From 5b5c1e16deaa3a9d6d0ed1ffca390655ed103df7 Mon Sep 17 00:00:00 2001
From: buli <137736985@qq.com>
Date: 星期五, 14 七月 2023 14:56:14 +0800
Subject: [PATCH] lex community
---
force-app/main/default/classes/LexCancelRemoveBoxControllerTest.cls | 567
force-app/main/default/classes/LexArriveGoodsMainControllerTest.cls | 126
force-app/main/default/lwc/lexCustomInventoryColor/lexCustomInventoryColor.html | 49
force-app/main/default/lwc/lexSaleAndDelivery/lexSaleAndDelivery.js | 2
force-app/main/default/lwc/lexTopPage/lexTopPage.js | 16
force-app/main/default/lwc/lexCustomLightningDatatable/lexCustomLightningDatatable.js | 86
force-app/main/default/classes/LexConsumableControllerTest.cls | 1889 -
force-app/main/default/classes/LexProductLimitEditControllerTest.cls | 77
force-app/main/default/classes/LexInventoryViewControllerTest.cls | 1360
force-app/main/default/lwc/lexArriveGoodsMain/lexArriveGoodsMain.html | 2
force-app/main/default/aura/NewAgencyOpportunity/NewAgencyOpportunityRenderer.js | 6
force-app/main/default/classes/LexConsumableGoodsInfoTest.cls | 1000
force-app/main/default/classes/LexArriveGoodsMainControllerTest.cls-meta.xml | 2
force-app/main/default/aura/CreateTarget/CreateTargetHelper.js | 792
force-app/main/default/lwc/paginator/paginator.html | 4
force-app/main/default/classes/LexOverdueStockControllerTest.cls-meta.xml | 2
force-app/main/default/lwc/customShipmentNumberComp/customShipmentNumberComp.js | 50
force-app/main/default/lwc/lexRemoveBox/lexRemoveBox.html | 354
force-app/main/default/aura/RetrospectiveWeeklyReport/RetrospectiveWeeklyReportHelper.js | 3168 +--
.sf/config.json | 5
force-app/main/default/classes/LexOutboundorderImportController.cls | 8
force-app/main/default/classes/LexInventoryControllerTest.cls | 1611 -
force-app/main/default/lwc/lexCancelRemoveBox/lexCancelRemoveBox.js | 413
force-app/main/default/classes/LexConInvoiceViewControllerTest.cls-meta.xml | 2
force-app/main/default/aura/WeeklyReport/WeeklyReport.cmp | 1147
force-app/main/default/classes/LexSummonsCreatControllerTest.cls | 1915 -
force-app/main/default/classes/LexConsumableGoodsInfoTest.cls-meta.xml | 2
force-app/main/default/lwc/lexLookup/lexLookup.html | 218
force-app/main/default/classes/LexSearchContractControllerTest.cls-meta.xml | 2
force-app/main/default/permissionsets/Community_Consumable_LEX_PS.permissionset-meta.xml | 6
force-app/main/default/classes/LexArriveGoodsMainController.cls | 443
force-app/main/default/classes/LexCancelRemoveBoxControllerTest.cls-meta.xml | 2
force-app/main/default/lwc/paginator/paginator.js | 15
force-app/main/default/lwc/customShippingUnitPriceComp/customShippingUnitPriceComp.js | 37
force-app/main/default/lwc/lexInventory/lexInventory.js | 1484
force-app/main/default/classes/LookupSearchResultTest.cls | 39
force-app/main/default/aura/RetrospectiveWeeklyReport/RetrospectiveWeeklyReport.cmp | 1258
force-app/main/default/aura/NewAgencyContact2/NewAgencyContact2.cmp-meta.xml | 5
force-app/main/default/lwc/lexSaleAndDelivery/lexSaleAndDelivery.html | 3
force-app/main/default/aura/NewAgencyOpportunity/NewAgencyOpportunityHelper.js | 425
force-app/main/default/aura/NewAgencyOpportunity/NewAgencyOpportunity.css | 46
force-app/main/default/aura/NewAgencyOpportunity/NewAgencyOpportunity.cmp-meta.xml | 2
force-app/main/default/classes/Batch_FixAttachmentToFilesTest.cls | 37
force-app/main/default/classes/LexInventoryViewControllerTest.cls-meta.xml | 2
force-app/main/default/classes/LexArriveGoodsControllerTest1.cls-meta.xml | 2
force-app/main/default/classes/LexSearchContractControllerTest.cls | 65
force-app/main/default/lwc/lexRemoveBox/lexRemoveBox.js | 463
force-app/main/default/lwc/lexArriveGsDetails/lexArriveGsDetails.js | 300
force-app/main/default/classes/LexSaleAndDeliveryControllerTest.cls-meta.xml | 2
force-app/main/default/classes/LexInventoryListController.cls | 85
force-app/main/default/classes/ResponseBodyLWCTest.cls | 6
force-app/main/default/aura/NewAgencyContact2/NewAgencyContact2Controller.js | 396
force-app/main/default/classes/LexArriveGoodsControllerTest.cls | 650
force-app/main/default/classes/LexSearchHospitalControllerTest.cls-meta.xml | 2
force-app/main/default/lwc/customMydrComp/customMydrComp.js | 8
force-app/main/default/classes/LexTopPageControllerTest.cls-meta.xml | 2
force-app/main/default/classes/LexConsumableOrderManageController.cls | 18
force-app/main/default/classes/LexSaleOrderController.cls | 16
force-app/main/default/classes/LexArriveGsDetailsControllerTest.cls-meta.xml | 2
force-app/main/default/classes/LexUpAccountProLimitControllerTest.cls | 171
force-app/main/default/classes/LexSaleOrderControllerTest.cls | 1246
force-app/main/default/lwc/lexCssUtility/lexCssUtility.css | 88
force-app/main/default/classes/LexLicenceReminderControllerTest.cls | 152
force-app/main/default/classes/LexConInvoiceViewControllerTest.cls | 3802 +--
force-app/main/default/classes/lexSearchAgencyHospitalControllerTest.cls | 87
force-app/main/default/lwc/lexConInvoiceView/lexConInvoiceView.css | 14
force-app/main/default/classes/LexInventoryController.cls | 20
force-app/main/default/classes/LexConInvoiceListTest.cls-meta.xml | 2
force-app/main/default/classes/LexConsumableOrderManageControllerTest.cls | 108
force-app/main/default/classes/LexConsumableController.cls | 74
force-app/main/default/lwc/customMydrComp/customMydrComp.html | 12
force-app/main/default/lwc/lexArriveGsDetails/lexArriveGsDetails.html | 141
force-app/main/default/pages/DealerInquiryModifyState.page | 1362
force-app/main/default/aura/CreateTarget/CreateTarget.css | 6
force-app/main/default/classes/DealerInquiryModifyStateControllerTest.cls | 98
force-app/main/default/lwc/customAccountUrlComp/customAccountUrlComp.html | 12
force-app/main/default/lwc/lexInventory/lexInventory.html | 306
force-app/main/default/lwc/lexCustomLightningDatatable/customdeleteReason.html | 6
force-app/main/default/classes/LexRemoveBoxControllerTest.cls | 539
force-app/main/default/aura/DealerPersonnelInformationImport/DealerPersonnelInformationImport.cmp | 167
force-app/main/default/lwc/lexArriveGoods/lexArriveGoods.css | 2
force-app/main/default/classes/LexConsumableAccountSOQL.cls | 37
force-app/main/default/aura/NewAgencyContact2/NewAgencyContact2.cmp | 71
force-app/main/default/lwc/lexSummonsCreat/lexSummonsCreat.css | 32
force-app/main/default/lwc/lexCustomLightningDatatable/customShipmentNumber.html | 13
force-app/main/default/lwc/lexConInvoiceView/lexConInvoiceView.html | 2
force-app/main/default/aura/AgencyAccount/AgencyAccount.css | 13
force-app/main/default/lwc/lexConsumableAccount/lexConsumableAccount.js | 63
force-app/main/default/triggers/ConsumableOrderDetail2Trigger.trigger-meta.xml | 2
force-app/main/default/lwc/lexinventoryViewLWC/lexinventoryViewLWC.css | 12
force-app/main/default/classes/LexConsumableControllerTest.cls-meta.xml | 2
force-app/main/default/aura/NewAgencyContact2/NewAgencyContact2.design | 3
force-app/main/default/lwc/lexArriveGoodsMain/lexArriveGoodsMain.js | 2
force-app/main/default/classes/LexUpAccountProLimitControllerTest.cls-meta.xml | 2
force-app/main/default/objects/LicenceReminderDate__c/LicenceReminderDate__c.object-meta.xml | 2
force-app/main/default/lwc/lexinventoryViewLWC/lexinventoryViewLWC.js | 6
force-app/main/default/lwc/lexOverdueStock/lexOverdueStock.html | 311
force-app/main/default/classes/LexProductLimitEditControllerTest.cls-meta.xml | 2
force-app/main/default/triggers/ContentDocumentTrigger.trigger | 7
force-app/main/default/classes/LexArriveGsDetailsControllerTest.cls | 154
force-app/main/default/aura/NewAgencyOpportunity/NewAgencyOpportunityController.js | 465
force-app/main/default/classes/Batch_FixAttachmentToFilesTest.cls-meta.xml | 2
force-app/main/default/classes/LexConInvoicedetailsController.cls | 8
force-app/main/default/lwc/lexOutboundorderImport/lexOutboundorderImport.html | 72
force-app/main/default/lwc/lexOverdueStock/lexOverdueStock.js | 693
force-app/main/default/classes/LexUtilityTest.cls-meta.xml | 2
force-app/main/default/aura/DealerPersonnelInformationImport/DealerPersonnelInformationImportController.js | 22
force-app/main/default/lwc/customShippingUnitPriceComp/customShippingUnitPriceComp.html | 19
force-app/main/default/aura/NewAgencyContact2/NewAgencyContact2.css | 15
force-app/main/default/aura/DealerPersonnelInformationImport/DealerPersonnelInformationImportHelper.js | 273
force-app/main/default/classes/LexLicenceReminderControllerTest.cls-meta.xml | 2
manifest/LEXC02packagelexcommunityupdate.xml | 4
force-app/main/default/objects/NoteStay__c/NoteStay__c.object-meta.xml | 2
force-app/main/default/classes/LookupSearchResultTest.cls-meta.xml | 2
force-app/main/default/lwc/customOutputGood/customOutputGood.html | 2
force-app/main/default/classes/LexArriveGoodsControllerTest.cls-meta.xml | 2
force-app/main/default/contentassets/OlympusCommunityLogo.asset-meta.xml | 2
force-app/main/default/aura/RetrospectiveWeeklyReport/RetrospectiveWeeklyReport.css | 6
force-app/main/default/classes/ArriveGoodsControllerTestV2.cls | 332
force-app/main/default/classes/LexSearchHospitalControllerTest.cls | 4
force-app/main/default/aura/NewAgencyOpportunity/NewAgencyOpportunity.cmp | 274
force-app/main/default/aura/NewAgencyContact2/NewAgencyContact2.auradoc | 6
force-app/main/default/aura/CreateTarget/CreateTarget.cmp-meta.xml | 2
force-app/main/default/lwc/lexCustomDiffReasonComp/lexCustomDiffReasonComp.html | 14
force-app/main/default/classes/ArriveGoodsControllerTestV2.cls-meta.xml | 2
force-app/main/default/classes/LexConsumableAccountControllerTest.cls | 332
force-app/main/default/lwc/lexArriveGoods/lexArriveGoods.js-meta.xml | 4
force-app/main/default/classes/LexArriveGsDetailsController.cls | 111
force-app/main/default/classes/LexInventoryListControllerTest.cls | 158
force-app/main/default/lwc/customDeleteReasonComp/customDeleteReasonComp.html | 8
force-app/main/default/lwc/customShipmentNumberComp/customShipmentNumberComp.html | 19
force-app/main/default/lwc/lexConsumableAccount/lexConsumableAccount.html | 3
force-app/main/default/classes/LexConsumableAccountSOQLTest.cls | 110
force-app/main/default/classes/LexConInvoiceListTest.cls | 169
manifest/LEXC03report2.xml | 9
force-app/main/default/objects/NoteStay__c/fields/IsStay__c.field-meta.xml | 2
force-app/main/default/pages/DealerInquiryModifyState.page-meta.xml | 2
force-app/main/default/classes/LexConInvoiceViewController.cls | 24
force-app/main/default/classes/LexInventoryListControllerTest.cls-meta.xml | 2
force-app/main/default/classes/LexSaleAndDeliveryControllerTest.cls | 90
force-app/main/default/aura/WeeklyReport/WeeklyReportController.js | 349
force-app/main/default/lwc/lexProductLimitEdit/lexProductLimitEdit.html | 137
force-app/main/default/classes/LexArriveGoodsController.cls-meta.xml | 2
force-app/main/default/classes/LexUtilityTest.cls | 8
force-app/main/default/classes/LexConsumableGoodsInfo.cls | 683
force-app/main/default/aura/AgencyAccount/AgencyAccount.cmp | 20
force-app/main/default/lwc/customMydrComp/customMydrComp.js-meta.xml | 4
force-app/main/default/objects/LicenceReminderDate__c/fields/ReminderDays__c.field-meta.xml | 2
force-app/main/default/lwc/lexCustomLightningDatatable/customMyDrCheckBox.html | 2
force-app/main/default/lwc/lexAgencyInfo/lexAgencyInfo.css | 8
force-app/main/default/lwc/customDeleteReasonComp/customDeleteReasonComp.js-meta.xml | 4
force-app/main/default/classes/LexInventoryViewController.cls | 52
force-app/main/default/classes/lexSearchAgencyHospitalControllerTest.cls-meta.xml | 2
force-app/main/default/classes/Batch_FixAttachmentToFiles.cls | 79
force-app/main/default/aura/WeeklyReport/WeeklyReport.css | 71
force-app/main/default/aura/RetrospectiveWeeklyReport/RetrospectiveWeeklyReportController.js | 198
force-app/main/default/classes/LexSummonsCreatController.cls | 184
force-app/main/default/classes/LexConsumableOrderManageControllerTest.cls-meta.xml | 2
force-app/main/default/classes/LexOverdueStockController.cls | 44
force-app/main/default/lwc/customAccountUrlComp/customAccountUrlComp.js | 10
force-app/main/default/lwc/lexSummonsCreat/lexSummonsCreat.js | 3101 +-
force-app/main/default/reports/Store_Custom_ReportLink/X2_Lky.report-meta.xml | 133
force-app/main/default/classes/LexConInvoicedetailsControllerTest.cls-meta.xml | 2
force-app/main/default/classes/LexOverdueStockControllerTest.cls | 345
force-app/main/default/lwc/lexConInvoiceView/lexConInvoiceView.js | 2
force-app/main/default/classes/LexConsumableAccountController.cls | 47
force-app/main/default/classes/ArriveGoodsController.cls | 5436 ++---
force-app/main/default/lwc/lexAgencyInfo/lexAgencyInfo.html | 183
force-app/main/default/classes/Batch_FixAttachmentToFiles.cls-meta.xml | 2
force-app/main/default/lwc/lexinventoryViewLWC/lexinventoryViewLWC.html | 5
force-app/main/default/classes/LexSaleOrderControllerTest.cls-meta.xml | 2
force-app/main/default/lwc/lexTopPage/lexTopPage.html | 2
force-app/main/default/classes/LexInventoryControllerTest.cls-meta.xml | 2
force-app/main/default/classes/DealerInquiryModifyStateController.cls | 113
force-app/main/default/lwc/customAccountUrlComp/customAccountUrlComp.js-meta.xml | 4
force-app/main/default/classes/LexUpAccountProLimit.cls | 130
force-app/main/default/aura/WeeklyReport/WeeklyReportHelper.js | 3258 +--
force-app/main/default/classes/LexConInvoicedetailsControllerTest.cls | 247
force-app/main/default/classes/LexConsumableAccountInfoControllerTest.cls-meta.xml | 2
force-app/main/default/classes/LexOutboundorderImportControllerTest.cls | 548
force-app/main/default/classes/LexCancelRemoveBoxController.cls | 824
force-app/main/default/classes/ResponseBodyLWCTest.cls-meta.xml | 2
force-app/main/default/lwc/lexOutboundorderImport/lexOutboundorderImport.js | 291
force-app/main/default/reports/Store_Custom_ReportLink/new_report_0iF.report-meta.xml | 142
force-app/main/default/classes/LexConsumableAccountSOQLTest.cls-meta.xml | 2
force-app/main/default/classes/LexRemoveBoxControllerTest.cls-meta.xml | 2
force-app/main/default/classes/LexTopPageControllerTest.cls | 610
force-app/main/default/classes/LexConsumableAccountControllerTest.cls-meta.xml | 2
force-app/main/default/lwc/lexProductLimitEdit/lexProductLimitEdit.js | 208
force-app/main/default/lwc/lexCancelRemoveBox/lexCancelRemoveBox.html | 355
force-app/main/default/classes/LexSummonsCreatControllerTest.cls-meta.xml | 2
force-app/main/default/classes/LexArriveGoodsControllerTest1.cls | 323
force-app/main/default/lwc/lexArriveGoods/lexArriveGoods.html | 14
force-app/main/default/aura/NewAgencyContact2/NewAgencyContact2Helper.js | 56
force-app/main/default/lwc/lexArriveGoods/lexArriveGoods.js | 2
force-app/main/default/classes/LexOutboundorderImportControllerTest.cls-meta.xml | 2
force-app/main/default/contentassets/OlympusCommunityLoginBG.asset-meta.xml | 2
force-app/main/default/triggers/ConsumableOrderDetail2Trigger.trigger | 525
force-app/main/default/classes/LexConsumableAccountInfoControllerTest.cls | 17
force-app/main/default/lwc/lexConsumableOrderManage/lexConsumableOrderManage.html | 175
force-app/main/default/aura/NewAgencyContact2/NewAgencyContact2.svg | 7
force-app/main/default/lwc/lexConsumable/lexConsumable.js | 6
force-app/main/default/lwc/lexInventory/lexInventory.css | 20
force-app/main/default/lwc/lexConsumable/lexConsumable.html | 4
force-app/main/default/lwc/lexSummonsCreat/lexSummonsCreat.html | 1679 -
manifest/packageForLex copy.xml | 18
force-app/main/default/triggers/ContentDocumentLink.trigger | 12
force-app/main/default/classes/ArriveGoodsControllerTest.cls | 1734 -
force-app/main/default/classes/LexArriveGoodsController.cls | 57
force-app/main/default/aura/CreateTarget/CreateTarget.cmp | 1229
force-app/main/default/lwc/customDeleteReasonComp/customDeleteReasonComp.js | 2
force-app/main/default/lwc/lexCustomLightningDatatable/customaccountUrl.html | 2
force-app/main/default/aura/NewAgencyContact2/NewAgencyContact2Renderer.js | 5
213 files changed, 21,244 insertions(+), 35,629 deletions(-)
diff --git a/.sf/config.json b/.sf/config.json
index 9e6a1d3..ce048d6 100644
--- a/.sf/config.json
+++ b/.sf/config.json
@@ -1,3 +1,6 @@
+<<<<<<< HEAD
+=======
{
- "target-org": "OlympusStageEnv"
+ "target-org": "OlympusStageEnv"
}
+>>>>>>> LEXCommunityLiJun
diff --git a/force-app/main/default/aura/AgencyAccount/AgencyAccount.cmp b/force-app/main/default/aura/AgencyAccount/AgencyAccount.cmp
index 486b5df..ad1a5d5 100644
--- a/force-app/main/default/aura/AgencyAccount/AgencyAccount.cmp
+++ b/force-app/main/default/aura/AgencyAccount/AgencyAccount.cmp
@@ -12,13 +12,16 @@
<ltng:require scripts="{! $Resource.jquery183minjs }" />
<ltng:require scripts="{! $Resource.AWSService+'/AWSService.js' }" afterScriptsLoaded="{!c.scriptsLoaded}" />
<aura:renderIf isTrue="{!v.login}">
- <div class="slds-spinner_container height100vh">
- <div class="slds-spinner--brand slds-spinner slds-spinner--medium" role="alert">
- <span class="slds-assistive-text">Loading</span>
- <div class="slds-spinner__dot-a"></div>
- <div class="slds-spinner__dot-b"></div>
- </div>
- </div>
+ <!-- add by Deloitte-Link 2023-6-19 -->
+ <div class="weeklyReportSpinner">
+ <div class="slds-spinner_container">
+ <div class="slds-spinner--brand slds-spinner slds-spinner--medium" role="alert">
+ <span id="aa" class="slds-assistive-text">Loading</span>
+ <div class="slds-spinner__dot-a"></div>
+ <div class="slds-spinner__dot-b"></div>
+ </div>
+ </div>
+ </div>
</aura:renderIf>
<form class="slds-form--inline">
<div class="slds-form-element">
@@ -77,7 +80,8 @@
<div class="slds-truncate">
<a href="{!'/partner/s/agency-contact/' + item.Id}" style="position: relative;">
- {!item.Name}
+ <span class="encrypt">{!item.Name}</span>
+ <span class="decrypt">{!item.awsdata.name}</span>
</a>
</div>
</th>
diff --git a/force-app/main/default/aura/AgencyAccount/AgencyAccount.css b/force-app/main/default/aura/AgencyAccount/AgencyAccount.css
index c5abf53..b5a3e56 100644
--- a/force-app/main/default/aura/AgencyAccount/AgencyAccount.css
+++ b/force-app/main/default/aura/AgencyAccount/AgencyAccount.css
@@ -18,4 +18,15 @@
.THIS tr:hover .encrypt{
display: none;
-}
\ No newline at end of file
+}
+
+/* add by Deloitte-Link 2023-6-19 start*/
+.THIS .weeklyReportSpinner{
+ top:100px;
+}
+
+.THIS .slds-spinner_container{
+ position: absolute;
+ top:100px;
+}
+/* add by Deloitte-Link 2023-6-19 end*/
\ No newline at end of file
diff --git a/force-app/main/default/aura/CreateTarget/CreateTarget.cmp b/force-app/main/default/aura/CreateTarget/CreateTarget.cmp
index 225f3e3..a3de553 100644
--- a/force-app/main/default/aura/CreateTarget/CreateTarget.cmp
+++ b/force-app/main/default/aura/CreateTarget/CreateTarget.cmp
@@ -1,926 +1,321 @@
-<aura:component
- controller="CreateTargetCmp"
- implements="force:appHostable,flexipage:availableForAllPageTypes,flexipage:availableForRecordHome,force:hasRecordId,force:lightningQuickAction,forceCommunity:availableForAllPageTypes"
- access="global"
->
- <aura:handler name="init" value="{!this}" action="{!c.doInit}" />
- <aura:attribute name="recordId" type="Id" />
- <aura:attribute name="hospital" type="string" default="" />
- <aura:attribute name="test" type="string" default="1" />
- <aura:handler event="force:refreshView" action="{!c.isRefreshed}" />
- <aura:attribute name="hospitalId" type="string" default="" />
- <aura:attribute name="GIAmount" type="string" default="0.00" />
- <aura:attribute name="BFAmount" type="string" default="0.00" />
- <aura:attribute name="ETAmount" type="string" default="0.00" />
- <aura:attribute name="GSAmount" type="string" default="0.00" />
- <aura:attribute name="UROAmount" type="string" default="0.00" />
- <aura:attribute name="GYNAmount" type="string" default="0.00" />
- <aura:attribute name="ENTAmount" type="string" default="0.00" />
- <aura:attribute name="OTHAmount" type="string" default="0.00" />
- <aura:attribute name="OCMTerm" type="string" default="" />
- <aura:attribute name="button_text" type="string" default="鏂板缓" />
- <aura:handler
- name="change"
- value="{!v.record.Agency_Hospital__c}"
- action="{!c.hosChange}"
- />
- <aura:attribute name="hospitalList" type="sobject[]" />
- <aura:attribute
- name="record"
- type="Agency_Opportunity__c"
- default="{'sobjectType':'Agency_Opportunity__c'}"
- />
- <aura:handler
- name="change"
- value="{!v.recordET.Product_Category1__c}"
- action="{!c.productcategoryETChange1}"
- />
- <aura:handler
- name="change"
- value="{!v.recordET.Product_Category2__c}"
- action="{!c.productcategoryETChange2}"
- />
- <aura:handler
- name="change"
- value="{!v.recordET.Product_Category3__c}"
- action="{!c.productcategoryETChange3}"
- />
+<aura:component controller="CreateTargetCmp" implements="force:appHostable,flexipage:availableForAllPageTypes,flexipage:availableForRecordHome,force:hasRecordId,force:lightningQuickAction,forceCommunity:availableForAllPageTypes" access="global" >
+ <aura:handler name="init" value="{!this}" action="{!c.doInit}"/>
+ <aura:attribute name="recordId" type="Id" />
+ <aura:attribute name="hospital" type="string" default=""/>
+ <aura:attribute name="test" type="string" default="1"/>
+ <aura:handler event="force:refreshView" action="{!c.isRefreshed}" />
+ <aura:attribute name="hospitalId" type="string" default=""/>
+ <aura:attribute name="GIAmount" type="string" default="0.00"/>
+ <aura:attribute name="BFAmount" type="string" default="0.00"/>
+ <aura:attribute name="ETAmount" type="string" default="0.00"/>
+ <aura:attribute name="GSAmount" type="string" default="0.00"/>
+ <aura:attribute name="UROAmount" type="string" default="0.00"/>
+ <aura:attribute name="GYNAmount" type="string" default="0.00"/>
+ <aura:attribute name="ENTAmount" type="string" default="0.00"/>
+ <aura:attribute name="OTHAmount" type="string" default="0.00"/>
+ <aura:attribute name="OCMTerm" type="string" default=""/>
+ <aura:attribute name="button_text" type="string" default="鏂板缓"/>
+ <aura:handler name="change" value="{!v.record.Agency_Hospital__c}" action="{!c.hosChange}"/>
+ <aura:attribute name="hospitalList" type="sobject[]" />
+ <aura:attribute name="record" type="Agency_Opportunity__c" default="{'sobjectType':'Agency_Opportunity__c'}"/>
+ <aura:handler name="change" value="{!v.recordET.Product_Category1__c}" action="{!c.productcategoryETChange1}"/>
+ <aura:handler name="change" value="{!v.recordET.Product_Category2__c}" action="{!c.productcategoryETChange2}"/>
+ <aura:handler name="change" value="{!v.recordET.Product_Category3__c}" action="{!c.productcategoryETChange3}"/>
+
- <aura:handler
- name="change"
- value="{!v.recordBF.Product_Category1__c}"
- action="{!c.productcategoryBFChange1}"
- />
- <aura:handler
- name="change"
- value="{!v.recordBF.Product_Category2__c}"
- action="{!c.productcategoryBFChange2}"
- />
- <aura:handler
- name="change"
- value="{!v.recordBF.Product_Category3__c}"
- action="{!c.productcategoryBFChange3}"
- />
- <aura:handler
- name="change"
- value="{!v.recordGS.Product_Category1__c}"
- action="{!c.productcategoryGSChange1}"
- />
- <aura:handler
- name="change"
- value="{!v.recordGS.Product_Category2__c}"
- action="{!c.productcategoryGSChange2}"
- />
- <aura:handler
- name="change"
- value="{!v.recordGS.Product_Category3__c}"
- action="{!c.productcategoryGSChange3}"
- />
- <aura:handler
- name="change"
- value="{!v.recordURO.Product_Category1__c}"
- action="{!c.productcategoryUROChange1}"
- />
- <aura:handler
- name="change"
- value="{!v.recordURO.Product_Category2__c}"
- action="{!c.productcategoryUROChange2}"
- />
- <aura:handler
- name="change"
- value="{!v.recordURO.Product_Category3__c}"
- action="{!c.productcategoryUROChange3}"
- />
- <aura:handler
- name="change"
- value="{!v.recordGYN.Product_Category1__c}"
- action="{!c.productcategoryGYNChange1}"
- />
- <aura:handler
- name="change"
- value="{!v.recordGYN.Product_Category2__c}"
- action="{!c.productcategoryGYNChange2}"
- />
- <aura:handler
- name="change"
- value="{!v.recordGYN.Product_Category3__c}"
- action="{!c.productcategoryGYNChange3}"
- />
- <aura:handler
- name="change"
- value="{!v.recordENT.Product_Category1__c}"
- action="{!c.productcategoryENTChange1}"
- />
- <aura:handler
- name="change"
- value="{!v.recordENT.Product_Category2__c}"
- action="{!c.productcategoryENTChange2}"
- />
- <aura:handler
- name="change"
- value="{!v.recordENT.Product_Category3__c}"
- action="{!c.productcategoryENTChange3}"
- />
- <aura:handler
- name="change"
- value="{!v.recordOTH.Product_Category1__c}"
- action="{!c.productcategoryOTHChange1}"
- />
- <aura:handler
- name="change"
- value="{!v.recordOTH.Product_Category2__c}"
- action="{!c.productcategoryOTHChange2}"
- />
- <aura:handler
- name="change"
- value="{!v.recordOTH.Product_Category3__c}"
- action="{!c.productcategoryOTHChange3}"
- />
- <div class="button_area">
- <ui:button label="{!v.button_text}" press="{!c.toggle_report}" />
+ <aura:handler name="change" value="{!v.recordBF.Product_Category1__c}" action="{!c.productcategoryBFChange1}"/>
+ <aura:handler name="change" value="{!v.recordBF.Product_Category2__c}" action="{!c.productcategoryBFChange2}"/>
+ <aura:handler name="change" value="{!v.recordBF.Product_Category3__c}" action="{!c.productcategoryBFChange3}"/>
+ <aura:handler name="change" value="{!v.recordGS.Product_Category1__c}" action="{!c.productcategoryGSChange1}"/>
+ <aura:handler name="change" value="{!v.recordGS.Product_Category2__c}" action="{!c.productcategoryGSChange2}"/>
+ <aura:handler name="change" value="{!v.recordGS.Product_Category3__c}" action="{!c.productcategoryGSChange3}"/>
+ <aura:handler name="change" value="{!v.recordURO.Product_Category1__c}" action="{!c.productcategoryUROChange1}"/>
+ <aura:handler name="change" value="{!v.recordURO.Product_Category2__c}" action="{!c.productcategoryUROChange2}"/>
+ <aura:handler name="change" value="{!v.recordURO.Product_Category3__c}" action="{!c.productcategoryUROChange3}"/>
+ <aura:handler name="change" value="{!v.recordGYN.Product_Category1__c}" action="{!c.productcategoryGYNChange1}"/>
+ <aura:handler name="change" value="{!v.recordGYN.Product_Category2__c}" action="{!c.productcategoryGYNChange2}"/>
+ <aura:handler name="change" value="{!v.recordGYN.Product_Category3__c}" action="{!c.productcategoryGYNChange3}"/>
+ <aura:handler name="change" value="{!v.recordENT.Product_Category1__c}" action="{!c.productcategoryENTChange1}"/>
+ <aura:handler name="change" value="{!v.recordENT.Product_Category2__c}" action="{!c.productcategoryENTChange2}"/>
+ <aura:handler name="change" value="{!v.recordENT.Product_Category3__c}" action="{!c.productcategoryENTChange3}"/>
+ <aura:handler name="change" value="{!v.recordOTH.Product_Category1__c}" action="{!c.productcategoryOTHChange1}"/>
+ <aura:handler name="change" value="{!v.recordOTH.Product_Category2__c}" action="{!c.productcategoryOTHChange2}"/>
+ <aura:handler name="change" value="{!v.recordOTH.Product_Category3__c}" action="{!c.productcategoryOTHChange3}"/>
+ <div class="button_area">
+ <ui:button label="{!v.button_text}" press="{!c.toggle_report}"/>
</div>
- <div
- aura:id="modal_window"
- role="dialog"
- tabindex="-1"
- class="disp_none slds-modal slds-fade-in-open slds-modal--large"
- aria-labelledby="headerTarget"
- >
- <div class="slds-modal__container">
- <div class="slds-modal__header">
- <button
- class="slds-button slds-modal__close slds-button--icon-inverse"
- title="Close"
- onclick="{!c.toggle_report}"
- >
- <lightning:icon
- iconName="utility:close"
- size="medium"
- alternative-text="close"
- variant="inverse"
- />
- <span class="slds-assistive-text">Close</span>
- </button>
- <h2 id="headerTarget" class="slds-text-heading--medium">
- 鐩爣({!v.OCMTerm})
- </h2>
- </div>
- <div class="slds-modal__content slds-grow slds-p-around--medium">
- <div class="slds-box slds-theme--shade">
- <fieldset class="slds-form--compound">
- <div class="slds-form-element__group">
- <div class="slds-form-element__row">
- <div
- class="slds-form-element slds-size--1-of-2"
- >
- <label
- class="slds-form-element__label"
- for="input-hos"
- >鍖婚櫌</label
- >
- <!-- <force:inputField value="{!v.record.Agency_Hospital__c}" aura:id="input-hos"/> -->
- <lightning:recordEditForm
- objectApiName="Agency_Opportunity__c"
- >
- <lightning:inputField
- variant="label-hidden"
- fieldName="Agency_Hospital__c"
- value="{!v.record.Agency_Hospital__c}"
- aura:id="input-hos"
- />
- </lightning:recordEditForm>
- </div>
- </div>
- <!-- <h4 class="slds-section__title">璁块棶鐩爣</h4>
+ <div aura:id="modal_window" role="dialog" tabindex="-1" class="disp_none slds-modal slds-fade-in-open slds-modal--large" aria-labelledby="headerTarget">
+ <div class="slds-modal__container">
+ <div class="slds-modal__header">
+ <button class="slds-button slds-modal__close slds-button--icon-inverse" title="Close" onclick="{!c.toggle_report}">
+ <lightning:icon iconName="utility:close" size="medium" alternative-text="close" variant="inverse"/>
+ <span class="slds-assistive-text">Close</span>
+ </button>
+ <h2 id="headerTarget" class="slds-text-heading--medium">鐩爣({!v.OCMTerm})</h2>
+ </div>
+ <div class="slds-modal__content slds-grow slds-p-around--medium">
+ <div class="slds-box slds-theme--shade ">
+ <fieldset class="slds-form--compound">
+ <div class="slds-form-element__group">
+ <div class="slds-form-element__row">
+ <div class="slds-form-element slds-size--1-of-2">
+ <label class="slds-form-element__label" for="input-hos">鍖婚櫌</label>
+ <!-- <force:inputField value="{!v.record.Agency_Hospital__c}" aura:id="input-hos"/> -->
+ <lightning:recordEditForm objectApiName="Agency_Opportunity__c">
+ <lightning:inputField variant="label-hidden" fieldName="Agency_Hospital__c" value="{!v.record.Agency_Hospital__c}" aura:id="input-hos"/>
+ </lightning:recordEditForm>
+ </div>
+ </div>
+ <!-- <h4 class="slds-section__title">璁块棶鐩爣</h4>
<div class="slds-form-element__row">
<div class="slds-form-element slds-size-1-of-2">
<label class="slds-form-element__label" for="input-target">鐩爣鍖婚櫌</label>
<force:inputField value="{!v.record2.TargetHospital__c}" aura:id="input-target"/>
</div>
</div> -->
- <h4 class="slds-section__title">浜у搧鐩爣</h4>
- <div class="slds-form-element__row">
- <div
- class="slds-size--1-of-7 slds-grid--align-center"
- >
- <div style="margin-top: 32px">娑堝寲绉�</div>
- </div>
- <div
- class="slds-form-element slds-size--1-of-7"
- >
- <label
- class="slds-form-element__label"
- for="input-hos"
- >浜у搧鍖哄垎1</label
- >
- <ui:inputSelect
- aura:id="select_GI1"
- class="slds-select"
- change="{!c.productcategoryGIChange1}"
- />
- </div>
- <div
- class="slds-form-element slds-size--1-of-7"
- >
- <label
- class="slds-form-element__label"
- for="input-hos"
- >閲戦鐩爣(涓嶅惈绋�)</label
- >
- <ui:inputText
- aura:id="select_GI4_1"
- class="slds-select"
- />
- </div>
- <div
- class="slds-form-element slds-size--1-of-7"
- >
- <label
- class="slds-form-element__label"
- for="input-hos"
- >浜у搧鍖哄垎2</label
- >
- <ui:inputSelect
- aura:id="select_GI2"
- class="slds-select"
- change="{!c.productcategoryGIChange2}"
- />
- </div>
- <div
- class="slds-form-element slds-size--1-of-7"
- >
- <label
- class="slds-form-element__label"
- for="input-hos"
- >閲戦鐩爣(涓嶅惈绋�)</label
- >
- <ui:inputText
- aura:id="select_GI4_2"
- class="slds-select"
- />
- </div>
- <div
- class="slds-form-element slds-size--1-of-7"
- >
- <label
- class="slds-form-element__label"
- for="input-hos"
- >浜у搧鍖哄垎3</label
- >
- <ui:inputSelect
- aura:id="select_GI3"
- class="slds-select"
- change="{!c.productcategoryGIChange3}"
- />
- </div>
- <div
- class="slds-form-element slds-size--1-of-7"
- >
- <label
- class="slds-form-element__label"
- for="input-hos"
- >閲戦鐩爣(涓嶅惈绋�)</label
- >
- <ui:inputText
- aura:id="select_GI4_3"
- class="slds-select"
- />
- </div>
- </div>
- <div class="slds-form-element__row">
- <div
- class="slds-size--1-of-7 slds-grid--align-center"
- >
- <div style="margin-top: 32px">ET鑰楁潗</div>
- </div>
- <div
- class="slds-form-element slds-size--1-of-7"
- >
- <label
- class="slds-form-element__label"
- for="input-hos"
- >浜у搧鍖哄垎1</label
- >
- <ui:inputSelect
- aura:id="select_ET1"
- class="slds-select"
- change="{!c.productcategoryETChange1}"
- />
- </div>
- <div
- class="slds-form-element slds-size--1-of-7"
- >
- <label
- class="slds-form-element__label"
- for="input-hos"
- >閲戦鐩爣(涓嶅惈绋�)</label
- >
- <ui:inputText
- aura:id="select_ET4_1"
- class="slds-select"
- />
- </div>
- <div
- class="slds-form-element slds-size--1-of-7"
- >
- <label
- class="slds-form-element__label"
- for="input-hos"
- >浜у搧鍖哄垎2</label
- >
- <ui:inputSelect
- aura:id="select_ET2"
- class="slds-select"
- change="{!c.productcategoryETChange2}"
- />
- </div>
- <div
- class="slds-form-element slds-size--1-of-7"
- >
- <label
- class="slds-form-element__label"
- for="input-hos"
- >閲戦鐩爣(涓嶅惈绋�)</label
- >
- <ui:inputText
- aura:id="select_ET4_2"
- class="slds-select"
- />
- </div>
- <div
- class="slds-form-element slds-size--1-of-7"
- >
- <label
- class="slds-form-element__label"
- for="input-hos"
- >浜у搧鍖哄垎3</label
- >
- <ui:inputSelect
- aura:id="select_ET3"
- class="slds-select"
- change="{!c.productcategoryETChange3}"
- />
- </div>
- <div
- class="slds-form-element slds-size--1-of-7"
- >
- <label
- class="slds-form-element__label"
- for="input-hos"
- >閲戦鐩爣(涓嶅惈绋�)</label
- >
- <ui:inputText
- aura:id="select_ET4_3"
- class="slds-select"
- />
- </div>
- </div>
- <div class="slds-form-element__row">
- <div
- class="slds-size--1-of-7 slds-grid--align-center"
- >
- <div style="margin-top: 32px">鍛煎惛绉�</div>
- </div>
- <div
- class="slds-form-element slds-size--1-of-7"
- >
- <label
- class="slds-form-element__label"
- for="input-hos"
- >浜у搧鍖哄垎1</label
- >
- <ui:inputSelect
- aura:id="select_BF1"
- class="slds-select"
- change="{!c.productcategoryBFChange1}"
- />
- </div>
- <div
- class="slds-form-element slds-size--1-of-7"
- >
- <label
- class="slds-form-element__label"
- for="input-hos"
- >閲戦鐩爣(涓嶅惈绋�)</label
- >
- <ui:inputText
- aura:id="select_BF4_1"
- class="slds-select"
- />
- </div>
- <div
- class="slds-form-element slds-size--1-of-7"
- >
- <label
- class="slds-form-element__label"
- for="input-hos"
- >浜у搧鍖哄垎2</label
- >
- <ui:inputSelect
- aura:id="select_BF2"
- class="slds-select"
- change="{!c.productcategoryBFChange2}"
- />
- </div>
- <div
- class="slds-form-element slds-size--1-of-7"
- >
- <label
- class="slds-form-element__label"
- for="input-hos"
- >閲戦鐩爣(涓嶅惈绋�)</label
- >
- <ui:inputText
- aura:id="select_BF4_2"
- class="slds-select"
- />
- </div>
- <div
- class="slds-form-element slds-size--1-of-7"
- >
- <label
- class="slds-form-element__label"
- for="input-hos"
- >浜у搧鍖哄垎3</label
- >
- <ui:inputSelect
- aura:id="select_BF3"
- class="slds-select"
- change="{!c.productcategoryBFChange3}"
- />
- </div>
- <div
- class="slds-form-element slds-size--1-of-7"
- >
- <label
- class="slds-form-element__label"
- for="input-hos"
- >閲戦鐩爣(涓嶅惈绋�)</label
- >
- <ui:inputText
- aura:id="select_BF4_3"
- class="slds-select"
- />
- </div>
- </div>
- <div class="slds-form-element__row">
- <div
- class="slds-size--1-of-7 slds-grid--align-center"
- >
- <div style="margin-top: 32px">鏅绉�</div>
- </div>
- <div
- class="slds-form-element slds-size--1-of-7"
- >
- <label
- class="slds-form-element__label"
- for="input-hos"
- >浜у搧鍖哄垎1</label
- >
- <ui:inputSelect
- aura:id="select_GS1"
- class="slds-select"
- change="{!c.productcategoryGSChange1}"
- />
- </div>
- <div
- class="slds-form-element slds-size--1-of-7"
- >
- <label
- class="slds-form-element__label"
- for="input-hos"
- >閲戦鐩爣(涓嶅惈绋�)</label
- >
- <ui:inputText
- aura:id="select_GS4_1"
- class="slds-select"
- />
- </div>
- <div
- class="slds-form-element slds-size--1-of-7"
- >
- <label
- class="slds-form-element__label"
- for="input-hos"
- >浜у搧鍖哄垎2</label
- >
- <ui:inputSelect
- aura:id="select_GS2"
- class="slds-select"
- change="{!c.productcategoryGSChange2}"
- />
- </div>
- <div
- class="slds-form-element slds-size--1-of-7"
- >
- <label
- class="slds-form-element__label"
- for="input-hos"
- >閲戦鐩爣(涓嶅惈绋�)</label
- >
- <ui:inputText
- aura:id="select_GS4_2"
- class="slds-select"
- />
- </div>
- <div
- class="slds-form-element slds-size--1-of-7"
- >
- <label
- class="slds-form-element__label"
- for="input-hos"
- >浜у搧鍖哄垎3</label
- >
- <ui:inputSelect
- aura:id="select_GS3"
- class="slds-select"
- change="{!c.productcategoryGSChange3}"
- />
- </div>
- <div
- class="slds-form-element slds-size--1-of-7"
- >
- <label
- class="slds-form-element__label"
- for="input-hos"
- >閲戦鐩爣(涓嶅惈绋�)</label
- >
- <ui:inputText
- aura:id="select_GS4_3"
- class="slds-select"
- />
- </div>
- </div>
- <div class="slds-form-element__row">
- <div
- class="slds-size--1-of-7 slds-grid--align-center"
- >
- <div style="margin-top: 32px">娉屽翱绉�</div>
- </div>
- <div
- class="slds-form-element slds-size--1-of-7"
- >
- <label
- class="slds-form-element__label"
- for="input-hos"
- >浜у搧鍖哄垎1</label
- >
- <ui:inputSelect
- aura:id="select_URO1"
- class="slds-select"
- change="{!c.productcategoryUROChange1}"
- />
- </div>
- <div
- class="slds-form-element slds-size--1-of-7"
- >
- <label
- class="slds-form-element__label"
- for="input-hos"
- >閲戦鐩爣(涓嶅惈绋�)</label
- >
- <ui:inputText
- aura:id="select_URO4_1"
- class="slds-select"
- />
- </div>
- <div
- class="slds-form-element slds-size--1-of-7"
- >
- <label
- class="slds-form-element__label"
- for="input-hos"
- >浜у搧鍖哄垎2</label
- >
- <ui:inputSelect
- aura:id="select_URO2"
- class="slds-select"
- change="{!c.productcategoryUROChange2}"
- />
- </div>
- <div
- class="slds-form-element slds-size--1-of-7"
- >
- <label
- class="slds-form-element__label"
- for="input-hos"
- >閲戦鐩爣(涓嶅惈绋�)</label
- >
- <ui:inputText
- aura:id="select_URO4_2"
- class="slds-select"
- />
- </div>
- <div
- class="slds-form-element slds-size--1-of-7"
- >
- <label
- class="slds-form-element__label"
- for="input-hos"
- >浜у搧鍖哄垎3</label
- >
- <ui:inputSelect
- aura:id="select_URO3"
- class="slds-select"
- change="{!c.productcategoryUROChange3}"
- />
- </div>
- <div
- class="slds-form-element slds-size--1-of-7"
- >
- <label
- class="slds-form-element__label"
- for="input-hos"
- >閲戦鐩爣(涓嶅惈绋�)</label
- >
- <ui:inputText
- aura:id="select_URO4_3"
- class="slds-select"
- />
- </div>
- </div>
- <div class="slds-form-element__row">
- <div
- class="slds-size--1-of-7 slds-grid--align-center"
- >
- <div style="margin-top: 32px">濡囩</div>
- </div>
- <div
- class="slds-form-element slds-size--1-of-7"
- >
- <label
- class="slds-form-element__label"
- for="input-hos"
- >浜у搧鍖哄垎1</label
- >
- <ui:inputSelect
- aura:id="select_GYN1"
- class="slds-select"
- change="{!c.productcategoryGYNChange1}"
- />
- </div>
- <div
- class="slds-form-element slds-size--1-of-7"
- >
- <label
- class="slds-form-element__label"
- for="input-hos"
- >閲戦鐩爣(涓嶅惈绋�)</label
- >
- <ui:inputText
- aura:id="select_GYN4_1"
- class="slds-select"
- />
- </div>
- <div
- class="slds-form-element slds-size--1-of-7"
- >
- <label
- class="slds-form-element__label"
- for="input-hos"
- >浜у搧鍖哄垎2</label
- >
- <ui:inputSelect
- aura:id="select_GYN2"
- class="slds-select"
- change="{!c.productcategoryGYNChange2}"
- />
- </div>
- <div
- class="slds-form-element slds-size--1-of-7"
- >
- <label
- class="slds-form-element__label"
- for="input-hos"
- >閲戦鐩爣(涓嶅惈绋�)</label
- >
- <ui:inputText
- aura:id="select_GYN4_2"
- class="slds-select"
- />
- </div>
- <div
- class="slds-form-element slds-size--1-of-7"
- >
- <label
- class="slds-form-element__label"
- for="input-hos"
- >浜у搧鍖哄垎3</label
- >
- <ui:inputSelect
- aura:id="select_GYN3"
- class="slds-select"
- change="{!c.productcategoryGYNChange3}"
- />
- </div>
- <div
- class="slds-form-element slds-size--1-of-7"
- >
- <label
- class="slds-form-element__label"
- for="input-hos"
- >閲戦鐩爣(涓嶅惈绋�)</label
- >
- <ui:inputText
- aura:id="select_GYN4_3"
- class="slds-select"
- />
- </div>
- </div>
- <div class="slds-form-element__row">
- <div
- class="slds-size--1-of-7 slds-grid--align-center"
- >
- <div style="margin-top: 32px">鑰抽蓟鍠夌</div>
- </div>
- <div
- class="slds-form-element slds-size--1-of-7"
- >
- <label
- class="slds-form-element__label"
- for="input-hos"
- >浜у搧鍖哄垎1</label
- >
- <ui:inputSelect
- aura:id="select_ENT1"
- class="slds-select"
- change="{!c.productcategoryENTChange1}"
- />
- </div>
- <div
- class="slds-form-element slds-size--1-of-7"
- >
- <label
- class="slds-form-element__label"
- for="input-hos"
- >閲戦鐩爣(涓嶅惈绋�)</label
- >
- <ui:inputText
- aura:id="select_ENT4_1"
- class="slds-select"
- />
- </div>
- <div
- class="slds-form-element slds-size--1-of-7"
- >
- <label
- class="slds-form-element__label"
- for="input-hos"
- >浜у搧鍖哄垎2</label
- >
- <ui:inputSelect
- aura:id="select_ENT2"
- class="slds-select"
- change="{!c.productcategoryENTChange2}"
- />
- </div>
- <div
- class="slds-form-element slds-size--1-of-7"
- >
- <label
- class="slds-form-element__label"
- for="input-hos"
- >閲戦鐩爣(涓嶅惈绋�)</label
- >
- <ui:inputText
- aura:id="select_ENT4_2"
- class="slds-select"
- />
- </div>
- <div
- class="slds-form-element slds-size--1-of-7"
- >
- <label
- class="slds-form-element__label"
- for="input-hos"
- >浜у搧鍖哄垎3</label
- >
- <ui:inputSelect
- aura:id="select_ENT3"
- class="slds-select"
- change="{!c.productcategoryENTChange3}"
- />
- </div>
- <div
- class="slds-form-element slds-size--1-of-7"
- >
- <label
- class="slds-form-element__label"
- for="input-hos"
- >閲戦鐩爣(涓嶅惈绋�)</label
- >
- <ui:inputText
- aura:id="select_ENT4_3"
- class="slds-select"
- />
- </div>
- </div>
- <div class="slds-form-element__row">
- <div
- class="slds-size--1-of-7 slds-grid--align-center"
- >
- <div style="margin-top: 32px">鍏朵粬</div>
- </div>
- <div
- class="slds-form-element slds-size--1-of-7"
- >
- <label
- class="slds-form-element__label"
- for="input-hos"
- >浜у搧鍖哄垎1</label
- >
- <ui:inputSelect
- aura:id="select_OTH1"
- class="slds-select"
- change="{!c.productcategoryOTHChange1}"
- />
- </div>
- <div
- class="slds-form-element slds-size--1-of-7"
- >
- <label
- class="slds-form-element__label"
- for="input-hos"
- >閲戦鐩爣(涓嶅惈绋�)</label
- >
- <ui:inputText
- aura:id="select_OTH4_1"
- class="slds-select"
- />
- </div>
- <div
- class="slds-form-element slds-size--1-of-7"
- >
- <label
- class="slds-form-element__label"
- for="input-hos"
- >浜у搧鍖哄垎2</label
- >
- <ui:inputSelect
- aura:id="select_OTH2"
- class="slds-select"
- change="{!c.productcategoryOTHChange2}"
- />
- </div>
- <div
- class="slds-form-element slds-size--1-of-7"
- >
- <label
- class="slds-form-element__label"
- for="input-hos"
- >閲戦鐩爣(涓嶅惈绋�)</label
- >
- <ui:inputText
- aura:id="select_OTH4_2"
- class="slds-select"
- />
- </div>
- <div
- class="slds-form-element slds-size--1-of-7"
- >
- <label
- class="slds-form-element__label"
- for="input-hos"
- >浜у搧鍖哄垎3</label
- >
- <ui:inputSelect
- aura:id="select_OTH3"
- class="slds-select"
- change="{!c.productcategoryOTHChange3}"
- />
- </div>
- <div
- class="slds-form-element slds-size--1-of-7"
- >
- <label
- class="slds-form-element__label"
- for="input-hos"
- >閲戦鐩爣(涓嶅惈绋�)</label
- >
- <ui:inputText
- aura:id="select_OTH4_3"
- class="slds-select"
- />
- </div>
- </div>
- </div>
- </fieldset>
- </div>
- </div>
- <div class="slds-modal__footer slds-grid slds-grid--align-spread">
- <div class="slds-order--1" />
- <ui:button
- aura:id="save_button"
- label="淇濆瓨"
- class="slds-button slds-button--brand slds-order--2"
- press="{!c.createTarget}"
- />
- <div class="slds-order--3" />
- </div>
- </div>
+ <h4 class="slds-section__title">浜у搧鐩爣</h4>
+ <div class="slds-form-element__row">
+ <div class="slds-size--1-of-7 slds-grid--align-center">
+ <div style="margin-top: 32px;">娑堝寲绉�</div>
+ </div>
+ <div class="slds-form-element slds-size--1-of-7">
+ <label class="slds-form-element__label" for="input-hos">浜у搧鍖哄垎1</label>
+ <ui:inputSelect aura:id="select_GI1" class="slds-select" change="{!c.productcategoryGIChange1}"/>
+ </div>
+ <div class="slds-form-element slds-size--1-of-7">
+ <label class="slds-form-element__label" for="input-hos">閲戦鐩爣(涓嶅惈绋�)</label>
+ <ui:inputText aura:id="select_GI4_1" class="slds-select"/>
+ </div>
+ <div class="slds-form-element slds-size--1-of-7">
+ <label class="slds-form-element__label" for="input-hos">浜у搧鍖哄垎2</label>
+ <ui:inputSelect aura:id="select_GI2" class="slds-select" change="{!c.productcategoryGIChange2}"/>
+ </div>
+ <div class="slds-form-element slds-size--1-of-7">
+ <label class="slds-form-element__label" for="input-hos">閲戦鐩爣(涓嶅惈绋�)</label>
+ <ui:inputText aura:id="select_GI4_2" class="slds-select"/>
+ </div>
+ <div class="slds-form-element slds-size--1-of-7">
+ <label class="slds-form-element__label" for="input-hos">浜у搧鍖哄垎3</label>
+ <ui:inputSelect aura:id="select_GI3" class="slds-select" change="{!c.productcategoryGIChange3}"/>
+ </div>
+ <div class="slds-form-element slds-size--1-of-7">
+ <label class="slds-form-element__label" for="input-hos">閲戦鐩爣(涓嶅惈绋�)</label>
+ <ui:inputText aura:id="select_GI4_3" class="slds-select"/>
+ </div>
+ </div>
+ <div class="slds-form-element__row">
+ <div class="slds-size--1-of-7 slds-grid--align-center">
+ <div style="margin-top: 32px;">ET鑰楁潗</div>
+ </div>
+ <div class="slds-form-element slds-size--1-of-7">
+ <label class="slds-form-element__label" for="input-hos">浜у搧鍖哄垎1</label>
+ <ui:inputSelect aura:id="select_ET1" class="slds-select" change="{!c.productcategoryETChange1}"/>
+ </div>
+ <div class="slds-form-element slds-size--1-of-7">
+ <label class="slds-form-element__label" for="input-hos">閲戦鐩爣(涓嶅惈绋�)</label>
+ <ui:inputText aura:id="select_ET4_1" class="slds-select"/>
+ </div>
+ <div class="slds-form-element slds-size--1-of-7">
+ <label class="slds-form-element__label" for="input-hos">浜у搧鍖哄垎2</label>
+ <ui:inputSelect aura:id="select_ET2" class="slds-select" change="{!c.productcategoryETChange2}"/>
+ </div>
+ <div class="slds-form-element slds-size--1-of-7">
+ <label class="slds-form-element__label" for="input-hos">閲戦鐩爣(涓嶅惈绋�)</label>
+ <ui:inputText aura:id="select_ET4_2" class="slds-select"/>
+ </div>
+ <div class="slds-form-element slds-size--1-of-7">
+ <label class="slds-form-element__label" for="input-hos">浜у搧鍖哄垎3</label>
+ <ui:inputSelect aura:id="select_ET3" class="slds-select" change="{!c.productcategoryETChange3}"/>
+ </div>
+ <div class="slds-form-element slds-size--1-of-7">
+ <label class="slds-form-element__label" for="input-hos">閲戦鐩爣(涓嶅惈绋�)</label>
+ <ui:inputText aura:id="select_ET4_3" class="slds-select" />
+ </div>
+ </div>
+ <div class="slds-form-element__row">
+ <div class="slds-size--1-of-7 slds-grid--align-center">
+ <div style="margin-top: 32px;">鍛煎惛绉�</div>
+ </div>
+ <div class="slds-form-element slds-size--1-of-7">
+ <label class="slds-form-element__label" for="input-hos">浜у搧鍖哄垎1</label>
+ <ui:inputSelect aura:id="select_BF1" class="slds-select" change="{!c.productcategoryBFChange1}"/>
+ </div>
+ <div class="slds-form-element slds-size--1-of-7">
+ <label class="slds-form-element__label" for="input-hos">閲戦鐩爣(涓嶅惈绋�)</label>
+ <ui:inputText aura:id="select_BF4_1" class="slds-select" />
+ </div>
+ <div class="slds-form-element slds-size--1-of-7">
+ <label class="slds-form-element__label" for="input-hos">浜у搧鍖哄垎2</label>
+ <ui:inputSelect aura:id="select_BF2" class="slds-select" change="{!c.productcategoryBFChange2}"/>
+ </div>
+ <div class="slds-form-element slds-size--1-of-7">
+ <label class="slds-form-element__label" for="input-hos">閲戦鐩爣(涓嶅惈绋�)</label>
+ <ui:inputText aura:id="select_BF4_2" class="slds-select" />
+ </div>
+ <div class="slds-form-element slds-size--1-of-7">
+ <label class="slds-form-element__label" for="input-hos">浜у搧鍖哄垎3</label>
+ <ui:inputSelect aura:id="select_BF3" class="slds-select" change="{!c.productcategoryBFChange3}"/>
+ </div>
+ <div class="slds-form-element slds-size--1-of-7">
+ <label class="slds-form-element__label" for="input-hos">閲戦鐩爣(涓嶅惈绋�)</label>
+ <ui:inputText aura:id="select_BF4_3" class="slds-select" />
+ </div>
+ </div>
+ <div class="slds-form-element__row">
+ <div class="slds-size--1-of-7 slds-grid--align-center">
+ <div style="margin-top: 32px;">鏅绉�</div>
+ </div>
+ <div class="slds-form-element slds-size--1-of-7">
+ <label class="slds-form-element__label" for="input-hos">浜у搧鍖哄垎1</label>
+ <ui:inputSelect aura:id="select_GS1" class="slds-select" change="{!c.productcategoryGSChange1}"/>
+ </div>
+ <div class="slds-form-element slds-size--1-of-7">
+ <label class="slds-form-element__label" for="input-hos">閲戦鐩爣(涓嶅惈绋�)</label>
+ <ui:inputText aura:id="select_GS4_1" class="slds-select" />
+ </div>
+ <div class="slds-form-element slds-size--1-of-7">
+ <label class="slds-form-element__label" for="input-hos">浜у搧鍖哄垎2</label>
+ <ui:inputSelect aura:id="select_GS2" class="slds-select" change="{!c.productcategoryGSChange2}"/>
+ </div>
+ <div class="slds-form-element slds-size--1-of-7">
+ <label class="slds-form-element__label" for="input-hos">閲戦鐩爣(涓嶅惈绋�)</label>
+ <ui:inputText aura:id="select_GS4_2" class="slds-select" />
+ </div>
+ <div class="slds-form-element slds-size--1-of-7">
+ <label class="slds-form-element__label" for="input-hos">浜у搧鍖哄垎3</label>
+ <ui:inputSelect aura:id="select_GS3" class="slds-select" change="{!c.productcategoryGSChange3}"/>
+ </div>
+ <div class="slds-form-element slds-size--1-of-7">
+ <label class="slds-form-element__label" for="input-hos">閲戦鐩爣(涓嶅惈绋�)</label>
+ <ui:inputText aura:id="select_GS4_3" class="slds-select" />
+ </div>
+ </div>
+ <div class="slds-form-element__row">
+ <div class="slds-size--1-of-7 slds-grid--align-center">
+ <div style="margin-top: 32px;">娉屽翱绉�</div>
+ </div>
+ <div class="slds-form-element slds-size--1-of-7">
+ <label class="slds-form-element__label" for="input-hos">浜у搧鍖哄垎1</label>
+ <ui:inputSelect aura:id="select_URO1" class="slds-select" change="{!c.productcategoryUROChange1}"/>
+ </div>
+ <div class="slds-form-element slds-size--1-of-7">
+ <label class="slds-form-element__label" for="input-hos">閲戦鐩爣(涓嶅惈绋�)</label>
+ <ui:inputText aura:id="select_URO4_1" class="slds-select" />
+ </div>
+ <div class="slds-form-element slds-size--1-of-7">
+ <label class="slds-form-element__label" for="input-hos">浜у搧鍖哄垎2</label>
+ <ui:inputSelect aura:id="select_URO2" class="slds-select" change="{!c.productcategoryUROChange2}"/>
+ </div>
+ <div class="slds-form-element slds-size--1-of-7">
+ <label class="slds-form-element__label" for="input-hos">閲戦鐩爣(涓嶅惈绋�)</label>
+ <ui:inputText aura:id="select_URO4_2" class="slds-select" />
+ </div>
+ <div class="slds-form-element slds-size--1-of-7">
+ <label class="slds-form-element__label" for="input-hos">浜у搧鍖哄垎3</label>
+ <ui:inputSelect aura:id="select_URO3" class="slds-select" change="{!c.productcategoryUROChange3}"/>
+ </div>
+ <div class="slds-form-element slds-size--1-of-7">
+ <label class="slds-form-element__label" for="input-hos">閲戦鐩爣(涓嶅惈绋�)</label>
+ <ui:inputText aura:id="select_URO4_3" class="slds-select" />
+ </div>
+ </div>
+ <div class="slds-form-element__row">
+ <div class="slds-size--1-of-7 slds-grid--align-center">
+ <div style="margin-top: 32px;">濡囩</div>
+ </div>
+ <div class="slds-form-element slds-size--1-of-7">
+ <label class="slds-form-element__label" for="input-hos">浜у搧鍖哄垎1</label>
+ <ui:inputSelect aura:id="select_GYN1" class="slds-select" change="{!c.productcategoryGYNChange1}"/>
+ </div>
+ <div class="slds-form-element slds-size--1-of-7">
+ <label class="slds-form-element__label" for="input-hos">閲戦鐩爣(涓嶅惈绋�)</label>
+ <ui:inputText aura:id="select_GYN4_1" class="slds-select" />
+ </div>
+ <div class="slds-form-element slds-size--1-of-7">
+ <label class="slds-form-element__label" for="input-hos">浜у搧鍖哄垎2</label>
+ <ui:inputSelect aura:id="select_GYN2" class="slds-select" change="{!c.productcategoryGYNChange2}"/>
+ </div>
+ <div class="slds-form-element slds-size--1-of-7">
+ <label class="slds-form-element__label" for="input-hos">閲戦鐩爣(涓嶅惈绋�)</label>
+ <ui:inputText aura:id="select_GYN4_2" class="slds-select" />
+ </div>
+ <div class="slds-form-element slds-size--1-of-7">
+ <label class="slds-form-element__label" for="input-hos">浜у搧鍖哄垎3</label>
+ <ui:inputSelect aura:id="select_GYN3" class="slds-select" change="{!c.productcategoryGYNChange3}"/>
+ </div>
+ <div class="slds-form-element slds-size--1-of-7">
+ <label class="slds-form-element__label" for="input-hos">閲戦鐩爣(涓嶅惈绋�)</label>
+ <ui:inputText aura:id="select_GYN4_3" class="slds-select" />
+ </div>
+ </div>
+ <div class="slds-form-element__row">
+ <div class="slds-size--1-of-7 slds-grid--align-center">
+ <div style="margin-top: 32px;">鑰抽蓟鍠夌</div>
+ </div>
+ <div class="slds-form-element slds-size--1-of-7">
+ <label class="slds-form-element__label" for="input-hos">浜у搧鍖哄垎1</label>
+ <ui:inputSelect aura:id="select_ENT1" class="slds-select" change="{!c.productcategoryENTChange1}"/>
+ </div>
+ <div class="slds-form-element slds-size--1-of-7">
+ <label class="slds-form-element__label" for="input-hos">閲戦鐩爣(涓嶅惈绋�)</label>
+ <ui:inputText aura:id="select_ENT4_1" class="slds-select" />
+ </div>
+ <div class="slds-form-element slds-size--1-of-7">
+ <label class="slds-form-element__label" for="input-hos">浜у搧鍖哄垎2</label>
+ <ui:inputSelect aura:id="select_ENT2" class="slds-select" change="{!c.productcategoryENTChange2}"/>
+ </div>
+ <div class="slds-form-element slds-size--1-of-7">
+ <label class="slds-form-element__label" for="input-hos">閲戦鐩爣(涓嶅惈绋�)</label>
+ <ui:inputText aura:id="select_ENT4_2" class="slds-select" />
+ </div>
+ <div class="slds-form-element slds-size--1-of-7">
+ <label class="slds-form-element__label" for="input-hos">浜у搧鍖哄垎3</label>
+ <ui:inputSelect aura:id="select_ENT3" class="slds-select" change="{!c.productcategoryENTChange3}"/>
+ </div>
+ <div class="slds-form-element slds-size--1-of-7">
+ <label class="slds-form-element__label" for="input-hos">閲戦鐩爣(涓嶅惈绋�)</label>
+ <ui:inputText aura:id="select_ENT4_3" class="slds-select" />
+ </div>
+ </div>
+ <div class="slds-form-element__row">
+ <div class="slds-size--1-of-7 slds-grid--align-center">
+ <div style="margin-top: 32px;">鍏朵粬</div>
+ </div>
+ <div class="slds-form-element slds-size--1-of-7">
+ <label class="slds-form-element__label" for="input-hos">浜у搧鍖哄垎1</label>
+ <ui:inputSelect aura:id="select_OTH1" class="slds-select" change="{!c.productcategoryOTHChange1}"/>
+ </div>
+ <div class="slds-form-element slds-size--1-of-7">
+ <label class="slds-form-element__label" for="input-hos">閲戦鐩爣(涓嶅惈绋�)</label>
+ <ui:inputText aura:id="select_OTH4_1" class="slds-select" />
+ </div>
+ <div class="slds-form-element slds-size--1-of-7">
+ <label class="slds-form-element__label" for="input-hos">浜у搧鍖哄垎2</label>
+ <ui:inputSelect aura:id="select_OTH2" class="slds-select" change="{!c.productcategoryOTHChange2}"/>
+ </div>
+ <div class="slds-form-element slds-size--1-of-7">
+ <label class="slds-form-element__label" for="input-hos">閲戦鐩爣(涓嶅惈绋�)</label>
+ <ui:inputText aura:id="select_OTH4_2" class="slds-select" />
+ </div>
+ <div class="slds-form-element slds-size--1-of-7">
+ <label class="slds-form-element__label" for="input-hos">浜у搧鍖哄垎3</label>
+ <ui:inputSelect aura:id="select_OTH3" class="slds-select" change="{!c.productcategoryOTHChange3}"/>
+ </div>
+ <div class="slds-form-element slds-size--1-of-7">
+ <label class="slds-form-element__label" for="input-hos">閲戦鐩爣(涓嶅惈绋�)</label>
+ <ui:inputText aura:id="select_OTH4_3" class="slds-select" />
+ </div>
+ </div>
+ </div>
+ </fieldset>
+ </div>
+ </div>
+ <div class="slds-modal__footer slds-grid slds-grid--align-spread">
+ <div class="slds-order--1" />
+ <ui:button aura:id="save_button" label="淇濆瓨" class="slds-button slds-button--brand slds-order--2" press="{!c.createTarget}"/>
+ <div class="slds-order--3" />
+ </div>
+ </div>
</div>
- <div
- aura:id="modal_bg"
- class="disp_none slds-backdrop slds-backdrop--open"
- ></div>
-</aura:component>
+ <div aura:id="modal_bg" class="disp_none slds-backdrop slds-backdrop--open"></div>
+</aura:component>
\ No newline at end of file
diff --git a/force-app/main/default/aura/CreateTarget/CreateTarget.cmp-meta.xml b/force-app/main/default/aura/CreateTarget/CreateTarget.cmp-meta.xml
index 171ac69..e7c0133 100644
--- a/force-app/main/default/aura/CreateTarget/CreateTarget.cmp-meta.xml
+++ b/force-app/main/default/aura/CreateTarget/CreateTarget.cmp-meta.xml
@@ -1,4 +1,4 @@
-<?xml version="1.0" encoding="UTF-8" ?>
+<?xml version="1.0" encoding="UTF-8"?>
<AuraDefinitionBundle xmlns="http://soap.sforce.com/2006/04/metadata">
<apiVersion>42.0</apiVersion>
<description>A Lightning Component Bundle</description>
diff --git a/force-app/main/default/aura/CreateTarget/CreateTarget.css b/force-app/main/default/aura/CreateTarget/CreateTarget.css
index f17614f..68a877a 100644
--- a/force-app/main/default/aura/CreateTarget/CreateTarget.css
+++ b/force-app/main/default/aura/CreateTarget/CreateTarget.css
@@ -5,8 +5,8 @@
display: none;
}
.THIS select {
- --lwc-lineHeightButton: 36px;
- --lwc-heightInput: 36px;
+ --lwc-lineHeightButton:36px;
+ --lwc-heightInput:36px;
min-height: 0px !important;
height: 36px !important;
-}
+}
\ No newline at end of file
diff --git a/force-app/main/default/aura/CreateTarget/CreateTargetHelper.js b/force-app/main/default/aura/CreateTarget/CreateTargetHelper.js
index 5d97e95..89aea61 100644
--- a/force-app/main/default/aura/CreateTarget/CreateTargetHelper.js
+++ b/force-app/main/default/aura/CreateTarget/CreateTargetHelper.js
@@ -1,192 +1,130 @@
({
- doinit: function (component, event, helper) {
- component.set('v.OCMTerm', this.getOCMTerm());
- if (component.get('v.recordId')) {
- component.set('v.button_text', '缂栬緫');
- var recordId = component.get('v.recordId');
- var action = component.get('c.getHospital');
- action.setParams({ recordId: recordId });
- action.setCallback(this, function (response) {
- var state = response.getState();
- console.log('state1:' + state);
- if (state === 'SUCCESS') {
+ doinit : function(component, event, helper) {
+ component.set("v.OCMTerm", this.getOCMTerm());
+ if (component.get("v.recordId")) {
+ component.set("v.button_text", "缂栬緫");
+ var recordId = component.get("v.recordId");
+ var action = component.get("c.getHospital");
+ action.setParams({recordId: recordId});
+ action.setCallback(this, function(response) {
+ var state = response.getState();
+ console.log("state1:"+state);
+ if(state === "SUCCESS") {
var ah = response.getReturnValue();
var select_ah = ah.Id;
var select_ah_name = ah.Name;
// component.set('v.record.Agency_Hospital__c', select_ah);
//add by Deloitte 2023-6-8
- let agency = component.get('v.record');
+ let agency = component.get("v.record");
agency.Agency_Hospital__c = select_ah;
// component.set("v.record", agency);
// alert(JSON.stringify(component.find('input-hos').get("v.body")[0].get('v.values')));
- if ($A.get('$Browser.formFactor') == 'DESKTOP') {
- console.log('flag1');
- var values = [
- {
- type: 'Agency_Hospital_Link__c',
- id: select_ah,
- label: select_ah_name,
- icon: {
- url: '/img/icon/t4v35/custom/custom24_120.png',
- backgroundColor: 'dc71d1',
- alt: 'Agency_Hospital_Link__c'
- }
+ if ($A.get("$Browser.formFactor") == 'DESKTOP') {
+ console.log("flag1");
+ var values = [{
+ type: 'Agency_Hospital_Link__c',
+ id: select_ah,
+ label: select_ah_name,
+ icon : {
+ url:'/img/icon/t4v35/custom/custom24_120.png',
+ backgroundColor:'dc71d1',
+ alt:'Agency_Hospital_Link__c'
}
- ];
+ }];
// component.find('input-hos').get("v.body")[0].set('v.values', values);
//add by Deloitte 2023-6-8
- if (
- component.find('input-hos').get('v.body') &&
- component.find('input-hos').get('v.body').length > 0
- ) {
- component
- .find('input-hos')
- .get('v.body')[0]
- .set('v.values', values);
- }
+ if(component.find('input-hos').get("v.body") && component.find('input-hos').get("v.body").length>0){
+ component.find('input-hos').get("v.body")[0].set('v.values', values);
+ }
} else {
// component.find('input-hos').get("v.body")[0].set('v.selectedLabel', select_ah_name);
//add by Deloitte 2023-6-8
- if (
- component.find('input-hos').get('v.body') &&
- component.find('input-hos').get('v.body').length > 0
- ) {
- component
- .find('input-hos')
- .get('v.body')[0]
- .set('v.selectedLabel', select_ah_name);
- }
+ if(component.find('input-hos').get("v.body") && component.find('input-hos').get("v.body").length>0){
+ component.find('input-hos').get("v.body")[0].set('v.selectedLabel', select_ah_name);
+ }
}
- } else if (state === 'ERROR') {
+
+ } else if (state === "ERROR") {
var errors = response.getError();
- var toastEvent = $A.get('e.force:showToast');
+ var toastEvent = $A.get("e.force:showToast");
toastEvent.setParams({
- title: '閿欒',
- type: 'error',
- message: errors[0].message
+ "title": "閿欒",
+ "type":"error",
+ "message": errors[0].message
});
toastEvent.fire();
+
}
});
$A.enqueueAction(action);
}
- var action = component.get('c.getProductList');
- action.setCallback(this, function (response) {
+ var action = component.get("c.getProductList");
+ action.setCallback(this, function(response) {
var state = response.getState();
- console.log('state2:' + state);
- if (state === 'SUCCESS') {
+ console.log("state2:"+state);
+ if(state === "SUCCESS") {
var opts = response.getReturnValue();
// alert(JSON.stringify(opts["GI"]));
- component
- .find('select_GI1')
- .set('v.options', JSON.parse(JSON.stringify(opts['GI'])));
- component
- .find('select_GI2')
- .set('v.options', JSON.parse(JSON.stringify(opts['GI'])));
- component
- .find('select_GI3')
- .set('v.options', JSON.parse(JSON.stringify(opts['GI'])));
+ component.find("select_GI1").set("v.options", JSON.parse(JSON.stringify(opts["GI"])));
+ component.find("select_GI2").set("v.options", JSON.parse(JSON.stringify(opts["GI"])));
+ component.find("select_GI3").set("v.options", JSON.parse(JSON.stringify(opts["GI"])));
- component
- .find('select_GS1')
- .set('v.options', JSON.parse(JSON.stringify(opts['GS'])));
- component
- .find('select_GS2')
- .set('v.options', JSON.parse(JSON.stringify(opts['GS'])));
- component
- .find('select_GS3')
- .set('v.options', JSON.parse(JSON.stringify(opts['GS'])));
+ component.find("select_GS1").set("v.options", JSON.parse(JSON.stringify(opts["GS"])));
+ component.find("select_GS2").set("v.options", JSON.parse(JSON.stringify(opts["GS"])));
+ component.find("select_GS3").set("v.options", JSON.parse(JSON.stringify(opts["GS"])));
- component
- .find('select_GYN1')
- .set('v.options', JSON.parse(JSON.stringify(opts['GYN'])));
- component
- .find('select_GYN2')
- .set('v.options', JSON.parse(JSON.stringify(opts['GYN'])));
- component
- .find('select_GYN3')
- .set('v.options', JSON.parse(JSON.stringify(opts['GYN'])));
+ component.find("select_GYN1").set("v.options", JSON.parse(JSON.stringify(opts["GYN"])));
+ component.find("select_GYN2").set("v.options", JSON.parse(JSON.stringify(opts["GYN"])));
+ component.find("select_GYN3").set("v.options", JSON.parse(JSON.stringify(opts["GYN"])));
- component
- .find('select_URO1')
- .set('v.options', JSON.parse(JSON.stringify(opts['URO'])));
- component
- .find('select_URO2')
- .set('v.options', JSON.parse(JSON.stringify(opts['URO'])));
- component
- .find('select_URO3')
- .set('v.options', JSON.parse(JSON.stringify(opts['URO'])));
+ component.find("select_URO1").set("v.options", JSON.parse(JSON.stringify(opts["URO"])));
+ component.find("select_URO2").set("v.options", JSON.parse(JSON.stringify(opts["URO"])));
+ component.find("select_URO3").set("v.options", JSON.parse(JSON.stringify(opts["URO"])));
- component
- .find('select_ENT1')
- .set('v.options', JSON.parse(JSON.stringify(opts['ENT'])));
- component
- .find('select_ENT2')
- .set('v.options', JSON.parse(JSON.stringify(opts['ENT'])));
- component
- .find('select_ENT3')
- .set('v.options', JSON.parse(JSON.stringify(opts['ENT'])));
+ component.find("select_ENT1").set("v.options", JSON.parse(JSON.stringify(opts["ENT"])));
+ component.find("select_ENT2").set("v.options", JSON.parse(JSON.stringify(opts["ENT"])));
+ component.find("select_ENT3").set("v.options", JSON.parse(JSON.stringify(opts["ENT"])));
- component
- .find('select_OTH1')
- .set('v.options', JSON.parse(JSON.stringify(opts['OTH'])));
- component
- .find('select_OTH2')
- .set('v.options', JSON.parse(JSON.stringify(opts['OTH'])));
- component
- .find('select_OTH3')
- .set('v.options', JSON.parse(JSON.stringify(opts['OTH'])));
+ component.find("select_OTH1").set("v.options", JSON.parse(JSON.stringify(opts["OTH"])));
+ component.find("select_OTH2").set("v.options", JSON.parse(JSON.stringify(opts["OTH"])));
+ component.find("select_OTH3").set("v.options", JSON.parse(JSON.stringify(opts["OTH"])));
- component
- .find('select_ET1')
- .set('v.options', JSON.parse(JSON.stringify(opts['ET'])));
- component
- .find('select_ET2')
- .set('v.options', JSON.parse(JSON.stringify(opts['ET'])));
- component
- .find('select_ET3')
- .set('v.options', JSON.parse(JSON.stringify(opts['ET'])));
+ component.find("select_ET1").set("v.options", JSON.parse(JSON.stringify(opts["ET"])));
+ component.find("select_ET2").set("v.options", JSON.parse(JSON.stringify(opts["ET"])));
+ component.find("select_ET3").set("v.options", JSON.parse(JSON.stringify(opts["ET"])));
- component
- .find('select_BF1')
- .set('v.options', JSON.parse(JSON.stringify(opts['BF'])));
- component
- .find('select_BF2')
- .set('v.options', JSON.parse(JSON.stringify(opts['BF'])));
- component
- .find('select_BF3')
- .set('v.options', JSON.parse(JSON.stringify(opts['BF'])));
- } else if (state === 'ERROR') {
+ component.find("select_BF1").set("v.options", JSON.parse(JSON.stringify(opts["BF"])));
+ component.find("select_BF2").set("v.options", JSON.parse(JSON.stringify(opts["BF"])));
+ component.find("select_BF3").set("v.options", JSON.parse(JSON.stringify(opts["BF"])));
+ } else if (state === "ERROR") {
var errors = response.getError();
- var toastEvent = $A.get('e.force:showToast');
+ var toastEvent = $A.get("e.force:showToast");
toastEvent.setParams({
- title: '閿欒',
- type: 'error',
+ title: "閿欒",
+ type:"error",
message: errors[0].message
});
toastEvent.fire();
+
}
});
$A.enqueueAction(action);
},
- toggle_report: function (component, event, helper) {
+ toggle_report : function(component, event, helper) {
var modal_window = component.find('modal_window');
var modal_bg = component.find('modal_bg');
$A.util.toggleClass(modal_window, 'disp_none');
$A.util.toggleClass(modal_bg, 'disp_none');
- if (
- $A.util.hasClass(modal_window, 'disp_none') &&
- !component.get('v.recordId')
- ) {
+ if ($A.util.hasClass(modal_window, 'disp_none') && !component.get("v.recordId")) {
$A.get('e.force:refreshView').fire();
}
},
- productcategoryChange: function (component, event, helper, dept, index) {
- var cmpId = 'select_' + dept;
+ productcategoryChange : function(component, event, helper, dept, index) {
+ var cmpId = 'select_'+dept;
var myId;
var o1Id;
var o2Id;
@@ -194,7 +132,7 @@
myId = cmpId + '1';
o1Id = cmpId + '2';
o2Id = cmpId + '3';
- } else if (index == 2) {
+ } else if (index == 2){
myId = cmpId + '2';
o1Id = cmpId + '1';
o2Id = cmpId + '3';
@@ -209,27 +147,22 @@
var pcId2 = component.find(o2Id).get('v.value');
var p1bool = pcId1 != '' && pcId1 != null && pcId1 != undefined;
var p2bool = pcId2 != '' && pcId2 != null && pcId2 != undefined;
- var p0bool =
- product_category_id != '' &&
- product_category_id != null &&
- product_category_id != undefined;
- if (
- (p1bool && p0bool && product_category_id == pcId1) ||
- (p2bool && p0bool && product_category_id == pcId2)
- ) {
+ var p0bool = product_category_id != '' && product_category_id != null && product_category_id != undefined;
+ if ((p1bool && p0bool && product_category_id == pcId1) || (p2bool && p0bool && product_category_id == pcId2)) {
this.warning('涓嶈兘閫夋嫨鍚屾牱鐨勪骇鍝佸尯鍒�');
- component.find(myId).set('v.value', '');
+ component.find(myId).set('v.value','');
}
},
- selectHos: function (component, event, helper) {
- var accid = component.get('v.record.Agency_Hospital__c');
- var action = component.get('c.getDeptAmount');
- action.setParams({ hospitalId: accid });
- action.setCallback(this, function (response) {
- var state = response.getState();
- if (state === 'SUCCESS') {
- var amountMap = response.getReturnValue();
+ selectHos : function(component, event, helper) {
+
+ var accid = component.get("v.record.Agency_Hospital__c");
+ var action = component.get("c.getDeptAmount");
+ action.setParams({ hospitalId : accid });
+ action.setCallback(this, function(response) {
+ var state = response.getState();
+ if (state === "SUCCESS") {
+ var amountMap = response.getReturnValue();
var GIProduct_Category1 = '';
var GIProduct_Category2 = '';
var GIProduct_Category3 = '';
@@ -239,36 +172,24 @@
if (amountMap.GI.length > 0) {
GIProduct_Category1 = amountMap.GI[0].Product_Category__c;
if (amountMap.GI.length > 1) {
- GIProduct_Category2 =
- amountMap.GI[1].Product_Category__c;
+ GIProduct_Category2 = amountMap.GI[1].Product_Category__c;
}
if (amountMap.GI.length > 2) {
- GIProduct_Category3 =
- amountMap.GI[2].Product_Category__c;
+ GIProduct_Category3 = amountMap.GI[2].Product_Category__c;
}
GIAim_Price__c1 = amountMap.GI[0].Aim_Price__c;
GIAim_Price__c2 = amountMap.GI[1].Aim_Price__c;
GIAim_Price__c3 = amountMap.GI[2].Aim_Price__c;
- console.warn(
- GIAim_Price__c1 +
- '-' +
- GIAim_Price__c2 +
- '-' +
- GIAim_Price__c3
- );
+ console.warn(GIAim_Price__c1+"-"+GIAim_Price__c2+"-"+GIAim_Price__c3);
+
}
- component
- .find('select_GI1')
- .set('v.value', GIProduct_Category1);
- component
- .find('select_GI2')
- .set('v.value', GIProduct_Category2);
- component
- .find('select_GI3')
- .set('v.value', GIProduct_Category3);
- component.find('select_GI4_1').set('v.value', GIAim_Price__c1);
- component.find('select_GI4_2').set('v.value', GIAim_Price__c2);
- component.find('select_GI4_3').set('v.value', GIAim_Price__c3);
+ component.find('select_GI1').set('v.value',GIProduct_Category1);
+ component.find('select_GI2').set('v.value',GIProduct_Category2);
+ component.find('select_GI3').set('v.value',GIProduct_Category3);
+ component.find('select_GI4_1').set('v.value',GIAim_Price__c1);
+ component.find('select_GI4_2').set('v.value',GIAim_Price__c2);
+ component.find('select_GI4_3').set('v.value',GIAim_Price__c3);
+
var ETProduct_Category1 = '';
var ETProduct_Category2 = '';
@@ -279,29 +200,22 @@
if (amountMap.ET.length > 0) {
ETProduct_Category1 = amountMap.ET[0].Product_Category__c;
if (amountMap.ET.length > 1) {
- ETProduct_Category2 =
- amountMap.ET[1].Product_Category__c;
+ ETProduct_Category2 = amountMap.ET[1].Product_Category__c;
}
if (amountMap.ET.length > 2) {
- ETProduct_Category3 =
- amountMap.ET[2].Product_Category__c;
+ ETProduct_Category3 = amountMap.ET[2].Product_Category__c;
}
ETAim_Price__c1 = amountMap.ET[0].Aim_Price__c;
ETAim_Price__c2 = amountMap.ET[1].Aim_Price__c;
ETAim_Price__c3 = amountMap.ET[2].Aim_Price__c;
- }
- component
- .find('select_ET1')
- .set('v.value', ETProduct_Category1);
- component
- .find('select_ET2')
- .set('v.value', ETProduct_Category2);
- component
- .find('select_ET3')
- .set('v.value', ETProduct_Category3);
- component.find('select_ET4_1').set('v.value', ETAim_Price__c1);
- component.find('select_ET4_2').set('v.value', ETAim_Price__c2);
- component.find('select_ET4_3').set('v.value', ETAim_Price__c3);
+ }
+ component.find('select_ET1').set('v.value',ETProduct_Category1);
+ component.find('select_ET2').set('v.value',ETProduct_Category2);
+ component.find('select_ET3').set('v.value',ETProduct_Category3);
+ component.find('select_ET4_1').set('v.value',ETAim_Price__c1);
+ component.find('select_ET4_2').set('v.value',ETAim_Price__c2);
+ component.find('select_ET4_3').set('v.value',ETAim_Price__c3);
+
var BFProduct_Category1 = '';
var BFProduct_Category2 = '';
@@ -312,29 +226,22 @@
if (amountMap.BF.length > 0) {
BFProduct_Category1 = amountMap.BF[0].Product_Category__c;
if (amountMap.BF.length > 1) {
- BFProduct_Category2 =
- amountMap.BF[1].Product_Category__c;
+ BFProduct_Category2 = amountMap.BF[1].Product_Category__c;
}
if (amountMap.BF.length > 2) {
- BFProduct_Category3 =
- amountMap.BF[2].Product_Category__c;
+ BFProduct_Category3 = amountMap.BF[2].Product_Category__c;
}
BFAim_Price__c1 = amountMap.BF[0].Aim_Price__c;
BFAim_Price__c2 = amountMap.BF[1].Aim_Price__c;
BFAim_Price__c3 = amountMap.BF[2].Aim_Price__c;
- }
- component
- .find('select_BF1')
- .set('v.value', BFProduct_Category1);
- component
- .find('select_BF2')
- .set('v.value', BFProduct_Category2);
- component
- .find('select_BF3')
- .set('v.value', BFProduct_Category3);
- component.find('select_BF4_1').set('v.value', BFAim_Price__c1);
- component.find('select_BF4_2').set('v.value', BFAim_Price__c2);
- component.find('select_BF4_3').set('v.value', BFAim_Price__c3);
+ }
+ component.find('select_BF1').set('v.value',BFProduct_Category1);
+ component.find('select_BF2').set('v.value',BFProduct_Category2);
+ component.find('select_BF3').set('v.value',BFProduct_Category3);
+ component.find('select_BF4_1').set('v.value',BFAim_Price__c1);
+ component.find('select_BF4_2').set('v.value',BFAim_Price__c2);
+ component.find('select_BF4_3').set('v.value',BFAim_Price__c3);
+
var OTHProduct_Category1 = '';
var OTHProduct_Category2 = '';
@@ -343,38 +250,25 @@
var OTHAim_Price__c2 = '';
var OTHAim_Price__c3 = '';
if (amountMap.OTH.length > 0) {
+
OTHProduct_Category1 = amountMap.OTH[0].Product_Category__c;
if (amountMap.OTH.length > 1) {
- OTHProduct_Category2 =
- amountMap.OTH[1].Product_Category__c;
+ OTHProduct_Category2 = amountMap.OTH[1].Product_Category__c;
}
if (amountMap.OTH.length > 2) {
- OTHProduct_Category3 =
- amountMap.OTH[2].Product_Category__c;
+ OTHProduct_Category3 = amountMap.OTH[2].Product_Category__c;
}
OTHAim_Price__c1 = amountMap.OTH[0].Aim_Price__c;
OTHAim_Price__c2 = amountMap.OTH[1].Aim_Price__c;
OTHAim_Price__c3 = amountMap.OTH[2].Aim_Price__c;
- }
- component
- .find('select_OTH1')
- .set('v.value', OTHProduct_Category1);
- component
- .find('select_OTH2')
- .set('v.value', OTHProduct_Category2);
- component
- .find('select_OTH3')
- .set('v.value', OTHProduct_Category3);
- component
- .find('select_OTH4_1')
- .set('v.value', OTHAim_Price__c1);
- component
- .find('select_OTH4_2')
- .set('v.value', OTHAim_Price__c2);
- component
- .find('select_OTH4_3')
- .set('v.value', OTHAim_Price__c3);
-
+ }
+ component.find('select_OTH1').set('v.value',OTHProduct_Category1);
+ component.find('select_OTH2').set('v.value',OTHProduct_Category2);
+ component.find('select_OTH3').set('v.value',OTHProduct_Category3);
+ component.find('select_OTH4_1').set('v.value',OTHAim_Price__c1);
+ component.find('select_OTH4_2').set('v.value',OTHAim_Price__c2);
+ component.find('select_OTH4_3').set('v.value',OTHAim_Price__c3);
+
var GSProduct_Category1 = '';
var GSProduct_Category2 = '';
var GSProduct_Category3 = '';
@@ -384,30 +278,22 @@
if (amountMap.GS.length > 0) {
GSProduct_Category1 = amountMap.GS[0].Product_Category__c;
if (amountMap.GS.length > 1) {
- GSProduct_Category2 =
- amountMap.GS[1].Product_Category__c;
+ GSProduct_Category2 = amountMap.GS[1].Product_Category__c;
}
if (amountMap.GS.length > 2) {
- GSProduct_Category3 =
- amountMap.GS[2].Product_Category__c;
+ GSProduct_Category3 = amountMap.GS[2].Product_Category__c;
}
GSPAim_Price__c1 = amountMap.GS[0].Aim_Price__c;
GSPAim_Price__c2 = amountMap.GS[1].Aim_Price__c;
- GSPAim_Price__c3 = amountMap.GS[2].Aim_Price__c;
- }
- component
- .find('select_GS1')
- .set('v.value', GSProduct_Category1);
- component
- .find('select_GS2')
- .set('v.value', GSProduct_Category2);
- component
- .find('select_GS3')
- .set('v.value', GSProduct_Category3);
- component.find('select_GS4_1').set('v.value', GSPAim_Price__c1);
- component.find('select_GS4_2').set('v.value', GSPAim_Price__c2);
- component.find('select_GS4_3').set('v.value', GSPAim_Price__c3);
-
+ GSPAim_Price__c3= amountMap.GS[2].Aim_Price__c;
+ }
+ component.find('select_GS1').set('v.value',GSProduct_Category1);
+ component.find('select_GS2').set('v.value',GSProduct_Category2);
+ component.find('select_GS3').set('v.value',GSProduct_Category3);
+ component.find('select_GS4_1').set('v.value',GSPAim_Price__c1);
+ component.find('select_GS4_2').set('v.value',GSPAim_Price__c2);
+ component.find('select_GS4_3').set('v.value',GSPAim_Price__c3);
+
var UROProduct_Category1 = '';
var UROProduct_Category2 = '';
var UROProduct_Category3 = '';
@@ -415,38 +301,26 @@
var UROAim_Price__c2 = '';
var UROAim_Price__c3 = '';
if (amountMap.URO.length > 0) {
+
UROProduct_Category1 = amountMap.URO[0].Product_Category__c;
if (amountMap.URO.length > 1) {
- UROProduct_Category2 =
- amountMap.URO[1].Product_Category__c;
+ UROProduct_Category2 = amountMap.URO[1].Product_Category__c;
}
if (amountMap.URO.length > 2) {
- UROProduct_Category3 =
- amountMap.URO[2].Product_Category__c;
+ UROProduct_Category3 = amountMap.URO[2].Product_Category__c;
}
UROAim_Price__c1 = amountMap.URO[0].Aim_Price__c;
UROAim_Price__c2 = amountMap.URO[1].Aim_Price__c;
UROAim_Price__c3 = amountMap.URO[2].Aim_Price__c;
- }
- component
- .find('select_URO1')
- .set('v.value', UROProduct_Category1);
- component
- .find('select_URO2')
- .set('v.value', UROProduct_Category2);
- component
- .find('select_URO3')
- .set('v.value', UROProduct_Category3);
- component
- .find('select_URO4_1')
- .set('v.value', UROAim_Price__c1);
- component
- .find('select_URO4_2')
- .set('v.value', UROAim_Price__c2);
- component
- .find('select_URO4_3')
- .set('v.value', UROAim_Price__c3);
+ }
+ component.find('select_URO1').set('v.value',UROProduct_Category1);
+ component.find('select_URO2').set('v.value',UROProduct_Category2);
+ component.find('select_URO3').set('v.value',UROProduct_Category3);
+ component.find('select_URO4_1').set('v.value',UROAim_Price__c1);
+ component.find('select_URO4_2').set('v.value',UROAim_Price__c2);
+ component.find('select_URO4_3').set('v.value',UROAim_Price__c3);
+
var GYNProduct_Category1 = '';
var GYNProduct_Category2 = '';
var GYNProduct_Category3 = '';
@@ -454,38 +328,26 @@
var GYNAim_Price__c2 = '';
var GYNAim_Price__c3 = '';
if (amountMap.GYN.length > 0) {
+
GYNProduct_Category1 = amountMap.GYN[0].Product_Category__c;
if (amountMap.GYN.length > 1) {
- GYNProduct_Category2 =
- amountMap.GYN[1].Product_Category__c;
+ GYNProduct_Category2 = amountMap.GYN[1].Product_Category__c;
}
if (amountMap.GYN.length > 2) {
- GYNProduct_Category3 =
- amountMap.GYN[2].Product_Category__c;
+ GYNProduct_Category3 = amountMap.GYN[2].Product_Category__c;
}
- GYNAim_Price__c1 = amountMap.GYN[0].Aim_Price__c;
+ GYNAim_Price__c1= amountMap.GYN[0].Aim_Price__c;
GYNAim_Price__c2 = amountMap.GYN[1].Aim_Price__c;
GYNAim_Price__c3 = amountMap.GYN[2].Aim_Price__c;
- }
- component
- .find('select_GYN1')
- .set('v.value', GYNProduct_Category1);
- component
- .find('select_GYN2')
- .set('v.value', GYNProduct_Category2);
- component
- .find('select_GYN3')
- .set('v.value', GYNProduct_Category3);
- component
- .find('select_GYN4_1')
- .set('v.value', GYNAim_Price__c1);
- component
- .find('select_GYN4_2')
- .set('v.value', GYNAim_Price__c2);
- component
- .find('select_GYN4_3')
- .set('v.value', GYNAim_Price__c3);
+ }
+ component.find('select_GYN1').set('v.value',GYNProduct_Category1);
+ component.find('select_GYN2').set('v.value',GYNProduct_Category2);
+ component.find('select_GYN3').set('v.value',GYNProduct_Category3);
+ component.find('select_GYN4_1').set('v.value',GYNAim_Price__c1);
+ component.find('select_GYN4_2').set('v.value',GYNAim_Price__c2);
+ component.find('select_GYN4_3').set('v.value',GYNAim_Price__c3);
+
var ENTProduct_Category1 = '';
var ENTProduct_Category2 = '';
var ENTProduct_Category3 = '';
@@ -493,48 +355,32 @@
var ENTAim_Price__c2 = '';
var ENTAim_Price__c3 = '';
if (amountMap.ENT.length > 0) {
+
ENTProduct_Category1 = amountMap.ENT[0].Product_Category__c;
if (amountMap.ENT.length > 1) {
- ENTProduct_Category2 =
- amountMap.ENT[1].Product_Category__c;
+ ENTProduct_Category2 = amountMap.ENT[1].Product_Category__c;
}
if (amountMap.ENT.length > 2) {
- ENTProduct_Category3 =
- amountMap.ENT[2].Product_Category__c;
+ ENTProduct_Category3 = amountMap.ENT[2].Product_Category__c;
}
ENTAim_Price__c1 = amountMap.ENT[0].Aim_Price__c;
ENTAim_Price__c2 = amountMap.ENT[1].Aim_Price__c;
ENTAim_Price__c3 = amountMap.ENT[2].Aim_Price__c;
- }
- component
- .find('select_ENT1')
- .set('v.value', ENTProduct_Category1);
- component
- .find('select_ENT2')
- .set('v.value', ENTProduct_Category2);
- component
- .find('select_ENT3')
- .set('v.value', ENTProduct_Category3);
- component
- .find('select_ENT4_1')
- .set('v.value', ENTAim_Price__c1);
- component
- .find('select_ENT4_2')
- .set('v.value', ENTAim_Price__c2);
- component
- .find('select_ENT4_3')
- .set('v.value', ENTAim_Price__c3);
- }
- });
- $A.enqueueAction(action);
- console.log(
- JSON.stringify(
- component.find('input-hos').get('v.body')[0].get('v')
- )
- );
+ }
+ component.find('select_ENT1').set('v.value',ENTProduct_Category1);
+ component.find('select_ENT2').set('v.value',ENTProduct_Category2);
+ component.find('select_ENT3').set('v.value',ENTProduct_Category3);
+ component.find('select_ENT4_1').set('v.value',ENTAim_Price__c1);
+ component.find('select_ENT4_2').set('v.value',ENTAim_Price__c2);
+ component.find('select_ENT4_3').set('v.value',ENTAim_Price__c3);
+
+ }
+ });
+ $A.enqueueAction(action);
+ console.log(JSON.stringify(component.find('input-hos').get("v.body")[0].get('v')));
},
- getOCMTerm: function () {
+ getOCMTerm : function() {
var today = new Date();
var year = today.getFullYear();
var month = today.getMonth();
@@ -545,243 +391,203 @@
return thisYearOCMPeriod;
},
- createTarget: function (component, event, helper) {
- var action = component.get('c.createSFTarget');
- // alert(component.get("v.GIAmount"));
+ createTarget : function(component, event, helper) {
+ var action = component.get("c.createSFTarget");
+ // alert(component.get("v.GIAmount"));
- var p1_1 = component.find('select_GI4_1').get('v.value');
- var p1_2 = component.find('select_GI4_2').get('v.value');
- var p1_3 = component.find('select_GI4_3').get('v.value');
- if (p1_1 == undefined || p1_1 == '') {
+
+ var p1_1 = component.find('select_GI4_1').get('v.value') ;
+ var p1_2 = component.find('select_GI4_2').get('v.value') ;
+ var p1_3 = component.find('select_GI4_3').get('v.value') ;
+
+ if (p1_1 == undefined || p1_1 == "") {
p1_1 = 0;
}
- if (p1_2 == undefined || p1_2 == '') {
+ if (p1_2 == undefined || p1_2 == "") {
p1_2 = 0;
}
- if (p1_3 == undefined || p1_3 == '') {
+ if (p1_3 == undefined || p1_3 == "") {
p1_3 = 0;
}
- console.warn(p1_1 + '-' + p1_2 + '-' + p1_3);
+ console.warn(p1_1+"-"+p1_2+"-"+p1_3);
- var p2_1 = component.find('select_ET4_1').get('v.value');
- var p2_2 = component.find('select_ET4_2').get('v.value');
- var p2_3 = component.find('select_ET4_3').get('v.value');
- if (p2_1 == undefined || p2_1 == '') {
+ var p2_1 = component.find('select_ET4_1').get('v.value') ;
+ var p2_2 = component.find('select_ET4_2').get('v.value') ;
+ var p2_3 = component.find('select_ET4_3').get('v.value') ;
+ if (p2_1 == undefined || p2_1 == "") {
p2_1 = 0;
}
- if (p2_2 == undefined || p2_2 == '') {
+ if (p2_2 == undefined || p2_2 == "") {
p2_2 = 0;
}
- if (p2_3 == undefined || p2_3 == '') {
+ if (p2_3 == undefined || p2_3 == "") {
p2_3 = 0;
}
- var p3_1 = component.find('select_BF4_1').get('v.value');
- var p3_2 = component.find('select_BF4_2').get('v.value');
- var p3_3 = component.find('select_BF4_3').get('v.value');
- if (p3_1 == undefined || p3_1 == '') {
+
+ var p3_1 = component.find('select_BF4_1').get('v.value') ;
+ var p3_2 = component.find('select_BF4_2').get('v.value') ;
+ var p3_3 = component.find('select_BF4_3').get('v.value') ;
+ if (p3_1 == undefined || p3_1 == "") {
p3_1 = 0;
}
- if (p3_2 == undefined || p3_2 == '') {
+ if (p3_2 == undefined || p3_2 == "") {
p3_2 = 0;
}
- if (p3_3 == undefined || p3_3 == '') {
+ if (p3_3 == undefined || p3_3 == "") {
p3_3 = 0;
}
- var p4_1 = component.find('select_OTH4_1').get('v.value');
- var p4_2 = component.find('select_OTH4_2').get('v.value');
- var p4_3 = component.find('select_OTH4_3').get('v.value');
- if (p4_1 == undefined || p4_1 == '') {
+
+
+ var p4_1 = component.find('select_OTH4_1').get('v.value') ;
+ var p4_2 = component.find('select_OTH4_2').get('v.value') ;
+ var p4_3 = component.find('select_OTH4_3').get('v.value') ;
+ if (p4_1 == undefined || p4_1 == "") {
p4_1 = 0;
}
- if (p4_2 == undefined || p4_2 == '') {
+ if (p4_2 == undefined || p4_2 == "") {
p4_2 = 0;
}
- if (p4_3 == undefined || p4_3 == '') {
+ if (p4_3 == undefined || p4_3 == "") {
p4_3 = 0;
}
- var p5_1 = component.find('select_GS4_1').get('v.value');
- var p5_2 = component.find('select_GS4_2').get('v.value');
- var p5_3 = component.find('select_GS4_3').get('v.value');
- if (p5_1 == undefined || p5_1 == '') {
+
+
+ var p5_1 = component.find('select_GS4_1').get('v.value') ;
+ var p5_2 = component.find('select_GS4_2').get('v.value') ;
+ var p5_3 = component.find('select_GS4_3').get('v.value') ;
+ if (p5_1 == undefined || p5_1 == "") {
p5_1 = 0;
}
- if (p5_2 == undefined || p5_2 == '') {
+ if (p5_2 == undefined || p5_2 == "") {
p5_2 = 0;
}
- if (p5_3 == undefined || p5_3 == '') {
+ if (p5_3 == undefined || p5_3 == "") {
p5_3 = 0;
}
- var p6_1 = component.find('select_URO4_1').get('v.value');
- var p6_2 = component.find('select_URO4_2').get('v.value');
- var p6_3 = component.find('select_URO4_3').get('v.value');
- if (p6_1 == undefined || p6_1 == '') {
+
+
+ var p6_1 = component.find('select_URO4_1').get('v.value') ;
+ var p6_2 = component.find('select_URO4_2').get('v.value') ;
+ var p6_3 = component.find('select_URO4_3').get('v.value') ;
+ if (p6_1 == undefined || p6_1 == "") {
p6_1 = 0;
}
- if (p6_2 == undefined || p6_2 == '') {
+ if (p6_2 == undefined || p6_2 == "") {
p6_2 = 0;
}
- if (p6_3 == undefined || p6_3 == '') {
+ if (p6_3 == undefined || p6_3 == "") {
p6_3 = 0;
}
- var p7_1 = component.find('select_GYN4_1').get('v.value');
- var p7_2 = component.find('select_GYN4_2').get('v.value');
- var p7_3 = component.find('select_GYN4_3').get('v.value');
- if (p7_1 == undefined || p7_1 == '') {
+ var p7_1 = component.find('select_GYN4_1').get('v.value') ;
+ var p7_2 = component.find('select_GYN4_2').get('v.value') ;
+ var p7_3 = component.find('select_GYN4_3').get('v.value') ;
+ if (p7_1 == undefined || p7_1 == "") {
p7_1 = 0;
}
- if (p7_2 == undefined || p7_2 == '') {
+ if (p7_2 == undefined || p7_2 == "") {
p7_2 = 0;
}
- if (p7_3 == undefined || p7_3 == '') {
+ if (p7_3 == undefined || p7_3 == "") {
p7_3 = 0;
}
- var p8_1 = component.find('select_ENT4_1').get('v.value');
- var p8_2 = component.find('select_ENT4_2').get('v.value');
- var p8_3 = component.find('select_ENT4_3').get('v.value');
- if (p8_1 == undefined || p8_1 == '') {
+
+
+ var p8_1 = component.find('select_ENT4_1').get('v.value') ;
+ var p8_2 = component.find('select_ENT4_2').get('v.value') ;
+ var p8_3 = component.find('select_ENT4_3').get('v.value') ;
+ if (p8_1 == undefined || p8_1 == "") {
p8_1 = 0;
}
- if (p8_2 == undefined || p8_2 == '') {
+ if (p8_2 == undefined || p8_2 == "") {
p8_2 = 0;
}
- if (p8_3 == undefined || p8_3 == '') {
+ if (p8_3 == undefined || p8_3 == "") {
p8_3 = 0;
}
- action.setParams({
- hospitalId: component.get('v.record.Agency_Hospital__c'),
- GIProduct: [
- component.find('select_GI1').get('v.value'),
- component.find('select_GI2').get('v.value'),
- component.find('select_GI3').get('v.value'),
- p1_1,
- p1_2,
- p1_3
- ],
- ETProduct: [
- component.find('select_ET1').get('v.value'),
- component.find('select_ET2').get('v.value'),
- component.find('select_ET3').get('v.value'),
- p2_1,
- p2_2,
- p2_3
- ],
- BFProduct: [
- component.find('select_BF1').get('v.value'),
- component.find('select_BF2').get('v.value'),
- component.find('select_BF3').get('v.value'),
- p3_1,
- p3_2,
- p3_3
- ],
- OTHProduct: [
- component.find('select_OTH1').get('v.value'),
- component.find('select_OTH2').get('v.value'),
- component.find('select_OTH3').get('v.value'),
- p4_1,
- p4_2,
- p4_3
- ],
- GSProduct: [
- component.find('select_GS1').get('v.value'),
- component.find('select_GS2').get('v.value'),
- component.find('select_GS3').get('v.value'),
- p5_1,
- p5_2,
- p5_3
- ],
- UROProduct: [
- component.find('select_URO1').get('v.value'),
- component.find('select_URO2').get('v.value'),
- component.find('select_URO3').get('v.value'),
- p6_1,
- p6_2,
- p6_2
- ],
- GYNProduct: [
- component.find('select_GYN1').get('v.value'),
- component.find('select_GYN2').get('v.value'),
- component.find('select_GYN3').get('v.value'),
- p7_1,
- p7_2,
- p7_3
- ],
- ENTProduct: [
- component.find('select_ENT1').get('v.value'),
- component.find('select_ENT2').get('v.value'),
- component.find('select_ENT3').get('v.value'),
- p8_1,
- p8_2,
- p8_3
- ],
- OCMTerm: component.get('v.OCMTerm')
- });
- action.setCallback(this, function (response) {
- console.warn(response);
- var state = response.getState();
- if (state === 'SUCCESS') {
- var modal_window = component.find('modal_window');
- var modal_bg = component.find('modal_bg');
- $A.util.toggleClass(modal_window, 'disp_none');
- $A.util.toggleClass(modal_bg, 'disp_none');
- var toastEvent = $A.get('e.force:showToast');
+
+
+ action.setParams({
+ "hospitalId" : component.get("v.record.Agency_Hospital__c"),
+ "GIProduct" : [component.find('select_GI1').get('v.value'),component.find('select_GI2').get('v.value'),component.find('select_GI3').get('v.value'),p1_1,p1_2,p1_3],
+ "ETProduct" : [component.find('select_ET1').get('v.value'),component.find('select_ET2').get('v.value'),component.find('select_ET3').get('v.value'),p2_1, p2_2,p2_3 ],
+ "BFProduct" : [component.find('select_BF1').get('v.value'),component.find('select_BF2').get('v.value'),component.find('select_BF3').get('v.value'),p3_1 ,p3_2 ,p3_3 ],
+ "OTHProduct" : [component.find('select_OTH1').get('v.value'),component.find('select_OTH2').get('v.value'),component.find('select_OTH3').get('v.value'),p4_1,p4_2 ,p4_3],
+ "GSProduct" : [component.find('select_GS1').get('v.value'),component.find('select_GS2').get('v.value'),component.find('select_GS3').get('v.value'),p5_1,p5_2,p5_3],
+ "UROProduct" : [component.find('select_URO1').get('v.value'),component.find('select_URO2').get('v.value'),component.find('select_URO3').get('v.value'),p6_1,p6_2 ,p6_2 ],
+ "GYNProduct" : [component.find('select_GYN1').get('v.value'),component.find('select_GYN2').get('v.value'),component.find('select_GYN3').get('v.value'),p7_1,p7_2 ,p7_3 ],
+ "ENTProduct" : [component.find('select_ENT1').get('v.value'),component.find('select_ENT2').get('v.value'),component.find('select_ENT3').get('v.value'),p8_1 ,p8_2 ,p8_3],
+ "OCMTerm" : component.get("v.OCMTerm")
+ });
+ action.setCallback(this, function(response) {
+ console.warn(response);
+ var state = response.getState();
+ if (state === "SUCCESS") {
+ var modal_window = component.find('modal_window');
+ var modal_bg = component.find('modal_bg');
+ $A.util.toggleClass(modal_window, 'disp_none');
+ $A.util.toggleClass(modal_bg, 'disp_none');
+
+ var toastEvent = $A.get("e.force:showToast");
toastEvent.setParams({
- title: '鎴愬姛',
- type: 'success',
- message: '淇濆瓨鎴愬姛'
+ title: "鎴愬姛",
+ type:"success",
+ message: "淇濆瓨鎴愬姛"
});
toastEvent.fire();
$A.get('e.force:refreshView').fire();
- } else if (state === 'INCOMPLETE') {
- var toastEvent = $A.get('e.force:showToast');
+ } else if (state === "INCOMPLETE") {
+ var toastEvent = $A.get("e.force:showToast");
toastEvent.setParams({
- title: '鏈畬鎴�!',
- type: 'error',
- message: '鏈畬鎴�'
+ title: "鏈畬鎴�!",
+ type:"error",
+ message: "鏈畬鎴�"
});
toastEvent.fire();
- } else if (state === 'ERROR') {
- var errors = response.getError();
- var toastEvent = $A.get('e.force:showToast');
+ } else if (state === "ERROR") {
+ var errors = response.getError();
+ var toastEvent = $A.get("e.force:showToast");
toastEvent.setParams({
- title: '閿欒',
- type: 'error',
+ title: "閿欒",
+ type:"error",
message: errors[0].message
});
toastEvent.fire();
- }
- });
- $A.enqueueAction(action);
+
+ }
+ });
+ $A.enqueueAction(action);
},
- warning: function (message) {
- var toastEvent = $A.get('e.force:showToast');
+ warning : function(message) {
+ var toastEvent = $A.get("e.force:showToast");
toastEvent.setParams({
- title: '璀﹀憡!',
+ title: "璀﹀憡!",
message: message,
- type: 'warning',
- duration: '10000'
+ type:"warning",
+ duration : "10000"
+ });
+ toastEvent.fire();
+ },
+
+ error : function(message) {
+ var toastEvent = $A.get("e.force:showToast");
+ toastEvent.setParams({
+ title: "閿欒!",
+ message: message,
+ type:"error",
+ duration : "10000"
});
toastEvent.fire();
},
- error: function (message) {
- var toastEvent = $A.get('e.force:showToast');
- toastEvent.setParams({
- title: '閿欒!',
- message: message,
- type: 'error',
- duration: '10000'
- });
- toastEvent.fire();
- }
-});
+})
\ No newline at end of file
diff --git a/force-app/main/default/aura/DealerPersonnelInformationImport/DealerPersonnelInformationImport.cmp b/force-app/main/default/aura/DealerPersonnelInformationImport/DealerPersonnelInformationImport.cmp
index 10aa3b5..83c0c1a 100644
--- a/force-app/main/default/aura/DealerPersonnelInformationImport/DealerPersonnelInformationImport.cmp
+++ b/force-app/main/default/aura/DealerPersonnelInformationImport/DealerPersonnelInformationImport.cmp
@@ -1,27 +1,21 @@
-<aura:component
- controller="DealerPersonnelController"
+<!--
+ * @Author: Thhto 997058689@qq.com
+ * @Date: 2022-07-08 10:47:25
+ * @LastEditors: Thhto 997058689@qq.com
+ * @LastEditTime: 2023-02-03 15:25:46
+ * @FilePath: \ceshihuanj\force-app\main\default\aura\DealerPersonnelInformationImport\DealerPersonnelInformationImport.cmp
+ * @Description: 杩欐槸榛樿璁剧疆,璇疯缃甡customMade`, 鎵撳紑koroFileHeader鏌ョ湅閰嶇疆 杩涜璁剧疆: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
+-->
+<aura:component controller="DealerPersonnelController"
implements="force:appHostable,flexipage:availableForAllPageTypes,flexipage:availableForRecordHome,force:hasRecordId,force:lightningQuickAction,forceCommunity:availableForAllPageTypes"
- access="global"
->
+ access="global">
<!-- 鎵归噺娣诲姞鍛ㄦ姤 start-->
<!-- <aura:handler name="init" value="{!this}" action="{!c.doInit}" /> -->
<aura:attribute name="reports_date" type="List" />
<aura:attribute name="errorMessage" type="String" />
- <aura:attribute
- name="TableContent"
- type="String"
- description=" Show the Result class"
- />
- <aura:attribute
- name="TableContent2"
- type="String"
- description=" Show the Result class"
- />
- <aura:attribute
- name="TargetFileName"
- type="String"
- description="Name of the file"
- />
+ <aura:attribute name="TableContent" type="String" description=" Show the Result class" />
+ <aura:attribute name="TableContent2" type="String" description=" Show the Result class" />
+ <aura:attribute name="TargetFileName" type="String" description="Name of the file" />
<aura:attribute name="tableheaders" type="Object[]" />
<aura:attribute name="fileContentData" type="String" />
<aura:attribute name="filename" type="String" />
@@ -40,10 +34,7 @@
<!-- 鎵归噺娣诲姞鍛ㄦ姤 end-->
<aura:renderIf isTrue="{!v.login}">
<div class="slds-spinner_container height100vh">
- <div
- class="slds-spinner--brand slds-spinner slds-spinner--medium"
- role="alert"
- >
+ <div class="slds-spinner--brand slds-spinner slds-spinner--medium" role="alert">
<span class="slds-assistive-text">Loading</span>
<div class="slds-spinner__dot-a"></div>
<div class="slds-spinner__dot-b"></div>
@@ -51,31 +42,20 @@
</div>
</aura:renderIf>
<!-- 鎵归噺娣诲姞鍛ㄦ姤 start-->
- <div
- class="slds-modal slds-fade-in-open slds-hide"
- aura:id="errorDiv"
- style="z-index: 10001"
- >
- <ui:inputText aura:id="articleURL" />
- <div class="demo-only" style="height: 8rem">
+ <div class="slds-modal slds-fade-in-open slds-hide" aura:id="errorDiv" style="z-index: 10001">
+ <!-- <ui:inputText aura:id="articleURL" /> -->
+ <div class="demo-only" style="height: 8rem;">
<div class="slds-notify_container slds-is-relative">
- <div
- class="slds-notify slds-notify_toast slds-theme_error"
- role="status"
- >
- <div class="slds-m-left_xx-large">
+ <div class="slds-notify slds-notify_toast slds-theme_error" role="status">
+ <div class=" slds-m-left_xx-large">
<div
- class="slds-notify__content slds-m-left_small slds-align_absolute-center slds-m-left_xx-large"
- >
- <lightning:icon
- alternativeText="error"
- iconName="utility:error"
- size="small"
- class="buttonColor slds-m-right_small"
- />
- <h2 class="slds-text-heading_small">
- {!v.errorMessage}
- </h2>
+ class="slds-notify__content slds-m-left_small slds-align_absolute-center slds-m-left_xx-large">
+ <lightning:icon alternativeText="error" iconName="utility:error" size="small"
+ class="buttonColor slds-m-right_small" />
+ <!-- DB202301262139 SFDC缁忛攢鍟嗕汉鍛樺鍏ュ姛鑳芥敼杩� start -->
+ <!-- <h2 class="slds-text-heading_small ">{!v.errorMessage}</h2> -->
+ <pre class="slds-text-heading_small ">{!v.errorMessage}</pre>
+ <!-- DB202301262139 SFDC缁忛攢鍟嗕汉鍛樺鍏ュ姛鑳芥敼杩� end -->
</div>
</div>
</div>
@@ -83,99 +63,56 @@
</div>
</div>
<div class="slds-modal slds-fade-in-open slds-hide" aura:id="successDiv01">
- <ui:inputText aura:id="articleURL" />
- <div class="demo-only" style="height: 8rem">
+ <!-- <ui:inputText aura:id="articleURL" /> -->
+ <div class="demo-only" style="height: 8rem;">
<div class="slds-notify_container slds-is-relative">
- <div
- class="slds-notify slds-notify_toast slds-theme_success"
- role="alert"
- >
- <div class="slds-m-left_xx-large">
+ <div class="slds-notify slds-notify_toast slds-theme_success" role="alert">
+ <div class=" slds-m-left_xx-large">
<div
- class="slds-notify__content slds-m-left_small slds-align_absolute-center slds-m-left_xx-large"
- >
- <lightning:icon
- alternativeText="Success"
- iconName="utility:success"
- size="small"
- class="buttonColor slds-m-right_small"
- />
- <h2 class="slds-text-heading_small">
- {!v.successMessage}
- </h2>
+ class="slds-notify__content slds-m-left_small slds-align_absolute-center slds-m-left_xx-large">
+ <lightning:icon alternativeText="Success" iconName="utility:success" size="small"
+ class="buttonColor slds-m-right_small" />
+ <h2 class="slds-text-heading_small ">{!v.successMessage}</h2>
</div>
</div>
</div>
</div>
</div>
</div>
- <div>
- <div class="slds-modal__header">
+ <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"
- >
+ <div class="slds-modal__content slds-scrollable slds-grow slds-p-around--medium ">
<aura:if isTrue="{!v.showMain}">
<div>
<center>
- <lightning:input
- type="file"
- class="file"
- uara:id="file"
- onchange="{!c.CreateRecord}"
- />
+ <lightning:input type="file" class="file" uara:id="file" onchange="{!c.CreateRecord}" />
</center>
</div>
<aura:set attribute="else">
- <ui:outputRichText
- class="uiOutputRichText slds-m--around-large"
- value="{!v.TableContent}"
- />
- <div
- class="slds-p-around--large slds-align--absolute-center"
- >
- <lightning:button
- label="淇濆瓨"
- variant="brand"
- onclick="{!c.processFileContent}"
- />
- <lightning:button
- label="鍙栨秷"
- variant="brand"
- onclick="{!c.cancel}"
- />
+ <ui:outputRichText class="uiOutputRichText slds-m--around-large" value="{!v.TableContent}" />
+ <div class="slds-p-around--large slds-align--absolute-center">
+ <lightning:button aura:id="save_con" label="淇濆瓨" variant="brand" onclick="{!c.processFileContent}" disabled="false" />
+ <lightning:button label="鍙栨秷" variant="brand" onclick="{!c.cancel}" />
</div>
<aura:if isTrue="{!v.showErrorInfo}">
- <div
- class="slds-p-around--large slds-align--absolute-center"
- >
- <lightning:button
- label="瀵煎嚭閿欒淇℃伅"
- variant="brand"
- onclick="{!c.exportErrorInfo}"
- />
+ <div class="slds-p-around--large slds-align--absolute-center">
+ <lightning:button label="瀵煎嚭閿欒淇℃伅" variant="brand" onclick="{!c.exportErrorInfo}" />
</div>
- <div
- class="slds-p-around--large slds-align--absolute-center"
- >
- <div style="height: 300px; overflow-x: scroll">
- <lightning:datatable
- keyField="id"
- data="{! v.errorData }"
- columns="{! v.errorColumns }"
- hideCheckboxColumn="true"
- minColumnWidth="120"
- />
+ <div class="slds-p-around--large slds-align--absolute-center">
+ <div style="height: 300px;overflow-x:scroll">
+ <lightning:datatable keyField="id" data="{! v.errorData }" columns="{! v.errorColumns }"
+ hideCheckboxColumn="true"/>
</div>
</div>
</aura:if>
</aura:set>
</aura:if>
</div>
+
</div>
<!-- 鎵归噺娣诲姞鍛ㄦ姤 end-->
-</aura:component>
+
+</aura:component>
\ No newline at end of file
diff --git a/force-app/main/default/aura/DealerPersonnelInformationImport/DealerPersonnelInformationImportController.js b/force-app/main/default/aura/DealerPersonnelInformationImport/DealerPersonnelInformationImportController.js
index a2f994a..91dbcfc 100644
--- a/force-app/main/default/aura/DealerPersonnelInformationImport/DealerPersonnelInformationImportController.js
+++ b/force-app/main/default/aura/DealerPersonnelInformationImport/DealerPersonnelInformationImportController.js
@@ -1,17 +1,17 @@
({
- CreateRecord: function (component, event, helper) {
- var files = event.getSource().get('v.files');
- helper.readFile(component, helper, files[0]);
+ CreateRecord : function(component, event, helper){
+ var files = event.getSource().get("v.files");
+ helper.readFile(component,helper,files[0]);
},
- processFileContent: function (component, event, helper) {
- component.set('v.showErrorInfo', false);
- helper.saveRecords(component, event, helper);
+ processFileContent : function(component,event,helper){
+ component.set("v.showErrorInfo",false);
+ helper.saveRecords(component,event,helper);
},
- cancel: function (component, event, helper) {
- component.set('v.showMain', true);
+ cancel : function(component,event,helper){
+ component.set("v.showMain",true);
},
- exportErrorInfo: function (component, event, helper) {
+ exportErrorInfo: function(component,event,helper){
console.log('enter exportErrorInfo');
helper.exportErrorInfoHelper(component);
- }
-});
+ },
+})
\ No newline at end of file
diff --git a/force-app/main/default/aura/DealerPersonnelInformationImport/DealerPersonnelInformationImportHelper.js b/force-app/main/default/aura/DealerPersonnelInformationImport/DealerPersonnelInformationImportHelper.js
index c3c47b7..cbd114b 100644
--- a/force-app/main/default/aura/DealerPersonnelInformationImport/DealerPersonnelInformationImportHelper.js
+++ b/force-app/main/default/aura/DealerPersonnelInformationImport/DealerPersonnelInformationImportHelper.js
@@ -17,90 +17,81 @@
break; // noop
default:
alert('An error occurred reading this file.');
- }
- };
+ };
+ }
reader.onabort = function (e) {
alert('File read cancelled');
};
reader.onloadstart = function (e) {
- var output =
- '<ui type="disc"><li><strong>' +
- file.name +
- '</strong> (' +
- file.type +
- ')- ' +
- file.size +
- 'bytes, last modified: ' +
- file.lastModifiedDate.toLocaleDateString() +
- '</li></ui>';
- component.set('v.filename', file.name);
- component.set('v.TargetFileName', output);
+ var output = '<ui type=\"disc\"><li><strong>' + file.name + '</strong> (' + file.type + ')- ' + file.size + 'bytes, last modified: ' + file.lastModifiedDate.toLocaleDateString() + '</li></ui>';
+ component.set("v.filename", file.name);
+ component.set("v.TargetFileName", output);
};
reader.onload = function (e) {
var data = e.target.result;
// data.replace(/\n/,"")
var allTextLines11 = data.split(/\r/);
var s = allTextLines11.toString();
- component.set('v.fileContentData', s);
- console.log('file dataqqq' + JSON.stringify(s));
+ component.set("v.fileContentData", s);
+ console.log("file dataqqq" + JSON.stringify(s));
var allTextLines = data.split(/\r\n|\n/);
var dataRows = allTextLines.length - 1;
var headers = allTextLines[0].split(',');
- var numOfRows = component.get('v.NumOfRecords');
- if (
- dataRows > numOfRows + 1 ||
- dataRows == 1 ||
- dataRows == 0
- ) {
- alert('File Rows between 1 to ' + numOfRows + ' .');
- component.set('v.showMain', true);
- } else {
+ var numOfRows = component.get("v.NumOfRecords");
+ if (dataRows > numOfRows + 1 || dataRows == 1 || dataRows == 0) {
+ alert("File Rows between 1 to " + numOfRows + " .");
+ component.set("v.showMain", true);
+ }
+ else {
var lines = [];
var filecontentdata;
- var content =
- '<table class="table slds-table slds-table--bordered slds-table--cell-buffer">';
- content += '<thead><tr class="slds-text-title--caps">';
- content += '<th scope="col">' + '琛屽彿' + '</th>';
+ var content = "<table class=\"table slds-table slds-table--bordered slds-table--cell-buffer\">";
+ content += "<thead><tr class=\"slds-text-title--caps\">";
+ content += '<th scope=\"col"\>' + '琛屽彿' + '</th>';
for (i = 0; i < headers.length; i++) {
- content += '<th scope="col">' + headers[i] + '</th>';
+ content += '<th scope=\"col"\>' + headers[i] + '</th>';
}
- content += '</tr></thead>';
+ content += "</tr></thead>";
for (var i = 1; i < allTextLines.length; i++) {
filecontentdata = allTextLines[i].split(',');
if (filecontentdata[0] != '') {
- content += '<tr>';
- content += '<td>' + i + '</td>';
+ content += "<tr>";
+ content += "<td>" + i + "</td>";
for (var j = 0; j < filecontentdata.length; j++) {
- content +=
- '<td>' + filecontentdata[j] + '</td>';
+ content += '<td>' + filecontentdata[j] + '</td>';
}
- content += '</tr>';
+ content += "</tr>";
}
}
- content += '</table>';
+ content += "</table>";
console.log(content);
- component.set('v.TableContent', content);
- component.set('v.showMain', false);
+ component.set("v.TableContent", content);
+ component.set("v.showMain", false);
}
- };
+ }
reader.readAsText(file, 'gb2312');
+
}
var reader = new FileReader();
- reader.onloadend = function () {};
+ reader.onloadend = function () {
+ };
reader.readAsDataURL(file);
+ },
+ isNumber: function(str) {
+ return /^\d+$/.test(str);
},
saveRecords: function (component, event, helper) {
component.set('v.login', true);
- var action = component.get('c.processData');
+ var action = component.get("c.processData");
var fieldsList = ['Name', 'Phone', 'AccountNumber']; //Please write your code dynamic fields
action.setParams({
- fileData: component.get('v.fileContentData'),
+ fileData: component.get("v.fileContentData"),
sobjectName: 'Account', //Any object
fields: fieldsList
});
action.setCallback(this, function (response) {
var state = response.getState();
- if (state === 'SUCCESS') {
+ if (state === "SUCCESS") {
var res = response.getReturnValue();
var res1 = '';
if (res != 'success') {
@@ -108,178 +99,146 @@
console.log(ress);
let errorDatas = [];
let errorDataRow = [];
- debugger;
+ debugger
for (var i = 0; i < ress.length; i++) {
res1 += ress[i].substr(7) + '\n';
if (ress[i] != '') {
- let errorData = {};
- let index = errorDataRow.indexOf(
- ress[i].substr(7).substring(1, 2)
- );
+ let errorData = {}
+ if(!this.isNumber(ress[i].substr(7).substring(1, 2))){
+ continue
+ }
+ let index = errorDataRow.indexOf(ress[i].substr(7).substring(1, 2));
if (index == -1) {
- errorData.errorRow = ress[i]
- .substr(7)
- .substring(1, 2);
+ errorData.errorRow = ress[i].substr(7).substring(1, 2);
errorDataRow.push(errorData.errorRow);
- errorData.errorInfo = ress[i]
- .substr(7)
- .substring(6);
+ errorData.errorInfo = ress[i].substr(7).substring(5);
errorDatas.push(errorData);
} else {
- errorDatas[index].errorInfo +=
- '; ' + ress[i].substr(7).substring(6);
+ errorDatas[index].errorInfo += '; ' + ress[i].substr(7).substring(5);
}
}
}
- var fileContentData = component
- .get('v.fileContentData')
- .split('\n');
+ var fileContentData = component.get("v.fileContentData").split('\n');
let errorColumns = [
- {
- label: '閿欒琛�',
- fieldName: 'errorRow',
- type: 'text',
- hideDefaultActions: true,
- initialWidth: 50
- },
- {
- label: '閿欒淇℃伅',
- fieldName: 'errorInfo',
- type: 'text',
- hideDefaultActions: true,
- initialWidth: 300,
- wrapText: true
- }
+ { label: '閿欒琛�', fieldName: 'errorRow', type: 'text', hideDefaultActions: true, initialWidth: 100 },
+ { label: '閿欒淇℃伅', fieldName: 'errorInfo', type: 'text', hideDefaultActions: true,initialWidth: 300,wrapText: true }
];
- for (
- var i = 0;
- i < fileContentData[0].split(',').length - 1;
- i++
- ) {
+ for (var i = 0; i < fileContentData[0].split(',').length - 1; i++) {
errorColumns.push({
- label: fileContentData[0].split(',')[i],
- fieldName: 'field' + i,
- type: 'text',
+ label: fileContentData[0].split(',')[i],
+ fieldName: 'field' + i,
+ type: 'text',
hideDefaultActions: true,
- wrapText: true
+ wrapText: true,
+ initialWidth: 120
});
}
-
- for (var i = 0; i < errorDatas.length; i++) {
+
+ for(var i = 0; i < errorDatas.length; i++){
let data = fileContentData[errorDatas[i].errorRow];
console.log('data = ' + JSON.stringify(data));
- for (var j = 0; j < data.split(',').length; j++) {
- let label = 'field' + j;
- errorDatas[i][label] = data.split(',')[j];
+ if(data){
+ for(var j = 0; j < data.split(',').length; j++){
+ let label = 'field' + j;
+ errorDatas[i][label] = data.split(',')[j];
+ }
}
}
- console.log('errorDatas = ' + JSON.stringify(errorDatas));
-
+ console.log('errorDatas = ' + JSON.stringify(errorDatas))
+
component.set('v.errorColumns', errorColumns);
component.set('v.errorData', errorDatas);
- component.set('v.showErrorInfo', true);
+ component.set("v.showErrorInfo", true);
- console.log('==' + res1);
+ console.log("==" + res1);
// this.error( "璇蜂慨鏀瑰悗閲嶆柊涓婁紶");
- component.set('v.errorMessage', res1 + '璇蜂慨鏀瑰悗閲嶆柊涓婁紶');
+ component.set('v.errorMessage', res1 + "璇蜂慨鏀瑰悗閲嶆柊涓婁紶");
this.showErrorToast(component);
component.set('v.login', false);
+ component.find('save_con').set('v.disabled', true);
} else {
// this.success('瀵煎叆鎴愬姛');
component.set('v.successMessage', '瀵煎叆鎴愬姛');
this.showSuccessToast01(component);
- component.set('v.showMain', true);
+ component.set("v.showMain", true);
component.set('v.login', false);
+ component.find('save_con').set('v.disabled', false);
}
- } else if (state === 'INCOMPLETE') {
+ }
+ else if (state === "INCOMPLETE") {
component.set('v.login', false);
- } else if (state === 'ERROR') {
+ }
+ else if (state === "ERROR") {
var errors = response.getError();
if (errors) {
if (errors[0] && errors[0].message) {
- console.log('Error message: ' + errors[0].message);
- let errorDatas = [
- {
- errorRow: '1',
- errorInfo: errors[0].message
- }
- ];
+ console.log("Error message: " + errors[0].message);
+ let errorDatas = [{
+ errorRow: '1',
+ errorInfo: errors[0].message
+ }];
let errorColumns = [
- {
- label: '閿欒琛�',
- fieldName: 'errorRow',
- type: 'text',
- hideDefaultActions: true,
- initialWidth: 50
- },
- {
- label: '閿欒淇℃伅',
- fieldName: 'errorInfo',
- type: 'text',
- hideDefaultActions: true,
- initialWidth: 300,
- wrapText: true
- }
+ { label: '閿欒琛�', fieldName: 'errorRow', type: 'text', hideDefaultActions: true, initialWidth: 50 },
+ { label: '閿欒淇℃伅', fieldName: 'errorInfo', type: 'text', hideDefaultActions: true,initialWidth: 300,wrapText: true }
];
component.set('v.errorData', errorDatas);
component.set('v.errorColumns', errorColumns);
- component.set('v.showErrorInfo', true);
+ component.set("v.showErrorInfo", true);
component.set('v.login', false);
}
} else {
- console.log('Unknown error');
+ console.log("Unknown error");
component.set('v.login', false);
}
}
});
$A.enqueueAction(action);
+
},
//寮瑰嚭 鎴愬姛鎻愮ず
showSuccessToast01: function (component) {
$A.util.removeClass(component.find('successDiv01'), 'slds-hide');
- window.setTimeout(
- $A.getCallback(function () {
- $A.util.addClass(component.find('successDiv01'), 'slds-hide');
- }),
+ window.setTimeout($A.getCallback(function () {
+ $A.util.addClass(component.find('successDiv01'), 'slds-hide');
+ }),
3000
);
},
//寮瑰嚭 閿欒鎻愮ず
showErrorToast: function (component) {
$A.util.removeClass(component.find('errorDiv'), 'slds-hide');
- window.setTimeout(
- $A.getCallback(function () {
- $A.util.addClass(component.find('errorDiv'), 'slds-hide');
- }),
- 4000
+ window.setTimeout($A.getCallback(function () {
+ $A.util.addClass(component.find('errorDiv'), 'slds-hide');
+ }),
+ 7000
);
},
success: function (message) {
- var toastEvent = $A.get('e.force:showToast');
+ var toastEvent = $A.get("e.force:showToast");
toastEvent.setParams({
- title: '鎴愬姛!',
- message: message,
- duration: '5000'
+ "title": "鎴愬姛!",
+ "message": message,
+ "duration": "5000"
});
toastEvent.fire();
},
warning: function (message) {
- var toastEvent = $A.get('e.force:showToast');
+ var toastEvent = $A.get("e.force:showToast");
toastEvent.setParams({
- title: '璀﹀憡!',
- message: message,
- duration: '10000'
+ "title": "璀﹀憡!",
+ "message": message,
+ "duration": "10000"
});
toastEvent.fire();
},
error: function (message) {
- var toastEvent = $A.get('e.force:showToast');
+ var toastEvent = $A.get("e.force:showToast");
toastEvent.setParams({
- title: '閿欒!',
- message: message,
- duration: 'sticky'
+ "title": "閿欒!",
+ "message": message,
+ "duration": "sticky"
});
toastEvent.fire();
},
@@ -290,7 +249,7 @@
var datas = [];
let errorColumnsArray = [];
- for (var i in errorColumns) {
+ for(var i in errorColumns){
errorColumnsArray.push(errorColumns[i].label);
}
datas.push(errorColumnsArray);
@@ -298,22 +257,22 @@
for (var i in errorData) {
let data = [];
- data.push(errorData[i].errorRow);
- data.push(errorData[i].errorInfo);
- for (var j = 0; j < Object.keys(errorData[i]).length - 2; j++) {
- data.push(errorData[i]['field' + j]);
+ data.push(errorData[i].errorRow)
+ data.push(errorData[i].errorInfo)
+ for(var j = 0 ; j < Object.keys(errorData[i]).length - 2 ; j++){
+ data.push(errorData[i]['field' + j])
}
datas.push(data);
}
console.log('datas = ' + JSON.stringify(datas));
var csv = this.convertToCSV(component, datas);
- console.log('csv = ' + JSON.stringify(csv));
+ console.log('csv = ' + JSON.stringify(csv))
this.downloadCSV(component, csv);
},
convertToCSV: function (component, data) {
- console.log('enter convertToCSV');
+ console.log('enter convertToCSV')
console.log('data = ' + data);
var csv = '';
for (var i = 0; i < data.length; i++) {
@@ -323,11 +282,7 @@
var val = '';
val = row[j] === null ? '' : row[j].toString();
console.log('val = ' + val);
- if (
- val.indexOf(',') !== -1 ||
- val.indexOf('"') !== -1 ||
- val.indexOf('\n') !== -1
- ) {
+ if (val.indexOf(',') !== -1 || val.indexOf('"') !== -1 || val.indexOf('\n') !== -1) {
//val = '"' + val.replace(/"/g,'""') + '"';
}
if (j > 0) {
@@ -343,13 +298,13 @@
downloadCSV: function (component, csv) {
var link = document.createElement('a');
// 璁剧疆瀛楃闆嗗拰鏂囦欢澶�
- let bom = '\uFEFF';
- link.href =
- 'data:text/csv;charset=utf-8,' + encodeURIComponent(bom + csv);
+ var bom = "\uFEFF";
+ link.href = 'data:text/csv;charset=utf-8,' + encodeURIComponent(bom + csv);
+ //link.href = URL.createObjectURL(csvFile);
link.download = 'data.csv';
document.body.appendChild(link);
link.click();
document.body.removeChild(link);
- }
+ },
//zhj 瀵煎嚭閿欒淇℃伅 2023-05-16 end
-});
+})
\ No newline at end of file
diff --git a/force-app/main/default/aura/NewAgencyContact2/NewAgencyContact2.auradoc b/force-app/main/default/aura/NewAgencyContact2/NewAgencyContact2.auradoc
new file mode 100644
index 0000000..d0d6eb5
--- /dev/null
+++ b/force-app/main/default/aura/NewAgencyContact2/NewAgencyContact2.auradoc
@@ -0,0 +1,6 @@
+<aura:documentation>
+ <aura:description>Documentation</aura:description>
+ <aura:example name="ExampleName" ref="exampleComponentName" label="Label">
+ Example Description
+ </aura:example>
+</aura:documentation>
\ No newline at end of file
diff --git a/force-app/main/default/aura/NewAgencyContact2/NewAgencyContact2.cmp b/force-app/main/default/aura/NewAgencyContact2/NewAgencyContact2.cmp
new file mode 100644
index 0000000..754199c
--- /dev/null
+++ b/force-app/main/default/aura/NewAgencyContact2/NewAgencyContact2.cmp
@@ -0,0 +1,71 @@
+<!--
+ @description :
+ @author : ChangeMeIn@UserSettingsUnder.SFDoc
+ @group :
+ @last modified on : 07-08-2022
+ @last modified by : ChangeMeIn@UserSettingsUnder.SFDoc
+-->
+<aura:component implements="force:lightningQuickActionWithoutHeader,force:hasRecordId,lightning:actionOverride,lightning:isUrlAddressable" access="global"
+ controller="NewAgencyContactController">
+
+ <aura:attribute name = "recordId" type = "Id" default = ""/>
+ <aura:attribute name="title" type="string"/>
+ <aura:handler name="init" value="{!this}" action="{!c.doInit}" />
+ <aura:attribute name="layout" type="LayoutDescriberHelper.LayoutWrapper"/>
+ <aura:attribute name="record_data" type="Map"/>
+ <aura:attribute name="section_names" type="List"/>
+ <aura:attribute name="showSpinner" type="Boolean" default = "False"/>
+ <aura:attribute name="staticResource" type="Map"/>
+ <aura:attribute name="pi_fields_map" type="Map"/>
+ <aura:attribute name="isClone" type="Boolean" default = "False"/>
+ <ltng:require scripts="{! $Resource.AWSService+'/AWSService.js' }" />
+ <ltng:require scripts="{! $Resource.jquery183minjs }" />
+ <aura:registerEvent name="NewAgencyContactEvent" type="c:NewAgencyContactEvent"/>
+ <aura:attribute name="agencyHospitalId" type="String"/>
+
+ <div class="slds-modal__container">
+ <!-- header -->
+ <header class="slds-modal__header">
+ <h2 id="modal-heading-01" class="slds-modal__title slds-hyphenate">
+ {!v.title}
+ </h2>
+ </header>
+
+ <div class="slds-modal__content slds-p-around_medium">
+ <aura:if isTrue="{!v.showSpinner}">
+ <lightning:spinner alternativeText="Loading" size="medium" />
+ </aura:if>
+
+
+ <lightning:recordEditForm objectApiName="Agency_Contact__c" onload="{!c.handleLoad}">
+
+ <lightning:accordion activeSectionName="{! v.section_names }" allowMultipleSectionsOpen="true" class="greyyyy" >
+ <aura:iteration items="{!v.layout}" var="section">
+ <aura:if isTrue="{! section.editHeading }">
+ <lightning:accordionSection name="{! section.label }" label="{! section.label }">
+
+ <aura:iteration items="{! section.layoutColumns}" var="col">
+ <aura:iteration items="{! col.layoutItems}" var="field">
+ <aura:if isTrue="{! field.behavior != 'Readonly' }">
+ <lightning:inputField required="{! field.behavior == 'Required' }" aura:id="field" fieldName="{! field.field}" value="{! field.value}" />
+
+ </aura:if>
+ </aura:iteration>
+
+ </aura:iteration>
+
+
+ </lightning:accordionSection>
+ </aura:if>
+ </aura:iteration>
+ </lightning:accordion>
+ </lightning:recordEditForm>
+
+ <div style="text-align:center;margin: 5px;">
+ <lightning:button class="slds-button slds-button_neutral" label="鍙栨秷" onclick="{! c.cancelClick }" />
+ <lightning:button class="slds-button slds-button_brand" variant="brand" label="淇濆瓨" onclick="{! c.saveClick }" />
+
+ </div>
+ </div>
+ </div>
+</aura:component>
\ No newline at end of file
diff --git a/force-app/main/default/aura/NewAgencyContact2/NewAgencyContact2.cmp-meta.xml b/force-app/main/default/aura/NewAgencyContact2/NewAgencyContact2.cmp-meta.xml
new file mode 100644
index 0000000..119345a
--- /dev/null
+++ b/force-app/main/default/aura/NewAgencyContact2/NewAgencyContact2.cmp-meta.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<AuraDefinitionBundle xmlns="http://soap.sforce.com/2006/04/metadata">
+ <apiVersion>55.0</apiVersion>
+ <description>A Lightning Component Bundle</description>
+</AuraDefinitionBundle>
diff --git a/force-app/main/default/aura/NewAgencyContact2/NewAgencyContact2.css b/force-app/main/default/aura/NewAgencyContact2/NewAgencyContact2.css
new file mode 100644
index 0000000..919a7e5
--- /dev/null
+++ b/force-app/main/default/aura/NewAgencyContact2/NewAgencyContact2.css
@@ -0,0 +1,15 @@
+.THIS {
+}
+
+.THIS .greyyyy .slds-button_reset{
+ display: flex;
+ align-items: center;
+ background: var(--lwc-colorBackground,rgb(243, 242, 242));
+ cursor: pointer;
+ width: 100%;
+ height: 2rem;
+ text-align: left;
+ color: currentColor;
+ font-size: inherit;
+ padding: 0 var(--lwc-spacingXSmall,0.5rem);
+}
\ No newline at end of file
diff --git a/force-app/main/default/aura/NewAgencyContact2/NewAgencyContact2.design b/force-app/main/default/aura/NewAgencyContact2/NewAgencyContact2.design
new file mode 100644
index 0000000..d247163
--- /dev/null
+++ b/force-app/main/default/aura/NewAgencyContact2/NewAgencyContact2.design
@@ -0,0 +1,3 @@
+<design:component >
+
+</design:component>
\ No newline at end of file
diff --git a/force-app/main/default/aura/NewAgencyContact2/NewAgencyContact2.svg b/force-app/main/default/aura/NewAgencyContact2/NewAgencyContact2.svg
new file mode 100644
index 0000000..e201ae9
--- /dev/null
+++ b/force-app/main/default/aura/NewAgencyContact2/NewAgencyContact2.svg
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
+<svg width="120px" height="120px" viewBox="0 0 120 120" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
+ <g stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
+ <path d="M120,108 C120,114.6 114.6,120 108,120 L12,120 C5.4,120 0,114.6 0,108 L0,12 C0,5.4 5.4,0 12,0 L108,0 C114.6,0 120,5.4 120,12 L120,108 L120,108 Z" id="Shape" fill="#2A739E" />
+ <path d="M77.7383308,20 L61.1640113,20 L44.7300055,63.2000173 L56.0543288,63.2000173 L40,99.623291 L72.7458388,54.5871812 L60.907727,54.5871812 L77.7383308,20 Z" id="Path-1" fill="#FFFFFF" />
+ </g>
+</svg>
\ No newline at end of file
diff --git a/force-app/main/default/aura/NewAgencyContact2/NewAgencyContact2Controller.js b/force-app/main/default/aura/NewAgencyContact2/NewAgencyContact2Controller.js
new file mode 100644
index 0000000..72dc139
--- /dev/null
+++ b/force-app/main/default/aura/NewAgencyContact2/NewAgencyContact2Controller.js
@@ -0,0 +1,396 @@
+({
+ doInit : function(component, event, helper) {
+ let rid = component.get('v.recordId');
+ let pid = null;
+ if(!rid){
+ pid = window.location.href.replace("https://","").split("/")[4];
+ }
+ let isClone = component.get('v.isClone');
+ if(!rid || isClone){
+ component.set('v.title',$A.get("$Label.c.New")+'.瀹㈡埛浜哄憳');
+ }else{
+ component.set('v.title',$A.get("$Label.c.Edit")+'.瀹㈡埛浜哄憳');
+ }
+
+ let record_type_id = null;
+ let pageref = component.get("v.pageReference")
+ if(!record_type_id && pageref){
+ record_type_id = pageref.state.recordTypeId
+ }
+ component.set("v.showSpinner", true);
+ helper.CallBackAction(component,'Init',{
+ rid : rid,
+ pid : null,
+ //rid : component.get('v.recordId'),
+ record_type_id : record_type_id,
+ },function(data){
+ debugger
+ console.log('data = ' + JSON.stringify(data));
+ if(data.getState() == "SUCCESS"){
+ var rv = data.getReturnValue();
+ console.log(rv);
+ if(rv.IsSuccess){
+ let layout = JSON.parse(rv.Data.layout);
+ let fields = rv.Data.fields;
+ let staticResource = JSON.parse(rv.Data.staticResource);
+ let staticResourceV2 = JSON.parse(rv.Data.staticResourceV2);
+ let section_names = [];
+ section_names = layout.map(s=>s.label);
+ component.set('v.section_names',section_names);
+
+ let m = {};
+ for(let f of staticResource.PIDetails){
+ m[f.SF_Field_API_Name__c] = f;
+ }
+ component.set('v.pi_fields_map',m);
+
+
+
+ var agencyHospitalId = component.get("v.agencyHospitalId");
+ console.log('agencyHospitalId = ' + agencyHospitalId);
+ if(rv.Data && rv.Data.data && rv.Data.data.AWS_Data_Id__c){
+ helper.AwsGet(staticResource.queryUrl, {
+ dataId : rv.Data.data.AWS_Data_Id__c
+ }, function(data){
+ console.log('data = ' + data);
+
+ for(let f of staticResource.PIDetails){
+
+ if(data.object && data.object.hasOwnProperty(f.AWS_Field_API__c)){
+ rv.Data.data[f.SF_Field_API_Name__c] = data.object[f.AWS_Field_API__c];
+ if(data.object.hasOwnProperty(f.AWS_Encrypted_Field_API__c) && data.object[f.AWS_Encrypted_Field_API__c]){
+ rv.Data.data[f.SF_Field_Encrypted_API__c] = data.object[f.AWS_Encrypted_Field_API__c];
+ }
+ }
+ }
+
+ for(let s of layout){
+ for(let c of s.layoutColumns){
+ for(let item of c.layoutItems){
+ if(rv.Data.data.hasOwnProperty(item.field)){
+ item.value = rv.Data.data[item.field];
+ }
+ if(fields.hasOwnProperty(item.field)){
+ item.fi = fields[item.field];
+ }
+ if(item.field == 'Agency_Hospital__c'){
+ item.value = agencyHospitalId;
+ }
+ }
+ }
+ }
+
+ component.set('v.record_data',rv.Data.data);
+ component.set('v.layout',layout);
+ }, staticResource.token);
+ }else{
+
+ for(let s of layout){
+ for(let c of s.layoutColumns){
+ for(let item of c.layoutItems){
+ if(rv.Data && fields.hasOwnProperty(item.field) && fields[item.field].References && fields[item.field].References.map(m=>m.value).indexOf(rv.Data.pidType) > -1){
+ item.value = pid;
+ }
+ if(item.field == 'Agency_Hospital__c'){
+ item.value = agencyHospitalId;
+ }
+ }
+ }
+ }
+ component.set('v.layout',layout);
+ }
+
+
+ component.set('v.fields',fields);
+ component.set('v.staticResource',staticResource);
+ component.set('v.staticResourceV2',staticResourceV2);
+ }else{
+ helper.ShowToast({
+ "message" : rv.Message,
+ "type" : "error"
+ });
+ }
+
+ }else{
+
+ helper.ShowToast({
+ "message" : "Init error",
+ "type" : "error"
+ });
+
+ }
+ });
+ },
+ handleLoad: function(component, event, helper) {
+ console.log('recordEditForm handleSuccess')
+ component.set("v.showSpinner", false);
+ },
+ saveClick : function(component, event, helper){
+
+ let staticResource = component.get('v.staticResource');
+ //let staticResourceV2 = component.get('v.staticResourceV2');
+ let record_id = component.get('v.recordId');
+ let record_type_id = component.get('v.recordTypeId');
+
+ let isClone = component.get('v.isClone');
+ let url = staticResource.newUrl;
+ //let urlV2 = staticResourceV2.newUrl;
+ let payloadPi = {};
+ if (record_id && !isClone) {
+ url = staticResource.updateUrl;
+ //urlV2 = staticResourceV2.updateUrl;
+ payloadPi['dataId'] = component.get('v.record_data').AWS_Data_Id__c;
+ }
+ let layout = component.get('v.layout');
+
+ let pi_fields_map = component.get('v.pi_fields_map');
+
+ let hospitalId = '';
+ for(let s of layout){
+ for(let c of s.layoutColumns){
+ for(let item of c.layoutItems){
+ if(item.field == 'Agency_Hospital__c'){
+ hospitalId = item.value;
+ }
+ if(pi_fields_map.hasOwnProperty(item.field)){
+
+ payloadPi[pi_fields_map[item.field].AWS_Field_API__c] = item.value;
+ }
+
+ if (item.behavior == "Required" && !item.value ) {
+ let fs = component.find("field");
+ for(let fi in fs){
+ let f = fs[fi];
+ if(!f.get('v.value')){
+ f.reset();
+ }
+ }
+ return;
+ }
+ }
+ }
+ }
+
+ component.set("v.showSpinner", true);
+ //zhj MEBG鏂版柟妗堟敼閫� 2022-11-29 start
+ debugger
+ let hospitalName = '';
+ //璋冪敤鍚庣searchAgencyDataId鏂规硶鏌ヨ鍑哄尰闄笅闈㈡墍鏈夊鎴蜂汉鍛榙ataid
+ helper.CallBackAction(component,'searchAgencyDataId',{
+ hospitalId : hospitalId
+ },function(data){
+ if(data.getState() == "SUCCESS"){
+ var data = data.getReturnValue();
+ if(data.IsSuccess == true){
+ let agencyContactIds = ''
+ if(data.Message == '' && data.Data && data.Data.length > 0){
+ hospitalName = data.Data[0].Agency_Hospital__r.Name;
+ for(var i=0;i<data.Data.length;i++){
+ if(data.Data[i].AWS_Data_Id__c)
+ agencyContactIds += ','+data.Data[i].AWS_Data_Id__c;
+ }
+ agencyContactIds = agencyContactIds.substring(1);
+ payloadPi['agencyContactIds'] = agencyContactIds;
+ }else{
+ payloadPi['agencyContactIds'] = agencyContactIds;
+ }
+ helper.AwsPost(url+'V2', [payloadPi], function(result){
+ //濡傛灉杩斿洖鏄�129琛ㄧず閲嶅浜嗭紝鎶ラ敊
+ if(result.status == '129'){
+ helper.ShowToast({
+ "message" : '璇ュ鎴蜂汉鍛樺悕瀛楀凡瀛樺湪锛屽湪'+hospitalName+'鍖婚櫌锛岃淇敼',
+ "type" : "error"
+ });
+ component.set("v.showSpinner", false);
+ return
+ }
+
+ let obj = result.object[0];
+ let data = {};
+ if(record_id && !isClone){
+ data.Id = record_id;
+ }else{
+ data.AWS_Data_Id__c = obj.dataId;
+ }
+ for(let s of layout){
+ for(let c of s.layoutColumns){
+ for(let item of c.layoutItems){
+ if(item.field && item.behavior != "Readonly"){
+ if(pi_fields_map.hasOwnProperty(item.field)){
+ data[item.field] = obj[pi_fields_map[item.field].AWS_Field_API__c];
+ //data[pi_fields_map[item.field].SF_Field_Encrypted_API__c] = obj[pi_fields_map[item.field].AWS_Encrypted_Field_API__c];
+ }else{
+ data[item.field] = item.value;
+ }
+ }
+
+ }
+ }
+ }
+
+
+ $A.getCallback(function(){
+ helper.CallBackAction(component,'Save',{
+ data : data,
+ transId : result.txId
+ },function(data){
+ component.set("v.showSpinner", false);
+ if(data.getState() == "SUCCESS"){
+ var rv = data.getReturnValue();
+ console.log(rv);
+ var sfId = null;
+ if(rv.IsSuccess){
+ sfId = rv.Data.recordId;
+ }
+
+ helper.AwsPost(staticResource.transactionUrl,{
+ txId: result.txId,
+ sfRecordId:sfId,
+ isSuccess: rv.IsSuccess ? 1 : 0
+ },function(data){
+ if(rv.IsSuccess){
+ helper.ShowToast({
+ "message" : "鎴愬姛",
+ "type" : "success"
+ });
+ helper.closeAgencyContact(component);
+
+ // if (record_id && !isClone){
+
+ // helper.closeAgencyContact(component);
+ // //$A.get('e.force:refreshView').fire();
+ // }else{
+ // var sObjectEvent = $A.get("e.force:navigateToSObject");
+ // sObjectEvent.setParams({
+ // "recordId": sfId
+ // })
+ // sObjectEvent.fire();
+ // }
+ }else{
+ helper.ShowToast({
+ "message" : rv.Message,
+ "type" : "error"
+ });
+ }
+ },staticResource.token);
+
+
+ }else{
+
+ helper.ShowToast({
+ "message" : "Init error",
+ "type" : "error"
+ });
+
+ }
+ });
+ })();
+
+ }, staticResource.token);
+ }else{
+ helper.ShowToast({
+ "message" : data.message,
+ "type" : "error"
+ });
+ component.set("v.showSpinner", false);
+ }
+ }else{
+ helper.ShowToast({
+ "message" : 'searchAgency澶辫触',
+ "type" : "error"
+ });
+ component.set("v.showSpinner", false);
+ }
+ });
+ //zhj MEBG鏂版柟妗堟敼閫� 2022-11-29 end
+ // helper.AwsPost(urlV2, [payloadPi], function(result){
+
+ // let obj = result.object[0];
+ // let data = {};
+ // if(record_id && !isClone){
+ // data.Id = record_id;
+ // }else{
+ // data.AWS_Data_Id__c = obj.dataId;
+ // }
+ // for(let s of layout){
+ // for(let c of s.layoutColumns){
+ // for(let item of c.layoutItems){
+ // if(item.field && item.behavior != "Readonly"){
+ // if(pi_fields_map.hasOwnProperty(item.field)){
+ // data[item.field] = obj[pi_fields_map[item.field].AWS_Field_API__c];
+ // data[pi_fields_map[item.field].SF_Field_Encrypted_API__c] = obj[pi_fields_map[item.field].AWS_Encrypted_Field_API__c];
+ // }else{
+ // data[item.field] = item.value;
+ // }
+ // }
+
+ // }
+ // }
+ // }
+
+
+ // $A.getCallback(function(){
+ // helper.CallBackAction(component,'Save',{
+ // data : data,
+ // transId : result.txId
+ // },function(data){
+ // component.set("v.showSpinner", false);
+ // if(data.getState() == "SUCCESS"){
+ // var rv = data.getReturnValue();
+ // console.log(rv);
+ // var sfId = null;
+ // if(rv.IsSuccess){
+ // sfId = rv.Data.recordId;
+ // }
+
+ // helper.AwsPost(staticResource.transactionUrl,{
+ // txId: result.txId,
+ // sfRecordId:sfId,
+ // isSuccess: rv.IsSuccess ? 1 : 0
+ // },function(data){
+ // if(rv.IsSuccess){
+ // helper.ShowToast({
+ // "message" : "鎴愬姛",
+ // "type" : "success"
+ // });
+ // helper.closeAgencyContact(component);
+
+ // // if (record_id && !isClone){
+
+ // // helper.closeAgencyContact(component);
+ // // //$A.get('e.force:refreshView').fire();
+ // // }else{
+ // // var sObjectEvent = $A.get("e.force:navigateToSObject");
+ // // sObjectEvent.setParams({
+ // // "recordId": sfId
+ // // })
+ // // sObjectEvent.fire();
+ // // }
+ // }else{
+ // helper.ShowToast({
+ // "message" : rv.Message,
+ // "type" : "error"
+ // });
+ // }
+ // },staticResource.token);
+
+
+ // }else{
+
+ // helper.ShowToast({
+ // "message" : "Init error",
+ // "type" : "error"
+ // });
+
+ // }
+ // });
+ // })();
+
+ // }, staticResource.token);
+ },
+ cancelClick : function(component, event, helper){
+ helper.closeAgencyContact(component);
+ },
+
+ scriptsLoaded : function(component, event, helper){}
+})
\ No newline at end of file
diff --git a/force-app/main/default/aura/NewAgencyContact2/NewAgencyContact2Helper.js b/force-app/main/default/aura/NewAgencyContact2/NewAgencyContact2Helper.js
new file mode 100644
index 0000000..043120b
--- /dev/null
+++ b/force-app/main/default/aura/NewAgencyContact2/NewAgencyContact2Helper.js
@@ -0,0 +1,56 @@
+({
+ CallBackAction : function(component,action_name,para,callback) {
+ var action = component.get("c." + action_name.trimStart().replace("c.",""));
+ if(para){
+ action.setParams(para);
+ }
+ if(callback){
+ action.setCallback(this,function(data){
+ callback(data);
+ });
+ }
+
+ $A.enqueueAction(action);
+ },
+ ShowToast : function(paras){
+ var toastEvent = $A.get("e.force:showToast");
+ toastEvent.setParams(paras);
+ toastEvent.fire();
+ },
+ AwsPost : function(postURL, data ,callback,token){
+ let payloadForNewPI = '';
+ if(typeof(data) == 'string'){
+ payloadForNewPI = data;
+ }else{
+ payloadForNewPI = JSON.stringify(data);
+ }
+
+ AWSService.post(postURL,payloadForNewPI,function(result) {
+ //this.insertCalloutLog(this.insertModule,postURL,JSON.stringify(payloadForNewPI),JSON.stringify(result),this.successStatus);
+ if(callback) callback(result);
+ },token);
+ },
+ AwsGet : function(url, data ,callback,token){
+
+ if(typeof(data) == 'string'){
+ url += data;
+ }else{
+ let i = 0;
+ for(let p in data){
+ url += (i++) ? '&' : '?';
+ url += p + '=' + data[p];
+ }
+ }
+
+ AWSService.get(url,function(result){
+ //this.insertCalloutLog(this.insertModule,postURL,JSON.stringify(payloadForNewPI),JSON.stringify(result),this.successStatus);
+ if(callback) callback(result);
+ },token);
+ },
+ closeAgencyContact : function(component){
+ var cmpEvent = component.getEvent("NewAgencyContactEvent");
+ cmpEvent.setParams({
+ "showNewAgencyContact":false});
+ cmpEvent.fire();
+ }
+})
\ No newline at end of file
diff --git a/force-app/main/default/aura/NewAgencyContact2/NewAgencyContact2Renderer.js b/force-app/main/default/aura/NewAgencyContact2/NewAgencyContact2Renderer.js
new file mode 100644
index 0000000..f1f0c75
--- /dev/null
+++ b/force-app/main/default/aura/NewAgencyContact2/NewAgencyContact2Renderer.js
@@ -0,0 +1,5 @@
+({
+
+// Your renderer method overrides go here
+
+})
\ No newline at end of file
diff --git a/force-app/main/default/aura/NewAgencyOpportunity/NewAgencyOpportunity.cmp b/force-app/main/default/aura/NewAgencyOpportunity/NewAgencyOpportunity.cmp
index 6cc8450..4acb227 100644
--- a/force-app/main/default/aura/NewAgencyOpportunity/NewAgencyOpportunity.cmp
+++ b/force-app/main/default/aura/NewAgencyOpportunity/NewAgencyOpportunity.cmp
@@ -5,43 +5,36 @@
@last modified on : 07-08-2022
@last modified by : ChangeMeIn@UserSettingsUnder.SFDoc
-->
-<aura:component
- implements="force:lightningQuickActionWithoutHeader,force:hasRecordId,lightning:actionOverride,lightning:isUrlAddressable"
- access="global"
- controller="NewAgencyOpportunityController"
->
- <aura:attribute name="recordId" type="Id" default="" />
- <aura:attribute name="recordTypeId" type="Id" default="" />
- <aura:attribute name="ac_name" type="string" />
- <aura:attribute name="title" type="string" />
+<aura:component implements="force:lightningQuickActionWithoutHeader,force:hasRecordId,lightning:actionOverride,lightning:isUrlAddressable" access="global"
+ controller="NewAgencyOpportunityController">
+
+ <aura:attribute name = "recordId" type = "Id" default = ""/>
+ <aura:attribute name = "recordTypeId" type = "Id" default = ""/>
+ <aura:attribute name="ac_name" type="string"/>
+ <aura:attribute name="title" type="string"/>
<aura:handler name="init" value="{!this}" action="{!c.doInit}" />
- <aura:attribute name="layout" type="LayoutDescriberHelper.LayoutWrapper" />
- <aura:attribute name="record_data" type="Map" />
- <aura:attribute name="section_names" type="List" />
- <aura:attribute name="showSpinner" type="Boolean" default="False" />
- <aura:attribute name="showSpinner2" type="Boolean" default="False" />
- <aura:attribute name="staticResource" type="Map" />
- <aura:attribute name="pi_fields_map" type="Map" />
- <aura:attribute name="isClone" type="Boolean" default="False" />
+ <aura:attribute name="layout" type="LayoutDescriberHelper.LayoutWrapper"/>
+ <aura:attribute name="record_data" type="Map"/>
+ <aura:attribute name="section_names" type="List"/>
+ <aura:attribute name="showSpinner" type="Boolean" default = "False"/>
+ <aura:attribute name="showSpinner2" type="Boolean" default = "False"/>
+ <aura:attribute name="staticResource" type="Map"/>
+ <aura:attribute name="pi_fields_map" type="Map"/>
+ <aura:attribute name="isClone" type="Boolean" default = "False"/>
<ltng:require scripts="{! $Resource.AWSService+'/AWSService.js' }" />
<ltng:require scripts="{! $Resource.jquery183minjs }" />
- <aura:attribute name="isModalOpen" type="boolean" default="false" />
- <aura:attribute name="searchKeyWord" type="string" default="" />
- <aura:attribute name="contactAWSIds" type="List" />
- <aura:attribute name="login" type="Boolean" default="false" />
- <aura:attribute name="show" type="Boolean" default="false" />
- <aura:attribute
- name="showNewAgencyContact"
- type="Boolean"
- default="false"
- />
- <aura:handler
- name="NewAgencyContactEvent"
- event="c:NewAgencyContactEvent"
- action="{!c.closeAgencyContact}"
- />
+ <aura:attribute name="isModalOpen" type="boolean" default="false"/>
+ <aura:attribute name="searchKeyWord" type="string" default=""/>
+ <aura:attribute name="contactAWSIds" type="List"/>
+ <aura:attribute name="login" type="Boolean" default="false"/>
+ <aura:attribute name="show" type="Boolean" default="false"/>
+ <aura:attribute name="showNewAgencyContact" type="Boolean" default="false"/>
+ <aura:handler name="NewAgencyContactEvent" event="c:NewAgencyContactEvent" action="{!c.closeAgencyContact}"/>
+ <aura:attribute name="agencyHospitalId" type="String" default = ""/>
- <div class="{! v.container_class}">
+
+
+ <div class="{! v.container_class}">
<!-- header -->
<header class="slds-modal__header">
<h2 id="modal-heading-01" class="slds-modal__title slds-hyphenate">
@@ -53,63 +46,27 @@
<aura:if isTrue="{!v.showSpinner}">
<lightning:spinner alternativeText="Loading" size="medium" />
</aura:if>
- <lightning:recordEditForm objectApiName="Agency_Opportunity__c">
- <lightning:accordion
- activeSectionName="{! v.section_names }"
- allowMultipleSectionsOpen="true"
- class="greyyyy"
- >
+ <lightning:recordEditForm objectApiName="Agency_Opportunity__c" onload="{!c.handleLoad}">
+ <lightning:accordion activeSectionName="{! v.section_names }" allowMultipleSectionsOpen="true" class="greyyyy" >
<aura:iteration items="{!v.layout}" var="section">
<aura:if isTrue="{! section.editHeading }">
- <lightning:accordionSection
- name="{! section.label }"
- label="缁忛攢鍟嗚浠蜂俊鎭�"
- >
- <aura:iteration
- items="{! section.layoutColumns}"
- var="col"
- >
- <aura:iteration
- items="{! col.layoutItems}"
- var="field"
- >
- <aura:if
- isTrue="{!and(field.behavior != 'Readonly', field.field != 'Agency_Contact__c')}"
- >
- <lightning:inputField
- required="{! field.behavior == 'Required' }"
- aura:id="field"
- fieldName="{! field.field}"
- value="{! field.value}"
- />
+ <lightning:accordionSection name="{! section.label }" label="缁忛攢鍟嗚浠蜂俊鎭�">
+ <aura:iteration items="{! section.layoutColumns}" var="col">
+ <aura:iteration items="{! col.layoutItems}" var="field">
+
+ <aura:if isTrue="{!and(field.behavior != 'Readonly', field.field != 'Agency_Contact__c')}">
+ <lightning:inputField required="{! field.behavior == 'Required' }" aura:id="field" fieldName="{! field.field}" value="{! field.value}" />
</aura:if>
- <aura:if
- isTrue="{!field.field == 'Agency_Contact__c' }"
- >
+ <aura:if isTrue="{!field.field == 'Agency_Contact__c' }">
<lightning:layout>
<lightning:layoutItem size="12">
- <lightning:input
- required="{! field.behavior == 'Required' }"
- label="瀹㈡埛浜哄憳"
- value="{! field.value}"
- variant="label-inline"
- style="
- margin-left: 0cm;
- display: none;
- "
- onclick="{! c.openModel }"
- />
- <lightning:input
- required="{! field.behavior == 'Required' }"
- label="瀹㈡埛浜哄憳"
- value="{! v.ac_name}"
- variant="label-inline"
- style="margin-left: 0cm"
- onclick="{! c.openModel }"
- />
+ <lightning:input required="{! field.behavior == 'Required' }" label="瀹㈡埛浜哄憳" value = "{! field.value}" variant = "label-inline" style="margin-left: 0cm; display: none;" onclick="{! c.openModel }"/>
+ <lightning:input required="{! field.behavior == 'Required' }" label="瀹㈡埛浜哄憳" value = "{! v.ac_name}" variant = "label-inline" style="margin-left: 0cm; " onclick="{! c.openModel }"/>
</lightning:layoutItem>
</lightning:layout>
</aura:if>
+
+
</aura:iteration>
</aura:iteration>
</lightning:accordionSection>
@@ -117,117 +74,82 @@
</aura:iteration>
</lightning:accordion>
</lightning:recordEditForm>
-
- <div style="text-align: center; margin: 5px">
- <lightning:button
- class="slds-button slds-button_neutral"
- label="鍙栨秷"
- onclick="{! c.cancelClick }"
- />
- <lightning:button
- class="slds-button slds-button_brand"
- variant="brand"
- label="淇濆瓨"
- onclick="{! c.saveClick }"
- />
+
+ <div style="text-align:center;margin: 5px;">
+ <lightning:button class="slds-button slds-button_neutral" label="鍙栨秷" onclick="{! c.cancelClick }" />
+ <lightning:button class="slds-button slds-button_brand" variant="brand" label="淇濆瓨" onclick="{! c.saveClick }" />
</div>
</div>
- <aura:if isTrue="{!v.isModalOpen}">
- <!-- Modal/Popup Box starts here-->
- <section
- role="dialog"
- tabindex="-1"
- aria-labelledby="modal-heading-01"
- aria-modal="true"
- aria-describedby="modal-content-id-1"
- class="slds-modal slds-fade-in-open"
- >
- <aura:renderIf isTrue="{!v.login}">
- <div class="slds-spinner_container height100vh">
- <div
- class="slds-spinner--brand slds-spinner slds-spinner--medium"
- role="alert"
- >
- <span id="aa" class="slds-assistive-text"
- >Loading</span
- >
- <div class="slds-spinner__dot-a"></div>
- <div class="slds-spinner__dot-b"></div>
- </div>
- </div>
- </aura:renderIf>
+ <aura:if isTrue="{!v.isModalOpen}">
+
+ <!-- Modal/Popup Box starts here-->
+ <section role="dialog" tabindex="-1" aria-labelledby="modal-heading-01"
+ aria-modal="true" aria-describedby="modal-content-id-1"
+ class="slds-modal slds-fade-in-open" >
- <div class="slds-modal__container">
+
+
+ <aura:renderIf isTrue="{!v.login}">
+ <div class="slds-spinner_container height100vh">
+ <div class="slds-spinner--brand slds-spinner slds-spinner--medium" role="alert">
+ <span id="aa" class="slds-assistive-text">Loading</span>
+ <div class="slds-spinner__dot-a"></div>
+ <div class="slds-spinner__dot-b"></div>
+ </div>
+ </div>
+ </aura:renderIf>
+
+
+
+ <div class="slds-modal__container">
<!-- Modal/Popup Box Header Starts here-->
<header class="slds-modal__header">
- <lightning:buttonIcon
- iconName="utility:close"
+ <lightning:buttonIcon iconName="utility:close"
onclick="{! c.closeModel }"
alternativeText="close"
variant="bare-inverse"
- class="slds-modal__close"
- />
- <h2
- id="modal-heading-01"
- class="slds-text-heading_medium slds-hyphenate"
- >
- 鎼滅储瀹㈡埛浜哄憳
+ class="slds-modal__close"/>
+ <h2 id="modal-heading-01" class="slds-text-heading_medium slds-hyphenate">
+ 鎼滅储瀹㈡埛浜哄憳
</h2>
</header>
-
+
<!--Modal Body Start here-->
- <div
- class="slds-modal__content slds-p-around_medium modal-body"
- id="modal-content-id-1"
- >
+ <div class="slds-modal__content slds-p-around_medium modal-body" id="modal-content-id-1">
<lightning:layout>
<lightning:layoutItem size="7">
- <ui:inputText
- label="璇疯緭鍏ュ鎴峰鍚�"
- class="field"
- value="{!v.searchKeyWord}"
- />
+ <ui:inputText label="璇疯緭鍏ュ鎴峰鍚�" class="field" value="{!v.searchKeyWord}"/>
</lightning:layoutItem>
- <lightning:layoutItem size="2" class="searchButton">
- <ui:button
- aura:id="button"
- buttonTitle="Click to see agency contact"
- class="button"
- label="鎼滅储"
- press="{!c.searchAgencyContact}"
- disabled="false"
- />
+ <lightning:layoutItem size="2" class = "searchButton">
+ <ui:button aura:id="button" buttonTitle="Click to see agency contact" class="button" label="鎼滅储" press="{!c.searchAgencyContact}" disabled="false"/>
</lightning:layoutItem>
- <lightning:layoutItem size="3" class="searchButton">
- <ui:button
- aura:id="newAgencyContact"
- buttonTitle="Click to see agency contact"
- class="newAgencyContact"
- label="鏂板缓.瀹㈡埛浜哄憳"
- disabled="false"
- press="{!c.showNewAgency}"
- />
+ <lightning:layoutItem size="3" class = "searchButton">
+ <ui:button aura:id="newAgencyContact" buttonTitle="Click to see agency contact" class="newAgencyContact" label="鏂板缓.瀹㈡埛浜哄憳" disabled="false" press="{!c.showNewAgency}"/>
</lightning:layoutItem>
</lightning:layout>
- <div id="QueryResult" style="margin-top: 20px"></div>
+ <div id="QueryResult" style = "margin-top:20px;">
+ </div>
</div>
+
+ <!-- <aura:if isTrue="{!v.showNewAgencyContact}">
+ <section role="dialog" tabindex="-1" aria-modal="true" aria-labelledby="modal-heading-01" class="slds-modal slds-fade-in-open" aura:id="NewAgencyContact" id="NewAgencyContact">
+ <c:NewAgencyContact2 />
+ </section>
+ </aura:if> -->
- <aura:if isTrue="{!v.showNewAgencyContact}">
- <section
- role="dialog"
- tabindex="-1"
- aria-modal="true"
- aria-labelledby="modal-heading-01"
- class="slds-modal slds-fade-in-open"
- aura:id="NewAgencyContact"
- id="NewAgencyContact"
- >
- <c:NewAgencyContact2 />
- </section>
- </aura:if>
- </div>
- </section>
- <div class="slds-backdrop slds-backdrop_open"></div>
- </aura:if>
+ <aura:if isTrue="{!v.showNewAgencyContact}">
+ <section role="dialog" tabindex="-1" aria-modal="true" aria-labelledby="modal-heading-01"
+ class="slds-modal slds-fade-in-open" aura:id="NewAgencyContact"
+ id="NewAgencyContact" aria-describedby="modal-content-id-2" style="z-index: 9999;">
+ <c:NewAgencyContact2 agencyHospitalId="{!v.agencyHospitalId}"/>
+ </section>
+ <div class="slds-backdrop2 slds-backdrop_open2"></div>
+ </aura:if>
+
+ </div>
+ </section>
+ <div class="slds-backdrop slds-backdrop_open"></div>
+
+ </aura:if>
</div>
-</aura:component>
+</aura:component>
\ No newline at end of file
diff --git a/force-app/main/default/aura/NewAgencyOpportunity/NewAgencyOpportunity.cmp-meta.xml b/force-app/main/default/aura/NewAgencyOpportunity/NewAgencyOpportunity.cmp-meta.xml
index 2c30e5a..632b900 100644
--- a/force-app/main/default/aura/NewAgencyOpportunity/NewAgencyOpportunity.cmp-meta.xml
+++ b/force-app/main/default/aura/NewAgencyOpportunity/NewAgencyOpportunity.cmp-meta.xml
@@ -1,4 +1,4 @@
-<?xml version="1.0" encoding="UTF-8" ?>
+<?xml version="1.0" encoding="UTF-8"?>
<AuraDefinitionBundle xmlns="http://soap.sforce.com/2006/04/metadata">
<apiVersion>54.0</apiVersion>
<description>A Lightning Component Bundle</description>
diff --git a/force-app/main/default/aura/NewAgencyOpportunity/NewAgencyOpportunity.css b/force-app/main/default/aura/NewAgencyOpportunity/NewAgencyOpportunity.css
index 0df5018..8cbd05f 100644
--- a/force-app/main/default/aura/NewAgencyOpportunity/NewAgencyOpportunity.css
+++ b/force-app/main/default/aura/NewAgencyOpportunity/NewAgencyOpportunity.css
@@ -1,26 +1,26 @@
.THIS {
}
-.THIS .name {
- margin-right: 0.5cm;
+.THIS .name{
+ margin-right:0.5cm;
}
-.THIS .wh {
+.THIS .wh{
width: 670px;
height: 500px;
}
-.THIS .slds-modal__container {
- max-width: 70rem !important;
- width: 90% !important;
+.THIS .slds-modal__container{
+ max-width:70rem !important;
+ width:90% !important;
}
-.THIS .modal-body {
- height: 500px !important;
+.THIS .modal-body{
+ height : 500px !important;
max-height: 500px !important;
}
-.THIS table {
+.THIS table{
border-collapse: collapse;
border-spacing: 0;
width: 98%;
@@ -28,16 +28,16 @@
/* border: 1px solid #000000; */
text-align: center;
}
-.THIS tr {
+.THIS tr{
/* border: 1px solid #000000; */
text-align: center;
}
-.THIS td {
+.THIS td{
/* border: 1px solid #000000; */
text-align: center;
}
-.THIS th {
+.THIS th{
/* border: 1px solid #000000; */
text-align: center;
}
@@ -48,7 +48,7 @@
height: 80px;
}
-.THIS.exampleHolder {
+.THIS.exampleHolder{
position: relative;
display: inline-block;
margin-left: 15px;
@@ -57,11 +57,23 @@
white-space: nowrap;
}
-.THIS .searchButton {
- margin-top: 20px;
- margin-left: 20px;
+.THIS .searchButton{
+ margin-top:20px;
+ margin-left:20px;
}
-.THIS .slds-spinner_container {
+.THIS .slds-spinner_container{
position: revert;
}
+
+.THIS .slds-backdrop2 {
+ position: fixed;
+ top: 0;
+ left: 0;
+ width: 100%;
+ height: 100%;
+ background-color: rgba(0, 0, 0, 0.6); /* 閬僵灞傜殑鍗婇�忔槑鑳屾櫙鑹� */
+}
+.THIS .slds-backdrop_open2 {
+ z-index: 9003; /* 閬僵灞傜殑灞傜骇锛岄渶瑕佺‘淇濇瘮妯℃�佹鐨勫眰绾ч珮 */
+}
\ No newline at end of file
diff --git a/force-app/main/default/aura/NewAgencyOpportunity/NewAgencyOpportunityController.js b/force-app/main/default/aura/NewAgencyOpportunity/NewAgencyOpportunityController.js
index 671f8e3..406ad66 100644
--- a/force-app/main/default/aura/NewAgencyOpportunity/NewAgencyOpportunityController.js
+++ b/force-app/main/default/aura/NewAgencyOpportunity/NewAgencyOpportunityController.js
@@ -1,188 +1,164 @@
({
- doInit: function (component, event, helper) {
+
+ doInit : function(component, event, helper) {
let rid = component.get('v.recordId');
let pid = null;
- if (!rid) {
- pid = window.location.href.replace('https://', '').split('/')[4];
+ if(!rid){
+ pid = window.location.href.replace("https://","").split("/")[4];
}
-
+
let record_type_id = '';
- let pageref = component.get('v.pageReference');
- if (!record_type_id && pageref) {
- record_type_id = pageref.state.recordTypeId
- ? pageref.state.recordTypeId
- : '';
+ let pageref = component.get("v.pageReference")
+ if(!record_type_id && pageref){
+ record_type_id = pageref.state.recordTypeId ? pageref.state.recordTypeId : '';
}
-
+
let isClone = component.get('v.isClone');
- if (!rid || isClone) {
- component.set('v.title', $A.get('$Label.c.New') + '缁忛攢鍟嗚浠�');
- component.set('v.recordTypeId', record_type_id);
- } else {
- component.set('v.title', $A.get('$Label.c.Edit') + '缁忛攢鍟嗚浠�');
+ if(!rid || isClone){
+ component.set('v.title',$A.get("$Label.c.New")+'缁忛攢鍟嗚浠�');
+ component.set("v.recordTypeId", record_type_id);
+ }else{
+ component.set('v.title',$A.get("$Label.c.Edit")+'缁忛攢鍟嗚浠�');
}
console.log('rid: ' + rid);
console.log('pid: ' + pid);
console.log('record_type_id: ' + record_type_id);
- component.set('v.showSpinner', true);
- helper.CallBackAction(
- component,
- 'Init',
- {
- rid: rid,
- pid: pid,
- //rid : component.get('v.recordId'),
- record_type_id: record_type_id
- },
- function (data) {
- console.log('data: ' + data);
- var rv = data.getReturnValue();
- console.log('rv:' + rv);
- console.log('rv.Data:' + rv.Data);
- console.log('rv.IsSuccess:' + rv.IsSuccess);
- if (data.getState() == 'SUCCESS') {
- if (rv.IsSuccess) {
- debugger;
- let layout = JSON.parse(rv.Data.layout);
- debugger;
- let fields = rv.Data.fields;
- debugger;
- let staticResource = JSON.parse(rv.Data.staticResource);
- debugger;
- let section_names = layout.map((s) => s.label);
- debugger;
- // let awsData = rv.Data.awsDataIds;
- // section_names = layout.map(s=>s.label);
- component.set('v.section_names', section_names);
- component.set('v.layout', layout);
- component.set('v.fields', fields);
- component.set('v.staticResource', staticResource);
- debugger;
- let m = {};
- for (let f of staticResource.PIDetails) {
- m[f.SF_Field_API_Name__c] = f;
- }
- component.set('v.pi_fields_map', m);
- if (rv.Data && rv.Data.data) {
- debugger;
- console.log('rv.Data.data = ' + rv.Data.data);
- for (let s of layout) {
- for (let c of s.layoutColumns) {
- for (let item of c.layoutItems) {
- if (
- rv.Data.data.hasOwnProperty(
- item.field
- )
- ) {
- item.value =
- rv.Data.data[item.field];
- }
- if (fields.hasOwnProperty(item.field)) {
- item.fi = fields[item.field];
- }
- }
- }
- }
- // component.set('v.layout',layout);
- component.set('v.record_data', rv.Data.data);
- if (rv.Data.data.Agency_Contact__r) {
- if (
- rv.Data.data.Agency_Contact__r
- .AWS_Data_Id__c
- ) {
- helper.AwsGet(
- staticResource.queryUrl,
- {
- dataId: rv.Data.data
- .Agency_Contact__r
- .AWS_Data_Id__c
- },
- function (data) {
- console.log('data = ' + data);
- if (data.object) {
- component.set(
- 'v.ac_name',
- data.object.name
- );
- }
- },
- staticResource.token
- );
- }
- }
- // }, staticResource.token);
- } else {
- debugger;
- console.log('rv.Data.data = ' + rv.Data.data);
- console.log('layout = ' + layout);
- for (let s of layout) {
- for (let c of s.layoutColumns) {
- for (let item of c.layoutItems) {
- if (
- rv.Data &&
- fields.hasOwnProperty(item.field) &&
- fields[item.field].References &&
- fields[item.field].References.map(
- (m) => m.value
- ).indexOf(rv.Data.pidType) > -1
- ) {
- item.value = pid;
- }
- }
- }
- }
- debugger;
- // component.set('v.layout',layout);
- }
- // component.set('v.fields',fields);
- // component.set('v.staticResource',staticResource);
- component.set('v.showSpinner', false);
- } else {
- component.set('v.showSpinner', false);
- helper.ShowToast({
- message: rv.Message,
- type: 'error'
- });
+ component.set("v.showSpinner", true);
+ helper.CallBackAction(component,'Init',{
+ rid : rid,
+ pid : pid,
+ //rid : component.get('v.recordId'),
+ record_type_id : record_type_id
+ },function(data){
+ console.log('data: ' + data);
+ var rv = data.getReturnValue();
+ console.log('rv:' + rv);
+ console.log('rv.Data:' + rv.Data);
+ console.log('rv.IsSuccess:' + rv.IsSuccess);
+ if(data.getState() == "SUCCESS"){
+ if(rv.IsSuccess){
+ debugger;
+ let layout = JSON.parse(rv.Data.layout);
+ debugger;
+ let fields = rv.Data.fields;
+ debugger;
+ let staticResource = JSON.parse(rv.Data.staticResource)
+ debugger;
+ let section_names = layout.map(s=>s.label);
+ debugger;
+ // let awsData = rv.Data.awsDataIds;
+ // section_names = layout.map(s=>s.label);
+ component.set('v.section_names',section_names);
+ component.set('v.layout',layout);
+ component.set('v.fields',fields);
+ component.set('v.staticResource',staticResource);
+ debugger;
+ let m = {};
+ for(let f of staticResource.PIDetails){
+ m[f.SF_Field_API_Name__c] = f;
}
- } else {
- component.set('v.showSpinner', false);
+ component.set('v.pi_fields_map',m);
+ if(rv.Data && rv.Data.data ){
+ debugger;
+ console.log('rv.Data.data = ' + rv.Data.data);
+ for(let s of layout){
+ for(let c of s.layoutColumns){
+ for(let item of c.layoutItems){
+ if(rv.Data.data.hasOwnProperty(item.field)){
+ item.value = rv.Data.data[item.field];
+ }
+ if(fields.hasOwnProperty(item.field)){
+ item.fi = fields[item.field];
+ }
+ }
+ }
+ }
+ // component.set('v.layout',layout);
+ component.set('v.record_data',rv.Data.data);
+ if(rv.Data.data.Agency_Contact__r){
+ if (rv.Data.data.Agency_Contact__r.AWS_Data_Id__c) {
+ helper.AwsGet(staticResource.queryUrl, {
+ dataId : rv.Data.data.Agency_Contact__r.AWS_Data_Id__c
+ }, function(data){
+ console.log('data = ' + data);
+ if (data.object) {
+ component.set('v.ac_name',data.object.name);
+ }
+ }, staticResource.token);
+ }
+ }
+ // }, staticResource.token);
+ }else{
+ debugger;
+ console.log('rv.Data.data = ' + rv.Data.data);
+ console.log('layout = ' + layout);
+ for(let s of layout){
+ for(let c of s.layoutColumns){
+ for(let item of c.layoutItems){
+ if(rv.Data && fields.hasOwnProperty(item.field) && fields[item.field].References && fields[item.field].References.map(m=>m.value).indexOf(rv.Data.pidType) > -1){
+ item.value = pid;
+ }
+ }
+ }
+ }
+ debugger;
+ // component.set('v.layout',layout);
+ }
+ // component.set('v.fields',fields);
+ // component.set('v.staticResource',staticResource);
+ //component.set("v.showSpinner", false);
+ }else{
+ component.set("v.showSpinner", false);
helper.ShowToast({
- message: 'Init error',
- type: 'error'
+ "message" : rv.Message,
+ "type" : "error"
});
}
+
+ }else{
+ component.set("v.showSpinner", false);
+ helper.ShowToast({
+ "message" : "Init error",
+ "type" : "error"
+ });
+
}
- );
+ });
+ },
+ handleLoad: function(component, event, helper) {
+ console.log('recordEditForm handleSuccess')
+ component.set("v.showSpinner", false);
},
- saveClick: function (component, event, helper) {
+ saveClick : function(component, event, helper){
+
let staticResource = component.get('v.staticResource');
let record_id = component.get('v.recordId');
let record_type_id = component.get('v.recordTypeId');
-
+
let isClone = component.get('v.isClone');
let url = staticResource.newUrl;
let payloadPi = {};
if (record_id && !isClone) {
- url = staticResource.updateUrl;
+ url = staticResource.updateUrl
payloadPi['dataId'] = component.get('v.record_data').AWS_Data_Id__c;
}
let layout = component.get('v.layout');
-
+
let pi_fields_map = component.get('v.pi_fields_map');
-
- for (let s of layout) {
- for (let c of s.layoutColumns) {
- for (let item of c.layoutItems) {
- if (pi_fields_map.hasOwnProperty(item.field)) {
- payloadPi[pi_fields_map[item.field].AWS_Field_API__c] =
- item.value;
+
+ for(let s of layout){
+ for(let c of s.layoutColumns){
+ for(let item of c.layoutItems){
+ if(pi_fields_map.hasOwnProperty(item.field)){
+
+ payloadPi[pi_fields_map[item.field].AWS_Field_API__c] = item.value;
}
- if (item.behavior == 'Required' && !item.value) {
- let fs = component.find('field');
- for (let fi in fs) {
+ if (item.behavior == "Required" && !item.value ) {
+ let fs = component.find("field");
+ for(let fi in fs){
let f = fs[fi];
- if (!f.get('v.value')) {
+ if(!f.get('v.value')){
f.reset();
}
}
@@ -191,144 +167,139 @@
}
}
}
-
- component.set('v.showSpinner', true);
- debugger;
+
+ component.set("v.showSpinner", true);
+ debugger
let data = {};
- if (record_id && !isClone) {
+ if(record_id && !isClone){
data.Id = record_id;
}
- for (let s of layout) {
- for (let c of s.layoutColumns) {
- for (let item of c.layoutItems) {
- if (item.field && item.behavior != 'Readonly') {
+ for(let s of layout){
+ for(let c of s.layoutColumns){
+ for(let item of c.layoutItems){
+ if(item.field && item.behavior != "Readonly"){
data[item.field] = item.value;
}
}
}
}
let x = 1;
- helper.CallBackAction(
- component,
- 'Save',
- {
- data: data,
- transId: '1',
- recordTypeId: record_type_id
- },
- function (data) {
- component.set('v.showSpinner', false);
- if (data.getState() == 'SUCCESS') {
- var rv = data.getReturnValue();
- console.log(rv);
- var sfId = null;
- if (rv.IsSuccess) {
- sfId = rv.Data.recordId;
- helper.ShowToast({
- message: '鎴愬姛',
- type: 'success'
- });
- if (record_id) {
- $A.get('e.force:closeQuickAction').fire();
- $A.get('e.force:refreshView').fire();
- } else {
- var sObjectEvent = $A.get(
- 'e.force:navigateToSObject'
- );
- sObjectEvent.setParams({
- recordId: sfId
+ helper.CallBackAction(component,'Save',{
+ data : data,
+ transId :'1',
+ recordTypeId:record_type_id
+ },function(data){
+ component.set("v.showSpinner", false);
+ if(data.getState() == "SUCCESS"){
+ var rv = data.getReturnValue();
+ console.log(rv);
+ var sfId = null;
+ if(rv.IsSuccess){
+ sfId = rv.Data.recordId;
+ helper.ShowToast({
+ "message" : "鎴愬姛",
+ "type" : "success"
+ });
+ if (record_id){
+ $A.get("e.force:closeQuickAction").fire();
+ $A.get('e.force:refreshView').fire();
+ }else{
+ var sObjectEvent = $A.get("e.force:navigateToSObject");
+ sObjectEvent.setParams({
+ "recordId": sfId
+ })
+ sObjectEvent.fire();
+ }
+ }else{
+ helper.ShowToast({
+ "message" : rv.Message,
+ "type" : "error"
+ });
+ }
+ }else{
+ helper.ShowToast({
+ "message" : "Init error",
+ "type" : "error"
});
- sObjectEvent.fire();
}
- } else {
- helper.ShowToast({
- message: rv.Message,
- type: 'error'
- });
- }
- } else {
- helper.ShowToast({
- message: 'Init error',
- type: 'error'
- });
- }
- }
- );
+ })
},
- cancelClick: function (component, event, helper) {
- $A.get('e.force:closeQuickAction').fire();
+ cancelClick : function(component, event, helper){
+ $A.get("e.force:closeQuickAction").fire();
//component.set("v.showNewAgencyContact", false);
},
- searchAgencyContact: function (component, event, helper) {
+ searchAgencyContact : function(component, event, helper){
component.find('button').set('v.disabled', true);
helper.resetTable();
helper.preparePayloadForSearchAgencyContact(component, event, helper);
},
- initContactTable: function (component, event, helper) {
- let cols = ['Name', 'AgencyHospital', 'DoctorDivision1', 'Type'];
+ initContactTable : function(component, event, helper){
+ let cols = ['Name','AgencyHospital', 'DoctorDivision1','Type'];
let contactInfoList = [];
let awsDataIds = [];
let data = component.get('v.result');
- if (data.object) {
- for (var i = 0; i < data.object.length; i++) {
- if (data.object[i].dataId) {
+ if(data.object){
+ for(var i=0;i<data.object.length;i++){
+ if(data.object[i].dataId){
let contactInfo = new Object();
//闇�瑕佷慨鏀�
contactInfo.Name = data.object[i].name;
- contactInfo.DoctorDivision1 =
- data.object[i].doctorDivision1;
+ contactInfo.DoctorDivision1 = data.object[i].doctorDivision1;
contactInfo.AWSDataId = data.object[i].dataId;
contactInfo.Type = data.object[i].type;
contactInfo.pi = true;
awsDataIds.push(contactInfo.AWSDataId);
contactInfo.sfRecordId = '';
contactInfoList.push(contactInfo);
- }
+ }
}
}
let AWSIdToSFIdMapValue = {};
},
- openModel: function (component, event, helper) {
+ openModel: function(component, event, helper) {
let layout = component.get('v.layout');
- for (let s of layout) {
- for (let c of s.layoutColumns) {
- for (let item of c.layoutItems) {
- if (item.field == 'Agency_Hospital__c' && !item.value) {
- console.log('item.value = ' + item.value);
+ for(let s of layout){
+ for(let c of s.layoutColumns){
+ for(let item of c.layoutItems){
+ if(item.field == 'Agency_Hospital__c' && !item.value){
+ console.log('item.value = ' + item.value)
helper.ShowToast({
- message: '璇峰厛閫夋嫨缁忛攢鍟嗗尰闄�',
- type: 'warning'
+ "message" : "璇峰厛閫夋嫨缁忛攢鍟嗗尰闄�",
+ "type" : "warning"
});
- return;
+ return
+ }else if(item.field == 'Agency_Hospital__c' && item.value){
+ component.set('v.agencyHospitalId',item.value)
+ console.log('v.agencyHospitalId item.value = ' + item.value)
}
}
}
}
// Set isModalOpen true
- component.set('v.isModalOpen', true);
+ component.set("v.isModalOpen", true);
component.find('button').set('v.disabled', true);
helper.preparePayloadForSearchAgencyContact(component, event, helper);
- },
-
- closeModel: function (component, event, helper) {
+ },
+
+ closeModel: function(component, event, helper) {
// Set isModalOpen false
- component.set('v.isModalOpen', false);
- },
-
- saveDetails: function (component, event, helper) {
- //do something
- component.set('v.isModalOpen', false);
- },
-
- showNewAgency: function (component, event, helper) {
- //do something
- component.set('v.showNewAgencyContact', true);
- },
- closeAgencyContact: function (component, event, helper) {
- var message = event.getParam('showNewAgencyContact');
- component.set('v.showNewAgencyContact', message);
+ component.set("v.isModalOpen", false);
+ },
+
+ saveDetails: function(component, event, helper) {
+ //do something
+ component.set("v.isModalOpen", false);
+ },
+
+ showNewAgency: function(component, event, helper) {
+ //do something
+ component.set("v.showNewAgencyContact", true);
+ },
+ closeAgencyContact: function(component, event, helper) {
+ var message = event.getParam("showNewAgencyContact");
+ component.set("v.showNewAgencyContact", message);
component.find('button').set('v.disabled', true);
helper.resetTable();
helper.preparePayloadForSearchAgencyContact(component, event, helper);
- }
-});
+ },
+})
\ No newline at end of file
diff --git a/force-app/main/default/aura/NewAgencyOpportunity/NewAgencyOpportunityHelper.js b/force-app/main/default/aura/NewAgencyOpportunity/NewAgencyOpportunityHelper.js
index 6377482..34e057a 100644
--- a/force-app/main/default/aura/NewAgencyOpportunity/NewAgencyOpportunityHelper.js
+++ b/force-app/main/default/aura/NewAgencyOpportunity/NewAgencyOpportunityHelper.js
@@ -1,89 +1,69 @@
({
- CallBackAction: function (component, action_name, para, callback) {
- var action = component.get(
- 'c.' + action_name.trimStart().replace('c.', '')
- );
- if (para) {
+ CallBackAction : function(component,action_name,para,callback) {
+ var action = component.get("c." + action_name.trimStart().replace("c.",""));
+ if(para){
action.setParams(para);
}
- if (callback) {
- action.setCallback(this, function (data) {
+ if(callback){
+ action.setCallback(this,function(data){
callback(data);
});
}
-
+
$A.enqueueAction(action);
- },
- ShowToast: function (paras) {
- var toastEvent = $A.get('e.force:showToast');
+ },
+ ShowToast : function(paras){
+ var toastEvent = $A.get("e.force:showToast");
toastEvent.setParams(paras);
toastEvent.fire();
},
- AwsPost: function (postURL, data, callback, token) {
+ AwsPost : function(postURL, data ,callback,token){
let payloadForNewPI = '';
- if (typeof data == 'string') {
+ if(typeof(data) == 'string'){
payloadForNewPI = data;
- } else {
+ }else{
payloadForNewPI = JSON.stringify(data);
}
-
- AWSService.post(
- postURL,
- payloadForNewPI,
- function (result) {
- //this.insertCalloutLog(this.insertModule,postURL,JSON.stringify(payloadForNewPI),JSON.stringify(result),this.successStatus);
- if (callback) callback(result);
- },
- token
- );
+
+ AWSService.post(postURL,payloadForNewPI,function(result) {
+ //this.insertCalloutLog(this.insertModule,postURL,JSON.stringify(payloadForNewPI),JSON.stringify(result),this.successStatus);
+ if(callback) callback(result);
+ },token);
},
- AwsGet: function (url, data, callback, token) {
- if (typeof data == 'string') {
+ AwsGet : function(url, data ,callback,token){
+
+ if(typeof(data) == 'string'){
url += data;
- } else {
+ }else{
let i = 0;
- for (let p in data) {
- url += i++ ? '&' : '?';
+ for(let p in data){
+ url += (i++) ? '&' : '?';
url += p + '=' + data[p];
}
}
-
- AWSService.get(
- url,
- function (result) {
- //this.insertCalloutLog(this.insertModule,postURL,JSON.stringify(payloadForNewPI),JSON.stringify(result),this.successStatus);
- if (callback) callback(result);
- },
- token
- );
+
+ AWSService.get(url,function(result){
+ //this.insertCalloutLog(this.insertModule,postURL,JSON.stringify(payloadForNewPI),JSON.stringify(result),this.successStatus);
+ if(callback) callback(result);
+ },token);
},
- refreshTable: function (
- component,
- event,
- helper,
- cols,
- contactInfoList,
- contactsInfo
- ) {
+ refreshTable : function(component, event, helper,cols,contactInfoList,contactsInfo){
let that = this;
- let myTableDiv = document.getElementById('QueryResult');
+ let myTableDiv = document.getElementById("QueryResult");
let table = document.createElement('TABLE');
table.border = '1';
- table.id = 'table';
- table.setAttribute(
- 'class',
- 'slds-table slds-table_cell-buffer slds-table_bordered'
- );
+ table.id = 'customTable';
+ table.setAttribute('class','slds-table slds-table_cell-buffer slds-table_bordered');
let tableBody = document.createElement('TBODY');
table.appendChild(tableBody);
let headerTR = document.createElement('TR');
- headerTR.setAttribute('class', 'slds-line-height_reset');
- let colsHeader = ['濮撳悕', '鍖婚櫌', '鍖荤敓鍖哄垎(鑱屽姟)', '鍒嗙被'];
+ headerTR.setAttribute('class','slds-line-height_reset');
+ let colsHeader = [' ','濮撳悕','鍖婚櫌', '鍖荤敓鍖哄垎(鑱屽姟)','鍒嗙被'];
tableBody.appendChild(headerTR);
for (let i = 0; i < colsHeader.length; i++) {
let td = document.createElement('TH');
td.width = '75';
- td.setAttribute('class', 'slds-truncate slds-border_right');
+ td.setAttribute('class','slds-truncate slds-border_right');
td.appendChild(document.createTextNode(colsHeader[i]));
headerTR.appendChild(td);
}
@@ -92,84 +72,94 @@
let tr = document.createElement('TR');
tableBody.appendChild(tr);
let contactInfoTemp = contactInfoList[i];
+
+ //鍐嶅姞涓�鍒楅�夋嫨button
+ debugger
+ let td = document.createElement('TD');
+ td.width = '75';
+ td.id = contactsInfo[contactInfoTemp.AWSDataId].Id;
+ console.log('contactInfoTemp = ' + JSON.stringify(contactInfoTemp))
+ // 鍒涘缓鎸夐挳鍏冪礌
+ var button = document.createElement('button');
+ button.classList.add('slds-button','slds-button_neutral');
+ button.id = contactInfoTemp.sfRecordId != null ? contactInfoTemp.sfRecordId : '';
+ // 璁剧疆鎸夐挳鐨勬枃鏈唴瀹�
+ var buttonText = document.createTextNode('閫夋嫨');
+ button.appendChild(buttonText);
+ button.addEventListener("click", function (obj) {
+ that.redirectToParentPage(component, event, helper, obj);
+ });
+ button.value = contactInfoTemp[cols[0]] != null ? contactInfoTemp[cols[0]] : ''
+ td.appendChild(button);
+ tr.appendChild(td);
for (let j = 0; j < cols.length; j++) {
let td = document.createElement('TD');
td.width = '75';
- if (contactInfoTemp.pi) {
- if (
- !contactsInfo.hasOwnProperty(contactInfoTemp.AWSDataId)
- ) {
+ if(contactInfoTemp.pi){
+ if (!contactsInfo.hasOwnProperty(contactInfoTemp.AWSDataId)) {
continue;
}
- if (j == 0 && contactsInfo[contactInfoTemp.AWSDataId]) {
+ if(j == 0 && contactsInfo[contactInfoTemp.AWSDataId] ){
td.id = contactsInfo[contactInfoTemp.AWSDataId].Id;
- }
- } else {
+ }
+ }else{
td.id = contactInfoTemp.sfRecordId;
- }
- td.appendChild(
- document.createTextNode(
- contactInfoTemp[cols[j]] != null
- ? contactInfoTemp[cols[j]]
- : ''
- )
- );
- if (cols[j] == 'Name') {
- td.addEventListener('click', function (obj) {
- that.redirectToParentPage(
- component,
- event,
- helper,
- obj
- );
- });
- }
+ }
+ td.appendChild(document.createTextNode(contactInfoTemp[cols[j]]!=null?contactInfoTemp[cols[j]]:''));
+ // if (cols[j] == 'Name') {
+ // td.addEventListener("click", function (obj) {
+ // that.redirectToParentPage(component, event, helper,obj);
+ // });
+ // }
tr.appendChild(td);
}
}
+ that.resetTable();
myTableDiv.appendChild(table);
component.find('button').set('v.disabled', false);
},
- redirectToParentPage: function (component, event, helper, obj) {
- let agencyContactName = obj.currentTarget.innerText;
+ redirectToParentPage : function(component, event, helper,obj){
+ let agencyContactName = obj.currentTarget.value;
let id = obj.currentTarget.id;
- component.set('v.ac_name', agencyContactName);
+ component.set('v.ac_name',agencyContactName);
let layout = component.get('v.layout');
- for (let s of layout) {
- for (let c of s.layoutColumns) {
- for (let item of c.layoutItems) {
- if (item.field == 'Agency_Contact__c') {
+ for(let s of layout){
+ for(let c of s.layoutColumns){
+ for(let item of c.layoutItems){
+ if(item.field == 'Agency_Contact__c'){
item.value = id;
}
}
}
}
- component.set('v.isModalOpen', false);
+ component.set("v.isModalOpen", false);
},
- resetTable: function () {
- let queryResult = document.getElementById('QueryResult');
- let table = document.getElementsByTagName('table');
- debugger;
- console.log('table:' + table);
- debugger;
- if (table.length > 1) {
- for (var i = 1; i < table.length; i++) {
- queryResult.removeChild(table[i]);
- }
+ resetTable : function(){
+ // let queryResult = document.getElementById('QueryResult');
+ // let table = document.getElementById('customTable');
+ // console.log('table:' + table);
+ // if(table.length > 1){
+ // for(var i=1;i<table.length;i++){
+ // queryResult.removeChild(table[i])
+ // }
+ // }
+ let customTable = document.getElementById('customTable');
+ if(customTable){
+ customTable.parentNode.removeChild(customTable);
}
},
- preparePayloadForSearchAgencyContact: function (component, event, helper) {
+ preparePayloadForSearchAgencyContact : function(component, event, helper){
let that = this;
let agencyHospitalId = '';
let accountId = '';
let layout = component.get('v.layout');
- for (let s of layout) {
- for (let c of s.layoutColumns) {
- for (let item of c.layoutItems) {
- if (item.field == 'Agency_Hospital__c') {
+ for(let s of layout){
+ for(let c of s.layoutColumns){
+ for(let item of c.layoutItems){
+ if(item.field == 'Agency_Hospital__c'){
agencyHospitalId = item.value;
}
- if (item.field == 'Account_Opp__c') {
+ if(item.field == 'Account_Opp__c'){
accountId = item.value;
}
}
@@ -177,165 +167,118 @@
}
var action = component.get('c.getAWSDataIds');
action.setParams({
- agencyHospitalId: agencyHospitalId,
- accountId: accountId
+ "agencyHospitalId" : agencyHospitalId,
+ "accountId" : accountId
});
- action.setCallback(this, function (response) {
+ action.setCallback(this,function(response){
var state = response.getState();
- if (state == 'SUCCESS') {
+ if(state == 'SUCCESS'){
var rv = response.getReturnValue();
- if (rv.Data.length == 0) {
+ if(rv.Data.length == 0){
component.find('button').set('v.disabled', false);
helper.ShowToast({
- message: '璇ョ粡閿�鍟嗗尰闄笅闈㈡病鏈夊鎴蜂汉鍛�',
- type: 'warning'
+ "message" : "璇ョ粡閿�鍟嗗尰闄笅闈㈡病鏈夊鎴蜂汉鍛�",
+ "type" : "warning"
});
- return;
+ return
}
+ component.set('v.showSpinner',true);
let searchPayload = new Object();
let searchAgencyContactName = component.get('v.searchKeyWord');
searchPayload.dataIds = rv.Data;
searchPayload.name = searchAgencyContactName;
- component.set('v.contactAWSIds', rv.Data);
+ component.set('v.contactAWSIds',rv.Data);
let staticResource = component.get('v.staticResource');
let url = staticResource.searchUrl;
let token = staticResource.token;
- this.AwsPost(
- url,
- searchPayload,
- function (data) {
- if (data.success) {
- let cols = [
- 'Name',
- 'AgencyHospital',
- 'DoctorDivision1',
- 'Type'
- ];
- let contactInfoList = [];
- let awsDataIds = [];
- if (data.object.length == 0) {
- component
- .find('button')
- .set('v.disabled', false);
- that.ShowToast({
- message: '娌℃湁鏌ヨ鍒拌瀹㈡埛浜哄憳',
- type: 'warning'
- });
- return;
- }
- for (var i = 0; i < data.object.length; i++) {
- if (data.object[i].dataId) {
- let contactInfo = new Object();
- //闇�瑕佷慨鏀�
- contactInfo.Name = data.object[i].name;
- contactInfo.AgencyHospital = '';
- contactInfo.DoctorDivision1 =
- data.object[i].doctorDivision1;
- contactInfo.AWSDataId =
- data.object[i].dataId;
- contactInfo.Type = data.object[i].type;
- contactInfo.pi = true;
- awsDataIds.push(contactInfo.AWSDataId);
- contactInfo.sfRecordId = '';
- contactInfoList.push(contactInfo);
- }
- }
- //let AWSIdToSFIdMapValue = {};
- var searchAgencyContacts = component.get(
- 'c.searchAgencyContacts'
- );
- searchAgencyContacts.setParams({
- awsAgencyContactIds: JSON.stringify(awsDataIds),
- agencyHospitalId: agencyHospitalId,
- accountId: accountId
+ this.AwsPost(url,searchPayload,function(data){
+ if(data.success){
+ let cols = ['Name','AgencyHospital', 'DoctorDivision1','Type'];
+ let contactInfoList = [];
+ let awsDataIds = [];
+ if(data.object.length == 0){
+ component.find('button').set('v.disabled', false);
+ that.ShowToast({
+ "message" : '娌℃湁鏌ヨ鍒拌瀹㈡埛浜哄憳',
+ "type" : "warning"
});
- searchAgencyContacts.setCallback(
- this,
- function (response) {
- var state = response.getState();
- if (state == 'SUCCESS') {
- var rv = response.getReturnValue();
- if (rv.IsSuccess) {
- let contactsInfo = '';
- if (rv.Data) {
- contactsInfo = JSON.parse(
- rv.Data.replace(
- /("\;)/g,
- '"'
- )
- );
- if (
- Object.keys(contactsInfo)
- .length > 0
- ) {
- for (
- let i = 0;
- i <
- contactInfoList.length;
- i++
- ) {
- let contactFromSF =
- contactsInfo[
- contactInfoList[
- i
- ]['AWSDataId']
- ];
- if (contactFromSF) {
- contactInfoList[
- i
- ].sfRecordId =
- contactFromSF[
- 'Id'
- ];
- if (
- contactFromSF[
- 'Agency_Hospital__r'
- ]
- ) {
- contactInfoList[
- i
- ].AgencyHospital =
- contactFromSF[
- 'Agency_Hospital__r'
- ]['Name'];
- }
- if (
- contactFromSF[
- 'Department_Class__r'
- ]
- ) {
- contactInfoList[
- i
- ].AgencyHospital =
- contactFromSF[
- 'Department_Class__r'
- ]['Parent'][
- 'Name'
- ];
- }
- }
+ component.set('v.showSpinner',false);
+ return
+ }
+ for(var i=0;i<data.object.length;i++){
+ if(data.object[i].dataId){
+ let contactInfo = new Object();
+ //闇�瑕佷慨鏀�
+ contactInfo.Name = data.object[i].name;
+ contactInfo.AgencyHospital = '';
+ contactInfo.DoctorDivision1 = data.object[i].doctorDivision1;
+ contactInfo.AWSDataId = data.object[i].dataId;
+ contactInfo.Type = data.object[i].type;
+ contactInfo.pi = true;
+ awsDataIds.push(contactInfo.AWSDataId);
+ contactInfo.sfRecordId = '';
+ contactInfoList.push(contactInfo);
+ }
+ }
+ //let AWSIdToSFIdMapValue = {};
+ debugger
+ var searchAgencyContacts = component.get('c.searchAgencyContacts');
+ searchAgencyContacts.setParams({
+ "awsAgencyContactIds" : JSON.stringify(awsDataIds),
+ "agencyHospitalId" : agencyHospitalId,
+ "accountId" : accountId
+ });
+ // 寤惰繜鎵ц涓�娈典唬鐮�
+ setTimeout(function() {
+ // 闇�瑕佸欢杩熸墽琛岀殑浠g爜
+ // 鍒涘缓涓�涓紶鏍囩偣鍑讳簨浠�
+ var event = new MouseEvent('click', {
+ bubbles: true,
+ cancelable: true,
+ view: window
+ });
+
+ // 瑙﹀彂鍏冪礌鐨勭偣鍑讳簨浠�
+ var element = document.getElementById('NewAgencyContact');
+ for(var i = 0;i<100;i++){
+ element.dispatchEvent(event);
+ }
+ }, 1000); // 寤惰繜 1000 姣锛堝嵆 1 绉掞級
+ searchAgencyContacts.setCallback(that,function(response){
+ var state = response.getState();
+ if(state == 'SUCCESS'){
+ var rv = response.getReturnValue();
+ if(rv.IsSuccess){
+ let contactsInfo = '';
+ if(rv.Data){
+ contactsInfo = JSON.parse(rv.Data.replace(/("\;)/g,"\""));
+ if(Object.keys(contactsInfo).length>0){
+ for(let i=0;i<contactInfoList.length;i++){
+ let contactFromSF = contactsInfo[contactInfoList[i]['AWSDataId']];
+ if(contactFromSF){
+ contactInfoList[i].sfRecordId = contactFromSF['Id'];
+ if(contactFromSF['Agency_Hospital__r']){
+ contactInfoList[i].AgencyHospital = contactFromSF['Agency_Hospital__r']['Name'];
+ }
+ if(contactFromSF['Department_Class__r']){
+ contactInfoList[i].AgencyHospital = contactFromSF['Department_Class__r']['Parent']['Name'];
}
}
}
- that.refreshTable(
- component,
- event,
- helper,
- cols,
- contactInfoList,
- contactsInfo
- );
}
}
+ that.refreshTable(component, event, helper,cols,contactInfoList,contactsInfo);
+ component.set('v.showSpinner',false);
}
- );
- $A.enqueueAction(searchAgencyContacts);
- }
- },
- token
- );
+ }
+ });
+ $A.enqueueAction(searchAgencyContacts);
+ }else{
+ component.set('v.showSpinner',false);
+ }
+ },token);
}
});
$A.enqueueAction(action);
}
-});
+})
\ No newline at end of file
diff --git a/force-app/main/default/aura/NewAgencyOpportunity/NewAgencyOpportunityRenderer.js b/force-app/main/default/aura/NewAgencyOpportunity/NewAgencyOpportunityRenderer.js
index 605447f..f1f0c75 100644
--- a/force-app/main/default/aura/NewAgencyOpportunity/NewAgencyOpportunityRenderer.js
+++ b/force-app/main/default/aura/NewAgencyOpportunity/NewAgencyOpportunityRenderer.js
@@ -1,3 +1,5 @@
({
- // Your renderer method overrides go here
-});
+
+// Your renderer method overrides go here
+
+})
\ No newline at end of file
diff --git a/force-app/main/default/aura/RetrospectiveWeeklyReport/RetrospectiveWeeklyReport.cmp b/force-app/main/default/aura/RetrospectiveWeeklyReport/RetrospectiveWeeklyReport.cmp
index 3a97a6b..2f53aa1 100644
--- a/force-app/main/default/aura/RetrospectiveWeeklyReport/RetrospectiveWeeklyReport.cmp
+++ b/force-app/main/default/aura/RetrospectiveWeeklyReport/RetrospectiveWeeklyReport.cmp
@@ -1,31 +1,13 @@
-<aura:component
- controller="RetrospectiveWeeklyReportController"
+<aura:component controller="RetrospectiveWeeklyReportController"
implements="force:appHostable,flexipage:availableForAllPageTypes,flexipage:availableForRecordHome,force:hasRecordId,force:lightningQuickAction,forceCommunity:availableForAllPageTypes,lightning:availableForFlowScreens"
- access="global"
->
+ access="global">
<ltng:require styles="{!$Resource.multilineToastCSS}" />聽
<aura:handler name="init" value="{!this}" action="{!c.doInit}" />
- <aura:handler
- event="c:strike_evt"
- action="{!c.createAopp}"
- name="strike_evt_addNewRecord"
- />
- <aura:attribute
- name="data"
- type="Agency_Report__c"
- default="{sobjectType:'Agency_Report__c'}"
- />
- <aura:attribute
- name="oppdata"
- type="Agency_Opportunity__c"
- default="{sobjectType:'Agency_Opportunity__c'}"
- />
- <aura:attribute
- name="acondata"
- type="Agency_Contact__c"
- default="{sobjectType:'Ag
- ency_Contact__c'}"
- />
+ <aura:handler event="c:strike_evt" action="{!c.createAopp}" name="strike_evt_addNewRecord" />
+ <aura:attribute name="data" type="Agency_Report__c" default="{sobjectType:'Agency_Report__c'}" />
+ <aura:attribute name="oppdata" type="Agency_Opportunity__c" default="{sobjectType:'Agency_Opportunity__c'}" />
+ <aura:attribute name="acondata" type="Agency_Contact__c" default="{sobjectType:'Ag
+ ency_Contact__c'}" />
<aura:attribute name="successMessage" type="String" />
<aura:attribute name="etEng" type="String" />
<aura:attribute name="errorMessage" type="String" />
@@ -44,11 +26,7 @@
<aura:attribute name="docmap" type="Map" />
<aura:attribute name="login" type="Boolean" default="false" />
<aura:attribute name="loginEdit" type="Boolean" default="false" />
- <aura:attribute
- name="modal_import_spinner"
- type="Boolean"
- default="false"
- />
+ <aura:attribute name="modal_import_spinner" type="Boolean" default="false" />
<aura:attribute name="loadOpp" type="Boolean" default="false" />
<aura:attribute name="reportPageData" type="Map" />
<aura:attribute name="selectbody" type="String" />
@@ -68,31 +46,19 @@
<!-- 浣跨敤浜у搧1(浜у搧鍨嬪彿) -->
<aura:attribute name="UseProduct1" type="string" default="" />
<aura:attribute name="UseProduct1s" type="string" default="" />
- <aura:handler
- name="change"
- value="{!v.UseProduct1}"
- action="{!c.UseProduct1Change}"
- />
+ <aura:handler name="change" value="{!v.UseProduct1}" action="{!c.UseProduct1Change}" />
<aura:attribute name="UseProduct1List" type="Map" />
<aura:attribute name="UseProduct1Id" type="string" default="" />
<!-- 浣跨敤浜у搧2 -->
<aura:attribute name="UseProduct2" type="string" default="" />
<aura:attribute name="UseProduct2s" type="string" default="" />
- <aura:handler
- name="change"
- value="{!v.UseProduct2}"
- action="{!c.UseProduct2Change}"
- />
+ <aura:handler name="change" value="{!v.UseProduct2}" action="{!c.UseProduct2Change}" />
<aura:attribute name="UseProduct2List" type="Map" />
<aura:attribute name="UseProduct2Id" type="string" default="" />
<!-- 浣跨敤浜у搧3 -->
<aura:attribute name="UseProduct3" type="string" default="" />
<aura:attribute name="UseProduct3s" type="string" default="" />
- <aura:handler
- name="change"
- value="{!v.UseProduct3}"
- action="{!c.UseProduct3Change}"
- />
+ <aura:handler name="change" value="{!v.UseProduct3}" action="{!c.UseProduct3Change}" />
<aura:attribute name="UseProduct3List" type="Map" />
<aura:attribute name="UseProduct3Id" type="string" default="" />
<!--SWAG-CF58C3 fy start -->
@@ -105,6 +71,7 @@
<aura:attribute name="contactawsurl" type="Map" />
<aura:attribute name="allselectlistAgencyPerson" type="Map" />
<!--SWAG-CF58C3 fy end -->
+
<aura:attribute name="doctor_list" type="Map" />
<!-- <aura:attribute name="doctor_title" type="String" /> -->
@@ -132,28 +99,12 @@
<aura:attribute name="UserProType" type="String" />
<!-- 绉戝 -->
<aura:attribute name="opportunity_cfilter" type="String" />
- <aura:attribute
- name="update_select_report_data_id"
- type="String"
- default=""
- />
+ <aura:attribute name="update_select_report_data_id" type="String" default="" />
<!-- 鎵归噺娣诲姞鏃ユ姤 start-->
<aura:attribute name="reports_date" type="List" />
- <aura:attribute
- name="TableContent"
- type="String"
- description=" Show the Result class"
- />
- <aura:attribute
- name="TableContent2"
- type="String"
- description=" Show the Result class"
- />
- <aura:attribute
- name="TargetFileName"
- type="String"
- description="Name of the file"
- />
+ <aura:attribute name="TableContent" type="String" description=" Show the Result class" />
+ <aura:attribute name="TableContent2" type="String" description=" Show the Result class" />
+ <aura:attribute name="TargetFileName" type="String" description="Name of the file" />
<aura:attribute name="tableheaders" type="Object[]" />
<aura:attribute name="fileContentData" type="String" />
<aura:attribute name="filename" type="String" />
@@ -183,11 +134,7 @@
聽 聽 <div class="slds-spinner__dot-b"></div>
</div>
</div> -->
- <div
- class="slds-spinner_container"
- id="spinner"
- style="position: fixed; top: 123px"
- >
+ <div class="slds-spinner_container" id="spinner" style="position: fixed;top:123px;">
<div
role="status"
class="slds-spinner slds-spinner_medium slds-spinner_brand"
@@ -201,230 +148,123 @@
</aura:renderIf>
<div aura:id="report" id="report">
<div class="slds-grid slds-wrap slds-grid--pull-padded">
- <div style="width: 150px"></div>
+ <div style="width: 150px;"></div>
<div
- class="tr mt5 slds-p-horizontal--small slds-size--1-of-1 slds-medium-size--1-of-12 slds-large-size--1-of-12 fontSize"
- >
+ class="tr mt5 slds-p-horizontal--small slds-size--1-of-1 slds-medium-size--1-of-12 slds-large-size--1-of-12 fontSize">
鍛�
</div>
<div
- class="slds-p-horizontal--small slds-size--1-of-1 slds-medium-size--3-of-12 slds-large-size--3-of-12 fontSize"
- >
- <ui:inputSelect
- aura:id="select_date"
- class="slds-select"
- change="{!c.select_date_change}"
- />
+ class="slds-p-horizontal--small slds-size--1-of-1 slds-medium-size--3-of-12 slds-large-size--3-of-12 fontSize">
+ <ui:inputSelect aura:id="select_date" class="slds-select" change="{!c.select_date_change}" />
</div>
<!-- 浠g悊搴楁媴褰撹�� -->
- <div
- class="tr mt5 slds-p-horizontal--small slds-size--1-of-1 slds-medium-size--1-of-12 slds-large-size--1-of-12"
- style="display: none"
- >
+ <div class="tr mt5 slds-p-horizontal--small slds-size--1-of-1 slds-medium-size--1-of-12 slds-large-size--1-of-12"
+ style="display: none;">
{!v.fieldsmap.Person_In_Charge2__c}
</div>
- <div
- class="slds-p-horizontal--small slds-size--1-of-1 slds-medium-size--3-of-12 slds-large-size--3-of-12"
- style="display: none"
- >
- <ui:inputSelect
- aura:id="select_agency_person"
- class="slds-select agency_person_select"
- change="{!c.select_agency_change}"
- />
+ <div class="slds-p-horizontal--small slds-size--1-of-1 slds-medium-size--3-of-12 slds-large-size--3-of-12"
+ style="display: none;">
+ <ui:inputSelect aura:id="select_agency_person" class="slds-select agency_person_select"
+ change="{!c.select_agency_change}" />
</div>
- <div style="width: 100px"></div>
- <div
- class="tr slds-p-horizontal--small slds-size--1-of-1 slds-medium-size--2-of-12 slds-large-size--2-of-12"
- style="display: contents"
- >
- <ui:button
- aura:id="new_button"
- label="鏂板缓"
- press="{!c.new_report}"
- class="buttonFontSize"
- />
+ <div style="width: 100px;">
</div>
- <div
- style="width: 400px"
- class="slds-p-horizontal--small slds-size--1-of-1 slds-medium-size--4-of-12 slds-large-size--4-of-12"
- >
- <ui:button
- aura:id="copy_button"
- label="澶嶅埗"
- press="{!c.copy_button}"
- disabled="true"
- class="buttonFontSize"
- />
- <ui:button
- aura:id="delete_button"
- label="鍒犻櫎"
- press="{!c.delete_button}"
- disabled="true"
- class="buttonFontSize"
- />
- <ui:button
- aura:id="import"
- label="瀵煎叆"
- press="{!c.import}"
- class="buttonFontSize"
- />
- <ui:button
- aura:id="export"
- label="瀵煎嚭"
- press="{!c.export_condition}"
- class="buttonFontSize"
- />
+ <div class="tr slds-p-horizontal--small slds-size--1-of-1 slds-medium-size--2-of-12 slds-large-size--2-of-12"
+ style="display: contents;">
+ <ui:button aura:id="new_button" label="鏂板缓" press="{!c.new_report}" class="buttonFontSize" />
+ </div>
+ <div style="width: 400px;"
+ class="slds-p-horizontal--small slds-size--1-of-1 slds-medium-size--4-of-12 slds-large-size--4-of-12">
+ <ui:button aura:id="copy_button" label="澶嶅埗" press="{!c.copy_button}" disabled="true"
+ class="buttonFontSize" />
+ <ui:button aura:id="delete_button" label="鍒犻櫎" press="{!c.delete_button}" disabled="true"
+ class="buttonFontSize" />
+ <ui:button aura:id="import" label="瀵煎叆" press="{!c.import}" class="buttonFontSize" />
+ <ui:button aura:id="export" label="瀵煎嚭" press="{!c.export_condition}" class="buttonFontSize" />
<!-- <ui:button aura:id="returnbutton" label="杩斿洖" press="{!c.return_main_page}" /> -->
</div>
</div>
</div>
<div aura:id="report_list" class="report_list_area">
- <div
- class="slds-table--edit_container slds-is-relative"
- style="padding-left: 50px"
- >
- <table
- class="slds-table slds-table--edit slds-table--bordered slds-table--fixed-layout slds-no-cell-focus"
- role="grid"
- style="width: 66.75rem"
- >
+ <div class="slds-table--edit_container slds-is-relative" style="padding-left: 50px;">
+ <table class="slds-table slds-table--edit slds-table--bordered slds-table--fixed-layout slds-no-cell-focus"
+ role="grid" style="width:66.75rem;">
<thead>
<tr class="slds-line-height--reset">
- <th
- class="table_header slds-text-title--caps fontSize"
- style="width: 250px"
- >
- <span class="slds-truncate" title="Name"
- >鏃ユ姤缂栧彿</span
- >
+ <th class="table_header slds-text-title--caps fontSize" style="width:250px">
+ <span class="slds-truncate" title="Name">鏃ユ姤缂栧彿</span>
</th>
<th class="table_header slds-text-title--caps fontSize">
- <span class="slds-truncate" title="Name"
- >{!v.fieldsmap.Person_In_Charge2__c}</span
- >
+ <span class="slds-truncate" title="Name">{!v.fieldsmap.Person_In_Charge2__c}</span>
<!-- {!v.fieldsmap.Person_In_Charge2__c} 鎷呭綋-->
</th>
- <th
- class="table_header slds-text-title--caps fontSize"
- style="width: 250px"
- >
+ <th class="table_header slds-text-title--caps fontSize" style="width:250px">
<span class="slds-truncate" title="Name">鍖婚櫌</span>
</th>
<th class="table_header slds-text-title--caps fontSize">
- <span class="slds-truncate" title="Name"
- >{!v.fieldsmap.Department_Cateogy__c}</span
- >
+ <span class="slds-truncate" title="Name">{!v.fieldsmap.Department_Cateogy__c}</span>
<!-- {!v.fieldsmap.Department_Cateogy__c} 绉戝-->
</th>
<th class="table_header slds-text-title--caps fontSize">
- <span class="slds-truncate" title="Name"
- >鎷滆浜�</span
- >
+ <span class="slds-truncate" title="Name">鎷滆浜�</span>
<!-- {!v.fieldsmap.doctor2__c} 鎷滆浜� -->
</th>
<th class="table_header slds-text-title--caps fontSize">
- <span class="slds-truncate" title="Name"
- >{!v.fieldsmap.DealerPersonnel__c}</span
- >
+ <span class="slds-truncate" title="Name">{!v.fieldsmap.DealerPersonnel__c}</span>
<!-- {!v.fieldsmap.visitor_title__c} 鑱屼綅-->
</th>
<th class="table_header slds-text-title--caps fontSize">
- <span class="slds-truncate" title="Name"
- >{!v.fieldsmap.WorkMark__c}</span
- >
+ <span class="slds-truncate" title="Name">{!v.fieldsmap.WorkMark__c}</span>
<!-- {!v.fieldsmap.visitor_title__c} 鑱屼綅-->
</th>
</tr>
</thead>
<tbody>
- <aura:iteration
- items="{!v.reports}"
- var="item"
- indexVar="index"
- >
+ <aura:iteration items="{!v.reports}" var="item" indexVar="index">
<tr class="slds-hint-parent">
<td role="gridcell" class="slds-cell-edit fontSize">
- <ui:inputRadio
- class="report_radio"
- name="report_radio"
- label="{!item.Name}"
- change="{!c.change_report_radio}"
- />
- <lightning:buttonIcon
- class="edit_button"
- iconName="utility:edit"
- size="small"
- alternativeText="edit"
- value="{!index}"
- onclick="{!c.edit_button}"
- />
+ <ui:inputRadio class="report_radio" name="report_radio" label="{!item.Name}"
+ change="{!c.change_report_radio}" />
+ <lightning:buttonIcon class="edit_button" iconName="utility:edit" size="small"
+ alternativeText="edit" value="{!index}" onclick="{!c.edit_button}" />
+
</td>
<td role="gridcell" class="slds-cell-edit fontSize">
<span class="slds-grid slds-grid--align-spread">
- <span
- class="slds-truncate"
- title="{!item.Person_In_Charge2__r.Name}"
- >{!item.Person_In_Charge2__r.Name}</span
- >
+ <span class="slds-truncate"
+ title="{!item.Person_In_Charge2__r.Name}">{!item.Person_In_Charge2__r.Name}</span>
</span>
</td>
- <td
- scope="row"
- tabindex="0"
- class="slds-cell-edit fontSize"
- >
- <div
- class="slds-grid slds-grid--align-spread"
- style="word-wrap: break-word"
- >
+ <td scope="row" tabindex="0" class="slds-cell-edit fontSize">
+ <div class="slds-grid slds-grid--align-spread" style="word-wrap: break-word;">
{!item.Agency_Hospital__r.Name}
</div>
</td>
<td role="gridcell" class="slds-cell-edit fontSize">
<span class="slds-grid slds-grid--align-spread">
- <span
- class="slds-truncate"
- title="{!item.Department_Cateogy_text__c}"
- >{!item.Department_Cateogy_text__c}</span
- >
+ <span class="slds-truncate"
+ title="{!item.Department_Cateogy_text__c}">{!item.Department_Cateogy_text__c}</span>
</span>
</td>
<td role="gridcell" class="slds-cell-edit fontSize">
<span class="slds-grid slds-grid--align-spread">
- <span
- class="slds-truncate"
- title="{!item.doctor2__r.Name}"
- >
- <span class="encrypt"
- >{!item.doctor2__r.Name}</span
- >
- <span class="decrypt"
- >{!item.doctor2__r.awsdata.name}</span
- >
+ <span class="slds-truncate" title="{!item.doctor2__r.Name}">
+ <span class="encrypt">{!item.doctor2__r.Name}</span>
+ <span class="decrypt">{!item.doctor2__r.awsdata.name}</span>
</span>
</span>
</td>
<td role="gridcell" class="slds-cell-edit fontSize">
<span class="slds-grid slds-grid--align-spread">
- <span
- class="slds-truncate"
- title="{!item.DealerPersonnel__r.Name}"
- >{!item.DealerPersonnel__r.Name}</span
- >
+ <span class="slds-truncate"
+ title="{!item.DealerPersonnel__r.Name}">{!item.DealerPersonnel__r.Name}</span>
</span>
</td>
<td role="gridcell" class="slds-cell-edit fontSize">
<span class="slds-grid slds-grid--align-spread">
- <span
- class="slds-truncate"
- title="{!item.WorkMark__c}"
- >
- <lightning:input
- type="checkbox"
- checked="{!item.WorkMark__c}"
- disabled="true"
- />
+ <span class="slds-truncate" title="{!item.WorkMark__c}">
+ <lightning:input type="checkbox" checked="{!item.WorkMark__c}"
+ disabled="true" />
</span>
</span>
</td>
@@ -435,45 +275,29 @@
</div>
<aura:renderIf isTrue="{!v.report_count > 0}">
<aura:set attribute="else">
- <div class="no_data_area">{!v.list_message}</div>
+ <div class="no_data_area">
+ {!v.list_message}
+ </div>
</aura:set>
</aura:renderIf>
</div>
<!-- 鎵归噺娣诲姞鏃ユ姤 start-->
- <div
- aura:id="modal_import"
- role="dialog"
- tabindex="-1"
- class="disp_none slds-modal slds-fade-in-open slds-modal--large"
- aria-labelledby="headerTarget"
- >
+ <div aura:id="modal_import" role="dialog" tabindex="-1"
+ class="disp_none slds-modal slds-fade-in-open slds-modal--large" aria-labelledby="headerTarget">
<aura:renderIf isTrue="{!v.modal_import_spinner}">
<lightning:spinner alternativeText="Loading" size="medium" />
</aura:renderIf>
- <div
- class="slds-modal slds-fade-in-open slds-hide"
- aura:id="successDiv01"
- >
+ <div class="slds-modal slds-fade-in-open slds-hide" aura:id="successDiv01">
<!-- <ui:inputText aura:id="articleURL" /> -->
- <div class="demo-only" style="height: 8rem">
+ <div class="demo-only" style="height: 8rem;">
<div class="slds-notify_container slds-is-relative">
- <div
- class="slds-notify slds-notify_toast slds-theme_success"
- role="alert"
- >
- <div class="slds-m-left_xx-large">
+ <div class="slds-notify slds-notify_toast slds-theme_success" role="alert">
+ <div class=" slds-m-left_xx-large">
<div
- class="slds-notify__content slds-m-left_small slds-align_absolute-center slds-m-left_xx-large"
- >
- <lightning:icon
- alternativeText="Success"
- iconName="utility:success"
- size="small"
- class="buttonColor slds-m-right_small"
- />
- <h2 class="slds-text-heading_small">
- {!v.successMessage}
- </h2>
+ class="slds-notify__content slds-m-left_small slds-align_absolute-center slds-m-left_xx-large">
+ <lightning:icon alternativeText="Success" iconName="utility:success" size="small"
+ class="buttonColor slds-m-right_small" />
+ <h2 class="slds-text-heading_small ">{!v.successMessage}</h2>
</div>
</div>
</div>
@@ -498,244 +322,127 @@
</div>
</div>
</div> -->
- <div class="slds-modal__container">
- <div class="slds-modal__header">
+ <div class="slds-modal__container ">
+ <div class="slds-modal__header ">
<h4 id="headerTarget" class="slds-float--left"></h4>
- <h2 id="headerTarget" class="slds-text-heading--medium">
- 鏃ユ姤鎵归噺瀵煎叆
- </h2>
- <ui:button
- aura:id="close_button"
- label="鍏抽棴"
+ <h2 id="headerTarget" class="slds-text-heading--medium">鏃ユ姤鎵归噺瀵煎叆</h2>
+ <ui:button aura:id="close_button" label="鍏抽棴"
class="close_button slds-button slds-button--neutral slds-order--1 buttonFontSize"
- press="{!c.close_import}"
- />
+ press="{!c.close_import}" />
</div>
- <div
- class="slds-modal__content slds-scrollable slds-grow slds-p-around--medium fontSize"
- >
+ <div class="slds-modal__content slds-scrollable slds-grow slds-p-around--medium fontSize">
<aura:if isTrue="{!v.showMain}">
<div>
- <lightning:input
- type="file"
- class="file"
- uara:id="file"
- onchange="{!c.CreateRecord}"
- />
+ <lightning:input type="file" class="file" uara:id="file" onchange="{!c.CreateRecord}" />
</div>
<aura:set attribute="else">
- <ui:outputRichText
- class="uiOutputRichText slds-m--around-large fontSize"
- value="{!v.TableContent}"
- />
- <div
- class="slds-p-around--large slds-align--absolute-center"
- >
- <lightning:button
- label="淇濆瓨"
- variant="brand"
- onclick="{!c.processFileContent}"
- class="buttonFontSize"
- />
- <lightning:button
- label="鍙栨秷"
- variant="brand"
- onclick="{!c.cancel}"
- class="buttonFontSize"
- />
+ <ui:outputRichText class="uiOutputRichText slds-m--around-large fontSize"
+ value="{!v.TableContent}" />
+ <div class="slds-p-around--large slds-align--absolute-center">
+ <lightning:button label="淇濆瓨" variant="brand" onclick="{!c.processFileContent}"
+ class="buttonFontSize" />
+ <lightning:button label="鍙栨秷" variant="brand" onclick="{!c.cancel}" class="buttonFontSize" />
</div>
<aura:if isTrue="{!v.showErrorInfo}">
- <div
- class="slds-p-around--large slds-align--absolute-center"
- >
- <lightning:button
- label="瀵煎嚭閿欒淇℃伅"
- variant="brand"
- onclick="{!c.exportErrorInfo}"
- />
+ <div class="slds-p-around--large slds-align--absolute-center">
+ <lightning:button label="瀵煎嚭閿欒淇℃伅" variant="brand" onclick="{!c.exportErrorInfo}" />
</div>
- <div
- class="slds-p-around--large slds-align--absolute-center"
- >
- <div style="height: 300px; overflow-x: scroll">
- <lightning:datatable
- keyField="id"
- data="{! v.errorData }"
- columns="{! v.errorColumns }"
- hideCheckboxColumn="true"
- />
+ <div class="slds-p-around--large slds-align--absolute-center">
+ <div style="height: 300px;overflow-x:scroll">
+ <lightning:datatable keyField="id" data="{! v.errorData }"
+ columns="{! v.errorColumns }" hideCheckboxColumn="true" />
</div>
</div>
</aura:if>
</aura:set>
+
</aura:if>
</div>
</div>
</div>
- <div
- aura:id="modal_importbg"
- class="disp_none slds-backdrop slds-backdrop--open"
- ></div>
+ <div aura:id="modal_importbg" class="disp_none slds-backdrop slds-backdrop--open"></div>
<!-- 鎵归噺娣诲姞鏃ユ姤 end-->
<!-- 鎵归噺瀵煎嚭鏃ユ姤 start-->
- <div
- aura:id="modal_export"
- role="dialog"
- tabindex="-1"
- class="disp_none slds-modal slds-fade-in-open slds-modal--large"
- >
+ <div aura:id="modal_export" role="dialog" tabindex="-1"
+ class="disp_none slds-modal slds-fade-in-open slds-modal--large">
<div class="slds-modal__container">
<div class="slds-modal__header">
<h4 id="headerTarget" class="slds-float--left"></h4>
- <h2 id="headerTarget" class="slds-text-heading--medium">
- 鏃ユ姤鎵归噺瀵煎嚭
- </h2>
- <ui:button
- aura:id="close_button"
- label="鍏抽棴"
- class="close_button slds-button slds-button--neutral slds-order--1"
- press="{!c.close_export}"
- />
+ <h2 id="headerTarget" class="slds-text-heading--medium">鏃ユ姤鎵归噺瀵煎嚭</h2>
+ <ui:button aura:id="close_button" label="鍏抽棴"
+ class="close_button slds-button slds-button--neutral slds-order--1" press="{!c.close_export}" />
</div>
- <div
- class="slds-modal__content slds-scrollable slds-grow slds-p-around--medium"
- >
+ <div class="slds-modal__content slds-scrollable slds-grow slds-p-around--medium">
<aura:if isTrue="{!v.showMain}">
<div class="slds-grid slds-wrap slds-grid--pull-padded">
<div
- class="slds-p-horizontal--small slds-size--1-of-1 slds-medium-size--1-of-5 slds-large-size--1-of-4"
- ></div>
+ class="slds-p-horizontal--small slds-size--1-of-1 slds-medium-size--1-of-5 slds-large-size--1-of-4">
+ </div>
<div
- class="slds-p-horizontal--small slds-size--1-of-1 slds-medium-size--1-of-5 slds-large-size--1-of-4"
- >
+ class="slds-p-horizontal--small slds-size--1-of-1 slds-medium-size--1-of-5 slds-large-size--1-of-4">
娲诲姩鏃ュ紑濮嬫棩鏈�
- <lightning:input
- type="Date"
- class="slds-input slds-input_bare"
- aura:id="input-report-date1"
- />
+ <lightning:input type="Date" class="slds-input slds-input_bare "
+ aura:id="input-report-date1" />
</div>
<div
- class="slds-p-horizontal--small slds-size--1-of-1 slds-medium-size--1-of-5 slds-large-size--1-of-4"
- >
+ class="slds-p-horizontal--small slds-size--1-of-1 slds-medium-size--1-of-5 slds-large-size--1-of-4">
娲诲姩鏃ョ粨鏉熸棩鏈�
- <lightning:input
- type="Date"
- class="slds-input slds-input_bare"
- aura:id="input-report-date2"
- />
+ <lightning:input type="Date" class="slds-input slds-input_bare "
+ aura:id="input-report-date2" />
</div>
<div
- class="slds-p-horizontal--small slds-size--1-of-1 slds-medium-size--1-of-5 slds-large-size--1-of-4"
- ></div>
- <div
- class="slds-p-around--large slds-align--absolute-center"
- >
- <lightning:button
- label="纭"
- variant="brand"
- onclick="{!c.select_repores_date}"
- />
- <lightning:button
- label="鍙栨秷"
- variant="brand"
- onclick="{!c.close_export}"
- />
+ class="slds-p-horizontal--small slds-size--1-of-1 slds-medium-size--1-of-5 slds-large-size--1-of-4">
+ </div>
+ <div class="slds-p-around--large slds-align--absolute-center">
+ <lightning:button label="纭" variant="brand" onclick="{!c.select_repores_date}" />
+ <lightning:button label="鍙栨秷" variant="brand" onclick="{!c.close_export}" />
</div>
</div>
<aura:set attribute="else">
- <ui:outputRichText
- class="uiOutputRichText slds-m--around-large"
- value="{!v.TableContent2}"
- />
- <div
- class="slds-p-around--large slds-align--absolute-center"
- >
- <lightning:button
- label="纭"
- variant="brand"
- onclick="{!c.exportDate}"
- />
- <lightning:button
- label="鍙栨秷"
- variant="brand"
- onclick="{!c.close_export}"
- />
+ <ui:outputRichText class="uiOutputRichText slds-m--around-large" value="{!v.TableContent2}" />
+ <div class="slds-p-around--large slds-align--absolute-center">
+ <lightning:button label="纭" variant="brand" onclick="{!c.exportDate}" />
+ <lightning:button label="鍙栨秷" variant="brand" onclick="{!c.close_export}" />
</div>
</aura:set>
</aura:if>
</div>
</div>
</div>
- <div
- aura:id="modal_exportbg"
- class="disp_none slds-backdrop slds-backdrop--open"
- ></div>
+ <div aura:id="modal_exportbg" class="disp_none slds-backdrop slds-backdrop--open"></div>
<!-- 鎵归噺瀵煎嚭鏃ユ姤 end-->
- <div
- aura:id="modal_window"
- role="dialog"
- tabindex="-1"
- class="disp_none slds-modal slds-fade-in-open slds-modal--large"
- aria-labelledby="headerTarget"
- >
+ <div aura:id="modal_window" role="dialog" tabindex="-1"
+ class="disp_none slds-modal slds-fade-in-open slds-modal--large" aria-labelledby="headerTarget">
<div class="slds-modal__container">
- <div
- class="slds-modal slds-fade-in-open slds-hide"
- aura:id="successDiv"
- >
+ <div class="slds-modal slds-fade-in-open slds-hide" aura:id="successDiv">
<!-- <ui:inputText aura:id="articleURL" /> -->
- <div class="demo-only" style="height: 8rem">
+ <div class="demo-only" style="height: 8rem;">
<div class="slds-notify_container slds-is-relative">
- <div
- class="slds-notify slds-notify_toast slds-theme_success"
- role="alert"
- >
- <div class="slds-m-left_xx-large">
+ <div class="slds-notify slds-notify_toast slds-theme_success" role="alert">
+ <div class=" slds-m-left_xx-large">
<div
- class="slds-notify__content slds-m-left_small slds-align_absolute-center slds-m-left_xx-large"
- >
- <lightning:icon
- alternativeText="Success"
- iconName="utility:success"
- size="small"
- class="buttonColor slds-m-right_small"
- />
- <h2 class="slds-text-heading_small">
- {!v.successMessage}
- </h2>
+ class="slds-notify__content slds-m-left_small slds-align_absolute-center slds-m-left_xx-large">
+ <lightning:icon alternativeText="Success" iconName="utility:success" size="small"
+ class="buttonColor slds-m-right_small" />
+ <h2 class="slds-text-heading_small ">{!v.successMessage}</h2>
</div>
</div>
</div>
</div>
</div>
</div>
- <div
- class="slds-modal slds-fade-in-open slds-hide"
- aura:id="errorDiv"
- style="z-index: 10001"
- >
+ <div class="slds-modal slds-fade-in-open slds-hide" aura:id="errorDiv" style="z-index: 10001">
<!-- <ui:inputText aura:id="articleURL" /> -->
- <div class="demo-only" style="height: 8rem">
+ <div class="demo-only" style="height: 8rem;">
<div class="slds-notify_container slds-is-relative">
- <div
- class="slds-notify slds-notify_toast slds-theme_error"
- role="status"
- >
- <div class="slds-m-left_xx-large">
+ <div class="slds-notify slds-notify_toast slds-theme_error" role="status">
+ <div class=" slds-m-left_xx-large">
<div
- class="slds-notify__content slds-m-left_small slds-align_absolute-center slds-m-left_xx-large"
- >
- <lightning:icon
- alternativeText="error"
- iconName="utility:error"
- size="small"
- class="buttonColor slds-m-right_small"
- />
- <h2 class="slds-text-heading_small">
- {!v.errorMessage}
- </h2>
+ class="slds-notify__content slds-m-left_small slds-align_absolute-center slds-m-left_xx-large">
+ <lightning:icon alternativeText="error" iconName="utility:error" size="small"
+ class="buttonColor slds-m-right_small" />
+ <h2 class="slds-text-heading_small ">{!v.errorMessage}</h2>
</div>
</div>
</div>
@@ -743,79 +450,44 @@
</div>
</div>
- <div
- class="slds-modal__content slds-grow slds-p-around--medium"
- style="position: relative"
- >
+ <div class="slds-modal__content slds-grow slds-p-around--medium" style="position: relative;">
<aura:renderIf isTrue="{!v.loginEdit}">
- <lightning:spinner
- alternativeText="Loading"
- size="medium"
- style="width: 100%; height: 100%"
- />
+ <lightning:spinner alternativeText="Loading" size="medium" style="width: 100%; height: 100%;" />
</aura:renderIf>
<div class="slds-modal__header">
<h2 id="headerTarget" class="slds-text-heading--medium">
- 鏃ユ姤({!v.selected_date} {!v.selected_agency_person})
- </h2>
- <ui:button
- aura:id="close_button"
- label="鍏抽棴"
+ 鏃ユ姤({!v.selected_date} {!v.selected_agency_person})</h2>
+ <ui:button aura:id="close_button" label="鍏抽棴"
class="close_button slds-button slds-button--neutral slds-order--1"
- press="{!c.toggle_report}"
- />
+ press="{!c.toggle_report}" />
</div>
<div class="slds-box slds-theme--shade">
<div class="slds-grid slds-wrap slds-grid--pull-padded">
<div
- class="slds-p-horizontal--small slds-size--1-of-1 slds-medium-size--1-of-7 slds-large-size--1-of-7"
- >
+ class="slds-p-horizontal--small slds-size--1-of-1 slds-medium-size--1-of-7 slds-large-size--1-of-7">
娲诲姩鏃�
- <lightning:input
- type="date"
- value="{!v.data.Report_Date__c}"
- aura:id="input-report-date"
- variant="label-hidden"
- />
+ <lightning:input type="date" value="{!v.data.Report_Date__c}" aura:id="input-report-date"
+ variant="label-hidden" />
</div>
<!-- 鍖婚櫌 -->
- <div
- aura:id="hospital_list"
+ <div aura:id="hospital_list"
class="slds-form-element slds-lookup slds-p-horizontal--small slds-size--1-of-1 slds-medium-size--1-of-7 slds-large-size--1-of-7"
- data-select="single"
- >
+ data-select="single">
<!-- label="鍖婚櫌" -->
鍖婚櫌
- <lightning:input
- aura:id="hospital_input_text"
- class="field"
- value="{!v.hospital}"
- updateOn="keyup"
- variant="label-hidden"
- />
+ <lightning:input aura:id="hospital_input_text" class="field" value="{!v.hospital}"
+ updateOn="keyup" variant="label-hidden" />
<div class="slds-lookup__menu" id="lookup-66">
<ul class="slds-lookup__list" role="listbox">
- <aura:iteration
- var="hospital"
- items="{!v.hospitalList}"
- >
- <li
- role="presentation"
- onclick="{!c.selectHos}"
+ <aura:iteration var="hospital" items="{!v.hospitalList}">
+ <li role="presentation" onclick="{!c.selectHos}"
data-accName="{!hospital.Hospital_Name_readonly__c}"
- data-accId="{!hospital.Hospital__c}"
- >
- <span
- class="slds-lookup__item-action slds-media"
- id="lookup-option-498"
- role="option"
- >
+ data-accId="{!hospital.Hospital__c}">
+ <span class="slds-lookup__item-action slds-media" id="lookup-option-498"
+ role="option">
<div class="slds-media__body">
- <div
- class="slds-lookup__result-text"
- >
- {!hospital.Hospital_Name_readonly__c}
- </div>
+ <div class="slds-lookup__result-text">
+ {!hospital.Hospital_Name_readonly__c}</div>
</div>
</span>
</li>
@@ -825,122 +497,69 @@
</div>
<!-- 绉戝鍒嗙被 -->
<div
- class="slds-p-horizontal--small slds-size--1-of-1 slds-medium-size--1-of-7 slds-large-size--1-of-7"
- >
+ class="slds-p-horizontal--small slds-size--1-of-1 slds-medium-size--1-of-7 slds-large-size--1-of-7">
{!v.fieldsmap.Department_Cateogy__c}
<!-- <ui:inputText aura:id="select_department" class="slds-select"
change="{!c.select_department}"/> -->
- <lightning:input
- type="text"
- onchange="{!c.select_department}"
- aura:id="select_department"
- variant="label-hidden"
- />
+ <lightning:input type="text" onchange="{!c.select_department}" aura:id="select_department"
+ variant="label-hidden" />
</div>
<!-- 缁忛攢鍟嗕汉鍛� change="{!c.select_DealerPersonnel}" -->
- <div
- class="slds-p-horizontal--small slds-size--1-of-1 slds-medium-size--1-of-7 slds-large-size--1-of-7"
- style="width: 145px"
- >
+ <div class="slds-p-horizontal--small slds-size--1-of-1 slds-medium-size--1-of-7 slds-large-size--1-of-7"
+ style="width: 145px;">
{!v.fieldsmap.DealerPersonnel__c}
- <ui:inputSelect
- aura:id="select_DealerPersonnel"
- class="slds-select"
- />
+ <ui:inputSelect aura:id="select_DealerPersonnel" class="slds-select" />
</div>
<!-- 娲诲姩鍖哄垎 -->
<div
- class="slds-p-horizontal--small slds-size--1-of-1 slds-medium-size--1-of-7 slds-large-size--1-of-7"
- >
+ class="slds-p-horizontal--small slds-size--1-of-1 slds-medium-size--1-of-7 slds-large-size--1-of-7">
{!v.fieldsmap.WorkRecord__c}
- <ui:inputSelect
- aura:id="select_purpose_type"
- class="slds-select"
- change="{!c.select_purpose_type}"
- />
+ <ui:inputSelect aura:id="select_purpose_type" class="slds-select"
+ change="{!c.select_purpose_type}" />
</div>
<!-- 鎷滆浜� {!v.fieldsmap.doctor2__c}-->
- <div
- class="slds-p-horizontal--small slds-size--1-of-1 slds-medium-size--1-of-7 slds-large-size--1-of-7"
- style="width: 145px"
- >
+ <div class="slds-p-horizontal--small slds-size--1-of-1 slds-medium-size--1-of-7 slds-large-size--1-of-7"
+ style="width: 145px;">
鎷滆浜�
- <ui:inputSelect
- aura:id="select_doctor"
- class="slds-select"
- change="{!c.doctor_change}"
- />
+ <ui:inputSelect aura:id="select_doctor" class="slds-select" change="{!c.doctor_change}" />
</div>
<!-- <p hidden="hidden"> -->
<div
- class="slds-p-horizontal--small slds-size--1-of-1 slds-medium-size--1-of-7 slds-large-size--1-of-7"
- >
+ class="slds-p-horizontal--small slds-size--1-of-1 slds-medium-size--1-of-7 slds-large-size--1-of-7">
<br />
- <ui:button
- label="鏂板缓"
- class="slds-button"
- press="{!c.createCon}"
- disabled="true"
- aura:id="new_con"
- />
+ <ui:button label="鏂板缓" class="slds-button" press="{!c.createCon}" disabled="true"
+ aura:id="new_con" />
</div>
<!-- </p> -->
<hr />
<!-- 浜у搧鍒嗙被(绗笁鍒嗙被) change="{!c.select_ProductClassification}" -->
<div
- class="slds-p-horizontal--small slds-size--1-of-1 slds-medium-size--1-of-5 slds-large-size--1-of-5"
- >
+ class="slds-p-horizontal--small slds-size--1-of-1 slds-medium-size--1-of-5 slds-large-size--1-of-5">
浜у搧鍒嗙被(绗笁鍒嗙被)
- <ui:inputSelect
- aura:id="select_ProductClassification"
- class="slds-select"
- change="{!c.selectProductClassification}"
- />
+ <ui:inputSelect aura:id="select_ProductClassification" class="slds-select"
+ change="{!c.selectProductClassification}" />
</div>
<!-- 浣跨敤浜у搧1(浜у搧鍨嬪彿) UseProduct1__c -->
- <div
- aura:id="UseProduct1_List"
+ <div aura:id="UseProduct1_List"
class="slds-form-element slds-lookup slds-p-horizontal--small slds-size--1-of-1 slds-medium-size--1-of-5 slds-large-size--1-of-5"
- data-select="single"
- >
+ data-select="single">
<!-- label="浣跨敤浜у搧1(浜у搧鍨嬪彿)" -->
浣跨敤浜у搧1(浜у搧鍨嬪彿)
- <lightning:input
- aura:id="UseProduct1_TEXT"
- class="field"
- value="{!v.UseProduct1}"
- updateOn="keyup"
- variant="label-hidden"
- />
+ <lightning:input aura:id="UseProduct1_TEXT" class="field" value="{!v.UseProduct1}"
+ updateOn="keyup" variant="label-hidden" />
<div class="slds-lookup__menu" id="lookup-11">
- <ul
- class="slds-lookup__list"
- role="listbox"
- style="max-height: 230px"
- >
- <aura:iteration
- var="UseProduct1"
- items="{!v.UseProduct1List}"
- >
- <li
- role="presentation"
- onclick="{!c.seletUseProduct1Change}"
+ <ul class="slds-lookup__list" role="listbox" style="max-height:230px;">
+ <aura:iteration var="UseProduct1" items="{!v.UseProduct1List}">
+ <li role="presentation" onclick="{!c.seletUseProduct1Change}"
data-accid="{!UseProduct1.Id}"
- data-accName="{!UseProduct1.Asset_Model_No__c}"
- >
- <span
- class="slds-lookup__item-action slds-media"
- id="lookup-option-498"
- role="option"
- >
+ data-accName="{!UseProduct1.Asset_Model_No__c}">
+ <span class="slds-lookup__item-action slds-media" id="lookup-option-498"
+ role="option">
<div class="slds-media__body">
- <div
- class="slds-lookup__result-text"
- >
- {!UseProduct1.Asset_Model_No__c}
- </div>
+ <div class="slds-lookup__result-text">
+ {!UseProduct1.Asset_Model_No__c}</div>
</div>
</span>
</li>
@@ -949,47 +568,24 @@
</div>
</div>
<!-- 浣跨敤浜у搧2 UseProduct2__c -->
- <div
- aura:id="UseProduct2_List"
+ <div aura:id="UseProduct2_List"
class="slds-form-element slds-lookup slds-p-horizontal--small slds-size--1-of-1 slds-medium-size--1-of-5 slds-large-size--1-of-5"
- data-select="single"
- >
+ data-select="single">
<!-- label="浣跨敤浜у搧2" -->
浣跨敤浜у搧2
- <lightning:input
- aura:id="UseProduct2_TEXT"
- class="field"
- value="{!v.UseProduct2}"
- updateOn="keyup"
- variant="label-hidden"
- />
+ <lightning:input aura:id="UseProduct2_TEXT" class="field" value="{!v.UseProduct2}"
+ updateOn="keyup" variant="label-hidden" />
<div class="slds-lookup__menu" id="lookup-22">
- <ul
- class="slds-lookup__list"
- role="listbox"
- style="max-height: 230px"
- >
- <aura:iteration
- var="UseProduct2"
- items="{!v.UseProduct2List}"
- >
- <li
- role="presentation"
- onclick="{!c.seletUseProduct2Change}"
+ <ul class="slds-lookup__list" role="listbox" style="max-height:230px;">
+ <aura:iteration var="UseProduct2" items="{!v.UseProduct2List}">
+ <li role="presentation" onclick="{!c.seletUseProduct2Change}"
data-accid="{!UseProduct2.Id}"
- data-accName="{!UseProduct2.Asset_Model_No__c}"
- >
- <span
- class="slds-lookup__item-action slds-media"
- id="lookup-option-498"
- role="option"
- >
+ data-accName="{!UseProduct2.Asset_Model_No__c}">
+ <span class="slds-lookup__item-action slds-media" id="lookup-option-498"
+ role="option">
<div class="slds-media__body">
- <div
- class="slds-lookup__result-text"
- >
- {!UseProduct2.Asset_Model_No__c}
- </div>
+ <div class="slds-lookup__result-text">
+ {!UseProduct2.Asset_Model_No__c}</div>
</div>
</span>
</li>
@@ -998,47 +594,24 @@
</div>
</div>
<!-- 浣跨敤浜у搧3 UseProduct3__c -->
- <div
- aura:id="UseProduct3_List"
+ <div aura:id="UseProduct3_List"
class="slds-form-element slds-lookup slds-p-horizontal--small slds-size--1-of-1 slds-medium-size--1-of-5 slds-large-size--1-of-5"
- data-select="single"
- >
+ data-select="single">
<!-- label="浣跨敤浜у搧3" -->
浣跨敤浜у搧3
- <lightning:input
- aura:id="UseProduct3_TEXT"
- class="field"
- value="{!v.UseProduct3}"
- updateOn="keyup"
- variant="label-hidden"
- />
+ <lightning:input aura:id="UseProduct3_TEXT" class="field" value="{!v.UseProduct3}"
+ updateOn="keyup" variant="label-hidden" />
<div class="slds-lookup__menu" id="lookup-33">
- <ul
- class="slds-lookup__list"
- role="listbox"
- style="max-height: 230px"
- >
- <aura:iteration
- var="UseProduct3"
- items="{!v.UseProduct3List}"
- >
- <li
- role="presentation"
- onclick="{!c.seletUseProduct3Change}"
+ <ul class="slds-lookup__list" role="listbox" style="max-height:230px;">
+ <aura:iteration var="UseProduct3" items="{!v.UseProduct3List}">
+ <li role="presentation" onclick="{!c.seletUseProduct3Change}"
data-accid="{!UseProduct3.Id}"
- data-accName="{!UseProduct3.Asset_Model_No__c}"
- >
- <span
- class="slds-lookup__item-action slds-media"
- id="lookup-option-498"
- role="option"
- >
+ data-accName="{!UseProduct3.Asset_Model_No__c}">
+ <span class="slds-lookup__item-action slds-media" id="lookup-option-498"
+ role="option">
<div class="slds-media__body">
- <div
- class="slds-lookup__result-text"
- >
- {!UseProduct3.Asset_Model_No__c}
- </div>
+ <div class="slds-lookup__result-text">
+ {!UseProduct3.Asset_Model_No__c}</div>
</div>
</span>
</li>
@@ -1047,298 +620,153 @@
</div>
</div>
<!-- 鏁堟灉/杩涘害 EffectProgress__c-->
- <div
- aura:id="product_category_select1"
- class="slds-p-horizontal--small slds-size--1-of-1 slds-medium-size--1-of-5 slds-large-size--1-of-5"
- >
+ <div aura:id="product_category_select1"
+ class="slds-p-horizontal--small slds-size--1-of-1 slds-medium-size--1-of-5 slds-large-size--1-of-5">
{!v.fieldsmap.EffectProgress__c}
- <ui:inputSelect
- aura:id="select_EffectProgress"
- class="slds-select"
- />
+ <ui:inputSelect aura:id="select_EffectProgress" class="slds-select" />
</div>
<hr />
<!-- 浜у搧1鍚岀被鑰楁潗绉戝鏈堜娇鐢ㄩ噺 ConsumptionOfConsumables__c-->
<div
- class="slds-p-horizontal--small slds-size--1-of-1 slds-medium-size--1-of-5 slds-large-size--1-of-5"
- >
+ class="slds-p-horizontal--small slds-size--1-of-1 slds-medium-size--1-of-5 slds-large-size--1-of-5">
{!v.fieldsmap.ConsumptionOfConsumables__c}
<!-- <ui:inputText aura:id="select_ConsumptionOfConsumables" class="slds-select"
change="{!c.select_ConsumptionOfConsumables}" /> -->
- <lightning:input
- type="text"
- onchange="{!c.select_ConsumptionOfConsumables}"
- aura:id="select_ConsumptionOfConsumables"
- variant="label-hidden"
- />
+ <lightning:input type="text" onchange="{!c.select_ConsumptionOfConsumables}"
+ aura:id="select_ConsumptionOfConsumables" variant="label-hidden" />
</div>
<!-- 鏈+鍒嗙被 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"
- >
+ class="slds-p-horizontal--small slds-size--1-of-1 slds-medium-size--1-of-5 slds-large-size--1-of-6">
{!v.fieldsmap.WarlockClassification__c}
- <ui:inputSelect
- aura:id="select_OtherBrandConsumables"
- class="slds-select"
- />
+ <ui:inputSelect aura:id="select_OtherBrandConsumables" class="slds-select" />
</div>
<!-- 宸查噰鐢ㄥ叾浠栧搧鐗� ProductCcategory__c -->
<div
- class="slds-p-horizontal--small slds-size--1-of-1 slds-medium-size--1-of-5 slds-large-size--1-of-6"
- >
+ class="slds-p-horizontal--small slds-size--1-of-1 slds-medium-size--1-of-5 slds-large-size--1-of-6">
{!v.fieldsmap.ProductCcategory__c}
- <ui:inputSelect
- aura:id="select_ProductCcategory"
- class="slds-select"
- change="{!c.selectpurposetype}"
- />
+ <ui:inputSelect aura:id="select_ProductCcategory" class="slds-select"
+ change="{!c.selectpurposetype}" />
</div>
<!-- 鍏朵粬鍝佺墝浜у搧绫诲埆 -->
- <div
- aura:id="result"
- class="disp_none slds-p-horizontal--small slds-size--1-of-1 slds-medium-size--1-of-5 slds-large-size--1-of-6"
- >
+ <div aura:id="result"
+ class="disp_none slds-p-horizontal--small slds-size--1-of-1 slds-medium-size--1-of-5 slds-large-size--1-of-6">
{!v.fieldsmap.productCategories__c}
- <ui:inputSelect
- aura:id="select_productCategories"
- class="slds-select"
- />
+ <ui:inputSelect aura:id="select_productCategories" class="slds-select" />
</div>
<!-- 浜у搧鐢ㄩ噺 warlocksNumber__c -->
<div
- class="slds-p-horizontal--small slds-size--1-of-1 slds-medium-size--1-of-5 slds-large-size--1-of-6"
- >
+ class="slds-p-horizontal--small slds-size--1-of-1 slds-medium-size--1-of-5 slds-large-size--1-of-6">
{!v.fieldsmap.warlocksNumber__c}
<!-- <ui:inputText aura:id="select_warlocksNumber" class="slds-select"
change="{!c.select_warlocksNumber}" /> -->
- <lightning:input
- type="text"
- onchange="{!c.select_warlocksNumber}"
- aura:id="select_warlocksNumber"
- variant="label-hidden"
- />
+ <lightning:input type="text" onchange="{!c.select_warlocksNumber}"
+ aura:id="select_warlocksNumber" variant="label-hidden" />
</div>
<!-- 鏀彺闇�姹� WorkMark__c-->
- <div style="padding-left: 12px">
+ <div style="padding-left: 12px;">
{!v.fieldsmap.WorkMark__c}
- <lightning:input
- type="checkbox"
- aura:id="select_WorkMark"
- />
+ <lightning:input type="checkbox" aura:id="select_WorkMark" />
</div>
- <div
- aura:id="input-opportunity-stage"
- class="disp_none slds-p-horizontal--small slds-size--1-of-1 slds-medium-size--2-of-12 slds-large-size--2-of-12"
- >
+ <div aura:id="input-opportunity-stage"
+ class="disp_none slds-p-horizontal--small slds-size--1-of-1 slds-medium-size--2-of-12 slds-large-size--2-of-12">
{!v.fieldsmap.StageName__c}
- <ui:inputSelect
- aura:id="select_stageName"
- class="slds-select"
- />
+ <ui:inputSelect aura:id="select_stageName" class="slds-select" />
</div>
- <div
- aura:id="input-opportunity-amount1"
- class="disp_none slds-p-horizontal--small slds-size--1-of-1 slds-medium-size--2-of-12 slds-large-size--2-of-12"
- >
+ <div aura:id="input-opportunity-amount1"
+ class="disp_none slds-p-horizontal--small slds-size--1-of-1 slds-medium-size--2-of-12 slds-large-size--2-of-12">
{!v.fieldsmap.Amount__c}
<!-- <ui:inputSelect aura:id="select_opportunity" class="slds-select"/> 鍖婚櫌閲囪喘棰勭畻(涓嶅惈绋�,鍏�)-->
- <lightning:inputField
- value="{!v.oppdata.Amount__c}"
- class=""
- />
+ <lightning:inputField value="{!v.oppdata.Amount__c}" class="" />
+
</div>
- <div
- aura:id="input-opportunity-amount2"
- class="disp_none slds-p-horizontal--small slds-size--1-of-1 slds-medium-size--2-of-12 slds-large-size--2-of-12"
- >
+ <div aura:id="input-opportunity-amount2"
+ class="disp_none slds-p-horizontal--small slds-size--1-of-1 slds-medium-size--2-of-12 slds-large-size--2-of-12">
{!v.fieldsmap.OCMSale_Price__c}
<!-- <ui:inputSelect aura:id="select_opportunity" class="slds-select"/> 璁㈣揣閲戦(涓嶅惈绋�,鍏�) -->
- <lightning:inputField
- value="{!v.oppdata.OCMSale_Price__c}"
- class=""
- />
+ <lightning:inputField value="{!v.oppdata.OCMSale_Price__c}" class="" />
</div>
- <div
- aura:id="input-opportunity-date"
- class="disp_none slds-p-horizontal--small slds-size--1-of-1 slds-medium-size--2-of-12 slds-large-size--2-of-12"
- >
+ <div aura:id="input-opportunity-date"
+ class="disp_none slds-p-horizontal--small slds-size--1-of-1 slds-medium-size--2-of-12 slds-large-size--2-of-12">
{!v.fieldsmap.Close_Forecasted_Date__c}
<!-- <ui:inputSelect aura:id="select_opportunity" class="slds-select"/> 棰勬祴涓嶰CSM绛剧害鏃� -->
- <lightning:inputField
- value="{!v.oppdata.Close_Forecasted_Date__c}"
- class=""
- />
+ <lightning:inputField value="{!v.oppdata.Close_Forecasted_Date__c}" class="" />
</div>
<hr />
</div>
</div>
<div class="save_button_area">
- <ui:button
- aura:id="save_button"
- label="淇濆瓨骞舵柊寤�"
- class="save_button slds-button slds-button--brand slds-order--3"
- press="{!c.save_report}"
- />
+ <ui:button aura:id="save_button" label="淇濆瓨骞舵柊寤�"
+ class="save_button slds-button slds-button--brand slds-order--3" press="{!c.save_report}" />
</div>
<aura:renderIf isTrue="{!v.reports_now_count > 0}">
<div class="mt40 slds-box slds-theme--shade">
- <div
- class="slds-table--edit_container slds-is-relative"
- >
+ <div class="slds-table--edit_container slds-is-relative">
<table
class="slds-table slds-table--edit slds-table--bordered slds-table--fixed-layout slds-no-cell-focus"
- role="grid"
- >
+ role="grid">
<thead>
<tr class="slds-line-height--reset">
- <th
- class="table_header slds-text-title--caps"
- >
- <span
- class="slds-truncate"
- title="Name"
- ></span>
+ <th class="table_header slds-text-title--caps">
+ <span class="slds-truncate" title="Name"></span>
</th>
- <th
- class="table_header slds-text-title--caps"
- >
- <span
- class="slds-truncate"
- title="Name"
- >鍖婚櫌</span
- >
+ <th class="table_header slds-text-title--caps">
+ <span class="slds-truncate" title="Name">鍖婚櫌</span>
</th>
- <th
- class="table_header slds-text-title--caps"
- >
- <span
- class="slds-truncate"
- title="Name"
- >{!v.fieldsmap.Department_Cateogy__c}</span
- >
+ <th class="table_header slds-text-title--caps">
+ <span class="slds-truncate"
+ title="Name">{!v.fieldsmap.Department_Cateogy__c}</span>
</th>
- <th
- class="table_header slds-text-title--caps"
- >
- <span
- class="slds-truncate"
- title="Name"
- >{!v.fieldsmap.doctor2__c}</span
- >
+ <th class="table_header slds-text-title--caps">
+ <span class="slds-truncate" title="Name">{!v.fieldsmap.doctor2__c}</span>
<!-- 瀹㈡埛浜哄憳 -->
</th>
- <th
- class="table_header slds-text-title--caps"
- >
- <span
- class="slds-truncate"
- title="Name"
- >{!v.fieldsmap.visitor_title__c}</span
- >
+ <th class="table_header slds-text-title--caps">
+ <span class="slds-truncate"
+ title="Name">{!v.fieldsmap.visitor_title__c}</span>
</th>
- <th
- class="table_header slds-text-title--caps"
- >
- <span
- class="slds-truncate"
- title="Name"
- >{!v.fieldsmap.WorkRecord__c}</span
- >
+ <th class="table_header slds-text-title--caps">
+ <span class="slds-truncate" title="Name">{!v.fieldsmap.WorkRecord__c}</span>
</th>
</tr>
</thead>
<tbody>
- <aura:iteration
- items="{!v.reports_now}"
- var="item"
- indexVar="index"
- >
- <tr
- aura:id="modal_data_list_tr"
- class="slds-hint-parent"
- >
- <td
- role="gridcell"
- class="slds-cell-edit"
- >
- <span
- class="slds-grid slds-grid--align-spread"
- >
- <span
- class="slds-truncate"
- title="{!item.Department_Cateogy_text__c}"
- >{!item.Name}</span
- >
+ <aura:iteration items="{!v.reports_now}" var="item" indexVar="index">
+ <tr aura:id="modal_data_list_tr" class="slds-hint-parent">
+ <td role="gridcell" class="slds-cell-edit">
+ <span class="slds-grid slds-grid--align-spread">
+ <span class="slds-truncate"
+ title="{!item.Department_Cateogy_text__c}">{!item.Name}</span>
</span>
</td>
- <td
- role="gridcell"
- class="slds-cell-edit"
- >
- <span
- class="slds-grid slds-grid--align-spread"
- >
- <span
- class="slds-truncate"
- title="{!item.Agency_Hospital__r.Name}"
- >{!item.Agency_Hospital__r.Name}</span
- >
+ <td role="gridcell" class="slds-cell-edit">
+ <span class="slds-grid slds-grid--align-spread">
+ <span class="slds-truncate"
+ title="{!item.Agency_Hospital__r.Name}">{!item.Agency_Hospital__r.Name}</span>
</span>
</td>
- <td
- role="gridcell"
- class="slds-cell-edit"
- >
- <span
- class="slds-grid slds-grid--align-spread"
- >
- <span
- class="slds-truncate"
- title="{!item.Department_Cateogy_text__c}"
- >{!item.Department_Cateogy_text__c}</span
- >
+ <td role="gridcell" class="slds-cell-edit">
+ <span class="slds-grid slds-grid--align-spread">
+ <span class="slds-truncate"
+ title="{!item.Department_Cateogy_text__c}">{!item.Department_Cateogy_text__c}</span>
</span>
</td>
- <td
- role="gridcell"
- class="slds-cell-edit"
- >
- <span
- class="slds-grid slds-grid--align-spread"
- >
- <span
- class="slds-truncate"
- title="{!item.doctor2__r.Name}"
- >{!item.doctor2__r.Name}</span
- >
+ <td role="gridcell" class="slds-cell-edit">
+ <span class="slds-grid slds-grid--align-spread">
+ <span class="slds-truncate"
+ title="{!item.doctor2__r.Name}">{!item.doctor2__r.Name}</span>
</span>
</td>
- <td
- role="gridcell"
- class="slds-cell-edit"
- >
- <span
- class="slds-grid slds-grid--align-spread"
- >
- <span
- class="slds-truncate"
- title="{!item.visitor_title__c}"
- >{!item.visitor_title__c}</span
- >
+ <td role="gridcell" class="slds-cell-edit">
+ <span class="slds-grid slds-grid--align-spread">
+ <span class="slds-truncate"
+ title="{!item.visitor_title__c}">{!item.visitor_title__c}</span>
</span>
</td>
- <td
- role="gridcell"
- class="slds-cell-edit"
- >
- <span
- class="slds-grid slds-grid--align-spread"
- >
- <span
- class="slds-truncate"
- title="{!item.WorkRecord__c}"
- >{!item.WorkRecord__c}</span
- >
+ <td role="gridcell" class="slds-cell-edit">
+ <span class="slds-grid slds-grid--align-spread">
+ <span class="slds-truncate"
+ title="{!item.WorkRecord__c}">{!item.WorkRecord__c}</span>
</span>
</td>
</tr>
@@ -1352,82 +780,42 @@
</div>
</div>
- <div
- aura:id="modal_bg"
- class="disp_none slds-backdrop slds-backdrop--open"
- ></div>
- <div
- aura:id="modal_confirm"
- role="dialog"
- tabindex="-2"
- aria-labelledby="header43"
- class="disp_none slds-modal slds-fade-in-open"
- >
+
+ <div aura:id="modal_bg" class="disp_none slds-backdrop slds-backdrop--open"></div>
+
+ <div aura:id="modal_confirm" role="dialog" tabindex="-2" aria-labelledby="header43"
+ class="disp_none slds-modal slds-fade-in-open">
<div class="slds-modal__container">
<div class="slds-modal__header">
- <h2 id="header43" class="slds-text-heading--medium">
- {!v.modal_confirm_title}
- </h2>
+ <h2 id="header43" class="slds-text-heading--medium">{!v.modal_confirm_title}</h2>
</div>
<div class="slds-modal__content slds-p-around--medium">
<p>{!v.modal_confirm_text}</p>
</div>
<div class="slds-modal__footer">
- <ui:button
- label="鏄�"
- class="slds-button slds-button--brand"
- press="{!c.yes_button}"
- />
- <ui:button
- label="鍚�"
- class="slds-button slds-button--neutral"
- press="{!c.no_button}"
- />
+ <ui:button label="鏄�" class="slds-button slds-button--brand" press="{!c.yes_button}" />
+ <ui:button label="鍚�" class="slds-button slds-button--neutral" press="{!c.no_button}" />
</div>
</div>
</div>
- <div
- aura:id="modal_confirm_bg"
- class="disp_none slds-backdrop slds-backdrop--open"
- ></div>
+ <div aura:id="modal_confirm_bg" class="disp_none slds-backdrop slds-backdrop--open"></div>
- <div
- aura:id="modal_newAC"
- role="dialog"
- tabindex="-3"
- aria-labelledby="headertest"
- class="disp_none slds-modal slds-fade-in-open"
- >
+ <div aura:id="modal_newAC" role="dialog" tabindex="-3" aria-labelledby="headertest"
+ class="disp_none slds-modal slds-fade-in-open">
<div class="slds-modal__container">
<div class="slds-modal__header">
- <h2 id="headertest" class="slds-text-heading--medium">
- 鏂板缓.鎷滆浜�
- </h2>
+ <h2 id="headertest" class="slds-text-heading--medium">鏂板缓.鎷滆浜�</h2>
</div>
<div class="slds-modal__content slds-p-around--medium">
- <lightning:recordEditForm
- aura:id="recordEditForm"
- objectApiName="Agency_Contact__c"
- onsuccess="{!c.handleSuccess}"
- onload="{!c.showRequiredFields}"
- onsubmit="{!c.handleSubmit}"
- >
+ <lightning:recordEditForm aura:id="recordEditForm" objectApiName="Agency_Contact__c"
+ onsuccess="{!c.handleSuccess}" onload="{!c.showRequiredFields}" onsubmit="{!c.handleSubmit}">
<lightning:messages aura:id="OppMessage" />
<!-- onload="{!c.showRequiredFields}" -->
<aura:renderIf isTrue="{!v.truthy}">
- <lightning:inputField
- fieldName="Name"
- aura:id="newOpportunityField"
- />
- <lightning:inputField
- fieldName="Type__c"
- aura:id="newOpportunityField"
- />
- <lightning:inputField
- fieldName="Doctor_Division1__c"
- aura:id="newOpportunityField"
- />
+ <lightning:inputField fieldName="Name" aura:id="newOpportunityField" />
+ <lightning:inputField fieldName="Type__c" aura:id="newOpportunityField" />
+ <lightning:inputField fieldName="Doctor_Division1__c" aura:id="newOpportunityField" />
</aura:renderIf>
<br />
<br />
@@ -1435,21 +823,15 @@
<br />
<br />
<div class="save_button_area">
- <lightning:button
- class="slds-m-top_small"
- type="button"
- label="鍙栨秷"
- onclick="{!c.createCancel}"
- />
- <lightning:button
- class="slds-m-top_small"
- type="button"
- label="淇濆瓨"
- onclick="{!c.handleSubmit}"
- />
+ <lightning:button class="slds-m-top_small" type="button" label="鍙栨秷"
+ onclick="{!c.createCancel}" />
+ <lightning:button class="slds-m-top_small" type="button" label="淇濆瓨"
+ onclick="{!c.handleSubmit}" />
</div>
</lightning:recordEditForm>
</div>
</div>
</div>
-</aura:component>
+
+
+</aura:component>
\ No newline at end of file
diff --git a/force-app/main/default/aura/RetrospectiveWeeklyReport/RetrospectiveWeeklyReport.css b/force-app/main/default/aura/RetrospectiveWeeklyReport/RetrospectiveWeeklyReport.css
index 920fa09..b528937 100644
--- a/force-app/main/default/aura/RetrospectiveWeeklyReport/RetrospectiveWeeklyReport.css
+++ b/force-app/main/default/aura/RetrospectiveWeeklyReport/RetrospectiveWeeklyReport.css
@@ -28,7 +28,7 @@
.THIS .no_data_area {
text-align: center;
- margin: 0.5em 0;
+ margin: .5em 0;
}
.THIS.report_list_area {
@@ -153,7 +153,7 @@
}
.THIS .customRequired:before {
- content: '*';
+ content: "*";
margin: 0 0.125rem 0 0.125rem;
color: rgb(194, 57, 52);
float: left;
@@ -199,4 +199,4 @@
.THIS td {
white-space: normal;
overflow-wrap: break-word;
-}
+}
\ No newline at end of file
diff --git a/force-app/main/default/aura/RetrospectiveWeeklyReport/RetrospectiveWeeklyReportController.js b/force-app/main/default/aura/RetrospectiveWeeklyReport/RetrospectiveWeeklyReportController.js
index 4a9d273..baa5976 100644
--- a/force-app/main/default/aura/RetrospectiveWeeklyReport/RetrospectiveWeeklyReportController.js
+++ b/force-app/main/default/aura/RetrospectiveWeeklyReport/RetrospectiveWeeklyReportController.js
@@ -38,8 +38,8 @@
},
showRequiredFields: function (component, event, helper) {
- $A.util.removeClass(component.find('newOpportunityField'), 'none');
- $A.util.removeClass(component.find('newOpportunityField'), 'none');
+ $A.util.removeClass(component.find("newOpportunityField"), "none");
+ $A.util.removeClass(component.find("newOpportunityField"), "none");
},
handleSuccess: function (component, event, helper) {
@@ -49,107 +49,80 @@
handleSubmit: function (component, event, helper) {
event.preventDefault(); // stop form submission
var showValidationError = false;
- var fields = component.find('newOpportunityField');
+ var fields = component.find("newOpportunityField");
var vaildationFailReason = '';
let agencyReport = Object.create(null);
fields.forEach(function (field) {
- if (
- field.get('v.fieldName') === 'Type__c' &&
- $A.util.isEmpty(field.get('v.value'))
- ) {
+ if (field.get("v.fieldName") === 'Type__c' && $A.util.isEmpty(field.get("v.value"))) {
showValidationError = true;
- vaildationFailReason = '鍒嗙被涓嶈兘涓虹┖锛�';
- } else if (
- field.get('v.fieldName') === 'Doctor_Division1__c' &&
- $A.util.isEmpty(field.get('v.value'))
- ) {
+ vaildationFailReason = "鍒嗙被涓嶈兘涓虹┖锛�";
+ } else if (field.get("v.fieldName") === 'Doctor_Division1__c' && $A.util.isEmpty(field.get("v.value"))) {
showValidationError = true;
if (vaildationFailReason != '') {
- vaildationFailReason += '鍖荤敓鍖哄垎(鑱屽姟)涓嶈兘涓虹┖锛�';
+ vaildationFailReason += "鍖荤敓鍖哄垎(鑱屽姟)涓嶈兘涓虹┖锛�";
} else {
- vaildationFailReason = '鍖荤敓鍖哄垎(鑱屽姟)涓嶈兘涓虹┖锛�';
+ vaildationFailReason = "鍖荤敓鍖哄垎(鑱屽姟)涓嶈兘涓虹┖锛�";
}
+
}
- //SWAG-CF58C3 fy start
- if (field.get('v.fieldName') === 'Name') {
- agencyReport['name'] = field.get('v.value');
- } else if (field.get('v.fieldName') === 'Type__c') {
- agencyReport['type'] = field.get('v.value');
- } else if (field.get('v.fieldName') === 'Doctor_Division1__c') {
- agencyReport['doctorDivision1'] = field.get('v.value');
+ //SWAG-CF58C3 fy start
+ if (field.get("v.fieldName") === 'Name') {
+ agencyReport['name'] = field.get("v.value");
+ } else if (field.get("v.fieldName") === 'Type__c') {
+ agencyReport['type'] = field.get("v.value");
+ } else if (field.get("v.fieldName") === 'Doctor_Division1__c') {
+ agencyReport['doctorDivision1'] = field.get("v.value");
}
- //SWAG-CF58C3 fy end
+ //SWAG-CF58C3 fy end
});
if (!showValidationError) {
- //SWAG-CF58C3 fy start
+ //SWAG-CF58C3 fy start
var agencyHospitalid = component.get('v.hospitalLinkId');
//zhj MEBG鏂版柟妗堟敼閫� 2022-11-29 start
- debugger;
+ debugger
let hospitalName = '';
//璋冪敤鍚庣searchAgencyDataId鏂规硶鏌ヨ鍑哄尰闄笅闈㈡墍鏈夊鎴蜂汉鍛榙ataid
- helper.CallBackAction(
- component,
- 'searchAgencyDataId',
- {
- hospitalId: agencyHospitalid
- },
- function (data) {
- if (data.getState() == 'SUCCESS') {
- var data = data.getReturnValue();
- if (data.IsSuccess == true) {
- let agencyContactIds = '';
- if (
- data.Message == '' &&
- data.Data &&
- data.Data.length > 0
- ) {
- hospitalName =
- data.Data[0].Agency_Hospital__r.Name;
- for (var i = 0; i < data.Data.length; i++) {
- if (data.Data[i].AWS_Data_Id__c)
- agencyContactIds +=
- ',' + data.Data[i].AWS_Data_Id__c;
- }
- agencyContactIds =
- agencyContactIds.substring(1);
- agencyReport['agencyContactIds'] =
- agencyContactIds;
- } else {
- agencyReport['agencyContactIds'] =
- agencyContactIds;
+ helper.CallBackAction(component, 'searchAgencyDataId', {
+ hospitalId: agencyHospitalid
+ }, function (data) {
+ if (data.getState() == "SUCCESS") {
+ var data = data.getReturnValue();
+ if (data.IsSuccess == true) {
+ let agencyContactIds = ''
+ if (data.Message == '' && data.Data && data.Data.length > 0) {
+ hospitalName = data.Data[0].Agency_Hospital__r.Name;
+ for (var i = 0; i < data.Data.length; i++) {
+ if (data.Data[i].AWS_Data_Id__c)
+ agencyContactIds += ',' + data.Data[i].AWS_Data_Id__c;
}
- var arr = new Array();
- arr.push(agencyReport);
- var requestData = JSON.stringify(arr);
- // helper.set_aws_url(component,data,agencyHospitalid);
-
- var token = component.get('v.AWStoken');
- var newUrl = component.get('v.AWSinsert') + 'V2';
-
- component.set('v.login', true);
- helper.insert_agencycontact(
- component,
- token,
- newUrl,
- requestData,
- agencyHospitalid,
- helper,
- hospitalName
- );
+ agencyContactIds = agencyContactIds.substring(1);
+ agencyReport['agencyContactIds'] = agencyContactIds;
} else {
- helper.ShowToast({
- message: data.message,
- type: 'error'
- });
+ agencyReport['agencyContactIds'] = agencyContactIds;
}
+ var arr = new Array();
+ arr.push(agencyReport);
+ var requestData = JSON.stringify(arr);
+ // helper.set_aws_url(component,data,agencyHospitalid);
+
+ var token = component.get('v.AWStoken');
+ var newUrl = component.get('v.AWSinsert') + 'V2';
+
+ component.set('v.login', true);
+ helper.insert_agencycontact(component, token, newUrl, requestData, agencyHospitalid, helper, hospitalName);
} else {
helper.ShowToast({
- message: 'searchAgency澶辫触',
- type: 'error'
+ "message": data.message,
+ "type": "error"
});
}
+ } else {
+ helper.ShowToast({
+ "message": 'searchAgency澶辫触',
+ "type": "error"
+ });
}
- );
+ })
//zhj MEBG鏂版柟妗堟敼閫� 2022-11-29 end
// var arr = new Array();
// arr.push(agencyReport);
@@ -158,7 +131,7 @@
// var newUrl = component.get('v.AWSinsert');
// component.set('v.login',true);
// helper.insert_agencycontact(component,token,newUrl,data,agencyHospitalid,helper);
- //SWAG-CF58C3 fy end
+ //SWAG-CF58C3 fy end
// helper.newlyBuild(component, event, helper);
} else {
component.find('OppMessage').setError(vaildationFailReason);
@@ -171,20 +144,12 @@
yes_button: function (component, event, helper) {
component.set('v.confirm_status', 1);
- helper.close_confirm(
- component,
- component.get('v.modal_confirm_title'),
- component.get('v.modal_confirm_text')
- );
+ helper.close_confirm(component, component.get('v.modal_confirm_title'), component.get('v.modal_confirm_text'));
},
no_button: function (component, event, helper) {
component.set('v.confirm_status', 2);
- helper.close_confirm(
- component,
- component.get('v.modal_confirm_title'),
- component.get('v.modal_confirm_text')
- );
+ helper.close_confirm(component, component.get('v.modal_confirm_title'), component.get('v.modal_confirm_text'));
},
toggle_report: function (component, event, helper) {
@@ -200,13 +165,13 @@
},
select_agency_change: function (component, event, helper) {
- debugger;
+ debugger
helper.select_agency_change(component, event, helper);
},
hosChange: function (component, event, helper) {
- var hospital_name = event.getParam('value');
- var hospital_nameld = component.get('v.UseProduct1s');
+ var hospital_name = event.getParam("value");
+ var hospital_nameld = component.get("v.UseProduct1s");
if (hospital_name.match(/(\S+\s)+/)) {
if (hospital_nameld != hospital_name) {
helper.searchHos(component, event, helper);
@@ -225,9 +190,9 @@
},
//浣跨敤浜у搧1
UseProduct1Change: function (component, event, helper) {
- var UseProduct1Name = event.getParam('value');
- var UseProduct1Nameold = component.get('v.UseProduct1s');
- debugger;
+ var UseProduct1Name = event.getParam("value");
+ var UseProduct1Nameold = component.get("v.UseProduct1s");
+ debugger
if (UseProduct1Name.match(/(\S+\s)+/)) {
if (UseProduct1Name != UseProduct1Nameold) {
helper.searchUseProduct1(component, event, helper);
@@ -245,8 +210,8 @@
},
//浣跨敤浜у搧2
UseProduct2Change: function (component, event, helper) {
- var UseProduct2Name = event.getParam('value');
- var UseProduct2Nameold = component.get('v.UseProduct2s');
+ var UseProduct2Name = event.getParam("value");
+ var UseProduct2Nameold = component.get("v.UseProduct2s");
if (UseProduct2Name.match(/(\S+\s)+/)) {
if (UseProduct2Name != UseProduct2Nameold) {
helper.searchUseProduct2(component, event, helper);
@@ -267,8 +232,8 @@
},
//浣跨敤浜у搧3
UseProduct3Change: function (component, event, helper) {
- var UseProduct3Name = event.getParam('value');
- var UseProduct3Nameold = component.get('v.UseProduct3s');
+ var UseProduct3Name = event.getParam("value");
+ var UseProduct3Nameold = component.get("v.UseProduct3s");
if (UseProduct3Name.match(/(\S+\s)+/)) {
if (UseProduct3Name != UseProduct3Nameold) {
helper.searchUseProduct3(component, event, helper);
@@ -284,6 +249,7 @@
seletUseProduct3Change: function (component, event, helper) {
helper.seletUseProduct3Change(component, event, helper);
},
+
select_department: function (component, event, helper) {
helper.setOpportunity_cfilter(component);
@@ -306,39 +272,37 @@
helper.readFile(component, helper, files[0]);
},
CreateRecord: function (component, event, helper) {
- var files = event.getSource().get('v.files');
+ var files = event.getSource().get("v.files");
helper.readFile(component, helper, files[0]);
- component.set('v.showErrorInfo', false);
+ component.set("v.showErrorInfo", false);
},
processFileContent: function (component, event, helper) {
helper.saveRecords(component, event, helper);
- component.set('v.showErrorInfo', false);
+ component.set("v.showErrorInfo", false);
},
cancel: function (component, event, helper) {
- component.set('v.showMain', true);
+ component.set("v.showMain", true);
},
import: function (component, event, helper) {
helper.showImport(component);
},
exportDate: function (component, event, helper) {
- var stockData = component.get('v.reports_date');
+ var stockData = component.get("v.reports_date");
console.log('瀵煎嚭鏁版嵁' + stockData);
var csv = helper.convertArrayOfObjectsToCSV(component, stockData);
- if (csv == null) {
- return;
- }
+ if (csv == null) { return; }
- var universalBOM = '\uFEFF';
+ var universalBOM = "\uFEFF";
var hiddenElement = document.createElement('a');
- hiddenElement.href =
- 'data:text/csv;charset=utf-8,' + encodeURI(universalBOM + csv);
- hiddenElement.target = '_self'; //
- hiddenElement.download = 'ExportData.csv'; // CSV file Name* you can change it.[only name not .csv]
+ hiddenElement.href = 'data:text/csv;charset=utf-8,' + encodeURI(universalBOM + csv);
+ hiddenElement.target = '_self'; //
+ hiddenElement.download = 'ExportData.csv'; // CSV file Name* you can change it.[only name not .csv]
document.body.appendChild(hiddenElement); // Required for FireFox browser
hiddenElement.click(); // using click() js function to download csv file
+
},
export_condition: function (component, event, helper) {
helper.showExport(component);
@@ -349,15 +313,15 @@
},
export: function (component, event, helper) {
console.log('杩涘叆export');
- var stockData = component.get('v.reports_date');
+ var stockData = component.get("v.reports_date");
console.log('鏌ュ嚭鐨勬暟鎹�' + stockData);
},
close_import: function (component, event, helper) {
- component.set('v.showMain', true);
+ component.set("v.showMain", true);
helper.close_import(component);
},
close_export: function (component, event, helper) {
- component.set('v.showMain', true);
+ component.set("v.showMain", true);
helper.close_export(component);
},
select_ConsumptionOfConsumables: function (component, event, helper) {
@@ -385,4 +349,4 @@
var errorDiv01 = component.find('errorDiv01');
$A.util.addClass(errorDiv01, 'slds-hide');
}
-});
+})
\ No newline at end of file
diff --git a/force-app/main/default/aura/RetrospectiveWeeklyReport/RetrospectiveWeeklyReportHelper.js b/force-app/main/default/aura/RetrospectiveWeeklyReport/RetrospectiveWeeklyReportHelper.js
index 81439c5..ce599da 100644
--- a/force-app/main/default/aura/RetrospectiveWeeklyReport/RetrospectiveWeeklyReportHelper.js
+++ b/force-app/main/default/aura/RetrospectiveWeeklyReport/RetrospectiveWeeklyReportHelper.js
@@ -1,7 +1,7 @@
({
doinit: function (component, event, helper) {
- document.title = '杩芥函鏃ユ姤';
-
+ document.title = "杩芥函鏃ユ姤";
+
this.report_date_list(component, event, helper, 5);
component.set('v.login', true);
var action = component.get('c.getalldata');
@@ -14,59 +14,24 @@
component.set('v.allselectlist', res.allselectlist);
component.set('v.doclist', res.doclist);
//fy
-
+
var xx = res.UserProType;
component.set('v.UserProType', res.UserProType);
var gg = component.get('v.UserProType');
//fy
- component
- .find('select_agency_person')
- .set(
- 'v.options',
- this.conv_selected(res.allselectlist.AgencyPerson__c)
- );
- component
- .find('select_DealerPersonnel')
- .set(
- 'v.options',
- this.conv_selected(res.allselectlist.DealerPersonnel__c)
- );
- component
- .find('select_purpose_type')
- .set(
- 'v.options',
- this.conv_selected(res.allselectlist.WorkRecord__c)
- );
- component
- .find('select_ProductClassification')
- .set(
- 'v.options',
- this.conv_selected(
- res.allselectlist.ProductClassification__c
- )
- );
- component
- .find('select_stageName')
- .set(
- 'v.options',
- this.conv_selected(res.allselectlist.StageName__c)
- );
- component.set(
- 'v.selected_agency_person',
- res.allselectlist.AgencyPerson__c[0].label
- );
+ component.find('select_agency_person').set('v.options', this.conv_selected(res.allselectlist.AgencyPerson__c));
+ component.find('select_DealerPersonnel').set('v.options', this.conv_selected(res.allselectlist.DealerPersonnel__c));
+ component.find('select_purpose_type').set('v.options', this.conv_selected(res.allselectlist.WorkRecord__c));
+ component.find('select_ProductClassification').set('v.options', this.conv_selected(res.allselectlist.ProductClassification__c));
+ component.find('select_stageName').set('v.options', this.conv_selected(res.allselectlist.StageName__c));
+ component.set('v.selected_agency_person', res.allselectlist.AgencyPerson__c[0].label);
component.set('v.dialog_type', '鏂板缓');
- this.get_reports(
- component,
- event,
- helper,
- component.find('select_date').get('v.value'),
- component.find('select_agency_person').get('v.value')
- );
+ this.get_reports(component, event, helper, component.find('select_date').get('v.value'), component.find('select_agency_person').get('v.value'));
- component.set('v.PIConfig', res.PIConfig); // 20220222 PI鏀归�� by Bright
+ component.set('v.PIConfig', res.PIConfig);// 20220222 PI鏀归�� by Bright
component.set('v.login', false);
- } else {
+ }
+ else {
//component.set('v.errorMessage', 'doinit failed.');
this.error('doinit failed.');
//this.showErrorToast(component);
@@ -76,7 +41,7 @@
$A.enqueueAction(action);
},
doinitSave: function (component, event, helper) {
- document.title = '杩芥函鏃ユ姤';
+ document.title = "杩芥函鏃ユ姤";
component.set('v.loginEdit', true);
this.report_date_list(component, event, helper, 5);
var action = component.get('c.getalldata');
@@ -89,59 +54,24 @@
component.set('v.allselectlist', res.allselectlist);
component.set('v.doclist', res.doclist);
//fy
-
+
var xx = res.UserProType;
component.set('v.UserProType', res.UserProType);
var gg = component.get('v.UserProType');
//fy
- component
- .find('select_agency_person')
- .set(
- 'v.options',
- this.conv_selected(res.allselectlist.AgencyPerson__c)
- );
- component
- .find('select_DealerPersonnel')
- .set(
- 'v.options',
- this.conv_selected(res.allselectlist.DealerPersonnel__c)
- );
- component
- .find('select_purpose_type')
- .set(
- 'v.options',
- this.conv_selected(res.allselectlist.WorkRecord__c)
- );
- component
- .find('select_ProductClassification')
- .set(
- 'v.options',
- this.conv_selected(
- res.allselectlist.ProductClassification__c
- )
- );
- component
- .find('select_stageName')
- .set(
- 'v.options',
- this.conv_selected(res.allselectlist.StageName__c)
- );
- component.set(
- 'v.selected_agency_person',
- res.allselectlist.AgencyPerson__c[0].label
- );
+ component.find('select_agency_person').set('v.options', this.conv_selected(res.allselectlist.AgencyPerson__c));
+ component.find('select_DealerPersonnel').set('v.options', this.conv_selected(res.allselectlist.DealerPersonnel__c));
+ component.find('select_purpose_type').set('v.options', this.conv_selected(res.allselectlist.WorkRecord__c));
+ component.find('select_ProductClassification').set('v.options', this.conv_selected(res.allselectlist.ProductClassification__c));
+ component.find('select_stageName').set('v.options', this.conv_selected(res.allselectlist.StageName__c));
+ component.set('v.selected_agency_person', res.allselectlist.AgencyPerson__c[0].label);
component.set('v.dialog_type', '鏂板缓');
- this.get_reports(
- component,
- event,
- helper,
- component.find('select_date').get('v.value'),
- component.find('select_agency_person').get('v.value')
- );
+ this.get_reports(component, event, helper, component.find('select_date').get('v.value'), component.find('select_agency_person').get('v.value'));
- component.set('v.PIConfig', res.PIConfig); // 20220222 PI鏀归�� by Bright
+ component.set('v.PIConfig', res.PIConfig);// 20220222 PI鏀归�� by Bright
component.set('v.loginEdit', false);
- } else {
+ }
+ else {
//component.set('v.errorMessage', 'doinit failed.');
this.error('doinit failed.');
//this.showErrorToast(component);
@@ -152,18 +82,14 @@
},
//鍏朵粬鍝佺墝浜у搧绫诲埆 涓嬫媺妗嗚祴鍊�
selectProductCcategory: function (component) {
- var select_ProductClassification = component
- .find('select_ProductClassification')
- .get('v.value');
+ var select_ProductClassification = component.find('select_ProductClassification').get('v.value');
if (select_ProductClassification != '') {
var action = component.get('c.selectProductCcategory');
action.setCallback(this, function (response) {
var state = response.getState();
if (state == 'SUCCESS') {
var res = response.getReturnValue();
- component
- .find('select_ProductCcategory')
- .set('v.options', JSON.parse(JSON.stringify(res)));
+ component.find('select_ProductCcategory').set('v.options', JSON.parse(JSON.stringify(res)));
}
});
$A.enqueueAction(action);
@@ -173,6 +99,7 @@
},
//鏍规嵁鍛ㄥ拰鎷呭綋鏌ヨ鏁版嵁缁欏垵濮嬮〉闈㈣祴鏁版嵁
get_reports: function (component, event, helper, date_str, person_str) {
+
if (!date_str) {
return false;
}
@@ -186,11 +113,12 @@
date_str = this.get_date_string(date_str);
var action = component.get('c.getReports');
action.setParams({
- date_str: date_str,
- person_str: person_str
+ "date_str": date_str,
+ "person_str": person_str,
});
component.set('v.loginEdit', true);
action.setCallback(this, function (response) {
+
var state = response.getState();
if (state == 'SUCCESS') {
var res = response.getReturnValue();
@@ -198,13 +126,10 @@
component.set('v.report_count', res.reports.length);
// 鏇存柊淇濆瓨寰屻伄select_data鐢�
var report_id = component.get('v.update_select_report_data_id');
- if (report_id != '') {
+ if (report_id != "") {
for (var i = 0; i < res.reports.length; i++) {
if (res.reports[i]['Id'] == report_id) {
- component.set(
- 'v.select_report_data',
- res.reports[i]
- );
+ component.set('v.select_report_data', res.reports[i]);
break;
}
}
@@ -216,17 +141,10 @@
//fy 20220414 start
var report1 = [];
var report2 = [];
- res.reports.forEach((item) => {
- if (
- (item.WorkRecord__c == '绉戝浼�' &&
- item.doctor3__c != undefined) ||
- ((item.doctor3__c == undefined ||
- item.doctor3__c == '' ||
- item.doctor3__c == '') &&
- (item.doctor2__r == undefined ||
- item.doctor2__r == '' ||
- item.doctor2__r == ''))
- ) {
+ res.reports.forEach(item => {
+ if ((item.WorkRecord__c == '绉戝浼�' && item.doctor3__c != undefined) ||
+ ((item.doctor3__c == undefined || item.doctor3__c == '' || item.doctor3__c == "")
+ && (item.doctor2__r == undefined || item.doctor2__r == '' || item.doctor2__r == ""))) {
report1.push(item);
} else {
report2.push(item);
@@ -236,78 +154,39 @@
//fy 20220414 end
// PI 鏀归�� By Bright 20220328
if (true) {
- let doctor_awsids = res.reports.map(function (d) {
- return d.doctor2__r.AWS_Data_Id__c;
- });
+ let doctor_awsids = res.reports.map(function (d) { return d.doctor2__r.AWS_Data_Id__c; });
let PIConfig = component.get('v.PIConfig');
- let staticResourceAgencyContact = JSON.parse(
- PIConfig.staticResourceAgencyContact
- );
+ let staticResourceAgencyContact = JSON.parse(PIConfig.staticResourceAgencyContact);
if (doctor_awsids.length > 0) {
- AWSService.search(
- staticResourceAgencyContact.searchUrl,
- {
- dataIds: doctor_awsids
- },
- function (data) {
- if (
- data &&
- data.object &&
- data.object.length
- ) {
- let m = {};
- for (let di in data.object) {
- if (
- data.object[di] &&
- data.object[di].dataId
- ) {
- m[data.object[di].dataId] =
- data.object[di];
- }
+ AWSService.search(staticResourceAgencyContact.searchUrl, {
+ dataIds: doctor_awsids
+ }, function (data) {
+ if (data && data.object && data.object.length) {
+ let m = {};
+ for (let di in data.object) {
+ if (data.object[di] && data.object[di].dataId) {
+ m[data.object[di].dataId] = data.object[di];
}
-
- for (let ri in res.reports) {
- if (
- res.reports[ri] &&
- res.reports[ri].doctor2__r &&
- res.reports[ri].doctor2__r
- .AWS_Data_Id__c &&
- m.hasOwnProperty(
- res.reports[ri].doctor2__r
- .AWS_Data_Id__c
- )
- ) {
- res.reports[
- ri
- ].doctor2__r.awsdata =
- m[
- res.reports[
- ri
- ].doctor2__r.AWS_Data_Id__c
- ];
- }
+ }
+
+ for (let ri in res.reports) {
+ if (res.reports[ri] && res.reports[ri].doctor2__r && res.reports[ri].doctor2__r.AWS_Data_Id__c && m.hasOwnProperty(res.reports[ri].doctor2__r.AWS_Data_Id__c)) {
+ res.reports[ri].doctor2__r.awsdata = m[res.reports[ri].doctor2__r.AWS_Data_Id__c];
}
- component.set('v.reports', res.reports);
- component.set(
- 'v.report_count',
- res.reports.length
- );
}
- //fy 20220414 start
- var reports3 = component.get('v.reports');
- if (reports3.length < flag2) {
- res.reports = [...report1, ...reports3];
- component.set('v.reports', res.reports);
- component.set(
- 'v.report_count',
- res.reports.length
- );
- }
- //fy 20220414 end
- component.set('v.loginEdit', false);
- },
- staticResourceAgencyContact.token
- );
+ component.set('v.reports', res.reports);
+ component.set('v.report_count', res.reports.length);
+ }
+ //fy 20220414 start
+ var reports3 = component.get('v.reports');
+ if (reports3.length < flag2) {
+ res.reports = [...report1, ...reports3];
+ component.set('v.reports', res.reports);
+ component.set('v.report_count', res.reports.length);
+ }
+ //fy 20220414 end
+ component.set('v.loginEdit', false);
+ }, staticResourceAgencyContact.token);
} else {
component.set('v.loginEdit', false);
}
@@ -316,7 +195,9 @@
component.set('v.list_message', 'no_data');
component.set('v.loginEdit', false);
}
- } else {
+
+ }
+ else {
//component.set('v.errorMessage', 'get_reports failed.');
this.error('get_reports failed.');
//this.showErrorToast(component);
@@ -327,31 +208,17 @@
},
//澶嶅埗鎸夐挳鍙樼伆鑹�
select_date_change: function (component, event, helper) {
- this.get_reports(
- component,
- event,
- helper,
- component.find('select_date').get('v.value'),
- component.find('select_agency_person').get('v.value')
- );
+ this.get_reports(component, event, helper, component.find('select_date').get('v.value'), component.find('select_agency_person').get('v.value'));
component.set('v.select_report_data_radio', '');
component.find('copy_button').set('v.disabled', true);
component.find('delete_button').set('v.disabled', true);
},
select_agency_change: function (component, event, helper) {
- var select_value = component
- .find('select_agency_person')
- .get('v.value');
+ var select_value = component.find('select_agency_person').get('v.value');
var new_label = this.get_agency_person_name(component, select_value);
component.set('v.selected_agency_person', new_label);
- this.get_reports(
- component,
- event,
- helper,
- component.find('select_date').get('v.value'),
- select_value
- );
+ this.get_reports(component, event, helper, component.find('select_date').get('v.value'), select_value);
component.set('v.select_report_data_radio', '');
component.find('copy_button').set('v.disabled', true);
component.find('delete_button').set('v.disabled', true);
@@ -370,6 +237,7 @@
},
//澶嶅埗鍜岀紪杈戝洖鏄剧殑浣嶇疆
toggle_report: function (component) {
+
var modal_window = component.find('modal_window');
var modal_bg = component.find('modal_bg');
if ($A.util.hasClass(modal_window, 'disp_none')) {
@@ -377,10 +245,7 @@
$A.util.removeClass(modal_window, 'disp_none');
$A.util.removeClass(modal_bg, 'disp_none');
//澶嶅埗 鍜岀紪杈� 鍥炴樉闂鍦ㄨ繖閲岄潰
- if (
- component.get('v.mode') == 'edit' ||
- component.get('v.mode') == 'copy'
- ) {
+ if (component.get('v.mode') == 'edit' || component.get('v.mode') == 'copy') {
var select_data = '';
if (component.get('v.mode') == 'edit') {
select_data = component.get('v.select_report_data');
@@ -393,108 +258,61 @@
// 鍖婚櫌鍚�
if (select_data['Agency_Hospital__c'] != '') {
for (var i = 0; i < reports.length; i++) {
- if (
- reports[i]['Agency_Hospital__c'] ==
- select_data['Agency_Hospital__c']
- ) {
- Agency_Hospital_text =
- reports[i]['Agency_Hospital__r']['Name'];
- Agency_Hospital_parent_id =
- reports[i]['Agency_Hospital__r']['Hospital__c'];
+ if (reports[i]['Agency_Hospital__c'] == select_data['Agency_Hospital__c']) {
+ Agency_Hospital_text = reports[i]['Agency_Hospital__r']['Name'];
+ Agency_Hospital_parent_id = reports[i]['Agency_Hospital__r']['Hospital__c'];
}
}
component.set('v.hospital', Agency_Hospital_text);
component.set('v.hospitalId', Agency_Hospital_parent_id);
- component.set(
- 'v.hospitalLinkId',
- select_data['Agency_Hospital__c']
- );
+ component.set('v.hospitalLinkId', select_data['Agency_Hospital__c']);
component.find('new_con').set('v.disabled', false);
}
//浣跨敤浜у搧1(浜у搧鍨嬪彿)
var UseProduct1Text = '';
var UseProduct1Id = '';
- if (
- select_data['UseProduct1__c'] != '' &&
- select_data['UseProduct1__c'] != undefined
- ) {
+ if (select_data['UseProduct1__c'] != '' && select_data['UseProduct1__c'] != undefined) {
for (var i = 0; i < reports.length; i++) {
- if (
- reports[i]['UseProduct1__c'] ==
- select_data['UseProduct1__c']
- ) {
- UseProduct1Text =
- reports[i]['UseProduct1__r'][
- 'Asset_Model_No__c'
- ];
+ if (reports[i]['UseProduct1__c'] == select_data['UseProduct1__c']) {
+ UseProduct1Text = reports[i]['UseProduct1__r']['Asset_Model_No__c'];
UseProduct1Id = reports[i]['UseProduct1__c'];
}
}
component.set('v.UseProduct1', UseProduct1Text);
- component.set(
- 'v.UseProduct1Id',
- select_data['UseProduct1__c']
- );
+ component.set('v.UseProduct1Id', select_data['UseProduct1__c']);
}
//浣跨敤浜у搧2
var UseProduct2Text = '';
var UseProduct2Id = '';
- if (
- select_data['UseProduct2__c'] != '' &&
- select_data['UseProduct2__c'] != undefined
- ) {
+ if (select_data['UseProduct2__c'] != '' && select_data['UseProduct2__c'] != undefined) {
for (var i = 0; i < reports.length; i++) {
- if (
- reports[i]['UseProduct2__c'] ==
- select_data['UseProduct2__c']
- ) {
- UseProduct2Text =
- reports[i]['UseProduct2__r'][
- 'Asset_Model_No__c'
- ];
+ if (reports[i]['UseProduct2__c'] == select_data['UseProduct2__c']) {
+ UseProduct2Text = reports[i]['UseProduct2__r']['Asset_Model_No__c'];
UseProduct2Id = reports[i]['UseProduct2__c'];
}
}
component.set('v.UseProduct2', UseProduct2Text);
- component.set(
- 'v.UseProduct2Id',
- select_data['UseProduct2__c']
- );
+ component.set('v.UseProduct2Id', select_data['UseProduct2__c']);
}
//浣跨敤浜у搧3
var UseProduct3Text = '';
var UseProduct3Id = '';
- if (
- select_data['UseProduct3__c'] != '' &&
- select_data['UseProduct3__c'] != undefined
- ) {
+ if (select_data['UseProduct3__c'] != '' && select_data['UseProduct3__c'] != undefined) {
for (var i = 0; i < reports.length; i++) {
- if (
- reports[i]['UseProduct3__c'] ==
- select_data['UseProduct3__c']
- ) {
- UseProduct3Text =
- reports[i]['UseProduct3__r'][
- 'Asset_Model_No__c'
- ];
+ if (reports[i]['UseProduct3__c'] == select_data['UseProduct3__c']) {
+ UseProduct3Text = reports[i]['UseProduct3__r']['Asset_Model_No__c'];
UseProduct3Id = reports[i]['UseProduct3__c'];
}
}
component.set('v.UseProduct3', UseProduct3Text);
- component.set(
- 'v.UseProduct3Id',
- select_data['UseProduct3__c']
- );
+ component.set('v.UseProduct3Id', select_data['UseProduct3__c']);
}
//娲诲姩鏃�
var reportDate;
if (select_data['Report_Date__c'] != '') {
for (var i = 0; i < reports.length; i++) {
- if (
- reports[i]['Report_Date__c'] ==
- select_data['Report_Date__c']
- ) {
- reportDate = reports[i]['Report_Date__c'];
+ if (reports[i]['Report_Date__c'] == select_data['Report_Date__c']) {
+ reportDate = reports[i]["Report_Date__c"];
}
}
component.set('v.data.Report_Date__c', reportDate);
@@ -505,127 +323,79 @@
// }
//fy Department_Cateogy_text__c
if (select_data['Department_Cateogy_text__c'] != '') {
- component
- .find('select_department')
- .set(
- 'v.value',
- select_data['Department_Cateogy_text__c']
- );
+ component.find('select_department').set('v.value', select_data['Department_Cateogy_text__c']);
}
//缁忛攢鍟嗕汉鍛�
if (select_data['DealerPersonnel__c'] != '') {
- this.set_selected(
- component,
- 'select_DealerPersonnel',
- select_data['DealerPersonnel__c']
- );
+ this.set_selected(component, 'select_DealerPersonnel', select_data['DealerPersonnel__c']);
}
// 娲诲姩鍖哄垎
if (select_data['WorkRecord__c'] != '') {
- this.set_selected(
- component,
- 'select_purpose_type',
- select_data['WorkRecord__c']
- );
+ this.set_selected(component, 'select_purpose_type', select_data['WorkRecord__c']);
this.selectPurposeType(component);
}
// 鎷滆浜�
if (select_data['WorkRecord__c'] == '绉戝浼�') {
- component.set(
- 'v.default_select_doctor_id2',
- select_data['doctor3__c']
- );
+ component.set('v.default_select_doctor_id2', select_data['doctor3__c']);
var a = component.get('v.default_select_doctor_id2');
this.set_doctor_list(component);
} else {
- component.set(
- 'v.default_select_doctor_id',
- select_data['doctor2__c']
- );
+ component.set('v.default_select_doctor_id', select_data['doctor2__c']);
this.set_doctor_list(component);
}
//浜у搧鍒嗙被(绗笁鍒嗙被)
if (select_data['ProductClassification__c'] != null) {
- this.set_selected(
- component,
- 'select_ProductClassification',
- select_data['ProductClassification__c']
- );
+ this.set_selected(component, 'select_ProductClassification', select_data['ProductClassification__c']);
this.selectProductClassification(component);
}
- // 浜у搧1鍚岀被鑰楁潗绉戝鏈堜娇鐢ㄩ噺
+ // 浜у搧1鍚岀被鑰楁潗绉戝鏈堜娇鐢ㄩ噺
if (select_data['ConsumptionOfConsumables__c'] != '') {
- component
- .find('select_ConsumptionOfConsumables')
- .set(
- 'v.value',
- select_data['ConsumptionOfConsumables__c']
- );
+ component.find('select_ConsumptionOfConsumables').set('v.value', select_data['ConsumptionOfConsumables__c']);
}
// 浜у搧鐢ㄩ噺
if (select_data['warlocksNumber__c'] != '') {
- component
- .find('select_warlocksNumber')
- .set('v.value', select_data['warlocksNumber__c']);
+ component.find('select_warlocksNumber').set('v.value', select_data['warlocksNumber__c']);
}
// 鏀彺闇�姹�
if (select_data['WorkMark__c'] != false) {
- component
- .find('select_WorkMark')
- .set('v.checked', select_data['WorkMark__c']);
+ component.find('select_WorkMark').set('v.checked', select_data['WorkMark__c']);
}
+ ;
+
var report_id = component.get('v.edit_copy_select_report_id');
- if (report_id != '') {
+ if (report_id != "") {
var select_EffectProgress1 = '';
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'];
- WarlockClassification =
- reports[i]['WarlockClassification__c'];
- ProductCcategory =
- reports[i]['ProductCcategory__c'];
- productCategories =
- reports[i]['productCategories__c'];
+ if (report_id == reports[i]["Id"]) {
+ select_EffectProgress1 = reports[i]["EffectProgress__c"];
+ WarlockClassification = reports[i]["WarlockClassification__c"];
+ ProductCcategory = reports[i]["ProductCcategory__c"];
+ productCategories = reports[i]["productCategories__c"];
break;
}
}
//鏁堟灉/杩涘害
- if (
- select_EffectProgress1 != null &&
- select_EffectProgress1 != ''
- ) {
- component
- .find('select_EffectProgress')
- .set('v.value', select_EffectProgress1);
+ if (select_EffectProgress1 != null && select_EffectProgress1 != '') {
+ component.find('select_EffectProgress').set('v.value', select_EffectProgress1);
}
//鏈+鍒嗙被
- if (
- WarlockClassification != null &&
- WarlockClassification != ''
- ) {
- component
- .find('select_OtherBrandConsumables')
- .set('v.value', WarlockClassification);
+ if (WarlockClassification != null && WarlockClassification != '') {
+ component.find('select_OtherBrandConsumables').set('v.value', WarlockClassification);
}
//宸查噰鐢ㄥ叾浠栧搧鐗�
if (ProductCcategory != null && ProductCcategory != '') {
- component
- .find('select_ProductCcategory')
- .set('v.value', ProductCcategory);
+ component.find('select_ProductCcategory').set('v.value', ProductCcategory);
this.selectpurposetype(component);
}
//鍏朵粬鍝佺墝浜у搧绫诲埆
if (productCategories != null && productCategories != '') {
- component
- .find('select_productCategories')
- .set('v.value', productCategories);
+ component.find('select_productCategories').set('v.value', productCategories);
}
- component.set('v.edit_copy_select_report_id', '');
+ component.set('v.edit_copy_select_report_id', "");
}
}
} else {
@@ -635,42 +405,21 @@
var UseProduct1__c = component.get('v.UseProduct1Id');
var UseProduct2__c = component.get('v.UseProduct2Id');
var UseProduct3__c = component.get('v.UseProduct3Id');
- var Department_Cateogy__c = component
- .find('select_department')
- .get('v.value');
- var ConsumptionOfConsumables__c = component
- .find('select_ConsumptionOfConsumables')
- .get('v.value');
- var DealerPersonnel__c = component
- .find('select_DealerPersonnel')
- .get('v.value');
+ var Department_Cateogy__c = component.find('select_department').get('v.value');
+ var ConsumptionOfConsumables__c = component.find('select_ConsumptionOfConsumables').get('v.value');
+ var DealerPersonnel__c = component.find('select_DealerPersonnel').get('v.value');
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 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');
- var WorkMark__c = component
- .find('select_WorkMark')
- .get('v.checked');
+ var WorkRecord__c = component.find('select_purpose_type').get('v.value');
+ var EffectProgress__c = component.find('select_EffectProgress').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');
+ var WorkMark__c = component.find('select_WorkMark').get('v.checked');
if (component.get('v.mode') == 'new') {
- var confirm_title = '璀﹀憡!';
+ var confirm_title = '璀﹀憡!'
var confirm_text = '鏀惧純鏂板缓鏃ユ姤锛�';
- if (
- !Report_Date__c &&
+ if (!Report_Date__c &&
!Agency_Hospital__c &&
!UseProduct1__c &&
!UseProduct2__c &&
@@ -695,35 +444,24 @@
this.close_confirm(component, confirm_title, confirm_text);
}
} else if (component.get('v.mode') == 'copy') {
- var confirm_title = '璀﹀憡!';
+ var confirm_title = '璀﹀憡!'
var confirm_text = '鏀惧純鏂板缓鏃ユ姤锛�';
- if (
- select_report_data['Report_Date__c'] == Report_Date__c &&
- select_report_data['Agency_Hospital__c'] ==
- Agency_Hospital__c &&
+ if (select_report_data['Report_Date__c'] == Report_Date__c &&
+ select_report_data['Agency_Hospital__c'] == Agency_Hospital__c &&
select_report_data['UseProduct1__c'] == UseProduct1__c &&
select_report_data['UseProduct2__c'] == UseProduct2__c &&
select_report_data['UseProduct3__c'] == UseProduct3__c &&
- select_report_data['Department_Cateogy__c'] ==
- Department_Cateogy__c &&
- select_report_data['ConsumptionOfConsumables__c'] ==
- ConsumptionOfConsumables__c &&
- select_report_data['DealerPersonnel__c'] ==
- DealerPersonnel__c &&
+ select_report_data['Department_Cateogy__c'] == Department_Cateogy__c &&
+ select_report_data['ConsumptionOfConsumables__c'] == ConsumptionOfConsumables__c &&
+ select_report_data['DealerPersonnel__c'] == DealerPersonnel__c &&
select_report_data['doctor2__c'] == doctor2__c &&
- select_report_data['EffectProgress__c'] ==
- EffectProgress__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 &&
+ select_report_data['EffectProgress__c'] == EffectProgress__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 &&
select_report_data['WorkMark__c'] == WorkMark__c &&
- select_report_data['WorkRecord__c'] == WorkRecord__c
- ) {
+ select_report_data['WorkRecord__c'] == WorkRecord__c) {
this.allclear(component);
$A.util.addClass(modal_window, 'disp_none');
$A.util.addClass(modal_bg, 'disp_none');
@@ -731,35 +469,24 @@
this.close_confirm(component, confirm_title, confirm_text);
}
} else if (component.get('v.mode') == 'edit') {
- var confirm_title = '璀﹀憡!';
+ var confirm_title = '璀﹀憡!'
var confirm_text = '鏀惧純缂栬緫鏃ユ姤锛�';
- if (
- select_report_data['Report_Date__c'] == Report_Date__c &&
- select_report_data['Agency_Hospital__c'] ==
- Agency_Hospital__c &&
+ if (select_report_data['Report_Date__c'] == Report_Date__c &&
+ select_report_data['Agency_Hospital__c'] == Agency_Hospital__c &&
select_report_data['UseProduct1__c'] == UseProduct1__c &&
select_report_data['UseProduct2__c'] == UseProduct2__c &&
select_report_data['UseProduct3__c'] == UseProduct3__c &&
- select_report_data['Department_Cateogy__c'] ==
- Department_Cateogy__c &&
- select_report_data['ConsumptionOfConsumables__c'] ==
- ConsumptionOfConsumables__c &&
- select_report_data['DealerPersonnel__c'] ==
- DealerPersonnel__c &&
+ select_report_data['Department_Cateogy__c'] == Department_Cateogy__c &&
+ select_report_data['ConsumptionOfConsumables__c'] == ConsumptionOfConsumables__c &&
+ select_report_data['DealerPersonnel__c'] == DealerPersonnel__c &&
select_report_data['doctor2__c'] == doctor2__c &&
- select_report_data['EffectProgress__c'] ==
- EffectProgress__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 &&
+ select_report_data['EffectProgress__c'] == EffectProgress__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 &&
select_report_data['WorkMark__c'] == WorkMark__c &&
- select_report_data['WorkRecord__c'] == WorkRecord__c
- ) {
+ select_report_data['WorkRecord__c'] == WorkRecord__c) {
this.allclear(component);
$A.util.addClass(modal_window, 'disp_none');
$A.util.addClass(modal_bg, 'disp_none');
@@ -776,12 +503,9 @@
// OPEN
$A.util.removeClass(modal_window, 'disp_none');
$A.util.removeClass(modal_bg, 'disp_none');
- component.set('v.loginEdit', true);
+ component.set('v.loginEdit',true);
//澶嶅埗 鍜岀紪杈� 鍥炴樉闂鍦ㄨ繖閲岄潰
- if (
- component.get('v.mode') == 'edit' ||
- component.get('v.mode') == 'copy'
- ) {
+ if (component.get('v.mode') == 'edit' || component.get('v.mode') == 'copy') {
var select_data = '';
if (component.get('v.mode') == 'edit') {
select_data = component.get('v.select_report_data');
@@ -794,108 +518,61 @@
// 鍖婚櫌鍚�
if (select_data['Agency_Hospital__c'] != '') {
for (var i = 0; i < reports.length; i++) {
- if (
- reports[i]['Agency_Hospital__c'] ==
- select_data['Agency_Hospital__c']
- ) {
- Agency_Hospital_text =
- reports[i]['Agency_Hospital__r']['Name'];
- Agency_Hospital_parent_id =
- reports[i]['Agency_Hospital__r']['Hospital__c'];
+ if (reports[i]['Agency_Hospital__c'] == select_data['Agency_Hospital__c']) {
+ Agency_Hospital_text = reports[i]['Agency_Hospital__r']['Name'];
+ Agency_Hospital_parent_id = reports[i]['Agency_Hospital__r']['Hospital__c'];
}
}
component.set('v.hospital', Agency_Hospital_text);
component.set('v.hospitalId', Agency_Hospital_parent_id);
- component.set(
- 'v.hospitalLinkId',
- select_data['Agency_Hospital__c']
- );
+ component.set('v.hospitalLinkId', select_data['Agency_Hospital__c']);
component.find('new_con').set('v.disabled', false);
}
//浣跨敤浜у搧1(浜у搧鍨嬪彿)
var UseProduct1Text = '';
var UseProduct1Id = '';
- if (
- select_data['UseProduct1__c'] != '' &&
- select_data['UseProduct1__c'] != undefined
- ) {
+ if (select_data['UseProduct1__c'] != '' && select_data['UseProduct1__c'] != undefined) {
for (var i = 0; i < reports.length; i++) {
- if (
- reports[i]['UseProduct1__c'] ==
- select_data['UseProduct1__c']
- ) {
- UseProduct1Text =
- reports[i]['UseProduct1__r'][
- 'Asset_Model_No__c'
- ];
+ if (reports[i]['UseProduct1__c'] == select_data['UseProduct1__c']) {
+ UseProduct1Text = reports[i]['UseProduct1__r']['Asset_Model_No__c'];
UseProduct1Id = reports[i]['UseProduct1__c'];
}
}
component.set('v.UseProduct1', UseProduct1Text);
- component.set(
- 'v.UseProduct1Id',
- select_data['UseProduct1__c']
- );
+ component.set('v.UseProduct1Id', select_data['UseProduct1__c']);
}
//浣跨敤浜у搧2
var UseProduct2Text = '';
var UseProduct2Id = '';
- if (
- select_data['UseProduct2__c'] != '' &&
- select_data['UseProduct2__c'] != undefined
- ) {
+ if (select_data['UseProduct2__c'] != '' && select_data['UseProduct2__c'] != undefined) {
for (var i = 0; i < reports.length; i++) {
- if (
- reports[i]['UseProduct2__c'] ==
- select_data['UseProduct2__c']
- ) {
- UseProduct2Text =
- reports[i]['UseProduct2__r'][
- 'Asset_Model_No__c'
- ];
+ if (reports[i]['UseProduct2__c'] == select_data['UseProduct2__c']) {
+ UseProduct2Text = reports[i]['UseProduct2__r']['Asset_Model_No__c'];
UseProduct2Id = reports[i]['UseProduct2__c'];
}
}
component.set('v.UseProduct2', UseProduct2Text);
- component.set(
- 'v.UseProduct2Id',
- select_data['UseProduct2__c']
- );
+ component.set('v.UseProduct2Id', select_data['UseProduct2__c']);
}
//浣跨敤浜у搧3
var UseProduct3Text = '';
var UseProduct3Id = '';
- if (
- select_data['UseProduct3__c'] != '' &&
- select_data['UseProduct3__c'] != undefined
- ) {
+ if (select_data['UseProduct3__c'] != '' && select_data['UseProduct3__c'] != undefined) {
for (var i = 0; i < reports.length; i++) {
- if (
- reports[i]['UseProduct3__c'] ==
- select_data['UseProduct3__c']
- ) {
- UseProduct3Text =
- reports[i]['UseProduct3__r'][
- 'Asset_Model_No__c'
- ];
+ if (reports[i]['UseProduct3__c'] == select_data['UseProduct3__c']) {
+ UseProduct3Text = reports[i]['UseProduct3__r']['Asset_Model_No__c'];
UseProduct3Id = reports[i]['UseProduct3__c'];
}
}
component.set('v.UseProduct3', UseProduct3Text);
- component.set(
- 'v.UseProduct3Id',
- select_data['UseProduct3__c']
- );
+ component.set('v.UseProduct3Id', select_data['UseProduct3__c']);
}
//娲诲姩鏃�
var reportDate;
if (select_data['Report_Date__c'] != '') {
for (var i = 0; i < reports.length; i++) {
- if (
- reports[i]['Report_Date__c'] ==
- select_data['Report_Date__c']
- ) {
- reportDate = reports[i]['Report_Date__c'];
+ if (reports[i]['Report_Date__c'] == select_data['Report_Date__c']) {
+ reportDate = reports[i]["Report_Date__c"];
}
}
component.set('v.data.Report_Date__c', reportDate);
@@ -906,128 +583,81 @@
// }
//fy Department_Cateogy_text__c
if (select_data['Department_Cateogy_text__c'] != '') {
- component
- .find('select_department')
- .set(
- 'v.value',
- select_data['Department_Cateogy_text__c']
- );
+ component.find('select_department').set('v.value', select_data['Department_Cateogy_text__c']);
}
//缁忛攢鍟嗕汉鍛�
if (select_data['DealerPersonnel__c'] != '') {
- this.set_selected(
- component,
- 'select_DealerPersonnel',
- select_data['DealerPersonnel__c']
- );
+ this.set_selected(component, 'select_DealerPersonnel', select_data['DealerPersonnel__c']);
}
// 娲诲姩鍖哄垎
if (select_data['WorkRecord__c'] != '') {
- this.set_selected(
- component,
- 'select_purpose_type',
- select_data['WorkRecord__c']
- );
+ this.set_selected(component, 'select_purpose_type', select_data['WorkRecord__c']);
this.selectPurposeType(component);
}
// 鎷滆浜�
if (select_data['WorkRecord__c'] == '绉戝浼�') {
- component.set(
- 'v.default_select_doctor_id2',
- select_data['doctor3__c']
- );
+ component.set('v.default_select_doctor_id2', select_data['doctor3__c']);
var a = component.get('v.default_select_doctor_id2');
this.set_doctor_list_edit(component);
} else {
- component.set(
- 'v.default_select_doctor_id',
- select_data['doctor2__c']
- );
+ component.set('v.default_select_doctor_id', select_data['doctor2__c']);
this.set_doctor_list_edit(component);
}
//浜у搧鍒嗙被(绗笁鍒嗙被)
if (select_data['ProductClassification__c'] != null) {
- this.set_selected(
- component,
- 'select_ProductClassification',
- select_data['ProductClassification__c']
- );
+ this.set_selected(component, 'select_ProductClassification', select_data['ProductClassification__c']);
this.selectProductClassification(component);
}
- // 浜у搧1鍚岀被鑰楁潗绉戝鏈堜娇鐢ㄩ噺
+ // 浜у搧1鍚岀被鑰楁潗绉戝鏈堜娇鐢ㄩ噺
if (select_data['ConsumptionOfConsumables__c'] != '') {
- component
- .find('select_ConsumptionOfConsumables')
- .set(
- 'v.value',
- select_data['ConsumptionOfConsumables__c']
- );
+ component.find('select_ConsumptionOfConsumables').set('v.value', select_data['ConsumptionOfConsumables__c']);
}
// 浜у搧鐢ㄩ噺
if (select_data['warlocksNumber__c'] != '') {
- component
- .find('select_warlocksNumber')
- .set('v.value', select_data['warlocksNumber__c']);
+ component.find('select_warlocksNumber').set('v.value', select_data['warlocksNumber__c']);
}
// 鏀彺闇�姹�
if (select_data['WorkMark__c'] != false) {
- component
- .find('select_WorkMark')
- .set('v.checked', select_data['WorkMark__c']);
+ component.find('select_WorkMark').set('v.checked', select_data['WorkMark__c']);
}
+ ;
+
var report_id = component.get('v.edit_copy_select_report_id');
- if (report_id != '') {
+ if (report_id != "") {
var select_EffectProgress1 = '';
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'];
- WarlockClassification =
- reports[i]['WarlockClassification__c'];
- ProductCcategory =
- reports[i]['ProductCcategory__c'];
- productCategories =
- reports[i]['productCategories__c'];
+ if (report_id == reports[i]["Id"]) {
+ select_EffectProgress1 = reports[i]["EffectProgress__c"];
+ WarlockClassification = reports[i]["WarlockClassification__c"];
+ ProductCcategory = reports[i]["ProductCcategory__c"];
+ productCategories = reports[i]["productCategories__c"];
break;
}
}
//鏁堟灉/杩涘害
- if (
- select_EffectProgress1 != null &&
- select_EffectProgress1 != ''
- ) {
- component
- .find('select_EffectProgress')
- .set('v.value', select_EffectProgress1);
+ if (select_EffectProgress1 != null && select_EffectProgress1 != '') {
+ component.find('select_EffectProgress').set('v.value', select_EffectProgress1);
}
//鏈+鍒嗙被
- if (
- WarlockClassification != null &&
- WarlockClassification != ''
- ) {
- component
- .find('select_OtherBrandConsumables')
- .set('v.value', WarlockClassification);
+ if (WarlockClassification != null && WarlockClassification != '') {
+ component.find('select_OtherBrandConsumables').set('v.value', WarlockClassification);
}
//宸查噰鐢ㄥ叾浠栧搧鐗�
if (ProductCcategory != null && ProductCcategory != '') {
- component
- .find('select_ProductCcategory')
- .set('v.value', ProductCcategory);
+ component.find('select_ProductCcategory').set('v.value', ProductCcategory);
this.selectpurposetype(component);
}
//鍏朵粬鍝佺墝浜у搧绫诲埆
if (productCategories != null && productCategories != '') {
- component
- .find('select_productCategories')
- .set('v.value', productCategories);
+ component.find('select_productCategories').set('v.value', productCategories);
}
- component.set('v.edit_copy_select_report_id', '');
+ component.set('v.edit_copy_select_report_id', "");
}
+
}
} else {
var select_report_data = component.get('v.select_report_data');
@@ -1036,42 +666,21 @@
var UseProduct1__c = component.get('v.UseProduct1Id');
var UseProduct2__c = component.get('v.UseProduct2Id');
var UseProduct3__c = component.get('v.UseProduct3Id');
- var Department_Cateogy__c = component
- .find('select_department')
- .get('v.value');
- var ConsumptionOfConsumables__c = component
- .find('select_ConsumptionOfConsumables')
- .get('v.value');
- var DealerPersonnel__c = component
- .find('select_DealerPersonnel')
- .get('v.value');
+ var Department_Cateogy__c = component.find('select_department').get('v.value');
+ var ConsumptionOfConsumables__c = component.find('select_ConsumptionOfConsumables').get('v.value');
+ var DealerPersonnel__c = component.find('select_DealerPersonnel').get('v.value');
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 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');
- var WorkMark__c = component
- .find('select_WorkMark')
- .get('v.checked');
+ var WorkRecord__c = component.find('select_purpose_type').get('v.value');
+ var EffectProgress__c = component.find('select_EffectProgress').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');
+ var WorkMark__c = component.find('select_WorkMark').get('v.checked');
if (component.get('v.mode') == 'new') {
- var confirm_title = '璀﹀憡!';
+ var confirm_title = '璀﹀憡!'
var confirm_text = '鏀惧純鏂板缓鏃ユ姤锛�';
- if (
- !Report_Date__c &&
+ if (!Report_Date__c &&
!Agency_Hospital__c &&
!UseProduct1__c &&
!UseProduct2__c &&
@@ -1096,35 +705,24 @@
this.close_confirm(component, confirm_title, confirm_text);
}
} else if (component.get('v.mode') == 'copy') {
- var confirm_title = '璀﹀憡!';
+ var confirm_title = '璀﹀憡!'
var confirm_text = '鏀惧純鏂板缓鏃ユ姤锛�';
- if (
- select_report_data['Report_Date__c'] == Report_Date__c &&
- select_report_data['Agency_Hospital__c'] ==
- Agency_Hospital__c &&
+ if (select_report_data['Report_Date__c'] == Report_Date__c &&
+ select_report_data['Agency_Hospital__c'] == Agency_Hospital__c &&
select_report_data['UseProduct1__c'] == UseProduct1__c &&
select_report_data['UseProduct2__c'] == UseProduct2__c &&
select_report_data['UseProduct3__c'] == UseProduct3__c &&
- select_report_data['Department_Cateogy__c'] ==
- Department_Cateogy__c &&
- select_report_data['ConsumptionOfConsumables__c'] ==
- ConsumptionOfConsumables__c &&
- select_report_data['DealerPersonnel__c'] ==
- DealerPersonnel__c &&
+ select_report_data['Department_Cateogy__c'] == Department_Cateogy__c &&
+ select_report_data['ConsumptionOfConsumables__c'] == ConsumptionOfConsumables__c &&
+ select_report_data['DealerPersonnel__c'] == DealerPersonnel__c &&
select_report_data['doctor2__c'] == doctor2__c &&
- select_report_data['EffectProgress__c'] ==
- EffectProgress__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 &&
+ select_report_data['EffectProgress__c'] == EffectProgress__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 &&
select_report_data['WorkMark__c'] == WorkMark__c &&
- select_report_data['WorkRecord__c'] == WorkRecord__c
- ) {
+ select_report_data['WorkRecord__c'] == WorkRecord__c) {
this.allclear(component);
$A.util.addClass(modal_window, 'disp_none');
$A.util.addClass(modal_bg, 'disp_none');
@@ -1132,35 +730,24 @@
this.close_confirm(component, confirm_title, confirm_text);
}
} else if (component.get('v.mode') == 'edit') {
- var confirm_title = '璀﹀憡!';
+ var confirm_title = '璀﹀憡!'
var confirm_text = '鏀惧純缂栬緫鏃ユ姤锛�';
- if (
- select_report_data['Report_Date__c'] == Report_Date__c &&
- select_report_data['Agency_Hospital__c'] ==
- Agency_Hospital__c &&
+ if (select_report_data['Report_Date__c'] == Report_Date__c &&
+ select_report_data['Agency_Hospital__c'] == Agency_Hospital__c &&
select_report_data['UseProduct1__c'] == UseProduct1__c &&
select_report_data['UseProduct2__c'] == UseProduct2__c &&
select_report_data['UseProduct3__c'] == UseProduct3__c &&
- select_report_data['Department_Cateogy__c'] ==
- Department_Cateogy__c &&
- select_report_data['ConsumptionOfConsumables__c'] ==
- ConsumptionOfConsumables__c &&
- select_report_data['DealerPersonnel__c'] ==
- DealerPersonnel__c &&
+ select_report_data['Department_Cateogy__c'] == Department_Cateogy__c &&
+ select_report_data['ConsumptionOfConsumables__c'] == ConsumptionOfConsumables__c &&
+ select_report_data['DealerPersonnel__c'] == DealerPersonnel__c &&
select_report_data['doctor2__c'] == doctor2__c &&
- select_report_data['EffectProgress__c'] ==
- EffectProgress__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 &&
+ select_report_data['EffectProgress__c'] == EffectProgress__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 &&
select_report_data['WorkMark__c'] == WorkMark__c &&
- select_report_data['WorkRecord__c'] == WorkRecord__c
- ) {
+ select_report_data['WorkRecord__c'] == WorkRecord__c) {
this.allclear(component);
$A.util.addClass(modal_window, 'disp_none');
$A.util.addClass(modal_bg, 'disp_none');
@@ -1168,6 +755,7 @@
this.close_confirm(component, confirm_title, confirm_text);
}
}
+
}
//component.set('v.loginEdit',false);
},
@@ -1180,7 +768,7 @@
var modal_bg = component.find('modal_bg');
var modal_confirm = component.find('modal_confirm');
var modal_confirm_bg = component.find('modal_confirm_bg');
-
+
if (confirm_status == 0) {
$A.util.addClass(modal_window, 'disp_none');
$A.util.addClass(modal_bg, 'disp_none');
@@ -1192,7 +780,7 @@
$A.util.addClass(modal_confirm_bg, 'disp_none');
component.set('v.mode', '');
this.allclear(component);
- component.set('v.reports_now', '');
+ component.set('v.reports_now', "");
component.set('v.reports_now_count', 0);
component.set('v.confirm_status', 0);
} else if (confirm_status == 2) {
@@ -1206,37 +794,30 @@
},
//鏂板缓鎸夐挳
new_report: function (component, event, helper) {
+
component.set('v.mode', 'new');
component.set('v.dialog_type', '鏂板缓');
// 鍛�
var select_date = component.find('select_date').get('v.value');
// 鎷呭綋
- var select_agency = component
- .find('select_agency_person')
- .get('v.value');
+ var select_agency = component.find('select_agency_person').get('v.value');
var cm = 0;
- if (select_agency.indexOf(';') != -1) {
- select_agency = select_agency.split(';')[0];
+ if (select_agency.indexOf(";") != -1) {
+ select_agency = select_agency.split(";")[0];
}
component.set('v.selected_date', select_date);
// 鎷呭綋
var name = component.get('v.selected_agency_person');
- var ret = this.create_report_header(
- component,
- event,
- helper,
- name,
- select_agency,
- select_date
- );
+ var ret = this.create_report_header(component, event, helper, name, select_agency, select_date);
component.set('v.default_select_doctor_id2', '');
// SWAG-CF58C3 fy start
- this.set_aws_url(component, 'Agency_Contact__c');
+ this.set_aws_url(component, 'Agency_Contact__c')
// SWAG-CF58C3 fy end
},
// 澶嶅埗鎸夐挳
copy_button: function (component, event, helper) {
+
this.allclear(component);
component.set('v.mode', 'copy');
component.set('v.dialog_type', '鏂板缓');
@@ -1244,17 +825,8 @@
component.set('v.loadOpp', true);
// 閫�
var now = new Date();
- var start_day = new Date(
- now.getFullYear(),
- now.getMonth(),
- now.getDate() - now.getDay() + 1
- );
- var select_date =
- start_day.getFullYear() +
- '/' +
- (start_day.getMonth() + 1) +
- '/' +
- start_day.getDate();
+ var start_day = new Date(now.getFullYear(), now.getMonth(), (now.getDate() - now.getDay() + 1));
+ var select_date = start_day.getFullYear() + '/' + (start_day.getMonth() + 1) + '/' + start_day.getDate();
this.set_selected(component, 'select_date', select_date);
component.set('v.selected_date', select_date);
// 鎷呭綋
@@ -1266,26 +838,22 @@
component.set('v.edit_copy_select_report_id', select_report_data['Id']);
component.set('v.select_report_data', select_report_data);
- var ret = this.create_report_header(
- component,
- event,
- helper,
- name,
- select_agency,
- select_date
- );
+ var ret = this.create_report_header(component, event, helper, name, select_agency, select_date);
// SWAG-CF58C3 fy start
- this.set_aws_url(component, 'Agency_Contact__c');
+ this.set_aws_url(component, 'Agency_Contact__c')
// SWAG-CF58C3 fy end
+
},
//鍒犻櫎鎸夐挳
delete_button: function (component, event, helper) {
+
var select_report_data = component.get('v.select_report_data_radio');
if (confirm('鏄惁鍒犻櫎璇ユ暟鎹紵')) {
+
component.set('v.login', true);
var action = component.get('c.deleteAgencyReport');
action.setParams({
- agencyReport_id: select_report_data.Id
+ "agencyReport_id": select_report_data.Id,
});
action.setCallback(this, function (response) {
var state = response.getState();
@@ -1304,6 +872,7 @@
},
//澶嶅埗鎸夐挳鍙敤
change_report_radio: function (component, event, helper) {
+
var reports = component.get('v.reports');
for (var i = 0; i < reports.length; i++) {
if (reports[i].Name == event.getSource().get('v.label')) {
@@ -1317,42 +886,27 @@
//缂栬緫鎸夐挳
edit_button: function (component, event, helper) {
component.set('v.login', true);
- debugger;
+ debugger
//component.set('v.loginEdit', true);
this.allclear(component);
//component.set('v.loadOpp', true);
var index = event.getSource().get('v.value');
- component.set(
- 'v.select_report_data',
- component.get('v.reports')[index]
- );
+ component.set('v.select_report_data', component.get('v.reports')[index]);
component.set('v.mode', 'edit');
component.set('v.dialog_type', '缂栬緫');
var select_date = component.get('v.reports')[index].Submit_date__c;
- var select_agency =
- component.get('v.reports')[index].Person_In_Charge2__c;
+ var select_agency = component.get('v.reports')[index].Person_In_Charge2__c;
var text_tmp = select_date.split('-');
- var select_date_text =
- text_tmp[0] + '/' + Number(text_tmp[1]) + '/' + Number(text_tmp[2]);
+ var select_date_text = text_tmp[0] + '/' + Number(text_tmp[1]) + '/' + Number(text_tmp[2]);
component.set('v.selected_date', select_date_text);
var name = component.get('v.reports')[index].Person_In_Charge2__r.Name;
this.set_selected(component, 'select_agency_person', select_agency);
var new_label = this.get_agency_person_name(component, select_agency);
component.set('v.selected_agency_person', new_label);
- component.set(
- 'v.edit_copy_select_report_id',
- component.get('v.reports')[index].Id
- );
- var ret = this.create_report_header_edit(
- component,
- event,
- helper,
- name,
- select_agency,
- select_date
- );
+ component.set('v.edit_copy_select_report_id', component.get('v.reports')[index].Id);
+ var ret = this.create_report_header_edit(component, event, helper, name, select_agency, select_date);
// SWAG-CF58C3 fy start
- this.set_aws_url(component, 'Agency_Contact__c');
+ this.set_aws_url(component, 'Agency_Contact__c')
//component.set('v.login', false);
// SWAG-CF58C3 fy end
},
@@ -1362,114 +916,68 @@
component.find('save_button').set('v.disabled', true);
var etEng = component.get('v.etEng');
var Report_Date__c = component.get('v.data.Report_Date__c');
- var Person_In_Charge2__c = '';
- var Submit_date__c = '';
+ var Person_In_Charge2__c = "";
+ var Submit_date__c = "";
if (component.get('v.mode') == 'edit') {
// 鍛� Submit_date__c
- Submit_date__c = component.get(
- 'v.select_report_data'
- ).Submit_date__c;
+ Submit_date__c = component.get('v.select_report_data').Submit_date__c;
// 鎷呭綋 Person_In_Charge2__c
- Person_In_Charge2__c = component.get(
- 'v.select_report_data'
- ).Person_In_Charge2__c;
+ Person_In_Charge2__c = component.get('v.select_report_data').Person_In_Charge2__c;
} else {
// 鍛� Submit_date__c
- Submit_date__c = this.get_date_string(
- component.find('select_date').get('v.value')
- );
+ Submit_date__c = this.get_date_string(component.find('select_date').get('v.value'));
// 鎷呭綋 Person_In_Charge2__c
- Person_In_Charge2__c = component
- .find('select_agency_person')
- .get('v.value');
+ Person_In_Charge2__c = component.find('select_agency_person').get('v.value');
}
-
+
// Agency_Report_Header__c
- var Agency_Report_Header__c = component.get(
- 'v.agency_report_header_id'
- );
- // 鍖婚櫌
+ var Agency_Report_Header__c = component.get('v.agency_report_header_id');
+ // 鍖婚櫌
var Agency_Hospital__c = component.get('v.hospitalLinkId');
// 浜у搧鍒嗙被(绗笁鍒嗙被)
- var ProductClassification__c = component
- .find('select_ProductClassification')
- .get('v.value');
- // 浣跨敤浜у搧1(浜у搧鍨嬪彿) UseProduct1__c
+ var ProductClassification__c = component.find('select_ProductClassification').get('v.value');
+ // 浣跨敤浜у搧1(浜у搧鍨嬪彿) UseProduct1__c
var UseProduct1__c = component.get('v.UseProduct1Id');
- // 浣跨敤浜у搧2 UseProduct2__c
+ // 浣跨敤浜у搧2 UseProduct2__c
var UseProduct2__c = component.get('v.UseProduct2Id');
- // 浣跨敤浜у搧3 UseProduct3__c
+ // 浣跨敤浜у搧3 UseProduct3__c
var UseProduct3__c = component.get('v.UseProduct3Id');
- // 绉戝 Department_Cateogy__c
- var Department_Cateogy__c = component
- .find('select_department')
- .get('v.value');
+ // 绉戝 Department_Cateogy__c
+ var Department_Cateogy__c = component.find('select_department').get('v.value');
// 缁忛攢鍟嗕汉鍛� DealerPersonnel__c
- var DealerPersonnel__c = component
- .find('select_DealerPersonnel')
- .get('v.value');
+ var DealerPersonnel__c = component.find('select_DealerPersonnel').get('v.value');
// 鎷滆浜� doctor2__c
var doctor2__c = component.find('select_doctor').get('v.value');
// 娲诲姩鍖哄垎浼� WorkRecord__c
- var WorkRecord__c = component
- .find('select_purpose_type')
- .get('v.value');
+ var WorkRecord__c = component.find('select_purpose_type').get('v.value');
// 鏁堟灉/杩涘害 EffectProgress__c
- var EffectProgress__c = component
- .find('select_EffectProgress')
- .get('v.value');
+ var EffectProgress__c = component.find('select_EffectProgress').get('v.value');
// alert(EffectProgress__c);
- // 绉戝鍚屾潵鑰楁潗鏈堜娇鐢ㄩ噺 ConsumptionOfConsumables__c
- var ConsumptionOfConsumables__c = component
- .find('select_ConsumptionOfConsumables')
- .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
- var productCategories__c = component
- .find('select_productCategories')
- .get('v.value');
- // 浜у搧鐢ㄩ噺 warlocksNumber__c
- var warlocksNumber__c = component
- .find('select_warlocksNumber')
- .get('v.value');
- // 鏀彺闇�姹� WorkMark__c
+ // 绉戝鍚屾潵鑰楁潗鏈堜娇鐢ㄩ噺 ConsumptionOfConsumables__c
+ var ConsumptionOfConsumables__c = component.find('select_ConsumptionOfConsumables').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
+ var productCategories__c = component.find('select_productCategories').get('v.value');
+ // 浜у搧鐢ㄩ噺 warlocksNumber__c
+ var warlocksNumber__c = component.find('select_warlocksNumber').get('v.value');
+ // 鏀彺闇�姹� WorkMark__c
var WorkMark__c = component.find('select_WorkMark').get('v.checked');
var StageName__c = component.find('select_stageName').get('v.value');
- var Amount__c =
- component.get('v.oppdata.Amount__c') != null
- ? component.get('v.oppdata.Amount__c').toString()
- : '';
- var OCMSale_Price__c =
- component.get('v.oppdata.OCMSale_Price__c') != null
- ? component.get('v.oppdata.OCMSale_Price__c').toString()
- : '';
- var Close_Forecasted_Date__c = component.get(
- 'v.oppdata.Close_Forecasted_Date__c'
- );
+ var Amount__c = component.get('v.oppdata.Amount__c') != null ? component.get('v.oppdata.Amount__c').toString() : '';
+ var OCMSale_Price__c = component.get('v.oppdata.OCMSale_Price__c') != null ? component.get('v.oppdata.OCMSale_Price__c').toString() : '';
+ var Close_Forecasted_Date__c = component.get('v.oppdata.Close_Forecasted_Date__c');
var StageName__c_o = component.get('v.StageName__c_o');
var Amount__c_o = component.get('v.Amount__c_o');
var OCMSale_Price__c_o = component.get('v.OCMSale_Price__c_o');
- var Close_Forecasted_Date__c_o = component.get(
- 'v.Close_Forecasted_Date__c_o'
- );
+ var Close_Forecasted_Date__c_o = component.get('v.Close_Forecasted_Date__c_o');
if (StageName__c_o == undefined) StageName__c_o = '';
if (Amount__c_o == undefined) Amount__c_o = '';
if (OCMSale_Price__c_o == undefined) OCMSale_Price__c_o = '';
- if (Close_Forecasted_Date__c_o == undefined)
- Close_Forecasted_Date__c_o = '';
- if (
- StageName__c == StageName__c_o &&
- OCMSale_Price__c_o == OCMSale_Price__c &&
- Amount__c == Amount__c_o &&
- Close_Forecasted_Date__c == Close_Forecasted_Date__c_o
- ) {
+ if (Close_Forecasted_Date__c_o == undefined) Close_Forecasted_Date__c_o = '';
+ if (StageName__c == StageName__c_o && OCMSale_Price__c_o == OCMSale_Price__c && Amount__c == Amount__c_o && Close_Forecasted_Date__c == Close_Forecasted_Date__c_o) {
StageName__c = '';
Amount__c = '';
OCMSale_Price__c = '';
@@ -1480,164 +988,61 @@
//fy start
// if(WorkRecord__c != 'SIS'&&WorkRecord__c != '绉戝浼�'){
if (WorkRecord__c == '涓村簥淇℃伅(浣跨敤閲�)鏀堕泦') {
- if (
- warlocksNumber__c == '' ||
- warlocksNumber__c == '' ||
- warlocksNumber__c == undefined
- ) {
- error.push('浜у搧鐢ㄩ噺 涓嶈兘涓虹┖');
- }
+ if (warlocksNumber__c == '' || warlocksNumber__c == "" || warlocksNumber__c == undefined) { error.push("浜у搧鐢ㄩ噺 涓嶈兘涓虹┖"); }
}
//fy end
if (WorkRecord__c == '涓村簥淇℃伅(浣跨敤閲�)鏀堕泦' && UserProType == 'ENG') {
- if (
- productCategories__c == '' ||
- productCategories__c == '' ||
- productCategories__c == undefined
- ) {
- error.push('鍏朵粬鍝佺墝浜у搧绫诲埆 涓嶅瓨鍦�');
- }
+ if (productCategories__c == '' || productCategories__c == "" || productCategories__c == undefined) { error.push("鍏朵粬鍝佺墝浜у搧绫诲埆 涓嶅瓨鍦�"); }
}
if (WorkRecord__c == '涓村簥淇℃伅(浣跨敤閲�)鏀堕泦') {
- if (
- ProductCcategory__c == '' ||
- ProductCcategory__c == '' ||
- ProductCcategory__c == undefined
- ) {
- error.push('宸查噰鐢ㄥ叾浠栧搧鐗� 涓嶅瓨鍦�');
- }
+ if (ProductCcategory__c == '' || ProductCcategory__c == "" || ProductCcategory__c == undefined) { error.push("宸查噰鐢ㄥ叾浠栧搧鐗� 涓嶅瓨鍦�"); }
}
if (WorkRecord__c == '涓村簥淇℃伅(浣跨敤閲�)鏀堕泦') {
- if (
- WarlockClassification__c == '' ||
- WarlockClassification__c == '' ||
- WarlockClassification__c == undefined
- ) {
- error.push('浜у搧1瀵瑰簲OLY浜у搧绾� 涓嶅瓨鍦�');
- }
+ if (WarlockClassification__c == '' || WarlockClassification__c == "" || WarlockClassification__c == undefined) { error.push("浜у搧1瀵瑰簲OLY浜у搧绾� 涓嶅瓨鍦�"); }
}
if (WorkRecord__c == '涓村簥淇℃伅(浣跨敤閲�)鏀堕泦') {
- if (
- ConsumptionOfConsumables__c == '' ||
- ConsumptionOfConsumables__c == '' ||
- ConsumptionOfConsumables__c == undefined
- ) {
- error.push('浜у搧1鍚岀被鑰楁潗绉戝鏈堜娇鐢ㄩ噺 涓嶈兘涓虹┖');
- }
+ if (ConsumptionOfConsumables__c == '' || ConsumptionOfConsumables__c == "" || ConsumptionOfConsumables__c == undefined) { error.push("浜у搧1鍚岀被鑰楁潗绉戝鏈堜娇鐢ㄩ噺 涓嶈兘涓虹┖"); }
}
- if (
- WorkRecord__c != '涓村簥淇℃伅(浣跨敤閲�)鏀堕泦' &&
- WorkRecord__c != '甯傚満鎺ㄥ箍绫绘椿鍔�'
- ) {
- if (
- EffectProgress__c == '' ||
- EffectProgress__c == '' ||
- EffectProgress__c == undefined
- ) {
- error.push('鏁堟灉/杩涘害 涓嶅瓨鍦�');
- }
+ if (WorkRecord__c != '涓村簥淇℃伅(浣跨敤閲�)鏀堕泦' && WorkRecord__c != '甯傚満鎺ㄥ箍绫绘椿鍔�') {
+ if (EffectProgress__c == '' || EffectProgress__c == "" || EffectProgress__c == undefined) { error.push("鏁堟灉/杩涘害 涓嶅瓨鍦�"); }
}
// if(WorkRecord__c != '涓村簥淇℃伅(浣跨敤閲�)鏀堕泦'&&WorkRecord__c != 'QIS澶勭悊'){
if (WorkRecord__c != '涓村簥淇℃伅(浣跨敤閲�)鏀堕泦') {
- if (
- UseProduct1__c == '' ||
- UseProduct1__c == '' ||
- UseProduct1__c == undefined
- ) {
- error.push('浣跨敤浜у搧1(浜у搧鍨嬪彿) 涓嶅瓨鍦�');
- }
+ if (UseProduct1__c == '' || UseProduct1__c == "" || UseProduct1__c == undefined) { error.push("浣跨敤浜у搧1(浜у搧鍨嬪彿) 涓嶅瓨鍦�"); }
}
- if (
- ProductClassification__c == '' ||
- ProductClassification__c == '' ||
- ProductClassification__c == undefined
- ) {
- error.push('浜у搧鍒嗙被(绗笁鍒嗙被) 涓嶅瓨鍦�');
+ if (ProductClassification__c == '' || ProductClassification__c == "" || ProductClassification__c == undefined) { error.push("浜у搧鍒嗙被(绗笁鍒嗙被) 涓嶅瓨鍦�"); }
+ if (WorkRecord__c == 'SIS' || WorkRecord__c == '绉戝浼�' || WorkRecord__c == '闄㈠唴鍏ラ櫌鐢宠' || WorkRecord__c == '鏀惰垂椤圭洰鐢宠') {
+ if (doctor2__c == '' || doctor2__c == "" || doctor2__c == undefined) { error.push("鎷滆浜� 涓嶅瓨鍦�"); }
}
- if (
- WorkRecord__c == 'SIS' ||
- WorkRecord__c == '绉戝浼�' ||
- WorkRecord__c == '闄㈠唴鍏ラ櫌鐢宠' ||
- WorkRecord__c == '鏀惰垂椤圭洰鐢宠'
- ) {
- if (
- doctor2__c == '' ||
- doctor2__c == '' ||
- doctor2__c == undefined
- ) {
- error.push('鎷滆浜� 涓嶅瓨鍦�');
- }
- }
- if (
- WorkRecord__c == '' ||
- WorkRecord__c == '' ||
- WorkRecord__c == undefined
- ) {
- error.push('娲诲姩鍖哄垎 涓嶅瓨鍦�');
- }
- if (
- DealerPersonnel__c == '' ||
- DealerPersonnel__c == '' ||
- DealerPersonnel__c == undefined
- ) {
- error.push('缁忛攢鍟嗕汉鍛� 涓嶅瓨鍦�');
- }
- if (
- Department_Cateogy__c == '' ||
- Department_Cateogy__c == '' ||
- Department_Cateogy__c == undefined
- ) {
- error.push('绉戝 涓嶅瓨鍦�');
- }
- if (
- Agency_Hospital__c == '' ||
- Agency_Hospital__c == '' ||
- Agency_Hospital__c == undefined
- ) {
- error.push('鍖婚櫌 涓嶅瓨鍦�');
- }
+ if (WorkRecord__c == '' || WorkRecord__c == "" || WorkRecord__c == undefined) { error.push("娲诲姩鍖哄垎 涓嶅瓨鍦�"); }
+ if (DealerPersonnel__c == '' || DealerPersonnel__c == "" || DealerPersonnel__c == undefined) { error.push("缁忛攢鍟嗕汉鍛� 涓嶅瓨鍦�"); }
+ if (Department_Cateogy__c == '' || Department_Cateogy__c == "" || Department_Cateogy__c == undefined) { error.push("绉戝 涓嶅瓨鍦�"); }
+ if (Agency_Hospital__c == '' || Agency_Hospital__c == "" || Agency_Hospital__c == undefined) { error.push("鍖婚櫌 涓嶅瓨鍦�"); }
- if (
- Report_Date__c == '' ||
- Report_Date__c == '' ||
- Report_Date__c == undefined
- ) {
- error.push('娲诲姩鏃� 涓嶅瓨鍦�');
- }
- if (
- Submit_date__c == '' ||
- Submit_date__c == '' ||
- Submit_date__c == undefined
- ) {
- error.push('鍛� 涓嶅瓨鍦�');
- }
+
+
+
+ if (Report_Date__c == '' || Report_Date__c == "" || Report_Date__c == undefined) { error.push("娲诲姩鏃� 涓嶅瓨鍦�"); }
+ if (Submit_date__c == '' || Submit_date__c == "" || Submit_date__c == undefined) { error.push("鍛� 涓嶅瓨鍦�"); }
var rDate = new Date(Report_Date__c);
var sDate = new Date(Submit_date__c);
sDate.setDate(sDate.getDate() - 1);
- if (rDate < sDate) {
- error.push('娲诲姩鏃ュ繀椤绘槸鏈懆锛�');
- }
+ if (rDate < sDate) { error.push('娲诲姩鏃ュ繀椤绘槸鏈懆锛�'); }
sDate.setDate(sDate.getDate() + 7);
- if (rDate >= sDate) {
- error.push('娲诲姩鏃ュ繀椤绘槸鏈懆锛�');
- }
- if (
- Person_In_Charge2__c == '' ||
- Person_In_Charge2__c == '' ||
- Person_In_Charge2__c == undefined
- ) {
- error.push('鎷呭綋 涓嶅瓨鍦�');
- }
- if (
- Agency_Report_Header__c == '' ||
- Agency_Report_Header__c == '' ||
- Agency_Report_Header__c == undefined
- ) {
- this.error('Report Header Id 涓嶅瓨鍦�');
- }
+ if (rDate >= sDate) { error.push('娲诲姩鏃ュ繀椤绘槸鏈懆锛�'); }
+ if (Person_In_Charge2__c == '' || Person_In_Charge2__c == "" || Person_In_Charge2__c == undefined) { error.push("鎷呭綋 涓嶅瓨鍦�"); }
+ if (Agency_Report_Header__c == '' || Agency_Report_Header__c == "" || Agency_Report_Header__c == undefined) { this.error("Report Header Id 涓嶅瓨鍦�"); }
- // if (!UseProduct2__c) { error.push("浣跨敤浜у搧2 涓嶅瓨鍦�"); }
- // if (!UseProduct3__c) { error.push("浣跨敤浜у搧3 涓嶅瓨鍦�"); }
+
+ // if (!UseProduct2__c) { error.push("浣跨敤浜у搧2 涓嶅瓨鍦�"); }
+ // if (!UseProduct3__c) { error.push("浣跨敤浜у搧3 涓嶅瓨鍦�"); }
+
+
+
+
+
+
+
// if (!productCategories__c) { error.push("鍏朵粬鍝佺墝浜у搧绫诲埆 涓嶅瓨鍦�"); }
@@ -1660,68 +1065,55 @@
var Agency_Report__c = component.get('v.select_report_data').Id;
var action = component.get('c.editAgencyReport');
action.setParams({
- Agency_Report_Id: Agency_Report__c,
- Department_Cateogy: Department_Cateogy__c,
- ConsumptionOfConsumables: ConsumptionOfConsumables__c,
- WorkRecord: WorkRecord__c,
- EffectProgress: EffectProgress__c,
- WarlockClassification: WarlockClassification__c,
- ProductCcategory: ProductCcategory__c,
- productCategories: productCategories__c,
- warlocksNumber: warlocksNumber__c,
- WorkMark: WorkMark__c,
- ProductClassification: ProductClassification__c,
- DealerPersonnel: DealerPersonnel__c,
- Agency_Report_Header: Agency_Report_Header__c,
- Agency_Hospital: Agency_Hospital__c,
- UseProduct1: UseProduct1__c,
- UseProduct2: UseProduct2__c,
- UseProduct3: UseProduct3__c,
- Person_In_Charge2: Person_In_Charge2__c,
- doctor: doctor2__c,
- Submit_date: Submit_date__c,
- StageName: StageName__c,
- oppAmount: Amount__c,
- oppOCMPrice: OCMSale_Price__c,
- Close_Forecasted_Date: Close_Forecasted_Date__c,
- Report_Date: Report_Date__c
+ "Agency_Report_Id": Agency_Report__c,
+ "Department_Cateogy": Department_Cateogy__c,
+ "ConsumptionOfConsumables": ConsumptionOfConsumables__c,
+ "WorkRecord": WorkRecord__c,
+ "EffectProgress": EffectProgress__c,
+ "WarlockClassification": WarlockClassification__c,
+ "ProductCcategory": ProductCcategory__c,
+ "productCategories": productCategories__c,
+ "warlocksNumber": warlocksNumber__c,
+ "WorkMark": WorkMark__c,
+ "ProductClassification": ProductClassification__c,
+ "DealerPersonnel": DealerPersonnel__c,
+ "Agency_Report_Header": Agency_Report_Header__c,
+ "Agency_Hospital": Agency_Hospital__c,
+ "UseProduct1": UseProduct1__c,
+ "UseProduct2": UseProduct2__c,
+ "UseProduct3": UseProduct3__c,
+ "Person_In_Charge2": Person_In_Charge2__c,
+ "doctor": doctor2__c,
+ "Submit_date": Submit_date__c,
+ "StageName": StageName__c,
+ "oppAmount": Amount__c,
+ "oppOCMPrice": OCMSale_Price__c,
+ "Close_Forecasted_Date": Close_Forecasted_Date__c,
+ "Report_Date": Report_Date__c
});
action.setCallback(this, function (response) {
var state = response.getState();
if (state == 'SUCCESS') {
- debugger;
+ debugger
component.set('v.successMessage', '缂栬緫淇濆瓨鎴愬姛');
this.showSuccessToast(component);
var report_id = response.getReturnValue();
component.set('v.create_agency_report_id', report_id);
- var select_agency_list =
- component.get('v.allselectlist').AgencyPerson__c;
+ var select_agency_list = component.get('v.allselectlist').AgencyPerson__c;
for (var i = 0; i < select_agency_list.length; i++) {
- if (
- select_agency_list[i].value ==
- component.get('v.select_report_data')
- .Person_In_Charge2__c
- ) {
+ if (select_agency_list[i].value == component.get('v.select_report_data').Person_In_Charge2__c) {
select_agency_list[i].selected = true;
} else {
select_agency_list[i].selected = false;
}
}
- component
- .find('select_agency_person')
- .set('v.options', select_agency_list);
+ component.find('select_agency_person').set('v.options', select_agency_list);
component.set('v.update_select_report_data_id', report_id);
- this.get_reports(
- component,
- event,
- helper,
- component.get('v.select_report_data').Submit_date__c,
- component.get('v.select_report_data')
- .Person_In_Charge2__c
- );
+ this.get_reports(component, event, helper, component.get('v.select_report_data').Submit_date__c, component.get('v.select_report_data').Person_In_Charge2__c);
component.find('save_button').set('v.disabled', false);
component.set('v.loginEdit', false);
- } else {
+ }
+ else {
//component.set('v.errorMessage', 'save_report failed.');
this.error('淇濆瓨鏃ユ姤澶辫触');
//this.showErrorToast(component);
@@ -1734,30 +1126,30 @@
/* Save (New & Copy) */
var action = component.get('c.saveAgencyReport');
action.setParams({
- Department_Cateogy: Department_Cateogy__c,
- ConsumptionOfConsumables: ConsumptionOfConsumables__c,
- WorkMark: WorkMark__c,
- warlocksNumber: warlocksNumber__c,
- DealerPersonnel: DealerPersonnel__c,
- ProductCcategory: ProductCcategory__c,
- productCategories: productCategories__c,
- WarlockClassification: WarlockClassification__c,
- ProductClassification: ProductClassification__c,
- WorkRecord: WorkRecord__c,
- EffectProgress: EffectProgress__c,
- Agency_Report_Header: Agency_Report_Header__c,
- Agency_Hospital: Agency_Hospital__c,
- Person_In_Charge2: Person_In_Charge2__c,
- doctor: doctor2__c,
- Submit_date: Submit_date__c,
- UseProduct1: UseProduct1__c,
- UseProduct2: UseProduct2__c,
- UseProduct3: UseProduct3__c,
- StageName: StageName__c,
- oppAmount: Amount__c,
- oppOCMPrice: OCMSale_Price__c,
- Close_Forecasted_Date: Close_Forecasted_Date__c,
- Report_Date: Report_Date__c
+ "Department_Cateogy": Department_Cateogy__c,
+ "ConsumptionOfConsumables": ConsumptionOfConsumables__c,
+ "WorkMark": WorkMark__c,
+ "warlocksNumber": warlocksNumber__c,
+ "DealerPersonnel": DealerPersonnel__c,
+ "ProductCcategory": ProductCcategory__c,
+ "productCategories": productCategories__c,
+ "WarlockClassification": WarlockClassification__c,
+ "ProductClassification": ProductClassification__c,
+ "WorkRecord": WorkRecord__c,
+ "EffectProgress": EffectProgress__c,
+ "Agency_Report_Header": Agency_Report_Header__c,
+ "Agency_Hospital": Agency_Hospital__c,
+ "Person_In_Charge2": Person_In_Charge2__c,
+ "doctor": doctor2__c,
+ "Submit_date": Submit_date__c,
+ "UseProduct1": UseProduct1__c,
+ "UseProduct2": UseProduct2__c,
+ "UseProduct3": UseProduct3__c,
+ "StageName": StageName__c,
+ "oppAmount": Amount__c,
+ "oppOCMPrice": OCMSale_Price__c,
+ "Close_Forecasted_Date": Close_Forecasted_Date__c,
+ "Report_Date": Report_Date__c
});
action.setCallback(this, function (response) {
var state = response.getState();
@@ -1766,17 +1158,11 @@
this.showSuccessToast(component);
var report_id = response.getReturnValue();
component.set('v.create_agency_report_id', report_id);
- this.get_reports(
- component,
- event,
- helper,
- component.find('select_date').get('v.value'),
- component.find('select_agency_person').get('v.value')
- );
+ this.get_reports(component, event, helper, component.find('select_date').get('v.value'), component.find('select_agency_person').get('v.value'));
// 銉€兗銉�銉偊銈c兂銉夈偊鍐呫伄涓�瑕х敤
var action2 = component.get('c.getReportsById');
action2.setParams({
- report_id: report_id
+ "report_id": report_id,
});
action2.setCallback(this, function (response) {
var state = response.getState();
@@ -1784,7 +1170,7 @@
var res = response.getReturnValue();
var reports_now = component.get('v.reports_now');
var reports_now_count = 0;
- if (reports_now.length > 0 && reports_now != '') {
+ if (reports_now.length > 0 && reports_now != "") {
reports_now_count = reports_now.length;
}
// Save&New鏅傘伄銈︺偅銉炽儔銈﹀唴銉囥兗銈夸竴瑕�
@@ -1796,20 +1182,15 @@
return 0;
});
component.set('v.reports_now', reports_now);
- component.set(
- 'v.reports_now_count',
- reports_now.length
- );
- var data_list =
- component.find('modal_data_list_tr');
+ component.set('v.reports_now_count', reports_now.length);
+ var data_list = component.find('modal_data_list_tr');
}
- } else {
+ }
+ else {
// component.set('v.errorMessage', 'get_reports_now failed.');
this.error('get_reports_now failed.');
//this.showErrorToast(component);
- component
- .find('save_button')
- .set('v.disabled', false);
+ component.find('save_button').set('v.disabled', false);
component.set('v.loginEdit', false);
}
});
@@ -1818,9 +1199,10 @@
component.find('select_WorkMark').set('v.value', false);
component.find('save_button').set('v.disabled', false);
component.set('v.loginEdit', false);
- debugger;
+ debugger
this.doinitSave(component, event, helper);
- } else {
+ }
+ else {
var error = response.getError();
//component.set('v.errorMessage', '淇濆瓨鏃ユ姤澶辫触');
this.error('淇濆瓨鏃ユ姤澶辫触');
@@ -1851,23 +1233,9 @@
component.find('select_WorkMark').set('v.checked', false);
component.find('new_con').set('v.disabled', true);
component.find('select_doctor').set('v.options', clear);
- component
- .find('select_DealerPersonnel')
- .set(
- 'v.options',
- this.conv_selected(
- component.get('v.allselectlist.DealerPersonnel__c')
- )
- );
- component
- .find('select_purpose_type')
- .set(
- 'v.options',
- this.conv_selected(
- component.get('v.allselectlist.WorkRecord__c')
- )
- );
- // component.find('select_ProductCcategory').set('v.options', this.conv_selected(component.get('v.allselectlist.ProductCcategory__c')));
+ component.find('select_DealerPersonnel').set('v.options', this.conv_selected(component.get('v.allselectlist.DealerPersonnel__c')));
+ component.find('select_purpose_type').set('v.options', this.conv_selected(component.get('v.allselectlist.WorkRecord__c')));
+ // component.find('select_ProductCcategory').set('v.options', this.conv_selected(component.get('v.allselectlist.ProductCcategory__c')));
component.find('select_EffectProgress').set('v.value', '');
component.find('select_OtherBrandConsumables').set('v.value', '');
component.find('select_ProductCcategory').set('v.value', '');
@@ -1882,18 +1250,9 @@
component.set('v.Amount__c_o', '');
component.set('v.OCMSale_Price__c_o', '');
component.set('v.StageName__c_o', '');
- $A.util.addClass(
- component.find('input-opportunity-stage'),
- 'disp_none'
- );
- $A.util.addClass(
- component.find('input-opportunity-amount1'),
- 'disp_none'
- );
- $A.util.addClass(
- component.find('input-opportunity-amount2'),
- 'disp_none'
- );
+ $A.util.addClass(component.find('input-opportunity-stage'), 'disp_none');
+ $A.util.addClass(component.find('input-opportunity-amount1'), 'disp_none');
+ $A.util.addClass(component.find('input-opportunity-amount2'), 'disp_none');
$A.util.addClass(component.find('input-opportunity-date'), 'disp_none');
this.selectPurposeType(component);
this.selectProductClassification(component);
@@ -1904,95 +1263,29 @@
var ret_obj = [];
var now = new Date();
for (var i = 0; i < count; i++) {
- var start_day = new Date(
- now.getFullYear(),
- now.getMonth(),
- now.getDate() - now.getDay() + 1 - i * 7
- );
- var end_day = new Date(
- now.getFullYear(),
- now.getMonth(),
- now.getDate() + (7 - now.getDay()) - i * 7
- );
- var start_day_show = new Date(
- now.getFullYear(),
- now.getMonth(),
- now.getDate() - now.getDay() - i * 7
- );
- var end_day_show = new Date(
- now.getFullYear(),
- now.getMonth(),
- now.getDate() + (6 - now.getDay()) - i * 7
- );
- var date_text =
- start_day.getFullYear() +
- '/' +
- (start_day.getMonth() + 1) +
- '/' +
- start_day.getDate() +
- '~' +
- end_day.getFullYear() +
- '/' +
- (end_day.getMonth() + 1) +
- '/' +
- end_day.getDate();
+ var start_day = new Date(now.getFullYear(), now.getMonth(), (now.getDate() - now.getDay() + 1 - (i * 7)));
+ var end_day = new Date(now.getFullYear(), now.getMonth(), now.getDate() + (7 - now.getDay()) - (i * 7));
+ var start_day_show = new Date(now.getFullYear(), now.getMonth(), (now.getDate() - now.getDay() - (i * 7)));
+ var end_day_show = new Date(now.getFullYear(), now.getMonth(), now.getDate() + (6 - now.getDay()) - (i * 7));
+ var date_text = start_day.getFullYear() + '/' + (start_day.getMonth() + 1) + '/' + start_day.getDate() + '~' + end_day.getFullYear() + '/' + (end_day.getMonth() + 1) + '/' + end_day.getDate();
if (i == 0) {
ret_obj.push({
selected: true,
- value:
- start_day.getFullYear() +
- '/' +
- (start_day.getMonth() + 1) +
- '/' +
- start_day.getDate(),
- label:
- start_day_show.getFullYear() +
- '/' +
- (start_day_show.getMonth() + 1) +
- '/' +
- start_day_show.getDate() +
- '~' +
- end_day_show.getFullYear() +
- '/' +
- (end_day_show.getMonth() + 1) +
- '/' +
- end_day_show.getDate()
+ value: start_day.getFullYear() + '/' + (start_day.getMonth() + 1) + '/' + start_day.getDate(),
+ label: start_day_show.getFullYear() + '/' + (start_day_show.getMonth() + 1) + '/' + start_day_show.getDate() + '~' + end_day_show.getFullYear() + '/' + (end_day_show.getMonth() + 1) + '/' + end_day_show.getDate(),
});
} else {
ret_obj.push({
selected: false,
- value:
- start_day.getFullYear() +
- '/' +
- (start_day.getMonth() + 1) +
- '/' +
- start_day.getDate(),
- label:
- start_day_show.getFullYear() +
- '/' +
- (start_day_show.getMonth() + 1) +
- '/' +
- start_day_show.getDate() +
- '~' +
- end_day_show.getFullYear() +
- '/' +
- (end_day_show.getMonth() + 1) +
- '/' +
- end_day_show.getDate()
+ value: start_day.getFullYear() + '/' + (start_day.getMonth() + 1) + '/' + start_day.getDate(),
+ label: start_day_show.getFullYear() + '/' + (start_day_show.getMonth() + 1) + '/' + start_day_show.getDate() + '~' + end_day_show.getFullYear() + '/' + (end_day_show.getMonth() + 1) + '/' + end_day_show.getDate(),
});
}
}
component.find('select_date').set('v.options', ret_obj);
component.set('v.report_date_list', ret_obj);
},
- create_report_header: function (
- component,
- event,
- helper,
- name,
- s_agency,
- s_date
- ) {
+ create_report_header: function (component, event, helper, name, s_agency, s_date) {
s_date = this.get_date_string(s_date);
if (s_date == false) {
//component.set('v.errorMessage', 'get_date_string failed.');
@@ -2011,10 +1304,10 @@
var key2 = s_date.replace(/-/g, '');
var action = component.get('c.createReportHeader');
action.setParams({
- name: name,
- s_date: s_date,
- s_agency: s_agency,
- head_key: head_key
+ "name": name,
+ "s_date": s_date,
+ "s_agency": s_agency,
+ "head_key": head_key,
});
component.set('v.login', true);
action.setCallback(this, function (response) {
@@ -2024,7 +1317,8 @@
component.set('v.agency_report_header_id', res);
component.set('v.login', false);
this.toggle_report(component, event, helper);
- } else {
+ }
+ else {
//component.set('v.errorMessage', 'createReportHeader callback failed.');
this.error('createReportHeader callback failed.');
//this.showErrorToast(component);
@@ -2033,14 +1327,8 @@
});
$A.enqueueAction(action);
},
- create_report_header_edit: function (
- component,
- event,
- helper,
- name,
- s_agency,
- s_date
- ) {
+ create_report_header_edit: function (component, event, helper, name, s_agency, s_date) {
+
s_date = this.get_date_string(s_date);
if (s_date == false) {
//component.set('v.errorMessage', 'get_date_string failed.');
@@ -2058,14 +1346,14 @@
}
var key2 = s_date.replace(/-/g, '');
var action = component.get('c.createReportHeader');
-
+
action.setParams({
- name: name,
- s_date: s_date,
- s_agency: s_agency,
- head_key: head_key
+ "name": name,
+ "s_date": s_date,
+ "s_agency": s_agency,
+ "head_key": head_key,
});
- component.set('v.login', true);
+ component.set('v.login',true);
action.setCallback(this, function (response) {
var state = response.getState();
if (state == 'SUCCESS') {
@@ -2073,7 +1361,8 @@
component.set('v.agency_report_header_id', res);
component.set('v.login', false);
this.toggle_report_edit(component, event, helper);
- } else {
+ }
+ else {
//component.set('v.errorMessage', 'createReportHeader callback failed.');
this.error('createReportHeader callback failed.');
//this.showErrorToast(component);
@@ -2083,7 +1372,7 @@
$A.enqueueAction(action);
},
create_header_input_key: function (agency_id, s_date) {
- if (typeof s_date != 'string') {
+ if (typeof (s_date) != 'string') {
s_date = this.get_date_string(s_date);
if (s_date == false) {
//component.set('v.errorMessage', 'get_date_string in create_header_input_key.');
@@ -2096,7 +1385,7 @@
return false;
}
s_date = s_date.replace(/-/g, '');
- var headkey = agency_id + ':' + s_date;
+ var headkey = agency_id + ":" + s_date;
return headkey;
},
@@ -2109,7 +1398,7 @@
},
// create yyyy-mm-dd string
get_date_string: function (val) {
- if (typeof val == 'string') {
+ if (typeof (val) == 'string') {
if (val.match(/^\d{4}\/\d{1,2}\/\d{1,2}$/)) {
val = val.replace(/[\/]/g, '-');
var tmp = val.split('-');
@@ -2144,14 +1433,14 @@
},
// Controller 鏍规嵁椤甸潰鍖婚櫌鏌ヨ绗﹀悎鐨勫尰闄�
searchHos: function (component, event, helper) {
- var hospital_name = event.getParam('value');
- var action = component.get('c.getHospitalList');
+ var hospital_name = event.getParam("value");
+ var action = component.get("c.getHospitalList");
action.setParams({
- hospital_name: hospital_name
+ "hospital_name": hospital_name
});
action.setCallback(this, function (response) {
var state = response.getState();
- if (state === 'SUCCESS') {
+ if (state === "SUCCESS") {
var hospital_list = component.find('hospital_list');
var hosList = response.getReturnValue();
if (hosList.length > 0) {
@@ -2159,7 +1448,7 @@
} else {
$A.util.removeClass(hospital_list, 'slds-is-open');
}
- component.set('v.hospitalList', response.getReturnValue());
+ component.set("v.hospitalList", response.getReturnValue());
} else {
$A.util.removeClass(hospital_list, 'slds-is-open');
}
@@ -2173,57 +1462,52 @@
hideSearchs: function (component, event, helper) {
var hospital_list = component.find('hospital_list');
$A.util.removeClass(hospital_list, 'slds-is-open');
- component.set('v.hospital', '');
- component.set('v.hospitals', '');
+ component.set("v.hospital", '');
+ component.set("v.hospitals", '');
component.set('v.hospitalLinkId', '');
component.set('v.data.Agency_Hospital__c', '');
- component.set('v.hospitalId', '');
+ component.set("v.hospitalId", '');
},
selectHos: function (component, event, helper) {
+
var hospital_list = component.find('hospital_list');
$A.util.removeClass(hospital_list, 'slds-is-open');
var accname = event.currentTarget.dataset.accname;
var accid = event.currentTarget.dataset.accid;
var hospital_data = component.get('v.hospitalList');
- var select_purpose_type = component
- .find('select_purpose_type')
- .get('v.value');
+ var select_purpose_type = component.find('select_purpose_type').get('v.value');
for (var i = 0; i < hospital_data.length; i++) {
if (hospital_data[i].Hospital__c == accid) {
component.set('v.hospitalLinkId', hospital_data[i].Id);
component.set('v.data.Agency_Hospital__c', hospital_data[i].Id);
- if (
- select_purpose_type != '绉戝浼�' &&
- hospital_data[i].Hospital__c
- ) {
+ if (select_purpose_type != '绉戝浼�' && hospital_data[i].Hospital__c) {
component.find('new_con').set('v.disabled', false);
} else {
component.find('new_con').set('v.disabled', true);
}
}
}
- component.set('v.hospitals', accname);
- component.set('v.hospital', accname);
- component.set('v.hospitalId', accid);
-
+ component.set("v.hospitals", accname);
+ component.set("v.hospital", accname);
+ component.set("v.hospitalId", accid);
+
component.set('v.setdoctorlisthos', true);
this.set_doctor_list_edit(component, event, helper);
},
+
//妯$硦鏌ヨ浣跨敤浜у搧1(浜у搧鍨嬪彿)
searchUseProduct1: function (component, event, helper) {
- var UseProduct1Name = event.getParam('value');
- var select_ProductClassification = component
- .find('select_ProductClassification')
- .get('v.value');
- var action = component.get('c.getUseProduct1');
+ var UseProduct1Name = event.getParam("value");
+ var select_ProductClassification = component.find('select_ProductClassification').get('v.value');
+ var action = component.get("c.getUseProduct1");
action.setParams({
- UseProduct1Name: UseProduct1Name,
- select_ProductClassification: select_ProductClassification
+ "UseProduct1Name": UseProduct1Name,
+ "select_ProductClassification": select_ProductClassification
});
action.setCallback(this, function (response) {
var state = response.getState();
- if (state === 'SUCCESS') {
+ if (state === "SUCCESS") {
var UseProduct1_List = component.find('UseProduct1_List');
var UseProduct1ListValue = response.getReturnValue();
if (UseProduct1ListValue.length > 0) {
@@ -2231,7 +1515,7 @@
} else {
$A.util.removeClass(UseProduct1_List, 'slds-is-open');
}
- component.set('v.UseProduct1List', UseProduct1ListValue);
+ component.set("v.UseProduct1List", UseProduct1ListValue);
} else {
$A.util.removeClass(UseProduct1_List, 'slds-is-open');
}
@@ -2245,12 +1529,13 @@
hideSearchUseProduct1s: function (component, event, helper) {
var UseProduct1_List = component.find('UseProduct1_List');
$A.util.removeClass(UseProduct1_List, 'slds-is-open');
- component.set('v.UseProduct1', '');
- component.set('v.UseProduct1s', '');
+ component.set("v.UseProduct1", '');
+ component.set("v.UseProduct1s", '');
component.set('v.UseProduct1Id', '');
component.set('v.data.UseProduct1__c', '');
},
seletUseProduct1Change: function (component, event, helper) {
+
var UseProduct1_List = component.find('UseProduct1_List');
$A.util.removeClass(UseProduct1_List, 'slds-is-open');
var accname = event.currentTarget.dataset.accname;
@@ -2259,21 +1544,14 @@
for (var i = 0; i < UseProduct1ListDate.length; i++) {
if (UseProduct1ListDate[i].Id == accid) {
component.set('v.UseProduct1Id', UseProduct1ListDate[i].Id);
- component.set(
- 'v.data.UseProduct1__c',
- UseProduct1ListDate[i].Id
- );
+ component.set('v.data.UseProduct1__c', UseProduct1ListDate[i].Id);
}
}
- var UseProduct2_TEXT = component
- .find('UseProduct2_TEXT')
- .get('v.value');
- var UseProduct3_TEXT = component
- .find('UseProduct3_TEXT')
- .get('v.value');
+ var UseProduct2_TEXT = component.find('UseProduct2_TEXT').get('v.value');
+ var UseProduct3_TEXT = component.find('UseProduct3_TEXT').get('v.value');
if (UseProduct2_TEXT != accname && UseProduct3_TEXT != accname) {
- component.set('v.UseProduct1s', accname);
- component.set('v.UseProduct1', accname);
+ component.set("v.UseProduct1s", accname);
+ component.set("v.UseProduct1", accname);
} else {
//component.set('v.errorMessage', '涓嶈兘閫夋嫨鍚屾牱鐨勪骇鍝�');
this.error('涓嶈兘閫夋嫨鍚屾牱鐨勪骇鍝�');
@@ -2282,18 +1560,16 @@
},
//妯$硦鏌ヨ浣跨敤浜у搧2
searchUseProduct2: function (component, event, helper) {
- var UseProduct2Name = event.getParam('value');
- var select_ProductClassification = component
- .find('select_ProductClassification')
- .get('v.value');
- var action = component.get('c.getUseProduct1');
+ var UseProduct2Name = event.getParam("value");
+ var select_ProductClassification = component.find('select_ProductClassification').get('v.value');
+ var action = component.get("c.getUseProduct1");
action.setParams({
- UseProduct1Name: UseProduct2Name,
- select_ProductClassification: select_ProductClassification
+ "UseProduct1Name": UseProduct2Name,
+ "select_ProductClassification": select_ProductClassification
});
action.setCallback(this, function (response) {
var state = response.getState();
- if (state === 'SUCCESS') {
+ if (state === "SUCCESS") {
var UseProduct2_List = component.find('UseProduct2_List');
var UseProduct2List = response.getReturnValue();
if (UseProduct2List.length > 0) {
@@ -2301,7 +1577,7 @@
} else {
$A.util.removeClass(UseProduct2_List, 'slds-is-open');
}
- component.set('v.UseProduct2List', response.getReturnValue());
+ component.set("v.UseProduct2List", response.getReturnValue());
} else {
$A.util.removeClass(UseProduct2_List, 'slds-is-open');
}
@@ -2315,8 +1591,8 @@
hideSearchUseProduct2s: function (component, event, helper) {
var UseProduct2_List = component.find('UseProduct2_List');
$A.util.removeClass(UseProduct2_List, 'slds-is-open');
- component.set('v.UseProduct2', '');
- component.set('v.UseProduct2s', '');
+ component.set("v.UseProduct2", '');
+ component.set("v.UseProduct2s", '');
component.set('v.UseProduct2Id', '');
component.set('v.data.UseProduct2__c', '');
},
@@ -2329,41 +1605,33 @@
for (var i = 0; i < UseProduct2ListDate.length; i++) {
if (UseProduct2ListDate[i].Id == accid) {
component.set('v.UseProduct2Id', UseProduct2ListDate[i].Id);
- component.set(
- 'v.data.UseProduct2__c',
- UseProduct2ListDate[i].Id
- );
+ component.set('v.data.UseProduct2__c', UseProduct2ListDate[i].Id);
}
}
- var UseProduct1_TEXT = component
- .find('UseProduct1_TEXT')
- .get('v.value');
- var UseProduct3_TEXT = component
- .find('UseProduct3_TEXT')
- .get('v.value');
+ var UseProduct1_TEXT = component.find('UseProduct1_TEXT').get('v.value');
+ var UseProduct3_TEXT = component.find('UseProduct3_TEXT').get('v.value');
if (UseProduct1_TEXT != accname && UseProduct3_TEXT != accname) {
- component.set('v.UseProduct2s', accname);
- component.set('v.UseProduct2', accname);
+ component.set("v.UseProduct2s", accname);
+ component.set("v.UseProduct2", accname);
} else {
//component.set('v.errorMessage', '涓嶈兘閫夋嫨鍚屾牱鐨勪骇鍝�');
this.error('涓嶈兘閫夋嫨鍚屾牱鐨勪骇鍝�');
//this.showErrorToast(component);
}
+
},
//妯$硦鏌ヨ浣跨敤浜у搧3
searchUseProduct3: function (component, event, helper) {
- var UseProduct3Name = event.getParam('value');
- var select_ProductClassification = component
- .find('select_ProductClassification')
- .get('v.value');
- var action = component.get('c.getUseProduct1');
+ var UseProduct3Name = event.getParam("value");
+ var select_ProductClassification = component.find('select_ProductClassification').get('v.value');
+ var action = component.get("c.getUseProduct1");
action.setParams({
- UseProduct1Name: UseProduct3Name,
- select_ProductClassification: select_ProductClassification
+ "UseProduct1Name": UseProduct3Name,
+ "select_ProductClassification": select_ProductClassification
});
action.setCallback(this, function (response) {
var state = response.getState();
- if (state === 'SUCCESS') {
+ if (state === "SUCCESS") {
var UseProduct3_List = component.find('UseProduct3_List');
var UseProduct3List = response.getReturnValue();
if (UseProduct3List.length > 0) {
@@ -2371,7 +1639,7 @@
} else {
$A.util.removeClass(UseProduct3_List, 'slds-is-open');
}
- component.set('v.UseProduct3List', response.getReturnValue());
+ component.set("v.UseProduct3List", response.getReturnValue());
} else {
$A.util.removeClass(UseProduct3_List, 'slds-is-open');
}
@@ -2385,8 +1653,8 @@
hideSearchUseProduct3s: function (component, event, helper) {
var UseProduct3_List = component.find('UseProduct3_List');
$A.util.removeClass(UseProduct3_List, 'slds-is-open');
- component.set('v.UseProduct3', '');
- component.set('v.UseProduct3s', '');
+ component.set("v.UseProduct3", '');
+ component.set("v.UseProduct3s", '');
component.set('v.UseProduct3Id', '');
component.set('v.data.UseProduct3__c', '');
},
@@ -2399,29 +1667,24 @@
for (var i = 0; i < UseProduct3ListDate.length; i++) {
if (UseProduct3ListDate[i].Id == accid) {
component.set('v.UseProduct3Id', UseProduct3ListDate[i].Id);
- component.set(
- 'v.data.UseProduct3__c',
- UseProduct3ListDate[i].Id
- );
+ component.set('v.data.UseProduct3__c', UseProduct3ListDate[i].Id);
}
}
- var UseProduct1_TEXT = component
- .find('UseProduct1_TEXT')
- .get('v.value');
- var UseProduct2_TEXT = component
- .find('UseProduct2_TEXT')
- .get('v.value');
+ var UseProduct1_TEXT = component.find('UseProduct1_TEXT').get('v.value');
+ var UseProduct2_TEXT = component.find('UseProduct2_TEXT').get('v.value');
if (UseProduct1_TEXT != accname && UseProduct2_TEXT != accname) {
- component.set('v.UseProduct3s', accname);
- component.set('v.UseProduct3', accname);
+ component.set("v.UseProduct3s", accname);
+ component.set("v.UseProduct3", accname);
} else {
//component.set('v.errorMessage', '涓嶈兘閫夋嫨鍚屾牱鐨勪骇鍝�');
this.error('涓嶈兘閫夋嫨鍚屾牱鐨勪骇鍝�');
//this.showErrorToast(component);
}
+
},
//hospitalLinkId 缁忛攢鍟嗗尰闄㈢殑ID 鎷滆浜哄鍒剁殑鍦版柟
doctor_change: function (component, event, helper) {
+
var doctorurpose = component.find('select_purpose_type').get('v.value');
var doctor_value = component.find('select_doctor').get('v.value');
var doctor_list = component.get('v.doctor_list');
@@ -2432,10 +1695,7 @@
if (doctorurpose == '绉戝浼�') {
// component.set('v.doctor_title', doctor_list[i].Doctor_Division1__c);
} else {
- component.set(
- 'v.doctor_title',
- doctor_list[i].Doctor_Division1__c
- );
+ component.set('v.doctor_title', doctor_list[i].Doctor_Division1__c);
}
flg = true;
break;
@@ -2450,7 +1710,7 @@
set_aws_url: function (component, sobject) {
var action = component.get('c.getAwsurl');
action.setParams({
- sobj: sobject
+ "sobj": sobject,
});
action.setCallback(this, function (response) {
var state = response.getState();
@@ -2460,7 +1720,8 @@
component.set('v.AWSinsert', awsmap.newUrl);
component.set('v.AWSsearch', awsmap.searchUrl);
component.set('v.AWStransactionURL', awsmap.transactionURL);
- } else {
+ }
+ else {
// component.set('v.errorMessage', 'AWS url/token error.');
this.error('AWS url/token error.');
//this.showErrorToast(component);
@@ -2471,15 +1732,8 @@
$A.enqueueAction(action);
},
- insert_agencycontact: function (
- component,
- token,
- newUrl,
- payload,
- agencyHospitalid,
- helper,
- hospitalName
- ) {
+ insert_agencycontact: function (component, token, newUrl, payload, agencyHospitalid, helper, hospitalName) {
+
console.log('newUrl = ' + newUrl);
console.log('payload = ' + payload);
console.log('token = ' + token);
@@ -2490,56 +1744,42 @@
'Content-Type': 'application/json',
'pi-token': token
}
- })
- .then((data) => {
- return data.json();
- })
- .then((result) => {
- console.log('result = ' + JSON.stringify(result));
- if (result.status == '0') {
- $A.getCallback(function () {
- helper.to_agencycontact(
- component,
- result,
- agencyHospitalid
- );
- })();
- } else {
- console.log('AWS status error:' + result);
- component.set('v.login', false);
- if (result.status == '129') {
- component
- .find('OppMessage')
- .setError(
- '璇ュ鎴蜂汉鍛樺悕瀛楀凡瀛樺湪锛屽湪' +
- hospitalName +
- '鍖婚櫌锛岃淇敼'
- );
- } else {
- component
- .find('OppMessage')
- .setError('AWS insert error.');
- }
- }
- })
- .catch((error) => {
- console.log('AWS insert error:' + error);
+ }).then((data) => {
+ return data.json();
+ }).then((result) => {
+ console.log('result = ' + JSON.stringify(result));
+ if (result.status == '0') {
+ $A.getCallback(function () {
+ helper.to_agencycontact(component, result, agencyHospitalid);
+ })();
+ } else {
+ console.log('AWS status error:' + result)
component.set('v.login', false);
- component.find('OppMessage').setError('AWS insert error.');
- });
+ if (result.status == '129') {
+ component.find('OppMessage').setError('璇ュ鎴蜂汉鍛樺悕瀛楀凡瀛樺湪锛屽湪' + hospitalName + '鍖婚櫌锛岃淇敼');
+ } else {
+ component.find('OppMessage').setError('AWS insert error.');
+ }
+ }
+ }).catch(error => {
+ console.log('AWS insert error:' + error)
+ component.set('v.login', false);
+ component.find('OppMessage').setError('AWS insert error.');
+ });
+
},
to_agencycontact: function (component, result, agencyHospitalid) {
var action = component.get('c.saveAgencyContact');
action.setParams({
- name: result.object[0].name,
+ "name": result.object[0].name,
//"nameEncrypt" : result.object[0].nameEncrypt, //zhj 鏂版柟妗堟敼閫� 2023-12-21
- type: result.object[0].type,
+ "type": result.object[0].type,
//"typeEncrypt" : result.object[0].typeEncrypt, //zhj 鏂版柟妗堟敼閫� 2023-12-21
- doctorDivision1: result.object[0].doctorDivision1,
+ "doctorDivision1": result.object[0].doctorDivision1,
//"doctorDivision1Encrypt" : result.object[0].doctorDivision1Encrypt, //zhj 鏂版柟妗堟敼閫� 2023-12-21
- agencyHospitalid: agencyHospitalid,
- awsid: result.object[0].dataId
+ "agencyHospitalid": agencyHospitalid,
+ "awsid": result.object[0].dataId,
});
action.setCallback(this, function (response) {
var state = response.getState();
@@ -2547,7 +1787,7 @@
var acMap = this.conv_selected(response.getReturnValue());
console.log(acMap);
if (acMap.AgencyContactId != '') {
- //纭浜嬪姟
+ //纭浜嬪姟
var token = component.get('v.AWStoken');
var confirmUrl = component.get('v.AWStransactionURL');
@@ -2556,12 +1796,7 @@
data['sfRecordId'] = '';
data['txId'] = result.txId;
- this.to_confirm(
- component,
- token,
- confirmUrl,
- JSON.stringify(data)
- );
+ this.to_confirm(component, token, confirmUrl, JSON.stringify(data));
} else if (acMap.errormsg != '') {
// component.set('v.errorMessage', acMap.errormsg);
this.error(acMap.errormsg);
@@ -2573,7 +1808,8 @@
//this.showErrorToast(component);
component.set('v.login', false);
}
- } else {
+ }
+ else {
//component.set('v.errorMessage', 'agency contact insert error.');
this.error('agency contact insert error.');
//this.showErrorToast(component);
@@ -2591,47 +1827,40 @@
'Content-Type': 'application/json',
'pi-token': token
}
- })
- .then((data) => {
- return data.json();
- })
- .then((result) => {
- if (
- result.status == '0' &&
- result.hasOwnProperty('success') &&
- result.success
- ) {
- // component.set('v.truthy', false);
- // var modal_newAC = component.find('modal_newAC')
- // $A.util.addClass(modal_newAC, 'disp_none');
- // this.success('.瀹㈡埛浜哄憳宸插垱寤恒��');
- // this.set_doctor_list(component);
+ }).then((data) => {
+ return data.json();
+ }).then((result) => {
+ if (result.status == '0' && result.hasOwnProperty('success') && result.success) {
+ // component.set('v.truthy', false);
+ // var modal_newAC = component.find('modal_newAC')
+ // $A.util.addClass(modal_newAC, 'disp_none');
+ // this.success('.瀹㈡埛浜哄憳宸插垱寤恒��');
+ // this.set_doctor_list(component);
- component.set('v.truthy', false);
- var modal_newAC = component.find('modal_newAC');
- $A.util.addClass(modal_newAC, 'disp_none');
- component.set('v.successMessage', '.鎷滆浜哄凡鍒涘缓銆�');
- this.showSuccessToast(component);
- component.set('v.login', false);
- this.set_doctor_list_edit(component);
- } else {
- //component.set('v.errorMessage', 'AWS confirm error.');
- this.error('AWS confirm error.');
- //this.showErrorToast(component);
- component.set('v.login', false);
- }
- })
- .catch((error) => {
- // component.set('v.errorMessage', 'AWS confirm error.');
+ component.set('v.truthy', false);
+ var modal_newAC = component.find('modal_newAC')
+ $A.util.addClass(modal_newAC, 'disp_none');
+ component.set('v.successMessage', '.鎷滆浜哄凡鍒涘缓銆�');
+ this.showSuccessToast(component);
+ component.set('v.login', false);
+ this.set_doctor_list_edit(component);
+ } else {
+ //component.set('v.errorMessage', 'AWS confirm error.');
this.error('AWS confirm error.');
//this.showErrorToast(component);
component.set('v.login', false);
- });
+ }
+ }).catch(error => {
+ // component.set('v.errorMessage', 'AWS confirm error.');
+ this.error('AWS confirm error.');
+ //this.showErrorToast(component);
+ component.set('v.login', false);
+ });
},
//SWAG-CF58C3 fy end 璋冪敤pi
set_doctor_list: function (component) {
- console.log('set_doctor_list');
+ console.log('set_doctor_list')
var doctor_value = component.find('select_purpose_type').get('v.value');
var hospital_id = component.get('v.hospitalLinkId');
console.log('hospital_id = ' + hospital_id);
@@ -2643,23 +1872,21 @@
component.set('v.loginEdit', true);
var action = component.get('c.getDoctorList');
action.setParams({
- hospital_id: hospital_id
+ "hospital_id": hospital_id,
});
action.setCallback(this, function (response) {
var state = response.getState();
if (state == 'SUCCESS') {
+ ;
var res = this.conv_selected(response.getReturnValue());
//fy
- var setdoctorlisthos =
- component.get('v.setdoctorlisthos');
+ var setdoctorlisthos = component.get('v.setdoctorlisthos');
if (setdoctorlisthos) {
component.set('v.default_select_doctor_id', '');
component.set('v.setdoctorlisthos', false);
}
- //fy
- var default_doctor = component.get(
- 'v.default_select_doctor_id'
- );
+ //fy
+ var default_doctor = component.get('v.default_select_doctor_id');
if (default_doctor != '' && res.length > 0) {
var doctor_title = '';
let awsids = [];
@@ -2674,66 +1901,34 @@
awsids.push(res[i].AWS_Data_Id__c);
}
}
- component
- .find('select_doctor')
- .set('v.options', res);
+ component.find('select_doctor').set('v.options', res);
component.set('v.doctor_title', doctor_title);
- console.log('awsids = ' + JSON.stringify(awsids));
+ console.log('awsids = ' + JSON.stringify(awsids))
if (awsids.length > 0) {
let PIConfig = component.get('v.PIConfig');
- let staticResourceAgencyContact = JSON.parse(
- PIConfig.staticResourceAgencyContact
- );
- AWSService.search(
- staticResourceAgencyContact.searchUrl,
- {
- dataIds: awsids
- },
- function (data) {
- console.log(
- 'data = ' + JSON.stringify(data)
- );
- if (
- data &&
- data.object &&
- data.object.length
- ) {
- let m = {};
- for (let di in data.object) {
- if (
- data.object[di] &&
- data.object[di].dataId
- ) {
- m[data.object[di].dataId] =
- data.object[di];
- }
+ let staticResourceAgencyContact = JSON.parse(PIConfig.staticResourceAgencyContact);
+ AWSService.search(staticResourceAgencyContact.searchUrl, {
+ dataIds: awsids
+ }, function (data) {
+ console.log('data = ' + JSON.stringify(data))
+ if (data && data.object && data.object.length) {
+ let m = {};
+ for (let di in data.object) {
+ if (data.object[di] && data.object[di].dataId) {
+ m[data.object[di].dataId] = data.object[di];
}
-
- for (let ri in res) {
- if (
- res[ri] &&
- res[ri].AWS_Data_Id__c &&
- m.hasOwnProperty(
- res[ri].AWS_Data_Id__c
- )
- ) {
- res[ri].label =
- m[
- res[
- ri
- ].AWS_Data_Id__c
- ].name;
- }
- }
- component
- .find('select_doctor')
- .set('v.options', res);
}
- component.set('v.loginEdit', false);
- },
- staticResourceAgencyContact.token
- );
+ for (let ri in res) {
+ if (res[ri] && res[ri].AWS_Data_Id__c && m.hasOwnProperty(res[ri].AWS_Data_Id__c)) {
+ res[ri].label = m[res[ri].AWS_Data_Id__c].name;
+ }
+ }
+ component.find('select_doctor').set('v.options', res);
+ }
+
+ component.set('v.loginEdit', false);
+ }, staticResourceAgencyContact.token);
}
} else {
let awsids = [];
@@ -2742,75 +1937,43 @@
awsids.push(res[i].AWS_Data_Id__c);
}
}
- component
- .find('select_doctor')
- .set('v.options', res);
+ component.find('select_doctor').set('v.options', res);
if (awsids.length > 0) {
let PIConfig = component.get('v.PIConfig');
- let staticResourceAgencyContact = JSON.parse(
- PIConfig.staticResourceAgencyContact
- );
- AWSService.search(
- staticResourceAgencyContact.searchUrl,
- {
- dataIds: awsids
- },
- function (data) {
- if (
- data &&
- data.object &&
- data.object.length
- ) {
- let m = {};
- for (let di in data.object) {
- if (
- data.object[di] &&
- data.object[di].dataId
- ) {
- m[data.object[di].dataId] =
- data.object[di];
- }
+ let staticResourceAgencyContact = JSON.parse(PIConfig.staticResourceAgencyContact);
+ AWSService.search(staticResourceAgencyContact.searchUrl, {
+ dataIds: awsids
+ }, function (data) {
+ if (data && data.object && data.object.length) {
+ let m = {};
+ for (let di in data.object) {
+ if (data.object[di] && data.object[di].dataId) {
+ m[data.object[di].dataId] = data.object[di];
}
-
- for (let ri in res) {
- if (
- res[ri] &&
- res[ri].AWS_Data_Id__c &&
- m.hasOwnProperty(
- res[ri].AWS_Data_Id__c
- )
- ) {
- res[ri].label =
- m[
- res[
- ri
- ].AWS_Data_Id__c
- ].name;
- }
- }
- component
- .find('select_doctor')
- .set('v.options', res);
}
- component.set('v.loginEdit', false);
- },
- staticResourceAgencyContact.token
- );
+ for (let ri in res) {
+ if (res[ri] && res[ri].AWS_Data_Id__c && m.hasOwnProperty(res[ri].AWS_Data_Id__c)) {
+ res[ri].label = m[res[ri].AWS_Data_Id__c].name;
+ }
+ }
+ component.find('select_doctor').set('v.options', res);
+ }
+
+ component.set('v.loginEdit', false);
+ }, staticResourceAgencyContact.token);
}
// component.find('select_doctor').set('v.options', res);
if (res.length > 0) {
- component.set(
- 'v.doctor_title',
- res[0].Doctor_Division1__c
- );
+ component.set('v.doctor_title', res[0].Doctor_Division1__c);
}
}
// component.set('v.default_select_doctor_id', '');
-
+
component.set('v.doctor_list', res);
component.set('v.loginEdit', false);
- } else {
+ }
+ else {
// component.set('v.errorMessage', 'set_doctor_list failed.');
this.error('set_doctor_list failed.');
//this.showErrorToast(component);
@@ -2819,6 +1982,7 @@
});
$A.enqueueAction(action);
}
+
} else {
if (doctor_value == '绉戝浼�') {
this.set_doctor_list2(component);
@@ -2827,9 +1991,9 @@
}
}
component.set('v.loginEdit', false);
- }, //fy 20220414
+ },//fy 20220414
set_doctor_list_edit: function (component) {
- console.log('set_doctor_list');
+ console.log('set_doctor_list')
var doctor_value = component.find('select_purpose_type').get('v.value');
var hospital_id = component.get('v.hospitalLinkId');
console.log('hospital_id = ' + hospital_id);
@@ -2841,23 +2005,20 @@
component.set('v.loginEdit', true);
var action = component.get('c.getDoctorList');
action.setParams({
- hospital_id: hospital_id
+ "hospital_id": hospital_id,
});
action.setCallback(this, function (response) {
var state = response.getState();
if (state == 'SUCCESS') {
var res = this.conv_selected(response.getReturnValue());
//fy
- var setdoctorlisthos =
- component.get('v.setdoctorlisthos');
+ var setdoctorlisthos = component.get('v.setdoctorlisthos');
if (setdoctorlisthos) {
component.set('v.default_select_doctor_id', '');
component.set('v.setdoctorlisthos', false);
}
- //fy
- var default_doctor = component.get(
- 'v.default_select_doctor_id'
- );
+ //fy
+ var default_doctor = component.get('v.default_select_doctor_id');
if (default_doctor != '' && res.length > 0) {
var doctor_title = '';
let awsids = [];
@@ -2872,66 +2033,34 @@
awsids.push(res[i].AWS_Data_Id__c);
}
}
- component
- .find('select_doctor')
- .set('v.options', res);
+ component.find('select_doctor').set('v.options', res);
component.set('v.doctor_title', doctor_title);
- console.log('awsids = ' + JSON.stringify(awsids));
+ console.log('awsids = ' + JSON.stringify(awsids))
if (awsids.length > 0) {
let PIConfig = component.get('v.PIConfig');
- let staticResourceAgencyContact = JSON.parse(
- PIConfig.staticResourceAgencyContact
- );
- AWSService.search(
- staticResourceAgencyContact.searchUrl,
- {
- dataIds: awsids
- },
- function (data) {
- console.log(
- 'data = ' + JSON.stringify(data)
- );
- if (
- data &&
- data.object &&
- data.object.length
- ) {
- let m = {};
- for (let di in data.object) {
- if (
- data.object[di] &&
- data.object[di].dataId
- ) {
- m[data.object[di].dataId] =
- data.object[di];
- }
+ let staticResourceAgencyContact = JSON.parse(PIConfig.staticResourceAgencyContact);
+ AWSService.search(staticResourceAgencyContact.searchUrl, {
+ dataIds: awsids
+ }, function (data) {
+ console.log('data = ' + JSON.stringify(data))
+ if (data && data.object && data.object.length) {
+ let m = {};
+ for (let di in data.object) {
+ if (data.object[di] && data.object[di].dataId) {
+ m[data.object[di].dataId] = data.object[di];
}
-
- for (let ri in res) {
- if (
- res[ri] &&
- res[ri].AWS_Data_Id__c &&
- m.hasOwnProperty(
- res[ri].AWS_Data_Id__c
- )
- ) {
- res[ri].label =
- m[
- res[
- ri
- ].AWS_Data_Id__c
- ].name;
- }
- }
- component
- .find('select_doctor')
- .set('v.options', res);
}
- component.set('v.loginEdit', false);
- },
- staticResourceAgencyContact.token
- );
+ for (let ri in res) {
+ if (res[ri] && res[ri].AWS_Data_Id__c && m.hasOwnProperty(res[ri].AWS_Data_Id__c)) {
+ res[ri].label = m[res[ri].AWS_Data_Id__c].name;
+ }
+ }
+ component.find('select_doctor').set('v.options', res);
+ }
+
+ component.set('v.loginEdit', false);
+ }, staticResourceAgencyContact.token);
}
} else {
let awsids = [];
@@ -2940,75 +2069,43 @@
awsids.push(res[i].AWS_Data_Id__c);
}
}
- component
- .find('select_doctor')
- .set('v.options', res);
+ component.find('select_doctor').set('v.options', res);
if (awsids.length > 0) {
let PIConfig = component.get('v.PIConfig');
- let staticResourceAgencyContact = JSON.parse(
- PIConfig.staticResourceAgencyContact
- );
- AWSService.search(
- staticResourceAgencyContact.searchUrl,
- {
- dataIds: awsids
- },
- function (data) {
- if (
- data &&
- data.object &&
- data.object.length
- ) {
- let m = {};
- for (let di in data.object) {
- if (
- data.object[di] &&
- data.object[di].dataId
- ) {
- m[data.object[di].dataId] =
- data.object[di];
- }
+ let staticResourceAgencyContact = JSON.parse(PIConfig.staticResourceAgencyContact);
+ AWSService.search(staticResourceAgencyContact.searchUrl, {
+ dataIds: awsids
+ }, function (data) {
+ if (data && data.object && data.object.length) {
+ let m = {};
+ for (let di in data.object) {
+ if (data.object[di] && data.object[di].dataId) {
+ m[data.object[di].dataId] = data.object[di];
}
-
- for (let ri in res) {
- if (
- res[ri] &&
- res[ri].AWS_Data_Id__c &&
- m.hasOwnProperty(
- res[ri].AWS_Data_Id__c
- )
- ) {
- res[ri].label =
- m[
- res[
- ri
- ].AWS_Data_Id__c
- ].name;
- }
- }
- component
- .find('select_doctor')
- .set('v.options', res);
}
- component.set('v.loginEdit', false);
- },
- staticResourceAgencyContact.token
- );
+ for (let ri in res) {
+ if (res[ri] && res[ri].AWS_Data_Id__c && m.hasOwnProperty(res[ri].AWS_Data_Id__c)) {
+ res[ri].label = m[res[ri].AWS_Data_Id__c].name;
+ }
+ }
+ component.find('select_doctor').set('v.options', res);
+ }
+
+ component.set('v.loginEdit', false);
+ }, staticResourceAgencyContact.token);
}
// component.find('select_doctor').set('v.options', res);
if (res.length > 0) {
- component.set(
- 'v.doctor_title',
- res[0].Doctor_Division1__c
- );
+ component.set('v.doctor_title', res[0].Doctor_Division1__c);
}
}
// component.set('v.default_select_doctor_id', '');
-
+
component.set('v.doctor_list', res);
component.set('v.loginEdit', false);
- } else {
+ }
+ else {
// component.set('v.errorMessage', 'set_doctor_list failed.');
this.error('set_doctor_list failed.');
//this.showErrorToast(component);
@@ -3017,6 +2114,7 @@
});
$A.enqueueAction(action);
}
+
} else {
if (doctor_value == '绉戝浼�') {
this.set_doctor_list2(component);
@@ -3031,7 +2129,7 @@
var state = response.getState();
if (state == 'SUCCESS') {
var res = response.getReturnValue();
-
+
for (var i = 0; i < res.length; i++) {
if (res[i].selected == 'true') {
res[i].selected = true;
@@ -3039,7 +2137,7 @@
res[i].selected = false;
}
}
-
+
component.find('select_doctor').set('v.options', res);
var doctor3value = component.get('v.default_select_doctor_id2');
this.set_selected(component, 'select_doctor', doctor3value);
@@ -3050,21 +2148,13 @@
$A.enqueueAction(action1);
},
productcategoryChange1: function (component, event, helper) {
- var product_category_id = component
- .find('select_Product1')
- .get('v.value');
+ var product_category_id = component.find('select_Product1').get('v.value');
var pcId1 = component.find('select_Product2').get('v.value');
var pcId2 = component.find('select_Product3').get('v.value');
var p1bool = pcId1 != '' && pcId1 != null && pcId1 != undefined;
var p2bool = pcId2 != '' && pcId2 != null && pcId2 != undefined;
- var p0bool =
- product_category_id != '' &&
- product_category_id != null &&
- product_category_id != undefined;
- if (
- (p1bool && p0bool && product_category_id == pcId1) ||
- (p2bool && p0bool && product_category_id == pcId2)
- ) {
+ var p0bool = product_category_id != '' && product_category_id != null && product_category_id != undefined;
+ if ((p1bool && p0bool && product_category_id == pcId1) || (p2bool && p0bool && product_category_id == pcId2)) {
//component.set('v.errorMessage', '涓嶈兘閫夋嫨鍚屾牱鐨勪骇鍝佸尯鍒�');
this.error('涓嶈兘閫夋嫨鍚屾牱鐨勪骇鍝佸尯鍒�');
//this.showErrorToast(component);
@@ -3072,18 +2162,13 @@
}
},
productcategoryChange2: function (component, event, helper) {
- var product_category_id = component
- .find('UseProduct2_TEXT')
- .get('v.value');
+ var product_category_id = component.find('UseProduct2_TEXT').get('v.value');
var pcId1 = component.find('UseProduct1_TEXT').get('v.value');
var pcId2 = component.find('UseProduct3_TEXT').get('v.value');
var p1bool = pcId1 != '' && pcId1 != null;
var p2bool = pcId2 != '' && pcId2 != null;
var p0bool = product_category_id != '' && product_category_id != null;
- if (
- (p1bool && p0bool && product_category_id == pcId1) ||
- (p2bool && p0bool && product_category_id == pcId2)
- ) {
+ if ((p1bool && p0bool && product_category_id == pcId1) || (p2bool && p0bool && product_category_id == pcId2)) {
//component.set('v.errorMessage', '涓嶈兘閫夋嫨鍚屾牱鐨勪骇鍝佸尯鍒�');
this.error('涓嶈兘閫夋嫨鍚屾牱鐨勪骇鍝佸尯鍒�');
//this.showErrorToast(component);
@@ -3091,21 +2176,13 @@
}
},
productcategoryChange3: function (component, event, helper) {
- var product_category_id = component
- .find('select_Product3')
- .get('v.value');
+ var product_category_id = component.find('select_Product3').get('v.value');
var pcId1 = component.find('select_Product1').get('v.value');
var pcId2 = component.find('select_Product2').get('v.value');
var p1bool = pcId1 != '' && pcId1 != null && pcId1 != undefined;
var p2bool = pcId2 != '' && pcId2 != null && pcId2 != undefined;
- var p0bool =
- product_category_id != '' &&
- product_category_id != null &&
- product_category_id != undefined;
- if (
- (p1bool && p0bool && product_category_id == pcId1) ||
- (p2bool && p0bool && product_category_id == pcId2)
- ) {
+ var p0bool = product_category_id != '' && product_category_id != null && product_category_id != undefined;
+ if ((p1bool && p0bool && product_category_id == pcId1) || (p2bool && p0bool && product_category_id == pcId2)) {
//component.set('v.errorMessage', '涓嶈兘閫夋嫨鍚屾牱鐨勪骇鍝佸尯鍒�');
this.error('涓嶈兘閫夋嫨鍚屾牱鐨勪骇鍝佸尯鍒�');
//this.showErrorToast(component);
@@ -3125,6 +2202,7 @@
return obj;
},
set_selected: function (component, aura_id_name, value) {
+ ;
var select_tmp = component.find(aura_id_name).get('v.options');
if (select_tmp) {
for (var i = 0; i < select_tmp.length; i++) {
@@ -3142,51 +2220,51 @@
},
//寮瑰嚭 鎴愬姛鎻愮ず
showSuccessToast: function (component) {
+
$A.util.removeClass(component.find('successDiv'), 'slds-hide');
- window.setTimeout(
- $A.getCallback(function () {
- $A.util.addClass(component.find('successDiv'), 'slds-hide');
- }),
+ window.setTimeout($A.getCallback(function () {
+ $A.util.addClass(component.find('successDiv'), 'slds-hide');
+ }),
3000
);
},
//寮瑰嚭 鎴愬姛鎻愮ず
showSuccessToast01: function (component) {
+
$A.util.removeClass(component.find('successDiv01'), 'slds-hide');
- window.setTimeout(
- $A.getCallback(function () {
- $A.util.addClass(component.find('successDiv01'), 'slds-hide');
- }),
+ window.setTimeout($A.getCallback(function () {
+ $A.util.addClass(component.find('successDiv01'), 'slds-hide');
+ }),
3000
);
},
//寮瑰嚭 閿欒鎻愮ず
showErrorToast: function (component) {
+
$A.util.removeClass(component.find('errorDiv'), 'slds-hide');
- window.setTimeout(
- $A.getCallback(function () {
- $A.util.addClass(component.find('errorDiv'), 'slds-hide');
- }),
+ window.setTimeout($A.getCallback(function () {
+ $A.util.addClass(component.find('errorDiv'), 'slds-hide');
+ }),
3000
);
},
//寮瑰嚭 閿欒鎻愮ず
showErrorToast01: function (component) {
+
$A.util.removeClass(component.find('errorDiv01'), 'slds-hide');
- window.setTimeout(
- $A.getCallback(function () {
- $A.util.addClass(component.find('errorDiv01'), 'slds-hide');
- }),
+ window.setTimeout($A.getCallback(function () {
+ $A.util.addClass(component.find('errorDiv01'), 'slds-hide');
+ }),
6000
);
},
error: function (message) {
- var toastEvent = $A.get('e.force:showToast');
+ var toastEvent = $A.get("e.force:showToast");
toastEvent.setParams({
- title: '閿欒!',
- message: message,
- type: 'error',
- duration: 'sticky'
+ "title": "閿欒!",
+ "message": message,
+ "type": "error",
+ "duration": "sticky"
});
toastEvent.fire();
},
@@ -3196,8 +2274,8 @@
component.set('v.truthy', true);
},
hideCmp: function (component, event, helper) {
- var div1 = component.find('report');
- var div2 = component.find('report_list');
+ var div1 = component.find('report')
+ var div2 = component.find('report_list')
$A.util.addClass(div1, 'disp_none');
$A.util.addClass(div2, 'disp_none');
},
@@ -3206,7 +2284,7 @@
var displayValue = event.getParams().response.fields.Name.value;
event.setParams({});
component.set('v.truthy', false);
- var modal_newAC = component.find('modal_newAC');
+ var modal_newAC = component.find('modal_newAC')
$A.util.addClass(modal_newAC, 'disp_none');
component.set('v.successMessage', '.鎷滆浜哄凡鍒涘缓銆�');
this.showSuccessToast(component);
@@ -3214,28 +2292,24 @@
},
createCancel: function (component, event, helper) {
component.set('v.truthy', false);
- var modal_newAC = component.find('modal_newAC');
+ var modal_newAC = component.find('modal_newAC')
$A.util.addClass(modal_newAC, 'disp_none');
component.find('OppMessage').setError('');
},
//绉戝璧嬪��
setOpportunity_cfilter: function (component) {
var hosId = component.get('v.hospitalId');
- var Department_Cateogy__c = component
- .find('select_department')
- .get('v.value');
+ var Department_Cateogy__c = component.find('select_department').get('v.value');
var opportunity_cfilter = '';
if (hosId != '' && hosId != null) {
- opportunity_cfilter =
- ' Agency_Hospital__r.Hospital__c=' + "'" + hosId + "'";
+ opportunity_cfilter = ' Agency_Hospital__r.Hospital__c=' + '\'' + hosId + '\'';
}
if (Department_Cateogy__c != '' && Department_Cateogy__c != null) {
if (opportunity_cfilter != '' && opportunity_cfilter != null) {
opportunity_cfilter += ' AND ';
}
// fy Department_Cateogy_text__c
- opportunity_cfilter +=
- 'Department_Cateogy__c=' + "'" + Department_Cateogy__c + "'";
+ opportunity_cfilter += 'Department_Cateogy__c=' + '\'' + Department_Cateogy__c + '\'';
// opportunity_cfilter += 'Department_Cateogy_text__c=' + '\'' + Department_Cateogy__c + '\'';
}
component.set('v.opportunity_cfilter', opportunity_cfilter);
@@ -3258,93 +2332,73 @@
break; // noop
default:
alert('An error occurred reading this file.');
- }
- };
+ };
+ }
reader.onabort = function (e) {
alert('File read cancelled');
};
reader.onloadstart = function (e) {
- var output =
- '<ui type="disc"><li><strong>' +
- file.name +
- '</strong> (' +
- file.type +
- ')- ' +
- file.size +
- 'bytes, last modified: ' +
- file.lastModifiedDate.toLocaleDateString() +
- '</li></ui>';
- component.set('v.filename', file.name);
- component.set('v.TargetFileName', output);
+ var output = '<ui type=\"disc\"><li><strong>' + file.name + '</strong> (' + file.type + ')- ' + file.size + 'bytes, last modified: ' + file.lastModifiedDate.toLocaleDateString() + '</li></ui>';
+ component.set("v.filename", file.name);
+ component.set("v.TargetFileName", output);
};
reader.onload = function (e) {
+ ;
var data = e.target.result;
- component.set('v.fileContentData', data);
- console.log('file data' + JSON.stringify(data));
+ component.set("v.fileContentData", data);
+ console.log("file data" + JSON.stringify(data));
var allTextLines = data.split(/\r\n|\n/);
- console.log('qqqqqqqqqqqqqqqqqqq' + allTextLines);
+ console.log("qqqqqqqqqqqqqqqqqqq" + allTextLines);
var dataRows = allTextLines.length - 1;
var headers = allTextLines[0].split(',');
- var numOfRows = component.get('v.NumOfRecords');
- if (
- dataRows > numOfRows + 1 ||
- dataRows == 1 ||
- dataRows == 0
- ) {
- alert('File Rows between 1 to ' + numOfRows + ' .');
- component.set('v.showMain', true);
- } else {
+ var numOfRows = component.get("v.NumOfRecords");
+ if (dataRows > numOfRows + 1 || dataRows == 1 || dataRows == 0) {
+ alert("File Rows between 1 to " + numOfRows + " .");
+ component.set("v.showMain", true);
+ }
+ else {
var lines = [];
var filecontentdata;
- var content =
- '<table class="table slds-table slds-table--bordered slds-table--cell-buffer">';
- content += '<thead><tr class="slds-text-title--caps">';
- content +=
- '<th scope="col" style="width:100px">' +
- '琛屽彿' +
- '</th>';
+ var content = "<table class=\"table slds-table slds-table--bordered slds-table--cell-buffer\">";
+ content += "<thead><tr class=\"slds-text-title--caps\">";
+ content += '<th scope=\"col"\ style=\"width:100px">' + '琛屽彿' + '</th>';
for (i = 0; i < headers.length; i++) {
if (headers[i] == '浜у搧1鍚岀被鑰楁潗绉戝鏈堜娇鐢ㄩ噺') {
- content +=
- '<th scope="col" style="width:250px">' +
- headers[i] +
- '</th>';
+ content += '<th scope=\"col"\ style=\"width:250px"\>' + headers[i] + '</th>';
} else {
- content +=
- '<th scope="col" style="width:200px">' +
- headers[i] +
- '</th>';
+ content += '<th scope=\"col"\ style=\"width:200px"\>' + headers[i] + '</th>';
}
}
- content += '</tr></thead>';
+ content += "</tr></thead>";
for (var i = 1; i < allTextLines.length; i++) {
filecontentdata = allTextLines[i].split(',');
if (filecontentdata[0] != '') {
- content += '<tr>';
- content += '<td>' + i + '</td>';
+ content += "<tr>";
+ content += "<td>" + i + "</td>";
for (var j = 0; j < filecontentdata.length; j++) {
- content +=
- '<td>' + filecontentdata[j] + '</td>';
+ content += '<td>' + filecontentdata[j] + '</td>';
}
- content += '</tr>';
+ content += "</tr>";
}
}
- content += '</table>';
+ content += "</table>";
console.log(content);
- component.set('v.TableContent', content);
- component.set('v.showMain', false);
+ component.set("v.TableContent", content);
+ component.set("v.showMain", false);
}
- };
+ }
reader.readAsText(file, 'gb2312');
+
}
var reader = new FileReader();
- reader.onloadend = function () {};
+ reader.onloadend = function () {
+ };
reader.readAsDataURL(file);
},
// fy 璋冪敤pi鏀归�犵殑 鑾峰彇url 鍜� token鐨勬柟娉�
search_contact_url: function (component, sobject, callback) {
- var action = component.get('c.getAwsurl');
+ var action = component.get("c.getAwsurl");
action.setParams({
sobj: sobject
});
@@ -3353,7 +2407,8 @@
if (state == 'SUCCESS') {
var result = response.getReturnValue();
if (callback) callback(result);
- } else {
+ }
+ else {
//component.set('v.errorMessage', 'AWS url/token error.');
this.error('AWS url/token error.');
//this.showErrorToast01(component);
@@ -3372,119 +2427,82 @@
'Content-Type': 'application/json',
'pi-token': token
}
- })
- .then((data) => {
- return data.json();
- })
- .then((result) => {
- component.set('v.login', false);
- if (callback) callback(result);
- })
- .catch((error) => {
- console.log('AWS search error = ' + JSON.stringify(error));
- // component.set('v.errorMessage', 'AWS search error.');
- this.error('AWS search error.');
- //this.showErrorToast01(component);
- component.set('v.login', false);
- });
+ }).then((data) => {
+ return data.json();
+ }).then((result) => {
+ component.set('v.login', false);
+ if (callback) callback(result);
+ }).catch(error => {
+ console.log('AWS search error = ' + JSON.stringify(error));
+ // component.set('v.errorMessage', 'AWS search error.');
+ this.error('AWS search error.');
+ //this.showErrorToast01(component);
+ component.set('v.login', false);
+ });
},
saveRecords: function (component, event, helper) {
//component.set('v.login', true);
component.set('v.modal_import_spinner', true);
//fy 瀵煎叆 202200506 start
- var action1 = component.get('c.processDataAWSId');
+ var action1 = component.get("c.processDataAWSId");
action1.setParams({
- fileData: component.get('v.fileContentData')
+ fileData: component.get("v.fileContentData"),
});
action1.setCallback(this, function (response) {
var state = response.getState();
- if (state === 'SUCCESS') {
+ if (state === "SUCCESS") {
+
var ress = response.getReturnValue();
if (ress) {
var valur = ress.split('error1');
if (valur.length <= 1) {
var res = JSON.parse(response.getReturnValue());
-
+
var dataArr = new Array();
var dataMap = new Map();
- res.forEach((item) => {
+ res.forEach(item => {
if (item.AWS_Data_Id__c) {
dataArr.push(item.AWS_Data_Id__c);
//dataMap.set(item.AWS_Data_Id__c,item.Name_Encrypted__c); //zhj 鏂版柟妗堟敼閫� 2022-12-21
- dataMap.set(
- item.AWS_Data_Id__c,
- item.AWS_Data_Id__c
- );
+ dataMap.set(item.AWS_Data_Id__c, item.AWS_Data_Id__c);
}
});
-
+
let obj = Object.create(null);
obj['dataIds'] = dataArr;
var payload = JSON.stringify(obj);
- this.search_contact_url(
- component,
- 'Agency_Contact__c',
- (result) => {
- var token = result.token;
- var searchUrl = result.searchUrl;
- console.log('token = ' + token);
- console.log('searchUrl = ' + searchUrl);
- console.log('payload = ' + payload);
- this.search_core(
- token,
- searchUrl,
- payload,
- (result) => {
- console.log(
- 'result = ' + JSON.stringify(result)
- );
- if (result.status == '0') {
- if (
- result.object != null &&
- result.object.length != 0
- ) {
- //component.set('v.login', true);
- component.set(
- 'v.modal_import_spinner',
- true
- );
- this.saveRecordsEditFile(
- component,
- dataMap,
- result.object,
- helper
- );
- } else {
- //component.set('v.errorMessage', 'AWS 鏌ヨ鏁版嵁涓虹┖ ');
- this.error('AWS 鏌ヨ鏁版嵁涓虹┖ ');
- //this.showErrorToast01(component);
- //component.set('v.login', false);
- component.set(
- 'v.modal_import_spinner',
- false
- );
- }
- } else {
- //component.set('v.errorMessage', 'AWS search status : ' + result.status);
- this.error(
- 'AWS search status : ' +
- result.status
- );
- //this.showErrorToast01(component);
- //component.set('v.login', false);
- component.set(
- 'v.modal_import_spinner',
- false
- );
- }
- },
- component
- );
- }
- );
+ this.search_contact_url(component, 'Agency_Contact__c', (result) => {
+ var token = result.token;
+ var searchUrl = result.searchUrl;
+ console.log('token = ' + token);
+ console.log('searchUrl = ' + searchUrl);
+ console.log('payload = ' + payload);
+ this.search_core(token, searchUrl, payload, (result) => {
+ console.log('result = ' + JSON.stringify(result));
+ if (result.status == '0') {
+ if (result.object != null && result.object.length != 0) {
+ //component.set('v.login', true);
+ component.set('v.modal_import_spinner', true);
+ this.saveRecordsEditFile(component, dataMap, result.object, helper);
+ } else {
+ //component.set('v.errorMessage', 'AWS 鏌ヨ鏁版嵁涓虹┖ ');
+ this.error('AWS 鏌ヨ鏁版嵁涓虹┖ ');
+ //this.showErrorToast01(component);
+ //component.set('v.login', false);
+ component.set('v.modal_import_spinner', false);
+ }
+ } else {
+ //component.set('v.errorMessage', 'AWS search status : ' + result.status);
+ this.error('AWS search status : ' + result.status);
+ //this.showErrorToast01(component);
+ //component.set('v.login', false);
+ component.set('v.modal_import_spinner', false);
+ }
+ }, component);
+ });
} else {
//component.set('v.errorMessage', valur[1] + '\n' + "璇蜂慨鏀瑰悗閲嶆柊涓婁紶");
- this.error(valur[1] + '\n' + '璇蜂慨鏀瑰悗閲嶆柊涓婁紶');
+ this.error(valur[1] + '\n' + "璇蜂慨鏀瑰悗閲嶆柊涓婁紶");
//this.showErrorToast01(component);
//component.set('v.login', false);
component.set('v.modal_import_spinner', false);
@@ -3542,6 +2560,7 @@
// }
// });
// $A.enqueueAction(action);
+
},
saveRecordsEditFile: function (component, dataMap, searchData, helper) {
var searchDataMap = new Map();
@@ -3553,8 +2572,8 @@
}
console.log('searchDataMap=' + searchDataMap);
var error = '';
- var fileData = component.get('v.fileContentData');
- fileData = this.ToCDB(fileData); //鍏ㄨ杞崐瑙�
+ var fileData = component.get("v.fileContentData");
+ fileData = this.ToCDB(fileData);//鍏ㄨ杞崐瑙�
var files = fileData.split('\n');
var fileStr = files[0];
@@ -3565,36 +2584,21 @@
var filelist = files[i].split(',');
var fileName = filelist[5];
var WorkRecord = filelist[4];
- if (
- WorkRecord == 'SIS' ||
- WorkRecord == '闄㈠唴鍏ラ櫌鐢宠' ||
- WorkRecord == '鏀惰垂椤圭洰鐢宠' ||
- WorkRecord == '绉戝浼�'
- ) {
+ if (WorkRecord == 'SIS' || WorkRecord == '闄㈠唴鍏ラ櫌鐢宠' || WorkRecord == '鏀惰垂椤圭洰鐢宠' || WorkRecord == '绉戝浼�') {
if (fileName) {
if (WorkRecord != '绉戝浼�') {
if (searchDataMap.get(fileName.replace(' ', ''))) {
- var nameDataId = searchDataMap.get(
- fileName.replace(' ', '')
- );
+ var nameDataId = searchDataMap.get(fileName.replace(' ', ''));
if (dataMap.get(nameDataId)) {
- filelist[5] = dataMap.get(nameDataId); //zhj 鏂版柟妗堟敼閫� filelist[5]涓嶅啀瀛樼殑nameEncrpt 2022-12-21
+ filelist[5] = dataMap.get(nameDataId); //zhj 鏂版柟妗堟敼閫� filelist[5]涓嶅啀瀛樼殑nameEncrpt 2022-12-21
} else {
- error +=
- 'error1 绗�' +
- i +
- '琛屾暟鎹嫓璁夸汉SF涓嶅瓨鍦�';
+ error += 'error1 绗�' + i + '琛屾暟鎹嫓璁夸汉SF涓嶅瓨鍦�';
}
} else {
- error +=
- 'error1 绗�' + i + '琛屾暟鎹嫓璁夸汉AWS涓嶅瓨鍦�';
+ error += 'error1 绗�' + i + '琛屾暟鎹嫓璁夸汉AWS涓嶅瓨鍦�';
}
} else {
- if (
- filelist[5] != '鍖荤敓' &&
- filelist[5] != '鍖荤敓+鎶ゅ+'
- ) {
- //&&filelist[5]!='鍖荤敓锛嬫姢澹�'
+ if (filelist[5] != '鍖荤敓' && filelist[5] != '鍖荤敓+鎶ゅ+') {//&&filelist[5]!='鍖荤敓锛嬫姢澹�'
error += 'error1 绗�' + i + '琛屾暟鎹嫓璁夸汉涓嶅瓨鍦�';
}
}
@@ -3605,27 +2609,17 @@
if (fileName) {
if (WorkRecord != '绉戝浼�') {
if (searchDataMap.get(fileName.replace(' ', ''))) {
- var nameDataId = searchDataMap.get(
- fileName.replace(' ', '')
- );
+ var nameDataId = searchDataMap.get(fileName.replace(' ', ''));
if (dataMap.get(nameDataId)) {
filelist[5] = dataMap.get(nameDataId);
} else {
- error +=
- 'error1 绗�' +
- i +
- '琛屾暟鎹嫓璁夸汉SF涓嶅瓨鍦�';
+ error += 'error1 绗�' + i + '琛屾暟鎹嫓璁夸汉SF涓嶅瓨鍦�';
}
} else {
- error +=
- 'error1 绗�' + i + '琛屾暟鎹嫓璁夸汉AWS涓嶅瓨鍦�';
+ error += 'error1 绗�' + i + '琛屾暟鎹嫓璁夸汉AWS涓嶅瓨鍦�';
}
} else {
- if (
- filelist[5] != '鍖荤敓' &&
- filelist[5] != '鍖荤敓+鎶ゅ+'
- ) {
- //&&filelist[5]!='鍖荤敓锛嬫姢澹�'
+ if (filelist[5] != '鍖荤敓' && filelist[5] != '鍖荤敓+鎶ゅ+') {//&&filelist[5]!='鍖荤敓锛嬫姢澹�'
error += 'error1 绗�' + i + '琛屾暟鎹嫓璁夸汉涓嶅瓨鍦�';
}
}
@@ -3641,12 +2635,10 @@
let errorArray = error.split('error1');
let errorDatas = [];
let errorDataRow = [];
-
- var fileContentData = component
- .get('v.fileContentData')
- .split('\n');
- console.log('fileContentData = ' + JSON.stringify(fileContentData));
- console.log('errorArray = ' + JSON.stringify(errorArray));
+
+ var fileContentData = component.get("v.fileContentData").split('\n');
+ console.log('fileContentData = ' + JSON.stringify(fileContentData))
+ console.log('errorArray = ' + JSON.stringify(errorArray))
for (var i in errorArray) {
// if (errorArray[i] != '') {
// let errorData = {}
@@ -3655,73 +2647,35 @@
// errorDatas.push(errorData);
// }
if (errorArray[i] != '') {
- let errorData = {};
- let index = errorDataRow.indexOf(
- errorArray[i].trim().substring(1, 2)
- );
+ let errorData = {}
+ let index = errorDataRow.indexOf(errorArray[i].trim().substring(1, 2));
if (index == -1) {
- errorData.errorRow = errorArray[i]
- .trim()
- .substring(1, 2);
+ errorData.errorRow = errorArray[i].trim().substring(1, 2);
errorDataRow.push(errorData.errorRow);
errorData.errorInfo = errorArray[i].trim().substring(5);
- if (errorData.errorInfo == '鎷滆浜篈WS涓嶅瓨鍦�') {
- errorData.errorInfo =
- '鎷滆浜� ' +
- fileContentData[errorData.errorRow].split(
- ','
- )[5] +
- '涓嶅瓨鍦�';
+ if(errorData.errorInfo == '鎷滆浜篈WS涓嶅瓨鍦�'){
+ errorData.errorInfo ='鎷滆浜� ' + fileContentData[errorData.errorRow].split(',')[5] + '涓嶅瓨鍦�';
}
errorDatas.push(errorData);
} else {
- if (
- errorArray[i].trim().substring(5) ==
- '鎷滆浜篈WS涓嶅瓨鍦�'
- ) {
- errorData[index].errorInfo =
- '; ' +
- '鎷滆浜� ' +
- fileContentData[
- errorDatas[index].errorRow
- ].split(',')[5] +
- '涓嶅瓨鍦�';
- } else {
- errorDatas[index].errorInfo +=
- '; ' + errorArray[i].trim().substring(5);
+ if(errorArray[i].trim().substring(5) == '鎷滆浜篈WS涓嶅瓨鍦�'){
+ errorData[index].errorInfo = '; ' + '鎷滆浜� ' + fileContentData[errorDatas[index].errorRow].split(',')[5] + '涓嶅瓨鍦�';
+ }else{
+ errorDatas[index].errorInfo += '; ' + errorArray[i].trim().substring(5);
}
}
}
}
- var fileContentData = component
- .get('v.fileContentData')
- .split('\n');
- console.log('fileContentData = ' + JSON.stringify(fileContentData));
+ var fileContentData = component.get("v.fileContentData").split('\n');
+ console.log('fileContentData = ' + JSON.stringify(fileContentData))
let errorColumns = [
- {
- label: '閿欒琛�',
- fieldName: 'errorRow',
- type: 'text',
- hideDefaultActions: true,
- initialWidth: 100
- },
- {
- label: '閿欒淇℃伅',
- fieldName: 'errorInfo',
- type: 'text',
- hideDefaultActions: true,
- initialWidth: 300,
- wrapText: true
- }
+ { label: '閿欒琛�', fieldName: 'errorRow', type: 'text', hideDefaultActions: true, initialWidth: 100 },
+ { label: '閿欒淇℃伅', fieldName: 'errorInfo', type: 'text', hideDefaultActions: true, initialWidth: 300, wrapText: true }
];
for (var i = 0; i < fileContentData[0].split(',').length - 1; i++) {
let initialWidth = 180;
- if (
- fileContentData[0].split(',')[i] ==
- '浜у搧1鍚岀被鑰楁潗绉戝鏈堜娇鐢ㄩ噺' ||
- fileContentData[0].split(',')[i] == '浣跨敤浜у搧1(浜у搧鍨嬪彿)'
- ) {
+ if (fileContentData[0].split(',')[i] == '浜у搧1鍚岀被鑰楁潗绉戝鏈堜娇鐢ㄩ噺' || fileContentData[0].split(',')[i] == '浣跨敤浜у搧1(浜у搧鍨嬪彿)') {
initialWidth = 250;
}
errorColumns.push({
@@ -3744,10 +2698,10 @@
}
}
}
- console.log('errorDatas =' + JSON.stringify(errorDatas));
+ console.log('errorDatas =' + JSON.stringify(errorDatas))
component.set('v.errorColumns', errorColumns);
component.set('v.errorData', errorDatas);
- component.set('v.showErrorInfo', true);
+ component.set("v.showErrorInfo", true);
console.log('error = ' + error);
//component.set('v.errorMessage', error);
@@ -3761,11 +2715,12 @@
console.log('fileStr=' + fileStr);
$A.getCallback(function () {
+
helper.ImportMethod(component, fileStr, helper);
})();
- },
- ImportMethod: function (component, fileStr, helper) {
- var action = component.get('c.processData');
+
+ }, ImportMethod: function (component, fileStr, helper) {
+ var action = component.get("c.processData");
var fieldsList = ['Name', 'Phone', 'AccountNumber']; //Please write your code dynamic fields
// var filedata =component.get("v.fileContentData");
action.setParams({
@@ -3775,7 +2730,7 @@
});
action.setCallback(this, function (response) {
var state = response.getState();
- if (state === 'SUCCESS') {
+ if (state === "SUCCESS") {
var res = response.getReturnValue();
var res1 = '';
if (res != 'success') {
@@ -3783,93 +2738,41 @@
console.log(ress);
let errorDatas = [];
let errorDataRow = [];
- var fileContentData = component
- .get('v.fileContentData')
- .split('\n');
- console.log(
- 'fileContentData[1].split(,)[5] = ' +
- fileContentData[1].split(',')[5]
- );
-
+ var fileContentData = component.get("v.fileContentData").split('\n');
+ console.log('fileContentData[1].split(,)[5] = ' + fileContentData[1].split(',')[5])
+
for (var i = 0; i < ress.length; i++) {
res1 += ress[i].substr(7) + '\n';
if (ress[i] != '') {
- let errorData = {};
- let index = errorDataRow.indexOf(
- ress[i].substr(7).substring(1, 2)
- );
+ let errorData = {}
+ let index = errorDataRow.indexOf(ress[i].substr(7).substring(1, 2));
if (index == -1) {
- errorData.errorRow = ress[i]
- .substr(7)
- .substring(1, 2);
+ errorData.errorRow = ress[i].substr(7).substring(1, 2);
errorDataRow.push(errorData.errorRow);
- errorData.errorInfo = ress[i]
- .substr(7)
- .substring(5);
- if (errorData.errorInfo == '鎷滆浜轰笉瀛樺湪') {
- console.log(
- 'errorData.errorRow = ' +
- errorData.errorRow
- );
- errorData.errorInfo =
- '鎷滆浜� ' +
- fileContentData[
- errorData.errorRow
- ].split(',')[5] +
- '涓嶅瓨鍦�';
+ errorData.errorInfo = ress[i].substr(7).substring(5);
+ if(errorData.errorInfo == '鎷滆浜轰笉瀛樺湪'){
+ console.log('errorData.errorRow = ' + errorData.errorRow)
+ errorData.errorInfo ='鎷滆浜� ' + fileContentData[errorData.errorRow].split(',')[5] + '涓嶅瓨鍦�';
}
errorDatas.push(errorData);
} else {
- if (
- ress[i].substr(7).substring(5) ==
- '鎷滆浜轰笉瀛樺湪'
- ) {
- errorDatas[index].errorInfo +=
- '; ' +
- '鎷滆浜� ' +
- fileContentData[
- errorDatas[index].errorRow
- ].split(',')[5] +
- '涓嶅瓨鍦�';
- } else {
- errorDatas[index].errorInfo +=
- '; ' + ress[i].substr(7).substring(5);
+
+ if(ress[i].substr(7).substring(5) == '鎷滆浜轰笉瀛樺湪'){
+ errorDatas[index].errorInfo += '; ' + '鎷滆浜� ' + fileContentData[errorDatas[index].errorRow].split(',')[5] + '涓嶅瓨鍦�';
+ }else{
+ errorDatas[index].errorInfo += '; ' + ress[i].substr(7).substring(5);
}
}
}
}
- var fileContentData = component
- .get('v.fileContentData')
- .split('\n');
+ var fileContentData = component.get("v.fileContentData").split('\n');
let errorColumns = [
- {
- label: '閿欒琛�',
- fieldName: 'errorRow',
- type: 'text',
- hideDefaultActions: true,
- initialWidth: 100
- },
- {
- label: '閿欒淇℃伅',
- fieldName: 'errorInfo',
- type: 'text',
- hideDefaultActions: true,
- initialWidth: 300,
- wrapText: true
- }
+ { label: '閿欒琛�', fieldName: 'errorRow', type: 'text', hideDefaultActions: true, initialWidth: 100 },
+ { label: '閿欒淇℃伅', fieldName: 'errorInfo', type: 'text', hideDefaultActions: true, initialWidth: 300, wrapText: true }
];
- for (
- var i = 0;
- i < fileContentData[0].split(',').length - 1;
- i++
- ) {
+ for (var i = 0; i < fileContentData[0].split(',').length - 1; i++) {
let initialWidth = 180;
- if (
- fileContentData[0].split(',')[i] ==
- '浜у搧1鍚岀被鑰楁潗绉戝鏈堜娇鐢ㄩ噺' ||
- fileContentData[0].split(',')[i] ==
- '浣跨敤浜у搧1(浜у搧鍨嬪彿)'
- ) {
+ if (fileContentData[0].split(',')[i] == '浜у搧1鍚岀被鑰楁潗绉戝鏈堜娇鐢ㄩ噺' || fileContentData[0].split(',')[i] == '浣跨敤浜у搧1(浜у搧鍨嬪彿)') {
initialWidth = 250;
}
errorColumns.push({
@@ -3892,52 +2795,56 @@
}
component.set('v.errorColumns', errorColumns);
component.set('v.errorData', errorDatas);
- component.set('v.showErrorInfo', true);
+ component.set("v.showErrorInfo", true);
- console.log('==' + res1);
+ console.log("==" + res1);
//component.set('v.errorMessage', res1 + "璇蜂慨鏀瑰悗閲嶆柊涓婁紶");
- this.error(res1 + '璇蜂慨鏀瑰悗閲嶆柊涓婁紶');
+ this.error(res1 + "璇蜂慨鏀瑰悗閲嶆柊涓婁紶");
//this.showErrorToast01(component);
//component.set('v.login', false);
component.set('v.modal_import_spinner', false);
} else {
component.set('v.successMessage', '瀵煎叆鎴愬姛');
this.showSuccessToast01(component);
- component.set('v.showMain', true);
+ component.set("v.showMain", true);
//component.set('v.login', false);
component.set('v.modal_import_spinner', false);
this.doinit(component, event, helper);
}
- } else if (state === 'INCOMPLETE') {
+ }
+ else if (state === "INCOMPLETE") {
//component.set('v.login', false);
component.set('v.modal_import_spinner', false);
- } else if (state === 'ERROR') {
+ }
+ else if (state === "ERROR") {
var errors = response.getError();
if (errors) {
if (errors[0] && errors[0].message) {
- console.log('Error message: ' + errors[0].message);
+ console.log("Error message: " +
+ errors[0].message);
//component.set('v.login', false);
component.set('v.modal_import_spinner', false);
}
} else {
- console.log('Unknown error');
+ console.log("Unknown error");
//component.set('v.login', false);
component.set('v.modal_import_spinner', false);
}
}
});
$A.enqueueAction(action);
- }, //鍏ㄨ杞崐瑙�
+ },//鍏ㄨ杞崐瑙�
ToCDB: function (str) {
- var tmp = '';
+ var tmp = "";
for (var i = 0; i < str.length; i++) {
if (str.charCodeAt(i) > 65248 && str.charCodeAt(i) < 65375) {
tmp += String.fromCharCode(str.charCodeAt(i) - 65248);
- } else {
+ }
+ else {
tmp += String.fromCharCode(str.charCodeAt(i));
}
}
- return tmp;
+ return tmp
},
//瀵煎嚭鐨凜SV鏂囦欢
convertArrayOfObjectsToCSV: function (component, objectRecords) {
@@ -3947,48 +2854,12 @@
}
columnDivider = ',';
lineDivider = '\n';
- keys = [
- 'Report_Date__c',
- 'Agency_Hospital__c',
- 'Department_Cateogy_text__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',
- '鏁堟灉/杩涘害',
- '浜у搧1鍚岀被鑰楁潗绉戝鏈堜娇鐢ㄩ噺',
- '浜у搧1瀵瑰簲鏈紡鍒嗙被',
- '宸查噰鐢ㄥ叾浠栧搧鐗�',
- '鍏朵粬鍝佺墝浜у搧绫诲埆',
- '浜у搧鐢ㄩ噺',
- '鏀彺闇�姹�'
- ];
+ keys = ['Report_Date__c', 'Agency_Hospital__c', 'Department_Cateogy_text__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', '鏁堟灉/杩涘害', '浜у搧1鍚岀被鑰楁潗绉戝鏈堜娇鐢ㄩ噺', '浜у搧1瀵瑰簲鏈紡鍒嗙被', '宸查噰鐢ㄥ叾浠栧搧鐗�', '鍏朵粬鍝佺墝浜у搧绫诲埆', '浜у搧鐢ㄩ噺', '鏀彺闇�姹�']
csvStringResult = '';
csvStringResult += thkeys.join(columnDivider);
csvStringResult += lineDivider;
- console.log('杩涘叆瀵煎嚭helper');
+ console.log("杩涘叆瀵煎嚭helper");
for (var i = 0; i < objectRecords.length; i++) {
counter = 0;
for (var sTempkey in keys) {
@@ -3996,13 +2867,12 @@
if (counter > 0) {
csvStringResult += columnDivider;
}
- if (typeof objectRecords[i][skey] === 'undefined') {
+ if (typeof objectRecords[i][skey] === "undefined") {
csvStringResult += '' + '' + '';
continue;
}
if (skey == 'Person_In_Charge2__c') {
- csvStringResult +=
- objectRecords[i].Person_In_Charge2__r.Name;
+ csvStringResult += objectRecords[i].Person_In_Charge2__r.Name;
} else if (skey == 'Agency_Hospital__c') {
csvStringResult += objectRecords[i].Agency_Hospital__r.Name;
} else if (skey == 'DealerPersonnel__c') {
@@ -4010,20 +2880,17 @@
} else if (skey == 'doctor2__c') {
csvStringResult += objectRecords[i].doctor2__r.Name;
} else if (skey == 'UseProduct1__c') {
- csvStringResult +=
- objectRecords[i].UseProduct1__r.Asset_Model_No__c;
+ csvStringResult += objectRecords[i].UseProduct1__r.Asset_Model_No__c;
} else if (skey == 'UseProduct2__c') {
- csvStringResult +=
- objectRecords[i].UseProduct2__r.Asset_Model_No__c;
+ csvStringResult += objectRecords[i].UseProduct2__r.Asset_Model_No__c;
} else if (skey == 'UseProduct3__c') {
- csvStringResult +=
- objectRecords[i].UseProduct3__r.Asset_Model_No__c;
+ csvStringResult += objectRecords[i].UseProduct3__r.Asset_Model_No__c;
} else {
csvStringResult += objectRecords[i][skey];
}
counter++;
}
- console.log('瀵煎嚭寰幆缁撴潫');
+ console.log("瀵煎嚭寰幆缁撴潫");
csvStringResult += lineDivider;
}
return csvStringResult;
@@ -4031,117 +2898,62 @@
// 瀵煎嚭椤甸潰鏄剧ず鐨勬ā鏉�
showExportDate: function (component, objectRecords) {
console.log('杩涘叆showexceportdate' + objectRecords);
- var keys = [
- 'Report_Date__c',
- 'Agency_Hospital__c',
- 'Department_Cateogy_text__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',
- '鏁堟灉/杩涘害',
- '浜у搧1鍚岀被鑰楁潗绉戝鏈堜娇鐢ㄩ噺',
- '浜у搧1瀵瑰簲鏈紡鍒嗙被',
- '宸查噰鐢ㄥ叾浠栧搧鐗�',
- '鍏朵粬鍝佺墝浜у搧绫诲埆',
- '浜у搧鐢ㄩ噺',
- '鏀彺闇�姹�'
- ];
- var content =
- '<table class="table slds-table slds-table--bordered slds-table--cell-buffer">';
- content += '<thead><tr class="slds-text-title--caps">';
+ var keys = ['Report_Date__c', 'Agency_Hospital__c', 'Department_Cateogy_text__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', '鏁堟灉/杩涘害', '浜у搧1鍚岀被鑰楁潗绉戝鏈堜娇鐢ㄩ噺', '浜у搧1瀵瑰簲鏈紡鍒嗙被', '宸查噰鐢ㄥ叾浠栧搧鐗�', '鍏朵粬鍝佺墝浜у搧绫诲埆', '浜у搧鐢ㄩ噺', '鏀彺闇�姹�']
+ var content = "<table class=\"table slds-table slds-table--bordered slds-table--cell-buffer\">";
+ content += "<thead><tr class=\"slds-text-title--caps\">";
for (i = 0; i < headers.length; i++) {
- content += '<th scope="col">' + headers[i] + '</th>';
+ //content += '<th scope=\"col"\ style=\"width:200px">' + headers[i] + '</th>';
+ if (headers[i] == '浜у搧1鍚岀被鑰楁潗绉戝鏈堜娇鐢ㄩ噺') {
+ content += '<th scope=\"col"\ style=\"width:250px"\>' + headers[i] + '</th>';
+ } else {
+ content += '<th scope=\"col"\ style=\"width:200px"\>' + headers[i] + '</th>';
+ }
}
- content += '</tr></thead>';
+ content += "</tr></thead>";
for (var i = 0; i < objectRecords.length; i++) {
console.log('for' + content);
content += '<tr>';
for (var sTempkey in keys) {
console.log('for1' + sTempkey);
var skey = keys[sTempkey];
- if (typeof objectRecords[i][skey] === 'undefined') {
+ if (typeof objectRecords[i][skey] === "undefined") {
content += '<td>' + '' + '</td>';
continue;
}
- console.log(
- 'for2' + objectRecords[i].Person_In_Charge2__r.Name
- );
+ console.log('for2' + objectRecords[i].Person_In_Charge2__r.Name);
if (skey == 'Person_In_Charge2__c') {
- content +=
- '<td>' +
- objectRecords[i].Person_In_Charge2__r.Name +
- '</td>';
+ content += '<td>' + objectRecords[i].Person_In_Charge2__r.Name + '</td>';
} else if (skey == 'Agency_Hospital__c') {
- content +=
- '<td>' +
- objectRecords[i].Agency_Hospital__r.Name +
- '</td>';
+ content += '<td>' + objectRecords[i].Agency_Hospital__r.Name + '</td>';
} else if (skey == 'DealerPersonnel__c') {
- content +=
- '<td>' +
- objectRecords[i].DealerPersonnel__r.Name +
- '</td>';
+ content += '<td>' + objectRecords[i].DealerPersonnel__r.Name + '</td>';
} else if (skey == 'doctor2__c') {
- content +=
- '<td>' + objectRecords[i].doctor2__r.Name + '</td>';
+ content += '<td>' + objectRecords[i].doctor2__r.Name + '</td>';
} else if (skey == 'UseProduct1__c') {
- content +=
- '<td>' +
- objectRecords[i].UseProduct1__r.Asset_Model_No__c +
- '</td>';
+ content += '<td>' + objectRecords[i].UseProduct1__r.Asset_Model_No__c + '</td>';
} else if (skey == 'UseProduct2__c') {
- content +=
- '<td>' +
- objectRecords[i].UseProduct2__r.Asset_Model_No__c +
- '</td>';
+ content += '<td>' + objectRecords[i].UseProduct2__r.Asset_Model_No__c + '</td>';
} else if (skey == 'UseProduct3__c') {
- content +=
- '<td>' +
- objectRecords[i].UseProduct3__r.Asset_Model_No__c +
- '</td>';
+ content += '<td>' + objectRecords[i].UseProduct3__r.Asset_Model_No__c + '</td>';
} else {
content += '<td>' + objectRecords[i][skey] + '</td>';
}
}
- content += '</tr>';
+ content += '</tr>'
}
content += '</table>';
- console.log('helper寰幆缁撴潫' + content);
- component.set('v.TableContent2', content);
- component.set('v.showMain', false);
+ console.log("helper寰幆缁撴潫" + content);
+ component.set("v.TableContent2", content);
+ component.set("v.showMain", false);
},
select_repores_date: function (component, event, helper) {
component.set('v.login', true);
var reportsdate1 = component.find('input-report-date1').get('v.value');
var reportsdate2 = component.find('input-report-date2').get('v.value');
- console.log(
- '杈撳叆鐨勫紑濮嬫棩鏈�' + reportsdate1 + '杈撳叆鐨勭粨鏉熸棩鏈�' + reportsdate2
- );
- var action = component.get('c.getReportsByDate');
+ console.log('杈撳叆鐨勫紑濮嬫棩鏈�' + reportsdate1 + '杈撳叆鐨勭粨鏉熸棩鏈�' + reportsdate2);
+ var action = component.get("c.getReportsByDate");
console.log('杈撳叆鐨勫紑濮嬫棩鏈�1');
action.setParams({
date1: reportsdate1,
@@ -4150,7 +2962,7 @@
console.log('杈撳叆鐨勫紑濮嬫棩鏈�2');
action.setCallback(this, function (response) {
var state = response.getState();
- if (state === 'SUCCESS') {
+ if (state === "SUCCESS") {
var res = response.getReturnValue();
console.log('杈撳叆鐨勫紑濮嬫棩鏈�3' + res);
component.set('v.login', false);
@@ -4159,66 +2971,39 @@
if (true) {
let awsids = [];
for (let ri in res) {
- if (
- res[ri] &&
- res[ri].doctor2__r &&
- res[ri].doctor2__r.AWS_Data_Id__c
- ) {
+ if (res[ri] && res[ri].doctor2__r && res[ri].doctor2__r.AWS_Data_Id__c) {
awsids.push(res[ri].doctor2__r.AWS_Data_Id__c);
}
}
if (awsids.length > 0) {
let PIConfig = component.get('v.PIConfig');
- let staticResourceAgencyContact = JSON.parse(
- PIConfig.staticResourceAgencyContact
- );
- AWSService.search(
- staticResourceAgencyContact.searchUrl,
- {
- dataIds: awsids
- },
- function (data) {
- if (data && data.object && data.object.length) {
- let m = {};
- for (let di in data.object) {
- if (
- data.object[di] &&
- data.object[di].dataId
- ) {
- m[data.object[di].dataId] =
- data.object[di];
- }
- }
-
- for (let ri in res) {
- if (
- res[ri] &&
- res[ri].doctor2__r &&
- res[ri].doctor2__r.AWS_Data_Id__c &&
- m.hasOwnProperty(
- res[ri].doctor2__r
- .AWS_Data_Id__c
- )
- ) {
- res[ri].doctor2__r.Name =
- m[
- res[
- ri
- ].doctor2__r.AWS_Data_Id__c
- ].name;
- }
+ let staticResourceAgencyContact = JSON.parse(PIConfig.staticResourceAgencyContact);
+ AWSService.search(staticResourceAgencyContact.searchUrl, {
+ dataIds: awsids
+ }, function (data) {
+ if (data && data.object && data.object.length) {
+ let m = {};
+ for (let di in data.object) {
+ if (data.object[di] && data.object[di].dataId) {
+ m[data.object[di].dataId] = data.object[di];
}
}
- helper.showExportDate(component, res);
- component.set('v.login', false);
- },
- staticResourceAgencyContact.token
- );
+ for (let ri in res) {
+ if (res[ri] && res[ri].doctor2__r && res[ri].doctor2__r.AWS_Data_Id__c && m.hasOwnProperty(res[ri].doctor2__r.AWS_Data_Id__c)) {
+ res[ri].doctor2__r.Name = m[res[ri].doctor2__r.AWS_Data_Id__c].name;
+ }
+ }
+ }
+ helper.showExportDate(component, res);
+
+ component.set('v.login', false);
+ }, staticResourceAgencyContact.token);
} else {
helper.showExportDate(component, res);
}
}
+
component.set('v.reports_date', res);
} else {
@@ -4227,6 +3012,7 @@
}
});
$A.enqueueAction(action);
+
},
showImport: function (component) {
@@ -4260,37 +3046,35 @@
newlyBuild: function (component, event, helper) {
var hospital_id = component.get('v.hospitalLinkId');
event.preventDefault(); // stop form submission
- var fields = component.find('newOpportunityField');
+ var fields = component.find("newOpportunityField");
var nameer = '';
var type = '';
var doctorDivision1 = '';
fields.forEach(function (field) {
- if (field.get('v.fieldName') === 'Name') {
- nameer = field.get('v.value');
+ if (field.get("v.fieldName") === 'Name') {
+ nameer = field.get("v.value");
}
- if (field.get('v.fieldName') === 'Type__c') {
- type = field.get('v.value');
+ if (field.get("v.fieldName") === 'Type__c') {
+ type = field.get("v.value");
}
- if (field.get('v.fieldName') === 'Doctor_Division1__c') {
- doctorDivision1 = field.get('v.value');
+ if (field.get("v.fieldName") === 'Doctor_Division1__c') {
+ doctorDivision1 = field.get("v.value");
}
});
if (hospital_id) {
component.set('v.login', true);
var action = component.get('c.newlyBuild');
action.setParams({
- hospital_id: hospital_id,
- nameer: nameer,
- type: type,
- doctorDivision1: doctorDivision1
+ "hospital_id": hospital_id,
+ "nameer": nameer,
+ "type": type,
+ "doctorDivision1": doctorDivision1,
});
action.setCallback(this, function (response) {
var state = response.getState();
if (state == 'SUCCESS') {
var res = this.conv_selected(response.getReturnValue());
- var default_doctor = component.get(
- 'v.default_select_doctor_id'
- );
+ var default_doctor = component.get('v.default_select_doctor_id');
if (default_doctor != '' && res.length > 0) {
var doctor_title = '';
for (var i = 0; i < res.length; i++) {
@@ -4306,16 +3090,14 @@
} else {
component.find('select_doctor').set('v.options', res);
if (res.length > 0) {
- component.set(
- 'v.doctor_title',
- res[0].Doctor_Division1__c
- );
+ component.set('v.doctor_title', res[0].Doctor_Division1__c);
}
}
component.set('v.default_select_doctor_id', '');
component.set('v.doctor_list', res);
component.set('v.login', false);
- } else {
+ }
+ else {
//component.set('v.errorMessage', 'newlyBuild failed.');
this.error('newlyBuild failed.');
//this.showErrorToast(component);
@@ -4330,8 +3112,8 @@
var sc = event.getSource().get('v.value');
if (sc != null) {
if (sc.length <= 14) {
- if (sc.replace(/\D/gi, '')) {
- component.set('v.select_ConsumptionOfConsumables', sc);
+ if (sc.replace(/\D/gi, "")) {
+ component.set("v.select_ConsumptionOfConsumables", sc);
} else {
//component.set('v.errorMessage', '浜у搧1鍚岀被鑰楁潗绉戝鏈堜娇鐢ㄩ噺蹇呴』杈撳叆鏁板瓧!');
this.error('浜у搧1鍚岀被鑰楁潗绉戝鏈堜娇鐢ㄩ噺蹇呴』杈撳叆鏁板瓧!');
@@ -4349,8 +3131,8 @@
var sc = event.getSource().get('v.value');
if (sc != null) {
if (sc.length <= 14) {
- if (sc.replace(/\D/gi, '')) {
- component.set('v.select_warlocksNumber', sc);
+ if (sc.replace(/\D/gi, "")) {
+ component.set("v.select_warlocksNumber", sc);
} else {
//component.set('v.errorMessage', '浜у搧鐢ㄩ噺蹇呴』杈撳叆鏁板瓧!');
this.error('浜у搧鐢ㄩ噺蹇呴』杈撳叆鏁板瓧!');
@@ -4365,6 +3147,7 @@
},
//宸ヤ綔浼氳褰�
selectPurposeType: function (component, event, helper) {
+
var doctor_value = component.find('select_purpose_type').get('v.value');
// alert(doctor_value);
if (doctor_value != '绉戝浼�') {
@@ -4376,15 +3159,13 @@
this.set_doctor_list_edit(component);
var action = component.get('c.selectPurposeTypes');
action.setParams({
- doctor_value: doctor_value
+ 'doctor_value': doctor_value
});
action.setCallback(this, function (response) {
var state = response.getState();
if (state == 'SUCCESS') {
var res = response.getReturnValue();
- component
- .find('select_EffectProgress')
- .set('v.options', JSON.parse(JSON.stringify(res)));
+ component.find('select_EffectProgress').set("v.options", JSON.parse(JSON.stringify(res)));
}
});
$A.enqueueAction(action);
@@ -4394,21 +3175,18 @@
},
selectProductClassification: function (component, event, helper) {
- var select_ProductClassification = component
- .find('select_ProductClassification')
- .get('v.value');
+
+ var select_ProductClassification = component.find('select_ProductClassification').get('v.value');
if (select_ProductClassification != '') {
var action = component.get('c.selectProductClassificationc');
action.setParams({
- select_ProductClassification: select_ProductClassification
+ "select_ProductClassification": select_ProductClassification
});
action.setCallback(this, function (response) {
var state = response.getState();
if (state == 'SUCCESS') {
var res = response.getReturnValue();
- component
- .find('select_OtherBrandConsumables')
- .set('v.options', JSON.parse(JSON.stringify(res)));
+ component.find('select_OtherBrandConsumables').set("v.options", JSON.parse(JSON.stringify(res)));
}
});
$A.enqueueAction(action);
@@ -4418,10 +3196,8 @@
this.selectProductCcategory(component);
},
select_ProductCcategory: function (component, event, helper) {
- var select_ProductCcategory = component
- .find('select_ProductCcategory')
- .get('v.value');
-
+ var select_ProductCcategory = component.find('select_ProductCcategory').get('v.value');
+
if (select_ProductCcategory != '') {
var result = component.find('result');
var UserProType = component.get('v.UserProType');
@@ -4434,15 +3210,13 @@
}
var action = component.get('c.selectProductCcategory01');
action.setParams({
- select_ProductCcategory: select_ProductCcategory
+ "select_ProductCcategory": select_ProductCcategory
});
action.setCallback(this, function (response) {
var state = response.getState();
if (state == 'SUCCESS') {
var res = response.getReturnValue();
- component
- .find('select_productCategories')
- .set('v.options', JSON.parse(JSON.stringify(res)));
+ component.find('select_productCategories').set("v.options", JSON.parse(JSON.stringify(res)));
}
});
$A.enqueueAction(action);
@@ -4453,14 +3227,8 @@
}
},
selectpurposetype: function (component, event, helper) {
- var select_ProductCcategory = component
- .find('select_ProductCcategory')
- .get('v.value');
- if (
- select_ProductCcategory == null &&
- select_ProductCcategory == undefined &&
- select_ProductCcategory == ''
- ) {
+ var select_ProductCcategory = component.find('select_ProductCcategory').get('v.value');
+ if (select_ProductCcategory == null && select_ProductCcategory == undefined && select_ProductCcategory == '') {
var result = component.find('result');
// $A.util.removeClass(result, 'disp_none');
if (UserProType == 'ENG') {
@@ -4469,6 +3237,7 @@
$A.util.addClass(result, 'disp_none');
}
} else {
+
component.find('select_productCategories').set('v.value', '');
var result = component.find('result');
$A.util.addClass(result, 'disp_none');
@@ -4477,9 +3246,7 @@
},
//zhj MEBG鏂版柟妗堟敼閫� 2022-11-29 start
CallBackAction: function (component, action_name, para, callback) {
- var action = component.get(
- 'c.' + action_name.trimStart().replace('c.', '')
- );
+ var action = component.get("c." + action_name.trimStart().replace("c.", ""));
if (para) {
action.setParams(para);
}
@@ -4508,22 +3275,22 @@
for (var i in errorData) {
let data = [];
- data.push(errorData[i].errorRow);
- data.push(errorData[i].errorInfo);
+ data.push(errorData[i].errorRow)
+ data.push(errorData[i].errorInfo)
for (var j = 0; j < Object.keys(errorData[i]).length - 2; j++) {
- data.push(errorData[i]['field' + j]);
+ data.push(errorData[i]['field' + j])
}
datas.push(data);
}
console.log('datas = ' + JSON.stringify(datas));
var csv = this.convertToCSV(component, datas);
- console.log('csv = ' + JSON.stringify(csv));
+ console.log('csv = ' + JSON.stringify(csv))
this.downloadCSV(component, csv);
},
convertToCSV: function (component, data) {
- console.log('enter convertToCSV');
+ console.log('enter convertToCSV')
console.log('data = ' + data);
var csv = '';
for (var i = 0; i < data.length; i++) {
@@ -4533,11 +3300,7 @@
var val = '';
val = row[j] === null ? '' : row[j].toString();
console.log('val = ' + val);
- if (
- val.indexOf(',') !== -1 ||
- val.indexOf('"') !== -1 ||
- val.indexOf('\n') !== -1
- ) {
+ if (val.indexOf(',') !== -1 || val.indexOf('"') !== -1 || val.indexOf('\n') !== -1) {
//val = '"' + val.replace(/"/g,'""') + '"';
}
if (j > 0) {
@@ -4552,9 +3315,8 @@
downloadCSV: function (component, csv) {
var link = document.createElement('a');
- var bom = '\uFEFF';
- link.href =
- 'data:text/csv;charset=utf-8,' + encodeURIComponent(bom + csv);
+ var bom = "\uFEFF";
+ link.href = 'data:text/csv;charset=utf-8,' + encodeURIComponent(bom + csv);
link.download = 'data.csv';
document.body.appendChild(link);
link.click();
@@ -4562,15 +3324,15 @@
},
error: function (message) {
// $('toastMessage.forceToastManager').css('white-space', 'pre-wrap');
- var toastEvent = $A.get('e.force:showToast');
+ var toastEvent = $A.get("e.force:showToast");
toastEvent.setParams({
- title: '閿欒!',
- message: message,
- type: 'error'
+ "title": "閿欒!",
+ "message": message,
+ "type": "error",
//"duration" : "sticky"
});
toastEvent.fire();
- }
+ },
//zhj 瀵煎嚭閿欒淇℃伅 2023-05-16 end
-});
+})
\ No newline at end of file
diff --git a/force-app/main/default/aura/WeeklyReport/WeeklyReport.cmp b/force-app/main/default/aura/WeeklyReport/WeeklyReport.cmp
index 74c553a..8b827ee 100644
--- a/force-app/main/default/aura/WeeklyReport/WeeklyReport.cmp
+++ b/force-app/main/default/aura/WeeklyReport/WeeklyReport.cmp
@@ -1,77 +1,53 @@
-<aura:component
- controller="WeeklyReportCmp"
- implements="force:appHostable,flexipage:availableForAllPageTypes,flexipage:availableForRecordHome,force:hasRecordId,force:lightningQuickAction,forceCommunity:availableForAllPageTypes"
- access="global"
->
+<aura:component controller="WeeklyReportCmp" implements="force:appHostable,flexipage:availableForAllPageTypes,flexipage:availableForRecordHome,force:hasRecordId,force:lightningQuickAction,forceCommunity:availableForAllPageTypes" access="global" >
<ltng:require styles="{!$Resource.multilineToastCSS}" />聽
- <aura:handler name="init" value="{!this}" action="{!c.doInit}" />
- <aura:handler
- event="c:strike_evt"
- action="{!c.createAopp}"
- name="strike_evt_addNewRecord"
- />
- <aura:attribute
- name="data"
- type="Agency_Report__c"
- default="{sobjectType:'Agency_Report__c'}"
- />
- <aura:attribute
- name="oppdata"
- type="Agency_Opportunity__c"
- default="{sobjectType:'Agency_Opportunity__c'}"
- />
- <aura:attribute
- name="acondata"
- type="Agency_Contact__c"
- default="{sobjectType:'Agency_Contact__c'}"
- />
+ <aura:handler name="init" value="{!this}" action="{!c.doInit}"/>
+ <aura:handler event="c:strike_evt" action="{!c.createAopp}" name="strike_evt_addNewRecord"/>
+ <aura:attribute name="data" type="Agency_Report__c" default="{sobjectType:'Agency_Report__c'}"/>
+ <aura:attribute name="oppdata" type="Agency_Opportunity__c" default="{sobjectType:'Agency_Opportunity__c'}"/>
+ <aura:attribute name="acondata" type="Agency_Contact__c" default="{sobjectType:'Agency_Contact__c'}"/>
<!-- <aura:attribute name="oppdata_old" type="Agency_Opportunity__c" default="{sobjectType:'Agency_Opportunity__c'}"/> -->
- <aura:attribute name="Close_Forecasted_Date__c_o" type="Date" />
- <aura:attribute name="Amount__c_o" type="String" />
- <aura:attribute name="OCMSale_Price__c_o" type="String" />
- <aura:attribute name="StageName__c_o" type="String" />
- <aura:attribute name="fieldsmap" type="Map" />
- <aura:attribute name="alldata" type="List" />
- <aura:attribute name="allselectlist" type="Map" />
- <aura:attribute name="doclist" type="List" />
- <aura:attribute name="docmap" type="Map" />
- <aura:attribute name="login" type="Boolean" default="false" />
+ <aura:attribute name="Close_Forecasted_Date__c_o" type="Date"/>
+ <aura:attribute name="Amount__c_o" type="String"/>
+ <aura:attribute name="OCMSale_Price__c_o" type="String"/>
+ <aura:attribute name="StageName__c_o" type="String"/>
+ <aura:attribute name="fieldsmap" type="Map"/>
+ <aura:attribute name="alldata" type="List"/>
+ <aura:attribute name="allselectlist" type="Map"/>
+ <aura:attribute name="doclist" type="List"/>
+ <aura:attribute name="docmap" type="Map"/>
+ <aura:attribute name="login" type="Boolean" default="false"/>
<aura:attribute name="loginEdit" type="Boolean" default="false" />
- <aura:attribute name="loadOpp" type="Boolean" default="false" />
- <aura:attribute name="reportPageData" type="Map" />
- <aura:attribute name="selectbody" type="String" />
- <aura:attribute name="report_date_list" type="Map" />
- <aura:attribute name="selected_date" type="String" />
- <aura:attribute name="selected_agency_person" type="String" />
- <aura:attribute name="agency_report_header" type="String" />
- <aura:attribute name="agency_report_header_id" type="String" />
- <aura:attribute name="result" type="String" default="" />
- <aura:attribute name="hospital" type="string" default="" />
- <aura:attribute name="hospitalId" type="string" default="" />
- <aura:attribute name="hospitalLinkId" type="string" default="" />
- <aura:handler name="change" value="{!v.hospital}" action="{!c.hosChange}" />
+ <aura:attribute name="loadOpp" type="Boolean" default="false"/>
+ <aura:attribute name="reportPageData" type="Map"/>
+ <aura:attribute name="selectbody" type="String"/>
+ <aura:attribute name="report_date_list" type="Map"/>
+ <aura:attribute name="selected_date" type="String"/>
+ <aura:attribute name="selected_agency_person" type="String"/>
+ <aura:attribute name="agency_report_header" type="String"/>
+ <aura:attribute name="agency_report_header_id" type="String"/>
+ <aura:attribute name="result" type="String" default=""/>
+ <aura:attribute name="hospital" type="string" default=""/>
+ <aura:attribute name="hospitalId" type="string" default=""/>
+ <aura:attribute name="hospitalLinkId" type="string" default=""/>
+ <aura:handler name="change" value="{!v.hospital}" action="{!c.hosChange}"/>
<aura:attribute name="hospitalList" type="Map" />
- <aura:attribute name="doctor_list" type="Map" />
- <aura:attribute name="doctor_title" type="String" />
- <aura:attribute name="opportunity_list" type="Map" />
- <aura:handler
- name="change"
- value="{!v.data.Opportunity__c}"
- action="{!c.opportunityChange}"
- />
- <aura:attribute name="edit_copy_select_report_id" type="String" />
- <aura:attribute name="create_agency_report_id" type="String" />
- <aura:attribute name="reports" type="List" />
- <aura:attribute name="reports_now" type="List" />
- <aura:attribute name="reports_now_count" type="Integer" />
- <aura:attribute name="mode" type="String" />
- <aura:attribute name="select_report_data" type="Map" />
- <aura:attribute name="select_report_data_radio" type="Map" />
- <aura:attribute name="default_select_doctor_id" type="String" />
- <aura:attribute name="default_select_opportunity_id" type="String" />
- <aura:attribute name="report_count" type="Integer" />
- <aura:attribute name="dialog_type" type="String" />
- <aura:attribute name="truthy" type="Boolean" default="false" />
+ <aura:attribute name="doctor_list" type="Map"/>
+ <aura:attribute name="doctor_title" type="String"/>
+ <aura:attribute name="opportunity_list" type="Map"/>
+ <aura:handler name="change" value="{!v.data.Opportunity__c}" action="{!c.opportunityChange}"/>
+ <aura:attribute name="edit_copy_select_report_id" type="String"/>
+ <aura:attribute name="create_agency_report_id" type="String"/>
+ <aura:attribute name="reports" type="List"/>
+ <aura:attribute name="reports_now" type="List"/>
+ <aura:attribute name="reports_now_count" type="Integer"/>
+ <aura:attribute name="mode" type="String"/>
+ <aura:attribute name="select_report_data" type="Map"/>
+ <aura:attribute name="select_report_data_radio" type="Map"/>
+ <aura:attribute name="default_select_doctor_id" type="String"/>
+ <aura:attribute name="default_select_opportunity_id" type="String"/>
+ <aura:attribute name="report_count" type="Integer"/>
+ <aura:attribute name="dialog_type" type="String"/>
+ <aura:attribute name="truthy" type="Boolean" default="false"/>
<aura:attribute name="list_message" type="String" default="鎼滅储" />
<aura:attribute name="confirm_status" type="Integer" default="0" />
<aura:attribute name="modal_confirm_title" type="String" />
@@ -81,46 +57,30 @@
<aura:handler name="change" value="{!v.data.Product_Category2__c}" action="{!c.productcategoryChange2}"/>
<aura:handler name="change" value="{!v.data.Product_Category3__c}" action="{!c.productcategoryChange3}"/> -->
<!-- <aura:handler name="change" value="{!v.oppdata.StageName__c}" action="{!c.stageNameChange}"/> -->
- <aura:attribute
- name="update_select_report_data_id"
- type="String"
- default=""
- />
+ <aura:attribute name="update_select_report_data_id" type="String" default=""/>
<!-- 鎵归噺娣诲姞鍛ㄦ姤 start-->
<aura:attribute name="reports_date" type="List" />
<!-- <aura:attribute name="reports_date1" type="Date" />
<aura:attribute name="reports_date2" type="Date" /> -->
- <aura:attribute
- name="TableContent"
- type="String"
- description=" Show the Result class"
- />
- <aura:attribute
- name="TableContent2"
- type="String"
- description=" Show the Result class"
- />
- <aura:attribute
- name="TargetFileName"
- type="String"
- description="Name of the file"
- />
+ <aura:attribute name="TableContent" type="String" description=" Show the Result class"/>
+ <aura:attribute name="TableContent2" type="String" description=" Show the Result class"/>
+ <aura:attribute name="TargetFileName" type="String" description="Name of the file"/>
<aura:attribute name="tableheaders" type="Object[]" />
- <aura:attribute name="fileContentData" type="String" />
- <aura:attribute name="filename" type="String" />
+ <aura:attribute name="fileContentData" type="String"/>
+ <aura:attribute name="filename" type="String"/>
<!-- It will display 100 records . Change for your requirement-->
- <aura:attribute name="NumOfRecords" type="Integer" default="1000" />
- <aura:attribute name="showMain" type="Boolean" default="true" />
+ <aura:attribute name="NumOfRecords" type="Integer" default="1000"/>
+ <aura:attribute name="showMain" type="Boolean" default="true"/>
<!-- PIPL update Yin Mingjie 21/02/2022 start -->
- <aura:attribute name="AWStoken" type="String" />
- <aura:attribute name="AWSsearch" type="String" />
- <aura:attribute name="AWSinsert" type="String" />
- <aura:attribute name="AWStransactionURL" type="String" />
- <aura:attribute name="AWSDoctor2Map" type="String" />
- <aura:attribute name="awsurl" type="Map" />
- <aura:attribute name="contactawsurl" type="Map" />
- <aura:attribute name="allselectlistAgencyPerson" type="Map" />
+ <aura:attribute name="AWStoken" type="String"/>
+ <aura:attribute name="AWSsearch" type="String"/>
+ <aura:attribute name="AWSinsert" type="String"/>
+ <aura:attribute name="AWStransactionURL" type="String"/>
+ <aura:attribute name="AWSDoctor2Map" type="String"/>
+ <aura:attribute name="awsurl" type="Map"/>
+ <aura:attribute name="contactawsurl" type="Map"/>
+ <aura:attribute name="allselectlistAgencyPerson" type="Map"/>
<!-- PIPL update Yin Mingjie 21/02/2022 end -->
<!-- start DTT-zhj 澧炲姞閿欒淇℃伅table 2023-05-16-->
@@ -133,17 +93,14 @@
<!-- 鎵归噺娣诲姞鍛ㄦ姤 end-->
<ltng:require scripts="{! $Resource.AWSService+'/AWSService.js' }" />
<ltng:require scripts="{! $Resource.jquery183minjs }" />
-
+
<!--銉兗銉変腑...-->
<aura:renderIf isTrue="{!v.login}">
<aura:renderIf isTrue="{!!v.loginEdit}">
<!-- add by Deloitte-Link 2023-6-19 -->
<div class="weeklyReportSpinner">
<div class="slds-spinner_container">
- <div
- class="slds-spinner--brand slds-spinner slds-spinner--medium"
- role="alert"
- >
+ <div class="slds-spinner--brand slds-spinner slds-spinner--medium" role="alert">
<span id="aa" class="slds-assistive-text">Loading</span>
<div class="slds-spinner__dot-a"></div>
<div class="slds-spinner__dot-b"></div>
@@ -152,172 +109,81 @@
</div>
</aura:renderIf>
</aura:renderIf>
-
+
<div aura:id="report" id="report" class="contents_wrapper">
<div class="slds-grid slds-wrap slds-grid--pull-padded">
- <div
- class="tr mt5 slds-p-horizontal--small slds-size--1-of-1 slds-medium-size--1-of-12 slds-large-size--1-of-12"
- >
+ <div class="tr mt5 slds-p-horizontal--small slds-size--1-of-1 slds-medium-size--1-of-12 slds-large-size--1-of-12">
鍛�
</div>
- <div
- class="slds-p-horizontal--small slds-size--1-of-1 slds-medium-size--3-of-12 slds-large-size--3-of-12"
- >
- <ui:inputSelect
- aura:id="select_date"
- class="slds-select"
- change="{!c.select_date_change}"
- />
+ <div class="slds-p-horizontal--small slds-size--1-of-1 slds-medium-size--3-of-12 slds-large-size--3-of-12">
+ <ui:inputSelect aura:id="select_date" class="slds-select" change="{!c.select_date_change}"/>
</div>
-
+
<!-- 浠g悊搴楁媴褰撹�� -->
- <div
- class="tr mt5 slds-p-horizontal--small slds-size--1-of-1 slds-medium-size--1-of-12 slds-large-size--1-of-12"
- >
+ <div class="tr mt5 slds-p-horizontal--small slds-size--1-of-1 slds-medium-size--1-of-12 slds-large-size--1-of-12">
{!v.fieldsmap.Person_In_Charge2__c}
</div>
- <div
- class="slds-p-horizontal--small slds-size--1-of-1 slds-medium-size--3-of-12 slds-large-size--3-of-12"
- >
- <ui:inputSelect
- aura:id="select_agency_person"
- class="slds-select agency_person_select"
- change="{!c.select_agency_change}"
- />
+ <div class="slds-p-horizontal--small slds-size--1-of-1 slds-medium-size--3-of-12 slds-large-size--3-of-12">
+ <ui:inputSelect aura:id="select_agency_person" class="slds-select agency_person_select" change="{!c.select_agency_change}"/>
</div>
- <div
- class="tr slds-p-horizontal--small slds-size--1-of-1 slds-medium-size--1-of-12 slds-large-size--1-of-12"
- >
- <ui:button
- aura:id="new_button"
- label="鏂板缓"
- press="{!c.new_report}"
- disabled="true"
- />
+ <div class="tr slds-p-horizontal--small slds-size--1-of-1 slds-medium-size--1-of-12 slds-large-size--1-of-12">
+ <ui:button aura:id="new_button" label="鏂板缓" press="{!c.new_report}" disabled="true"/>
</div>
- <div
- class="slds-p-horizontal--small slds-size--1-of-1 slds-medium-size--3-of-12 slds-large-size--3-of-12"
- >
- <ui:button
- aura:id="copy_button"
- label="澶嶅埗"
- press="{!c.copy_button}"
- disabled="true"
- />
+ <div class="slds-p-horizontal--small slds-size--1-of-1 slds-medium-size--3-of-12 slds-large-size--3-of-12">
+ <ui:button aura:id="copy_button" label="澶嶅埗" press="{!c.copy_button}" disabled="true"/>
<!-- <ui:button aura:id="import" label="瀵煎叆" press="{!c.import}" /> -->
<ui:button aura:id="import" label="瀵煎叆" press="{!c.import}" />
-
+
<!-- <input type="file" class="file" aura:id="file" onchange="{!c.CreateRecord}" style="position:absolute;filter:alpha(opacity=0);" size="1" hidden="true" /> -->
<!-- <ui:button aura:id="import" label="瀵煎嚭" press="{!c.export}"/> -->
- <ui:button
- aura:id="export"
- label="瀵煎嚭"
- press="{!c.export_condition}"
- />
+ <ui:button aura:id="export" label="瀵煎嚭" press="{!c.export_condition}"/>
</div>
+
</div>
</div>
-
- <div aura:id="report_list" class="report_list_area">
+
+ <div aura:id="report_list" class="report_list_area" >
<div class="slds-table--edit_container slds-is-relative">
- <table
- class="slds-table slds-table--edit slds-table--bordered slds-table--fixed-layout slds-no-cell-focus"
- role="grid"
- style="width: 66.75rem"
- >
+ <table class="slds-table slds-table--edit slds-table--bordered slds-table--fixed-layout slds-no-cell-focus" role="grid" style="width:66.75rem;">
<thead>
<tr class="slds-line-height--reset">
- <th
- class="table_header slds-text-title--caps"
- style="width: 250px; font-size: 13px"
- >
- <span class="slds-truncate" title="Name"
- >鍛ㄦ姤缂栧彿</span
- >
+ <th class="table_header slds-text-title--caps" style="width: 250px;font-size: 13px;">
+ <span class="slds-truncate" title="Name">鍛ㄦ姤缂栧彿</span>
</th>
- <th
- class="table_header slds-text-title--caps"
- style="width: 100px; font-size: 13px"
- >
- <span class="slds-truncate" title="Name"
- >{!v.fieldsmap.Person_In_Charge2__c}</span
- >
+ <th class="table_header slds-text-title--caps" style="width: 100px;font-size: 13px;">
+ <span class="slds-truncate" title="Name">{!v.fieldsmap.Person_In_Charge2__c}</span>
</th>
- <th
- class="table_header slds-text-title--caps"
- style="width: 250px; font-size: 13px"
- >
+ <th class="table_header slds-text-title--caps" style="width: 250px;font-size: 13px;">
<span class="slds-truncate" title="Name">鍖婚櫌</span>
</th>
- <th
- class="table_header slds-text-title--caps"
- style="width: 100px; font-size: 13px"
- >
- <span class="slds-truncate" title="Name"
- >{!v.fieldsmap.Department_Cateogy__c}</span
- >
+ <th class="table_header slds-text-title--caps" style="width: 100px;font-size: 13px;">
+ <span class="slds-truncate" title="Name">{!v.fieldsmap.Department_Cateogy__c}</span>
</th>
- <th
- class="table_header slds-text-title--caps"
- style="width: 100px; font-size: 13px"
- >
+ <th class="table_header slds-text-title--caps" style="width: 100px;font-size: 13px;">
<!-- PIPL update Yin Mingjie 21/02/2022 start
<span class="slds-truncate" title="Name">{!v.fieldsmap.doctor2__r}</span>
PIPL update Yin Mingjie 21/02/2022 end-->
- <span
- class="slds-truncate"
- title="Name"
- style="width: 100px; font-size: 13px"
- >{!v.fieldsmap.Agency_Contact__c}</span
- >
+ <span class="slds-truncate" title="Name" style="width: 100px;font-size: 13px;">{!v.fieldsmap.Agency_Contact__c}</span>
+
</th>
- <th
- class="table_header slds-text-title--caps"
- style="width: 100px; font-size: 13px"
- >
- <span class="slds-truncate" title="Name"
- >{!v.fieldsmap.visitor_title__c}</span
- >
+ <th class="table_header slds-text-title--caps" style="width: 100px;font-size: 13px;">
+ <span class="slds-truncate" title="Name">{!v.fieldsmap.visitor_title__c}</span>
</th>
- <th
- class="table_header slds-text-title--caps"
- style="width: 100px; font-size: 13px"
- >
- <span class="slds-truncate" title="Name"
- >{!v.fieldsmap.Purpose_Type__c}</span
- >
+ <th class="table_header slds-text-title--caps" style="width: 100px;font-size: 13px;">
+ <span class="slds-truncate" title="Name">{!v.fieldsmap.Purpose_Type__c}</span>
</th>
</tr>
</thead>
<tbody>
- <aura:iteration
- items="{!v.reports}"
- var="item"
- indexVar="index"
- >
+ <aura:iteration items="{!v.reports}" var="item" indexVar="index">
<tr class="slds-hint-parent">
<td role="gridcell" class="slds-cell-edit">
- <ui:inputRadio
- class="report_radio"
- name="report_radio"
- label="{!item.Name}"
- change="{!c.change_report_radio}"
- />
- <lightning:buttonIcon
- class="edit_button"
- iconName="utility:edit"
- size="small"
- alternativeText="edit"
- value="{!index}"
- onclick="{!c.edit_button}"
- />
+ <ui:inputRadio class="report_radio" name="report_radio" label="{!item.Name}" change="{!c.change_report_radio}"/>
+ <lightning:buttonIcon class="edit_button" iconName="utility:edit" size="small" alternativeText="edit" value="{!index}" onclick="{!c.edit_button}"/>
</td>
<td role="gridcell" class="slds-cell-edit">
<span class="slds-grid slds-grid--align-spread">
- <span
- class="slds-truncate"
- title="{!item.Person_In_Charge2__r.Name}"
- >
+ <span class="slds-truncate" title="{!item.Person_In_Charge2__r.Name}">
{!item.Person_In_Charge2__r.Name}
<!-- <span class="decrypt">{!item.Person_In_Charge2__r.awsdata.lastName}</span> -->
</span>
@@ -330,50 +196,28 @@
</th>
<td role="gridcell" class="slds-cell-edit">
<span class="slds-grid slds-grid--align-spread">
- <span
- class="slds-truncate"
- title="{!item.Department_Cateogy__c}"
- >{!item.Department_Cateogy__c}</span
- >
+ <span class="slds-truncate" title="{!item.Department_Cateogy__c}">{!item.Department_Cateogy__c}</span>
</span>
</td>
<td role="gridcell" class="slds-cell-edit">
<span class="slds-grid slds-grid--align-spread">
- <span
- class="slds-truncate"
- title="{!item.doctor2__r.Name}"
- >
- <span class="encrypt"
- >{!item.doctor2__r.Name}</span
- >
- <span class="decrypt"
- >{!item.doctor2__r.awsdata.name}</span
- >
+ <span class="slds-truncate" title="{!item.doctor2__r.Name}">
+ <span class="encrypt">{!item.doctor2__r.Name}</span>
+ <span class="decrypt">{!item.doctor2__r.awsdata.name}</span>
</span>
</span>
</td>
<td role="gridcell" class="slds-cell-edit">
<span class="slds-grid slds-grid--align-spread">
- <span
- class="slds-truncate"
- title="{!item.visitor_title__c}"
- >
- <span class="encrypt"
- >{!item.visitor_title__c}</span
- >
- <span class="decrypt"
- >{!item.doctor2__r.awsdata.doctorDivision1}</span
- >
+ <span class="slds-truncate" title="{!item.visitor_title__c}">
+ <span class="encrypt">{!item.visitor_title__c}</span>
+ <span class="decrypt">{!item.doctor2__r.awsdata.doctorDivision1}</span>
</span>
</span>
</td>
<td role="gridcell" class="slds-cell-edit">
<span class="slds-grid slds-grid--align-spread">
- <span
- class="slds-truncate"
- title="{!item.Purpose_Type__c}"
- >{!item.Purpose_Type__c}</span
- >
+ <span class="slds-truncate" title="{!item.Purpose_Type__c}">{!item.Purpose_Type__c}</span>
</span>
</td>
</tr>
@@ -383,95 +227,50 @@
</div>
<aura:renderIf isTrue="{!v.report_count > 0}">
<aura:set attribute="else">
- <div class="no_data_area">{!v.list_message}</div>
+ <div class="no_data_area">
+ {!v.list_message}
+ </div>
</aura:set>
</aura:renderIf>
</div>
<!-- <ui:button aura:id="test_button" label="test" class="fade animation_on" press="{!c.test}"/>-->
<!-- 鎵归噺娣诲姞鍛ㄦ姤 start-->
- <div
- aura:id="modal_import"
- role="dialog"
- tabindex="-1"
- class="disp_none slds-modal slds-fade-in-open slds-modal--large"
- aria-labelledby="headerTarget"
- >
- <div class="slds-modal__container">
+ <div aura:id="modal_import" role="dialog" tabindex="-1" class="disp_none slds-modal slds-fade-in-open slds-modal--large" aria-labelledby="headerTarget">
+ <div class="slds-modal__container ">
<aura:renderIf isTrue="{!v.loginEdit}">
- <lightning:spinner
- alternativeText="Loading"
- size="medium"
- style="width: 100%; height: 80%; top: 50px"
- />
+ <lightning:spinner alternativeText="Loading" size="medium" style="width: 100%; height: 80%;top:50px;" />
</aura:renderIf>
- <div class="slds-modal__header">
+ <div class="slds-modal__header ">
<h4 id="headerTarget" class="slds-float--left"></h4>
- <h2 id="headerTarget" class="slds-text-heading--medium">
- 鍛ㄦ姤鎵归噺瀵煎叆
- </h2>
- <ui:button
- aura:id="close_button"
- label="鍏抽棴"
- class="close_button slds-button slds-button--neutral slds-order--1"
- press="{!c.close_import}"
- />
+ <h2 id="headerTarget" class="slds-text-heading--medium">鍛ㄦ姤鎵归噺瀵煎叆</h2>
+ <ui:button aura:id="close_button" label="鍏抽棴" class="close_button slds-button slds-button--neutral slds-order--1" press="{!c.close_import}"/>
</div>
- <div
- class="slds-modal__content slds-scrollable slds-grow slds-p-around--medium"
- >
+ <div class="slds-modal__content slds-scrollable slds-grow slds-p-around--medium " >
<aura:if isTrue="{!v.showMain}">
<div>
<!-- <input type="file" class="file" aura:id="file" onchange="{!c.CreateRecord}" value="瀵煎叆" /> -->
- <lightning:input
- type="file"
- class="file"
- uara:id="file"
- onchange="{!c.CreateRecord}"
- />
+ <lightning:input type="file" class="file" uara:id="file" onchange="{!c.CreateRecord}" />
<!-- <ui:button label="Create Accounts" press="{!c.CreateRecord}"/> -->
</div>
<aura:set attribute="else">
<!-- <ui:outputRichText class="uiOutputRichText slds-m-around-large" value="{!v.TargetFileName}"/> -->
- <ui:outputRichText
- class="uiOutputRichText slds-m--around-large"
- value="{!v.TableContent}"
- />
- <div
- class="slds-p-around--large slds-align--absolute-center"
- >
- <lightning:button
- label="淇濆瓨"
- variant="brand"
- onclick="{!c.processFileContent}"
- />
- <lightning:button
- label="鍙栨秷"
- variant="brand"
- onclick="{!c.cancel}"
- />
+ <ui:outputRichText class="uiOutputRichText slds-m--around-large" value="{!v.TableContent}"/>
+ <div class="slds-p-around--large slds-align--absolute-center">
+ <lightning:button label="淇濆瓨" variant="brand" onclick="{!c.processFileContent}"
+ />
+ <lightning:button label="鍙栨秷" variant="brand"
+ onclick="{!c.cancel}" />
</div>
<!-- start DTT-zhj 澧炲姞閿欒淇℃伅table 2023-05-16-->
<aura:if isTrue="{!v.showErrorInfo}">
- <div
- class="slds-p-around--large slds-align--absolute-center"
- >
- <lightning:button
- label="瀵煎嚭閿欒淇℃伅"
- variant="brand"
- onclick="{!c.exportErrorInfo}"
- />
+ <div class="slds-p-around--large slds-align--absolute-center">
+ <lightning:button label="瀵煎嚭閿欒淇℃伅" variant="brand" onclick="{!c.exportErrorInfo}" />
</div>
- <div
- class="slds-p-around--large slds-align--absolute-center"
- >
- <div style="height: 300px; overflow-x: scroll">
- <lightning:datatable
- keyField="id"
- data="{! v.errorData }"
- columns="{! v.errorColumns }"
- hideCheckboxColumn="true"
- />
+ <div class="slds-p-around--large slds-align--absolute-center">
+ <div style="height: 300px;overflow-x:scroll">
+ <lightning:datatable keyField="id" data="{! v.errorData }"
+ columns="{! v.errorColumns }" hideCheckboxColumn="true" />
</div>
</div>
</aura:if>
@@ -481,78 +280,39 @@
</div>
</div>
</div>
- <div
- aura:id="modal_importbg"
- class="disp_none slds-backdrop slds-backdrop--open"
- ></div>
+ <div aura:id="modal_importbg" class="disp_none slds-backdrop slds-backdrop--open"></div>
<!-- 鎵归噺娣诲姞鍛ㄦ姤 end-->
<!-- 鎵归噺瀵煎嚭鍛ㄦ姤 start-->
- <div
- aura:id="modal_export"
- role="dialog"
- tabindex="-1"
- class="disp_none slds-modal slds-fade-in-open slds-modal--large"
- >
+ <div aura:id="modal_export" role="dialog" tabindex="-1" class="disp_none slds-modal slds-fade-in-open slds-modal--large" >
<div class="slds-modal__container">
<div class="slds-modal__header">
<h4 id="headerTarget" class="slds-float--left"></h4>
- <h2 id="headerTarget" class="slds-text-heading--medium">
- 鍛ㄦ姤鎵归噺瀵煎嚭
- </h2>
- <ui:button
- aura:id="close_button"
- label="鍏抽棴"
- class="close_button slds-button slds-button--neutral slds-order--1"
- press="{!c.close_export}"
- />
+ <h2 id="headerTarget" class="slds-text-heading--medium">鍛ㄦ姤鎵归噺瀵煎嚭</h2>
+ <ui:button aura:id="close_button" label="鍏抽棴" class="close_button slds-button slds-button--neutral slds-order--1" press="{!c.close_export}"/>
</div>
- <div
- class="slds-modal__content slds-scrollable slds-grow slds-p-around--medium"
- >
+ <div class="slds-modal__content slds-scrollable slds-grow slds-p-around--medium">
<aura:if isTrue="{!v.showMain}">
- <div class="slds-grid slds-wrap slds-grid--pull-padded">
- <div
- class="slds-p-horizontal--small slds-size--1-of-1 slds-medium-size--1-of-5 slds-large-size--1-of-4"
- ></div>
- <div
- class="slds-p-horizontal--small slds-size--1-of-1 slds-medium-size--1-of-5 slds-large-size--1-of-4"
- >
+ <div class="slds-grid slds-wrap slds-grid--pull-padded" >
+ <div class="slds-p-horizontal--small slds-size--1-of-1 slds-medium-size--1-of-5 slds-large-size--1-of-4">
+ </div>
+ <div class="slds-p-horizontal--small slds-size--1-of-1 slds-medium-size--1-of-5 slds-large-size--1-of-4">
娲诲姩鏃ュ紑濮嬫棩鏈�
-
- <lightning:input
- type="Date"
- class="slds-input slds-input_bare"
- aura:id="input-report-date1"
- />
+
+ <lightning:input type="Date" class="slds-input slds-input_bare " aura:id="input-report-date1" />
</div>
- <div
- class="slds-p-horizontal--small slds-size--1-of-1 slds-medium-size--1-of-5 slds-large-size--1-of-4"
- >
+ <div class="slds-p-horizontal--small slds-size--1-of-1 slds-medium-size--1-of-5 slds-large-size--1-of-4">
娲诲姩鏃ョ粨鏉熸棩鏈�
- <lightning:input
- type="Date"
- class="slds-input slds-input_bare"
- aura:id="input-report-date2"
- />
+ <lightning:input type="Date" class="slds-input slds-input_bare " aura:id="input-report-date2" />
</div>
- <div
- class="slds-p-horizontal--small slds-size--1-of-1 slds-medium-size--1-of-5 slds-large-size--1-of-4"
- ></div>
+ <div class="slds-p-horizontal--small slds-size--1-of-1 slds-medium-size--1-of-5 slds-large-size--1-of-4">
+ </div>
- <div
- class="slds-p-around--large slds-align--absolute-center"
- >
- <lightning:button
- label="纭"
- variant="brand"
- onclick="{!c.select_repores_date}"
- />
- <lightning:button
- label="鍙栨秷"
- variant="brand"
- onclick="{!c.close_export}"
- />
+ <div class="slds-p-around--large slds-align--absolute-center">
+ <lightning:button label="纭" variant="brand" onclick="{!c.select_repores_date}"
+ />
+ <lightning:button label="鍙栨秷" variant="brand"
+ onclick="{!c.close_export}" />
</div>
</div>
<!-- <div>
@@ -565,116 +325,54 @@
onclick="{!c.close_export}" />
</div> -->
<aura:set attribute="else">
- <ui:outputRichText
- class="uiOutputRichText slds-m--around-large"
- value="{!v.TableContent2}"
- />
- <div
- class="slds-p-around--large slds-align--absolute-center"
- >
- <lightning:button
- label="纭"
- variant="brand"
- onclick="{!c.exportDate}"
- />
- <lightning:button
- label="鍙栨秷"
- variant="brand"
- onclick="{!c.close_export}"
- />
+ <ui:outputRichText class="uiOutputRichText slds-m--around-large" value="{!v.TableContent2}"/>
+ <div class="slds-p-around--large slds-align--absolute-center">
+ <lightning:button label="纭" variant="brand" onclick="{!c.exportDate}"
+ />
+ <lightning:button label="鍙栨秷" variant="brand"
+ onclick="{!c.close_export}" />
</div>
+
</aura:set>
</aura:if>
</div>
</div>
</div>
- <div
- aura:id="modal_exportbg"
- class="disp_none slds-backdrop slds-backdrop--open"
- ></div>
+ <div aura:id="modal_exportbg" class="disp_none slds-backdrop slds-backdrop--open"></div>
<!-- 鎵归噺瀵煎嚭鍛ㄦ姤 end-->
- <div
- aura:id="modal_window"
- role="dialog"
- tabindex="-1"
- class="disp_none slds-modal slds-fade-in-open slds-modal--large"
- aria-labelledby="headerTarget"
- >
- <div class="slds-modal__container">
+ <div aura:id="modal_window" role="dialog" tabindex="-1" class="disp_none slds-modal slds-fade-in-open slds-modal--large" aria-labelledby="headerTarget">
+ <div class="slds-modal__container" >
<aura:renderIf isTrue="{!v.loginEdit}">
- <lightning:spinner
- alternativeText="Loading"
- size="medium"
- style="width: 100%; height: 80%; top: 50px"
- />
+ <lightning:spinner alternativeText="Loading" size="medium" style="width: 100%; height: 80%;top:50px;" />
</aura:renderIf>
<div class="slds-modal__header">
<h4 id="headerTarget" class="slds-float--left"></h4>
- <h2 id="headerTarget" class="slds-text-heading--medium">
- 鍛ㄦ姤({!v.selected_date} {!v.selected_agency_person})
- </h2>
- <ui:button
- aura:id="close_button"
- label="鍏抽棴"
- class="close_button slds-button slds-button--neutral slds-order--1"
- press="{!c.toggle_report}"
- />
+ <h2 id="headerTarget" class="slds-text-heading--medium">鍛ㄦ姤({!v.selected_date} {!v.selected_agency_person})</h2>
+ <ui:button aura:id="close_button" label="鍏抽棴" class="close_button slds-button slds-button--neutral slds-order--1" press="{!c.toggle_report}"/>
</div>
<div class="slds-modal__content slds-grow slds-p-around--medium">
<div class="slds-box slds-theme--shade">
- <div class="slds-grid slds-wrap slds-grid--pull-padded">
- <div
- class="slds-p-horizontal--small slds-size--1-of-1 slds-medium-size--1-of-5 slds-large-size--1-of-6 marginTop"
- >
+ <div class="slds-grid slds-wrap slds-grid--pull-padded" >
+ <div class="slds-p-horizontal--small slds-size--1-of-1 slds-medium-size--1-of-5 slds-large-size--1-of-6 marginTop" >
娲诲姩鏃�
<!-- <ui:inputSelect aura:id="select_opportunity" class="slds-select"/> -->
<!-- <force:inputField value="{!v.data.Report_Date__c}" aura:id="input-report-date"/> -->
- <lightning:input
- type="date"
- value="{!v.data.Report_Date__c}"
- aura:id="input-report-date"
- variant="label-hidden"
- />
+ <lightning:input type="date" value="{!v.data.Report_Date__c}" aura:id="input-report-date"
+ variant="label-hidden" />
</div>
<!-- 鍖婚櫌 -->
- <div
- aura:id="hospital_list"
- class="slds-form-element slds-lookup slds-p-horizontal--small slds-size--1-of-1 slds-medium-size--1-of-5 slds-large-size--1-of-5 marginTop"
- data-select="single"
- >
+ <div aura:id="hospital_list" class="slds-form-element slds-lookup slds-p-horizontal--small slds-size--1-of-1 slds-medium-size--1-of-5 slds-large-size--1-of-5 marginTop" data-select="single">
<!-- <ui:inputText aura:id="hospital_input_text" label="鍖婚櫌" class="field" value="{!v.hospital}" updateOn="keyup"/> -->
鍖婚櫌
- <lightning:input
- aura:id="hospital_input_text"
- class="field"
- value="{!v.hospital}"
- variant="label-hidden"
- updateOn="keyup"
- />
+ <lightning:input aura:id="hospital_input_text" class="field" value="{!v.hospital}" variant="label-hidden" updateOn="keyup"/>
<div class="slds-lookup__menu" id="lookup-66">
<ul class="slds-lookup__list" role="listbox">
- <aura:iteration
- var="hospital"
- items="{!v.hospitalList}"
- >
- <li
- role="presentation"
- onclick="{!c.selectHos}"
- data-accName="{!hospital.Hospital_Name_readonly__c}"
- data-accId="{!hospital.Hospital__c}"
- >
- <span
- class="slds-lookup__item-action slds-media"
- id="lookup-option-498"
- role="option"
- >
+ <aura:iteration var="hospital" items="{!v.hospitalList}">
+ <li role="presentation" onclick="{!c.selectHos}" data-accName="{!hospital.Hospital_Name_readonly__c}" data-accId="{!hospital.Hospital__c}">
+ <span class="slds-lookup__item-action slds-media" id="lookup-option-498" role="option">
<div class="slds-media__body">
- <div
- class="slds-lookup__result-text"
- >
- {!hospital.Hospital_Name_readonly__c}
- </div>
+ <div class="slds-lookup__result-text">{!hospital.Hospital_Name_readonly__c}</div>
</div>
</span>
</li>
@@ -682,379 +380,176 @@
</ul>
</div>
</div>
-
+
<!-- 绉戝鍒嗙被 -->
- <div
- class="slds-p-horizontal--small slds-size--1-of-1 slds-medium-size--1-of-5 slds-large-size--1-of-8 marginTop"
- >
+ <div class="slds-p-horizontal--small slds-size--1-of-1 slds-medium-size--1-of-5 slds-large-size--1-of-8 marginTop">
{!v.fieldsmap.Department_Cateogy__c}
- <ui:inputSelect
- aura:id="select_department"
- class="slds-select"
- change="{!c.select_department}"
- />
+ <ui:inputSelect aura:id="select_department" class="slds-select" change="{!c.select_department}"/>
</div>
-
+
<!-- 鍏堢敓 -->
- <div
- class="slds-p-horizontal--small slds-size--1-of-1 slds-medium-size--1-of-5 slds-large-size--1-of-8 marginTop"
- >
+ <div class="slds-p-horizontal--small slds-size--1-of-1 slds-medium-size--1-of-5 slds-large-size--1-of-8 marginTop">
{!v.fieldsmap.doctor2__c}
- <ui:inputSelect
- aura:id="select_doctor"
- class="slds-select"
- change="{!c.doctor_change}"
- />
+ <ui:inputSelect aura:id="select_doctor" class="slds-select" change="{!c.doctor_change}"/>
</div>
-
- <div
- class="slds-p-horizontal--small slds-size--1-of-1 slds-medium-size--1-of-5 slds-large-size--1-of-12 marginTop"
- >
- <br />
- <ui:button
- label="鏂板缓"
- class="slds-button"
- press="{!c.createCon}"
- disabled="true"
- aura:id="new_con"
- />
+
+ <div class="slds-p-horizontal--small slds-size--1-of-1 slds-medium-size--1-of-5 slds-large-size--1-of-12 marginTop">
+ <br/>
+ <ui:button label="鏂板缓" class="slds-button" press="{!c.createCon}" disabled="true" aura:id="new_con"/>
</div>
-
+
<!-- 鑱屼綅 -->
- <div
- class="slds-p-horizontal--small slds-size--1-of-1 slds-medium-size--1-of-5 slds-large-size--1-of-8 marginTop"
- >
+ <div class="slds-p-horizontal--small slds-size--1-of-1 slds-medium-size--1-of-5 slds-large-size--1-of-8 marginTop">
{!v.fieldsmap.visitor_title__c}
<div>{!v.doctor_title}</div>
- </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 marginTop"
- >
+ <div class="slds-p-horizontal--small slds-size--1-of-1 slds-medium-size--1-of-5 slds-large-size--1-of-6 marginTop">
{!v.fieldsmap.Purpose_Type__c}
- <ui:inputSelect
- aura:id="select_purpose_type"
- class="slds-select"
- change="{!c.select_purpose_type}"
- />
+ <ui:inputSelect aura:id="select_purpose_type" class="slds-select" change="{!c.select_purpose_type}"/>
</div>
<!-- 璇环 -->
- <div
- aura:id="input-opportunity-opp"
- class="slds-p-horizontal--small slds-size--1-of-1 slds-medium-size--4-of-12 slds-large-size--4-of-12 marginTop"
- >
+ <div aura:id="input-opportunity-opp" class="slds-p-horizontal--small slds-size--1-of-1 slds-medium-size--4-of-12 slds-large-size--4-of-12 marginTop">
{!v.fieldsmap.Opportunity__c}
<!-- <ui:inputSelect aura:id="select_opportunity" class="slds-select"/> -->
<!-- <force:inputField value="{!v.data.Opportunity__c}" aura:id="input-opportunity"/> -->
- <c:strike_lookup
- label=""
- object="Agency_Opportunity__c"
- searchField="Name"
- placeholder="鎼滅储缁忛攢鍟嗚浠�..."
- iconName="standard:opportunity"
- subtitleField="Department_Cateogy__c,Agency_Opportunity_No__c,Change_To_Opportunity__r.Name"
- order="StageName__c"
- limit="5"
- loadingMessage="Loading..."
- errorMessage="Invalid input"
- allowNewRecords="true"
- overrideNewEvent="true"
- showRecentRecords="true"
- value="{!v.data.Opportunity__c}"
- filter="{!v.opportunity_cfilter}"
- subTitleFormat="{0}+{1}+{2}"
- />
+ <c:strike_lookup label=""
+ object="Agency_Opportunity__c"
+ searchField="Name"
+ placeholder="鎼滅储缁忛攢鍟嗚浠�..."
+ iconName="standard:opportunity"
+ subtitleField="Department_Cateogy__c,Agency_Opportunity_No__c,Change_To_Opportunity__r.Name"
+ order="StageName__c"
+ limit="5"
+ loadingMessage="Loading..."
+ errorMessage="Invalid input"
+ allowNewRecords = "true"
+ overrideNewEvent = "true"
+ showRecentRecords ="true"
+ value="{!v.data.Opportunity__c}"
+ filter="{!v.opportunity_cfilter}"
+ subTitleFormat="{0}+{1}+{2}"/>
</div>
- <div
- aura:id="input-opportunity-blank"
- class="lds-p-horizontal--small slds-size--1-of-1 slds-medium-size--8-of-12 slds-large-size--8-of-12 marginTop"
- ></div>
- <div
- aura:id="input-opportunity-stage"
- class="disp_none slds-p-horizontal--small slds-size--1-of-1 slds-medium-size--2-of-12 slds-large-size--2-of-12 marginTop"
- >
+ <div aura:id="input-opportunity-blank" class="lds-p-horizontal--small slds-size--1-of-1 slds-medium-size--8-of-12 slds-large-size--8-of-12 marginTop">
+ </div>
+ <div aura:id="input-opportunity-stage" class="disp_none slds-p-horizontal--small slds-size--1-of-1 slds-medium-size--2-of-12 slds-large-size--2-of-12 marginTop">
{!v.fieldsmap.StageName__c}
<!-- <ui:inputSelect aura:id="select_opportunity" class="slds-select"/> -->
- <ui:inputSelect
- aura:id="select_stageName"
- class="slds-select"
- />
+ <ui:inputSelect aura:id="select_stageName" class="slds-select"/>
<!-- <force:inputField value="{!v.oppdata.StageName__c}" aura:id="input-oppstage" /> -->
</div>
- <div
- aura:id="input-opportunity-amount1"
- class="disp_none slds-p-horizontal--small slds-size--1-of-1 slds-medium-size--2-of-12 slds-large-size--2-of-12 marginTop"
- >
+ <div aura:id="input-opportunity-amount1" class="disp_none slds-p-horizontal--small slds-size--1-of-1 slds-medium-size--2-of-12 slds-large-size--2-of-12 marginTop">
{!v.fieldsmap.Amount__c}
<!-- <ui:inputSelect aura:id="select_opportunity" class="slds-select"/> -->
- <force:inputField
- value="{!v.oppdata.Amount__c}"
- class=""
- />
+ <force:inputField value="{!v.oppdata.Amount__c}" class=""/>
</div>
- <div
- aura:id="input-opportunity-amount2"
- class="disp_none slds-p-horizontal--small slds-size--1-of-1 slds-medium-size--2-of-12 slds-large-size--2-of-12 marginTop"
- >
+ <div aura:id="input-opportunity-amount2" class="disp_none slds-p-horizontal--small slds-size--1-of-1 slds-medium-size--2-of-12 slds-large-size--2-of-12 marginTop">
{!v.fieldsmap.OCMSale_Price__c}
<!-- <ui:inputSelect aura:id="select_opportunity" class="slds-select"/> -->
- <force:inputField
- value="{!v.oppdata.OCMSale_Price__c}"
- class=""
- />
+ <force:inputField value="{!v.oppdata.OCMSale_Price__c}" class=""/>
</div>
- <div
- aura:id="input-opportunity-date"
- class="disp_none slds-p-horizontal--small slds-size--1-of-1 slds-medium-size--2-of-12 slds-large-size--2-of-12 marginTop"
- >
+ <div aura:id="input-opportunity-date" class="disp_none slds-p-horizontal--small slds-size--1-of-1 slds-medium-size--2-of-12 slds-large-size--2-of-12 marginTop">
{!v.fieldsmap.Close_Forecasted_Date__c}
<!-- <ui:inputSelect aura:id="select_opportunity" class="slds-select"/> -->
- <force:inputField
- value="{!v.oppdata.Close_Forecasted_Date__c}"
- class=""
- />
+ <force:inputField value="{!v.oppdata.Close_Forecasted_Date__c}" class=""/>
</div>
<!-- 瑁藉搧鍒嗛 -->
- <div
- aura:id="product_category_select1"
- class="slds-p-horizontal--small slds-size--1-of-1 slds-medium-size--3-of-12 slds-large-size--3-of-12 marginTop"
- >
+ <div aura:id="product_category_select1" class="slds-p-horizontal--small slds-size--1-of-1 slds-medium-size--3-of-12 slds-large-size--3-of-12 marginTop">
{!v.fieldsmap.Product_Category1__c}
<!-- <force:inputField value="{!v.data.Product_Category1__c}" aura:id="input-product-category1"/> -->
- <ui:inputSelect
- aura:id="select_Product1"
- class="slds-select"
- change="{!c.productcategoryChange1}"
- />
+ <ui:inputSelect aura:id="select_Product1" class="slds-select" change="{!c.productcategoryChange1}"/>
</div>
- <div
- aura:id="product_category_select2"
- class="slds-p-horizontal--small slds-size--1-of-1 slds-medium-size--3-of-12 slds-large-size--3-of-12 marginTop"
- >
+ <div aura:id="product_category_select2" class="slds-p-horizontal--small slds-size--1-of-1 slds-medium-size--3-of-12 slds-large-size--3-of-12 marginTop">
{!v.fieldsmap.Product_Category2__c}
<!-- <force:inputField value="{!v.data.Product_Category2__c}" aura:id="input-product-category2"/> -->
- <ui:inputSelect
- aura:id="select_Product2"
- class="slds-select"
- change="{!c.productcategoryChange2}"
- />
+ <ui:inputSelect aura:id="select_Product2" class="slds-select" change="{!c.productcategoryChange2}"/>
</div>
- <div
- aura:id="product_category_select3"
- class="slds-p-horizontal--small slds-size--1-of-1 slds-medium-size--3-of-12 slds-large-size--3-of-12 marginTop"
- >
+ <div aura:id="product_category_select3" class="slds-p-horizontal--small slds-size--1-of-1 slds-medium-size--3-of-12 slds-large-size--3-of-12 marginTop">
{!v.fieldsmap.Product_Category3__c}
<!-- <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}"
- />
+ <ui:inputSelect aura:id="select_Product3" class="slds-select" change="{!c.productcategoryChange3}"/>
</div>
<!--SWAG-CBX68C fy 銆愬鎵樸�慏AMS绯荤粺鍛ㄦ姤妯″潡鍐呭闇�姹傚鍔� start-->
<!-- 鏀彺闇�姹� change="{!c.SupportNeeds__c}"-->
- <div
- class="slds-p-horizontal--small slds-size--1-of-1 slds-medium-size--1-of-5 slds-large-size--1-of-6 marginTop"
- >
+ <div class="slds-p-horizontal--small slds-size--1-of-1 slds-medium-size--1-of-5 slds-large-size--1-of-6 marginTop">
{!v.fieldsmap.SupportNeeds__c}
- <ui:inputSelect
- aura:id="SupportNeeds__c"
- class="slds-select"
- />
+ <ui:inputSelect aura:id="SupportNeeds__c" class="slds-select" />
</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 marginTop"
- >
+ <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 marginTop">
{!v.fieldsmap.Result__c}
- <ui:inputSelect
- aura:id="select_result"
- class="slds-select"
- />
+ <ui:inputSelect aura:id="select_result" class="slds-select"/>
<!-- <ui:inputText label="缁撴灉" class="bcolor" value="{!v.result}"/> -->
</div>
</div>
</div>
<div class="save_button_area">
- <ui:button
- aura:id="save_button"
- label="淇濆瓨骞舵柊寤�"
- class="save_button slds-button slds-button--brand slds-order--3"
- press="{!c.save_report}"
- />
+ <ui:button aura:id="save_button" label="淇濆瓨骞舵柊寤�" class="save_button slds-button slds-button--brand slds-order--3" press="{!c.save_report}"/>
</div>
-
+
<aura:renderIf isTrue="{!v.reports_now_count > 0}">
<div class="mt40 slds-box slds-theme--shade">
- <div
- class="slds-table--edit_container slds-is-relative"
- >
- <table
- class="slds-table slds-table--edit slds-table--bordered slds-table--fixed-layout slds-no-cell-focus"
- role="grid"
- >
+ <div class="slds-table--edit_container slds-is-relative">
+ <table class="slds-table slds-table--edit slds-table--bordered slds-table--fixed-layout slds-no-cell-focus" role="grid">
<thead>
<tr class="slds-line-height--reset">
- <th
- class="table_header slds-text-title--caps"
- >
- <span
- class="slds-truncate"
- title="Name"
- ></span>
+ <th class="table_header slds-text-title--caps">
+ <span class="slds-truncate" title="Name"></span>
</th>
- <th
- class="table_header slds-text-title--caps"
- >
- <span
- class="slds-truncate"
- title="Name"
- >鍖婚櫌</span
- >
+ <th class="table_header slds-text-title--caps">
+ <span class="slds-truncate" title="Name">鍖婚櫌</span>
</th>
- <th
- class="table_header slds-text-title--caps"
- >
- <span
- class="slds-truncate"
- title="Name"
- >{!v.fieldsmap.Department_Cateogy__c}</span
- >
+ <th class="table_header slds-text-title--caps">
+ <span class="slds-truncate" title="Name">{!v.fieldsmap.Department_Cateogy__c}</span>
</th>
- <th
- class="table_header slds-text-title--caps"
- >
- <span
- class="slds-truncate"
- title="Name"
- >{!v.fieldsmap.doctor2__c}</span
- >
+ <th class="table_header slds-text-title--caps">
+ <span class="slds-truncate" title="Name">{!v.fieldsmap.doctor2__c}</span>
</th>
- <th
- class="table_header slds-text-title--caps"
- >
- <span
- class="slds-truncate"
- title="Name"
- >{!v.fieldsmap.visitor_title__c}</span
- >
+ <th class="table_header slds-text-title--caps">
+ <span class="slds-truncate" title="Name">{!v.fieldsmap.visitor_title__c}</span>
</th>
- <th
- class="table_header slds-text-title--caps"
- >
- <span
- class="slds-truncate"
- title="Name"
- >{!v.fieldsmap.Purpose_Type__c}</span
- >
+ <th class="table_header slds-text-title--caps">
+ <span class="slds-truncate" title="Name">{!v.fieldsmap.Purpose_Type__c}</span>
</th>
</tr>
</thead>
<tbody>
- <aura:iteration
- items="{!v.reports_now}"
- var="item"
- indexVar="index"
- >
- <tr
- aura:id="modal_data_list_tr"
- class="slds-hint-parent"
- >
- <td
- role="gridcell"
- class="slds-cell-edit"
- >
- <span
- class="slds-grid slds-grid--align-spread"
- >
- <span
- class="slds-truncate"
- title="{!item.Department_Cateogy__c}"
- >{!item.Name}</span
- >
+ <aura:iteration items="{!v.reports_now}" var="item" indexVar="index">
+ <tr aura:id="modal_data_list_tr" class="slds-hint-parent">
+ <td role="gridcell" class="slds-cell-edit">
+ <span class="slds-grid slds-grid--align-spread">
+ <span class="slds-truncate" title="{!item.Department_Cateogy__c}">{!item.Name}</span>
</span>
</td>
- <td
- role="gridcell"
- class="slds-cell-edit"
- >
- <span
- class="slds-grid slds-grid--align-spread"
- >
- <span
- class="slds-truncate"
- title="{!item.Agency_Hospital__r.Name}"
- >{!item.Agency_Hospital__r.Name}</span
- >
+ <td role="gridcell" class="slds-cell-edit">
+ <span class="slds-grid slds-grid--align-spread">
+ <span class="slds-truncate" title="{!item.Agency_Hospital__r.Name}">{!item.Agency_Hospital__r.Name}</span>
</span>
</td>
- <td
- role="gridcell"
- class="slds-cell-edit"
- >
- <span
- class="slds-grid slds-grid--align-spread"
- >
- <span
- class="slds-truncate"
- title="{!item.Department_Cateogy__c}"
- >{!item.Department_Cateogy__c}</span
- >
+ <td role="gridcell" class="slds-cell-edit">
+ <span class="slds-grid slds-grid--align-spread">
+ <span class="slds-truncate" title="{!item.Department_Cateogy__c}">{!item.Department_Cateogy__c}</span>
</span>
</td>
- <td
- role="gridcell"
- class="slds-cell-edit"
- >
- <span
- class="slds-grid slds-grid--align-spread"
- >
- <span
- class="slds-truncate"
- title="{!item.doctor2__r.Name}"
- >
- <span class="encrypt"
- >{!item.doctor2__r.Name}</span
- >
- <span class="decrypt"
- >{!item.doctor2NameOrigin}</span
- >
+ <td role="gridcell" class="slds-cell-edit">
+ <span class="slds-grid slds-grid--align-spread">
+ <span class="slds-truncate" title="{!item.doctor2__r.Name}">
+ <span class="encrypt">{!item.doctor2__r.Name}</span>
+ <span class="decrypt">{!item.doctor2NameOrigin}</span>
</span>
</span>
</td>
- <td
- role="gridcell"
- class="slds-cell-edit"
- >
- <span
- class="slds-grid slds-grid--align-spread"
- >
- <span
- class="slds-truncate"
- title="{!item.visitor_title__c}"
- >
- <span class="encrypt"
- >{!item.visitor_title__c}</span
- >
- <span class="decrypt"
- >{!item.visitorTitleOrigin}</span
- >
+ <td role="gridcell" class="slds-cell-edit">
+ <span class="slds-grid slds-grid--align-spread">
+ <span class="slds-truncate" title="{!item.visitor_title__c}">
+ <span class="encrypt">{!item.visitor_title__c}</span>
+ <span class="decrypt">{!item.visitorTitleOrigin}</span>
</span>
</span>
</td>
- <td
- role="gridcell"
- class="slds-cell-edit"
- >
- <span
- class="slds-grid slds-grid--align-spread"
- >
- <span
- class="slds-truncate"
- title="{!item.Purpose_Type__c}"
- >{!item.Purpose_Type__c}</span
- >
+ <td role="gridcell" class="slds-cell-edit">
+ <span class="slds-grid slds-grid--align-spread">
+ <span class="slds-truncate" title="{!item.Purpose_Type__c}">{!item.Purpose_Type__c}</span>
</span>
</td>
</tr>
@@ -1067,112 +562,58 @@
</div>
</div>
</div>
- <div
- aura:id="modal_bg"
- class="disp_none slds-backdrop slds-backdrop--open"
- ></div>
-
- <div
- aura:id="modal_confirm"
- role="dialog"
- tabindex="-2"
- aria-labelledby="header43"
- class="disp_none slds-modal slds-fade-in-open"
- >
+ <div aura:id="modal_bg" class="disp_none slds-backdrop slds-backdrop--open"></div>
+
+ <div aura:id="modal_confirm" role="dialog" tabindex="-2" aria-labelledby="header43" class="disp_none slds-modal slds-fade-in-open">
<div class="slds-modal__container">
<div class="slds-modal__header">
- <h2 id="header43" class="slds-text-heading--medium">
- {!v.modal_confirm_title}
- </h2>
+ <h2 id="header43" class="slds-text-heading--medium">{!v.modal_confirm_title}</h2>
</div>
<div class="slds-modal__content slds-p-around--medium">
<p>{!v.modal_confirm_text}</p>
</div>
<div class="slds-modal__footer">
- <ui:button
- label="鏄�"
- class="slds-button slds-button--brand"
- press="{!c.yes_button}"
- />
- <ui:button
- label="鍚�"
- class="slds-button slds-button--neutral"
- press="{!c.no_button}"
- />
+ <ui:button label="鏄�" class="slds-button slds-button--brand" press="{!c.yes_button}"/>
+ <ui:button label="鍚�" class="slds-button slds-button--neutral" press="{!c.no_button}" />
</div>
</div>
</div>
- <div
- aura:id="modal_confirm_bg"
- class="disp_none slds-backdrop slds-backdrop--open"
- ></div>
+ <div aura:id="modal_confirm_bg" class="disp_none slds-backdrop slds-backdrop--open"></div>
- <div
- aura:id="modal_newAC"
- role="dialog"
- tabindex="-3"
- aria-labelledby="headertest"
- class="disp_none slds-modal slds-fade-in-open"
- >
+ <div aura:id="modal_newAC" role="dialog" tabindex="-3" aria-labelledby="headertest" class="disp_none slds-modal slds-fade-in-open">
<div class="slds-modal__container">
<aura:renderIf isTrue="{!v.loginEdit}">
- <lightning:spinner
- alternativeText="Loading"
- size="medium"
- style="width: 100%; height: 80%; top: 50px"
- />
+ <lightning:spinner alternativeText="Loading" size="medium" style="width: 100%; height: 80%;top:50px;" />
</aura:renderIf>
<div class="slds-modal__header">
- <h2 id="headertest" class="slds-text-heading--medium">
- 鏂板缓.瀹㈡埛浜哄憳
- </h2>
+ <h2 id="headertest" class="slds-text-heading--medium">鏂板缓.瀹㈡埛浜哄憳</h2>
</div>
<div class="slds-modal__content slds-p-around--medium">
- <lightning:recordEditForm
- aura:id="recordEditForm"
- objectApiName="Agency_Contact__c"
- onsuccess="{!c.handleSuccess}"
- onload="{!c.showRequiredFields}"
- onsubmit="{!c.handleSubmit}"
- >
- <lightning:messages aura:id="OppMessage" />
+ <lightning:recordEditForm aura:id="recordEditForm" objectApiName="Agency_Contact__c" onsuccess="{!c.handleSuccess}" onload="{!c.showRequiredFields}" onsubmit="{!c.handleSubmit}">
+ <lightning:messages aura:id="OppMessage" />
<!-- onload="{!c.showRequiredFields}" -->
<aura:renderIf isTrue="{!v.truthy}">
- <lightning:inputField
- fieldName="Name"
- aura:id="newOpportunityField"
- />
- <lightning:inputField
- fieldName="Type__c"
- aura:id="newOpportunityField"
- />
- <lightning:inputField
- fieldName="Doctor_Division1__c"
- aura:id="newOpportunityField"
- />
+ <lightning:inputField fieldName="Name" aura:id="newOpportunityField" />
+ <lightning:inputField fieldName="Type__c" aura:id="newOpportunityField" />
+ <lightning:inputField fieldName="Doctor_Division1__c" aura:id="newOpportunityField" />
<!-- <lightning:inputField class="customRequired none" aura:id="Input_type__c" fieldName="Type__c"/>
<lightning:inputField class="customRequired none" aura:id="Input_Doctor_Division1__c" fieldName="Doctor_Division1__c"/> -->
</aura:renderIf>
- <br />
- <br />
- <br />
- <br />
- <br />
+ <br/>
+ <br/>
+ <br/>
+ <br/>
+ <br/>
<div class="save_button_area">
- <lightning:button
- class="slds-m-top_small"
- type="button"
- label="鍙栨秷"
- onclick="{!c.createCancel}"
- />
- <lightning:button
- class="slds-m-top_small"
- type="submit"
- label="鏂板缓"
- />
+ <lightning:button class="slds-m-top_small" type="button" label="鍙栨秷" onclick="{!c.createCancel}"/>
+ <lightning:button class="slds-m-top_small" type="submit" label="淇濆瓨" />
</div>
- </lightning:recordEditForm>
+
+
+ </lightning:recordEditForm>
</div>
</div>
</div>
-</aura:component>
+
+
+</aura:component>
\ No newline at end of file
diff --git a/force-app/main/default/aura/WeeklyReport/WeeklyReport.css b/force-app/main/default/aura/WeeklyReport/WeeklyReport.css
index 7e0b372..19e31fe 100644
--- a/force-app/main/default/aura/WeeklyReport/WeeklyReport.css
+++ b/force-app/main/default/aura/WeeklyReport/WeeklyReport.css
@@ -21,7 +21,7 @@
}
.THIS .no_data_area {
text-align: center;
- margin: 0.5em 0;
+ margin: .5em 0;
}
.THIS.report_list_area {
margin: 40px 0 20px 0px;
@@ -99,72 +99,71 @@
.THIS .animation_on {
opacity: 1;
}
-.THIS .divbotuser {
- width: fit-content;
+.THIS .divbotuser{
+ width:fit-content;
}
-.THIS .toastMessage.forceActionsText {
- white-space: pre-line !important;
+.THIS .toastMessage.forceActionsText{
+ white-space : pre-line !important;
}
-.THIS .slds-file-selector__dropzone .slds-file-selector__text {
+.THIS .slds-file-selector__dropzone .slds-file-selector__text{
display: none;
}
-.THIS .slds-input:focus,
-.THIS .slds-input:active {
- border-color: rgb(216, 221, 230);
- box-shadow: none;
+.THIS .slds-input:focus, .THIS .slds-input:active {
+ border-color: rgb(216, 221, 230);
+ box-shadow: none;
}
-.THIS .customRequired {
- font-weight: 400;
+.THIS .customRequired{
+ font-weight: 400;
+}
+.THIS .customRequired:before{
+ content: "*";
+ margin: 0 0.125rem 0 0.125rem;
+ color: rgb(194, 57, 52);
+ float: left;
+}
+.THIS .none{
+ display:none;
}
-.THIS .customRequired:before {
- content: '*';
- margin: 0 0.125rem 0 0.125rem;
- color: rgb(194, 57, 52);
- float: left;
-}
-.THIS .none {
+
+.THIS tr .decrypt{
display: none;
}
-.THIS tr .decrypt {
- display: none;
-}
-
-.THIS tr:hover .decrypt {
+.THIS tr:hover .decrypt{
display: unset;
}
-.THIS tr:hover .encrypt {
+.THIS tr:hover .encrypt{
display: none;
}
/* add by Deloitte-Link 2023-6-19 start*/
-.THIS .weeklyReportSpinner {
- top: 100px;
+.THIS .weeklyReportSpinner{
+ top:100px;
}
-.THIS .weeklyReportSpinnerEdit {
- top: 50px;
+.THIS .weeklyReportSpinnerEdit{
+ top:50px;
}
-.THIS .slds-spinner_container {
+.THIS .slds-spinner_container{
position: absolute;
- top: 100px;
+ top:100px;
}
-.THIS .slds-spinner_containerEdit {
+.THIS .slds-spinner_containerEdit{
position: absolute;
- top: 50px;
+ top:50px;
}
-.THIS .marginTop {
+.THIS .marginTop{
margin-top: 10px;
}
.THIS .custom-input .uiInput {
- height: 2rem;
+ height: 2rem;
}
-/* add by Deloitte-Link 2023-6-19 end*/
+/* add by Deloitte-Link 2023-6-19 end*/
\ No newline at end of file
diff --git a/force-app/main/default/aura/WeeklyReport/WeeklyReportController.js b/force-app/main/default/aura/WeeklyReport/WeeklyReportController.js
index 5e2cad0..435e472 100644
--- a/force-app/main/default/aura/WeeklyReport/WeeklyReportController.js
+++ b/force-app/main/default/aura/WeeklyReport/WeeklyReportController.js
@@ -1,58 +1,58 @@
({
- doInit: function (component, event, helper) {
+ doInit : function(component, event, helper) {
console.log('zhj 鏂版柟妗坵eeklyReport');
- if (window.location.href.endsWith('weekly-report')) {
+ if (window.location.href.endsWith("weekly-report")) {
helper.doinit(component, event, helper);
} else {
helper.hideCmp(component, event, helper);
}
- component.set('v.showErrorInfo', false);
+ component.set("v.showErrorInfo", false);
},
- createAopp: function (component, event, helper) {
+ createAopp : function(component, event, helper) {
var addRecordEvent = $A.get('e.force:createRecord');
addRecordEvent.setParams({
entityApiName: 'Agency_Opportunity__c',
recordTypeId: '012100000006KW7'
});
addRecordEvent.fire();
- component.set('v.showErrorInfo', false);
+ component.set("v.showErrorInfo", false);
},
-
- new_report: function (component, event, helper) {
+
+ new_report : function(component, event, helper) {
component.find('save_button').set('v.label', '淇濆瓨骞舵柊寤�');
component.set('v.data.Report_Date__c', '');
helper.new_report(component, event, helper);
},
-
- copy_button: function (component, event, helper) {
+
+ copy_button : function(component, event, helper) {
component.find('save_button').set('v.label', '淇濆瓨骞舵柊寤�');
helper.copy_button(component, event, helper);
},
-
- change_report_radio: function (component, event, helper) {
+
+ change_report_radio : function(component, event, helper) {
helper.change_report_radio(component, event, helper);
},
-
- edit_button: function (component, event, helper) {
+
+ edit_button : function(component, event, helper) {
component.find('save_button').set('v.label', '淇濆瓨');
helper.edit_button(component, event, helper);
},
-
- createCon: function (component, event, helper) {
- helper.createCon(component, event, helper);
+
+ createCon : function(component, event, helper) {
+ helper.createCon(component, event, helper);
},
- showRequiredFields: function (component, event, helper) {
- $A.util.removeClass(component.find('newOpportunityField'), 'none');
- $A.util.removeClass(component.find('newOpportunityField'), 'none');
+ showRequiredFields: function(component, event, helper){
+ $A.util.removeClass(component.find("newOpportunityField"), "none");
+ $A.util.removeClass(component.find("newOpportunityField"), "none");
},
-
- handleSuccess: function (component, event, helper) {
+
+ handleSuccess : function(component, event, helper) {
helper.handleSuccess(component, event, helper);
},
-
- handleSubmit: function (component, event, helper) {
+
+ handleSubmit : function(component, event, helper) {
/*
var params = event.getParams();
params.fields["Agency_Hospital__c"] = component.get('v.hospitalLinkId');
@@ -63,44 +63,39 @@
// vivek 娣诲姞楠岃瘉 start
// helper.handleFormSubmit(component);
var showValidationError = false;
- var fields = component.find('newOpportunityField');
+ var fields = component.find("newOpportunityField");
var vaildationFailReason = '';
// var vaildationFailReason2 = '';
// var currentDate = new Date().toJSON().slice(0,10);
-
+
// PIPL update Yin Mingjie 21/02/2022 start
let agencyReport = Object.create(null);
// PIPL update Yin Mingjie 21/02/2022 end
fields.forEach(function (field) {
- if (
- field.get('v.fieldName') === 'Type__c' &&
- $A.util.isEmpty(field.get('v.value'))
- ) {
+ if(field.get("v.fieldName") === 'Type__c' && $A.util.isEmpty(field.get("v.value"))){
showValidationError = true;
- vaildationFailReason = '鍒嗙被涓嶈兘涓虹┖锛�';
- } else if (
- field.get('v.fieldName') === 'Doctor_Division1__c' &&
- $A.util.isEmpty(field.get('v.value'))
- ) {
+ vaildationFailReason = "鍒嗙被涓嶈兘涓虹┖锛�";
+ }else if(field.get("v.fieldName") === 'Doctor_Division1__c' && $A.util.isEmpty(field.get("v.value"))){
showValidationError = true;
- if (vaildationFailReason != '') {
- vaildationFailReason += '鍖荤敓鍖哄垎(鑱屽姟)涓嶈兘涓虹┖锛�';
- } else {
- vaildationFailReason = '鍖荤敓鍖哄垎(鑱屽姟)涓嶈兘涓虹┖锛�';
+ if(vaildationFailReason != ''){
+ vaildationFailReason += "鍖荤敓鍖哄垎(鑱屽姟)涓嶈兘涓虹┖锛�";
+ }else{
+ vaildationFailReason = "鍖荤敓鍖哄垎(鑱屽姟)涓嶈兘涓虹┖锛�";
}
+
}
// PIPL update Yin Mingjie 21/02/2022 start
- if (field.get('v.fieldName') === 'Name') {
- agencyReport['name'] = field.get('v.value');
- } else if (field.get('v.fieldName') === 'Type__c') {
- agencyReport['type'] = field.get('v.value');
- } else if (field.get('v.fieldName') === 'Doctor_Division1__c') {
- agencyReport['doctorDivision1'] = field.get('v.value');
+ if(field.get("v.fieldName") === 'Name'){
+ agencyReport['name'] = field.get("v.value");
+ }else if(field.get("v.fieldName") === 'Type__c'){
+ agencyReport['type'] = field.get("v.value");
+ }else if(field.get("v.fieldName") === 'Doctor_Division1__c'){
+ agencyReport['doctorDivision1'] = field.get("v.value");
}
// PIPL update Yin Mingjie 21/02/2022 end
});
-
+
if (!showValidationError) {
// PIPL update Yin Mingjie 21/02/2022 start
/*
@@ -111,72 +106,50 @@
var agencyHospitalid = component.get('v.hospitalLinkId');
//zhj MEBG鏂版柟妗堟敼閫� 2022-11-29 start
- debugger;
+ debugger
let hospitalName = '';
//璋冪敤鍚庣searchAgencyDataId鏂规硶鏌ヨ鍑哄尰闄笅闈㈡墍鏈夊鎴蜂汉鍛榙ataid
- helper.CallBackAction(
- component,
- 'searchAgencyDataId',
- {
- hospitalId: agencyHospitalid
- },
- function (data) {
- if (data.getState() == 'SUCCESS') {
- var data = data.getReturnValue();
- if (data.IsSuccess == true) {
- let agencyContactIds = '';
- if (
- data.Message == '' &&
- data.Data &&
- data.Data.length > 0
- ) {
- hospitalName =
- data.Data[0].Agency_Hospital__r.Name;
- for (var i = 0; i < data.Data.length; i++) {
- if (data.Data[i].AWS_Data_Id__c)
- agencyContactIds +=
- ',' + data.Data[i].AWS_Data_Id__c;
- }
- agencyContactIds =
- agencyContactIds.substring(1);
- agencyReport['agencyContactIds'] =
- agencyContactIds;
- } else {
- agencyReport['agencyContactIds'] =
- agencyContactIds;
+ helper.CallBackAction(component,'searchAgencyDataId',{
+ hospitalId : agencyHospitalid
+ },function(data){
+ if(data.getState() == "SUCCESS"){
+ var data = data.getReturnValue();
+ if(data.IsSuccess == true){
+ let agencyContactIds = ''
+ if(data.Message == '' && data.Data && data.Data.length > 0){
+ hospitalName = data.Data[0].Agency_Hospital__r.Name;
+ for(var i=0;i<data.Data.length;i++){
+ if(data.Data[i].AWS_Data_Id__c)
+ agencyContactIds += ','+data.Data[i].AWS_Data_Id__c;
}
- var arr = new Array();
- arr.push(agencyReport);
- var requestData = JSON.stringify(arr);
- // helper.set_aws_url(component,data,agencyHospitalid);
-
- var token = component.get('v.AWStoken');
- var newUrl = component.get('v.AWSinsert') + 'V2';
-
- component.set('v.loginEdit', true);
- helper.insert_agencycontact(
- component,
- token,
- newUrl,
- requestData,
- agencyHospitalid,
- helper,
- hospitalName
- );
- } else {
- helper.ShowToast({
- message: data.message,
- type: 'error'
- });
+ agencyContactIds = agencyContactIds.substring(1);
+ agencyReport['agencyContactIds'] = agencyContactIds;
+ }else{
+ agencyReport['agencyContactIds'] = agencyContactIds;
}
- } else {
+ var arr = new Array();
+ arr.push(agencyReport);
+ var requestData = JSON.stringify(arr);
+ // helper.set_aws_url(component,data,agencyHospitalid);
+
+ var token = component.get('v.AWStoken');
+ var newUrl = component.get('v.AWSinsert') + 'V2';
+
+ component.set('v.loginEdit',true);
+ helper.insert_agencycontact(component,token,newUrl,requestData,agencyHospitalid,helper,hospitalName);
+ }else{
helper.ShowToast({
- message: 'searchAgency澶辫触',
- type: 'error'
+ "message" : data.message,
+ "type" : "error"
});
}
+ }else{
+ helper.ShowToast({
+ "message" : 'searchAgency澶辫触',
+ "type" : "error"
+ });
}
- );
+ })
//zhj MEBG鏂版柟妗堟敼閫� 2022-11-29 end
// var arr = new Array();
// arr.push(agencyReport);
@@ -185,12 +158,12 @@
// var token = component.get('v.AWStoken');
// var newUrl = component.get('v.AWSinsert');
-
+
// component.set('v.login',true);
// helper.insert_agencycontact(component,token,newUrl,data,agencyHospitalid,helper);
// PIPL update Yin Mingjie 21/02/2022 end
- } else {
+ }else{
component.find('OppMessage').setError(vaildationFailReason);
}
// var eventFields = event.getParam("fields");
@@ -198,166 +171,156 @@
// component.find('recordEditForm').submit(eventFields);
// vivek 娣诲姞楠岃瘉 end
},
-
- createCancel: function (component, event, helper) {
+
+ createCancel : function(component, event, helper) {
helper.createCancel(component, event, helper);
},
-
- yes_button: function (component, event, helper) {
+
+ yes_button : function(component, event, helper) {
component.set('v.confirm_status', 1);
- helper.close_confirm(
- component,
- component.get('v.modal_confirm_title'),
- component.get('v.modal_confirm_text')
- );
+ helper.close_confirm(component, component.get('v.modal_confirm_title'), component.get('v.modal_confirm_text'));
},
- no_button: function (component, event, helper) {
+ no_button : function(component, event, helper) {
component.set('v.confirm_status', 2);
- helper.close_confirm(
- component,
- component.get('v.modal_confirm_title'),
- component.get('v.modal_confirm_text')
- );
+ helper.close_confirm(component, component.get('v.modal_confirm_title'), component.get('v.modal_confirm_text'));
},
-
- toggle_report: function (component, event, helper) {
+
+ toggle_report : function(component, event, helper) {
helper.toggle_report(component);
},
- save_report: function (component, event, helper) {
+ save_report : function(component, event, helper) {
helper.save_report(component, event, helper);
},
-
- select_date_change: function (component, event, helper) {
+
+ select_date_change : function(component, event, helper) {
helper.select_date_change(component, event, helper);
},
-
- select_agency_change: function (component, event, helper) {
+
+ select_agency_change : function(component, event, helper) {
helper.select_agency_change(component, event, helper);
},
-
- hosChange: function (component, event, helper) {
- var hospital_name = event.getParam('value');
- if (hospital_name.match(/(\S+\s)+/)) {
- helper.searchHos(component, event, helper);
- } else {
- helper.hideSearch(component, event, helper);
- }
+
+ hosChange : function(component, event, helper) {
+ var hospital_name = event.getParam("value");
+ if (hospital_name.match(/(\S+\s)+/)) {
+ helper.searchHos(component, event, helper);
+ } else {
+ helper.hideSearch(component, event, helper);
+ }
},
-
- selectHos: function (component, event, helper) {
- helper.selectHos(component, event, helper);
+
+ selectHos : function(component, event, helper) {
+ helper.selectHos(component, event, helper);
helper.setOpportunity_cfilter(component);
},
- select_department: function (component, event, helper) {
+ select_department : function(component, event, helper) {
helper.select_department(component, event, helper);
helper.setOpportunity_cfilter(component);
},
- select_purpose_type: function (component, event, helper) {
+ select_purpose_type : function(component, event, helper) {
helper.select_purpose_type(component, event, helper);
},
-
- doctor_change: function (component, event, helper) {
+
+ doctor_change : function(component, event, helper) {
helper.doctor_change(component, event, helper);
},
-
- opportunityChange: function (component, event, helper) {
+
+ opportunityChange : function(component, event, helper) {
helper.opportunityChange(component, event, helper);
},
-
- productcategoryChange1: function (component, event, helper) {
+
+ productcategoryChange1 : function(component, event, helper) {
helper.productcategoryChange1(component, event, helper);
},
- productcategoryChange2: function (component, event, helper) {
+ productcategoryChange2 : function(component, event, helper) {
helper.productcategoryChange2(component, event, helper);
},
- productcategoryChange3: function (component, event, helper) {
+ productcategoryChange3 : function(component, event, helper) {
helper.productcategoryChange3(component, event, helper);
},
- stageNameChange: function (component, event, helper) {
+ stageNameChange : function(component, event, helper) {
helper.stageNameChange(component, event, helper);
},
- onDragOver: function (component, event, helper) {
+ onDragOver : function(component, event, helper) {
event.preventDefault();
},
-
- onDrop: function (component, event, helper) {
+
+ onDrop : function(component, event, helper) {
event.stopPropagation();
event.preventDefault();
- event.dataTransfer.dropEffect = 'copy';
- var files = event.dataTransfer.files;
- helper.readFile(component, helper, files[0]);
+ event.dataTransfer.dropEffect='copy';
+ var files=event.dataTransfer.files;
+ helper.readFile(component,helper,files[0]);
},
- CreateRecord: function (component, event, helper) {
- var files = event.getSource().get('v.files');
+ CreateRecord : function(component, event, helper){
+ var files = event.getSource().get("v.files");
// var fileInput = component.find("file").getElement();
// var file = fileInput.files[0];
- helper.readFile(component, helper, files[0]);
- component.set('v.showErrorInfo', false);
+ helper.readFile(component,helper,files[0]);
+ component.set("v.showErrorInfo", false);
},
- processFileContent: function (component, event, helper) {
- helper.saveRecords(component, event, helper);
- component.set('v.showErrorInfo', false);
+ processFileContent : function(component,event,helper){
+ helper.saveRecords(component,event,helper);
+ component.set("v.showErrorInfo", false);
+ },
+
+ cancel : function(component,event,helper){
+ component.set("v.showMain",true);
},
- cancel: function (component, event, helper) {
- component.set('v.showMain', true);
- },
-
- import: function (component, event, helper) {
+ import : function(component,event,helper){
// component.find('file').click();
// console.log('lll'+component.find('file'));
helper.showImport(component);
},
- exportDate: function (component, event, helper) {
- var stockData = component.get('v.reports_date');
- console.log('瀵煎嚭鏁版嵁' + stockData);
- var csv = helper.convertArrayOfObjectsToCSV(component, stockData);
- if (csv == null) {
- return;
- }
+ exportDate : function(component,event,helper){
+ var stockData = component.get("v.reports_date");
+ console.log('瀵煎嚭鏁版嵁'+stockData);
+ var csv = helper.convertArrayOfObjectsToCSV(component,stockData);
+ if (csv == null){return;}
- // ####--code for create a temp. <a> html tag [link tag] for download the CSV file--####
- var universalBOM = '\uFEFF';
+ // ####--code for create a temp. <a> html tag [link tag] for download the CSV file--####
+ var universalBOM = "\uFEFF";
var hiddenElement = document.createElement('a');
- hiddenElement.href =
- 'data:text/csv;charset=utf-8,' + encodeURI(universalBOM + csv);
- hiddenElement.target = '_self'; //
- hiddenElement.download = 'ExportData.csv'; // CSV file Name* you can change it.[only name not .csv]
+ hiddenElement.href = 'data:text/csv;charset=utf-8,' + encodeURI(universalBOM+csv);
+ hiddenElement.target = '_self'; //
+ hiddenElement.download = 'ExportData.csv'; // CSV file Name* you can change it.[only name not .csv]
document.body.appendChild(hiddenElement); // Required for FireFox browser
hiddenElement.click(); // using click() js function to download csv file
// helper.showExport(component);
+
},
- export_condition: function (component, event, helper) {
+ export_condition : function(component,event,helper){
helper.showExport(component);
},
- select_repores_date: function (component, event, helper) {
- helper.select_repores_date(component, event, helper);
+ select_repores_date : function(component,event,helper){
+ helper.select_repores_date(component,event,helper);
// var stockData = component.get("v.reports_date");
// console.log('鏌ュ嚭鐨勬暟鎹�'+stockData);
// helper.showExportDate(component,stockData);
// this.export(component,event,helper);
},
- export: function (component, event, helper) {
+ export : function(component,event,helper){
console.log('杩涘叆export');
- var stockData = component.get('v.reports_date');
- console.log('鏌ュ嚭鐨勬暟鎹�' + stockData);
+ var stockData = component.get("v.reports_date");
+ console.log('鏌ュ嚭鐨勬暟鎹�'+stockData);
// helper.showExportDate(component,stockData);
// helper.showExport(component);
},
- close_import: function (component, event, helper) {
- component.set('v.showMain', true);
+ close_import : function(component,event,helper){
+ component.set("v.showMain",true);
helper.close_import(component);
},
- close_export: function (component, event, helper) {
- component.set('v.showMain', true);
+ close_export : function(component,event,helper){
+ component.set("v.showMain",true);
helper.close_export(component);
},
- exportErrorInfo: function (component, event, helper) {
+ exportErrorInfo: function(component,event,helper){
helper.exportErrorInfoHelper(component);
- }
-});
+ },
+})
\ No newline at end of file
diff --git a/force-app/main/default/aura/WeeklyReport/WeeklyReportHelper.js b/force-app/main/default/aura/WeeklyReport/WeeklyReportHelper.js
index 4129232..5dbdbe7 100644
--- a/force-app/main/default/aura/WeeklyReport/WeeklyReportHelper.js
+++ b/force-app/main/default/aura/WeeklyReport/WeeklyReportHelper.js
@@ -1,126 +1,77 @@
({
- doinit: function (component, event, helper) {
+ doinit : function(component, event, helper) {
this.report_date_list(component, event, helper, 5);
- component.set('v.login', true);
+ component.set('v.login',true);
var action = component.get('c.getalldata');
- action.setCallback(this, function (response) {
+ action.setCallback(this,function(response){
var state = response.getState();
- if (state == 'SUCCESS') {
+ if(state == 'SUCCESS'){
var res = response.getReturnValue();
- component.set('v.alldata', res.reports);
- component.set('v.fieldsmap', res.fieldsMap);
- component.set('v.allselectlist', res.allselectlist);
- component.set('v.doclist', res.doclist);
+ component.set('v.alldata',res.reports);
+ component.set('v.fieldsmap',res.fieldsMap);
+ component.set('v.allselectlist',res.allselectlist);
+ component.set('v.doclist',res.doclist);
// PIPL update Yin Mingjie 21/02/2022 start
- component
- .find('select_agency_person')
- .set(
- 'v.options',
- this.conv_selected(res.allselectlist.AgencyPerson__c)
- );
+ component.find('select_agency_person').set('v.options', this.conv_selected(res.allselectlist.AgencyPerson__c));
// this.search_contact(component, event, helper,res.allselectlist.AgencyPerson__c);
// PIPL update Yin Mingjie 21/02/2022 end
- component
- .find('select_department')
- .set(
- 'v.options',
- this.conv_selected(
- res.allselectlist.Department_Cateogy__c
- )
- );
- 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.find('select_department').set('v.options', this.conv_selected(res.allselectlist.Department_Cateogy__c));
+ 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', '鏂板缓');
- component.set('v.awsurl', res.awsurl); // 20220222 PI鏀归�� by Bright
- component.set('v.contactawsurl', res.contactawsurl); // 20220222 PI鏀归�� by Bright
-
- this.get_reports(
- component,
- event,
- helper,
- component.find('select_date').get('v.value'),
- component.find('select_agency_person').get('v.value')
- );
-
- component.set('v.login', false);
- } else {
+ component.set('v.awsurl', res.awsurl);// 20220222 PI鏀归�� by Bright
+ component.set('v.contactawsurl', res.contactawsurl);// 20220222 PI鏀归�� by Bright
+
+ this.get_reports(component, event, helper, component.find('select_date').get('v.value'), component.find('select_agency_person').get('v.value'));
+
+ component.set('v.login',false);
+ }
+ else{
this.error('doinit failed.');
- component.set('v.login', false);
+ component.set('v.login',false);
}
});
$A.enqueueAction(action);
},
-
+
// PIPL update Yin Mingjie 21/02/2022 start
- search_contact: function (component, event, helper, resobj) {
+ search_contact : function(component, event, helper, resobj) {
let contactData = Object.create(null);
var dataArr = new Array();
for (let i = 0; i < resobj.length; i++) {
- if (resobj[i].awsid != null && resobj[i].awsid != '') {
+ if (resobj[i].awsid != null && resobj[i].awsid != ''){
contactData[resobj[i].awsid] = resobj[i];
dataArr.push(resobj[i].awsid);
}
}
- let obj = Object.create(null);
+ let obj= Object.create(null);
obj['dataIds'] = dataArr;
var payload = JSON.stringify(obj);
- this.search_contact_url(component, 'Contact', (result) => {
+ this.search_contact_url(component, 'Contact', (result)=>{
var token = result.token;
var searchUrl = result.searchUrl;
- this.search_core(
- token,
- searchUrl,
- payload,
- (result) => {
- if (result.status == '0') {
- if (result.object != null) {
- this.to_contact_list(
- result,
- contactData,
- component
- );
- } else {
- component.set('v.loginEdit', false);
- }
- } else {
- this.error('AWS search status1 : ' + result.status);
- component.set('v.loginEdit', false);
+ this.search_core(token,searchUrl,payload,(result)=>{
+ if(result.status == '0'){
+ if(result.object != null){
+ this.to_contact_list(result,contactData,component);
+ }else{
+ component.set('v.loginEdit',false);
}
- },
- component
- );
+ }else{
+ this.error('AWS search status1 : ' + result.status);
+ component.set('v.loginEdit',false);
+ }
+ },component);
+
});
},
- to_contact_list: function (result, retMap, component) {
+ to_contact_list : function(result,retMap,component) {
var resls = result.object;
var res = [];
var space = {};
@@ -137,34 +88,35 @@
t['value'] = retMap[resls[i].dataId].value;
res.push(t);
}
- component.find('select_agency_person').set('v.options', res);
- component.set('v.allselectlistAgencyPerson', res);
- component.set('v.loginEdit', false);
+ component.find('select_agency_person').set('v.options',res);
+ component.set('v.allselectlistAgencyPerson',res);
+ component.set('v.loginEdit',false);
},
- search_contact_url: function (component, sobject, callback) {
+ search_contact_url : function(component, sobject, callback) {
var action = component.get('c.getAwsurl');
action.setParams({
- sobj: sobject
+ "sobj" : sobject,
});
- action.setCallback(this, function (response) {
+ action.setCallback(this,function(response){
var state = response.getState();
- if (state == 'SUCCESS') {
+ if(state == 'SUCCESS'){
var result = response.getReturnValue();
- if (callback) callback(result);
- } else {
+ if(callback)callback(result);
+ }
+ else{
this.error('AWS url/token error.');
- component.set('v.loginEdit', false);
+ component.set('v.loginEdit',false);
}
});
$A.enqueueAction(action);
},
// PIPL update Yin Mingjie 21/02/2022 end
- select_department: function (component, event, helper) {
- var dc = component.find('select_department').get('v.value');
- dc = dc ? '%' + dc + '%' : '';
- var purpose_type = component.find('select_purpose_type').get('v.value');
+ select_department : function(component, event, helper) {
+ var dc = component.find("select_department").get("v.value");
+ dc = dc ? '%'+dc+'%' : '';
+ var purpose_type = component.find("select_purpose_type").get("v.value");
if (purpose_type) {
if (purpose_type.substr(-3) == 'OPD') {
purpose_type = 'OPD';
@@ -175,25 +127,22 @@
}
}
if (dc != '' || purpose_type != '') {
+
var action = component.get('c.getProductList');
action.setParams({
- dc: dc,
- opdsis: purpose_type
+ "dc" : dc,
+ "opdsis" : purpose_type,
});
- action.setCallback(this, function (response) {
+ action.setCallback(this,function(response){
var state = response.getState();
- if (state == 'SUCCESS') {
+ if(state == 'SUCCESS'){
+
var res = response.getReturnValue();
- component
- .find('select_Product1')
- .set('v.options', JSON.parse(JSON.stringify(res)));
- component
- .find('select_Product2')
- .set('v.options', JSON.parse(JSON.stringify(res)));
- component
- .find('select_Product3')
- .set('v.options', JSON.parse(JSON.stringify(res)));
- } else {
+ component.find('select_Product1').set("v.options", JSON.parse(JSON.stringify(res)));
+ component.find('select_Product2').set("v.options", JSON.parse(JSON.stringify(res)));
+ component.find('select_Product3').set("v.options", JSON.parse(JSON.stringify(res)));
+ }
+ else{
this.error('getProductList failed.');
}
});
@@ -205,26 +154,26 @@
}
},
- get_reports: function (component, event, helper, date_str, person_str) {
+ get_reports : function(component, event, helper, date_str, person_str) {
if (!date_str) {
return false;
}
-
+
date_str = this.get_date_string(date_str);
-
+
var action = component.get('c.getReports');
action.setParams({
- date_str: date_str,
- person_str: person_str
+ "date_str" : date_str,
+ "person_str" : person_str,
});
- component.set('v.login', true);
- action.setCallback(this, function (response) {
+ component.set('v.login',true);
+ action.setCallback(this,function(response){
var state = response.getState();
- if (state == 'SUCCESS') {
+ if(state == 'SUCCESS'){
var res = response.getReturnValue();
- component.set('v.reports', res.reports);
-
+ component.set('v.reports', res.reports);
+
// 20220222 PI鏀归�� by Bright--start
let dataIds = [];
let dataIds1 = [];
@@ -236,96 +185,69 @@
dataIds.push(rep.doctor2__r.AWS_Data_Id__c);
}
- if (
- rep.Person_In_Charge2__r &&
- rep.Person_In_Charge2__r.AWS_Data_Id__c
- ) {
+ if (rep.Person_In_Charge2__r && rep.Person_In_Charge2__r.AWS_Data_Id__c) {
dataIds1.push(rep.Person_In_Charge2__r.AWS_Data_Id__c);
}
}
let Foo = null;
- Foo = function () {
- if (b && b1) {
+ Foo = function(){
+ if(b && b1){
for (const rep of res.reports) {
- if (
- rep.doctor2__r &&
- rep.doctor2__r.AWS_Data_Id__c &&
- mm.hasOwnProperty(rep.doctor2__r.AWS_Data_Id__c)
- ) {
- rep.doctor2__r.awsdata =
- mm[rep.doctor2__r.AWS_Data_Id__c];
+ if (rep.doctor2__r && rep.doctor2__r.AWS_Data_Id__c && mm.hasOwnProperty(rep.doctor2__r.AWS_Data_Id__c)) {
+ rep.doctor2__r.awsdata = mm[rep.doctor2__r.AWS_Data_Id__c];
}
- if (
- rep.Person_In_Charge2__r &&
- rep.Person_In_Charge2__r.AWS_Data_Id__c &&
- mm.hasOwnProperty(
- rep.Person_In_Charge2__r.AWS_Data_Id__c
- )
- ) {
- rep.Person_In_Charge2__r.awsdata =
- mm[rep.Person_In_Charge2__r.AWS_Data_Id__c];
+ if (rep.Person_In_Charge2__r && rep.Person_In_Charge2__r.AWS_Data_Id__c && mm.hasOwnProperty(rep.Person_In_Charge2__r.AWS_Data_Id__c)) {
+ rep.Person_In_Charge2__r.awsdata = mm[rep.Person_In_Charge2__r.AWS_Data_Id__c];
}
}
- $A.getCallback(() =>
- component.set('v.reports', res.reports)
- )();
- } else {
- console.log('b=' + b + ',b1=' + b1 + ',continue');
- setTimeout(Foo, 100);
+ $A.getCallback(()=>component.set('v.reports', res.reports))();
+ }else{
+ console.log('b='+b + ',b1='+b1+',continue');
+ setTimeout(Foo,100);
}
- };
-
- if (dataIds.length > 0) {
+ }
+
+ if(dataIds.length > 0){
let awsurl = component.get('v.awsurl');
- helper.search_core(
- awsurl.token,
- awsurl.searchUrl,
- JSON.stringify({
- dataIds: dataIds
- }),
- (result) => {
- if (result.status == '0') {
- for (const m of result.object) {
- mm[m.dataId] = m;
- }
- b = true;
- Foo();
- } else {
- //this.error('AWS search status2 : ' + result.status);
- this.success('璇烽噸鏂板埛鏂伴〉闈㈣繘琛岃В瀵�');
+ helper.search_core(awsurl.token,awsurl.searchUrl,JSON.stringify({
+ "dataIds":dataIds
+ }),(result)=>{
+ if(result.status == '0'){
+
+ for (const m of result.object) {
+ mm[m.dataId] = m;
}
- },
- component
- );
- } else {
+ b = true;
+ Foo();
+ }else{
+ //this.error('AWS search status2 : ' + result.status);
+ this.success('璇烽噸鏂板埛鏂伴〉闈㈣繘琛岃В瀵�');
+ }
+ },component);
+ }else{
b = true;
}
- if (dataIds1.length > 0) {
+
+
+ if(dataIds1.length > 0){
let contactawsurl = component.get('v.contactawsurl');
- helper.search_core(
- contactawsurl.token,
- contactawsurl.searchUrl,
- JSON.stringify({
- dataIds: dataIds1
- }),
- (result) => {
- if (result.status == '0') {
- for (const m of result.object) {
- mm[m.dataId] = m;
- }
- b1 = true;
- Foo();
- } else {
- this.error(
- 'AWS search status3 : ' + result.status
- );
+ helper.search_core(contactawsurl.token,contactawsurl.searchUrl,JSON.stringify({
+ "dataIds":dataIds1
+ }),(result)=>{
+ if(result.status == '0'){
+
+ for (const m of result.object) {
+ mm[m.dataId] = m;
}
- },
- component
- );
- } else {
+ b1 = true;
+ Foo();
+ }else{
+ this.error('AWS search status3 : ' + result.status);
+ }
+ },component);
+ }else{
b1 = true;
}
// 20220222 PI鏀归�� by Bright--end
@@ -334,59 +256,51 @@
// 鏇存柊淇濆瓨寰屻伄select_data鐢�
var report_id = component.get('v.update_select_report_data_id');
-
- if (report_id != '') {
+
+ if (report_id != "") {
for (i = 0; i < res.reports.length; i++) {
if (res.reports[i]['Id'] == report_id) {
- component.set(
- 'v.select_report_data',
- res.reports[i]
- );
+ component.set('v.select_report_data', res.reports[i]);
break;
}
}
component.set('v.update_select_report_data_id', '');
}
-
+
if (res.reports.length > 0) {
component.set('v.list_message', '');
} else {
component.set('v.list_message', 'no_data');
}
- component.set('v.login', false);
- } else {
+ component.set('v.login',false);
+ }
+ else{
this.error('get_reports failed.');
- component.set('v.login', false);
+ component.set('v.login',false);
}
});
$A.enqueueAction(action);
},
- get_reports_edit: function (
- component,
- event,
- helper,
- date_str,
- person_str
- ) {
+ get_reports_edit : function(component, event, helper, date_str, person_str) {
if (!date_str) {
return false;
}
-
+
date_str = this.get_date_string(date_str);
-
+
var action = component.get('c.getReports');
action.setParams({
- date_str: date_str,
- person_str: person_str
+ "date_str" : date_str,
+ "person_str" : person_str,
});
- component.set('v.loginEdit', true);
- action.setCallback(this, function (response) {
+ component.set('v.loginEdit',true);
+ action.setCallback(this,function(response){
var state = response.getState();
- if (state == 'SUCCESS') {
+ if(state == 'SUCCESS'){
var res = response.getReturnValue();
- component.set('v.reports', res.reports);
-
+ component.set('v.reports', res.reports);
+
// 20220222 PI鏀归�� by Bright--start
let dataIds = [];
let dataIds1 = [];
@@ -398,96 +312,69 @@
dataIds.push(rep.doctor2__r.AWS_Data_Id__c);
}
- if (
- rep.Person_In_Charge2__r &&
- rep.Person_In_Charge2__r.AWS_Data_Id__c
- ) {
+ if (rep.Person_In_Charge2__r && rep.Person_In_Charge2__r.AWS_Data_Id__c) {
dataIds1.push(rep.Person_In_Charge2__r.AWS_Data_Id__c);
}
}
let Foo = null;
- Foo = function () {
- if (b && b1) {
+ Foo = function(){
+ if(b && b1){
for (const rep of res.reports) {
- if (
- rep.doctor2__r &&
- rep.doctor2__r.AWS_Data_Id__c &&
- mm.hasOwnProperty(rep.doctor2__r.AWS_Data_Id__c)
- ) {
- rep.doctor2__r.awsdata =
- mm[rep.doctor2__r.AWS_Data_Id__c];
+ if (rep.doctor2__r && rep.doctor2__r.AWS_Data_Id__c && mm.hasOwnProperty(rep.doctor2__r.AWS_Data_Id__c)) {
+ rep.doctor2__r.awsdata = mm[rep.doctor2__r.AWS_Data_Id__c];
}
- if (
- rep.Person_In_Charge2__r &&
- rep.Person_In_Charge2__r.AWS_Data_Id__c &&
- mm.hasOwnProperty(
- rep.Person_In_Charge2__r.AWS_Data_Id__c
- )
- ) {
- rep.Person_In_Charge2__r.awsdata =
- mm[rep.Person_In_Charge2__r.AWS_Data_Id__c];
+ if (rep.Person_In_Charge2__r && rep.Person_In_Charge2__r.AWS_Data_Id__c && mm.hasOwnProperty(rep.Person_In_Charge2__r.AWS_Data_Id__c)) {
+ rep.Person_In_Charge2__r.awsdata = mm[rep.Person_In_Charge2__r.AWS_Data_Id__c];
}
}
- $A.getCallback(() =>
- component.set('v.reports', res.reports)
- )();
- } else {
- console.log('b=' + b + ',b1=' + b1 + ',continue');
- setTimeout(Foo, 100);
+ $A.getCallback(()=>component.set('v.reports', res.reports))();
+ }else{
+ console.log('b='+b + ',b1='+b1+',continue');
+ setTimeout(Foo,100);
}
- };
-
- if (dataIds.length > 0) {
+ }
+
+ if(dataIds.length > 0){
let awsurl = component.get('v.awsurl');
- helper.search_core(
- awsurl.token,
- awsurl.searchUrl,
- JSON.stringify({
- dataIds: dataIds
- }),
- (result) => {
- if (result.status == '0') {
- for (const m of result.object) {
- mm[m.dataId] = m;
- }
- b = true;
- Foo();
- } else {
- //this.error('AWS search status2 : ' + result.status);
- this.success('璇烽噸鏂板埛鏂伴〉闈㈣繘琛岃В瀵�');
+ helper.search_core(awsurl.token,awsurl.searchUrl,JSON.stringify({
+ "dataIds":dataIds
+ }),(result)=>{
+ if(result.status == '0'){
+
+ for (const m of result.object) {
+ mm[m.dataId] = m;
}
- },
- component
- );
- } else {
+ b = true;
+ Foo();
+ }else{
+ //this.error('AWS search status2 : ' + result.status);
+ this.success('璇烽噸鏂板埛鏂伴〉闈㈣繘琛岃В瀵�');
+ }
+ },component);
+ }else{
b = true;
}
- if (dataIds1.length > 0) {
+
+
+ if(dataIds1.length > 0){
let contactawsurl = component.get('v.contactawsurl');
- helper.search_core(
- contactawsurl.token,
- contactawsurl.searchUrl,
- JSON.stringify({
- dataIds: dataIds1
- }),
- (result) => {
- if (result.status == '0') {
- for (const m of result.object) {
- mm[m.dataId] = m;
- }
- b1 = true;
- Foo();
- } else {
- this.error(
- 'AWS search status3 : ' + result.status
- );
+ helper.search_core(contactawsurl.token,contactawsurl.searchUrl,JSON.stringify({
+ "dataIds":dataIds1
+ }),(result)=>{
+ if(result.status == '0'){
+
+ for (const m of result.object) {
+ mm[m.dataId] = m;
}
- },
- component
- );
- } else {
+ b1 = true;
+ Foo();
+ }else{
+ this.error('AWS search status3 : ' + result.status);
+ }
+ },component);
+ }else{
b1 = true;
}
// 20220222 PI鏀归�� by Bright--end
@@ -496,69 +383,53 @@
// 鏇存柊淇濆瓨寰屻伄select_data鐢�
var report_id = component.get('v.update_select_report_data_id');
-
- if (report_id != '') {
+
+ if (report_id != "") {
for (i = 0; i < res.reports.length; i++) {
if (res.reports[i]['Id'] == report_id) {
- component.set(
- 'v.select_report_data',
- res.reports[i]
- );
+ component.set('v.select_report_data', res.reports[i]);
break;
}
}
component.set('v.update_select_report_data_id', '');
}
-
+
if (res.reports.length > 0) {
component.set('v.list_message', '');
} else {
component.set('v.list_message', 'no_data');
}
- component.set('v.loginEdit', false);
- } else {
+ component.set('v.loginEdit',false);
+ }
+ else{
this.error('get_reports failed.');
- component.set('v.loginEdit', false);
+ component.set('v.loginEdit',false);
}
});
$A.enqueueAction(action);
},
-
- select_date_change: function (component, event, helper) {
- this.get_reports(
- component,
- event,
- helper,
- component.find('select_date').get('v.value'),
- component.find('select_agency_person').get('v.value')
- );
+
+ select_date_change : function(component, event, helper) {
+ this.get_reports(component, event, helper, component.find('select_date').get('v.value'), component.find('select_agency_person').get('v.value'));
this.new_button_disabled(component, event, helper);
-
+
component.set('v.select_report_data_radio', '');
component.find('copy_button').set('v.disabled', true);
},
-
- select_agency_change: function (component, event, helper) {
- var select_value = component
- .find('select_agency_person')
- .get('v.value');
+
+ select_agency_change : function(component, event, helper) {
+ var select_value = component.find('select_agency_person').get('v.value');
var new_label = this.get_agency_person_name(component, select_value);
component.set('v.selected_agency_person', new_label);
-
- this.get_reports(
- component,
- event,
- helper,
- component.find('select_date').get('v.value'),
- select_value
- );
+
+ this.get_reports(component, event, helper, component.find('select_date').get('v.value'), select_value);
this.new_button_disabled(component, event, helper);
component.set('v.select_report_data_radio', '');
component.find('copy_button').set('v.disabled', true);
},
-
- get_agency_person_name: function (component, agency_person_value) {
+
+ get_agency_person_name : function(component, agency_person_value) {
// PIPL update Yin Mingjie 21/02/2022 start
var allselectlist = component.get('v.allselectlist.AgencyPerson__c');
// var allselectlist = component.get('v.allselectlistAgencyPerson');
@@ -572,111 +443,78 @@
}
return new_label;
},
-
- new_button_disabled: function (component, event, helper) {
+
+ new_button_disabled : function(component, event, helper) {
var select_date = component.find('select_date').get('v.value');
- var select_agency = component
- .find('select_agency_person')
- .get('v.value');
+ var select_agency = component.find('select_agency_person').get('v.value');
if (select_date && select_agency) {
component.find('new_button').set('v.disabled', false);
} else {
component.find('new_button').set('v.disabled', true);
}
},
-
- toggle_report: function (component) {
+
+ toggle_report : function(component) {
var modal_window = component.find('modal_window');
var modal_bg = component.find('modal_bg');
if ($A.util.hasClass(modal_window, 'disp_none')) {
// OPEN
$A.util.removeClass(modal_window, 'disp_none');
- $A.util.removeClass(modal_bg, 'disp_none');
- component.set('v.loginEdit', true);
- if (
- component.get('v.mode') == 'edit' ||
- component.get('v.mode') == 'copy'
- ) {
+ $A.util.removeClass(modal_bg, 'disp_none');
+ component.set('v.loginEdit',true);
+ if (component.get('v.mode') == 'edit' || component.get('v.mode') == 'copy') {
var select_data = '';
if (component.get('v.mode') == 'edit') {
select_data = component.get('v.select_report_data');
} else if (component.get('v.mode') == 'copy') {
select_data = component.get('v.select_report_data_radio');
}
-
+
var reports = component.get('v.reports');
var Agency_Hospital_text = '';
var Agency_Hospital_parent_id = '';
- debugger;
- // 鍖婚櫌鍚�
+ debugger
+ // 鍖婚櫌鍚�
if (select_data['Agency_Hospital__c'] != '') {
for (var i = 0; i < reports.length; i++) {
- if (
- reports[i]['Agency_Hospital__c'] ==
- select_data['Agency_Hospital__c']
- ) {
- Agency_Hospital_text =
- reports[i]['Agency_Hospital__r']['Name'];
- Agency_Hospital_parent_id =
- reports[i]['Agency_Hospital__r']['Hospital__c'];
+ if (reports[i]['Agency_Hospital__c'] == select_data['Agency_Hospital__c']) {
+ Agency_Hospital_text = reports[i]['Agency_Hospital__r']['Name'];
+ Agency_Hospital_parent_id = reports[i]['Agency_Hospital__r']['Hospital__c'];
}
}
component.set('v.hospital', Agency_Hospital_text);
component.set('v.hospitalId', Agency_Hospital_parent_id);
- component.set(
- 'v.hospitalLinkId',
- select_data['Agency_Hospital__c']
- );
+ component.set('v.hospitalLinkId', select_data['Agency_Hospital__c']);
component.find('new_con').set('v.disabled', false);
}
-
+
// 绉戝
if (select_data['Department_Cateogy__c'] != '') {
- this.set_selected(
- component,
- 'select_department',
- select_data['Department_Cateogy__c']
- );
+ this.set_selected(component, 'select_department', select_data['Department_Cateogy__c']);
}
// 鎷滆浜�
- component.set(
- 'v.default_select_doctor_id',
- select_data['doctor2__c']
- );
- this.set_doctor_list(component);
-
+ component.set('v.default_select_doctor_id', select_data['doctor2__c']);
+ this.set_doctor_list(component);
+
// 娲诲姩鍖哄垎
if (select_data['Purpose_Type__c'] != '') {
- this.set_selected(
- component,
- 'select_purpose_type',
- select_data['Purpose_Type__c']
- );
+ this.set_selected(component, 'select_purpose_type', select_data['Purpose_Type__c']);
this.select_purpose_type(component);
}
//SWAG-CBX68C fy 銆愬鎵樸�慏AMS绯荤粺鍛ㄦ姤妯″潡鍐呭闇�姹傚鍔� start
// 鏀彺闇�姹�
if (select_data['SupportNeeds__c'] != '') {
- this.set_selected(
- component,
- 'SupportNeeds__c',
- select_data['SupportNeeds__c']
- );
- }
- //SWAG-CBX68C fy 銆愬鎵樸�慏AMS绯荤粺鍛ㄦ姤妯″潡鍐呭闇�姹傚鍔� end
+ this.set_selected(component, 'SupportNeeds__c', select_data['SupportNeeds__c']);
+ }
+ //SWAG-CBX68C fy 銆愬鎵樸�慏AMS绯荤粺鍛ㄦ姤妯″潡鍐呭闇�姹傚鍔� end
// 绲愭灉
- if (
- select_data['Result__c'] != '' &&
- typeof select_data['Result__c'] !== 'undefined'
- ) {
- component
- .find('select_result')
- .set('v.value', select_data['Result__c']);
+ if (select_data['Result__c'] != '' && typeof select_data['Result__c'] !== "undefined") {
+ component.find('select_result').set('v.value', select_data['Result__c']);
}
-
+
// 璇环
var report_id = component.get('v.edit_copy_select_report_id');
- if (report_id != '') {
+ if (report_id != "") {
var select_opp = '';
var select_product_category1 = '';
var select_product_category2 = '';
@@ -684,83 +522,59 @@
var reportDate;
var i = 0;
for (i = 0; i < reports.length; i++) {
- if (report_id == reports[i]['Id']) {
- select_opp = reports[i]['Opportunity__c'];
- select_product_category1 =
- reports[i]['Product_Category1__c'];
- select_product_category2 =
- reports[i]['Product_Category2__c'];
- select_product_category3 =
- reports[i]['Product_Category3__c'];
- reportDate = reports[i]['Report_Date__c'];
+ if (report_id == reports[i]["Id"]) {
+ select_opp = reports[i]["Opportunity__c"];
+ select_product_category1 = reports[i]["Product_Category1__c"];
+ select_product_category2 = reports[i]["Product_Category2__c"];
+ select_product_category3 = reports[i]["Product_Category3__c"];
+ reportDate = reports[i]["Report_Date__c"];
break;
}
}
-
+
// 璇环
if (select_opp != null && select_opp != '') {
- var select_opp_name =
- component.get('v.reports')[i].OppName__c;
+ var select_opp_name = component.get('v.reports')[i].OppName__c;
component.set('v.data.Opportunity__c', select_opp);
- if ($A.get('$Browser.formFactor') == 'DESKTOP') {
- var values = [
- {
- type: 'Agency_Opportunity__c',
- id: select_opp,
- label: select_opp_name,
- icon: {
- url: '/img/icon/t4v35/custom/custom12_120.png',
- backgroundColor: 'dc71d1',
- alt: 'Agency_Opportunity__c'
- }
+ if ($A.get("$Browser.formFactor") == 'DESKTOP') {
+ var values = [{
+ type: 'Agency_Opportunity__c',
+ id: select_opp,
+ label: select_opp_name,
+ icon : {
+ url:'/img/icon/t4v35/custom/custom12_120.png',
+ backgroundColor:'dc71d1',
+ alt:'Agency_Opportunity__c'
}
- ];
+ }];
component.set('v.data.Opportunity__c', select_opp);
// component.find('input-opportunity').get("v.body")[0].set('v.values', values);
} else {
- component
- .find('input-opportunity')
- .get('v.body')[0]
- .set('v.selectedLabel', select_opp_name);
+ component.find('input-opportunity').get("v.body")[0].set('v.selectedLabel', select_opp_name);
}
}
-
+
// 浜у搧鍖哄垎
- if (
- select_product_category1 != null &&
- select_product_category1 != ''
- ) {
- component
- .find('select_Product1')
- .set('v.value', select_product_category1);
+ if (select_product_category1 != null && select_product_category1 != '') {
+ component.find('select_Product1').set('v.value', select_product_category1);
}
- if (
- select_product_category2 != null &&
- select_product_category2 != ''
- ) {
- component
- .find('select_Product2')
- .set('v.value', select_product_category2);
+ if (select_product_category2 != null && select_product_category2 != '') {
+ component.find('select_Product2').set('v.value', select_product_category2);
}
- if (
- select_product_category3 != null &&
- select_product_category3 != ''
- ) {
- component
- .find('select_Product3')
- .set('v.value', select_product_category3);
+ if (select_product_category3 != null && select_product_category3 != '') {
+ component.find('select_Product3').set('v.value', select_product_category3);
}
if (reportDate != null) {
console.log('reportDate = ' + reportDate);
component.set('v.data.Report_Date__c', reportDate);
}
-
- component.set('v.edit_copy_select_report_id', '');
- }
+
+ component.set('v.edit_copy_select_report_id', "");
+ }
}
- setTimeout(function () {
- component.set('v.loginEdit', false);
+ setTimeout(function() {
+ component.set('v.loginEdit',false);
}, 1000);
} else {
// CLOSE
@@ -768,148 +582,113 @@
var select_report_data = component.get('v.select_report_data');
var Report_Date__c = component.get('v.data.Report_Date__c');
var Agency_Hospital__c = component.get('v.hospitalLinkId');
- var Department_Cateogy__c = component
- .find('select_department')
- .get('v.value');
+ var Department_Cateogy__c = component.find('select_department').get('v.value');
var doctor2__c = component.find('select_doctor').get('v.value');
- var Purpose_Type__c = component
- .find('select_purpose_type')
- .get('v.value');
- var SupportNeeds__c = component
- .find('SupportNeeds__c')
- .get('v.value');
+ var Purpose_Type__c = component.find('select_purpose_type').get('v.value');
+ var SupportNeeds__c = component.find('SupportNeeds__c').get('v.value');
var Opportunity__c = component.get('v.data.Opportunity__c');
- var Product_Category1__c = component
- .find('select_Product1')
- .get('v.value');
- var Product_Category2__c = component
- .find('select_Product2')
- .get('v.value');
- var Product_Category3__c = component
- .find('select_Product3')
- .get('v.value');
+ var Product_Category1__c = component.find('select_Product1').get('v.value');
+ var Product_Category2__c = component.find('select_Product2').get('v.value');
+ var Product_Category3__c = component.find('select_Product3').get('v.value');
var Result__c = component.find('select_result').get('v.value');
-
+
if (select_report_data !== null) {
- if (
- typeof select_report_data['Opportunity__c'] === 'undefined'
- ) {
- select_report_data['Opportunity__c'] = '';
+ if (typeof select_report_data['Opportunity__c'] === "undefined") {
+ select_report_data['Opportunity__c'] = "";
}
- if (
- typeof select_report_data['Product_Category1__c'] ===
- 'undefined'
- ) {
- select_report_data['Product_Category1__c'] = '';
+ if (typeof select_report_data['Product_Category1__c'] === "undefined") {
+ select_report_data['Product_Category1__c'] = "";
}
- if (
- typeof select_report_data['Product_Category2__c'] ===
- 'undefined'
- ) {
- select_report_data['Product_Category2__c'] = '';
+ if (typeof select_report_data['Product_Category2__c'] === "undefined") {
+ select_report_data['Product_Category2__c'] = "";
}
- if (
- typeof select_report_data['Product_Category3__c'] ===
- 'undefined'
- ) {
- select_report_data['Product_Category3__c'] = '';
+ if (typeof select_report_data['Product_Category3__c'] === "undefined") {
+ select_report_data['Product_Category3__c'] = "";
}
- if (typeof select_report_data['Result__c'] === 'undefined') {
- select_report_data['Result__c'] = '';
+ if (typeof select_report_data['Result__c'] === "undefined") {
+ select_report_data['Result__c'] = "";
}
}
-
+
if (component.get('v.mode') == 'new') {
- var confirm_title = '璀﹀憡!';
+ var confirm_title = '璀﹀憡!'
var confirm_text = '鏀惧純鏂板缓鍛ㄦ姤锛�';
-
- if (
- !Report_Date__c &&
+
+ if (!Report_Date__c &&
!Agency_Hospital__c &&
!Department_Cateogy__c &&
!doctor2__c &&
!Purpose_Type__c &&
- !SupportNeeds__c && //WAG-CBX68C fy 銆愬鎵樸�慏AMS绯荤粺鍛ㄦ姤妯″潡鍐呭闇�姹傚鍔�
+ !SupportNeeds__c&&//WAG-CBX68C fy 銆愬鎵樸�慏AMS绯荤粺鍛ㄦ姤妯″潡鍐呭闇�姹傚鍔�
!Opportunity__c &&
!Product_Category1__c &&
!Product_Category2__c &&
!Product_Category3__c &&
- !Result__c
- ) {
+ !Result__c)
+ {
this.allclear(component);
$A.util.addClass(modal_window, 'disp_none');
- $A.util.addClass(modal_bg, 'disp_none');
+ $A.util.addClass(modal_bg, 'disp_none');
} else {
this.close_confirm(component, confirm_title, confirm_text);
- }
+ }
} else if (component.get('v.mode') == 'copy') {
- var confirm_title = '璀﹀憡!';
+ var confirm_title = '璀﹀憡!'
var confirm_text = '鏀惧純鏂板缓鍛ㄦ姤锛�';
-
- if (
- select_report_data['Report_Date__c'] == Report_Date__c &&
- select_report_data['Agency_Hospital__c'] ==
- Agency_Hospital__c &&
- select_report_data['Department_Cateogy__c'] ==
- Department_Cateogy__c &&
+
+ if (select_report_data['Report_Date__c'] == Report_Date__c &&
+ select_report_data['Agency_Hospital__c'] == Agency_Hospital__c &&
+ select_report_data['Department_Cateogy__c'] == Department_Cateogy__c &&
select_report_data['doctor2__c'] == doctor2__c &&
select_report_data['Purpose_Type__c'] == Purpose_Type__c &&
- select_report_data['SupportNeeds__c'] == SupportNeeds__c && //WAG-CBX68C fy 銆愬鎵樸�慏AMS绯荤粺鍛ㄦ姤妯″潡鍐呭闇�姹傚鍔�
+ select_report_data['SupportNeeds__c'] == SupportNeeds__c &&//WAG-CBX68C fy 銆愬鎵樸�慏AMS绯荤粺鍛ㄦ姤妯″潡鍐呭闇�姹傚鍔�
select_report_data['Opportunity__c'] == Opportunity__c &&
- select_report_data['Product_Category1__c'] ==
- Product_Category1__c &&
- select_report_data['Product_Category2__c'] ==
- Product_Category2__c &&
- select_report_data['Product_Category3__c'] ==
- Product_Category3__c &&
- select_report_data['Result__c'] == Result__c
- ) {
+ select_report_data['Product_Category1__c'] == Product_Category1__c &&
+ select_report_data['Product_Category2__c'] == Product_Category2__c &&
+ select_report_data['Product_Category3__c'] == Product_Category3__c &&
+ select_report_data['Result__c'] == Result__c)
+ {
this.allclear(component);
$A.util.addClass(modal_window, 'disp_none');
- $A.util.addClass(modal_bg, 'disp_none');
+ $A.util.addClass(modal_bg, 'disp_none');
} else {
this.close_confirm(component, confirm_title, confirm_text);
- }
- } else if (component.get('v.mode') == 'edit') {
- var confirm_title = '璀﹀憡!';
+ }
+ } else if (component.get('v.mode') == 'edit') {
+ var confirm_title = '璀﹀憡!'
var confirm_text = '鏀惧純缂栬緫鍛ㄦ姤锛�';
- if (
- select_report_data['Report_Date__c'] == Report_Date__c &&
- select_report_data['Agency_Hospital__c'] ==
- Agency_Hospital__c &&
- select_report_data['Department_Cateogy__c'] ==
- Department_Cateogy__c &&
+ if (select_report_data['Report_Date__c'] == Report_Date__c &&
+ select_report_data['Agency_Hospital__c'] == Agency_Hospital__c &&
+ select_report_data['Department_Cateogy__c'] == Department_Cateogy__c &&
select_report_data['doctor2__c'] == doctor2__c &&
select_report_data['Purpose_Type__c'] == Purpose_Type__c &&
- select_report_data['SupportNeeds__c'] == SupportNeeds__c && //WAG-CBX68C fy 銆愬鎵樸�慏AMS绯荤粺鍛ㄦ姤妯″潡鍐呭闇�姹傚鍔�
+ select_report_data['SupportNeeds__c'] == SupportNeeds__c &&//WAG-CBX68C fy 銆愬鎵樸�慏AMS绯荤粺鍛ㄦ姤妯″潡鍐呭闇�姹傚鍔�
select_report_data['Opportunity__c'] == Opportunity__c &&
- select_report_data['Product_Category1__c'] ==
- Product_Category1__c &&
- select_report_data['Product_Category2__c'] ==
- Product_Category2__c &&
- select_report_data['Product_Category3__c'] ==
- Product_Category3__c &&
- select_report_data['Result__c'] == Result__c
- ) {
+ select_report_data['Product_Category1__c'] == Product_Category1__c &&
+ select_report_data['Product_Category2__c'] == Product_Category2__c &&
+ select_report_data['Product_Category3__c'] == Product_Category3__c &&
+ select_report_data['Result__c'] == Result__c)
+ {
this.allclear(component);
$A.util.addClass(modal_window, 'disp_none');
- $A.util.addClass(modal_bg, 'disp_none');
+ $A.util.addClass(modal_bg, 'disp_none');
} else {
this.close_confirm(component, confirm_title, confirm_text);
}
- }
+ }
+
}
},
-
- close_confirm: function (component, title, text) {
+
+ close_confirm : function(component, title, text) {
var confirm_status = component.get('v.confirm_status');
component.set('v.modal_confirm_title', title);
component.set('v.modal_confirm_text', text);
var modal_window = component.find('modal_window');
var modal_bg = component.find('modal_bg');
- var modal_confirm = component.find('modal_confirm');
- var modal_confirm_bg = component.find('modal_confirm_bg');
+ var modal_confirm = component.find('modal_confirm');
+ var modal_confirm_bg = component.find('modal_confirm_bg');
if (confirm_status == 0) {
$A.util.addClass(modal_window, 'disp_none');
@@ -922,83 +701,62 @@
$A.util.addClass(modal_confirm_bg, 'disp_none');
component.set('v.mode', '');
this.allclear(component);
- component.set('v.reports_now', '');
+ component.set('v.reports_now', "");
component.set('v.reports_now_count', 0);
component.set('v.confirm_status', 0);
} else if (confirm_status == 2) {
// 鍚�
$A.util.removeClass(modal_window, 'disp_none');
- $A.util.removeClass(modal_bg, 'disp_none');
+ $A.util.removeClass(modal_bg, 'disp_none');
$A.util.addClass(modal_confirm, 'disp_none');
- $A.util.addClass(modal_confirm_bg, 'disp_none');
+ $A.util.addClass(modal_confirm_bg, 'disp_none');
component.set('v.confirm_status', 0);
}
},
- new_report: function (component, event, helper) {
+ new_report : function(component, event, helper) {
component.set('v.mode', 'new');
component.set('v.dialog_type', '鏂板缓');
var select_date = component.find('select_date').get('v.value');
- var select_agency = component
- .find('select_agency_person')
- .get('v.value');
+ var select_agency = component.find('select_agency_person').get('v.value');
component.set('v.selected_date', select_date);
var name = component.get('v.selected_agency_person');
- var ret = this.create_report_header(
- component,
- name,
- select_agency,
- select_date
- );
+ var ret = this.create_report_header(component, name, select_agency, select_date);
// PIPL update Yin Mingjie 21/02/2022 start
- this.set_aws_url(component, 'Agency_Contact__c');
+ this.set_aws_url(component,'Agency_Contact__c')
// PIPL update Yin Mingjie 21/02/2022 end
},
-
- copy_button: function (component, event, helper) {
+
+ copy_button : function(component, event, helper) {
this.allclear(component);
component.set('v.mode', 'copy');
component.set('v.dialog_type', '鏂板缓');
var select_report_data = component.get('v.select_report_data_radio');
component.set('v.loadOpp', true);
// 閫�
- var now = new Date();
- var start_day = new Date(
- now.getFullYear(),
- now.getMonth(),
- now.getDate() - now.getDay() + 1
- );
- var select_date =
- start_day.getFullYear() +
- '/' +
- (start_day.getMonth() + 1) +
- '/' +
- start_day.getDate();
+ var now = new Date();
+ var start_day = new Date(now.getFullYear(), now.getMonth(), (now.getDate() - now.getDay() + 1));
+ var select_date = start_day.getFullYear() + '/' + (start_day.getMonth() + 1) + '/' + start_day.getDate();
this.set_selected(component, 'select_date', select_date);
component.set('v.selected_date', select_date);
-
+
// 鎷呭綋
var select_agency = select_report_data['Person_In_Charge2__c'];
var new_label = this.get_agency_person_name(component, select_agency);
component.set('v.selected_agency_person', new_label);
this.set_selected(component, 'select_agency_person', select_agency);
-
+
this.new_button_disabled(component, event, helper);
var name = component.get('v.selected_agency_person');
-
+
component.set('v.edit_copy_select_report_id', select_report_data['Id']);
component.set('v.select_report_data', select_report_data);
- var ret = this.create_report_header(
- component,
- name,
- select_agency,
- select_date
- );
+ var ret = this.create_report_header(component, name, select_agency, select_date);
},
-
- change_report_radio: function (component, event, helper) {
+
+ change_report_radio : function(component, event, helper) {
var reports = component.get('v.reports');
for (var i = 0; i < reports.length; i++) {
if (reports[i].Name == event.getSource().get('v.label')) {
@@ -1008,52 +766,40 @@
}
}
},
-
- edit_button: function (component, event, helper) {
+
+ edit_button : function(component, event, helper) {
component.set('v.login', true);
this.allclear(component);
component.set('v.loadOpp', true);
var index = event.getSource().get('v.value');
- component.set(
- 'v.select_report_data',
- component.get('v.reports')[index]
- );
+ component.set('v.select_report_data', component.get('v.reports')[index]);
component.set('v.mode', 'edit');
component.set('v.dialog_type', '缂栬緫');
var select_date = component.get('v.reports')[index].Submit_date__c;
- var select_agency =
- component.get('v.reports')[index].Person_In_Charge2__c;
+ var select_agency = component.get('v.reports')[index].Person_In_Charge2__c;
var text_tmp = select_date.split('-');
- var select_date_text =
- text_tmp[0] + '/' + Number(text_tmp[1]) + '/' + Number(text_tmp[2]);
+ var select_date_text = text_tmp[0] + '/' + Number(text_tmp[1]) + '/' + Number(text_tmp[2]);
component.set('v.selected_date', select_date_text);
var name = component.get('v.reports')[index].Person_In_Charge2__r.Name;
-
+
this.set_selected(component, 'select_agency_person', select_agency);
this.new_button_disabled(component, event, helper);
-
+
var new_label = this.get_agency_person_name(component, select_agency);
component.set('v.selected_agency_person', new_label);
- component.set(
- 'v.edit_copy_select_report_id',
- component.get('v.reports')[index].Id
- );
-
- var ret = this.create_report_header(
- component,
- name,
- select_agency,
- select_date
- );
+ component.set('v.edit_copy_select_report_id', component.get('v.reports')[index].Id);
+
+ var ret = this.create_report_header(component, name, select_agency, select_date);
},
+
+ save_report : function(component, event, helper) {
- save_report: function (component, event, helper) {
// 20220222 PI鏀归�� by Bright--start
let doctor2Name = '';
let visitortitle = '';
- for (let op of component.find('select_doctor').get('v.options')) {
+ for(let op of component.find('select_doctor').get('v.options')){
if (op.selected) {
doctor2Name = op.label;
visitortitle = op.Doctor_Division1__c;
@@ -1061,56 +807,44 @@
}
// 20220222 PI鏀归�� by Bright--end
+
component.find('save_button').set('v.disabled', true);
var Report_Date__c = component.get('v.data.Report_Date__c');
- // alert('Report_Date__c'+Report_Date__c);
- var Person_In_Charge2__c = '';
- var Submit_date__c = '';
+ // alert('Report_Date__c'+Report_Date__c);
+ var Person_In_Charge2__c = "";
+ var Submit_date__c = "";
if (component.get('v.mode') == 'edit') {
// 鍛� Submit_date__c
- Submit_date__c = component.get(
- 'v.select_report_data'
- ).Submit_date__c;
+ Submit_date__c = component.get('v.select_report_data').Submit_date__c;
// alert('Submit_date__c'+Submit_date__c);
+
// 鎷呭綋 Person_In_Charge2__c
- Person_In_Charge2__c = component.get(
- 'v.select_report_data'
- ).Person_In_Charge2__c;
+ Person_In_Charge2__c = component.get('v.select_report_data').Person_In_Charge2__c;
} else {
// 鍛� Submit_date__c
- Submit_date__c = this.get_date_string(
- component.find('select_date').get('v.value')
- );
+ Submit_date__c = this.get_date_string(component.find('select_date').get('v.value'));
// alert('Submit_date__c'+Submit_date__c);
// 鎷呭綋 Person_In_Charge2__c
- Person_In_Charge2__c = component
- .find('select_agency_person')
- .get('v.value');
+ Person_In_Charge2__c = component.find('select_agency_person').get('v.value');
}
// Agency_Report_Header__c
- var Agency_Report_Header__c = component.get(
- 'v.agency_report_header_id'
- );
-
+ var Agency_Report_Header__c = component.get('v.agency_report_header_id');
+
// 鍖婚櫌 Agency_Hospital__c (Agency_Hospital_Link__c)
var Agency_Hospital__c = component.get('v.hospitalLinkId');
-
+
// 绉戝 Department_Cateogy__c
- var Department_Cateogy__c = component
- .find('select_department')
- .get('v.value');
-
+ var Department_Cateogy__c = component.find('select_department').get('v.value');
+
// 鎷滆浜� doctor2__c
var doctor2__c = component.find('select_doctor').get('v.value');
-
+
// 娲诲姩鍖哄垎 Purpose_Type__c
- var Purpose_Type__c = component
- .find('select_purpose_type')
- .get('v.value');
- //SWAG-CBX68C fy 銆愬鎵樸�慏AMS绯荤粺鍛ㄦ姤妯″潡鍐呭闇�姹傚鍔� start
+ 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
@@ -1118,35 +852,19 @@
var Opportunity__c = component.get('v.data.Opportunity__c');
var StageName__c = component.find('select_stageName').get('v.value');
- var Amount__c =
- component.get('v.oppdata.Amount__c') != null
- ? component.get('v.oppdata.Amount__c').toString()
- : '';
- var OCMSale_Price__c =
- component.get('v.oppdata.OCMSale_Price__c') != null
- ? component.get('v.oppdata.OCMSale_Price__c').toString()
- : '';
- var Close_Forecasted_Date__c = component.get(
- 'v.oppdata.Close_Forecasted_Date__c'
- );
+ var Amount__c = component.get('v.oppdata.Amount__c') != null ? component.get('v.oppdata.Amount__c').toString() : '';
+ var OCMSale_Price__c = component.get('v.oppdata.OCMSale_Price__c') != null ? component.get('v.oppdata.OCMSale_Price__c').toString() : '';
+ var Close_Forecasted_Date__c = component.get('v.oppdata.Close_Forecasted_Date__c');
var StageName__c_o = component.get('v.StageName__c_o');
var Amount__c_o = component.get('v.Amount__c_o');
var OCMSale_Price__c_o = component.get('v.OCMSale_Price__c_o');
- var Close_Forecasted_Date__c_o = component.get(
- 'v.Close_Forecasted_Date__c_o'
- );
+ var Close_Forecasted_Date__c_o = component.get('v.Close_Forecasted_Date__c_o');
if (StageName__c_o == undefined) StageName__c_o = '';
if (Amount__c_o == undefined) Amount__c_o = '';
if (OCMSale_Price__c_o == undefined) OCMSale_Price__c_o = '';
- if (Close_Forecasted_Date__c_o == undefined)
- Close_Forecasted_Date__c_o = '';
- if (
- StageName__c == StageName__c_o &&
- OCMSale_Price__c_o == OCMSale_Price__c &&
- Amount__c == Amount__c_o &&
- Close_Forecasted_Date__c == Close_Forecasted_Date__c_o
- ) {
+ if (Close_Forecasted_Date__c_o == undefined) Close_Forecasted_Date__c_o = '';
+ if (StageName__c == StageName__c_o && OCMSale_Price__c_o == OCMSale_Price__c && Amount__c == Amount__c_o && Close_Forecasted_Date__c == Close_Forecasted_Date__c_o) {
StageName__c = '';
Amount__c = '';
OCMSale_Price__c = '';
@@ -1154,71 +872,35 @@
}
// 浜у搧鍖哄垎 Product_Category__c (ProductTypes__c)
- var Product_Category1__c = component
- .find('select_Product1')
- .get('v.value');
- var Product_Category2__c = component
- .find('select_Product2')
- .get('v.value');
- var Product_Category3__c = component
- .find('select_Product3')
- .get('v.value');
-
+ var Product_Category1__c = component.find('select_Product1').get('v.value');
+ var Product_Category2__c = component.find('select_Product2').get('v.value');
+ var Product_Category3__c = component.find('select_Product3').get('v.value');
+
// 绲愭灉 Result__c
var Result__c = component.find('select_result').get('v.value');
-
+
// 銉愩儶銉囥兗銈枫儳銉�
var error = [];
- if (!Report_Date__c) {
- error.push('娲诲姩鏃� 涓嶅瓨鍦�');
- }
- if (!Submit_date__c) {
- error.push('鍛� 涓嶅瓨鍦�');
- }
+ if (!Report_Date__c) { error.push("娲诲姩鏃� 涓嶅瓨鍦�"); }
+ if (!Submit_date__c) { error.push("鍛� 涓嶅瓨鍦�"); }
var rDate = new Date(Report_Date__c);
var sDate = new Date(Submit_date__c);
sDate.setDate(sDate.getDate() - 1);
- if (rDate < sDate) {
- error.push('娲诲姩鏃ュ繀椤绘槸鏈懆锛�');
- }
+ if (rDate < sDate) {error.push('娲诲姩鏃ュ繀椤绘槸鏈懆锛�'); }
sDate.setDate(sDate.getDate() + 7);
- if (rDate >= sDate) {
- error.push('娲诲姩鏃ュ繀椤绘槸鏈懆锛�');
- }
-
- if (!Person_In_Charge2__c) {
- error.push('鎷呭綋 涓嶅瓨鍦�');
- }
- if (!Agency_Report_Header__c) {
- this.error('Report Header Id 涓嶅瓨鍦�');
- }
- if (!Agency_Hospital__c) {
- error.push('鍖婚櫌 涓嶅瓨鍦�');
- }
- if (!Department_Cateogy__c) {
- error.push('绉戝 涓嶅瓨鍦�');
- }
- if (!doctor2__c) {
- error.push('鎷滆浜� 涓嶅瓨鍦�');
- }
- if (!Purpose_Type__c) {
- error.push('娲诲姩鍖哄垎 涓嶅瓨鍦�');
- }
+ if (rDate >= sDate) {error.push('娲诲姩鏃ュ繀椤绘槸鏈懆锛�'); }
+
+ if (!Person_In_Charge2__c) { error.push("鎷呭綋 涓嶅瓨鍦�"); }
+ if (!Agency_Report_Header__c) { this.error("Report Header Id 涓嶅瓨鍦�"); }
+ if (!Agency_Hospital__c) { error.push("鍖婚櫌 涓嶅瓨鍦�"); }
+ 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')
- ) {
- if (!Result__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')) {
+ if (!Result__c) { error.push("缁撴灉 涓嶅瓨鍦�"); }
}
for (var i = 0; i < error.length; i++) {
this.warning(error[i]);
@@ -1228,74 +910,62 @@
return false;
}
+
// 淇濆瓨鍑︾悊
- component.set('v.loginEdit', true);
- if (component.get('v.mode') == 'edit') {
+ component.set('v.loginEdit',true);
+ if (component.get('v.mode') == 'edit') {
var Agency_Report__c = component.get('v.select_report_data').Id;
var action = component.get('c.editAgencyReport');
- debugger;
+ debugger
// 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,
- doctor: doctor2__c,
- Submit_date: Submit_date__c,
- Product_Category1: Product_Category1__c,
- Product_Category2: Product_Category2__c,
- Product_Category3: Product_Category3__c,
- Result: Result__c,
- Opportunity: Opportunity__c,
- StageName: StageName__c,
- oppAmount: Amount__c,
- oppOCMPrice: OCMSale_Price__c,
- Close_Forecasted_Date: Close_Forecasted_Date__c,
- Report_Date: Report_Date__c
+ "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,
+ "doctor" : doctor2__c,
+ "Submit_date" : Submit_date__c,
+ "Product_Category1" : Product_Category1__c,
+ "Product_Category2" : Product_Category2__c,
+ "Product_Category3" : Product_Category3__c,
+ "Result" : Result__c,
+ "Opportunity" : Opportunity__c,
+ "StageName" : StageName__c,
+ "oppAmount" : Amount__c,
+ "oppOCMPrice" : OCMSale_Price__c,
+ "Close_Forecasted_Date" : Close_Forecasted_Date__c,
+ "Report_Date" : Report_Date__c,
});
-
- action.setCallback(this, function (response) {
+
+ action.setCallback(this,function(response){
var state = response.getState();
- if (state == 'SUCCESS') {
+ if(state == 'SUCCESS'){
this.success('缂栬緫淇濆瓨鎴愬姛');
var report_id = response.getReturnValue();
component.set('v.create_agency_report_id', report_id);
-
- var select_agency_list =
- component.get('v.allselectlist').AgencyPerson__c;
+
+ var select_agency_list = component.get('v.allselectlist').AgencyPerson__c;
for (var i = 0; i < select_agency_list.length; i++) {
- if (
- select_agency_list[i].value ==
- component.get('v.select_report_data')
- .Person_In_Charge2__c
- ) {
+ if (select_agency_list[i].value == component.get('v.select_report_data').Person_In_Charge2__c) {
select_agency_list[i].selected = true;
} else {
select_agency_list[i].selected = false;
}
}
- component
- .find('select_agency_person')
- .set('v.options', select_agency_list);
-
+ component.find('select_agency_person').set('v.options', select_agency_list);
+
component.set('v.update_select_report_data_id', report_id);
- this.get_reports_edit(
- component,
- event,
- helper,
- component.get('v.select_report_data').Submit_date__c,
- component.get('v.select_report_data')
- .Person_In_Charge2__c
- );
+ this.get_reports_edit(component, event, helper, component.get('v.select_report_data').Submit_date__c, component.get('v.select_report_data').Person_In_Charge2__c);
component.find('save_button').set('v.disabled', false);
- component.set('v.loginEdit', false);
- } else {
+ component.set('v.loginEdit',false);
+ }
+ else{
// var error = response.getError();
// alert(JSON.stringify(error));
// alert(JSON.stringify(error[0].fieldErrors));
@@ -1307,66 +977,60 @@
// }
this.error('save_report failed.');
component.find('save_button').set('v.disabled', false);
- component.set('v.loginEdit', false);
+ component.set('v.loginEdit',false);
}
});
$A.enqueueAction(action);
} else {
/* Save (New & Copy) */
-
+
var action = component.get('c.saveAgencyReport');
debugger;
// alert(SupportNeeds__c);
action.setParams({
- Department_Cateogy: Department_Cateogy__c,
- Purpose_Type: Purpose_Type__c,
+ "Department_Cateogy" : Department_Cateogy__c,
+ "Purpose_Type" : Purpose_Type__c,
//SWAG-CBX68C fy 銆愬鎵樸�慏AMS绯荤粺鍛ㄦ姤妯″潡鍐呭闇�姹傚鍔� start
- SupportNeedsc: SupportNeeds__c,
+ "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,
- doctor: doctor2__c,
- Submit_date: Submit_date__c,
- Product_Category1: Product_Category1__c,
- Product_Category2: Product_Category2__c,
- Product_Category3: Product_Category3__c,
- Result: Result__c,
- Opportunity: Opportunity__c,
- StageName: StageName__c,
- oppAmount: Amount__c,
- oppOCMPrice: OCMSale_Price__c,
- Close_Forecasted_Date: Close_Forecasted_Date__c,
- Report_Date: Report_Date__c
+ "Agency_Report_Header" : Agency_Report_Header__c,
+ "Agency_Hospital" : Agency_Hospital__c,
+ "Person_In_Charge2" : Person_In_Charge2__c,
+ "doctor" : doctor2__c,
+ "Submit_date" : Submit_date__c,
+ "Product_Category1" : Product_Category1__c,
+ "Product_Category2" : Product_Category2__c,
+ "Product_Category3" : Product_Category3__c,
+ "Result" : Result__c,
+ "Opportunity" : Opportunity__c,
+ "StageName" : StageName__c,
+ "oppAmount" : Amount__c,
+ "oppOCMPrice" : OCMSale_Price__c,
+ "Close_Forecasted_Date" : Close_Forecasted_Date__c,
+ "Report_Date" : Report_Date__c,
});
- action.setCallback(this, function (response) {
+ action.setCallback(this,function(response){
var state = response.getState();
- if (state == 'SUCCESS') {
+ if(state == 'SUCCESS'){
this.success('淇濆瓨鎴愬姛');
var report_id = response.getReturnValue();
component.set('v.create_agency_report_id', report_id);
+
+ this.get_reports_edit(component, event, helper, component.find('select_date').get('v.value'), component.find('select_agency_person').get('v.value'));
- this.get_reports_edit(
- component,
- event,
- helper,
- component.find('select_date').get('v.value'),
- component.find('select_agency_person').get('v.value')
- );
-
- // 銉€兗銉�銉偊銈c兂銉夈偊鍐呫伄涓�瑕х敤
+ // 銉€兗銉�銉偊銈c兂銉夈偊鍐呫伄涓�瑕х敤
var action2 = component.get('c.getReportsById');
action2.setParams({
- report_id: report_id
+ "report_id" : report_id,
});
- action2.setCallback(this, function (response) {
+ action2.setCallback(this,function(response){
var state = response.getState();
- if (state == 'SUCCESS') {
+ if(state == 'SUCCESS'){
var res = response.getReturnValue();
var reports_now = component.get('v.reports_now');
var reports_now_count = 0;
- if (reports_now.length > 0 && reports_now != '') {
+ if (reports_now.length > 0 && reports_now != "") {
reports_now_count = reports_now.length;
}
@@ -1376,86 +1040,61 @@
res[0].doctor2NameOrigin = doctor2Name;
res[0].visitorTitleOrigin = visitortitle;
// 20220222 PI鏀归�� by Bright--end
- reports_now[reports_now_count] = res[0];
-
- reports_now.sort(function (a, b) {
- if (a.Name > b.Name) return -1;
- if (a.Name < b.Name) return 1;
+ reports_now[reports_now_count] = res[0];
+
+ reports_now.sort(function(a,b) {
+ if(a.Name>b.Name) return -1;
+ if(a.Name < b.Name) return 1;
return 0;
});
-
+
component.set('v.reports_now', reports_now);
- component.set(
- 'v.reports_now_count',
- reports_now.length
- );
- var data_list =
- component.find('modal_data_list_tr');
+ component.set('v.reports_now_count', reports_now.length);
+ var data_list = component.find('modal_data_list_tr');
}
- } else {
+ }
+ else{
this.error('get_reports_now failed.');
- component
- .find('save_button')
- .set('v.disabled', false);
- component.set('v.loginEdit', false);
+ component.find('save_button').set('v.disabled', false);
+ component.set('v.loginEdit',false);
}
});
$A.enqueueAction(action2);
-
+
this.allclear(component);
component.find('save_button').set('v.disabled', false);
- component.set('v.loginEdit', false);
- } else {
+ component.set('v.loginEdit',false);
+ }
+ else{
var error = response.getError();
// alert(JSON.stringify(error));
this.error('saveAgencyReport failed.');
component.find('save_button').set('v.disabled', false);
- component.set('v.loginEdit', false);
+ component.set('v.loginEdit',false);
}
});
$A.enqueueAction(action);
}
},
-
- allclear: function (component) {
- var clear = [{ label: '', value: '', selected: true }];
+
+ allclear : function(component) {
+ var clear = [{label:'', value:'', selected:true}];
component.set('v.hospital', '');
- component.set('v.hospitalId', '');
+ component.set('v.hospitalId', '');
component.set('v.hospitalLinkId', '');
component.find('new_con').set('v.disabled', true);
component.find('select_doctor').set('v.options', clear);
component.set('v.doctor_title', '');
- component
- .find('select_department')
- .set(
- 'v.options',
- this.conv_selected(
- component.get('v.allselectlist.Department_Cateogy__c')
- )
- );
- component
- .find('select_purpose_type')
- .set(
- 'v.options',
- this.conv_selected(
- component.get('v.allselectlist.Purpose_Type__c')
- )
- );
+ component.find('select_department').set('v.options', this.conv_selected(component.get('v.allselectlist.Department_Cateogy__c')));
+ component.find('select_purpose_type').set('v.options', this.conv_selected(component.get('v.allselectlist.Purpose_Type__c')));
//SWAG-CBX68C fy 銆愬鎵樸�慏AMS绯荤粺鍛ㄦ姤妯″潡鍐呭闇�姹傚鍔� start
- component
- .find('SupportNeeds__c')
- .set(
- 'v.options',
- this.conv_selected(
- component.get('v.allselectlist.SupportNeeds__c')
- )
- );
+ component.find('SupportNeeds__c').set('v.options', this.conv_selected(component.get('v.allselectlist.SupportNeeds__c')));
//SWAG-CBX68C fy 銆愬鎵樸�慏AMS绯荤粺鍛ㄦ姤妯″潡鍐呭闇�姹傚鍔� end
// ToDo闇�瑕佹祴璇曟墜鏈轰笂鑳借繍琛屼笉
component.set('v.data.Opportunity__c', '');
- component.find('select_Product1').set('v.value', '');
- component.find('select_Product2').set('v.value', '');
- component.find('select_Product3').set('v.value', '');
+ component.find('select_Product1').set('v.value','');
+ component.find('select_Product2').set('v.value','');
+ component.find('select_Product3').set('v.value','');
console.log('reportDate = 绌�');
component.set('v.data.Report_Date__c', '');
component.set('v.oppdata.Close_Forecasted_Date__c', '');
@@ -1467,28 +1106,16 @@
component.set('v.Amount__c_o', '');
component.set('v.OCMSale_Price__c_o', '');
component.set('v.StageName__c_o', '');
- $A.util.addClass(
- component.find('input-opportunity-stage'),
- 'disp_none'
- );
- $A.util.addClass(
- component.find('input-opportunity-amount1'),
- 'disp_none'
- );
- $A.util.addClass(
- component.find('input-opportunity-amount2'),
- 'disp_none'
- );
+ $A.util.addClass(component.find('input-opportunity-stage'), 'disp_none');
+ $A.util.addClass(component.find('input-opportunity-amount1'), 'disp_none');
+ $A.util.addClass(component.find('input-opportunity-amount2'), 'disp_none');
$A.util.addClass(component.find('input-opportunity-date'), 'disp_none');
- $A.util.removeClass(
- component.find('input-opportunity-blank'),
- 'disp_none'
- );
+ $A.util.removeClass(component.find('input-opportunity-blank'), 'disp_none');
// if ($A.get("$Browser.formFactor") == 'DESKTOP') {
- // var values = [];
- // component.find('input-opportunity').get("v.body")[0].set('v.values', values);
+ // var values = [];
+ // component.find('input-opportunity').get("v.body")[0].set('v.values', values);
// } else {
- // component.find('input-opportunity').get("v.body")[0].set('v.selectedLabel', '');
+ // component.find('input-opportunity').get("v.body")[0].set('v.selectedLabel', '');
// }
// component.find('input-opportunity').set("v.body",[]);
// if (component.find('input-product-category1'))
@@ -1500,96 +1127,38 @@
component.find('select_result').set('v.value', '');
this.select_purpose_type(component);
},
-
- report_date_list: function (component, event, helper, count) {
+
+ report_date_list : function(component, event, helper, count) {
var ret_obj = [];
- var now = new Date();
+ var now = new Date();
for (var i = 0; i < count; i++) {
- var start_day = new Date(
- now.getFullYear(),
- now.getMonth(),
- now.getDate() - now.getDay() + 1 - i * 7
- );
- var end_day = new Date(
- now.getFullYear(),
- now.getMonth(),
- now.getDate() + (7 - now.getDay()) - i * 7
- );
- var start_day_show = new Date(
- now.getFullYear(),
- now.getMonth(),
- now.getDate() - now.getDay() - i * 7
- );
- var end_day_show = new Date(
- now.getFullYear(),
- now.getMonth(),
- now.getDate() + (6 - now.getDay()) - i * 7
- );
- var date_text =
- start_day.getFullYear() +
- '/' +
- (start_day.getMonth() + 1) +
- '/' +
- start_day.getDate() +
- '~' +
- end_day.getFullYear() +
- '/' +
- (end_day.getMonth() + 1) +
- '/' +
- end_day.getDate();
+ var start_day = new Date(now.getFullYear(), now.getMonth(), (now.getDate() - now.getDay() + 1 - (i * 7)));
+ var end_day = new Date(now.getFullYear(), now.getMonth(), now.getDate() + (7 - now.getDay()) - (i * 7));
+
+ var start_day_show = new Date(now.getFullYear(), now.getMonth(), (now.getDate() - now.getDay() - (i * 7)));
+ var end_day_show = new Date(now.getFullYear(), now.getMonth(), now.getDate() + (6 - now.getDay()) - (i * 7));
+ var date_text = start_day.getFullYear() + '/' + (start_day.getMonth() + 1) + '/' + start_day.getDate() + '~' + end_day.getFullYear() + '/' + (end_day.getMonth() + 1) + '/' + end_day.getDate();
if (i == 0) {
ret_obj.push({
- selected: true,
- value:
- start_day.getFullYear() +
- '/' +
- (start_day.getMonth() + 1) +
- '/' +
- start_day.getDate(),
- label:
- start_day_show.getFullYear() +
- '/' +
- (start_day_show.getMonth() + 1) +
- '/' +
- start_day_show.getDate() +
- '~' +
- end_day_show.getFullYear() +
- '/' +
- (end_day_show.getMonth() + 1) +
- '/' +
- end_day_show.getDate()
+ selected : true,
+ value : start_day.getFullYear() + '/' + (start_day.getMonth() + 1) + '/' + start_day.getDate(),
+ label : start_day_show.getFullYear() + '/' + (start_day_show.getMonth() + 1) + '/' + start_day_show.getDate() + '~' + end_day_show.getFullYear() + '/' + (end_day_show.getMonth() + 1) + '/' + end_day_show.getDate(),
});
} else {
ret_obj.push({
- selected: false,
- value:
- start_day.getFullYear() +
- '/' +
- (start_day.getMonth() + 1) +
- '/' +
- start_day.getDate(),
- label:
- start_day_show.getFullYear() +
- '/' +
- (start_day_show.getMonth() + 1) +
- '/' +
- start_day_show.getDate() +
- '~' +
- end_day_show.getFullYear() +
- '/' +
- (end_day_show.getMonth() + 1) +
- '/' +
- end_day_show.getDate()
+ selected : false,
+ value : start_day.getFullYear() + '/' + (start_day.getMonth() + 1) + '/' + start_day.getDate(),
+ label : start_day_show.getFullYear() + '/' + (start_day_show.getMonth() + 1) + '/' + start_day_show.getDate() + '~' + end_day_show.getFullYear() + '/' + (end_day_show.getMonth() + 1) + '/' + end_day_show.getDate(),
});
}
}
- component.find('select_date').set('v.options', ret_obj);
+ component.find('select_date').set('v.options', ret_obj);
component.set('v.report_date_list', ret_obj);
},
-
- create_report_header: function (component, name, s_agency, s_date) {
+
+ create_report_header : function(component, name, s_agency, s_date) {
s_date = this.get_date_string(s_date);
if (s_date == false) {
this.error('get_date_string failed.');
@@ -1602,38 +1171,39 @@
this.error('create_header_input_key failed.');
return false;
}
-
+
var key2 = s_date.replace(/-/g, '');
var action = component.get('c.createReportHeader');
action.setParams({
- name: name,
- s_date: s_date,
- s_agency: s_agency,
- head_key: head_key
+ "name" : name,
+ "s_date" : s_date,
+ "s_agency" : s_agency,
+ "head_key" : head_key,
});
-
- component.set('v.login', true);
- action.setCallback(this, function (response) {
+
+ component.set('v.login',true);
+ action.setCallback(this,function(response){
var state = response.getState();
- if (state == 'SUCCESS') {
+ if(state == 'SUCCESS'){
var res = response.getReturnValue();
component.set('v.agency_report_header_id', res);
- component.set('v.login', false);
+ component.set('v.login',false);
this.toggle_report(component);
- } else {
+ }
+ else{
this.error('createReportHeader callback failed.');
- component.set('v.login', false);
+ component.set('v.login',false);
}
});
$A.enqueueAction(action);
},
- create_header_input_key: function (agency_id, s_date) {
- if (typeof s_date != 'string') {
+ create_header_input_key : function(agency_id, s_date) {
+ if (typeof(s_date) != 'string') {
s_date = this.get_date_string(s_date);
if (s_date == false) {
- this.error('get_date_string in create_header_input_key.');
+ this.error('get_date_string in create_header_input_key.')
return false;
}
}
@@ -1642,7 +1212,7 @@
}
s_date = s_date.replace(/-/g, '');
- var headkey = agency_id + ':' + s_date;
+ var headkey = agency_id + ":" + s_date;
return headkey;
},
@@ -1650,14 +1220,14 @@
/* typeof is not cool
* @ret : String, Boolean, Date, Error, Array, Function, Null, Undefined, etc
*/
- object_type: function (obj) {
+ object_type : function(obj) {
var obj_type = Object.prototype.toString.call(obj).slice(8, -1);
return obj_type;
},
// create yyyy-mm-dd string
- get_date_string: function (val) {
- if (typeof val == 'string') {
+ get_date_string : function(val) {
+ if (typeof(val) == 'string') {
if (val.match(/^\d{4}\/\d{1,2}\/\d{1,2}$/)) {
val = val.replace(/[\/]/g, '-');
var tmp = val.split('-');
@@ -1678,39 +1248,39 @@
if (String(mm).length == 1) {
mm = '0' + mm;
}
-
+
var dd = '';
if (String(val.getDate()).length == 1) {
dd = '0' + val.getDate();
} else {
dd = val.getDate();
}
-
+
val = val.getFullYear() + '-' + mm + '-' + dd;
} else {
return false;
}
-
+
return val;
},
-
- searchHos: function (component, event, helper) {
- var hospital_name = event.getParam('value');
- var action = component.get('c.getHospitalList');
+
+ searchHos : function(component, event, helper) {
+ var hospital_name = event.getParam("value");
+ var action = component.get("c.getHospitalList");
debugger;
- action.setParams({ hospital_name: hospital_name });
+ action.setParams({"hospital_name": hospital_name});
- action.setCallback(this, function (response) {
+ action.setCallback(this, function(response) {
var state = response.getState();
- if (state === 'SUCCESS') {
- var hospital_list = component.find('hospital_list');
- var hosList = response.getReturnValue();
- if (hosList.length > 0) {
- $A.util.addClass(hospital_list, 'slds-is-open');
- } else {
- $A.util.removeClass(hospital_list, 'slds-is-open');
- }
- component.set('v.hospitalList', response.getReturnValue());
+ if(state === "SUCCESS") {
+ var hospital_list = component.find('hospital_list');
+ var hosList = response.getReturnValue();
+ if (hosList.length > 0) {
+ $A.util.addClass(hospital_list, 'slds-is-open');
+ } else {
+ $A.util.removeClass(hospital_list, 'slds-is-open');
+ }
+ component.set("v.hospitalList", response.getReturnValue());
} else {
$A.util.removeClass(hospital_list, 'slds-is-open');
}
@@ -1718,17 +1288,17 @@
$A.enqueueAction(action);
},
- hideSearch: function (component, event, helper) {
- var hospital_list = component.find('hospital_list');
- $A.util.removeClass(hospital_list, 'slds-is-open');
+ hideSearch : function(component, event, helper) {
+ var hospital_list = component.find('hospital_list');
+ $A.util.removeClass(hospital_list, 'slds-is-open');
},
- selectHos: function (component, event, helper) {
- debugger;
- var hospital_list = component.find('hospital_list');
- $A.util.removeClass(hospital_list, 'slds-is-open');
- var accname = event.currentTarget.dataset.accname;
- var accid = event.currentTarget.dataset.accid;
+ selectHos : function(component, event, helper) {
+ debugger
+ var hospital_list = component.find('hospital_list');
+ $A.util.removeClass(hospital_list, 'slds-is-open');
+ var accname = event.currentTarget.dataset.accname;
+ var accid = event.currentTarget.dataset.accid;
var hospital_data = component.get('v.hospitalList');
for (var i = 0; i < hospital_data.length; i++) {
if (hospital_data[i].Hospital__c == accid) {
@@ -1737,40 +1307,32 @@
component.find('new_con').set('v.disabled', false);
}
}
- component.set('v.hospital', accname);
- component.set('v.hospitalId', accid);
+ component.set("v.hospital", accname);
+ component.set("v.hospitalId", accid);
this.set_doctor_list(component);
this.opportunityChange(component, event, helper);
},
-
- select_purpose_type: function (component) {
+
+ select_purpose_type : function(component) {
var purpose_type = component.find('select_purpose_type').get('v.value');
- if (
- (purpose_type != null &&
- purpose_type != undefined &&
- purpose_type.substr(-3) == 'OPD') ||
- purpose_type.substr(-3) == 'SIS'
- ) {
+ if (purpose_type != null && purpose_type != undefined && purpose_type.substr(-3) == 'OPD' || purpose_type.substr(-3) == 'SIS') {
var result = component.find('result');
- $A.util.removeClass(result, 'disp_none');
+ $A.util.removeClass(result, 'disp_none');
} else {
component.find('select_result').set('v.value', '');
var result = component.find('result');
- $A.util.addClass(result, 'disp_none');
+ $A.util.addClass(result, 'disp_none');
}
this.select_department(component, null, null);
},
-
- doctor_change: function (component, event, helper) {
+
+ doctor_change : function(component, event, helper) {
var doctor_value = component.find('select_doctor').get('v.value');
var doctor_list = component.get('v.doctor_list');
var flg = false;
for (var i = 0; i < doctor_list.length; i++) {
if (doctor_list[i].value == doctor_value) {
- component.set(
- 'v.doctor_title',
- doctor_list[i].Doctor_Division1__c
- );
+ component.set('v.doctor_title', doctor_list[i].Doctor_Division1__c);
flg = true;
break;
}
@@ -1780,36 +1342,30 @@
}
},
// PIPL update Yin Mingjie 21/02/2022 start
- set_aws_url: function (component, sobject) {
+ set_aws_url : function(component,sobject) {
var action = component.get('c.getAwsurl');
action.setParams({
- sobj: sobject
+ "sobj" : sobject,
});
- action.setCallback(this, function (response) {
+ action.setCallback(this,function(response){
var state = response.getState();
- if (state == 'SUCCESS') {
+ if(state == 'SUCCESS'){
var awsmap = this.conv_selected(response.getReturnValue());
- component.set('v.AWStoken', awsmap.token);
- component.set('v.AWSinsert', awsmap.newUrl);
- component.set('v.AWSsearch', awsmap.searchUrl);
- component.set('v.AWStransactionURL', awsmap.transactionURL);
- } else {
+ component.set('v.AWStoken',awsmap.token);
+ component.set('v.AWSinsert',awsmap.newUrl);
+ component.set('v.AWSsearch',awsmap.searchUrl);
+ component.set('v.AWStransactionURL',awsmap.transactionURL);
+ }
+ else{
this.error('AWS url/token error.');
- component.set('v.loginEdit', false);
+ component.set('v.loginEdit',false);
}
});
$A.enqueueAction(action);
},
- insert_agencycontact: function (
- component,
- token,
- newUrl,
- payload,
- agencyHospitalid,
- helper,
- hospitalName
- ) {
+ insert_agencycontact : function(component,token,newUrl,payload,agencyHospitalid,helper,hospitalName) {
+
// AWSService.insert(newUrl,payload,function(result){
// if(result.status == '0'){
// $A.getCallback(function(){
@@ -1822,7 +1378,7 @@
// component.find('OppMessage').setError('AWS insert error.');
// }
// },token);
-
+
fetch(newUrl, {
method: 'POST',
body: payload,
@@ -1830,63 +1386,49 @@
'Content-Type': 'application/json',
'pi-token': token
}
- })
- .then((data) => {
- return data.json();
- })
- .then((result) => {
- if (result.status == '0') {
- $A.getCallback(function () {
- helper.to_agencycontact(
- component,
- result,
- agencyHospitalid
- );
- })();
- } else {
- console.log('AWS status error:' + result);
- component.set('v.loginEdit', false);
- if (result.status == '129') {
- component
- .find('OppMessage')
- .setError(
- '璇ュ鎴蜂汉鍛樺悕瀛楀凡瀛樺湪锛屽湪' +
- hospitalName +
- '鍖婚櫌锛岃淇敼'
- );
- } else {
- component
- .find('OppMessage')
- .setError('AWS insert error.');
- }
+ }).then((data) => {
+ return data.json();
+ }).then((result) => {
+ if(result.status == '0'){
+ $A.getCallback(function(){
+ helper.to_agencycontact(component,result,agencyHospitalid);
+ })();
+ }else{
+ console.log('AWS status error:' + result)
+ component.set('v.loginEdit',false);
+ if(result.status == '129'){
+ component.find('OppMessage').setError('璇ュ鎴蜂汉鍛樺悕瀛楀凡瀛樺湪锛屽湪'+hospitalName+'鍖婚櫌锛岃淇敼');
+ }else{
+ component.find('OppMessage').setError('AWS insert error.');
}
- })
- .catch((error) => {
- console.log('AWS insert error:' + error);
- component.set('v.loginEdit', false);
- component.find('OppMessage').setError('AWS insert error.');
- });
+ }
+ }).catch(error => {
+ console.log('AWS insert error:' + error)
+ component.set('v.loginEdit',false);
+ component.find('OppMessage').setError('AWS insert error.');
+ });
+
},
- to_agencycontact: function (component, result, agencyHospitalid) {
+ to_agencycontact : function(component,result,agencyHospitalid) {
var action = component.get('c.saveAgencyContact');
action.setParams({
- name: result.object[0].name,
+ "name" : result.object[0].name,
//"nameEncrypt" : result.object[0].nameEncrypt,
- type: result.object[0].type,
+ "type" : result.object[0].type,
//"typeEncrypt" : result.object[0].typeEncrypt,
- doctorDivision1: result.object[0].doctorDivision1,
+ "doctorDivision1" : result.object[0].doctorDivision1,
//"doctorDivision1Encrypt" : result.object[0].doctorDivision1Encrypt,
- agencyHospitalid: agencyHospitalid,
- awsid: result.object[0].dataId
+ "agencyHospitalid" : agencyHospitalid,
+ "awsid" : result.object[0].dataId,
});
- action.setCallback(this, function (response) {
+ action.setCallback(this,function(response){
var state = response.getState();
- if (state == 'SUCCESS') {
+ if(state == 'SUCCESS'){
var acMap = this.conv_selected(response.getReturnValue());
console.log(acMap);
- if (acMap.AgencyContactId != '') {
- //纭浜嬪姟
+ if(acMap.AgencyContactId != ''){
+ //纭浜嬪姟
var token = component.get('v.AWStoken');
var confirmUrl = component.get('v.AWStransactionURL');
@@ -1895,28 +1437,24 @@
data['sfRecordId'] = '';
data['txId'] = result.txId;
- this.to_confirm(
- component,
- token,
- confirmUrl,
- JSON.stringify(data)
- );
- } else if (acMap.errormsg != '') {
+ this.to_confirm(component,token,confirmUrl,JSON.stringify(data));
+ }else if(acMap.errormsg != ''){
this.error(acMap.errormsg);
- component.set('v.loginEdit', false);
- } else {
+ component.set('v.loginEdit',false);
+ }else {
this.error('agency contact insert id error.');
- component.set('v.loginEdit', false);
+ component.set('v.loginEdit',false);
}
- } else {
+ }
+ else{
this.error('agency contact insert error.');
- component.set('v.loginEdit', false);
+ component.set('v.loginEdit',false);
}
});
$A.enqueueAction(action);
},
- to_confirm: function (component, token, confirmUrl, payload) {
+ to_confirm : function(component,token,confirmUrl,payload) {
fetch(confirmUrl, {
method: 'POST',
body: payload,
@@ -1924,47 +1462,40 @@
'Content-Type': 'application/json',
'pi-token': token
}
- })
- .then((data) => {
- return data.json();
- })
- .then((result) => {
- if (
- result.status == '0' &&
- result.hasOwnProperty('success') &&
- result.success
- ) {
- component.set('v.truthy', false);
- var modal_newAC = component.find('modal_newAC');
- $A.util.addClass(modal_newAC, 'disp_none');
- this.success('.瀹㈡埛浜哄憳宸插垱寤恒��');
- this.set_doctor_list(component);
- } else {
- this.error('AWS confirm error.');
- component.set('v.loginEdit', false);
- }
- })
- .catch((error) => {
+ }).then((data) => {
+ return data.json();
+ }).then((result) => {
+ if(result.status == '0' && result.hasOwnProperty('success') && result.success){
+ component.set('v.truthy', false);
+ var modal_newAC = component.find('modal_newAC')
+ $A.util.addClass(modal_newAC, 'disp_none');
+ this.success('.瀹㈡埛浜哄憳宸插垱寤恒��');
+ this.set_doctor_list(component);
+ }else {
this.error('AWS confirm error.');
- component.set('v.loginEdit', false);
- });
+ component.set('v.loginEdit',false);
+ }
+ }).catch(error => {
+ this.error('AWS confirm error.');
+ component.set('v.loginEdit',false);
+ });
},
// PIPL update Yin Mingjie 21/02/2022 end
- set_doctor_list: function (component) {
+ set_doctor_list : function(component) {
var hospital_id = component.get('v.hospitalLinkId');
if (hospital_id) {
- component.set('v.loginEdit', true);
+ component.set('v.loginEdit',true);
var action = component.get('c.getDoctorList');
action.setParams({
- hospital_id: hospital_id
+ "hospital_id" : hospital_id,
});
- action.setCallback(this, function (response) {
+ action.setCallback(this,function(response){
var state = response.getState();
- if (state == 'SUCCESS') {
+ if(state == 'SUCCESS'){
var retMap = this.conv_selected(response.getReturnValue());
// PIPL update Yin Mingjie 21/02/2022 start
- this.AWS_search(retMap, component);
+ this.AWS_search(retMap,component);
/*
var default_doctor = component.get('v.default_select_doctor_id');
if (default_doctor != '' && res.length > 0) {
@@ -1991,10 +1522,11 @@
component.set('v.doctor_list', res);
component.set('v.login',false);
*/
- // PIPL update Yin Mingjie 21/02/2022 end
- } else {
+ // PIPL update Yin Mingjie 21/02/2022 end
+ }
+ else{
this.error('set_doctor_list failed.');
- component.set('v.loginEdit', false);
+ component.set('v.loginEdit',false);
}
});
$A.enqueueAction(action);
@@ -2002,49 +1534,35 @@
},
// PIPL update Yin Mingjie 21/02/2022 start
- AWS_search: function (retMap, component) {
+ AWS_search : function(retMap,component) {
var token = retMap.sre.token;
var searchUrl = retMap.sre.searchUrl;
var dataArr = new Array();
for (const key in retMap) {
- if (key == 'sre') {
- continue;
- }
+ if (key == 'sre') {continue;}
dataArr.push(key);
}
- if (dataArr.length == 0) {
- component.set('v.loginEdit', false);
+ if(dataArr.length == 0){
+ component.set('v.loginEdit',false);
this.warning('娌℃湁鎵惧埌绗﹀悎鏉′欢鐨勫鎴蜂汉鍛�');
return;
}
- let obj = Object.create(null);
+ let obj= Object.create(null);
obj['dataIds'] = dataArr;
var data = JSON.stringify(obj);
- this.search_agency_contact(token, searchUrl, data, retMap, component);
+ this.search_agency_contact(token,searchUrl,data,retMap,component);
},
- search_agency_contact: function (
- token,
- searchUrl,
- payload,
- retMap,
- component
- ) {
- this.search_core(
- token,
- searchUrl,
- payload,
- (result) => {
- if (result.status == '0') {
- this.to_doctor_list(result, retMap, component);
- } else {
- this.error('AWS search status4 : ' + result.status);
- component.set('v.loginEdit', false);
- }
- },
- component
- );
+ search_agency_contact : function(token,searchUrl,payload,retMap,component) {
+ this.search_core(token,searchUrl,payload,(result)=>{
+ if(result.status == '0'){
+ this.to_doctor_list(result,retMap,component);
+ }else{
+ this.error('AWS search status4 : ' + result.status);
+ component.set('v.loginEdit',false);
+ }
+ },component);
// fetch(searchUrl, {
// method: 'POST',
// body: payload,
@@ -2055,13 +1573,13 @@
// }).then((data) => {
// return data.json();
// }).then((result) => {
-
+
// }).catch(error => {
// this.error('AWS search error.');
// component.set('v.login',false);
// });
},
- search_core: function (token, searchUrl, payload, callback, component) {
+ search_core : function(token,searchUrl,payload,callback,component) {
console.log('token = ' + token);
console.log('searchUrl = ' + searchUrl);
console.log('payload = ' + payload);
@@ -2072,22 +1590,19 @@
'Content-Type': 'application/json',
'pi-token': token
}
- })
- .then((data) => {
- return data.json();
- })
- .then((result) => {
- component.set('v.loginEdit', false);
- if (callback) callback(result);
- })
- .catch((error) => {
- console.log('error = ' + JSON.stringify(error));
- this.error('AWS search error.');
- component.set('v.loginEdit', false);
- });
+ }).then((data) => {
+ return data.json();
+ }).then((result) => {
+ component.set('v.loginEdit',false);
+ if(callback)callback(result);
+ }).catch(error => {
+ console.log('error = ' + JSON.stringify(error));
+ this.error('AWS search error.');
+ component.set('v.loginEdit',false);
+ });
},
- to_doctor_list: function (result, retMap, component) {
+ to_doctor_list : function(result,retMap,component) {
var resls = result.object;
var res = [];
var space = {};
@@ -2125,10 +1640,10 @@
component.set('v.doctor_title', res[0].Doctor_Division1__c);
}
}
-
+
component.set('v.default_select_doctor_id', '');
component.set('v.doctor_list', res);
- component.set('v.loginEdit', false);
+ component.set('v.loginEdit',false);
},
// PIPL update Yin Mingjie 21/02/2022 end
@@ -2143,99 +1658,52 @@
// }
// options.splice(remove,1);
// },
-
- opportunityChange: function (component, event, helper) {
- debugger;
+
+ opportunityChange : function(component, event, helper) {
+ debugger
var opp_id = component.get('v.data.Opportunity__c');
if (opp_id == '') {
- $A.util.addClass(
- component.find('input-opportunity-stage'),
- 'disp_none'
- );
- $A.util.addClass(
- component.find('input-opportunity-amount1'),
- 'disp_none'
- );
- $A.util.addClass(
- component.find('input-opportunity-amount2'),
- 'disp_none'
- );
- $A.util.addClass(
- component.find('input-opportunity-date'),
- 'disp_none'
- );
- $A.util.removeClass(
- component.find('input-opportunity-blank'),
- 'disp_none'
- );
+ $A.util.addClass(component.find('input-opportunity-stage'), 'disp_none');
+ $A.util.addClass(component.find('input-opportunity-amount1'), 'disp_none');
+ $A.util.addClass(component.find('input-opportunity-amount2'), 'disp_none');
+ $A.util.addClass(component.find('input-opportunity-date'), 'disp_none');
+ $A.util.removeClass(component.find('input-opportunity-blank'), 'disp_none');
} else if (opp_id == 'MALFORMED_ID') {
component.set('v.data.Opportunity__c', '');
- $A.util.addClass(
- component.find('input-opportunity-stage'),
- 'disp_none'
- );
- $A.util.addClass(
- component.find('input-opportunity-amount1'),
- 'disp_none'
- );
- $A.util.addClass(
- component.find('input-opportunity-amount2'),
- 'disp_none'
- );
- $A.util.addClass(
- component.find('input-opportunity-date'),
- 'disp_none'
- );
- $A.util.removeClass(
- component.find('input-opportunity-blank'),
- 'disp_none'
- );
- } else if (opp_id != '') {
+ $A.util.addClass(component.find('input-opportunity-stage'), 'disp_none');
+ $A.util.addClass(component.find('input-opportunity-amount1'), 'disp_none');
+ $A.util.addClass(component.find('input-opportunity-amount2'), 'disp_none');
+ $A.util.addClass(component.find('input-opportunity-date'), 'disp_none');
+ $A.util.removeClass(component.find('input-opportunity-blank'), 'disp_none');
+ } else if (opp_id != "") {
var hospital_link_id = component.get('v.hospitalLinkId');
if (hospital_link_id == '') {
this.warning('鍖婚櫌涓嶅瓨鍦�');
// ToDo闇�瑕佹祴璇曟墜鏈轰笂鑳借繍琛屼笉
component.set('v.data.Opportunity__c', '');
- $A.util.addClass(
- component.find('input-opportunity-stage'),
- 'disp_none'
- );
- $A.util.addClass(
- component.find('input-opportunity-amount1'),
- 'disp_none'
- );
- $A.util.addClass(
- component.find('input-opportunity-amount2'),
- 'disp_none'
- );
- $A.util.addClass(
- component.find('input-opportunity-date'),
- 'disp_none'
- );
- $A.util.removeClass(
- component.find('input-opportunity-blank'),
- 'disp_none'
- );
+ $A.util.addClass(component.find('input-opportunity-stage'), 'disp_none');
+ $A.util.addClass(component.find('input-opportunity-amount1'), 'disp_none');
+ $A.util.addClass(component.find('input-opportunity-amount2'), 'disp_none');
+ $A.util.addClass(component.find('input-opportunity-date'), 'disp_none');
+ $A.util.removeClass(component.find('input-opportunity-blank'), 'disp_none');
// if ($A.get("$Browser.formFactor") == 'DESKTOP') {
// var values = [];
// // component.find('input-opportunity').get("v.body")[0].set('v.values', values);
// } else {
- // component.find('input-opportunity').get("v.body")[0].set('v.selectedLabel', '');
+ // component.find('input-opportunity').get("v.body")[0].set('v.selectedLabel', '');
// }
return false;
}
- var action = component.get(
- 'c.selectOpportunityByIdAndHospitalLinkId'
- );
+ var action = component.get('c.selectOpportunityByIdAndHospitalLinkId');
action.setParams({
- opportunity_id: opp_id,
- agency_hospital_link_id: component.get('v.hospitalLinkId')
+ "opportunity_id" : opp_id,
+ "agency_hospital_link_id" : component.get('v.hospitalLinkId'),
});
- component.set('v.loginEdit', true);
- action.setCallback(this, function (response) {
+ component.set('v.loginEdit',true);
+ action.setCallback(this,function(response){
var state = response.getState();
- if (state == 'SUCCESS') {
+ if(state == 'SUCCESS'){
var res = response.getReturnValue();
if (res.length <= 0) {
if (component.get('v.data.Opportunity__c')) {
@@ -2243,33 +1711,18 @@
}
// ToDo闇�瑕佹祴璇曟墜鏈轰笂鑳借繍琛屼笉
component.set('v.data.Opportunity__c', '');
- $A.util.addClass(
- component.find('input-opportunity-stage'),
- 'disp_none'
- );
- $A.util.addClass(
- component.find('input-opportunity-amount1'),
- 'disp_none'
- );
- $A.util.addClass(
- component.find('input-opportunity-amount2'),
- 'disp_none'
- );
- $A.util.addClass(
- component.find('input-opportunity-date'),
- 'disp_none'
- );
- $A.util.removeClass(
- component.find('input-opportunity-blank'),
- 'disp_none'
- );
+ $A.util.addClass(component.find('input-opportunity-stage'), 'disp_none');
+ $A.util.addClass(component.find('input-opportunity-amount1'), 'disp_none');
+ $A.util.addClass(component.find('input-opportunity-amount2'), 'disp_none');
+ $A.util.addClass(component.find('input-opportunity-date'), 'disp_none');
+ $A.util.removeClass(component.find('input-opportunity-blank'), 'disp_none');
// if ($A.get("$Browser.formFactor") == 'DESKTOP') {
// var values = [];
// component.find('input-opportunity').get("v.body")[0].set('v.values', values);
// } else {
- // component.find('input-opportunity').get("v.body")[0].set('v.selectedLabel', '');
+ // component.find('input-opportunity').get("v.body")[0].set('v.selectedLabel', '');
// }
- component.set('v.loginEdit', false);
+ component.set('v.loginEdit',false);
return false;
}
//SWAG-CKH5M8 銆愬鎵樸�戝懆鎶ュ叧鑱旇浠凤紝鍙�夋嫨璇环鑼冨洿璋冩暣 fy start
@@ -2286,127 +1739,77 @@
// // var values = [];
// // component.find('input-opportunity').get("v.body")[0].set('v.values', values);
// // } else {
- // // component.find('input-opportunity').get("v.body")[0].set('v.selectedLabel', '');
+ // // component.find('input-opportunity').get("v.body")[0].set('v.selectedLabel', '');
// // }
// component.set('v.login',false);
// return false;
// }
//SWAG-CKH5M8 銆愬鎵樸�戝懆鎶ュ叧鑱旇浠凤紝鍙�夋嫨璇环鑼冨洿璋冩暣 fy end
- else {
+ else {
component.set('v.loadOpp', false);
- component.set('v.oppdata', res[0]);
- this.set_selected(
- component,
- 'select_stageName',
- res[0].StageName__c
- );
- component.set(
- 'v.Close_Forecasted_Date__c_o',
- res[0].Close_Forecasted_Date__c
- );
+ component.set('v.oppdata',res[0]);
+ this.set_selected(component, 'select_stageName', res[0].StageName__c);
+ component.set('v.Close_Forecasted_Date__c_o', res[0].Close_Forecasted_Date__c);
component.set('v.Amount__c_o', res[0].Amount__c);
- component.set(
- 'v.OCMSale_Price__c_o',
- res[0].OCMSale_Price__c
- );
+ component.set('v.OCMSale_Price__c_o', res[0].OCMSale_Price__c);
component.set('v.StageName__c_o', res[0].StageName__c);
- $A.util.removeClass(
- component.find('input-opportunity-stage'),
- 'disp_none'
- );
- $A.util.removeClass(
- component.find('input-opportunity-amount1'),
- 'disp_none'
- );
- $A.util.removeClass(
- component.find('input-opportunity-amount2'),
- 'disp_none'
- );
- $A.util.removeClass(
- component.find('input-opportunity-date'),
- 'disp_none'
- );
- $A.util.addClass(
- component.find('input-opportunity-blank'),
- 'disp_none'
- );
+ $A.util.removeClass(component.find('input-opportunity-stage'), 'disp_none');
+ $A.util.removeClass(component.find('input-opportunity-amount1'), 'disp_none');
+ $A.util.removeClass(component.find('input-opportunity-amount2'), 'disp_none');
+ $A.util.removeClass(component.find('input-opportunity-date'), 'disp_none');
+ $A.util.addClass(component.find('input-opportunity-blank'), 'disp_none');
}
-
- component.set('v.loginEdit', false);
- } else {
- this.error(
- 'selectOpportunityByIdAndHospitalLinkId failed.'
- );
- component.set('v.loginEdit', false);
+
+ component.set('v.loginEdit',false);
+ }
+ else{
+ this.error('selectOpportunityByIdAndHospitalLinkId failed.');
+ component.set('v.loginEdit',false);
}
});
$A.enqueueAction(action);
}
},
-
- productcategoryChange1: function (component, event, helper) {
- var product_category_id = component
- .find('select_Product1')
- .get('v.value');
+
+ productcategoryChange1 : function(component, event, helper) {
+ var product_category_id = component.find('select_Product1').get('v.value');
var pcId1 = component.find('select_Product2').get('v.value');
var pcId2 = component.find('select_Product3').get('v.value');
var p1bool = pcId1 != '' && pcId1 != null && pcId1 != undefined;
var p2bool = pcId2 != '' && pcId2 != null && pcId2 != undefined;
- var p0bool =
- product_category_id != '' &&
- product_category_id != null &&
- product_category_id != undefined;
- if (
- (p1bool && p0bool && product_category_id == pcId1) ||
- (p2bool && p0bool && product_category_id == pcId2)
- ) {
+ var p0bool = product_category_id != '' && product_category_id != null && product_category_id != undefined;
+ if ((p1bool && p0bool && product_category_id == pcId1) || (p2bool && p0bool && product_category_id == pcId2)) {
this.warning('涓嶈兘閫夋嫨鍚屾牱鐨勪骇鍝佸尯鍒�');
- component.find('select_Product1').set('v.value', '');
+ component.find('select_Product1').set('v.value','');
}
},
- productcategoryChange2: function (component, event, helper) {
- var product_category_id = component
- .find('select_Product2')
- .get('v.value');
+ productcategoryChange2 : function(component, event, helper) {
+ var product_category_id = component.find('select_Product2').get('v.value');
var pcId1 = component.find('select_Product1').get('v.value');
var pcId2 = component.find('select_Product3').get('v.value');
var p1bool = pcId1 != '' && pcId1 != null && pcId1 != undefined;
var p2bool = pcId2 != '' && pcId2 != null && pcId2 != undefined;
- var p0bool =
- product_category_id != '' &&
- product_category_id != null &&
- product_category_id != undefined;
- if (
- (p1bool && p0bool && product_category_id == pcId1) ||
- (p2bool && p0bool && product_category_id == pcId2)
- ) {
+ var p0bool = product_category_id != '' && product_category_id != null && product_category_id != undefined;
+ if ((p1bool && p0bool && product_category_id == pcId1) || (p2bool && p0bool && product_category_id == pcId2)) {
this.warning('涓嶈兘閫夋嫨鍚屾牱鐨勪骇鍝佸尯鍒�');
- component.find('select_Product2').set('v.value', '');
+ component.find('select_Product2').set('v.value','');
}
},
- productcategoryChange3: function (component, event, helper) {
- var product_category_id = component
- .find('select_Product3')
- .get('v.value');
+ productcategoryChange3 : function(component, event, helper) {
+ var product_category_id = component.find('select_Product3').get('v.value');
var pcId1 = component.find('select_Product1').get('v.value');
var pcId2 = component.find('select_Product2').get('v.value');
var p1bool = pcId1 != '' && pcId1 != null && pcId1 != undefined;
var p2bool = pcId2 != '' && pcId2 != null && pcId2 != undefined;
- var p0bool =
- product_category_id != '' &&
- product_category_id != null &&
- product_category_id != undefined;
- if (
- (p1bool && p0bool && product_category_id == pcId1) ||
- (p2bool && p0bool && product_category_id == pcId2)
- ) {
+ var p0bool = product_category_id != '' && product_category_id != null && product_category_id != undefined;
+ if ((p1bool && p0bool && product_category_id == pcId1) || (p2bool && p0bool && product_category_id == pcId2)) {
this.warning('涓嶈兘閫夋嫨鍚屾牱鐨勪骇鍝佸尯鍒�');
- component.find('select_Product3').set('v.value', '');
+ component.find('select_Product3').set('v.value','');
}
},
-
- conv_selected: function (obj) {
+
+ conv_selected : function(obj) {
for (var i = 0; i < obj.length; i++) {
if (obj[i].selected) {
if (obj[i].selected == 'true') {
@@ -2416,11 +1819,11 @@
}
}
}
-
+
return obj;
},
-
- set_selected: function (component, aura_id_name, value) {
+
+ set_selected : function (component, aura_id_name, value) {
var select_tmp = component.find(aura_id_name).get('v.options');
if (select_tmp) {
for (var i = 0; i < select_tmp.length; i++) {
@@ -2436,44 +1839,44 @@
return false;
}
},
-
- success: function (message) {
- var toastEvent = $A.get('e.force:showToast');
+
+ success : function(message) {
+ var toastEvent = $A.get("e.force:showToast");
toastEvent.setParams({
- title: '鎴愬姛!',
- message: message,
- type: 'success',
- duration: '5000'
+ "title" : "鎴愬姛!",
+ "message" : message,
+ "type" : "success",
+ "duration" : "5000"
});
toastEvent.fire();
},
-
- warning: function (message) {
- var toastEvent = $A.get('e.force:showToast');
+
+ warning : function(message) {
+ var toastEvent = $A.get("e.force:showToast");
toastEvent.setParams({
- title: '璀﹀憡!',
- message: message,
- type: 'warning',
- duration: '10000'
+ "title": "璀﹀憡!",
+ "message": message,
+ "type":"warning",
+ "duration" : "10000"
});
toastEvent.fire();
},
-
- error: function (message) {
+
+ error : function(message) {
// $('toastMessage.forceToastManager').css('white-space', 'pre-wrap');
- var toastEvent = $A.get('e.force:showToast');
+ var toastEvent = $A.get("e.force:showToast");
toastEvent.setParams({
- title: '閿欒!',
- message: message,
- type: 'error',
- duration: 'sticky'
+ "title": "閿欒!",
+ "message": message,
+ "type":"error",
+ "duration" : "sticky"
});
toastEvent.fire();
},
-
- createCon: function (component, event, helper) {
- var modal_newAC = component.find('modal_newAC');
+
+ createCon : function(component, event, helper) {
+ var modal_newAC = component.find('modal_newAC')
$A.util.removeClass(modal_newAC, 'disp_none');
component.set('v.truthy', true);
// var modal_newAC = component.find('modal_newAC')
@@ -2486,7 +1889,7 @@
// var fields = component.find("newOpportunityField");
// var vaildationFailReason = '';
// var currentDate = new Date().toJSON().slice(0,10);
-
+
// fields.forEach(function (field) {
// if(field.get("v.fieldName") === 'Type__c' && $A.util.isEmpty(field.get("v.value"))){
// showValidationError = true;
@@ -2496,66 +1899,63 @@
// vaildationFailReason = "鍖荤敓鍖哄垎(鑱屽姟)涓嶈兘涓虹┖锛�";
// }
// });
-
+
// if (showValidationError) {
// component.find('OppMessage').setError(vaildationFailReason);
// }
// },
// vivek end 娣诲姞楠岃瘉
- hideCmp: function (component, event, helper) {
- var div1 = component.find('report');
- var div2 = component.find('report_list');
+ hideCmp : function(component, event, helper) {
+ var div1 = component.find('report')
+ var div2 = component.find('report_list')
$A.util.addClass(div1, 'disp_none');
$A.util.addClass(div2, 'disp_none');
},
-
- handleSuccess: function (component, event, helper) {
+
+ handleSuccess : function(component, event, helper) {
var insertId = event.getParams().response.Id;
var displayValue = event.getParams().response.fields.Name.value;
event.setParams({});
component.set('v.truthy', false);
- var modal_newAC = component.find('modal_newAC');
+ var modal_newAC = component.find('modal_newAC')
$A.util.addClass(modal_newAC, 'disp_none');
this.success('.瀹㈡埛浜哄憳宸插垱寤恒��');
this.set_doctor_list(component);
},
-
- createCancel: function (component, event, helper) {
+
+ createCancel : function(component, event, helper) {
component.set('v.truthy', false);
- var modal_newAC = component.find('modal_newAC');
+ var modal_newAC = component.find('modal_newAC')
$A.util.addClass(modal_newAC, 'disp_none');
},
- setOpportunity_cfilter: function (component) {
- debugger;
+ setOpportunity_cfilter : function(component) {
+ debugger
var hosId = component.get('v.hospitalId');
- var Department_Cateogy__c = component
- .find('select_department')
- .get('v.value');
+ var Department_Cateogy__c = component.find('select_department').get('v.value');
var opportunity_cfilter = '';
if (hosId != '' && hosId != null) {
- opportunity_cfilter =
- ' Agency_Hospital__r.Hospital__c=' + "'" + hosId + "'";
+ opportunity_cfilter = ' Agency_Hospital__r.Hospital__c=' + '\'' + hosId + '\'';
}
if (Department_Cateogy__c != '' && Department_Cateogy__c != null) {
if (opportunity_cfilter != '' && opportunity_cfilter != null) {
opportunity_cfilter += ' AND ';
}
- opportunity_cfilter +=
- 'Department_Cateogy__c=' + "'" + Department_Cateogy__c + "'";
+ opportunity_cfilter += 'Department_Cateogy__c=' + '\'' + Department_Cateogy__c + '\'';
}
component.set('v.opportunity_cfilter', opportunity_cfilter);
component.set('v.data.Opportunity__c', null);
},
- readFile: function (component, helper, file) {
+ readFile: function(component, helper, file) {
if (!file) return;
// console.log('file'+file.name);
- if (!file.name.match(/\.(csv||CSV)$/)) {
+ if(!file.name.match(/\.(csv||CSV)$/)){
return alert('only support csv files');
- } else {
+ }else{
+
reader = new FileReader();
- reader.onerror = function errorHandler(evt) {
- switch (evt.target.error.code) {
+ reader.onerror =function errorHandler(evt) {
+ switch(evt.target.error.code) {
case evt.target.error.NOT_FOUND_ERR:
alert('File Not Found!');
break;
@@ -2566,176 +1966,141 @@
break; // noop
default:
alert('An error occurred reading this file.');
- }
- };
+ };
+ }
//reader.onprogress = updateProgress;
- reader.onabort = function (e) {
+ reader.onabort = function(e) {
alert('File read cancelled');
};
- reader.onloadstart = function (e) {
- var output =
- '<ui type="disc"><li><strong>' +
- file.name +
- '</strong> (' +
- file.type +
- ')- ' +
- file.size +
- 'bytes, last modified: ' +
- file.lastModifiedDate.toLocaleDateString() +
- '</li></ui>';
- component.set('v.filename', file.name);
- component.set('v.TargetFileName', output);
+ reader.onloadstart = function(e) {
+
+ var output = '<ui type=\"disc\"><li><strong>'+file.name +'</strong> ('+file.type+')- '+file.size+'bytes, last modified: '+file.lastModifiedDate.toLocaleDateString()+'</li></ui>';
+ component.set("v.filename",file.name);
+ component.set("v.TargetFileName",output);
+
};
- reader.onload = function (e) {
- var data = e.target.result;
- component.set('v.fileContentData', data);
- console.log('file data' + JSON.stringify(data));
+ reader.onload = function(e) {
+ var data=e.target.result;
+ component.set("v.fileContentData",data);
+ console.log("file data"+JSON.stringify(data));
// console.log("file data"+encodeURI(JSON.stringify(data),"utf-8"));
var allTextLines = data.split(/\r\n|\n/);
- var dataRows = allTextLines.length - 1;
+ var dataRows=allTextLines.length-1;
var headers = allTextLines[0].split(',');
-
+
// console.log("Rows length::"+dataRows);
-
- var numOfRows = component.get('v.NumOfRecords');
- if (
- dataRows > numOfRows + 1 ||
- dataRows == 1 ||
- dataRows == 0
- ) {
- alert('File Rows between 1 to ' + numOfRows + ' .');
- component.set('v.showMain', true);
- } else {
+
+
+ var numOfRows=component.get("v.NumOfRecords");
+ if(dataRows > numOfRows+1 || dataRows == 1 || dataRows== 0){
+
+ alert("File Rows between 1 to "+numOfRows+" .");
+ component.set("v.showMain",true);
+
+ }
+ else{
var lines = [];
var filecontentdata;
- var content =
- '<table class="table slds-table slds-table--bordered slds-table--cell-buffer">';
- content += '<thead><tr class="slds-text-title--caps">';
- content += '<th scope="col">' + '琛屽彿' + '</th>';
- for (i = 0; i < headers.length; i++) {
- content += '<th scope="col">' + headers[i] + '</th>';
+ var content = "<table class=\"table slds-table slds-table--bordered slds-table--cell-buffer\">";
+ content += "<thead><tr class=\"slds-text-title--caps\">";
+ content += '<th scope=\"col"\>'+'琛屽彿'+'</th>';
+ for(i=0;i<headers.length; i++){
+ content += '<th scope=\"col"\>'+headers[i]+'</th>';
}
- content += '</tr></thead>';
- for (var i = 1; i < allTextLines.length; i++) {
+ content += "</tr></thead>";
+ for (var i=1; i<allTextLines.length; i++) {
filecontentdata = allTextLines[i].split(',');
- if (filecontentdata[0] != '') {
- content += '<tr>';
- content += '<td>' + i + '</td>';
- for (var j = 0; j < filecontentdata.length; j++) {
- content +=
- '<td>' + filecontentdata[j] + '</td>';
+ if(filecontentdata[0]!=''){
+ content +="<tr>";
+ content +="<td>"+i+"</td>";
+ for(var j=0;j<filecontentdata.length;j++){
+ content +='<td>'+filecontentdata[j]+'</td>';
}
- content += '</tr>';
+ content +="</tr>";
}
}
- content += '</table>';
+ content += "</table>";
console.log(content);
- component.set('v.TableContent', content);
- component.set('v.showMain', false);
+ component.set("v.TableContent",content);
+ component.set("v.showMain",false);
}
- };
- reader.readAsText(file, 'gb2312');
+ }
+ reader.readAsText(file,'gb2312');
+
}
var reader = new FileReader();
- reader.onloadend = function () {};
+ reader.onloadend = function() {
+
+ };
reader.readAsDataURL(file);
},
-
- saveRecords: function (component, event, helper) {
- debugger;
- component.set('v.loginEdit', true);
+
+ saveRecords : function(component,event,helper){
+ debugger
+ component.set('v.loginEdit',true);
//fy 瀵煎叆 20220424 start
- var action1 = component.get('c.processDataAWSId');
- action1.setParams({
- fileData: component.get('v.fileContentData')
- });
- debugger;
- action1.setCallback(this, function (response) {
- console.log('response = ' + JSON.stringify(response));
+ var action1 = component.get("c.processDataAWSId");
+ action1.setParams({
+ fileData : component.get("v.fileContentData"),
+ });
+ debugger
+ action1.setCallback(this, function(response) {
+ console.log('response = ' + JSON.stringify(response));
var state = response.getState();
- if (state === 'SUCCESS') {
+ if (state === "SUCCESS") {
var ress = response.getReturnValue();
- console.log('ress = ' + JSON.stringify(ress));
- if (ress) {
- var valur = ress.split('error1');
- if (valur.length <= 1) {
+ console.log('ress = ' + JSON.stringify(ress));
+ if(ress){
+ var valur =ress.split('error1');
+ if(valur.length<=1){
var res = JSON.parse(response.getReturnValue());
- console.log('res = ' + JSON.stringify(res));
+ console.log('res = ' + JSON.stringify(res));
var dataArr = new Array();
var dataMap = new Map();
- res.forEach((item) => {
- if (item.AWS_Data_Id__c) {
+ res.forEach(item => {
+ if(item.AWS_Data_Id__c){
dataArr.push(item.AWS_Data_Id__c);
//dataMap.set(item.AWS_Data_Id__c,item.Name_Encrypted__c);
- dataMap.set(
- item.AWS_Data_Id__c,
- item.AWS_Data_Id__c
- ); //zhj 鏂版柟妗堟敼閫� 2022-12-21
+ dataMap.set(item.AWS_Data_Id__c,item.AWS_Data_Id__c); //zhj 鏂版柟妗堟敼閫� 2022-12-21
}
});
- let obj = Object.create(null);
+ let obj= Object.create(null);
obj['dataIds'] = dataArr;
var payload = JSON.stringify(obj);
console.log('payload zhj = ' + JSON.stringify(payload));
-
- this.search_contact_url(
- component,
- 'Agency_Contact__c',
- (result) => {
- var token = result.token;
- var searchUrl = result.searchUrl;
- this.search_core(
- token,
- searchUrl,
- payload,
- (result) => {
- if (result.status == '0') {
- if (
- result.object != null &&
- result.object.length != 0
- ) {
- // var resultjson = JSON.stringify(result.object);
- // if(resultjson){
- // debugger
- // console.warn('001');
- // component.set('v.login',true);
- // this.ImportMethod(component,resultjson);
- // }
- component.set(
- 'v.loginEdit',
- true
- );
- this.saveRecordsEditFile(
- component,
- dataMap,
- result.object,
- helper
- );
- } else {
- this.error('AWS 鏌ヨ鏁版嵁涓虹┖ ');
- component.set(
- 'v.loginEdit',
- false
- );
- }
- } else {
- this.error(
- 'AWS search status6 : ' +
- result.status
- );
- component.set('v.loginEdit', false);
- }
- },
- component
- );
- // var resultjson =null;
- // this.ImportMethod(component,resultjson);
- }
- );
+
+ this.search_contact_url(component, 'Agency_Contact__c', (result)=>{
+ var token = result.token;
+ var searchUrl = result.searchUrl;
+ this.search_core(token,searchUrl,payload,(result)=>{
+ if(result.status == '0'){
+ if(result.object != null&&result.object.length != 0){
+ // var resultjson = JSON.stringify(result.object);
+ // if(resultjson){
+ // debugger
+ // console.warn('001');
+ // component.set('v.login',true);
+ // this.ImportMethod(component,resultjson);
+ // }
+ component.set('v.loginEdit',true);
+ this.saveRecordsEditFile(component,dataMap,result.object,helper);
+ }else{
+ this.error('AWS 鏌ヨ鏁版嵁涓虹┖ ' );
+ component.set('v.loginEdit',false);
+ }
+ }else{
+ this.error('AWS search status6 : ' + result.status);
+ component.set('v.loginEdit',false);
+ }
+ },component);
+ // var resultjson =null;
+ // this.ImportMethod(component,resultjson);
+
+ });
// var resultjson =null;
// this.ImportMethod(component,resultjson);
- } else {
- this.error(valur[1] + '\n' + '璇蜂慨鏀瑰悗閲嶆柊涓婁紶');
+ }else{
+ this.error(valur[1]+'\n'+"璇蜂慨鏀瑰悗閲嶆柊涓婁紶");
}
}
}
@@ -2744,18 +2109,18 @@
//fy 瀵煎叆 20220424 end
// var action = component.get("c.processData");
// var selectDate = component.find('select_date').get('v.value');
- // var fieldsList=['Name','Phone','AccountNumber']; //Please write your code dynamic
+ // var fieldsList=['Name','Phone','AccountNumber']; //Please write your code dynamic
// var sss=component.get("v.fileContentData");
- // action.setParams({
+ // action.setParams({
// fileData : component.get("v.fileContentData"),
// //selectDateselectDate :component.find('select_date').get('v.value'),
// sobjectName:'Account', //Any object
// fields:fieldsList
- // });
+ // });
// action.setCallback(this, function(response) {
// var state = response.getState();
// if (state === "SUCCESS") {
-
+
// var res = response.getReturnValue();
// var res1 = '';
// console.log("[[[[[["+res);
@@ -2776,7 +2141,7 @@
// // alert('saved successfully');
// component.set('v.login',false);
// }
-
+
// }
// else if (state === "INCOMPLETE") {
// // do something
@@ -2786,7 +2151,7 @@
// var errors = response.getError();
// if (errors) {
// if (errors[0] && errors[0].message) {
- // console.log("Error message: " +
+ // console.log("Error message: " +
// errors[0].message);
// component.set('v.login',false);
// }
@@ -2797,199 +2162,154 @@
// }
// });
// $A.enqueueAction(action);
- },
- isNumber: function (str) {
+
+ },isNumber: function(str) {
return /^\d+$/.test(str);
- },
- ImportMethod: function (component, fileStr) {
- debugger;
- var actionss = component.get('c.processData');
- var selectDate = component.find('select_date').get('v.value');
- var fieldsList = ['Name', 'Phone', 'AccountNumber']; //Please write your code dynamic
- var sss = component.get('v.fileContentData');
- actionss.setParams({
+ },ImportMethod : function(component,fileStr){
+ debugger
+ var actionss = component.get("c.processData");
+ var selectDate = component.find('select_date').get('v.value');
+ var fieldsList=['Name','Phone','AccountNumber']; //Please write your code dynamic
+ var sss=component.get("v.fileContentData");
+ actionss.setParams({
// fileData : component.get("v.fileContentData"),
- fileData: fileStr,
+ fileData : fileStr,
// selectDateselectDate :component.find('select_date').get('v.value'),
- sobjectName: 'Account', //Any object
- fields: fieldsList
+ sobjectName:'Account', //Any object
+ fields:fieldsList
// Agency_ContactListjson:resultjson
- });
- actionss.setCallback(this, function (response) {
- console.log('002');
- var state = response.getState();
- if (state === 'SUCCESS') {
- var res = response.getReturnValue();
- var res1 = '';
- console.log('[[[[[[' + res);
- if (res != 'success') {
- var ress = res.split('=');
- console.log(ress);
- let errorDatas = [];
- let errorDataRow = [];
- debugger;
- var fileContentData = component
- .get('v.fileContentData')
- .split('\n');
- for (var i = 0; i < ress.length; i++) {
- res1 += ress[i].substr(7) + '\n';
- if (ress[i] != '') {
- let errorData = {};
- if (
- !this.isNumber(
- ress[i].substr(7).substring(1, 2)
- )
- ) {
- continue;
- }
- let index = errorDataRow.indexOf(
- ress[i].substr(7).substring(1, 2)
- );
- if (index == -1) {
- errorData.errorRow = ress[i]
- .substr(7)
- .substring(1, 2);
- errorDataRow.push(errorData.errorRow);
- errorData.errorInfo = ress[i]
- .substr(7)
- .substring(5)
- .replace('=', '');
- if (errorData.errorInfo == '鎷滆浜轰笉瀛樺湪') {
- console.log(
- 'errorData.errorRow = ' +
- errorData.errorRow
- );
- errorData.errorInfo =
- '鎷滆浜� ' +
- fileContentData[
- errorData.errorRow
- ].split(',')[4] +
- '涓嶅瓨鍦�';
+ });
+ actionss.setCallback(this, function(response) {
+ console.log('002');
+ var state = response.getState();
+ if (state === "SUCCESS") {
+ var res = response.getReturnValue();
+ var res1 = '';
+ console.log("[[[[[["+res);
+ if(res != 'success'){
+ var ress = res.split('=');
+ console.log(ress);
+ let errorDatas = [];
+ let errorDataRow = [];
+ debugger
+ var fileContentData = component.get("v.fileContentData").split('\n');
+ for (var i=0; i<ress.length; i++) {
+ res1 += ress[i].substr(7)+'\n';
+ if (ress[i] != '') {
+ let errorData = {}
+ if(!this.isNumber(ress[i].substr(7).substring(1, 2))){
+ continue
}
- errorDatas.push(errorData);
- } else {
- if (
- ress[i].substr(7).substring(5) ==
- '鎷滆浜轰笉瀛樺湪'
- ) {
- errorDatas[index].errorInfo +=
- '; ' +
- '鎷滆浜� ' +
- fileContentData[
- errorDatas[index].errorRow
- ].split(',')[4] +
- '涓嶅瓨鍦�';
+ let index = errorDataRow.indexOf(ress[i].substr(7).substring(1, 2));
+ if (index == -1) {
+ errorData.errorRow = ress[i].substr(7).substring(1, 2);
+ errorDataRow.push(errorData.errorRow);
+ errorData.errorInfo = ress[i].substr(7).substring(5).replace('=','');
+ if(errorData.errorInfo == '鎷滆浜轰笉瀛樺湪'){
+ console.log('errorData.errorRow = ' + errorData.errorRow)
+ errorData.errorInfo ='鎷滆浜� ' + fileContentData[errorData.errorRow].split(',')[4] + '涓嶅瓨鍦�';
+ }
+ errorDatas.push(errorData);
} else {
- errorDatas[index].errorInfo +=
- '; ' + ress[i].substr(7).substring(5);
+ if(ress[i].substr(7).substring(5) == '鎷滆浜轰笉瀛樺湪'){
+ errorDatas[index].errorInfo += '; ' + '鎷滆浜� ' + fileContentData[errorDatas[index].errorRow].split(',')[4] + '涓嶅瓨鍦�';
+ }else{
+ errorDatas[index].errorInfo += '; ' + ress[i].substr(7).substring(5);
+ }
}
}
}
- }
- let errorColumns = [
- {
- label: '閿欒琛�',
- fieldName: 'errorRow',
- type: 'text',
- hideDefaultActions: true,
- initialWidth: 100
- },
- {
- label: '閿欒淇℃伅',
- fieldName: 'errorInfo',
- type: 'text',
- hideDefaultActions: true,
- initialWidth: 300,
- wrapText: true
+ let errorColumns = [
+ { label: '閿欒琛�', fieldName: 'errorRow', type: 'text', hideDefaultActions: true, initialWidth: 100 },
+ { label: '閿欒淇℃伅', fieldName: 'errorInfo', type: 'text', hideDefaultActions: true, initialWidth: 300, wrapText: true }
+ ];
+ for (var i = 0; i < fileContentData[0].split(',').length; i++) {
+ errorColumns.push({
+ label: fileContentData[0].split(',')[i],
+ fieldName: 'field' + i,
+ type: 'text',
+ hideDefaultActions: true,
+ wrapText: true,
+ initialWidth: 120
+ });
}
- ];
- for (
- var i = 0;
- i < fileContentData[0].split(',').length;
- i++
- ) {
- errorColumns.push({
- label: fileContentData[0].split(',')[i],
- fieldName: 'field' + i,
- type: 'text',
- hideDefaultActions: true,
- wrapText: true,
- initialWidth: 120
- });
- }
- for (var i = 0; i < errorDatas.length; i++) {
- let data = fileContentData[errorDatas[i].errorRow];
- console.log('data = ' + JSON.stringify(data));
- if (data) {
- for (var j = 0; j < data.split(',').length; j++) {
- let label = 'field' + j;
- errorDatas[i][label] = data.split(',')[j];
+ for (var i = 0; i < errorDatas.length; i++) {
+ let data = fileContentData[errorDatas[i].errorRow];
+ console.log('data = ' + JSON.stringify(data));
+ if(data){
+ for (var j = 0; j < data.split(',').length; j++) {
+ let label = 'field' + j;
+ errorDatas[i][label] = data.split(',')[j];
+ }
}
}
+ component.set('v.errorColumns', errorColumns);
+ component.set('v.errorData', errorDatas);
+ component.set("v.showErrorInfo", true);
+ console.log("=="+res1);
+ this.error(res1+"璇蜂慨鏀瑰悗閲嶆柊涓婁紶");
+ component.set('v.loginEdit',false);
+ }else{
+ component.set("v.showMain",true);
+ this.success("瀵煎叆鎴愬姛");
+ // alert('saved successfully');
+ component.set('v.loginEdit',false);
}
- component.set('v.errorColumns', errorColumns);
- component.set('v.errorData', errorDatas);
- component.set('v.showErrorInfo', true);
- console.log('==' + res1);
- this.error(res1 + '璇蜂慨鏀瑰悗閲嶆柊涓婁紶');
- component.set('v.loginEdit', false);
- } else {
- component.set('v.showMain', true);
- this.success('瀵煎叆鎴愬姛');
- // alert('saved successfully');
- component.set('v.loginEdit', false);
+
}
- } else if (state === 'INCOMPLETE') {
- // do something
- component.set('v.loginEdit', false);
- } else if (state === 'ERROR') {
- var errors = response.getError();
- if (errors) {
- if (errors[0] && errors[0].message) {
- console.log('Error message: ' + errors[0].message);
- component.set('v.loginEdit', false);
+ else if (state === "INCOMPLETE") {
+ // do something
+ component.set('v.loginEdit',false);
+ }
+ else if (state === "ERROR") {
+ var errors = response.getError();
+ if (errors) {
+ if (errors[0] && errors[0].message) {
+ console.log("Error message: " +
+ errors[0].message);
+ component.set('v.loginEdit',false);
+ }
+ } else {
+ console.log("Unknown error");
+ component.set('v.loginEdit',false);
}
- } else {
- console.log('Unknown error');
- component.set('v.loginEdit', false);
}
- }
- });
+ });
$A.enqueueAction(actionss);
- },
- saveRecordsEditFile: function (component, dataMap, searchData, helper) {
+ },saveRecordsEditFile : function(component,dataMap,searchData,helper){
var searchDataMap = new Map();
- for (var i = 0; i < searchData.length; i++) {
- var sd = searchData[i];
- if (sd.name) searchDataMap.set(sd.name.replace(' ', ''), sd.dataId);
- }
- console.log('searchDataMap=' + searchDataMap);
- var error = '';
- var fileData = component.get('v.fileContentData');
- var files = fileData.split('\n');
+ for (var i = 0; i < searchData.length; i++) {
+ var sd = searchData[i];
+ if(sd.name)
+ searchDataMap.set(sd.name.replace(' ',''),sd.dataId);
+ }
+ console.log('searchDataMap='+searchDataMap);
+ var error = '';
+ var fileData = component.get("v.fileContentData");
+ var files = fileData.split('\n');
- var fileStr = files[0];
- fileStr += '\n';
+ var fileStr = files[0];
+ fileStr += '\n';
- for (var i = 1; i < files.length - 1; i++) {
- var filelist = files[i].split(',');
- var fileName = filelist[4];
+ for (var i = 1; i < files.length-1; i++) {
+ var filelist = files[i].split(',');
+ var fileName = filelist[4];
- if (searchDataMap.get(fileName.replace(' ', ''))) {
- var nameDataId = searchDataMap.get(fileName.replace(' ', ''));
+ if (searchDataMap.get(fileName.replace(' ',''))) {
+ var nameDataId = searchDataMap.get(fileName.replace(' ',''));
if (dataMap.get(nameDataId)) {
- filelist[4] = dataMap.get(nameDataId); //zhj 鏂版柟妗堟敼閫� filelist[4]涓嶅啀瀛樼殑nameEncrpt 2022-12-21
- } else {
- error += 'error1 绗�' + i + '琛屾暟鎹嫓璁夸汉SF涓嶅瓨鍦�';
- error += '=';
+ filelist[4] = dataMap.get(nameDataId); //zhj 鏂版柟妗堟敼閫� filelist[4]涓嶅啀瀛樼殑nameEncrpt 2022-12-21
+ }else {
+ error += 'error1 绗�'+i+'琛屾暟鎹嫓璁夸汉SF涓嶅瓨鍦�';
+ error += '=';
}
- } else {
- error += 'error1 绗�' + i + '琛屾暟鎹嫓璁夸汉AWS涓嶅瓨鍦�';
- error += '=';
+ }else {
+ error += 'error1 绗�'+i+'琛屾暟鎹嫓璁夸汉AWS涓嶅瓨鍦�';
+ error += '=';
}
fileStr += filelist.toString();
- fileStr += '\n';
+ fileStr += '\n';
}
if (error != '') {
@@ -2997,86 +2317,44 @@
let errorArray = error.split('error1');
let errorDatas = [];
let errorDataRow = [];
- debugger;
- var fileContentData = component
- .get('v.fileContentData')
- .split('\n');
- console.log('errorArray = ' + JSON.stringify(errorArray));
+ debugger
+ var fileContentData = component.get("v.fileContentData").split('\n');
+ console.log('errorArray = ' + JSON.stringify(errorArray))
for (var i in errorArray) {
if (errorArray[i] != '') {
- let errorData = {};
- if (!this.isNumber(errorArray[i].trim().substring(1, 2))) {
- continue;
+ let errorData = {}
+ if(!this.isNumber(errorArray[i].trim().substring(1, 2))){
+ continue
}
- let index = errorDataRow.indexOf(
- errorArray[i].trim().substring(1, 2)
- );
+ let index = errorDataRow.indexOf(errorArray[i].trim().substring(1, 2));
if (index == -1) {
- errorData.errorRow = errorArray[i]
- .trim()
- .substring(1, 2);
+ errorData.errorRow = errorArray[i].trim().substring(1, 2);
errorDataRow.push(errorData.errorRow);
- errorData.errorInfo = errorArray[i]
- .trim()
- .substring(5, errorArray[i].trim().length)
- .replace('=', '');
- if (errorData.errorInfo == '鎷滆浜篈WS涓嶅瓨鍦�') {
- errorData.errorInfo =
- '鎷滆浜� ' +
- fileContentData[errorData.errorRow].split(
- ','
- )[4] +
- '涓嶅瓨鍦�';
+ errorData.errorInfo = errorArray[i].trim().substring(5,errorArray[i].trim().length).replace('=','');
+ if(errorData.errorInfo == '鎷滆浜篈WS涓嶅瓨鍦�'){
+ errorData.errorInfo ='鎷滆浜� ' + fileContentData[errorData.errorRow].split(',')[4] + '涓嶅瓨鍦�';
}
errorDatas.push(errorData);
} else {
- if (
- errorArray[i].trim().substring(5) ==
- '鎷滆浜篈WS涓嶅瓨鍦�'
- ) {
- errorData[index].errorInfo =
- '; ' +
- '鎷滆浜� ' +
- fileContentData[
- errorDatas[index].errorRow
- ].split(',')[4] +
- '涓嶅瓨鍦�';
- } else {
- errorDatas[index].errorInfo +=
- '; ' +
- errorArray[i]
- .trim()
- .substring(5, errorArray[i].trim().length);
+ if(errorArray[i].trim().substring(5) == '鎷滆浜篈WS涓嶅瓨鍦�'){
+ errorData[index].errorInfo = '; ' + '鎷滆浜� ' + fileContentData[errorDatas[index].errorRow].split(',')[4] + '涓嶅瓨鍦�';
+ }else{
+ errorDatas[index].errorInfo += '; ' + errorArray[i].trim().substring(5,errorArray[i].trim().length);
}
}
}
}
- var fileContentData = component
- .get('v.fileContentData')
- .split('\n');
+ var fileContentData = component.get("v.fileContentData").split('\n');
let errorColumns = [
- {
- label: '閿欒琛�',
- fieldName: 'errorRow',
- type: 'text',
- hideDefaultActions: true,
- initialWidth: 100
- },
- {
- label: '閿欒淇℃伅',
- fieldName: 'errorInfo',
- type: 'text',
- hideDefaultActions: true,
- initialWidth: 300,
- wrapText: true
- }
+ { label: '閿欒琛�', fieldName: 'errorRow', type: 'text', hideDefaultActions: true, initialWidth: 100 },
+ { label: '閿欒淇℃伅', fieldName: 'errorInfo', type: 'text', hideDefaultActions: true, initialWidth: 300, wrapText: true }
];
for (var i = 0; i < fileContentData[0].split(',').length; i++) {
errorColumns.push({
- label: fileContentData[0].split(',')[i],
- fieldName: 'field' + i,
- type: 'text',
- hideDefaultActions: true,
+ label: fileContentData[0].split(',')[i],
+ fieldName: 'field' + i,
+ type: 'text',
+ hideDefaultActions: true,
wrapText: true,
initialWidth: 120
});
@@ -3090,355 +2368,248 @@
errorDatas[i][label] = data.split(',')[j];
}
}
- console.log('errorDatas =' + JSON.stringify(errorDatas));
+ console.log('errorDatas =' + JSON.stringify(errorDatas))
component.set('v.errorColumns', errorColumns);
component.set('v.errorData', errorDatas);
- component.set('v.showErrorInfo', true);
+ component.set("v.showErrorInfo", true);
+
+
console.log('error = ' + error);
component.set('v.errorMessage', error);
this.error(error);
- console.log('error=' + error);
- component.set('v.loginEdit', false);
+ console.log('error='+error);
+ component.set('v.loginEdit',false);
return;
- }
+ }
- console.log('fileStr=' + fileStr);
- $A.getCallback(function () {
- debugger;
- helper.ImportMethod(component, fileStr);
- })();
- },
- convertArrayOfObjectsToCSV: function (component, objectRecords) {
- var csvStringResult, counter, keys, columnDivider, lineDivider, thkeys;
+ console.log('fileStr='+fileStr);
+ $A.getCallback(function(){
+ debugger
+ helper.ImportMethod(component,fileStr);
+ })();
+
+ },
+ convertArrayOfObjectsToCSV : function(component,objectRecords){
+ var csvStringResult, counter, keys, columnDivider, lineDivider,thkeys;
if (objectRecords == null || !objectRecords.length) {
return null;
- }
+ }
columnDivider = ',';
- lineDivider = '\n';
+ lineDivider = '\n';
//SWAG-CBX68C fy 銆愬鎵樸�慏AMS绯荤粺鍛ㄦ姤妯″潡鍐呭闇�姹傚鍔� start ,'SupportNeeds__c' ,'鏀彺闇�姹�'
- keys = [
- 'Submit_date__c',
- 'Person_In_Charge2__c',
- 'Report_Date__c',
- 'Agency_Hospital__c',
- 'Department_Cateogy__c',
- 'doctor2__c',
- 'visitor_title__c',
- 'Product_Category1__c',
- 'Product_Category2__c',
- 'Product_Category3__c',
- 'Purpose_Type__c',
- 'Result__c',
- 'SupportNeeds__c'
- ];
- thkeys = [
- '鍛�',
- '鎷呭綋',
- '娲诲姩鏃�',
- '鍖婚櫌',
- '绉戝',
- '鎷滆浜�',
- '鑱屼綅',
- '浜у搧鍖哄垎1',
- '浜у搧鍖哄垎2',
- '浜у搧鍖哄垎3',
- '娲诲姩鍖哄垎',
- '缁撴灉',
- '鏀彺闇�姹�'
- ];
+ keys = ['Submit_date__c','Person_In_Charge2__c','Report_Date__c','Agency_Hospital__c','Department_Cateogy__c','doctor2__c','visitor_title__c','Product_Category1__c','Product_Category2__c','Product_Category3__c','Purpose_Type__c','Result__c','SupportNeeds__c'];
+ thkeys = ['鍛�','鎷呭綋','娲诲姩鏃�','鍖婚櫌','绉戝','鎷滆浜�','鑱屼綅','浜у搧鍖哄垎1','浜у搧鍖哄垎2','浜у搧鍖哄垎3','娲诲姩鍖哄垎','缁撴灉','鏀彺闇�姹�']
csvStringResult = '';
csvStringResult += thkeys.join(columnDivider);
csvStringResult += lineDivider;
- console.log('杩涘叆瀵煎嚭helper');
- for (var i = 0; i < objectRecords.length; i++) {
+ console.log("杩涘叆瀵煎嚭helper");
+ for(var i=0; i < objectRecords.length; i++){
counter = 0;
- for (var sTempkey in keys) {
+ for(var sTempkey in keys) {
var skey = keys[sTempkey];
- if (counter > 0) {
- csvStringResult += columnDivider;
+ if(counter > 0){
+ csvStringResult += columnDivider;
}
- if (typeof objectRecords[i][skey] === 'undefined') {
- csvStringResult += '"' + '' + '"';
+ if(typeof objectRecords[i][skey] === "undefined"){
+ csvStringResult += '"'+''+'"';
continue;
+ }
+ if(skey == 'Person_In_Charge2__c'){
+ csvStringResult += '"'+ objectRecords[i].Person_In_Charge2__r.Name+'"';
+ }else if(skey == 'Agency_Hospital__c'){
+ csvStringResult += '"'+ objectRecords[i].Agency_Hospital__r.Name+'"';
+ }else if(skey == 'doctor2__c'){
+ csvStringResult += '"'+ objectRecords[i].doctor2__r.Name+'"';
+ }else if(skey == 'Product_Category1__c'){
+ csvStringResult += '"'+ objectRecords[i].Product_Category1__r.Name+'"';
+ }else if(skey == 'Product_Category2__c'){
+ csvStringResult += '"'+ objectRecords[i].Product_Category2__r.Name+'"';
+ }else if(skey == 'Product_Category3__c'){
+ csvStringResult += '"'+ objectRecords[i].Product_Category3__r.Name+'"';
}
- if (skey == 'Person_In_Charge2__c') {
- csvStringResult +=
- '"' + objectRecords[i].Person_In_Charge2__r.Name + '"';
- } else if (skey == 'Agency_Hospital__c') {
- csvStringResult +=
- '"' + objectRecords[i].Agency_Hospital__r.Name + '"';
- } else if (skey == 'doctor2__c') {
- csvStringResult +=
- '"' + objectRecords[i].doctor2__r.Name + '"';
- } else if (skey == 'Product_Category1__c') {
- csvStringResult +=
- '"' + objectRecords[i].Product_Category1__r.Name + '"';
- } else if (skey == 'Product_Category2__c') {
- csvStringResult +=
- '"' + objectRecords[i].Product_Category2__r.Name + '"';
- } else if (skey == 'Product_Category3__c') {
- csvStringResult +=
- '"' + objectRecords[i].Product_Category3__r.Name + '"';
- } else if (skey == 'SupportNeeds__c') {
- //SWAG-CBX68C fy 銆愬鎵樸�慏AMS绯荤粺鍛ㄦ姤妯″潡鍐呭闇�姹傚鍔� start
- csvStringResult +=
- '"' + objectRecords[i].SupportNeeds__c + '"';
- } else {
- csvStringResult += '"' + objectRecords[i][skey] + '"';
+ else if(skey == 'SupportNeeds__c'){//SWAG-CBX68C fy 銆愬鎵樸�慏AMS绯荤粺鍛ㄦ姤妯″潡鍐呭闇�姹傚鍔� start
+ csvStringResult += '"'+ objectRecords[i].SupportNeeds__c+'"';
+ }
+ else{
+ csvStringResult += '"'+ objectRecords[i][skey]+'"';
}
counter++;
- } // inner for loop close
- console.log('瀵煎嚭寰幆缁撴潫');
+
+ } // inner for loop close
+ console.log("瀵煎嚭寰幆缁撴潫");
csvStringResult += lineDivider;
- } // outer main for loop close
-
- // return the CSV formate String
- return csvStringResult;
+ }// outer main for loop close
+
+ // return the CSV formate String
+ return csvStringResult;
},
- showExportDate: function (component, objectRecords) {
- console.log('杩涘叆showexceportdate' + objectRecords); //SWAG-CBX68C fy 銆愬鎵樸�慏AMS绯荤粺鍛ㄦ姤妯″潡鍐呭闇�姹傚鍔� start ,'SupportNeeds__c' ,'鏀彺闇�姹�'
- var keys = [
- 'Submit_date__c',
- 'Person_In_Charge2__c',
- 'Report_Date__c',
- 'Agency_Hospital__c',
- 'Department_Cateogy__c',
- 'doctor2__c',
- 'visitor_title__c',
- 'Product_Category1__c',
- 'Product_Category2__c',
- 'Product_Category3__c',
- 'Purpose_Type__c',
- 'Result__c',
- 'SupportNeeds__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">';
- for (i = 0; i < headers.length; i++) {
- content += '<th scope="col">' + headers[i] + '</th>';
+ showExportDate : function(component,objectRecords){
+ console.log('杩涘叆showexceportdate'+objectRecords);//SWAG-CBX68C fy 銆愬鎵樸�慏AMS绯荤粺鍛ㄦ姤妯″潡鍐呭闇�姹傚鍔� start ,'SupportNeeds__c' ,'鏀彺闇�姹�'
+ var keys = ['Submit_date__c','Person_In_Charge2__c','Report_Date__c','Agency_Hospital__c','Department_Cateogy__c','doctor2__c','visitor_title__c','Product_Category1__c','Product_Category2__c','Product_Category3__c','Purpose_Type__c','Result__c','SupportNeeds__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\">";
+ for(i=0;i<headers.length; i++){
+ content += '<th scope=\"col"\>'+headers[i]+'</th>';
}
- content += '</tr></thead>';
- for (var i = 0; i < objectRecords.length; i++) {
- console.log('for' + content);
+ content += "</tr></thead>";
+ for(var i=0; i < objectRecords.length; i++){
+ console.log('for'+content);
content += '<tr>';
// content += '<td>'+(i+1)+'</td>';
- for (var sTempkey in keys) {
- console.log('for1' + sTempkey);
+ for(var sTempkey in keys) {
+ console.log('for1'+sTempkey);
var skey = keys[sTempkey];
- if (typeof objectRecords[i][skey] === 'undefined') {
- content += '<td>' + '' + '</td>';
+ if(typeof objectRecords[i][skey] === "undefined"){
+ content += '<td>'+''+'</td>';
continue;
}
- console.log(
- 'for2' + objectRecords[i].Person_In_Charge2__r.Name
- );
- if (skey == 'Person_In_Charge2__c') {
- content +=
- '<td>' +
- objectRecords[i].Person_In_Charge2__r.Name +
- '</td>';
- } else if (skey == 'Agency_Hospital__c') {
- content +=
- '<td>' +
- objectRecords[i].Agency_Hospital__r.Name +
- '</td>';
- } else if (skey == 'doctor2__c') {
- content +=
- '<td>' + objectRecords[i].doctor2__r.Name + '</td>';
- } else if (skey == 'Product_Category1__c') {
- content +=
- '<td>' +
- objectRecords[i].Product_Category1__r.Name +
- '</td>';
- } else if (skey == 'Product_Category2__c') {
- content +=
- '<td>' +
- objectRecords[i].Product_Category2__r.Name +
- '</td>';
- } else if (skey == 'Product_Category3__c') {
- content +=
- '<td>' +
- objectRecords[i].Product_Category3__r.Name +
- '</td>';
- } else if (skey == 'SupportNeeds__c') {
- //SWAG-CBX68C fy 銆愬鎵樸�慏AMS绯荤粺鍛ㄦ姤妯″潡鍐呭闇�姹傚鍔� start
- content +=
- '<td>' + objectRecords[i].SupportNeeds__c + '</td>';
- } else {
- content += '<td>' + objectRecords[i][skey] + '</td>';
+ console.log('for2'+objectRecords[i].Person_In_Charge2__r.Name);
+ if(skey == 'Person_In_Charge2__c'){
+ content += '<td>'+ objectRecords[i].Person_In_Charge2__r.Name+'</td>';
+ }else if(skey == 'Agency_Hospital__c'){
+ content += '<td>'+ objectRecords[i].Agency_Hospital__r.Name+'</td>';
+ }else if(skey == 'doctor2__c'){
+ content += '<td>'+ objectRecords[i].doctor2__r.Name+'</td>';
+ }else if(skey == 'Product_Category1__c'){
+ content += '<td>'+ objectRecords[i].Product_Category1__r.Name+'</td>';
+ }else if(skey == 'Product_Category2__c'){
+ content += '<td>'+ objectRecords[i].Product_Category2__r.Name+'</td>';
+ }else if(skey == 'Product_Category3__c'){
+ content += '<td>'+ objectRecords[i].Product_Category3__r.Name+'</td>';
}
- } // inner for loop close
- content += '</tr>';
- } // outer main for loop close
+ else if(skey == 'SupportNeeds__c'){//SWAG-CBX68C fy 銆愬鎵樸�慏AMS绯荤粺鍛ㄦ姤妯″潡鍐呭闇�姹傚鍔� start
+ content += '<td>'+ objectRecords[i].SupportNeeds__c+'</td>';
+ }
+ else{
+ content += '<td>'+ objectRecords[i][skey]+'</td>';
+ }
+ } // inner for loop close
+ content += '</tr>'
+ }// outer main for loop close
content += '</table>';
- console.log('helper寰幆缁撴潫' + content);
- component.set('v.TableContent2', content);
- component.set('v.showMain', false);
+ console.log("helper寰幆缁撴潫"+content);
+ component.set("v.TableContent2",content);
+ component.set("v.showMain",false);
},
- select_repores_date: function (component, event, helper) {
- component.set('v.loginEdit', true);
+ select_repores_date : function(component,event,helper){
+ component.set('v.loginEdit',true);
var reportsdate1 = component.find('input-report-date1').get('v.value');
var reportsdate2 = component.find('input-report-date2').get('v.value');
- console.log(
- '杈撳叆鐨勫紑濮嬫棩鏈�' + reportsdate1 + '杈撳叆鐨勭粨鏉熸棩鏈�' + reportsdate2
- );
- var action = component.get('c.getReportsByDate');
+ console.log('杈撳叆鐨勫紑濮嬫棩鏈�'+reportsdate1+'杈撳叆鐨勭粨鏉熸棩鏈�'+reportsdate2);
+ var action = component.get("c.getReportsByDate");
console.log('杈撳叆鐨勫紑濮嬫棩鏈�1');
- action.setParams({
- date1: reportsdate1,
+ action.setParams({
+ date1 : reportsdate1,
date2: reportsdate2
});
console.log('杈撳叆鐨勫紑濮嬫棩鏈�2');
- action.setCallback(this, function (response) {
+ action.setCallback(this, function(response) {
var state = response.getState();
- if (state === 'SUCCESS') {
+ if (state === "SUCCESS") {
+
var res = response.getReturnValue();
- console.log('杈撳叆鐨勫紑濮嬫棩鏈�3' + res);
- component.set('v.loginEdit', false);
+ console.log('杈撳叆鐨勫紑濮嬫棩鏈�3'+res);
+ component.set('v.loginEdit',false);
// PI 鏀归�� By Bright 20220328
- if (true) {
+ if(true){
let awsids = [];
for (let ri in res) {
- if (
- res[ri] &&
- res[ri].doctor2__r &&
- res[ri].doctor2__r.AWS_Data_Id__c
- ) {
+ if(res[ri] && res[ri].doctor2__r && res[ri].doctor2__r.AWS_Data_Id__c){
awsids.push(res[ri].doctor2__r.AWS_Data_Id__c);
}
- }
- if (awsids.length > 0) {
+ }
+ if(awsids.length > 0){
let awsurl = component.get('v.awsurl');
-
- AWSService.search(
- awsurl.searchUrl,
- {
- dataIds: awsids
- },
- function (data) {
- if (data && data.object && data.object.length) {
- let m = {};
- for (let di in data.object) {
- if (
- data.object[di] &&
- data.object[di].dataId
- ) {
- m[data.object[di].dataId] =
- data.object[di];
- }
- }
-
- for (let ri in res) {
- if (
- res[ri] &&
- res[ri].doctor2__r &&
- res[ri].doctor2__r.AWS_Data_Id__c &&
- m.hasOwnProperty(
- res[ri].doctor2__r
- .AWS_Data_Id__c
- )
- ) {
- res[ri].doctor2__r.Name =
- m[
- res[
- ri
- ].doctor2__r.AWS_Data_Id__c
- ].name;
- res[ri].visitor_title__c =
- m[
- res[
- ri
- ].doctor2__r.AWS_Data_Id__c
- ].doctorDivision1;
- }
+
+ AWSService.search(awsurl.searchUrl,{
+ dataIds:awsids
+ }, function(data){
+ if(data && data.object && data.object.length){
+ let m = {};
+ for(let di in data.object){
+ if(data.object[di] && data.object[di].dataId){
+ m[data.object[di].dataId] = data.object[di];
}
}
- helper.showExportDate(component, res);
-
- component.set('v.loginEdit', false);
- },
- awsurl.token
- );
- } else {
+
+ for(let ri in res){
+ if(res[ri] && res[ri].doctor2__r && res[ri].doctor2__r.AWS_Data_Id__c && m.hasOwnProperty(res[ri].doctor2__r.AWS_Data_Id__c)){
+ res[ri].doctor2__r.Name = m[res[ri].doctor2__r.AWS_Data_Id__c].name;
+ res[ri].visitor_title__c = m[res[ri].doctor2__r.AWS_Data_Id__c].doctorDivision1;
+
+ }
+ }
+ }
+ helper.showExportDate(component, res);
+
+ component.set('v.loginEdit', false);
+ }, awsurl.token);
+ }else{
helper.showExportDate(component, res);
}
}
+
component.set('v.reports_date', res);
- } else {
+
+ }else{
alert('瀵煎嚭澶辫触,璇锋鏌ユ椿鍔ㄦ棩');
- component.set('v.loginEdit', false);
+ component.set('v.loginEdit',false);
}
});
$A.enqueueAction(action);
+
},
- showImport: function (component) {
+ showImport : function(component){
// console.log('杩涘叆');
// component.find('file').click();
var modalimport = component.find('modal_import');
var modalimportbg = component.find('modal_importbg');
$A.util.removeClass(modalimport, 'disp_none');
- $A.util.removeClass(modalimportbg, 'disp_none');
+ $A.util.removeClass(modalimportbg,'disp_none');
},
- showExport: function (component) {
+ showExport : function(component) {
var modalimport = component.find('modal_export');
var modalimportbg = component.find('modal_exportbg');
$A.util.removeClass(modalimport, 'disp_none');
- $A.util.removeClass(modalimportbg, 'disp_none');
+ $A.util.removeClass(modalimportbg,'disp_none');
},
- close_import: function (component) {
+ close_import : function(component){
var modalimport = component.find('modal_import');
var modalimportbg = component.find('modal_importbg');
$A.util.addClass(modalimport, 'disp_none');
- $A.util.addClass(modalimportbg, 'disp_none');
+ $A.util.addClass(modalimportbg,'disp_none');
},
- close_export: function (component) {
+ close_export : function(component){
var modalimport = component.find('modal_export');
var modalimportbg = component.find('modal_exportbg');
$A.util.addClass(modalimport, 'disp_none');
- $A.util.addClass(modalimportbg, 'disp_none');
+ $A.util.addClass(modalimportbg,'disp_none');
},
//zhj MEBG鏂版柟妗堟敼閫� 2022-11-29 start
- CallBackAction: function (component, action_name, para, callback) {
- var action = component.get(
- 'c.' + action_name.trimStart().replace('c.', '')
- );
- if (para) {
+ CallBackAction : function(component,action_name,para,callback) {
+ var action = component.get("c." + action_name.trimStart().replace("c.",""));
+ if(para){
action.setParams(para);
}
- if (callback) {
- action.setCallback(this, function (data) {
+ if(callback){
+ action.setCallback(this,function(data){
callback(data);
});
}
-
+
$A.enqueueAction(action);
- },
+ },
//zhj MEBG鏂版柟妗堟敼閫� 2022-11-29 end
//zhj 瀵煎嚭閿欒淇℃伅 2023-05-16 start
@@ -3448,7 +2619,7 @@
var datas = [];
let errorColumnsArray = [];
- for (var i in errorColumns) {
+ for(var i in errorColumns){
errorColumnsArray.push(errorColumns[i].label);
}
datas.push(errorColumnsArray);
@@ -3456,22 +2627,22 @@
for (var i in errorData) {
let data = [];
- data.push(errorData[i].errorRow);
- data.push(errorData[i].errorInfo);
- for (var j = 0; j < Object.keys(errorData[i]).length - 2; j++) {
- data.push(errorData[i]['field' + j]);
+ data.push(errorData[i].errorRow)
+ data.push(errorData[i].errorInfo)
+ for(var j = 0 ; j < Object.keys(errorData[i]).length - 2 ; j++){
+ data.push(errorData[i]['field' + j])
}
datas.push(data);
}
console.log('datas = ' + JSON.stringify(datas));
var csv = this.convertToCSV(component, datas);
- console.log('csv = ' + JSON.stringify(csv));
+ console.log('csv = ' + JSON.stringify(csv))
this.downloadCSV(component, csv);
},
convertToCSV: function (component, data) {
- console.log('enter convertToCSV');
+ console.log('enter convertToCSV')
console.log('data = ' + data);
var csv = '';
for (var i = 0; i < data.length; i++) {
@@ -3481,11 +2652,7 @@
var val = '';
val = row[j] === null ? '' : row[j].toString();
console.log('val = ' + val);
- if (
- val.indexOf(',') !== -1 ||
- val.indexOf('"') !== -1 ||
- val.indexOf('\n') !== -1
- ) {
+ if (val.indexOf(',') !== -1 || val.indexOf('"') !== -1 || val.indexOf('\n') !== -1) {
//val = '"' + val.replace(/"/g,'""') + '"';
}
if (j > 0) {
@@ -3501,14 +2668,13 @@
downloadCSV: function (component, csv) {
var link = document.createElement('a');
// 璁剧疆瀛楃闆嗗拰鏂囦欢澶�
- var bom = '\uFEFF';
- link.href =
- 'data:text/csv;charset=utf-8,' + encodeURIComponent(bom + csv);
+ var bom = "\uFEFF";
+ link.href = 'data:text/csv;charset=utf-8,' + encodeURIComponent(bom + csv);
link.download = 'data.csv';
document.body.appendChild(link);
link.click();
document.body.removeChild(link);
- }
+ },
//zhj 瀵煎嚭閿欒淇℃伅 2023-05-16 end
// searchAgencyContact : function(res) {
@@ -3545,4 +2711,4 @@
// var data = this.search(searchUrl,data,token);
// return data;searchUrl,requestSearchPayload,token
// },
-});
+})
\ No newline at end of file
diff --git a/force-app/main/default/classes/ArriveGoodsController.cls b/force-app/main/default/classes/ArriveGoodsController.cls
index 6371001..190bd57 100644
--- a/force-app/main/default/classes/ArriveGoodsController.cls
+++ b/force-app/main/default/classes/ArriveGoodsController.cls
@@ -10,14 +10,14 @@
//鏇存柊鏄庣粏鍙栨秷鏃堕棿
public List<Consumable_order_details2__c> consumableorderdetails2Cancle = new List<Consumable_order_details2__c>();
// 鏇存柊鍊熻皟淇℃伅 add by gzw 2020-0-415 start
- Map<String, Consumable_order_details2__c> orderdetails2trMap = new Map<String, Consumable_order_details2__c>();
+ Map<String,Consumable_order_details2__c> orderdetails2trMap = new Map<String,Consumable_order_details2__c>();
// 鏇存柊鍊熻皟淇℃伅 add by gzw 2020-0-415 end
- public List<Consumable_order_details2__c> consumableorderdetails2Insert = new List<Consumable_order_details2__c>();
- public List<Consumable_order_details2__c> consumableorderdetails2Nobox = new List<Consumable_order_details2__c>();
+ public List<Consumable_order_details2__c> consumableorderdetails2Insert= new List<Consumable_order_details2__c>();
+ public List<Consumable_order_details2__c> consumableorderdetails2Nobox= new List<Consumable_order_details2__c>();
public List<ConsumableorderdetailsInfo> ConsumableorderdetailsRecordserror { get; set; }
public transient List<ConsumableorderdetailsInfo> ConsumableorderdetailsRecordsdummy { get; set; }
- public List<ConsumableorderdetailsInfo> ShowGoodsofReturnList { get; set; }
- public List<ConsumableorderdetailsInfo> ShowGoodsofRemoveBoxReturnList { get; set; }
+ public List<ConsumableorderdetailsInfo> ShowGoodsofReturnList{get;set;}
+ public List<ConsumableorderdetailsInfo> ShowGoodsofRemoveBoxReturnList{get;set;}
//add by rentx 20210602 CHAN-C3K4ZQ
public List<List<ConsumableorderdetailsInfo>> consumableorderdetailsRecordsview { get; set; }
//add by rentx 20210602 CHAN-C3K4ZQ
@@ -26,11 +26,11 @@
//瓒呭嚭瀹氳揣鏁伴噺鐨勪骇鍝�
public List<String> cancellationProList = new List<String>();
//閿欒淇℃伅
- public String alertMessage { get; set; }
- public integer getinventorysize() {
+ public String alertMessage {set;get;}
+ public integer getinventorysize(){
return consumableInventory.size();
}
- public integer geterrorsize() {
+ public integer geterrorsize(){
return ConsumableorderdetailsRecordserror.size();
}
Set<String> noboxBarcodeList = new Set<String>();
@@ -51,24 +51,25 @@
Map<String, Decimal> overOrderCunMap = new Map<String, Decimal>();
//瓒呭嚭BARCODE鍜屽瀷鍙�
Map<String, List<String>> overOrderBARcodeCunMap = new Map<String, List<String>>();
- list<String> overOrderBARcodeTTTTTT = new List<String>();
+ list<String> overOrderBARcodeTTTTTT = new list<String>();
//涓嶇鍚堢殑barcode鍜屽瀷鍙�
Map<String, List<String>> notEqualBARcodeCunMap = new Map<String, List<String>>();
- list<String> overOrderBARcodeSSSSSS = new List<String>();
- list<String> productList = new List<String>();
- list<String> notInlist = new List<String>();
+ list<String> overOrderBARcodeSSSSSS = new list<String>();
+ list<String> productList = new list<String>();
+ list<String> notInlist = new list<String>();
//涓嶉�夋嫨璁㈠崟鏃朵繚瀛樿鍗旾D銆佷骇鍝佸瀷鍙风敤
//List<String> orderId = new List<String>();
//List<String> prodName = new List<String>();
//搴撳瓨鐧诲綍浣跨敤
- list<String> notInStorelist = new List<String>();
- list<String> exitBarCodeList = new List<String>();
+ list<String> notInStorelist = new list<String>();
+ list<String> exitBarCodeList = new list<String>();
+
// Map<String, Consumable_order_details2__c> reallMap = new Map<String, Consumable_order_details2__c>();
- Map<String, String> HosErrorMap = new Map<String, String>();
+ Map<String,String> HosErrorMap = new Map<String,String>();
List<String> HosErrorList = new List<String>();
- public String baseUrl { get; private set; }
+ public String baseUrl {get;private set;}
public String ESetId { get; set; }
public String arriveId = '';
private String accountid = null;
@@ -76,11 +77,12 @@
//public String[] proidList =new String[]{};
public Decimal orderCountAll = 0;
public Decimal orderCountNotarrive = 0;
- private id return_Order_id = null;
- private id inventory_Order_id = null;
- public boolean ReturnFLGbln { get; set; }
- public boolean saveFLGbln { get; set; }
- public String ArrType { get; set; }
+ //LWC:Lwcflag鍜屾姤閿欐彁閱� update by Link 2023-04-27
+ public id return_Order_id = null;
+ public id inventory_Order_id = null;
+ public boolean ReturnFLGbln {get;set;}
+ public boolean saveFLGbln {get;set;}
+ public String ArrType{get;set;}
// 鐧诲綍鑰呭伐浣滃湴
private String userWorkLocation;
@@ -90,7 +92,15 @@
public String product_Type = null;
public Boolean EngFlag = false;
public Boolean ETFlag = false;
- public ArriveGoodsController() {
+
+ //LWC:Lwcflag鍜屾姤閿欐彁閱� update by Link 2023-04-27
+ public Boolean isLwc = false;
+ public String returnError;
+ public List<String> warningList;
+ public List<String> errorList;
+ public String urlType;
+
+ public ArriveGoodsController(){
baseUrl = URL.getSalesforceBaseUrl().toExternalForm();
ESetId = ApexPages.currentPage().getParameters().get('esetId');
ArrType = ApexPages.currentPage().getParameters().get('ArrType');
@@ -101,21 +111,44 @@
consumableorderdetailsRecordsUse = new List<ConsumableorderdetailsInfo>();
consumableInventoryUse = new List<ConsumableorderdetailsInfo>();
consumableorderdetails2Cancle = new List<Consumable_order_details2__c>();
- orderdetails2trMap = new Map<String, Consumable_order_details2__c>();
+ orderdetails2trMap = new Map<String,Consumable_order_details2__c>();
detailsSummary = new List<ConsumableorderdetailsInfo>();
- saveFLGbln = false;
+ saveFLGbln = FALSE;
//overOrderBARcodeTTTTTT.add('');
- //add by rentx 20210602 CHAN-C3K4ZQ start
+ //add by rentx 20210602 CHAN-C3K4ZQ start
consumableorderdetailsRecordsview = new List<List<ConsumableorderdetailsInfo>>();
- //add by rentx 20210602 CHAN-C3K4ZQ end
+ //add by rentx 20210602 CHAN-C3K4ZQ end
// OrderAllMap = new Map<String, String>();
}
+ //LWC:Lwcflag鍜屾姤閿欐彁閱� update by Link 2023-04-27
+ public ArriveGoodsController(String eSetId, String arrType){
+ this.ESetId = eSetId;
+ this.ArrType = arrType;
+ ConsumableorderdetailsRecords = new List<ConsumableorderdetailsInfo>();
+ ConsumableorderdetailsRecordserror = new List<ConsumableorderdetailsInfo>();
+ ConsumableorderdetailsRecordsdummy = new List<ConsumableorderdetailsInfo>();
+ consumableInventory = new List<ConsumableorderdetailsInfo>();
+ consumableorderdetailsRecordsUse = new List<ConsumableorderdetailsInfo>();
+ consumableInventoryUse = new List<ConsumableorderdetailsInfo>();
+ consumableorderdetails2Cancle = new List<Consumable_order_details2__c>();
+ orderdetails2trMap = new Map<String,Consumable_order_details2__c>();
+ detailsSummary = new List<ConsumableorderdetailsInfo>();
+ saveFLGbln = FALSE;
+ consumableorderdetailsRecordsview = new List<List<ConsumableorderdetailsInfo>>();
+ noboxBarcodeList = new Set<String>();
+ //LWC:Lwcflag鍜屾姤閿欐彁閱� update by Link 2023-04-27
+ warningList = new List<String>();
+ errorList = new List<String>();
+ returnError = null;
+ urlType = null;
+ }
+
//add by rentx 20210602 CHAN-C3K4ZQ start 鍑洪敊鐨勫師鍥犳槸椤甸潰鏈�澶氬睍绀�1000鏉℃暟鎹�,浣嗘槸闇�瑕佸睍绀虹殑鏁版嵁瓒呰繃浜�1000鏉�,鐜板湪鎶婂睍绀轰笂绾挎敼涓�1000 * 1000
- public void makeRecordsView(List<ConsumableorderdetailsInfo> recordsdummy) {
+ public void makeRecordsView(List<ConsumableorderdetailsInfo> recordsdummy){
consumableorderdetailsRecordsview = new List<List<ConsumableorderdetailsInfo>>();
- if (recordsdummy.size() > 1000) {
+ if(recordsdummy.size() > 1000){
List<ConsumableorderdetailsInfo> ConsumableorderdetailsRecordsbreak = new List<ConsumableorderdetailsInfo>();
List<ConsumableorderdetailsInfo> ConsumableorderdetailsRecordsbreakover = new List<ConsumableorderdetailsInfo>();
ConsumableorderdetailsInfo c = null;
@@ -125,19 +158,19 @@
//閫夋嫨浜у搧view
ConsumableorderdetailsRecordsbreak = new List<ConsumableorderdetailsInfo>();
ConsumableorderdetailsRecordsbreakover = new List<ConsumableorderdetailsInfo>();
- if (recordsdummy.size() > 1000) {
- for (Integer i = 0; i < recordsdummy.size(); i++) {
- if (i < 1000) {
+ if(recordsdummy.size() > 1000){
+ for(Integer i = 0; i < recordsdummy.size(); i++){
+ if(i < 1000){
c = recordsdummy.get(i);
ConsumableorderdetailsRecordsbreak.add(c);
- } else {
+ }else{
c = recordsdummy.get(i);
ConsumableorderdetailsRecordsbreakover.add(c);
}
}
consumableorderdetailsRecordsview.add(ConsumableorderdetailsRecordsbreak);
consumableorderdetailsRecordsview.add(ConsumableorderdetailsRecordsbreakover);
- } else {
+ }else{
consumableorderdetailsRecordsview.add(recordsdummy);
}
@@ -160,7 +193,7 @@
// }
// consumableorderdetailsRecordsview.add(tempList);
// }
- } else {
+ }else{
consumableorderdetailsRecordsview.add(recordsdummy);
}
}
@@ -168,128 +201,108 @@
public void init() {
// String userId = '00510000007cthP';
String userId = UserInfo.getUserId();
- List<user> Useracc = new List<user>();
- Useracc = [SELECT accountid, Work_Location__c, UserPro_Type__c FROM user WHERE id = :userId];
+ List<user> Useracc = New List<user>();
+ Useracc = [SELECT accountid, Work_Location__c,UserPro_Type__c FROM user WHERE id =:userId];
accountid = Useracc[0].accountid;
//--------AddStart-----XHL--------------20181008-------------
userPro_Type = Useracc[0].UserPro_Type__c;
- if (String.isBlank(userPro_Type)) {
+ if(String.isBlank(userPro_Type)){
userPro_Type = 'ET';
}
- if (userPro_Type == 'ENG') {
+ if(userPro_Type == 'ENG'){
product_Type = 'ET';
EngFlag = true;
- } else {
+ }else{
product_Type = 'ENG';
ETFlag = true;
}
userPro_Typestr = '%' + userPro_Type + '%';
//--------AddEnd-----XHL--------------20181008-------------
userWorkLocation = Useracc[0].Work_Location__c;
- system.debug('userWorkLocation' + userWorkLocation);
- List<account> accountInfo = [SELECT Name FROM account WHERE id = :accountid];
+ system.debug('userWorkLocation'+ userWorkLocation);
+ List<account> accountInfo = [SELECT Name FROM account WHERE id =:accountid];
accountName = accountInfo[0].Name;
- system.debug('accountName' + accountName);
+ system.debug('accountName'+ accountName);
coc = new Consumable_order__c();
- if (ArrType == 'ReG') {
+ if(ArrType=='ReG'){
ReturnFLGbln = true;
- } else {
+ }else{
ReturnFLGbln = false;
}
- if (ESetId != '' && ESetId != null) {
- List<Consumable_order__c> qs = new List<Consumable_order__c>();
- List<Consumable_order_details2__c> reSet1 = new List<Consumable_order_details2__c>();
- List<Consumable_Orderdetails__c> reSet = new List<Consumable_Orderdetails__c>();
- qs = [
- SELECT
- Id,
- Name,
- Order_status__c,
- Dealer_Info__c,
- Deliver_date__c,
- ReturnGs_Upload_Date__c,
- Order_Reason__c,
- Order_date__c,
- Contract_application_decision__c,
- Order_type__c,
- Total_num__c,
- OrderNumber_arrived__c,
- Delivery_detail_count__c,
- OrderNumber_notarrive__c,
- orderPattern__c
- FROM Consumable_order__c
- WHERE Id = :ESetId AND Order_Owner_WorkLocal__c = :userWorkLocation AND Dealer_Info__c = :accountid
- ];
- if (qs.size() > 0) {
+ if(ESetId != '' && ESetId !=null){
+ List<Consumable_order__c> qs = New List<Consumable_order__c>();
+ List<Consumable_order_details2__c> reSet1 = New List<Consumable_order_details2__c>();
+ List<Consumable_Orderdetails__c> reSet = New List<Consumable_Orderdetails__c>();
+ qs = [SELECT Id,Name,Order_status__c,Dealer_Info__c,Deliver_date__c,ReturnGs_Upload_Date__c,
+ Order_Reason__c,Order_date__c,
+ Contract_application_decision__c,Order_type__c,Total_num__c,
+ OrderNumber_arrived__c,Delivery_detail_count__c,OrderNumber_notarrive__c,orderPattern__c
+ FROM Consumable_order__c
+ WHERE Id =:ESetId AND Order_Owner_WorkLocal__c =: userWorkLocation
+ AND Dealer_Info__c = :accountid];
+ if (qs.size()>0){
coc = qs[0];
orderCountAll = coc.Total_num__c;
orderCountNotarrive = coc.OrderNumber_notarrive__c;
}
//浜у搧瀹氳揣鏁伴噺
- reSet = [
- SELECT Asset_Model_No__c, Consumable_order__c, Consumable_count__c
- FROM Consumable_Orderdetails__c
- WHERE Consumable_order__c = :ESetId AND Order_Owner_WorkLocal__c = :userWorkLocation
- ];
+ reSet = [SELECT Asset_Model_No__c,
+ Consumable_order__c,
+ Consumable_count__c
+ FROM Consumable_Orderdetails__c
+ WHERE Consumable_order__c = :ESetId AND Order_Owner_WorkLocal__c =: userWorkLocation];
for (Integer i = 0; i < reSet.size(); i++) {
productList.add(reSet[i].Asset_Model_No__c);
- orderProductCunMap.put(reSet[i].Asset_Model_No__c, reSet[i].Consumable_count__c);
- orderProductArrivedCunMap.put(reSet[i].Asset_Model_No__c, 0);
- orderWantArriveCunMap.put(reSet[i].Asset_Model_No__c, 0);
- overOrderCunMap.put(reSet[i].Asset_Model_No__c, 0);
- overOrderBARcodeCunMap.put(reSet[i].Asset_Model_No__c, overOrderBARcodeTTTTTT);
+ orderProductCunMap.put(reSet[i].Asset_Model_No__c,reSet[i].Consumable_count__c);
+ orderProductArrivedCunMap.put(reSet[i].Asset_Model_No__c,0);
+ orderWantArriveCunMap.put(reSet[i].Asset_Model_No__c,0);
+ overOrderCunMap.put(reSet[i].Asset_Model_No__c,0);
+ overOrderBARcodeCunMap.put(reSet[i].Asset_Model_No__c,overOrderBARcodeTTTTTT);
//overOrderCunMap.put(reSet[i].Asset_Model_No__c,0);
}
//
- reSet1 = [
- SELECT
- Id,
- Name,
- Intra_Trade_List_RMB__c,
- Asset_Model_No__c,
- Consumable_Product__c,
- Consumable_Product__r.Name,
- Consumable_Product__r.Name__c,
- Sterilization_limit__c,
- Deliver_date__c,
- Bar_Code__c,
- Arrive_date__c,
- Send_Date__c,
- Consumable_order_minor__r.Name,
- Consumable_order_minor__c,
- Dealer_Arrive__c,
- Guarantee_period_for_products__c,
- CFDA_Status__c,
- Box_Piece__c,
- Rrturn_count__c,
- ProductPacking_list_manual__c,
- Report_Product_Approbation__c,
- Report_Product_Expiration__c,
- //add by rentx 2020-10-14 start
- ContractNo_text__c /*,ContractNo__c1*/,
- // tcm start
- Consumable_order_minor__r.ContractNo__c
- // tcm end
- //add by rentx 2020-10-14 end
- FROM Consumable_order_details2__c
- WHERE
- recordtypeid = :System.Label.RT_ConOrderDetail2_Delivery
- AND Arrive_Owner_Work_Location__c = :userWorkLocation
- AND Consumable_order_minor__c = :ESetId
- AND Dealer_Arrive__c = TRUE
- AND Box_Piece__c != '涓�'
- ];
+ reSet1 = [SELECT Id,
+ Name,
+ Intra_Trade_List_RMB__c,
+ Asset_Model_No__c,
+ Consumable_Product__c,
+ Consumable_Product__r.Name,
+ Consumable_Product__r.Name__c,
+ Sterilization_limit__c,
+ Deliver_date__c,
+ Bar_Code__c,
+ Arrive_date__c,
+ Send_Date__c,
+ Consumable_order_minor__r.Name,
+ Consumable_order_minor__c,
+ Dealer_Arrive__c,
+ Guarantee_period_for_products__c,
+ CFDA_Status__c,
+ Box_Piece__c,
+ Rrturn_count__c,
+ ProductPacking_list_manual__c,
+ Report_Product_Approbation__c,
+ Report_Product_Expiration__c
+ //add by rentx 2020-10-14 start
+ ,ContractNo_text__c/*,ContractNo__c1*/
+ // tcm start
+ ,Consumable_order_minor__r.ContractNo__c
+ // tcm end
+ //add by rentx 2020-10-14 end
+ FROM Consumable_order_details2__c
+ WHERE recordtypeid = :System.Label.RT_ConOrderDetail2_Delivery
+ AND Arrive_Owner_Work_Location__c = : userWorkLocation
+ AND Consumable_order_minor__c = :ESetId
+ AND Dealer_Arrive__c = true
+ AND Box_Piece__c != '涓�' ];
for (Integer i = 0; i < reSet1.size(); i++) {
// OrderAllMap.put(reSet1[i].Bar_Code__c,reSet1[i].Bar_Code__c);
//init鐨勬椂鍊欎笉灞曠ず宸茬粡鍏ュ簱鐨勬槑缁� by rentx 20210617 CHAN-C3K4ZQ
// ConsumableorderdetailsRecordsdummy.add(new ConsumableorderdetailsInfo(reSet1[i]));
//update by rentx 20210617 end CHAN-C3K4ZQ
- if (orderProductArrivedCunMap.containsKey(reSet1[i].Asset_Model_No__c)) {
- orderProductArrivedCunMap.put(
- reSet1[i].Asset_Model_No__c,
- orderProductArrivedCunMap.get(reSet1[i].Asset_Model_No__c) + 1
- );
+ if(orderProductArrivedCunMap.containsKey(reSet1[i].Asset_Model_No__c)){
+ orderProductArrivedCunMap.put(reSet1[i].Asset_Model_No__c,orderProductArrivedCunMap.get(reSet1[i].Asset_Model_No__c)+1);
}
}
//add by rentx 20210602 start CHAN-C3K4ZQ
@@ -300,39 +313,53 @@
//========20160311======ADD_Start================================
// 灏嗛〉闈㈡垨鍙栧緱BarCode鍘绘帀閲嶅鐨勶紝杞崲鎴怢ist
//========20160311======ADD_Start================================
- public List<String> ParseBarCode(String Code) {
- String[] Cache = new List<String>{};
+ public List<String> ParseBarCode(String Code){
+ String[] Cache = new String[]{};
Cache = Code.split('\n');
- Set<String> Buff = new Set<String>();
- for (String A : Cache) {
+ Set <String> Buff = new Set<String>();
+ for(String A : Cache){
Buff.add(A.toUpperCase());
}
List<String> outPut = new List<String>();
- for (String B : Buff) {
+ for(String B :Buff){
B = B.trim();
- if (B.length() > 8) {
- String tracingCode = B.substring(B.length() - 5, B.length());
- barMcodeMap.put(B, tracingCode);
+ if(B.length() > 8){
+ String tracingCode = B.substring(B.length() - 5,B.length());
+ barMcodeMap.put(B,tracingCode);
}
outPut.add(B);
- }
- system.debug('barMcodeMap绛変簬' + barMcodeMap);
+ }system.debug('barMcodeMap绛変簬'+barMcodeMap);
return outPut;
}
+
//========20160311======ADD_End==================================
//鑾峰彇鏄庣粏
public void SearchPro() {
- notInlist = new List<String>();
+ //浠庝笅杈圭Щ涓婃潵 by Link 2023-5-23
+ if(barcode == null || barcode.trim() ==''){
+ //LWC:Lwcflag鍜屾姤閿欐彁閱� update by Link 2023-04-27
+ if(isLwc){
+ returnError = '璇疯緭鍏arCode鍙�';
+ }else {
+ ApexPages.addmessage(new ApexPages.message(ApexPages.severity.INFO,'璇疯緭鍏arCode鍙枫��'));
+ }
+ return;
+ }
+ notInlist = new list<String>();
otherAgencyMap = new Map<String, String>();
barMcodeMap = new Map<String, String>();
consumableInventory = new List<ConsumableorderdetailsInfo>();
consumableInventoryUse = new List<ConsumableorderdetailsInfo>();
consumableorderdetails2Cancle = new List<Consumable_order_details2__c>();
- orderdetails2trMap = new Map<String, Consumable_order_details2__c>();
+ orderdetails2trMap = new Map<String,Consumable_order_details2__c>();
+ //update by Link 20230428
+ if(isLwc){
+ noboxBarcodeList = new Set<String>();
+ }
//add by rentx 2021-01-27 start
HosErrorList = new List<String>();
- HosErrorMap = new Map<String, String>();
+ HosErrorMap = new Map<String,String>();
//add by rentx 2021-01-27 end
noboxBarcodeList.clear();
@@ -397,467 +424,383 @@
BarCodeListP = new List<String>();
BarCodeListP = ParseBarCode(barcode);
Consumable_order_details2__c p = new Consumable_order_details2__c();
- List<Consumable_order_details2__c> Ins = new List<Consumable_order_details2__c>();
+ List<Consumable_order_details2__c> Ins = New List<Consumable_order_details2__c>();
List<Consumable_order_details2__c> reSet = new List<Consumable_order_details2__c>();
List<Consumable_order_details2__c> reSet1 = new List<Consumable_order_details2__c>();
- if (barcode == null || barcode.trim() == '') {
- ApexPages.addmessage(new ApexPages.message(ApexPages.severity.INFO, '璇疯緭鍏arCode鍙枫��'));
- return;
- }
+ //绉诲埌鏈�涓婅竟 by Link 2023-5-23
+ // if(barcode == null || barcode.trim() ==''){
+ // //LWC:Lwcflag鍜屾姤閿欐彁閱� update by Link 2023-04-27
+ // if(isLwc){
+ // returnError = '璇疯緭鍏arCode鍙�';
+ // }else {
+ // ApexPages.addmessage(new ApexPages.message(ApexPages.severity.INFO,'璇疯緭鍏arCode鍙枫��'));
+ // }
+ // return;
+ // }
//瀵规瘮鍏ㄩ儴搴撳瓨涓槸鍚﹀瓨鍦ㄧ鐞嗙紪鐮佷竴鏍凤紝barcode鍙蜂笉涓�鏍风殑浜у搧
- reSet1 = [
- SELECT Id, Name, TracingCode__c, Bar_Code__c, Report_Product_Expiration__c
- FROM Consumable_order_details2__c
- WHERE
- Dealer_Arrive__c = TRUE
- AND Dealer_Shipment__c = FALSE
- AND Dealer_Saled__c = FALSE
- AND Lose_Flag__c = FALSE
- AND Dealer_Returned__c = FALSE
- AND Cancellation_Flag__c = FALSE
- AND TracingCode__c IN :barMcodeMap.values()
- AND Bar_Code__c NOT IN :barMcodeMap.keySet()
- AND Dealer_Info_text__c = :accountName
- AND Arrive_Owner_Work_Location__c = :userWorkLocation
- ORDER BY Name
- ];
- if (reSet1.size() > 0) {
+ reSet1 = [SELECT Id, Name,TracingCode__c,Bar_Code__c,Report_Product_Expiration__c
+ FROM Consumable_order_details2__c
+ WHERE Dealer_Arrive__c = true
+ AND Dealer_Shipment__c = false
+ AND Dealer_Saled__c = false
+ AND Lose_Flag__c = false
+ AND Dealer_Returned__c = false
+ AND Cancellation_Flag__c = false
+ AND TracingCode__c in :barMcodeMap.values()
+ AND Bar_Code__c not in :barMcodeMap.keySet()
+ AND Dealer_Info_text__c = :accountName
+ AND Arrive_Owner_Work_Location__c =: userWorkLocation
+ ORDER BY Name ];
+ if(reSet1.size()>0){
for (Integer i = 0; i < reSet1.size(); i++) {
- if (ErrorIdMap.containsKey(reSet1[i].Bar_Code__c)) {
+ if(ErrorIdMap.containsKey(reSet1[i].Bar_Code__c)){
// 璺宠繃宸茬粡澶勭悊鐨勬秷鑰楀搧鏄庣粏
continue;
- } else {
- for (String str : barMcodeMap.keySet()) {
- if (barMcodeMap.get(str) == reSet1[i].TracingCode__c) {
- ApexPages.addmessage(
- new ApexPages.message(
- ApexPages.severity.ERROR,
- str + ' 鐨勭鐞嗙紪鐮佸凡缁忓瓨鍦ㄤ簬绯荤粺鐨勫簱瀛樹腑锛岃纭杈撳叆淇℃伅鏄惁鏈夎銆�'
- )
- );
- ErrorIdMap.put(str, str);
- ErrorIdMap.put(reSet1[i].Bar_Code__c, reSet1[i].Bar_Code__c);
+ }else{
+ for(String str : barMcodeMap.keySet()){
+ if(barMcodeMap.get(str) == reSet1[i].TracingCode__c){
+ //LWC:Lwcflag鍜屾姤閿欐彁閱� update by Link 2023-04-27
+ if(isLwc){
+ errorList.add(str + ' 鐨勭鐞嗙紪鐮佸凡缁忓瓨鍦ㄤ簬绯荤粺鐨勫簱瀛樹腑锛岃纭杈撳叆淇℃伅鏄惁鏈夎銆�');
+ }else {
+ ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR, str + ' 鐨勭鐞嗙紪鐮佸凡缁忓瓨鍦ㄤ簬绯荤粺鐨勫簱瀛樹腑锛岃纭杈撳叆淇℃伅鏄惁鏈夎銆�'));
+ }
+ ErrorIdMap.put(str,str);
+ ErrorIdMap.put(reSet1[i].Bar_Code__c,reSet1[i].Bar_Code__c);
}
}
}
}
}
//绠$悊缂栫爜涓虹┖鐨勪骇鍝�
- reSet1 = [
- SELECT
- Id,
- Name,
- Consumable_Product__r.Name__c,
- Consumable_Product__c,
- Consumable_Product__r.Name,
- Sterilization_limit__c,
- Deliver_date__c,
- Bar_Code__c,
- Box_Piece__c,
- Arrive_date__c,
- Send_Date__c,
- Consumable_order_minor__r.Name,
- Consumable_order_minor__c,
- TracingCode__c,
- Report_Product_Expiration__c
- FROM Consumable_order_details2__c
- WHERE
- Bar_Code__c IN :BarCodeListP
- AND Dealer_Info_text__c = :accountName
- //AND Arrive_Owner_Work_Location__c =: userWorkLocation
- AND (TracingCode__c = NULL
- OR TracingCode__c = '')
- ORDER BY Name
- ];
+ reSet1 = [SELECT Id, Name,Consumable_Product__r.Name__c,
+ Consumable_Product__c,Consumable_Product__r.Name, Sterilization_limit__c,
+ Deliver_date__c,Bar_Code__c,Box_Piece__c,
+ Arrive_date__c,Send_Date__c,Consumable_order_minor__r.Name,Consumable_order_minor__c,
+ TracingCode__c,Report_Product_Expiration__c
+ FROM Consumable_order_details2__c
+ WHERE Bar_Code__c in :BarCodeListP
+ AND Dealer_Info_text__c = :accountName
+ //AND Arrive_Owner_Work_Location__c =: userWorkLocation
+ AND (TracingCode__c = null
+ OR TracingCode__c = '')
+ ORDER BY Name ];
- if (reSet1.size() > 0) {
+ if(reSet1.size()>0){
for (Integer i = 0; i < reSet1.size(); i++) {
- if (ErrorIdMap.containsKey(reSet1[i].Bar_Code__c)) {
+ if(ErrorIdMap.containsKey(reSet1[i].Bar_Code__c)){
// 璺宠繃宸茬粡澶勭悊鐨勬秷鑰楀搧鏄庣粏
continue;
- } else {
+ }else{
String str = '璇ヤ骇鍝佹病鏈夌鐞嗙紪鐮侊紝鏃犳硶鍏ュ簱';
- ConsumableorderdetailsRecordserror.add(new ConsumableorderdetailsInfo(reSet1[i], str));
- ErrorIdMap.put(reSet1[i].Bar_Code__c, reSet1[i].Bar_Code__c);
+ ConsumableorderdetailsRecordserror.add(new ConsumableorderdetailsInfo(reSet1[i],str));
+ ErrorIdMap.put(reSet1[i].Bar_Code__c,reSet1[i].Bar_Code__c);
}
}
}
//ApexPages.addmessage(new ApexPages.message(ApexPages.severity.INFO, '绠$悊缂栫爜涓虹┖鐨勪骇鍝� ' + ErrorIdMap));
//鏁翠綋鍒拌揣
- if (EsetId == null || EsetId == '') {
- if (ArrType != 'ReG') {
- //鍒拌揣浣嗕骇鍝佺被鍨嬩笌鐢ㄦ埛鐨勭被鍨嬩笉绗�
- reSet1 = [
- SELECT
- Id,
- Name,
- Intra_Trade_List_RMB__c,
- Asset_Model_No__c,
- Consumable_Product__c,
- Consumable_Product__r.Name,
- Consumable_Product__r.Name__c,
- Consumable_Product__r.Asset_Model_No__c,
- Sterilization_limit__c,
- Deliver_date__c,
- Bar_Code__c,
- Arrive_date__c,
- Send_Date__c,
- Consumable_order_minor__r.Name,
- Consumable_order_minor__c,
- Dealer_Arrive__c,
- Guarantee_period_for_products__c,
- CFDA_Status__c,
- ProductPacking_list_manual__c,
- Report_Product_Approbation__c,
- Report_Product_Expiration__c,
- Box_Piece__c,
- Rrturn_count__c,
- Product_Type__c,
- ContractNo_text__c /*,ContractNo__c1*/,
- // tcm start
- Consumable_order_minor__r.ContractNo__c
- // tcm end
- FROM Consumable_order_details2__c
- WHERE
- Bar_Code__c IN :BarCodeListP
- AND (NOT Product_Type__c LIKE :userPro_Typestr)
+ System.debug('EsetId===>'+EsetId);
+ System.debug('ArrType===>'+ArrType);
+ if(EsetId == null || EsetId == ''){
+ if(ArrType!='ReG'){
+ //鍒拌揣浣嗕骇鍝佺被鍨嬩笌鐢ㄦ埛鐨勭被鍨嬩笉绗�
+ reSet1 = [SELECT Id,Name,Intra_Trade_List_RMB__c,Asset_Model_No__c,
+ Consumable_Product__c,Consumable_Product__r.Name,
+ Consumable_Product__r.Name__c,Consumable_Product__r.Asset_Model_No__c,
+ Sterilization_limit__c,Deliver_date__c,Bar_Code__c,
+ Arrive_date__c,Send_Date__c,Consumable_order_minor__r.Name,
+ Consumable_order_minor__c,Dealer_Arrive__c,
+ Guarantee_period_for_products__c,CFDA_Status__c,
+ ProductPacking_list_manual__c,Report_Product_Approbation__c,
+ Report_Product_Expiration__c,Box_Piece__c, Rrturn_count__c,
+ Product_Type__c
+ ,ContractNo_text__c/*,ContractNo__c1*/
+ // tcm start
+ ,Consumable_order_minor__r.ContractNo__c
+ // tcm end
+ FROM Consumable_order_details2__c
+ WHERE Bar_Code__c in :BarCodeListP
+ AND ( not Product_Type__c like :userPro_Typestr)
AND Dealer_Info_text__c = :accountName
- AND ((Consumable_order_minor__c != NULL
- AND Consumable_order_minor__r.Order_Owner_WorkLocal__c = :userWorkLocation)
- OR Consumable_order_minor__c = NULL)
- ORDER BY Name
- ];
+ AND ((Consumable_order_minor__c != null
+ AND Consumable_order_minor__r.Order_Owner_WorkLocal__c = :userWorkLocation)
+ OR Consumable_order_minor__c = null)
+ ORDER BY Name ];
- if (reSet1.size() > 0) {
+ if(reSet1.size()>0){
for (Integer i = 0; i < reSet1.size(); i++) {
- if (ErrorIdMap.containsKey(reSet1[i].Bar_Code__c)) {
+ if(ErrorIdMap.containsKey(reSet1[i].Bar_Code__c)){
// 璺宠繃宸茬粡澶勭悊鐨勬秷鑰楀搧鏄庣粏
continue;
- } else {
- String str = '浜у搧绫诲瀷[' + reSet1[i].Product_Type__c + ']涓庣敤鎴风殑绫诲瀷[' + userPro_Type + ']涓嶇';
- ConsumableorderdetailsRecordserror.add(new ConsumableorderdetailsInfo(reSet1[i], str));
- ErrorIdMap.put(reSet1[i].Bar_Code__c, reSet1[i].Bar_Code__c);
+ }else{
+ String str = '浜у搧绫诲瀷['+reSet1[i].Product_Type__c+']涓庣敤鎴风殑绫诲瀷['+userPro_Type+']涓嶇';
+ ConsumableorderdetailsRecordserror.add(new ConsumableorderdetailsInfo(reSet1[i],str));
+ ErrorIdMap.put(reSet1[i].Bar_Code__c,reSet1[i].Bar_Code__c);
}
}
}
+ System.debug('reSet1===>'+reSet1);
+ //add by Wang Xueqin
+ //鍒拌揣浣嗕骇鍝佺被鍨嬩笌鐢ㄦ埛鐨勭被鍨嬩笉绗�
+ reSet1 = [SELECT Id,Name,Intra_Trade_List_RMB__c,Asset_Model_No__c,
+ Consumable_Product__c,Consumable_Product__r.Name,
+ Consumable_Product__r.Name__c,Consumable_Product__r.Asset_Model_No__c,
+ Sterilization_limit__c,Deliver_date__c,Bar_Code__c,
+ Arrive_date__c,Send_Date__c,Consumable_order_minor__r.Name,
+ Consumable_order_minor__c,Dealer_Arrive__c,
+ Guarantee_period_for_products__c,CFDA_Status__c,
+ ProductPacking_list_manual__c,Report_Product_Approbation__c,
+ Report_Product_Expiration__c,Box_Piece__c, Rrturn_count__c,
+ Product_Type__c
+ ,ContractNo_text__c
+ ,Consumable_order_minor__r.ContractNo__c
+ FROM Consumable_order_details2__c
+ WHERE Bar_Code__c in :BarCodeListP
+ AND ( not Product_Type__c like :userPro_Typestr)
+ ];
+
+ if(reSet1.size()>0){
+ for (Integer i = 0; i < reSet1.size(); i++) {
+ if(ErrorIdMap.containsKey(reSet1[i].Bar_Code__c)){
+ // 璺宠繃宸茬粡澶勭悊鐨勬秷鑰楀搧鏄庣粏
+ continue;
+ }else{
+ String str = '浜у搧绫诲瀷['+reSet1[i].Product_Type__c+']涓庣敤鎴风殑绫诲瀷['+userPro_Type+']涓嶇';
+ ConsumableorderdetailsRecordserror.add(new ConsumableorderdetailsInfo(reSet1[i],str));
+ ErrorIdMap.put(reSet1[i].Bar_Code__c,reSet1[i].Bar_Code__c);
+ }
+ }
+ }
+ System.debug('reSet1===>1'+reSet1);
+ //end
+
+
//閿�鍞骇鍝�
- reSet1 = [
- SELECT
- Id,
- Name,
- Consumable_Product__r.Name__c,
- Consumable_Product__c,
- Consumable_Product__r.Name,
- Sterilization_limit__c,
- Deliver_date__c,
- Bar_Code__c,
- Box_Piece__c,
- Arrive_date__c,
- Send_Date__c,
- Consumable_order_minor__r.Name,
- Consumable_order_minor__c,
- recordtypeid,
- Consumable_order_minor__r.Arrive_Order__c,
- OwnerId,
- Report_Product_Expiration__c
- FROM Consumable_order_details2__c
- WHERE
- Dealer_Saled__c = TRUE
- AND Dealer_Returned__c = FALSE
- AND Bar_Code__c IN :BarCodeListP
- AND Dealer_Info_text__c = :accountName
- AND (Arrive_Owner_Work_Location__c = :userWorkLocation
- OR OwnerId = :System.Label.User_OlympusSystem)
- ORDER BY Name
- ];
- if (reSet1.size() > 0) {
+ reSet1 = [SELECT Id, Name,Consumable_Product__r.Name__c,
+ Consumable_Product__c,Consumable_Product__r.Name, Sterilization_limit__c,
+ Deliver_date__c,Bar_Code__c,Box_Piece__c,
+ Arrive_date__c,Send_Date__c,Consumable_order_minor__r.Name,Consumable_order_minor__c,
+ recordtypeid,Consumable_order_minor__r.Arrive_Order__c,OwnerId,Report_Product_Expiration__c
+ FROM Consumable_order_details2__c
+ WHERE Dealer_Saled__c = true
+ AND Dealer_Returned__c = false
+ AND Bar_Code__c in :BarCodeListP
+ AND Dealer_Info_text__c = :accountName
+ AND (Arrive_Owner_Work_Location__c =: userWorkLocation
+ OR OwnerId = :System.Label.User_OlympusSystem)
+ ORDER BY Name ];
+ if(reSet1.size()>0){
for (Integer i = 0; i < reSet1.size(); i++) {
- if (ErrorIdMap.containsKey(reSet1[i].Bar_Code__c)) {
+ if(ErrorIdMap.containsKey(reSet1[i].Bar_Code__c)){
// 璺宠繃宸茬粡澶勭悊鐨勬秷鑰楀搧鏄庣粏
continue;
- } else {
+ }else{
String str = '';
if (reSet1[i].OwnerId == System.Label.User_OlympusSystem) {
str = '璇ュ晢鍝佹槸鐩撮攢浜у搧璇峰厛杩斿搧';
- } else {
+ }else{
str = '璇ュ晢鍝佸凡缁忛攢鍞�';
}
- ConsumableorderdetailsRecordserror.add(new ConsumableorderdetailsInfo(reSet1[i], str));
- ErrorIdMap.put(reSet1[i].Bar_Code__c, reSet1[i].Bar_Code__c);
+ ConsumableorderdetailsRecordserror.add(new ConsumableorderdetailsInfo(reSet1[i],str));
+ ErrorIdMap.put(reSet1[i].Bar_Code__c,reSet1[i].Bar_Code__c);
+
}
}
}
//鍑哄簱浜у搧
- reSet1 = [
- SELECT
- Id,
- Name,
- Consumable_Product__r.Name__c,
- Consumable_Product__c,
- Consumable_Product__r.Name,
- Sterilization_limit__c,
- Deliver_date__c,
- Bar_Code__c,
- Box_Piece__c,
- Arrive_date__c,
- Send_Date__c,
- Consumable_order_minor__r.Name,
- Consumable_order_minor__c,
- recordtypeid,
- Consumable_order_minor__r.Arrive_Order__c,
- Report_Product_Expiration__c
- FROM Consumable_order_details2__c
- WHERE
- Dealer_Shipment__c = TRUE
- AND Dealer_Returned__c = FALSE
- AND Bar_Code__c IN :BarCodeListP
- AND Dealer_Info_text__c = :accountName
- AND Arrive_Owner_Work_Location__c = :userWorkLocation
- ORDER BY Name
- ];
- if (reSet1.size() > 0) {
+ reSet1 = [SELECT Id, Name,Consumable_Product__r.Name__c,
+ Consumable_Product__c,Consumable_Product__r.Name, Sterilization_limit__c,
+ Deliver_date__c,Bar_Code__c,Box_Piece__c,
+ Arrive_date__c,Send_Date__c,Consumable_order_minor__r.Name,Consumable_order_minor__c,
+ recordtypeid,Consumable_order_minor__r.Arrive_Order__c,Report_Product_Expiration__c
+ FROM Consumable_order_details2__c
+ WHERE Dealer_Shipment__c = true
+ AND Dealer_Returned__c = false
+ AND Bar_Code__c in :BarCodeListP
+ AND Dealer_Info_text__c = :accountName
+ AND Arrive_Owner_Work_Location__c =: userWorkLocation
+ ORDER BY Name ];
+ if(reSet1.size()>0){
for (Integer i = 0; i < reSet1.size(); i++) {
- if (ErrorIdMap.containsKey(reSet1[i].Bar_Code__c)) {
+ if(ErrorIdMap.containsKey(reSet1[i].Bar_Code__c)){
// 璺宠繃宸茬粡澶勭悊鐨勬秷鑰楀搧鏄庣粏
continue;
- } else {
+ }else{
String str = '璇ュ晢鍝佸凡缁忓嚭搴�';
- ConsumableorderdetailsRecordserror.add(new ConsumableorderdetailsInfo(reSet1[i], str));
- ErrorIdMap.put(reSet1[i].Bar_Code__c, reSet1[i].Bar_Code__c);
+ ConsumableorderdetailsRecordserror.add(new ConsumableorderdetailsInfo(reSet1[i],str));
+ ErrorIdMap.put(reSet1[i].Bar_Code__c,reSet1[i].Bar_Code__c);
}
}
}
//宸插埌璐т骇鍝�
- reSet1 = [
- SELECT
- Id,
- Name,
- Consumable_Product__r.Name__c,
- Consumable_Product__c,
- Consumable_Product__r.Name,
- Sterilization_limit__c,
- Deliver_date__c,
- Bar_Code__c,
- Lose_Flag__c,
- Box_Piece__c,
- Arrive_date__c,
- Send_Date__c,
- Consumable_order_minor__r.Name,
- Consumable_order_minor__c,
- recordtypeid,
- Consumable_order_minor__r.Arrive_Order__c,
- Report_Product_Expiration__c
- FROM Consumable_order_details2__c
- WHERE
- Dealer_Arrive__c = TRUE
- AND Dealer_Returned__c = FALSE
- AND Bar_Code__c IN :BarCodeListP
- AND Dealer_Info_text__c = :accountName
- AND Arrive_Owner_Work_Location__c = :userWorkLocation
- ORDER BY Name
- ];
- if (reSet1.size() > 0) {
+ reSet1 = [SELECT Id, Name,Consumable_Product__r.Name__c,
+ Consumable_Product__c,Consumable_Product__r.Name, Sterilization_limit__c,
+ Deliver_date__c,Bar_Code__c,Lose_Flag__c,Box_Piece__c,
+ Arrive_date__c,Send_Date__c,Consumable_order_minor__r.Name,Consumable_order_minor__c,
+ recordtypeid,Consumable_order_minor__r.Arrive_Order__c,Report_Product_Expiration__c
+ FROM Consumable_order_details2__c
+ WHERE Dealer_Arrive__c = true
+ AND Dealer_Returned__c = false
+ AND Bar_Code__c in :BarCodeListP
+ AND Dealer_Info_text__c = :accountName
+ AND Arrive_Owner_Work_Location__c =: userWorkLocation
+ ORDER BY Name ];
+ if(reSet1.size()>0){
for (Integer i = 0; i < reSet1.size(); i++) {
- if (ErrorIdMap.containsKey(reSet1[i].Bar_Code__c)) {
+ if(ErrorIdMap.containsKey(reSet1[i].Bar_Code__c)){
// 璺宠繃宸茬粡澶勭悊鐨勬秷鑰楀搧鏄庣粏
continue;
- } else {
+ }else{
String str = '璇ュ晢鍝佸凡缁忓埌璐�';
- if (reSet1[i].Lose_Flag__c == true) {
+ if (reSet1[i].Lose_Flag__c == TRUE) {
str = '璇ュ晢鍝佸凡缁忎涪澶�';
}
- ConsumableorderdetailsRecordserror.add(new ConsumableorderdetailsInfo(reSet1[i], str));
- ErrorIdMap.put(reSet1[i].Bar_Code__c, reSet1[i].Bar_Code__c);
+ ConsumableorderdetailsRecordserror.add(new ConsumableorderdetailsInfo(reSet1[i],str));
+ ErrorIdMap.put(reSet1[i].Bar_Code__c,reSet1[i].Bar_Code__c);
}
}
}
//宸叉媶鐩掍骇鍝�
- reSet1 = [
- SELECT
- Id,
- Name,
- Consumable_Product__r.Name__c,
- Consumable_Product__c,
- Consumable_Product__r.Name,
- Sterilization_limit__c,
- Deliver_date__c,
- Bar_Code__c,
- Box_Piece__c,
- Arrive_date__c,
- Send_Date__c,
- Consumable_order_minor__r.Name,
- Consumable_order_minor__c,
- recordtypeid,
- Consumable_order_minor__r.Arrive_Order__c,
- Report_Product_Expiration__c
- FROM Consumable_order_details2__c
- WHERE
- Dealer_Arrive__c = TRUE
- AND Bar_Code__c IN :BarCodeListP
- AND (Dealer_Info_text__c != :accountName
- OR (Dealer_Info_text__c = :accountName
- AND Arrive_Owner_Work_Location__c != :userWorkLocation))
- AND Box_Piece__c = '涓�'
- ORDER BY Name
- ];
- if (reSet1.size() > 0) {
+ reSet1 = [SELECT Id, Name,Consumable_Product__r.Name__c,
+ Consumable_Product__c,Consumable_Product__r.Name, Sterilization_limit__c,
+ Deliver_date__c,Bar_Code__c,Box_Piece__c,
+ Arrive_date__c,Send_Date__c,Consumable_order_minor__r.Name,Consumable_order_minor__c,
+ recordtypeid,Consumable_order_minor__r.Arrive_Order__c,Report_Product_Expiration__c
+ FROM Consumable_order_details2__c
+ WHERE Dealer_Arrive__c = true
+ AND Bar_Code__c in :BarCodeListP
+ AND (Dealer_Info_text__c != :accountName
+ OR (Dealer_Info_text__c = :accountName
+ AND Arrive_Owner_Work_Location__c !=: userWorkLocation))
+ AND Box_Piece__c = '涓�'
+ ORDER BY Name ];
+ if(reSet1.size()>0){
for (Integer i = 0; i < reSet1.size(); i++) {
- if (ErrorIdMap.containsKey(reSet1[i].Bar_Code__c)) {
+ if(ErrorIdMap.containsKey(reSet1[i].Bar_Code__c)){
// 璺宠繃宸茬粡澶勭悊鐨勬秷鑰楀搧鏄庣粏
continue;
- } else {
+ }else{
String str = '宸叉媶鐩掔殑浜у搧涓嶈兘鍏ュ簱';
- ConsumableorderdetailsRecordserror.add(new ConsumableorderdetailsInfo(reSet1[i], str));
- ErrorIdMap.put(reSet1[i].Bar_Code__c, reSet1[i].Bar_Code__c);
+ ConsumableorderdetailsRecordserror.add(new ConsumableorderdetailsInfo(reSet1[i],str));
+ ErrorIdMap.put(reSet1[i].Bar_Code__c,reSet1[i].Bar_Code__c);
}
}
}
// 缁忛攢鍟嗕箣闂存垨鑰呭悓涓�缁忛攢鍟嗕笉鍚屽伐浣滃湴璋冭揣
- reSet1 = [
- SELECT
- Id,
- Name,
- Consumable_Product__r.Name__c,
- Asset_Model_No__c,
- Arrive_Owner_Work_Location__c,
- Consumable_Product__c,
- Consumable_Product__r.Name,
- Sterilization_limit__c,
- Box_Piece__c,
- Deliver_date__c,
- Bar_Code__c,
- TracingCode__c,
- Dealer_Info_text__c,
- OwnerId,
- Lose_Flag__c,
- Arrive_date__c,
- Send_Date__c,
- Consumable_order_minor__r.Name,
- Consumable_order_minor__c,
- recordtypeid,
- Consumable_order_minor__r.Arrive_Order__c,
- SerialLotNo__c,
- Dealer_Arrive__c,
- Consumable_Arrived_order__r.Dealer_Info__c,
- Consumable_Arrived_order__r.Dealer_Info__r.Name,
- Intra_Trade_List_RMB__c,
- Dealer_Shipment__c,
- Dealer_Saled__c,
- Consumable_Product__r.Asset_Model_No__c,
- // 鏇存柊鍊熻皟淇℃伅 add by gzw 2020-0-415 start
- SummonsForDirction_det__c,
- Transfer_Time__c,
- Frist_Transfer_Agency__c,
- Agency_Transfer__c,
- // 鏇存柊鍊熻皟淇℃伅 add by gzw 2020-0-415 start
- // 棣栨鍏ュ簱缁忛攢鍟嗕俊鎭� add by gzw 2020-04-27 start
- Agencyinfo_fromSAP__c,
- Frist_Storage_Agency__c,
- // 棣栨鍏ュ簱缁忛攢鍟嗕俊鎭� add by gzw 2020-04-27 end
+ reSet1 = [SELECT Id, Name,Consumable_Product__r.Name__c,Asset_Model_No__c, Arrive_Owner_Work_Location__c,
+ Consumable_Product__c,Consumable_Product__r.Name, Sterilization_limit__c,Box_Piece__c,
+ Deliver_date__c,Bar_Code__c,TracingCode__c, Dealer_Info_text__c, OwnerId, Lose_Flag__c,
+ Arrive_date__c,Send_Date__c,Consumable_order_minor__r.Name,Consumable_order_minor__c,
+ recordtypeid,Consumable_order_minor__r.Arrive_Order__c,SerialLotNo__c, Dealer_Arrive__c,
+ Consumable_Arrived_order__r.Dealer_Info__c, Consumable_Arrived_order__r.Dealer_Info__r.Name,
+ Intra_Trade_List_RMB__c, Dealer_Shipment__c, Dealer_Saled__c,Consumable_Product__r.Asset_Model_No__c
+ // 鏇存柊鍊熻皟淇℃伅 add by gzw 2020-0-415 start
+ ,SummonsForDirction_det__c,Transfer_Time__c,Frist_Transfer_Agency__c,Agency_Transfer__c
+ // 鏇存柊鍊熻皟淇℃伅 add by gzw 2020-0-415 start
+ // 棣栨鍏ュ簱缁忛攢鍟嗕俊鎭� add by gzw 2020-04-27 start
+ ,Agencyinfo_fromSAP__c,Frist_Storage_Agency__c
+ // 棣栨鍏ュ簱缁忛攢鍟嗕俊鎭� add by gzw 2020-04-27 end
- //add by rentx 2020-10-13 start 浜掔浉璋冭揣鏃�,鍊熷叆鏂硅褰昐AP鍚堝悓鍙�
- ContractNo_text__c /*,ContractNo__c */,
- // tcm start
- Consumable_order_minor__r.ContractNo__c,
- // tcm end
- //add by rentx 2020-10-13 end
- //add by rentx 2021-03-22 start
- hospitalSpecialOffer__c,
- exchangeOutPattern__c,
- Report_Product_Expiration__c
- //add by rentx 2021-03-22 end
- FROM Consumable_order_details2__c
- WHERE
- Dealer_Arrive__c = TRUE
- //AND Dealer_Shipment__c= false
- //AND Dealer_Saled__c = FALSE
- AND Dealer_Returned__c = FALSE
- AND Cancellation_Flag__c = FALSE
- AND Bar_Code__c IN :BarCodeListP
- //AND (Dealer_Shipment__c = FALSE
- // OR (Dealer_Shipment__c = TRUE
- // AND Consumable_Shipment_order__r.SummonsForDirction__c != '浜掔浉璋冭揣'))
- AND (Dealer_Info_text__c != :accountName
- OR (Dealer_Info_text__c = :accountName
- AND Arrive_Owner_Work_Location__c != :userWorkLocation))
- // 鏇存柊鍊熻皟淇℃伅 add by gzw 2020-0-415 start
- ORDER BY Bar_Code__c, Transfer_Time__c DESC
- // 鏇存柊鍊熻皟淇℃伅 add by gzw 2020-0-415 end
- ];
- if (reSet1.size() > 0) {
+ //add by rentx 2020-10-13 start 浜掔浉璋冭揣鏃�,鍊熷叆鏂硅褰昐AP鍚堝悓鍙�
+ ,ContractNo_text__c/*,ContractNo__c */
+ // tcm start
+ ,Consumable_order_minor__r.ContractNo__c
+ // tcm end
+ //add by rentx 2020-10-13 end
+ //add by rentx 2021-03-22 start
+ ,hospitalSpecialOffer__c
+ ,exchangeOutPattern__c
+ ,Report_Product_Expiration__c
+ //add by rentx 2021-03-22 end
+ FROM Consumable_order_details2__c
+ WHERE Dealer_Arrive__c = TRUE
+ //AND Dealer_Shipment__c= false
+ //AND Dealer_Saled__c = FALSE
+ AND Dealer_Returned__c = FALSE
+ AND Cancellation_Flag__c = FALSE
+ AND Bar_Code__c in :BarCodeListP
+ //AND (Dealer_Shipment__c = FALSE
+ // OR (Dealer_Shipment__c = TRUE
+ // AND Consumable_Shipment_order__r.SummonsForDirction__c != '浜掔浉璋冭揣'))
+ AND (Dealer_Info_text__c != :accountName
+ OR (Dealer_Info_text__c = :accountName
+ AND Arrive_Owner_Work_Location__c != :userWorkLocation)
+ )
+ // 鏇存柊鍊熻皟淇℃伅 add by gzw 2020-0-415 start
+ order by Bar_Code__c, Transfer_Time__c desc
+ // 鏇存柊鍊熻皟淇℃伅 add by gzw 2020-0-415 end
+ ];
+ if(reSet1.size()>0){
for (Integer i = 0; i < reSet1.size(); i++) {
- if (ErrorIdMap.containsKey(reSet1[i].Bar_Code__c)) {
+ if(ErrorIdMap.containsKey(reSet1[i].Bar_Code__c)){
// 璺宠繃宸茬粡澶勭悊鐨勬秷鑰楀搧鏄庣粏
continue;
- } else {
- if (otherAgencyMap.containsKey(reSet1[i].Bar_Code__c)) {
+ }else{
+ if(otherAgencyMap.containsKey(reSet1[i].Bar_Code__c)){
continue;
- } else {
+ }else{
//鍏朵粬缁忛攢鍟嗗嚭搴撲骇鍝佸彲浠ュ叆搴�
List<String> barcodedetList = new List<String>();
barcodedetList.add(reSet1[i].Bar_Code__c);
barcodedetList.add(String.valueOf(reSet1[i].Sterilization_limit__c));
barcodedetList.add(reSet1[i].SerialLotNo__c);
barcodedetList.add(reSet1[i].TracingCode__c);
- if (reSet1[i].Lose_Flag__c == false) {
+ if (reSet1[i].Lose_Flag__c == false
//&& reSet1[i].Dealer_Info_text__c == accountName
+ ) {
consumableorderdetails2Cancle.add(reSet1[i]);
}
// 鏇存柊鍊熻皟淇℃伅 add by gzw 2020-0-415 start
- if (
- reSet1[i].SummonsForDirction_det__c == '浜掔浉璋冭揣' &&
- !orderdetails2trMap.containsKey(reSet1[i].Bar_Code__c)
- ) {
+ if (reSet1[i].SummonsForDirction_det__c == '浜掔浉璋冭揣' && !orderdetails2trMap.containsKey(reSet1[i].Bar_Code__c)) {
orderdetails2trMap.put(reSet1[i].Bar_Code__c, reSet1[i]);
}
// 鏇存柊鍊熻皟淇℃伅 add by gzw 2020-0-415 end
- consumableInventory.add(new ConsumableorderdetailsInfo(reSet1[i], barcodedetList));
+ consumableInventory.add(new ConsumableorderdetailsInfo(reSet1[i],barcodedetList));
Consumable_order_details2__c codsIns = new Consumable_order_details2__c();
- codsIns.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
- codsIns.Intra_Trade_List_RMB__c = reSet1[i].Intra_Trade_List_RMB__c;
+ codsIns.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
+ codsIns.Intra_Trade_List_RMB__c = reSet1[i].Intra_Trade_List_RMB__c;
//gzw 鎵嬪姩鍏ュ簱 榛樿浜у搧鍗曚环 20230307
- codsIns.Asset_Model_No__c = reSet1[i].Asset_Model_No__c;
- codsIns.Direct_Arrive_Product__c = true;
- codsIns.Sterilization_limit__c = reSet1[i].Sterilization_limit__c;
- codsIns.Consumable_Product__c = reSet1[i].Consumable_Product__c;
- codsIns.Bar_Code__c = reSet1[i].Bar_Code__c;
- codsIns.SerialLotNo__c = reSet1[i].SerialLotNo__c;
- codsIns.TracingCode__c = reSet1[i].TracingCode__c;
+ codsIns.Asset_Model_No__c = reSet1[i].Asset_Model_No__c;
+ codsIns.Direct_Arrive_Product__c = true;
+ codsIns.Sterilization_limit__c = reSet1[i].Sterilization_limit__c;
+ codsIns.Consumable_Product__c = reSet1[i].Consumable_Product__c;
+ codsIns.Bar_Code__c = reSet1[i].Bar_Code__c;
+ codsIns.SerialLotNo__c = reSet1[i].SerialLotNo__c;
+ codsIns.TracingCode__c = reSet1[i].TracingCode__c;
// 鏇存柊鍊熻皟淇℃伅 add by gzw 2020-0-415 start
- codsIns.Transfer_Time__c = reSet1[i].Transfer_Time__c == null ? 1 : reSet1[i].Transfer_Time__c;
- codsIns.Frist_Transfer_Agency__c = reSet1[i].Frist_Transfer_Agency__c == null
- ? reSet1[i].Dealer_Info_text__c
- : reSet1[i].Frist_Transfer_Agency__c;
- codsIns.Agency_Transfer__c = true;
+ codsIns.Transfer_Time__c = reSet1[i].Transfer_Time__c == null? 1 : reSet1[i].Transfer_Time__c;
+ codsIns.Frist_Transfer_Agency__c = reSet1[i].Frist_Transfer_Agency__c == null ? reSet1[i].Dealer_Info_text__c : reSet1[i].Frist_Transfer_Agency__c;
+ codsIns.Agency_Transfer__c = true;
// 鏇存柊鍊熻皟淇℃伅 add by gzw 2020-0-415 end
-
+
// 杩藉姞棣栨鍏ュ簱缁忛攢鍟� add by gzw 2020-04-27 start
- codsIns.Agencyinfo_fromSAP__c = reSet1[i].Agencyinfo_fromSAP__c;
- codsIns.Frist_Storage_Agency__c = reSet1[i].Frist_Storage_Agency__c;
+ codsIns.Agencyinfo_fromSAP__c = reSet1[i].Agencyinfo_fromSAP__c;
+ codsIns.Frist_Storage_Agency__c = reSet1[i].Frist_Storage_Agency__c;
// 杩藉姞棣栨鍏ュ簱缁忛攢鍟� add by gzw 2020-04-27 end
//add by rentx 2020-10-13 start 浜掔浉璋冭揣鏃�,璁板綍SAP鍚堝悓鍙�
// update tcm start
if (String.isBlank(reSet1[i].Consumable_order_minor__r.ContractNo__c)) {
- codsIns.ContractNo_text__c = reSet1[i].ContractNo_text__c;
- } else {
- codsIns.ContractNo_text__c = reSet1[i].Consumable_order_minor__r.ContractNo__c;
+ codsIns.ContractNo_text__c= reSet1[i].ContractNo_text__c;
+ }else {
+ codsIns.ContractNo_text__c= reSet1[i].Consumable_order_minor__r.ContractNo__c;
}
// update tcm end
//add by rentx 2020-10-13 end
//add by rentx 2021-03-22 start
// if (reSet1[i].Lose_Flag__c == true){
- if (reSet1[i].hospitalSpecialOffer__c == true && reSet1[i].SummonsForDirction_det__c == '浜掔浉璋冭揣') {
+ if (reSet1[i].hospitalSpecialOffer__c == true && reSet1[i].SummonsForDirction_det__c == '浜掔浉璋冭揣'){
codsIns.exchangeOutPattern__c = true;
}
//add by rentx 2021-03-22 end
consumableorderdetails2Insert.add(codsIns);
- otherAgencyMap.put(reSet1[i].Bar_Code__c, reSet1[i].Bar_Code__c);
+ otherAgencyMap.put(reSet1[i].Bar_Code__c,reSet1[i].Bar_Code__c);
//String str = '璇ュ晢鍝佸湪鍏朵粬缁忛攢鍟嗗簱瀛�';
//ConsumableorderdetailsRecordserror.add(new ConsumableorderdetailsInfo(reSet1[i],str));
//ErrorIdMap.put(reSet1[i].Bar_Code__c,reSet1[i].Bar_Code__c);
@@ -866,81 +809,56 @@
}
}
- //鍙戦敊搴� 鏈埌璐�
- reSet1 = [
- SELECT
- Id,
- Name,
- Consumable_Product__r.Name__c,
- Asset_Model_No__c,
- Consumable_Product__c,
- Consumable_Product__r.Name,
- Sterilization_limit__c,
- Deliver_date__c,
- Bar_Code__c,
- TracingCode__c,
- Box_Piece__c,
- Arrive_date__c,
- Send_Date__c,
- Consumable_order_minor__r.Name,
- Consumable_order_minor__c,
- recordtypeid,
- Consumable_order_minor__r.Arrive_Order__c,
- SerialLotNo__c,
- Dealer_Arrive__c,
- Dealer_Shipment__c,
- Dealer_Saled__c,
- Consumable_Product__r.Asset_Model_No__c,
- // 鏇存柊鍊熻皟淇℃伅 add by gzw 2020-0-415 start
- SummonsForDirction_det__c,
- Transfer_Time__c,
- Frist_Transfer_Agency__c,
- Agency_Transfer__c,
- Dealer_Info_text__c,
- Intra_Trade_List_RMB__c,
- // 鏇存柊鍊熻皟淇℃伅 add by gzw 2020-0-415 start
- // 棣栨鍏ュ簱缁忛攢鍟嗕俊鎭� add by gzw 2020-04-27 start
- Agencyinfo_fromSAP__c,
- Frist_Storage_Agency__c,
- // 棣栨鍏ュ簱缁忛攢鍟嗕俊鎭� add by gzw 2020-04-27 end
- //add by rentx 2020-10-13 start 浜掔浉璋冭揣鏃�,鍊熷叆鏂硅褰昐AP鍚堝悓鍙�
- ContractNo_text__c /*,ContractNo__c*/,
- // tcm start
- Consumable_order_minor__r.ContractNo__c,
- // tcm end
- //add by rentx 2020-10-13 end 浜掔浉璋冭揣鏃�,鍊熷叆鏂硅褰昐AP鍚堝悓鍙�
- hospitalSpecialOffer__c,
- exchangeOutPattern__c,
- Lose_Flag__c,
- Report_Product_Expiration__c
- FROM Consumable_order_details2__c
- WHERE
- Dealer_Arrive__c = FALSE
- AND Dealer_Shipment__c = FALSE
- AND Dealer_Saled__c = FALSE
- //AND Cancellation_Flag__c = FALSE
- AND Bar_Code__c IN :BarCodeListP
- AND (Dealer_Info_text__c != :accountName
- OR (Dealer_Info_text__c = :accountName
- AND ((Consumable_order_minor__c != NULL
- AND (Consumable_order_minor__r.Order_Owner_WorkLocal__c != :userWorkLocation
- OR (Consumable_order_minor__r.Order_Owner_WorkLocal__c = :userWorkLocation
- AND Cancellation_Flag__c = TRUE)))
- OR (Consumable_order_minor__c = NULL
- AND Cancellation_Flag__c = TRUE))))
- // 鏇存柊鍊熻皟淇℃伅 add by gzw 2020-0-415 start
- ORDER BY Bar_Code__c, Transfer_Time__c DESC
- // 鏇存柊鍊熻皟淇℃伅 add by gzw 2020-0-415 end
- ];
- if (reSet1.size() > 0) {
+ //鍙戦敊搴� 鏈埌璐�
+ reSet1 = [SELECT Id, Name,Consumable_Product__r.Name__c,Asset_Model_No__c,
+ Consumable_Product__c,Consumable_Product__r.Name, Sterilization_limit__c,
+ Deliver_date__c,Bar_Code__c,TracingCode__c,Box_Piece__c,
+ Arrive_date__c,Send_Date__c,Consumable_order_minor__r.Name,Consumable_order_minor__c,
+ recordtypeid,Consumable_order_minor__r.Arrive_Order__c,SerialLotNo__c,Dealer_Arrive__c,
+ Dealer_Shipment__c, Dealer_Saled__c,Consumable_Product__r.Asset_Model_No__c
+ // 鏇存柊鍊熻皟淇℃伅 add by gzw 2020-0-415 start
+ ,SummonsForDirction_det__c,Transfer_Time__c,Frist_Transfer_Agency__c,Agency_Transfer__c,
+ Dealer_Info_text__c,Intra_Trade_List_RMB__c
+ // 鏇存柊鍊熻皟淇℃伅 add by gzw 2020-0-415 start
+ // 棣栨鍏ュ簱缁忛攢鍟嗕俊鎭� add by gzw 2020-04-27 start
+ ,Agencyinfo_fromSAP__c,Frist_Storage_Agency__c
+ // 棣栨鍏ュ簱缁忛攢鍟嗕俊鎭� add by gzw 2020-04-27 end
+ //add by rentx 2020-10-13 start 浜掔浉璋冭揣鏃�,鍊熷叆鏂硅褰昐AP鍚堝悓鍙�
+ ,ContractNo_text__c/*,ContractNo__c*/
+ // tcm start
+ ,Consumable_order_minor__r.ContractNo__c
+ // tcm end
+ //add by rentx 2020-10-13 end 浜掔浉璋冭揣鏃�,鍊熷叆鏂硅褰昐AP鍚堝悓鍙�
+ ,hospitalSpecialOffer__c
+ ,exchangeOutPattern__c
+ ,Lose_Flag__c,Report_Product_Expiration__c
+ FROM Consumable_order_details2__c
+ WHERE Dealer_Arrive__c = FALSE
+ AND Dealer_Shipment__c= FALSE
+ AND Dealer_Saled__c = FALSE
+ //AND Cancellation_Flag__c = FALSE
+ AND Bar_Code__c in :BarCodeListP
+ AND (Dealer_Info_text__c != :accountName
+ OR (Dealer_Info_text__c = :accountName
+ AND ((Consumable_order_minor__c != null
+ AND (Consumable_order_minor__r.Order_Owner_WorkLocal__c != :userWorkLocation
+ OR (Consumable_order_minor__r.Order_Owner_WorkLocal__c = :userWorkLocation
+ AND Cancellation_Flag__c = TRUE)))
+ OR (Consumable_order_minor__c = null AND Cancellation_Flag__c = TRUE)))
+ )
+ // 鏇存柊鍊熻皟淇℃伅 add by gzw 2020-0-415 start
+ order by Bar_Code__c, Transfer_Time__c desc
+ // 鏇存柊鍊熻皟淇℃伅 add by gzw 2020-0-415 end
+ ];
+ if(reSet1.size()>0){
for (Integer i = 0; i < reSet1.size(); i++) {
- if (ErrorIdMap.containsKey(reSet1[i].Bar_Code__c)) {
+ if(ErrorIdMap.containsKey(reSet1[i].Bar_Code__c)){
// 璺宠繃宸茬粡澶勭悊鐨勬秷鑰楀搧鏄庣粏
continue;
- } else {
- if (otherAgencyMap.containsKey(reSet1[i].Bar_Code__c)) {
+ }else{
+ if(otherAgencyMap.containsKey(reSet1[i].Bar_Code__c)){
continue;
- } else {
+ }else{
//鍙栨秷鏄庣粏
List<String> barcodedetList = new List<String>();
barcodedetList.add(reSet1[i].Bar_Code__c);
@@ -949,243 +867,196 @@
barcodedetList.add(reSet1[i].TracingCode__c);
// 鍙戦敊搴撳瓨鏃讹紝鑷姩鍙栨秷 update by gzw 2020-04-15 start
//if (reSet1[i].Consumable_order_minor__c == null) {
- consumableorderdetails2Cancle.add(reSet1[i]);
+ consumableorderdetails2Cancle.add(reSet1[i]);
//}
// 鍙戦敊搴撳瓨鏃讹紝鑷姩鍙栨秷 update by gzw 2020-04-15 start
// 鏇存柊鍊熻皟淇℃伅 add by gzw 2020-0-415 start
- if (
- reSet1[i].SummonsForDirction_det__c == '浜掔浉璋冭揣' &&
- !orderdetails2trMap.containsKey(reSet1[i].Bar_Code__c)
- ) {
+ if (reSet1[i].SummonsForDirction_det__c == '浜掔浉璋冭揣' && !orderdetails2trMap.containsKey(reSet1[i].Bar_Code__c)) {
+
orderdetails2trMap.put(reSet1[i].Bar_Code__c, reSet1[i]);
}
// 鏇存柊鍊熻皟淇℃伅 add by gzw 2020-0-415 end
- consumableInventory.add(new ConsumableorderdetailsInfo(reSet1[i], barcodedetList));
+ consumableInventory.add(new ConsumableorderdetailsInfo(reSet1[i],barcodedetList));
Consumable_order_details2__c codsIns = new Consumable_order_details2__c();
- codsIns.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
- codsIns.Intra_Trade_List_RMB__c = reSet1[i].Intra_Trade_List_RMB__c;
+ codsIns.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
+ codsIns.Intra_Trade_List_RMB__c = reSet1[i].Intra_Trade_List_RMB__c;
//gzw 鎵嬪姩鍏ュ簱 榛樿浜у搧鍗曚环 20230307
- codsIns.Asset_Model_No__c = reSet1[i].Asset_Model_No__c;
- codsIns.Direct_Arrive_Product__c = true;
- codsIns.Sterilization_limit__c = reSet1[i].Sterilization_limit__c;
- codsIns.Consumable_Product__c = reSet1[i].Consumable_Product__c;
- codsIns.Bar_Code__c = reSet1[i].Bar_Code__c;
- codsIns.SerialLotNo__c = reSet1[i].SerialLotNo__c;
- codsIns.TracingCode__c = reSet1[i].TracingCode__c;
+ codsIns.Asset_Model_No__c = reSet1[i].Asset_Model_No__c;
+ codsIns.Direct_Arrive_Product__c = true;
+ codsIns.Sterilization_limit__c = reSet1[i].Sterilization_limit__c;
+ codsIns.Consumable_Product__c = reSet1[i].Consumable_Product__c;
+ codsIns.Bar_Code__c = reSet1[i].Bar_Code__c;
+ codsIns.SerialLotNo__c = reSet1[i].SerialLotNo__c;
+ codsIns.TracingCode__c = reSet1[i].TracingCode__c;
// 鏇存柊鍊熻皟淇℃伅 add by gzw 2020-0-415 start
// 娌℃湁鍏ュ簱鏃讹紝娌℃湁鍊熻皟淇℃伅
- codsIns.Transfer_Time__c = reSet1[i].Transfer_Time__c;
- codsIns.Frist_Transfer_Agency__c = reSet1[i].Frist_Transfer_Agency__c;
- codsIns.Agency_Transfer__c = reSet1[i].Agency_Transfer__c;
+ codsIns.Transfer_Time__c = reSet1[i].Transfer_Time__c;
+ codsIns.Frist_Transfer_Agency__c = reSet1[i].Frist_Transfer_Agency__c;
+ codsIns.Agency_Transfer__c = reSet1[i].Agency_Transfer__c;
// 鏇存柊鍊熻皟淇℃伅 add by gzw 2020-0-415 end
-
+
// 杩藉姞棣栨鍏ュ簱缁忛攢鍟� add by gzw 2020-04-27 start
- codsIns.Agencyinfo_fromSAP__c = reSet1[i].Agencyinfo_fromSAP__c;
- codsIns.Frist_Storage_Agency__c = reSet1[i].Frist_Storage_Agency__c;
+ codsIns.Agencyinfo_fromSAP__c = reSet1[i].Agencyinfo_fromSAP__c;
+ codsIns.Frist_Storage_Agency__c = reSet1[i].Frist_Storage_Agency__c;
// 杩藉姞棣栨鍏ュ簱缁忛攢鍟� add by gzw 2020-04-27 end
//add by rentx 2020-10-13 start 浜掔浉璋冭揣鏃�,鍊熷叆鏂硅褰昐AP鍚堝悓鍙�
// update tcm start
if (String.isBlank(reSet1[i].Consumable_order_minor__r.ContractNo__c)) {
- codsIns.ContractNo_text__c = reSet1[i].ContractNo_text__c;
- } else {
- codsIns.ContractNo_text__c = reSet1[i].Consumable_order_minor__r.ContractNo__c;
+ codsIns.ContractNo_text__c= reSet1[i].ContractNo_text__c;
+ }else {
+ codsIns.ContractNo_text__c= reSet1[i].Consumable_order_minor__r.ContractNo__c;
}
// update tcm end
//add by rentx 2020-10-13 end 浜掔浉璋冭揣鏃�,鍊熷叆鏂硅褰昐AP鍚堝悓鍙�
//add by rentx 2021-03-22 start
// if (reSet1[i].Lose_Flag__c == true){
- if (reSet1[i].hospitalSpecialOffer__c == true && reSet1[i].SummonsForDirction_det__c == '浜掔浉璋冭揣') {
+ if (reSet1[i].hospitalSpecialOffer__c == true && reSet1[i].SummonsForDirction_det__c == '浜掔浉璋冭揣'){
codsIns.exchangeOutPattern__c = true;
}
//add by rentx 2021-03-22 end
consumableorderdetails2Insert.add(codsIns);
- otherAgencyMap.put(reSet1[i].Bar_Code__c, reSet1[i].Bar_Code__c);
+ otherAgencyMap.put(reSet1[i].Bar_Code__c,reSet1[i].Bar_Code__c);
}
}
}
}
- } else {
+ }else{
//杩斿搧妫�鏌�
- //鍒拌揣浣嗕骇鍝佺被鍨嬩笌鐢ㄦ埛鐨勭被鍨嬩笉绗�
- reSet1 = [
- SELECT
- Id,
- Name,
- Intra_Trade_List_RMB__c,
- Asset_Model_No__c,
- Consumable_Product__c,
- Consumable_Product__r.Name,
- Consumable_Product__r.Name__c,
- Consumable_Product__r.Asset_Model_No__c,
- Sterilization_limit__c,
- Deliver_date__c,
- Bar_Code__c,
- Arrive_date__c,
- Send_Date__c,
- Consumable_order_minor__r.Name,
- Consumable_order_minor__c,
- Dealer_Arrive__c,
- Guarantee_period_for_products__c,
- CFDA_Status__c,
- ProductPacking_list_manual__c,
- Report_Product_Approbation__c,
- Report_Product_Expiration__c,
- Box_Piece__c,
- Rrturn_count__c,
- Product_Type__c,
- //add by rentx 2020-10-14 start
- ContractNo_text__c /*,ContractNo__c*/,
- // tcm start
- Consumable_order_minor__r.ContractNo__c
- // tcm end
- //add by rentx 2020-10-14 end
- FROM Consumable_order_details2__c
- WHERE
- Bar_Code__c IN :BarCodeListP
- AND (NOT Product_Type__c LIKE :userPro_Typestr)
+ //鍒拌揣浣嗕骇鍝佺被鍨嬩笌鐢ㄦ埛鐨勭被鍨嬩笉绗�
+ reSet1 = [SELECT Id,Name,Intra_Trade_List_RMB__c,Asset_Model_No__c,
+ Consumable_Product__c,Consumable_Product__r.Name,
+ Consumable_Product__r.Name__c,Consumable_Product__r.Asset_Model_No__c,
+ Sterilization_limit__c,Deliver_date__c,Bar_Code__c,
+ Arrive_date__c,Send_Date__c,Consumable_order_minor__r.Name,
+ Consumable_order_minor__c,Dealer_Arrive__c,
+ Guarantee_period_for_products__c,CFDA_Status__c,
+ ProductPacking_list_manual__c,Report_Product_Approbation__c,
+ Report_Product_Expiration__c,Box_Piece__c, Rrturn_count__c,
+ Product_Type__c
+ //add by rentx 2020-10-14 start
+ ,ContractNo_text__c/*,ContractNo__c*/
+ // tcm start
+ ,Consumable_order_minor__r.ContractNo__c
+ // tcm end
+ //add by rentx 2020-10-14 end
+ FROM Consumable_order_details2__c
+ WHERE Bar_Code__c in :BarCodeListP
+ AND ( not Product_Type__c like :userPro_Typestr)
AND Dealer_Info_text__c = :accountName
- AND ((Consumable_order_minor__c != NULL
- AND Consumable_order_minor__r.Order_Owner_WorkLocal__c = :userWorkLocation)
- OR Consumable_order_minor__c = NULL)
- ORDER BY Name
- ];
+ AND ((Consumable_order_minor__c != null
+ AND Consumable_order_minor__r.Order_Owner_WorkLocal__c = :userWorkLocation)
+ OR Consumable_order_minor__c = null)
+ ORDER BY Name ];
- if (reSet1.size() > 0) {
+ if(reSet1.size()>0){
for (Integer i = 0; i < reSet1.size(); i++) {
- if (ErrorIdMap.containsKey(reSet1[i].Bar_Code__c)) {
+ if(ErrorIdMap.containsKey(reSet1[i].Bar_Code__c)){
// 璺宠繃宸茬粡澶勭悊鐨勬秷鑰楀搧鏄庣粏
continue;
- } else {
- String str = '浜у搧绫诲瀷[' + reSet1[i].Product_Type__c + ']涓庣敤鎴风殑绫诲瀷[' + userPro_Type + ']涓嶇';
- ConsumableorderdetailsRecordserror.add(new ConsumableorderdetailsInfo(reSet1[i], str));
- ErrorIdMap.put(reSet1[i].Bar_Code__c, reSet1[i].Bar_Code__c);
+ }else{
+ String str = '浜у搧绫诲瀷['+reSet1[i].Product_Type__c+']涓庣敤鎴风殑绫诲瀷['+userPro_Type+']涓嶇';
+ ConsumableorderdetailsRecordserror.add(new ConsumableorderdetailsInfo(reSet1[i],str));
+ ErrorIdMap.put(reSet1[i].Bar_Code__c,reSet1[i].Bar_Code__c);
}
}
}
- reSet1 = [
- SELECT
- Id,
- Name,
- Consumable_Product__r.Name__c,
- Consumable_Product__c,
- Consumable_Product__r.Name,
- Sterilization_limit__c,
- Deliver_date__c,
- Bar_Code__c,
- Box_Piece__c,
- Arrive_date__c,
- Send_Date__c,
- Consumable_order_minor__r.Name,
- Consumable_order_minor__c,
- recordtypeid,
- Consumable_order_minor__r.Arrive_Order__c,
- //add by rentx 2020-10-14 start
- ContractNo_text__c /*,ContractNo__c*/,
- // tcm start
- Consumable_order_minor__r.ContractNo__c,
- // tcm end
- Report_Product_Expiration__c
- //add by rentx 2020-10-14 end
- FROM Consumable_order_details2__c
- WHERE
- Dealer_Arrive__c = FALSE
- AND Dealer_Shipment__c = FALSE
- AND Dealer_Saled__c = FALSE
- AND Dealer_Returned__c = FALSE
- AND Bar_Code__c IN :BarCodeListP
+ reSet1 = [SELECT Id, Name,Consumable_Product__r.Name__c,
+ Consumable_Product__c,Consumable_Product__r.Name, Sterilization_limit__c,
+ Deliver_date__c,Bar_Code__c,Box_Piece__c,
+ Arrive_date__c,Send_Date__c,Consumable_order_minor__r.Name,Consumable_order_minor__c,
+ recordtypeid,Consumable_order_minor__r.Arrive_Order__c
+ //add by rentx 2020-10-14 start
+ ,ContractNo_text__c/*,ContractNo__c*/
+ // tcm start
+ ,Consumable_order_minor__r.ContractNo__c
+ // tcm end
+ ,Report_Product_Expiration__c
+ //add by rentx 2020-10-14 end
+ FROM Consumable_order_details2__c
+ WHERE Dealer_Arrive__c = FALSE
+ AND Dealer_Shipment__c= FALSE
+ AND Dealer_Saled__c = FALSE
+ // gzw fix 鍙栨秷浜у搧鍒ゆ柇涓烘湭鍏ュ簱 20230323
+ AND Cancellation_Flag__c = false
+ AND Dealer_Returned__c = false
+ AND Bar_Code__c in :BarCodeListP
AND Dealer_Info_text__c = :accountName
- ORDER BY Name
- ]; //娌″埌璐�
- if (reSet1.size() > 0) {
+ ORDER BY Name ];//娌″埌璐�
+ if(reSet1.size()>0){
for (Integer i = 0; i < reSet1.size(); i++) {
- if (ErrorIdMap.containsKey(reSet1[i].Bar_Code__c)) {
+ if(ErrorIdMap.containsKey(reSet1[i].Bar_Code__c)){
// 璺宠繃宸茬粡澶勭悊鐨勬秷鑰楀搧鏄庣粏
continue;
- } else {
+ }else{
String str = '璇ュ晢鍝佸皻鏈叆搴�';
- ConsumableorderdetailsRecordserror.add(new ConsumableorderdetailsInfo(reSet1[i], str));
- ErrorIdMap.put(reSet1[i].Bar_Code__c, reSet1[i].Bar_Code__c);
+ ConsumableorderdetailsRecordserror.add(new ConsumableorderdetailsInfo(reSet1[i],str));
+ ErrorIdMap.put(reSet1[i].Bar_Code__c,reSet1[i].Bar_Code__c);
}
}
}
- reSet1 = [
- SELECT
- Id,
- Name,
- Consumable_Product__r.Name__c,
- ToDueDateDays__c,
- Consumable_Product__c,
- Consumable_Product__r.Name,
- Sterilization_limit__c,
- Deliver_date__c,
- Bar_Code__c,
- Lose_Flag__c,
- Box_Piece__c,
- Arrive_date__c,
- Send_Date__c,
- Consumable_order_minor__r.Name,
- Consumable_order_minor__c,
- recordtypeid,
- Consumable_order_minor__r.Arrive_Order__c,
- //add by rentx 2020-10-14 start
- ContractNo_text__c /*,ContractNo__c*/,
- // tcm start
- Consumable_order_minor__r.ContractNo__c,
- // tcm end
- Report_Product_Expiration__c
- //add by rentx 2020-10-14 end
- FROM Consumable_order_details2__c
- WHERE
- Dealer_Arrive__c = TRUE
- AND Dealer_Shipment__c = FALSE
- AND Dealer_Saled__c = FALSE
- AND Bar_Code__c IN :BarCodeListP
- AND Dealer_Returned__c = FALSE
- // WYIN-BLZE48鐩樼偣涓㈠け浜у搧澧炲姞鍏ュ簱鏂瑰紡 update by vivek 2020-03-05 start
- //AND Lose_Flag__c = FALSE
- // AND Lose_Flag__c = FALSE
- // WYIN-BLZE48鐩樼偣涓㈠け浜у搧澧炲姞鍏ュ簱鏂瑰紡 update by vivek 2020-03-05 start
- AND Dealer_Info_text__c = :accountName
- AND Arrive_Owner_Work_Location__c = :userWorkLocation
- // WYIN-BLZE48鐩樼偣涓㈠け浜у搧澧炲姞鍏ュ簱鏂瑰紡 update by vivek 2020-03-05 start
- // Gzw 20201215淇锛屾媶鐩掍骇鍝佷笉鍒ゆ柇
- AND Box_Piece__c = '鐩�'
- // WYIN-BLZE48鐩樼偣涓㈠け浜у搧澧炲姞鍏ュ簱鏂瑰紡 update by vivek 2020-03-05 end
- ORDER BY Name
- ]; //娌″嚭搴擄紝娌¢攢鍞紝灏辨槸鍦ㄥ簱
- if (reSet1.size() > 0) {
+ reSet1 = [SELECT Id, Name,Consumable_Product__r.Name__c,ToDueDateDays__c,
+ Consumable_Product__c,Consumable_Product__r.Name, Sterilization_limit__c,
+ Deliver_date__c,Bar_Code__c,Lose_Flag__c,Box_Piece__c,
+ Arrive_date__c,Send_Date__c,Consumable_order_minor__r.Name,Consumable_order_minor__c,
+ recordtypeid,Consumable_order_minor__r.Arrive_Order__c
+ //add by rentx 2020-10-14 start
+ ,ContractNo_text__c/*,ContractNo__c*/
+ // tcm start
+ ,Consumable_order_minor__r.ContractNo__c
+ // tcm end
+ , Report_Product_Expiration__c
+ //add by rentx 2020-10-14 end
+ FROM Consumable_order_details2__c
+ WHERE Dealer_Arrive__c = true
+ AND Dealer_Shipment__c= FALSE
+ AND Dealer_Saled__c = FALSE
+ AND Bar_Code__c in :BarCodeListP
+ AND Dealer_Returned__c = false
+ // WYIN-BLZE48鐩樼偣涓㈠け浜у搧澧炲姞鍏ュ簱鏂瑰紡 update by vivek 2020-03-05 start
+ //AND Lose_Flag__c = FALSE
+ // AND Lose_Flag__c = FALSE
+ // WYIN-BLZE48鐩樼偣涓㈠け浜у搧澧炲姞鍏ュ簱鏂瑰紡 update by vivek 2020-03-05 start
+ AND Dealer_Info_text__c = :accountName
+ AND Arrive_Owner_Work_Location__c =: userWorkLocation
+ // WYIN-BLZE48鐩樼偣涓㈠け浜у搧澧炲姞鍏ュ簱鏂瑰紡 update by vivek 2020-03-05 start
+ // Gzw 20201215淇锛屾媶鐩掍骇鍝佷笉鍒ゆ柇
+ AND Box_Piece__c = '鐩�'
+ // WYIN-BLZE48鐩樼偣涓㈠け浜у搧澧炲姞鍏ュ簱鏂瑰紡 update by vivek 2020-03-05 end
+ ORDER BY Name ];//娌″嚭搴擄紝娌¢攢鍞紝灏辨槸鍦ㄥ簱
+ if(reSet1.size()>0){
for (Integer i = 0; i < reSet1.size(); i++) {
- if (ErrorIdMap.containsKey(reSet1[i].Bar_Code__c)) {
+ if(ErrorIdMap.containsKey(reSet1[i].Bar_Code__c)){
// 璺宠繃宸茬粡澶勭悊鐨勬秷鑰楀搧鏄庣粏
continue;
- } else {
+ }else{
+
// WYIN-BLZE48鐩樼偣涓㈠け浜у搧澧炲姞鍏ュ簱鏂瑰紡 update by vivek 2020-03-05 start
// String str = '璇ュ晢鍝佸湪搴�';
// if (reSet1[i].Lose_Flag__c) {
// str = '璇ュ晢鍝佷涪澶�';
// }
String str = '';
- if (reSet1[i].Lose_Flag__c == false) {
- str = '璇ュ晢鍝佸湪搴�'; //娌″嚭搴� 锛屾病閿�鍞紝娌′涪澶卞氨鏄湪搴撱��
+ if(reSet1[i].Lose_Flag__c == false){
+ str = '璇ュ晢鍝佸湪搴�';//娌″嚭搴� 锛屾病閿�鍞紝娌′涪澶卞氨鏄湪搴撱��
}
- if (reSet1[i].Lose_Flag__c == true && reSet1[i].ToDueDateDays__c >= 0) {
- ApexPages.addmessage(
- new ApexPages.message(
- ApexPages.severity.WARNING,
- '浜у搧' + reSet1[i].Consumable_Product__r.Name + '瀛樺湪涓㈠け璁板綍'
- )
- ); //濡傛灉涓㈠け浜у搧灏辩粰鎻愮ず銆�
+ if(reSet1[i].Lose_Flag__c == true && reSet1[i].ToDueDateDays__c >= 0){
+ //LWC:Lwcflag鍜屾姤閿欐彁閱� update by Link 2023-04-27
+ if(isLwc){
+ warningList.add('浜у搧'+reSet1[i].Consumable_Product__r.Name+'瀛樺湪涓㈠け璁板綍');
+ }else {
+ ApexPages.addmessage(new ApexPages.message(ApexPages.severity.WARNING, '浜у搧'+reSet1[i].Consumable_Product__r.Name+'瀛樺湪涓㈠け璁板綍'));//濡傛灉涓㈠け浜у搧灏辩粰鎻愮ず銆�
+ }
}
if (reSet1[i].Lose_Flag__c == true && reSet1[i].ToDueDateDays__c < 0) {
str = '杩囨湡宸查攢瀛樹骇鍝侊紝涓嶅厑璁歌繑鍝�';
}
- if (str != '') {
- ConsumableorderdetailsRecordserror.add(new ConsumableorderdetailsInfo(reSet1[i], str));
- ErrorIdMap.put(reSet1[i].Bar_Code__c, reSet1[i].Bar_Code__c);
+ if(str != ''){
+ ConsumableorderdetailsRecordserror.add(new ConsumableorderdetailsInfo(reSet1[i],str));
+ ErrorIdMap.put(reSet1[i].Bar_Code__c,reSet1[i].Bar_Code__c);
}
// ConsumableorderdetailsRecordserror.add(new ConsumableorderdetailsInfo(reSet1[i],str));
// ErrorIdMap.put(reSet1[i].Bar_Code__c,reSet1[i].Bar_Code__c);
@@ -1195,82 +1066,96 @@
}
}
+
+
+
//鍒拌揣姝g‘淇℃伅
- reSet = [
- SELECT
- Id,
- Name,
- Intra_Trade_List_RMB__c,
- Asset_Model_No__c,
- Consumable_Product__c,
- Consumable_Product__r.Name,
- Consumable_Product__r.Name__c,
- Consumable_Product__r.Asset_Model_No__c,
- Sterilization_limit__c,
- Deliver_date__c,
- Bar_Code__c,
- Arrive_date__c,
- Send_Date__c,
- Box_Piece__c,
- Rrturn_count__c,
- Consumable_order_minor__r.Name,
- Consumable_order_minor__c,
- Dealer_Arrive__c,
- Guarantee_period_for_products__c,
- CFDA_Status__c,
- ProductPacking_list_manual__c,
- Report_Product_Approbation__c,
- Report_Product_Expiration__c,
- Consumable_Product__r.Pro2_Dealer_ENG__c,
- Consumable_Product__r.Pro2_Dealer_Object__c,
- TracingCode__c,
- Agencyinfo_fromSAP__c,
- Frist_Storage_Agency__c,
- Dealer_Info_text__c,
- //add by rentx 2020-10-14 start
- ContractNo_text__c /*,ContractNo__c*/,
- // tcm start
- Consumable_order_minor__r.ContractNo__c
- // tcm end
- //add by rentx 2020-10-14 end
- FROM Consumable_order_details2__c
- WHERE
- recordtypeid = :System.Label.RT_ConOrderDetail2_Delivery
- AND Cancellation_Date__c = NULL
- AND Dealer_Arrive__c = FALSE
- AND Product_Type__c LIKE :userPro_Typestr
- AND Bar_Code__c IN :BarCodeListP
- AND Dealer_Info_text__c = :accountName
- AND ((Consumable_order_minor__c != NULL
- AND Consumable_order_minor__r.Order_Owner_WorkLocal__c = :userWorkLocation)
- OR Consumable_order_minor__c = NULL)
- ORDER BY Name
- ];
+ reSet = [SELECT Id,
+ Name,
+ Intra_Trade_List_RMB__c,
+ Asset_Model_No__c,
+ Consumable_Product__c,
+ Consumable_Product__r.Name,
+ Consumable_Product__r.Name__c,
+ Consumable_Product__r.Asset_Model_No__c,
+ Sterilization_limit__c,
+ Deliver_date__c,
+ Bar_Code__c,
+ Arrive_date__c,
+ Send_Date__c,
+ Box_Piece__c,
+ Rrturn_count__c,
+ Consumable_order_minor__r.Name,
+ Consumable_order_minor__c,
+ Dealer_Arrive__c,
+ Guarantee_period_for_products__c,
+ CFDA_Status__c,
+ ProductPacking_list_manual__c,
+ Report_Product_Approbation__c,
+ Report_Product_Expiration__c,
+ Consumable_Product__r.Pro2_Dealer_ENG__c,
+ Consumable_Product__r.Pro2_Dealer_Object__c,
+ TracingCode__c,
+ Agencyinfo_fromSAP__c,
+ Frist_Storage_Agency__c,
+ Dealer_Info_text__c
+ //add by rentx 2020-10-14 start
+ ,ContractNo_text__c/*,ContractNo__c*/
+ // tcm start
+ ,Consumable_order_minor__r.ContractNo__c
+ // tcm end
+ //add by rentx 2020-10-14 end
+ FROM Consumable_order_details2__c
+ WHERE recordtypeid = :System.Label.RT_ConOrderDetail2_Delivery
+ AND Cancellation_Date__c = null
+ AND Dealer_Arrive__c = false
+ AND Product_Type__c like :userPro_Typestr
+ AND Bar_Code__c in :BarCodeListP
+ AND Dealer_Info_text__c = :accountName
+ AND ((Consumable_order_minor__c != null
+ AND Consumable_order_minor__r.Order_Owner_WorkLocal__c = :userWorkLocation)
+ OR Consumable_order_minor__c = null)
+ ORDER BY Name ];
- if (reSet.size() > 0) {
+ if(reSet.size()>0){
//ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR,'ErrorIdMap+++ '+ ErrorIdMap.keyset()));
- Map<String, String> errorMap = new Map<String, String>();
+ Map<String,String> errorMap = new Map<String,String>();
for (Integer i = 0; i < reSet.size(); i++) {
- if (ExistIdMap.containsKey(reSet[i].Bar_Code__c) || ErrorIdMap.containsKey(reSet[i].Bar_Code__c)) {
+
+ if(ExistIdMap.containsKey(reSet[i].Bar_Code__c) || ErrorIdMap.containsKey(reSet[i].Bar_Code__c)){
// 璺宠繃宸茬粡澶勭悊鐨勬秷鑰楀搧鏄庣粏
continue;
- } else {
+ }else{
Matcher n = Pattern.compile('[0-9]').matcher(reSet[i].TracingCode__c);
- if (n.find()) {
- String str = '绠$悊缂栫爜涓湁鏁板瓧锛岃涓庣鐞嗗憳纭鏄惁閿欒銆�';
- ConsumableorderdetailsRecordserror.add(new ConsumableorderdetailsInfo(reSet[i], str));
- ErrorIdMap.put(reSet[i].Bar_Code__c, reSet[i].Bar_Code__c);
+ if(n.find()){
+ // gzw DB202305352696 鍏ュ簱绠$悊缂栫爜楠岃瘉绋嬪簭璋冩暣 start
+ if (reSet[i].TracingCode__c.length() == 5) {
+ String tr = reSet[i].TracingCode__c;
+ String Ctr = tr.substring(tr.length() - 3,tr.length());
+ String Btr = tr.substring(tr.length() - 4,tr.length()-3);
+ String Atr = tr.substring(tr.length() - 5,tr.length()-4);
+ if (Pattern.compile('[0-9]').matcher(Atr).find() || Pattern.compile('[0-9]').matcher(Ctr).find()) {
+ String str = '绠$悊缂栫爜鏈夎锛岃妫�鏌ユ潯褰㈢爜鏁版嵁銆�';
+ ConsumableorderdetailsRecordserror.add(new ConsumableorderdetailsInfo(reSet[i],str));
+ ErrorIdMap.put(reSet[i].Bar_Code__c,reSet[i].Bar_Code__c);
continue;
}
- if (otherAgencyMap.containsKey(reSet[i].Bar_Code__c)) {
- for (Integer j = 0; j < consumableInventory.size(); j++) {
+ }
+ // String str = '绠$悊缂栫爜涓湁鏁板瓧锛岃涓庣鐞嗗憳纭鏄惁閿欒銆�';
+ // ConsumableorderdetailsRecordserror.add(new ConsumableorderdetailsInfo(reSet[i],str));
+ // ErrorIdMap.put(reSet[i].Bar_Code__c,reSet[i].Bar_Code__c);
+ // continue;
+ // gzw DB202305352696 鍏ュ簱绠$悊缂栫爜楠岃瘉绋嬪簭璋冩暣 end
+ }
+ if(otherAgencyMap.containsKey(reSet[i].Bar_Code__c)){
+ for (Integer j=0; j<consumableInventory.size(); j++) {
ConsumableorderdetailsInfo codInfo = consumableInventory.get(j);
if (codInfo.barCodeNo == reSet[i].Bar_Code__c) {
consumableInventory.remove(j);
break;
}
}
- for (Integer m = 0; m < consumableorderdetails2Insert.size(); m++) {
+ for (Integer m=0; m<consumableorderdetails2Insert.size(); m++) {
Consumable_order_details2__c cod2 = consumableorderdetails2Insert.get(m);
if (cod2.Bar_Code__c == reSet[i].Bar_Code__c) {
consumableorderdetails2Insert.remove(m);
@@ -1282,92 +1167,102 @@
//prodName.add(reSet[i].Consumable_Product__r.Name);
ConsumableorderdetailsRecordsdummy.add(new ConsumableorderdetailsInfo(reSet[i]));
ConsumableorderdetailsRecords.add(new ConsumableorderdetailsInfo(reSet[i]));
- ExistIdMap.put(reSet[i].Bar_Code__c, reSet[i].Bar_Code__c);
+ ExistIdMap.put(reSet[i].Bar_Code__c,reSet[i].Bar_Code__c);
}
}
}
//barcode涓嶄竴鑷达紝绠$悊缂栫爜涓�鑷�
- reSet = [
- SELECT
- Id,
- Name,
- Intra_Trade_List_RMB__c,
- Asset_Model_No__c,
- Consumable_Product__c,
- Consumable_Product__r.Name,
- Consumable_Product__r.Name__c,
- Consumable_Product__r.Asset_Model_No__c,
- Sterilization_limit__c,
- Deliver_date__c,
- Bar_Code__c,
- Arrive_date__c,
- Send_Date__c,
- Consumable_order_minor__r.Name,
- Consumable_order_minor__c,
- Dealer_Arrive__c,
- Guarantee_period_for_products__c,
- CFDA_Status__c,
- ProductPacking_list_manual__c,
- Report_Product_Approbation__c,
- Report_Product_Expiration__c,
- Box_Piece__c,
- Rrturn_count__c,
- TracingCode__c,
- Agencyinfo_fromSAP__c,
- Frist_Storage_Agency__c,
- //add by rentx 2020-10-14 start
- ContractNo_text__c /*,ContractNo__c */,
- // tcm start
- Consumable_order_minor__r.ContractNo__c
- // tcm end
- //add by rentx 2020-10-14 end
- FROM Consumable_order_details2__c
- WHERE
- recordtypeid = :System.Label.RT_ConOrderDetail2_Delivery
- AND Dealer_Info_text__c = :accountName
- //update by rentx 2021-01-04 start CHAN-BWX3XW
- // AND Consumable_order_minor__c != null
- // AND Consumable_order_minor__r.Order_Owner_WorkLocal__c = :userWorkLocation
- AND ((Consumable_order_minor__c != NULL
- AND Consumable_order_minor__r.Order_Owner_WorkLocal__c = :userWorkLocation)
- OR Consumable_order_minor__c = NULL)
- //update by rentx 2021-01-04 end CHAN-BWX3XW
- AND Dealer_Arrive__c = FALSE
- AND Cancellation_Date__c = NULL
- AND TracingCode__c IN :barMcodeMap.values()
- AND Bar_Code__c NOT IN :barMcodeMap.keySet()
- ORDER BY Name
- ];
+ reSet = [SELECT Id,
+ Name,
+ Intra_Trade_List_RMB__c,
+ Asset_Model_No__c,
+ Consumable_Product__c,
+ Consumable_Product__r.Name,
+ Consumable_Product__r.Name__c,
+ Consumable_Product__r.Asset_Model_No__c,
+ Sterilization_limit__c,
+ Deliver_date__c,
+ Bar_Code__c,
+ Arrive_date__c,
+ Send_Date__c,
+ Consumable_order_minor__r.Name,
+ Consumable_order_minor__c,
+ Dealer_Arrive__c,
+ Guarantee_period_for_products__c,
+ CFDA_Status__c,
+ ProductPacking_list_manual__c,
+ Report_Product_Approbation__c,
+ Report_Product_Expiration__c,
+ Box_Piece__c,
+ Rrturn_count__c,
+ TracingCode__c
+ ,Agencyinfo_fromSAP__c
+ ,Frist_Storage_Agency__c
+ //add by rentx 2020-10-14 start
+ ,ContractNo_text__c/*,ContractNo__c */
+ // tcm start
+ ,Consumable_order_minor__r.ContractNo__c
+ // tcm end
+ //add by rentx 2020-10-14 end
+ FROM Consumable_order_details2__c
+ WHERE recordtypeid = :System.Label.RT_ConOrderDetail2_Delivery
+ AND Dealer_Info_text__c = :accountName
+ //update by rentx 2021-01-04 start CHAN-BWX3XW
+ // AND Consumable_order_minor__c != null
+ // AND Consumable_order_minor__r.Order_Owner_WorkLocal__c = :userWorkLocation
+ AND ((Consumable_order_minor__c != null AND Consumable_order_minor__r.Order_Owner_WorkLocal__c = :userWorkLocation) OR Consumable_order_minor__c = null)
+ //update by rentx 2021-01-04 end CHAN-BWX3XW
+ AND Dealer_Arrive__c = false
+ AND Cancellation_Date__c = null
+ AND TracingCode__c in :barMcodeMap.values()
+ AND Bar_Code__c not in :barMcodeMap.keySet()
+ ORDER BY Name ];
- if (reSet.size() > 0) {
+ if(reSet.size()>0){
for (Integer i = 0; i < reSet.size(); i++) {
- if (ExistIdMap.containsKey(reSet[i].Bar_Code__c) || ErrorIdMap.containsKey(reSet[i].Bar_Code__c)) {
+ if(ExistIdMap.containsKey(reSet[i].Bar_Code__c) || ErrorIdMap.containsKey(reSet[i].Bar_Code__c)){
// 璺宠繃宸茬粡澶勭悊鐨勬秷鑰楀搧鏄庣粏
continue;
- } else {
+ }else{
Matcher n = Pattern.compile('[0-9]').matcher(reSet[i].TracingCode__c);
- if (n.find()) {
- String str = '绠$悊缂栫爜涓湁鏁板瓧锛岃涓庣鐞嗗憳纭鏄惁閿欒銆�';
- ConsumableorderdetailsRecordserror.add(new ConsumableorderdetailsInfo(reSet[i], str));
- ErrorIdMap.put(reSet[i].Bar_Code__c, reSet[i].Bar_Code__c);
+ if(n.find()){// gzw DB202305352696 鍏ュ簱绠$悊缂栫爜楠岃瘉绋嬪簭璋冩暣 start
+ if (reSet[i].TracingCode__c.length() == 5) {
+ String tr = reSet[i].TracingCode__c;
+ String Ctr = tr.substring(tr.length() - 3,tr.length());
+ String Btr = tr.substring(tr.length() - 4,tr.length()-3);
+ String Atr = tr.substring(tr.length() - 5,tr.length()-4);
+ if (Pattern.compile('[0-9]').matcher(Atr).find() || Pattern.compile('[0-9]').matcher(Ctr).find()) {
+ String str = '绠$悊缂栫爜鏈夎锛岃妫�鏌ユ潯褰㈢爜鏁版嵁銆�';
+ ConsumableorderdetailsRecordserror.add(new ConsumableorderdetailsInfo(reSet[i],str));
+ ErrorIdMap.put(reSet[i].Bar_Code__c,reSet[i].Bar_Code__c);
continue;
}
- ExistIdMap.put(reSet[i].Bar_Code__c, reSet[i].Bar_Code__c);
- for (String str : barMcodeMap.keySet()) {
- // BarCode涓嶄竴鑷存椂鐨勮鍛婁俊鎭�
- if (reSet[i].Bar_Code__c != str && reSet[i].TracingCode__c == barMcodeMap.get(str)) {
- // 20220815 ljh SWAG-CH65B7 start
- // ApexPages.addmessage(new ApexPages.message(ApexPages.severity.WARNING,'姝ょ鐞嗙紪鐮佷笌瀹為檯鍙戣揣BarCode涓嶄竴鑷达紝璇锋牳瀵圭鐞嗙紪鐮�('+ str +')鐨勫叆搴撳強搴撳瓨鏁版嵁銆�'));
- ApexPages.addmessage(
- new ApexPages.message(ApexPages.severity.WARNING, '鏉″舰鐮佷负(' + str + ')鐨勫叆搴撴暟鎹笌鍙戣揣鏁版嵁涓嶄竴鑷�')
- );
- // 20220815 ljh SWAG-CH65B7 end
}
- if (barMcodeMap.get(str) == reSet[i].TracingCode__c) {
+ // String str = '绠$悊缂栫爜涓湁鏁板瓧锛岃涓庣鐞嗗憳纭鏄惁閿欒銆�';
+ // ConsumableorderdetailsRecordserror.add(new ConsumableorderdetailsInfo(reSet[i],str));
+ // ErrorIdMap.put(reSet[i].Bar_Code__c,reSet[i].Bar_Code__c);
+ // continue;
+ // gzw DB202305352696 鍏ュ簱绠$悊缂栫爜楠岃瘉绋嬪簭璋冩暣 end
+ }
+ ExistIdMap.put(reSet[i].Bar_Code__c,reSet[i].Bar_Code__c);
+ for(String str : barMcodeMap.keySet()){
+ // BarCode涓嶄竴鑷存椂鐨勮鍛婁俊鎭�
+ if(reSet[i].Bar_Code__c != str && reSet[i].TracingCode__c == barMcodeMap.get(str)){
+ //LWC:Lwcflag鍜屾姤閿欐彁閱� update by Link 2023-04-27
+ if(isLwc){
+ warningList.add('鏉″舰鐮佷负('+ str +')鐨勫叆搴撴暟鎹笌鍙戣揣鏁版嵁涓嶄竴鑷�');
+ }else {
+ // 20220815 ljh SWAG-CH65B7 start
+ // ApexPages.addmessage(new ApexPages.message(ApexPages.severity.WARNING,'姝ょ鐞嗙紪鐮佷笌瀹為檯鍙戣揣BarCode涓嶄竴鑷达紝璇锋牳瀵圭鐞嗙紪鐮�('+ str +')鐨勫叆搴撳強搴撳瓨鏁版嵁銆�'));
+ ApexPages.addmessage(new ApexPages.message(ApexPages.severity.WARNING,'鏉″舰鐮佷负('+ str +')鐨勫叆搴撴暟鎹笌鍙戣揣鏁版嵁涓嶄竴鑷�'));
+ // 20220815 ljh SWAG-CH65B7 end
+ }
+ }
+ if(barMcodeMap.get(str) == reSet[i].TracingCode__c){
reSet[i].Bar_Code__c = str;
//=====================================
// ApexPages.addmessage(new ApexPages.message(ApexPages.severity.WARNING,'鍏ュ簱BarCode('+ str +')鍜屽簱瀛樻潯鐮佷笉涓�鑷淬��'));
- ExistIdMap.put(str, str);
+ ExistIdMap.put(str,str);
}
}
ConsumableorderdetailsRecordsdummy.add(new ConsumableorderdetailsInfo(reSet[i]));
@@ -1376,488 +1271,407 @@
}
}
+
// CHAN-BD43NK 鍏抽棴鐩存帴杩斿搧鍔熻兘 杩藉姞 barcode涓嶄竴鑷村垽鏂�
- reSet1 = [
- SELECT Id, Name, TracingCode__c, Bar_Code__c, Sale_orderName__c, Report_Product_Expiration__c
- FROM Consumable_order_details2__c
- WHERE
- Dealer_Arrive__c = TRUE
- AND (Dealer_Shipment__c = TRUE
- OR Dealer_Saled__c = TRUE)
- AND TracingCode__c IN :barMcodeMap.values()
- AND Bar_Code__c NOT IN :barMcodeMap.keySet()
- AND Dealer_Info_text__c = :accountName
- AND Arrive_Owner_Work_Location__c = :userWorkLocation
- ORDER BY Name
- ];
- if (reSet1.size() > 0) {
+ reSet1 = [SELECT Id,Name,TracingCode__c,Bar_Code__c,Sale_orderName__c,Report_Product_Expiration__c
+ FROM Consumable_order_details2__c
+ WHERE Dealer_Arrive__c = true
+ AND (Dealer_Shipment__c = true
+ OR Dealer_Saled__c = true)
+ AND TracingCode__c in :barMcodeMap.values()
+ AND Bar_Code__c not in :barMcodeMap.keySet()
+ AND Dealer_Info_text__c = :accountName
+ AND Arrive_Owner_Work_Location__c =: userWorkLocation
+ ORDER BY Name ];
+ if(reSet1.size()>0){
for (Integer i = 0; i < reSet1.size(); i++) {
- if (ErrorIdMap.containsKey(reSet1[i].Bar_Code__c)) {
+ if(ErrorIdMap.containsKey(reSet1[i].Bar_Code__c)){
// 璺宠繃宸茬粡澶勭悊鐨勬秷鑰楀搧鏄庣粏
continue;
- } else {
- for (String str : barMcodeMap.keySet()) {
- if (barMcodeMap.get(str) == reSet1[i].TracingCode__c) {
- ApexPages.addmessage(
- new ApexPages.message(
- ApexPages.severity.ERROR,
- 'barcode' +
- str +
- '涓庡嚭搴撳崟' +
- reSet1[i].Sale_orderName__c +
- ' 涓殑绠$悊缂栫爜涓�鑷达紝浣咮arcode涓嶅悓锛岃纭鍏蜂綋鏁版嵁銆�'
- )
- );
- ErrorIdMap.put(str, str);
- ErrorIdMap.put(reSet1[i].Bar_Code__c, reSet1[i].Bar_Code__c);
+ }else{
+ for(String str : barMcodeMap.keySet()){
+ if(barMcodeMap.get(str) == reSet1[i].TracingCode__c){
+ //LWC:Lwcflag鍜屾姤閿欐彁閱� update by Link 2023-04-27
+ if(isLwc){
+ errorList.add('barcode' +str + '涓庡嚭搴撳崟' + reSet1[i].Sale_orderName__c + ' 涓殑绠$悊缂栫爜涓�鑷达紝浣咮arcode涓嶅悓锛岃纭鍏蜂綋鏁版嵁銆�');
+ }else {
+ ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR, 'barcode' +str + '涓庡嚭搴撳崟' + reSet1[i].Sale_orderName__c + ' 涓殑绠$悊缂栫爜涓�鑷达紝浣咮arcode涓嶅悓锛岃纭鍏蜂綋鏁版嵁銆�'));
+ }
+ ErrorIdMap.put(str,str);
+ ErrorIdMap.put(reSet1[i].Bar_Code__c,reSet1[i].Bar_Code__c);
}
}
}
}
}
- integer RGcnt = GoodsReturnCheck();
+ integer RGcnt = GoodsReturnCheck();
AllMap.putAll(ErrorIdMap);
AllMap.putAll(ExistIdMap);
- if (RGcnt > 0) {
- for (String str : GrList) {
- AllMap.put(str, str);
+ if(RGcnt>0){
+ for(String str:GrList){
+ AllMap.put(str,str);
}
}
//寰楀埌涓嶅瓨鍦ㄧ殑BarCode
//return;
- for (Integer i = 0; i < BarCodeListP.size(); i++) {
- if (AllMap.containsKey(BarCodeListP[i])) {
+ for(Integer i = 0; i < BarCodeListP.size(); i++){
+ if(AllMap.containsKey(BarCodeListP[i])){
continue;
- } else if (otherAgencyMap.containsKey(BarCodeListP[i])) {
+ }else if(otherAgencyMap.containsKey(BarCodeListP[i])){
continue;
}
//add by rentx 2021-01-27 start
- else if (coc != null && coc.orderPattern__c == 'hospitalorder') {
+ else if (coc!= null && coc.orderPattern__c == 'hospitalorder') {
HosErrorList.add(BarCodeListP[i]);
continue;
}
//add by rentx 2021-01-27 end
- else {
+ else{
notInlist.add(BarCodeListP[i]);
- otherAgencyMap.put(BarCodeListP[i], BarCodeListP[i]);
+ otherAgencyMap.put(BarCodeListP[i],BarCodeListP[i]);
}
}
// CHAN-BD43NK 鍏抽棴鐩存帴杩斿搧鍔熻兘
- if (notInlist.size() > 0) {
- if (ArrType != 'ReG') {
+ if(notInlist.size()>0){
+ if(ArrType!='ReG'){
inventoryEntryNoESetId(notInlist);
- if (notInStorelist.size() > 0) {
- ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR, 'BarCode鍙�' + notInStorelist + '涓嶅瓨鍦ㄣ��'));
+ if(notInStorelist.size() > 0){
+ //LWC:Lwcflag鍜屾姤閿欐彁閱� update by Link 2023-04-27
+ if(isLwc){
+ returnError = 'BarCode鍙�'+ notInStorelist + '涓嶅瓨鍦�';
+ }else {
+ ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR,'BarCode鍙�'+ notInStorelist + '涓嶅瓨鍦ㄣ��'));
+ }
return;
}
- } else {
- ApexPages.addmessage(
- new ApexPages.message(
- ApexPages.severity.ERROR,
- 'BarCode鍙�' + notInlist + '涓嶅瓨鍦紝鏃犲搴旂殑鍑哄簱鍗曪紝璇峰厛鎿嶄綔浜у搧鍏ュ簱銆�'
- )
- );
+ }else{
+ //LWC:Lwcflag鍜屾姤閿欐彁閱� update by Link 2023-04-27
+ if(isLwc){
+ returnError = 'BarCode鍙�'+ notInlist + '涓嶅瓨鍦紝鏃犲搴旂殑鍑哄簱鍗曪紝璇峰厛鎿嶄綔浜у搧鍏ュ簱';
+ }else {
+ ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR,'BarCode鍙�'+ notInlist + '涓嶅瓨鍦紝鏃犲搴旂殑鍑哄簱鍗曪紝璇峰厛鎿嶄綔浜у搧鍏ュ簱銆�'));
+ }
return;
}
}
- //add by rentx 2021-01-27 start
- if (HosErrorList.size() > 0) {
- for (String str : HosErrorList) {
- ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR, 'BarCode鍙�:' + str + HosErrorMap.get(str) + ''));
+ //add by rentx 2021-01-27 start
+ if (HosErrorList.size() > 0) {
+ for (String str : HosErrorList) {
+ //LWC:Lwcflag鍜屾姤閿欐彁閱� update by Link 2023-04-27
+ if(isLwc){
+ errorList.add('BarCode鍙�:' + str + HosErrorMap.get(str)+'');
+ }else {
+ ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR,'BarCode鍙�:' + str + HosErrorMap.get(str)+''));
}
}
- //add by rentx 2021-01-27 end
- } else {
- //宸插彇娑堜骇鍝�
- reSet1 = [
- SELECT
- Id,
- Name,
- Consumable_Product__r.Name__c,
- Consumable_Product__c,
- Consumable_Product__r.Name,
- Sterilization_limit__c,
- Deliver_date__c,
- Bar_Code__c,
- Box_Piece__c,
- Arrive_date__c,
- Send_Date__c,
- Consumable_order_minor__r.Name,
- Consumable_order_minor__c,
- recordtypeid,
- Consumable_order_minor__r.Arrive_Order__c,
- Report_Product_Expiration__c
- FROM Consumable_order_details2__c
- WHERE
- Dealer_Arrive__c = FALSE
- AND Dealer_Shipment__c = FALSE
- AND Dealer_Saled__c = FALSE
- AND Dealer_Returned__c = FALSE
- AND Cancellation_Date__c != NULL
- AND Bar_Code__c IN :BarCodeListP
- AND Dealer_Info_text__c = :accountName
- ORDER BY Name
- ]; //娌″埌璐�
- if (reSet1.size() > 0) {
- for (Integer i = 0; i < reSet1.size(); i++) {
- if (ErrorIdMap.containsKey(reSet1[i].Bar_Code__c)) {
- // 璺宠繃宸茬粡澶勭悊鐨勬秷鑰楀搧鏄庣粏
- continue;
- } else {
- String str = '璇ュ晢鍝佸彇娑�';
- ConsumableorderdetailsRecordserror.add(new ConsumableorderdetailsInfo(reSet1[i], str));
- ErrorIdMap.put(reSet1[i].Bar_Code__c, reSet1[i].Bar_Code__c);
- }
- }
- }
- //宸茬粡閿�鍞�
- reSet1 = [
- SELECT
- Id,
- Name,
- Consumable_Product__r.Name__c,
- Consumable_Product__c,
- Consumable_Product__r.Name,
- Sterilization_limit__c,
- Deliver_date__c,
- Bar_Code__c,
- Box_Piece__c,
- Arrive_date__c,
- Send_Date__c,
- Consumable_order_minor__r.Name,
- Consumable_order_minor__c,
- recordtypeid,
- Consumable_order_minor__r.Arrive_Order__c,
- Report_Product_Expiration__c
- FROM Consumable_order_details2__c
- WHERE
- Dealer_Saled__c = TRUE
- AND Dealer_Returned__c = FALSE
- AND Dealer_Info_text__c = :accountName
- AND Bar_Code__c IN :BarCodeListP
- AND Arrive_Owner_Work_Location__c = :userWorkLocation
- ORDER BY Name
- ];
- if (reSet1.size() > 0) {
- for (Integer i = 0; i < reSet1.size(); i++) {
- if (ErrorIdMap.containsKey(reSet1[i].Bar_Code__c)) {
- // 璺宠繃宸茬粡澶勭悊鐨勬秷鑰楀搧鏄庣粏
- continue;
- } else {
- String str = '璇ュ晢鍝佸凡缁忛攢鍞�';
- ConsumableorderdetailsRecordserror.add(new ConsumableorderdetailsInfo(reSet1[i], str));
- ErrorIdMap.put(reSet1[i].Bar_Code__c, reSet1[i].Bar_Code__c);
- }
- }
- }
- //宸茬粡鍑哄簱浜у搧
- reSet1 = [
- SELECT
- Id,
- Name,
- Consumable_Product__r.Name__c,
- Consumable_Product__c,
- Consumable_Product__r.Name,
- Sterilization_limit__c,
- Deliver_date__c,
- Bar_Code__c,
- Box_Piece__c,
- Arrive_date__c,
- Send_Date__c,
- Consumable_order_minor__r.Name,
- Consumable_order_minor__c,
- recordtypeid,
- Consumable_order_minor__r.Arrive_Order__c,
- Report_Product_Expiration__c
- FROM Consumable_order_details2__c
- WHERE
- Dealer_Shipment__c = TRUE
- AND Dealer_Returned__c = FALSE
- AND Dealer_Info_text__c = :accountName
- AND Arrive_Owner_Work_Location__c = :userWorkLocation
- AND Bar_Code__c IN :BarCodeListP
- ORDER BY Name
- ];
- if (reSet1.size() > 0) {
- for (Integer i = 0; i < reSet1.size(); i++) {
- if (ErrorIdMap.containsKey(reSet1[i].Bar_Code__c)) {
- // 璺宠繃宸茬粡澶勭悊鐨勬秷鑰楀搧鏄庣粏
- continue;
- } else {
- String str = '璇ュ晢鍝佸凡缁忓嚭搴�';
- ConsumableorderdetailsRecordserror.add(new ConsumableorderdetailsInfo(reSet1[i], str));
- ErrorIdMap.put(reSet1[i].Bar_Code__c, reSet1[i].Bar_Code__c);
- }
- }
- }
- //宸茬粡鍒拌揣浜у搧
- reSet1 = [
- SELECT
- Id,
- Name,
- Consumable_Product__r.Name__c,
- Consumable_Product__c,
- Consumable_Product__r.Name,
- Sterilization_limit__c,
- Deliver_date__c,
- Bar_Code__c,
- Lose_Flag__c,
- Box_Piece__c,
- Arrive_date__c,
- Send_Date__c,
- Consumable_order_minor__r.Name,
- Consumable_order_minor__c,
- recordtypeid,
- Consumable_order_minor__r.Arrive_Order__c,
- Report_Product_Expiration__c
- FROM Consumable_order_details2__c
- WHERE
- Dealer_Arrive__c = TRUE
- AND Dealer_Returned__c = FALSE
- AND Bar_Code__c IN :BarCodeListP
- AND Dealer_Info_text__c = :accountName
- AND Arrive_Owner_Work_Location__c = :userWorkLocation
- ORDER BY Name
- ];
- if (reSet1.size() > 0) {
- for (Integer i = 0; i < reSet1.size(); i++) {
- if (ErrorIdMap.containsKey(reSet1[i].Bar_Code__c)) {
- // 璺宠繃宸茬粡澶勭悊鐨勬秷鑰楀搧鏄庣粏
- continue;
- } else {
- String str = '璇ュ晢鍝佸凡缁忓埌璐�';
- if (reSet1[i].Lose_Flag__c == true) {
- str = '璇ュ晢鍝佸凡缁忎涪澶�';
+ }
+ //add by rentx 2021-01-27 end
+
+ }else{
+ //宸插彇娑堜骇鍝�
+ reSet1 = [SELECT Id, Name,Consumable_Product__r.Name__c,
+ Consumable_Product__c,Consumable_Product__r.Name, Sterilization_limit__c,
+ Deliver_date__c,Bar_Code__c,Box_Piece__c,
+ Arrive_date__c,Send_Date__c,Consumable_order_minor__r.Name,Consumable_order_minor__c,
+ recordtypeid,Consumable_order_minor__r.Arrive_Order__c,Report_Product_Expiration__c
+ FROM Consumable_order_details2__c
+ WHERE Dealer_Arrive__c = FALSE
+ AND Dealer_Shipment__c= FALSE
+ AND Dealer_Saled__c = FALSE
+ AND Dealer_Returned__c = false
+ AND Cancellation_Date__c != null
+ AND Bar_Code__c in :BarCodeListP
+ AND Dealer_Info_text__c = :accountName
+ ORDER BY Name ];//娌″埌璐�
+ if(reSet1.size()>0){
+ for (Integer i = 0; i < reSet1.size(); i++) {
+ if(ErrorIdMap.containsKey(reSet1[i].Bar_Code__c)){
+ // 璺宠繃宸茬粡澶勭悊鐨勬秷鑰楀搧鏄庣粏
+ continue;
+ }else{
+ String str = '璇ュ晢鍝佸彇娑�';
+ ConsumableorderdetailsRecordserror.add(new ConsumableorderdetailsInfo(reSet1[i],str));
+ ErrorIdMap.put(reSet1[i].Bar_Code__c,reSet1[i].Bar_Code__c);
}
- ConsumableorderdetailsRecordserror.add(new ConsumableorderdetailsInfo(reSet1[i], str));
- ErrorIdMap.put(reSet1[i].Bar_Code__c, reSet1[i].Bar_Code__c);
}
}
- }
- //涓嶅睘浜庢湰璁㈠崟
- reSet1 = [
- SELECT
- Id,
- Name,
- Consumable_Product__r.Name__c,
- Consumable_Product__c,
- Consumable_Product__r.Name,
- Sterilization_limit__c,
- Deliver_date__c,
- Bar_Code__c,
- Box_Piece__c,
- Arrive_date__c,
- Send_Date__c,
- Consumable_order_minor__r.Name,
- Consumable_order_minor__c,
- recordtypeid,
- Consumable_order_minor__r.Arrive_Order__c,
- Report_Product_Expiration__c
- FROM Consumable_order_details2__c
- WHERE Consumable_order_minor__c != :ESetId AND Bar_Code__c IN :BarCodeListP
- //AND Dealer_Info_text__c = :accountName
- ORDER BY Name
- ];
- if (reSet1.size() > 0) {
- for (Integer i = 0; i < reSet1.size(); i++) {
- if (ErrorIdMap.containsKey(reSet1[i].Bar_Code__c)) {
- // 璺宠繃宸茬粡澶勭悊鐨勬秷鑰楀搧鏄庣粏
- continue;
- } else {
- String str = '璇ユ秷鑰楀搧涓嶅睘浜庢湰璁㈠崟';
- ConsumableorderdetailsRecordserror.add(new ConsumableorderdetailsInfo(reSet1[i], str));
- ErrorIdMap.put(reSet1[i].Bar_Code__c, reSet1[i].Bar_Code__c);
+ //宸茬粡閿�鍞�
+ reSet1 = [SELECT Id, Name,Consumable_Product__r.Name__c,
+ Consumable_Product__c,Consumable_Product__r.Name, Sterilization_limit__c,
+ Deliver_date__c,Bar_Code__c,Box_Piece__c,
+ Arrive_date__c,Send_Date__c,Consumable_order_minor__r.Name,Consumable_order_minor__c,
+ recordtypeid,Consumable_order_minor__r.Arrive_Order__c,Report_Product_Expiration__c
+ FROM Consumable_order_details2__c
+ WHERE Dealer_Saled__c = true
+ AND Dealer_Returned__c =false
+ AND Dealer_Info_text__c = :accountName
+ AND Bar_Code__c in :BarCodeListP
+ AND Arrive_Owner_Work_Location__c =: userWorkLocation
+ ORDER BY Name ];
+ if(reSet1.size()>0){
+ for (Integer i = 0; i < reSet1.size(); i++) {
+ if(ErrorIdMap.containsKey(reSet1[i].Bar_Code__c)){
+ // 璺宠繃宸茬粡澶勭悊鐨勬秷鑰楀搧鏄庣粏
+ continue;
+ }else{
+ String str = '璇ュ晢鍝佸凡缁忛攢鍞�';
+ ConsumableorderdetailsRecordserror.add(new ConsumableorderdetailsInfo(reSet1[i],str));
+ ErrorIdMap.put(reSet1[i].Bar_Code__c,reSet1[i].Bar_Code__c);
+ }
}
}
- }
+ //宸茬粡鍑哄簱浜у搧
+ reSet1 = [SELECT Id, Name,Consumable_Product__r.Name__c,
+ Consumable_Product__c,Consumable_Product__r.Name, Sterilization_limit__c,
+ Deliver_date__c,Bar_Code__c,Box_Piece__c,
+ Arrive_date__c,Send_Date__c,Consumable_order_minor__r.Name,Consumable_order_minor__c,
+ recordtypeid,Consumable_order_minor__r.Arrive_Order__c,Report_Product_Expiration__c
+ FROM Consumable_order_details2__c
+ WHERE Dealer_Shipment__c = true
+ AND Dealer_Returned__c =false
+ AND Dealer_Info_text__c = :accountName
+ AND Arrive_Owner_Work_Location__c =: userWorkLocation
+ AND Bar_Code__c in :BarCodeListP
+ ORDER BY Name ];
+ if(reSet1.size()>0){
+ for (Integer i = 0; i < reSet1.size(); i++) {
+ if(ErrorIdMap.containsKey(reSet1[i].Bar_Code__c)){
+ // 璺宠繃宸茬粡澶勭悊鐨勬秷鑰楀搧鏄庣粏
+ continue;
+ }else{
+ String str = '璇ュ晢鍝佸凡缁忓嚭搴�';
+ ConsumableorderdetailsRecordserror.add(new ConsumableorderdetailsInfo(reSet1[i],str));
+ ErrorIdMap.put(reSet1[i].Bar_Code__c,reSet1[i].Bar_Code__c);
+ }
+ }
+ }
+ //宸茬粡鍒拌揣浜у搧
+ reSet1 = [SELECT Id, Name,Consumable_Product__r.Name__c,
+ Consumable_Product__c,Consumable_Product__r.Name, Sterilization_limit__c,
+ Deliver_date__c,Bar_Code__c,Lose_Flag__c,Box_Piece__c,
+ Arrive_date__c,Send_Date__c,Consumable_order_minor__r.Name,Consumable_order_minor__c,
+ recordtypeid,Consumable_order_minor__r.Arrive_Order__c,Report_Product_Expiration__c
+ FROM Consumable_order_details2__c
+ WHERE Dealer_Arrive__c = true
+ AND Dealer_Returned__c =false
+ AND Bar_Code__c in :BarCodeListP
+ AND Dealer_Info_text__c = :accountName
+ AND Arrive_Owner_Work_Location__c =: userWorkLocation
+ ORDER BY Name ];
+ if(reSet1.size()>0){
+ for (Integer i = 0; i < reSet1.size(); i++) {
+ if(ErrorIdMap.containsKey(reSet1[i].Bar_Code__c)){
+ // 璺宠繃宸茬粡澶勭悊鐨勬秷鑰楀搧鏄庣粏
+ continue;
+ }else{
+ String str = '璇ュ晢鍝佸凡缁忓埌璐�';
+ if (reSet1[i].Lose_Flag__c == TRUE) {
+ str = '璇ュ晢鍝佸凡缁忎涪澶�';
+ }
+ ConsumableorderdetailsRecordserror.add(new ConsumableorderdetailsInfo(reSet1[i],str));
+ ErrorIdMap.put(reSet1[i].Bar_Code__c,reSet1[i].Bar_Code__c);
+ }
+ }
+ }
+ //涓嶅睘浜庢湰璁㈠崟
+ reSet1 = [SELECT Id, Name,Consumable_Product__r.Name__c,
+ Consumable_Product__c,Consumable_Product__r.Name, Sterilization_limit__c,
+ Deliver_date__c,Bar_Code__c,Box_Piece__c,
+ Arrive_date__c,Send_Date__c,Consumable_order_minor__r.Name,Consumable_order_minor__c,
+ recordtypeid,Consumable_order_minor__r.Arrive_Order__c,Report_Product_Expiration__c
+ FROM Consumable_order_details2__c
+ WHERE Consumable_order_minor__c != :ESetId
+ AND Bar_Code__c in :BarCodeListP
+ //AND Dealer_Info_text__c = :accountName
+ ORDER BY Name ];
+ if(reSet1.size()>0){
+ for (Integer i = 0; i < reSet1.size(); i++) {
+ if(ErrorIdMap.containsKey(reSet1[i].Bar_Code__c)){
+ // 璺宠繃宸茬粡澶勭悊鐨勬秷鑰楀搧鏄庣粏
+ continue;
+ }else{
+ String str = '璇ユ秷鑰楀搧涓嶅睘浜庢湰璁㈠崟';
+ ConsumableorderdetailsRecordserror.add(new ConsumableorderdetailsInfo(reSet1[i],str));
+ ErrorIdMap.put(reSet1[i].Bar_Code__c,reSet1[i].Bar_Code__c);
+ }
+ }
+ }
//鍒拌揣浣嗕骇鍝佺被鍨嬩笌鐢ㄦ埛鐨勭被鍨嬩笉绗�
- reSet1 = [
- SELECT
- Id,
- Name,
- Intra_Trade_List_RMB__c,
- Asset_Model_No__c,
- Consumable_Product__c,
- Consumable_Product__r.Name,
- Consumable_Product__r.Name__c,
- Consumable_Product__r.Asset_Model_No__c,
- Sterilization_limit__c,
- Deliver_date__c,
- Bar_Code__c,
- Arrive_date__c,
- Send_Date__c,
- Consumable_order_minor__r.Name,
- Consumable_order_minor__c,
- Dealer_Arrive__c,
- Guarantee_period_for_products__c,
- CFDA_Status__c,
- ProductPacking_list_manual__c,
- Report_Product_Approbation__c,
- Report_Product_Expiration__c,
- Box_Piece__c,
- Rrturn_count__c,
- Product_Type__c,
- ContractNo_text__c /*,ContractNo__c*/,
- // tcm start
- Consumable_order_minor__r.ContractNo__c
- // tcm end
- FROM Consumable_order_details2__c
- WHERE
- recordtypeid = :System.Label.RT_ConOrderDetail2_Delivery
- AND Dealer_Info_text__c = :accountName
- AND (NOT Product_Type__c LIKE :userPro_Typestr)
- AND Consumable_order_minor__c = :ESetId
- AND Consumable_order_minor__r.Order_Owner_WorkLocal__c = :userWorkLocation
- AND Dealer_Arrive__c = FALSE
- AND Cancellation_Date__c = NULL
- AND Bar_Code__c IN :BarCodeListP
- ORDER BY Name
- ];
- if (reSet1.size() > 0) {
- for (Integer i = 0; i < reSet1.size(); i++) {
- if (ErrorIdMap.containsKey(reSet1[i].Bar_Code__c)) {
- // 璺宠繃宸茬粡澶勭悊鐨勬秷鑰楀搧鏄庣粏
- continue;
- } else {
- String str = '浜у搧绫诲瀷[' + reSet1[i].Product_Type__c + ']涓庣敤鎴风殑绫诲瀷[' + userPro_Type + ']涓嶇';
- ConsumableorderdetailsRecordserror.add(new ConsumableorderdetailsInfo(reSet1[i], str));
- ErrorIdMap.put(reSet1[i].Bar_Code__c, reSet1[i].Bar_Code__c);
+ reSet1 = [SELECT Id,Name,Intra_Trade_List_RMB__c,Asset_Model_No__c,
+ Consumable_Product__c,Consumable_Product__r.Name,
+ Consumable_Product__r.Name__c,Consumable_Product__r.Asset_Model_No__c,
+ Sterilization_limit__c,Deliver_date__c,Bar_Code__c,
+ Arrive_date__c,Send_Date__c,Consumable_order_minor__r.Name,
+ Consumable_order_minor__c,Dealer_Arrive__c,
+ Guarantee_period_for_products__c,CFDA_Status__c,
+ ProductPacking_list_manual__c,Report_Product_Approbation__c,
+ Report_Product_Expiration__c,Box_Piece__c, Rrturn_count__c,
+ Product_Type__c
+ ,ContractNo_text__c/*,ContractNo__c*/
+ // tcm start
+ ,Consumable_order_minor__r.ContractNo__c
+ // tcm end
+ FROM Consumable_order_details2__c
+ WHERE recordtypeid = :System.Label.RT_ConOrderDetail2_Delivery
+ AND Dealer_Info_text__c = :accountName
+ AND ( not Product_Type__c like :userPro_Typestr)
+ AND Consumable_order_minor__c = :ESetId
+ AND Consumable_order_minor__r.Order_Owner_WorkLocal__c = :userWorkLocation
+ AND Dealer_Arrive__c = false
+ AND Cancellation_Date__c = null
+ AND Bar_Code__c in :BarCodeListP
+ ORDER BY Name ];
+ if(reSet1.size()>0){
+ for (Integer i = 0; i < reSet1.size(); i++) {
+ if(ErrorIdMap.containsKey(reSet1[i].Bar_Code__c)){
+ // 璺宠繃宸茬粡澶勭悊鐨勬秷鑰楀搧鏄庣粏
+ continue;
+ }else{
+ String str = '浜у搧绫诲瀷['+reSet1[i].Product_Type__c+']涓庣敤鎴风殑绫诲瀷['+userPro_Type+']涓嶇';
+ ConsumableorderdetailsRecordserror.add(new ConsumableorderdetailsInfo(reSet1[i],str));
+ ErrorIdMap.put(reSet1[i].Bar_Code__c,reSet1[i].Bar_Code__c);
+ }
}
}
- }
//鍒拌揣姝g‘淇℃伅
- reSet = [
- SELECT
- Id,
- Name,
- Intra_Trade_List_RMB__c,
- Asset_Model_No__c,
- Consumable_Product__c,
- Consumable_Product__r.Name,
- Consumable_Product__r.Name__c,
- Consumable_Product__r.Asset_Model_No__c,
- Sterilization_limit__c,
- Deliver_date__c,
- Bar_Code__c,
- Arrive_date__c,
- Send_Date__c,
- Consumable_order_minor__r.Name,
- Consumable_order_minor__c,
- Dealer_Arrive__c,
- Guarantee_period_for_products__c,
- CFDA_Status__c,
- ProductPacking_list_manual__c,
- Report_Product_Approbation__c,
- Report_Product_Expiration__c,
- Box_Piece__c,
- Rrturn_count__c,
- TracingCode__c,
- Agencyinfo_fromSAP__c,
- Frist_Storage_Agency__c,
- Dealer_Info_text__c,
- ContractNo_text__c /*,ContractNo__c*/,
- // tcm start
- Consumable_order_minor__r.ContractNo__c
- // tcm end
- FROM Consumable_order_details2__c
- WHERE
- recordtypeid = :System.Label.RT_ConOrderDetail2_Delivery
- AND Dealer_Info_text__c = :accountName
- AND Product_Type__c LIKE :userPro_Typestr
- AND Consumable_order_minor__c = :ESetId
- AND Consumable_order_minor__r.Order_Owner_WorkLocal__c = :userWorkLocation
- AND Dealer_Arrive__c = FALSE
- AND Cancellation_Date__c = NULL
- AND Bar_Code__c IN :BarCodeListP
- ORDER BY Name
- ];
- if (reSet.size() > 0) {
- Map<String, String> errorMap = new Map<String, String>();
+ reSet = [SELECT Id,Name,Intra_Trade_List_RMB__c,Asset_Model_No__c,
+ Consumable_Product__c,Consumable_Product__r.Name,
+ Consumable_Product__r.Name__c,Consumable_Product__r.Asset_Model_No__c,
+ Sterilization_limit__c,Deliver_date__c,Bar_Code__c,
+ Arrive_date__c,Send_Date__c,Consumable_order_minor__r.Name,
+ Consumable_order_minor__c,Dealer_Arrive__c,
+ Guarantee_period_for_products__c,CFDA_Status__c,
+ ProductPacking_list_manual__c,Report_Product_Approbation__c,
+ Report_Product_Expiration__c,Box_Piece__c, Rrturn_count__c,
+ TracingCode__c,
+ Agencyinfo_fromSAP__c,
+ Frist_Storage_Agency__c,
+ Dealer_Info_text__c
+ ,ContractNo_text__c/*,ContractNo__c*/
+ // tcm start
+ ,Consumable_order_minor__r.ContractNo__c
+ // tcm end
+ FROM Consumable_order_details2__c
+ WHERE recordtypeid = :System.Label.RT_ConOrderDetail2_Delivery
+ AND Dealer_Info_text__c = :accountName
+ AND Product_Type__c like :userPro_Typestr
+ AND Consumable_order_minor__c = :ESetId
+ AND Consumable_order_minor__r.Order_Owner_WorkLocal__c = :userWorkLocation
+ AND Dealer_Arrive__c = false
+ AND Cancellation_Date__c = null
+ AND Bar_Code__c in :BarCodeListP
+ ORDER BY Name ];
+ if(reSet.size()>0){
+ Map<String,String> errorMap = new Map<String,String>();
for (Integer i = 0; i < reSet.size(); i++) {
- if (ExistIdMap.containsKey(reSet[i].Bar_Code__c) || ErrorIdMap.containsKey(reSet[i].Bar_Code__c)) {
+ if(ExistIdMap.containsKey(reSet[i].Bar_Code__c) || ErrorIdMap.containsKey(reSet[i].Bar_Code__c)){
// 璺宠繃宸茬粡澶勭悊鐨勬秷鑰楀搧鏄庣粏
continue;
- } else {
+ }else{
Matcher n = Pattern.compile('[0-9]').matcher(reSet[i].TracingCode__c);
- if (n.find()) {
- String str = '绠$悊缂栫爜涓湁鏁板瓧锛岃涓庣鐞嗗憳纭鏄惁閿欒銆�';
- ConsumableorderdetailsRecordserror.add(new ConsumableorderdetailsInfo(reSet[i], str));
- ErrorIdMap.put(reSet[i].Bar_Code__c, reSet[i].Bar_Code__c);
+ if(n.find()){
+ // gzw DB202305352696 鍏ュ簱绠$悊缂栫爜楠岃瘉绋嬪簭璋冩暣 start
+ if (reSet[i].TracingCode__c.length() == 5) {
+ String tr = reSet[i].TracingCode__c;
+ String Ctr = tr.substring(tr.length() - 3,tr.length());
+ String Btr = tr.substring(tr.length() - 4,tr.length()-3);
+ String Atr = tr.substring(tr.length() - 5,tr.length()-4);
+ if (Pattern.compile('[0-9]').matcher(Atr).find() || Pattern.compile('[0-9]').matcher(Ctr).find()) {
+ String str = '绠$悊缂栫爜鏈夎锛岃妫�鏌ユ潯褰㈢爜鏁版嵁銆�';
+ ConsumableorderdetailsRecordserror.add(new ConsumableorderdetailsInfo(reSet[i],str));
+ ErrorIdMap.put(reSet[i].Bar_Code__c,reSet[i].Bar_Code__c);
continue;
+ }
+ }
+ // String str = '绠$悊缂栫爜涓湁鏁板瓧锛岃涓庣鐞嗗憳纭鏄惁閿欒銆�';
+ // ConsumableorderdetailsRecordserror.add(new ConsumableorderdetailsInfo(reSet[i],str));
+ // ErrorIdMap.put(reSet[i].Bar_Code__c,reSet[i].Bar_Code__c);
+ // continue;
+ // gzw DB202305352696 鍏ュ簱绠$悊缂栫爜楠岃瘉绋嬪簭璋冩暣 end
}
ConsumableorderdetailsRecordsdummy.add(new ConsumableorderdetailsInfo(reSet[i]));
ConsumableorderdetailsRecords.add(new ConsumableorderdetailsInfo(reSet[i]));
- ExistIdMap.put(reSet[i].Bar_Code__c, reSet[i].Bar_Code__c);
+ ExistIdMap.put(reSet[i].Bar_Code__c,reSet[i].Bar_Code__c);
}
}
}
//barcode涓嶄竴鑷达紝绠$悊缂栫爜涓�鑷�
- reSet = [
- SELECT
- Id,
- Name,
- Intra_Trade_List_RMB__c,
- Asset_Model_No__c,
- Consumable_Product__c,
- Consumable_Product__r.Name,
- Consumable_Product__r.Name__c,
- Consumable_Product__r.Asset_Model_No__c,
- Sterilization_limit__c,
- Deliver_date__c,
- Bar_Code__c,
- Arrive_date__c,
- Send_Date__c,
- Box_Piece__c,
- Rrturn_count__c,
- Consumable_order_minor__r.Name,
- Consumable_order_minor__c,
- Dealer_Arrive__c,
- Guarantee_period_for_products__c,
- CFDA_Status__c,
- ProductPacking_list_manual__c,
- Report_Product_Approbation__c,
- Report_Product_Expiration__c,
- TracingCode__c,
- Agencyinfo_fromSAP__c,
- Frist_Storage_Agency__c,
- ContractNo_text__c /*,ContractNo__c*/,
- // tcm start
- Consumable_order_minor__r.ContractNo__c
- // tcm end
- FROM Consumable_order_details2__c
- WHERE
- recordtypeid = :System.Label.RT_ConOrderDetail2_Delivery
- AND Cancellation_Date__c = NULL
- AND Dealer_Arrive__c = FALSE
- AND TracingCode__c IN :barMcodeMap.values()
- AND Bar_Code__c NOT IN :barMcodeMap.keySet()
- AND Dealer_Info_text__c = :accountName
- AND ((Consumable_order_minor__c != NULL
- AND Consumable_order_minor__r.Order_Owner_WorkLocal__c = :userWorkLocation)
- OR Consumable_order_minor__c = NULL)
- ORDER BY Name
- ];
- if (reSet.size() > 0) {
+ reSet = [SELECT Id,
+ Name,
+ Intra_Trade_List_RMB__c,
+ Asset_Model_No__c,
+ Consumable_Product__c,
+ Consumable_Product__r.Name,
+ Consumable_Product__r.Name__c,
+ Consumable_Product__r.Asset_Model_No__c,
+ Sterilization_limit__c,
+ Deliver_date__c,
+ Bar_Code__c,
+ Arrive_date__c,
+ Send_Date__c,
+ Box_Piece__c,
+ Rrturn_count__c,
+ Consumable_order_minor__r.Name,
+ Consumable_order_minor__c,
+ Dealer_Arrive__c,
+ Guarantee_period_for_products__c,
+ CFDA_Status__c,
+ ProductPacking_list_manual__c,
+ Report_Product_Approbation__c,
+ Report_Product_Expiration__c,
+ TracingCode__c
+ ,Agencyinfo_fromSAP__c
+ ,Frist_Storage_Agency__c
+ ,ContractNo_text__c/*,ContractNo__c*/
+ // tcm start
+ ,Consumable_order_minor__r.ContractNo__c
+ // tcm end
+ FROM Consumable_order_details2__c
+ WHERE recordtypeid = :System.Label.RT_ConOrderDetail2_Delivery
+ AND Cancellation_Date__c = null
+ AND Dealer_Arrive__c = false
+ AND TracingCode__c in :barMcodeMap.values()
+ AND Bar_Code__c not in :barMcodeMap.keySet()
+ AND Dealer_Info_text__c = :accountName
+ AND ((Consumable_order_minor__c != null
+ AND Consumable_order_minor__r.Order_Owner_WorkLocal__c = :userWorkLocation)
+ OR Consumable_order_minor__c = null)
+ ORDER BY Name ];
+ if(reSet.size()>0){
for (Integer i = 0; i < reSet.size(); i++) {
- if (ExistIdMap.containsKey(reSet[i].Bar_Code__c) || ErrorIdMap.containsKey(reSet[i].Bar_Code__c)) {
+ if(ExistIdMap.containsKey(reSet[i].Bar_Code__c) || ErrorIdMap.containsKey(reSet[i].Bar_Code__c)){
// 璺宠繃宸茬粡澶勭悊鐨勬秷鑰楀搧鏄庣粏
continue;
- } else {
+ }else{
Matcher n = Pattern.compile('[0-9]').matcher(reSet[i].TracingCode__c);
- if (n.find()) {
- String str = '绠$悊缂栫爜涓湁鏁板瓧锛岃涓庣鐞嗗憳纭鏄惁閿欒銆�';
- ConsumableorderdetailsRecordserror.add(new ConsumableorderdetailsInfo(reSet[i], str));
- ErrorIdMap.put(reSet[i].Bar_Code__c, reSet[i].Bar_Code__c);
+ if(n.find()){
+ // gzw DB202305352696 鍏ュ簱绠$悊缂栫爜楠岃瘉绋嬪簭璋冩暣 start
+ if (reSet[i].TracingCode__c.length() == 5) {
+ String tr = reSet[i].TracingCode__c;
+ String Ctr = tr.substring(tr.length() - 3,tr.length());
+ String Btr = tr.substring(tr.length() - 4,tr.length()-3);
+ String Atr = tr.substring(tr.length() - 5,tr.length()-4);
+ if (Pattern.compile('[0-9]').matcher(Atr).find() || Pattern.compile('[0-9]').matcher(Ctr).find()) {
+ String str = '绠$悊缂栫爜鏈夎锛岃妫�鏌ユ潯褰㈢爜鏁版嵁銆�';
+ ConsumableorderdetailsRecordserror.add(new ConsumableorderdetailsInfo(reSet[i],str));
+ ErrorIdMap.put(reSet[i].Bar_Code__c,reSet[i].Bar_Code__c);
continue;
}
- ExistIdMap.put(reSet[i].Bar_Code__c, reSet[i].Bar_Code__c);
- for (String str : barMcodeMap.keySet()) {
- if (barMcodeMap.get(str) == reSet[i].TracingCode__c) {
+ }
+ // String str = '绠$悊缂栫爜涓湁鏁板瓧锛岃涓庣鐞嗗憳纭鏄惁閿欒銆�';
+ // ConsumableorderdetailsRecordserror.add(new ConsumableorderdetailsInfo(reSet[i],str));
+ // ErrorIdMap.put(reSet[i].Bar_Code__c,reSet[i].Bar_Code__c);
+ // continue;
+ // gzw DB202305352696 鍏ュ簱绠$悊缂栫爜楠岃瘉绋嬪簭璋冩暣 end
+ }
+ ExistIdMap.put(reSet[i].Bar_Code__c,reSet[i].Bar_Code__c);
+ for(String str : barMcodeMap.keySet()){
+ if(barMcodeMap.get(str) == reSet[i].TracingCode__c){
reSet[i].Bar_Code__c = str;
- ExistIdMap.put(str, str);
+ ExistIdMap.put(str,str);
}
}
ConsumableorderdetailsRecordsdummy.add(new ConsumableorderdetailsInfo(reSet[i]));
@@ -1868,27 +1682,33 @@
AllMap.putAll(ErrorIdMap);
AllMap.putAll(ExistIdMap);
//寰楀埌涓嶅瓨鍦ㄧ殑BarCode
- for (Integer i = 0; i < BarCodeListP.size(); i++) {
- if (AllMap.containsKey(BarCodeListP[i])) {
+ for(Integer i = 0; i < BarCodeListP.size(); i++){
+ if(AllMap.containsKey(BarCodeListP[i])){
continue;
- } else if (otherAgencyMap.containsKey(BarCodeListP[i])) {
+ }else if(otherAgencyMap.containsKey(BarCodeListP[i])){
continue;
}
//add by rentx 2021-01-27 start
- else if (coc != null && coc.orderPattern__c == 'hospitalorder') {
+ else if (coc!= null && coc.orderPattern__c == 'hospitalorder') {
HosErrorList.add(BarCodeListP[i]);
continue;
+
}
//add by rentx 2021-01-27 end
- else {
+ else{
notInlist.add(BarCodeListP[i]);
- otherAgencyMap.put(BarCodeListP[i], BarCodeListP[i]);
+ otherAgencyMap.put(BarCodeListP[i],BarCodeListP[i]);
}
}
- if (notInlist.size() > 0) {
+ if(notInlist.size()>0){
inventoryEntry(notInlist);
- if (notInStorelist.size() > 0) {
- ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR, 'BarCode鍙�' + notInStorelist + '涓嶅瓨鍦ㄣ��'));
+ if(notInStorelist.size() > 0){
+ //LWC:Lwcflag鍜屾姤閿欐彁閱� update by Link 2023-04-27
+ if(isLwc){
+ returnError = 'BarCode鍙�'+ notInStorelist + '涓嶅瓨鍦�';
+ }else {
+ ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR,'BarCode鍙�'+ notInStorelist + '涓嶅瓨鍦ㄣ��'));
+ }
return;
}
}
@@ -1897,188 +1717,189 @@
//add by rentx 2021-01-27 start 褰撹鍗曚负鍖婚櫌鐗逛环绫诲瀷鐨勮鍗曟椂,濡傛灉鎵句笉鍒癰arcode,涓嶈В鏋�,骞朵笖榛樿璇arcode瀵瑰簲鐨勬槑缁�2涓洪潪鍖婚櫌鐗逛环浜у搧,鐩存帴鎶ラ敊
if (HosErrorList.size() > 0) {
for (String str : HosErrorList) {
- ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR, 'BarCode鍙�:' + str + '鏄潪鍖婚櫌鐗逛环浜у搧'));
+ //LWC:Lwcflag鍜屾姤閿欐彁閱� update by Link 2023-04-27
+ if(isLwc){
+ errorList.add('BarCode鍙�:' + str +'鏄潪鍖婚櫌鐗逛环浜у搧');
+ }else {
+ ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR,'BarCode鍙�:' + str +'鏄潪鍖婚櫌鐗逛环浜у搧'));
+ }
+
}
}
//add by rentx 2021-01-27 end
makeArrivedSummary();
+
//add by rentx 20210602 start CHAN-C3K4ZQ
makeRecordsView(ConsumableorderdetailsRecordsdummy);
//add by rentx 20210602 end CHAN-C3K4ZQ
}
- public void inventoryEntryNoESetId(List<String> barCodeList) {
+
+ public void inventoryEntryNoESetId (List<String> barCodeList){
//鎵�鏈塨arcode瑙f瀽鍒扮殑Jancode
List<String> alljanCodeList = new List<String>();
List<String> allotCodeList = new List<String>();
List<String> barCode01List = new List<String>();
List<String> barCode241List = new List<String>();
- Map<String, Map<String, String>> barJancodeMap = new Map<String, Map<String, String>>();
- Map<String, Map<String, String>> barOtcodeMap = new Map<String, Map<String, String>>();
- Map<String, List<String>> barcodeinfoMap = new Map<String, List<String>>();
- Map<String, String> barcoderightMap = new Map<String, String>();
+ Map<String,Map<String,String>> barJancodeMap = new Map<String,Map<String,String>>();
+ Map<String,Map<String,String>> barOtcodeMap = new Map<String,Map<String,String>>();
+ Map<String,List<String>> barcodeinfoMap = new Map<String,List<String>>();
+ Map<String,String> barcoderightMap = new Map<String,String>();
notInStorelist.clear();
- for (Integer i = 0; i < barCodeList.size(); i++) {
- Date expirationDate = null;
+ for(Integer i = 0; i < barCodeList.size(); i++){
+ Date expirationDate = null ;
String serialNoorLotNo = '';
String tracingCode = '';
String productDateStr = '';
- Date productionDate = null;
+ Date productionDate = null ;
String expirationDateStr = '';
- if (barCodeList[i].length() >= 3) {
- if (barCodeList[i].substring(0, 2) == '01') {
+ if(barCodeList[i].length() >= 3){
+ if(barCodeList[i].substring(0,2) =='01'){
String janCodeMark = '';
//鐢熶骇鏃ユ湡
List<String> janCode = new List<String>();
- if (barCodeList[i].length() < 16) {
- ApexPages.addmessage(
- new ApexPages.message(
- ApexPages.severity.ERROR,
- '浜у搧BarCode(' + barCodeList[i] + ')鐨勪綅鏁颁笉瓒�16锛屼笉绗﹀悎瑕佹眰閿欒锛�'
- )
- );
+ if(barCodeList[i].length() < 16){
+ //LWC:Lwcflag鍜屾姤閿欐彁閱� update by Link 2023-04-27
+ if(isLwc){
+ errorList.add('浜у搧BarCode(' + barCodeList[i] + ')鐨勪綅鏁颁笉瓒�16锛屼笉绗﹀悎瑕佹眰閿欒锛�');
+ }else {
+ ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR,'浜у搧BarCode(' + barCodeList[i] + ')鐨勪綅鏁颁笉瓒�16锛屼笉绗﹀悎瑕佹眰閿欒锛�'));
+ }
continue;
- } else {
+ }else {
//if(barCodeList[i].substring(0,2) !='01'){
// ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR,'浜у搧BarCode(' + barCodeList[i] + ')娌℃湁janCode锛屼笉绗﹀悎瑕佹眰锛�'));
// return;
//}
- janCodeMark = barCodeList[i].substring(2, 16);
- try {
- Decimal test = Decimal.valueOf(janCodeMark);
- } catch (Exception e) {
- ApexPages.addmessage(
- new ApexPages.message(ApexPages.severity.ERROR, '浜у搧BarCode(' + barCodeList[i] + ')鐨刯anCode閿欒锛�')
- );
+ janCodeMark = barCodeList[i].substring(2,16);
+ try{
+ Decimal test = Decimal.valueOf(janCodeMark);
+ }catch(Exception e){
+ //LWC:Lwcflag鍜屾姤閿欐彁閱� update by Link 2023-04-27
+ if(isLwc){
+ errorList.add('浜у搧BarCode(' + barCodeList[i] + ')鐨刯anCode閿欒锛�');
+ }else {
+ ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR,'浜у搧BarCode(' + barCodeList[i] + ')鐨刯anCode閿欒锛�'));
+ }
continue;
}
}
- if (barCodeList[i].length() >= 22) {
- if (barCodeList[i].substring(barCodeList[i].length() - 8, barCodeList[i].length() - 5) != '250') {
- ApexPages.addmessage(
- new ApexPages.message(ApexPages.severity.ERROR, '浜у搧BarCode(' + barCodeList[i] + ')娌℃湁绠$悊缂栫爜锛�')
- );
+ if(barCodeList[i].length() >= 22){
+ if(barCodeList[i].substring(barCodeList[i].length() - 8,barCodeList[i].length()-5)!='250'){
+ //LWC:Lwcflag鍜屾姤閿欐彁閱� update by Link 2023-04-27
+ if(isLwc){
+ errorList.add('浜у搧BarCode(' + barCodeList[i] + ')娌℃湁绠$悊缂栫爜锛�');
+ }else {
+ ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR, '浜у搧BarCode(' + barCodeList[i] + ')娌℃湁绠$悊缂栫爜锛�'));
+ }
continue;
}
- if (barCodeList[i].substring(16, 18) == '11') {
- try {
- productDateStr = '20' + barCodeList[i].substring(18, 20) + '-' + barCodeList[i].substring(20, 22) + '-01';
+ if( barCodeList[i].substring(16,18) =='11'){
+ try{
+ productDateStr = '20' + barCodeList[i].substring(18,20) + '-' + barCodeList[i].substring(20,22) + '-01' ;
productionDate = Date.valueOf(productDateStr);
- } catch (Exception e) {
- ApexPages.addmessage(
- new ApexPages.message(
- ApexPages.severity.ERROR,
- '浜у搧BarCode(' + barCodeList[i] + ')鐨勭敓浜ф棩鏈�' + productDateStr + '閿欒锛�'
- )
- );
+ }catch(Exception e){
+ //LWC:Lwcflag鍜屾姤閿欐彁閱� update by Link 2023-04-27
+ if(isLwc){
+ errorList.add('浜у搧BarCode(' + barCodeList[i] + ')鐨勭敓浜ф棩鏈�' + productDateStr + '閿欒锛�');
+ }else {
+ ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR, '浜у搧BarCode(' + barCodeList[i] + ')鐨勭敓浜ф棩鏈�' + productDateStr + '閿欒锛�'));
+ }
continue;
}
- if (barCodeList[i].length() >= 32) {
- if (barCodeList[i].substring(24, 26) == '17') {
- try {
- if (barCodeList[i].substring(30, 32) == '00') {
- expirationDateStr =
- '20' +
- barCodeList[i].substring(26, 28) +
- '-' +
- barCodeList[i].substring(28, 30) +
- '-' +
- '01';
+ if(barCodeList[i].length() >=32){
+ if( barCodeList[i].substring(24,26) =='17'){
+ try{
+ if(barCodeList[i].substring(30,32)=='00'){
+ expirationDateStr = '20' + barCodeList[i].substring(26,28) + '-' + barCodeList[i].substring(28,30) + '-' + '01' ;
expirationDate = Date.valueOf(expirationDateStr);
expirationDate = expirationDate.addMonths(1).toStartofMonth().addDays(-1);
- } else {
- expirationDateStr =
- '20' +
- barCodeList[i].substring(26, 28) +
- '-' +
- barCodeList[i].substring(28, 30) +
- '-' +
- barCodeList[i].substring(30, 32);
- expirationDate = Date.valueOf(expirationDateStr);
+ }else{
+ expirationDateStr = '20' + barCodeList[i].substring(26,28) + '-' + barCodeList[i].substring(28,30) + '-' +barCodeList[i].substring(30,32) ;
+ expirationDate = Date.valueOf(expirationDateStr);
}
- } catch (Exception e) {
- ApexPages.addmessage(
- new ApexPages.message(
- ApexPages.severity.ERROR,
- '浜у搧BarCode(' + barCodeList[i] + ')鐨勬粎鑿屾湁鍔规湡闄�' + expirationDateStr + '閿欒锛�'
- )
- );
+ }catch(Exception e){
+ //LWC:Lwcflag鍜屾姤閿欐彁閱� update by Link 2023-04-27
+ if(isLwc){
+ errorList.add('浜у搧BarCode(' + barCodeList[i] + ')鐨勬粎鑿屾湁鍔规湡闄�' + expirationDateStr + '閿欒锛�');
+ }else {
+ ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR,'浜у搧BarCode(' + barCodeList[i] + ')鐨勬粎鑿屾湁鍔规湡闄�' + expirationDateStr + '閿欒锛�'));
+ }
continue;
}
- if (barCodeList[i].length() >= 42) {
- if (barCodeList[i].substring(32, 34) == '10' || barCodeList[i].substring(32, 34) == '21') {
- serialNoorLotNo = barCodeList[i].substring(34, barCodeList[i].length() - 8);
+ if(barCodeList[i].length() >= 42){
+ if(barCodeList[i].substring(32,34) =='10' || barCodeList[i].substring(32,34) =='21'){
+ serialNoorLotNo = barCodeList[i].substring(34,barCodeList[i].length() - 8) ;
}
}
- } else if (barCodeList[i].substring(24, 26) == '10' || barCodeList[i].substring(24, 26) == '21') {
- serialNoorLotNo = barCodeList[i].substring(26, barCodeList[i].length() - 8);
+ }else if(barCodeList[i].substring(24,26) =='10' || barCodeList[i].substring(24,26) =='21'){
+ serialNoorLotNo = barCodeList[i].substring(26,barCodeList[i].length() - 8) ;
}
}
- } else if (barCodeList[i].substring(16, 18) == '17') {
- try {
- if (barCodeList[i].substring(22, 24) == '00') {
- expirationDateStr =
- '20' +
- barCodeList[i].substring(18, 20) +
- '-' +
- barCodeList[i].substring(20, 22) +
- '-01';
+ }else if(barCodeList[i].substring(16,18) =='17'){
+ try{
+ if(barCodeList[i].substring(22,24)=='00'){
+ expirationDateStr = '20' + barCodeList[i].substring(18,20) + '-' + barCodeList[i].substring(20,22) + '-01';
//ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR,'浜у搧expirationDateStr' + expirationDateStr));
expirationDate = Date.valueOf(expirationDateStr);
expirationDate = expirationDate.addMonths(1).toStartofMonth().addDays(-1);
- } else {
- expirationDateStr =
- '20' +
- barCodeList[i].substring(18, 20) +
- '-' +
- barCodeList[i].substring(20, 22) +
- '-' +
- barCodeList[i].substring(22, 24);
+ }else{
+ expirationDateStr = '20' + barCodeList[i].substring(18,20) + '-' + barCodeList[i].substring(20,22) + '-' +barCodeList[i].substring(22,24);
expirationDate = Date.valueOf(expirationDateStr);
}
- } catch (Exception e) {
- ApexPages.addmessage(
- new ApexPages.message(
- ApexPages.severity.ERROR,
- '浜у搧BarCode(' + barCodeList[i] + ')鐨勬粎鑿屾湁鍔规湡闄�' + expirationDateStr + '閿欒锛�'
- )
- );
+ }catch(Exception e){
+ //LWC:Lwcflag鍜屾姤閿欐彁閱� update by Link 2023-04-27
+ if(isLwc){
+ errorList.add('浜у搧BarCode(' + barCodeList[i] + ')鐨勬粎鑿屾湁鍔规湡闄�' + expirationDateStr + '閿欒锛�');
+ }else {
+ ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR,'浜у搧BarCode(' + barCodeList[i] + ')鐨勬粎鑿屾湁鍔规湡闄�' + expirationDateStr + '閿欒锛�'));
+ }
continue;
}
- if (barCodeList[i].length() >= 34) {
- if (barCodeList[i].substring(24, 26) == '10' || barCodeList[i].substring(24, 26) == '21') {
- serialNoorLotNo = barCodeList[i].substring(26, barCodeList[i].length() - 8);
+ if(barCodeList[i].length() >= 34){
+ if(barCodeList[i].substring(24,26) =='10' || barCodeList[i].substring(24,26) =='21'){
+ serialNoorLotNo = barCodeList[i].substring(26,barCodeList[i].length() - 8) ;
}
}
- } else if (barCodeList[i].length() >= 26) {
- if (barCodeList[i].substring(16, 18) == '10' || barCodeList[i].substring(16, 18) == '21') {
- serialNoorLotNo = barCodeList[i].substring(18, barCodeList[i].length() - 8);
+
+ }else if(barCodeList[i].length() >= 26){
+ if(barCodeList[i].substring(16,18) =='10' || barCodeList[i].substring(16,18) =='21'){
+ serialNoorLotNo = barCodeList[i].substring(18,barCodeList[i].length() - 8) ;
}
}
}
- if (
- barCodeList[i].length() >= 24 &&
- barCodeList[i].substring(barCodeList[i].length() - 8, barCodeList[i].length() - 5) == '250'
- ) {
- if (barCodeList[i].substring(barCodeList[i].length() - 8, barCodeList[i].length() - 5) == '250') {
- tracingCode = barCodeList[i].substring(barCodeList[i].length() - 5, barCodeList[i].length());
+ if(barCodeList[i].length() >= 24 && barCodeList[i].substring(barCodeList[i].length() - 8,barCodeList[i].length()-5)=='250'){
+ if(barCodeList[i].substring(barCodeList[i].length() - 8,barCodeList[i].length()-5)=='250'){
+ tracingCode = barCodeList[i].substring(barCodeList[i].length() - 5,barCodeList[i].length());
Matcher n = Pattern.compile('[0-9]').matcher(tracingCode);
- if (n.find()) {
- String str = '绠$悊缂栫爜涓嶆纭紝璇蜂笌绠$悊鍛樼‘璁ゆ槸鍚﹂敊璇��';
- ApexPages.addmessage(
- new ApexPages.message(
- ApexPages.severity.ERROR,
- '浜у搧BarCode(' + barCodeList[i] + ')绠$悊缂栫爜涓湁鏁板瓧锛岃涓庣鐞嗗憳纭鏄惁閿欒锛�'
- )
- );
- continue;
+ if(n.find()){
+ // gzw DB202305352696 鍏ュ簱绠$悊缂栫爜楠岃瘉绋嬪簭璋冩暣 start
+ if (tracingCode.length() == 5) {
+ String tr = tracingCode;
+ String Ctr = tr.substring(tr.length() - 3,tr.length());
+ String Btr = tr.substring(tr.length() - 4,tr.length()-3);
+ String Atr = tr.substring(tr.length() - 5,tr.length()-4);
+ if (Pattern.compile('[0-9]').matcher(Atr).find() || Pattern.compile('[0-9]').matcher(Ctr).find()) {
+ //LWC:Lwcflag鍜屾姤閿欐彁閱� update by Link 2023-04-27
+ String str = '绠$悊缂栫爜鏈夎锛岃妫�鏌ユ潯褰㈢爜鏁版嵁銆�';
+ if(isLwc){
+ errorList.add('浜у搧BarCode(' + barCodeList[i] + ')绠$悊缂栫爜鏈夎锛岃妫�鏌ユ潯褰㈢爜鏁版嵁銆�');
+ }else {
+ ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR,'浜у搧BarCode(' + barCodeList[i] + ')绠$悊缂栫爜鏈夎锛岃妫�鏌ユ潯褰㈢爜鏁版嵁銆�'));
+ }
+ continue;
+ }
+ }
}
- } else {
- ApexPages.addmessage(
- new ApexPages.message(ApexPages.severity.ERROR, '浜у搧BarCode(' + barCodeList[i] + ')鐨則racingCode閿欒锛�')
- );
+ }else{
+ //LWC:Lwcflag鍜屾姤閿欐彁閱� update by Link 2023-04-27
+ if(isLwc){
+ errorList.add('浜у搧BarCode(' + barCodeList[i] + ')鐨則racingCode閿欒锛�');
+ }else {
+ ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR,'浜у搧BarCode(' + barCodeList[i] + ')鐨則racingCode閿欒锛�'));
+ }
continue;
}
}
@@ -2087,590 +1908,525 @@
barcodedetList.add(String.valueOf(expirationDate));
barcodedetList.add(serialNoorLotNo);
barcodedetList.add(tracingCode);
- Integer jan1 = Integer.valueOf(janCodeMark.substring(0, 1));
- Integer jan2 = Integer.valueOf(janCodeMark.substring(1, 2));
- Integer jan3 = Integer.valueOf(janCodeMark.substring(2, 3));
- Integer jan4 = Integer.valueOf(janCodeMark.substring(3, 4));
- Integer jan5 = Integer.valueOf(janCodeMark.substring(4, 5));
- Integer jan6 = Integer.valueOf(janCodeMark.substring(5, 6));
- Integer jan7 = Integer.valueOf(janCodeMark.substring(6, 7));
- Integer jan8 = Integer.valueOf(janCodeMark.substring(7, 8));
- Integer jan9 = Integer.valueOf(janCodeMark.substring(8, 9));
+ Integer jan1 = Integer.valueOf(janCodeMark.substring(0, 1));
+ Integer jan2 = Integer.valueOf(janCodeMark.substring(1, 2));
+ Integer jan3 = Integer.valueOf(janCodeMark.substring(2, 3));
+ Integer jan4 = Integer.valueOf(janCodeMark.substring(3, 4));
+ Integer jan5 = Integer.valueOf(janCodeMark.substring(4, 5));
+ Integer jan6 = Integer.valueOf(janCodeMark.substring(5, 6));
+ Integer jan7 = Integer.valueOf(janCodeMark.substring(6, 7));
+ Integer jan8 = Integer.valueOf(janCodeMark.substring(7, 8));
+ Integer jan9 = Integer.valueOf(janCodeMark.substring(8, 9));
Integer jan10 = Integer.valueOf(janCodeMark.substring(9, 10));
Integer jan11 = Integer.valueOf(janCodeMark.substring(10, 11));
Integer jan12 = Integer.valueOf(janCodeMark.substring(11, 12));
Integer jan13 = Integer.valueOf(janCodeMark.substring(12, 13));
- Integer count12 =
- jan2 +
- jan3 * 3 +
- jan4 +
- jan5 * 3 +
- jan6 +
- jan7 * 3 +
- jan8 +
- jan9 * 3 +
- jan10 +
- jan11 * 3 +
- jan12 +
- jan13 * 3;
- Integer count13 =
- jan1 * 3 +
- jan2 +
- jan3 * 3 +
- jan4 +
- jan5 * 3 +
- jan6 +
- jan7 * 3 +
- jan8 +
- jan9 * 3 +
- jan10 +
- jan11 * 3 +
- jan12 +
- jan13 * 3;
- String frost12 = (String.valueOf(count12)).substring((String.valueOf(count12)).length() - 1);
- String frost13 = (String.valueOf(count13)).substring((String.valueOf(count13)).length() - 1);
+ Integer count12 = jan2 + jan3*3 + jan4 + jan5*3 + jan6 + jan7*3 + jan8 + jan9*3 + jan10 + jan11*3 +jan12 + jan13*3;
+ Integer count13 = jan1*3 + jan2 + jan3*3 + jan4 + jan5*3 + jan6 + jan7*3 + jan8 + jan9*3 + jan10 + jan11*3 +jan12 + jan13*3;
+ String frost12 = (String.valueOf(count12)).substring((String.valueOf(count12)).length()-1);
+ String frost13 = (String.valueOf(count13)).substring((String.valueOf(count13)).length()-1);
//鍑忓幓12浣嶄釜浣�
- frost12 = (String.valueOf(10 - Integer.valueOf(frost12)))
- .substring((String.valueOf(10 - Integer.valueOf(frost12))).length() - 1);
- frost13 = (String.valueOf(10 - Integer.valueOf(frost13)))
- .substring((String.valueOf(10 - Integer.valueOf(frost13))).length() - 1);
+ frost12 = (String.valueOf(10 - Integer.valueOf(frost12))).substring((String.valueOf(10 - Integer.valueOf(frost12))).length()-1);
+ frost13 = (String.valueOf(10 - Integer.valueOf(frost13))).substring((String.valueOf(10 - Integer.valueOf(frost13))).length()-1);
janCode.add(janCodeMark.substring(1, 13) + frost12);
janCode.add(janCodeMark.substring(0, 13) + frost12);
janCode.add(janCodeMark.substring(1, 13) + frost13);
janCode.add(janCodeMark.substring(0, 13) + frost13);
alljanCodeList.addAll(janCode);
- Map<String, String> janCodeMap = new Map<String, String>();
- janCodeMap.put(janCodeMark.substring(1, 13) + frost12, barCodeList[i]);
- janCodeMap.put(janCodeMark.substring(0, 13) + frost12, barCodeList[i]);
- janCodeMap.put(janCodeMark.substring(1, 13) + frost13, barCodeList[i]);
- janCodeMap.put(janCodeMark.substring(0, 13) + frost13, barCodeList[i]);
+ Map<String,String> janCodeMap = new Map<String,String>();
+ janCodeMap.put(janCodeMark.substring(1, 13) + frost12,barCodeList[i]);
+ janCodeMap.put(janCodeMark.substring(0, 13) + frost12,barCodeList[i]);
+ janCodeMap.put(janCodeMark.substring(1, 13) + frost13,barCodeList[i]);
+ janCodeMap.put(janCodeMark.substring(0, 13) + frost13,barCodeList[i]);
barJancodeMap.put(barCodeList[i], janCodeMap);
barcodeinfoMap.put(barCodeList[i], barcodedetList);
barCode01List.add(barCodeList[i]);
- } else if (barCodeList[i].substring(0, 3) == '241') {
- if (
- barCodeList[i].length() > 8 &&
- barCodeList[i].substring(barCodeList[i].length() - 8, barCodeList[i].length() - 5) != '250'
- ) {
- ApexPages.addmessage(
- new ApexPages.message(ApexPages.severity.ERROR, '浜у搧BarCode(' + barCodeList[i] + ')娌℃湁绠$悊缂栫爜锛�')
- );
+ }else if(barCodeList[i].substring(0,3) =='241'){
+ if(barCodeList[i].length() > 8 && barCodeList[i].substring(barCodeList[i].length() - 8,barCodeList[i].length()-5)!='250'){
+ //LWC:Lwcflag鍜屾姤閿欐彁閱� update by Link 2023-04-27
+ if(isLwc){
+ errorList.add('浜у搧BarCode(' + barCodeList[i] + ')娌℃湁绠$悊缂栫爜锛�');
+ }else {
+ ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR, '浜у搧BarCode(' + barCodeList[i] + ')娌℃湁绠$悊缂栫爜锛�'));
+ }
continue;
}
List<String> otCodeList = new List<String>();
- Map<String, String> otCodeMap = new Map<String, String>();
- if (barCodeList[i].length() < 7) {
- ApexPages.addmessage(
- new ApexPages.message(
- ApexPages.severity.ERROR,
- '浜у搧BarCode(' + barCodeList[i] + ')鐨勪綅鏁颁笉瓒�16锛屼笉绗﹀悎瑕佹眰閿欒锛�'
- )
- );
+ Map<String,String> otCodeMap = new Map<String,String>();
+ if(barCodeList[i].length() < 7){
+ //LWC:Lwcflag鍜屾姤閿欐彁閱� update by Link 2023-04-27
+ if(isLwc){
+ errorList.add('浜у搧BarCode(' + barCodeList[i] + ')鐨勪綅鏁颁笉瓒�16锛屼笉绗﹀悎瑕佹眰閿欒锛�');
+ }else {
+ ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR,'浜у搧BarCode(' + barCodeList[i] + ')鐨勪綅鏁颁笉瓒�16锛屼笉绗﹀悎瑕佹眰閿欒锛�'));
+ }
continue;
- } else if (barCodeList[i].length() == 11) {
- String otCode4 = barCodeList[i].substring(3, 7);
- String otCode5 = barCodeList[i].substring(3, 8);
- String otCode6 = barCodeList[i].substring(3, 9);
- String otCode7 = barCodeList[i].substring(3, 10);
- String otCode8 = barCodeList[i].substring(3, 11);
+ }else if(barCodeList[i].length() == 11){
+ String otCode4 = barCodeList[i].substring(3,7);
+ String otCode5 = barCodeList[i].substring(3,8);
+ String otCode6 = barCodeList[i].substring(3,9);
+ String otCode7 = barCodeList[i].substring(3,10);
+ String otCode8 = barCodeList[i].substring(3,11);
otCodeList.add(otCode4);
otCodeList.add(otCode5);
otCodeList.add(otCode6);
otCodeList.add(otCode7);
otCodeList.add(otCode8);
- otCodeMap.put(otCode4, barCodeList[i]);
- otCodeMap.put(otCode5, barCodeList[i]);
- otCodeMap.put(otCode6, barCodeList[i]);
- otCodeMap.put(otCode7, barCodeList[i]);
- otCodeMap.put(otCode8, barCodeList[i]);
- } else if (barCodeList[i].length() >= 12) {
- String otCode4 = barCodeList[i].substring(3, 7);
- String otCode5 = barCodeList[i].substring(3, 8);
- String otCode6 = barCodeList[i].substring(3, 9);
- String otCode7 = barCodeList[i].substring(3, 10);
- String otCode8 = barCodeList[i].substring(3, 11);
- String otCode9 = barCodeList[i].substring(3, 12);
+ otCodeMap.put(otCode4,barCodeList[i]);
+ otCodeMap.put(otCode5,barCodeList[i]);
+ otCodeMap.put(otCode6,barCodeList[i]);
+ otCodeMap.put(otCode7,barCodeList[i]);
+ otCodeMap.put(otCode8,barCodeList[i]);
+ }else if(barCodeList[i].length() >= 12){
+ String otCode4 = barCodeList[i].substring(3,7);
+ String otCode5 = barCodeList[i].substring(3,8);
+ String otCode6 = barCodeList[i].substring(3,9);
+ String otCode7 = barCodeList[i].substring(3,10);
+ String otCode8 = barCodeList[i].substring(3,11);
+ String otCode9 = barCodeList[i].substring(3,12);
otCodeList.add(otCode4);
otCodeList.add(otCode5);
otCodeList.add(otCode6);
otCodeList.add(otCode7);
otCodeList.add(otCode8);
otCodeList.add(otCode9);
- otCodeMap.put(otCode4, barCodeList[i]);
- otCodeMap.put(otCode5, barCodeList[i]);
- otCodeMap.put(otCode6, barCodeList[i]);
- otCodeMap.put(otCode7, barCodeList[i]);
- otCodeMap.put(otCode8, barCodeList[i]);
- otCodeMap.put(otCode9, barCodeList[i]);
+ otCodeMap.put(otCode4,barCodeList[i]);
+ otCodeMap.put(otCode5,barCodeList[i]);
+ otCodeMap.put(otCode6,barCodeList[i]);
+ otCodeMap.put(otCode7,barCodeList[i]);
+ otCodeMap.put(otCode8,barCodeList[i]);
+ otCodeMap.put(otCode9,barCodeList[i]);
}
allotCodeList.addAll(otCodeList);
barOtcodeMap.put(barCodeList[i], otCodeMap);
barCode241List.add(barCodeList[i]);
- } else {
- ApexPages.addmessage(
- new ApexPages.message(ApexPages.severity.ERROR, '浜у搧BarCode(' + barCodeList[i] + ')涓嶇鍚堣姹傦紒')
- );
+ }else{
+ //LWC:Lwcflag鍜屾姤閿欐彁閱� update by Link 2023-04-27
+ if(isLwc){
+ errorList.add('浜у搧BarCode(' + barCodeList[i] + ')涓嶇鍚堣姹傦紒');
+ }else {
+ ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR,'浜у搧BarCode(' + barCodeList[i] + ')涓嶇鍚堣姹傦紒'));
+ }
continue;
}
- } else {
- ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR, '浜у搧BarCode(' + barCodeList[i] + ')涓嶇鍚堣姹傦紒'));
+ }else{
+ //LWC:Lwcflag鍜屾姤閿欐彁閱� update by Link 2023-04-27
+ if(isLwc){
+ errorList.add('浜у搧BarCode(' + barCodeList[i] + ')涓嶇鍚堣姹傦紒');
+ }else {
+ ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR,'浜у搧BarCode(' + barCodeList[i] + ')涓嶇鍚堣姹傦紒'));
+ }
continue;
}
}
//01閫氳繃妫�绱骇鍝佹槸鍚﹀瓨鍦�
//-----------XHL--------------UpdateSTART----------------20181010------
- if (alljanCodeList.size() > 0) {
- List<Product2__c> product2InStore = [
- SELECT
- Id,
- Name,
- Name__c,
- Intra_Trade_List_RMB__c,
- Asset_Model_No__c,
- OT_CODE__c,
- Product2_Jancode__c,
- Pro2_Dealer_ENG__c,
- Pro2_Dealer_Object__c
+ if(alljanCodeList.size() > 0){
+ List<Product2__c> product2InStore = [SELECT Id, Name,Name__c,Intra_Trade_List_RMB__c,Asset_Model_No__c,OT_CODE__c,Product2_Jancode__c,
+ Pro2_Dealer_ENG__c,Pro2_Dealer_Object__c
FROM Product2__c
- WHERE Product2_Jancode__c IN :alljanCodeList
- ORDER BY SFDA_Expiration_Date__c DESC
- ];
- if (product2InStore.size() > 0) {
+ WHERE Product2_Jancode__c in :alljanCodeList
+ order by SFDA_Expiration_Date__c desc ] ;
+ if(product2InStore.size() > 0){
// CHAN-AVSAST
- Map<String, String> rightBar = new Map<String, String>();
- Map<String, String> errorMap = new Map<String, String>();
- for (String bar : barJancodeMap.keySet()) {
+ Map<String,String> rightBar = new Map<String,String>();
+ Map<String,String> errorMap = new Map<String,String>();
+ for(String bar: barJancodeMap.keySet() ){
Integer cou = 0;
- for (Product2__c produ : product2InStore) {
- if (barJancodeMap.get(bar).containsKey(produ.Product2_Jancode__c) && !rightBar.containsKey(bar)) {
- cou++;
- if (EngFlag == true && produ.Pro2_Dealer_ENG__c == true) {
- consumableInventory.add(new ConsumableorderdetailsInfo(produ, barcodeinfoMap.get(bar)));
- consumableInventoryUse.add(new ConsumableorderdetailsInfo(produ, barcodeinfoMap.get(bar)));
+ for(Product2__c produ: product2InStore){
+ if(barJancodeMap.get(bar).containsKey(produ.Product2_Jancode__c) && !rightBar.containsKey(bar)){
+ cou ++;
+ if(EngFlag == TRUE && produ.Pro2_Dealer_ENG__c == TRUE){
+ consumableInventory.add(new ConsumableorderdetailsInfo(produ,barcodeinfoMap.get(bar)));
+ consumableInventoryUse.add(new ConsumableorderdetailsInfo(produ,barcodeinfoMap.get(bar)));
rightBar.put(bar, bar);
- } else if (ETFlag == true && produ.Pro2_Dealer_Object__c == true) {
- consumableInventory.add(new ConsumableorderdetailsInfo(produ, barcodeinfoMap.get(bar)));
- consumableInventoryUse.add(new ConsumableorderdetailsInfo(produ, barcodeinfoMap.get(bar)));
+ }else if(ETFlag == TRUE && produ.Pro2_Dealer_Object__c == TRUE){
+ consumableInventory.add(new ConsumableorderdetailsInfo(produ,barcodeinfoMap.get(bar)));
+ consumableInventoryUse.add(new ConsumableorderdetailsInfo(produ,barcodeinfoMap.get(bar)));
rightBar.put(bar, bar);
- } else {
+ }else{
errorMap.put(bar, bar);
}
}
+
}
- if (cou <= 0) {
+ if(cou <= 0 ){
notInStorelist.add(bar);
}
}
- if (errorMap.size() > 0) {
- ApexPages.addmessage(
- new ApexPages.message(
- ApexPages.severity.ERROR,
- 'BarCode鍙穂' + errorMap.values() + ']浜у搧绫诲瀷[' + product_Type + ']涓庣敤鎴风被鍨媅' + userPro_Type + ']涓嶇'
- )
- );
+ if(errorMap.size() > 0){
+ //LWC:Lwcflag鍜屾姤閿欐彁閱� update by Link 2023-04-27
+ if(isLwc){
+ errorList.add('BarCode鍙穂'+ errorMap.values() +']浜у搧绫诲瀷['+product_Type+']涓庣敤鎴风被鍨媅'+userPro_Type+']涓嶇');
+ }else {
+ ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR,'BarCode鍙穂'+ errorMap.values() +']浜у搧绫诲瀷['+product_Type+']涓庣敤鎴风被鍨媅'+userPro_Type+']涓嶇'));
+ }
}
}
}
-
+
//241閫氳繃妫�绱骇鍝佹槸鍚﹀瓨鍦�
- if (allotCodeList.size() > 0) {
- Map<String, String> errorMap = new Map<String, String>();
- Map<String, String> exitBarCodeMap = new Map<String, String>();
- List<Product2__c> product2InStore = [
- SELECT
- Id,
- Name,
- Name__c,
- Intra_Trade_List_RMB__c,
- Asset_Model_No__c,
- OT_CODE__c,
- Product2_Jancode__c,
- Pro2_Dealer_ENG__c,
- Pro2_Dealer_Object__c
+ if(allotCodeList.size() > 0){
+ Map<String,String> errorMap = new Map<String,String>();
+ Map<String,String> exitBarCodeMap = new Map<String,String>();
+ List<Product2__c> product2InStore = [SELECT Id, Name,Name__c,Intra_Trade_List_RMB__c,Asset_Model_No__c,OT_CODE__c,Product2_Jancode__c,
+ Pro2_Dealer_ENG__c,Pro2_Dealer_Object__c
FROM Product2__c
- WHERE OT_CODE__c IN :allotCodeList AND (NOT Product_Type__c LIKE :userPro_Typestr)
- ];
- if (product2InStore.size() > 0) {
- for (Product2__c produ : product2InStore) {
- for (String bar : barOtcodeMap.keySet()) {
- if (barOtcodeMap.get(bar).containsKey(produ.OT_CODE__c)) {
- exitBarCodeMap.put(bar, bar);
+ WHERE OT_CODE__c in :allotCodeList
+ AND (not Product_Type__c like :userPro_Typestr)] ;
+ if(product2InStore.size() > 0){
+
+ for(Product2__c produ: product2InStore){
+ for(String bar: barOtcodeMap.keySet() ){
+ if(barOtcodeMap.get(bar).containsKey(produ.OT_CODE__c)){
+ exitBarCodeMap.put(bar,bar);
errorMap.put(bar, bar);
}
}
}
}
- if (errorMap.size() > 0) {
- ApexPages.addmessage(
- new ApexPages.message(
- ApexPages.severity.ERROR,
- 'BarCode鍙穂' + errorMap.values() + ']浜у搧绫诲瀷[' + product_Type + ']涓庣敤鎴穂' + userPro_Type + ']绫诲瀷涓嶇'
- )
- );
+ if(errorMap.size() > 0){
+ //LWC:Lwcflag鍜屾姤閿欐彁閱� update by Link 2023-04-27
+ if(isLwc){
+ errorList.add('BarCode鍙穂'+ errorMap.values() +']浜у搧绫诲瀷['+product_Type+']涓庣敤鎴穂'+userPro_Type+']绫诲瀷涓嶇');
+ }else {
+ ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR,'BarCode鍙穂'+ errorMap.values() +']浜у搧绫诲瀷['+product_Type+']涓庣敤鎴穂'+userPro_Type+']绫诲瀷涓嶇'));
+ }
}
- product2InStore = [
- SELECT
- Id,
- Name,
- Name__c,
- Intra_Trade_List_RMB__c,
- Asset_Model_No__c,
- OT_CODE__c,
- Product2_Jancode__c,
- Pro2_Dealer_ENG__c,
- Pro2_Dealer_Object__c
+ product2InStore = [SELECT Id, Name,Name__c,Intra_Trade_List_RMB__c,Asset_Model_No__c,OT_CODE__c,Product2_Jancode__c,
+ Pro2_Dealer_ENG__c,Pro2_Dealer_Object__c
FROM Product2__c
- WHERE OT_CODE__c IN :allotCodeList AND Product_Type__c LIKE :userPro_Typestr
- ];
-
- if (product2InStore.size() > 0) {
- for (Product2__c produ : product2InStore) {
- for (String bar : barOtcodeMap.keySet()) {
- Date expirationDate = null;
+ WHERE OT_CODE__c in :allotCodeList
+ AND Product_Type__c like :userPro_Typestr] ;
+
+ if(product2InStore.size() > 0){
+
+ for(Product2__c produ: product2InStore){
+ for(String bar: barOtcodeMap.keySet() ){
+ Date expirationDate = null ;
String serialNoorLotNo = '';
String tracingCode = '';
String productDateStr = '';
- Date productionDate = null;
+ Date productionDate = null ;
String expirationDateStr = '';
- if (barOtcodeMap.get(bar).containsKey(produ.OT_CODE__c)) {
+ if(barOtcodeMap.get(bar).containsKey(produ.OT_CODE__c)){
Integer oTcodeLength = produ.OT_CODE__c.length();
- if (bar.length() >= oTcodeLength + 11) {
- if (bar.substring(oTcodeLength + 3, oTcodeLength + 5) == '11') {
- try {
- productDateStr =
- '20' +
- bar.substring(oTcodeLength + 5, oTcodeLength + 7) +
- '-' +
- bar.substring(oTcodeLength + 7, oTcodeLength + 9) +
- '-01';
- productionDate = Date.valueOf(productDateStr);
- } catch (Exception e) {
- ApexPages.addmessage(
- new ApexPages.message(
- ApexPages.severity.ERROR,
- '浜у搧BarCode(' + bar + ')鐨勭敓浜ф棩鏈�' + productDateStr + '閿欒锛�'
- )
- );
- continue;
- }
- if (bar.length() >= oTcodeLength + 3 + 16) {
- if (bar.substring(oTcodeLength + 3 + 8, oTcodeLength + 3 + 10) == '17') {
- try {
- if (bar.substring(oTcodeLength + 3 + 14, oTcodeLength + 3 + 16) == '00') {
- expirationDateStr =
- '20' +
- bar.substring(oTcodeLength + 3 + 10, oTcodeLength + 3 + 12) +
- '-' +
- bar.substring(oTcodeLength + 3 + 12, oTcodeLength + 3 + 14) +
- '-' +
- '01';
- expirationDate = Date.valueOf(expirationDateStr);
- expirationDate = expirationDate.addMonths(1).toStartofMonth().addDays(-1);
- } else {
- expirationDateStr =
- '20' +
- bar.substring(oTcodeLength + 3 + 10, oTcodeLength + 3 + 12) +
- '-' +
- bar.substring(oTcodeLength + 3 + 12, oTcodeLength + 3 + 14) +
- '-' +
- bar.substring(oTcodeLength + 3 + 14, oTcodeLength + 3 + 16);
- expirationDate = Date.valueOf(expirationDateStr);
- }
- } catch (Exception e) {
- ApexPages.addmessage(
- new ApexPages.message(
- ApexPages.severity.ERROR,
- '浜у搧BarCode(' + bar + ')鐨勬粎鑿屾湁鍔规湡闄�' + expirationDateStr + '閿欒锛�'
- )
- );
- continue;
+ if(bar.length() >= oTcodeLength + 11){
+ if( bar.substring(oTcodeLength + 3,oTcodeLength + 5) =='11'){
+ try{
+ productDateStr = '20' + bar.substring(oTcodeLength + 5,oTcodeLength + 7) + '-' + bar.substring(oTcodeLength + 7,oTcodeLength + 9) + '-01' ;
+ productionDate = Date.valueOf(productDateStr);
+ }catch(Exception e){
+ //LWC:Lwcflag鍜屾姤閿欐彁閱� update by Link 2023-04-27
+ if(isLwc){
+ errorList.add('浜у搧BarCode(' + bar + ')鐨勭敓浜ф棩鏈�' + productDateStr + '閿欒锛�');
+ }else {
+ ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR, '浜у搧BarCode(' + bar + ')鐨勭敓浜ф棩鏈�' + productDateStr + '閿欒锛�'));
}
- if (bar.length() >= oTcodeLength + 3 + 25) {
- if (
- bar.substring(oTcodeLength + 3 + 16, oTcodeLength + 3 + 18) == '10' ||
- bar.substring(oTcodeLength + 3 + 16, oTcodeLength + 3 + 18) == '21'
- ) {
- serialNoorLotNo = bar.substring(oTcodeLength + 3 + 18, bar.length() - 8);
- //ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR, 'serialNoorLotNo' + serialNoorLotNo));
+ continue;
+ }
+ if(bar.length() >=oTcodeLength + 3 + 16){
+ if( bar.substring(oTcodeLength + 3 + 8,oTcodeLength + 3 + 10) =='17'){
+ try{
+ if(bar.substring(oTcodeLength + 3 + 14,oTcodeLength + 3 + 16)=='00'){
+ expirationDateStr = '20' + bar.substring(oTcodeLength + 3 + 10,oTcodeLength + 3 + 12) + '-' + bar.substring(oTcodeLength + 3 + 12,oTcodeLength + 3 + 14) + '-' + '01' ;
+ expirationDate = Date.valueOf(expirationDateStr);
+ expirationDate = expirationDate.addMonths(1).toStartofMonth().addDays(-1);
+ }else{
+ expirationDateStr = '20' + bar.substring(oTcodeLength + 3 + 10,oTcodeLength + 3 + 12) + '-' + bar.substring(oTcodeLength + 3 + 12,oTcodeLength + 3 + 14) + '-' +bar.substring(oTcodeLength + 3 + 14,oTcodeLength + 3 + 16) ;
+ expirationDate = Date.valueOf(expirationDateStr);
+ }
+ }catch(Exception e){
+ //LWC:Lwcflag鍜屾姤閿欐彁閱� update by Link 2023-04-27
+ if(isLwc){
+ errorList.add('浜у搧BarCode(' + bar + ')鐨勬粎鑿屾湁鍔规湡闄�' + expirationDateStr + '閿欒锛�');
+ }else {
+ ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR,'浜у搧BarCode(' + bar + ')鐨勬粎鑿屾湁鍔规湡闄�' + expirationDateStr + '閿欒锛�'));
+ }
+ continue;
}
+ if(bar.length() >= oTcodeLength + 3 + 25){
+ if(bar.substring(oTcodeLength + 3 + 16,oTcodeLength + 3 + 18) =='10' || bar.substring(oTcodeLength + 3 + 16,oTcodeLength + 3 + 18) =='21'){
+ serialNoorLotNo = bar.substring(oTcodeLength + 3 + 18,bar.length() - 8) ;
+ //ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR, 'serialNoorLotNo' + serialNoorLotNo));
+ }
+ }
+ }else if(bar.substring(oTcodeLength + 3 + 8,oTcodeLength + 3 + 10) =='10' || bar.substring(oTcodeLength + 3 + 8,oTcodeLength + 3 + 10) =='21'){
+ serialNoorLotNo = bar.substring(oTcodeLength + 3 + 10,bar.length() - 8) ;
+ //ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR, 'serialNoorLotNo' + serialNoorLotNo));
}
- } else if (
- bar.substring(oTcodeLength + 3 + 8, oTcodeLength + 3 + 10) == '10' ||
- bar.substring(oTcodeLength + 3 + 8, oTcodeLength + 3 + 10) == '21'
- ) {
- serialNoorLotNo = bar.substring(oTcodeLength + 3 + 10, bar.length() - 8);
- //ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR, 'serialNoorLotNo' + serialNoorLotNo));
}
- }
- } else if (bar.substring(oTcodeLength + 3, oTcodeLength + 5) == '17') {
- try {
- if (bar.substring(oTcodeLength + 3 + 6, oTcodeLength + 3 + 8) == '00') {
- expirationDateStr =
- '20' +
- bar.substring(oTcodeLength + 3 + 2, oTcodeLength + 3 + 4) +
- '-' +
- bar.substring(oTcodeLength + 3 + 4, oTcodeLength + 3 + 6) +
- '-01';
- expirationDate = Date.valueOf(expirationDateStr);
- expirationDate = expirationDate.addMonths(1).toStartofMonth().addDays(-1);
- } else {
- expirationDateStr =
- '20' +
- bar.substring(oTcodeLength + 3 + 2, oTcodeLength + 3 + 4) +
- '-' +
- bar.substring(oTcodeLength + 3 + 4, oTcodeLength + 3 + 6) +
- '-' +
- bar.substring(oTcodeLength + 3 + 6, oTcodeLength + 3 + 8);
- expirationDate = Date.valueOf(expirationDateStr);
+ }else if(bar.substring(oTcodeLength + 3,oTcodeLength + 5) =='17'){
+ try{
+ if(bar.substring(oTcodeLength + 3 + 6,oTcodeLength + 3 + 8)=='00'){
+ expirationDateStr = '20' + bar.substring(oTcodeLength + 3 + 2,oTcodeLength + 3 + 4) + '-' + bar.substring(oTcodeLength + 3 + 4,oTcodeLength + 3 + 6) + '-01';
+ expirationDate = Date.valueOf(expirationDateStr);
+ expirationDate = expirationDate.addMonths(1).toStartofMonth().addDays(-1);
+ }else{
+ expirationDateStr = '20' + bar.substring(oTcodeLength + 3 + 2,oTcodeLength + 3 + 4) + '-' + bar.substring(oTcodeLength + 3 + 4,oTcodeLength + 3 + 6) + '-' +bar.substring(oTcodeLength + 3 + 6,oTcodeLength + 3 + 8);
+ expirationDate = Date.valueOf(expirationDateStr);
+ }
+ }catch(Exception e){
+ //LWC:Lwcflag鍜屾姤閿欐彁閱� update by Link 2023-04-27
+ if(isLwc){
+ errorList.add('浜у搧BarCode(' + bar + ')鐨勬粎鑿屾湁鍔规湡闄�' + expirationDateStr + '閿欒锛�');
+ }else {
+ ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR,'浜у搧BarCode(' + bar + ')鐨勬粎鑿屾湁鍔规湡闄�' + expirationDateStr + '閿欒锛�'));
+ }
+ continue;
}
- } catch (Exception e) {
- ApexPages.addmessage(
- new ApexPages.message(
- ApexPages.severity.ERROR,
- '浜у搧BarCode(' + bar + ')鐨勬粎鑿屾湁鍔规湡闄�' + expirationDateStr + '閿欒锛�'
- )
- );
- continue;
- }
- if (bar.length() >= oTcodeLength + 20) {
- if (
- bar.substring(oTcodeLength + 3 + 8, oTcodeLength + 3 + 10) == '10' ||
- bar.substring(oTcodeLength + 3 + 8, oTcodeLength + 3 + 10) == '21'
- ) {
- serialNoorLotNo = bar.substring(oTcodeLength + 3 + 10, bar.length() - 8);
+ if(bar.length() >=oTcodeLength + 20){
+ if(bar.substring(oTcodeLength + 3 + 8,oTcodeLength + 3 + 10) =='10' || bar.substring(oTcodeLength + 3 + 8,oTcodeLength + 3 + 10) =='21'){
+ serialNoorLotNo = bar.substring(oTcodeLength + 3 + 10,bar.length() - 8) ;
+ }
}
- }
- } else if (bar.length() >= oTcodeLength + 12) {
- if (
- bar.substring(oTcodeLength + 3, oTcodeLength + 5) == '10' ||
- bar.substring(oTcodeLength + 3, oTcodeLength + 5) == '21'
- ) {
- serialNoorLotNo = bar.substring(oTcodeLength + 3 + 2, bar.length() - 8);
+
+ }else if(bar.length() >= oTcodeLength + 12){
+ if(bar.substring(oTcodeLength + 3,oTcodeLength + 5) =='10' || bar.substring(oTcodeLength + 3,oTcodeLength + 5) =='21'){
+ serialNoorLotNo = bar.substring(oTcodeLength + 3 + 2,bar.length() - 8) ;
+ }
}
}
- }
- if (bar.length() >= oTcodeLength + 3 + 8 && bar.substring(bar.length() - 8, bar.length() - 5) == '250') {
- if (bar.substring(bar.length() - 8, bar.length() - 5) == '250') {
- tracingCode = bar.substring(bar.length() - 5, bar.length());
- Matcher n = Pattern.compile('[0-9]').matcher(tracingCode);
- if (n.find()) {
- String str = '绠$悊缂栫爜涓嶆纭紝璇蜂笌绠$悊鍛樼‘璁ゆ槸鍚﹂敊璇��';
- ApexPages.addmessage(
- new ApexPages.message(
- ApexPages.severity.ERROR,
- '浜у搧BarCode(' + bar + ')绠$悊缂栫爜涓湁鏁板瓧锛岃涓庣鐞嗗憳纭鏄惁閿欒锛�'
- )
- );
+ if(bar.length() >= oTcodeLength + 3 + 8 && bar.substring(bar.length() - 8,bar.length()-5)=='250'){
+ if(bar.substring(bar.length() - 8,bar.length()-5)=='250'){
+ tracingCode = bar.substring(bar.length() - 5,bar.length());
+ Matcher n = Pattern.compile('[0-9]').matcher(tracingCode);
+ if(n.find()){
+ // gzw DB202305352696 鍏ュ簱绠$悊缂栫爜楠岃瘉绋嬪簭璋冩暣 start
+ if (tracingCode.length() == 5) {
+ String tr = tracingCode;
+ String Ctr = tr.substring(tr.length() - 3,tr.length());
+ String Btr = tr.substring(tr.length() - 4,tr.length()-3);
+ String Atr = tr.substring(tr.length() - 5,tr.length()-4);
+ if (Pattern.compile('[0-9]').matcher(Atr).find() || Pattern.compile('[0-9]').matcher(Ctr).find()) {
+ String str = '绠$悊缂栫爜涓嶆纭紝璇蜂笌绠$悊鍛樼‘璁ゆ槸鍚﹂敊璇��';
+ //LWC:Lwcflag鍜屾姤閿欐彁閱� update by Link 2023-04-27
+ if(isLwc){
+ errorList.add('浜у搧BarCode(' + bar + ')绠$悊缂栫爜鏈夎锛岃妫�鏌ユ潯褰㈢爜鏁版嵁銆�');
+ }else {
+ ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR,'浜у搧BarCode(' + bar + ')绠$悊缂栫爜鏈夎锛岃妫�鏌ユ潯褰㈢爜鏁版嵁銆�'));
+ }
+ continue;
+ }
+ }
+ // String str = '绠$悊缂栫爜涓嶆纭紝璇蜂笌绠$悊鍛樼‘璁ゆ槸鍚﹂敊璇��';
+ // ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR,'浜у搧BarCode(' + bar + ')绠$悊缂栫爜涓湁鏁板瓧锛岃涓庣鐞嗗憳纭鏄惁閿欒锛�'));
+ // continue;
+ // gzw DB202305352696 鍏ュ簱绠$悊缂栫爜楠岃瘉绋嬪簭璋冩暣 end
+ }
+ }else{
+ //LWC:Lwcflag鍜屾姤閿欐彁閱� update by Link 2023-04-27
+ if(isLwc){
+ errorList.add('浜у搧BarCode(' + bar + ')鐨則racingCode閿欒锛�');
+ }else {
+ ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR,'浜у搧BarCode(' + bar + ')鐨則racingCode閿欒锛�'));
+ }
continue;
}
- } else {
- ApexPages.addmessage(
- new ApexPages.message(ApexPages.severity.ERROR, '浜у搧BarCode(' + bar + ')鐨則racingCode閿欒锛�')
- );
- continue;
}
- }
- exitBarCodeMap.put(bar, bar);
- List<String> barcodedetList = new List<String>();
- barcodedetList.add(bar);
- barcodedetList.add(String.valueOf(expirationDate));
- barcodedetList.add(serialNoorLotNo);
- barcodedetList.add(tracingCode);
- consumableInventory.add(new ConsumableorderdetailsInfo(produ, barcodedetList));
- consumableInventoryUse.add(new ConsumableorderdetailsInfo(produ, barcodedetList));
+ exitBarCodeMap.put(bar,bar);
+ List<String> barcodedetList = new List<String>();
+ barcodedetList.add(bar);
+ barcodedetList.add(String.valueOf(expirationDate));
+ barcodedetList.add(serialNoorLotNo);
+ barcodedetList.add(tracingCode);
+ consumableInventory.add(new ConsumableorderdetailsInfo(produ,barcodedetList));
+ consumableInventoryUse.add(new ConsumableorderdetailsInfo(produ,barcodedetList));
+
}
}
+
}
}
- for (String bartxt : barCode241List) {
- if (!exitBarCodeMap.containsKey(bartxt)) {
- if (!errorMap.containsKey(bartxt)) {
- notInStorelist.add(bartxt);
- }
- }
+ for(String bartxt :barCode241List){
+ if(!exitBarCodeMap.containsKey(bartxt)){
+ if(!errorMap.containsKey(bartxt)){
+ notInStorelist.add(bartxt);
+ }
+ }
}
}
+
}
- public void inventoryEntry(List<String> barCodeList) {
+
+ public void inventoryEntry (List<String> barCodeList){
//鎵�鏈塨arcode瑙f瀽鍒扮殑Jancode
List<String> alljanCodeList = new List<String>();
List<String> allotCodeList = new List<String>();
List<String> barCode01List = new List<String>();
List<String> barCode241List = new List<String>();
- Map<String, Map<String, String>> barJancodeMap = new Map<String, Map<String, String>>();
- Map<String, Map<String, String>> barOtcodeMap = new Map<String, Map<String, String>>();
- Map<String, List<String>> barcodeinfoMap = new Map<String, List<String>>();
+ Map<String,Map<String,String>> barJancodeMap = new Map<String,Map<String,String>>();
+ Map<String,Map<String,String>> barOtcodeMap = new Map<String,Map<String,String>>();
+ Map<String,List<String>> barcodeinfoMap = new Map<String,List<String>>();
notInStorelist.clear();
notEqualBARcodeCunMap.clear();
- Map<String, String> orderdetailMap = new Map<String, String>();
- List<Consumable_Orderdetails__c> orderdetail = [
- SELECT Id, Name, Consumable_order__c, Consumable_Product__c, Asset_Model_No__c
- FROM Consumable_Orderdetails__c
- WHERE
- Consumable_order__r.Dealer_Info__c = :accountid
- AND Consumable_order__c != NULL
- AND Consumable_order__c = :ESetId
- AND Order_Owner_WorkLocal__c = :userWorkLocation
- ORDER BY Name
- ];
- for (Integer i = 0; i < orderdetail.size(); i++) {
+ Map<String,String> orderdetailMap = new Map<String,String>();
+ List<Consumable_Orderdetails__c> orderdetail = [SELECT Id, Name, Consumable_order__c,
+ Consumable_Product__c,Asset_Model_No__c
+ FROM Consumable_Orderdetails__c
+ WHERE Consumable_order__r.Dealer_Info__c = :accountid
+ AND Consumable_order__c != null
+ AND Consumable_order__c = :ESetId
+ AND Order_Owner_WorkLocal__c = :userWorkLocation
+ ORDER BY Name ];
+ for(Integer i = 0; i < orderdetail.size(); i++){
orderdetailMap.put(orderdetail[i].Consumable_Product__c, orderdetail[i].Consumable_Product__c);
}
- for (Integer i = 0; i < barCodeList.size(); i++) {
- Date expirationDate = null;
+ for(Integer i = 0; i < barCodeList.size(); i++){
+ Date expirationDate = null ;
String serialNoorLotNo = '';
String tracingCode = '';
String productDateStr = '';
- Date productionDate = null;
+ Date productionDate = null ;
String expirationDateStr = '';
- if (barCodeList[i].substring(0, 2) == '01') {
+ if(barCodeList[i].substring(0,2) =='01'){
String janCodeMark = '';
//鐢熶骇鏃ユ湡
List<String> janCode = new List<String>();
- if (barCodeList[i].length() < 16) {
- ApexPages.addmessage(
- new ApexPages.message(ApexPages.severity.ERROR, '浜у搧BarCode(' + barCodeList[i] + ')鐨勪綅鏁颁笉瓒�16锛屼笉绗﹀悎瑕佹眰閿欒锛�')
- );
+ if(barCodeList[i].length() < 16){
+ //LWC:Lwcflag鍜屾姤閿欐彁閱� update by Link 2023-04-27
+ if(isLwc){
+ errorList.add('浜у搧BarCode(' + barCodeList[i] + ')鐨勪綅鏁颁笉瓒�16锛屼笉绗﹀悎瑕佹眰閿欒锛�');
+ }else {
+ ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR,'浜у搧BarCode(' + barCodeList[i] + ')鐨勪綅鏁颁笉瓒�16锛屼笉绗﹀悎瑕佹眰閿欒锛�'));
+ }
continue;
- } else {
- janCodeMark = barCodeList[i].substring(2, 16);
- try {
- Decimal test = Decimal.valueOf(janCodeMark);
- } catch (Exception e) {
- ApexPages.addmessage(
- new ApexPages.message(ApexPages.severity.ERROR, '浜у搧BarCode(' + barCodeList[i] + ')鐨刯anCode閿欒锛�')
- );
+ }else {
+ janCodeMark = barCodeList[i].substring(2,16);
+ try{
+ Decimal test = Decimal.valueOf(janCodeMark);
+ }catch(Exception e){
+ //LWC:Lwcflag鍜屾姤閿欐彁閱� update by Link 2023-04-27
+ if(isLwc){
+ errorList.add('浜у搧BarCode(' + barCodeList[i] + ')鐨刯anCode閿欒锛�');
+ }else {
+ ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR,'浜у搧BarCode(' + barCodeList[i] + ')鐨刯anCode閿欒锛�'));
+ }
continue;
}
}
- if (barCodeList[i].length() >= 22) {
- if (barCodeList[i].substring(barCodeList[i].length() - 8, barCodeList[i].length() - 5) != '250') {
- ApexPages.addmessage(
- new ApexPages.message(ApexPages.severity.ERROR, '浜у搧BarCode(' + barCodeList[i] + ')娌℃湁绠$悊缂栫爜锛�')
- );
+ if(barCodeList[i].length() >= 22){
+ if(barCodeList[i].substring(barCodeList[i].length() - 8,barCodeList[i].length()-5)!='250'){
+ //LWC:Lwcflag鍜屾姤閿欐彁閱� update by Link 2023-04-27
+ if(isLwc){
+ errorList.add('浜у搧BarCode(' + barCodeList[i] + ')娌℃湁绠$悊缂栫爜锛�');
+ }else {
+ ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR, '浜у搧BarCode(' + barCodeList[i] + ')娌℃湁绠$悊缂栫爜锛�'));
+ }
continue;
}
- if (barCodeList[i].substring(16, 18) == '11') {
- try {
- productDateStr = '20' + barCodeList[i].substring(18, 20) + '-' + barCodeList[i].substring(20, 22) + '-01';
+ if( barCodeList[i].substring(16,18) =='11'){
+ try{
+ productDateStr = '20' + barCodeList[i].substring(18,20) + '-' + barCodeList[i].substring(20,22) + '-01' ;
productionDate = Date.valueOf(productDateStr);
- } catch (Exception e) {
- ApexPages.addmessage(
- new ApexPages.message(
- ApexPages.severity.ERROR,
- '浜у搧BarCode(' + barCodeList[i] + ')鐨勭敓浜ф棩鏈�' + productDateStr + '閿欒锛�'
- )
- );
+ }catch(Exception e){
+ //LWC:Lwcflag鍜屾姤閿欐彁閱� update by Link 2023-04-27
+ if(isLwc){
+ errorList.add('浜у搧BarCode(' + barCodeList[i] + ')鐨勭敓浜ф棩鏈�' + productDateStr + '閿欒锛�');
+ }else {
+ ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR, '浜у搧BarCode(' + barCodeList[i] + ')鐨勭敓浜ф棩鏈�' + productDateStr + '閿欒锛�'));
+ }
continue;
}
- if (barCodeList[i].length() >= 32) {
- if (barCodeList[i].substring(24, 26) == '17') {
- try {
- if (barCodeList[i].substring(30, 32) == '00') {
- expirationDateStr =
- '20' +
- barCodeList[i].substring(26, 28) +
- '-' +
- barCodeList[i].substring(28, 30) +
- '-' +
- '01';
+ if(barCodeList[i].length() >=32){
+ if( barCodeList[i].substring(24,26) =='17'){
+ try{
+ if(barCodeList[i].substring(30,32)=='00'){
+ expirationDateStr = '20' + barCodeList[i].substring(26,28) + '-' + barCodeList[i].substring(28,30) + '-' + '01' ;
expirationDate = Date.valueOf(expirationDateStr);
expirationDate = expirationDate.addMonths(1).toStartofMonth().addDays(-1);
- } else {
- expirationDateStr =
- '20' +
- barCodeList[i].substring(26, 28) +
- '-' +
- barCodeList[i].substring(28, 30) +
- '-' +
- barCodeList[i].substring(30, 32);
- expirationDate = Date.valueOf(expirationDateStr);
+ }else{
+ expirationDateStr = '20' + barCodeList[i].substring(26,28) + '-' + barCodeList[i].substring(28,30) + '-' +barCodeList[i].substring(30,32) ;
+ expirationDate = Date.valueOf(expirationDateStr);
}
- } catch (Exception e) {
- ApexPages.addmessage(
- new ApexPages.message(
- ApexPages.severity.ERROR,
- '浜у搧BarCode(' + barCodeList[i] + ')鐨勬粎鑿屾湁鍔规湡闄�' + expirationDateStr + '閿欒锛�'
- )
- );
+ }catch(Exception e){
+ //LWC:Lwcflag鍜屾姤閿欐彁閱� update by Link 2023-04-27
+ if(isLwc){
+ errorList.add('浜у搧BarCode(' + barCodeList[i] + ')鐨勬粎鑿屾湁鍔规湡闄�' + expirationDateStr + '閿欒锛�');
+ }else {
+ ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR,'浜у搧BarCode(' + barCodeList[i] + ')鐨勬粎鑿屾湁鍔规湡闄�' + expirationDateStr + '閿欒锛�'));
+ }
continue;
}
- if (barCodeList[i].length() >= 42) {
- if (barCodeList[i].substring(32, 34) == '10' || barCodeList[i].substring(32, 34) == '21') {
- serialNoorLotNo = barCodeList[i].substring(34, barCodeList[i].length() - 8);
+ if(barCodeList[i].length() >= 42){
+ if(barCodeList[i].substring(32,34) =='10' || barCodeList[i].substring(32,34) =='21'){
+ serialNoorLotNo = barCodeList[i].substring(34,barCodeList[i].length() - 8) ;
}
}
- } else if (barCodeList[i].substring(24, 26) == '10' || barCodeList[i].substring(24, 26) == '21') {
- serialNoorLotNo = barCodeList[i].substring(26, barCodeList[i].length() - 8);
+ }else if(barCodeList[i].substring(24,26) =='10' || barCodeList[i].substring(24,26) =='21'){
+ serialNoorLotNo = barCodeList[i].substring(26,barCodeList[i].length() - 8) ;
}
}
- } else if (barCodeList[i].substring(16, 18) == '17') {
- try {
- if (barCodeList[i].substring(22, 24) == '00') {
- expirationDateStr =
- '20' +
- barCodeList[i].substring(18, 20) +
- '-' +
- barCodeList[i].substring(20, 22) +
- '-01';
+ }else if(barCodeList[i].substring(16,18) =='17'){
+ try{
+ if(barCodeList[i].substring(22,24)=='00'){
+ expirationDateStr = '20' + barCodeList[i].substring(18,20) + '-' + barCodeList[i].substring(20,22) + '-01';
//ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR,'浜у搧expirationDateStr' + expirationDateStr));
expirationDate = Date.valueOf(expirationDateStr);
expirationDate = expirationDate.addMonths(1).toStartofMonth().addDays(-1);
- } else {
- expirationDateStr =
- '20' +
- barCodeList[i].substring(18, 20) +
- '-' +
- barCodeList[i].substring(20, 22) +
- '-' +
- barCodeList[i].substring(22, 24);
+ }else{
+ expirationDateStr = '20' + barCodeList[i].substring(18,20) + '-' + barCodeList[i].substring(20,22) + '-' +barCodeList[i].substring(22,24);
expirationDate = Date.valueOf(expirationDateStr);
}
- } catch (Exception e) {
- ApexPages.addmessage(
- new ApexPages.message(
- ApexPages.severity.ERROR,
- '浜у搧BarCode(' + barCodeList[i] + ')鐨勬粎鑿屾湁鍔规湡闄�' + expirationDateStr + '閿欒锛�'
- )
- );
+ }catch(Exception e){
+ //LWC:Lwcflag鍜屾姤閿欐彁閱� update by Link 2023-04-27
+ if(isLwc){
+ errorList.add('浜у搧BarCode(' + barCodeList[i] + ')鐨勬粎鑿屾湁鍔规湡闄�' + expirationDateStr + '閿欒锛�');
+ }else {
+ ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR,'浜у搧BarCode(' + barCodeList[i] + ')鐨勬粎鑿屾湁鍔规湡闄�' + expirationDateStr + '閿欒锛�'));
+ }
continue;
}
- if (barCodeList[i].length() >= 34) {
- if (barCodeList[i].substring(24, 26) == '10' || barCodeList[i].substring(24, 26) == '21') {
- serialNoorLotNo = barCodeList[i].substring(26, barCodeList[i].length() - 8);
+ if(barCodeList[i].length() >= 34){
+ if(barCodeList[i].substring(24,26) =='10' || barCodeList[i].substring(24,26) =='21'){
+ serialNoorLotNo = barCodeList[i].substring(26,barCodeList[i].length() - 8) ;
}
}
- } else if (barCodeList[i].length() >= 26) {
- if (barCodeList[i].substring(16, 18) == '10' || barCodeList[i].substring(16, 18) == '21') {
- serialNoorLotNo = barCodeList[i].substring(18, barCodeList[i].length() - 8);
+
+ }else if(barCodeList[i].length() >= 26){
+ if(barCodeList[i].substring(16,18) =='10' || barCodeList[i].substring(16,18) =='21'){
+ serialNoorLotNo = barCodeList[i].substring(18,barCodeList[i].length() - 8) ;
}
}
}
- if (
- barCodeList[i].length() >= 24 &&
- barCodeList[i].substring(barCodeList[i].length() - 8, barCodeList[i].length() - 5) == '250'
- ) {
- if (barCodeList[i].substring(barCodeList[i].length() - 8, barCodeList[i].length() - 5) == '250') {
- tracingCode = barCodeList[i].substring(barCodeList[i].length() - 5, barCodeList[i].length());
+ if(barCodeList[i].length() >= 24 && barCodeList[i].substring(barCodeList[i].length() - 8,barCodeList[i].length()-5)=='250'){
+ if(barCodeList[i].substring(barCodeList[i].length() - 8,barCodeList[i].length()-5)=='250'){
+ tracingCode = barCodeList[i].substring(barCodeList[i].length() - 5,barCodeList[i].length());
Matcher n = Pattern.compile('[0-9]').matcher(tracingCode);
- if (n.find()) {
- String str = '绠$悊缂栫爜涓嶆纭紝璇蜂笌绠$悊鍛樼‘璁ゆ槸鍚﹂敊璇��';
- ApexPages.addmessage(
- new ApexPages.message(
- ApexPages.severity.ERROR,
- '浜у搧BarCode(' + barCodeList[i] + ')绠$悊缂栫爜涓湁鏁板瓧锛岃涓庣鐞嗗憳纭鏄惁閿欒锛�'
- )
- );
- continue;
+ if(n.find()){
+ // gzw DB202305352696 鍏ュ簱绠$悊缂栫爜楠岃瘉绋嬪簭璋冩暣 start
+ if (tracingCode.length() == 5) {
+ String tr = tracingCode;
+ String Ctr = tr.substring(tr.length() - 3,tr.length());
+ String Btr = tr.substring(tr.length() - 4,tr.length()-3);
+ String Atr = tr.substring(tr.length() - 5,tr.length()-4);
+ if (Pattern.compile('[0-9]').matcher(Atr).find() || Pattern.compile('[0-9]').matcher(Ctr).find()) {
+ String str = '绠$悊缂栫爜涓嶆纭紝璇蜂笌绠$悊鍛樼‘璁ゆ槸鍚﹂敊璇��';
+ //LWC:Lwcflag鍜屾姤閿欐彁閱� update by Link 2023-04-27
+ if(isLwc){
+ errorList.add('浜у搧BarCode(' + barCodeList[i] + ')绠$悊缂栫爜鏈夎锛岃妫�鏌ユ潯褰㈢爜鏁版嵁銆�');
+ }else {
+ ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR,'浜у搧BarCode(' + barCodeList[i] + ')绠$悊缂栫爜鏈夎锛岃妫�鏌ユ潯褰㈢爜鏁版嵁銆�'));
+ }
+ continue;
+ }
+ }
+ // String str = '绠$悊缂栫爜涓嶆纭紝璇蜂笌绠$悊鍛樼‘璁ゆ槸鍚﹂敊璇��';
+ // ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR,'浜у搧BarCode(' + barCodeList[i] + ')绠$悊缂栫爜涓湁鏁板瓧锛岃涓庣鐞嗗憳纭鏄惁閿欒锛�'));
+ // continue;
+ // gzw DB202305352696 鍏ュ簱绠$悊缂栫爜楠岃瘉绋嬪簭璋冩暣 end
}
- } else {
- ApexPages.addmessage(
- new ApexPages.message(ApexPages.severity.ERROR, '浜у搧BarCode(' + barCodeList[i] + ')鐨則racingCode閿欒锛�')
- );
+ }else{
+ //LWC:Lwcflag鍜屾姤閿欐彁閱� update by Link 2023-04-27
+ if(isLwc){
+ errorList.add('浜у搧BarCode(' + barCodeList[i] + ')鐨則racingCode閿欒锛�');
+ }else {
+ ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR,'浜у搧BarCode(' + barCodeList[i] + ')鐨則racingCode閿欒锛�'));
+ }
continue;
}
}
@@ -2679,397 +2435,338 @@
barcodedetList.add(String.valueOf(expirationDate));
barcodedetList.add(serialNoorLotNo);
barcodedetList.add(tracingCode);
- Integer jan1 = Integer.valueOf(janCodeMark.substring(0, 1));
- Integer jan2 = Integer.valueOf(janCodeMark.substring(1, 2));
- Integer jan3 = Integer.valueOf(janCodeMark.substring(2, 3));
- Integer jan4 = Integer.valueOf(janCodeMark.substring(3, 4));
- Integer jan5 = Integer.valueOf(janCodeMark.substring(4, 5));
- Integer jan6 = Integer.valueOf(janCodeMark.substring(5, 6));
- Integer jan7 = Integer.valueOf(janCodeMark.substring(6, 7));
- Integer jan8 = Integer.valueOf(janCodeMark.substring(7, 8));
- Integer jan9 = Integer.valueOf(janCodeMark.substring(8, 9));
+ Integer jan1 = Integer.valueOf(janCodeMark.substring(0, 1));
+ Integer jan2 = Integer.valueOf(janCodeMark.substring(1, 2));
+ Integer jan3 = Integer.valueOf(janCodeMark.substring(2, 3));
+ Integer jan4 = Integer.valueOf(janCodeMark.substring(3, 4));
+ Integer jan5 = Integer.valueOf(janCodeMark.substring(4, 5));
+ Integer jan6 = Integer.valueOf(janCodeMark.substring(5, 6));
+ Integer jan7 = Integer.valueOf(janCodeMark.substring(6, 7));
+ Integer jan8 = Integer.valueOf(janCodeMark.substring(7, 8));
+ Integer jan9 = Integer.valueOf(janCodeMark.substring(8, 9));
Integer jan10 = Integer.valueOf(janCodeMark.substring(9, 10));
Integer jan11 = Integer.valueOf(janCodeMark.substring(10, 11));
Integer jan12 = Integer.valueOf(janCodeMark.substring(11, 12));
Integer jan13 = Integer.valueOf(janCodeMark.substring(12, 13));
- Integer count12 =
- jan2 +
- jan3 * 3 +
- jan4 +
- jan5 * 3 +
- jan6 +
- jan7 * 3 +
- jan8 +
- jan9 * 3 +
- jan10 +
- jan11 * 3 +
- jan12 +
- jan13 * 3;
-
- Integer count13 =
- jan1 * 3 +
- jan2 +
- jan3 * 3 +
- jan4 +
- jan5 * 3 +
- jan6 +
- jan7 * 3 +
- jan8 +
- jan9 * 3 +
- jan10 +
- jan11 * 3 +
- jan12 +
- jan13 * 3;
- String frost12 = (String.valueOf(count12)).substring((String.valueOf(count12)).length() - 1);
- String frost13 = (String.valueOf(count13)).substring((String.valueOf(count13)).length() - 1);
+ Integer count12 = jan2 + jan3*3 + jan4 + jan5*3 + jan6 + jan7*3 + jan8 + jan9*3 + jan10 + jan11*3 +jan12 + jan13*3;
+
+ Integer count13 = jan1*3 + jan2 + jan3*3 + jan4 + jan5*3 + jan6 + jan7*3 + jan8 + jan9*3 + jan10 + jan11*3 +jan12 + jan13*3;
+ String frost12 = (String.valueOf(count12)).substring((String.valueOf(count12)).length()-1);
+ String frost13 = (String.valueOf(count13)).substring((String.valueOf(count13)).length()-1);
//鍑忓幓12浣嶄釜浣�4
- frost12 = (String.valueOf(10 - Integer.valueOf(frost12)))
- .substring((String.valueOf(10 - Integer.valueOf(frost12))).length() - 1);
- frost13 = (String.valueOf(10 - Integer.valueOf(frost13)))
- .substring((String.valueOf(10 - Integer.valueOf(frost13))).length() - 1);
-
+ frost12 = (String.valueOf(10 - Integer.valueOf(frost12))).substring((String.valueOf(10 - Integer.valueOf(frost12))).length()-1);
+ frost13 = (String.valueOf(10 - Integer.valueOf(frost13))).substring((String.valueOf(10 - Integer.valueOf(frost13))).length()-1);
+
janCode.add(janCodeMark.substring(1, 13) + frost12);
janCode.add(janCodeMark.substring(0, 13) + frost12);
janCode.add(janCodeMark.substring(1, 13) + frost13);
janCode.add(janCodeMark.substring(0, 13) + frost13);
alljanCodeList.addAll(janCode);
- Map<String, String> janCodeMap = new Map<String, String>();
- janCodeMap.put(janCodeMark.substring(1, 13) + frost12, barCodeList[i]);
- janCodeMap.put(janCodeMark.substring(0, 13) + frost12, barCodeList[i]);
- janCodeMap.put(janCodeMark.substring(1, 13) + frost13, barCodeList[i]);
- janCodeMap.put(janCodeMark.substring(0, 13) + frost13, barCodeList[i]);
+ Map<String,String> janCodeMap = new Map<String,String>();
+ janCodeMap.put(janCodeMark.substring(1, 13) + frost12,barCodeList[i]);
+ janCodeMap.put(janCodeMark.substring(0, 13) + frost12,barCodeList[i]);
+ janCodeMap.put(janCodeMark.substring(1, 13) + frost13,barCodeList[i]);
+ janCodeMap.put(janCodeMark.substring(0, 13) + frost13,barCodeList[i]);
barJancodeMap.put(barCodeList[i], janCodeMap);
barcodeinfoMap.put(barCodeList[i], barcodedetList);
barCode01List.add(barCodeList[i]);
- } else if (barCodeList[i].substring(0, 3) == '241') {
- if (
- barCodeList[i].length() > 8 &&
- barCodeList[i].substring(barCodeList[i].length() - 8, barCodeList[i].length() - 5) != '250'
- ) {
- ApexPages.addmessage(
- new ApexPages.message(ApexPages.severity.ERROR, '浜у搧BarCode(' + barCodeList[i] + ')娌℃湁绠$悊缂栫爜锛�')
- );
+ }else if(barCodeList[i].substring(0,3) =='241'){
+ if(barCodeList[i].length() > 8 && barCodeList[i].substring(barCodeList[i].length() - 8,barCodeList[i].length()-5)!='250'){
+ //LWC:Lwcflag鍜屾姤閿欐彁閱� update by Link 2023-04-27
+ if(isLwc){
+ errorList.add('浜у搧BarCode(' + barCodeList[i] + ')娌℃湁绠$悊缂栫爜锛�');
+ }else {
+ ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR, '浜у搧BarCode(' + barCodeList[i] + ')娌℃湁绠$悊缂栫爜锛�'));
+ }
continue;
}
List<String> otCodeList = new List<String>();
- Map<String, String> otCodeMap = new Map<String, String>();
- if (barCodeList[i].length() < 7) {
- ApexPages.addmessage(
- new ApexPages.message(ApexPages.severity.ERROR, '浜у搧BarCode(' + barCodeList[i] + ')鐨勪綅鏁颁笉瓒�16锛屼笉绗﹀悎瑕佹眰閿欒锛�')
- );
+ Map<String,String> otCodeMap = new Map<String,String>();
+ if(barCodeList[i].length() < 7){
+ //LWC:Lwcflag鍜屾姤閿欐彁閱� update by Link 2023-04-27
+ if(isLwc){
+ errorList.add('浜у搧BarCode(' + barCodeList[i] + ')鐨勪綅鏁颁笉瓒�16锛屼笉绗﹀悎瑕佹眰閿欒锛�');
+ }else {
+ ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR,'浜у搧BarCode(' + barCodeList[i] + ')鐨勪綅鏁颁笉瓒�16锛屼笉绗﹀悎瑕佹眰閿欒锛�'));
+ }
continue;
- } else if (barCodeList[i].length() == 11) {
- String otCode4 = barCodeList[i].substring(3, 7);
- String otCode5 = barCodeList[i].substring(3, 8);
- String otCode6 = barCodeList[i].substring(3, 9);
- String otCode7 = barCodeList[i].substring(3, 10);
- String otCode8 = barCodeList[i].substring(3, 11);
+ }else if(barCodeList[i].length() == 11){
+ String otCode4 = barCodeList[i].substring(3,7);
+ String otCode5 = barCodeList[i].substring(3,8);
+ String otCode6 = barCodeList[i].substring(3,9);
+ String otCode7 = barCodeList[i].substring(3,10);
+ String otCode8 = barCodeList[i].substring(3,11);
otCodeList.add(otCode4);
otCodeList.add(otCode5);
otCodeList.add(otCode6);
otCodeList.add(otCode7);
otCodeList.add(otCode8);
- otCodeMap.put(otCode4, barCodeList[i]);
- otCodeMap.put(otCode5, barCodeList[i]);
- otCodeMap.put(otCode6, barCodeList[i]);
- otCodeMap.put(otCode7, barCodeList[i]);
- otCodeMap.put(otCode8, barCodeList[i]);
- } else if (barCodeList[i].length() >= 12) {
- String otCode4 = barCodeList[i].substring(3, 7);
- String otCode5 = barCodeList[i].substring(3, 8);
- String otCode6 = barCodeList[i].substring(3, 9);
- String otCode7 = barCodeList[i].substring(3, 10);
- String otCode8 = barCodeList[i].substring(3, 11);
- String otCode9 = barCodeList[i].substring(3, 12);
+ otCodeMap.put(otCode4,barCodeList[i]);
+ otCodeMap.put(otCode5,barCodeList[i]);
+ otCodeMap.put(otCode6,barCodeList[i]);
+ otCodeMap.put(otCode7,barCodeList[i]);
+ otCodeMap.put(otCode8,barCodeList[i]);
+ }else if(barCodeList[i].length() >= 12){
+ String otCode4 = barCodeList[i].substring(3,7);
+ String otCode5 = barCodeList[i].substring(3,8);
+ String otCode6 = barCodeList[i].substring(3,9);
+ String otCode7 = barCodeList[i].substring(3,10);
+ String otCode8 = barCodeList[i].substring(3,11);
+ String otCode9 = barCodeList[i].substring(3,12);
otCodeList.add(otCode4);
otCodeList.add(otCode5);
otCodeList.add(otCode6);
otCodeList.add(otCode7);
otCodeList.add(otCode8);
otCodeList.add(otCode9);
- otCodeMap.put(otCode4, barCodeList[i]);
- otCodeMap.put(otCode5, barCodeList[i]);
- otCodeMap.put(otCode6, barCodeList[i]);
- otCodeMap.put(otCode7, barCodeList[i]);
- otCodeMap.put(otCode8, barCodeList[i]);
- otCodeMap.put(otCode9, barCodeList[i]);
+ otCodeMap.put(otCode4,barCodeList[i]);
+ otCodeMap.put(otCode5,barCodeList[i]);
+ otCodeMap.put(otCode6,barCodeList[i]);
+ otCodeMap.put(otCode7,barCodeList[i]);
+ otCodeMap.put(otCode8,barCodeList[i]);
+ otCodeMap.put(otCode9,barCodeList[i]);
}
allotCodeList.addAll(otCodeList);
barOtcodeMap.put(barCodeList[i], otCodeMap);
barCode241List.add(barCodeList[i]);
- } else {
- ApexPages.addmessage(
- new ApexPages.message(ApexPages.severity.ERROR, '浜у搧BarCode(' + barCodeList[i] + ')娌℃湁janCode鎴朞Tcode锛屼笉绗﹀悎瑕佹眰锛�')
- );
+ }else{
+ //LWC:Lwcflag鍜屾姤閿欐彁閱� update by Link 2023-04-27
+ if(isLwc){
+ errorList.add('浜у搧BarCode(' + barCodeList[i] + ')娌℃湁janCode鎴朞Tcode锛屼笉绗﹀悎瑕佹眰锛�');
+ }else {
+ ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR,'浜у搧BarCode(' + barCodeList[i] + ')娌℃湁janCode鎴朞Tcode锛屼笉绗﹀悎瑕佹眰锛�'));
+ }
continue;
}
}
//01閫氳繃妫�绱骇鍝佹槸鍚﹀瓨鍦�
- Map<String, String> rightBar = new Map<String, String>();
- if (alljanCodeList.size() > 0) {
- Map<String, String> exitBarCodeMap = new Map<String, String>();
- List<Product2__c> product2InStore = [
- SELECT
- Id,
- Name,
- Name__c,
- Intra_Trade_List_RMB__c,
- Asset_Model_No__c,
- OT_CODE__c,
- Product2_Jancode__c,
- Pro2_Dealer_ENG__c,
- Pro2_Dealer_Object__c,
- Product_Type__c
- FROM Product2__c
- WHERE Product2_Jancode__c IN :alljanCodeList AND (NOT Product_Type__c LIKE :userPro_Typestr)
- ORDER BY SFDA_Expiration_Date__c DESC
- ];
- if (product2InStore.size() > 0) {
- Map<String, String> errorMap = new Map<String, String>();
- for (Product2__c produ : product2InStore) {
- for (String bar : barJancodeMap.keySet()) {
- if (barJancodeMap.get(bar).containsKey(produ.Product2_Jancode__c) && !rightBar.containsKey(bar)) {
- exitBarCodeMap.put(bar, bar);
+ Map<String,String> rightBar = new Map<String,String>();
+ if(alljanCodeList.size() > 0){
+ Map<String,String> exitBarCodeMap = new Map<String,String>();
+ List<Product2__c> product2InStore = [SELECT Id, Name,Name__c,Intra_Trade_List_RMB__c,Asset_Model_No__c,OT_CODE__c,Product2_Jancode__c,
+ Pro2_Dealer_ENG__c,Pro2_Dealer_Object__c,
+ Product_Type__c
+ FROM Product2__c
+ WHERE Product2_Jancode__c in :alljanCodeList
+ AND (not Product_Type__c like :userPro_Typestr)
+ order by SFDA_Expiration_Date__c desc ] ;
+ if(product2InStore.size() > 0){
+ Map<String,String> errorMap = new Map<String,String>();
+ for(Product2__c produ: product2InStore){
+ for(String bar: barJancodeMap.keySet() ){
+ if(barJancodeMap.get(bar).containsKey(produ.Product2_Jancode__c) && !rightBar.containsKey(bar)){
+ exitBarCodeMap.put(bar,bar);
errorMap.put(bar, bar);
}
+
}
}
- if (errorMap.size() > 0) {
- ApexPages.addmessage(
- new ApexPages.message(
- ApexPages.severity.ERROR,
- 'BarCode鍙穂' + errorMap.values() + ']浜у搧绫诲瀷[' + product_Type + ']涓庣敤鎴风殑绫诲瀷[' + userPro_Type + ']涓嶇'
- )
- );
+ if(errorMap.size() > 0){
+ //LWC:Lwcflag鍜屾姤閿欐彁閱� update by Link 2023-04-27
+ if(isLwc){
+ errorList.add('BarCode鍙穂'+ errorMap.values() +']浜у搧绫诲瀷['+product_Type+']涓庣敤鎴风殑绫诲瀷['+userPro_Type+']涓嶇');
+ }else {
+ ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR,'BarCode鍙穂'+ errorMap.values() +']浜у搧绫诲瀷['+product_Type+']涓庣敤鎴风殑绫诲瀷['+userPro_Type+']涓嶇'));
+ }
}
- }
- product2InStore = [
- SELECT
- Id,
- Name,
- Name__c,
- Intra_Trade_List_RMB__c,
- Asset_Model_No__c,
- OT_CODE__c,
- Product2_Jancode__c,
- Pro2_Dealer_ENG__c,
- Pro2_Dealer_Object__c,
- Product_Type__c
- FROM Product2__c
- WHERE Product2_Jancode__c IN :alljanCodeList AND Product_Type__c LIKE :userPro_Typestr
- ORDER BY SFDA_Expiration_Date__c DESC
- ];
- if (product2InStore.size() > 0) {
- Map<String, String> errorMap = new Map<String, String>();
- for (Product2__c produ : product2InStore) {
- for (String bar : barJancodeMap.keySet()) {
- if (barJancodeMap.get(bar).containsKey(produ.Product2_Jancode__c) && !rightBar.containsKey(bar)) {
- exitBarCodeMap.put(bar, bar);
- if (orderdetailMap.containsKey(produ.Id)) {
- consumableInventory.add(new ConsumableorderdetailsInfo(produ, barcodeinfoMap.get(bar)));
+ }
+ product2InStore = [SELECT Id, Name,Name__c,Intra_Trade_List_RMB__c,Asset_Model_No__c,OT_CODE__c,Product2_Jancode__c,
+ Pro2_Dealer_ENG__c,Pro2_Dealer_Object__c,
+ Product_Type__c
+ FROM Product2__c
+ WHERE Product2_Jancode__c in :alljanCodeList
+ AND Product_Type__c like :userPro_Typestr
+ order by SFDA_Expiration_Date__c desc ] ;
+ if(product2InStore.size() > 0){
+ Map<String,String> errorMap = new Map<String,String>();
+ for(Product2__c produ: product2InStore){
+ for(String bar: barJancodeMap.keySet() ){
+ if(barJancodeMap.get(bar).containsKey(produ.Product2_Jancode__c) && !rightBar.containsKey(bar)){
+ exitBarCodeMap.put(bar,bar);
+ if(orderdetailMap.containsKey(produ.Id)){
+ consumableInventory.add(new ConsumableorderdetailsInfo(produ,barcodeinfoMap.get(bar)));
rightBar.put(bar, bar);
- } else {
- consumableInventory.add(new ConsumableorderdetailsInfo(produ, barcodeinfoMap.get(bar)));
+ }else{
+ consumableInventory.add(new ConsumableorderdetailsInfo(produ,barcodeinfoMap.get(bar)));
rightBar.put(bar, bar);
- list<String> overOrderBARcodeCunList = new List<String>();
- if (notEqualBARcodeCunMap.containsKey(produ.Id)) {
+ list<String> overOrderBARcodeCunList = new list<String>();
+ if(notEqualBARcodeCunMap.containsKey(produ.Id)){
overOrderBARcodeCunList = notEqualBARcodeCunMap.get(produ.Id).clone();
overOrderBARcodeCunList.add(bar);
- notEqualBARcodeCunMap.put(produ.Id, overOrderBARcodeCunList);
- } else {
+ notEqualBARcodeCunMap.put(produ.Id,overOrderBARcodeCunList);
+ }else{
overOrderBARcodeCunList.add(bar);
- notEqualBARcodeCunMap.put(produ.Id, overOrderBARcodeCunList);
+ notEqualBARcodeCunMap.put(produ.Id,overOrderBARcodeCunList);
}
}
+
}
}
}
}
- for (String bartxt : barCode01List) {
- if (!exitBarCodeMap.containsKey(bartxt)) {
- notInStorelist.add(bartxt);
- }
+ for(String bartxt :barCode01List){
+ if(!exitBarCodeMap.containsKey(bartxt)){
+ notInStorelist.add(bartxt);
+ }
}
+
}
//241閫氳繃妫�绱骇鍝佹槸鍚﹀瓨鍦�
- if (allotCodeList.size() > 0) {
- Map<String, String> exitBarCodeMap = new Map<String, String>();
- Map<String, String> errorMap = new Map<String, String>();
- List<Product2__c> product2InStore = [
- SELECT Id, Name, Name__c, Intra_Trade_List_RMB__c, Asset_Model_No__c, OT_CODE__c, Pro2_Dealer_Object__c, Pro2_Dealer_ENG__c
- FROM Product2__c
- WHERE OT_CODE__c IN :allotCodeList AND (NOT Product_Type__c LIKE :userPro_Typestr)
- ];
- if (product2InStore.size() > 0) {
- for (Product2__c produ : product2InStore) {
- for (String bar : barOtcodeMap.keySet()) {
- if (barOtcodeMap.get(bar).containsKey(produ.OT_CODE__c)) {
- exitBarCodeMap.put(bar, bar);
+ if(allotCodeList.size() > 0){
+ Map<String,String> exitBarCodeMap = new Map<String,String>();
+ Map<String,String> errorMap = new Map<String,String>();
+ List<Product2__c> product2InStore = [SELECT Id, Name,Name__c,Intra_Trade_List_RMB__c,Asset_Model_No__c,OT_CODE__c,
+ Pro2_Dealer_Object__c,Pro2_Dealer_ENG__c
+ FROM Product2__c
+ WHERE OT_CODE__c in :allotCodeList
+ AND (not Product_Type__c like :userPro_Typestr)] ;
+ if(product2InStore.size() > 0){
+ for(Product2__c produ: product2InStore){
+ for(String bar: barOtcodeMap.keySet() ){
+ if(barOtcodeMap.get(bar).containsKey(produ.OT_CODE__c)){
+ exitBarCodeMap.put(bar,bar);
errorMap.put(bar, bar);
}
}
}
}
- if (errorMap.size() > 0) {
- ApexPages.addmessage(
- new ApexPages.message(
- ApexPages.severity.ERROR,
- 'BarCode鍙穂' + errorMap.values() + ']浜у搧绫诲瀷[' + product_Type + ']涓庣敤鎴穂' + userPro_Type + ']绫诲瀷涓嶇'
- )
- );
+ if(errorMap.size() > 0){
+ //LWC:Lwcflag鍜屾姤閿欐彁閱� update by Link 2023-04-27
+ if(isLwc){
+ errorList.add('BarCode鍙穂'+ errorMap.values() +']浜у搧绫诲瀷['+product_Type+']涓庣敤鎴穂'+userPro_Type+']绫诲瀷涓嶇');
+ }else {
+ ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR,'BarCode鍙穂'+ errorMap.values() +']浜у搧绫诲瀷['+product_Type+']涓庣敤鎴穂'+userPro_Type+']绫诲瀷涓嶇'));
+ }
}
- product2InStore = [
- SELECT Id, Name, Name__c, Intra_Trade_List_RMB__c, Asset_Model_No__c, OT_CODE__c, Pro2_Dealer_Object__c, Pro2_Dealer_ENG__c
- FROM Product2__c
- WHERE OT_CODE__c IN :allotCodeList AND Product_Type__c LIKE :userPro_Typestr
- ];
-
- if (product2InStore.size() > 0) {
- for (Product2__c produ : product2InStore) {
- for (String bar : barOtcodeMap.keySet()) {
- Date expirationDate = null;
+ product2InStore = [SELECT Id, Name,Name__c,Intra_Trade_List_RMB__c,Asset_Model_No__c,OT_CODE__c,
+ Pro2_Dealer_Object__c,Pro2_Dealer_ENG__c
+ FROM Product2__c
+ WHERE OT_CODE__c in :allotCodeList
+ AND Product_Type__c like :userPro_Typestr] ;
+
+ if(product2InStore.size() > 0){
+ for(Product2__c produ: product2InStore){
+ for(String bar: barOtcodeMap.keySet() ){
+ Date expirationDate = null ;
String serialNoorLotNo = '';
String tracingCode = '';
String productDateStr = '';
- Date productionDate = null;
+ Date productionDate = null ;
String expirationDateStr = '';
Integer oTcodeLength = produ.OT_CODE__c.length();
- if (bar.length() >= oTcodeLength + 11) {
- if (bar.substring(oTcodeLength + 3, oTcodeLength + 5) == '11') {
- try {
- productDateStr =
- '20' +
- bar.substring(oTcodeLength + 5, oTcodeLength + 7) +
- '-' +
- bar.substring(oTcodeLength + 7, oTcodeLength + 9) +
- '-01';
+ if(bar.length() >= oTcodeLength + 11){
+ if( bar.substring(oTcodeLength + 3,oTcodeLength + 5) =='11'){
+ try{
+ productDateStr = '20' + bar.substring(oTcodeLength + 5,oTcodeLength + 7) + '-' + bar.substring(oTcodeLength + 7,oTcodeLength + 9) + '-01' ;
productionDate = Date.valueOf(productDateStr);
- } catch (Exception e) {
- ApexPages.addmessage(
- new ApexPages.message(
- ApexPages.severity.ERROR,
- '浜у搧BarCode(' + bar + ')鐨勭敓浜ф棩鏈�' + productDateStr + '閿欒锛�'
- )
- );
+ }catch(Exception e){
+ //LWC:Lwcflag鍜屾姤閿欐彁閱� update by Link 2023-04-27
+ if(isLwc){
+ errorList.add('浜у搧BarCode(' + bar + ')鐨勭敓浜ф棩鏈�' + productDateStr + '閿欒锛�');
+ }else {
+ ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR, '浜у搧BarCode(' + bar + ')鐨勭敓浜ф棩鏈�' + productDateStr + '閿欒锛�'));
+ }
continue;
}
- if (bar.length() >= oTcodeLength + 3 + 16) {
+ if(bar.length() >=oTcodeLength + 3 + 16){
//ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR,'浜у搧BarCode17' + bar.substring(oTcodeLength + 3 + 8,oTcodeLength + 3 + 10)));
- if (bar.substring(oTcodeLength + 3 + 8, oTcodeLength + 3 + 10) == '17') {
- try {
- if (bar.substring(oTcodeLength + 3 + 14, oTcodeLength + 3 + 16) == '00') {
- expirationDateStr =
- '20' +
- bar.substring(oTcodeLength + 3 + 10, oTcodeLength + 3 + 12) +
- '-' +
- bar.substring(oTcodeLength + 3 + 12, oTcodeLength + 3 + 14) +
- '-' +
- '01';
+ if( bar.substring(oTcodeLength + 3 + 8,oTcodeLength + 3 + 10) =='17'){
+ try{
+ if(bar.substring(oTcodeLength + 3 + 14,oTcodeLength + 3 + 16)=='00'){
+ expirationDateStr = '20' + bar.substring(oTcodeLength + 3 + 10,oTcodeLength + 3 + 12) + '-' + bar.substring(oTcodeLength + 3 + 12,oTcodeLength + 3 + 14) + '-' + '01' ;
expirationDate = Date.valueOf(expirationDateStr);
expirationDate = expirationDate.addMonths(1).toStartofMonth().addDays(-1);
- } else {
- expirationDateStr =
- '20' +
- bar.substring(oTcodeLength + 3 + 10, oTcodeLength + 3 + 12) +
- '-' +
- bar.substring(oTcodeLength + 3 + 12, oTcodeLength + 3 + 14) +
- '-' +
- bar.substring(oTcodeLength + 3 + 14, oTcodeLength + 3 + 16);
- expirationDate = Date.valueOf(expirationDateStr);
+ }else{
+ expirationDateStr = '20' + bar.substring(oTcodeLength + 3 + 10,oTcodeLength + 3 + 12) + '-' + bar.substring(oTcodeLength + 3 + 12,oTcodeLength + 3 + 14) + '-' +bar.substring(oTcodeLength + 3 + 14,oTcodeLength + 3 + 16) ;
+ expirationDate = Date.valueOf(expirationDateStr);
}
- } catch (Exception e) {
- ApexPages.addmessage(
- new ApexPages.message(
- ApexPages.severity.ERROR,
- '浜у搧BarCode(' + bar + ')鐨勬粎鑿屾湁鍔规湡闄�' + expirationDateStr + '閿欒锛�'
- )
- );
+ }catch(Exception e){
+ //LWC:Lwcflag鍜屾姤閿欐彁閱� update by Link 2023-04-27
+ if(isLwc){
+ errorList.add('浜у搧BarCode(' + bar + ')鐨勬粎鑿屾湁鍔规湡闄�' + expirationDateStr + '閿欒锛�');
+ }else {
+ ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR,'浜у搧BarCode(' + bar + ')鐨勬粎鑿屾湁鍔规湡闄�' + expirationDateStr + '閿欒锛�'));
+ }
continue;
}
- if (bar.length() >= oTcodeLength + 3 + 25) {
- if (
- bar.substring(oTcodeLength + 3 + 16, oTcodeLength + 3 + 18) == '10' ||
- bar.substring(oTcodeLength + 3 + 16, oTcodeLength + 3 + 18) == '21'
- ) {
- serialNoorLotNo = bar.substring(oTcodeLength + 3 + 18, bar.length() - 8);
+ if(bar.length() >= oTcodeLength + 3 + 25){
+ if(bar.substring(oTcodeLength + 3 + 16,oTcodeLength + 3 + 18) =='10' || bar.substring(oTcodeLength + 3 + 16,oTcodeLength + 3 + 18) =='21'){
+ serialNoorLotNo = bar.substring(oTcodeLength + 3 + 18,bar.length() - 8) ;
//ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR, 'serialNoorLotNo' + serialNoorLotNo));
}
}
- } else if (
- bar.substring(oTcodeLength + 3 + 8, oTcodeLength + 3 + 10) == '10' ||
- bar.substring(oTcodeLength + 3 + 8, oTcodeLength + 3 + 10) == '21'
- ) {
- serialNoorLotNo = bar.substring(oTcodeLength + 3 + 10, bar.length() - 8);
+ }else if(bar.substring(oTcodeLength + 3 + 8,oTcodeLength + 3 + 10) =='10' || bar.substring(oTcodeLength + 3 + 8,oTcodeLength + 3 + 10) =='21'){
+ serialNoorLotNo = bar.substring(oTcodeLength + 3 + 10,bar.length() - 8) ;
//ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR, 'serialNoorLotNo' + serialNoorLotNo));
}
}
- } else if (bar.substring(oTcodeLength + 3, oTcodeLength + 5) == '17') {
- try {
- if (bar.substring(oTcodeLength + 3 + 6, oTcodeLength + 3 + 8) == '00') {
- expirationDateStr =
- '20' +
- bar.substring(oTcodeLength + 3 + 2, oTcodeLength + 3 + 4) +
- '-' +
- bar.substring(oTcodeLength + 3 + 4, oTcodeLength + 3 + 6) +
- '-01';
+ }else if(bar.substring(oTcodeLength + 3,oTcodeLength + 5) =='17'){
+ try{
+ if(bar.substring(oTcodeLength + 3 + 6,oTcodeLength + 3 + 8)=='00'){
+ expirationDateStr = '20' + bar.substring(oTcodeLength + 3 + 2,oTcodeLength + 3 + 4) + '-' + bar.substring(oTcodeLength + 3 + 4,oTcodeLength + 3 + 6) + '-01';
expirationDate = Date.valueOf(expirationDateStr);
expirationDate = expirationDate.addMonths(1).toStartofMonth().addDays(-1);
- } else {
- expirationDateStr =
- '20' +
- bar.substring(oTcodeLength + 3 + 2, oTcodeLength + 3 + 4) +
- '-' +
- bar.substring(oTcodeLength + 3 + 4, oTcodeLength + 3 + 6) +
- '-' +
- bar.substring(oTcodeLength + 3 + 6, oTcodeLength + 3 + 8);
+ }else{
+ expirationDateStr = '20' + bar.substring(oTcodeLength + 3 + 2,oTcodeLength + 3 + 4) + '-' + bar.substring(oTcodeLength + 3 + 4,oTcodeLength + 3 + 6) + '-' +bar.substring(oTcodeLength + 3 + 6,oTcodeLength + 3 + 8);
expirationDate = Date.valueOf(expirationDateStr);
}
- } catch (Exception e) {
- ApexPages.addmessage(
- new ApexPages.message(
- ApexPages.severity.ERROR,
- '浜у搧BarCode(' + bar + ')鐨勬粎鑿屾湁鍔规湡闄�' + expirationDateStr + '閿欒锛�'
- )
- );
+ }catch(Exception e){
+ //LWC:Lwcflag鍜屾姤閿欐彁閱� update by Link 2023-04-27
+ if(isLwc){
+ errorList.add('浜у搧BarCode(' + bar + ')鐨勬粎鑿屾湁鍔规湡闄�' + expirationDateStr + '閿欒锛�');
+ }else {
+ ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR,'浜у搧BarCode(' + bar + ')鐨勬粎鑿屾湁鍔规湡闄�' + expirationDateStr + '閿欒锛�'));
+ }
continue;
}
- if (bar.length() >= oTcodeLength + 20) {
- if (
- bar.substring(oTcodeLength + 3 + 8, oTcodeLength + 3 + 10) == '10' ||
- bar.substring(oTcodeLength + 3 + 8, oTcodeLength + 3 + 10) == '21'
- ) {
- serialNoorLotNo = bar.substring(oTcodeLength + 3 + 10, bar.length() - 8);
+ if(bar.length() >=oTcodeLength + 20){
+ if(bar.substring(oTcodeLength + 3 + 8,oTcodeLength + 3 + 10) =='10' || bar.substring(oTcodeLength + 3 + 8,oTcodeLength + 3 + 10) =='21'){
+ serialNoorLotNo = bar.substring(oTcodeLength + 3 + 10,bar.length() - 8) ;
}
}
- } else if (bar.length() >= oTcodeLength + 12) {
- if (
- bar.substring(oTcodeLength + 3, oTcodeLength + 5) == '10' ||
- bar.substring(oTcodeLength + 3, oTcodeLength + 5) == '21'
- ) {
- serialNoorLotNo = bar.substring(oTcodeLength + 3 + 2, bar.length() - 8);
+
+ }else if(bar.length() >= oTcodeLength + 12){
+ if(bar.substring(oTcodeLength + 3,oTcodeLength + 5) =='10' || bar.substring(oTcodeLength + 3,oTcodeLength + 5) =='21'){
+ serialNoorLotNo = bar.substring(oTcodeLength + 3 + 2,bar.length() - 8) ;
}
}
}
- if (bar.length() >= oTcodeLength + 3 + 8 && bar.substring(bar.length() - 8, bar.length() - 5) == '250') {
- if (bar.substring(bar.length() - 8, bar.length() - 5) == '250') {
- tracingCode = bar.substring(bar.length() - 5, bar.length());
+ if(bar.length() >= oTcodeLength + 3 + 8 && bar.substring(bar.length() - 8,bar.length()-5)=='250'){
+ if(bar.substring(bar.length() - 8,bar.length()-5)=='250'){
+ tracingCode = bar.substring(bar.length() - 5,bar.length());
Matcher n = Pattern.compile('[0-9]').matcher(tracingCode);
- if (n.find()) {
- String str = '绠$悊缂栫爜涓嶆纭紝璇蜂笌绠$悊鍛樼‘璁ゆ槸鍚﹂敊璇��';
- ApexPages.addmessage(
- new ApexPages.message(
- ApexPages.severity.ERROR,
- '浜у搧BarCode(' + bar + ')绠$悊缂栫爜涓湁鏁板瓧锛岃涓庣鐞嗗憳纭鏄惁閿欒锛�'
- )
- );
- continue;
+ if(n.find()){
+ // gzw DB202305352696 鍏ュ簱绠$悊缂栫爜楠岃瘉绋嬪簭璋冩暣 start
+ if (tracingCode.length() == 5) {
+ String tr = tracingCode;
+ String Ctr = tr.substring(tr.length() - 3,tr.length());
+ String Btr = tr.substring(tr.length() - 4,tr.length()-3);
+ String Atr = tr.substring(tr.length() - 5,tr.length()-4);
+ if (Pattern.compile('[0-9]').matcher(Atr).find() || Pattern.compile('[0-9]').matcher(Ctr).find()) {
+ String str = '绠$悊缂栫爜涓嶆纭紝璇蜂笌绠$悊鍛樼‘璁ゆ槸鍚﹂敊璇��';
+ //LWC:Lwcflag鍜屾姤閿欐彁閱� update by Link 2023-04-27
+ if(isLwc){
+ errorList.add('浜у搧BarCode(' + bar + ')绠$悊缂栫爜鏈夎锛岃妫�鏌ユ潯褰㈢爜鏁版嵁銆�');
+ }else {
+ ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR,'浜у搧BarCode(' + bar + ')绠$悊缂栫爜鏈夎锛岃妫�鏌ユ潯褰㈢爜鏁版嵁銆�'));
+ }
+ continue;
+ }
+ }
+ // String str = '绠$悊缂栫爜涓嶆纭紝璇蜂笌绠$悊鍛樼‘璁ゆ槸鍚﹂敊璇��';
+ // ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR,'浜у搧BarCode(' + bar + ')绠$悊缂栫爜涓湁鏁板瓧锛岃涓庣鐞嗗憳纭鏄惁閿欒锛�'));
+ // continue;
+ // gzw DB202305352696 鍏ュ簱绠$悊缂栫爜楠岃瘉绋嬪簭璋冩暣 end
}
- } else {
- ApexPages.addmessage(
- new ApexPages.message(ApexPages.severity.ERROR, '浜у搧BarCode(' + bar + ')鐨則racingCode閿欒锛�')
- );
+ }else{
+ //LWC:Lwcflag鍜屾姤閿欐彁閱� update by Link 2023-04-27
+ if(isLwc){
+ errorList.add('浜у搧BarCode(' + bar + ')鐨則racingCode閿欒锛�');
+ }else {
+ ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR,'浜у搧BarCode(' + bar + ')鐨則racingCode閿欒锛�'));
+ }
continue;
}
}
@@ -3078,43 +2775,54 @@
barcodedetList.add(String.valueOf(expirationDate));
barcodedetList.add(serialNoorLotNo);
barcodedetList.add(tracingCode);
- if (barOtcodeMap.get(bar).containsKey(produ.OT_CODE__c)) {
- exitBarCodeMap.put(bar, bar);
-
- if (orderdetailMap.containsKey(produ.Id)) {
- consumableInventory.add(new ConsumableorderdetailsInfo(produ, barcodedetList));
- } else {
- consumableInventory.add(new ConsumableorderdetailsInfo(produ, barcodedetList));
- list<String> overOrderBARcodeCunList = new List<String>();
- if (notEqualBARcodeCunMap.containsKey(produ.Id)) {
+ if(barOtcodeMap.get(bar).containsKey(produ.OT_CODE__c)){
+ exitBarCodeMap.put(bar,bar);
+
+ if(orderdetailMap.containsKey(produ.Id)){
+ consumableInventory.add(new ConsumableorderdetailsInfo(produ,barcodedetList));
+ }else{
+ consumableInventory.add(new ConsumableorderdetailsInfo(produ,barcodedetList));
+ list<String> overOrderBARcodeCunList = new list<String>();
+ if(notEqualBARcodeCunMap.containsKey(produ.Id)){
overOrderBARcodeCunList = notEqualBARcodeCunMap.get(produ.Id).clone();
overOrderBARcodeCunList.add(bar);
- notEqualBARcodeCunMap.put(produ.Id, overOrderBARcodeCunList);
- } else {
+ notEqualBARcodeCunMap.put(produ.Id,overOrderBARcodeCunList);
+ }else{
overOrderBARcodeCunList.add(bar);
- notEqualBARcodeCunMap.put(produ.Id, overOrderBARcodeCunList);
+ notEqualBARcodeCunMap.put(produ.Id,overOrderBARcodeCunList);
}
- }
+ }
+
}
}
}
}
- for (String bartxt : barCode241List) {
- if (!exitBarCodeMap.containsKey(bartxt)) {
- if (!errorMap.containsKey(bartxt)) {
+ for(String bartxt :barCode241List){
+ if(!exitBarCodeMap.containsKey(bartxt)){
+ if(!errorMap.containsKey(bartxt)){
notInStorelist.add(bartxt);
}
- }
+ }
}
}
//鍒ゆ柇浜у搧鏄惁涓�鑷�
- if (notEqualBARcodeCunMap.size() > 0) {
- for (String widget : notEqualBARcodeCunMap.keySet()) {
- if (notEqualBARcodeCunMap.get(widget).size() > 0) {
- ApexPages.addmessage(new ApexPages.message(ApexPages.severity.INFO, '浠ヤ笅barcode浜у搧涓庤璐т骇鍝佷笉涓�鑷淬��'));
- for (String barcodeListTTT : (List<String>) notEqualBARcodeCunMap.get(widget)) {
- ApexPages.addmessage(new ApexPages.message(ApexPages.severity.INFO, barcodeListTTT));
+ if(notEqualBARcodeCunMap.size() > 0){
+ for(String widget : notEqualBARcodeCunMap.keySet()) {
+ if(notEqualBARcodeCunMap.get(widget).size() >0){
+ //LWC:Lwcflag鍜屾姤閿欐彁閱� update by Link 2023-04-27
+ if(isLwc){
+ warningList.add('浠ヤ笅barcode浜у搧涓庤璐т骇鍝佷笉涓�鑷淬��');
+ }else {
+ ApexPages.addmessage(new ApexPages.message(ApexPages.severity.INFO, '浠ヤ笅barcode浜у搧涓庤璐т骇鍝佷笉涓�鑷淬��'));
+ }
+ for(String barcodeListTTT : (List<String>)notEqualBARcodeCunMap.get(widget)) {
+ //LWC:Lwcflag鍜屾姤閿欐彁閱� update by Link 2023-04-27
+ if(isLwc){
+ warningList.add(barcodeListTTT);
+ }else {
+ ApexPages.addmessage(new ApexPages.message(ApexPages.severity.INFO, barcodeListTTT));
+ }
}
}
}
@@ -3122,73 +2830,64 @@
}
public String ConfimResult() {
- list<String> overOrderproList = new List<String>();
- list<String> overOrderBARcodeCunList = new List<String>();
- list<String> overOrderBARcodeCunListTest = new List<String>();
+ list<String> overOrderproList = new list<String>();
+ list<String> overOrderBARcodeCunList = new list<String>();
+ list<String> overOrderBARcodeCunListTest = new list<String>();
//overOrderBARcodeCunMap.clear();
- for (ConsumableorderdetailsInfo ass : ConsumableorderdetailsRecords) {
- if (
- orderWantArriveCunMap.get(ass.esd.Asset_Model_No__c) + orderProductArrivedCunMap.get(ass.esd.Asset_Model_No__c) >
- orderProductCunMap.get(ass.esd.Asset_Model_No__c) - 1
- ) {
+ for (ConsumableorderdetailsInfo ass : ConsumableorderdetailsRecords) {
+ if(orderWantArriveCunMap.get(ass.esd.Asset_Model_No__c) + orderProductArrivedCunMap.get(ass.esd.Asset_Model_No__c) > orderProductCunMap.get(ass.esd.Asset_Model_No__c)-1){
// 鑾峰彇瓒呰繃瀹氳揣鏁伴噺鐨勬秷鑰楀搧淇℃伅
- overOrderBARcodeCunList = new List<String>();
+ overOrderBARcodeCunList = new list<String>();
overOrderBARcodeCunList = overOrderBARcodeCunMap.get(ass.esd.Asset_Model_No__c).clone();
overOrderBARcodeCunList.add(ass.esd.Bar_Code__c);
- overOrderBARcodeCunMap.put(ass.esd.Asset_Model_No__c, overOrderBARcodeCunList);
- overOrderCunMap.put(ass.esd.Asset_Model_No__c, overOrderCunMap.get(ass.esd.Asset_Model_No__c) + 1);
+ overOrderBARcodeCunMap.put(ass.esd.Asset_Model_No__c,overOrderBARcodeCunList);
+ overOrderCunMap.put(ass.esd.Asset_Model_No__c,overOrderCunMap.get(ass.esd.Asset_Model_No__c)+1);
cancellationProList.add(ass.esd.Asset_Model_No__c);
- } else if (
- orderWantArriveCunMap.get(ass.esd.Asset_Model_No__c) + orderProductArrivedCunMap.get(ass.esd.Asset_Model_No__c) ==
- orderProductCunMap.get(ass.esd.Asset_Model_No__c) - 1
- ) {
+ }else if(orderWantArriveCunMap.get(ass.esd.Asset_Model_No__c) + orderProductArrivedCunMap.get(ass.esd.Asset_Model_No__c) == orderProductCunMap.get(ass.esd.Asset_Model_No__c)-1){
consumableorderdetailsRecordsUse.add(ass);
cancellationProList.add(ass.esd.Asset_Model_No__c);
- } else {
+ }else{
consumableorderdetailsRecordsUse.add(ass);
}
- orderWantArriveCunMap.put(ass.esd.Asset_Model_No__c, orderWantArriveCunMap.get(ass.esd.Asset_Model_No__c) + 1);
+ orderWantArriveCunMap.put(ass.esd.Asset_Model_No__c,orderWantArriveCunMap.get(ass.esd.Asset_Model_No__c)+1);
}
- for (ConsumableorderdetailsInfo ass : consumableInventory) {
+ for(ConsumableorderdetailsInfo ass : consumableInventory){
if (!orderWantArriveCunMap.containsKey(ass.Prod.Asset_Model_No__c)) {
consumableInventoryUse.add(ass);
continue;
}
- if (
- orderWantArriveCunMap.get(ass.Prod.Asset_Model_No__c) + orderProductArrivedCunMap.get(ass.Prod.Asset_Model_No__c) >
- orderProductCunMap.get(ass.Prod.Asset_Model_No__c) - 1
- ) {
+ if(orderWantArriveCunMap.get(ass.Prod.Asset_Model_No__c) + orderProductArrivedCunMap.get(ass.Prod.Asset_Model_No__c) > orderProductCunMap.get(ass.Prod.Asset_Model_No__c)-1){
+
//鍙栧緱鍘熸湁list
- overOrderBARcodeCunList = new List<String>();
+ overOrderBARcodeCunList = new list<String>();
overOrderBARcodeCunList = overOrderBARcodeCunMap.get(ass.Prod.Asset_Model_No__c).clone();
//鏇存柊list
overOrderBARcodeCunList.add(ass.barCodeNo);
//鏇存柊map
- overOrderBARcodeCunMap.put(ass.Prod.Asset_Model_No__c, overOrderBARcodeCunList);
- overOrderCunMap.put(ass.Prod.Asset_Model_No__c, overOrderCunMap.get(ass.Prod.Asset_Model_No__c) + 1);
+ overOrderBARcodeCunMap.put(ass.Prod.Asset_Model_No__c,overOrderBARcodeCunList);
+ overOrderCunMap.put(ass.Prod.Asset_Model_No__c,overOrderCunMap.get(ass.Prod.Asset_Model_No__c)+1);
cancellationProList.add(ass.Prod.Asset_Model_No__c);
- } else if (
- orderWantArriveCunMap.get(ass.Prod.Asset_Model_No__c) + orderProductArrivedCunMap.get(ass.Prod.Asset_Model_No__c) ==
- orderProductCunMap.get(ass.Prod.Asset_Model_No__c) - 1
- ) {
+ }else if(orderWantArriveCunMap.get(ass.Prod.Asset_Model_No__c) + orderProductArrivedCunMap.get(ass.Prod.Asset_Model_No__c) == orderProductCunMap.get(ass.Prod.Asset_Model_No__c)-1){
+
consumableInventoryUse.add(ass);
cancellationProList.add(ass.Prod.Asset_Model_No__c);
- } else {
+ }else{
consumableInventoryUse.add(ass);
}
- orderWantArriveCunMap.put(ass.Prod.Asset_Model_No__c, orderWantArriveCunMap.get(ass.Prod.Asset_Model_No__c) + 1);
+ orderWantArriveCunMap.put(ass.Prod.Asset_Model_No__c,orderWantArriveCunMap.get(ass.Prod.Asset_Model_No__c)+1);
}
for (Integer i = 0; i < productList.size(); i++) {
- if (overOrderBARcodeCunMap.get(productList[i]).size() > 0) {
+ if(overOrderBARcodeCunMap.get(productList[i]).size() > 0){
// 鑾峰彇瓒呰繃瀹氳揣鏁伴噺鐨勬秷鑰楀搧淇℃伅
overOrderproList.add(productList[i]);
}
}
- if (overOrderproList.size() > 0) {
+ if(overOrderproList.size() > 0){
return '浜у搧' + overOrderproList + '鏈鍒拌揣鏁伴噺鍜屽凡鍒拌揣鏁伴噺宸茬粡瓒呰繃璁㈣揣鏁伴噺!';
- } else {
+ }else{
return '';
}
+
}
public void confimResultWithoutOrder() {
@@ -3229,7 +2928,7 @@
}*/
//瑕佸埌璐т骇鍝佹暟閲�
- for (ConsumableorderdetailsInfo ass : ConsumableorderdetailsRecords) {
+ for (ConsumableorderdetailsInfo ass : ConsumableorderdetailsRecords) {
/*if(orderWantArriveCunMap.get(ass.esd.Consumable_order_minor__c + ass.esd.Asset_Model_No__c) + orderProductArrivedCunMap.get(ass.esd.Consumable_order_minor__c + ass.esd.Asset_Model_No__c) > orderProductCunMap.get(ass.esd.Consumable_order_minor__c + ass.esd.Asset_Model_No__c)-1){
// 鑾峰彇瓒呰繃瀹氳揣鏁伴噺鐨勬秷鑰楀搧淇℃伅
overOrderproList.add('浜у搧' + ass.esd.Asset_Model_No__c + '鍦ㄨ鍗�' + ass.esd.Consumable_order_minor__r.Name + '涓秴杩囪璐ф暟閲�!\n');
@@ -3241,23 +2940,23 @@
consumableorderdetailsRecordsUse.add(ass);
orderWantArriveCunMap.put(ass.esd.Consumable_order_minor__c + ass.esd.Asset_Model_No__c,orderWantArriveCunMap.get(ass.esd.Consumable_order_minor__c + ass.esd.Asset_Model_No__c)+1);
}else{*/
- consumableorderdetailsRecordsUse.add(ass);
- }
- /*orderWantArriveCunMap.put(ass.esd.Consumable_order_minor__c + ass.esd.Asset_Model_No__c,orderWantArriveCunMap.get(ass.esd.Consumable_order_minor__c + ass.esd.Asset_Model_No__c)+1);
+ consumableorderdetailsRecordsUse.add(ass);
+ }
+ /*orderWantArriveCunMap.put(ass.esd.Consumable_order_minor__c + ass.esd.Asset_Model_No__c,orderWantArriveCunMap.get(ass.esd.Consumable_order_minor__c + ass.esd.Asset_Model_No__c)+1);
}
return overOrderproList;*/
}
// WYIN-BLZE48鐩樼偣涓㈠け浜у搧澧炲姞鍏ュ簱鏂瑰紡 update by vivek 2020-03-05 start
// 铏氭嫙鐩樼偣鍗曟秷鑰楀搧鏄庣粏1鍒涘缓宸″洖
- public void addInventoryDetails1(List<Consumable_order_details2__c> addList) {
+ public void addInventoryDetails1(List<Consumable_order_details2__c> addList){
Map<String, List<Consumable_order_details2__c>> accountGroupMap = new Map<String, List<Consumable_order_details2__c>>();
- Map<String, Map<Id, Integer>> productMap = new Map<String, Map<Id, Integer>>();
- List<Id> orderIdList = new List<Id>();
+ Map<String, Map<Id, Integer>> productMap = new Map<String, Map<Id, Integer>> ();
+ List<Id> orderIdList = new List<Id> ();
// 浠ョ粡閿�鍟嗗悕灏嗚鐢熸垚鍑哄簱鍗曠殑鏁版嵁鍒嗙粍
for (Consumable_order_details2__c cod : addList) {
- List<Consumable_order_details2__c> accGroupList = new List<Consumable_order_details2__c>();
- Map<Id, Integer> pNumMap = new Map<Id, Integer>();
+ List<Consumable_order_details2__c> accGroupList = new List<Consumable_order_details2__c> ();
+ Map<Id, Integer> pNumMap = new Map<Id, Integer> ();
Integer num = 1;
if (accountGroupMap.containsKey(cod.Dealer_Info_text__c + cod.Arrive_Owner_Work_Location__c)) {
accGroupList = accountGroupMap.get(cod.Dealer_Info_text__c + cod.Arrive_Owner_Work_Location__c);
@@ -3266,20 +2965,16 @@
num = pNumMap.get(cod.Consumable_Product__c) + 1;
}
}
- orderIdList.add(cod.Consumable_Inventory_order__c);
+ orderIdList.add(cod.Consumable_Inventory_order__c);
pNumMap.put(cod.Consumable_Product__c, num);
accGroupList.add(cod);
productMap.put(cod.Dealer_Info_text__c + cod.Arrive_Owner_Work_Location__c, pNumMap);
accountGroupMap.put(cod.Dealer_Info_text__c + cod.Arrive_Owner_Work_Location__c, accGroupList);
- System.debug('======accGroupList' + accGroupList);
+ System.debug('======accGroupList'+accGroupList);
}
-
- System.debug('======accountGroupMap' + accountGroupMap);
- List<Consumable_order__c> orderList = [
- SELECT Id, Name, Dealer_Info__r.Name, Order_Owner_WorkLocal__c
- FROM Consumable_order__c
- WHERE id IN :orderIdList
- ];
+
+ System.debug('======accountGroupMap'+accountGroupMap);
+ List<Consumable_order__c> orderList = [select Id, Name, Dealer_Info__r.Name, Order_Owner_WorkLocal__c from Consumable_order__c where id in : orderIdList];
// 鐢熸垚鍚勭粡閿�鍟嗗嚭搴撹鍗昄ist
// List<Consumable_order__c> orderList = new List<Consumable_order__c> ();
@@ -3287,19 +2982,19 @@
for (String acc : accountGroupMap.keySet()) {
Consumable_order_details2__c arriveAccount = accountGroupMap.get(acc)[0];
List<Consumable_order_details2__c> prodPriceList = accountGroupMap.get(acc);
- Map<Id, Integer> pNumMap = new Map<Id, Integer>();
+ Map<Id, Integer> pNumMap = new Map<Id, Integer> ();
pNumMap = productMap.get(acc);
- List<Consumable_orderdetails__c> insDetail1 = new List<Consumable_orderdetails__c>();
+ List<Consumable_orderdetails__c> insDetail1 = New List<Consumable_orderdetails__c>();
for (Id id : pNumMap.keySet()) {
Consumable_orderdetails__c ins = new Consumable_orderdetails__c();
-
+
//InsAfterDel.Consumable_order__c = p.id;
ins.Product_Refind__c = pNumMap.get(id);
ins.inventory_sum__c = pNumMap.get(id);
ins.Consumable_Product__c = id;
for (Consumable_order_details2__c pri : prodPriceList) {
if (pri.Consumable_Product__c == id) {
- ins.Intra_Trade_List_RMB__c = pri.Intra_Trade_List_RMB__c;
+ ins.Intra_Trade_List_RMB__c =pri.Intra_Trade_List_RMB__c;
break;
}
}
@@ -3314,11 +3009,11 @@
insDetail1.add(ins);
}
- System.debug('======insDetail1' + insDetail1);
+ System.debug('======insDetail1'+insDetail1);
insDetail1Map.put(acc, insDetail1);
- System.debug('======insDetail1Map' + insDetail1Map);
+ System.debug('======insDetail1Map'+insDetail1Map);
}
- List<Consumable_orderdetails__c> insDetail1List = new List<Consumable_orderdetails__c>();
+ List<Consumable_orderdetails__c> insDetail1List = new List<Consumable_orderdetails__c> ();
for (Consumable_order__c setId : orderList) {
// 鏄庣粏1
List<Consumable_orderdetails__c> d1list = insDetail1Map.get(setId.Dealer_Info__r.Name + setId.Order_Owner_WorkLocal__c);
@@ -3326,23 +3021,24 @@
for (Consumable_orderdetails__c dtl1 : d1list) {
String str = ('000' + i).right(4);
dtl1.Consumable_order__c = setId.Id;
- dtl1.Name = setId.Name + '-' + str;
+ dtl1.Name = setId.Name + '-'+ str;
insDetail1List.add(dtl1);
}
- }
- System.debug('======insDetail1List' + insDetail1List);
+ }
+ System.debug('======insDetail1List'+insDetail1List);
insert insDetail1List;
}
// WYIN-BLZE48鐩樼偣涓㈠け浜у搧澧炲姞鍏ュ簱鏂瑰紡 update by vivek 2020-03-05 end
+
// 缁忛攢鍟嗙殑涓嶅悓宸ヤ綔鍦拌皟璐ц嚜鍔ㄧ敓鎴愬嚭搴撳崟
- public void addSaleOrderAuto(List<Consumable_order_details2__c> addList) {
+ public void addSaleOrderAuto (List<Consumable_order_details2__c> addList) {
Map<String, List<Consumable_order_details2__c>> accountGroupMap = new Map<String, List<Consumable_order_details2__c>>();
- Map<String, Map<Id, Integer>> productMap = new Map<String, Map<Id, Integer>>();
+ Map<String, Map<Id, Integer>> productMap = new Map<String, Map<Id, Integer>> ();
// 浠ョ粡閿�鍟嗗悕灏嗚鐢熸垚鍑哄簱鍗曠殑鏁版嵁鍒嗙粍
for (Consumable_order_details2__c cod : addList) {
- List<Consumable_order_details2__c> accGroupList = new List<Consumable_order_details2__c>();
- Map<Id, Integer> pNumMap = new Map<Id, Integer>();
+ List<Consumable_order_details2__c> accGroupList = new List<Consumable_order_details2__c> ();
+ Map<Id, Integer> pNumMap = new Map<Id, Integer> ();
Integer num = 1;
if (accountGroupMap.containsKey(cod.Dealer_Info_text__c + cod.Arrive_Owner_Work_Location__c)) {
accGroupList = accountGroupMap.get(cod.Dealer_Info_text__c + cod.Arrive_Owner_Work_Location__c);
@@ -3350,7 +3046,7 @@
if (pNumMap.containsKey(cod.Consumable_Product__c)) {
num = pNumMap.get(cod.Consumable_Product__c) + 1;
}
- }
+ }
pNumMap.put(cod.Consumable_Product__c, num);
accGroupList.add(cod);
productMap.put(cod.Dealer_Info_text__c + cod.Arrive_Owner_Work_Location__c, pNumMap);
@@ -3358,7 +3054,7 @@
}
// 鐢熸垚鍚勭粡閿�鍟嗗嚭搴撹鍗昄ist
- List<Consumable_order__c> orderList = new List<Consumable_order__c>();
+ List<Consumable_order__c> orderList = new List<Consumable_order__c> ();
Map<String, List<Consumable_orderdetails__c>> insDetail1Map = new Map<String, List<Consumable_orderdetails__c>>();
for (String acc : accountGroupMap.keySet()) {
Consumable_order_details2__c arriveAccount = accountGroupMap.get(acc)[0];
@@ -3373,22 +3069,22 @@
autoOrder.RecordTypeid = System.Label.RT_ConOrder_Shipment;
autoOrder.Outbound_Date__c = Date.today();
autoOrder.Order_date__c = Date.today();
- autoOrder.AutoShipment__c = true;
+ autoOrder.AutoShipment__c = TRUE;
orderList.add(autoOrder);
List<Consumable_order_details2__c> prodPriceList = accountGroupMap.get(acc);
- Map<Id, Integer> pNumMap = new Map<Id, Integer>();
+ Map<Id, Integer> pNumMap = new Map<Id, Integer> ();
pNumMap = productMap.get(acc);
- List<Consumable_orderdetails__c> insDetail1 = new List<Consumable_orderdetails__c>();
+ List<Consumable_orderdetails__c> insDetail1 = New List<Consumable_orderdetails__c>();
for (Id id : pNumMap.keySet()) {
Consumable_orderdetails__c ins = new Consumable_orderdetails__c();
-
+
//InsAfterDel.Consumable_order__c = p.id;
ins.Shipment_Count__c = pNumMap.get(id);
ins.Consumable_Product__c = id;
for (Consumable_order_details2__c pri : prodPriceList) {
if (pri.Consumable_Product__c == id) {
- ins.Intra_Trade_List_RMB__c = pri.Intra_Trade_List_RMB__c;
+ ins.Intra_Trade_List_RMB__c =pri.Intra_Trade_List_RMB__c;
break;
}
}
@@ -3407,17 +3103,17 @@
}
insert orderList;
- List<Id> orderIdList = new List<Id>();
+ List<Id> orderIdList = new List<Id> ();
for (Consumable_order__c co : orderList) {
orderIdList.add(co.Id);
}
- orderList = new List<Consumable_order__c>();
- orderList = [SELECT Id, Name, Dealer_Info__r.Name, Order_Owner_WorkLocal__c FROM Consumable_order__c WHERE id IN :orderIdList];
+ orderList = new List<Consumable_order__c> ();
+ orderList = [select Id, Name, Dealer_Info__r.Name, Order_Owner_WorkLocal__c from Consumable_order__c where id in : orderIdList];
// 璁剧疆鏄庣粏1 鍜� 鏄庣粏2 鐨� 璁㈠崟ID
- List<Consumable_orderdetails__c> insDetail1List = new List<Consumable_orderdetails__c>();
- List<Consumable_order_details2__c> updDetail2List = new List<Consumable_order_details2__c>();
+ List<Consumable_orderdetails__c> insDetail1List = new List<Consumable_orderdetails__c> ();
+ List<Consumable_order_details2__c> updDetail2List = new List<Consumable_order_details2__c> ();
for (Consumable_order__c setId : orderList) {
// 鏄庣粏1
List<Consumable_orderdetails__c> d1list = insDetail1Map.get(setId.Dealer_Info__r.Name + setId.Order_Owner_WorkLocal__c);
@@ -3428,7 +3124,7 @@
// str = '0' + str;
// }
dtl1.Consumable_order__c = setId.Id;
- dtl1.Name = setId.Name + '-' + str;
+ dtl1.Name = setId.Name + '-'+ str;
insDetail1List.add(dtl1);
}
@@ -3462,158 +3158,162 @@
StaticParameter.ConsumableOrderTrigger = true;
//add by rentx 20210618 end CHAN-C3K4ZQ 璺宠繃涓嶅繀瑕佺殑鏌ヨ
cancellationProList = new List<String>();
- List<Consumable_order_details2__c> ins = new List<Consumable_order_details2__c>();
+ List<Consumable_order_details2__c> ins = New List<Consumable_order_details2__c>();
String resultcheck = '';
List<String> resultcheckWithoutOrder = new List<String>();
Savepoint sp = Database.setSavepoint();
- if (ConsumableorderdetailsRecords.size() < 1 && consumableInventory.size() < 1) {
- ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR, '涓嶅瓨鍦ㄥ埌璐ф槑缁�'));
+ if(ConsumableorderdetailsRecords.size()<1 && consumableInventory.size()<1){
+ //LWC:Lwcflag鍜屾姤閿欐彁閱� update by Link 2023-04-27
+ if(isLwc){
+ returnError = '涓嶅瓨鍦ㄥ埌璐ф槑缁�';
+ }else {
+ ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR,'涓嶅瓨鍦ㄥ埌璐ф槑缁�'));
+ }
return null;
}
- if (EsetId != null && EsetId != '') {
+ if(EsetId != null && EsetId != ''){
resultcheck = ConfimResult();
- if (resultcheck.length() > 0) {
- for (String widget : overOrderBARcodeCunMap.keySet()) {
- if (overOrderBARcodeCunMap.get(widget).size() > 0) {
- ApexPages.addmessage(
- new ApexPages.message(
- ApexPages.severity.INFO,
- '浜у搧' + widget + '鏈鍒拌揣鏁伴噺瓒呰繃' + overOrderBARcodeCunMap.get(widget).size() + '涓璐х殑鏁伴噺銆�'
- )
- );
- for (String barcodeListTTT : (List<String>) overOrderBARcodeCunMap.get(widget)) {
- ApexPages.addmessage(new ApexPages.message(ApexPages.severity.INFO, barcodeListTTT));
+ if(resultcheck.length() > 0){
+ for(String widget : overOrderBARcodeCunMap.keySet()) {
+ if(overOrderBARcodeCunMap.get(widget).size() >0){
+ //LWC:Lwcflag鍜屾姤閿欐彁閱� update by Link 2023-04-27
+ if(isLwc){
+ warningList.add('浜у搧' + widget + '鏈鍒拌揣鏁伴噺瓒呰繃' + overOrderBARcodeCunMap.get(widget).size() +'涓璐х殑鏁伴噺銆�');
+ }else {
+ ApexPages.addmessage(new ApexPages.message(ApexPages.severity.INFO, '浜у搧' + widget + '鏈鍒拌揣鏁伴噺瓒呰繃' + overOrderBARcodeCunMap.get(widget).size() +'涓璐х殑鏁伴噺銆�'));
+ }
+ for(String barcodeListTTT : (List<String>)overOrderBARcodeCunMap.get(widget)) {
+ //LWC:Lwcflag鍜屾姤閿欐彁閱� update by Link 2023-04-27
+ if(isLwc){
+ warningList.add(barcodeListTTT);
+ }else {
+ ApexPages.addmessage(new ApexPages.message(ApexPages.severity.INFO, barcodeListTTT));
+ }
}
}
}
}
- } else {
+ }else{
confimResultWithoutOrder();
}
- try {
+ try{
Consumable_order__c orderMain = new Consumable_order__c();
- List<Consumable_order_details2__c> orderdetails = new List<Consumable_order_details2__c>();
+ List<Consumable_order_details2__c> orderdetails = New List<Consumable_order_details2__c>();
//鍒拌揣姝g‘淇℃伅
- orderMain.Name = '*';
+ orderMain.Name = '*';
orderMain.Order_status__c = '鎵瑰噯';
- orderMain.Dealer_Info__c = accountid;
+ orderMain.Dealer_Info__c = accountid;
orderMain.Deliver_date__c = Date.today();
- orderMain.Order_date__c = Date.today();
- orderMain.Order_type__c = '鍒拌揣';
+ orderMain.Order_date__c = Date.today();
+ orderMain.Order_type__c = '鍒拌揣';
orderMain.Order_ProType__c = userPro_Type;
- if (EsetId != null && EsetId != '') {
+ if(EsetId != null && EsetId != ''){
orderMain.Arrive_Order__c = coc.Id;
}
orderMain.RecordTypeid = System.Label.RT_ConOrder_Arrive;
insert orderMain;
- List<Consumable_order__c> consumable_order = [SELECT Name FROM Consumable_order__c WHERE id = :orderMain.id];
+ List<Consumable_order__c> consumable_order = [SELECT Name FROM Consumable_order__c WHERE id =:orderMain.id];
arriveId = orderMain.id;
- Decimal arriveAmount = 0;
- for (ConsumableorderdetailsInfo ass : consumableorderdetailsRecordsUse) {
+ Decimal arriveAmount =0;
+ for (ConsumableorderdetailsInfo ass : consumableorderdetailsRecordsUse) {
+ //ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR,'------1------'));
Consumable_order_details2__c insDetails = new Consumable_order_details2__c();
- insDetails.Id = ass.esd.Id;
- insDetails.Consumable_Arrived_order__c = orderMain.id;
- insDetails.Arrive_date__c = Date.today();
- insDetails.Bar_Code__c = ass.esd.Bar_Code__c;
- insDetails.OwnerId = UserInfo.getUserId();
+ insDetails.Id = ass.esd.Id;
+ insDetails.Consumable_Arrived_order__c = orderMain.id;
+ insDetails.Arrive_date__c = Date.today();
+ insDetails.Bar_Code__c = ass.esd.Bar_Code__c;
+ insDetails.OwnerId = UserInfo.getUserId();
// 鏇存柊鍊熻皟淇℃伅 add by gzw 2020-0-415 start
if (orderdetails2trMap.containsKey(ass.esd.Bar_Code__c)) {
insDetails.Transfer_Time__c = ass.esd.Transfer_Time__c == null ? 1 : ass.esd.Transfer_Time__c;
insDetails.Agency_Transfer__c = true;
- insDetails.Frist_Transfer_Agency__c = ass.esd.Frist_Transfer_Agency__c == null
- ? ass.esd.Dealer_Info_text__c
- : ass.esd.Frist_Transfer_Agency__c;
+ insDetails.Frist_Transfer_Agency__c = ass.esd.Frist_Transfer_Agency__c == null ? ass.esd.Dealer_Info_text__c : ass.esd.Frist_Transfer_Agency__c;
}
// 鏇存柊鍊熻皟淇℃伅 add by gzw 2020-0-415 end
-
+
// 杩藉姞棣栨鍏ュ簱缁忛攢鍟� add by gzw 2020-04-27 start
insDetails.Agencyinfo_fromSAP__c = ass.esd.Agencyinfo_fromSAP__c;
- insDetails.Frist_Storage_Agency__c = ass.esd.Frist_Storage_Agency__c == null
- ? ass.esd.Dealer_Info_text__c
- : ass.esd.Frist_Storage_Agency__c;
+ insDetails.Frist_Storage_Agency__c = ass.esd.Frist_Storage_Agency__c == null ? ass.esd.Dealer_Info_text__c : ass.esd.Frist_Storage_Agency__c;
// 杩藉姞棣栨鍏ュ簱缁忛攢鍟� add by gzw 2020-04-27 end
- arriveAmount += ass.esd.Intra_Trade_List_RMB__c;
+ arriveAmount += ass.esd.Intra_Trade_List_RMB__c;
orderdetails.add(insDetails);
}
Integer i = 1;
- for (ConsumableorderdetailsInfo ass : consumableInventoryUse) {
+ for(ConsumableorderdetailsInfo ass : consumableInventoryUse){
//ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR,'------2------'));
Consumable_order_details2__c insAfterDel = new Consumable_order_details2__c();
String str = ('000' + i).right(4);
// if(str.length() == 1){
// str = '0' + str;
// }
- insAfterDel.Name = consumable_order[0].Name + '-' + str;
- insAfterDel.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
+ insAfterDel.Name = consumable_order[0].Name + '-'+ str;
+ insAfterDel.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
// gzw 鎵嬪姩鍏ュ簱 榛樿浜у搧鍗曚环 20230307
// if(EsetId != null && EsetId != ''){
// insAfterDel.Intra_Trade_List_RMB__c = ass.Prod.Intra_Trade_List_RMB__c;
// }else{
// insAfterDel.Intra_Trade_List_RMB__c = 0;
// }
- insAfterDel.Intra_Trade_List_RMB__c = ass.Prod.Intra_Trade_List_RMB__c;
+ insAfterDel.Intra_Trade_List_RMB__c = ass.Prod.Intra_Trade_List_RMB__c;
//gzw 鎵嬪姩鍏ュ簱 榛樿浜у搧鍗曚环 20230307
- insAfterDel.Asset_Model_No__c = ass.Prod.Asset_Model_No__c;
- if (EsetId != null && EsetId != '') {
- insAfterDel.Consumable_order_minor__c = ESetId;
+ insAfterDel.Asset_Model_No__c = ass.Prod.Asset_Model_No__c;
+ if(EsetId != null && EsetId != ''){
+ insAfterDel.Consumable_order_minor__c = ESetId;
}
- insAfterDel.Deliver_date__c = Date.today();
- insAfterDel.Direct_Arrive_Product__c = true;
+ insAfterDel.Deliver_date__c = Date.today();
+ insAfterDel.Direct_Arrive_Product__c = true;
//TODO寰呯‘璁�
- insAfterDel.Sterilization_limit__c = ass.sterilizationlimitDate;
- insAfterDel.Consumable_Product__c = ass.Prod.id;
- insAfterDel.Bar_Code__c = ass.barCodeNo;
- insAfterDel.Used_account__c = accountid;
+ insAfterDel.Sterilization_limit__c = ass.sterilizationlimitDate;
+ insAfterDel.Consumable_Product__c = ass.Prod.id;
+ insAfterDel.Bar_Code__c = ass.barCodeNo;
+ insAfterDel.Used_account__c = accountid;
//TODO寰呯‘璁�
- insAfterDel.SerialLotNo__c = ass.serialNoorLotNo;
- insAfterDel.TracingCode__c = ass.tracingCodeNo;
+ insAfterDel.SerialLotNo__c = ass.serialNoorLotNo;
+ insAfterDel.TracingCode__c = ass.tracingCodeNo;
//insAfterDel.Dealer_Arrive__c = true;
insAfterDel.Consumable_Arrived_order__c = orderMain.id;
- insAfterDel.Arrive_date__c = Date.today();
- insAfterDel.OwnerId = UserInfo.getUserId();
+ insAfterDel.Arrive_date__c = Date.today();
+ insAfterDel.OwnerId = UserInfo.getUserId();
// 鏇存柊鍊熻皟淇℃伅 add by gzw 2020-0-415 start
if (orderdetails2trMap.containsKey(ass.esd.Bar_Code__c)) {
insAfterDel.Transfer_Time__c = ass.esd.Transfer_Time__c == null ? 1 : ass.esd.Transfer_Time__c;
insAfterDel.Agency_Transfer__c = true;
- insAfterDel.Frist_Transfer_Agency__c = ass.esd.Frist_Transfer_Agency__c == null
- ? accountName
- : ass.esd.Frist_Transfer_Agency__c;
+ insAfterDel.Frist_Transfer_Agency__c = ass.esd.Frist_Transfer_Agency__c == null ? accountName : ass.esd.Frist_Transfer_Agency__c;
}
// 鏇存柊鍊熻皟淇℃伅 add by gzw 2020-0-415 end
-
+
// 杩藉姞棣栨鍏ュ簱缁忛攢鍟� add by gzw 2020-04-27 start
insAfterDel.Agencyinfo_fromSAP__c = ass.esd.Agencyinfo_fromSAP__c;
- insAfterDel.Frist_Storage_Agency__c = ass.esd.Frist_Storage_Agency__c == null
- ? accountName
- : ass.esd.Frist_Storage_Agency__c;
+ insAfterDel.Frist_Storage_Agency__c = ass.esd.Frist_Storage_Agency__c == null ? accountName : ass.esd.Frist_Storage_Agency__c;
// 杩藉姞棣栨鍏ュ簱缁忛攢鍟� add by gzw 2020-04-27 end
arriveAmount += insAfterDel.Intra_Trade_List_RMB__c;
//add by rentx 2020-10-14 strat
//insAfterDel.ContractNo_text__c = /*ass.esd.ContractNo__c*/;
// tcm start
if (String.isBlank(ass.esd.Consumable_order_minor__r.ContractNo__c)) {
- insAfterDel.ContractNo_text__c = ass.esd.ContractNo_text__c;
- } else {
- insAfterDel.ContractNo_text__c = ass.esd.Consumable_order_minor__r.ContractNo__c;
+ insAfterDel.ContractNo_text__c= ass.esd.ContractNo_text__c;
+ }else {
+ insAfterDel.ContractNo_text__c= ass.esd.Consumable_order_minor__r.ContractNo__c;
}
// tcm end
//add by rentx 2020-10-14 end
i++;
ins.add(insAfterDel);
+
}
orderMain.Arrive_total_amount__c = arriveAmount;
update orderMain;
List<Consumable_order_details2__c> updateconsumableorderdetails2 = new List<Consumable_order_details2__c>();
//鏇存柊鏄庣粏鍙栨秷鏃堕棿 => 鏈埌璐у彇娑堬紝鍒拌揣鑷姩鐢熸垚鍑哄簱娴佺▼
- List<Consumable_order_details2__c> addSaleOrderList = new List<Consumable_order_details2__c>();
- for (Consumable_order_details2__c Cod : consumableorderdetails2Cancle) {
+ List<Consumable_order_details2__c> addSaleOrderList = new List<Consumable_order_details2__c> ();
+ for(Consumable_order_details2__c Cod : consumableorderdetails2Cancle){
//ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR,'------3------'));
if (Cod.Dealer_Arrive__c) {
- if (Cod.Dealer_Shipment__c == false && Cod.Dealer_Saled__c == false) {
+ if (Cod.Dealer_Shipment__c == FALSE && Cod.Dealer_Saled__c == FALSE) {
addSaleOrderList.add(Cod);
}
} else {
@@ -3627,22 +3327,23 @@
addSaleOrderAuto(addSaleOrderList);
}
- if (updateconsumableorderdetails2.size() > 0) {
+ if(updateconsumableorderdetails2.size() > 0){
update updateconsumableorderdetails2;
}
+
List<Consumable_order_details2__c> insertconsumableorderdetails2 = new List<Consumable_order_details2__c>();
- for (Consumable_order_details2__c Cod2 : consumableorderdetails2Insert) {
+ for(Consumable_order_details2__c Cod2 : consumableorderdetails2Insert){
//ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR,'------4------'));
String str = ('000' + i).right(4);
// if(str.length() == 1){
// str = '0' + str;
// }
- Cod2.Name = consumable_order[0].Name + '-' + str;
- Cod2.Consumable_order_minor__c = null;
- Cod2.Deliver_date__c = Date.today();
- Cod2.Used_account__c = accountid;
+ Cod2.Name = consumable_order[0].Name + '-'+ str;
+ Cod2.Consumable_order_minor__c = null;
+ Cod2.Deliver_date__c = Date.today();
+ Cod2.Used_account__c = accountid;
Cod2.Consumable_Arrived_order__c = orderMain.id;
- Cod2.Arrive_date__c = Date.today();
+ Cod2.Arrive_date__c = Date.today();
// 鏇存柊鍊熻皟淇℃伅 add by gzw 2020-0-415 start
if (orderdetails2trMap.containsKey(Cod2.Bar_Code__c)) {
//ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR,'------4++++++' + Cod2.Frist_Storage_Agency__c));
@@ -3651,269 +3352,256 @@
Cod2.Frist_Transfer_Agency__c = Cod2.Frist_Transfer_Agency__c == null ? accountName : Cod2.Frist_Transfer_Agency__c;
}
// 鏇存柊鍊熻皟淇℃伅 add by gzw 2020-0-415 end
-
+
// 杩藉姞棣栨鍏ュ簱缁忛攢鍟� add by gzw 2020-04-27 start
- Cod2.Agencyinfo_fromSAP__c = Cod2.Agencyinfo_fromSAP__c;
+ Cod2.Agencyinfo_fromSAP__c = Cod2.Agencyinfo_fromSAP__c;
//ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR,'------4------' + Cod2.Frist_Storage_Agency__c));
- Cod2.Frist_Storage_Agency__c = Cod2.Frist_Storage_Agency__c == null ? accountName : Cod2.Frist_Storage_Agency__c;
+ Cod2.Frist_Storage_Agency__c = Cod2.Frist_Storage_Agency__c == null ? accountName : Cod2.Frist_Storage_Agency__c;
// 杩藉姞棣栨鍏ュ簱缁忛攢鍟� add by gzw 2020-04-27 end
insertconsumableorderdetails2.add(Cod2);
i++;
}
- // return null;
+ //return null;
- if (insertconsumableorderdetails2.size() > 0) {
+ if(insertconsumableorderdetails2.size() >0){
insert insertconsumableorderdetails2;
}
- if (ins.size() > 0) {
+ if(ins.size()>0){
insert ins;
}
- if (orderdetails.size() > 0) {
+ if(orderdetails.size()>0){
ControllerUtil.updateOrderDetailsSatus(orderdetails);
}
//瓒呭嚭鍒拌揣鏁伴噺浜у搧鍙栨秷鏃ユ湡鏇存柊
List<Consumable_order_details2__c> needcanceldet = new List<Consumable_order_details2__c>();
- if (cancellationProList.size() > 0) {
- needcanceldet = [
- SELECT Id, Cancellation_Date__c
- FROM Consumable_order_details2__c
- WHERE
- Asset_Model_No__c IN :cancellationProList
- AND Consumable_order_minor__c = :ESetId
- AND Dealer_Arrive__c = FALSE
- AND Cancellation_Date__c = NULL
- ];
- if (needcanceldet.size() > 0) {
- for (Integer a = 0; a < needcanceldet.size(); a++) {
+ if(cancellationProList.size() > 0){
+ needcanceldet = [SELECT Id,
+ Cancellation_Date__c
+ FROM Consumable_order_details2__c
+ WHERE Asset_Model_No__c in :cancellationProList
+ AND Consumable_order_minor__c = :ESetId
+ AND Dealer_Arrive__c = FALSE
+ AND Cancellation_Date__c = null ];
+ if(needcanceldet.size() >0){
+ for(Integer a = 0; a < needcanceldet.size(); a++){
needcanceldet[a].Cancellation_Date__c = Date.today();
needcanceldet[a].Cancellation_Flag__c = true;
}
ControllerUtil.updateOrderDetailsSatus(needcanceldet);
}
}
- List<Consumable_order__c> qs = new List<Consumable_order__c>();
- qs = [
- SELECT
- Id,
- Name,
- Order_status__c,
- Dealer_Info__c,
- Deliver_date__c,
- ReturnGs_Upload_Date__c,
- Order_Reason__c,
- Order_date__c,
- Contract_application_decision__c,
- Order_type__c,
- Total_num__c,
- OrderNumber_arrived__c,
- Delivery_detail_count__c,
- OrderNumber_notarrive__c
- FROM Consumable_order__c
- WHERE Id = :ESetId AND Dealer_Info__c = :accountid
- ];
- if (qs.size() > 0) {
+ List<Consumable_order__c> qs = New List<Consumable_order__c>();
+ qs = [SELECT Id,Name,Order_status__c,Dealer_Info__c,Deliver_date__c,ReturnGs_Upload_Date__c,
+ Order_Reason__c,Order_date__c,
+ Contract_application_decision__c,Order_type__c,Total_num__c,
+ OrderNumber_arrived__c,Delivery_detail_count__c,OrderNumber_notarrive__c
+ FROM Consumable_order__c
+ WHERE Id =:ESetId
+ AND Dealer_Info__c = :accountid];
+ if (qs.size()>0){
coc = qs[0];
}
saveFLGbln = true;
alertMessage = '鍒拌揣瀹屾垚銆�';
// Integer a = 1/0;
- } catch (Exception e) {
+ }catch(Exception e){
Database.rollback(sp);
- ApexPages.addMessages(e);
+ //LWC:Lwcflag鍜屾姤閿欐彁閱� update by Link 2023-04-27
+ if(isLwc){
+ returnError = e.getLineNumber()+'---'+e.getMessage();
+ }else {
+ ApexPages.addMessages(e);
+ }
return null;
}
- if (resultcheck.length() > 0) {
+ if(resultcheck.length() > 0){
return null;
- } else if (resultcheckWithoutOrder.size() > 0) {
+ }else if(resultcheckWithoutOrder.size() >0){
return null;
- } else {
+ } else{
+ urlType = 'UnabletoEdit';
return UnabletoEdit();
// return null;
}
}
-
+
// 杩斿搧妫�鏌ワ紝鍚庡洖搴�
- public integer GoodsReturnCheck() {
- List<String> GrListIn = ParseBarCode(barcode);
+ public integer GoodsReturnCheck(){
+ List<String> GrListIn = ParseBarCode( barcode );
GrList = new List<String>();
- Map<String, String> CheckBarcodeResult = new Map<String, String>();
- for (String Str : GrListIn) {
- CheckBarcodeResult.put(str, 'UnFind');
+ Map<String,String> CheckBarcodeResult = new Map<String,String>();
+ for( String Str : GrListIn ){
+ CheckBarcodeResult.put( str , 'UnFind');
}
- List<Consumable_order_details2__c> BarcodeRetrunResult = [
- SELECT
- Id,
- Name,
- Intra_Trade_List_RMB__c,
- Asset_Model_No__c,
- Consumable_Product__c,
- Consumable_Product__r.Name,
- Consumable_Product__r.Name__c,
- Consumable_Product__r.Asset_Model_No__c,
- Sterilization_limit__c,
- Deliver_date__c,
- Bar_Code__c,
- Arrive_date__c,
- Send_Date__c,
- Consumable_order_minor__r.Name,
- Consumable_order_minor__c,
- Dealer_Arrive__c,
- Guarantee_period_for_products__c,
- CFDA_Status__c,
- ProductPacking_list_manual__c,
- Report_Product_Approbation__c,
- Report_Product_Expiration__c,
- Box_Piece__c,
- Rrturn_count__c,
- Product_Type__c,
- //add by rentx 2020-10-14 start
- ContractNo_text__c /*,ContractNo__c*/,
- // tcm start
- Consumable_order_minor__r.ContractNo__c
- // tcm end
- //add by rentx 2020-10-14 end
- FROM Consumable_order_details2__c
- WHERE
- Dealer_Arrive__c = TRUE
- AND (Dealer_Shipment__c = TRUE
- //AND Consumable_Shipment_order__r.SummonsForDirction__c != '浜掔浉璋冭揣')
- OR Dealer_Saled__c = TRUE)
- AND Dealer_Info_text__c = :accountName
- AND Bar_Code__c IN :GrListIn
- AND (NOT Product_Type__c LIKE :userPro_Typestr)
- AND Dealer_Returned__c = FALSE
- AND Arrive_Owner_Work_Location__c = :userWorkLocation
- ORDER BY Box_Piece__c DESC, Name
- ];
- if (BarcodeRetrunResult.size() > 0) {
+ List<Consumable_order_details2__c> BarcodeRetrunResult =
+ [ SELECT Id,Name,Intra_Trade_List_RMB__c,Asset_Model_No__c,
+ Consumable_Product__c,Consumable_Product__r.Name,
+ Consumable_Product__r.Name__c,Consumable_Product__r.Asset_Model_No__c,
+ Sterilization_limit__c,Deliver_date__c,Bar_Code__c,
+ Arrive_date__c,Send_Date__c,Consumable_order_minor__r.Name,
+ Consumable_order_minor__c,Dealer_Arrive__c,
+ Guarantee_period_for_products__c,CFDA_Status__c,
+ ProductPacking_list_manual__c,Report_Product_Approbation__c,
+ Report_Product_Expiration__c,Box_Piece__c, Rrturn_count__c,
+ Product_Type__c
+ //add by rentx 2020-10-14 start
+ ,ContractNo_text__c/*,ContractNo__c*/
+ // tcm start
+ ,Consumable_order_minor__r.ContractNo__c
+ // tcm end
+ //add by rentx 2020-10-14 end
+ FROM Consumable_order_details2__c
+ WHERE ((Dealer_Arrive__c = true
+ AND( Dealer_Shipment__c = true
+ //AND Consumable_Shipment_order__r.SummonsForDirction__c != '浜掔浉璋冭揣')
+ or Dealer_Saled__c = true
+ )
+ ))
+ AND Dealer_Info_text__c = :accountName
+ AND Bar_Code__c in :GrListIn
+ AND ( not Product_Type__c like :userPro_Typestr)
+ AND Dealer_Returned__c = false
+ AND Arrive_Owner_Work_Location__c =: userWorkLocation
+ ORDER BY Box_Piece__c desc,Name ];
+ if(BarcodeRetrunResult.size()>0){
for (Integer i = 0; i < BarcodeRetrunResult.size(); i++) {
- if (
- ErrorIdMap.containsKey(BarcodeRetrunResult[i].Bar_Code__c) || ExistIdMap.containsKey(BarcodeRetrunResult[i].Bar_Code__c)
- ) {
+ if(ErrorIdMap.containsKey(BarcodeRetrunResult[i].Bar_Code__c) || ExistIdMap.containsKey(BarcodeRetrunResult[i].Bar_Code__c)){
// 璺宠繃宸茬粡澶勭悊鐨勬秷鑰楀搧鏄庣粏
continue;
- } else {
- String str = '浜у搧绫诲瀷[' + BarcodeRetrunResult[i].Product_Type__c + ']涓庣敤鎴风殑绫诲瀷[' + userPro_Type + ']涓嶇';
- ConsumableorderdetailsRecordserror.add(new ConsumableorderdetailsInfo(BarcodeRetrunResult[i], str));
- ErrorIdMap.put(BarcodeRetrunResult[i].Bar_Code__c, BarcodeRetrunResult[i].Bar_Code__c);
+ }else{
+ String str = '浜у搧绫诲瀷['+BarcodeRetrunResult[i].Product_Type__c+']涓庣敤鎴风殑绫诲瀷['+userPro_Type+']涓嶇';
+ ConsumableorderdetailsRecordserror.add(new ConsumableorderdetailsInfo(BarcodeRetrunResult[i],str));
+ ErrorIdMap.put(BarcodeRetrunResult[i].Bar_Code__c,BarcodeRetrunResult[i].Bar_Code__c);
}
}
}
AllMap.putAll(ErrorIdMap);
- BarcodeRetrunResult = [
- SELECT
- Id,
- Consumable_order_minor__c,
- Deliver_date__c,
- Asset_Model_No__c,
- Consumable_Product__c,
- Consumable_Product__r.Name,
- Consumable_Product__r.Name__c,
- Name,
- Bar_Code__c,
- Arrive_date__c,
- Dealer_Shipment__c,
- Lose_Flag__c,
- Dealer_Saled__c,
- Return_reason__c,
- Consumable_Shipment_order__c,
- Consumable_Shipment_order__r.Name,
- Send_date__c,
- Consumable_Sale_order__c,
- Consumable_Sale_order__r.Name,
- Used_date__c,
- SerialLotNo__c,
- TracingCode__c,
- Sterilization_limit__c,
- Consumable_ZS_order__c,
- Consumable_ZS_order__r.Name,
- Product_OutDate__c,
- Invoice_Date__c,
- recordtypeid,
- Consumable_Arrived_order__c,
- Box_Piece__c,
- Rrturn_count__c,
- Intra_Trade_List_RMB__c,
- OwnerId,
- SummonsForDirction_det__c,
- Order_Dealer_Info__c,
- HospItal_Name__c,
- Agencyinfo_fromSAP__c,
- Frist_Storage_Agency__c,
- Dealer_Info_text__c,
- Used_account__c,
- Transfer_Time__c,
- Frist_Transfer_Agency__c,
- Arrive_Owner_Work_Location__c,
- Agency_Transfer__c,
- //add by rentx 2020-10-14 start
- ContractNo_text__c /*,ContractNo__c*/,
- // tcm start
- Consumable_order_minor__r.ContractNo__c,
- // tcm end
- //add by rentx 2020-10-14 end
- Report_Product_Expiration__c,
- Intra_Trade_List__c
- FROM Consumable_order_details2__c
- WHERE
- Dealer_Arrive__c = TRUE
- AND (Dealer_Shipment__c = TRUE
- //AND Consumable_Shipment_order__r.SummonsForDirction__c != '浜掔浉璋冭揣')
- OR Dealer_Saled__c = TRUE
- // WYIN-BLZE48鐩樼偣涓㈠け浜у搧澧炲姞鍏ュ簱鏂瑰紡 update by vivek 2020-03-05 start
- OR (Dealer_Shipment__c = FALSE
- AND Dealer_Saled__c = FALSE
- AND Lose_Flag__c = TRUE))
- // WYIN-BLZE48鐩樼偣涓㈠け浜у搧澧炲姞鍏ュ簱鏂瑰紡 update by vivek 2020-03-05 end
- AND Dealer_Info_text__c = :accountName
- AND Bar_Code__c IN :GrListIn
- AND Product_Type__c LIKE :userPro_Typestr
- AND Dealer_Returned__c = FALSE
- AND (Arrive_Owner_Work_Location__c = :userWorkLocation
- OR OwnerId = :System.Label.User_OlympusSystem)
- ORDER BY Box_Piece__c DESC, Name
- ];
- ShowGoodsofReturnList = new List<ConsumableorderdetailsInfo>();
+ BarcodeRetrunResult =
+ [ SELECT Id,
+ Consumable_order_minor__c,
+ Deliver_date__c,
+ Asset_Model_No__c,
+ Consumable_Product__c,
+ Consumable_Product__r.Name,
+ Consumable_Product__r.Name__c,
+ Name,
+ Bar_Code__c,
+ Arrive_date__c,
+ Dealer_Shipment__c,
+ Lose_Flag__c,
+ Dealer_Saled__c,
+ Return_reason__c,
+ Consumable_Shipment_order__c,
+ Consumable_Shipment_order__r.Name,
+ Send_date__c,
+ Consumable_Sale_order__c,
+ Consumable_Sale_order__r.Name,
+ Used_date__c,
+ SerialLotNo__c,
+ TracingCode__c,
+ Sterilization_limit__c,
+ Consumable_ZS_order__c,
+ Consumable_ZS_order__r.Name,
+ Product_OutDate__c,
+ Invoice_Date__c,
+ recordtypeid,
+ Consumable_Arrived_order__c,
+ Box_Piece__c,
+ Rrturn_count__c,
+ Intra_Trade_List_RMB__c,
+ OwnerId,
+ SummonsForDirction_det__c,
+ Order_Dealer_Info__c,
+ HospItal_Name__c,
+ Agencyinfo_fromSAP__c,
+ Frist_Storage_Agency__c,
+ Dealer_Info_text__c,
+ Used_account__c,
+ Transfer_Time__c,
+ Frist_Transfer_Agency__c,
+ Arrive_Owner_Work_Location__c,
+ Agency_Transfer__c
+ //add by rentx 2020-10-14 start
+ ,ContractNo_text__c/*,ContractNo__c*/
+ // tcm start
+ ,Consumable_order_minor__r.ContractNo__c
+ // tcm end
+ //add by rentx 2020-10-14 end
+ ,Report_Product_Expiration__c
+ ,Intra_Trade_List__c
+ FROM Consumable_order_details2__c
+ WHERE ((Dealer_Arrive__c = true
+ AND( Dealer_Shipment__c = true
+ //AND Consumable_Shipment_order__r.SummonsForDirction__c != '浜掔浉璋冭揣')
+ or Dealer_Saled__c = true
+ // WYIN-BLZE48鐩樼偣涓㈠け浜у搧澧炲姞鍏ュ簱鏂瑰紡 update by vivek 2020-03-05 start
+ or (Dealer_Shipment__c = false and Dealer_Saled__c = false and Lose_Flag__c = true)
+ // WYIN-BLZE48鐩樼偣涓㈠け浜у搧澧炲姞鍏ュ簱鏂瑰紡 update by vivek 2020-03-05 end
+ )
+ ))
+ AND Dealer_Info_text__c = :accountName
+ AND Bar_Code__c in :GrListIn
+ AND Product_Type__c like :userPro_Typestr
+ AND Dealer_Returned__c = false
+ AND (Arrive_Owner_Work_Location__c =: userWorkLocation
+ OR OwnerId = :System.Label.User_OlympusSystem)
+ ORDER BY Box_Piece__c desc,Name ];
+ ShowGoodsofReturnList = new List<ConsumableorderdetailsInfo>();
//杩斿搧鏃秈stinct澶勭悊
- if (ArrType == 'ReG') {
+ if(ArrType=='ReG'){
BarcodeRetrunResult = getDistinctZSOrder(BarcodeRetrunResult);
}
- for (Consumable_order_details2__c codc : BarcodeRetrunResult) {
- if (ErrorIdMap.containsKey(codc.Bar_Code__c) || ExistIdMap.containsKey(codc.Bar_Code__c)) {
+ for( Consumable_order_details2__c codc : BarcodeRetrunResult ){
+ if(ErrorIdMap.containsKey(codc.Bar_Code__c) || ExistIdMap.containsKey(codc.Bar_Code__c)){
// 璺宠繃宸茬粡澶勭悊鐨勬秷鑰楀搧鏄庣粏
continue;
- } else {
+ }else{
+
Matcher n = Pattern.compile('[0-9]').matcher(codc.TracingCode__c);
- if (n.find()) {
- String str = '绠$悊缂栫爜涓湁鏁板瓧锛岃涓庣鐞嗗憳纭鏄惁閿欒銆�';
- ConsumableorderdetailsRecordserror.add(new ConsumableorderdetailsInfo(codc, str));
- ErrorIdMap.put(codc.Bar_Code__c, codc.Bar_Code__c);
+ if(n.find()){
+ // gzw DB202305352696 鍏ュ簱绠$悊缂栫爜楠岃瘉绋嬪簭璋冩暣 start
+ if (codc.TracingCode__c.length() == 5) {
+ String tr = codc.TracingCode__c;
+ String Ctr = tr.substring(tr.length() - 3,tr.length());
+ String Btr = tr.substring(tr.length() - 4,tr.length()-3);
+ String Atr = tr.substring(tr.length() - 5,tr.length()-4);
+ if (Pattern.compile('[0-9]').matcher(Atr).find() || Pattern.compile('[0-9]').matcher(Ctr).find()) {
+ String str = '绠$悊缂栫爜鏈夎锛岃妫�鏌ユ潯褰㈢爜鏁版嵁銆�';
+ ConsumableorderdetailsRecordserror.add(new ConsumableorderdetailsInfo(codc,str));
+ ErrorIdMap.put(codc.Bar_Code__c,codc.Bar_Code__c);
continue;
}
- if (CheckBarcodeResult.containsKey(codc.Bar_Code__c)) {
+ }
+ // String str = '绠$悊缂栫爜涓湁鏁板瓧锛岃涓庣鐞嗗憳纭鏄惁閿欒銆�';
+ // ConsumableorderdetailsRecordserror.add(new ConsumableorderdetailsInfo(codc,str));
+ // ErrorIdMap.put(codc.Bar_Code__c,codc.Bar_Code__c);
+ // continue;
+ // gzw DB202305352696 鍏ュ簱绠$悊缂栫爜楠岃瘉绋嬪簭璋冩暣 end
+ }
+ if( CheckBarcodeResult.containsKey( codc.Bar_Code__c )){
GrList.add(codc.Bar_Code__c);
- if (codc.Dealer_Shipment__c == true) {
- CheckBarcodeResult.put(codc.Bar_Code__c, '宸插嚭搴�');
- ShowGoodsofReturnList.add(new ConsumableorderdetailsInfo(codc));
+ if( codc.Dealer_Shipment__c == true){
+ CheckBarcodeResult.put( codc.Bar_Code__c, '宸插嚭搴�' );
+ ShowGoodsofReturnList.add( new ConsumableorderdetailsInfo( codc ) );
}
// WYIN-BLZE48鐩樼偣涓㈠け浜у搧澧炲姞鍏ュ簱鏂瑰紡 update by vivek 2020-03-05 start
// else{
// CheckBarcodeResult.put( codc.Bar_Code__c, '宸查攢鍞�');
// ShowGoodsofReturnList.add( new ConsumableorderdetailsInfo( codc ) );
// }
- else if (codc.Dealer_Saled__c == true) {
- CheckBarcodeResult.put(codc.Bar_Code__c, '宸查攢鍞�');
- ShowGoodsofReturnList.add(new ConsumableorderdetailsInfo(codc));
- } else {
- CheckBarcodeResult.put(codc.Bar_Code__c, '宸蹭涪澶�');
- ShowGoodsofReturnList.add(new ConsumableorderdetailsInfo(codc));
+ else if( codc.Dealer_Saled__c == true ){
+ CheckBarcodeResult.put( codc.Bar_Code__c, '宸查攢鍞�');
+ ShowGoodsofReturnList.add( new ConsumableorderdetailsInfo( codc ) );
+ }else{
+ CheckBarcodeResult.put( codc.Bar_Code__c, '宸蹭涪澶�');
+ ShowGoodsofReturnList.add( new ConsumableorderdetailsInfo( codc ) );
}
// WYIN-BLZE48鐩樼偣涓㈠け浜у搧澧炲姞鍏ュ簱鏂瑰紡 update by vivek 2020-03-05 end
- } else {
+ }else{
continue;
}
}
@@ -3923,126 +3611,113 @@
}
// 鍗曚綅涓轰釜鐨凚arcode瀵瑰簲鐨勫嚭搴撳崟
- public integer Getconsumableorderdetails2Nobox() {
+ public integer Getconsumableorderdetails2Nobox(){
consumableorderdetails2Nobox = new List<Consumable_order_details2__c>();
BarcodeCntMap.clear();
- consumableorderdetails2Nobox = [
- SELECT
- Id,
- Consumable_order_minor__c,
- Deliver_date__c,
- Asset_Model_No__c,
- Consumable_Product__c,
- Consumable_Product__r.Name,
- Consumable_Product__r.Name__c,
- Name,
- Bar_Code__c,
- Arrive_date__c,
- Dealer_Shipment__c,
- Dealer_Saled__c,
- Return_reason__c,
- Consumable_Shipment_order__c,
- Send_date__c,
- Consumable_Sale_order__c,
- Used_date__c,
- SerialLotNo__c,
- TracingCode__c,
- Sterilization_limit__c,
- Consumable_ZS_order__c,
- Consumable_ZS_order__r.Name,
- Product_OutDate__c,
- Invoice_Date__c,
- recordtypeid,
- Consumable_Arrived_order__c,
- Box_Piece__c,
- RemoveBox_No__c,
- RemoveBox_date__c,
- Rrturn_count__c,
- Dealer_Info_text__c,
- Arrive_Owner_Work_Location__c,
- Intra_Trade_List_RMB__c,
- //add by rentx 2020-10-13 start 杩斿搧鏃� 鏂版暟鎹褰昐AP鍚堝悓鍙�
- ContractNo_text__c /*,ContractNo__c*/,
- // tcm start
- Consumable_order_minor__r.ContractNo__c,
- // tcm end
- Report_Product_Expiration__c,
- //add by rentx 2020-10-13 end
- Intra_Trade_List__c
- //gzw 鎵嬪姩鍏ュ簱 榛樿浜у搧鍗曚环 20230307
- FROM Consumable_order_details2__c
- WHERE
- // WYIN-BLZE48鐩樼偣涓㈠け浜у搧澧炲姞鍏ュ簱鏂瑰紡 update by vivek 2020-03-05 start
- // (Dealer_Shipment__c = true or Dealer_Saled__c = true)
- (Dealer_Shipment__c = TRUE
- OR Dealer_Saled__c = TRUE
- OR (Dealer_Shipment__c = FALSE
- AND Dealer_Saled__c = FALSE
- AND Lose_Flag__c = TRUE))
- // WYIN-BLZE48鐩樼偣涓㈠け浜у搧澧炲姞鍏ュ簱鏂瑰紡 update by vivek 2020-03-05 end
- AND Dealer_Info_text__c = :accountName
- AND Bar_Code__c IN :noboxBarcodeList
- AND Arrive_Owner_Work_Location__c = :userWorkLocation
- AND Dealer_Returned__c = FALSE
- AND Box_Piece__c = '涓�'
- ORDER BY Consumable_ZS_order__c, RemoveBox_No__c
- ];
+ consumableorderdetails2Nobox =
+ [ SELECT Id,
+ Consumable_order_minor__c,
+ Deliver_date__c,
+ Asset_Model_No__c,
+ Consumable_Product__c,
+ Consumable_Product__r.Name,
+ Consumable_Product__r.Name__c,
+ Name,
+ Bar_Code__c,
+ Arrive_date__c,
+ Dealer_Shipment__c,
+ Dealer_Saled__c,
+ Return_reason__c,
+ Consumable_Shipment_order__c,
+ Send_date__c,
+ Consumable_Sale_order__c,
+ Used_date__c,
+ SerialLotNo__c,
+ TracingCode__c,
+ Sterilization_limit__c,
+ Consumable_ZS_order__c,
+ Consumable_ZS_order__r.Name,
+ Product_OutDate__c,
+ Invoice_Date__c,
+ recordtypeid,
+ Consumable_Arrived_order__c,
+ Box_Piece__c,
+ RemoveBox_No__c,
+ RemoveBox_date__c,
+ Rrturn_count__c,
+ Dealer_Info_text__c,
+ Arrive_Owner_Work_Location__c,
+ Intra_Trade_List_RMB__c
+ //add by rentx 2020-10-13 start 杩斿搧鏃� 鏂版暟鎹褰昐AP鍚堝悓鍙�
+ ,ContractNo_text__c/*,ContractNo__c*/
+ // tcm start
+ ,Consumable_order_minor__r.ContractNo__c
+ // tcm end
+ ,Report_Product_Expiration__c
+ //add by rentx 2020-10-13 end
+ ,Intra_Trade_List__c
+ //gzw 鎵嬪姩鍏ュ簱 榛樿浜у搧鍗曚环 20230307
+ FROM Consumable_order_details2__c
+ WHERE
+ // WYIN-BLZE48鐩樼偣涓㈠け浜у搧澧炲姞鍏ュ簱鏂瑰紡 update by vivek 2020-03-05 start
+ // (Dealer_Shipment__c = true or Dealer_Saled__c = true)
+ (Dealer_Shipment__c = true or Dealer_Saled__c = true or (Dealer_Shipment__c = false and Dealer_Saled__c = false and Lose_Flag__c = true))
+ // WYIN-BLZE48鐩樼偣涓㈠け浜у搧澧炲姞鍏ュ簱鏂瑰紡 update by vivek 2020-03-05 end
+ AND Dealer_Info_text__c = :accountName
+ AND Bar_Code__c in :noboxBarcodeList
+ AND Arrive_Owner_Work_Location__c =: userWorkLocation
+ AND Dealer_Returned__c = false
+ AND Box_Piece__c = '涓�'
+ ORDER BY Consumable_ZS_order__c,RemoveBox_No__c];
- AggregateResult[] results = [
- SELECT Consumable_ZS_order__c, Bar_Code__c, count(Id) recordCount
- FROM Consumable_order_details2__c
- WHERE
- Dealer_Arrive__c = TRUE
- // WYIN-BLZE48鐩樼偣涓㈠け浜у搧澧炲姞鍏ュ簱鏂瑰紡 update by vivek 2020-03-05 start
- // AND (Dealer_Shipment__c= true OR Dealer_Saled__c = true)
- AND (Dealer_Shipment__c = TRUE
- OR Dealer_Saled__c = TRUE
- OR (Dealer_Shipment__c = FALSE
- AND Dealer_Saled__c = FALSE
- AND Lose_Flag__c = TRUE))
- // WYIN-BLZE48鐩樼偣涓㈠け浜у搧澧炲姞鍏ュ簱鏂瑰紡 update by vivek 2020-03-05 end
- AND Dealer_Returned__c = FALSE
- AND Bar_Code__c IN :noboxBarcodeList
- AND Arrive_Owner_Work_Location__c = :userWorkLocation
- AND Box_Piece__c = '涓�'
- AND Dealer_Info_text__c = :accountName
- GROUP BY Consumable_ZS_order__c, Bar_Code__c
- ];
+ AggregateResult[] results = [SELECT Consumable_ZS_order__c,Bar_Code__c,count(Id) recordCount
+ FROM Consumable_order_details2__c
+ WHERE Dealer_Arrive__c = true
+ // WYIN-BLZE48鐩樼偣涓㈠け浜у搧澧炲姞鍏ュ簱鏂瑰紡 update by vivek 2020-03-05 start
+ // AND (Dealer_Shipment__c= true OR Dealer_Saled__c = true)
+ AND (Dealer_Shipment__c= true OR Dealer_Saled__c = true or(Dealer_Shipment__c = false and Dealer_Saled__c = false and Lose_Flag__c = true))
+ // WYIN-BLZE48鐩樼偣涓㈠け浜у搧澧炲姞鍏ュ簱鏂瑰紡 update by vivek 2020-03-05 end
+ AND Dealer_Returned__c = false
+ AND Bar_Code__c in :noboxBarcodeList
+ AND Arrive_Owner_Work_Location__c =: userWorkLocation
+ AND Box_Piece__c = '涓�'
+ AND Dealer_Info_text__c = :accountName
+ GROUP BY Consumable_ZS_order__c,Bar_Code__c];
- for (AggregateResult ar : results) {
+ for(AggregateResult ar: results){
String key = '' + ar.get('Consumable_ZS_order__c') + ar.get('Bar_Code__c');
BarcodeCntMap.put(key, Integer.valueOf(ar.get('recordCount')));
}
-
+
return consumableorderdetails2Nobox.size();
}
//distinct
- public List<Consumable_order_details2__c> getDistinctZSOrder(List<Consumable_order_details2__c> duplicates) {
- List<Consumable_order_details2__c> distinctOrder = new List<Consumable_order_details2__c>();
-
- for (Consumable_order_details2__c details2 : duplicates) {
+ public List<Consumable_order_details2__c> getDistinctZSOrder(List<Consumable_order_details2__c> duplicates){
+ List<Consumable_order_details2__c> distinctOrder = new List<Consumable_order_details2__c>();
+
+ for(Consumable_order_details2__c details2 : duplicates){
Boolean found = false;
- for (Consumable_order_details2__c result : distinctOrder) {
- if (details2.Consumable_ZS_order__c == result.Consumable_ZS_order__c && details2.Bar_Code__c == result.Bar_Code__c) {
+ for(Consumable_order_details2__c result : distinctOrder){
+ if(details2.Consumable_ZS_order__c == result.Consumable_ZS_order__c
+ && details2.Bar_Code__c == result.Bar_Code__c){
found = true;
break;
}
}
- if (!found) {
+ if(!found){
distinctOrder.add(details2);
- if (details2.Box_Piece__c == '涓�')
- noboxBarcodeList.add(details2.Bar_Code__c);
- }
+ if(details2.Box_Piece__c == '涓�') noboxBarcodeList.add(details2.Bar_Code__c);
+ }
}
return distinctOrder;
}
- // Update杩斿搧鏄庣粏淇℃伅
- public Pagereference UpdateGoodsOfReturn() {
- if (ShowGoodsofReturnList == null) {
+ // Update杩斿搧鏄庣粏淇℃伅
+ public Pagereference UpdateGoodsOfReturn(){
+ if( ShowGoodsofReturnList==null){
GoodsReturnCheck();
}
Getconsumableorderdetails2Nobox();
@@ -4050,277 +3725,269 @@
Savepoint sp = Database.setSavepoint();
boolean hasReturnGoods = false;
boolean hasLoseGoods = false;
- try {
- if (ShowGoodsofReturnList.size() > 0 || consumableInventory.size() > 0) {
- Consumable_order__c Return_Order_Sheet = new Consumable_order__c();
- Return_Order_Sheet.Name = '*';
- Return_Order_Sheet.Order_status__c = '鎵瑰噯';
+ try{
+ if( ShowGoodsofReturnList.size() >0 || consumableInventory.size()>0 ){
+
+ Consumable_order__c Return_Order_Sheet = new Consumable_order__c();
+ Return_Order_Sheet.Name ='*';
+ Return_Order_Sheet.Order_status__c = '鎵瑰噯';
Return_Order_Sheet.ReturnGs_Uploader_ID__c = UserInfo.getUserId();
Return_Order_Sheet.ReturnGs_Upload_Date__c = Date.today();
- Return_Order_Sheet.Order_type__c = '杩斿搧';
- Return_Order_Sheet.RecordTypeid = System.Label.Dealer_Returned_Label;
- Return_Order_Sheet.Order_ProType__c = userPro_Type;
+ Return_Order_Sheet.Order_type__c = '杩斿搧';
+ Return_Order_Sheet.RecordTypeid =System.Label.Dealer_Returned_Label;
+ Return_Order_Sheet.Order_ProType__c = userPro_Type;
insert Return_Order_Sheet;
return_Order_id = Return_Order_Sheet.id;
- List<Consumable_order__c> consumable_order_ret = [SELECT Name FROM Consumable_order__c WHERE id = :Return_Order_Sheet.id];
-
+ List<Consumable_order__c> consumable_order_ret = [SELECT Name FROM Consumable_order__c WHERE id =:Return_Order_Sheet.id];
+
//2017-07-03 鍒拌揣璁㈠崟
- Consumable_order__c Arrived_Order_Sheet = new Consumable_order__c();
- Arrived_Order_Sheet.Name = '*';
- Arrived_Order_Sheet.Order_status__c = '鎵瑰噯';
- Arrived_Order_Sheet.Order_type__c = '鍒拌揣';
- Arrived_Order_Sheet.Dealer_Info__c = accountid;
- Arrived_Order_Sheet.RecordTypeid = System.Label.RT_ConOrder_Arrive;
- Arrived_Order_Sheet.Order_ProType__c = userPro_Type;
+ Consumable_order__c Arrived_Order_Sheet = new Consumable_order__c();
+ Arrived_Order_Sheet.Name ='*';
+ Arrived_Order_Sheet.Order_status__c = '鎵瑰噯';
+ Arrived_Order_Sheet.Order_type__c = '鍒拌揣';
+ Arrived_Order_Sheet.Dealer_Info__c =accountid;
+ Arrived_Order_Sheet.RecordTypeid =System.Label.RT_ConOrder_Arrive;
+ Arrived_Order_Sheet.Order_ProType__c = userPro_Type;
insert Arrived_Order_Sheet;
- List<Consumable_order__c> consumable_order_arr = [SELECT Name FROM Consumable_order__c WHERE id = :Arrived_Order_Sheet.id];
+ List<Consumable_order__c> consumable_order_arr = [SELECT Name FROM Consumable_order__c WHERE id =:Arrived_Order_Sheet.id];
// WYIN-BLZE48鐩樼偣涓㈠け浜у搧澧炲姞鍏ュ簱鏂瑰紡 update by vivek 2020-03-05 start
// 铏氭嫙鐩樼偣鍗�
- Consumable_order__c Inventory_Order_Sheet = new Consumable_order__c();
- Inventory_Order_Sheet.Name = '*';
- Inventory_Order_Sheet.Order_status__c = '鎵瑰噯';
+ Consumable_order__c Inventory_Order_Sheet = new Consumable_order__c();
+ Inventory_Order_Sheet.Name ='*';
+ Inventory_Order_Sheet.Order_status__c = '鎵瑰噯';
Inventory_Order_Sheet.ReturnGs_Uploader_ID__c = UserInfo.getUserId();
- Inventory_Order_Sheet.Inventory_date__c = Date.today();
- Inventory_Order_Sheet.Dealer_Info__c = accountid;
+ Inventory_Order_Sheet.Inventory_date__c = Date.today();
+ Inventory_Order_Sheet.Dealer_Info__c =accountid;
Inventory_Order_Sheet.ReturnGs_Upload_Date__c = Date.today();
- Inventory_Order_Sheet.Order_type__c = '鐩樼偣';
- Inventory_Order_Sheet.RecordTypeid = System.Label.RT_ConOrder_Inventory;
- Inventory_Order_Sheet.Order_ProType__c = userPro_Type;
+ Inventory_Order_Sheet.Order_type__c = '鐩樼偣';
+ Inventory_Order_Sheet.RecordTypeid = System.Label.RT_ConOrder_Inventory;
+ Inventory_Order_Sheet.Order_ProType__c = userPro_Type;
insert Inventory_Order_Sheet;
inventory_Order_id = Inventory_Order_Sheet.id;
- List<Consumable_order__c> consumable_order_Inv = [
- SELECT Name
- FROM Consumable_order__c
- WHERE id = :Inventory_Order_Sheet.id
- ];
+ //List<Consumable_order__c> consumable_order_Inv = [SELECT Name FROM Consumable_order__c WHERE id =:Inventory_Order_Sheet.id]; //Commented By Li Jun 20230616
// WYIN-BLZE48鐩樼偣涓㈠け浜у搧澧炲姞鍏ュ簱鏂瑰紡 update by vivek 2020-03-05 end
- List<Consumable_order_details2__c> codcList = new List<Consumable_order_details2__c>();
+ List<Consumable_order_details2__c> codcList = new List<Consumable_order_details2__c>();
//鏂拌杩斿搧瀵瑰簲鐨勪骇鍝佹槑缁�
- List<Consumable_order_details2__c> codcorderdetList = new List<Consumable_order_details2__c>();
+ List<Consumable_order_details2__c> codcorderdetList = new List<Consumable_order_details2__c>();
//杩斿搧鍘熷洜,杩斿搧鏁伴噺妫�鏌�
- for (ConsumableorderdetailsInfo codi : ShowGoodsofReturnList) {
- if (
- codi.esd.Box_Piece__c == '涓�' &&
- (codi.esd.Rrturn_count__c == null ||
- String.valueof(codi.esd.Rrturn_count__c) == '' ||
- codi.esd.Rrturn_count__c <= 0)
- ) {
+ for( ConsumableorderdetailsInfo codi : ShowGoodsofReturnList ){
+ if (codi.esd.Box_Piece__c =='涓�' && (
+ codi.esd.Rrturn_count__c == null ||
+ String.valueof(codi.esd.Rrturn_count__c) =='' ||
+ codi.esd.Rrturn_count__c <= 0)){
continue;
}
- if (codi.esd.Return_reason__c == null || codi.esd.Return_reason__c == '') {
- codi.esd.Return_reason__c.addError('璇疯ˉ鍏呰繑鍝佸師鍥�');
+ if(codi.esd.Return_reason__c==null||codi.esd.Return_reason__c==''){
+ if(isLwc){
+ returnError = '璇疯ˉ鍏呰繑鍝佸師鍥�';
+ }else {
+ codi.esd.Return_reason__c.addError('璇疯ˉ鍏呰繑鍝佸師鍥�');
+ }
return null;
}
- if (codi.esd.Box_Piece__c == '涓�' && codi.esd.Rrturn_count__c > 0) {
+
+ if(codi.esd.Box_Piece__c=='涓�' && codi.esd.Rrturn_count__c > 0){
String key = '' + codi.esd.Consumable_ZS_order__c + codi.esd.Bar_Code__c;
Integer deliverycnt = BarcodeCntMap.get(key);
- if (codi.esd.Rrturn_count__c > deliverycnt) {
- codi.esd.Rrturn_count__c.addError('瓒呭嚭鍑哄簱鏁伴噺');
+ if(codi.esd.Rrturn_count__c > deliverycnt){
+ if(isLwc){
+ returnError = '瓒呭嚭鍑哄簱鏁伴噺';
+ }else {
+ codi.esd.Rrturn_count__c.addError('瓒呭嚭鍑哄簱鏁伴噺');
+ }
return null;
- }
+ }
}
}
- Integer tempNo = 0;
+ Integer tempNo=0;
// WYIN-BLZE48鐩樼偣涓㈠け浜у搧澧炲姞鍏ュ簱鏂瑰紡 update by vivek 2020-03-05 start
List<Consumable_order_details2__c> conOrderDetail2InList = new List<Consumable_order_details2__c>();
// WYIN-BLZE48鐩樼偣涓㈠け浜у搧澧炲姞鍏ュ簱鏂瑰紡 update by vivek 2020-03-05 start
- for (ConsumableorderdetailsInfo codi : ShowGoodsofReturnList) {
+ for( ConsumableorderdetailsInfo codi : ShowGoodsofReturnList ){
Consumable_order_details2__c codcorderdet = new Consumable_order_details2__c();
-
+
//鍗曚綅=涓�
- if (
- codi.esd.Box_Piece__c == '涓�' &&
- (codi.esd.Rrturn_count__c == null ||
- String.valueof(codi.esd.Rrturn_count__c) == '' ||
- codi.esd.Rrturn_count__c <= 0)
- ) {
+ if (codi.esd.Box_Piece__c =='涓�' && (
+ codi.esd.Rrturn_count__c == null ||
+ String.valueof(codi.esd.Rrturn_count__c) =='' ||
+ codi.esd.Rrturn_count__c <= 0)){
continue;
}
- if (codi.esd.Box_Piece__c == '涓�' && codi.esd.Rrturn_count__c > 0) {
+ if(codi.esd.Box_Piece__c=='涓�' && codi.esd.Rrturn_count__c > 0){
hasReturnGoods = true;
Integer cnt = 1;
- for (Consumable_order_details2__c codctmp : consumableorderdetails2Nobox) {
- if (
- codctmp.Consumable_ZS_order__c == codi.esd.Consumable_ZS_order__c &&
- codctmp.Bar_Code__c == codi.esd.Bar_Code__c
- ) {
+ for(Consumable_order_details2__c codctmp : consumableorderdetails2Nobox ){
+ if(codctmp.Consumable_ZS_order__c == codi.esd.Consumable_ZS_order__c && codctmp.Bar_Code__c == codi.esd.Bar_Code__c){
Consumable_order_details2__c esd = codctmp;
// esd.Consumable_Return_order__c = Return_Order_Sheet.id;
- esd.Return_reason__c = codi.esd.Return_reason__c;
- esd.Return_date__c = Date.today();
+ esd.Return_reason__c = codi.esd.Return_reason__c;
+ esd.Return_date__c = Date.today();
// WYIN-BLZE48鐩樼偣涓㈠け浜у搧澧炲姞鍏ュ簱鏂瑰紡 update by vivek 2020-03-05 start
// esd.Return_reason__c = codi.esd.Return_reason__c;
// esd.Return_date__c = Date.today();
// esd.Consumable_Return_order__c = Return_Order_Sheet.id;
- if (
- codi.esd.Dealer_Saled__c == false &&
- codi.esd.Dealer_Shipment__c == false &&
- codi.esd.Lose_Flag__c == true
- ) {
+ if(codi.esd.Dealer_Saled__c == false && codi.esd.Dealer_Shipment__c == false && codi.esd.Lose_Flag__c == true){
// esd.Lose_Flag__c = false;
esd.Consumable_Inventory_order__c = Inventory_Order_Sheet.id;
conOrderDetail2InList.add(esd);
hasLoseGoods = true;
- } else {
+ }
+ else{
// esd.Return_date__c = Date.today();
- esd.Consumable_Return_order__c = Return_Order_Sheet.id;
+ esd.Consumable_Return_order__c = Return_Order_Sheet.id;
+
}
// WYIN-BLZE48鐩樼偣涓㈠け浜у搧澧炲姞鍏ュ簱鏂瑰紡 update by vivek 2020-03-05 end
- esd.ReturnGs_Uploader_ID__c = UserInfo.getUserId();
-
+ esd.ReturnGs_Uploader_ID__c = UserInfo.getUserId();
+
//淇敼杩斿搧鎵�鏈変汉
- esd.OwnerId = UserInfo.getUserId();
- esd.RecordTypeId = System.Label.RT_ConOrderDetail2_Return;
-
+ esd.OwnerId = UserInfo.getUserId();
+ esd.RecordTypeId = System.Label.RT_ConOrderDetail2_Return;
+
//Consumable_order__c coc = [select name from Consumable_order__c where Id =:Arrived_Order_Sheet.id];
codcorderdet = new Consumable_order_details2__c();
- codcorderdet.Name = consumable_order_arr[0].name + '-' + String.valueOf(++tempNo).leftPad(4, '0');
- codcorderdet.Consumable_order_minor__c = codi.esd.Consumable_order_minor__c;
+ codcorderdet.Name = consumable_order_arr[0].name + '-' + String.valueOf(++tempNo).leftPad(4,'0');
+ codcorderdet.Consumable_order_minor__c = codi.esd.Consumable_order_minor__c;
codcorderdet.Consumable_Arrived_order__c = Arrived_Order_Sheet.id;
//淇敼鍒拌揣鎵�鏈変汉
- codcorderdet.OwnerId = UserInfo.getUserId();
- codcorderdet.Arrive_date__c = Date.today();
- codcorderdet.Consumable_Product__c = codi.esd.Consumable_Product__c;
- codcorderdet.Asset_Model_No__c = codi.esd.Asset_Model_No__c;
- codcorderdet.Bar_Code__c = codi.esd.Bar_Code__c;
- codcorderdet.Deliver_date__c = codi.esd.Deliver_date__c;
- codcorderdet.SerialLotNo__c = codi.esd.SerialLotNo__c;
- codcorderdet.TracingCode__c = codi.esd.TracingCode__c;
- codcorderdet.Sterilization_limit__c = codi.esd.Sterilization_limit__c;
+ codcorderdet.OwnerId = UserInfo.getUserId();
+ codcorderdet.Arrive_date__c = Date.today();
+ codcorderdet.Consumable_Product__c = codi.esd.Consumable_Product__c;
+ codcorderdet.Asset_Model_No__c = codi.esd.Asset_Model_No__c;
+ codcorderdet.Bar_Code__c = codi.esd.Bar_Code__c;
+ codcorderdet.Deliver_date__c = codi.esd.Deliver_date__c;
+ codcorderdet.SerialLotNo__c = codi.esd.SerialLotNo__c;
+ codcorderdet.TracingCode__c = codi.esd.TracingCode__c;
+ codcorderdet.Sterilization_limit__c = codi.esd.Sterilization_limit__c;
//gzw 鎵嬪姩鍏ュ簱 榛樿浜у搧鍗曚环 20230307
- codcorderdet.Intra_Trade_List_RMB__c = (codi.esd.Intra_Trade_List_RMB__c == null ||
- codi.esd.Intra_Trade_List_RMB__c == 0)
- ? codi.esd.Intra_Trade_List__c
- : codi.esd.Intra_Trade_List_RMB__c;
- codcorderdet.RemoveBox_No__c = codctmp.RemoveBox_No__c;
- codcorderdet.RemoveBox_date__c = codctmp.RemoveBox_date__c;
- codcorderdet.Box_Piece__c = codctmp.Box_Piece__c;
+ codcorderdet.Intra_Trade_List_RMB__c = (codi.esd.Intra_Trade_List_RMB__c == null || codi.esd.Intra_Trade_List_RMB__c == 0) ? codi.esd.Intra_Trade_List__c : codi.esd.Intra_Trade_List_RMB__c;
+ codcorderdet.RemoveBox_No__c = codctmp.RemoveBox_No__c;
+ codcorderdet.RemoveBox_date__c = codctmp.RemoveBox_date__c;
+ codcorderdet.Box_Piece__c = codctmp.Box_Piece__c;
//add by rentx 2020-10-13 start 杩斿搧鏃舵柊鏁版嵁璁板綍SAP鍚堝悓鍙�
// codcorderdet.ContractNo_text__c= codctmp.ContractNo__c;
// tcm start
if (String.isBlank(codctmp.Consumable_order_minor__r.ContractNo__c)) {
- codcorderdet.ContractNo_text__c = codctmp.ContractNo_text__c;
- } else {
- codcorderdet.ContractNo_text__c = codctmp.Consumable_order_minor__r.ContractNo__c;
+ codcorderdet.ContractNo_text__c= codctmp.ContractNo_text__c;
+ }else {
+ codcorderdet.ContractNo_text__c= codctmp.Consumable_order_minor__r.ContractNo__c;
}
// tcm end
//add by rentx 2020-10-13 end 杩斿搧鏃舵柊鏁版嵁璁板綍SAP鍚堝悓鍙�
+
// WYIN-BLZE48鐩樼偣涓㈠け浜у搧澧炲姞鍏ュ簱鏂瑰紡 update by vivek 2020-03-05 start
- if (hasLoseGoods) {
+ if(hasLoseGoods){
codcorderdet.loseInventory__c = true;
}
// WYIN-BLZE48鐩樼偣涓㈠け浜у搧澧炲姞鍏ュ簱鏂瑰紡 update by vivek 2020-03-05 end
-
+
// 杩藉姞棣栨鍏ュ簱缁忛攢鍟� add by gzw 2020-04-27 start
// 杩斿搧鏃讹紝鈶犺拷鍔犲�熻皟鍊熷嚭鏂逛俊鎭� 鈶′繚鐣欏�熻皟淇℃伅 鈶繚瀛楽AP鍜岀粡閿�鍟嗛娆″彂璐х粡閿�鍟�
- codcorderdet.Used_account__c = codi.esd.Used_account__c;
- codcorderdet.Transfer_Time__c = codi.esd.Transfer_Time__c;
- codcorderdet.Frist_Transfer_Agency__c = codi.esd.Frist_Transfer_Agency__c;
- codcorderdet.Agency_Transfer__c = codi.esd.Agency_Transfer__c;
+ codcorderdet.Used_account__c = codi.esd.Used_account__c;
+ codcorderdet.Transfer_Time__c = codi.esd.Transfer_Time__c;
+ codcorderdet.Frist_Transfer_Agency__c = codi.esd.Frist_Transfer_Agency__c;
+ codcorderdet.Agency_Transfer__c = codi.esd.Agency_Transfer__c;
- codcorderdet.Agencyinfo_fromSAP__c = codi.esd.Agencyinfo_fromSAP__c;
+ codcorderdet.Agencyinfo_fromSAP__c = codi.esd.Agencyinfo_fromSAP__c;
//ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR,'------1------' + codi.esd.Frist_Storage_Agency__c));
- codcorderdet.Frist_Storage_Agency__c = codi.esd.Frist_Storage_Agency__c == null
- ? codi.esd.Dealer_Info_text__c
- : codi.esd.Frist_Storage_Agency__c;
+ codcorderdet.Frist_Storage_Agency__c = codi.esd.Frist_Storage_Agency__c == null ? codi.esd.Dealer_Info_text__c : codi.esd.Frist_Storage_Agency__c;
// 杩藉姞棣栨鍏ュ簱缁忛攢鍟� add by gzw 2020-04-27 end
codcorderdetList.add(codcorderdet);
- codcList.add(esd);
+ codcList.add( esd );
cnt++;
- if (cnt > codi.esd.Rrturn_count__c)
- break;
+ if(cnt > codi.esd.Rrturn_count__c) break;
}
+
}
- } else {
+ }
+ else{
hasReturnGoods = true;
//鍗曚綅=鐩�
//changeinvoiceInfo(codi.esd);
//Consumable_order__c coc = [select name from Consumable_order__c where Id =:Arrived_Order_Sheet.id];
// WYIN-BLZE48鐩樼偣涓㈠け浜у搧澧炲姞鍏ュ簱鏂瑰紡 update by vivek 2020-03-05 start
- codi.esd.Return_date__c = Date.today();
+ codi.esd.Return_date__c = Date.today();
// codi.esd.Consumable_Return_order__c = Return_Order_Sheet.id;
- if (codi.esd.Dealer_Saled__c == false && codi.esd.Dealer_Shipment__c == false && codi.esd.Lose_Flag__c == true) {
+ if(codi.esd.Dealer_Saled__c == false && codi.esd.Dealer_Shipment__c == false && codi.esd.Lose_Flag__c == true){
codi.esd.Lose_Flag__c = false;
codi.esd.Return_reason__c = '';
- codi.esd.Consumable_Inventory_order__c = Inventory_Order_Sheet.id;
+ codi.esd.Consumable_Inventory_order__c = Inventory_Order_Sheet.id;
conOrderDetail2InList.add(codi.esd);
hasLoseGoods = true;
- } else {
+ }
+ else{
// codi.esd.Return_date__c = Date.today();
- codi.esd.Consumable_Return_order__c = Return_Order_Sheet.id;
+ codi.esd.Consumable_Return_order__c = Return_Order_Sheet.id;
+
}
// WYIN-BLZE48鐩樼偣涓㈠け浜у搧澧炲姞鍏ュ簱鏂瑰紡 update by vivek 2020-03-05 end
- codi.esd.ReturnGs_Uploader_ID__c = UserInfo.getUserId();
+ codi.esd.ReturnGs_Uploader_ID__c = UserInfo.getUserId();
// codi.esd.Consumable_Return_order__c = Return_Order_Sheet.id;
//淇敼杩斿搧鎵�鏈変汉
- codi.esd.OwnerId = UserInfo.getUserId();
- codi.esd.RecordTypeId = System.Label.RT_ConOrderDetail2_Return;
- codcorderdet.Name = consumable_order_arr[0].name + '-' + String.valueOf(++tempNo).leftPad(4, '0');
- codcorderdet.Consumable_order_minor__c = codi.esd.Consumable_order_minor__c;
+ codi.esd.OwnerId = UserInfo.getUserId();
+ codi.esd.RecordTypeId = System.Label.RT_ConOrderDetail2_Return;
+ codcorderdet.Name = consumable_order_arr[0].name + '-' + String.valueOf(++tempNo).leftPad(4,'0');
+ codcorderdet.Consumable_order_minor__c = codi.esd.Consumable_order_minor__c;
codcorderdet.Consumable_Arrived_order__c = Arrived_Order_Sheet.id;
//淇敼鍒拌揣鎵�鏈変汉
- codcorderdet.OwnerId = UserInfo.getUserId();
- codcorderdet.Arrive_date__c = Date.today();
- codcorderdet.Consumable_Product__c = codi.esd.Consumable_Product__c;
- codcorderdet.Asset_Model_No__c = codi.esd.Asset_Model_No__c;
- codcorderdet.Bar_Code__c = codi.esd.Bar_Code__c;
- codcorderdet.Deliver_date__c = codi.esd.Deliver_date__c;
- codcorderdet.SerialLotNo__c = codi.esd.SerialLotNo__c;
- codcorderdet.TracingCode__c = codi.esd.TracingCode__c;
- codcorderdet.Sterilization_limit__c = codi.esd.Sterilization_limit__c;
+ codcorderdet.OwnerId = UserInfo.getUserId();
+ codcorderdet.Arrive_date__c = Date.today();
+ codcorderdet.Consumable_Product__c = codi.esd.Consumable_Product__c;
+ codcorderdet.Asset_Model_No__c = codi.esd.Asset_Model_No__c;
+ codcorderdet.Bar_Code__c = codi.esd.Bar_Code__c;
+ codcorderdet.Deliver_date__c = codi.esd.Deliver_date__c;
+ codcorderdet.SerialLotNo__c = codi.esd.SerialLotNo__c;
+ codcorderdet.TracingCode__c = codi.esd.TracingCode__c;
+ codcorderdet.Sterilization_limit__c = codi.esd.Sterilization_limit__c;
//gzw 鎵嬪姩鍏ュ簱 榛樿浜у搧鍗曚环 20230307
- codcorderdet.Intra_Trade_List_RMB__c = (codi.esd.Intra_Trade_List_RMB__c == null ||
- codi.esd.Intra_Trade_List_RMB__c == 0)
- ? codi.esd.Intra_Trade_List__c
- : codi.esd.Intra_Trade_List_RMB__c;
+ codcorderdet.Intra_Trade_List_RMB__c = (codi.esd.Intra_Trade_List_RMB__c == null || codi.esd.Intra_Trade_List_RMB__c == 0) ? codi.esd.Intra_Trade_List__c : codi.esd.Intra_Trade_List_RMB__c;
// WYIN-BLZE48鐩樼偣涓㈠け浜у搧澧炲姞鍏ュ簱鏂瑰紡 update by vivek 2020-03-05 start
- if (hasLoseGoods) {
+ if(hasLoseGoods){
codcorderdet.loseInventory__c = true;
}
// WYIN-BLZE48鐩樼偣涓㈠け浜у搧澧炲姞鍏ュ簱鏂瑰紡 update by vivek 2020-03-05 end
// 杩藉姞棣栨鍏ュ簱缁忛攢鍟� add by gzw 2020-04-27 start
// 杩斿搧鏃讹紝鈶犺拷鍔犲�熻皟鍊熷嚭鏂逛俊鎭� 鈶′繚鐣欏�熻皟淇℃伅 鈶繚瀛楽AP鍜岀粡閿�鍟嗛娆″彂璐х粡閿�鍟�
- codcorderdet.Used_account__c = codi.esd.Used_account__c;
- codcorderdet.Transfer_Time__c = codi.esd.Transfer_Time__c;
- codcorderdet.Frist_Transfer_Agency__c = codi.esd.Frist_Transfer_Agency__c;
- codcorderdet.Agency_Transfer__c = codi.esd.Agency_Transfer__c;
+ codcorderdet.Used_account__c = codi.esd.Used_account__c;
+ codcorderdet.Transfer_Time__c = codi.esd.Transfer_Time__c;
+ codcorderdet.Frist_Transfer_Agency__c = codi.esd.Frist_Transfer_Agency__c;
+ codcorderdet.Agency_Transfer__c = codi.esd.Agency_Transfer__c;
- codcorderdet.Agencyinfo_fromSAP__c = codi.esd.Agencyinfo_fromSAP__c;
+ codcorderdet.Agencyinfo_fromSAP__c = codi.esd.Agencyinfo_fromSAP__c;
//ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR,'------2------' + codi.esd.Frist_Storage_Agency__c));
- codcorderdet.Frist_Storage_Agency__c = codi.esd.Frist_Storage_Agency__c == null
- ? codi.esd.Dealer_Info_text__c
- : codi.esd.Frist_Storage_Agency__c;
+ codcorderdet.Frist_Storage_Agency__c = codi.esd.Frist_Storage_Agency__c == null ? codi.esd.Dealer_Info_text__c : codi.esd.Frist_Storage_Agency__c;
// 杩藉姞棣栨鍏ュ簱缁忛攢鍟� add by gzw 2020-04-27 end
//add by rentx 2020-10-13 start 杩斿搧鏃舵柊鏁版嵁璁板綍SAP鍚堝悓鍙�
// codcorderdet.ContractNo_text__c = /*codi.esd.ContractNo__c*/;
// tcm start
if (String.isBlank(codi.esd.Consumable_order_minor__r.ContractNo__c)) {
- codcorderdet.ContractNo_text__c = codi.esd.ContractNo_text__c;
- } else {
- codcorderdet.ContractNo_text__c = codi.esd.Consumable_order_minor__r.ContractNo__c;
+ codcorderdet.ContractNo_text__c= codi.esd.ContractNo_text__c;
+ }else {
+ codcorderdet.ContractNo_text__c= codi.esd.Consumable_order_minor__r.ContractNo__c;
}
// tcm end
//add by rentx 2020-10-13 end 杩斿搧鏃舵柊鏁版嵁璁板綍SAP鍚堝悓鍙�
codcorderdetList.add(codcorderdet);
- codcList.add(codi.esd);
+ codcList.add( codi.esd );
}
}
+
//鏄庣粏2涓嶅瓨鍦ㄧ殑瀵瑰簲鐨勫埌璐ц鍗曟槑缁� 2017-07-05
Integer i = 1;
//for(ConsumableorderdetailsInfo ass : consumableInventoryUse){
- for (ConsumableorderdetailsInfo ass : consumableInventory) {
+ for(ConsumableorderdetailsInfo ass : consumableInventory){
hasReturnGoods = true;
Consumable_order_details2__c codcorderdetail = new Consumable_order_details2__c();
Consumable_order_details2__c retorddetail = new Consumable_order_details2__c();
@@ -4329,33 +3996,38 @@
// str = '0' + str;
// }
- if (ass.ReturnReason == null || ass.ReturnReason == '') {
- ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR, '璇疯ˉ鍏呰繑鍝佸師鍥�'));
+ if(ass.ReturnReason==null || ass.ReturnReason==''){
+ //LWC:Lwcflag鍜屾姤閿欐彁閱� update by Link 2023-04-27
+ if(isLwc){
+ returnError = '璇疯ˉ鍏呰繑鍝佸師鍥�';
+ }else {
+ ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR,'璇疯ˉ鍏呰繑鍝佸師鍥�'));
+ }
return null;
}
//鍒拌揣鏄庣粏
- codcorderdetail.Name = consumable_order_arr[0].Name + '-' + str;
- codcorderdetail.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
- codcorderdetail.Intra_Trade_List_RMB__c = ass.Prod.Intra_Trade_List_RMB__c;
+ codcorderdetail.Name = consumable_order_arr[0].Name + '-'+ str;
+ codcorderdetail.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
+ codcorderdetail.Intra_Trade_List_RMB__c = ass.Prod.Intra_Trade_List_RMB__c;
//gzw 鎵嬪姩鍏ュ簱 榛樿浜у搧鍗曚环 20230307
- codcorderdetail.Asset_Model_No__c = ass.Prod.Asset_Model_No__c;
- codcorderdetail.Direct_Arrive_Product__c = true;
- codcorderdetail.Sterilization_limit__c = ass.sterilizationlimitDate;
- codcorderdetail.Consumable_Product__c = ass.Prod.id;
- codcorderdetail.Bar_Code__c = ass.barCodeNo;
- codcorderdetail.SerialLotNo__c = ass.serialNoorLotNo;
- codcorderdetail.TracingCode__c = ass.tracingCodeNo;
+ codcorderdetail.Asset_Model_No__c = ass.Prod.Asset_Model_No__c;
+ codcorderdetail.Direct_Arrive_Product__c = true;
+ codcorderdetail.Sterilization_limit__c = ass.sterilizationlimitDate;
+ codcorderdetail.Consumable_Product__c = ass.Prod.id;
+ codcorderdetail.Bar_Code__c = ass.barCodeNo;
+ codcorderdetail.SerialLotNo__c = ass.serialNoorLotNo;
+ codcorderdetail.TracingCode__c = ass.tracingCodeNo;
codcorderdetail.Consumable_Arrived_order__c = Arrived_Order_Sheet.id;
- codcorderdetail.Arrive_date__c = Date.today();
+ codcorderdetail.Arrive_date__c = Date.today();
//add by rentx 2020-10-14 start
// codcorderdetail.ContractNo_text__c = /*ass.esd.ContractNo__c*/;
// tcm start
if (String.isBlank(ass.esd.Consumable_order_minor__r.ContractNo__c)) {
- codcorderdetail.ContractNo_text__c = ass.esd.ContractNo_text__c;
- } else {
- codcorderdetail.ContractNo_text__c = ass.esd.Consumable_order_minor__r.ContractNo__c;
+ codcorderdetail.ContractNo_text__c= ass.esd.ContractNo_text__c;
+ }else {
+ codcorderdetail.ContractNo_text__c= ass.esd.Consumable_order_minor__r.ContractNo__c;
}
// tcm end
//add by rentx 2020-10-14 end
@@ -4363,44 +4035,45 @@
codcorderdetList.add(codcorderdetail);
//杩斿搧鏄庣粏
- retorddetail.Return_reason__c = ass.ReturnReason;
- retorddetail.Return_date__c = Date.today();
- retorddetail.ReturnGs_Uploader_ID__c = UserInfo.getUserId();
+ retorddetail.Return_reason__c = ass.ReturnReason;
+ retorddetail.Return_date__c = Date.today();
+ retorddetail.ReturnGs_Uploader_ID__c = UserInfo.getUserId();
// WYIN-BLZE48鐩樼偣涓㈠け浜у搧澧炲姞鍏ュ簱鏂瑰紡 update by vivek 2020-03-05 start
// if(ass.esd.Dealer_Saled__c == false && ass.esd.Dealer_Shipment__c == false && ass.esd.Lose_Flag__c == true){
// retorddetail.Consumable_Inventory_order__c = Inventory_Order_Sheet.id;
// retorddetail.loseInventory__c = true;
// }
- retorddetail.Consumable_Return_order__c = Return_Order_Sheet.id;
+ retorddetail.Consumable_Return_order__c = Return_Order_Sheet.id;
// WYIN-BLZE48鐩樼偣涓㈠け浜у搧澧炲姞鍏ュ簱鏂瑰紡 update by vivek 2020-03-05 end
- retorddetail.Name = consumable_order_ret[0].Name + '-' + str;
- retorddetail.RecordTypeId = System.Label.RT_ConOrderDetail2_Return;
- retorddetail.Intra_Trade_List_RMB__c = ass.Prod.Intra_Trade_List_RMB__c;
+
+ retorddetail.Name = consumable_order_ret[0].Name + '-'+ str;
+ retorddetail.RecordTypeId = System.Label.RT_ConOrderDetail2_Return;
+ retorddetail.Intra_Trade_List_RMB__c = ass.Prod.Intra_Trade_List_RMB__c;
//gzw 鎵嬪姩鍏ュ簱 榛樿浜у搧鍗曚环 20230307
- retorddetail.Dealer_Info_IF__c = accountid;
- retorddetail.Asset_Model_No__c = ass.Prod.Asset_Model_No__c;
- retorddetail.Direct_Arrive_Product__c = true;
- retorddetail.Sterilization_limit__c = ass.sterilizationlimitDate;
- retorddetail.Consumable_Product__c = ass.Prod.id;
- retorddetail.Bar_Code__c = ass.barCodeNo;
- retorddetail.SerialLotNo__c = ass.serialNoorLotNo;
- retorddetail.TracingCode__c = ass.tracingCodeNo;
- retorddetail.Arrive_date__c = Date.today();
- retorddetail.Deliver_date__c = Date.today();
+ retorddetail.Dealer_Info_IF__c = accountid;
+ retorddetail.Asset_Model_No__c = ass.Prod.Asset_Model_No__c;
+ retorddetail.Direct_Arrive_Product__c = true;
+ retorddetail.Sterilization_limit__c = ass.sterilizationlimitDate;
+ retorddetail.Consumable_Product__c = ass.Prod.id;
+ retorddetail.Bar_Code__c = ass.barCodeNo;
+ retorddetail.SerialLotNo__c = ass.serialNoorLotNo;
+ retorddetail.TracingCode__c = ass.tracingCodeNo;
+ retorddetail.Arrive_date__c = Date.today();
+ retorddetail.Deliver_date__c = Date.today();
// 杩藉姞棣栨鍏ュ簱缁忛攢鍟� add by gzw 2020-04-27 start
- retorddetail.Frist_Storage_Agency__c = accountName;
+ retorddetail.Frist_Storage_Agency__c = accountName;
// 杩藉姞棣栨鍏ュ簱缁忛攢鍟� add by gzw 2020-04-27 end
//add by rentx 2020-10-14 start
// retorddetail.ContractNo_text__c = /*ass.esd.ContractNo__c*/;
// tcm start
- if (String.isBlank(ass.esd.Consumable_order_minor__r.ContractNo__c)) {
- retorddetail.ContractNo_text__c = ass.esd.ContractNo_text__c;
- } else {
- retorddetail.ContractNo_text__c = ass.esd.Consumable_order_minor__r.ContractNo__c;
- }
+ if (String.isBlank(ass.esd.Consumable_order_minor__r.ContractNo__c)) {
+ retorddetail.ContractNo_text__c= ass.esd.ContractNo_text__c;
+ }else {
+ retorddetail.ContractNo_text__c= ass.esd.Consumable_order_minor__r.ContractNo__c;
+ }
// tcm end
//add by rentx 2020-10-14 end
@@ -4411,88 +4084,107 @@
// ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR,'------end------'));
// return null;
- if (codcList.size() > 0) {
- ControllerUtil.updateOrderDetailsSatus(codcList);
+ if(codcList.size()>0){
+ ControllerUtil.updateOrderDetailsSatus( codcList );
//insert codcorderdetList;
}
- if (codcorderdetList.size() > 0) {
- System.debug('codcorderdetList +++++ ' + codcorderdetList);
+ if (codcorderdetList.size()>0){
+ System.debug('codcorderdetList +++++ '+ codcorderdetList);
insert codcorderdetList;
}
// WYIN-BPE3T4 铏氭嫙鐩樼偣鍗� update by vivek 2020-05-11 start
- if (conOrderDetail2InList.size() > 0) {
+ if(conOrderDetail2InList.size() > 0){
addInventoryDetails1(conOrderDetail2InList);
}
// WYIN-BPE3T4 铏氭嫙鐩樼偣鍗� update by vivek 2020-05-11 start
- if (hasReturnGoods) {
+ if(hasReturnGoods){
// WYIN-BPE3T4 铏氭嫙鐩樼偣鍗� update by vivek 2020-05-11 start
// return ToReturnGoodsPage();
- if (hasLoseGoods) {
+ if(hasLoseGoods){
+ urlType = 'ToInventoryGoodsPage';
return ToInventoryGoodsPage();
// return null;
- } else {
+ }else{
+ urlType = 'ToReturnGoodsPage';
return ToReturnGoodsPage();
// return null;
}
// WYIN-BPE3T4 铏氭嫙鐩樼偣鍗� update by vivek 2020-05-11 start
- } else {
- ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR, '娌℃湁闇�瑕佺櫥褰曠殑杩斿搧'));
+ }
+ else{
+ //LWC:Lwcflag鍜屾姤閿欐彁閱� update by Link 2023-04-27
+ if(isLwc){
+ returnError = '娌℃湁闇�瑕佺櫥褰曠殑杩斿搧';
+ }else {
+ ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR,'娌℃湁闇�瑕佺櫥褰曠殑杩斿搧'));
+ }
return null;
}
- } else {
- ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR, '娌℃湁闇�瑕佺櫥褰曠殑杩斿搧'));
+
+ }else{
+ //LWC:Lwcflag鍜屾姤閿欐彁閱� update by Link 2023-04-27
+ if(isLwc){
+ returnError = '娌℃湁闇�瑕佺櫥褰曠殑杩斿搧';
+ }else {
+ ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR,'娌℃湁闇�瑕佺櫥褰曠殑杩斿搧'));
+ }
return null;
}
- } catch (Exception e) {
+ }catch(Exception e){
Database.rollback(sp);
- ApexPages.addMessages(e);
+ //LWC:Lwcflag鍜屾姤閿欐彁閱� update by Link 2023-04-27
+ if(isLwc){
+ returnError = e.getLineNumber()+'---'+e.getMessage();
+ }else {
+ ApexPages.addMessages(e);
+ }
return null;
}
}
- public void makeArrivedSummary() {
+ public void makeArrivedSummary(){
detailsSummary = new List<ConsumableorderdetailsInfo>();
//ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR,'consumableInventory ' + consumableInventory));
- try {
+ try{
ConsumableorderdetailsInfo arriveDdetailsSummary = null;
- Map<String, ConsumableorderdetailsInfo> detailsSummaryMap = new Map<String, ConsumableorderdetailsInfo>();
- for (ConsumableorderdetailsInfo ass : ConsumableorderdetailsRecords) {
- if (detailsSummaryMap.containsKey(ass.Prod.Id)) {
- detailsSummaryMap.get(ass.Prod.Id).arrivedCount++;
+ Map<String,ConsumableorderdetailsInfo> detailsSummaryMap = new Map<String,ConsumableorderdetailsInfo>();
+ for(ConsumableorderdetailsInfo ass : ConsumableorderdetailsRecords){
+ if(detailsSummaryMap.containsKey(ass.Prod.Id)){
+ detailsSummaryMap.get(ass.Prod.Id).arrivedCount ++;
detailsSummaryMap.get(ass.Prod.Id).arriveAmount += ass.esd.Intra_Trade_List_RMB__c;
- } else {
+ }else{
arriveDdetailsSummary = new ConsumableorderdetailsInfo(ass.Prod);
arriveDdetailsSummary.arrivedCount = 1;
arriveDdetailsSummary.arriveAmount = ass.esd.Intra_Trade_List_RMB__c;
detailsSummaryMap.put(ass.Prod.Id, arriveDdetailsSummary);
}
}
- for (ConsumableorderdetailsInfo ass : consumableInventory) {
- if (detailsSummaryMap.containsKey(ass.Prod.Id)) {
- detailsSummaryMap.get(ass.Prod.Id).arrivedCount++;
- if (EsetId != null && EsetId != '') {
+ for(ConsumableorderdetailsInfo ass : consumableInventory){
+ if(detailsSummaryMap.containsKey(ass.Prod.Id)){
+ detailsSummaryMap.get(ass.Prod.Id).arrivedCount ++;
+ if(EsetId != null && EsetId != ''){
detailsSummaryMap.get(ass.Prod.Id).arriveAmount += ass.Prod.Intra_Trade_List_RMB__c;
- } else {
+ }else{
detailsSummaryMap.get(ass.Prod.Id).arriveAmount += 0;
}
- } else {
+ }else{
arriveDdetailsSummary = new ConsumableorderdetailsInfo(ass.Prod);
arriveDdetailsSummary.arrivedCount = 1;
- if (EsetId != null && EsetId != '') {
+ if(EsetId != null && EsetId != ''){
arriveDdetailsSummary.arriveAmount = ass.Prod.Intra_Trade_List_RMB__c;
- } else {
+ }else{
arriveDdetailsSummary.arriveAmount = 0;
}
detailsSummaryMap.put(ass.Prod.Id, arriveDdetailsSummary);
}
}
- for (String key : detailsSummaryMap.keySet()) {
+ for(String key : detailsSummaryMap.keySet()){
detailsSummary.add(detailsSummaryMap.get(key));
}
- } catch (Exception e) {
+ }catch(Exception e){
//Database.rollback(sp);
- throw new ControllerUtil.myException('e::' + e + ' linenumber::' + e.getLineNumber());
+ throw new ControllerUtil.myException('e::'+e + ' linenumber::'+e.getLineNumber());
// ApexPages.addMessages(e);
// ApexPages.addMessages(e.getLineNumber() + ' 11111111111111111');
@@ -4501,23 +4193,23 @@
}
//璺宠浆鍒拌繑鍝侀〉闈�
- public Pagereference ToReturnGoodsPage() {
- PageReference ref = new Pagereference('/' + return_Order_id);
- ref.setRedirect(true);
- return ref;
+ public Pagereference ToReturnGoodsPage(){
+ PageReference ref = new Pagereference('/'+return_Order_id);
+ ref.setRedirect(true);
+ return ref;
}
-
+
// WYIN-BPE3T4 铏氭嫙鐩樼偣鍗� update by vivek 2020-05-11 start
- public Pagereference ToInventoryGoodsPage() {
- PageReference ref = new Pagereference('/' + inventory_Order_id);
- ref.setRedirect(true);
- return ref;
+ public Pagereference ToInventoryGoodsPage(){
+ PageReference ref = new Pagereference('/'+inventory_Order_id);
+ ref.setRedirect(true);
+ return ref;
}
// WYIN-BPE3T4 铏氭嫙鐩樼偣鍗� update by vivek 2020-05-11 end
- // 璺宠浆鍒板埌璐ц鍗曟槑缁�
- public PageReference UnabletoEdit() {
- PageReference ref = new Pagereference('/ArriveGsDetails?EsetId=' + arriveId);
+ // 璺宠浆鍒板埌璐ц鍗曟槑缁�
+ public PageReference UnabletoEdit(){
+ PageReference ref = new Pagereference('/ArriveGsDetails?EsetId='+arriveId);
ref.setRedirect(true);
return ref;
}
@@ -4539,38 +4231,45 @@
public Decimal arriveAmount { get; set; }
public Decimal arrivedCount { get; set; }
- public String ReportProductExpirationDate { get; set; }
- public ConsumableorderdetailsInfo(Consumable_order_details2__c e, string str) {
- esd = e;
- Prod = e.Consumable_Product__r;
+ public String ReportProductExpirationDate {get;set;}
+
+ public ConsumableorderdetailsInfo(){
+
+ }
+
+ public ConsumableorderdetailsInfo(Consumable_order_details2__c e,string str) {
+ esd = e;
+ Prod = e.Consumable_Product__r;
oldConsumableCount = e.name;
- ErrorReason = str;
+ ErrorReason = str;
intMark = 1;
if (e.Report_Product_Expiration__c != null) {
- ReportProductExpirationDate = e.Report_Product_Expiration__c.format();
+ ReportProductExpirationDate = e.Report_Product_Expiration__c.format();
}
+
}
public ConsumableorderdetailsInfo(Consumable_order_details2__c e) {
canEdit = false;
- if (e.Box_Piece__c == '鐩�') {
+ if(e.Box_Piece__c=='鐩�'){
e.Rrturn_count__c = 1;
canEdit = true;
}
- esd = e;
- Prod = e.Consumable_Product__r;
+ esd = e;
+ Prod = e.Consumable_Product__r;
oldConsumableCount = e.name;
if (e.Report_Product_Expiration__c != null) {
- ReportProductExpirationDate = e.Report_Product_Expiration__c.format();
+ ReportProductExpirationDate = e.Report_Product_Expiration__c.format();
}
+
}
- public ConsumableorderdetailsInfo(Product2__c e, List<String> barinfoL) {
+ public ConsumableorderdetailsInfo(Product2__c e,List<String> barinfoL) {
esd = new Consumable_order_details2__c();
ProductName = e.Name__c;
Prod = e;
barCodeNo = barinfoL[0];
- if (String.isNotBlank(barinfoL[1])) {
+ if(String.isNotBlank(barinfoL[1])){
sterilizationlimitDate = Date.valueOf(barinfoL[1]);
}
serialNoorLotNo = barinfoL[2];
@@ -4578,18 +4277,19 @@
ReturnReason = '';
}
- public ConsumableorderdetailsInfo(Consumable_order_details2__c e, List<String> barinfoL) {
+ public ConsumableorderdetailsInfo(Consumable_order_details2__c e,List<String> barinfoL) {
esd = e;
- Prod = e.Consumable_Product__r;
+ Prod = e.Consumable_Product__r;
barCodeNo = barinfoL[0];
- if (String.isNotBlank(barinfoL[1])) {
+ if(String.isNotBlank(barinfoL[1])){
sterilizationlimitDate = Date.valueOf(barinfoL[1]);
}
serialNoorLotNo = barinfoL[2];
tracingCodeNo = barinfoL[3];
if (e.Report_Product_Expiration__c != null) {
- ReportProductExpirationDate = e.Report_Product_Expiration__c.format();
+ ReportProductExpirationDate = e.Report_Product_Expiration__c.format();
}
+
}
public ConsumableorderdetailsInfo(Product2__c e) {
Prod = e;
@@ -4599,4 +4299,4 @@
return null;
}
}
-}
+}
\ No newline at end of file
diff --git a/force-app/main/default/classes/ArriveGoodsControllerTest.cls b/force-app/main/default/classes/ArriveGoodsControllerTest.cls
index 63df10b..80257b2 100644
--- a/force-app/main/default/classes/ArriveGoodsControllerTest.cls
+++ b/force-app/main/default/classes/ArriveGoodsControllerTest.cls
@@ -1,49 +1,26 @@
@isTest
private class ArriveGoodsControllerTest {
+
//閫夋嫨绛夊緟鍏ュ簱,鍖呮嫭01 鍜�241
@isTest
static void arriveWithID() {
// // TO DO: implement unit test
- List<RecordType> rectCo = [
- SELECT Id
- FROM RecordType
- WHERE IsActive = TRUE AND SobjectType = 'Account' AND Name = '璨╁2搴�'
- ];
+ List<RecordType> rectCo = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '璨╁2搴�'];
if (rectCo.size() == 0) {
return;
}
// Profile prof = [select Id from Profile where Name ='901_缁忛攢鍟嗙ぞ鍖烘櫘閫氭潈闄恄2閲嶉獙璇�(ET Email)'];
- Profile prof = [
- SELECT Id
- FROM Profile
- WHERE Name = '901_缁忛攢鍟嗙ぞ鍖烘櫘閫氭潈闄恄2閲嶉獙璇�(ET)'
- ];
+ Profile prof = [select Id from Profile where Name ='901_缁忛攢鍟嗙ぞ鍖烘櫘閫氭潈闄恄2閲嶉獙璇�(ET)'];
- Account myAccount2 = new Account(
- name = 'Testaccount002',
- Dealer_discount__c = 20,
- RecordTypeId = rectCo[0].Id,
- AgentCode_Ext__c = '9999900'
- );
- Account myAccount1 = new Account(name = 'Testaccount001', Dealer_discount__c = 30, RecordTypeId = rectCo[0].Id);
- insert new List<account>{ myAccount1, myAccount2 };
- Contact core = new Contact(email = 'jplumber@salesforce.com', firstname = 'Joe', lastname = 'Plumber', accountid = myAccount1.id);
+ Account myAccount2 = new Account(name='Testaccount002',Dealer_discount__c =20,RecordTypeId = rectCo[0].Id,AgentCode_Ext__c = '9999900');
+ Account myAccount1 = new Account(name='Testaccount001',Dealer_discount__c =30,RecordTypeId = rectCo[0].Id);
+ insert new account[]{myAccount1,myAccount2};
+
+ Contact core = new Contact(email='jplumber@salesforce.com', firstname='Joe',lastname='Plumber',accountid=myAccount1.id);
insert core;
- user MyUser_Test = new User(
- ContactId = core.id,
- Alias = 'newUser',
- Email = 'newuser@testorg.com',
- EmailEncodingKey = 'UTF-8',
- LastName = 'TestUser',
- LanguageLocaleKey = 'zh_CN',
- LocaleSidKey = 'zh_CN',
- ProfileId = prof.Id,
- TimeZoneSidKey = 'Asia/Shanghai',
- UserName = 'testUser@testorg.com',
- UserPro_Type__c = 'ET'
- );
- System.runAs(new User(Id = UserInfo.getUserId())) {
+ user MyUser_Test = New User(ContactId = core.id,Alias = 'newUser',Email='newuser@testorg.com',EmailEncodingKey='UTF-8', LastName='TestUser', LanguageLocaleKey='zh_CN',LocaleSidKey='zh_CN', ProfileId = prof.Id,TimeZoneSidKey='Asia/Shanghai', UserName='testUser@testorg.com',UserPro_Type__c = 'ET');
+ System.runAs(new User(Id = UserInfo.getUserId())){
insert MyUser_Test;
}
@@ -51,29 +28,13 @@
// Product2 prod01 = new Product2(Name='Test01',ProductCode='Test01',Asset_Model_No__c = 'Test01',SFDA_Status__c = '鏈夊姽',JANCODE__c = '04953170200311',Dealer_special_Object__c = true,Manual_Entry__c = false);
// Product2 prod02 = new Product2(Name='Test02',ProductCode='Test02',Asset_Model_No__c = 'Test02',SFDA_Status__c = '鏈夊姽',JANCODE__c = '04953170200312',Dealer_special_Object__c = true,Manual_Entry__c = false);
// insert new Product2[] {prod01,prod02};
- System.runAs(MyUser_Test) {
- Product2 prod01 = new Product2(
- Name = 'Test01',
- ProductCode = 'Test01',
- Asset_Model_No__c = 'Test01',
- SFDA_Status__c = '鏈夊姽',
- JANCODE__c = '04953170200311',
- Dealer_special_Object__c = true,
- Manual_Entry__c = false
- );
- Product2 prod02 = new Product2(
- Name = 'Test02',
- ProductCode = 'Test02',
- Asset_Model_No__c = 'Test02',
- SFDA_Status__c = '鏈夊姽',
- JANCODE__c = '04953170200312',
- Dealer_special_Object__c = true,
- Manual_Entry__c = false
- );
- insert new List<Product2>{ prod01, prod02 };
- Product2__c pro1 = new Product2__c(Name = 'Pro001', OT_CODE_Text__c = 'N3047730', Product2__c = prod01.Id);
- Product2__c pro2 = new Product2__c(Name = 'Pro002', OT_CODE_Text__c = 'N3047731', Product2__c = prod02.Id);
- insert new List<Product2__c>{ pro1, pro2 };
+ system.runAs(MyUser_Test){
+ Product2 prod01 = new Product2(Name='Test01',ProductCode='Test01',Asset_Model_No__c = 'Test01',SFDA_Status__c = '鏈夊姽',JANCODE__c = '04953170200311',Dealer_special_Object__c = true,Manual_Entry__c = false);
+ Product2 prod02 = new Product2(Name='Test02',ProductCode='Test02',Asset_Model_No__c = 'Test02',SFDA_Status__c = '鏈夊姽',JANCODE__c = '04953170200312',Dealer_special_Object__c = true,Manual_Entry__c = false);
+ insert new Product2[] {prod01,prod02};
+ Product2__c pro1 = new Product2__c(Name='Pro001',OT_CODE_Text__c='N3047730',Product2__c = prod01.Id);
+ Product2__c pro2 = new Product2__c(Name='Pro002',OT_CODE_Text__c='N3047731',Product2__c = prod02.Id);
+ insert new Product2__c[] {pro1, pro2};
//璁㈠崟
Consumable_order__c Order1 = new Consumable_order__c();
@@ -120,59 +81,33 @@
// System.assertEquals(1, Controller.ConsumableorderdetailsRecords.size());
// System.assertEquals(2, Controller.consumableInventory.size());
Controller.ArriveGoodsConfim();
- List<Consumable_order_details2__c> ins = [
- SELECT Id, Name
- FROM Consumable_order_details2__c
- ];
+ List<Consumable_order_details2__c> ins = [SELECT Id,Name FROM Consumable_order_details2__c];
// System.assertEquals(3, ins.size());
System.Test.stopTest();
}
}
+
//浜у搧鐩存帴鍏ュ簱,鍖呮嫭01 鍜�241
@isTest
- static void arriveWithoutID() {
+ static void arriveWithoutID() {
// // TO DO: implement unit test
- List<RecordType> rectCo = [
- SELECT Id
- FROM RecordType
- WHERE IsActive = TRUE AND SobjectType = 'Account' AND Name = '璨╁2搴�'
- ];
+ List<RecordType> rectCo = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '璨╁2搴�'];
if (rectCo.size() == 0) {
return;
}
// Profile prof = [select Id from Profile where Name ='901_缁忛攢鍟嗙ぞ鍖烘櫘閫氭潈闄恄2閲嶉獙璇�(ET Email)'];
- Profile prof = [
- SELECT Id
- FROM Profile
- WHERE Name = '901_缁忛攢鍟嗙ぞ鍖烘櫘閫氭潈闄恄2閲嶉獙璇�(ET)'
- ];
+ Profile prof = [select Id from Profile where Name ='901_缁忛攢鍟嗙ぞ鍖烘櫘閫氭潈闄恄2閲嶉獙璇�(ET)'];
- Account myAccount2 = new Account(
- name = 'Testaccount002',
- Dealer_discount__c = 20,
- RecordTypeId = rectCo[0].Id,
- AgentCode_Ext__c = '9999900'
- );
- Account myAccount1 = new Account(name = 'Testaccount001', Dealer_discount__c = 30, RecordTypeId = rectCo[0].Id);
- insert new List<account>{ myAccount1, myAccount2 };
- Contact core = new Contact(email = 'jplumber@salesforce.com', firstname = 'Joe', lastname = 'Plumber', accountid = myAccount1.id);
+ Account myAccount2 = new Account(name='Testaccount002',Dealer_discount__c =20,RecordTypeId = rectCo[0].Id,AgentCode_Ext__c = '9999900');
+ Account myAccount1 = new Account(name='Testaccount001',Dealer_discount__c =30,RecordTypeId = rectCo[0].Id);
+ insert new account[]{myAccount1,myAccount2};
+
+ Contact core = new Contact(email='jplumber@salesforce.com', firstname='Joe',lastname='Plumber',accountid=myAccount1.id);
insert core;
- user MyUser_Test = new User(
- ContactId = core.id,
- Alias = 'newUser',
- Email = 'newuser@testorg.com',
- EmailEncodingKey = 'UTF-8',
- LastName = 'TestUser',
- LanguageLocaleKey = 'zh_CN',
- LocaleSidKey = 'zh_CN',
- ProfileId = prof.Id,
- TimeZoneSidKey = 'Asia/Shanghai',
- UserName = 'testUser@testorg.com',
- UserPro_Type__c = 'ET'
- );
- System.runAs(new User(Id = UserInfo.getUserId())) {
+ user MyUser_Test = New User(ContactId = core.id,Alias = 'newUser',Email='newuser@testorg.com',EmailEncodingKey='UTF-8', LastName='TestUser', LanguageLocaleKey='zh_CN',LocaleSidKey='zh_CN', ProfileId = prof.Id,TimeZoneSidKey='Asia/Shanghai', UserName='testUser@testorg.com',UserPro_Type__c = 'ET');
+ System.runAs(new User(Id = UserInfo.getUserId())){
insert MyUser_Test;
}
@@ -180,29 +115,13 @@
// Product2 prod01 = new Product2(Name='Test01',ProductCode='Test01',ProductCode_Ext__c = 'Test01',SFDA_Status__c = '鏈夊姽',JANCODE__c = '04953170200311',Dealer_special_Object__c = true,Manual_Entry__c = false);
// Product2 prod02 = new Product2(Name='Test02',ProductCode='N3047731',ProductCode_Ext__c = 'Test02',SFDA_Status__c = '鏈夊姽',JANCODE__c = '04953170200312',Dealer_special_Object__c = true,Manual_Entry__c = false);
// insert new Product2[] {prod01,prod02};
- System.runAs(MyUser_Test) {
- Product2 prod01 = new Product2(
- Name = 'Test01',
- ProductCode = 'Test01',
- Asset_Model_No__c = 'Test01',
- SFDA_Status__c = '鏈夊姽',
- JANCODE__c = '04953170200311',
- Dealer_special_Object__c = true,
- Manual_Entry__c = false
- );
- Product2 prod02 = new Product2(
- Name = 'Test02',
- ProductCode = 'Test02',
- Asset_Model_No__c = 'Test02',
- SFDA_Status__c = '鏈夊姽',
- JANCODE__c = '04953170200312',
- Dealer_special_Object__c = true,
- Manual_Entry__c = false
- );
- insert new List<Product2>{ prod01, prod02 };
- Product2__c pro1 = new Product2__c(Name = 'Pro001', OT_CODE_Text__c = 'Test01', Product2__c = prod01.Id);
- Product2__c pro2 = new Product2__c(Name = 'Pro002', OT_CODE_Text__c = 'N3047731', Product2__c = prod02.Id);
- insert new List<Product2__c>{ pro1, pro2 };
+ system.runAs(MyUser_Test){
+ Product2 prod01 = new Product2(Name='Test01',ProductCode='Test01',Asset_Model_No__c = 'Test01',SFDA_Status__c = '鏈夊姽',JANCODE__c = '04953170200311',Dealer_special_Object__c = true,Manual_Entry__c = false);
+ Product2 prod02 = new Product2(Name='Test02',ProductCode='Test02',Asset_Model_No__c = 'Test02',SFDA_Status__c = '鏈夊姽',JANCODE__c = '04953170200312',Dealer_special_Object__c = true,Manual_Entry__c = false);
+ insert new Product2[] {prod01,prod02};
+ Product2__c pro1 = new Product2__c(Name='Pro001',OT_CODE_Text__c='Test01',Product2__c = prod01.Id);
+ Product2__c pro2 = new Product2__c(Name='Pro002',OT_CODE_Text__c='N3047731',Product2__c = prod02.Id);
+ insert new Product2__c[] {pro1, pro2};
PageReference page = new PageReference('/apex/ArriveGoods?ArrType=Arr');
System.Test.setCurrentPage(page);
ArriveGoodsController Controller = new ArriveGoodsController();
@@ -215,59 +134,30 @@
Controller.barcode = '01049531702003111115120017181000105ZK250BXJRF\n241N30477311115120017181000105ZK250BXJRA\n241Test021115120017181000105ZK250\n01049531702003111115120017181000105ZK250';
Controller.SearchPro();
Controller.ArriveGoodsConfim();
- List<Consumable_order_details2__c> ins = [
- SELECT Id, Name
- FROM Consumable_order_details2__c
- WHERE Bar_Code__c IN ('01049531702003111115120017181000105ZK250BXJRF', '241N30477311115120017181000105ZK250BXJRA')
- ];
+ List<Consumable_order_details2__c> ins = [SELECT Id,Name FROM Consumable_order_details2__c WHERE Bar_Code__c in ('01049531702003111115120017181000105ZK250BXJRF','241N30477311115120017181000105ZK250BXJRA')];
// System.assertEquals(2, ins.size());
System.Test.stopTest();
}
}
//鏁翠綋鍒拌揣
@isTest
- static void ArriveTest() {
+ static void ArriveTest() {
// // TO DO: implement unit test
- List<RecordType> rectCo = [
- SELECT Id
- FROM RecordType
- WHERE IsActive = TRUE AND SobjectType = 'Account' AND Name = '璨╁2搴�'
- ];
+ List<RecordType> rectCo = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '璨╁2搴�'];
if (rectCo.size() == 0) {
return;
}
// Profile prof = [select Id from Profile where Name ='901_缁忛攢鍟嗙ぞ鍖烘櫘閫氭潈闄恄2閲嶉獙璇�(ET Email)'];
- Profile prof = [
- SELECT Id
- FROM Profile
- WHERE Name = '901_缁忛攢鍟嗙ぞ鍖烘櫘閫氭潈闄恄2閲嶉獙璇�(ET)'
- ];
+ Profile prof = [select Id from Profile where Name ='901_缁忛攢鍟嗙ぞ鍖烘櫘閫氭潈闄恄2閲嶉獙璇�(ET)'];
Oly_TriggerHandler.bypass('ConsumableAssetHander');
- Account myAccount2 = new Account(
- name = 'Testaccount002',
- Dealer_discount__c = 20,
- RecordTypeId = rectCo[0].Id,
- AgentCode_Ext__c = '9999900'
- );
- Account myAccount1 = new Account(name = 'Testaccount001', Dealer_discount__c = 30, RecordTypeId = rectCo[0].Id);
- insert new List<account>{ myAccount1, myAccount2 };
- Contact core = new Contact(email = 'jplumber@salesforce.com', firstname = 'Joe', lastname = 'Plumber', accountid = myAccount1.id);
+ Account myAccount2 = new Account(name='Testaccount002',Dealer_discount__c =20,RecordTypeId = rectCo[0].Id,AgentCode_Ext__c = '9999900');
+ Account myAccount1 = new Account(name='Testaccount001',Dealer_discount__c =30,RecordTypeId = rectCo[0].Id);
+ insert new account[]{myAccount1,myAccount2};
+ Contact core = new Contact(email='jplumber@salesforce.com', firstname='Joe',lastname='Plumber',accountid=myAccount1.id);
insert core;
- user MyUser_Test = new User(
- ContactId = core.id,
- Alias = 'newUser',
- Email = 'newuser@testorg.com',
- EmailEncodingKey = 'UTF-8',
- LastName = 'TestUser',
- LanguageLocaleKey = 'zh_CN',
- LocaleSidKey = 'zh_CN',
- ProfileId = prof.Id,
- TimeZoneSidKey = 'Asia/Shanghai',
- UserName = 'testUser@testorg.com',
- UserPro_Type__c = 'ET'
- );
- System.runAs(new User(Id = UserInfo.getUserId())) {
+ user MyUser_Test = New User(ContactId = core.id,Alias = 'newUser',Email='newuser@testorg.com',EmailEncodingKey='UTF-8', LastName='TestUser', LanguageLocaleKey='zh_CN',LocaleSidKey='zh_CN', ProfileId = prof.Id,TimeZoneSidKey='Asia/Shanghai', UserName='testUser@testorg.com',UserPro_Type__c = 'ET');
+ System.runAs(new User(Id = UserInfo.getUserId())){
insert MyUser_Test;
}
@@ -275,28 +165,12 @@
// Product2 prod01 = new Product2(Name='Test01',ProductCode='Test01',Asset_Model_No__c = 'Test01',SFDA_Status__c = '鏈夊姽',JANCODE__c = '04953170200311',Dealer_special_Object__c = true,Manual_Entry__c = false);
// Product2 prod02 = new Product2(Name='Test02',ProductCode='Test02',Asset_Model_No__c = 'Test02',SFDA_Status__c = '鏈夊姽',JANCODE__c = '04953170200312',Dealer_special_Object__c = true,Manual_Entry__c = false);
// insert new Product2[] {prod01,prod02};
- System.runAs(MyUser_Test) {
- Product2 prod01 = new Product2(
- Name = 'Test01',
- ProductCode = 'Test01',
- Asset_Model_No__c = 'Test01',
- SFDA_Status__c = '鏈夊姽',
- JANCODE__c = '04953170200311',
- Dealer_special_Object__c = true,
- Manual_Entry__c = false
- );
- Product2 prod02 = new Product2(
- Name = 'Test02',
- ProductCode = 'Test02',
- Asset_Model_No__c = 'Test02',
- SFDA_Status__c = '鏈夊姽',
- JANCODE__c = '04953170200312',
- Dealer_special_Object__c = true,
- Manual_Entry__c = false
- );
- insert new List<Product2>{ prod01, prod02 };
- Product2__c pro1 = new Product2__c(Name = 'Pro001', OT_CODE_Text__c = 'Test001', Product2__c = prod01.Id);
- insert new List<Product2__c>{ pro1 };
+ system.runAs(MyUser_Test){
+ Product2 prod01 = new Product2(Name='Test01',ProductCode='Test01',Asset_Model_No__c = 'Test01',SFDA_Status__c = '鏈夊姽',JANCODE__c = '04953170200311',Dealer_special_Object__c = true,Manual_Entry__c = false);
+ Product2 prod02 = new Product2(Name='Test02',ProductCode='Test02',Asset_Model_No__c = 'Test02',SFDA_Status__c = '鏈夊姽',JANCODE__c = '04953170200312',Dealer_special_Object__c = true,Manual_Entry__c = false);
+ insert new Product2[] {prod01,prod02};
+ Product2__c pro1 = new Product2__c(Name='Pro001',OT_CODE_Text__c='Test001',Product2__c = prod01.Id);
+ insert new Product2__c[] {pro1};
// Account myAccount1 = new Account(name='Testaccount001',Dealer_discount__c =30,RecordTypeId = rectCo[0].Id);
// insert myAccount1;
Consumable_order__c Order2 = new Consumable_order__c();
@@ -378,6 +252,7 @@
Orderdet3.SerialLotNo__c = '5ZK';
//Orderdet3.Box_Piece__c = '涓�';
+
//鍑哄簱浜у搧
Consumable_order_details2__c Orderdet4 = new Consumable_order_details2__c();
Orderdet4.Name = 'OCM_01_001005';
@@ -386,7 +261,7 @@
Orderdet4.Asset_Model_No__c = 'Test01';
Orderdet4.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
Orderdet4.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJRD';
- Orderdet4.Send_Date__c = Date.today();
+ Orderdet4.Send_Date__c = Date.today();
Orderdet4.Arrive_date__c = Date.today();
Orderdet4.Box_Piece__c = '鐩�';
Orderdet4.TracingCode__c = 'BXJRD';
@@ -404,11 +279,13 @@
Orderdet5.Consumable_Shipment_order__c = Order1.Id;
Orderdet5.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
Orderdet5.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJRE';
- Orderdet5.Arrive_date__c = Date.today();
+ Orderdet5.Arrive_date__c = Date.today();
Orderdet5.Box_Piece__c = '鐩�';
Orderdet5.TracingCode__c = 'BXJRE';
Orderdet5.SerialLotNo__c = '5ZK';
- insert new List<Consumable_order_details2__c>{ Orderdet1, Orderdet2, Orderdet3, Orderdet4, Orderdet5 };
+ insert new Consumable_order_details2__c[] {Orderdet1, Orderdet2,Orderdet3,Orderdet4,Orderdet5};
+
+
ArriveGoodsController Controller = new ArriveGoodsController();
PageReference page = new PageReference('/apex/ArriveGoods?ArrType=Arr');
@@ -423,54 +300,31 @@
System.assertEquals('OCM_01_001002', controller.ConsumableorderdetailsRecords[0].esd.Name);
// System.assertEquals(2, controller.ConsumableorderdetailsRecordserror.size());
System.Test.stopTest();
+
+
}
}
//鏁翠綋鍒拌揣
@isTest
- static void ArriveTest1() {
+ static void ArriveTest1() {
// // TO DO: implement unit test
- List<RecordType> rectCo = [
- SELECT Id
- FROM RecordType
- WHERE IsActive = TRUE AND SobjectType = 'Account' AND Name = '璨╁2搴�'
- ];
+ List<RecordType> rectCo = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '璨╁2搴�'];
if (rectCo.size() == 0) {
return;
}
// Profile prof = [select Id from Profile where Name ='901_缁忛攢鍟嗙ぞ鍖烘櫘閫氭潈闄恄2閲嶉獙璇�(ET Email)'];
- Profile prof = [
- SELECT Id
- FROM Profile
- WHERE Name = '901_缁忛攢鍟嗙ぞ鍖烘櫘閫氭潈闄恄2閲嶉獙璇�(ET)'
- ];
+ Profile prof = [select Id from Profile where Name ='901_缁忛攢鍟嗙ぞ鍖烘櫘閫氭潈闄恄2閲嶉獙璇�(ET)'];
Oly_TriggerHandler.bypass('ConsumableAssetHander');
- Account myAccount2 = new Account(
- name = 'Testaccount002',
- Dealer_discount__c = 20,
- RecordTypeId = rectCo[0].Id,
- AgentCode_Ext__c = '9999900'
- );
- Account myAccount1 = new Account(name = 'Testaccount001', Dealer_discount__c = 30, RecordTypeId = rectCo[0].Id);
- insert new List<account>{ myAccount1, myAccount2 };
+ Account myAccount2 = new Account(name='Testaccount002',Dealer_discount__c =20,RecordTypeId = rectCo[0].Id,AgentCode_Ext__c = '9999900');
+ Account myAccount1 = new Account(name='Testaccount001',Dealer_discount__c =30,RecordTypeId = rectCo[0].Id);
+ insert new account[]{myAccount1,myAccount2};
- Contact core = new Contact(email = 'jplumber@salesforce.com', firstname = 'Joe', lastname = 'Plumber', accountid = myAccount1.id);
+ Contact core = new Contact(email='jplumber@salesforce.com', firstname='Joe',lastname='Plumber',accountid=myAccount1.id);
insert core;
- user MyUser_Test = new User(
- ContactId = core.id,
- Alias = 'newUser',
- Email = 'newuser@testorg.com',
- EmailEncodingKey = 'UTF-8',
- LastName = 'TestUser',
- LanguageLocaleKey = 'zh_CN',
- LocaleSidKey = 'zh_CN',
- ProfileId = prof.Id,
- TimeZoneSidKey = 'Asia/Shanghai',
- UserName = 'testUser@testorg.com',
- UserPro_Type__c = 'ET'
- );
- System.runAs(new User(Id = UserInfo.getUserId())) {
+ user MyUser_Test = New User(ContactId = core.id,Alias = 'newUser',Email='newuser@testorg.com',EmailEncodingKey='UTF-8', LastName='TestUser', LanguageLocaleKey='zh_CN',LocaleSidKey='zh_CN', ProfileId = prof.Id,TimeZoneSidKey='Asia/Shanghai', UserName='testUser@testorg.com',UserPro_Type__c = 'ET');
+ System.runAs(new User(Id = UserInfo.getUserId())){
insert MyUser_Test;
}
@@ -478,29 +332,13 @@
// Product2 prod01 = new Product2(Name='Test01',ProductCode='Test01',Asset_Model_No__c = 'Test01',SFDA_Status__c = '鏈夊姽',JANCODE__c = '04953170200311',Dealer_special_Object__c = true,Manual_Entry__c = false);
// Product2 prod02 = new Product2(Name='Test02',ProductCode='Test02',Asset_Model_No__c = 'Test02',SFDA_Status__c = '鏈夊姽',JANCODE__c = '04953170200312',Dealer_special_Object__c = true,Manual_Entry__c = false);
// insert new Product2[] {prod01,prod02};
- System.runAs(MyUser_Test) {
- Product2 prod01 = new Product2(
- Name = 'Test01',
- ProductCode = 'Test01',
- Asset_Model_No__c = 'Test01',
- SFDA_Status__c = '鏈夊姽',
- JANCODE__c = '04953170200311',
- Dealer_special_Object__c = true,
- Manual_Entry__c = false
- );
- Product2 prod02 = new Product2(
- Name = 'Test02',
- ProductCode = 'Test02',
- Asset_Model_No__c = 'Test02',
- SFDA_Status__c = '鏈夊姽',
- JANCODE__c = '04953170200312',
- Dealer_special_Object__c = true,
- Manual_Entry__c = false
- );
- insert new List<Product2>{ prod01, prod02 };
- Product2__c pro1 = new Product2__c(Name = 'Pro001', OT_CODE_Text__c = 'Test001', Product2__c = prod01.Id);
- Product2__c pro2 = new Product2__c(Name = 'Pro002', OT_CODE_Text__c = 'Test002', Product2__c = prod02.Id);
- insert new List<Product2__c>{ pro1, pro2 };
+ system.runAs(MyUser_Test){
+ Product2 prod01 = new Product2(Name='Test01',ProductCode='Test01',Asset_Model_No__c = 'Test01',SFDA_Status__c = '鏈夊姽',JANCODE__c = '04953170200311',Dealer_special_Object__c = true,Manual_Entry__c = false);
+ Product2 prod02 = new Product2(Name='Test02',ProductCode='Test02',Asset_Model_No__c = 'Test02',SFDA_Status__c = '鏈夊姽',JANCODE__c = '04953170200312',Dealer_special_Object__c = true,Manual_Entry__c = false);
+ insert new Product2[] {prod01,prod02};
+ Product2__c pro1 = new Product2__c(Name='Pro001',OT_CODE_Text__c='Test001',Product2__c = prod01.Id);
+ Product2__c pro2 = new Product2__c(Name='Pro002',OT_CODE_Text__c='Test002',Product2__c = prod02.Id);
+ insert new Product2__c[] {pro1, pro2};
// Account myAccount1 = new Account(name='Testaccount001',Dealer_discount__c =30,RecordTypeId = rectCo[0].Id);
// insert myAccount1;
Consumable_order__c Order2 = new Consumable_order__c();
@@ -580,6 +418,7 @@
Orderdet3.TracingCode__c = 'BXJRC';
Orderdet3.SerialLotNo__c = '5ZK';
+
//鍑哄簱浜у搧
Consumable_order_details2__c Orderdet4 = new Consumable_order_details2__c();
Orderdet4.Name = 'OCM_01_001005';
@@ -588,7 +427,7 @@
Orderdet4.Asset_Model_No__c = 'Test01';
Orderdet4.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
Orderdet4.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJRD';
- Orderdet4.Send_Date__c = Date.today();
+ Orderdet4.Send_Date__c = Date.today();
Orderdet4.TracingCode__c = 'BXJRD';
Orderdet4.SerialLotNo__c = '5ZK';
//Orderdet4.Box_Piece__c = '鐩�';
@@ -604,11 +443,13 @@
Orderdet5.Consumable_Shipment_order__c = Order1.Id;
Orderdet5.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
Orderdet5.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJRE';
- Orderdet5.Arrive_date__c = Date.today();
+ Orderdet5.Arrive_date__c = Date.today();
Orderdet5.Box_Piece__c = '鐩�';
Orderdet5.TracingCode__c = 'BXJRE';
Orderdet5.SerialLotNo__c = '5ZK';
- insert new List<Consumable_order_details2__c>{ Orderdet1, Orderdet2, Orderdet3, Orderdet4, Orderdet5 };
+ insert new Consumable_order_details2__c[] {Orderdet1, Orderdet2,Orderdet3,Orderdet4,Orderdet5};
+
+
ArriveGoodsController Controller = new ArriveGoodsController();
PageReference page = new PageReference('/apex/ArriveGoods?ArrType=Arr');
@@ -623,53 +464,34 @@
System.assertEquals('OCM_01_001002', controller.ConsumableorderdetailsRecords[0].esd.Name);
// System.assertEquals(1, controller.ConsumableorderdetailsRecordserror.size());
System.Test.stopTest();
+
+
}
}
+
+
+
//杩斿搧
@isTest
- static void productReturn() {
+ static void productReturn() {
// // TO DO: implement unit test
- List<RecordType> rectCo = [
- SELECT Id
- FROM RecordType
- WHERE IsActive = TRUE AND SobjectType = 'Account' AND Name = '璨╁2搴�'
- ];
+ List<RecordType> rectCo = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '璨╁2搴�'];
if (rectCo.size() == 0) {
return;
}
// Profile prof = [select Id from Profile where Name ='901_缁忛攢鍟嗙ぞ鍖烘櫘閫氭潈闄恄2閲嶉獙璇�(ET Email)'];
- Profile prof = [
- SELECT Id
- FROM Profile
- WHERE Name = '901_缁忛攢鍟嗙ぞ鍖烘櫘閫氭潈闄恄2閲嶉獙璇�(ET)'
- ];
+ Profile prof = [select Id from Profile where Name ='901_缁忛攢鍟嗙ぞ鍖烘櫘閫氭潈闄恄2閲嶉獙璇�(ET)'];
- Account myAccount2 = new Account(
- name = 'Testaccount002',
- Dealer_discount__c = 20,
- RecordTypeId = rectCo[0].Id,
- AgentCode_Ext__c = '9999900'
- );
- Account myAccount1 = new Account(name = 'Testaccount001', Dealer_discount__c = 30, RecordTypeId = rectCo[0].Id);
- insert new List<account>{ myAccount1, myAccount2 };
- Contact core = new Contact(email = 'jplumber@salesforce.com', firstname = 'Joe', lastname = 'Plumber', accountid = myAccount1.id);
+ Account myAccount2 = new Account(name='Testaccount002',Dealer_discount__c =20,RecordTypeId = rectCo[0].Id,AgentCode_Ext__c = '9999900');
+ Account myAccount1 = new Account(name='Testaccount001',Dealer_discount__c =30,RecordTypeId = rectCo[0].Id);
+ insert new account[]{myAccount1,myAccount2};
+
+ Contact core = new Contact(email='jplumber@salesforce.com', firstname='Joe',lastname='Plumber',accountid=myAccount1.id);
insert core;
- user MyUser_Test = new User(
- ContactId = core.id,
- Alias = 'newUser',
- Email = 'newuser@testorg.com',
- EmailEncodingKey = 'UTF-8',
- LastName = 'TestUser',
- LanguageLocaleKey = 'zh_CN',
- LocaleSidKey = 'zh_CN',
- ProfileId = prof.Id,
- TimeZoneSidKey = 'Asia/Shanghai',
- UserName = 'testUser@testorg.com',
- UserPro_Type__c = 'ET'
- );
- System.runAs(new User(Id = UserInfo.getUserId())) {
+ user MyUser_Test = New User(ContactId = core.id,Alias = 'newUser',Email='newuser@testorg.com',EmailEncodingKey='UTF-8', LastName='TestUser', LanguageLocaleKey='zh_CN',LocaleSidKey='zh_CN', ProfileId = prof.Id,TimeZoneSidKey='Asia/Shanghai', UserName='testUser@testorg.com',UserPro_Type__c = 'ET');
+ System.runAs(new User(Id = UserInfo.getUserId())){
insert MyUser_Test;
}
@@ -677,29 +499,13 @@
// Product2 prod01 = new Product2(Name='Test01',ProductCode='Test01',Asset_Model_No__c = 'Test01',SFDA_Status__c = '鏈夊姽',JANCODE__c = '04953170200311',Dealer_special_Object__c = true,Manual_Entry__c = false);
// Product2 prod02 = new Product2(Name='Test02',ProductCode='Test02',Asset_Model_No__c = 'Test02',SFDA_Status__c = '鏈夊姽',JANCODE__c = '04953170200312',Dealer_special_Object__c = true,Manual_Entry__c = false);
// insert new Product2[] {prod01,prod02};
- System.runAs(MyUser_Test) {
- Product2 prod01 = new Product2(
- Name = 'Test01',
- ProductCode = 'Test01',
- Asset_Model_No__c = 'Test01',
- SFDA_Status__c = '鏈夊姽',
- JANCODE__c = '04953170200311',
- Dealer_special_Object__c = true,
- Manual_Entry__c = false
- );
- Product2 prod02 = new Product2(
- Name = 'Test02',
- ProductCode = 'Test02',
- Asset_Model_No__c = 'Test02',
- SFDA_Status__c = '鏈夊姽',
- JANCODE__c = '04953170200312',
- Dealer_special_Object__c = true,
- Manual_Entry__c = false
- );
- insert new List<Product2>{ prod01, prod02 };
- Product2__c pro1 = new Product2__c(Name = 'Pro001', OT_CODE_Text__c = 'Test001', Product2__c = prod01.Id);
- Product2__c pro2 = new Product2__c(Name = 'Pro002', OT_CODE_Text__c = 'Test002', Product2__c = prod02.Id);
- insert new List<Product2__c>{ pro1, pro2 };
+ system.runAs(MyUser_Test){
+ Product2 prod01 = new Product2(Name='Test01',ProductCode='Test01',Asset_Model_No__c = 'Test01',SFDA_Status__c = '鏈夊姽',JANCODE__c = '04953170200311',Dealer_special_Object__c = true,Manual_Entry__c = false);
+ Product2 prod02 = new Product2(Name='Test02',ProductCode='Test02',Asset_Model_No__c = 'Test02',SFDA_Status__c = '鏈夊姽',JANCODE__c = '04953170200312',Dealer_special_Object__c = true,Manual_Entry__c = false);
+ insert new Product2[] {prod01,prod02};
+ Product2__c pro1 = new Product2__c(Name='Pro001',OT_CODE_Text__c='Test001',Product2__c = prod01.Id);
+ Product2__c pro2 = new Product2__c(Name='Pro002',OT_CODE_Text__c='Test002',Product2__c = prod02.Id);
+ insert new Product2__c[] {pro1, pro2};
//璁㈠崟
Consumable_order__c Order1 = new Consumable_order__c();
@@ -765,7 +571,7 @@
Orderdet3.Consumable_Sale_order__c = Order1.Id;
Orderdet3.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
Orderdet3.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJRJ';
- Orderdet3.Box_Piece__c = '鐩�';
+ Orderdet3.Box_Piece__c ='鐩�';
Orderdet3.TracingCode__c = 'BXJRF';
//鍑哄簱
Consumable_order_details2__c Orderdet4 = new Consumable_order_details2__c();
@@ -780,7 +586,7 @@
Orderdet4.Consumable_Shipment_order__c = Order1.Id;
Orderdet4.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
Orderdet4.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJRN';
- Orderdet4.Box_Piece__c = '涓�';
+ Orderdet4.Box_Piece__c ='涓�';
Orderdet4.TracingCode__c = 'BXJRF';
//quxiao
Consumable_order_details2__c Orderdet5 = new Consumable_order_details2__c();
@@ -791,7 +597,7 @@
Orderdet5.Cancellation_Date__c = Date.today();
Orderdet5.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
Orderdet5.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJRZ';
- Orderdet5.Box_Piece__c = '鐩�';
+ Orderdet5.Box_Piece__c ='鐩�';
Orderdet5.TracingCode__c = 'BXJRF';
//fanpin
Consumable_order_details2__c Orderdet6 = new Consumable_order_details2__c();
@@ -802,10 +608,10 @@
Orderdet6.Consumable_Return_order__c = Order2.Id;
Orderdet6.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
Orderdet6.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJRA';
- Orderdet6.Box_Piece__c = '涓�';
+ Orderdet6.Box_Piece__c ='涓�';
Orderdet6.TracingCode__c = 'BXJRF';
- insert new List<Consumable_order_details2__c>{ Orderdet1, Orderdet2, Orderdet3, Orderdet4, Orderdet5, Orderdet6 };
+ insert new Consumable_order_details2__c[] {Orderdet1, Orderdet2,Orderdet3,Orderdet4,Orderdet5,Orderdet6};
PageReference page = new PageReference('/apex/ArriveGoods?ArrType=ReG');
System.Test.setCurrentPage(page);
ArriveGoodsController Controller = new ArriveGoodsController();
@@ -823,60 +629,37 @@
//System.assertEquals('OCM_01_001002', controller.ConsumableorderdetailsRecordserror[2].esd.Name);
//System.assertEquals('OCM_02_001001', controller.ConsumableorderdetailsRecordserror[3].esd.Name);
Controller.GoodsReturnCheck();
- controller.ShowGoodsofReturnList[0].esd.Return_reason__c = '澶氬彂';
- controller.ShowGoodsofReturnList[0].esd.Rrturn_count__c = 1;
+ controller.ShowGoodsofReturnList[0].esd.Return_reason__c='澶氬彂';
+ controller.ShowGoodsofReturnList[0].esd.Rrturn_count__c =1;
//System.assertEquals(1, controller.ShowGoodsofReturnList.size());
Controller.UpdateGoodsOfReturn();
Controller.ToReturnGoodsPage();
Controller.geterrorsize();
System.Test.stopTest();
+
}
}
//杩斿搧
@isTest
- static void productReturn_new() {
+ static void productReturn_new() {
// // TO DO: implement unit test
- List<RecordType> rectCo = [
- SELECT Id
- FROM RecordType
- WHERE IsActive = TRUE AND SobjectType = 'Account' AND Name = '璨╁2搴�'
- ];
+ List<RecordType> rectCo = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '璨╁2搴�'];
if (rectCo.size() == 0) {
return;
}
// Profile prof = [select Id from Profile where Name ='901_缁忛攢鍟嗙ぞ鍖烘櫘閫氭潈闄恄2閲嶉獙璇�(ET Email)'];
- Profile prof = [
- SELECT Id
- FROM Profile
- WHERE Name = '901_缁忛攢鍟嗙ぞ鍖烘櫘閫氭潈闄恄2閲嶉獙璇�(ET)'
- ];
+ Profile prof = [select Id from Profile where Name ='901_缁忛攢鍟嗙ぞ鍖烘櫘閫氭潈闄恄2閲嶉獙璇�(ET)'];
- Account myAccount2 = new Account(
- name = 'Testaccount002',
- Dealer_discount__c = 20,
- RecordTypeId = rectCo[0].Id,
- AgentCode_Ext__c = '9999900'
- );
- Account myAccount1 = new Account(name = 'Testaccount001', Dealer_discount__c = 30, RecordTypeId = rectCo[0].Id);
- insert new List<account>{ myAccount1, myAccount2 };
- Contact core = new Contact(email = 'jplumber@salesforce.com', firstname = 'Joe', lastname = 'Plumber', accountid = myAccount1.id);
+ Account myAccount2 = new Account(name='Testaccount002',Dealer_discount__c =20,RecordTypeId = rectCo[0].Id,AgentCode_Ext__c = '9999900');
+ Account myAccount1 = new Account(name='Testaccount001',Dealer_discount__c =30,RecordTypeId = rectCo[0].Id);
+ insert new account[]{myAccount1,myAccount2};
+
+ Contact core = new Contact(email='jplumber@salesforce.com', firstname='Joe',lastname='Plumber',accountid=myAccount1.id);
insert core;
- user MyUser_Test = new User(
- ContactId = core.id,
- Alias = 'newUser',
- Email = 'newuser@testorg.com',
- EmailEncodingKey = 'UTF-8',
- LastName = 'TestUser',
- LanguageLocaleKey = 'zh_CN',
- LocaleSidKey = 'zh_CN',
- ProfileId = prof.Id,
- TimeZoneSidKey = 'Asia/Shanghai',
- UserName = 'testUser@testorg.com',
- UserPro_Type__c = 'ET'
- );
- System.runAs(new User(Id = UserInfo.getUserId())) {
+ user MyUser_Test = New User(ContactId = core.id,Alias = 'newUser',Email='newuser@testorg.com',EmailEncodingKey='UTF-8', LastName='TestUser', LanguageLocaleKey='zh_CN',LocaleSidKey='zh_CN', ProfileId = prof.Id,TimeZoneSidKey='Asia/Shanghai', UserName='testUser@testorg.com',UserPro_Type__c = 'ET');
+ System.runAs(new User(Id = UserInfo.getUserId())){
insert MyUser_Test;
}
@@ -884,29 +667,13 @@
// Product2 prod01 = new Product2(Name='Test01',ProductCode='Test01',Asset_Model_No__c = 'Test01',SFDA_Status__c = '鏈夊姽',JANCODE__c = '04953170200311',Dealer_special_Object__c = true,Manual_Entry__c = false);
// Product2 prod02 = new Product2(Name='Test02',ProductCode='Test02',Asset_Model_No__c = 'Test02',SFDA_Status__c = '鏈夊姽',JANCODE__c = '04953170200312',Dealer_special_Object__c = true,Manual_Entry__c = false);
// insert new Product2[] {prod01,prod02};
- System.runAs(MyUser_Test) {
- Product2 prod01 = new Product2(
- Name = 'Test01',
- ProductCode = 'Test01',
- Asset_Model_No__c = 'Test01',
- SFDA_Status__c = '鏈夊姽',
- JANCODE__c = '04953170200311',
- Dealer_special_Object__c = true,
- Manual_Entry__c = false
- );
- Product2 prod02 = new Product2(
- Name = 'Test02',
- ProductCode = 'Test02',
- Asset_Model_No__c = 'Test02',
- SFDA_Status__c = '鏈夊姽',
- JANCODE__c = '04953170200312',
- Dealer_special_Object__c = true,
- Manual_Entry__c = false
- );
- insert new List<Product2>{ prod01, prod02 };
- Product2__c pro1 = new Product2__c(Name = 'Pro001', OT_CODE_Text__c = 'Test001', Product2__c = prod01.Id);
- Product2__c pro2 = new Product2__c(Name = 'Pro002', OT_CODE_Text__c = 'Test002', Product2__c = prod02.Id);
- insert new List<Product2__c>{ pro1, pro2 };
+ system.runAs(MyUser_Test){
+ Product2 prod01 = new Product2(Name='Test01',ProductCode='Test01',Asset_Model_No__c = 'Test01',SFDA_Status__c = '鏈夊姽',JANCODE__c = '04953170200311',Dealer_special_Object__c = true,Manual_Entry__c = false);
+ Product2 prod02 = new Product2(Name='Test02',ProductCode='Test02',Asset_Model_No__c = 'Test02',SFDA_Status__c = '鏈夊姽',JANCODE__c = '04953170200312',Dealer_special_Object__c = true,Manual_Entry__c = false);
+ insert new Product2[] {prod01,prod02};
+ Product2__c pro1 = new Product2__c(Name='Pro001',OT_CODE_Text__c='Test001',Product2__c = prod01.Id);
+ Product2__c pro2 = new Product2__c(Name='Pro002',OT_CODE_Text__c='Test002',Product2__c = prod02.Id);
+ insert new Product2__c[] {pro1, pro2};
//璁㈠崟
Consumable_order__c Order1 = new Consumable_order__c();
Order1.Name = 'OCM_01_001';
@@ -962,8 +729,8 @@
Orderdet3.Consumable_Arrived_order__c = Order1.Id;
//Orderdet3.IsArrival__c = true;
Orderdet3.Consumable_Sale_order__c = Order1.Id;
- Orderdet3.Box_Piece__c = '鐩�';
- Orderdet3.Used_date__c = Date.today();
+ Orderdet3.Box_Piece__c ='鐩�';
+ Orderdet3.Used_date__c= Date.today();
Orderdet3.Arrive_date__c = Date.today();
Orderdet3.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
Orderdet3.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJRF';
@@ -978,7 +745,7 @@
Orderdet4.Consumable_Arrived_order__c = Order1.Id;
//Orderdet4.IsArrival__c = true;
Orderdet4.Consumable_Shipment_order__c = Order1.Id;
- Orderdet4.Box_Piece__c = '涓�';
+ Orderdet4.Box_Piece__c ='涓�';
Orderdet4.Send_Date__c = Date.today();
Orderdet4.Arrive_date__c = Date.today();
Orderdet4.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
@@ -995,10 +762,10 @@
Orderdet5.Cancellation_Flag__c = true;
Orderdet5.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
Orderdet5.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJRZ';
- Orderdet5.Box_Piece__c = '涓�';
+ Orderdet5.Box_Piece__c ='涓�';
Orderdet5.TracingCode__c = 'BXJRZ';
Orderdet5.SerialLotNo__c = '5ZK';
- insert new List<Consumable_order_details2__c>{ Orderdet3, Orderdet4, Orderdet5 };
+ insert new Consumable_order_details2__c[] {Orderdet3,Orderdet4,Orderdet5};
PageReference page = new PageReference('/apex/ArriveGoods?ArrType=ReG');
System.Test.setCurrentPage(page);
@@ -1011,12 +778,12 @@
Controller.SearchPro();
// System.assertEquals(1, controller.ConsumableorderdetailsRecordserror.size());
System.assertEquals(2, controller.ShowGoodsofReturnList.size());
- controller.ShowGoodsofReturnList[0].esd.Return_reason__c = '澶氬彂';
- controller.ShowGoodsofReturnList[1].esd.Return_reason__c = '澶氬彂';
- controller.ShowGoodsofReturnList[0].esd.Rrturn_count__c = 1;
+ controller.ShowGoodsofReturnList[0].esd.Return_reason__c='澶氬彂';
+ controller.ShowGoodsofReturnList[1].esd.Return_reason__c='澶氬彂';
+ controller.ShowGoodsofReturnList[0].esd.Rrturn_count__c =1;
Controller.UpdateGoodsOfReturn();
- list<String> list1 = new List<String>();
+ list<String> list1 = new list<String>();
list1.add(Controller.barcode = '01234567898');
Controller.inventoryEntryNoESetId(list1);
@@ -1079,53 +846,30 @@
list1.add(Controller.barcode = '0112345678901231106789012105625001234');
Controller.inventoryEntryNoESetId(list1);
System.Test.stopTest();
+
}
}
//鐩存帴鍒拌揣
@isTest
- static void arrivedirect() {
+ static void arrivedirect() {
// // TO DO: implement unit test
- List<RecordType> rectCo = [
- SELECT Id
- FROM RecordType
- WHERE IsActive = TRUE AND SobjectType = 'Account' AND Name = '璨╁2搴�'
- ];
+ List<RecordType> rectCo = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '璨╁2搴�'];
if (rectCo.size() == 0) {
return;
}
// Profile prof = [select Id from Profile where Name ='901_缁忛攢鍟嗙ぞ鍖烘櫘閫氭潈闄恄2閲嶉獙璇�(ET Email)'];
- Profile prof = [
- SELECT Id
- FROM Profile
- WHERE Name = '901_缁忛攢鍟嗙ぞ鍖烘櫘閫氭潈闄恄2閲嶉獙璇�(ET)'
- ];
+ Profile prof = [select Id from Profile where Name ='901_缁忛攢鍟嗙ぞ鍖烘櫘閫氭潈闄恄2閲嶉獙璇�(ET)'];
- Account myAccount2 = new Account(
- name = 'Testaccount002',
- Dealer_discount__c = 20,
- RecordTypeId = rectCo[0].Id,
- AgentCode_Ext__c = '9999900'
- );
- Account myAccount1 = new Account(name = 'Testaccount001', Dealer_discount__c = 30, RecordTypeId = rectCo[0].Id);
- insert new List<account>{ myAccount1, myAccount2 };
- Contact core = new Contact(email = 'jplumber@salesforce.com', firstname = 'Joe', lastname = 'Plumber', accountid = myAccount1.id);
+ Account myAccount2 = new Account(name='Testaccount002',Dealer_discount__c =20,RecordTypeId = rectCo[0].Id,AgentCode_Ext__c = '9999900');
+ Account myAccount1 = new Account(name='Testaccount001',Dealer_discount__c =30,RecordTypeId = rectCo[0].Id);
+ insert new account[]{myAccount1,myAccount2};
+
+ Contact core = new Contact(email='jplumber@salesforce.com', firstname='Joe',lastname='Plumber',accountid=myAccount1.id);
insert core;
- user MyUser_Test = new User(
- ContactId = core.id,
- Alias = 'newUser',
- Email = 'newuser@testorg.com',
- EmailEncodingKey = 'UTF-8',
- LastName = 'TestUser',
- LanguageLocaleKey = 'zh_CN',
- LocaleSidKey = 'zh_CN',
- ProfileId = prof.Id,
- TimeZoneSidKey = 'Asia/Shanghai',
- UserName = 'testUser@testorg.com',
- UserPro_Type__c = 'ET'
- );
- System.runAs(new User(Id = UserInfo.getUserId())) {
+ user MyUser_Test = New User(ContactId = core.id,Alias = 'newUser',Email='newuser@testorg.com',EmailEncodingKey='UTF-8', LastName='TestUser', LanguageLocaleKey='zh_CN',LocaleSidKey='zh_CN', ProfileId = prof.Id,TimeZoneSidKey='Asia/Shanghai', UserName='testUser@testorg.com',UserPro_Type__c = 'ET');
+ System.runAs(new User(Id = UserInfo.getUserId())){
insert MyUser_Test;
}
@@ -1133,39 +877,22 @@
// Product2 prod01 = new Product2(Name='Test01',ProductCode='Test01',Asset_Model_No__c = 'Test01',SFDA_Status__c = '鏈夊姽',JANCODE__c = '04953170200311',Dealer_special_Object__c = true,Manual_Entry__c = false);
// Product2 prod02 = new Product2(Name='Test02',ProductCode='Test02',Asset_Model_No__c = 'Test02',SFDA_Status__c = '鏈夊姽',JANCODE__c = '04953170200312',Dealer_special_Object__c = true,Manual_Entry__c = false);
// insert new Product2[] {prod01,prod02};
- System.runAs(MyUser_Test) {
- Product2 prod01 = new Product2(
- Name = 'Test01',
- ProductCode = 'Test01',
- Asset_Model_No__c = 'Test01',
- SFDA_Status__c = '鏈夊姽',
- JANCODE__c = '04953170200311',
- Dealer_special_Object__c = true,
- Manual_Entry__c = false
- );
- Product2 prod02 = new Product2(
- Name = 'Test02',
- ProductCode = 'Test02',
- Asset_Model_No__c = 'Test02',
- SFDA_Status__c = '鏈夊姽',
- JANCODE__c = '04953170200312',
- Dealer_special_Object__c = true,
- Manual_Entry__c = false
- );
- insert new List<Product2>{ prod01, prod02 };
- Product2__c pro1 = new Product2__c(Name = 'Pro001', OT_CODE_Text__c = '2344', Product2__c = prod01.Id);
- Product2__c pro2 = new Product2__c(Name = 'Pro002', OT_CODE_Text__c = '82324', Product2__c = prod02.Id);
- insert new List<Product2__c>{ pro1, pro2 };
+ system.runAs(MyUser_Test){
+ Product2 prod01 = new Product2(Name='Test01',ProductCode='Test01',Asset_Model_No__c = 'Test01',SFDA_Status__c = '鏈夊姽',JANCODE__c = '04953170200311',Dealer_special_Object__c = true,Manual_Entry__c = false);
+ Product2 prod02 = new Product2(Name='Test02',ProductCode='Test02',Asset_Model_No__c = 'Test02',SFDA_Status__c = '鏈夊姽',JANCODE__c = '04953170200312',Dealer_special_Object__c = true,Manual_Entry__c = false);
+ insert new Product2[] {prod01,prod02};
+ Product2__c pro1 = new Product2__c(Name='Pro001',OT_CODE_Text__c='2344',Product2__c = prod01.Id);
+ Product2__c pro2 = new Product2__c(Name='Pro002',OT_CODE_Text__c='82324',Product2__c = prod02.Id);
+ insert new Product2__c[] {pro1, pro2};
//浜у搧娉ㄥ唽璇�
- Product_Register__c prc = new Product_Register__c(
- Name = '鍥芥娉ㄨ繘20162220210',
- MedPrdClass__c = '3',
- ValidFrom__c = date.newinstance(2018, 7, 22),
- ValidTo__c = date.newinstance(2028, 7, 22),
- RegisterNoClass_Old__c = '6815',
- RegisterNoClass_New__c = '6815',
- RegisterNoStatus__c = '鏈夋晥'
- );
+ Product_Register__c prc = new Product_Register__c(Name = '鍥芥娉ㄨ繘20162220210',
+ MedPrdClass__c = '3',
+ ValidFrom__c = date.newinstance(2018, 07, 22),
+ ValidTo__c = date.newinstance(2028, 07, 22),
+ RegisterNoClass_Old__c = '6815',
+ RegisterNoClass_New__c = '6815',
+ RegisterNoStatus__c = '鏈夋晥'
+ );
insert prc;
//鏂版棫鍏崇郴瀵圭収琛�
//Product_Register_contrast__c prcc = new Product_Register_contrast__c(
@@ -1175,10 +902,16 @@
// );
//insert prcc;
//浜у搧-浜у搧娉ㄥ唽璇佸叧绯� prod01
- Product_Register_Link__c prlc = new Product_Register_Link__c(Product2__c = prod01.Id, Product_Register__c = prc.Id);
+ Product_Register_Link__c prlc = new Product_Register_Link__c(
+ Product2__c = prod01.Id,
+ Product_Register__c = prc.Id
+ );
insert prlc;
//浜у搧-浜у搧娉ㄥ唽璇佸叧绯� prod02
- Product_Register_Link__c prlc2 = new Product_Register_Link__c(Product2__c = prod02.Id, Product_Register__c = prc.Id);
+ Product_Register_Link__c prlc2 = new Product_Register_Link__c(
+ Product2__c = prod02.Id,
+ Product_Register__c = prc.Id
+ );
insert prlc2;
//璁㈠崟
@@ -1244,7 +977,7 @@
//List<Product2> proList = [select name,Estimation_Entry_Possibility__c from Product2 where id = :prod01.Id];
//System.assertEquals('鈼�', proList[0].Estimation_Entry_Possibility__c);
- insert new List<Consumable_order_details2__c>{ Orderdet1, Orderdet2, Orderdet3, Orderdet4 };
+ insert new Consumable_order_details2__c[] {Orderdet1, Orderdet2,Orderdet3,Orderdet4};
PageReference page = new PageReference('/apex/ArriveGoods?Esetid=' + Order1.Id);
System.Test.setCurrentPage(page);
ArriveGoodsController Controller = new ArriveGoodsController();
@@ -1261,47 +994,23 @@
//鐩存帴鍒拌揣
@isTest
- static void arrivedirect241() {
+ static void arrivedirect241() {
// // TO DO: implement unit test
- List<RecordType> rectCo = [
- SELECT Id
- FROM RecordType
- WHERE IsActive = TRUE AND SobjectType = 'Account' AND Name = '璨╁2搴�'
- ];
+ List<RecordType> rectCo = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '璨╁2搴�'];
if (rectCo.size() == 0) {
return;
}
// Profile prof = [select Id from Profile where Name ='901_缁忛攢鍟嗙ぞ鍖烘櫘閫氭潈闄恄2閲嶉獙璇�(ET Email)'];
- Profile prof = [
- SELECT Id
- FROM Profile
- WHERE Name = '901_缁忛攢鍟嗙ぞ鍖烘櫘閫氭潈闄恄2閲嶉獙璇�(ET)'
- ];
+ Profile prof = [select Id from Profile where Name ='901_缁忛攢鍟嗙ぞ鍖烘櫘閫氭潈闄恄2閲嶉獙璇�(ET)'];
- Account myAccount2 = new Account(
- name = 'Testaccount002',
- Dealer_discount__c = 20,
- RecordTypeId = rectCo[0].Id,
- AgentCode_Ext__c = '9999900'
- );
- Account myAccount1 = new Account(name = 'Testaccount001', Dealer_discount__c = 30, RecordTypeId = rectCo[0].Id);
- insert new List<account>{ myAccount1, myAccount2 };
- Contact core = new Contact(email = 'jplumber@salesforce.com', firstname = 'Joe', lastname = 'Plumber', accountid = myAccount1.id);
+
+ Account myAccount2 = new Account(name='Testaccount002',Dealer_discount__c =20,RecordTypeId = rectCo[0].Id,AgentCode_Ext__c = '9999900');
+ Account myAccount1 = new Account(name='Testaccount001',Dealer_discount__c =30,RecordTypeId = rectCo[0].Id);
+ insert new account[]{myAccount1,myAccount2};
+ Contact core = new Contact(email='jplumber@salesforce.com', firstname='Joe',lastname='Plumber',accountid=myAccount1.id);
insert core;
- user MyUser_Test = new User(
- ContactId = core.id,
- Alias = 'newUser',
- Email = 'newuser@testorg.com',
- EmailEncodingKey = 'UTF-8',
- LastName = 'TestUser',
- LanguageLocaleKey = 'zh_CN',
- LocaleSidKey = 'zh_CN',
- ProfileId = prof.Id,
- TimeZoneSidKey = 'Asia/Shanghai',
- UserName = 'testUser@testorg.com',
- UserPro_Type__c = 'ET'
- );
- System.runAs(new User(Id = UserInfo.getUserId())) {
+ user MyUser_Test = New User(ContactId = core.id,Alias = 'newUser',Email='newuser@testorg.com',EmailEncodingKey='UTF-8', LastName='TestUser', LanguageLocaleKey='zh_CN',LocaleSidKey='zh_CN', ProfileId = prof.Id,TimeZoneSidKey='Asia/Shanghai', UserName='testUser@testorg.com',UserPro_Type__c = 'ET');
+ System.runAs(new User(Id = UserInfo.getUserId())){
insert MyUser_Test;
}
@@ -1309,39 +1018,22 @@
// Product2 prod01 = new Product2(Name='Test01',ProductCode='Test01',Asset_Model_No__c = 'Test01',SFDA_Status__c = '鏈夊姽',JANCODE__c = '04953170200311',Dealer_special_Object__c = true,Manual_Entry__c = false);
// Product2 prod02 = new Product2(Name='Test02',ProductCode='Test02',Asset_Model_No__c = 'Test02',SFDA_Status__c = '鏈夊姽',JANCODE__c = '04953170200312',Dealer_special_Object__c = true,Manual_Entry__c = false);
// insert new Product2[] {prod01,prod02};
- System.runAs(MyUser_Test) {
- Product2 prod01 = new Product2(
- Name = 'Test01',
- ProductCode = 'Test01',
- Asset_Model_No__c = 'Test01',
- SFDA_Status__c = '鏈夊姽',
- JANCODE__c = '04953170200311',
- Dealer_special_Object__c = true,
- Manual_Entry__c = false
- );
- Product2 prod02 = new Product2(
- Name = 'Test02',
- ProductCode = 'Test02',
- Asset_Model_No__c = 'Test02',
- SFDA_Status__c = '鏈夊姽',
- JANCODE__c = '04953170200312',
- Dealer_special_Object__c = true,
- Manual_Entry__c = false
- );
- insert new List<Product2>{ prod01, prod02 };
- Product2__c pro1 = new Product2__c(Name = 'Pro001', OT_CODE_Text__c = 'Test001', Product2__c = prod01.Id);
- Product2__c pro2 = new Product2__c(Name = 'Pro002', OT_CODE_Text__c = 'Test002', Product2__c = prod02.Id);
- insert new List<Product2__c>{ pro1, pro2 };
+ system.runAs(MyUser_Test){
+ Product2 prod01 = new Product2(Name='Test01',ProductCode='Test01',Asset_Model_No__c = 'Test01',SFDA_Status__c = '鏈夊姽',JANCODE__c = '04953170200311',Dealer_special_Object__c = true,Manual_Entry__c = false);
+ Product2 prod02 = new Product2(Name='Test02',ProductCode='Test02',Asset_Model_No__c = 'Test02',SFDA_Status__c = '鏈夊姽',JANCODE__c = '04953170200312',Dealer_special_Object__c = true,Manual_Entry__c = false);
+ insert new Product2[] {prod01,prod02};
+ Product2__c pro1 = new Product2__c(Name='Pro001',OT_CODE_Text__c='Test001',Product2__c = prod01.Id);
+ Product2__c pro2 = new Product2__c(Name='Pro002',OT_CODE_Text__c='Test002',Product2__c = prod02.Id);
+ insert new Product2__c[] {pro1, pro2};
//浜у搧娉ㄥ唽璇�
- Product_Register__c prc = new Product_Register__c(
- Name = '鍥芥娉ㄨ繘20162220210',
- MedPrdClass__c = '3',
- ValidFrom__c = date.newinstance(2018, 7, 22),
- ValidTo__c = date.newinstance(2028, 7, 22),
- RegisterNoClass_Old__c = '6815',
- RegisterNoClass_New__c = '6815',
- RegisterNoStatus__c = '鏈夋晥'
- );
+ Product_Register__c prc = new Product_Register__c(Name = '鍥芥娉ㄨ繘20162220210',
+ MedPrdClass__c = '3',
+ ValidFrom__c = date.newinstance(2018, 07, 22),
+ ValidTo__c = date.newinstance(2028, 07, 22),
+ RegisterNoClass_Old__c = '6815',
+ RegisterNoClass_New__c = '6815',
+ RegisterNoStatus__c = '鏈夋晥'
+ );
insert prc;
//鏂版棫鍏崇郴瀵圭収琛�
//Product_Register_contrast__c prcc = new Product_Register_contrast__c(
@@ -1351,10 +1043,16 @@
// );
//insert prcc;
//浜у搧-浜у搧娉ㄥ唽璇佸叧绯� prod01
- Product_Register_Link__c prlc = new Product_Register_Link__c(Product2__c = prod01.Id, Product_Register__c = prc.Id);
+ Product_Register_Link__c prlc = new Product_Register_Link__c(
+ Product2__c = prod01.Id,
+ Product_Register__c = prc.Id
+ );
insert prlc;
//浜у搧-浜у搧娉ㄥ唽璇佸叧绯� prod02
- Product_Register_Link__c prlc2 = new Product_Register_Link__c(Product2__c = prod02.Id, Product_Register__c = prc.Id);
+ Product_Register_Link__c prlc2 = new Product_Register_Link__c(
+ Product2__c = prod02.Id,
+ Product_Register__c = prc.Id
+ );
insert prlc2;
//璁㈠崟
@@ -1368,20 +1066,20 @@
Consumable_order__c Order2 = new Consumable_order__c();
Order2.Name = 'OCM_01_002';
Order2.Order_status__c = '鎵瑰噯';
- Order2.Order_type__c = '鍒拌揣';
+ Order2.Order_type__c = '鍒拌揣';
Order2.Dealer_Info__c = myAccount1.id;
Order2.RecordTypeid = System.Label.RT_ConOrder_Delivery;
Order2.Deliver_date__c = Date.today();
- Order2.Order_date__c = Date.today();
+ Order2.Order_date__c = Date.today();
insert Order2;
Order2 = new Consumable_order__c();
Order2.Name = 'OCM_01_002';
Order2.Order_status__c = '鎵瑰噯';
- Order2.Order_type__c = '杩斿搧';
+ Order2.Order_type__c = '杩斿搧';
Order2.Dealer_Info__c = myAccount1.id;
Order2.RecordTypeid = System.Label.RT_ConOrder_Delivery;
Order2.Deliver_date__c = Date.today();
- Order2.Order_date__c = Date.today();
+ Order2.Order_date__c = Date.today();
Order2.ReturnGs_Upload_Date__c = Date.today();
insert Order2;
@@ -1405,7 +1103,7 @@
Orderdet1.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
Orderdet1.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJRF';
Orderdet1.Arrive_date__c = Date.today();
- Orderdet1.Rrturn_count__c = 1;
+ Orderdet1.Rrturn_count__c =1;
Orderdet1.TracingCode__c = '20170808';
//daohuo
Consumable_order_details2__c Orderdet2 = new Consumable_order_details2__c();
@@ -1442,7 +1140,7 @@
Orderdet4.Consumable_Sale_order__c = Order2.Id;
Orderdet4.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
Orderdet4.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJR3';
- Orderdet4.Used_date__c = Date.today();
+ Orderdet4.Used_date__c =Date.today();
Orderdet4 = new Consumable_order_details2__c();
Orderdet4.Name = 'OCM_01_001003';
Orderdet4.Consumable_order_minor__c = Order1.Id;
@@ -1453,7 +1151,7 @@
Orderdet4.Consumable_Sale_order__c = Order2.Id;
Orderdet4.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
Orderdet4.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJ13';
- Orderdet4.Used_date__c = Date.today();
+ Orderdet4.Used_date__c =Date.today();
Orderdet4.TracingCode__c = '20170808';
Consumable_order_details2__c Orderdet5 = new Consumable_order_details2__c();
Orderdet5.Name = 'OCM_01_001003';
@@ -1469,8 +1167,8 @@
Orderdet5.Send_Date__c = null;
Orderdet5.Used_date__c = null;
Orderdet5.Lose_Flag__c = false;
- Orderdet5.Return_date__c = null;
- Orderdet5.Cancellation_Date__c = Date.today().addDays(1);
+ Orderdet5.Return_date__c= null;
+ Orderdet5.Cancellation_Date__c= Date.today().addDays(1);
Orderdet5.Box_Piece__c = '鐩�';
Orderdet5.TracingCode__c = '20170808';
@@ -1485,10 +1183,10 @@
Orderdet6.Consumable_Shipment_order__c = Order1.Id;
Orderdet6.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
Orderdet6.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJR4';
- Orderdet6.Send_Date__c = Date.today();
- Orderdet6.Return_date__c = null;
+ Orderdet6.Send_Date__c = Date.today();
+ Orderdet6.Return_date__c= null;
Orderdet6.Box_Piece__c = '鐩�';
- Orderdet6.Rrturn_count__c = 1;
+ Orderdet6.Rrturn_count__c =1;
Orderdet6.TracingCode__c = '20170808';
// 鍗曚綅涓轰釜鐨凚arcode瀵瑰簲鐨勫嚭搴撳崟
@@ -1502,13 +1200,13 @@
Orderdet7.Consumable_Shipment_order__c = Order1.Id;
Orderdet7.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
Orderdet7.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJR1';
- Orderdet7.Send_Date__c = Date.today();
+ Orderdet7.Send_Date__c = Date.today();
Orderdet7.Box_Piece__c = '涓�';
- Orderdet7.Used_date__c = Date.today();
- Orderdet7.Return_date__c = null;
- Orderdet7.RemoveBox_No__c = 1;
- Orderdet7.Consumable_ZS_order__c = Order1.Id;
- Orderdet7.Rrturn_count__c = 1;
+ Orderdet7.Used_date__c = Date.today();
+ Orderdet7.Return_date__c= null;
+ Orderdet7.RemoveBox_No__c =1;
+ Orderdet7.Consumable_ZS_order__c= Order1.Id;
+ Orderdet7.Rrturn_count__c =1;
Orderdet7.TracingCode__c = '20170808';
Orderdet7 = new Consumable_order_details2__c();
@@ -1520,13 +1218,13 @@
Orderdet7.Consumable_Shipment_order__c = Order1.Id;
Orderdet7.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
Orderdet7.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJR7';
- Orderdet7.Send_Date__c = Date.today();
+ Orderdet7.Send_Date__c = Date.today();
Orderdet7.Box_Piece__c = '涓�';
- Orderdet7.Used_date__c = Date.today();
- Orderdet7.Return_date__c = null;
- Orderdet7.RemoveBox_No__c = 1;
- Orderdet7.Consumable_ZS_order__c = Order1.Id;
- Orderdet7.Rrturn_count__c = 0;
+ Orderdet7.Used_date__c = Date.today();
+ Orderdet7.Return_date__c= null;
+ Orderdet7.RemoveBox_No__c =1;
+ Orderdet7.Consumable_ZS_order__c= Order1.Id;
+ Orderdet7.Rrturn_count__c =0;
Orderdet7.TracingCode__c = '20170808';
Consumable_order_details2__c Orderdet8 = new Consumable_order_details2__c();
@@ -1539,19 +1237,19 @@
Orderdet8.Consumable_Shipment_order__c = Order1.Id;
Orderdet8.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
Orderdet8.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJR9';
- Orderdet8.Send_Date__c = Date.today();
+ Orderdet8.Send_Date__c = Date.today();
Orderdet8.Box_Piece__c = '涓�';
- Orderdet8.Used_date__c = Date.today();
- Orderdet8.Return_date__c = null;
- Orderdet8.RemoveBox_No__c = 1;
- Orderdet8.Consumable_ZS_order__c = Order1.Id;
- Orderdet8.Rrturn_count__c = null;
- Orderdet8.RemoveBox_date__c = Date.today();
+ Orderdet8.Used_date__c = Date.today();
+ Orderdet8.Return_date__c= null;
+ Orderdet8.RemoveBox_No__c =1;
+ Orderdet8.Consumable_ZS_order__c= Order1.Id;
+ Orderdet8.Rrturn_count__c =null;
+ Orderdet8.RemoveBox_date__c = Date.today();
Orderdet8.Intra_Trade_List_RMB__c = 1;
- Orderdet8.Sterilization_limit__c = Date.today();
- Orderdet8.SerialLotNo__c = '11鎵规';
+ Orderdet8.Sterilization_limit__c = Date.today();
+ Orderdet8.SerialLotNo__c ='11鎵规';
Orderdet8.TracingCode__c = '20170808';
- Orderdet8.Arrive_date__c = Date.today();
+ Orderdet8.Arrive_date__c = Date.today();
Consumable_order_details2__c Orderdet9 = new Consumable_order_details2__c();
Orderdet9.Name = 'OCM_01_001004';
@@ -1562,13 +1260,13 @@
Orderdet9.Consumable_Shipment_order__c = Order1.Id;
Orderdet9.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
Orderdet9.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJR8';
- Orderdet9.Send_Date__c = Date.today();
+ Orderdet9.Send_Date__c = Date.today();
Orderdet9.Box_Piece__c = '涓�';
- Orderdet9.Used_date__c = Date.today();
- Orderdet9.Return_date__c = null;
- Orderdet9.Consumable_ZS_order__c = Order1.Id;
- Orderdet9.Arrive_date__c = Date.today();
- Orderdet9.Rrturn_count__c = 10;
+ Orderdet9.Used_date__c = Date.today();
+ Orderdet9.Return_date__c= null;
+ Orderdet9.Consumable_ZS_order__c= Order1.Id;
+ Orderdet9.Arrive_date__c = Date.today();
+ Orderdet9.Rrturn_count__c =10;
Orderdet9.TracingCode__c = '20170808';
Consumable_order_details2__c lose = new Consumable_order_details2__c();
lose.Name = 'OCM_01_001004';
@@ -1580,9 +1278,9 @@
lose.Consumable_Shipment_order__c = Order1.Id;
lose.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
lose.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJR5';
- lose.Send_Date__c = null;
- lose.Arrive_date__c = null;
- lose.Used_date__c = null;
+ lose.Send_Date__c = null;
+ lose.Arrive_date__c = null;
+ lose.Used_date__c = null;
lose.Box_Piece__c = '鐩�';
lose.TracingCode__c = '20170808';
Consumable_order_details2__c lose1 = new Consumable_order_details2__c();
@@ -1595,9 +1293,9 @@
lose1.Consumable_Shipment_order__c = Order1.Id;
lose1.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
lose1.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJR6';
- lose1.Send_Date__c = null;
- lose1.Arrive_date__c = Date.today();
- lose1.Used_date__c = null;
+ lose1.Send_Date__c = null;
+ lose1.Arrive_date__c = Date.today();
+ lose1.Used_date__c = null;
lose1.Box_Piece__c = '鐩�';
lose1.TracingCode__c = '20170808';
Consumable_order_details2__c lose2 = new Consumable_order_details2__c();
@@ -1610,33 +1308,20 @@
lose2.Consumable_Shipment_order__c = Order2.Id;
lose2.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
lose2.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJR7';
- lose2.Send_Date__c = null;
- lose2.Arrive_date__c = Date.today();
- lose2.Used_date__c = null;
+ lose2.Send_Date__c = null;
+ lose2.Arrive_date__c = Date.today();
+ lose2.Used_date__c = null;
lose2.Box_Piece__c = '鐩�';
lose2.Intra_Trade_List_RMB__c = 1;
lose2.Direct_Arrive_Product__c = true;
- lose2.Sterilization_limit__c = Date.today();
- lose2.SerialLotNo__c = '11鎵规';
+ lose2.Sterilization_limit__c = Date.today();
+ lose2.SerialLotNo__c ='11鎵规';
lose2.TracingCode__c = '20170808';
//List<Product2> proList = [select name,Estimation_Entry_Possibility__c from Product2 where id = :prod01.Id];
//System.assertEquals('鈼�', proList[0].Estimation_Entry_Possibility__c);
- insert new List<Consumable_order_details2__c>{
- Orderdet1,
- Orderdet2,
- Orderdet3,
- Orderdet4,
- Orderdet5,
- Orderdet6,
- Orderdet7,
- Orderdet8,
- Orderdet9,
- lose,
- lose1,
- lose2
- };
+ insert new Consumable_order_details2__c[] {Orderdet1, Orderdet2,Orderdet3,Orderdet4,Orderdet5,Orderdet6,Orderdet7,Orderdet8,Orderdet9,lose,lose1,lose2};
PageReference page = new PageReference('/apex/ArriveGoods?Esetid=' + Order1.Id);
System.Test.setCurrentPage(page);
ArriveGoodsController Controller = new ArriveGoodsController();
@@ -1652,50 +1337,27 @@
}
}
+
//杩斿搧 鏄庣粏2涓嶅瓨鍦ㄧ殑瀵瑰簲鐨勫埌璐ц鍗曟槑缁�
@isTest
- static void productReturn_oldbarcode() {
+ static void productReturn_oldbarcode() {
// // TO DO: implement unit test
- List<RecordType> rectCo = [
- SELECT Id
- FROM RecordType
- WHERE IsActive = TRUE AND SobjectType = 'Account' AND Name = '璨╁2搴�'
- ];
+ List<RecordType> rectCo = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '璨╁2搴�'];
if (rectCo.size() == 0) {
return;
}
// Profile prof = [select Id from Profile where Name ='901_缁忛攢鍟嗙ぞ鍖烘櫘閫氭潈闄恄2閲嶉獙璇�(ET Email)'];
- Profile prof = [
- SELECT Id
- FROM Profile
- WHERE Name = '901_缁忛攢鍟嗙ぞ鍖烘櫘閫氭潈闄恄2閲嶉獙璇�(ET)'
- ];
+ Profile prof = [select Id from Profile where Name ='901_缁忛攢鍟嗙ぞ鍖烘櫘閫氭潈闄恄2閲嶉獙璇�(ET)'];
- Account myAccount2 = new Account(
- name = 'Testaccount002',
- Dealer_discount__c = 20,
- RecordTypeId = rectCo[0].Id,
- AgentCode_Ext__c = '9999900'
- );
- Account myAccount1 = new Account(name = 'Testaccount001', Dealer_discount__c = 30, RecordTypeId = rectCo[0].Id);
- insert new List<account>{ myAccount1, myAccount2 };
- Contact core = new Contact(email = 'jplumber@salesforce.com', firstname = 'Joe', lastname = 'Plumber', accountid = myAccount1.id);
+ Account myAccount2 = new Account(name='Testaccount002',Dealer_discount__c =20,RecordTypeId = rectCo[0].Id,AgentCode_Ext__c = '9999900');
+ Account myAccount1 = new Account(name='Testaccount001',Dealer_discount__c =30,RecordTypeId = rectCo[0].Id);
+ insert new account[]{myAccount1,myAccount2};
+
+ Contact core = new Contact(email='jplumber@salesforce.com', firstname='Joe',lastname='Plumber',accountid=myAccount1.id);
insert core;
- user MyUser_Test = new User(
- ContactId = core.id,
- Alias = 'newUser',
- Email = 'newuser@testorg.com',
- EmailEncodingKey = 'UTF-8',
- LastName = 'TestUser',
- LanguageLocaleKey = 'zh_CN',
- LocaleSidKey = 'zh_CN',
- ProfileId = prof.Id,
- TimeZoneSidKey = 'Asia/Shanghai',
- UserName = 'testUser@testorg.com',
- UserPro_Type__c = 'ET'
- );
- System.runAs(new User(Id = UserInfo.getUserId())) {
+ user MyUser_Test = New User(ContactId = core.id,Alias = 'newUser',Email='newuser@testorg.com',EmailEncodingKey='UTF-8', LastName='TestUser', LanguageLocaleKey='zh_CN',LocaleSidKey='zh_CN', ProfileId = prof.Id,TimeZoneSidKey='Asia/Shanghai', UserName='testUser@testorg.com',UserPro_Type__c = 'ET');
+ System.runAs(new User(Id = UserInfo.getUserId())){
insert MyUser_Test;
}
@@ -1703,29 +1365,13 @@
// Product2 prod01 = new Product2(Name='Test01',ProductCode='Test01',Asset_Model_No__c = 'Test01',SFDA_Status__c = '鏈夊姽',JANCODE__c = '04953170200311',Dealer_special_Object__c = true,Manual_Entry__c = false);
// Product2 prod02 = new Product2(Name='Test02',ProductCode='Test02',Asset_Model_No__c = 'Test02',SFDA_Status__c = '鏈夊姽',JANCODE__c = '04953170200312',Dealer_special_Object__c = true,Manual_Entry__c = false);
// insert new Product2[] {prod01,prod02};
- System.runAs(MyUser_Test) {
- Product2 prod01 = new Product2(
- Name = 'Test01',
- ProductCode = 'Test01',
- Asset_Model_No__c = 'Test01',
- SFDA_Status__c = '鏈夊姽',
- JANCODE__c = '04953170200311',
- Dealer_special_Object__c = true,
- Manual_Entry__c = false
- );
- Product2 prod02 = new Product2(
- Name = 'Test02',
- ProductCode = 'Test02',
- Asset_Model_No__c = 'Test02',
- SFDA_Status__c = '鏈夊姽',
- JANCODE__c = '04953170200312',
- Dealer_special_Object__c = true,
- Manual_Entry__c = false
- );
- insert new List<Product2>{ prod01, prod02 };
- Product2__c pro1 = new Product2__c(Name = 'Pro001', OT_CODE_Text__c = 'Test001', Product2__c = prod01.Id);
- Product2__c pro2 = new Product2__c(Name = 'Pro002', OT_CODE_Text__c = 'Test002', Product2__c = prod02.Id);
- insert new List<Product2__c>{ pro1, pro2 };
+ system.runAs(MyUser_Test){
+ Product2 prod01 = new Product2(Name='Test01',ProductCode='Test01',Asset_Model_No__c = 'Test01',SFDA_Status__c = '鏈夊姽',JANCODE__c = '04953170200311',Dealer_special_Object__c = true,Manual_Entry__c = false);
+ Product2 prod02 = new Product2(Name='Test02',ProductCode='Test02',Asset_Model_No__c = 'Test02',SFDA_Status__c = '鏈夊姽',JANCODE__c = '04953170200312',Dealer_special_Object__c = true,Manual_Entry__c = false);
+ insert new Product2[] {prod01,prod02};
+ Product2__c pro1 = new Product2__c(Name='Pro001',OT_CODE_Text__c='Test001',Product2__c = prod01.Id);
+ Product2__c pro2 = new Product2__c(Name='Pro002',OT_CODE_Text__c='Test002',Product2__c = prod02.Id);
+ insert new Product2__c[] {pro1, pro2};
//璁㈠崟
Consumable_order__c Order1 = new Consumable_order__c();
@@ -1813,7 +1459,7 @@
Orderdet5.Cancellation_Date__c = Date.today();
Orderdet5.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
Orderdet5.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJRZ';
- Orderdet5.Box_Piece__c = '涓�';
+ Orderdet5.Box_Piece__c ='涓�';
Orderdet5.TracingCode__c = 'BXSYS';
//fanpin
Consumable_order_details2__c Orderdet6 = new Consumable_order_details2__c();
@@ -1824,7 +1470,7 @@
Orderdet6.Consumable_Return_order__c = Order2.Id;
Orderdet6.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
Orderdet6.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJRA';
- Orderdet6.Box_Piece__c = '涓�';
+ Orderdet6.Box_Piece__c ='涓�';
Orderdet6.TracingCode__c = 'BXSYS';
//鍙戣揣鏄庣粏
@@ -1838,7 +1484,7 @@
Orderdet7.Bar_Code__c = '01049531702003111115120017181000105ZK250BX333';
Orderdet7.TracingCode__c = 'BXSYS';
- insert new List<Consumable_order_details2__c>{ Orderdet1, Orderdet2, Orderdet3, Orderdet4, Orderdet5, Orderdet6, Orderdet7 };
+ insert new Consumable_order_details2__c[] {Orderdet1, Orderdet2,Orderdet3,Orderdet4,Orderdet5,Orderdet6,Orderdet7};
PageReference page = new PageReference('/apex/ArriveGoods?ArrType=ReG');
System.Test.setCurrentPage(page);
ArriveGoodsController Controller = new ArriveGoodsController();
@@ -1862,83 +1508,44 @@
controller.getinventorysize();
System.Test.stopTest();
+
}
}
@isTest
- static void barcodecheck() {
+ static void barcodecheck() {
// // TO DO: implement unit test
- List<RecordType> rectCo = [
- SELECT Id
- FROM RecordType
- WHERE IsActive = TRUE AND SobjectType = 'Account' AND Name = '璨╁2搴�'
- ];
+ List<RecordType> rectCo = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '璨╁2搴�'];
if (rectCo.size() == 0) {
return;
}
// Profile prof = [select Id from Profile where Name ='901_缁忛攢鍟嗙ぞ鍖烘櫘閫氭潈闄恄2閲嶉獙璇�(ET Email)'];
- Profile prof = [
- SELECT Id
- FROM Profile
- WHERE Name = '901_缁忛攢鍟嗙ぞ鍖烘櫘閫氭潈闄恄2閲嶉獙璇�(ET)'
- ];
+ Profile prof = [select Id from Profile where Name ='901_缁忛攢鍟嗙ぞ鍖烘櫘閫氭潈闄恄2閲嶉獙璇�(ET)'];
- Account myAccount2 = new Account(
- name = 'Testaccount002',
- Dealer_discount__c = 20,
- RecordTypeId = rectCo[0].Id,
- AgentCode_Ext__c = '9999900'
- );
- Account myAccount1 = new Account(name = 'Testaccount001', Dealer_discount__c = 30, RecordTypeId = rectCo[0].Id);
- insert new List<account>{ myAccount1, myAccount2 };
- Contact core = new Contact(email = 'jplumber@salesforce.com', firstname = 'Joe', lastname = 'Plumber', accountid = myAccount1.id);
+ Account myAccount2 = new Account(name='Testaccount002',Dealer_discount__c =20,RecordTypeId = rectCo[0].Id,AgentCode_Ext__c = '9999900');
+ Account myAccount1 = new Account(name='Testaccount001',Dealer_discount__c =30,RecordTypeId = rectCo[0].Id);
+ insert new account[]{myAccount1,myAccount2};
+
+ Contact core = new Contact(email='jplumber@salesforce.com', firstname='Joe',lastname='Plumber',accountid=myAccount1.id);
insert core;
- user MyUser_Test = new User(
- ContactId = core.id,
- Alias = 'newUser',
- Email = 'newuser@testorg.com',
- EmailEncodingKey = 'UTF-8',
- LastName = 'TestUser',
- LanguageLocaleKey = 'zh_CN',
- LocaleSidKey = 'zh_CN',
- ProfileId = prof.Id,
- TimeZoneSidKey = 'Asia/Shanghai',
- UserName = 'testUser@testorg.com',
- UserPro_Type__c = 'ET'
- );
- System.runAs(new User(Id = UserInfo.getUserId())) {
+ user MyUser_Test = New User(ContactId = core.id,Alias = 'newUser',Email='newuser@testorg.com',EmailEncodingKey='UTF-8', LastName='TestUser', LanguageLocaleKey='zh_CN',LocaleSidKey='zh_CN', ProfileId = prof.Id,TimeZoneSidKey='Asia/Shanghai', UserName='testUser@testorg.com',UserPro_Type__c = 'ET');
+ System.runAs(new User(Id = UserInfo.getUserId())){
insert MyUser_Test;
}
// User MyUser_Test = [select id,Contact.accountid from User WHERE ProfileId = :prof.Id and IsActive = true and UserPro_Type__c = 'ET' limit 1 ];
// Product2 prod01 = new Product2(Name='Test01',ProductCode='Test01',Asset_Model_No__c = 'Test01',SFDA_Status__c = '鏈夊姽',JANCODE__c = '04953170200311',Dealer_special_Object__c = true,Manual_Entry__c = false);
// Product2 prod02 = new Product2(Name='Test02',ProductCode='Test02',Asset_Model_No__c = 'Test02',SFDA_Status__c = '鏈夊姽',JANCODE__c = '04953170200312',Dealer_special_Object__c = true,Manual_Entry__c = false);
// insert new Product2[] {prod01,prod02};
- System.runAs(MyUser_Test) {
- Product2 prod01 = new Product2(
- Name = 'Test01',
- ProductCode = 'Test01',
- Asset_Model_No__c = 'Test01',
- SFDA_Status__c = '鏈夊姽',
- JANCODE__c = '04953170200311',
- Dealer_special_Object__c = true,
- Manual_Entry__c = false
- );
- Product2 prod02 = new Product2(
- Name = 'Test02',
- ProductCode = 'Test02',
- Asset_Model_No__c = 'Test02',
- SFDA_Status__c = '鏈夊姽',
- JANCODE__c = '04953170200312',
- Dealer_special_Object__c = true,
- Manual_Entry__c = false
- );
- insert new List<Product2>{ prod01, prod02 };
- Product2__c pro1 = new Product2__c(Name = 'Pro001', OT_CODE_Text__c = '2344', Product2__c = prod01.Id);
- Product2__c pro2 = new Product2__c(Name = 'Pro002', OT_CODE_Text__c = '8232', Product2__c = prod02.Id);
- insert new List<Product2__c>{ pro1, pro2 };
+ system.runAs(MyUser_Test){
+ Product2 prod01 = new Product2(Name='Test01',ProductCode='Test01',Asset_Model_No__c = 'Test01',SFDA_Status__c = '鏈夊姽',JANCODE__c = '04953170200311',Dealer_special_Object__c = true,Manual_Entry__c = false);
+ Product2 prod02 = new Product2(Name='Test02',ProductCode='Test02',Asset_Model_No__c = 'Test02',SFDA_Status__c = '鏈夊姽',JANCODE__c = '04953170200312',Dealer_special_Object__c = true,Manual_Entry__c = false);
+ insert new Product2[] {prod01,prod02};
+ Product2__c pro1 = new Product2__c(Name='Pro001',OT_CODE_Text__c='2344',Product2__c = prod01.Id);
+ Product2__c pro2 = new Product2__c(Name='Pro002',OT_CODE_Text__c='8232',Product2__c = prod02.Id);
+ insert new Product2__c[] {pro1, pro2};
ArriveGoodsController Controller = new ArriveGoodsController();
//鍒濆鍖栨祴璇�
- list<String> list1 = new List<String>();
+ list<String> list1 = new list<String>();
list1.clear();
list1.add(Controller.barcode = '2413456250BBBBA');
Controller.inventoryEntry(list1);
@@ -2056,87 +1663,46 @@
}
}
@isTest
- static void barcodechkeck_2() {
+ static void barcodechkeck_2() {
// // TO DO: implement unit test
- List<RecordType> rectCo = [
- SELECT Id
- FROM RecordType
- WHERE IsActive = TRUE AND SobjectType = 'Account' AND Name = '璨╁2搴�'
- ];
+ List<RecordType> rectCo = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '璨╁2搴�'];
if (rectCo.size() == 0) {
return;
}
// Profile prof = [select Id from Profile where Name ='901_缁忛攢鍟嗙ぞ鍖烘櫘閫氭潈闄恄2閲嶉獙璇�(ET Email)'];
- Profile prof = [
- SELECT Id
- FROM Profile
- WHERE Name = '901_缁忛攢鍟嗙ぞ鍖烘櫘閫氭潈闄恄2閲嶉獙璇�(ET)'
- ];
+ Profile prof = [select Id from Profile where Name ='901_缁忛攢鍟嗙ぞ鍖烘櫘閫氭潈闄恄2閲嶉獙璇�(ET)'];
- Account myAccount2 = new Account(
- name = 'Testaccount002',
- Dealer_discount__c = 20,
- RecordTypeId = rectCo[0].Id,
- AgentCode_Ext__c = '9999900'
- );
- Account myAccount1 = new Account(name = 'Testaccount001', Dealer_discount__c = 30, RecordTypeId = rectCo[0].Id);
- insert new List<account>{ myAccount1, myAccount2 };
- Contact core = new Contact(email = 'jplumber@salesforce.com', firstname = 'Joe', lastname = 'Plumber', accountid = myAccount1.id);
+ Account myAccount2 = new Account(name='Testaccount002',Dealer_discount__c =20,RecordTypeId = rectCo[0].Id,AgentCode_Ext__c = '9999900');
+ Account myAccount1 = new Account(name='Testaccount001',Dealer_discount__c =30,RecordTypeId = rectCo[0].Id);
+ insert new account[]{myAccount1,myAccount2};
+
+ Contact core = new Contact(email='jplumber@salesforce.com', firstname='Joe',lastname='Plumber',accountid=myAccount1.id);
insert core;
- user MyUser_Test = new User(
- ContactId = core.id,
- Alias = 'newUser',
- Email = 'newuser@testorg.com',
- EmailEncodingKey = 'UTF-8',
- LastName = 'TestUser',
- LanguageLocaleKey = 'zh_CN',
- LocaleSidKey = 'zh_CN',
- ProfileId = prof.Id,
- TimeZoneSidKey = 'Asia/Shanghai',
- UserName = 'testUser@testorg.com',
- UserPro_Type__c = 'ET'
- );
- System.runAs(new User(Id = UserInfo.getUserId())) {
+ user MyUser_Test = New User(ContactId = core.id,Alias = 'newUser',Email='newuser@testorg.com',EmailEncodingKey='UTF-8', LastName='TestUser', LanguageLocaleKey='zh_CN',LocaleSidKey='zh_CN', ProfileId = prof.Id,TimeZoneSidKey='Asia/Shanghai', UserName='testUser@testorg.com',UserPro_Type__c = 'ET');
+System.runAs(new User(Id = UserInfo.getUserId())){
insert MyUser_Test;
}
// User MyUser_Test = [select id,Contact.accountid from User WHERE ProfileId = :prof.Id and IsActive = true and UserPro_Type__c = 'ET' limit 1 ];
// Product2 prod01 = new Product2(Name='Test01',ProductCode='Test01',Asset_Model_No__c = 'Test01',SFDA_Status__c = '鏈夊姽',JANCODE__c = '04953170200311',Dealer_special_Object__c = true,Manual_Entry__c = false);
// Product2 prod02 = new Product2(Name='Test02',ProductCode='Test02',Asset_Model_No__c = 'Test02',SFDA_Status__c = '鏈夊姽',JANCODE__c = '04953170200312',Dealer_special_Object__c = true,Manual_Entry__c = false);
// insert new Product2[] {prod01,prod02};
- System.runAs(MyUser_Test) {
- Product2 prod01 = new Product2(
- Name = 'Test01',
- ProductCode = 'Test01',
- Asset_Model_No__c = 'Test01',
- SFDA_Status__c = '鏈夊姽',
- JANCODE__c = '04953170200311',
- Dealer_special_Object__c = true,
- Manual_Entry__c = false
- );
- Product2 prod02 = new Product2(
- Name = 'Test02',
- ProductCode = 'Test02',
- Asset_Model_No__c = 'Test02',
- SFDA_Status__c = '鏈夊姽',
- JANCODE__c = '04953170200312',
- Dealer_special_Object__c = true,
- Manual_Entry__c = false
- );
- insert new List<Product2>{ prod01, prod02 };
- Product2__c pro1 = new Product2__c(Name = 'Pro001', OT_CODE_Text__c = '2344', Product2__c = prod01.Id);
- Product2__c pro2 = new Product2__c(Name = 'Pro002', OT_CODE_Text__c = '82324', Product2__c = prod02.Id);
- insert new List<Product2__c>{ pro1, pro2 };
+ system.runAs(MyUser_Test){
+ Product2 prod01 = new Product2(Name='Test01',ProductCode='Test01',Asset_Model_No__c = 'Test01',SFDA_Status__c = '鏈夊姽',JANCODE__c = '04953170200311',Dealer_special_Object__c = true,Manual_Entry__c = false);
+ Product2 prod02 = new Product2(Name='Test02',ProductCode='Test02',Asset_Model_No__c = 'Test02',SFDA_Status__c = '鏈夊姽',JANCODE__c = '04953170200312',Dealer_special_Object__c = true,Manual_Entry__c = false);
+ insert new Product2[] {prod01,prod02};
+ Product2__c pro1 = new Product2__c(Name='Pro001',OT_CODE_Text__c='2344',Product2__c = prod01.Id);
+ Product2__c pro2 = new Product2__c(Name='Pro002',OT_CODE_Text__c='82324',Product2__c = prod02.Id);
+ insert new Product2__c[] {pro1, pro2};
//浜у搧娉ㄥ唽璇�
- Product_Register__c prc = new Product_Register__c(
- Name = '鍥芥娉ㄨ繘20162220210',
- MedPrdClass__c = '3',
- ValidFrom__c = date.newinstance(2018, 7, 22),
- ValidTo__c = date.newinstance(2028, 7, 22),
- RegisterNoClass_Old__c = '6815',
- RegisterNoClass_New__c = '6815',
- RegisterNoStatus__c = '鏈夋晥'
- );
+ Product_Register__c prc = new Product_Register__c(Name = '鍥芥娉ㄨ繘20162220210',
+ MedPrdClass__c = '3',
+ ValidFrom__c = date.newinstance(2018, 07, 22),
+ ValidTo__c = date.newinstance(2028, 07, 22),
+ RegisterNoClass_Old__c = '6815',
+ RegisterNoClass_New__c = '6815',
+ RegisterNoStatus__c = '鏈夋晥'
+ );
insert prc;
//鏂版棫鍏崇郴瀵圭収琛�
//Product_Register_contrast__c prcc = new Product_Register_contrast__c(
@@ -2146,10 +1712,16 @@
// );
//insert prcc;
//浜у搧-浜у搧娉ㄥ唽璇佸叧绯� prod01
- Product_Register_Link__c prlc = new Product_Register_Link__c(Product2__c = prod01.Id, Product_Register__c = prc.Id);
+ Product_Register_Link__c prlc = new Product_Register_Link__c(
+ Product2__c = prod01.Id,
+ Product_Register__c = prc.Id
+ );
insert prlc;
//浜у搧-浜у搧娉ㄥ唽璇佸叧绯� prod02
- Product_Register_Link__c prlc2 = new Product_Register_Link__c(Product2__c = prod02.Id, Product_Register__c = prc.Id);
+ Product_Register_Link__c prlc2 = new Product_Register_Link__c(
+ Product2__c = prod02.Id,
+ Product_Register__c = prc.Id
+ );
insert prlc2;
PageReference page = new PageReference('/apex/ArriveGoods?ArrType=ReG');
System.Test.setCurrentPage(page);
@@ -2157,13 +1729,13 @@
ArriveGoodsController Controller = new ArriveGoodsController();
//List<Product2> proList = [select name,Estimation_Entry_Possibility__c from Product2 where id = :prod01.Id];
//System.assertEquals('鈼�', proList[0].Estimation_Entry_Possibility__c);
- List<Product2__c> product2InStore = [
- SELECT Id, Name, Name__c, Intra_Trade_List_RMB__c, Asset_Model_No__c, OT_CODE__c
- FROM Product2__c
- WHERE Estimation_Entry_Possibility__c = '鈼�' AND Pro2_Dealer_Object__c = TRUE AND OT_CODE__c = 'test'
- ];
+ List<Product2__c> product2InStore = [SELECT Id, Name,Name__c,Intra_Trade_List_RMB__c,Asset_Model_No__c,OT_CODE__c
+ FROM Product2__c
+ WHERE Estimation_Entry_Possibility__c = '鈼�'
+ AND Pro2_Dealer_Object__c = true
+ AND OT_CODE__c ='test' ];
//System.assertEquals(1, product2InStore.size());
- list<String> list1 = new List<String>();
+ list<String> list1 = new list<String>();
list1.clear();
list1.add(Controller.barcode = '2413456250BBBBA');
Controller.inventoryEntryNoESetId(list1);
@@ -2242,6 +1814,7 @@
list1.add(Controller.barcode = '241test111204121778900034567890250BBBBQ');
Controller.inventoryEntryNoESetId(list1);
+
list1.clear();
list1.add(Controller.barcode = '0111234101204120118901231712a4001234250BBBBR');
Controller.inventoryEntryNoESetId(list1);
@@ -2261,81 +1834,42 @@
list1.clear();
list1.add(Controller.barcode = '011123410120412017120100250AAAAA');
Controller.inventoryEntryNoESetId(list1);
+
}
}
//鑷姩鍑哄簱
@isTest
- static void addSaleOrderAuto() {
+ static void addSaleOrderAuto() {
// // TO DO: implement unit test
- List<RecordType> rectCo = [
- SELECT Id
- FROM RecordType
- WHERE IsActive = TRUE AND SobjectType = 'Account' AND Name = '璨╁2搴�'
- ];
+ List<RecordType> rectCo = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '璨╁2搴�'];
if (rectCo.size() == 0) {
return;
}
// Profile prof = [select Id from Profile where Name ='901_缁忛攢鍟嗙ぞ鍖烘櫘閫氭潈闄恄2閲嶉獙璇�(ET Email)'];
- Profile prof = [
- SELECT Id
- FROM Profile
- WHERE Name = '901_缁忛攢鍟嗙ぞ鍖烘櫘閫氭潈闄恄2閲嶉獙璇�(ET)'
- ];
+ Profile prof = [select Id from Profile where Name ='901_缁忛攢鍟嗙ぞ鍖烘櫘閫氭潈闄恄2閲嶉獙璇�(ET)'];
- Account myAccount2 = new Account(
- name = 'Testaccount002',
- Dealer_discount__c = 20,
- RecordTypeId = rectCo[0].Id,
- AgentCode_Ext__c = '9999900'
- );
- Account myAccount1 = new Account(name = 'Testaccount001', Dealer_discount__c = 30, RecordTypeId = rectCo[0].Id);
- insert new List<account>{ myAccount1, myAccount2 };
- Contact core = new Contact(email = 'jplumber@salesforce.com', firstname = 'Joe', lastname = 'Plumber', accountid = myAccount1.id);
+ Account myAccount2 = new Account(name='Testaccount002',Dealer_discount__c =20,RecordTypeId = rectCo[0].Id,AgentCode_Ext__c = '9999900');
+ Account myAccount1 = new Account(name='Testaccount001',Dealer_discount__c =30,RecordTypeId = rectCo[0].Id);
+ insert new account[]{myAccount1,myAccount2};
+
+ Contact core = new Contact(email='jplumber@salesforce.com', firstname='Joe',lastname='Plumber',accountid=myAccount1.id);
insert core;
- user MyUser_Test = new User(
- ContactId = core.id,
- Alias = 'newUser',
- Email = 'newuser@testorg.com',
- EmailEncodingKey = 'UTF-8',
- LastName = 'TestUser',
- LanguageLocaleKey = 'zh_CN',
- LocaleSidKey = 'zh_CN',
- ProfileId = prof.Id,
- TimeZoneSidKey = 'Asia/Shanghai',
- UserName = 'testUser@testorg.com',
- UserPro_Type__c = 'ET'
- );
- System.runAs(new User(Id = UserInfo.getUserId())) {
+ user MyUser_Test = New User(ContactId = core.id,Alias = 'newUser',Email='newuser@testorg.com',EmailEncodingKey='UTF-8', LastName='TestUser', LanguageLocaleKey='zh_CN',LocaleSidKey='zh_CN', ProfileId = prof.Id,TimeZoneSidKey='Asia/Shanghai', UserName='testUser@testorg.com',UserPro_Type__c = 'ET');
+System.runAs(new User(Id = UserInfo.getUserId())){
insert MyUser_Test;
}
// User MyUser_Test = [select id,Contact.accountid from User WHERE ProfileId = :prof.Id and IsActive = true and UserPro_Type__c = 'ET' limit 1 ];
// Product2 prod01 = new Product2(Name='Test01',ProductCode='Test01',Asset_Model_No__c = 'Test01',SFDA_Status__c = '鏈夊姽',JANCODE__c = '04953170200311',Dealer_special_Object__c = true,Manual_Entry__c = false);
// Product2 prod02 = new Product2(Name='Test02',ProductCode='Test02',Asset_Model_No__c = 'Test02',SFDA_Status__c = '鏈夊姽',JANCODE__c = '04953170200312',Dealer_special_Object__c = true,Manual_Entry__c = false);
// insert new Product2[] {prod01,prod02};
- System.runAs(MyUser_Test) {
- Product2 prod01 = new Product2(
- Name = 'Test01',
- ProductCode = 'Test01',
- Asset_Model_No__c = 'Test01',
- SFDA_Status__c = '鏈夊姽',
- JANCODE__c = '04953170200311',
- Dealer_special_Object__c = true,
- Manual_Entry__c = false
- );
- Product2 prod02 = new Product2(
- Name = 'Test02',
- ProductCode = 'Test02',
- Asset_Model_No__c = 'Test02',
- SFDA_Status__c = '鏈夊姽',
- JANCODE__c = '04953170200312',
- Dealer_special_Object__c = true,
- Manual_Entry__c = false
- );
- insert new List<Product2>{ prod01, prod02 };
- Product2__c pro1 = new Product2__c(Name = 'Pro001', OT_CODE_Text__c = 'Test001', Product2__c = prod01.Id);
- insert new List<Product2__c>{ pro1 };
+ system.runAs(MyUser_Test){
+ Product2 prod01 = new Product2(Name='Test01',ProductCode='Test01',Asset_Model_No__c = 'Test01',SFDA_Status__c = '鏈夊姽',JANCODE__c = '04953170200311',Dealer_special_Object__c = true,Manual_Entry__c = false);
+ Product2 prod02 = new Product2(Name='Test02',ProductCode='Test02',Asset_Model_No__c = 'Test02',SFDA_Status__c = '鏈夊姽',JANCODE__c = '04953170200312',Dealer_special_Object__c = true,Manual_Entry__c = false);
+ insert new Product2[] {prod01,prod02};
+ Product2__c pro1 = new Product2__c(Name='Pro001',OT_CODE_Text__c='Test001',Product2__c = prod01.Id);
+ insert new Product2__c[] {pro1};
// Account myAccount1 = new Account(name='Testaccount001',Dealer_discount__c =30,RecordTypeId = rectCo[0].Id);
// insert myAccount1;
Consumable_order__c Order2 = new Consumable_order__c();
@@ -2376,77 +1910,37 @@
// UPDATE TCM TEST1
@isTest
- static void methodTest1() {
+ static void methodTest1() {
// // TO DO: implement unit test
- List<RecordType> rectCo = [
- SELECT Id
- FROM RecordType
- WHERE IsActive = TRUE AND SobjectType = 'Account' AND Name = '璨╁2搴�'
- ];
+ List<RecordType> rectCo = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '璨╁2搴�'];
if (rectCo.size() == 0) {
return;
}
// Profile prof = [select Id from Profile where Name ='901_缁忛攢鍟嗙ぞ鍖烘櫘閫氭潈闄恄2閲嶉獙璇�(ET Email)'];
- Profile prof = [
- SELECT Id
- FROM Profile
- WHERE Name = '901_缁忛攢鍟嗙ぞ鍖烘櫘閫氭潈闄恄2閲嶉獙璇�(ET)'
- ];
+ Profile prof = [select Id from Profile where Name ='901_缁忛攢鍟嗙ぞ鍖烘櫘閫氭潈闄恄2閲嶉獙璇�(ET)'];
- Account myAccount2 = new Account(
- name = 'Testaccount002',
- Dealer_discount__c = 20,
- RecordTypeId = rectCo[0].Id,
- AgentCode_Ext__c = '9999900'
- );
- Account myAccount1 = new Account(name = 'Testaccount001', Dealer_discount__c = 30, RecordTypeId = rectCo[0].Id);
- insert new List<account>{ myAccount1, myAccount2 };
- Contact core = new Contact(email = 'jplumber@salesforce.com', firstname = 'Joe', lastname = 'Plumber', accountid = myAccount1.id);
+ Account myAccount2 = new Account(name='Testaccount002',Dealer_discount__c =20,RecordTypeId = rectCo[0].Id,AgentCode_Ext__c = '9999900');
+ Account myAccount1 = new Account(name='Testaccount001',Dealer_discount__c =30,RecordTypeId = rectCo[0].Id);
+ insert new account[]{myAccount1,myAccount2};
+
+ Contact core = new Contact(email='jplumber@salesforce.com', firstname='Joe',lastname='Plumber',accountid=myAccount1.id);
insert core;
- user MyUser_Test = new User(
- ContactId = core.id,
- Alias = 'newUser',
- Email = 'newuser@testorg.com',
- EmailEncodingKey = 'UTF-8',
- LastName = 'TestUser',
- LanguageLocaleKey = 'zh_CN',
- LocaleSidKey = 'zh_CN',
- ProfileId = prof.Id,
- TimeZoneSidKey = 'Asia/Shanghai',
- UserName = 'testUser@testorg.com',
- UserPro_Type__c = 'ET'
- );
- System.runAs(new User(Id = UserInfo.getUserId())) {
+ user MyUser_Test = New User(ContactId = core.id,Alias = 'newUser',Email='newuser@testorg.com',EmailEncodingKey='UTF-8', LastName='TestUser', LanguageLocaleKey='zh_CN',LocaleSidKey='zh_CN', ProfileId = prof.Id,TimeZoneSidKey='Asia/Shanghai', UserName='testUser@testorg.com',UserPro_Type__c = 'ET');
+System.runAs(new User(Id = UserInfo.getUserId())){
insert MyUser_Test;
}
// User MyUser_Test = [select id,Contact.accountid from User WHERE ProfileId = :prof.Id and IsActive = true and UserPro_Type__c = 'ET' limit 1 ];
// Product2 prod01 = new Product2(Name='Test01',ProductCode='Test01',Asset_Model_No__c = 'Test01',SFDA_Status__c = '鏈夊姽',JANCODE__c = '04953170200311',Dealer_special_Object__c = true,Manual_Entry__c = false);
// Product2 prod02 = new Product2(Name='Test02',ProductCode='Test02',Asset_Model_No__c = 'Test02',SFDA_Status__c = '鏈夊姽',JANCODE__c = '04953170200312',Dealer_special_Object__c = true,Manual_Entry__c = false);
// insert new Product2[] {prod01,prod02};
- System.runAs(MyUser_Test) {
- Product2 prod01 = new Product2(
- Name = 'Test01',
- ProductCode = 'Test01',
- Asset_Model_No__c = 'Test01',
- SFDA_Status__c = '鏈夊姽',
- JANCODE__c = '04953170200311',
- Dealer_special_Object__c = true,
- Manual_Entry__c = false
- );
- Product2 prod02 = new Product2(
- Name = 'Test02',
- ProductCode = 'Test02',
- Asset_Model_No__c = 'Test02',
- SFDA_Status__c = '鏈夊姽',
- JANCODE__c = '04953170200312',
- Dealer_special_Object__c = true,
- Manual_Entry__c = false
- );
- insert new List<Product2>{ prod01, prod02 };
- Product2__c pro1 = new Product2__c(Name = 'Pro001', OT_CODE_Text__c = 'N3047730', Product2__c = prod01.Id);
- Product2__c pro2 = new Product2__c(Name = 'Pro002', OT_CODE_Text__c = 'N3047731', Product2__c = prod02.Id);
- insert new List<Product2__c>{ pro1, pro2 };
+ system.runAs(MyUser_Test){
+ Product2 prod01 = new Product2(Name='Test01',ProductCode='Test01',Asset_Model_No__c = 'Test01',SFDA_Status__c = '鏈夊姽',JANCODE__c = '04953170200311',Dealer_special_Object__c = true,Manual_Entry__c = false);
+ Product2 prod02 = new Product2(Name='Test02',ProductCode='Test02',Asset_Model_No__c = 'Test02',SFDA_Status__c = '鏈夊姽',JANCODE__c = '04953170200312',Dealer_special_Object__c = true,Manual_Entry__c = false);
+ insert new Product2[] {prod01,prod02};
+ Product2__c pro1 = new Product2__c(Name='Pro001',OT_CODE_Text__c='N3047730',Product2__c = prod01.Id);
+ Product2__c pro2 = new Product2__c(Name='Pro002',OT_CODE_Text__c='N3047731',Product2__c = prod02.Id);
+ insert new Product2__c[] {pro1, pro2};
//璁㈠崟
Consumable_order__c Order1 = new Consumable_order__c();
@@ -2477,7 +1971,7 @@
Orderdet1.Asset_Model_No__c = 'Test01';
Orderdet1.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
Orderdet1.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJRF';
- Orderdet1.Arrive_date__c = Date.today();
+ Orderdet1.Arrive_date__c=Date.today();
// Orderdet1.Send_Date__c=Date.today();
// Orderdet1.Used_date__c=Date.today();
Orderdet1.TracingCode__c = 'BXJRF';
@@ -2492,7 +1986,7 @@
Orderdet2.Asset_Model_No__c = 'Test01';
Orderdet2.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
Orderdet2.Bar_Code__c = '01049531702003111115120017181234105ZK250BXJRF';
- Orderdet2.Arrive_date__c = Date.today();
+ Orderdet2.Arrive_date__c=Date.today();
Orderdet2.TracingCode__c = 'BXJRF';
Orderdet2.SerialLotNo__c = '5ZK';
insert Orderdet2;
@@ -2508,88 +2002,46 @@
// System.assertEquals(1, Controller.ConsumableorderdetailsRecords.size());
// System.assertEquals(2, Controller.consumableInventory.size());
Controller.ArriveGoodsConfim();
- List<Consumable_order_details2__c> ins = [
- SELECT Id, Name
- FROM Consumable_order_details2__c
- ];
+ List<Consumable_order_details2__c> ins = [SELECT Id,Name FROM Consumable_order_details2__c];
// System.assertEquals(3, ins.size());
System.Test.stopTest();
}
}
+
//杩斿搧
@isTest
- static void methodTest2() {
+ static void methodTest2() {
// // TO DO: implement unit test
- List<RecordType> rectCo = [
- SELECT Id
- FROM RecordType
- WHERE IsActive = TRUE AND SobjectType = 'Account' AND Name = '璨╁2搴�'
- ];
+ List<RecordType> rectCo = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '璨╁2搴�'];
if (rectCo.size() == 0) {
return;
}
// Profile prof = [select Id from Profile where Name ='901_缁忛攢鍟嗙ぞ鍖烘櫘閫氭潈闄恄2閲嶉獙璇�(ET Email)'];
- Profile prof = [
- SELECT Id
- FROM Profile
- WHERE Name = '901_缁忛攢鍟嗙ぞ鍖烘櫘閫氭潈闄恄2閲嶉獙璇�(ET)'
- ];
+ Profile prof = [select Id from Profile where Name ='901_缁忛攢鍟嗙ぞ鍖烘櫘閫氭潈闄恄2閲嶉獙璇�(ET)'];
- Account myAccount2 = new Account(
- name = 'Testaccount002',
- Dealer_discount__c = 20,
- RecordTypeId = rectCo[0].Id,
- AgentCode_Ext__c = '9999900'
- );
- Account myAccount1 = new Account(name = 'Testaccount001', Dealer_discount__c = 30, RecordTypeId = rectCo[0].Id);
- insert new List<account>{ myAccount1, myAccount2 };
- Contact core = new Contact(email = 'jplumber@salesforce.com', firstname = 'Joe', lastname = 'Plumber', accountid = myAccount1.id);
+ Account myAccount2 = new Account(name='Testaccount002',Dealer_discount__c =20,RecordTypeId = rectCo[0].Id,AgentCode_Ext__c = '9999900');
+ Account myAccount1 = new Account(name='Testaccount001',Dealer_discount__c =30,RecordTypeId = rectCo[0].Id);
+ insert new account[]{myAccount1,myAccount2};
+
+ Contact core = new Contact(email='jplumber@salesforce.com', firstname='Joe',lastname='Plumber',accountid=myAccount1.id);
insert core;
- user MyUser_Test = new User(
- ContactId = core.id,
- Alias = 'newUser',
- Email = 'newuser@testorg.com',
- EmailEncodingKey = 'UTF-8',
- LastName = 'TestUser',
- LanguageLocaleKey = 'zh_CN',
- LocaleSidKey = 'zh_CN',
- ProfileId = prof.Id,
- TimeZoneSidKey = 'Asia/Shanghai',
- UserName = 'testUser@testorg.com',
- UserPro_Type__c = 'ET'
- );
- System.runAs(new User(Id = UserInfo.getUserId())) {
+ user MyUser_Test = New User(ContactId = core.id,Alias = 'newUser',Email='newuser@testorg.com',EmailEncodingKey='UTF-8', LastName='TestUser', LanguageLocaleKey='zh_CN',LocaleSidKey='zh_CN', ProfileId = prof.Id,TimeZoneSidKey='Asia/Shanghai', UserName='testUser@testorg.com',UserPro_Type__c = 'ET');
+System.runAs(new User(Id = UserInfo.getUserId())){
insert MyUser_Test;
}
// User MyUser_Test = [select id,Contact.accountid from User WHERE ProfileId = :prof.Id and IsActive = true and UserPro_Type__c = 'ET' limit 1 ];
// Product2 prod01 = new Product2(Name='Test01',ProductCode='Test01',Asset_Model_No__c = 'Test01',SFDA_Status__c = '鏈夊姽',JANCODE__c = '04953170200311',Dealer_special_Object__c = true,Manual_Entry__c = false);
// Product2 prod02 = new Product2(Name='Test02',ProductCode='Test02',Asset_Model_No__c = 'Test02',SFDA_Status__c = '鏈夊姽',JANCODE__c = '04953170200312',Dealer_special_Object__c = true,Manual_Entry__c = false);
// insert new Product2[] {prod01,prod02};
- System.runAs(MyUser_Test) {
- Product2 prod01 = new Product2(
- Name = 'Test01',
- ProductCode = 'Test01',
- Asset_Model_No__c = 'Test01',
- SFDA_Status__c = '鏈夊姽',
- JANCODE__c = '04953170200311',
- Dealer_special_Object__c = true,
- Manual_Entry__c = false
- );
- Product2 prod02 = new Product2(
- Name = 'Test02',
- ProductCode = 'Test02',
- Asset_Model_No__c = 'Test02',
- SFDA_Status__c = '鏈夊姽',
- JANCODE__c = '04953170200312',
- Dealer_special_Object__c = true,
- Manual_Entry__c = false
- );
- insert new List<Product2>{ prod01, prod02 };
- Product2__c pro1 = new Product2__c(Name = 'Pro001', OT_CODE_Text__c = 'Test001', Product2__c = prod01.Id);
- Product2__c pro2 = new Product2__c(Name = 'Pro002', OT_CODE_Text__c = 'Test002', Product2__c = prod02.Id);
- insert new List<Product2__c>{ pro1, pro2 };
+ system.runAs(MyUser_Test){
+ Product2 prod01 = new Product2(Name='Test01',ProductCode='Test01',Asset_Model_No__c = 'Test01',SFDA_Status__c = '鏈夊姽',JANCODE__c = '04953170200311',Dealer_special_Object__c = true,Manual_Entry__c = false);
+ Product2 prod02 = new Product2(Name='Test02',ProductCode='Test02',Asset_Model_No__c = 'Test02',SFDA_Status__c = '鏈夊姽',JANCODE__c = '04953170200312',Dealer_special_Object__c = true,Manual_Entry__c = false);
+ insert new Product2[] {prod01,prod02};
+ Product2__c pro1 = new Product2__c(Name='Pro001',OT_CODE_Text__c='Test001',Product2__c = prod01.Id);
+ Product2__c pro2 = new Product2__c(Name='Pro002',OT_CODE_Text__c='Test002',Product2__c = prod02.Id);
+ insert new Product2__c[] {pro1, pro2};
//璁㈠崟
Consumable_order__c Order1 = new Consumable_order__c();
Order1.Name = 'OCM_01_001';
@@ -2615,27 +2067,27 @@
//鍙戣揣鏄庣粏
//fahuo
Consumable_order_details2__c Orderdet1 = new Consumable_order_details2__c();
- Orderdet1.Name = 'OCM_01_001001';
- Orderdet1.Consumable_order_minor__c = Order1.Id;
- Orderdet1.Consumable_Product__c = pro1.Id;
- Orderdet1.Asset_Model_No__c = 'Pro001';
- Orderdet1.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
- Orderdet1.Box_Piece__c = '鐩�';
- Orderdet1.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJRF';
- //daohuo
- Consumable_order_details2__c Orderdet2 = new Consumable_order_details2__c();
- Orderdet2.Name = 'OCM_01_001002';
- Orderdet2.Consumable_order_minor__c = Order1.Id;
- Orderdet2.Consumable_Product__c = pro1.Id;
- Orderdet2.Asset_Model_No__c = 'Pro001';
- Orderdet2.Consumable_Arrived_order__c = Order1.Id;
- //Orderdet2.IsArrival__c = true;
- Orderdet2.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
- Orderdet2.Box_Piece__c = '鐩�';
- Orderdet2.Arrive_date__c = Date.today();
- //Orderdet2.Send_Date__c = Date.today();
- //Orderdet2.Used_date__c= Date.today();
- Orderdet2.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJRF';
+ Orderdet1.Name = 'OCM_01_001001';
+ Orderdet1.Consumable_order_minor__c = Order1.Id;
+ Orderdet1.Consumable_Product__c = pro1.Id;
+ Orderdet1.Asset_Model_No__c = 'Pro001';
+ Orderdet1.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
+ Orderdet1.Box_Piece__c ='鐩�';
+ Orderdet1.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJRF';
+ //daohuo
+ Consumable_order_details2__c Orderdet2 = new Consumable_order_details2__c();
+ Orderdet2.Name = 'OCM_01_001002';
+ Orderdet2.Consumable_order_minor__c = Order1.Id;
+ Orderdet2.Consumable_Product__c = pro1.Id;
+ Orderdet2.Asset_Model_No__c = 'Pro001';
+ Orderdet2.Consumable_Arrived_order__c = Order1.Id;
+ //Orderdet2.IsArrival__c = true;
+ Orderdet2.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
+ Orderdet2.Box_Piece__c ='鐩�';
+ Orderdet2.Arrive_date__c = Date.today();
+ //Orderdet2.Send_Date__c = Date.today();
+ //Orderdet2.Used_date__c= Date.today();
+ Orderdet2.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJRF';
//sale
Consumable_order_details2__c Orderdet3 = new Consumable_order_details2__c();
Orderdet3.Name = 'OCM_01_001003';
@@ -2645,8 +2097,8 @@
Orderdet3.Consumable_Arrived_order__c = Order1.Id;
//Orderdet3.IsArrival__c = true;
Orderdet3.Consumable_Sale_order__c = Order1.Id;
- Orderdet3.Box_Piece__c = '鐩�';
- Orderdet3.Used_date__c = Date.today();
+ Orderdet3.Box_Piece__c ='鐩�';
+ Orderdet3.Used_date__c= Date.today();
Orderdet3.Arrive_date__c = Date.today();
Orderdet3.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
Orderdet3.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJRF';
@@ -2661,7 +2113,7 @@
Orderdet4.Consumable_Arrived_order__c = Order1.Id;
//Orderdet4.IsArrival__c = true;
Orderdet4.Consumable_Shipment_order__c = Order1.Id;
- Orderdet4.Box_Piece__c = '涓�';
+ Orderdet4.Box_Piece__c ='涓�';
Orderdet4.Send_Date__c = Date.today();
Orderdet4.Arrive_date__c = Date.today();
Orderdet4.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
@@ -2678,10 +2130,10 @@
Orderdet5.Cancellation_Flag__c = true;
Orderdet5.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
Orderdet5.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJRZ';
- Orderdet5.Box_Piece__c = '涓�';
+ Orderdet5.Box_Piece__c ='涓�';
Orderdet5.TracingCode__c = 'BXJRZ';
Orderdet5.SerialLotNo__c = '5ZK';
- insert new List<Consumable_order_details2__c>{ Orderdet1, Orderdet3, Orderdet4, Orderdet5 };
+ insert new Consumable_order_details2__c[] {Orderdet1,Orderdet3,Orderdet4,Orderdet5};
PageReference page = new PageReference('/apex/ArriveGoods?ArrType=ReG');
System.Test.setCurrentPage(page);
@@ -2694,12 +2146,12 @@
Controller.SearchPro();
System.assertEquals(1, controller.ConsumableorderdetailsRecordserror.size());
// System.assertEquals(2, controller.ShowGoodsofReturnList.size());
- controller.ShowGoodsofReturnList[0].esd.Return_reason__c = '澶氬彂';
+ controller.ShowGoodsofReturnList[0].esd.Return_reason__c='澶氬彂';
// controller.ShowGoodsofReturnList[1].esd.Return_reason__c='澶氬彂';
// controller.ShowGoodsofReturnList[0].esd.Rrturn_count__c =1;
Controller.UpdateGoodsOfReturn();
- list<String> list1 = new List<String>();
+ list<String> list1 = new list<String>();
list1.add(Controller.barcode = '01234567898');
Controller.inventoryEntryNoESetId(list1);
@@ -2762,53 +2214,29 @@
list1.add(Controller.barcode = '0112345678901231106789012105625001234');
Controller.inventoryEntryNoESetId(list1);
System.Test.stopTest();
+
}
}
//鏁翠綋鍒拌揣
@isTest
- static void ArrivejancodeTest() {
+ static void ArrivejancodeTest() {
// // TO DO: implement unit test
- List<RecordType> rectCo = [
- SELECT Id
- FROM RecordType
- WHERE IsActive = TRUE AND SobjectType = 'Account' AND Name = '璨╁2搴�'
- ];
+ List<RecordType> rectCo = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '璨╁2搴�'];
if (rectCo.size() == 0) {
return;
}
// Profile prof = [select Id from Profile where Name ='901_缁忛攢鍟嗙ぞ鍖烘櫘閫氭潈闄恄2閲嶉獙璇�(ET Email)'];
- Profile prof = [
- SELECT Id
- FROM Profile
- WHERE Name = '901_缁忛攢鍟嗙ぞ鍖烘櫘閫氭潈闄恄2閲嶉獙璇�(ET)'
- ];
+ Profile prof = [select Id from Profile where Name ='901_缁忛攢鍟嗙ぞ鍖烘櫘閫氭潈闄恄2閲嶉獙璇�(ET)'];
Oly_TriggerHandler.bypass('ConsumableAssetHander');
- Account myAccount2 = new Account(
- name = 'Testaccount002',
- Dealer_discount__c = 20,
- RecordTypeId = rectCo[0].Id,
- AgentCode_Ext__c = '9999900'
- );
- Account myAccount1 = new Account(name = 'Testaccount001', Dealer_discount__c = 30, RecordTypeId = rectCo[0].Id);
- insert new List<account>{ myAccount1, myAccount2 };
- Contact core = new Contact(email = 'jplumber@salesforce.com', firstname = 'Joe', lastname = 'Plumber', accountid = myAccount1.id);
+ Account myAccount2 = new Account(name='Testaccount002',Dealer_discount__c =20,RecordTypeId = rectCo[0].Id,AgentCode_Ext__c = '9999900');
+ Account myAccount1 = new Account(name='Testaccount001',Dealer_discount__c =30,RecordTypeId = rectCo[0].Id);
+ insert new account[]{myAccount1,myAccount2};
+ Contact core = new Contact(email='jplumber@salesforce.com', firstname='Joe',lastname='Plumber',accountid=myAccount1.id);
insert core;
- user MyUser_Test = new User(
- ContactId = core.id,
- Alias = 'newUser',
- Email = 'newuser@testorg.com',
- EmailEncodingKey = 'UTF-8',
- LastName = 'TestUser',
- LanguageLocaleKey = 'zh_CN',
- LocaleSidKey = 'zh_CN',
- ProfileId = prof.Id,
- TimeZoneSidKey = 'Asia/Shanghai',
- UserName = 'testUser@testorg.com',
- UserPro_Type__c = 'ET'
- );
- System.runAs(new User(Id = UserInfo.getUserId())) {
+ user MyUser_Test = New User(ContactId = core.id,Alias = 'newUser',Email='newuser@testorg.com',EmailEncodingKey='UTF-8', LastName='TestUser', LanguageLocaleKey='zh_CN',LocaleSidKey='zh_CN', ProfileId = prof.Id,TimeZoneSidKey='Asia/Shanghai', UserName='testUser@testorg.com',UserPro_Type__c = 'ET');
+ System.runAs(new User(Id = UserInfo.getUserId())){
insert MyUser_Test;
}
@@ -2816,28 +2244,12 @@
// Product2 prod01 = new Product2(Name='Test01',ProductCode='Test01',Asset_Model_No__c = 'Test01',SFDA_Status__c = '鏈夊姽',JANCODE__c = '04953170200311',Dealer_special_Object__c = true,Manual_Entry__c = false);
// Product2 prod02 = new Product2(Name='Test02',ProductCode='Test02',Asset_Model_No__c = 'Test02',SFDA_Status__c = '鏈夊姽',JANCODE__c = '04953170200312',Dealer_special_Object__c = true,Manual_Entry__c = false);
// insert new Product2[] {prod01,prod02};
- System.runAs(MyUser_Test) {
- Product2 prod01 = new Product2(
- Name = 'Test01',
- ProductCode = 'Test01',
- Asset_Model_No__c = 'Test01',
- SFDA_Status__c = '鏈夊姽',
- JANCODE__c = '04953170200311',
- Dealer_special_Object__c = true,
- Manual_Entry__c = false
- );
- Product2 prod02 = new Product2(
- Name = 'Test02',
- ProductCode = 'Test02',
- Asset_Model_No__c = 'Test02',
- SFDA_Status__c = '鏈夊姽',
- JANCODE__c = '04953170200312',
- Dealer_special_Object__c = true,
- Manual_Entry__c = false
- );
- insert new List<Product2>{ prod01, prod02 };
- Product2__c pro1 = new Product2__c(Name = 'Pro001', OT_CODE_Text__c = 'Test001', Product2__c = prod01.Id);
- insert new List<Product2__c>{ pro1 };
+ system.runAs(MyUser_Test){
+ Product2 prod01 = new Product2(Name='Test01',ProductCode='Test01',Asset_Model_No__c = 'Test01',SFDA_Status__c = '鏈夊姽',JANCODE__c = '04953170200311',Dealer_special_Object__c = true,Manual_Entry__c = false);
+ Product2 prod02 = new Product2(Name='Test02',ProductCode='Test02',Asset_Model_No__c = 'Test02',SFDA_Status__c = '鏈夊姽',JANCODE__c = '04953170200312',Dealer_special_Object__c = true,Manual_Entry__c = false);
+ insert new Product2[] {prod01,prod02};
+ Product2__c pro1 = new Product2__c(Name='Pro001',OT_CODE_Text__c='Test001',Product2__c = prod01.Id);
+ insert new Product2__c[] {pro1};
// Account myAccount1 = new Account(name='Testaccount001',Dealer_discount__c =30,RecordTypeId = rectCo[0].Id);
// insert myAccount1;
Consumable_order__c Order2 = new Consumable_order__c();
@@ -2919,6 +2331,7 @@
Orderdet3.SerialLotNo__c = '5ZK';
//Orderdet3.Box_Piece__c = '涓�';
+
//鍑哄簱浜у搧
Consumable_order_details2__c Orderdet4 = new Consumable_order_details2__c();
Orderdet4.Name = 'OCM_01_001005';
@@ -2927,7 +2340,7 @@
Orderdet4.Asset_Model_No__c = 'Test01';
Orderdet4.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
Orderdet4.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJRD';
- Orderdet4.Send_Date__c = Date.today();
+ Orderdet4.Send_Date__c = Date.today();
Orderdet4.Arrive_date__c = Date.today();
Orderdet4.Box_Piece__c = '鐩�';
Orderdet4.TracingCode__c = 'BXJRD';
@@ -2945,11 +2358,13 @@
Orderdet5.Consumable_Shipment_order__c = Order1.Id;
Orderdet5.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
Orderdet5.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJRE';
- Orderdet5.Arrive_date__c = Date.today();
+ Orderdet5.Arrive_date__c = Date.today();
Orderdet5.Box_Piece__c = '鐩�';
Orderdet5.TracingCode__c = 'BXJRE';
Orderdet5.SerialLotNo__c = '5ZK';
- insert new List<Consumable_order_details2__c>{ Orderdet1, Orderdet2, Orderdet3, Orderdet4, Orderdet5 };
+ insert new Consumable_order_details2__c[] {Orderdet1, Orderdet2,Orderdet3,Orderdet4,Orderdet5};
+
+
ArriveGoodsController Controller = new ArriveGoodsController();
PageReference page = new PageReference('/apex/ArriveGoods?ArrType=Arr');
@@ -2964,53 +2379,30 @@
System.assertEquals('OCM_01_001002', controller.ConsumableorderdetailsRecords[0].esd.Name);
// System.assertEquals(2, controller.ConsumableorderdetailsRecordserror.size());
System.Test.stopTest();
+
+
}
}
//鍙戦敊璐� 鍏ュ簱
@isTest
- static void ArriveotheragencyTest() {
+ static void ArriveotheragencyTest() {
// // TO DO: implement unit test
- List<RecordType> rectCo = [
- SELECT Id
- FROM RecordType
- WHERE IsActive = TRUE AND SobjectType = 'Account' AND Name = '璨╁2搴�'
- ];
+ List<RecordType> rectCo = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '璨╁2搴�'];
if (rectCo.size() == 0) {
return;
}
// Profile prof = [select Id from Profile where Name ='901_缁忛攢鍟嗙ぞ鍖烘櫘閫氭潈闄恄2閲嶉獙璇�(ET Email)'];
- Profile prof = [
- SELECT Id
- FROM Profile
- WHERE Name = '901_缁忛攢鍟嗙ぞ鍖烘櫘閫氭潈闄恄2閲嶉獙璇�(ET)'
- ];
+ Profile prof = [select Id from Profile where Name ='901_缁忛攢鍟嗙ぞ鍖烘櫘閫氭潈闄恄2閲嶉獙璇�(ET)'];
Oly_TriggerHandler.bypass('ConsumableAssetHander');
- Account myAccount2 = new Account(
- name = 'Testaccount002',
- Dealer_discount__c = 20,
- RecordTypeId = rectCo[0].Id,
- AgentCode_Ext__c = '9999900'
- );
- Account myAccount1 = new Account(name = 'Testaccount001', Dealer_discount__c = 30, RecordTypeId = rectCo[0].Id);
- insert new List<account>{ myAccount1, myAccount2 };
- Contact core = new Contact(email = 'jplumber@salesforce.com', firstname = 'Joe', lastname = 'Plumber', accountid = myAccount1.id);
+ Account myAccount2 = new Account(name='Testaccount002',Dealer_discount__c =20,RecordTypeId = rectCo[0].Id,AgentCode_Ext__c = '9999900');
+ Account myAccount1 = new Account(name='Testaccount001',Dealer_discount__c =30,RecordTypeId = rectCo[0].Id);
+ insert new account[]{myAccount1,myAccount2};
+ Contact core = new Contact(email='jplumber@salesforce.com', firstname='Joe',lastname='Plumber',accountid=myAccount1.id);
insert core;
- user MyUser_Test = new User(
- ContactId = core.id,
- Alias = 'newUser',
- Email = 'newuser@testorg.com',
- EmailEncodingKey = 'UTF-8',
- LastName = 'TestUser',
- LanguageLocaleKey = 'zh_CN',
- LocaleSidKey = 'zh_CN',
- ProfileId = prof.Id,
- TimeZoneSidKey = 'Asia/Shanghai',
- UserName = 'testUser@testorg.com',
- UserPro_Type__c = 'ET'
- );
- System.runAs(new User(Id = UserInfo.getUserId())) {
+ user MyUser_Test = New User(ContactId = core.id,Alias = 'newUser',Email='newuser@testorg.com',EmailEncodingKey='UTF-8', LastName='TestUser', LanguageLocaleKey='zh_CN',LocaleSidKey='zh_CN', ProfileId = prof.Id,TimeZoneSidKey='Asia/Shanghai', UserName='testUser@testorg.com',UserPro_Type__c = 'ET');
+ System.runAs(new User(Id = UserInfo.getUserId())){
insert MyUser_Test;
}
@@ -3018,29 +2410,13 @@
// Product2 prod01 = new Product2(Name='Test01',ProductCode='Test01',Asset_Model_No__c = 'Test01',SFDA_Status__c = '鏈夊姽',JANCODE__c = '04953170200311',Dealer_special_Object__c = true,Manual_Entry__c = false);
// Product2 prod02 = new Product2(Name='Test02',ProductCode='Test02',Asset_Model_No__c = 'Test02',SFDA_Status__c = '鏈夊姽',JANCODE__c = '04953170200312',Dealer_special_Object__c = true,Manual_Entry__c = false);
// insert new Product2[] {prod01,prod02};
- System.runAs(MyUser_Test) {
- Product2 prod01 = new Product2(
- Name = 'Test01',
- ProductCode = 'Test01',
- Asset_Model_No__c = 'Test01',
- SFDA_Status__c = '鏈夊姽',
- JANCODE__c = '04953170200311',
- Dealer_special_Object__c = true,
- Manual_Entry__c = false
- );
- Product2 prod02 = new Product2(
- Name = 'Test02',
- ProductCode = 'Test02',
- Asset_Model_No__c = 'Test02',
- SFDA_Status__c = '鏈夊姽',
- JANCODE__c = '04953170200312',
- Dealer_special_Object__c = true,
- Manual_Entry__c = false
- );
- insert new List<Product2>{ prod01, prod02 };
- Product2__c pro1 = new Product2__c(Name = 'Pro001', OT_CODE_Text__c = 'Test001', Product2__c = prod01.Id);
- insert new List<Product2__c>{ pro1 };
- Account myAccount3 = new Account(name = 'Testaccount003', Dealer_discount__c = 30, RecordTypeId = rectCo[0].Id);
+ system.runAs(MyUser_Test){
+ Product2 prod01 = new Product2(Name='Test01',ProductCode='Test01',Asset_Model_No__c = 'Test01',SFDA_Status__c = '鏈夊姽',JANCODE__c = '04953170200311',Dealer_special_Object__c = true,Manual_Entry__c = false);
+ Product2 prod02 = new Product2(Name='Test02',ProductCode='Test02',Asset_Model_No__c = 'Test02',SFDA_Status__c = '鏈夊姽',JANCODE__c = '04953170200312',Dealer_special_Object__c = true,Manual_Entry__c = false);
+ insert new Product2[] {prod01,prod02};
+ Product2__c pro1 = new Product2__c(Name='Pro001',OT_CODE_Text__c='Test001',Product2__c = prod01.Id);
+ insert new Product2__c[] {pro1};
+ Account myAccount3 = new Account(name='Testaccount003',Dealer_discount__c =30,RecordTypeId = rectCo[0].Id);
insert myAccount3;
Consumable_order__c Order2 = new Consumable_order__c();
Order2.Name = 'OCM_02_001';
@@ -3138,6 +2514,7 @@
// Orderdet3.SerialLotNo__c = '5ZK';
// //Orderdet3.Box_Piece__c = '涓�';
+
// //鍑哄簱浜у搧
// Consumable_order_details2__c Orderdet4 = new Consumable_order_details2__c();
// Orderdet4.Name = 'OCM_01_001005';
@@ -3170,6 +2547,8 @@
// Orderdet5.SerialLotNo__c = '5ZK';
// insert new Consumable_order_details2__c[] {Orderdet1, Orderdet2,Orderdet3,Orderdet4,Orderdet5};
+
+
ArriveGoodsController Controller = new ArriveGoodsController();
PageReference page = new PageReference('/apex/ArriveGoods?ArrType=Arr');
System.Test.setCurrentPage(page);
@@ -3183,53 +2562,31 @@
// System.assertEquals(2, controller.ConsumableorderdetailsRecordserror.size());
System.Test.stopTest();
+
+
}
}
//杩斿搧
@isTest
- static void addInventoryDetails1() {
+ static void addInventoryDetails1() {
// // TO DO: implement unit test
- List<RecordType> rectCo = [
- SELECT Id
- FROM RecordType
- WHERE IsActive = TRUE AND SobjectType = 'Account' AND Name = '璨╁2搴�'
- ];
+ List<RecordType> rectCo = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '璨╁2搴�'];
if (rectCo.size() == 0) {
return;
}
// Profile prof = [select Id from Profile where Name ='901_缁忛攢鍟嗙ぞ鍖烘櫘閫氭潈闄恄2閲嶉獙璇�(ET Email)'];
- Profile prof = [
- SELECT Id
- FROM Profile
- WHERE Name = '901_缁忛攢鍟嗙ぞ鍖烘櫘閫氭潈闄恄2閲嶉獙璇�(ET)'
- ];
+ Profile prof = [select Id from Profile where Name ='901_缁忛攢鍟嗙ぞ鍖烘櫘閫氭潈闄恄2閲嶉獙璇�(ET)'];
- Account myAccount2 = new Account(
- name = 'Testaccount002',
- Dealer_discount__c = 20,
- RecordTypeId = rectCo[0].Id,
- AgentCode_Ext__c = '9999900'
- );
- Account myAccount1 = new Account(name = 'Testaccount001', Dealer_discount__c = 30, RecordTypeId = rectCo[0].Id);
- insert new List<account>{ myAccount1, myAccount2 };
- Contact core = new Contact(email = 'jplumber@salesforce.com', firstname = 'Joe', lastname = 'Plumber', accountid = myAccount1.id);
+ Account myAccount2 = new Account(name='Testaccount002',Dealer_discount__c =20,RecordTypeId = rectCo[0].Id,AgentCode_Ext__c = '9999900');
+ Account myAccount1 = new Account(name='Testaccount001',Dealer_discount__c =30,RecordTypeId = rectCo[0].Id);
+ insert new account[]{myAccount1,myAccount2};
+
+ Contact core = new Contact(email='jplumber@salesforce.com', firstname='Joe',lastname='Plumber',accountid=myAccount1.id);
insert core;
- user MyUser_Test = new User(
- ContactId = core.id,
- Alias = 'newUser',
- Email = 'newuser@testorg.com',
- EmailEncodingKey = 'UTF-8',
- LastName = 'TestUser',
- LanguageLocaleKey = 'zh_CN',
- LocaleSidKey = 'zh_CN',
- ProfileId = prof.Id,
- TimeZoneSidKey = 'Asia/Shanghai',
- UserName = 'testUser@testorg.com',
- UserPro_Type__c = 'ET'
- );
- System.runAs(new User(Id = UserInfo.getUserId())) {
+ user MyUser_Test = New User(ContactId = core.id,Alias = 'newUser',Email='newuser@testorg.com',EmailEncodingKey='UTF-8', LastName='TestUser', LanguageLocaleKey='zh_CN',LocaleSidKey='zh_CN', ProfileId = prof.Id,TimeZoneSidKey='Asia/Shanghai', UserName='testUser@testorg.com',UserPro_Type__c = 'ET');
+ System.runAs(new User(Id = UserInfo.getUserId())){
insert MyUser_Test;
}
@@ -3237,29 +2594,13 @@
// Product2 prod01 = new Product2(Name='Test01',ProductCode='Test01',Asset_Model_No__c = 'Test01',SFDA_Status__c = '鏈夊姽',JANCODE__c = '04953170200311',Dealer_special_Object__c = true,Manual_Entry__c = false);
// Product2 prod02 = new Product2(Name='Test02',ProductCode='Test02',Asset_Model_No__c = 'Test02',SFDA_Status__c = '鏈夊姽',JANCODE__c = '04953170200312',Dealer_special_Object__c = true,Manual_Entry__c = false);
// insert new Product2[] {prod01,prod02};
- System.runAs(MyUser_Test) {
- Product2 prod01 = new Product2(
- Name = 'Test01',
- ProductCode = 'Test01',
- Asset_Model_No__c = 'Test01',
- SFDA_Status__c = '鏈夊姽',
- JANCODE__c = '04953170200311',
- Dealer_special_Object__c = true,
- Manual_Entry__c = false
- );
- Product2 prod02 = new Product2(
- Name = 'Test02',
- ProductCode = 'Test02',
- Asset_Model_No__c = 'Test02',
- SFDA_Status__c = '鏈夊姽',
- JANCODE__c = '04953170200312',
- Dealer_special_Object__c = true,
- Manual_Entry__c = false
- );
- insert new List<Product2>{ prod01, prod02 };
- Product2__c pro1 = new Product2__c(Name = 'Pro001', OT_CODE_Text__c = 'Test001', Product2__c = prod01.Id);
- Product2__c pro2 = new Product2__c(Name = 'Pro002', OT_CODE_Text__c = 'Test002', Product2__c = prod02.Id);
- insert new List<Product2__c>{ pro1, pro2 };
+ system.runAs(MyUser_Test){
+ Product2 prod01 = new Product2(Name='Test01',ProductCode='Test01',Asset_Model_No__c = 'Test01',SFDA_Status__c = '鏈夊姽',JANCODE__c = '04953170200311',Dealer_special_Object__c = true,Manual_Entry__c = false);
+ Product2 prod02 = new Product2(Name='Test02',ProductCode='Test02',Asset_Model_No__c = 'Test02',SFDA_Status__c = '鏈夊姽',JANCODE__c = '04953170200312',Dealer_special_Object__c = true,Manual_Entry__c = false);
+ insert new Product2[] {prod01,prod02};
+ Product2__c pro1 = new Product2__c(Name='Pro001',OT_CODE_Text__c='Test001',Product2__c = prod01.Id);
+ Product2__c pro2 = new Product2__c(Name='Pro002',OT_CODE_Text__c='Test002',Product2__c = prod02.Id);
+ insert new Product2__c[] {pro1, pro2};
//璁㈠崟
Oly_TriggerHandler.bypass('ConsumableAssetHander');
Consumable_order__c Order1 = new Consumable_order__c();
@@ -3325,7 +2666,7 @@
Orderdet3.Consumable_Sale_order__c = Order1.Id;
Orderdet3.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
Orderdet3.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJRJ';
- Orderdet3.Box_Piece__c = '鐩�';
+ Orderdet3.Box_Piece__c ='鐩�';
Orderdet3.TracingCode__c = 'BXJRF';
//鍑哄簱
Consumable_order_details2__c Orderdet4 = new Consumable_order_details2__c();
@@ -3340,7 +2681,7 @@
Orderdet4.Consumable_Shipment_order__c = Order1.Id;
Orderdet4.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
Orderdet4.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJRN';
- Orderdet4.Box_Piece__c = '涓�';
+ Orderdet4.Box_Piece__c ='涓�';
Orderdet4.TracingCode__c = 'BXJRF';
//quxiao
Consumable_order_details2__c Orderdet5 = new Consumable_order_details2__c();
@@ -3351,7 +2692,7 @@
Orderdet5.Cancellation_Date__c = Date.today();
Orderdet5.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
Orderdet5.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJRZ';
- Orderdet5.Box_Piece__c = '鐩�';
+ Orderdet5.Box_Piece__c ='鐩�';
Orderdet5.TracingCode__c = 'BXJRF';
//fanpin
Consumable_order_details2__c Orderdet6 = new Consumable_order_details2__c();
@@ -3362,7 +2703,7 @@
Orderdet6.Consumable_Return_order__c = Order2.Id;
Orderdet6.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
Orderdet6.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJRA';
- Orderdet6.Box_Piece__c = '涓�';
+ Orderdet6.Box_Piece__c ='涓�';
Orderdet6.TracingCode__c = 'BXJRF';
// 涓㈠け
@@ -3376,10 +2717,10 @@
Orderdet7.Arrive_date__c = Date.today();
Orderdet7.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
Orderdet7.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJQT';
- Orderdet7.Box_Piece__c = '涓�';
+ Orderdet7.Box_Piece__c ='涓�';
Orderdet7.TracingCode__c = 'BXJQT';
- insert new List<Consumable_order_details2__c>{ Orderdet1, Orderdet2, Orderdet3, Orderdet4, Orderdet5, Orderdet6, Orderdet7 };
+ insert new Consumable_order_details2__c[] {Orderdet1, Orderdet2,Orderdet3,Orderdet4,Orderdet5,Orderdet6,Orderdet7};
PageReference page = new PageReference('/apex/ArriveGoods?ArrType=ReG');
System.Test.setCurrentPage(page);
ArriveGoodsController Controller = new ArriveGoodsController();
@@ -3397,100 +2738,60 @@
//System.assertEquals('OCM_01_001002', controller.ConsumableorderdetailsRecordserror[2].esd.Name);
//System.assertEquals('OCM_02_001001', controller.ConsumableorderdetailsRecordserror[3].esd.Name);
// Controller.GoodsReturnCheck();
- controller.ShowGoodsofReturnList[0].esd.Return_reason__c = '澶氬彂';
- controller.ShowGoodsofReturnList[0].esd.Rrturn_count__c = 1;
+ controller.ShowGoodsofReturnList[0].esd.Return_reason__c='澶氬彂';
+ controller.ShowGoodsofReturnList[0].esd.Rrturn_count__c =1;
//System.assertEquals(1, controller.ShowGoodsofReturnList.size());
Controller.UpdateGoodsOfReturn();
Controller.ToReturnGoodsPage();
Controller.geterrorsize();
System.Test.stopTest();
+
}
}
@isTest
- static void makeRecordsVieweTest() {
- Integer count = 1001;
+ static void makeRecordsVieweTest() {
+ Integer count = 1001;
List<ArriveGoodsController.ConsumableorderdetailsInfo> conList = new List<ArriveGoodsController.ConsumableorderdetailsInfo>();
- for (Integer i = 0; i < 1001; i++) {
+ for(Integer i = 0; i < 1001; i++){
conList.add(new ArriveGoodsController.ConsumableorderdetailsInfo());
}
ArriveGoodsController arr = new ArriveGoodsController();
arr.makeRecordsView(conList);
- ArriveGoodsController arr1 = new ArriveGoodsController('', '');
+ ArriveGoodsController arr1 = new ArriveGoodsController('','');
}
@isTest
- static void compareToTest() {
+ static void compareToTest() {
ArriveGoodsController.ConsumableorderdetailsInfo c1 = new ArriveGoodsController.ConsumableorderdetailsInfo();
ArriveGoodsController.ConsumableorderdetailsInfo c2 = new ArriveGoodsController.ConsumableorderdetailsInfo();
c1.compareTo(c2);
}
@isTest
- static void searchProTest1() {
- List<RecordType> rectCo = [
- SELECT Id
- FROM RecordType
- WHERE IsActive = TRUE AND SobjectType = 'Account' AND Name = '璨╁2搴�'
- ];
+ static void searchProTest1() {
+ List<RecordType> rectCo = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '璨╁2搴�'];
if (rectCo.size() == 0) {
return;
}
- Profile prof = [
- SELECT Id
- FROM Profile
- WHERE Name = '901_缁忛攢鍟嗙ぞ鍖烘櫘閫氭潈闄恄2閲嶉獙璇�(ET)'
- ];
- Account myAccount2 = new Account(
- name = 'Testaccount002',
- Dealer_discount__c = 20,
- RecordTypeId = rectCo[0].Id,
- AgentCode_Ext__c = '9999900'
- );
- Account myAccount1 = new Account(name = 'Testaccount001', Dealer_discount__c = 30, RecordTypeId = rectCo[0].Id);
- insert new List<account>{ myAccount1, myAccount2 };
- Contact core = new Contact(email = 'jplumber@salesforce.com', firstname = 'Joe', lastname = 'Plumber', accountid = myAccount1.id);
+ Profile prof = [select Id from Profile where Name ='901_缁忛攢鍟嗙ぞ鍖烘櫘閫氭潈闄恄2閲嶉獙璇�(ET)'];
+ Account myAccount2 = new Account(name='Testaccount002',Dealer_discount__c =20,RecordTypeId = rectCo[0].Id,AgentCode_Ext__c = '9999900');
+ Account myAccount1 = new Account(name='Testaccount001',Dealer_discount__c =30,RecordTypeId = rectCo[0].Id);
+ insert new account[]{myAccount1,myAccount2};
+ Contact core = new Contact(email='jplumber@salesforce.com', firstname='Joe',lastname='Plumber',accountid=myAccount1.id);
insert core;
- user MyUser_Test = new User(
- ContactId = core.id,
- Alias = 'newUser',
- Email = 'newuser@testorg.com',
- EmailEncodingKey = 'UTF-8',
- LastName = 'TestUser',
- LanguageLocaleKey = 'zh_CN',
- LocaleSidKey = 'zh_CN',
- ProfileId = prof.Id,
- TimeZoneSidKey = 'Asia/Shanghai',
- UserName = 'testUser@testorg.com',
- UserPro_Type__c = 'ET'
- );
- System.runAs(new User(Id = UserInfo.getUserId())) {
+ user MyUser_Test = New User(ContactId = core.id,Alias = 'newUser',Email='newuser@testorg.com',EmailEncodingKey='UTF-8', LastName='TestUser', LanguageLocaleKey='zh_CN',LocaleSidKey='zh_CN', ProfileId = prof.Id,TimeZoneSidKey='Asia/Shanghai', UserName='testUser@testorg.com',UserPro_Type__c = 'ET');
+ System.runAs(new User(Id = UserInfo.getUserId())){
insert MyUser_Test;
}
- System.runAs(MyUser_Test) {
- Product2 prod01 = new Product2(
- Name = 'Test01',
- ProductCode = 'Test01',
- Asset_Model_No__c = 'Test01',
- SFDA_Status__c = '鏈夊姽',
- JANCODE__c = '04953170200311',
- Dealer_special_Object__c = true,
- Manual_Entry__c = false
- );
- Product2 prod02 = new Product2(
- Name = 'Test02',
- ProductCode = 'Test02',
- Asset_Model_No__c = 'Test02',
- SFDA_Status__c = '鏈夊姽',
- JANCODE__c = '04953170200312',
- Dealer_special_Object__c = true,
- Manual_Entry__c = false
- );
- insert new List<Product2>{ prod01, prod02 };
- Product2__c pro1 = new Product2__c(Name = 'Pro001', OT_CODE_Text__c = 'N3047730', Product2__c = prod01.Id);
- Product2__c pro2 = new Product2__c(Name = 'Pro002', OT_CODE_Text__c = 'N3047731', Product2__c = prod02.Id);
- insert new List<Product2__c>{ pro1, pro2 };
+ System.runAs(MyUser_Test){
+ Product2 prod01 = new Product2(Name='Test01',ProductCode='Test01',Asset_Model_No__c = 'Test01',SFDA_Status__c = '鏈夊姽',JANCODE__c = '04953170200311',Dealer_special_Object__c = true,Manual_Entry__c = false);
+ Product2 prod02 = new Product2(Name='Test02',ProductCode='Test02',Asset_Model_No__c = 'Test02',SFDA_Status__c = '鏈夊姽',JANCODE__c = '04953170200312',Dealer_special_Object__c = true,Manual_Entry__c = false);
+ insert new Product2[] {prod01,prod02};
+ Product2__c pro1 = new Product2__c(Name='Pro001',OT_CODE_Text__c='N3047730',Product2__c = prod01.Id);
+ Product2__c pro2 = new Product2__c(Name='Pro002',OT_CODE_Text__c='N3047731',Product2__c = prod02.Id);
+ insert new Product2__c[] {pro1, pro2};
Consumable_order__c Order1 = new Consumable_order__c();
Order1.Name = 'OCM_01_001';
@@ -3518,7 +2819,7 @@
Orderdet1.TracingCode__c = 'BXJRF';
Orderdet1.SerialLotNo__c = '5ZK';
insert Orderdet1;
- System.debug('Orderdet1:' + Orderdet1);
+ System.debug('Orderdet1:'+Orderdet1);
Consumable_order_details2__c Orderdet2 = new Consumable_order_details2__c();
Orderdet2.Name = 'OCM_01_001001';
Orderdet2.Consumable_order_minor__c = Order1.Id;
@@ -3539,11 +2840,8 @@
Controller.barcode = '01049531702003111115120017181000105ZK250BXJRF';
Controller.SearchPro();
Controller.ArriveGoodsConfim();
- List<Consumable_order_details2__c> ins = [
- SELECT Id, Name
- FROM Consumable_order_details2__c
- ];
+ List<Consumable_order_details2__c> ins = [SELECT Id,Name FROM Consumable_order_details2__c];
System.Test.stopTest();
}
}
-}
+}
\ No newline at end of file
diff --git a/force-app/main/default/classes/ArriveGoodsControllerTestV2.cls b/force-app/main/default/classes/ArriveGoodsControllerTestV2.cls
index 01d3945..b5d3132 100644
--- a/force-app/main/default/classes/ArriveGoodsControllerTestV2.cls
+++ b/force-app/main/default/classes/ArriveGoodsControllerTestV2.cls
@@ -1,207 +1,163 @@
@isTest
public class ArriveGoodsControllerTestV2 {
- @isTest
- static void myUnitTest() {
- // // TO DO: implement unit test
- List<RecordType> rectCo = [
- SELECT Id
- FROM RecordType
- WHERE IsActive = TRUE AND SobjectType = 'Account' AND Name = '璨╁2搴�'
- ];
- if (rectCo.size() == 0) {
- return;
- }
- // Profile prof = [select Id from Profile where Name ='901_缁忛攢鍟嗙ぞ鍖烘櫘閫氭潈闄恄2閲嶉獙璇�(ET Email)'];
- Profile prof = [
- SELECT Id
- FROM Profile
- WHERE Name = '901_缁忛攢鍟嗙ぞ鍖烘櫘閫氭潈闄恄2閲嶉獙璇�(ET)'
- ];
+ @isTest
+ static void myUnitTest() {
+ // // TO DO: implement unit test
+ List<RecordType> rectCo = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '璨╁2搴�'];
+ if (rectCo.size() == 0) {
+ return;
+ }
+ // Profile prof = [select Id from Profile where Name ='901_缁忛攢鍟嗙ぞ鍖烘櫘閫氭潈闄恄2閲嶉獙璇�(ET Email)'];
+ Profile prof = [select Id from Profile where Name ='901_缁忛攢鍟嗙ぞ鍖烘櫘閫氭潈闄恄2閲嶉獙璇�(ET)'];
- Account myAccount2 = new Account(
- name = 'Testaccount002',
- Dealer_discount__c = 20,
- RecordTypeId = rectCo[0].Id,
- AgentCode_Ext__c = '9999900'
- );
- Account myAccount1 = new Account(name = 'Testaccount001', Dealer_discount__c = 30, RecordTypeId = rectCo[0].Id);
- insert new List<account>{ myAccount1, myAccount2 };
+ Account myAccount2 = new Account(name='Testaccount002',Dealer_discount__c =20,RecordTypeId = rectCo[0].Id,AgentCode_Ext__c = '9999900');
+ Account myAccount1 = new Account(name='Testaccount001',Dealer_discount__c =30,RecordTypeId = rectCo[0].Id);
+ insert new account[]{myAccount1,myAccount2};
- Contact core = new Contact(email = 'jplumber@salesforce.com', firstname = 'Joe', lastname = 'Plumber', accountid = myAccount1.id);
- insert core;
- user MyUser_Test = new User(
- ContactId = core.id,
- Alias = 'newUser',
- Email = 'newuser@testorg.com',
- EmailEncodingKey = 'UTF-8',
- LastName = 'TestUser',
- LanguageLocaleKey = 'zh_CN',
- LocaleSidKey = 'zh_CN',
- ProfileId = prof.Id,
- TimeZoneSidKey = 'Asia/Shanghai',
- UserName = 'testUser@testorg.com',
- UserPro_Type__c = 'ET'
- );
- System.runAs(new User(Id = UserInfo.getUserId())) {
+ Contact core = new Contact(email='jplumber@salesforce.com', firstname='Joe',lastname='Plumber',accountid=myAccount1.id);
+ insert core;
+ user MyUser_Test = New User(ContactId = core.id,Alias = 'newUser',Email='newuser@testorg.com',EmailEncodingKey='UTF-8', LastName='TestUser', LanguageLocaleKey='zh_CN',LocaleSidKey='zh_CN', ProfileId = prof.Id,TimeZoneSidKey='Asia/Shanghai', UserName='testUser@testorg.com',UserPro_Type__c = 'ET');
+ System.runAs(new User(Id = UserInfo.getUserId())){
insert MyUser_Test;
}
- // User MyUser_Test = [select id,Contact.accountid from User WHERE ProfileId = :prof.Id and IsActive = true and UserPro_Type__c = 'ET' limit 1 ];
- // Product2 prod01 = new Product2(Name='Test01',ProductCode='Test01',Asset_Model_No__c = 'Test01',SFDA_Status__c = '鏈夊姽',JANCODE__c = '04953170200311',Dealer_special_Object__c = true,Manual_Entry__c = false);
- // Product2 prod02 = new Product2(Name='Test02',ProductCode='Test02',Asset_Model_No__c = 'Test02',SFDA_Status__c = '鏈夊姽',JANCODE__c = '04953170200312',Dealer_special_Object__c = true,Manual_Entry__c = false);
- // insert new Product2[] {prod01,prod02};
- System.runAs(MyUser_Test) {
- Product2 prod01 = new Product2(
- Name = 'Test01',
- ProductCode = 'Test01',
- Asset_Model_No__c = 'Test01',
- SFDA_Status__c = '鏈夊姽',
- JANCODE__c = '04953170200311',
- Dealer_special_Object__c = true,
- Manual_Entry__c = false
- );
- Product2 prod02 = new Product2(
- Name = 'Test02',
- ProductCode = 'Test02',
- Asset_Model_No__c = 'Test02',
- SFDA_Status__c = '鏈夊姽',
- JANCODE__c = '04953170200312',
- Dealer_special_Object__c = true,
- Manual_Entry__c = false
- );
- insert new List<Product2>{ prod01, prod02 };
- Product2__c pro1 = new Product2__c(Name = 'Pro001', OT_CODE_Text__c = 'Test001', Product2__c = prod01.Id);
- Product2__c pro2 = new Product2__c(Name = 'Pro002', OT_CODE_Text__c = 'Test002', Product2__c = prod02.Id);
- insert new List<Product2__c>{ pro1, pro2 };
- //璁㈠崟
- Consumable_order__c Order1 = new Consumable_order__c();
- Order1.Name = 'OCM_01_001';
- Order1.Order_status__c = '鎵瑰噯';
- Order1.Order_type__c = '璁㈠崟';
- // Order1.Dealer_Info__c = myAccount1.id;
- Order1.Dealer_Info__c = myAccount1.id;
- Order1.RecordTypeid = System.Label.RT_ConOrder_Delivery;
- Order1.Total_num__c = 3;
- Order1.OrderNumber_arrived__c = 1;
- Order1.Delivery_detail_count__c = 1;
- Order1.Order_ProType__c = 'ET';
- insert Order1;
+ // User MyUser_Test = [select id,Contact.accountid from User WHERE ProfileId = :prof.Id and IsActive = true and UserPro_Type__c = 'ET' limit 1 ];
+ // Product2 prod01 = new Product2(Name='Test01',ProductCode='Test01',Asset_Model_No__c = 'Test01',SFDA_Status__c = '鏈夊姽',JANCODE__c = '04953170200311',Dealer_special_Object__c = true,Manual_Entry__c = false);
+ // Product2 prod02 = new Product2(Name='Test02',ProductCode='Test02',Asset_Model_No__c = 'Test02',SFDA_Status__c = '鏈夊姽',JANCODE__c = '04953170200312',Dealer_special_Object__c = true,Manual_Entry__c = false);
+ // insert new Product2[] {prod01,prod02};
+ system.runAs(MyUser_Test){
+ Product2 prod01 = new Product2(Name='Test01',ProductCode='Test01',Asset_Model_No__c = 'Test01',SFDA_Status__c = '鏈夊姽',JANCODE__c = '04953170200311',Dealer_special_Object__c = true,Manual_Entry__c = false);
+ Product2 prod02 = new Product2(Name='Test02',ProductCode='Test02',Asset_Model_No__c = 'Test02',SFDA_Status__c = '鏈夊姽',JANCODE__c = '04953170200312',Dealer_special_Object__c = true,Manual_Entry__c = false);
+ insert new Product2[] {prod01,prod02};
+ Product2__c pro1 = new Product2__c(Name='Pro001',OT_CODE_Text__c='Test001',Product2__c = prod01.Id);
+ Product2__c pro2 = new Product2__c(Name='Pro002',OT_CODE_Text__c='Test002',Product2__c = prod02.Id);
+ insert new Product2__c[] {pro1, pro2};
+ //璁㈠崟
+ Consumable_order__c Order1 = new Consumable_order__c();
+ Order1.Name = 'OCM_01_001';
+ Order1.Order_status__c = '鎵瑰噯';
+ Order1.Order_type__c = '璁㈠崟';
+ // Order1.Dealer_Info__c = myAccount1.id;
+ Order1.Dealer_Info__c = myAccount1.id;
+ Order1.RecordTypeid = System.Label.RT_ConOrder_Delivery;
+ Order1.Total_num__c = 3;
+ Order1.OrderNumber_arrived__c =1;
+ Order1.Delivery_detail_count__c=1;
+ Order1.Order_ProType__c = 'ET';
+ insert Order1;
- //璁㈠崟鏄庣粏
- //fahuo
- Consumable_orderdetails__c Orderdet = new Consumable_orderdetails__c();
- Orderdet.Name = 'OCM_01_00101';
- Orderdet.Consumable_order__c = Order1.Id;
- Orderdet.RecordTypeId = System.Label.RT_ConOrderDetail1_Order;
- Orderdet.Consumable_Product__c = pro1.Id;
- Orderdet.Consumable_count__c = 40;
- insert Orderdet;
+ //璁㈠崟鏄庣粏
+ //fahuo
+ Consumable_orderdetails__c Orderdet = new Consumable_orderdetails__c();
+ Orderdet.Name = 'OCM_01_00101';
+ Orderdet.Consumable_order__c = Order1.Id;
+ Orderdet.RecordTypeId = System.Label.RT_ConOrderDetail1_Order;
+ Orderdet.Consumable_Product__c = pro1.Id;
+ Orderdet.Consumable_count__c = 40;
+ insert Orderdet;
- //鍙戣揣鏄庣粏
- //鍒拌揣姝g‘淇℃伅
- Consumable_order_details2__c Orderdet1 = new Consumable_order_details2__c();
- Orderdet1.Name = 'OCM_01_001002';
- Orderdet1.Consumable_order_minor__c = Order1.Id;
- Orderdet1.Consumable_Product__c = pro1.Id;
- Orderdet1.Asset_Model_No__c = 'Test01';
- Orderdet1.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
- Orderdet1.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJRA';
- Orderdet1.TracingCode__c = 'BXJRA';
+ //鍙戣揣鏄庣粏
+ //鍒拌揣姝g‘淇℃伅
+ Consumable_order_details2__c Orderdet1 = new Consumable_order_details2__c();
+ Orderdet1.Name = 'OCM_01_001002';
+ Orderdet1.Consumable_order_minor__c = Order1.Id;
+ Orderdet1.Consumable_Product__c = pro1.Id;
+ Orderdet1.Asset_Model_No__c = 'Test01';
+ Orderdet1.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
+ Orderdet1.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJRA';
+ Orderdet1.TracingCode__c = 'BXJRA';
- //鍙栨秷浜у搧
- Consumable_order_details2__c Orderdet2 = new Consumable_order_details2__c();
- Orderdet2.Name = 'OCM_01_001003';
- Orderdet2.Consumable_order_minor__c = Order1.Id;
- Orderdet2.Consumable_Product__c = pro1.Id;
- Orderdet2.Asset_Model_No__c = 'Test01';
- //Orderdet2.Consumable_Arrived_order__c = Order1.Id;
- Orderdet2.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
- Orderdet2.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJRB';
- Orderdet2.Cancellation_Date__c = Date.today();
- Orderdet2.TracingCode__c = 'BXJRB';
- //閿�鍞骇鍝�
- Consumable_order_details2__c Orderdet3 = new Consumable_order_details2__c();
- Orderdet3.Name = 'OCM_01_001004';
- Orderdet3.Consumable_order_minor__c = Order1.Id;
- Orderdet3.Consumable_Product__c = pro1.Id;
- Orderdet3.Asset_Model_No__c = 'Test01';
- Orderdet3.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
- Orderdet3.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJRC';
- Orderdet3.Used_date__c = Date.today();
- Orderdet3.Arrive_date__c = Date.today();
- Orderdet3.TracingCode__c = 'BXJRC';
- //Orderdet3.Box_Piece__c = '鐩�';
+ //鍙栨秷浜у搧
+ Consumable_order_details2__c Orderdet2 = new Consumable_order_details2__c();
+ Orderdet2.Name = 'OCM_01_001003';
+ Orderdet2.Consumable_order_minor__c = Order1.Id;
+ Orderdet2.Consumable_Product__c = pro1.Id;
+ Orderdet2.Asset_Model_No__c = 'Test01';
+ //Orderdet2.Consumable_Arrived_order__c = Order1.Id;
+ Orderdet2.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
+ Orderdet2.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJRB';
+ Orderdet2.Cancellation_Date__c= Date.today();
+ Orderdet2.TracingCode__c = 'BXJRB';
+ //閿�鍞骇鍝�
+ Consumable_order_details2__c Orderdet3 = new Consumable_order_details2__c();
+ Orderdet3.Name = 'OCM_01_001004';
+ Orderdet3.Consumable_order_minor__c = Order1.Id;
+ Orderdet3.Consumable_Product__c = pro1.Id;
+ Orderdet3.Asset_Model_No__c = 'Test01';
+ Orderdet3.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
+ Orderdet3.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJRC';
+ Orderdet3.Used_date__c = Date.today();
+ Orderdet3.Arrive_date__c = Date.today();
+ Orderdet3.TracingCode__c = 'BXJRC';
+ //Orderdet3.Box_Piece__c = '鐩�';
- //鍑哄簱浜у搧
- Consumable_order_details2__c Orderdet4 = new Consumable_order_details2__c();
- Orderdet4.Name = 'OCM_01_001005';
- Orderdet4.Consumable_order_minor__c = Order1.Id;
- Orderdet4.Consumable_Product__c = pro1.Id;
- Orderdet4.Asset_Model_No__c = 'Test01';
- Orderdet4.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
- Orderdet4.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJRD';
- Orderdet4.Send_Date__c = Date.today();
- Orderdet4.Arrive_date__c = Date.today();
- Orderdet4.TracingCode__c = 'BXJRD';
- //宸插埌璐т骇鍝�
- Consumable_order_details2__c Orderdet5 = new Consumable_order_details2__c();
- Orderdet5.Name = 'OCM_01_001006';
- Orderdet5.Consumable_order_minor__c = Order1.Id;
- Orderdet5.Consumable_Product__c = pro1.Id;
- Orderdet5.Asset_Model_No__c = 'Test01';
- Orderdet5.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
- Orderdet5.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJRE';
- Orderdet5.Arrive_date__c = Date.today();
- Orderdet5.TracingCode__c = 'BXJRE';
+ //鍑哄簱浜у搧
+ Consumable_order_details2__c Orderdet4 = new Consumable_order_details2__c();
+ Orderdet4.Name = 'OCM_01_001005';
+ Orderdet4.Consumable_order_minor__c = Order1.Id;
+ Orderdet4.Consumable_Product__c = pro1.Id;
+ Orderdet4.Asset_Model_No__c = 'Test01';
+ Orderdet4.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
+ Orderdet4.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJRD';
+ Orderdet4.Send_Date__c = Date.today();
+ Orderdet4.Arrive_date__c = Date.today();
+ Orderdet4.TracingCode__c = 'BXJRD';
- //鍙戣揣鏄庣粏
- //绠$悊缂栫爜鍖呭惈鏁板瓧
- Consumable_order_details2__c Orderdet6 = new Consumable_order_details2__c();
- Orderdet6.Name = 'OCM_01_001002';
- Orderdet6.Consumable_order_minor__c = Order1.Id;
- Orderdet6.Consumable_Product__c = pro1.Id;
- Orderdet6.Asset_Model_No__c = 'Test01';
- Orderdet6.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
- Orderdet6.Bar_Code__c = '01049531702003111115120017181000105ZK250BX123';
- Orderdet6.TracingCode__c = 'BX123';
+ //宸插埌璐т骇鍝�
+ Consumable_order_details2__c Orderdet5 = new Consumable_order_details2__c();
+ Orderdet5.Name = 'OCM_01_001006';
+ Orderdet5.Consumable_order_minor__c = Order1.Id;
+ Orderdet5.Consumable_Product__c = pro1.Id;
+ Orderdet5.Asset_Model_No__c = 'Test01';
+ Orderdet5.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
+ Orderdet5.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJRE';
+ Orderdet5.Arrive_date__c = Date.today();
+ Orderdet5.TracingCode__c = 'BXJRE';
- //鍙戦敊搴� 鏈埌璐�
- Consumable_order_details2__c Orderdets8 = new Consumable_order_details2__c();
- Orderdets8.Name = 'OCM_01_001011';
- Orderdets8.Consumable_order_minor__c = Order1.Id;
- Orderdets8.Consumable_Product__c = pro1.Id;
- Orderdets8.Asset_Model_No__c = 'Test01';
- Orderdets8.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
- Orderdets8.Bar_Code__c = '01049531702003111115120017181000105ZK250BXsys';
- Orderdets8.Box_Piece__c = '鐩�';
- Orderdets8.TracingCode__c = 'BXsys';
+ //鍙戣揣鏄庣粏
+ //绠$悊缂栫爜鍖呭惈鏁板瓧
+ Consumable_order_details2__c Orderdet6 = new Consumable_order_details2__c();
+ Orderdet6.Name = 'OCM_01_001002';
+ Orderdet6.Consumable_order_minor__c = Order1.Id;
+ Orderdet6.Consumable_Product__c = pro1.Id;
+ Orderdet6.Asset_Model_No__c = 'Test01';
+ Orderdet6.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
+ Orderdet6.Bar_Code__c = '01049531702003111115120017181000105ZK250BX123';
+ Orderdet6.TracingCode__c = 'BX123';
- insert new List<Consumable_order_details2__c>{ Orderdet1, Orderdet2, Orderdet3, Orderdet4, Orderdet5, Orderdet6, Orderdets8 };
+ //鍙戦敊搴� 鏈埌璐�
+ Consumable_order_details2__c Orderdets8 = new Consumable_order_details2__c();
+ Orderdets8.Name = 'OCM_01_001011';
+ Orderdets8.Consumable_order_minor__c = Order1.Id;
+ Orderdets8.Consumable_Product__c = pro1.Id;
+ Orderdets8.Asset_Model_No__c = 'Test01';
+ Orderdets8.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
+ Orderdets8.Bar_Code__c = '01049531702003111115120017181000105ZK250BXsys';
+ Orderdets8.Box_Piece__c = '鐩�';
+ Orderdets8.TracingCode__c = 'BXsys';
- List<Consumable_orderdetails__c> cod1 = [
- SELECT Id
- FROM Consumable_orderdetails__c
- WHERE Consumable_order__c = :Order1.Id
- ];
- System.assertEquals(1, cod1.size());
+ insert new Consumable_order_details2__c[] {Orderdet1, Orderdet2,Orderdet3,Orderdet4,Orderdet5,Orderdet6,Orderdets8};
- PageReference page = new PageReference('/apex/ArriveGoods?Esetid=' + Order1.Id);
+ List<Consumable_orderdetails__c> cod1 = [select Id from Consumable_orderdetails__c WHERE Consumable_order__c = :Order1.Id];
+ System.assertEquals(1, cod1.size());
- System.Test.setCurrentPage(page);
- ArriveGoodsController Controller = new ArriveGoodsController();
- //鍒濆鍖栨祴璇�
- System.Test.startTest();
- Controller.init();
- //鎺掑簭
- Controller.barcode = '';
- Controller.SearchPro();
- Controller.barcode = '01049531702003111115120017181000105ZK250BXJRA\n01049531702003111115120017181000105ZK250BXsys\n01049531702003111115120017181000105ZK250BXsun\n01049531702003111115120017181000105ZK250BXJRB\n01049531702003111115120017181000105ZK250BXJRC\n01049531702003111115120017181000105ZK250BX111\n01049531702003111115120017181000105ZK250BXJRD\n01049531702003111115120017181000105ZK250BXJRE\n01049531702003111115120017181000105ZK250BXJRF\n01049531702003111115120017181000105ZK250BXJRG\n01049531702003111115120017181000105ZK250BX123';
- Controller.SearchPro();
+ PageReference page = new PageReference('/apex/ArriveGoods?Esetid=' + Order1.Id);
- // System.assertEquals(3, controller.ConsumableorderdetailsRecordsdummy.size()); //tcm
- Controller.ArriveGoodsConfim();
- System.Test.stopTest();
- }
- }
-}
+ System.Test.setCurrentPage(page);
+ ArriveGoodsController Controller = new ArriveGoodsController();
+ //鍒濆鍖栨祴璇�
+ System.Test.startTest();
+ Controller.init();
+ //鎺掑簭
+ Controller.barcode = '';
+ Controller.SearchPro();
+ Controller.barcode = '01049531702003111115120017181000105ZK250BXJRA\n01049531702003111115120017181000105ZK250BXsys\n01049531702003111115120017181000105ZK250BXsun\n01049531702003111115120017181000105ZK250BXJRB\n01049531702003111115120017181000105ZK250BXJRC\n01049531702003111115120017181000105ZK250BX111\n01049531702003111115120017181000105ZK250BXJRD\n01049531702003111115120017181000105ZK250BXJRE\n01049531702003111115120017181000105ZK250BXJRF\n01049531702003111115120017181000105ZK250BXJRG\n01049531702003111115120017181000105ZK250BX123';
+ Controller.SearchPro();
+
+ // System.assertEquals(3, controller.ConsumableorderdetailsRecordsdummy.size()); //tcm
+ Controller.ArriveGoodsConfim();
+ System.Test.stopTest();
+ }
+ }
+}
\ No newline at end of file
diff --git a/force-app/main/default/classes/ArriveGoodsControllerTestV2.cls-meta.xml b/force-app/main/default/classes/ArriveGoodsControllerTestV2.cls-meta.xml
index 133fce1..7a51829 100644
--- a/force-app/main/default/classes/ArriveGoodsControllerTestV2.cls-meta.xml
+++ b/force-app/main/default/classes/ArriveGoodsControllerTestV2.cls-meta.xml
@@ -1,4 +1,4 @@
-<?xml version="1.0" encoding="UTF-8" ?>
+<?xml version="1.0" encoding="UTF-8"?>
<ApexClass xmlns="http://soap.sforce.com/2006/04/metadata">
<apiVersion>58.0</apiVersion>
<status>Active</status>
diff --git a/force-app/main/default/classes/Batch_FixAttachmentToFiles.cls b/force-app/main/default/classes/Batch_FixAttachmentToFiles.cls
index 1d917ed..ccb9821 100644
--- a/force-app/main/default/classes/Batch_FixAttachmentToFiles.cls
+++ b/force-app/main/default/classes/Batch_FixAttachmentToFiles.cls
@@ -1,9 +1,9 @@
-global without sharing class Batch_FixAttachmentToFiles implements Database.Batchable<sObject> {
+global without sharing class Batch_FixAttachmentToFiles implements Database.Batchable<sObject>{
// Id batchJobId = Database.executeBatch(new Batch_FixAttachmentToFiles('Consumable_order__c',Datetime.newInstance(2023, 1, 1, 8, 0, 0),Datetime.newInstance(2024, 1, 1, 8, 0, 0)),2000);
private Datetime creStartDate = null;
private Datetime creEndDate = null;
- private String objectApiName = null;
- private Set<String> parentIds = new Set<String>(); //Add by Li Jun 20230703
+ private String objectApiName = null;
+ private Set<String> parentIds = new Set<String>();//Add by Li Jun 20230703
public Batch_FixAttachmentToFiles(String objectType, Datetime startTime, Datetime endTime) {
creStartDate = startTime;
creEndDate = endTime;
@@ -13,10 +13,10 @@
public Batch_FixAttachmentToFiles(Set<String> parentIds) {
this.parentIds = parentIds;
}
- //Add by Li Jun 20230703 End
+ //Add by Li Jun 20230703 End
global Database.QueryLocator start(Database.BatchableContext BC) {
String queryObject = 'SELECT Id, Name, OwnerId, ParentId, Parent.Name, Parent.Type, Body, CreatedDate, CreatedById FROM Attachment WHERE Parent.Type =:objectApiName AND CreatedDate >=:creStartDate AND CreatedDate <:creEndDate Order by CreatedDate ASC';
- if (parentIds.size() > 0) {
+ if(parentIds.size() > 0){
queryObject = 'SELECT Id, Name, OwnerId, ParentId, Parent.Name, Parent.Type, Body, CreatedDate, CreatedById FROM Attachment WHERE ParentId in:parentIds';
}
return Database.getQueryLocator(queryObject);
@@ -24,73 +24,72 @@
global void execute(Database.BatchableContext BC, List<Attachment> scope) {
List<ContentVersion> insertContents = new List<ContentVersion>();
- Map<string, id> nameParentMaps = new Map<string, id>();
- Set<String> attachmentIds = new Set<String>();
+ Map<string,id> nameParentMaps = new Map<string,id>();
+ Set<String> attachmentIds = new Set<String>();
for (Attachment att : scope) {
- nameParentMaps.put(att.Name, att.ParentId);
- attachmentIds.add(att.Id);
+ nameParentMaps.put(att.Id, att.ParentId);
+ attachmentIds.add(att.Id);
ContentVersion cVersion = new ContentVersion();
- cVersion.ContentLocation = 'S'; //S-Document is in Salesforce. E-Document is outside of Salesforce. L-Document is on a Social Netork.
- cVersion.PathOnClient = att.Name; //File name with extention
- cVersion.Origin = 'C'; //C-Content Origin. H-Chatter Origin.
- cVersion.Title = att.Name; //Name of the file
- cVersion.VersionData = att.Body; //File content
- insertContents.add(cVersion);
+ cVersion.ContentLocation = 'S'; //S-Document is in Salesforce. E-Document is outside of Salesforce. L-Document is on a Social Netork.
+ cVersion.PathOnClient = att.Id; //File name with extention
+ cVersion.Origin = 'C'; //C-Content Origin. H-Chatter Origin.
+ cVersion.Title = att.Name; //Name of the file
+ cVersion.VersionData = att.Body; //File content
+ insertContents.add(cVersion);
}
- if (insertContents.isEmpty()) {
+ if(insertContents.isEmpty()){
return;
}
//Insert insertContents;
List<Database.SaveResult> saveResultsContents = Database.insert(insertContents, false);
- insertLog(saveResultsContents, attachmentIds);
- set<Id> contentIds = new Set<Id>();
- for (ContentVersion cv : insertContents) {
+ insertLog(saveResultsContents,attachmentIds);
+ set<Id> contentIds = new set<Id>();
+ for(ContentVersion cv : insertContents){
contentIds.add(cv.id);
}
- List<ContentVersion> conDocuments = [
- SELECT ContentDocumentId, Title
- FROM ContentVersion
- WHERE Id IN :contentIds
- ];
- List<ContentDocumentLink> insertDocLinks = new List<ContentDocumentLink>();
- for (ContentVersion cv : conDocuments) {
+ List<ContentVersion> conDocuments = [SELECT ContentDocumentId, Title,PathOnClient FROM ContentVersion WHERE Id in: contentIds];
+ List<ContentDocumentLink> insertDocLinks = new List<ContentDocumentLink>();
+ for(ContentVersion cv : conDocuments){
ContentDocumentLink cDocLink = new ContentDocumentLink();
- cDocLink.ContentDocumentId = cv.ContentDocumentId; //Add ContentDocumentId
- cDocLink.LinkedEntityId = nameParentMaps.get(cv.Title); //Add attachment parentId
- cDocLink.ShareType = 'V'; //V - Viewer permission. C - Collaborator permission. I - Inferred permission.
+ cDocLink.ContentDocumentId = cv.ContentDocumentId; //Add ContentDocumentId
+ cDocLink.LinkedEntityId = nameParentMaps.get(cv.PathOnClient); //Add attachment parentId
+ cDocLink.ShareType = 'V'; //V - Viewer permission. C - Collaborator permission. I - Inferred permission.
cDocLink.Visibility = 'AllUsers';
insertDocLinks.add(cDocLink);
}
//Insert insertDocLinks;
List<Database.SaveResult> saveResultsLinks = Database.insert(insertDocLinks, false);
- insertLog(saveResultsLinks, attachmentIds);
+ insertLog(saveResultsLinks,attachmentIds);
}
- global void insertLog(List<Database.SaveResult> saveResults, Set<String> attachmentIds) {
+ global void insertLog(List<Database.SaveResult> saveResults,Set<String> attachmentIds) {
Transaction_Log__c traLog = new Transaction_Log__c();
- List<Map<String, String>> logMapList = new List<Map<String, String>>();
+ List<Map<String,String>> logMapList = new List<Map<String,String>>();
for (Database.SaveResult result : saveResults) {
String recordId = result.getId();
if (!result.isSuccess()) {
for (Database.Error error : result.getErrors()) {
- Map<String, String> logMap = new Map<String, String>();
+ Map<String,String> logMap = new Map<String,String>();
String errorMsg = error.getMessage();
- logMap.put('recordId', recordId);
- logMap.put('errorMsg', errorMsg);
+ logMap.put('recordId',recordId);
+ logMap.put('errorMsg',errorMsg);
logMapList.add(logMap);
}
}
}
- if (logMapList.size() > 0) {
- Map<String, String> attachmentIdMap = new Map<String, String>();
- attachmentIdMap.put('attachmentIds', JSON.serialize(attachmentIds));
+ if(logMapList.size() > 0){
+ Map<String,String> attachmentIdMap = new Map<String,String>();
+ attachmentIdMap.put('attachmentIds',JSON.serialize(attachmentIds));
logMapList.add(attachmentIdMap);
traLog.Response__c = JSON.serialize(logMapList);
traLog.Module__c = 'Attachment COnvert Transaction ';
- insert traLog;
+ Insert traLog;
}
}
+
+
global void finish(Database.BatchableContext BC) {
+
}
-}
+}
\ No newline at end of file
diff --git a/force-app/main/default/classes/Batch_FixAttachmentToFiles.cls-meta.xml b/force-app/main/default/classes/Batch_FixAttachmentToFiles.cls-meta.xml
index a9fd6e9..754ecb1 100644
--- a/force-app/main/default/classes/Batch_FixAttachmentToFiles.cls-meta.xml
+++ b/force-app/main/default/classes/Batch_FixAttachmentToFiles.cls-meta.xml
@@ -1,4 +1,4 @@
-<?xml version="1.0" encoding="UTF-8" ?>
+<?xml version="1.0" encoding="UTF-8"?>
<ApexClass xmlns="http://soap.sforce.com/2006/04/metadata">
<apiVersion>57.0</apiVersion>
<status>Active</status>
diff --git a/force-app/main/default/classes/Batch_FixAttachmentToFilesTest.cls b/force-app/main/default/classes/Batch_FixAttachmentToFilesTest.cls
index 938de55..ce9a300 100644
--- a/force-app/main/default/classes/Batch_FixAttachmentToFilesTest.cls
+++ b/force-app/main/default/classes/Batch_FixAttachmentToFilesTest.cls
@@ -1,9 +1,10 @@
@isTest(SeeAllData=true)
private class Batch_FixAttachmentToFilesTest {
- @isTest(SeeAllData=true)
+
+ @isTest(SeeAllData=true)
static void testInit() {
String rectCo = Schema.SObjectType.Account.getRecordTypeInfosByDeveloperName().get('Agency').getRecordTypeId();
- Account accountItem1 = new Account(Name = 'Testaccount001', RecordTypeId = rectCo);
+ Account accountItem1 = new Account(Name='Testaccount001',RecordTypeId = rectCo);
insert accountItem1;
Consumable_order__c consOrder = new Consumable_order__c();
@@ -16,28 +17,26 @@
consOrder.Dealer_Info__c = accountItem1.Id;
consOrder.Delivery_detail_count__c = 5;
insert consOrder;
-
+
List<Attachment> attachList = new List<Attachment>();
Attachment attach = new Attachment();
- attach.Name = 'A-65224941-20200923--1.docx';
- Blob bodyBlob = Blob.valueOf('Unit Test Attachment Body');
+ attach.Name='A-65224941-20200923--1.docx';
+ Blob bodyBlob= Blob.valueOf('Unit Test Attachment Body');
attach.body = bodyBlob;
attach.ParentId = consOrder.Id;
attachList.add(attach);
insert attachList;
-
+
Set<String> Id = new Set<String>();
String objectType;
Datetime creStartDate;
Datetime creEndDate;
-
- List<Attachment> attachmentList = [
- SELECT Id, Name, OwnerId, ParentId, Parent.Name, Parent.Type, Body, CreatedDate, CreatedById
- FROM Attachment
- WHERE Id = :attachList[0].Id
- ORDER BY CreatedDate ASC
- LIMIT 1
- ];
+
+ List<Attachment> attachmentList = [Select Id, Name, OwnerId, ParentId, Parent.Name, Parent.Type, Body, CreatedDate, CreatedById
+ From Attachment
+ Where Id =:attachList[0].Id
+ Order by CreatedDate ASC
+ Limit 1];
for (Attachment att : attachmentList) {
Id.add(att.ParentId);
objectType = att.Parent.Name;
@@ -45,8 +44,8 @@
creEndDate = att.CreatedDate.addDays(1);
}
System.Test.startTest();
- Database.executeBatch(new Batch_FixAttachmentToFiles(objectType, creStartDate, creEndDate), 1);
- Database.executeBatch(new Batch_FixAttachmentToFiles(Id), 1);
- System.Test.stopTest();
- }
-}
+ Database.executeBatch(new Batch_FixAttachmentToFiles(objectType,creStartDate,creEndDate),1);
+ Database.executeBatch(new Batch_FixAttachmentToFiles(Id),1);
+ System.Test.stopTest();
+ }
+}
\ No newline at end of file
diff --git a/force-app/main/default/classes/Batch_FixAttachmentToFilesTest.cls-meta.xml b/force-app/main/default/classes/Batch_FixAttachmentToFilesTest.cls-meta.xml
index a9fd6e9..754ecb1 100644
--- a/force-app/main/default/classes/Batch_FixAttachmentToFilesTest.cls-meta.xml
+++ b/force-app/main/default/classes/Batch_FixAttachmentToFilesTest.cls-meta.xml
@@ -1,4 +1,4 @@
-<?xml version="1.0" encoding="UTF-8" ?>
+<?xml version="1.0" encoding="UTF-8"?>
<ApexClass xmlns="http://soap.sforce.com/2006/04/metadata">
<apiVersion>57.0</apiVersion>
<status>Active</status>
diff --git a/force-app/main/default/classes/DealerInquiryModifyStateController.cls b/force-app/main/default/classes/DealerInquiryModifyStateController.cls
index d46bcca..9e6c25c 100644
--- a/force-app/main/default/classes/DealerInquiryModifyStateController.cls
+++ b/force-app/main/default/classes/DealerInquiryModifyStateController.cls
@@ -1,23 +1,23 @@
public with sharing class DealerInquiryModifyStateController {
public List<OpportunityInfo> oppRecords { get; set; }
// 銉氥兗銈搞儸銈ゃ偄銈︺儓銇儏鍫便倰鍙栧緱
- private Map<String, Map<String, String>> editLayoutItemRWMap = new Map<String, Map<String, String>>();
+ private Map<String, Map<String, String>> editLayoutItemRWMap = New Map<String, Map<String, String>>();
// private Map<String, Map<String, String>> editLayoutItemRWMapRt = null;
public List<OpportunityInfo> OPPORTList { get; set; }
/*****************妞滅储鐢�******************/
/*******************妫�绱㈠睘鎬у��*******************/
- public String accSearch { get; set; } //缁忛攢鍟嗗尰闄�
- public String aooSearch { get; set; } //鎷呭綋浜�
+ public String accSearch { get; set; }//缁忛攢鍟嗗尰闄�
+ public String aooSearch { get; set; }//鎷呭綋浜�
public String numtext1 { get; set; } //鏁版嵁瀛楁01
- public String numtext { get; set; } //鏁版嵁瀛楁03
+ public String numtext { get; set; }//鏁版嵁瀛楁03
public String numtext2 { get; set; } //鏁版嵁瀛楁02
public String timetext1 { get; set; } //鏃ユ湡01
public String timetext2 { get; set; } //鏃ユ湡02
public Agency_Opportunity__c tmpAO { get; set; } //妫�绱㈡棩鏈熺敤
public Agency_Opportunity__c tmpBO { get; set; } //妫�绱㈡棩鏈熺敤
- public String limits { get; set; } //鏃ユ湡03
+ public String limits { get; set; }//鏃ユ湡03
public List<SelectOption> dateOpts { get; private set; }
public List<SelectOption> textOpts { get; private set; }
@@ -34,28 +34,27 @@
public String preSortKey { get; set; }
public Boolean sortOrderAsc { get; set; }
public String[] sortOrder { get; set; }
- public String[] columus = new List<String>{ 'Id' };
+ public String[] columus = new String[] {'Id'};
public String[] selColumus = null;
- public Set<String> columusSet = new Set<String>{ 'Id' };
+ public Set<String> columusSet = new Set<String> {'Id'};
// 椤圭洰set 瀛楁鏍囩
public List<String> titleLeft { get; private set; }
public List<String> titleRight { get; private set; }
// 椤圭洰set 瀛楁鍚�
- public List<List<String>> columnsLeftApi { get; private set; } // 鍙傜収闋呯洰鐢�
- public List<List<String>> columnsRightApi { get; private set; } // 鍙傜収闋呯洰鐢�
- public List<String> columnLeftCss { get; private set; } // css 鐢�
- public List<String> columnRightCss { get; private set; } // css 鐢�
- public Map<String, String> columnLeftRW { get; private set; } // r,w,wm鐢�
- public Map<String, String> columnRightRW { get; private set; } // r,w,wm鐢�
+ public List<List<String>> columnsLeftApi { get; private set; } // 鍙傜収闋呯洰鐢�
+ public List<List<String>> columnsRightApi { get; private set; } // 鍙傜収闋呯洰鐢�
+ public List<String> columnLeftCss { get; private set; } // css 鐢�
+ public List<String> columnRightCss { get; private set; } // css 鐢�
+ public Map<String, String> columnLeftRW { get; private set; } // r,w,wm鐢�
+ public Map<String, String> columnRightRW { get; private set; } // r,w,wm鐢�
private String strColumus;
private String strRtColumus;
//add by Link 2023-6-2
- public String remindMsg { get; set; }
+ public String remindMsg{get;set;}
- @TestVisible
- private String accTypeForSort = null;
+ @TestVisible private String accTypeForSort = null;
private static Integer oppLimit = 500;
public DealerInquiryModifyStateController() {
@@ -83,7 +82,7 @@
textOpts.add(new SelectOption('Oly_Inquiry_Stage__c', 'Oly璇环闃舵'));
//绮剧悽绉戞妧 zxk 2021-08-25 end
textOpts.add(new SelectOption('Hospital_City_Master__c', '甯�'));
-
+
// textOpts.add(new SelectOption('Agency_Hospital__r.Hospital__r.Salesdepartment_HP__c', '閿�鍞湰閮�'));
// textOpts.add(new SelectOption('Agency_Hospital__r.Hospital__r.State_Master__r.Name', '鐪�'));
// textOpts.add(new SelectOption('Agency_Hospital__r.Hospital__r.City_Master__r.Name', '甯�'));
@@ -160,7 +159,7 @@
layoutItem.layoutComponents.add(layoutComponent);
// return dlr;
} else {
- dlr = soap.describeLayout('Agency_Opportunity__c', null, null);
+ dlr = soap.describeLayout('Agency_Opportunity__c', null, null);
// dlr = soap.describeLayout('asdas', null, null);
}
@@ -178,11 +177,8 @@
for (PartnerSoapSforceCom.DescribeLayoutSection section : layout.editLayoutSections) {
for (PartnerSoapSforceCom.DescribeLayoutRow row : section.layoutRows) {
for (PartnerSoapSforceCom.DescribeLayoutItem item : row.layoutItems) {
- if (
- item.layoutComponents != null &&
- item.layoutComponents.size() > 0 &&
- String.isBlank(item.layoutComponents[0].value) == false
- ) {
+ if (item.layoutComponents != null && item.layoutComponents.size() > 0
+ && String.isBlank(item.layoutComponents[0].value) == false) {
rtnInner.put(item.layoutComponents[0].value, 'r');
if (item.editableForUpdate) {
rtnInner.put(item.layoutComponents[0].value, 'w');
@@ -203,10 +199,9 @@
return null;
}
//鐢ㄤ簬鑾峰彇缁忛攢鍟嗚浠峰瓧娈甸泦鍜岃浠峰瓧娈甸泦浠ュ強鐩稿簲鐨勮鍐欐潈闄�
- @TestVisible
- private void setLayoutRWInfo() {
+ @TestVisible private void setLayoutRWInfo() {
if (this.sortOrder == null) {
- selColumus = new List<String>{};
+ selColumus = new String[] {};
strColumus = '';
ID accRecordTypeId = accTypeForSort;
@@ -285,14 +280,14 @@
strRtColumus = strRtColumus + ',' + s;
}
columnRightCss.add(s.replace('.', '_'));
+
}
strColumus = String.join(columus, ',');
System.debug('======-======-======strColumus' + strColumus);
System.debug('======-======-======strRtColumus' + strRtColumus);
this.sortOrderAsc = true;
- this.sortOrder = new List<String>(selColumus.size());
- for (Integer i = 0; i < selColumus.size(); i++)
- this.sortOrder[i] = '銆�';
+ this.sortOrder = new String[selColumus.size()];
+ for (Integer i = 0; i < selColumus.size(); i++) this.sortOrder[i] = '銆�';
}
}
//鐢ㄤ簬鎷兼帴SOQL璇彞 鏍规嵁涓嶅悓妫�绱㈡潯浠舵嫾鎺ヤ笉鍚孲OQL璇彞銆�
@@ -314,17 +309,14 @@
// System.debug('pppqqq333'+querySoql);
// AND Ownerid in ( '+querySoql+')'
- String soql =
- 'SELECT Change_To_Opportunity__r.Id , Agency_Hospital__r.Name , Product_Category1__r.Name , Product_Category2__r.Name , Product_Category3__r.Name , Agency_Person__r.Name , Agency__r.Name , Change_To_Opportunity__r.Name ,' +
- strColumus +
- ',' +
- strRtColumus +
- ' FROM Agency_Opportunity__c WHERE recordType.DeveloperName = \'Opportunity\' ';
+ String soql = 'SELECT Change_To_Opportunity__r.Id , Agency_Hospital__r.Name , Product_Category1__r.Name , Product_Category2__r.Name , Product_Category3__r.Name , Agency_Person__r.Name , Agency__r.Name , Change_To_Opportunity__r.Name ,' +
+ strColumus + ',' + strRtColumus +
+ ' FROM Agency_Opportunity__c WHERE recordType.DeveloperName = \'Opportunity\' ';
//鏁版嵁瀛楁锛氱粡閿�鍟嗗尰闄� +SOQL
if (!String.isBlank(accSearch)) {
accSearch = accSearch.trim();
// soql += 'AND Agency__r.Name ' + ' LIKE \'%' + accSearch + '%\' ';
- soql += 'AND Agency_Hospital__r.Name ' + ' LIKE \'%' + accSearch + '%\' ';
+ soql += 'AND Agency_Hospital__r.Name ' + ' LIKE \'%' + accSearch + '%\' ';
}
//鏁版嵁瀛楁锛氭媴褰撲汉 +SOQL
if (!String.isBlank(aooSearch)) {
@@ -335,7 +327,7 @@
//鏁版嵁瀛楁锛�03 鎵嬪姩濉啓椤� 鍑嗗璋冪敤makeTextSql锛�
if (!String.isBlank(numtext)) {
String newNumtext = numtext.trim();
- String str = makeTextSql(numtext1, numtext2, newNumtext);
+ String str = makeTextSql(numtext1, numtext2, newNumtext);
soql += str;
System.debug('+++++++++++++=============++++++++++++++++++' + soql);
}
@@ -345,21 +337,9 @@
soql += ' order by LastModifiedDate desc limit ' + Integer.valueOf(limits);
} else {
if (Integer.valueOf(this.sortKey) <= titleLeft.size() + 7) {
- soql +=
- ' order by ' +
- this.selColumus[Integer.valueOf(this.sortKey)] +
- ' ' +
- (this.sortOrderAsc == true ? 'asc nulls first' : 'desc nulls last') +
- ' limit ' +
- Integer.valueOf(limits);
+ soql += ' order by ' + this.selColumus[Integer.valueOf(this.sortKey)] + ' ' + (this.sortOrderAsc == true ? 'asc nulls first' : 'desc nulls last') + ' limit ' + Integer.valueOf(limits);
} else {
- soql +=
- ' order by Change_To_Opportunity__r.' +
- this.selColumus[Integer.valueOf(this.sortKey)] +
- ' ' +
- (this.sortOrderAsc == true ? 'asc nulls first' : 'desc nulls last') +
- ' limit ' +
- Integer.valueOf(limits);
+ soql += ' order by Change_To_Opportunity__r.' + this.selColumus[Integer.valueOf(this.sortKey)] + ' ' + (this.sortOrderAsc == true ? 'asc nulls first' : 'desc nulls last') + ' limit ' + Integer.valueOf(limits);
}
}
system.debug(soql);
@@ -367,7 +347,7 @@
// System.debug('pppqqq111'+userlist1);
List<Agency_Opportunity__c> InfoList = Database.query(soql);
- System.debug('+++++++-------------------' + InfoList);
+ System.debug('+++++++-------------------'+InfoList);
// List<Agency_Opportunity__c> InfoList = ControllerUtil.DatabaseQuery(soql);
// System.debug('InfoList[0].Change_To_Opportunity_T__c'+InfoList[0].Change_To_Opportunity_T__c);
@@ -383,6 +363,7 @@
str = '\'' + agc.Change_To_Opportunity__r.Id + '\'';
} else if (agc.Change_To_Opportunity__r.Id != null) {
str += ',\'' + agc.Change_To_Opportunity__r.Id + '\'';
+
}
}
for (Agency_Opportunity__c info : InfoList) {
@@ -399,9 +380,7 @@
remindMsg = '鍙栧緱鏈�杩戠殑 ' + oppCount + ' 鏉℃暟鎹�';
} else if (!String.isBlank(this.sortKey)) {
if (oppCount > oppLimit) {
- ApexPages.addmessage(
- new ApexPages.message(ApexPages.severity.INFO, '鏁版嵁瓒呰繃' + oppLimit + '浠讹紝鍙樉绀哄墠' + oppLimit + '浠�')
- );
+ ApexPages.addmessage(new ApexPages.message(ApexPages.severity.INFO, '鏁版嵁瓒呰繃' + oppLimit + '浠讹紝鍙樉绀哄墠' + oppLimit + '浠�'));
//add by Link 2023-6-2
remindMsg = '鏁版嵁瓒呰繃' + oppLimit + '浠讹紝鍙樉绀哄墠' + oppLimit + '浠�';
} else {
@@ -428,6 +407,7 @@
String cSql = '';
soql += ' AND (';
for (Integer icount = 0; icount < vals.size(); icount++) {
+
//绮剧悽绉戞妧 zxk 2021-08-25 start
String val = vals[icount];
if (equalOpts == 'contains') {
@@ -444,8 +424,10 @@
soql += ' AND ';
}
}
+
}
//绮剧悽绉戞妧 zxk 2021-08-25 end
+
// String val = vals[icount];
// cSql = this.makeTextSqlStr(textOpts, equalOpts, val);
@@ -489,6 +471,7 @@
else if (equalOpts == '=' || equalOpts == '<>') {
soql += 'AND ' + textOpts + equalOpts + '\'' + numtext + '\'';
}
+
//绮剧悽绉戞妧 zxk 2021-08-25 start
//璧峰瀛楃
else if (equalOpts == 'starts with' && numtext.contains(' ')) {
@@ -497,13 +480,15 @@
for (Integer icount = 0; icount < vals.size(); icount++) {
String val = vals[icount];
if (equalOpts == 'starts with') {
- soql += ' ' + textOpts + ' LIKE \'%' + val + '%\'';
+ soql += ' ' + textOpts + ' LIKE \'%' + val + '%\'' ;
if (icount < vals.size() - 1) {
soql += ' OR ';
+
}
}
}
soql += ')';
+
}
//绮剧悽绉戞妧 zxk 2021-08-25 end
@@ -524,23 +509,22 @@
return soql;
}
//妫�绱㈡潯浠讹細鏁版嵁瀛楁1锛屾暟鎹瓧娈�2锛屾暟鎹瓧娈�3鍧囨弧瓒筹紝骞朵笖杩涘叆makeTextSql锛堬級涔嬪悗锛屽唴鍚暟鎹瓧娈靛寘鍚绉嶆椂杩涘叆姝ゆ柟娉曘��
- @TestVisible
- private String makeTextSqlStr(String textOpts, String equalOpts, String val) {
+ @TestVisible private String makeTextSqlStr(String textOpts, String equalOpts, String val) {
String soql = '';
if (!String.isBlank(textOpts)) {
String tmpVal = val;
if (!String.isBlank(tmpVal)) {
if (equalOpts == 'contains' || equalOpts == 'notcontains') {
if (equalOpts == 'contains') {
- soql += ' ' + textOpts + ' LIKE \'%' + val + '%\'';
+ soql += ' ' + textOpts + ' LIKE \'%' + val + '%\'' ;
} else if (equalOpts == 'notcontains') {
- soql += ' ( NOT ' + textOpts + ' LIKE \'%' + val + '%\' ) ';
+ soql += ' ( NOT ' + textOpts + ' LIKE \'%' + val + '%\' ) ' ;
}
} else if (equalOpts == '=' || equalOpts == '<>') {
if (equalOpts == '=') {
- soql += ' AND ' + textOpts + ' = ' + val;
+ soql += ' AND ' + textOpts + ' = ' + val ;
} else if (equalOpts == '<>') {
- soql += ' AND ' + textOpts + ' <> ' + val;
+ soql += ' AND ' + textOpts + ' <> ' + val ;
}
}
} else {
@@ -579,6 +563,7 @@
if (oi.changeFlg == '1') {
oi.changeFlg = '0';
updTarget.add(oi.AgcOpp);
+
}
// if (oi.changeFlgRt == '1' && oi.opp.id != null) {
// oi.changeFlgRt = '0';
@@ -586,7 +571,7 @@
// }
}
if (updTarget.size() > 0) {
- system.debug('updTarget.size:' + updTarget.size());
+ system.debug('updTarget.size:' + updTarget.size() );
update updTarget;
}
// if (updOpps.size() > 0) {
@@ -656,4 +641,4 @@
AgcOpp = record;
}
}
-}
+}
\ No newline at end of file
diff --git a/force-app/main/default/classes/DealerInquiryModifyStateControllerTest.cls b/force-app/main/default/classes/DealerInquiryModifyStateControllerTest.cls
index 0ad62f6..60ceee1 100644
--- a/force-app/main/default/classes/DealerInquiryModifyStateControllerTest.cls
+++ b/force-app/main/default/classes/DealerInquiryModifyStateControllerTest.cls
@@ -1,64 +1,51 @@
@isTest
private class DealerInquiryModifyStateControllerTest {
- @TestSetup
- static void init() {
- List<RecordType> rectCo = [
- SELECT Id
- FROM RecordType
- WHERE IsActive = TRUE AND SobjectType = 'Account' AND Name = '鐥呴櫌'
- ];
+ @TestSetup static void init() {
+ 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 = '鎴︾暐绉戝鍒嗛 鍛煎惛绉�'
- ];
+ 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 = '瑷虹檪绉� 娑堝寲绉�'
- ];
+ List<RecordType> rectDpt = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '瑷虹檪绉� 娑堝寲绉�'];
if (rectDpt.size() == 0) {
return;
}
// 銉嗐偣銉堛儑銉笺偪
-
+
Account company = new Account();
company.RecordTypeId = rectCo[0].Id;
- company.Name = 'NFM007TestCompany';
+ company.Name = 'NFM007TestCompany';
insert company;
Account section = new Account();
section.RecordTypeId = rectSct[0].Id;
- section.Name = '*';
+ section.Name = '*';
section.Department_Class_Label__c = '娑堝寲绉�';
- section.ParentId = company.Id;
+ section.ParentId = company.Id;
section.Hospital_Department_Class__c = company.Id;
insert section;
// Test.startTest();
Account depart = new Account();
depart.RecordTypeId = rectDpt[0].Id;
- depart.Name = '*';
- depart.Department_Name__c = 'NFM007TestDepart';
- depart.ParentId = section.Id;
+ depart.Name = '*';
+ depart.Department_Name__c = 'NFM007TestDepart';
+ depart.ParentId = section.Id;
depart.Department_Class__c = section.Id;
- depart.Hospital__c = company.Id;
+ depart.Hospital__c = company.Id;
insert depart;
Opportunity opp = new Opportunity();
- opp.AccountId = depart.Id;
+ opp.AccountId = depart.Id;
opp.Department_Class__c = section.Id;
- opp.Hospital__c = company.Id;
- opp.SAP_Send_OK__c = false;
- opp.Name = 'GZ-SP-NFM007_1';
- opp.Trade__c = '鍐呰部';
- opp.StageName = '寮曞悎';
- opp.CloseDate = Date.today();
+ opp.Hospital__c = company.Id;
+ opp.SAP_Send_OK__c = false;
+ opp.Name = 'GZ-SP-NFM007_1';
+ opp.Trade__c = '鍐呰部';
+ opp.StageName = '寮曞悎';
+ opp.CloseDate = Date.today();
opp.Stock_apply_status__c = '鐢宠涓�';
insert opp;
Test.startTest();
@@ -73,16 +60,17 @@
contact1.LastName = 'test1鍖婚櫌';
contact1.Agency_User__c = true;
insert contact1;
- List<Contact> contactlist = [
- SELECT Id, FirstName
- FROM Contact
- ];
+ List<Contact> contactlist = [select Id, FirstName
+ from Contact
+ ];
System.assertEquals('璨换鑰�', contactlist[0].FirstName);
+
+
//
User user = new User();
- Profile p = [SELECT Id FROM Profile WHERE Name = '901_缁忛攢鍟嗘椿鍔ㄧ郴缁�'];
+ Profile p = [select Id from Profile where Name = '901_缁忛攢鍟嗘椿鍔ㄧ郴缁�'];
user.ProfileId = p.Id;
user.ContactId = contact1.Id;
user.FirstName = '銉︺兗銈躲兗';
@@ -96,14 +84,10 @@
user.Alias = '銉嗐儲';
user.CommunityNickname = '銉嗐偣銉堛儲銉笺偠銉�';
user.SalesManager__c = UserInfo.getUserId();
- System.runAs(new User(Id = UserInfo.getUserId())) {
+ System.runAs(new User(Id = UserInfo.getUserId())){
insert user;
}
- List<user> users = [
- SELECT Id, Name, LastName, FirstName
- FROM User
- WHERE LastName = '銉嗐偣銉�'
- ];
+ List<user> users = [select Id, Name, LastName, FirstName from User where LastName = '銉嗐偣銉�'];
//
Agency_Hospital_Link__c agency_hospital_link = new Agency_Hospital_Link__c();
@@ -116,14 +100,9 @@
//
//System.assertEquals('銉嗐偣銉�',users[0].LastName);
- System.assertEquals('銉︺兗銈躲兗', users[0].FirstName);
+ System.assertEquals('銉︺兗銈躲兗', users[0].FirstName );
- Id rtId = [
- SELECT Id, DeveloperName
- FROM RecordType
- WHERE IsActive = TRUE AND SobjectType = 'Agency_Opportunity__c' AND DeveloperName = 'Opportunity'
- ]
- .Id;
+ Id rtId = [select Id, DeveloperName from RecordType where IsActive = true and SobjectType = 'Agency_Opportunity__c' and DeveloperName = 'Opportunity'].Id;
// Schema.SobjectType.Agency_Opportunity__c.getRecordTypeInfosByName().get('璇环').getRecordTypeId();
Agency_opportunity__c agency_opportunity = new Agency_opportunity__c();
agency_opportunity.RecordTypeId = rtId;
@@ -134,22 +113,25 @@
agency_opportunity.StageName__c = '杩樻病鐢宠棰勭畻';
agency_opportunity.OwnerId = user.Id;
agency_opportunity.Change_To_Opportunity_T__c = '::CF-HQ290I';
- agency_opportunity.Sales_Manager__c = UserInfo.getUserId();
+ agency_opportunity.Sales_Manager__c =UserInfo.getUserId();
insert agency_opportunity;
Test.stopTest();
+
}
static testMethod void myUnitTest_SortKey() {
- Test.startTest();
+ Test.startTest();
Test.setMock(WebServiceMock.class, new NFMTest_Mock());
Test.stopTest();
PageReference page = new PageReference('/apex/DealerInquiryModifyState');
System.Test.setCurrentPage(page);
+
// 鍒濆鍖栨祴璇�
DealerInquiryModifyStateController controller = new DealerInquiryModifyStateController();
-
+
+
controller.init();
//System.assertEquals(1, controller.oppRecords.size());楠岃瘉棰勬湡鍊煎拰缁撴灉鍊兼纭��
// 鎺掑簭娴嬭瘯
@@ -164,7 +146,7 @@
// Test.stopTest();
}
static testMethod void myUnitTest_AccSearchAndAoosearch() {
- Test.startTest();
+ Test.startTest();
Test.setMock(WebServiceMock.class, new NFMTest_Mock());
Test.stopTest();
PageReference page = new PageReference('/apex/DealerInquiryModifyState');
@@ -172,7 +154,7 @@
DealerInquiryModifyStateController controller = new DealerInquiryModifyStateController();
// 鍒濆鍖栨祴璇�
// Test.startTest();
-
+
controller.init();
//鏂囨湰杈撳叆妗嗘绱�
//1:缁忛攢鍟嗗尰闄�
@@ -361,7 +343,8 @@
controller.chick();
controller.tmpBO.MaxActivityDate__c = date.valueOf('2018-02-09');
controller.chick();
- Test.stopTest();
+ Test.stopTest();
+
}
static testMethod void myUnitTestTime02() {
PageReference page = new PageReference('/apex/DealerInquiryModifyState');
@@ -396,6 +379,7 @@
controller.tmpBO.MaxActivityDate__c = date.valueOf('2018-02-09');
controller.chick();
Test.stopTest();
+
}
static testMethod void myUnitTestTimeSave() {
PageReference page = new PageReference('/apex/DealerInquiryModifyState');
@@ -434,4 +418,4 @@
controller.init();
Test.stopTest();
}
-}
+}
\ No newline at end of file
diff --git a/force-app/main/default/classes/LexArriveGoodsController.cls b/force-app/main/default/classes/LexArriveGoodsController.cls
index 5eeaf1f..b2c79cc 100644
--- a/force-app/main/default/classes/LexArriveGoodsController.cls
+++ b/force-app/main/default/classes/LexArriveGoodsController.cls
@@ -1,4 +1,5 @@
public without sharing class LexArriveGoodsController {
+
//鍒濆鍖�
@AuraEnabled
public static Results init(String arrType, String eSetId) {
@@ -25,20 +26,20 @@
public static Results searchProduct(String barcode, String arrControllerStr) {
Results results = new Results();
try {
- System.debug('arrControllerStr:' + arrControllerStr);
- ArriveGoodsController arrController = (ArriveGoodsController) JSON.deserialize(arrControllerStr, ArriveGoodsController.class);
+ System.debug('arrControllerStr:'+arrControllerStr);
+ ArriveGoodsController arrController = (ArriveGoodsController)JSON.deserialize(arrControllerStr, ArriveGoodsController.class);
arrController.barcode = barcode;
arrController.returnError = null;
arrController.warningList = new List<String>();
arrController.errorList = new List<String>();
arrController.SearchPro();
results.arrGoodCon = JSON.serialize(arrController);
- if (arrController.returnError != null && arrController.returnError != '') {
+ if(arrController.returnError != null && arrController.returnError != ''){
results.result = 'Fail';
results.errorMsgList = arrController.errorList;
results.warningMsgList = arrController.warningList;
results.errorMsg = arrController.returnError;
- } else {
+ }else {
results.coc = arrController.coc;
results.saveFLGbln = arrController.saveFLGbln;
results.returnFLGbln = arrController.ReturnFLGbln;
@@ -63,20 +64,20 @@
public static Results arriveGoodsConfim(String arrControllerStr) {
Results results = new Results();
try {
- ArriveGoodsController arrController = (ArriveGoodsController) JSON.deserialize(arrControllerStr, ArriveGoodsController.class);
+ ArriveGoodsController arrController = (ArriveGoodsController)JSON.deserialize(arrControllerStr, ArriveGoodsController.class);
arrController.returnError = null;
arrController.warningList = new List<String>();
arrController.errorList = new List<String>();
Pagereference page = arrController.ArriveGoodsConfim();
results.arrGoodCon = JSON.serialize(arrController);
- if (arrController.returnError != null && arrController.returnError != '') {
+ if(arrController.returnError != null && arrController.returnError != ''){
results.result = 'Fail';
results.errorMsgList = arrController.errorList;
results.warningMsgList = arrController.warningList;
results.errorMsg = arrController.returnError;
- } else {
- if (arrController.urlType == 'UnabletoEdit') {
- results.url = '/lexarrivegsdetails?EsetId=' + arrController.arriveId;
+ }else {
+ if(arrController.urlType == 'UnabletoEdit'){
+ results.url = '/lexarrivegsdetails?EsetId='+arrController.arriveId;
}
results.errorMsgList = arrController.errorList;
results.warningMsgList = arrController.warningList;
@@ -88,17 +89,14 @@
}
return results;
}
-
+
//鐧诲綍杩斿搧
@AuraEnabled
public static Results updateGoodsOfReturn(String arrControllerStr, String showGoodsofReturnListStr) {
Results results = new Results();
try {
- List<ConsumableorderdetailsInfo> showGoodsofReturnList = (List<ConsumableorderdetailsInfo>) JSON.deserialize(
- showGoodsofReturnListStr,
- List<ConsumableorderdetailsInfo>.class
- );
- ArriveGoodsController arrController = (ArriveGoodsController) JSON.deserialize(arrControllerStr, ArriveGoodsController.class);
+ List<ConsumableorderdetailsInfo> showGoodsofReturnList = (List<ConsumableorderdetailsInfo>)JSON.deserialize(showGoodsofReturnListStr, List<ConsumableorderdetailsInfo>.class);
+ ArriveGoodsController arrController = (ArriveGoodsController)JSON.deserialize(arrControllerStr, ArriveGoodsController.class);
arrController.ShowGoodsofReturnList = changeType2(showGoodsofReturnList);
arrController.returnError = null;
arrController.warningList = new List<String>();
@@ -106,17 +104,17 @@
StaticParameter.ConsumableOrderTrigger = true; //Add by Li Jun for bypass ConsumableOrderTrigger 20230616
Pagereference page = arrController.UpdateGoodsOfReturn();
results.arrGoodCon = JSON.serialize(arrController);
- if (arrController.returnError != null && arrController.returnError != '') {
+ if(arrController.returnError != null && arrController.returnError != ''){
results.result = 'Fail';
results.errorMsgList = arrController.errorList;
results.warningMsgList = arrController.warningList;
results.errorMsg = arrController.returnError;
- } else {
- if (arrController.urlType == 'ToReturnGoodsPage') {
- results.url = '/detail/' + arrController.return_Order_id;
+ }else {
+ if(arrController.urlType == 'ToReturnGoodsPage'){
+ results.url = '/detail/'+arrController.return_Order_id;
}
- if (arrController.urlType == 'ToInventoryGoodsPage') {
- results.url = '/detail/' + arrController.inventory_Order_id;
+ if(arrController.urlType == 'ToInventoryGoodsPage'){
+ results.url = '/detail/'+arrController.inventory_Order_id;
}
results.errorMsgList = arrController.errorList;
results.warningMsgList = arrController.warningList;
@@ -129,10 +127,10 @@
return results;
}
- public static List<ConsumableorderdetailsInfo> changeType1(List<ArriveGoodsController.ConsumableorderdetailsInfo> conList) {
+ public static List<ConsumableorderdetailsInfo> changeType1(List<ArriveGoodsController.ConsumableorderdetailsInfo> conList){
List<ConsumableorderdetailsInfo> conList1 = new List<ConsumableorderdetailsInfo>();
- if (conList != null) {
- for (ArriveGoodsController.ConsumableorderdetailsInfo con : conList) {
+ if(conList != null){
+ for(ArriveGoodsController.ConsumableorderdetailsInfo con : conList){
ConsumableorderdetailsInfo con1 = new ConsumableorderdetailsInfo();
con1.esd = con.esd;
con1.Prod = con.Prod;
@@ -155,10 +153,10 @@
return conList1;
}
- public static List<ArriveGoodsController.ConsumableorderdetailsInfo> changeType2(List<ConsumableorderdetailsInfo> conList) {
+ public static List<ArriveGoodsController.ConsumableorderdetailsInfo> changeType2(List<ConsumableorderdetailsInfo> conList){
List<ArriveGoodsController.ConsumableorderdetailsInfo> conList1 = new List<ArriveGoodsController.ConsumableorderdetailsInfo>();
- if (conList != null) {
- for (ConsumableorderdetailsInfo con : conList) {
+ if(conList != null){
+ for(ConsumableorderdetailsInfo con : conList){
ArriveGoodsController.ConsumableorderdetailsInfo con1 = new ArriveGoodsController.ConsumableorderdetailsInfo();
con1.esd = con.esd;
con1.Prod = con.Prod;
@@ -246,7 +244,8 @@
@AuraEnabled
public String ReportProductExpirationDate { get; set; }
- public ConsumableorderdetailsInfo() {
+ public ConsumableorderdetailsInfo(){
+
}
// 鎺掑簭
@@ -254,4 +253,4 @@
return null;
}
}
-}
+}
\ No newline at end of file
diff --git a/force-app/main/default/classes/LexArriveGoodsController.cls-meta.xml b/force-app/main/default/classes/LexArriveGoodsController.cls-meta.xml
index 1248daa..fbbad0a 100644
--- a/force-app/main/default/classes/LexArriveGoodsController.cls-meta.xml
+++ b/force-app/main/default/classes/LexArriveGoodsController.cls-meta.xml
@@ -1,4 +1,4 @@
-<?xml version="1.0" encoding="UTF-8" ?>
+<?xml version="1.0" encoding="UTF-8"?>
<ApexClass xmlns="http://soap.sforce.com/2006/04/metadata">
<apiVersion>56.0</apiVersion>
<status>Active</status>
diff --git a/force-app/main/default/classes/LexArriveGoodsControllerTest.cls b/force-app/main/default/classes/LexArriveGoodsControllerTest.cls
index 5e42821..0d16dab 100644
--- a/force-app/main/default/classes/LexArriveGoodsControllerTest.cls
+++ b/force-app/main/default/classes/LexArriveGoodsControllerTest.cls
@@ -1,418 +1,318 @@
@isTest
private class LexArriveGoodsControllerTest {
@IsTest
- static void test1() {
- NoteStay__c n = new NoteStay__c(Name = 'NoteStay', IsStay__c = true);
+ static void test1(){
+ NoteStay__c n = new NoteStay__c(Name = 'NoteStay',IsStay__c = true);
insert n;
- List<RecordType> rectCo = [
- SELECT Id
- FROM RecordType
- WHERE IsActive = TRUE AND SobjectType = 'Account' AND Name = '璨╁2搴�'
- ];
- if (rectCo.size() == 0) {
- return;
- }
- // Profile prof = [select Id from Profile where Name ='901_缁忛攢鍟嗙ぞ鍖烘櫘閫氭潈闄恄2閲嶉獙璇�(ET Email)'];
- Profile prof = [
- SELECT Id
- FROM Profile
- WHERE Name = '901_缁忛攢鍟嗙ぞ鍖烘櫘閫氭潈闄恄2閲嶉獙璇�(ET)'
- ];
+ List<RecordType> rectCo = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '璨╁2搴�'];
+ if (rectCo.size() == 0) {
+ return;
+ }
+ // Profile prof = [select Id from Profile where Name ='901_缁忛攢鍟嗙ぞ鍖烘櫘閫氭潈闄恄2閲嶉獙璇�(ET Email)'];
+ Profile prof = [select Id from Profile where Name ='901_缁忛攢鍟嗙ぞ鍖烘櫘閫氭潈闄恄2閲嶉獙璇�(ET)'];
- Account myAccount1 = new Account(
- Name = 'Testaccount001',
- Dealer_discount__c = 20,
- RecordTypeId = rectCo[0].Id,
- AgentCode_Ext__c = '9999996'
- );
- Account myAccount2 = new Account(
- Name = 'Testaccount002',
- Dealer_discount__c = 10,
- RecordTypeId = rectCo[0].Id,
- AgentCode_Ext__c = '9999900',
- Product_Limit_Date__c = 'Test01|2|4,Test02|3|5'
- );
- insert new List<Account>{ myAccount1, myAccount2 };
+ Account myAccount1 = new Account(Name='Testaccount001',Dealer_discount__c =20,RecordTypeId = rectCo[0].Id,AgentCode_Ext__c = '9999996');
+ Account myAccount2 = new Account(Name='Testaccount002',Dealer_discount__c =10,RecordTypeId = rectCo[0].Id,AgentCode_Ext__c = '9999900',Product_Limit_Date__c = 'Test01|2|4,Test02|3|5');
+ insert new Account[]{myAccount1,myAccount2};
- Contact core = new Contact(email = 'jplumber@salesforce.com', firstname = 'Joe', lastname = 'Plumber', accountid = myAccount1.id);
- insert core;
- user MyUser_Test = new User(
- ContactId = core.id,
- Alias = 'newUser',
- Email = 'newuser@testorg.com',
- EmailEncodingKey = 'UTF-8',
- LastName = 'TestUser',
- LanguageLocaleKey = 'zh_CN',
- LocaleSidKey = 'zh_CN',
- ProfileId = prof.Id,
- TimeZoneSidKey = 'Asia/Shanghai',
- UserName = 'testUser@testorg.com',
- UserPro_Type__c = 'ET'
- );
- System.runAs(new User(Id = UserInfo.getUserId())) {
+ Contact core = new Contact(email='jplumber@salesforce.com', firstname='Joe',lastname='Plumber',accountid=myAccount1.id);
+ insert core;
+ user MyUser_Test = New User(ContactId = core.id,Alias = 'newUser',Email='newuser@testorg.com',EmailEncodingKey='UTF-8', LastName='TestUser', LanguageLocaleKey='zh_CN',LocaleSidKey='zh_CN', ProfileId = prof.Id,TimeZoneSidKey='Asia/Shanghai', UserName='testUser@testorg.com',UserPro_Type__c = 'ET');
+ System.runAs(new User(Id = UserInfo.getUserId())){
insert MyUser_Test;
}
- // User MyUser_Test = [select id,Contact.accountid from User WHERE ProfileId = :prof.Id and IsActive = true and UserPro_Type__c = 'ET' limit 1 ];
- // Product2 prod01 = new Product2(Name='Test01',ProductCode='Test01',Asset_Model_No__c = 'Test01',SFDA_Status__c = '鏈夊姽',JANCODE__c = '04953170200311',Dealer_special_Object__c = true,Manual_Entry__c = false);
- // Product2 prod02 = new Product2(Name='Test02',ProductCode='Test02',Asset_Model_No__c = 'Test02',SFDA_Status__c = '鏈夊姽',JANCODE__c = '04953170200312',Dealer_special_Object__c = true,Manual_Entry__c = false);
- // insert new Product2[] {prod01,prod02};
- System.runAs(MyUser_Test) {
- Product2 prod01 = new Product2(
- Name = 'Test01',
- ProductCode = 'Test01',
- Asset_Model_No__c = 'Test01',
- RecordTypeId = '01210000000aMAFAA2',
- SFDA_Status__c = '鏈夊姽',
- JANCODE__c = '04953170200311',
- Dealer_special_Object__c = true,
- Manual_Entry__c = false
- );
- Product2 prod02 = new Product2(
- Name = 'Test02',
- ProductCode = 'Test02',
- Asset_Model_No__c = 'Test02',
- RecordTypeId = '01210000000aMAFAA2',
- SFDA_Status__c = '鏈夊姽',
- JANCODE__c = '04953170200312',
- Dealer_special_Object__c = true,
- Manual_Entry__c = false
- );
- insert new List<Product2>{ prod01, prod02 };
- Product2__c pro1 = new Product2__c(Name = 'Pro001', OT_CODE_Text__c = 'Test001', Product2__c = prod01.Id);
- Product2__c pro2 = new Product2__c(Name = 'Pro002', OT_CODE_Text__c = 'Test002', Product2__c = prod02.Id);
- insert new List<Product2__c>{ pro1, pro2 };
- //璁㈠崟
- Consumable_order__c Order1 = new Consumable_order__c();
- Order1.Name = 'OCM_01_001';
- Order1.Order_status__c = '鎵瑰噯';
- Order1.Order_type__c = '璁㈠崟';
- // Order1.Dealer_Info__c = myAccount1.id;
- Order1.RecordTypeid = System.Label.RT_ConOrder_Delivery;
- Order1.Total_num__c = 3;
- Order1.OrderNumber_arrived__c = 1;
- Order1.Delivery_detail_count__c = 1;
- Order1.Order_ProType__c = 'ET';
- insert Order1;
+ // User MyUser_Test = [select id,Contact.accountid from User WHERE ProfileId = :prof.Id and IsActive = true and UserPro_Type__c = 'ET' limit 1 ];
+ // Product2 prod01 = new Product2(Name='Test01',ProductCode='Test01',Asset_Model_No__c = 'Test01',SFDA_Status__c = '鏈夊姽',JANCODE__c = '04953170200311',Dealer_special_Object__c = true,Manual_Entry__c = false);
+ // Product2 prod02 = new Product2(Name='Test02',ProductCode='Test02',Asset_Model_No__c = 'Test02',SFDA_Status__c = '鏈夊姽',JANCODE__c = '04953170200312',Dealer_special_Object__c = true,Manual_Entry__c = false);
+ // insert new Product2[] {prod01,prod02};
+ system.runAs(MyUser_Test){
+ Product2 prod01 = new Product2(Name='Test01',ProductCode='Test01',Asset_Model_No__c = 'Test01',RecordTypeId = '01210000000aMAFAA2',SFDA_Status__c = '鏈夊姽',JANCODE__c = '04953170200311',Dealer_special_Object__c = true,Manual_Entry__c = false);
+ Product2 prod02 = new Product2(Name='Test02',ProductCode='Test02',Asset_Model_No__c = 'Test02',RecordTypeId = '01210000000aMAFAA2',SFDA_Status__c = '鏈夊姽',JANCODE__c = '04953170200312',Dealer_special_Object__c = true,Manual_Entry__c = false);
+ insert new Product2[] {prod01,prod02};
+ Product2__c pro1 = new Product2__c(Name='Pro001',OT_CODE_Text__c='Test001',Product2__c = prod01.Id);
+ Product2__c pro2 = new Product2__c(Name='Pro002',OT_CODE_Text__c='Test002',Product2__c = prod02.Id);
+ insert new Product2__c[] {pro1, pro2};
+ //璁㈠崟
+ Consumable_order__c Order1 = new Consumable_order__c();
+ Order1.Name = 'OCM_01_001';
+ Order1.Order_status__c = '鎵瑰噯';
+ Order1.Order_type__c = '璁㈠崟';
+ // Order1.Dealer_Info__c = myAccount1.id;
+ Order1.RecordTypeid = System.Label.RT_ConOrder_Delivery;
+ Order1.Total_num__c = 3;
+ Order1.OrderNumber_arrived__c =1;
+ Order1.Delivery_detail_count__c=1;
+ Order1.Order_ProType__c = 'ET';
+ insert Order1;
- //璁㈠崟鏄庣粏
- //fahuo
- Consumable_orderdetails__c Orderdet = new Consumable_orderdetails__c();
- Orderdet.Name = 'OCM_01_00101';
- Orderdet.Consumable_order__c = Order1.Id;
- Orderdet.RecordTypeId = System.Label.RT_ConOrderDetail1_Order;
- Orderdet.Consumable_Product__c = pro1.Id;
- Orderdet.Consumable_count__c = 40;
- insert Orderdet;
+ //璁㈠崟鏄庣粏
+ //fahuo
+ Consumable_orderdetails__c Orderdet = new Consumable_orderdetails__c();
+ Orderdet.Name = 'OCM_01_00101';
+ Orderdet.Consumable_order__c = Order1.Id;
+ Orderdet.RecordTypeId = System.Label.RT_ConOrderDetail1_Order;
+ Orderdet.Consumable_Product__c = pro1.Id;
+ Orderdet.Consumable_count__c = 40;
+ insert Orderdet;
- //鍙戣揣鏄庣粏
- //鍒拌揣姝g‘淇℃伅
- Consumable_order_details2__c Orderdet1 = new Consumable_order_details2__c();
- Orderdet1.Name = 'OCM_01_001002';
- Orderdet1.Consumable_order_minor__c = Order1.Id;
- Orderdet1.Consumable_Product__c = pro1.Id;
- Orderdet1.Asset_Model_No__c = 'Test01';
- Orderdet1.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
- Orderdet1.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJRA';
- Orderdet1.TracingCode__c = 'BXJRA';
+ //鍙戣揣鏄庣粏
+ //鍒拌揣姝g‘淇℃伅
+ Consumable_order_details2__c Orderdet1 = new Consumable_order_details2__c();
+ Orderdet1.Name = 'OCM_01_001002';
+ Orderdet1.Consumable_order_minor__c = Order1.Id;
+ Orderdet1.Consumable_Product__c = pro1.Id;
+ Orderdet1.Asset_Model_No__c = 'Test01';
+ Orderdet1.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
+ Orderdet1.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJRA';
+ Orderdet1.TracingCode__c = 'BXJRA';
- //鍙栨秷浜у搧
- Consumable_order_details2__c Orderdet2 = new Consumable_order_details2__c();
- Orderdet2.Name = 'OCM_01_001003';
- Orderdet2.Consumable_order_minor__c = Order1.Id;
- Orderdet2.Consumable_Product__c = pro1.Id;
- Orderdet2.Asset_Model_No__c = 'Test01';
- //Orderdet2.Consumable_Arrived_order__c = Order1.Id;
- Orderdet2.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
- Orderdet2.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJRB';
- Orderdet2.Cancellation_Date__c = Date.today();
- Orderdet2.TracingCode__c = 'BXJRB';
- //閿�鍞骇鍝�
- Consumable_order_details2__c Orderdet3 = new Consumable_order_details2__c();
- Orderdet3.Name = 'OCM_01_001004';
- Orderdet3.Consumable_order_minor__c = Order1.Id;
- Orderdet3.Consumable_Product__c = pro1.Id;
- Orderdet3.Asset_Model_No__c = 'Test01';
- Orderdet3.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
- Orderdet3.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJRC';
- Orderdet3.Used_date__c = Date.today();
- Orderdet3.Arrive_date__c = Date.today();
- Orderdet3.TracingCode__c = 'BXJRC';
- //Orderdet3.Box_Piece__c = '鐩�';
+ //鍙栨秷浜у搧
+ Consumable_order_details2__c Orderdet2 = new Consumable_order_details2__c();
+ Orderdet2.Name = 'OCM_01_001003';
+ Orderdet2.Consumable_order_minor__c = Order1.Id;
+ Orderdet2.Consumable_Product__c = pro1.Id;
+ Orderdet2.Asset_Model_No__c = 'Test01';
+ //Orderdet2.Consumable_Arrived_order__c = Order1.Id;
+ Orderdet2.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
+ Orderdet2.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJRB';
+ Orderdet2.Cancellation_Date__c= Date.today();
+ Orderdet2.TracingCode__c = 'BXJRB';
+ //閿�鍞骇鍝�
+ Consumable_order_details2__c Orderdet3 = new Consumable_order_details2__c();
+ Orderdet3.Name = 'OCM_01_001004';
+ Orderdet3.Consumable_order_minor__c = Order1.Id;
+ Orderdet3.Consumable_Product__c = pro1.Id;
+ Orderdet3.Asset_Model_No__c = 'Test01';
+ Orderdet3.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
+ Orderdet3.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJRC';
+ Orderdet3.Used_date__c = Date.today();
+ Orderdet3.Arrive_date__c = Date.today();
+ Orderdet3.TracingCode__c = 'BXJRC';
+ //Orderdet3.Box_Piece__c = '鐩�';
- //鍑哄簱浜у搧
- Consumable_order_details2__c Orderdet4 = new Consumable_order_details2__c();
- Orderdet4.Name = 'OCM_01_001005';
- Orderdet4.Consumable_order_minor__c = Order1.Id;
- Orderdet4.Consumable_Product__c = pro1.Id;
- Orderdet4.Asset_Model_No__c = 'Test01';
- Orderdet4.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
- Orderdet4.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJRD';
- Orderdet4.Send_Date__c = Date.today();
- Orderdet4.Arrive_date__c = Date.today();
- Orderdet4.TracingCode__c = 'BXJRD';
- //宸插埌璐т骇鍝�
- Consumable_order_details2__c Orderdet5 = new Consumable_order_details2__c();
- Orderdet5.Name = 'OCM_01_001006';
- Orderdet5.Consumable_order_minor__c = Order1.Id;
- Orderdet5.Consumable_Product__c = pro1.Id;
- Orderdet5.Asset_Model_No__c = 'Test01';
- Orderdet5.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
- Orderdet5.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJRE';
- Orderdet5.Arrive_date__c = Date.today();
- Orderdet5.TracingCode__c = 'BXJRE';
+ //鍑哄簱浜у搧
+ Consumable_order_details2__c Orderdet4 = new Consumable_order_details2__c();
+ Orderdet4.Name = 'OCM_01_001005';
+ Orderdet4.Consumable_order_minor__c = Order1.Id;
+ Orderdet4.Consumable_Product__c = pro1.Id;
+ Orderdet4.Asset_Model_No__c = 'Test01';
+ Orderdet4.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
+ Orderdet4.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJRD';
+ Orderdet4.Send_Date__c = Date.today();
+ Orderdet4.Arrive_date__c = Date.today();
+ Orderdet4.TracingCode__c = 'BXJRD';
- //鍙戣揣鏄庣粏
- //绠$悊缂栫爜鍖呭惈鏁板瓧
- Consumable_order_details2__c Orderdet6 = new Consumable_order_details2__c();
- Orderdet6.Name = 'OCM_01_001002';
- Orderdet6.Consumable_order_minor__c = Order1.Id;
- Orderdet6.Consumable_Product__c = pro1.Id;
- Orderdet6.Asset_Model_No__c = 'Test01';
- Orderdet6.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
- Orderdet6.Bar_Code__c = '01049531702003111115120017181000105ZK250BX123';
- Orderdet6.TracingCode__c = 'BX123';
+ //宸插埌璐т骇鍝�
+ Consumable_order_details2__c Orderdet5 = new Consumable_order_details2__c();
+ Orderdet5.Name = 'OCM_01_001006';
+ Orderdet5.Consumable_order_minor__c = Order1.Id;
+ Orderdet5.Consumable_Product__c = pro1.Id;
+ Orderdet5.Asset_Model_No__c = 'Test01';
+ Orderdet5.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
+ Orderdet5.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJRE';
+ Orderdet5.Arrive_date__c = Date.today();
+ Orderdet5.TracingCode__c = 'BXJRE';
- //鍙戦敊搴� 鏈埌璐�
- Consumable_order_details2__c Orderdets8 = new Consumable_order_details2__c();
- Orderdets8.Name = 'OCM_01_001011';
- Orderdets8.Consumable_order_minor__c = Order1.Id;
- Orderdets8.Consumable_Product__c = pro1.Id;
- Orderdets8.Asset_Model_No__c = 'Test01';
- Orderdets8.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
- Orderdets8.Bar_Code__c = '01049531702003111115120017181000105ZK250BXsys';
- Orderdets8.Box_Piece__c = '鐩�';
- Orderdets8.TracingCode__c = 'BXsys';
+ //鍙戣揣鏄庣粏
+ //绠$悊缂栫爜鍖呭惈鏁板瓧
+ Consumable_order_details2__c Orderdet6 = new Consumable_order_details2__c();
+ Orderdet6.Name = 'OCM_01_001002';
+ Orderdet6.Consumable_order_minor__c = Order1.Id;
+ Orderdet6.Consumable_Product__c = pro1.Id;
+ Orderdet6.Asset_Model_No__c = 'Test01';
+ Orderdet6.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
+ Orderdet6.Bar_Code__c = '01049531702003111115120017181000105ZK250BX123';
+ Orderdet6.TracingCode__c = 'BX123';
- insert new List<Consumable_order_details2__c>{ Orderdet1, Orderdet2, Orderdet3, Orderdet4, Orderdet5, Orderdet6, Orderdets8 };
+ //鍙戦敊搴� 鏈埌璐�
+ Consumable_order_details2__c Orderdets8 = new Consumable_order_details2__c();
+ Orderdets8.Name = 'OCM_01_001011';
+ Orderdets8.Consumable_order_minor__c = Order1.Id;
+ Orderdets8.Consumable_Product__c = pro1.Id;
+ Orderdets8.Asset_Model_No__c = 'Test01';
+ Orderdets8.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
+ Orderdets8.Bar_Code__c = '01049531702003111115120017181000105ZK250BXsys';
+ Orderdets8.Box_Piece__c = '鐩�';
+ Orderdets8.TracingCode__c = 'BXsys';
- List<Consumable_orderdetails__c> cod1 = [
- SELECT Id
- FROM Consumable_orderdetails__c
- WHERE Consumable_order__c = :Order1.Id
- ];
- System.assertEquals(1, cod1.size());
+ insert new Consumable_order_details2__c[] {Orderdet1, Orderdet2,Orderdet3,Orderdet4,Orderdet5,Orderdet6,Orderdets8};
- PageReference page = new PageReference('/apex/ArriveGoods?Esetid=' + Order1.Id);
+ List<Consumable_orderdetails__c> cod1 = [select Id from Consumable_orderdetails__c WHERE Consumable_order__c = :Order1.Id];
+ System.assertEquals(1, cod1.size());
- System.Test.setCurrentPage(page);
- ArriveGoodsController Controller = new ArriveGoodsController();
- //鍒濆鍖栨祴璇�
- System.Test.startTest();
- LexArriveGoodsController.Results re = LexArriveGoodsController.init('Arr', Order1.Id);
+ PageReference page = new PageReference('/apex/ArriveGoods?Esetid=' + Order1.Id);
+
+ System.Test.setCurrentPage(page);
+ ArriveGoodsController Controller = new ArriveGoodsController();
+ //鍒濆鍖栨祴璇�
+ System.Test.startTest();
+ LexArriveGoodsController.Results re = LexArriveGoodsController.init('Arr', Order1.Id);
String arrControllerStr = re.arrGoodCon;
LexArriveGoodsController.searchProduct('', arrControllerStr);
- re = LexArriveGoodsController.searchProduct(
- '01049531702003111115120017181000105ZK250BXJRA\n01049531702003111115120017181000105ZK250BXsys\n01049531702003111115120017181000105ZK250BXsun\n01049531702003111115120017181000105ZK250BXJRB\n01049531702003111115120017181000105ZK250BXJRC\n01049531702003111115120017181000105ZK250BX111\n01049531702003111115120017181000105ZK250BXJRD\n01049531702003111115120017181000105ZK250BXJRE\n01049531702003111115120017181000105ZK250BXJRF\n01049531702003111115120017181000105ZK250BXJRG\n01049531702003111115120017181000105ZK250BX123',
- arrControllerStr
- );
+ re = LexArriveGoodsController.searchProduct('01049531702003111115120017181000105ZK250BXJRA\n01049531702003111115120017181000105ZK250BXsys\n01049531702003111115120017181000105ZK250BXsun\n01049531702003111115120017181000105ZK250BXJRB\n01049531702003111115120017181000105ZK250BXJRC\n01049531702003111115120017181000105ZK250BX111\n01049531702003111115120017181000105ZK250BXJRD\n01049531702003111115120017181000105ZK250BXJRE\n01049531702003111115120017181000105ZK250BXJRF\n01049531702003111115120017181000105ZK250BXJRG\n01049531702003111115120017181000105ZK250BX123', arrControllerStr);
arrControllerStr = re.arrGoodCon;
LexArriveGoodsController.arriveGoodsConfim(arrControllerStr);
- System.Test.stopTest();
+ System.Test.stopTest();
}
}
@IsTest
- static void test2() {
- NoteStay__c n = new NoteStay__c(Name = 'NoteStay', IsStay__c = true);
+ static void test2(){
+ NoteStay__c n = new NoteStay__c(Name = 'NoteStay',IsStay__c = true);
insert n;
- List<RecordType> rectCo = [
- SELECT Id
- FROM RecordType
- WHERE IsActive = TRUE AND SobjectType = 'Account' AND Name = '璨╁2搴�'
- ];
- if (rectCo.size() == 0) {
- return;
- }
- // Profile prof = [select Id from Profile where Name ='901_缁忛攢鍟嗙ぞ鍖烘櫘閫氭潈闄恄2閲嶉獙璇�(ET Email)'];
- Profile prof = [
- SELECT Id
- FROM Profile
- WHERE Name = '901_缁忛攢鍟嗙ぞ鍖烘櫘閫氭潈闄恄2閲嶉獙璇�(ET)'
- ];
+ List<RecordType> rectCo = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '璨╁2搴�'];
+ if (rectCo.size() == 0) {
+ return;
+ }
+ // Profile prof = [select Id from Profile where Name ='901_缁忛攢鍟嗙ぞ鍖烘櫘閫氭潈闄恄2閲嶉獙璇�(ET Email)'];
+ Profile prof = [select Id from Profile where Name ='901_缁忛攢鍟嗙ぞ鍖烘櫘閫氭潈闄恄2閲嶉獙璇�(ET)'];
- Account myAccount2 = new Account(
- name = 'Testaccount002',
- Dealer_discount__c = 20,
- RecordTypeId = rectCo[0].Id,
- AgentCode_Ext__c = '9999900'
- );
- Account myAccount1 = new Account(name = 'Testaccount001', Dealer_discount__c = 30, RecordTypeId = rectCo[0].Id);
- insert new List<account>{ myAccount1, myAccount2 };
- Contact core = new Contact(email = 'jplumber@salesforce.com', firstname = 'Joe', lastname = 'Plumber', accountid = myAccount1.id);
- insert core;
- user MyUser_Test = new User(
- ContactId = core.id,
- Alias = 'newUser',
- Email = 'newuser@testorg.com',
- EmailEncodingKey = 'UTF-8',
- LastName = 'TestUser',
- LanguageLocaleKey = 'zh_CN',
- LocaleSidKey = 'zh_CN',
- ProfileId = prof.Id,
- TimeZoneSidKey = 'Asia/Shanghai',
- UserName = 'testUser@testorg.com',
- UserPro_Type__c = 'ET'
- );
- System.runAs(new User(Id = UserInfo.getUserId())) {
+ Account myAccount2 = new Account(name='Testaccount002',Dealer_discount__c =20,RecordTypeId = rectCo[0].Id,AgentCode_Ext__c = '9999900');
+ Account myAccount1 = new Account(name='Testaccount001',Dealer_discount__c =30,RecordTypeId = rectCo[0].Id);
+ insert new account[]{myAccount1,myAccount2};
+
+ Contact core = new Contact(email='jplumber@salesforce.com', firstname='Joe',lastname='Plumber',accountid=myAccount1.id);
+ insert core;
+ user MyUser_Test = New User(ContactId = core.id,Alias = 'newUser',Email='newuser@testorg.com',EmailEncodingKey='UTF-8', LastName='TestUser', LanguageLocaleKey='zh_CN',LocaleSidKey='zh_CN', ProfileId = prof.Id,TimeZoneSidKey='Asia/Shanghai', UserName='testUser@testorg.com',UserPro_Type__c = 'ET');
+ System.runAs(new User(Id = UserInfo.getUserId())){
insert MyUser_Test;
}
- // User MyUser_Test = [select id,Contact.accountid from User WHERE ProfileId = :prof.Id and IsActive = true and UserPro_Type__c = 'ET' limit 1 ];
- // Product2 prod01 = new Product2(Name='Test01',ProductCode='Test01',Asset_Model_No__c = 'Test01',SFDA_Status__c = '鏈夊姽',JANCODE__c = '04953170200311',Dealer_special_Object__c = true,Manual_Entry__c = false);
- // Product2 prod02 = new Product2(Name='Test02',ProductCode='Test02',Asset_Model_No__c = 'Test02',SFDA_Status__c = '鏈夊姽',JANCODE__c = '04953170200312',Dealer_special_Object__c = true,Manual_Entry__c = false);
- // insert new Product2[] {prod01,prod02};
- System.runAs(MyUser_Test) {
- Product2 prod01 = new Product2(
- Name = 'Test01',
- ProductCode = 'Test01',
- Asset_Model_No__c = 'Test01',
- RecordTypeId = '01210000000aMAFAA2',
- SFDA_Status__c = '鏈夊姽',
- JANCODE__c = '04953170200311',
- Dealer_special_Object__c = true,
- Manual_Entry__c = false
- );
- Product2 prod02 = new Product2(
- Name = 'Test02',
- ProductCode = 'Test02',
- Asset_Model_No__c = 'Test02',
- RecordTypeId = '01210000000aMAFAA2',
- SFDA_Status__c = '鏈夊姽',
- JANCODE__c = '04953170200312',
- Dealer_special_Object__c = true,
- Manual_Entry__c = false
- );
- insert new List<Product2>{ prod01, prod02 };
- Product2__c pro1 = new Product2__c(Name = 'Pro001', OT_CODE_Text__c = 'Test001', Product2__c = prod01.Id);
- Product2__c pro2 = new Product2__c(Name = 'Pro002', OT_CODE_Text__c = 'Test002', Product2__c = prod02.Id);
- insert new List<Product2__c>{ pro1, pro2 };
- //璁㈠崟
+ // User MyUser_Test = [select id,Contact.accountid from User WHERE ProfileId = :prof.Id and IsActive = true and UserPro_Type__c = 'ET' limit 1 ];
+ // Product2 prod01 = new Product2(Name='Test01',ProductCode='Test01',Asset_Model_No__c = 'Test01',SFDA_Status__c = '鏈夊姽',JANCODE__c = '04953170200311',Dealer_special_Object__c = true,Manual_Entry__c = false);
+ // Product2 prod02 = new Product2(Name='Test02',ProductCode='Test02',Asset_Model_No__c = 'Test02',SFDA_Status__c = '鏈夊姽',JANCODE__c = '04953170200312',Dealer_special_Object__c = true,Manual_Entry__c = false);
+ // insert new Product2[] {prod01,prod02};
+ system.runAs(MyUser_Test){
+ Product2 prod01 = new Product2(Name='Test01',ProductCode='Test01',Asset_Model_No__c = 'Test01',RecordTypeId = '01210000000aMAFAA2',SFDA_Status__c = '鏈夊姽',JANCODE__c = '04953170200311',Dealer_special_Object__c = true,Manual_Entry__c = false);
+ Product2 prod02 = new Product2(Name='Test02',ProductCode='Test02',Asset_Model_No__c = 'Test02',RecordTypeId = '01210000000aMAFAA2',SFDA_Status__c = '鏈夊姽',JANCODE__c = '04953170200312',Dealer_special_Object__c = true,Manual_Entry__c = false);
+ insert new Product2[] {prod01,prod02};
+ Product2__c pro1 = new Product2__c(Name='Pro001',OT_CODE_Text__c='Test001',Product2__c = prod01.Id);
+ Product2__c pro2 = new Product2__c(Name='Pro002',OT_CODE_Text__c='Test002',Product2__c = prod02.Id);
+ insert new Product2__c[] {pro1, pro2};
+ //璁㈠崟
- Consumable_order__c Order1 = new Consumable_order__c();
- Order1.Name = 'OCM_01_001';
- Order1.Order_status__c = '鎵瑰噯';
- Order1.Order_type__c = '璁㈠崟';
- Order1.Dealer_Info__c = myAccount1.id;
- Order1.RecordTypeid = System.Label.RT_ConOrder_Delivery;
+ Consumable_order__c Order1 = new Consumable_order__c();
+ Order1.Name = 'OCM_01_001';
+ Order1.Order_status__c = '鎵瑰噯';
+ Order1.Order_type__c = '璁㈠崟';
+ Order1.Dealer_Info__c = myAccount1.id;
+ Order1.RecordTypeid = System.Label.RT_ConOrder_Delivery;
- //杩斿搧璁㈠崟
+ //杩斿搧璁㈠崟
- Consumable_order__c Order2 = new Consumable_order__c();
- Order2.Name = 'OCM_01_002';
- Order2.Order_status__c = '鎵瑰噯';
- Order2.Order_type__c = '杩斿搧';
- Order2.Dealer_Info__c = myAccount1.id;
- Order2.RecordTypeid = System.Label.Dealer_Returned_Label;
- insert Order1;
- insert Order2;
+ Consumable_order__c Order2 = new Consumable_order__c();
+ Order2.Name = 'OCM_01_002';
+ Order2.Order_status__c = '鎵瑰噯';
+ Order2.Order_type__c = '杩斿搧';
+ Order2.Dealer_Info__c = myAccount1.id;
+ Order2.RecordTypeid = System.Label.Dealer_Returned_Label;
+ insert Order1;
+ insert Order2;
- //璁㈠崟鏄庣粏
- //fahuo
- Consumable_orderdetails__c Orderdet = new Consumable_orderdetails__c();
- Orderdet.Name = 'OCM_01_00101';
- Orderdet.Consumable_order__c = Order1.Id;
- Orderdet.RecordTypeId = System.Label.RT_ConOrderDetail1_Order;
- Orderdet.Consumable_Product__c = pro1.Id;
- Orderdet.Consumable_count__c = 4;
- insert Orderdet;
+ //璁㈠崟鏄庣粏
+ //fahuo
+ Consumable_orderdetails__c Orderdet = new Consumable_orderdetails__c();
+ Orderdet.Name = 'OCM_01_00101';
+ Orderdet.Consumable_order__c = Order1.Id;
+ Orderdet.RecordTypeId = System.Label.RT_ConOrderDetail1_Order;
+ Orderdet.Consumable_Product__c = pro1.Id;
+ Orderdet.Consumable_count__c = 4;
+ insert Orderdet;
- //鍙戣揣鏄庣粏
- //娌″嚭搴擄紝娌¢攢鍞紝灏辨槸鍦ㄥ簱
- Consumable_order_details2__c Orderdet1 = new Consumable_order_details2__c();
- Orderdet1.Name = 'OCM_01_001001';
- Orderdet1.Consumable_order_minor__c = Order1.Id;
- Orderdet1.Consumable_Product__c = pro1.Id;
- Orderdet1.Asset_Model_No__c = 'Pro001';
- Orderdet1.Arrive_date__c = date.today();
- Orderdet1.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
- Orderdet1.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJRF';
- Orderdet1.TracingCode__c = 'BXSYS';
+ //鍙戣揣鏄庣粏
+ //娌″嚭搴擄紝娌¢攢鍞紝灏辨槸鍦ㄥ簱
+ Consumable_order_details2__c Orderdet1 = new Consumable_order_details2__c();
+ Orderdet1.Name = 'OCM_01_001001';
+ Orderdet1.Consumable_order_minor__c = Order1.Id;
+ Orderdet1.Consumable_Product__c = pro1.Id;
+ Orderdet1.Asset_Model_No__c = 'Pro001';
+ Orderdet1.Arrive_date__c = date.today();
+ Orderdet1.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
+ Orderdet1.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJRF';
+ Orderdet1.TracingCode__c = 'BXSYS';
- //daohuo
- Consumable_order_details2__c Orderdet2 = new Consumable_order_details2__c();
- Orderdet2.Name = 'OCM_01_001002';
- Orderdet2.Consumable_order_minor__c = Order1.Id;
- Orderdet2.Consumable_Product__c = pro1.Id;
- Orderdet2.Asset_Model_No__c = 'Pro001';
- Orderdet2.Consumable_Arrived_order__c = Order1.Id;
- Orderdet2.Arrive_date__c = date.today();
- Orderdet2.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
- Orderdet2.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJRI';
- Orderdet2.TracingCode__c = 'BXSYS';
- //sale
- Consumable_order_details2__c Orderdet3 = new Consumable_order_details2__c();
- Orderdet3.Name = 'OCM_01_001003';
- Orderdet3.Consumable_order_minor__c = Order1.Id;
- Orderdet3.Consumable_Product__c = pro1.Id;
- Orderdet3.Asset_Model_No__c = 'Pro001';
- Orderdet3.Consumable_Arrived_order__c = Order1.Id;
- Orderdet3.Arrive_date__c = date.today();
- Orderdet3.Used_date__c = date.today();
- Orderdet3.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
- Orderdet3.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJRJ';
- Orderdet3.TracingCode__c = 'BXSYS';
- //鍑哄簱
- Consumable_order_details2__c Orderdet4 = new Consumable_order_details2__c();
- Orderdet4.Name = 'OCM_01_001004';
- Orderdet4.Consumable_order_minor__c = Order1.Id;
- Orderdet4.Consumable_Product__c = pro1.Id;
- Orderdet4.Asset_Model_No__c = 'Pro001';
- Orderdet4.Consumable_Arrived_order__c = Order1.Id;
- Orderdet4.Consumable_Shipment_order__c = Order1.Id;
- Orderdet4.Send_Date__c = date.today();
- Orderdet4.Arrive_date__c = date.today();
- Orderdet4.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
- Orderdet4.Bar_Code__c = '01049531702003111115120017181000105ZK250BX222';
- Orderdet4.TracingCode__c = 'BXSYS';
- //quxiao
- Consumable_order_details2__c Orderdet5 = new Consumable_order_details2__c();
- Orderdet5.Name = 'OCM_01_001005';
- Orderdet5.Consumable_order_minor__c = Order1.Id;
- Orderdet5.Consumable_Product__c = pro1.Id;
- Orderdet5.Asset_Model_No__c = 'Pro001';
- Orderdet5.Cancellation_Date__c = Date.today();
- Orderdet5.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
- Orderdet5.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJRZ';
- Orderdet5.Box_Piece__c = '涓�';
- Orderdet5.TracingCode__c = 'BXSYS';
- //fanpin
- Consumable_order_details2__c Orderdet6 = new Consumable_order_details2__c();
- Orderdet6.Name = 'OCM_01_001006';
- Orderdet6.Consumable_order_minor__c = Order1.Id;
- Orderdet6.Consumable_Product__c = pro1.Id;
- Orderdet6.Asset_Model_No__c = 'Pro001';
- Orderdet6.Consumable_Return_order__c = Order2.Id;
- Orderdet6.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
- Orderdet6.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJRA';
- Orderdet6.Box_Piece__c = '涓�';
- Orderdet6.TracingCode__c = 'BXSYS';
+ //daohuo
+ Consumable_order_details2__c Orderdet2 = new Consumable_order_details2__c();
+ Orderdet2.Name = 'OCM_01_001002';
+ Orderdet2.Consumable_order_minor__c = Order1.Id;
+ Orderdet2.Consumable_Product__c = pro1.Id;
+ Orderdet2.Asset_Model_No__c = 'Pro001';
+ Orderdet2.Consumable_Arrived_order__c = Order1.Id;
+ Orderdet2.Arrive_date__c = date.today();
+ Orderdet2.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
+ Orderdet2.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJRI';
+ Orderdet2.TracingCode__c = 'BXSYS';
+ //sale
+ Consumable_order_details2__c Orderdet3 = new Consumable_order_details2__c();
+ Orderdet3.Name = 'OCM_01_001003';
+ Orderdet3.Consumable_order_minor__c = Order1.Id;
+ Orderdet3.Consumable_Product__c = pro1.Id;
+ Orderdet3.Asset_Model_No__c = 'Pro001';
+ Orderdet3.Consumable_Arrived_order__c = Order1.Id;
+ Orderdet3.Arrive_date__c = date.today();
+ Orderdet3.Used_date__c = date.today();
+ Orderdet3.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
+ Orderdet3.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJRJ';
+ Orderdet3.TracingCode__c = 'BXSYS';
+ //鍑哄簱
+ Consumable_order_details2__c Orderdet4 = new Consumable_order_details2__c();
+ Orderdet4.Name = 'OCM_01_001004';
+ Orderdet4.Consumable_order_minor__c = Order1.Id;
+ Orderdet4.Consumable_Product__c = pro1.Id;
+ Orderdet4.Asset_Model_No__c = 'Pro001';
+ Orderdet4.Consumable_Arrived_order__c = Order1.Id;
+ Orderdet4.Consumable_Shipment_order__c = Order1.Id;
+ Orderdet4.Send_Date__c = date.today();
+ Orderdet4.Arrive_date__c = date.today();
+ Orderdet4.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
+ Orderdet4.Bar_Code__c = '01049531702003111115120017181000105ZK250BX222';
+ Orderdet4.TracingCode__c = 'BXSYS';
+ //quxiao
+ Consumable_order_details2__c Orderdet5 = new Consumable_order_details2__c();
+ Orderdet5.Name = 'OCM_01_001005';
+ Orderdet5.Consumable_order_minor__c = Order1.Id;
+ Orderdet5.Consumable_Product__c = pro1.Id;
+ Orderdet5.Asset_Model_No__c = 'Pro001';
+ Orderdet5.Cancellation_Date__c = Date.today();
+ Orderdet5.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
+ Orderdet5.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJRZ';
+ Orderdet5.Box_Piece__c ='涓�';
+ Orderdet5.TracingCode__c = 'BXSYS';
+ //fanpin
+ Consumable_order_details2__c Orderdet6 = new Consumable_order_details2__c();
+ Orderdet6.Name = 'OCM_01_001006';
+ Orderdet6.Consumable_order_minor__c = Order1.Id;
+ Orderdet6.Consumable_Product__c = pro1.Id;
+ Orderdet6.Asset_Model_No__c = 'Pro001';
+ Orderdet6.Consumable_Return_order__c = Order2.Id;
+ Orderdet6.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
+ Orderdet6.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJRA';
+ Orderdet6.Box_Piece__c ='涓�';
+ Orderdet6.TracingCode__c = 'BXSYS';
- Consumable_order_details2__c Orderdet7 = new Consumable_order_details2__c();
- Orderdet7.Name = 'OCM_01_001001';
- Orderdet7.Consumable_order_minor__c = Order1.Id;
- Orderdet7.Consumable_Product__c = pro1.Id;
- Orderdet7.Asset_Model_No__c = 'Pro001';
- Orderdet7.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
- Orderdet7.Bar_Code__c = '01049531702003111115120017181000105ZK250BX333';
- Orderdet7.TracingCode__c = 'BXSYS';
- insert new List<Consumable_order_details2__c>{ Orderdet1, Orderdet2, Orderdet3, Orderdet4, Orderdet5, Orderdet6, Orderdet7 };
- ArriveGoodsController Controller = new ArriveGoodsController();
- System.Test.startTest();
- Controller.init();
- Controller.barcode = '01049531702003111115120017181000105ZK250BXAAA\n01049531702003111115120017181000105ZK250BXJRJ\n01049531702003111115120017181000105ZK250BXJRF\n01049531702003111115120017181000105ZK250BX123\n01049531702003111115120017181000105ZK250BX222';
- Controller.SearchPro();
- Controller.ArriveGoodsConfim();
- Controller.UpdateGoodsOfReturn();
- controller.getinventorysize();
- LexArriveGoodsController.Results re = LexArriveGoodsController.init('Arr', '');
+ Consumable_order_details2__c Orderdet7 = new Consumable_order_details2__c();
+ Orderdet7.Name = 'OCM_01_001001';
+ Orderdet7.Consumable_order_minor__c = Order1.Id;
+ Orderdet7.Consumable_Product__c = pro1.Id;
+ Orderdet7.Asset_Model_No__c = 'Pro001';
+ Orderdet7.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
+ Orderdet7.Bar_Code__c = '01049531702003111115120017181000105ZK250BX333';
+ Orderdet7.TracingCode__c = 'BXSYS';
+ insert new Consumable_order_details2__c[] {Orderdet1, Orderdet2,Orderdet3,Orderdet4,Orderdet5,Orderdet6,Orderdet7};
+ ArriveGoodsController Controller = new ArriveGoodsController();
+ System.Test.startTest();
+ Controller.init();
+ Controller.barcode = '01049531702003111115120017181000105ZK250BXAAA\n01049531702003111115120017181000105ZK250BXJRJ\n01049531702003111115120017181000105ZK250BXJRF\n01049531702003111115120017181000105ZK250BX123\n01049531702003111115120017181000105ZK250BX222';
+ Controller.SearchPro();
+ Controller.ArriveGoodsConfim();
+ Controller.UpdateGoodsOfReturn();
+ controller.getinventorysize();
+ LexArriveGoodsController.Results re = LexArriveGoodsController.init('Arr','');
String arrControllerStr = re.arrGoodCon;
- re = LexArriveGoodsController.searchProduct(
- '01049531702003111115120017181000105ZK250BXAAA\n01049531702003111115120017181000105ZK250BXJRJ\n01049531702003111115120017181000105ZK250BXJRF\n01049531702003111115120017181000105ZK250BX123\n01049531702003111115120017181000105ZK250BX222',
- arrControllerStr
- );
+ re = LexArriveGoodsController.searchProduct('01049531702003111115120017181000105ZK250BXAAA\n01049531702003111115120017181000105ZK250BXJRJ\n01049531702003111115120017181000105ZK250BXJRF\n01049531702003111115120017181000105ZK250BX123\n01049531702003111115120017181000105ZK250BX222', arrControllerStr);
arrControllerStr = re.arrGoodCon;
LexArriveGoodsController.arriveGoodsConfim(arrControllerStr);
LexArriveGoodsController.updateGoodsOfReturn(re.arrGoodCon, JSON.serialize(re.showGoodsofReturnList));
@@ -420,7 +320,7 @@
List<LexArriveGoodsController.ConsumableorderdetailsInfo> conList = new List<LexArriveGoodsController.ConsumableorderdetailsInfo>();
conList.add(con);
LexArriveGoodsController.changeType2(conList);
- System.Test.stopTest();
+ System.Test.stopTest();
}
}
-}
+}
\ No newline at end of file
diff --git a/force-app/main/default/classes/LexArriveGoodsControllerTest.cls-meta.xml b/force-app/main/default/classes/LexArriveGoodsControllerTest.cls-meta.xml
index a9fd6e9..754ecb1 100644
--- a/force-app/main/default/classes/LexArriveGoodsControllerTest.cls-meta.xml
+++ b/force-app/main/default/classes/LexArriveGoodsControllerTest.cls-meta.xml
@@ -1,4 +1,4 @@
-<?xml version="1.0" encoding="UTF-8" ?>
+<?xml version="1.0" encoding="UTF-8"?>
<ApexClass xmlns="http://soap.sforce.com/2006/04/metadata">
<apiVersion>57.0</apiVersion>
<status>Active</status>
diff --git a/force-app/main/default/classes/LexArriveGoodsControllerTest1.cls b/force-app/main/default/classes/LexArriveGoodsControllerTest1.cls
index ffb4887..d59dc74 100644
--- a/force-app/main/default/classes/LexArriveGoodsControllerTest1.cls
+++ b/force-app/main/default/classes/LexArriveGoodsControllerTest1.cls
@@ -1,214 +1,159 @@
@isTest
public class LexArriveGoodsControllerTest1 {
- static void test1() {
- NoteStay__c n = new NoteStay__c(Name = 'NoteStay', IsStay__c = true);
+ static void test1(){
+ NoteStay__c n = new NoteStay__c(Name = 'NoteStay',IsStay__c = true);
insert n;
- List<RecordType> rectCo = [
- SELECT Id
- FROM RecordType
- WHERE IsActive = TRUE AND SobjectType = 'Account' AND Name = '璨╁2搴�'
- ];
- if (rectCo.size() == 0) {
- return;
- }
- // Profile prof = [select Id from Profile where Name ='901_缁忛攢鍟嗙ぞ鍖烘櫘閫氭潈闄恄2閲嶉獙璇�(ET Email)'];
- Profile prof = [
- SELECT Id
- FROM Profile
- WHERE Name = '901_缁忛攢鍟嗙ぞ鍖烘櫘閫氭潈闄恄2閲嶉獙璇�(ET)'
- ];
+ List<RecordType> rectCo = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '璨╁2搴�'];
+ if (rectCo.size() == 0) {
+ return;
+ }
+ // Profile prof = [select Id from Profile where Name ='901_缁忛攢鍟嗙ぞ鍖烘櫘閫氭潈闄恄2閲嶉獙璇�(ET Email)'];
+ Profile prof = [select Id from Profile where Name ='901_缁忛攢鍟嗙ぞ鍖烘櫘閫氭潈闄恄2閲嶉獙璇�(ET)'];
- Account myAccount1 = new Account(
- Name = 'Testaccount001',
- Dealer_discount__c = 20,
- RecordTypeId = rectCo[0].Id,
- AgentCode_Ext__c = '9999996'
- );
- Account myAccount2 = new Account(
- Name = 'Testaccount002',
- Dealer_discount__c = 10,
- RecordTypeId = rectCo[0].Id,
- AgentCode_Ext__c = '9999900',
- Product_Limit_Date__c = 'Test01|2|4,Test02|3|5'
- );
- insert new List<Account>{ myAccount1, myAccount2 };
+ Account myAccount1 = new Account(Name='Testaccount001',Dealer_discount__c =20,RecordTypeId = rectCo[0].Id,AgentCode_Ext__c = '9999996');
+ Account myAccount2 = new Account(Name='Testaccount002',Dealer_discount__c =10,RecordTypeId = rectCo[0].Id,AgentCode_Ext__c = '9999900',Product_Limit_Date__c = 'Test01|2|4,Test02|3|5');
+ insert new Account[]{myAccount1,myAccount2};
- Contact core = new Contact(email = 'jplumber@salesforce.com', firstname = 'Joe', lastname = 'Plumber', accountid = myAccount1.id);
- insert core;
- user MyUser_Test = new User(
- ContactId = core.id,
- Alias = 'newUser',
- Email = 'newuser@testorg.com',
- EmailEncodingKey = 'UTF-8',
- LastName = 'TestUser',
- LanguageLocaleKey = 'zh_CN',
- LocaleSidKey = 'zh_CN',
- ProfileId = prof.Id,
- TimeZoneSidKey = 'Asia/Shanghai',
- UserName = 'testUser@testorg.com',
- UserPro_Type__c = 'ET'
- );
- System.runAs(new User(Id = UserInfo.getUserId())) {
+ Contact core = new Contact(email='jplumber@salesforce.com', firstname='Joe',lastname='Plumber',accountid=myAccount1.id);
+ insert core;
+ user MyUser_Test = New User(ContactId = core.id,Alias = 'newUser',Email='newuser@testorg.com',EmailEncodingKey='UTF-8', LastName='TestUser', LanguageLocaleKey='zh_CN',LocaleSidKey='zh_CN', ProfileId = prof.Id,TimeZoneSidKey='Asia/Shanghai', UserName='testUser@testorg.com',UserPro_Type__c = 'ET');
+ System.runAs(new User(Id = UserInfo.getUserId())){
insert MyUser_Test;
}
- // User MyUser_Test = [select id,Contact.accountid from User WHERE ProfileId = :prof.Id and IsActive = true and UserPro_Type__c = 'ET' limit 1 ];
- // Product2 prod01 = new Product2(Name='Test01',ProductCode='Test01',Asset_Model_No__c = 'Test01',SFDA_Status__c = '鏈夊姽',JANCODE__c = '04953170200311',Dealer_special_Object__c = true,Manual_Entry__c = false);
- // Product2 prod02 = new Product2(Name='Test02',ProductCode='Test02',Asset_Model_No__c = 'Test02',SFDA_Status__c = '鏈夊姽',JANCODE__c = '04953170200312',Dealer_special_Object__c = true,Manual_Entry__c = false);
- // insert new Product2[] {prod01,prod02};
- System.runAs(MyUser_Test) {
- Product2 prod01 = new Product2(
- Name = 'Test01',
- ProductCode = 'Test01',
- Asset_Model_No__c = 'Test01',
- RecordTypeId = '01210000000aMAFAA2',
- SFDA_Status__c = '鏈夊姽',
- JANCODE__c = '04953170200311',
- Dealer_special_Object__c = true,
- Manual_Entry__c = false
- );
- Product2 prod02 = new Product2(
- Name = 'Test02',
- ProductCode = 'Test02',
- Asset_Model_No__c = 'Test02',
- RecordTypeId = '01210000000aMAFAA2',
- SFDA_Status__c = '鏈夊姽',
- JANCODE__c = '04953170200312',
- Dealer_special_Object__c = true,
- Manual_Entry__c = false
- );
- insert new List<Product2>{ prod01, prod02 };
- Product2__c pro1 = new Product2__c(Name = 'Pro001', OT_CODE_Text__c = 'Test001', Product2__c = prod01.Id);
- Product2__c pro2 = new Product2__c(Name = 'Pro002', OT_CODE_Text__c = 'Test002', Product2__c = prod02.Id);
- insert new List<Product2__c>{ pro1, pro2 };
- //璁㈠崟
- Consumable_order__c Order1 = new Consumable_order__c();
- Order1.Name = 'OCM_01_001';
- Order1.Order_status__c = '鎵瑰噯';
- Order1.Order_type__c = '璁㈠崟';
- // Order1.Dealer_Info__c = myAccount1.id;
- Order1.RecordTypeid = System.Label.RT_ConOrder_Delivery;
- Order1.Total_num__c = 3;
- Order1.OrderNumber_arrived__c = 1;
- Order1.Delivery_detail_count__c = 1;
- Order1.Order_ProType__c = 'ET';
- insert Order1;
+ // User MyUser_Test = [select id,Contact.accountid from User WHERE ProfileId = :prof.Id and IsActive = true and UserPro_Type__c = 'ET' limit 1 ];
+ // Product2 prod01 = new Product2(Name='Test01',ProductCode='Test01',Asset_Model_No__c = 'Test01',SFDA_Status__c = '鏈夊姽',JANCODE__c = '04953170200311',Dealer_special_Object__c = true,Manual_Entry__c = false);
+ // Product2 prod02 = new Product2(Name='Test02',ProductCode='Test02',Asset_Model_No__c = 'Test02',SFDA_Status__c = '鏈夊姽',JANCODE__c = '04953170200312',Dealer_special_Object__c = true,Manual_Entry__c = false);
+ // insert new Product2[] {prod01,prod02};
+ system.runAs(MyUser_Test){
+ Product2 prod01 = new Product2(Name='Test01',ProductCode='Test01',Asset_Model_No__c = 'Test01',RecordTypeId = '01210000000aMAFAA2',SFDA_Status__c = '鏈夊姽',JANCODE__c = '04953170200311',Dealer_special_Object__c = true,Manual_Entry__c = false);
+ Product2 prod02 = new Product2(Name='Test02',ProductCode='Test02',Asset_Model_No__c = 'Test02',RecordTypeId = '01210000000aMAFAA2',SFDA_Status__c = '鏈夊姽',JANCODE__c = '04953170200312',Dealer_special_Object__c = true,Manual_Entry__c = false);
+ insert new Product2[] {prod01,prod02};
+ Product2__c pro1 = new Product2__c(Name='Pro001',OT_CODE_Text__c='Test001',Product2__c = prod01.Id);
+ Product2__c pro2 = new Product2__c(Name='Pro002',OT_CODE_Text__c='Test002',Product2__c = prod02.Id);
+ insert new Product2__c[] {pro1, pro2};
+ //璁㈠崟
+ Consumable_order__c Order1 = new Consumable_order__c();
+ Order1.Name = 'OCM_01_001';
+ Order1.Order_status__c = '鎵瑰噯';
+ Order1.Order_type__c = '璁㈠崟';
+ // Order1.Dealer_Info__c = myAccount1.id;
+ Order1.RecordTypeid = System.Label.RT_ConOrder_Delivery;
+ Order1.Total_num__c = 3;
+ Order1.OrderNumber_arrived__c =1;
+ Order1.Delivery_detail_count__c=1;
+ Order1.Order_ProType__c = 'ET';
+ insert Order1;
- //璁㈠崟鏄庣粏
- //fahuo
- Consumable_orderdetails__c Orderdet = new Consumable_orderdetails__c();
- Orderdet.Name = 'OCM_01_00101';
- Orderdet.Consumable_order__c = Order1.Id;
- Orderdet.RecordTypeId = System.Label.RT_ConOrderDetail1_Order;
- Orderdet.Consumable_Product__c = pro1.Id;
- Orderdet.Consumable_count__c = 40;
- insert Orderdet;
+ //璁㈠崟鏄庣粏
+ //fahuo
+ Consumable_orderdetails__c Orderdet = new Consumable_orderdetails__c();
+ Orderdet.Name = 'OCM_01_00101';
+ Orderdet.Consumable_order__c = Order1.Id;
+ Orderdet.RecordTypeId = System.Label.RT_ConOrderDetail1_Order;
+ Orderdet.Consumable_Product__c = pro1.Id;
+ Orderdet.Consumable_count__c = 40;
+ insert Orderdet;
- //鍙戣揣鏄庣粏
- //鍒拌揣姝g‘淇℃伅
- Consumable_order_details2__c Orderdet1 = new Consumable_order_details2__c();
- Orderdet1.Name = 'OCM_01_001002';
- Orderdet1.Consumable_order_minor__c = Order1.Id;
- Orderdet1.Consumable_Product__c = pro1.Id;
- Orderdet1.Asset_Model_No__c = 'Test01';
- Orderdet1.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
- Orderdet1.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJRA';
- Orderdet1.TracingCode__c = 'BXJRA';
+ //鍙戣揣鏄庣粏
+ //鍒拌揣姝g‘淇℃伅
+ Consumable_order_details2__c Orderdet1 = new Consumable_order_details2__c();
+ Orderdet1.Name = 'OCM_01_001002';
+ Orderdet1.Consumable_order_minor__c = Order1.Id;
+ Orderdet1.Consumable_Product__c = pro1.Id;
+ Orderdet1.Asset_Model_No__c = 'Test01';
+ Orderdet1.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
+ Orderdet1.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJRA';
+ Orderdet1.TracingCode__c = 'BXJRA';
- //鍙栨秷浜у搧
- Consumable_order_details2__c Orderdet2 = new Consumable_order_details2__c();
- Orderdet2.Name = 'OCM_01_001003';
- Orderdet2.Consumable_order_minor__c = Order1.Id;
- Orderdet2.Consumable_Product__c = pro1.Id;
- Orderdet2.Asset_Model_No__c = 'Test01';
- //Orderdet2.Consumable_Arrived_order__c = Order1.Id;
- Orderdet2.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
- Orderdet2.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJRB';
- Orderdet2.Cancellation_Date__c = Date.today();
- Orderdet2.TracingCode__c = 'BXJRB';
- //閿�鍞骇鍝�
- Consumable_order_details2__c Orderdet3 = new Consumable_order_details2__c();
- Orderdet3.Name = 'OCM_01_001004';
- Orderdet3.Consumable_order_minor__c = Order1.Id;
- Orderdet3.Consumable_Product__c = pro1.Id;
- Orderdet3.Asset_Model_No__c = 'Test01';
- Orderdet3.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
- Orderdet3.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJRC';
- Orderdet3.Used_date__c = Date.today();
- Orderdet3.Arrive_date__c = Date.today();
- Orderdet3.TracingCode__c = 'BXJRC';
- //Orderdet3.Box_Piece__c = '鐩�';
+ //鍙栨秷浜у搧
+ Consumable_order_details2__c Orderdet2 = new Consumable_order_details2__c();
+ Orderdet2.Name = 'OCM_01_001003';
+ Orderdet2.Consumable_order_minor__c = Order1.Id;
+ Orderdet2.Consumable_Product__c = pro1.Id;
+ Orderdet2.Asset_Model_No__c = 'Test01';
+ //Orderdet2.Consumable_Arrived_order__c = Order1.Id;
+ Orderdet2.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
+ Orderdet2.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJRB';
+ Orderdet2.Cancellation_Date__c= Date.today();
+ Orderdet2.TracingCode__c = 'BXJRB';
+ //閿�鍞骇鍝�
+ Consumable_order_details2__c Orderdet3 = new Consumable_order_details2__c();
+ Orderdet3.Name = 'OCM_01_001004';
+ Orderdet3.Consumable_order_minor__c = Order1.Id;
+ Orderdet3.Consumable_Product__c = pro1.Id;
+ Orderdet3.Asset_Model_No__c = 'Test01';
+ Orderdet3.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
+ Orderdet3.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJRC';
+ Orderdet3.Used_date__c = Date.today();
+ Orderdet3.Arrive_date__c = Date.today();
+ Orderdet3.TracingCode__c = 'BXJRC';
+ //Orderdet3.Box_Piece__c = '鐩�';
- //鍑哄簱浜у搧
- Consumable_order_details2__c Orderdet4 = new Consumable_order_details2__c();
- Orderdet4.Name = 'OCM_01_001005';
- Orderdet4.Consumable_order_minor__c = Order1.Id;
- Orderdet4.Consumable_Product__c = pro1.Id;
- Orderdet4.Asset_Model_No__c = 'Test01';
- Orderdet4.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
- Orderdet4.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJRD';
- Orderdet4.Send_Date__c = Date.today();
- Orderdet4.Arrive_date__c = Date.today();
- Orderdet4.TracingCode__c = 'BXJRD';
- //宸插埌璐т骇鍝�
- Consumable_order_details2__c Orderdet5 = new Consumable_order_details2__c();
- Orderdet5.Name = 'OCM_01_001006';
- Orderdet5.Consumable_order_minor__c = Order1.Id;
- Orderdet5.Consumable_Product__c = pro1.Id;
- Orderdet5.Asset_Model_No__c = 'Test01';
- Orderdet5.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
- Orderdet5.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJRE';
- Orderdet5.Arrive_date__c = Date.today();
- Orderdet5.TracingCode__c = 'BXJRE';
+ //鍑哄簱浜у搧
+ Consumable_order_details2__c Orderdet4 = new Consumable_order_details2__c();
+ Orderdet4.Name = 'OCM_01_001005';
+ Orderdet4.Consumable_order_minor__c = Order1.Id;
+ Orderdet4.Consumable_Product__c = pro1.Id;
+ Orderdet4.Asset_Model_No__c = 'Test01';
+ Orderdet4.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
+ Orderdet4.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJRD';
+ Orderdet4.Send_Date__c = Date.today();
+ Orderdet4.Arrive_date__c = Date.today();
+ Orderdet4.TracingCode__c = 'BXJRD';
- //鍙戣揣鏄庣粏
- //绠$悊缂栫爜鍖呭惈鏁板瓧
- Consumable_order_details2__c Orderdet6 = new Consumable_order_details2__c();
- Orderdet6.Name = 'OCM_01_001002';
- Orderdet6.Consumable_order_minor__c = Order1.Id;
- Orderdet6.Consumable_Product__c = pro1.Id;
- Orderdet6.Asset_Model_No__c = 'Test01';
- Orderdet6.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
- Orderdet6.Bar_Code__c = '01049531702003111115120017181000105ZK250BX123';
- Orderdet6.TracingCode__c = 'BX123';
+ //宸插埌璐т骇鍝�
+ Consumable_order_details2__c Orderdet5 = new Consumable_order_details2__c();
+ Orderdet5.Name = 'OCM_01_001006';
+ Orderdet5.Consumable_order_minor__c = Order1.Id;
+ Orderdet5.Consumable_Product__c = pro1.Id;
+ Orderdet5.Asset_Model_No__c = 'Test01';
+ Orderdet5.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
+ Orderdet5.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJRE';
+ Orderdet5.Arrive_date__c = Date.today();
+ Orderdet5.TracingCode__c = 'BXJRE';
- //鍙戦敊搴� 鏈埌璐�
- Consumable_order_details2__c Orderdets8 = new Consumable_order_details2__c();
- Orderdets8.Name = 'OCM_01_001011';
- Orderdets8.Consumable_order_minor__c = Order1.Id;
- Orderdets8.Consumable_Product__c = pro1.Id;
- Orderdets8.Asset_Model_No__c = 'Test01';
- Orderdets8.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
- Orderdets8.Bar_Code__c = '01049531702003111115120017181000105ZK250BXsys';
- Orderdets8.Box_Piece__c = '鐩�';
- Orderdets8.TracingCode__c = 'BXsys';
+ //鍙戣揣鏄庣粏
+ //绠$悊缂栫爜鍖呭惈鏁板瓧
+ Consumable_order_details2__c Orderdet6 = new Consumable_order_details2__c();
+ Orderdet6.Name = 'OCM_01_001002';
+ Orderdet6.Consumable_order_minor__c = Order1.Id;
+ Orderdet6.Consumable_Product__c = pro1.Id;
+ Orderdet6.Asset_Model_No__c = 'Test01';
+ Orderdet6.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
+ Orderdet6.Bar_Code__c = '01049531702003111115120017181000105ZK250BX123';
+ Orderdet6.TracingCode__c = 'BX123';
- insert new List<Consumable_order_details2__c>{ Orderdet1, Orderdet2, Orderdet3, Orderdet4, Orderdet5, Orderdet6, Orderdets8 };
+ //鍙戦敊搴� 鏈埌璐�
+ Consumable_order_details2__c Orderdets8 = new Consumable_order_details2__c();
+ Orderdets8.Name = 'OCM_01_001011';
+ Orderdets8.Consumable_order_minor__c = Order1.Id;
+ Orderdets8.Consumable_Product__c = pro1.Id;
+ Orderdets8.Asset_Model_No__c = 'Test01';
+ Orderdets8.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
+ Orderdets8.Bar_Code__c = '01049531702003111115120017181000105ZK250BXsys';
+ Orderdets8.Box_Piece__c = '鐩�';
+ Orderdets8.TracingCode__c = 'BXsys';
- List<Consumable_orderdetails__c> cod1 = [
- SELECT Id
- FROM Consumable_orderdetails__c
- WHERE Consumable_order__c = :Order1.Id
- ];
- System.assertEquals(1, cod1.size());
+ insert new Consumable_order_details2__c[] {Orderdet1, Orderdet2,Orderdet3,Orderdet4,Orderdet5,Orderdet6,Orderdets8};
- PageReference page = new PageReference('/apex/ArriveGoods?Esetid=' + Order1.Id);
+ List<Consumable_orderdetails__c> cod1 = [select Id from Consumable_orderdetails__c WHERE Consumable_order__c = :Order1.Id];
+ System.assertEquals(1, cod1.size());
- System.Test.setCurrentPage(page);
- ArriveGoodsController Controller = new ArriveGoodsController();
- //鍒濆鍖栨祴璇�
- System.Test.startTest();
- LexArriveGoodsController.Results re = LexArriveGoodsController.init('Arr', Order1.Id);
+ PageReference page = new PageReference('/apex/ArriveGoods?Esetid=' + Order1.Id);
+
+ System.Test.setCurrentPage(page);
+ ArriveGoodsController Controller = new ArriveGoodsController();
+ //鍒濆鍖栨祴璇�
+ System.Test.startTest();
+ LexArriveGoodsController.Results re = LexArriveGoodsController.init('Arr', Order1.Id);
String arrControllerStr = re.arrGoodCon;
LexArriveGoodsController.searchProduct('', arrControllerStr);
- re = LexArriveGoodsController.searchProduct(
- '01049531702003111115120017181000105ZK250BXJRA\n01049531702003111115120017181000105ZK250BXsys\n01049531702003111115120017181000105ZK250BXsun\n01049531702003111115120017181000105ZK250BXJRB\n01049531702003111115120017181000105ZK250BXJRC\n01049531702003111115120017181000105ZK250BX111\n01049531702003111115120017181000105ZK250BXJRD\n01049531702003111115120017181000105ZK250BXJRE\n01049531702003111115120017181000105ZK250BXJRF\n01049531702003111115120017181000105ZK250BXJRG\n01049531702003111115120017181000105ZK250BX123',
- arrControllerStr
- );
+ re = LexArriveGoodsController.searchProduct('01049531702003111115120017181000105ZK250BXJRA\n01049531702003111115120017181000105ZK250BXsys\n01049531702003111115120017181000105ZK250BXsun\n01049531702003111115120017181000105ZK250BXJRB\n01049531702003111115120017181000105ZK250BXJRC\n01049531702003111115120017181000105ZK250BX111\n01049531702003111115120017181000105ZK250BXJRD\n01049531702003111115120017181000105ZK250BXJRE\n01049531702003111115120017181000105ZK250BXJRF\n01049531702003111115120017181000105ZK250BXJRG\n01049531702003111115120017181000105ZK250BX123', arrControllerStr);
arrControllerStr = re.arrGoodCon;
LexArriveGoodsController.arriveGoodsConfim(arrControllerStr);
- System.Test.stopTest();
+ System.Test.stopTest();
}
}
-}
+}
\ No newline at end of file
diff --git a/force-app/main/default/classes/LexArriveGoodsControllerTest1.cls-meta.xml b/force-app/main/default/classes/LexArriveGoodsControllerTest1.cls-meta.xml
index a9fd6e9..754ecb1 100644
--- a/force-app/main/default/classes/LexArriveGoodsControllerTest1.cls-meta.xml
+++ b/force-app/main/default/classes/LexArriveGoodsControllerTest1.cls-meta.xml
@@ -1,4 +1,4 @@
-<?xml version="1.0" encoding="UTF-8" ?>
+<?xml version="1.0" encoding="UTF-8"?>
<ApexClass xmlns="http://soap.sforce.com/2006/04/metadata">
<apiVersion>57.0</apiVersion>
<status>Active</status>
diff --git a/force-app/main/default/classes/LexArriveGoodsMainController.cls b/force-app/main/default/classes/LexArriveGoodsMainController.cls
index 3e7d7cf..b5652b6 100644
--- a/force-app/main/default/classes/LexArriveGoodsMainController.cls
+++ b/force-app/main/default/classes/LexArriveGoodsMainController.cls
@@ -1,224 +1,233 @@
public without sharing class LexArriveGoodsMainController {
- /*****************妞滅储鐢�******************/
- //缁忛攢鍟嗕骇鍝佸垎绫�
- public static String agencyProType { get; set; }
- // public static Consumable_order__c coc { get; set; }
- public static String category1 { get; set; }
- private static String cate1ForSort = null;
- private static Date cate2ForSort = Date.today();
- private static Date cate2 = Date.today();
- private static String[] columus = new List<String>{ 'Product2__c.Name' };
- // 浜у搧 ID
- private static String ESetId = '';
- private static String accountid = null;
- // 璁㈠崟 瀛楁鏍囩
- public static List<String> title { get; private set; }
- // 璁㈠崟 瀛楁鍚�
- public static List<String> column;
- public static List<List<String>> columns { get; private set; }
- // 鐢婚潰鏄剧ず鏁版嵁
- public static List<Consumable_order__c> raesList { get; private set; }
- // 鐧诲綍鑰呭伐浣滃湴
- private static String userWorkLocation;
- // 20200904 ljh 姹囨�讳娇鐢� start
- public static Integer Total_num { get; set; }
- public static Integer OrderNumber_arrived { get; set; }
- public static Integer Delivery_detail_count { get; set; }
- public static Integer OrderNumber_notarrive { get; set; }
- public static Integer More_than_seven_days { get; set; }
+ /*****************妞滅储鐢�******************/
+ //缁忛攢鍟嗕骇鍝佸垎绫�
+ public static String agencyProType { get; set; }
+ // public static Consumable_order__c coc { get; set; }
+ public static String category1 { get; set; }
+ private static String cate1ForSort = null;
+ private static Date cate2ForSort = Date.today();
+ private static Date cate2 = Date.today();
+ private static String[] columus = new List<String>{ 'Product2__c.Name' };
+ // 浜у搧 ID
+ private static String ESetId = '';
+ private static String accountid = null;
+ // 璁㈠崟 瀛楁鏍囩
+ public static List<String> title { get; private set; }
+ // 璁㈠崟 瀛楁鍚�
+ public static List<String> column;
+ public static List<List<String>> columns { get; private set; }
+ // 鐢婚潰鏄剧ず鏁版嵁
+ public static List<Consumable_order__c> raesList { get; private set; }
+ // 鐧诲綍鑰呭伐浣滃湴
+ private static String userWorkLocation;
+ // 20200904 ljh 姹囨�讳娇鐢� start
+ public static Integer Total_num { get; set; }
+ public static Integer OrderNumber_arrived { get; set; }
+ public static Integer Delivery_detail_count { get; set; }
+ public static Integer OrderNumber_notarrive { get; set; }
+ public static Integer More_than_seven_days { get; set; }
- @AuraEnabled
- public static Results init() {
- Results results = new Results();
- results.isNoteStay = LexUtility.getIsNoteStay();
- try {
- // coc = new Consumable_order__c();
- String userId = UserInfo.getUserId();
- List<user> Useracc = new List<user>();
- Useracc = [
- SELECT accountid, Work_Location__c, UserPro_Type__c
- FROM user
- WHERE id = :userId
- ];
- accountid = Useracc[0].accountid;
- userWorkLocation = Useracc[0].Work_Location__c;
- agencyProType = Useracc[0].UserPro_Type__c;
- if (String.isBlank(Useracc[0].UserPro_Type__c)) {
- agencyProType = 'ET';
- }
- // 鑾峰緱璁㈠崟涓�瑙�
- Map<String, Schema.FieldSet> fsMap = Schema.getGlobalDescribe().get('Consumable_order__c').getDescribe().fieldSets.getMap();
- Schema.FieldSet fs = fsMap.get('arrive_view');
- // 鑾峰緱璁㈠崟涓殑鎵�鏈夐」鐩�
- List<FieldSetMember> fsmList = fs.getFields();
- // 鑾峰緱瀛楁鏍囩鍜屽瓧娈靛悕
- title = new List<String>();
- column = new List<String>();
- columns = new List<List<String>>();
- for (FieldSetMember fsm : fsmList) {
- title.add(fsm.getLabel());
- column.add(fsm.getFieldPath());
- columns.add(fsm.getFieldPath().split('\\.'));
- }
- // 鑾峰緱鏄剧ず鏁版嵁
- raesList = new List<Consumable_order__c>();
- String soql = 'select Id';
- for (String s : column) {
- soql += ',' + s;
- }
- soql +=
- ' from Consumable_order__c where Order_type__c = \'' +
- '璁㈠崟' +
- '\' and recordtypeid =\'' +
- System.Label.RT_ConOrder_Delivery +
- '\' and Dealer_Info__c =\'' +
- accountid +
- '\' and Order_ProType__c =\'' +
- agencyProType +
- '\' and (OrderNumber_notarrive__c > 0 or Delivery_detail_count__c >0) and Order_Owner_WorkLocal__c = \'' +
- userWorkLocation +
- '\' and showFalseNotshowTrue__c = false order by Deliver_date__c'; //
- // soql = 'select id,name,ContractNo__c,Total_num__c,OrderNumber_arrived__c,Delivery_detail_count__c,OrderNumber_notarrive__c,More_than_seven_days__c,Shipment_date__c,First_Delivery__c from Consumable_order__c where id in :idList';
- raesList = Database.query(soql);
- //20200904 ljh add start
- Total_num = 0;
- OrderNumber_arrived = 0;
- Delivery_detail_count = 0;
- OrderNumber_notarrive = 0;
- More_than_seven_days = 0;
- System.debug('-----1------' + raesList);
- for (Consumable_order__c conorder : raesList) {
- if (conorder.Total_num__c != null) {
- Total_num += (Integer) conorder.Total_num__c;
- }
- if (conorder.OrderNumber_arrived__c != null) {
- OrderNumber_arrived += (Integer) conorder.OrderNumber_arrived__c;
- }
- if (conorder.Delivery_detail_count__c != null) {
- Delivery_detail_count += (Integer) conorder.Delivery_detail_count__c;
- }
- if (conorder.OrderNumber_notarrive__c != null) {
- OrderNumber_notarrive += (Integer) conorder.OrderNumber_notarrive__c;
- }
- if (conorder.More_than_seven_days__c != null) {
- More_than_seven_days += (Integer) conorder.More_than_seven_days__c;
- }
- }
- results.agencyProType = agencyProType;
- results.accountId = accountid;
- results.title = title;
- results.raesList = raesList;
- results.userWorkLocation = userWorkLocation;
- results.totalNum = Total_num;
- results.orderNumberArrived = OrderNumber_arrived;
- results.deliveryDetailCount = Delivery_detail_count;
- results.orderNumberNotarrive = OrderNumber_notarrive;
- results.moreThanSevenDays = More_than_seven_days;
- results.result = 'Success';
- } catch (Exception e) {
- results.result = 'Fail';
- results.errorMsg = e.getLineNumber() + '---' + e.getMessage();
+ @AuraEnabled
+ public static Results init() {
+ Results results = new Results();
+ results.isNoteStay = LexUtility.getIsNoteStay();
+ try {
+ // coc = new Consumable_order__c();
+ String userId = UserInfo.getUserId();
+ List<user> Useracc = new List<user>();
+ Useracc = [
+ SELECT accountid, Work_Location__c, UserPro_Type__c
+ FROM user
+ WHERE id = :userId
+ ];
+ accountid = Useracc[0].accountid;
+ userWorkLocation = Useracc[0].Work_Location__c;
+ agencyProType = Useracc[0].UserPro_Type__c;
+ if (String.isBlank(Useracc[0].UserPro_Type__c)) {
+ agencyProType = 'ET';
+ }
+ // 鑾峰緱璁㈠崟涓�瑙�
+ Map<String, Schema.FieldSet> fsMap = Schema.getGlobalDescribe()
+ .get('Consumable_order__c')
+ .getDescribe()
+ .fieldSets.getMap();
+ Schema.FieldSet fs = fsMap.get('arrive_view');
+ // 鑾峰緱璁㈠崟涓殑鎵�鏈夐」鐩�
+ List<FieldSetMember> fsmList = fs.getFields();
+ // 鑾峰緱瀛楁鏍囩鍜屽瓧娈靛悕
+ title = new List<String>();
+ column = new List<String>();
+ columns = new List<List<String>>();
+ for (FieldSetMember fsm : fsmList) {
+ title.add(fsm.getLabel());
+ column.add(fsm.getFieldPath());
+ columns.add(fsm.getFieldPath().split('\\.'));
+ }
+ // 鑾峰緱鏄剧ず鏁版嵁
+ raesList = new List<Consumable_order__c>();
+ String soql = 'select Id';
+ for (String s : column) {
+ soql += ',' + s;
+ }
+ soql +=
+ ' from Consumable_order__c where Order_type__c = \'' +
+ '璁㈠崟' +
+ '\' and recordtypeid =\'' +
+ System.Label.RT_ConOrder_Delivery +
+ '\' and Dealer_Info__c =\'' +
+ accountid +
+ '\' and Order_ProType__c =\'' +
+ agencyProType +
+ '\' and (OrderNumber_notarrive__c > 0 or Delivery_detail_count__c >0) and Order_Owner_WorkLocal__c = \'' +
+ userWorkLocation +
+ '\' and showFalseNotshowTrue__c = false order by Deliver_date__c'; //
+ // soql = 'select id,name,ContractNo__c,Total_num__c,OrderNumber_arrived__c,Delivery_detail_count__c,OrderNumber_notarrive__c,More_than_seven_days__c,Shipment_date__c,First_Delivery__c from Consumable_order__c where id in :idList';
+ raesList = Database.query(soql);
+ //20200904 ljh add start
+ Total_num = 0;
+ OrderNumber_arrived = 0;
+ Delivery_detail_count = 0;
+ OrderNumber_notarrive = 0;
+ More_than_seven_days = 0;
+ System.debug('-----1------' + raesList);
+ for (Consumable_order__c conorder : raesList) {
+ if (conorder.Total_num__c != null) {
+ Total_num += (Integer) conorder.Total_num__c;
}
- return results;
- }
-
- @AuraEnabled
- public static Results searchConsumableorderdetails(
- String category1Str,
- Date cate2Str,
- String accountidStr,
- String userWorkLocationStr,
- String agencyProTypeStr
- ) {
- Results results = new Results();
- category1 = category1Str;
- cate2 = cate2Str;
- accountid = accountidStr;
- userWorkLocation = userWorkLocationStr;
- agencyProType = agencyProTypeStr;
- try {
- // cate2 = coc.Shipment_date__c;
- // 鑾峰緱璁㈠崟涓�瑙�
- Map<String, Schema.FieldSet> fsMap = Schema.getGlobalDescribe().get('Consumable_order__c').getDescribe().fieldSets.getMap();
- Schema.FieldSet fs = fsMap.get('arrive_view');
- // 鑾峰緱璁㈠崟涓殑鎵�鏈夐」鐩�
- List<FieldSetMember> fsmList = fs.getFields();
- // 鑾峰緱瀛楁鏍囩鍜屽瓧娈靛悕
- title = new List<String>();
- column = new List<String>();
- columns = new List<List<String>>();
- for (FieldSetMember fsm : fsmList) {
- title.add(fsm.getLabel());
- column.add(fsm.getFieldPath());
- columns.add(fsm.getFieldPath().split('\\.'));
- }
- // 鑾峰緱鏄剧ず鏁版嵁
- raesList = new List<Consumable_order__c>();
- String soql = 'select Id';
- for (String s : column) {
- soql += ',' + s;
- }
- soql +=
- ' from Consumable_order__c where Order_type__c = \'' +
- '璁㈠崟' +
- '\' and recordtypeid =\'' +
- System.Label.RT_ConOrder_Delivery +
- '\' and Dealer_Info__c =\'' +
- accountid +
- '\' and (OrderNumber_notarrive__c > 0 or Delivery_detail_count__c >0) ';
- soql += 'and Order_Owner_WorkLocal__c = \'' + userWorkLocation + '\' ';
- soql += 'and showFalseNotshowTrue__c = false';
- if (!String.isBlank(category1)) {
- soql += ' and Name like \'%' + String.escapeSingleQuotes(category1.replaceAll('%', '\\%')) + '%\' ';
- }
- if (cate2 != null) {
- soql += ' and Shipment_date__c = :cate2 ';
- }
- soql += ' and Order_ProType__c =\'' + agencyProType + '\'';
- soql += ' order by Deliver_date__c';
- system.debug('====soql:' + soql);
- raesList = Database.query(soql);
- results.raesList = raesList;
- results.result = 'Success';
- } catch (Exception e) {
- results.result = 'Fail';
- results.errorMsg = e.getLineNumber() + '---' + e.getMessage();
+ if (conorder.OrderNumber_arrived__c != null) {
+ OrderNumber_arrived += (Integer) conorder.OrderNumber_arrived__c;
}
- return results;
+ if (conorder.Delivery_detail_count__c != null) {
+ Delivery_detail_count += (Integer) conorder.Delivery_detail_count__c;
+ }
+ if (conorder.OrderNumber_notarrive__c != null) {
+ OrderNumber_notarrive += (Integer) conorder.OrderNumber_notarrive__c;
+ }
+ if (conorder.More_than_seven_days__c != null) {
+ More_than_seven_days += (Integer) conorder.More_than_seven_days__c;
+ }
+ }
+ results.agencyProType = agencyProType;
+ results.accountId = accountid;
+ results.title = title;
+ results.raesList = raesList;
+ results.userWorkLocation = userWorkLocation;
+ results.totalNum = Total_num;
+ results.orderNumberArrived = OrderNumber_arrived;
+ results.deliveryDetailCount = Delivery_detail_count;
+ results.orderNumberNotarrive = OrderNumber_notarrive;
+ results.moreThanSevenDays = More_than_seven_days;
+ results.result = 'Success';
+ } catch (Exception e) {
+ results.result = 'Fail';
+ results.errorMsg = e.getLineNumber() + '---' + e.getMessage();
}
+ return results;
+ }
- public class Results {
- @AuraEnabled
- public String result;
- @AuraEnabled
- public String errorMsg;
- @AuraEnabled
- public String agencyProType;
- @AuraEnabled
- public String category1;
- @AuraEnabled
- public Date cate2;
- @AuraEnabled
- public String eSetId;
- @AuraEnabled
- public String accountId;
- @AuraEnabled
- public List<String> title;
- @AuraEnabled
- public List<Consumable_order__c> raesList;
- @AuraEnabled
- public String userWorkLocation;
- @AuraEnabled
- public Integer totalNum;
- @AuraEnabled
- public Integer orderNumberArrived;
- @AuraEnabled
- public Integer deliveryDetailCount;
- @AuraEnabled
- public Integer orderNumberNotarrive;
- @AuraEnabled
- public Integer moreThanSevenDays;
- @AuraEnabled
- public Boolean isNoteStay;
+ @AuraEnabled
+ public static Results searchConsumableorderdetails(
+ String category1Str,
+ Date cate2Str,
+ String accountidStr,
+ String userWorkLocationStr,
+ String agencyProTypeStr
+ ) {
+ Results results = new Results();
+ category1 = category1Str;
+ cate2 = cate2Str;
+ accountid = accountidStr;
+ userWorkLocation = userWorkLocationStr;
+ agencyProType = agencyProTypeStr;
+ try {
+ // cate2 = coc.Shipment_date__c;
+ // 鑾峰緱璁㈠崟涓�瑙�
+ Map<String, Schema.FieldSet> fsMap = Schema.getGlobalDescribe()
+ .get('Consumable_order__c')
+ .getDescribe()
+ .fieldSets.getMap();
+ Schema.FieldSet fs = fsMap.get('arrive_view');
+ // 鑾峰緱璁㈠崟涓殑鎵�鏈夐」鐩�
+ List<FieldSetMember> fsmList = fs.getFields();
+ // 鑾峰緱瀛楁鏍囩鍜屽瓧娈靛悕
+ title = new List<String>();
+ column = new List<String>();
+ columns = new List<List<String>>();
+ for (FieldSetMember fsm : fsmList) {
+ title.add(fsm.getLabel());
+ column.add(fsm.getFieldPath());
+ columns.add(fsm.getFieldPath().split('\\.'));
+ }
+ // 鑾峰緱鏄剧ず鏁版嵁
+ raesList = new List<Consumable_order__c>();
+ String soql = 'select Id';
+ for (String s : column) {
+ soql += ',' + s;
+ }
+ soql +=
+ ' from Consumable_order__c where Order_type__c = \'' +
+ '璁㈠崟' +
+ '\' and recordtypeid =\'' +
+ System.Label.RT_ConOrder_Delivery +
+ '\' and Dealer_Info__c =\'' +
+ accountid +
+ '\' and (OrderNumber_notarrive__c > 0 or Delivery_detail_count__c >0) ';
+ soql += 'and Order_Owner_WorkLocal__c = \'' + userWorkLocation + '\' ';
+ soql += 'and showFalseNotshowTrue__c = false';
+ if (!String.isBlank(category1)) {
+ soql +=
+ ' and Name like \'%' +
+ String.escapeSingleQuotes(category1.replaceAll('%', '\\%')) +
+ '%\' ';
+ }
+ if (cate2 != null) {
+ soql += ' and Shipment_date__c = :cate2 ';
+ }
+ soql += ' and Order_ProType__c =\'' + agencyProType + '\'';
+ soql += ' order by Deliver_date__c';
+ system.debug('====soql:' + soql);
+ raesList = Database.query(soql);
+ results.raesList = raesList;
+ results.result = 'Success';
+ } catch (Exception e) {
+ results.result = 'Fail';
+ results.errorMsg = e.getLineNumber() + '---' + e.getMessage();
}
-}
+ return results;
+ }
+
+ public class Results {
+ @AuraEnabled
+ public String result;
+ @AuraEnabled
+ public String errorMsg;
+ @AuraEnabled
+ public String agencyProType;
+ @AuraEnabled
+ public String category1;
+ @AuraEnabled
+ public Date cate2;
+ @AuraEnabled
+ public String eSetId;
+ @AuraEnabled
+ public String accountId;
+ @AuraEnabled
+ public List<String> title;
+ @AuraEnabled
+ public List<Consumable_order__c> raesList;
+ @AuraEnabled
+ public String userWorkLocation;
+ @AuraEnabled
+ public Integer totalNum;
+ @AuraEnabled
+ public Integer orderNumberArrived;
+ @AuraEnabled
+ public Integer deliveryDetailCount;
+ @AuraEnabled
+ public Integer orderNumberNotarrive;
+ @AuraEnabled
+ public Integer moreThanSevenDays;
+ @AuraEnabled
+ public Boolean isNoteStay;
+ }
+}
\ No newline at end of file
diff --git a/force-app/main/default/classes/LexArriveGoodsMainControllerTest.cls b/force-app/main/default/classes/LexArriveGoodsMainControllerTest.cls
index b80a6d2..a974b8e 100644
--- a/force-app/main/default/classes/LexArriveGoodsMainControllerTest.cls
+++ b/force-app/main/default/classes/LexArriveGoodsMainControllerTest.cls
@@ -1,81 +1,61 @@
@istest
public class LexArriveGoodsMainControllerTest {
@IsTest
- static void lexArriveGoodsMainControllerTest1() {
+ static void lexArriveGoodsMainControllerTest1(){
User myUser_test = new User();
Account myAccount1;
Contact core;
User currentUser = [SELECT Id FROM User WHERE Id = :UserInfo.getUserId()];
- NoteStay__c n = new NoteStay__c(Name = 'NoteStay', IsStay__c = true);
+ NoteStay__c n = new NoteStay__c(Name = 'NoteStay',IsStay__c = true);
insert n;
- System.runAs(currentUser) {
- Profile prof = [
- SELECT Id
- FROM Profile
- WHERE Name = '901_缁忛攢鍟嗙ぞ鍖烘櫘閫氭潈闄恄2閲嶉獙璇�(ET)'
- ];
- List<RecordType> rectCo = [
- SELECT Id
- FROM RecordType
- WHERE IsActive = TRUE AND SobjectType = 'Account' AND Name = '璨╁2搴�'
- ];
+ System.runAs(currentUser){
+ Profile prof = [select Id from Profile where Name ='901_缁忛攢鍟嗙ぞ鍖烘櫘閫氭潈闄恄2閲嶉獙璇�(ET)'];
+ List<RecordType> rectCo = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '璨╁2搴�'];
if (rectCo.size() == 0) {
return;
}
- myAccount1 = new Account(name = 'testaccount001', RecordTypeId = rectCo[0].Id, AgentCode_Ext__c = '9999900');
+ myAccount1 = new Account(name='testaccount001',RecordTypeId = rectCo[0].Id ,AgentCode_Ext__c = '9999900');
insert myAccount1;
- core = new Contact(email = 'jplumber@salesforce.com', firstname = 'Joe', lastname = 'Plumber', accountid = myAccount1.id);
+ core = new Contact(email='jplumber@salesforce.com',
+ firstname='Joe',
+ lastname='Plumber',
+ accountid=myAccount1.id);
insert core;
- myUser_test = new User(
+ myUser_test = New User(
ContactId = core.id,
Alias = 'newUser',
- Email = 'newuser@testorg.com',
- EmailEncodingKey = 'UTF-8',
- LastName = 'testUser',
- LanguageLocaleKey = 'zh_CN',
- LocaleSidKey = 'zh_CN',
+ Email='newuser@testorg.com',
+ EmailEncodingKey='UTF-8',
+ LastName='testUser',
+ LanguageLocaleKey='zh_CN',
+ LocaleSidKey='zh_CN',
ProfileId = prof.Id,
- TimeZoneSidKey = 'Asia/Shanghai',
- UserName = 'testUser@testorg.com',
- Work_Location__c = '鍖椾含'
- );
+ TimeZoneSidKey='Asia/Shanghai',
+ UserName='testUser@testorg.com',
+ Work_Location__c='鍖椾含');
insert myUser_test;
}
- System.runAs(myUser_test) {
- Product2 prod01 = new Product2(
- Name = 'Test01',
- ProductCode = 'Test01',
- Asset_Model_No__c = 'Test01',
- SFDA_Status__c = '鏈夊姽',
- Manual_Entry__c = false
- );
- Product2 prod02 = new Product2(
- Name = 'Test02',
- ProductCode = 'Test02',
- Asset_Model_No__c = 'Test02',
- SFDA_Status__c = '鏈夊姽',
- Manual_Entry__c = false
- );
- insert new List<Product2>{ prod01, prod02 };
- Product2__c pro1 = new Product2__c(Name = 'Pro001', OT_CODE_Text__c = 'Test001', Product2__c = prod01.Id);
- Product2__c pro2 = new Product2__c(Name = 'Pro002', OT_CODE_Text__c = 'Test002', Product2__c = prod02.Id);
- insert new List<Product2__c>{ pro1, pro2 };
+ System.runAs(myUser_test){
+ Product2 prod01 = new Product2(Name='Test01',ProductCode='Test01',Asset_Model_No__c = 'Test01',SFDA_Status__c = '鏈夊姽',Manual_Entry__c = false);
+ Product2 prod02 = new Product2(Name='Test02',ProductCode='Test02',Asset_Model_No__c = 'Test02',SFDA_Status__c = '鏈夊姽',Manual_Entry__c = false);
+ insert new Product2[]{prod01,prod02};
+ Product2__c pro1 = new Product2__c(Name='Pro001',OT_CODE_Text__c='Test001',Product2__c = prod01.Id);
+ Product2__c pro2 = new Product2__c(Name='Pro002',OT_CODE_Text__c='Test002',Product2__c = prod02.Id);
+ insert new Product2__c[] {pro1, pro2};
//璁㈠崟
Consumable_order__c Order1 = new Consumable_order__c(
- Name = 'OCM_01_001',
+ Name='OCM_01_001',
RecordTypeId = System.Label.RT_ConOrder_Delivery,
- Order_type__c = '璁㈠崟',
- Dealer_info__c = myAccount1.Id,
- Order_ProType__c = 'ET'
- );
+ Order_type__c ='璁㈠崟',
+ Dealer_info__c=myAccount1.Id,
+ Order_ProType__c = 'ET');
Consumable_order__c Order2 = new Consumable_order__c(
- Name = 'OCM_01_002',
+ Name='OCM_01_002',
RecordTypeId = System.Label.RT_ConOrder_Delivery,
- Order_type__c = '璁㈠崟',
- Dealer_info__c = myAccount1.Id,
- Order_ProType__c = 'ET'
- );
- insert new List<Consumable_order__c>{ Order1, Order2 };
+ Order_type__c ='璁㈠崟',
+ Dealer_info__c=myAccount1.Id,
+ Order_ProType__c = 'ET');
+ insert new Consumable_order__c[] {Order1, Order2};
//鏄庣粏1
Consumable_orderdetails__c createDetail = new Consumable_orderdetails__c();
@@ -83,51 +63,47 @@
createDetail.Consumable_Product__c = pro1.id;
createDetail.Dealer_Custom_Price__c = 999.00;
createDetail.Consumable_count__c = 3;
- createDetail.Consumable_order__c = Order1.id;
+ createDetail.Consumable_order__c = Order1.id;
createDetail.RecordTypeid = System.Label.RT_ConOrderDetail1_Order;
insert createDetail;
Consumable_orderdetails__c createDetail1 = new Consumable_orderdetails__c();
createDetail1.name = 'Too002';
createDetail1.Consumable_Product__c = pro2.id;
- createDetail1.Consumable_order__c = Order2.id;
+ createDetail1.Consumable_order__c = Order2.id;
createDetail1.Dealer_Custom_Price__c = 999.00;
createDetail1.Consumable_count__c = 4;
createDetail1.RecordTypeid = System.Label.RT_ConOrderDetail1_Order;
insert createDetail1;
//璁㈠崟鏄庣粏
- Consumable_order_details2__c Orderdet1 = new Consumable_order_details2__c(
- Name = 'OCM_01_001001',
+ Consumable_order_details2__c Orderdet1 = new Consumable_order_details2__c(
+ Name='OCM_01_001001',
Consumable_order_minor__c = Order1.Id,
Arrive_date__c = Date.today(),
Consumable_Product__c = pro1.id,
- RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery
- );
- Consumable_order_details2__c Orderdet2 = new Consumable_order_details2__c(
- Name = 'OCM_01_001002',
+ RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery);
+ Consumable_order_details2__c Orderdet2 = new Consumable_order_details2__c(
+ Name='OCM_01_001002',
Consumable_order_minor__c = Order2.Id,
Arrive_date__c = Date.today(),
Consumable_Product__c = pro2.id,
- RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery
- );
- Consumable_order_details2__c Orderdet3 = new Consumable_order_details2__c(
- Name = 'OCM_01_001003',
+ RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery);
+ Consumable_order_details2__c Orderdet3 = new Consumable_order_details2__c(
+ Name='OCM_01_001003',
Consumable_order_minor__c = Order1.Id,
//Arrive_date__c = Date.today(),
Consumable_Product__c = pro1.id,
- RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery
- );
- Consumable_order_details2__c Orderdet4 = new Consumable_order_details2__c(
- Name = 'OCM_01_001004',
+ RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery);
+ Consumable_order_details2__c Orderdet4 = new Consumable_order_details2__c(
+ Name='OCM_01_001004',
Consumable_order_minor__c = Order2.Id,
Arrive_date__c = Date.today(),
Consumable_Product__c = pro2.id,
- RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery
- );
- insert new List<Consumable_order_details2__c>{ Orderdet1, Orderdet2, Orderdet3, Orderdet4 };
+ RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery);
+ insert new Consumable_order_details2__c[] {Orderdet1, Orderdet2, Orderdet3, Orderdet4};
LexArriveGoodsMainController.init();
LexArriveGoodsMainController.searchConsumableorderdetails('Too001', null, myAccount1.Id, '鍖椾含', 'ET');
}
}
-}
+}
\ No newline at end of file
diff --git a/force-app/main/default/classes/LexArriveGoodsMainControllerTest.cls-meta.xml b/force-app/main/default/classes/LexArriveGoodsMainControllerTest.cls-meta.xml
index a9fd6e9..754ecb1 100644
--- a/force-app/main/default/classes/LexArriveGoodsMainControllerTest.cls-meta.xml
+++ b/force-app/main/default/classes/LexArriveGoodsMainControllerTest.cls-meta.xml
@@ -1,4 +1,4 @@
-<?xml version="1.0" encoding="UTF-8" ?>
+<?xml version="1.0" encoding="UTF-8"?>
<ApexClass xmlns="http://soap.sforce.com/2006/04/metadata">
<apiVersion>57.0</apiVersion>
<status>Active</status>
diff --git a/force-app/main/default/classes/LexArriveGsDetailsController.cls b/force-app/main/default/classes/LexArriveGsDetailsController.cls
index b434454..69da85c 100644
--- a/force-app/main/default/classes/LexArriveGsDetailsController.cls
+++ b/force-app/main/default/classes/LexArriveGsDetailsController.cls
@@ -19,72 +19,45 @@
try {
//鍙栫粡閿�鍟嗕俊鎭�
String userId = UserInfo.getUserId();
- List<user> useracc = new List<user>();
- useracc = [SELECT accountid FROM user WHERE id = :userId];
+ List<user> useracc = New List<user>();
+ useracc = [select accountid from user where id =:userId];
accountid = useracc[0].accountid;
- List<Consumable_order__c> rs = new List<Consumable_order__c>();
- if (eSetId == null || eSetId == '') {
- } else {
- rs = [
- SELECT
- id,
- name,
- Order_reason__c,
- Arrive_Order__c,
- Arrive_Order__r.Total_num__c,
- Arrive_Order__r.IsShipment__c,
- Arrive_Order__r.Name,
- recordtypeid,
- Order_status__c,
- Deliver_date__c,
- Arrive_total_amount__c
- FROM Consumable_order__c
- WHERE id = :eSetId
- ];
- coc = new Consumable_order__c();
- if (rs.size() > 0) {
+ List<Consumable_order__c> rs = New List<Consumable_order__c>();
+ if(eSetId == NULL || eSetId == '') {
+
+ }else {
+ rs = [SELECT id,name,Order_reason__c,Arrive_Order__c,Arrive_Order__r.Total_num__c,Arrive_Order__r.IsShipment__c,Arrive_Order__r.Name,
+ recordtypeid,Order_status__c,Deliver_date__c,Arrive_total_amount__c
+ FROM Consumable_order__c
+ WHERE id =:eSetId];
+ coc = new Consumable_order__c();
+ if(rs.size()>0){
coc = rs[0];
orderallcount = coc.Arrive_Order__r.Total_num__c;
}
- if (coc.Arrive_Order__c == null) {
+ if(coc.Arrive_Order__c == null){
arrivetoorder = true;
}
- List<Consumable_order_details2__c> consumablearriveproductdetailsSelected = [
- SELECT
- Id,
- Dealer_Arrive__c,
- Bar_Code__c,
- RecordTypeid,
- Name,
- Consumable_Product__r.Name__c,
- Consumable_Product__c,
- Consumable_Product__r.Name,
- Dealer_Saled__c,
- Sterilization_limit__c,
- Deliver_date__c,
- Intra_Trade_List_RMB__c,
- Asset_Model_No__c,
- Arrive_Date__c,
- Send_Date__c,
- Consumable_Product__r.SFDA_Status__c,
- Consumable_Product__r.Product2__r.Packing_list_manual__c,
- Consumable_Product__r.Product2__r.SFDA_Approbation_No__c,
- Consumable_Product__r.Product2__r.SFDA_Expiration_Date__c
- FROM Consumable_order_details2__c
- WHERE Consumable_Arrived_order__c = :eSetId
- ORDER BY Name
- ];
+ List<Consumable_order_details2__c> consumablearriveproductdetailsSelected = [SELECT Id,Dealer_Arrive__c,Bar_Code__c, RecordTypeid, Name,Consumable_Product__r.Name__c,
+ Consumable_Product__c,Consumable_Product__r.Name,Dealer_Saled__c,
+ Sterilization_limit__c,Deliver_date__c,
+ Intra_Trade_List_RMB__c,Asset_Model_No__c,Arrive_Date__c,Send_Date__c,
+ Consumable_Product__r.SFDA_Status__c,
+ Consumable_Product__r.Product2__r.Packing_list_manual__c,
+ Consumable_Product__r.Product2__r.SFDA_Approbation_No__c,
+ Consumable_Product__r.Product2__r.SFDA_Expiration_Date__c
+ FROM Consumable_order_details2__c
+ WHERE Consumable_Arrived_order__c = :eSetId
+ ORDER BY Name ];
for (Integer i = 0; i < consumablearriveproductdetailsSelected.size(); i++) {
- consumableorderdetailsRecords.add(new ConsumableorderdetailsInfo(consumablearriveproductdetailsSelected[i]));
- }
+ consumableorderdetailsRecords.add(new ConsumableorderdetailsInfo(consumablearriveproductdetailsSelected[i]));
+ }
}
- for (ConsumableorderdetailsInfo bss : consumableorderdetailsRecords) {
+ for(ConsumableorderdetailsInfo bss : consumableorderdetailsRecords){
bss.packing_list = bss.Prod.Product2__r.Packing_list_manual__c;
bss.approbation_No = bss.Prod.Product2__r.SFDA_Approbation_No__c;
//update by rentx 20210622 start CHAN-C3K4ZQ
- bss.expiration_DateStr = bss.Prod.Product2__r.SFDA_Expiration_Date__c == null
- ? ''
- : bss.Prod.Product2__r.SFDA_Expiration_Date__c.format();
+ bss.expiration_DateStr = bss.Prod.Product2__r.SFDA_Expiration_Date__c == null ? '' : bss.Prod.Product2__r.SFDA_Expiration_Date__c.format();
bss.Sterilization_limitStr = bss.esd.Sterilization_limit__c == null ? '' : bss.esd.Sterilization_limit__c.format();
//update by rentx 20210622 end CHAN-C3K4ZQ
}
@@ -92,7 +65,7 @@
//add by rentx 20210622 CHAN-C3K4ZQ
// makeRecordsView(consumableorderdetailsRecords);
//add by rentx 20210622 CHAN-
- for (ConsumableorderdetailsInfo con : consumableorderdetailsRecords) {
+ for(ConsumableorderdetailsInfo con : consumableorderdetailsRecords){
con.prodName = con.esd.Consumable_Product__r.Name__c;
}
results.coc = coc;
@@ -117,28 +90,25 @@
try {
orderallcount = orderallcountParm;
consumableorderdetailsCount = consumableorderdetailsCountParm;
- coc = (Consumable_order__c) JSON.deserialize(cocStr, Consumable_order__c.class);
+ coc = (Consumable_order__c)JSON.deserialize(cocStr, Consumable_order__c.class);
List<Consumable_order_details2__c> orderdetails = new List<Consumable_order_details2__c>();
//鍙戣揣鏄庣粏2
- orderdetails = [
- SELECT Id
- FROM Consumable_order_details2__c
- WHERE
- Consumable_order_minor__c = :coc.Arrive_Order__c
- AND recordtypeid = :System.Label.RT_ConOrderDetail2_Delivery
- AND Dealer_Arrive__c = TRUE
- ];
- if (orderallcount != consumableorderdetailsCount) {
+ orderdetails = [SELECT Id
+ FROM Consumable_order_details2__c
+ WHERE Consumable_order_minor__c =:coc.Arrive_Order__c
+ AND recordtypeid = :System.Label.RT_ConOrderDetail2_Delivery
+ AND Dealer_Arrive__c = true ];
+ if(orderallcount!= consumableorderdetailsCount){
results.result = 'Fail';
results.errorMsg = '璁㈠崟涓嶅畬鍏ㄥ埌璐э紝鏃犳硶鍑哄簱';
return results;
}
- if (coc.Arrive_Order__r.IsShipment__c == true) {
+ if(coc.Arrive_Order__r.IsShipment__c == true){
results.result = 'Fail';
results.errorMsg = '璁㈠崟宸茬粡鍑哄簱';
return results;
}
- results.url = '/lexsummonscreat?arriveorder=' + eSetId + '&KeyWords=Redirect';
+ results.url = '/lexsummonscreat?arriveorder=' + eSetId +'&KeyWords=Redirect';
results.result = 'Success';
} catch (Exception e) {
results.result = 'Fail';
@@ -174,7 +144,7 @@
@AuraEnabled
public Consumable_order_details2__c esd;
@AuraEnabled
- public Product2__c Prod;
+ public Product2__c Prod;
@AuraEnabled
public Decimal packing_list;
@AuraEnabled
@@ -188,6 +158,7 @@
@AuraEnabled
public String prodName;
+
// 宸插瓨鍦ㄦ秷鑰楀搧鏄庣粏鐢�
public ConsumableorderdetailsInfo(Consumable_order_details2__c e) {
esd = e;
@@ -198,4 +169,4 @@
return null;
}
}
-}
+}
\ No newline at end of file
diff --git a/force-app/main/default/classes/LexArriveGsDetailsControllerTest.cls b/force-app/main/default/classes/LexArriveGsDetailsControllerTest.cls
index 3f175c6..c5c4727 100644
--- a/force-app/main/default/classes/LexArriveGsDetailsControllerTest.cls
+++ b/force-app/main/default/classes/LexArriveGsDetailsControllerTest.cls
@@ -1,66 +1,33 @@
@isTest
public class LexArriveGsDetailsControllerTest {
@IsTest
- static void test1() {
+ static void test1(){
User myUser_test = new User();
Account myAccount1;
Account myAccount2;
Contact core;
User currentUser = [SELECT Id FROM User WHERE Id = :UserInfo.getUserId()];
- NoteStay__c n = new NoteStay__c(Name = 'NoteStay', IsStay__c = true);
+ NoteStay__c n = new NoteStay__c(Name = 'NoteStay',IsStay__c = true);
insert n;
- System.runAs(currentUser) {
- List<RecordType> rectCo = [
- SELECT Id
- FROM RecordType
- WHERE IsActive = TRUE AND SobjectType = 'Account' AND Name = '璨╁2搴�'
- ];
+ System.runAs(currentUser){
+ List<RecordType> rectCo = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '璨╁2搴�'];
if (rectCo.size() == 0) {
return;
}
- Profile prof = [
- SELECT Id
- FROM Profile
- WHERE Name = '901_缁忛攢鍟嗙ぞ鍖烘櫘閫氭潈闄恄2閲嶉獙璇�(ET)'
- ];
- Product2 prod01 = new Product2(
- Name = 'Test01',
- ProductCode = 'Test01',
- Asset_Model_No__c = 'Test01',
- SFDA_Status__c = '鏈夊姽',
- Dealer_special_Object__c = true,
- Manual_Entry__c = false
- );
- Product2 prod02 = new Product2(
- Name = 'Test02',
- ProductCode = 'Test02',
- Asset_Model_No__c = 'Test02',
- SFDA_Status__c = '鏈夊姽',
- Dealer_special_Object__c = true,
- Manual_Entry__c = false
- );
- insert new List<Product2>{ prod01, prod02 };
- Product2__c pro1 = new Product2__c(Name = 'Pro001', OT_CODE_Text__c = 'Test001', Product2__c = prod01.Id);
- Product2__c pro2 = new Product2__c(Name = 'Pro002', OT_CODE_Text__c = 'Test002', Product2__c = prod02.Id);
- insert new List<Product2__c>{ pro1, pro2 };
- myAccount2 = new Account(name = 'Testaccount002', Dealer_discount__c = 20, RecordTypeId = rectCo[0].Id);
+ Profile prof = [select Id from Profile where Name ='901_缁忛攢鍟嗙ぞ鍖烘櫘閫氭潈闄恄2閲嶉獙璇�(ET)'];
+ Product2 prod01 = new Product2(Name='Test01',ProductCode='Test01',Asset_Model_No__c = 'Test01',SFDA_Status__c = '鏈夊姽',Dealer_special_Object__c = true,Manual_Entry__c = false);
+ Product2 prod02 = new Product2(Name='Test02',ProductCode='Test02',Asset_Model_No__c = 'Test02',SFDA_Status__c = '鏈夊姽',Dealer_special_Object__c = true,Manual_Entry__c = false);
+ insert new Product2[]{prod01,prod02};
+ Product2__c pro1 = new Product2__c(Name='Pro001',OT_CODE_Text__c='Test001',Product2__c = prod01.Id);
+ Product2__c pro2 = new Product2__c(Name='Pro002',OT_CODE_Text__c='Test002',Product2__c = prod02.Id);
+ insert new Product2__c[] {pro1, pro2};
+ myAccount2 = new Account(name='Testaccount002',Dealer_discount__c =20,RecordTypeId = rectCo[0].Id);
insert myAccount2;
- core = new Contact(email = 'jplumber@salesforce.com', firstname = 'Joe', lastname = 'Plumber', accountid = myAccount2.id);
+ core = new Contact(email='jplumber@salesforce.com', firstname='Joe',lastname='Plumber',accountid=myAccount2.id);
insert core;
- myUser_Test = new User(
- ContactId = core.id,
- Alias = 'newUser',
- Email = 'newuser@testorg.com',
- EmailEncodingKey = 'UTF-8',
- LastName = 'TestUser',
- LanguageLocaleKey = 'zh_CN',
- LocaleSidKey = 'zh_CN',
- ProfileId = prof.Id,
- TimeZoneSidKey = 'Asia/Shanghai',
- UserName = 'testUser@testorg.com'
- );
+ myUser_Test = New User(ContactId = core.id,Alias = 'newUser',Email='newuser@testorg.com',EmailEncodingKey='UTF-8', LastName='TestUser', LanguageLocaleKey='zh_CN',LocaleSidKey='zh_CN', ProfileId = prof.Id,TimeZoneSidKey='Asia/Shanghai', UserName='testUser@testorg.com');
insert myUser_Test;
- System.runAs(MyUser_Test) {
+ System.runAs(MyUser_Test){
StaticParameter.ConsumableAssetHanderTrigger = true;
Consumable_order__c order1 = new Consumable_order__c();
order1.Name = 'OCM_01_001';
@@ -68,16 +35,16 @@
order1.Order_type__c = '璁㈠崟';
order1.Dealer_Info__c = myAccount2.Id;
order1.RecordTypeid = System.Label.RT_ConOrder_Arrive;
- insert order1;
-
+ insert order1;
+
Consumable_order__c olyorder = new Consumable_order__c();
olyorder.Name = 'OCM_01_001';
olyorder.Order_status__c = '鎵瑰噯';
olyorder.Order_type__c = '璁㈠崟';
olyorder.Dealer_Info__c = myAccount2.Id;
olyorder.RecordTypeid = System.Label.RT_ConOrder_Delivery;
- insert olyorder;
-
+ insert olyorder;
+
//璁㈠崟鏄庣粏
Consumable_order_details2__c Orderdet1 = new Consumable_order_details2__c();
Orderdet1.Name = 'OCM_01_001001';
@@ -93,80 +60,42 @@
//Orderdet2.IsArrival__c = true;
Orderdet2.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
Orderdet2.Bar_Code__c = '22222';
-
- insert new List<Consumable_order_details2__c>{ Orderdet1, Orderdet2 };
+
+ insert new Consumable_order_details2__c[] {Orderdet1, Orderdet2};
LexArriveGsDetailsController.init(order1.Id);
- LexArriveGsDetailsController.proSale(
- JSON.serialize(LexArriveGsDetailsController.coc),
- LexArriveGsDetailsController.coc.Arrive_Order__r.Total_num__c,
- LexArriveGsDetailsController.consumableorderdetailsRecords.size(),
- order1.Id
- );
+ LexArriveGsDetailsController.proSale(JSON.serialize(LexArriveGsDetailsController.coc), LexArriveGsDetailsController.coc.Arrive_Order__r.Total_num__c, LexArriveGsDetailsController.consumableorderdetailsRecords.size(), order1.Id);
}
}
}
@IsTest
- static void test2() {
+ static void test2(){
User myUser_test = new User();
Account myAccount1;
Account myAccount2;
Contact core;
User currentUser = [SELECT Id FROM User WHERE Id = :UserInfo.getUserId()];
- NoteStay__c n = new NoteStay__c(Name = 'NoteStay', IsStay__c = true);
+ NoteStay__c n = new NoteStay__c(Name = 'NoteStay',IsStay__c = true);
insert n;
- System.runAs(currentUser) {
- List<RecordType> rectCo = [
- SELECT Id
- FROM RecordType
- WHERE IsActive = TRUE AND SobjectType = 'Account' AND Name = '璨╁2搴�'
- ];
+ System.runAs(currentUser){
+ List<RecordType> rectCo = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '璨╁2搴�'];
if (rectCo.size() == 0) {
return;
}
- Profile prof = [
- SELECT Id
- FROM Profile
- WHERE Name = '901_缁忛攢鍟嗙ぞ鍖烘櫘閫氭潈闄恄2閲嶉獙璇�(ET)'
- ];
- Product2 prod01 = new Product2(
- Name = 'Test01',
- ProductCode = 'Test01',
- Asset_Model_No__c = 'Test01',
- SFDA_Status__c = '鏈夊姽',
- Dealer_special_Object__c = true,
- Manual_Entry__c = false
- );
- Product2 prod02 = new Product2(
- Name = 'Test02',
- ProductCode = 'Test02',
- Asset_Model_No__c = 'Test02',
- SFDA_Status__c = '鏈夊姽',
- Dealer_special_Object__c = true,
- Manual_Entry__c = false
- );
- insert new List<Product2>{ prod01, prod02 };
- Product2__c pro1 = new Product2__c(Name = 'Pro001', OT_CODE_Text__c = 'Test001', Product2__c = prod01.Id);
- Product2__c pro2 = new Product2__c(Name = 'Pro002', OT_CODE_Text__c = 'Test002', Product2__c = prod02.Id);
- insert new List<Product2__c>{ pro1, pro2 };
- myAccount2 = new Account(name = 'Testaccount002', Dealer_discount__c = 20, RecordTypeId = rectCo[0].Id);
+ Profile prof = [select Id from Profile where Name ='901_缁忛攢鍟嗙ぞ鍖烘櫘閫氭潈闄恄2閲嶉獙璇�(ET)'];
+ Product2 prod01 = new Product2(Name='Test01',ProductCode='Test01',Asset_Model_No__c = 'Test01',SFDA_Status__c = '鏈夊姽',Dealer_special_Object__c = true,Manual_Entry__c = false);
+ Product2 prod02 = new Product2(Name='Test02',ProductCode='Test02',Asset_Model_No__c = 'Test02',SFDA_Status__c = '鏈夊姽',Dealer_special_Object__c = true,Manual_Entry__c = false);
+ insert new Product2[]{prod01,prod02};
+ Product2__c pro1 = new Product2__c(Name='Pro001',OT_CODE_Text__c='Test001',Product2__c = prod01.Id);
+ Product2__c pro2 = new Product2__c(Name='Pro002',OT_CODE_Text__c='Test002',Product2__c = prod02.Id);
+ insert new Product2__c[] {pro1, pro2};
+ myAccount2 = new Account(name='Testaccount002',Dealer_discount__c =20,RecordTypeId = rectCo[0].Id);
insert myAccount2;
- core = new Contact(email = 'jplumber@salesforce.com', firstname = 'Joe', lastname = 'Plumber', accountid = myAccount2.id);
+ core = new Contact(email='jplumber@salesforce.com', firstname='Joe',lastname='Plumber',accountid=myAccount2.id);
insert core;
- myUser_Test = new User(
- ContactId = core.id,
- Alias = 'newUser',
- Email = 'newuser@testorg.com',
- EmailEncodingKey = 'UTF-8',
- LastName = 'TestUser',
- LanguageLocaleKey = 'zh_CN',
- LocaleSidKey = 'zh_CN',
- ProfileId = prof.Id,
- TimeZoneSidKey = 'Asia/Shanghai',
- UserName = 'testUser@testorg.com'
- );
+ myUser_Test = New User(ContactId = core.id,Alias = 'newUser',Email='newuser@testorg.com',EmailEncodingKey='UTF-8', LastName='TestUser', LanguageLocaleKey='zh_CN',LocaleSidKey='zh_CN', ProfileId = prof.Id,TimeZoneSidKey='Asia/Shanghai', UserName='testUser@testorg.com');
insert myUser_Test;
- System.runAs(MyUser_Test) {
+ System.runAs(MyUser_Test){
StaticParameter.ConsumableAssetHanderTrigger = true;
Consumable_order__c order1 = new Consumable_order__c();
order1.Name = 'OCM_01_001';
@@ -174,7 +103,7 @@
order1.Order_type__c = '璁㈠崟';
order1.RecordTypeid = System.Label.RT_ConOrder_Arrive;
order1.IsShipment__c = true;
- insert order1;
+ insert order1;
Consumable_order__c olyorder = new Consumable_order__c();
olyorder.Name = 'OCM_01_001';
@@ -183,7 +112,8 @@
olyorder.Dealer_Info__c = myAccount2.Id;
olyorder.RecordTypeid = System.Label.RT_ConOrder_Delivery;
olyorder.IsShipment__c = true;
- insert olyorder;
+ insert olyorder;
+
//璁㈠崟鏄庣粏
Consumable_order_details2__c Orderdet1 = new Consumable_order_details2__c();
@@ -201,10 +131,10 @@
Orderdet2.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
Orderdet2.Bar_Code__c = '22222';
- insert new List<Consumable_order_details2__c>{ Orderdet1, Orderdet2 };
+ insert new Consumable_order_details2__c[] {Orderdet1, Orderdet2};
LexArriveGsDetailsController.init(order1.Id);
LexArriveGsDetailsController.proSale(JSON.serialize(LexArriveGsDetailsController.coc), 1, 1, order1.Id);
}
}
}
-}
+}
\ No newline at end of file
diff --git a/force-app/main/default/classes/LexArriveGsDetailsControllerTest.cls-meta.xml b/force-app/main/default/classes/LexArriveGsDetailsControllerTest.cls-meta.xml
index a9fd6e9..754ecb1 100644
--- a/force-app/main/default/classes/LexArriveGsDetailsControllerTest.cls-meta.xml
+++ b/force-app/main/default/classes/LexArriveGsDetailsControllerTest.cls-meta.xml
@@ -1,4 +1,4 @@
-<?xml version="1.0" encoding="UTF-8" ?>
+<?xml version="1.0" encoding="UTF-8"?>
<ApexClass xmlns="http://soap.sforce.com/2006/04/metadata">
<apiVersion>57.0</apiVersion>
<status>Active</status>
diff --git a/force-app/main/default/classes/LexCancelRemoveBoxController.cls b/force-app/main/default/classes/LexCancelRemoveBoxController.cls
index a1d4c44..69416e1 100644
--- a/force-app/main/default/classes/LexCancelRemoveBoxController.cls
+++ b/force-app/main/default/classes/LexCancelRemoveBoxController.cls
@@ -1,6 +1,6 @@
public with sharing class LexCancelRemoveBoxController {
//缁忛攢鍟嗕骇鍝佸垎绫�
- public static String agencyProType { get; set; }
+ public static String agencyProType {get;set;}
public static String userPro_Typestr = null;
public static String barcode { get; set; }
/*****************鐢婚潰琛ㄧずBean******************/
@@ -9,32 +9,32 @@
public static List<ConsumableorderdetailsInfo> ConsumableorderdetailsRecordserror { get; set; }
//鎷嗙洅鏄庣粏
public static List<ConsumableorderdetailsInfo> ConsumableorderdetailsRecordsdummy { get; set; }
- public static boolean saveFLGbln { get; set; }
+ public static boolean saveFLGbln {get;set;}
//閿欒淇℃伅
- public static String alertMessage { get; set; }
+ public static String alertMessage {set;get;}
//鎷嗙洅鏄庣粏浠舵暟
- public static Integer getinventorysize() {
+ public static Integer getinventorysize(){
return ConsumableorderdetailsRecordsdummy.size();
}
public static Map<String, String> ExistIdMap = new Map<String, String>();
public static Map<String, String> ErrorIdMap = new Map<String, String>();
public static Map<String, String> AllMap = new Map<String, String>();
- public static List<String> BarCodeListP = new List<String>();
+ public static List<String> BarCodeListP = new List<String>();
//涓嶇鍚堢殑barcode鍜屽瀷鍙�
- public static list<String> notInlist = new List<String>();
- public static String baseUrl { get; private set; }
+ public static list<String> notInlist = new list<String>();
+ public static String baseUrl {get;private set;}
private static String accountid = null;
private static String accountName = null;
//public String[] proidList =new String[]{};
// 鐧诲綍鑰呭伐浣滃湴
private static String userWorkLocation;
- public LexCancelRemoveBoxController() {
+ public LexCancelRemoveBoxController(){
baseUrl = URL.getSalesforceBaseUrl().toExternalForm();
ConsumableorderdetailsRecordserror = new List<ConsumableorderdetailsInfo>();
ConsumableorderdetailsRecordsdummy = new List<ConsumableorderdetailsInfo>();
consumableInventory = new List<ConsumableorderdetailsInfo>();
- saveFLGbln = false;
+ saveFLGbln = FALSE;
}
@AuraEnabled
@@ -44,46 +44,39 @@
res.entity = data;
String userId = UserInfo.getUserId();
- List<user> Useracc = new List<user>();
- Useracc = [
- SELECT accountid, Work_Location__c, UserPro_Type__c
- FROM user
- WHERE id = :userId
- ];
+ List<user> Useracc = New List<user>();
+ Useracc = [SELECT accountid, Work_Location__c,UserPro_Type__c FROM user WHERE id =:userId];
accountid = Useracc[0].accountid;
userWorkLocation = Useracc[0].Work_Location__c;
agencyProType = Useracc[0].UserPro_Type__c;
- if (String.isBlank(Useracc[0].UserPro_Type__c)) {
+ if(String.isBlank(Useracc[0].UserPro_Type__c)){
agencyProType = 'ET';
}
userPro_Typestr = '%' + agencyProType + '%';
- List<account> accountInfo = [
- SELECT Name
- FROM account
- WHERE id = :accountid
- ];
+ List<account> accountInfo = [SELECT Name FROM account WHERE id =:accountid];
//String view_product = accountInfo[0].view_product__c;
accountName = accountInfo[0].Name;
//proidList = view_product.split(',');
- data.put('accountName', accountName);
- data.put('userWorkLocation', userWorkLocation);
- data.put('agencyProType', agencyProType);
+ data.put('accountName',accountName);
+ data.put('userWorkLocation',userWorkLocation);
+ data.put('agencyProType',agencyProType);
res.status = 'Success';
res.code = 200;
System.debug('res = ' + res);
return res;
+
}
// 灏嗛〉闈㈡垨鍙栧緱BarCode鍘绘帀閲嶅鐨勶紝杞崲鎴怢ist
- public static List<String> ParseBarCode(String Code) {
- String[] Cache = new List<String>{};
+ public static List<String> ParseBarCode(String Code){
+ String[] Cache = new String[]{};
Cache = Code.split('\n');
- Set<String> Buff = new Set<String>();
- for (String A : Cache) {
+ Set <String> Buff = new Set<String>();
+ for(String A : Cache){
Buff.add(A);
}
List<String> outPut = new List<String>();
- for (String B : Buff) {
+ for(String B :Buff){
B = B.trim();
outPut.add(B);
}
@@ -92,14 +85,9 @@
//鑾峰彇鏄庣粏
@AuraEnabled
- public static ResponseBodyLWC searchConsumableorderdetails(
- String barcode,
- String accountName,
- String userWorkLocation,
- String agencyProType
- ) {
+ public static ResponseBodyLWC searchConsumableorderdetails(String barcode,String accountName,String userWorkLocation,String agencyProType) {
ResponseBodyLWC res = new ResponseBodyLWC();
- Map<String, object> data = new Map<String, object>();
+ Map<String,object> data = new Map<String,object>();
res.entity = data;
userPro_Typestr = '%' + agencyProType + '%';
barcode = barcode;
@@ -109,18 +97,20 @@
ConsumableorderdetailsRecordserror = new List<ConsumableorderdetailsInfo>();
ConsumableorderdetailsRecordsdummy = new List<ConsumableorderdetailsInfo>();
- notInlist = new List<String>();
+
+
+ notInlist = new list<String>();
BarCodeListP = ParseBarCode(barcode);
Consumable_order_details2__c p = new Consumable_order_details2__c();
- List<Consumable_order_details2__c> Ins = new List<Consumable_order_details2__c>();
+ List<Consumable_order_details2__c> Ins = New List<Consumable_order_details2__c>();
List<Consumable_order_details2__c> reSet = new List<Consumable_order_details2__c>();
List<Consumable_order_details2__c> reSet1 = new List<Consumable_order_details2__c>();
- saveFLGbln = false;
- alertMessage = '';
+ saveFLGbln = FALSE;
+ alertMessage='';
//鍒ゆ柇barcode鏄惁涓虹┖
- if (barcode == null || barcode == '') {
- return new ResponseBodyLWC('Error', 500, '璇疯緭鍏arCode鍙�', '');
+ if(barcode == null || barcode ==''){
+ return new ResponseBodyLWC('Error',500, '璇疯緭鍏arCode鍙�', '');
// ApexPages.addmessage(new ApexPages.message(ApexPages.severity.INFO,'璇疯緭鍏arCode鍙枫��'));
// return;
}
@@ -132,416 +122,309 @@
// ConsumableorderdetailsRecordsdummy.clear();
// 浜у搧绫诲瀷涓嶅悓
- reSet1 = [
- SELECT
- Id,
- Name,
- Consumable_Product__r.Name__c,
- Consumable_Product__c,
- Consumable_Product__r.Name,
- Sterilization_limit__c,
- Deliver_date__c,
- Bar_Code__c,
- Product_Type__c,
- Arrive_date__c,
- Send_Date__c,
- Consumable_order_minor__r.Name,
- Consumable_order_minor__c,
- recordtypeid,
- Consumable_order_minor__r.Arrive_Order__c,
- Arrive_Owner_Work_Location__c,
- //add by rentx 2020-10-13 start
- ContractNo_text__c
- /*,ContractNo__c*/
- //add by rentx 2020-10-13 end
- FROM Consumable_order_details2__c
- WHERE
- Dealer_Arrive__c = TRUE
- AND Bar_Code__c IN :BarCodeListP
- AND Dealer_Info_text__c = :accountName
- AND Arrive_Owner_Work_Location__c = :userWorkLocation
- AND (NOT Product_Type__c LIKE :userPro_Typestr)
- ORDER BY Name
- ];
- if (reSet1.size() > 0) {
+ reSet1 = [SELECT Id, Name,Consumable_Product__r.Name__c,
+ Consumable_Product__c,Consumable_Product__r.Name, Sterilization_limit__c,
+ Deliver_date__c,Bar_Code__c,Product_Type__c,
+ Arrive_date__c,Send_Date__c,Consumable_order_minor__r.Name,Consumable_order_minor__c,
+ recordtypeid,Consumable_order_minor__r.Arrive_Order__c, Arrive_Owner_Work_Location__c,
+ //add by rentx 2020-10-13 start
+ ContractNo_text__c
+ /*,ContractNo__c*/
+ //add by rentx 2020-10-13 end
+ FROM Consumable_order_details2__c
+ WHERE Dealer_Arrive__c = true
+ AND Bar_Code__c in :BarCodeListP
+ AND Dealer_Info_text__c = :accountName
+ AND Arrive_Owner_Work_Location__c = : userWorkLocation
+ AND (not Product_Type__c like : userPro_Typestr)
+ ORDER BY Name ];
+ if(reSet1.size() > 0){
for (Integer i = 0; i < reSet1.size(); i++) {
- if (ErrorIdMap.containsKey(reSet1[i].Bar_Code__c)) {
+ if(ErrorIdMap.containsKey(reSet1[i].Bar_Code__c)){
// 璺宠繃宸茬粡澶勭悊鐨勬秷鑰楀搧鏄庣粏
continue;
- } else {
- String str = '璇ュ晢鍝佺被鍨�' + reSet1[i].Product_Type__c + '涓庝骇鍝佺被鍨�' + agencyProType + '涓嶇,涓嶈兘鎷嗙洅';
- ConsumableorderdetailsRecordserror.add(new ConsumableorderdetailsInfo(reSet1[i], str));
- ErrorIdMap.put(reSet1[i].Bar_Code__c, reSet1[i].Bar_Code__c);
+ }else{
+ String str = '璇ュ晢鍝佺被鍨�'+ reSet1[i].Product_Type__c +'涓庝骇鍝佺被鍨�'+ agencyProType +'涓嶇,涓嶈兘鎷嗙洅';
+ ConsumableorderdetailsRecordserror.add(new ConsumableorderdetailsInfo(reSet1[i],str));
+ ErrorIdMap.put(reSet1[i].Bar_Code__c,reSet1[i].Bar_Code__c);
}
}
}
//娌℃湁鎷嗙洅
- reSet1 = [
- SELECT
- Id,
- Name,
- Consumable_Product__r.Name__c,
- Consumable_Product__c,
- Consumable_Product__r.Name,
- Sterilization_limit__c,
- Deliver_date__c,
- Bar_Code__c,
- Arrive_date__c,
- Send_Date__c,
- Consumable_order_minor__r.Name,
- Consumable_order_minor__c,
- recordtypeid,
- Consumable_order_minor__r.Arrive_Order__c,
- //add by rentx 2020-10-13 start
- ContractNo_text__c
- /*,ContractNo__c*/
- //add by rentx 2020-10-13 end
- FROM Consumable_order_details2__c
- WHERE
- Dealer_Arrive__c = TRUE
- AND Dealer_Shipment__c = FALSE
- AND Dealer_Saled__c = FALSE
- AND Dealer_Returned__c = FALSE
- AND Lose_Flag__c = FALSE
- AND Box_Piece__c = '鐩�'
- //AND ProductPacking_list_manual__c > 1
- AND Bar_Code__c IN :BarCodeListP
- AND Dealer_Info_text__c = :accountName
- ORDER BY Name
- ]; //娌″嚭搴擄紝娌¢攢鍞紝鍦ㄥ簱锛屾病鏈夋媶鐩�
- if (reSet1.size() > 0) {
+ reSet1 = [SELECT Id, Name,Consumable_Product__r.Name__c,
+ Consumable_Product__c,Consumable_Product__r.Name, Sterilization_limit__c,
+ Deliver_date__c,Bar_Code__c,
+ Arrive_date__c,Send_Date__c,Consumable_order_minor__r.Name,Consumable_order_minor__c,
+ recordtypeid,Consumable_order_minor__r.Arrive_Order__c,
+ //add by rentx 2020-10-13 start
+ ContractNo_text__c
+ /*,ContractNo__c*/
+ //add by rentx 2020-10-13 end
+ FROM Consumable_order_details2__c
+ WHERE Dealer_Arrive__c = true
+ AND Dealer_Shipment__c= false
+ AND Dealer_Saled__c = false
+ AND Dealer_Returned__c = false
+ AND Lose_Flag__c = false
+ AND Box_Piece__c = '鐩�'
+ //AND ProductPacking_list_manual__c > 1
+ AND Bar_Code__c in :BarCodeListP
+ AND Dealer_Info_text__c = :accountName
+ ORDER BY Name ]; //娌″嚭搴擄紝娌¢攢鍞紝鍦ㄥ簱锛屾病鏈夋媶鐩�
+ if(reSet1.size() > 0){
for (Integer i = 0; i < reSet1.size(); i++) {
- if (ErrorIdMap.containsKey(reSet1[i].Bar_Code__c)) {
+ if(ErrorIdMap.containsKey(reSet1[i].Bar_Code__c)){
// 璺宠繃宸茬粡澶勭悊鐨勬秷鑰楀搧鏄庣粏
continue;
- } else {
+ }else{
String str = '璇ュ晢鍝佹病鏈夋媶鐩�';
- ConsumableorderdetailsRecordserror.add(new ConsumableorderdetailsInfo(reSet1[i], str));
- ErrorIdMap.put(reSet1[i].Bar_Code__c, reSet1[i].Bar_Code__c);
+ ConsumableorderdetailsRecordserror.add(new ConsumableorderdetailsInfo(reSet1[i],str));
+ ErrorIdMap.put(reSet1[i].Bar_Code__c,reSet1[i].Bar_Code__c);
}
}
}
//宸插嚭璐э紝鏈埌璐�
- reSet1 = [
- SELECT
- Id,
- Name,
- Consumable_Product__r.Name__c,
- Consumable_Product__c,
- Consumable_Product__r.Name,
- Sterilization_limit__c,
- Deliver_date__c,
- Bar_Code__c,
- Arrive_date__c,
- Send_Date__c,
- Consumable_order_minor__r.Name,
- Consumable_order_minor__c,
- recordtypeid,
- Consumable_order_minor__r.Arrive_Order__c,
- //add by rentx 2020-10-13 start
- ContractNo_text__c
- /*,ContractNo__c*/
- //add by rentx 2020-10-13 end
- FROM Consumable_order_details2__c
- WHERE
- Dealer_Arrive__c = FALSE
- AND Dealer_Shipment__c = FALSE
- AND Dealer_Saled__c = FALSE
- AND Dealer_Returned__c = FALSE
- AND Lose_Flag__c = FALSE
- AND Box_Piece__c = '鐩�'
- AND Bar_Code__c IN :BarCodeListP
- AND Dealer_Info_text__c = :accountName
- ORDER BY Name
- ];
- if (reSet1.size() > 0) {
+ reSet1 = [SELECT Id, Name,Consumable_Product__r.Name__c,
+ Consumable_Product__c,Consumable_Product__r.Name, Sterilization_limit__c,
+ Deliver_date__c,Bar_Code__c,
+ Arrive_date__c,Send_Date__c,Consumable_order_minor__r.Name,Consumable_order_minor__c,
+ recordtypeid,Consumable_order_minor__r.Arrive_Order__c,
+ //add by rentx 2020-10-13 start
+ ContractNo_text__c
+ /*,ContractNo__c*/
+ //add by rentx 2020-10-13 end
+ FROM Consumable_order_details2__c
+ WHERE Dealer_Arrive__c = FALSE
+ AND Dealer_Shipment__c= FALSE
+ AND Dealer_Saled__c = FALSE
+ AND Dealer_Returned__c = false
+ AND Lose_Flag__c = false
+ AND Box_Piece__c = '鐩�'
+ AND Bar_Code__c in :BarCodeListP
+ AND Dealer_Info_text__c = :accountName
+ ORDER BY Name ];
+ if(reSet1.size() > 0){
for (Integer i = 0; i < reSet1.size(); i++) {
- if (ErrorIdMap.containsKey(reSet1[i].Bar_Code__c)) {
+ if(ErrorIdMap.containsKey(reSet1[i].Bar_Code__c)){
// 璺宠繃宸茬粡澶勭悊鐨勬秷鑰楀搧鏄庣粏
continue;
- } else {
+ }else{
String str = '璇ュ晢鍝佽繕鏈埌璐�';
- ConsumableorderdetailsRecordserror.add(new ConsumableorderdetailsInfo(reSet1[i], str));
- ErrorIdMap.put(reSet1[i].Bar_Code__c, reSet1[i].Bar_Code__c);
+ ConsumableorderdetailsRecordserror.add(new ConsumableorderdetailsInfo(reSet1[i],str));
+ ErrorIdMap.put(reSet1[i].Bar_Code__c,reSet1[i].Bar_Code__c);
}
}
}
//鎷嗙洅宸插嚭璐�
- reSet1 = [
- SELECT
- Id,
- Name,
- Consumable_Product__r.Name__c,
- Consumable_Product__c,
- Consumable_Product__r.Name,
- Sterilization_limit__c,
- Deliver_date__c,
- Bar_Code__c,
- Arrive_date__c,
- Send_Date__c,
- Consumable_order_minor__r.Name,
- Consumable_order_minor__c,
- recordtypeid,
- Consumable_order_minor__r.Arrive_Order__c,
- //add by rentx 2020-10-13 start
- ContractNo_text__c
- /*,ContractNo__c*/
- //add by rentx 2020-10-13 end
- FROM Consumable_order_details2__c
- WHERE
- Dealer_Shipment__c = TRUE
- AND Dealer_Arrive__c = TRUE
- AND Dealer_Returned__c = FALSE
- AND Lose_Flag__c = FALSE
- AND Box_Piece__c = '涓�'
- AND RemoveBox_date__c != NULL
- AND Bar_Code__c IN :BarCodeListP
- AND Dealer_Info_text__c = :accountName
- ORDER BY Name
- ];
- if (reSet1.size() > 0) {
+ reSet1 = [SELECT Id, Name,Consumable_Product__r.Name__c,
+ Consumable_Product__c,Consumable_Product__r.Name, Sterilization_limit__c,
+ Deliver_date__c,Bar_Code__c,
+ Arrive_date__c,Send_Date__c,Consumable_order_minor__r.Name,Consumable_order_minor__c,
+ recordtypeid,Consumable_order_minor__r.Arrive_Order__c,
+ //add by rentx 2020-10-13 start
+ ContractNo_text__c
+ /*,ContractNo__c*/
+ //add by rentx 2020-10-13 end
+ FROM Consumable_order_details2__c
+ WHERE Dealer_Shipment__c = true
+ AND Dealer_Arrive__c = true
+ AND Dealer_Returned__c = false
+ AND Lose_Flag__c = false
+ AND Box_Piece__c = '涓�'
+ AND RemoveBox_date__c != null
+ AND Bar_Code__c in :BarCodeListP
+ AND Dealer_Info_text__c = :accountName
+ ORDER BY Name ];
+ if(reSet1.size() > 0){
for (Integer i = 0; i < reSet1.size(); i++) {
- if (ErrorIdMap.containsKey(reSet1[i].Bar_Code__c)) {
+ if(ErrorIdMap.containsKey(reSet1[i].Bar_Code__c)){
// 璺宠繃宸茬粡澶勭悊鐨勬秷鑰楀搧鏄庣粏
continue;
- } else {
+ }else{
String str = '璇ュ晢鍝佸瓨鍦ㄥ嚭璐у饱鍘�';
- ConsumableorderdetailsRecordserror.add(new ConsumableorderdetailsInfo(reSet1[i], str));
- ErrorIdMap.put(reSet1[i].Bar_Code__c, reSet1[i].Bar_Code__c);
+ ConsumableorderdetailsRecordserror.add(new ConsumableorderdetailsInfo(reSet1[i],str));
+ ErrorIdMap.put(reSet1[i].Bar_Code__c,reSet1[i].Bar_Code__c);
}
}
}
//鎷嗙洅宸查攢鍞�
- reSet1 = [
- SELECT
- Id,
- Name,
- Consumable_Product__r.Name__c,
- Consumable_Product__c,
- Consumable_Product__r.Name,
- Sterilization_limit__c,
- Deliver_date__c,
- Bar_Code__c,
- Arrive_date__c,
- Send_Date__c,
- Consumable_order_minor__r.Name,
- Consumable_order_minor__c,
- recordtypeid,
- Consumable_order_minor__r.Arrive_Order__c,
- //add by rentx 2020-10-13 start
- ContractNo_text__c
- /*,ContractNo__c*/
- //add by rentx 2020-10-13 end
- FROM Consumable_order_details2__c
- WHERE
- Dealer_Saled__c = TRUE
- AND Dealer_Arrive__c = TRUE
- AND Dealer_Returned__c = FALSE
- AND Lose_Flag__c = FALSE
- AND Box_Piece__c = '涓�'
- AND RemoveBox_date__c != NULL
- AND Bar_Code__c IN :BarCodeListP
- AND Dealer_Info_text__c = :accountName
- ORDER BY Name
- ];
- if (reSet1.size() > 0) {
+ reSet1 = [SELECT Id, Name,Consumable_Product__r.Name__c,
+ Consumable_Product__c,Consumable_Product__r.Name, Sterilization_limit__c,
+ Deliver_date__c,Bar_Code__c,
+ Arrive_date__c,Send_Date__c,Consumable_order_minor__r.Name,Consumable_order_minor__c,
+ recordtypeid,Consumable_order_minor__r.Arrive_Order__c,
+ //add by rentx 2020-10-13 start
+ ContractNo_text__c
+ /*,ContractNo__c*/
+ //add by rentx 2020-10-13 end
+ FROM Consumable_order_details2__c
+ WHERE Dealer_Saled__c = true
+ AND Dealer_Arrive__c = true
+ AND Dealer_Returned__c = false
+ AND Lose_Flag__c = false
+ AND Box_Piece__c = '涓�'
+ AND RemoveBox_date__c != null
+ AND Bar_Code__c in :BarCodeListP
+ AND Dealer_Info_text__c = :accountName
+ ORDER BY Name ];
+ if(reSet1.size() > 0){
for (Integer i = 0; i < reSet1.size(); i++) {
- if (ErrorIdMap.containsKey(reSet1[i].Bar_Code__c)) {
+ if(ErrorIdMap.containsKey(reSet1[i].Bar_Code__c)){
// 璺宠繃宸茬粡澶勭悊鐨勬秷鑰楀搧鏄庣粏
continue;
- } else {
+ }else{
String str = '璇ュ晢鍝佸瓨鍦ㄩ攢鍞饱鍘�';
- ConsumableorderdetailsRecordserror.add(new ConsumableorderdetailsInfo(reSet1[i], str));
- ErrorIdMap.put(reSet1[i].Bar_Code__c, reSet1[i].Bar_Code__c);
+ ConsumableorderdetailsRecordserror.add(new ConsumableorderdetailsInfo(reSet1[i],str));
+ ErrorIdMap.put(reSet1[i].Bar_Code__c,reSet1[i].Bar_Code__c);
}
}
}
//鎷嗙洅杩斿搧
- reSet1 = [
- SELECT
- Id,
- Name,
- Consumable_Product__r.Name__c,
- Consumable_Product__c,
- Consumable_Product__r.Name,
- Sterilization_limit__c,
- Deliver_date__c,
- Bar_Code__c,
- Arrive_date__c,
- Send_Date__c,
- Consumable_order_minor__r.Name,
- Consumable_order_minor__c,
- recordtypeid,
- Consumable_order_minor__r.Arrive_Order__c,
- //add by rentx 2020-10-13 start
- ContractNo_text__c
- /*,ContractNo__c*/
- //add by rentx 2020-10-13 end
- FROM Consumable_order_details2__c
- WHERE
- Dealer_Returned__c = TRUE
- AND Return_date__c != NULL
- AND Box_Piece__c = '涓�'
- AND RemoveBox_date__c != NULL
- AND Bar_Code__c IN :BarCodeListP
- AND Dealer_Info_text__c = :accountName
- ORDER BY Name
- ];
- if (reSet1.size() > 0) {
+ reSet1 = [SELECT Id, Name,Consumable_Product__r.Name__c,
+ Consumable_Product__c,Consumable_Product__r.Name, Sterilization_limit__c,
+ Deliver_date__c,Bar_Code__c,
+ Arrive_date__c,Send_Date__c,Consumable_order_minor__r.Name,Consumable_order_minor__c,
+ recordtypeid,Consumable_order_minor__r.Arrive_Order__c,
+ //add by rentx 2020-10-13 start
+ ContractNo_text__c
+ /*,ContractNo__c*/
+ //add by rentx 2020-10-13 end
+ FROM Consumable_order_details2__c
+ WHERE Dealer_Returned__c = true
+ AND Return_date__c != null
+ AND Box_Piece__c = '涓�'
+ AND RemoveBox_date__c != null
+ AND Bar_Code__c in :BarCodeListP
+ AND Dealer_Info_text__c = :accountName
+ ORDER BY Name ];
+ if(reSet1.size() > 0){
for (Integer i = 0; i < reSet1.size(); i++) {
- if (ErrorIdMap.containsKey(reSet1[i].Bar_Code__c)) {
+ if(ErrorIdMap.containsKey(reSet1[i].Bar_Code__c)){
// 璺宠繃宸茬粡澶勭悊鐨勬秷鑰楀搧鏄庣粏
continue;
- } else {
+ }else{
String str = '璇ュ晢鍝佸瓨鍦ㄨ繑鍝佸饱鍘�';
- ConsumableorderdetailsRecordserror.add(new ConsumableorderdetailsInfo(reSet1[i], str));
- ErrorIdMap.put(reSet1[i].Bar_Code__c, reSet1[i].Bar_Code__c);
+ ConsumableorderdetailsRecordserror.add(new ConsumableorderdetailsInfo(reSet1[i],str));
+ ErrorIdMap.put(reSet1[i].Bar_Code__c,reSet1[i].Bar_Code__c);
}
}
}
+
//鎷嗙洅鍚庣洏鐐硅繃(鐩樼偣鏃ユ湡涓嶄负绌�)
- reSet1 = [
- SELECT
- Id,
- Name,
- Consumable_Product__r.Name__c,
- Consumable_Product__c,
- Consumable_Product__r.Name,
- Sterilization_limit__c,
- Deliver_date__c,
- Bar_Code__c,
- Arrive_date__c,
- Send_Date__c,
- Consumable_order_minor__r.Name,
- Consumable_order_minor__c,
- recordtypeid,
- Consumable_order_minor__r.Arrive_Order__c,
- //add by rentx 2020-10-13 start
- ContractNo_text__c
- /*,ContractNo__c*/
- //add by rentx 2020-10-13 end
- FROM Consumable_order_details2__c
- WHERE
- Inventory_date__c != NULL
- AND Box_Piece__c = '涓�'
- AND RemoveBox_date__c != NULL
- AND Bar_Code__c IN :BarCodeListP
- AND Dealer_Info_text__c = :accountName
- ORDER BY Name
- ];
- if (reSet1.size() > 0) {
+ reSet1 = [SELECT Id, Name,Consumable_Product__r.Name__c,
+ Consumable_Product__c,Consumable_Product__r.Name, Sterilization_limit__c,
+ Deliver_date__c,Bar_Code__c,
+ Arrive_date__c,Send_Date__c,Consumable_order_minor__r.Name,Consumable_order_minor__c,
+ recordtypeid,Consumable_order_minor__r.Arrive_Order__c,
+ //add by rentx 2020-10-13 start
+ ContractNo_text__c
+ /*,ContractNo__c*/
+ //add by rentx 2020-10-13 end
+ FROM Consumable_order_details2__c
+ WHERE Inventory_date__c != null
+ AND Box_Piece__c = '涓�'
+ AND RemoveBox_date__c != null
+ AND Bar_Code__c in :BarCodeListP
+ AND Dealer_Info_text__c = :accountName
+ ORDER BY Name ];
+ if(reSet1.size() > 0){
for (Integer i = 0; i < reSet1.size(); i++) {
- if (ErrorIdMap.containsKey(reSet1[i].Bar_Code__c)) {
+ if(ErrorIdMap.containsKey(reSet1[i].Bar_Code__c)){
// 璺宠繃宸茬粡澶勭悊鐨勬秷鑰楀搧鏄庣粏
continue;
- } else {
+ }else{
String str = '璇ュ晢鍝佸瓨鍦ㄧ洏鐐瑰饱鍘�';
- ConsumableorderdetailsRecordserror.add(new ConsumableorderdetailsInfo(reSet1[i], str));
- ErrorIdMap.put(reSet1[i].Bar_Code__c, reSet1[i].Bar_Code__c);
+ ConsumableorderdetailsRecordserror.add(new ConsumableorderdetailsInfo(reSet1[i],str));
+ ErrorIdMap.put(reSet1[i].Bar_Code__c,reSet1[i].Bar_Code__c);
}
}
}
//涓嶅悓宸ヤ綔鍦�
- reSet1 = [
- SELECT
- Id,
- Name,
- Consumable_Product__r.Name__c,
- Consumable_Product__c,
- Consumable_Product__r.Name,
- Sterilization_limit__c,
- Deliver_date__c,
- Bar_Code__c,
- Arrive_date__c,
- Send_Date__c,
- Consumable_order_minor__r.Name,
- Consumable_order_minor__c,
- recordtypeid,
- Consumable_order_minor__r.Arrive_Order__c,
- Arrive_Owner_Work_Location__c,
- //add by rentx 2020-10-13 start
- ContractNo_text__c
- /*,ContractNo__c*/
- //add by rentx 2020-10-13 end
- FROM Consumable_order_details2__c
- WHERE
- Dealer_Arrive__c = TRUE
- AND Bar_Code__c IN :BarCodeListP
- AND Dealer_Info_text__c = :accountName
- AND Arrive_Owner_Work_Location__c != :userWorkLocation
- ORDER BY Name
- ];
- if (reSet1.size() > 0) {
+ reSet1 = [SELECT Id, Name,Consumable_Product__r.Name__c,
+ Consumable_Product__c,Consumable_Product__r.Name, Sterilization_limit__c,
+ Deliver_date__c,Bar_Code__c,
+ Arrive_date__c,Send_Date__c,Consumable_order_minor__r.Name,Consumable_order_minor__c,
+ recordtypeid,Consumable_order_minor__r.Arrive_Order__c, Arrive_Owner_Work_Location__c,
+ //add by rentx 2020-10-13 start
+ ContractNo_text__c
+ /*,ContractNo__c*/
+ //add by rentx 2020-10-13 end
+ FROM Consumable_order_details2__c
+ WHERE Dealer_Arrive__c = true
+ AND Bar_Code__c in :BarCodeListP
+ AND Dealer_Info_text__c = :accountName
+ AND Arrive_Owner_Work_Location__c !=: userWorkLocation
+ ORDER BY Name ];
+ if(reSet1.size() > 0){
for (Integer i = 0; i < reSet1.size(); i++) {
- if (ErrorIdMap.containsKey(reSet1[i].Bar_Code__c)) {
+ if(ErrorIdMap.containsKey(reSet1[i].Bar_Code__c)){
// 璺宠繃宸茬粡澶勭悊鐨勬秷鑰楀搧鏄庣粏
continue;
- } else {
+ }else{
String str = '璇ュ晢鍝佸睘浜�' + reSet1[i].Arrive_Owner_Work_Location__c + ',涓嶈兘鍙栨秷鎷嗙洅';
- ConsumableorderdetailsRecordserror.add(new ConsumableorderdetailsInfo(reSet1[i], str));
- ErrorIdMap.put(reSet1[i].Bar_Code__c, reSet1[i].Bar_Code__c);
+ ConsumableorderdetailsRecordserror.add(new ConsumableorderdetailsInfo(reSet1[i],str));
+ ErrorIdMap.put(reSet1[i].Bar_Code__c,reSet1[i].Bar_Code__c);
}
}
}
- reSet = [
- SELECT
- Id,
- Name,
- Intra_Trade_List_RMB__c,
- Asset_Model_No__c,
- Consumable_Product__c,
- Consumable_Product__r.Name,
- Consumable_Product__r.Name__c,
- Sterilization_limit__c,
- Deliver_date__c,
- Bar_Code__c,
- Arrive_date__c,
- Send_Date__c,
- Consumable_order_minor__r.Name,
- Consumable_order_minor__c,
- Dealer_Arrive__c,
- Guarantee_period_for_products__c,
- CFDA_Status__c,
- ProductPacking_list_manual__c,
- Report_Product_Approbation__c,
- Report_Product_Expiration__c,
- //add by rentx 2020-10-13 start
- ContractNo_text__c
- /*,ContractNo__c*/
- //add by rentx 2020-10-13 end
- FROM Consumable_order_details2__c
- WHERE
- Dealer_Arrive__c = TRUE
- AND Dealer_Shipment__c = FALSE
- AND Dealer_Saled__c = FALSE
- AND Dealer_Returned__c = FALSE
- AND Lose_Flag__c = FALSE
- AND Box_Piece__c = '涓�'
- AND RemoveBox_date__c != NULL
- AND Bar_Code__c IN :BarCodeListP
- AND Dealer_Info_text__c = :accountName
- AND Arrive_Owner_Work_Location__c = :userWorkLocation
- AND Product_Type__c LIKE :userPro_Typestr
- ];
- if (reSet.size() > 0) {
+ reSet = [SELECT Id,
+ Name,
+ Intra_Trade_List_RMB__c,
+ Asset_Model_No__c,
+ Consumable_Product__c,
+ Consumable_Product__r.Name,
+ Consumable_Product__r.Name__c,
+ Sterilization_limit__c,
+ Deliver_date__c,
+ Bar_Code__c,
+ Arrive_date__c,
+ Send_Date__c,
+ Consumable_order_minor__r.Name,
+ Consumable_order_minor__c,
+ Dealer_Arrive__c,
+ Guarantee_period_for_products__c,
+ CFDA_Status__c,
+ ProductPacking_list_manual__c,
+ Report_Product_Approbation__c,
+ Report_Product_Expiration__c,
+ //add by rentx 2020-10-13 start
+ ContractNo_text__c
+ /*,ContractNo__c*/
+ //add by rentx 2020-10-13 end
+ FROM Consumable_order_details2__c
+ WHERE Dealer_Arrive__c = true
+ AND Dealer_Shipment__c = false
+ AND Dealer_Saled__c = false
+ AND Dealer_Returned__c = false
+ AND Lose_Flag__c = false
+ AND Box_Piece__c = '涓�'
+ AND RemoveBox_date__c != null
+ AND Bar_Code__c in :BarCodeListP
+ AND Dealer_Info_text__c = :accountName
+ AND Arrive_Owner_Work_Location__c =: userWorkLocation
+ AND Product_Type__c like : userPro_Typestr
+ ];
+ if(reSet.size()>0){
for (Integer i = 0; i < reSet.size(); i++) {
- if (ErrorIdMap.containsKey(reSet[i].Bar_Code__c)) {
+ if(ErrorIdMap.containsKey(reSet[i].Bar_Code__c) ){
// 璺宠繃閿欒鐨勬秷鑰楀搧鏄庣粏
continue;
- } else if (ExistIdMap.containsKey(reSet[i].Bar_Code__c)) {
+ }
+ else if(ExistIdMap.containsKey(reSet[i].Bar_Code__c) ){
// 璺宠繃宸茬粡澶勭悊鐨勬秷鑰楀搧鏄庣粏
continue;
- } else {
+ }
+ else{
ConsumableorderdetailsRecordsdummy.add(new ConsumableorderdetailsInfo(reSet[i]));
- ExistIdMap.put(reSet[i].Bar_Code__c, reSet[i].Bar_Code__c);
+ ExistIdMap.put(reSet[i].Bar_Code__c,reSet[i].Bar_Code__c);
}
}
}
@@ -549,97 +432,89 @@
AllMap.putAll(ExistIdMap);
//寰楀埌涓嶅瓨鍦ㄧ殑BarCode
- for (Integer i = 0; i < BarCodeListP.size(); i++) {
- if (ExistIdMap.containsKey(BarCodeListP[i])) {
+ for(Integer i = 0; i < BarCodeListP.size(); i++){
+ if(ExistIdMap.containsKey(BarCodeListP[i])){
continue;
- } else if (ErrorIdMap.containsKey(BarCodeListP[i])) {
+ }else if(ErrorIdMap.containsKey(BarCodeListP[i])){
continue;
- } else {
+ }else{
notInlist.add(BarCodeListP[i]);
}
}
- if (notInlist.size() > 0) {
- // ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR,'BarCode'+ notInlist + '涓嶅瓨鍦ㄣ��'));
- return new ResponseBodyLWC('Error', 500, 'BarCode' + notInlist + '涓嶅瓨鍦ㄣ��', '');
+ if(notInlist.size()>0){
+ // ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR,'BarCode'+ notInlist + '涓嶅瓨鍦ㄣ��'));
+ return new ResponseBodyLWC('Error',500, 'BarCode'+ notInlist + '涓嶅瓨鍦ㄣ��', '');
}
- data.put('ConsumableorderdetailsRecordsdummy', JSON.serialize(ConsumableorderdetailsRecordsdummy));
- data.put('ConsumableorderdetailsRecordserror', JSON.serialize(ConsumableorderdetailsRecordserror));
- data.put('dataSize', ConsumableorderdetailsRecordsdummy.size());
+ data.put('ConsumableorderdetailsRecordsdummy',JSON.serialize(ConsumableorderdetailsRecordsdummy));
+ data.put('ConsumableorderdetailsRecordserror',JSON.serialize(ConsumableorderdetailsRecordserror));
+ data.put('dataSize',ConsumableorderdetailsRecordsdummy.size());
res.status = 'Success';
res.code = 200;
System.debug('res = ' + res);
return res;
+
}
//鍙栨秷鎷嗙洅纭
@AuraEnabled
- public static ResponseBodyLWC cancelRemoveBoxConfirm(
- String saveConsumableorderdetailsRecordsdummy,
- String accountName,
- String userWorkLocation,
- String agencyProType
- ) {
+ public static ResponseBodyLWC cancelRemoveBoxConfirm(String saveConsumableorderdetailsRecordsdummy,String accountName,String userWorkLocation,String agencyProType) {
ResponseBodyLWC res = new ResponseBodyLWC();
- Map<String, object> data = new Map<String, object>();
+ Map<String,object> data = new Map<String,object>();
res.entity = data;
userPro_Typestr = '%' + agencyProType + '%';
accountName = accountName;
- userWorkLocation = userWorkLocation;
- List<ConsumableorderdetailsInfo> ConsumableorderdetailsRecordsdummy = (List<ConsumableorderdetailsInfo>) JSON.deserialize(
- saveConsumableorderdetailsRecordsdummy,
- List<ConsumableorderdetailsInfo>.class
- );
+ userWorkLocation =userWorkLocation;
+ List<ConsumableorderdetailsInfo> ConsumableorderdetailsRecordsdummy = (List<ConsumableorderdetailsInfo>)JSON.deserialize(saveConsumableorderdetailsRecordsdummy,List<ConsumableorderdetailsInfo>.class);
- List<Consumable_order_details2__c> ins = new List<Consumable_order_details2__c>();
+ List<Consumable_order_details2__c> ins = New List<Consumable_order_details2__c>();
+
Savepoint sp = Database.setSavepoint();
- if (ConsumableorderdetailsRecordsdummy.size() < 1) {
+ if(ConsumableorderdetailsRecordsdummy.size()<1){
// ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR,'涓嶅瓨鍦ㄥ彇娑堟媶鐩掓槑缁�'));
- return new ResponseBodyLWC('Error', 500, '涓嶅瓨鍦ㄥ彇娑堟媶鐩掓槑缁�', '');
+ return new ResponseBodyLWC('Error',500, '涓嶅瓨鍦ㄥ彇娑堟媶鐩掓槑缁�', '');
// return null;
}
List<String> BarCodeList = new List<String>();
- for (ConsumableorderdetailsInfo tmp : ConsumableorderdetailsRecordsdummy) {
+ for (ConsumableorderdetailsInfo tmp : ConsumableorderdetailsRecordsdummy) {
BarCodeList.add(tmp.esd.Bar_Code__c);
}
- try {
+ try{
//鍙栧緱閫氱暘澶т簬001鐨勫湪搴撴槑缁�
- List<Consumable_order_details2__c> orderDetails2del = [
- SELECT
- Id,
- Box_Piece__c,
- RemoveBox_date__c,
- RemoveBox_No__c,
- Bar_Code__c,
- //add by rentx 2020-10-13 start
- ContractNo_text__c
- /*,ContractNo__c*/
- //add by rentx 2020-10-13 end
- FROM Consumable_order_details2__c
- WHERE
- Dealer_Arrive__c = TRUE
- AND Dealer_Shipment__c = FALSE
- AND Dealer_Saled__c = FALSE
- AND Dealer_Returned__c = FALSE
- AND Lose_Flag__c = FALSE
+ List<Consumable_order_details2__c> orderDetails2del = [SELECT
+ Id,
+ Box_Piece__c,
+ RemoveBox_date__c,
+ RemoveBox_No__c,
+ Bar_Code__c,
+ //add by rentx 2020-10-13 start
+ ContractNo_text__c
+ /*,ContractNo__c*/
+ //add by rentx 2020-10-13 end
+ FROM Consumable_order_details2__c
+ WHERE Dealer_Arrive__c = true
+ AND Dealer_Shipment__c = false
+ AND Dealer_Saled__c = false
+ AND Dealer_Returned__c = false
+ AND Lose_Flag__c = false
AND Box_Piece__c = '涓�'
- AND RemoveBox_date__c != NULL
+ AND RemoveBox_date__c != null
AND RemoveBox_No__c > 1
- AND Bar_Code__c IN :BarCodeList
- AND Dealer_Info_text__c = :accountName
- AND Arrive_Owner_Work_Location__c = :userWorkLocation
- AND Product_Type__c LIKE :userPro_Typestr
- ];
+ AND Bar_Code__c in :BarCodeList
+ AND Dealer_Info_text__c = :accountName
+ AND Arrive_Owner_Work_Location__c =: userWorkLocation
+ AND Product_Type__c like : userPro_Typestr
+ ];
List<Consumable_order_details2__c> orderlistdel = new List<Consumable_order_details2__c>();
- List<Consumable_order_details2__c> orderlistupd = new List<Consumable_order_details2__c>();
-
+ List<Consumable_order_details2__c> orderlistupd= new List<Consumable_order_details2__c>();
+
for (Consumable_order_details2__c detail2tmp : orderDetails2del) {
Consumable_order_details2__c delDetails2 = new Consumable_order_details2__c();
- delDetails2.Id = detail2tmp.Id;
+ delDetails2.Id = detail2tmp.Id;
//鍒犻櫎閫氱暘澶т簬001鐨勬槑缁�2
//delete delDetails2;
@@ -647,48 +522,46 @@
}
//鍙栧緱閫氱暘001鐨勫湪搴撴槑缁�
- List<Consumable_order_details2__c> orderDetails2 = [
- SELECT
- Id,
- Box_Piece__c,
- RemoveBox_date__c,
- RemoveBox_No__c,
- Bar_Code__c,
- //add by rentx 2020-10-13 start
- ContractNo_text__c,
- /*,ContractNo__c*/
- //add by rebtx 2020-10-13 end
+ List<Consumable_order_details2__c> orderDetails2 = [SELECT
+ Id,
+ Box_Piece__c,
+ RemoveBox_date__c,
+ RemoveBox_No__c,
+ Bar_Code__c,
+ //add by rentx 2020-10-13 start
+ ContractNo_text__c
+ /*,ContractNo__c*/
+ //add by rebtx 2020-10-13 end
// tcm start
- Consumable_order_minor__r.ContractNo__c
- // tcm end
- FROM Consumable_order_details2__c
- WHERE
- Dealer_Arrive__c = TRUE
- AND Dealer_Shipment__c = FALSE
- AND Dealer_Saled__c = FALSE
- AND Dealer_Returned__c = FALSE
- AND Lose_Flag__c = FALSE
+ ,Consumable_order_minor__r.ContractNo__c
+ // tcm end
+ FROM Consumable_order_details2__c
+ WHERE Dealer_Arrive__c = true
+ AND Dealer_Shipment__c = false
+ AND Dealer_Saled__c = false
+ AND Dealer_Returned__c = false
+ AND Lose_Flag__c = false
AND Box_Piece__c = '涓�'
- AND RemoveBox_date__c != NULL
+ AND RemoveBox_date__c !=null
AND RemoveBox_No__c = 1
- AND Bar_Code__c IN :BarCodeList
- AND Dealer_Info_text__c = :accountName
- AND Arrive_Owner_Work_Location__c = :userWorkLocation
- AND Product_Type__c LIKE :userPro_Typestr
- ];
+ AND Bar_Code__c in :BarCodeList
+ AND Dealer_Info_text__c = :accountName
+ AND Arrive_Owner_Work_Location__c =: userWorkLocation
+ AND Product_Type__c like : userPro_Typestr
+ ];
for (Consumable_order_details2__c detail2tmp : orderDetails2) {
Consumable_order_details2__c updDetails2 = new Consumable_order_details2__c();
- updDetails2.Id = detail2tmp.Id;
- updDetails2.Box_Piece__c = '鐩�';
- updDetails2.RemoveBox_date__c = null;
- updDetails2.RemoveBox_No__c = null;
+ updDetails2.Id = detail2tmp.Id;
+ updDetails2.Box_Piece__c = '鐩�';
+ updDetails2.RemoveBox_date__c = null;
+ updDetails2.RemoveBox_No__c = null;
// tcm start
if (String.isBlank(detail2tmp.Consumable_order_minor__r.ContractNo__c)) {
- updDetails2.ContractNo_text__c = detail2tmp.ContractNo_text__c;
- } else {
- updDetails2.ContractNo_text__c = detail2tmp.Consumable_order_minor__r.ContractNo__c;
+ updDetails2.ContractNo_text__c= detail2tmp.ContractNo_text__c;
+ }else {
+ updDetails2.ContractNo_text__c= detail2tmp.Consumable_order_minor__r.ContractNo__c;
}
// updDetails2.ContractNo_text__c = detail2tmp.ContractNo__c;
// tcm end
@@ -698,28 +571,29 @@
orderlistupd.add(updDetails2);
}
- if (orderlistdel.size() > 0) {
+ if(orderlistdel.size()>0){
delete orderlistdel;
}
- if (orderlistupd.size() > 0) {
+ if(orderlistupd.size()>0){
update orderlistupd;
}
saveFLGbln = true;
alertMessage = '鍙栨秷鎷嗙洅瀹屾垚';
- data.put('saveFLGbln', saveFLGbln);
+ data.put('saveFLGbln',saveFLGbln);
res.status = 'Success';
res.code = 200;
res.msg = alertMessage;
System.debug('res = ' + res);
return res;
// return null;
- } catch (Exception e) {
+ }catch(Exception e){
Database.rollback(sp);
ApexPages.addMessages(e);
return null;
}
}
+
@TestVisible
class ConsumableorderdetailsInfo implements Comparable {
@@ -733,18 +607,18 @@
//public String tracingCodeNo { get; set; }
public String oldConsumableCount { get; set; }
public String ErrorReason { get; set; }
- public ConsumableorderdetailsInfo(Consumable_order_details2__c e, string str) {
- esd = e;
- Prod = e.Consumable_Product__r;
+ public ConsumableorderdetailsInfo(Consumable_order_details2__c e,string str) {
+ esd = e;
+ Prod = e.Consumable_Product__r;
oldConsumableCount = e.name;
- ErrorReason = str;
+ ErrorReason = str;
}
public ConsumableorderdetailsInfo(Consumable_order_details2__c e) {
- esd = e;
- Prod = e.Consumable_Product__r;
+ esd = e;
+ Prod = e.Consumable_Product__r;
oldConsumableCount = e.name;
}
- /*
+/*
public ConsumableorderdetailsInfo(Product2__c e,String barCode,Date sterilizationlimit,String serialNoorLot,String tracingCode) {
esd = new Consumable_order_details2__c();
ProductName = e.Name__c;
@@ -770,4 +644,4 @@
return null;
}
}
-}
+}
\ No newline at end of file
diff --git a/force-app/main/default/classes/LexCancelRemoveBoxControllerTest.cls b/force-app/main/default/classes/LexCancelRemoveBoxControllerTest.cls
index d3fbe00..e9f7dad 100644
--- a/force-app/main/default/classes/LexCancelRemoveBoxControllerTest.cls
+++ b/force-app/main/default/classes/LexCancelRemoveBoxControllerTest.cls
@@ -1,91 +1,35 @@
@IsTest
private class LexCancelRemoveBoxControllerTest {
- static testMethod void testMethod1() {
+ static testMethod void testMethod1(){
Oly_TriggerHandler.bypass('ConsumableAssetHander');
Oly_TriggerHandler.bypass('Oly_TriggerHandler');
user myUser_test;
Account myAccount2;
- User thisUser = [SELECT Id FROM User WHERE Id = :UserInfo.getUserId()];
- System.runAs(thisUser) {
- List<RecordType> rectCo = [
- SELECT Id
- FROM RecordType
- WHERE IsActive = TRUE AND SobjectType = 'Account' AND Name = '璨╁2搴�'
- ];
+ User thisUser = [ select Id from User where Id = :UserInfo.getUserId()];
+ System.runAs(thisUser){
+ List<RecordType> rectCo = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '璨╁2搴�'];
if (rectCo.size() == 0) {
return;
}
- Profile prof = [
- SELECT Id
- FROM Profile
- WHERE Name = '901_缁忛攢鍟嗙ぞ鍖烘櫘閫氭潈闄恄2閲嶉獙璇�(ET Email)'
- ];
-
- myAccount2 = new Account(
- name = 'Testaccount002',
- Dealer_discount__c = 20,
- RecordTypeId = rectCo[0].Id,
- AgentCode_Ext__c = '9999900'
- );
+ Profile prof = [select Id from Profile where Name ='901_缁忛攢鍟嗙ぞ鍖烘櫘閫氭潈闄恄2閲嶉獙璇�(ET Email)'];
+
+ myAccount2 = new Account(name='Testaccount002',Dealer_discount__c =20,RecordTypeId = rectCo[0].Id,AgentCode_Ext__c = '9999900');
insert myAccount2;
-
- Contact core = new Contact(
- email = 'jplumber@salesforce.com',
- firstname = 'Joe',
- lastname = 'Plumber',
- accountid = myAccount2.id
- );
+
+ Contact core = new Contact(email='jplumber@salesforce.com', firstname='Joe',lastname='Plumber',accountid=myAccount2.id);
insert core;
- MyUser_Test = new User(
- ContactId = core.id,
- Alias = 'newUser',
- Email = 'newuser@testorg.com',
- EmailEncodingKey = 'UTF-8',
- LastName = 'TestUser',
- LanguageLocaleKey = 'zh_CN',
- LocaleSidKey = 'zh_CN',
- ProfileId = prof.Id,
- TimeZoneSidKey = 'Asia/Shanghai',
- UserName = 'testUser@testorg.com'
- );
+ MyUser_Test = New User(ContactId = core.id,Alias = 'newUser',Email='newuser@testorg.com',EmailEncodingKey='UTF-8', LastName='TestUser', LanguageLocaleKey='zh_CN',LocaleSidKey='zh_CN', ProfileId = prof.Id,TimeZoneSidKey='Asia/Shanghai', UserName='testUser@testorg.com');
insert MyUser_Test;
}
- System.runAs(MyUser_Test) {
- Product2 prod01 = new Product2(
- Name = 'Test01',
- ProductCode = 'Test01',
- Asset_Model_No__c = 'Test01',
- SFDA_Status__c = '鏈夊姽',
- JANCODE__c = '04953170200311',
- Dealer_special_Object__c = true,
- Packing_list_manual__c = 5,
- Manual_Entry__c = false
- );
- Product2 prod02 = new Product2(
- Name = 'Test02',
- ProductCode = 'Test02',
- Asset_Model_No__c = 'Test02',
- SFDA_Status__c = '鏈夊姽',
- JANCODE__c = '04953170200312',
- Dealer_special_Object__c = true,
- Packing_list_manual__c = 5,
- Manual_Entry__c = false
- );
- Product2 prod03 = new Product2(
- Name = 'Test03',
- ProductCode = 'Test03',
- Asset_Model_No__c = 'Test03',
- SFDA_Status__c = '鏈夊姽',
- JANCODE__c = '04953170200313',
- Dealer_special_Object__c = true,
- Packing_list_manual__c = 1,
- Manual_Entry__c = false
- );
- insert new List<Product2>{ prod01, prod02, prod03 };
- Product2__c pro1 = new Product2__c(Name = 'Pro001', OT_CODE_Text__c = 'Test001', Product2__c = prod01.Id);
- Product2__c pro2 = new Product2__c(Name = 'Pro002', OT_CODE_Text__c = 'Test002', Product2__c = prod02.Id);
- Product2__c pro3 = new Product2__c(Name = 'Pro003', OT_CODE_Text__c = 'Test003', Product2__c = prod03.Id);
- insert new List<Product2__c>{ pro1, pro2, pro3 };
+ System.runAs(MyUser_Test){
+ Product2 prod01 = new Product2(Name='Test01',ProductCode='Test01',Asset_Model_No__c = 'Test01',SFDA_Status__c = '鏈夊姽',JANCODE__c = '04953170200311',Dealer_special_Object__c = true,Packing_list_manual__c = 5,Manual_Entry__c = false);
+ Product2 prod02 = new Product2(Name='Test02',ProductCode='Test02',Asset_Model_No__c = 'Test02',SFDA_Status__c = '鏈夊姽',JANCODE__c = '04953170200312',Dealer_special_Object__c = true,Packing_list_manual__c = 5,Manual_Entry__c = false);
+ Product2 prod03 = new Product2(Name='Test03',ProductCode='Test03',Asset_Model_No__c = 'Test03',SFDA_Status__c = '鏈夊姽',JANCODE__c = '04953170200313',Dealer_special_Object__c = true,Packing_list_manual__c = 1,Manual_Entry__c = false);
+ insert new Product2[]{prod01,prod02,prod03};
+ Product2__c pro1 = new Product2__c(Name='Pro001',OT_CODE_Text__c='Test001',Product2__c = prod01.Id);
+ Product2__c pro2 = new Product2__c(Name='Pro002',OT_CODE_Text__c='Test002',Product2__c = prod02.Id);
+ Product2__c pro3 = new Product2__c(Name='Pro003',OT_CODE_Text__c='Test003',Product2__c = prod03.Id);
+ insert new Product2__c[] {pro1, pro2,pro3};
//璁㈠崟
Consumable_order__c Order1 = new Consumable_order__c();
Order1.Name = 'OCM_01_001';
@@ -94,8 +38,9 @@
Order1.Dealer_Info__c = myAccount2.Id;
Order1.RecordTypeid = System.Label.RT_ConOrder_Delivery;
Order1.Order_ProType__c = 'ET';
- insert Order1;
+ insert Order1;
List<Consumable_order_details2__c> conList = new List<Consumable_order_details2__c>();
+
//daoku
Consumable_order_details2__c Orderdet2 = new Consumable_order_details2__c();
@@ -107,8 +52,8 @@
Orderdet2.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJRF';
Orderdet2.Used_date__c = null;
Orderdet2.Lose_Flag__c = false;
- Orderdet2.Return_date__c = null;
- Orderdet2.Send_Date__c = null;
+ Orderdet2.Return_date__c= null;
+ Orderdet2.Send_Date__c= null;
Orderdet2.Box_Piece__c = '鐩�';
conList.add(Orderdet2);
// insert Orderdet2;
@@ -122,13 +67,15 @@
Orderdet3.Arrive_date__c = Date.today();
Orderdet3.Send_Date__c = Date.today();
Orderdet3.Box_Piece__c = '涓�';
- Orderdet3.RemoveBox_date__c = Date.today();
+ Orderdet3.RemoveBox_date__c= Date.today();
Orderdet3.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJRA';
Orderdet3.Used_date__c = null;
Orderdet3.Lose_Flag__c = false;
- Orderdet3.Return_date__c = null;
+ Orderdet3.Return_date__c= null;
conList.add(Orderdet3);
// insert Orderdet3;
+
+
//sale
Consumable_order_details2__c Orderdet4 = new Consumable_order_details2__c();
@@ -138,13 +85,14 @@
Orderdet4.Asset_Model_No__c = 'Test02';
Orderdet4.Arrive_date__c = Date.today();
Orderdet4.Box_Piece__c = '涓�';
- Orderdet4.RemoveBox_date__c = Date.today();
+ Orderdet4.RemoveBox_date__c= Date.today();
Orderdet4.Bar_Code__c = '011495317020843711170400172003311074K250CXSDS';
Orderdet4.Lose_Flag__c = false;
- Orderdet4.Return_date__c = null;
- Orderdet4.Used_date__c = Date.today();
+ Orderdet4.Return_date__c= null;
+ Orderdet4.Used_date__c= Date.today();
// insert Orderdet4;
conList.add(Orderdet4);
+
//ProductPacking_list_manual__c=1
Consumable_order_details2__c Orderdet5 = new Consumable_order_details2__c();
@@ -155,17 +103,17 @@
Orderdet5.Arrive_date__c = Date.today();
//Orderdet5.Used_date__c = Date.today();
Orderdet5.Box_Piece__c = '鐩�';
- Orderdet5.RemoveBox_date__c = Date.today();
+ Orderdet5.RemoveBox_date__c= Date.today();
Orderdet5.Used_date__c = null;
Orderdet5.Lose_Flag__c = false;
- Orderdet5.Return_date__c = null;
- Orderdet5.Send_Date__c = null;
+ Orderdet5.Return_date__c= null;
+ Orderdet5.Send_Date__c=null;
Orderdet5.Bar_Code__c = '010495317014059411170400172203311074K250DCWQW';
// insert Orderdet5;
conList.add(Orderdet5);
//pandian
- Consumable_order_details2__c Orderdet7 = new Consumable_order_details2__c();
+ Consumable_order_details2__c Orderdet7 = new Consumable_order_details2__c();
Orderdet7.Name = 'OCM_01_001004';
Orderdet7.Consumable_order_minor__c = Order1.Id;
Orderdet7.Consumable_Product__c = pro2.Id;
@@ -173,12 +121,12 @@
Orderdet7.Box_Piece__c = '鐩�';
Orderdet7.Lose_Flag__c = false;
Orderdet7.Bar_Code__c = '010495317014059411170400172203311074K250DBVUD';
- Orderdet7.RemoveBox_date__c = Date.today();
- Orderdet7.Inventory_date__c = Date.today();
+ Orderdet7.RemoveBox_date__c= Date.today();
+ Orderdet7.Inventory_date__c= Date.today();
// insert Orderdet7;
conList.add(Orderdet7);
- Consumable_order_details2__c Orderdet8 = new Consumable_order_details2__c();
+ Consumable_order_details2__c Orderdet8= new Consumable_order_details2__c();
Orderdet8.Name = 'OCM_01_001004';
Orderdet8.Consumable_order_minor__c = Order1.Id;
Orderdet8.Consumable_Product__c = pro2.Id;
@@ -189,89 +137,61 @@
Orderdet8.Bar_Code__c = '1683272847250250WZIOF';
Orderdet8.Used_date__c = null;
Orderdet8.Lose_Flag__c = false;
- Orderdet8.Return_date__c = null;
- Orderdet8.RemoveBox_date__c = Date.today();
- Orderdet8.Send_Date__c = null;
- Orderdet8.RemoveBox_No__c = 3;
+ Orderdet8.Return_date__c= null;
+ Orderdet8.RemoveBox_date__c=Date.today();
+ Orderdet8.Send_Date__c=null;
+ Orderdet8.RemoveBox_No__c =3;
conList.add(Orderdet8);
insert conList;
// insert Orderdet8;
+
System.Test.startTest();
LexCancelRemoveBoxController.init();
// LexCancelRemoveBoxController.getinventorysize();
- LexCancelRemoveBoxController.searchConsumableorderdetails('1683272847250250WZIOF', '鎹峰皵鍖荤枟(娴峰崡锛夋湁闄愬叕鍙�', '娣卞湷', 'ENG');
- LexCancelRemoveBoxController.searchConsumableorderdetails('', '鎹峰皵鍖荤枟(娴峰崡锛夋湁闄愬叕鍙�', '娣卞湷', 'ENG');
- LexCancelRemoveBoxController.cancelRemoveBoxConfirm(JSON.serialize(conList), '鎹峰皵鍖荤枟(娴峰崡锛夋湁闄愬叕鍙�', '娣卞湷', 'ENG');
+ LexCancelRemoveBoxController.searchConsumableorderdetails('1683272847250250WZIOF','鎹峰皵鍖荤枟(娴峰崡锛夋湁闄愬叕鍙�','娣卞湷','ENG');
+ LexCancelRemoveBoxController.searchConsumableorderdetails('','鎹峰皵鍖荤枟(娴峰崡锛夋湁闄愬叕鍙�','娣卞湷','ENG');
+ LexCancelRemoveBoxController.cancelRemoveBoxConfirm(JSON.serialize(conList),'鎹峰皵鍖荤枟(娴峰崡锛夋湁闄愬叕鍙�','娣卞湷','ENG');
System.Test.stopTest();
+
}
}
- static testMethod void testMethod2() {
+ static testMethod void testMethod2(){
Oly_TriggerHandler.bypass('ConsumableAssetHander');
Oly_TriggerHandler.bypass('Oly_TriggerHandler');
user myUser_test;
Account myAccount2;
- User thisUser = [SELECT Id FROM User WHERE Id = :UserInfo.getUserId()];
- System.runAs(thisUser) {
- List<RecordType> rectCo = [
- SELECT Id
- FROM RecordType
- WHERE IsActive = TRUE AND SobjectType = 'Account' AND Name = '璨╁2搴�'
- ];
+ User thisUser = [ select Id from User where Id = :UserInfo.getUserId()];
+ System.runAs(thisUser){
+ List<RecordType> rectCo = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '璨╁2搴�'];
if (rectCo.size() == 0) {
return;
}
- Profile prof = [
- SELECT Id
- FROM Profile
- WHERE Name = '901_缁忛攢鍟嗙ぞ鍖烘櫘閫氭潈闄恄2閲嶉獙璇�(ET Email)'
- ];
-
- myAccount2 = new Account(
- name = 'Testaccount002',
- Dealer_discount__c = 20,
- RecordTypeId = rectCo[0].Id,
- AgentCode_Ext__c = '9999900'
- );
+ Profile prof = [select Id from Profile where Name ='901_缁忛攢鍟嗙ぞ鍖烘櫘閫氭潈闄恄2閲嶉獙璇�(ET Email)'];
+
+ myAccount2 = new Account(name='Testaccount002',Dealer_discount__c =20,RecordTypeId = rectCo[0].Id,AgentCode_Ext__c = '9999900');
insert myAccount2;
-
- Contact core = new Contact(
- email = 'jplumber@salesforce.com',
- firstname = 'Joe',
- lastname = 'Plumber',
- accountid = myAccount2.id
- );
+
+ Contact core = new Contact(email='jplumber@salesforce.com', firstname='Joe',lastname='Plumber',accountid=myAccount2.id);
insert core;
- MyUser_Test = new User(
- ContactId = core.id,
- Alias = 'newUser',
- Email = 'newuser@testorg.com',
- EmailEncodingKey = 'UTF-8',
- LastName = 'TestUser',
- LanguageLocaleKey = 'zh_CN',
- LocaleSidKey = 'zh_CN',
- ProfileId = prof.Id,
- TimeZoneSidKey = 'Asia/Shanghai',
- UserName = 'testUser@testorg.com',
- Work_Location__c = '閲嶅簡'
- );
+ MyUser_Test = New User(ContactId = core.id,Alias = 'newUser',Email='newuser@testorg.com',EmailEncodingKey='UTF-8', LastName='TestUser', LanguageLocaleKey='zh_CN',LocaleSidKey='zh_CN', ProfileId = prof.Id,TimeZoneSidKey='Asia/Shanghai', UserName='testUser@testorg.com',Work_Location__c ='閲嶅簡');
insert MyUser_Test;
}
- System.runAs(MyUser_Test) {
- //璁㈠崟
- Consumable_order__c Order1 = new Consumable_order__c();
- Order1.Name = 'OCM_01_001';
- Order1.Order_status__c = '鎵瑰噯';
- Order1.Order_type__c = '鍒拌揣';
- Order1.Dealer_Info__c = myAccount2.Id;
- Order1.RecordTypeid = '01210000000c9dqAAA';
- Order1.Order_ProType__c = 'ET';
- insert Order1;
-
- List<Consumable_order_details2__c> conList = new List<Consumable_order_details2__c>();
- List<Consumable_order_details2__c> conList1 = new List<Consumable_order_details2__c>();
+ System.runAs(MyUser_Test){
+ //璁㈠崟
+ Consumable_order__c Order1 = new Consumable_order__c();
+ Order1.Name = 'OCM_01_001';
+ Order1.Order_status__c = '鎵瑰噯';
+ Order1.Order_type__c = '鍒拌揣';
+ Order1.Dealer_Info__c = myAccount2.Id;
+ Order1.RecordTypeid = '01210000000c9dqAAA';
+ Order1.Order_ProType__c = 'ET';
+ insert Order1;
+
+ List<Consumable_order_details2__c> conList = new List<Consumable_order_details2__c>();
+ List<Consumable_order_details2__c> conList1 = new List<Consumable_order_details2__c>();
Consumable_order_details2__c con = new Consumable_order_details2__c();
con.Consumable_Arrived_order__c = Order1.Id;
con.Send_Date__c = null;
@@ -297,131 +217,50 @@
con.RemoveBox_No__c = 1;
con1.Bar_Code__c = '1682414917514250XSCYW';
conList.add(con1);
- insert (conList);
- System.debug('conList' + conList);
+ insert(conList);
+ System.debug('conList'+conList);
System.Test.startTest();
- LexCancelRemoveBoxController.cancelRemoveBoxConfirm(JSON.serialize(conList), 'Testaccount002', '閲嶅簡', 'ET');
- LexCancelRemoveBoxController.cancelRemoveBoxConfirm(JSON.serialize(conList1), 'Testaccount002', '閲嶅簡', 'ET');
+ LexCancelRemoveBoxController.cancelRemoveBoxConfirm(JSON.serialize(conList),'Testaccount002','閲嶅簡','ET');
+ LexCancelRemoveBoxController.cancelRemoveBoxConfirm(JSON.serialize(conList1),'Testaccount002','閲嶅簡','ET');
System.Test.stopTest();
- }
- }
- static testMethod void testMethod3() {
+ }
+}
+ static testMethod void testMethod3(){
Oly_TriggerHandler.bypass('ConsumableAssetHander');
Oly_TriggerHandler.bypass('Oly_TriggerHandler');
User myUser_test;
Account myAccount2;
- User thisUser = [SELECT Id FROM User WHERE Id = :UserInfo.getUserId()];
- System.runAs(thisUser) {
- List<RecordType> rectCo = [
- SELECT Id
- FROM RecordType
- WHERE IsActive = TRUE AND SobjectType = 'Account' AND Name = '璨╁2搴�'
- ];
+ User thisUser = [ select Id from User where Id = :UserInfo.getUserId()];
+ System.runAs(thisUser){
+ List<RecordType> rectCo = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '璨╁2搴�'];
if (rectCo.size() == 0) {
return;
}
- Profile prof = [
- SELECT Id
- FROM Profile
- WHERE Name = '901_缁忛攢鍟嗙ぞ鍖烘櫘閫氭潈闄恄2閲嶉獙璇�(ET Email)'
- ];
- myAccount2 = new Account(name = 'Testaccount003', Dealer_discount__c = 20, RecordTypeId = rectCo[0].Id, AgentCode_Ext__c = '2');
+ Profile prof = [select Id from Profile where Name ='901_缁忛攢鍟嗙ぞ鍖烘櫘閫氭潈闄恄2閲嶉獙璇�(ET Email)'];
+ myAccount2 = new Account(name='Testaccount003',Dealer_discount__c =20,RecordTypeId = rectCo[0].Id,AgentCode_Ext__c = '2');
insert myAccount2;
- Contact core = new Contact(email = 'wan@salesforce.com', firstname = 'wan', lastname = 'Plumbers', accountid = myAccount2.id);
+ Contact core = new Contact(email='wan@salesforce.com', firstname='wan',lastname='Plumbers',accountid=myAccount2.id);
insert core;
- myUser_test = new User(
- ContactId = core.id,
- Alias = 'newUser',
- Email = 'newuser@testorg.com',
- EmailEncodingKey = 'UTF-8',
- LastName = 'TestUser',
- LanguageLocaleKey = 'zh_CN',
- LocaleSidKey = 'zh_CN',
- ProfileId = prof.Id,
- TimeZoneSidKey = 'Asia/Shanghai',
- UserName = 'testUser@testorg.com',
- UserPro_Type__c = 'ENG',
- Work_Location__c = '鍖椾含'
- );
+ myUser_test = New User(ContactId = core.id, Alias = 'newUser', Email='newuser@testorg.com', EmailEncodingKey='UTF-8', LastName='TestUser', LanguageLocaleKey='zh_CN', LocaleSidKey='zh_CN', ProfileId = prof.Id, TimeZoneSidKey='Asia/Shanghai', UserName='testUser@testorg.com', UserPro_Type__c='ENG', Work_Location__c='鍖椾含');
insert myUser_test;
- System.debug('MyUser_Test' + MyUser_Test);
+ System.debug('MyUser_Test'+MyUser_Test);
}
- System.runAs(MyUser_Test) {
+ System.runAs(MyUser_Test){
//浜у搧淇℃伅
- Product2 prod01 = new Product2(
- Name = 'Test01',
- ProductCode = 'Test01',
- Asset_Model_No__c = 'Test01',
- SFDA_Status__c = '鏈夊姽',
- Dealer_special_Object__c = true,
- Packing_list_manual__c = 1,
- SFDA_Expiration_Date__c = Date.today(),
- Category5__c = 'test01',
- Manual_Entry__c = false
- );
- Product2 prod02 = new Product2(
- Name = 'Test02',
- ProductCode = 'Test02',
- Asset_Model_No__c = 'Test02',
- SFDA_Status__c = '鏈夊姽',
- Dealer_special_Object__c = true,
- Packing_list_manual__c = 1,
- SFDA_Expiration_Date__c = Date.today(),
- Category5__c = 'test02',
- Manual_Entry__c = false
- );
- Product2 prod03 = new Product2(
- Name = 'Test03',
- ProductCode = 'Test03',
- Asset_Model_No__c = 'Test03',
- SFDA_Status__c = '鏈夊姽',
- Dealer_special_Object__c = true,
- Packing_list_manual__c = 1,
- SFDA_Expiration_Date__c = Date.today(),
- Category5__c = 'test03',
- Manual_Entry__c = false
- );
- Product2 prod04 = new Product2(
- Name = 'Test04',
- ProductCode = 'Test04',
- Asset_Model_No__c = 'Test04',
- SFDA_Status__c = '鏈夊姽',
- Dealer_special_Object__c = true,
- Packing_list_manual__c = 2,
- SFDA_Expiration_Date__c = Date.today(),
- Category5__c = 'test04',
- Manual_Entry__c = false
- );
- Product2 prod05 = new Product2(
- Name = 'Test05',
- ProductCode = 'Test05',
- Asset_Model_No__c = 'Test05',
- SFDA_Status__c = '鏈夊姽',
- Dealer_special_Object__c = true,
- Packing_list_manual__c = 1,
- SFDA_Expiration_Date__c = Date.today(),
- Category5__c = 'test05',
- Manual_Entry__c = false
- );
- Product2 prod06 = new Product2(
- Name = 'Test06',
- ProductCode = 'Test06',
- Asset_Model_No__c = 'Test06',
- SFDA_Status__c = '鏈夊姽',
- Dealer_special_Object__c = true,
- Packing_list_manual__c = 1,
- SFDA_Expiration_Date__c = Date.today(),
- Category5__c = 'test06',
- Manual_Entry__c = false
- );
- insert new List<Product2>{ prod01, prod02, prod03, prod04, prod05, prod06 };
- Product2__c pro1 = new Product2__c(Name = 'Pro001', OT_CODE_Text__c = 'Test001', Product2__c = prod01.Id);
- Product2__c pro2 = new Product2__c(Name = 'Pro002', OT_CODE_Text__c = 'Test002', Product2__c = prod02.Id);
- Product2__c pro3 = new Product2__c(Name = 'Pro004', OT_CODE_Text__c = 'Test004', Product2__c = prod03.Id);
- Product2__c pro4 = new Product2__c(Name = 'Pro005', OT_CODE_Text__c = 'Test005', Product2__c = prod04.Id);
- Product2__c pro5 = new Product2__c(Name = 'Pro003', OT_CODE_Text__c = 'Test003', Product2__c = prod05.Id);
- Product2__c pro6 = new Product2__c(Name = 'Pro006', OT_CODE_Text__c = 'Test006', Product2__c = prod06.Id);
- insert new List<Product2__c>{ pro4, pro5, pro6, pro1, pro2, pro3 };
+ Product2 prod01 = new Product2(Name='Test01',ProductCode='Test01',Asset_Model_No__c = 'Test01',SFDA_Status__c = '鏈夊姽',Dealer_special_Object__c = true,Packing_list_manual__c=1,SFDA_Expiration_Date__c= Date.today(),Category5__c = 'test01',Manual_Entry__c = false);
+ Product2 prod02 = new Product2(Name='Test02',ProductCode='Test02',Asset_Model_No__c = 'Test02',SFDA_Status__c = '鏈夊姽',Dealer_special_Object__c = true,Packing_list_manual__c=1,SFDA_Expiration_Date__c= Date.today(),Category5__c = 'test02',Manual_Entry__c = false);
+ Product2 prod03 = new Product2(Name='Test03',ProductCode='Test03',Asset_Model_No__c = 'Test03',SFDA_Status__c = '鏈夊姽',Dealer_special_Object__c = true,Packing_list_manual__c=1,SFDA_Expiration_Date__c= Date.today(),Category5__c = 'test03',Manual_Entry__c = false);
+ Product2 prod04 = new Product2(Name='Test04',ProductCode='Test04',Asset_Model_No__c = 'Test04',SFDA_Status__c = '鏈夊姽',Dealer_special_Object__c = true,Packing_list_manual__c=2,SFDA_Expiration_Date__c= Date.today(),Category5__c = 'test04',Manual_Entry__c = false);
+ Product2 prod05 = new Product2(Name='Test05',ProductCode='Test05',Asset_Model_No__c = 'Test05',SFDA_Status__c = '鏈夊姽',Dealer_special_Object__c = true,Packing_list_manual__c=1,SFDA_Expiration_Date__c= Date.today(),Category5__c = 'test05',Manual_Entry__c = false);
+ Product2 prod06 = new Product2(Name='Test06',ProductCode='Test06',Asset_Model_No__c = 'Test06',SFDA_Status__c = '鏈夊姽',Dealer_special_Object__c = true,Packing_list_manual__c=1,SFDA_Expiration_Date__c= Date.today(),Category5__c = 'test06',Manual_Entry__c = false);
+ insert new Product2[] {prod01, prod02,prod03,prod04, prod05, prod06};
+ Product2__c pro1 = new Product2__c(Name='Pro001',OT_CODE_Text__c='Test001',Product2__c = prod01.Id);
+ Product2__c pro2 = new Product2__c(Name='Pro002',OT_CODE_Text__c='Test002',Product2__c = prod02.Id);
+ Product2__c pro3 = new Product2__c(Name='Pro004',OT_CODE_Text__c='Test004',Product2__c = prod03.Id);
+ Product2__c pro4 = new Product2__c(Name='Pro005',OT_CODE_Text__c='Test005',Product2__c = prod04.Id);
+ Product2__c pro5 = new Product2__c(Name='Pro003',OT_CODE_Text__c='Test003',Product2__c = prod05.Id);
+ Product2__c pro6 = new Product2__c(Name='Pro006',OT_CODE_Text__c='Test006',Product2__c = prod06.Id);
+ insert new Product2__c[] {pro4, pro5,pro6,pro1, pro2, pro3};
//璁㈠崟
Consumable_order__c Order1 = new Consumable_order__c();
Order1.Name = 'OCM_01';
@@ -430,7 +269,7 @@
Order1.Dealer_Info__c = myAccount2.Id;
Order1.RecordTypeid = System.Label.RT_ConOrder_Delivery;
Order1.Order_ProType__c = 'ENG';
- insert Order1;
+ insert Order1;
//鍑鸿揣
Consumable_order__c Order2 = new Consumable_order__c();
Order2.Name = 'OCM_01';
@@ -439,11 +278,11 @@
Order2.Dealer_Info__c = myAccount2.Id;
Order2.RecordTypeid = '012100000006Jx9AAE';
Order2.Order_ProType__c = 'ENG';
- insert Order2;
+ insert Order2;
- List<Consumable_order_details2__c> conList = new List<Consumable_order_details2__c>();
- List<Consumable_order_details2__c> conList1 = new List<Consumable_order_details2__c>();
- List<Consumable_order_details2__c> conList2 = new List<Consumable_order_details2__c>();
+ List<Consumable_order_details2__c> conList = new List<Consumable_order_details2__c> ();
+ List<Consumable_order_details2__c> conList1 = new List<Consumable_order_details2__c> ();
+ List<Consumable_order_details2__c> conList2 = new List<Consumable_order_details2__c> ();
//浜у搧绫诲瀷涓嶅悓
Consumable_order_details2__c con = new Consumable_order_details2__c();
con.Name = 'OCM_01_001001';
@@ -454,8 +293,8 @@
con.Bar_Code__c = '10061';
con.Used_date__c = null;
con.Lose_Flag__c = false;
- con.Return_date__c = null;
- con.Send_Date__c = null;
+ con.Return_date__c= null;
+ con.Send_Date__c= null;
con.Box_Piece__c = '鐩�';
conList.add(con);
insert conList;
@@ -469,7 +308,7 @@
conList1.add(con1);
//娌℃湁鎷嗙洅
Consumable_order_details2__c con2 = new Consumable_order_details2__c();
- con2.Send_Date__c = null;
+ con2.Send_Date__c =null;
con2.Used_date__c = null;
con2.Lose_Flag__c = false;
con2.Box_Piece__c = '鐩�';
@@ -484,7 +323,7 @@
//宸插嚭璐� 鏈埌璐�
Consumable_order_details2__c con3 = new Consumable_order_details2__c();
con3.Arrive_date__c = null;
- con3.Send_Date__c = null;
+ con3.Send_Date__c =null;
con3.Used_date__c = null;
con3.Return_date__c = null;
con3.Lose_Flag__c = false;
@@ -510,22 +349,14 @@
System.Test.startTest();
LexCancelRemoveBoxController.barcode = '1004\n1003\n1002\n1001';
- LexCancelRemoveBoxController.searchConsumableorderdetails(
- '10061\n10051\n10041\n10031\n10021\n10011',
- 'Testaccount003',
- '閲嶅簡',
- 'ET'
- );
+ LexCancelRemoveBoxController.searchConsumableorderdetails('10061\n10051\n10041\n10031\n10021\n10011','Testaccount003','閲嶅簡','ET');
String str = '璇ュ晢鍝佸瓨鍦ㄧ洏鐐瑰饱鍘�';
String errorReason = '';
- LexCancelRemoveBoxController.ConsumableorderdetailsInfo c2 = new LexCancelRemoveBoxController.ConsumableorderdetailsInfo(
- con,
- str
- );
+ LexCancelRemoveBoxController.ConsumableorderdetailsInfo c2 = new LexCancelRemoveBoxController.ConsumableorderdetailsInfo(con,str);
c2.esd = con;
c2.Prod = con.Consumable_product__r;
c2.oldConsumableCount = con.name;
- c2.ErrorReason = str;
+ c2.ErrorReason = str;
LexCancelRemoveBoxController.ConsumableorderdetailsInfo c1 = new LexCancelRemoveBoxController.ConsumableorderdetailsInfo(con2);
c1.esd = con;
c1.Prod = con.Consumable_product__r;
@@ -534,123 +365,43 @@
System.Test.stopTest();
}
}
- static testMethod void testMethod4() {
+ static testMethod void testMethod4(){
Oly_TriggerHandler.bypass('ConsumableAssetHander');
Oly_TriggerHandler.bypass('Oly_TriggerHandler');
User myUser_test;
Account myAccount2;
- User thisUser = [SELECT Id FROM User WHERE Id = :UserInfo.getUserId()];
- System.runAs(thisUser) {
- List<RecordType> rectCo = [
- SELECT Id
- FROM RecordType
- WHERE IsActive = TRUE AND SobjectType = 'Account' AND Name = '璨╁2搴�'
- ];
+ User thisUser = [ select Id from User where Id = :UserInfo.getUserId()];
+ System.runAs(thisUser){
+ List<RecordType> rectCo = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '璨╁2搴�'];
if (rectCo.size() == 0) {
return;
}
- Profile prof = [
- SELECT Id
- FROM Profile
- WHERE Name = '901_缁忛攢鍟嗙ぞ鍖烘櫘閫氭潈闄恄2閲嶉獙璇�(ET Email)'
- ];
- myAccount2 = new Account(name = 'Testaccount003', Dealer_discount__c = 20, RecordTypeId = rectCo[0].Id, AgentCode_Ext__c = '2');
+ Profile prof = [select Id from Profile where Name ='901_缁忛攢鍟嗙ぞ鍖烘櫘閫氭潈闄恄2閲嶉獙璇�(ET Email)'];
+ myAccount2 = new Account(name='Testaccount003',Dealer_discount__c =20,RecordTypeId = rectCo[0].Id,AgentCode_Ext__c = '2');
insert myAccount2;
- Contact core = new Contact(email = 'wan@salesforce.com', firstname = 'wan', lastname = 'Plumbers', accountid = myAccount2.id);
+ Contact core = new Contact(email='wan@salesforce.com', firstname='wan',lastname='Plumbers',accountid=myAccount2.id);
insert core;
- MyUser_Test = new User(
- ContactId = core.id,
- Alias = 'newWang',
- Email = 'newWang@testorg.com',
- EmailEncodingKey = 'UTF-8',
- LastName = 'TestUserWang',
- LanguageLocaleKey = 'zh_CN',
- LocaleSidKey = 'zh_CN',
- ProfileId = prof.Id,
- TimeZoneSidKey = 'Asia/Shanghai',
- UserName = 'testUserWang@testorg.com',
- Work_Location__c = '閲嶅簡'
- );
+ MyUser_Test = New User(ContactId = core.id,Alias = 'newWang',Email='newWang@testorg.com',EmailEncodingKey='UTF-8', LastName='TestUserWang', LanguageLocaleKey='zh_CN',LocaleSidKey='zh_CN', ProfileId = prof.Id,TimeZoneSidKey='Asia/Shanghai', UserName='testUserWang@testorg.com',Work_Location__c ='閲嶅簡');
insert MyUser_Test;
- System.debug('MyUser_Test' + MyUser_Test);
+ System.debug('MyUser_Test'+MyUser_Test);
}
- System.runAs(MyUser_Test) {
+ System.runAs(MyUser_Test){
//浜у搧淇℃伅
- Product2 prod01 = new Product2(
- Name = 'Test01',
- ProductCode = 'Test01',
- Asset_Model_No__c = 'Test01',
- SFDA_Status__c = '鏈夊姽',
- Dealer_special_Object__c = true,
- Packing_list_manual__c = 1,
- SFDA_Expiration_Date__c = Date.today(),
- Category5__c = 'test01',
- Manual_Entry__c = false
- );
- Product2 prod02 = new Product2(
- Name = 'Test02',
- ProductCode = 'Test02',
- Asset_Model_No__c = 'Test02',
- SFDA_Status__c = '鏈夊姽',
- Dealer_special_Object__c = true,
- Packing_list_manual__c = 1,
- SFDA_Expiration_Date__c = Date.today(),
- Category5__c = 'test02',
- Manual_Entry__c = false
- );
- Product2 prod03 = new Product2(
- Name = 'Test03',
- ProductCode = 'Test03',
- Asset_Model_No__c = 'Test03',
- SFDA_Status__c = '鏈夊姽',
- Dealer_special_Object__c = true,
- Packing_list_manual__c = 1,
- SFDA_Expiration_Date__c = Date.today(),
- Category5__c = 'test03',
- Manual_Entry__c = false
- );
- Product2 prod04 = new Product2(
- Name = 'Test04',
- ProductCode = 'Test04',
- Asset_Model_No__c = 'Test04',
- SFDA_Status__c = '鏈夊姽',
- Dealer_special_Object__c = true,
- Packing_list_manual__c = 2,
- SFDA_Expiration_Date__c = Date.today(),
- Category5__c = 'test04',
- Manual_Entry__c = false
- );
- Product2 prod05 = new Product2(
- Name = 'Test05',
- ProductCode = 'Test05',
- Asset_Model_No__c = 'Test05',
- SFDA_Status__c = '鏈夊姽',
- Dealer_special_Object__c = true,
- Packing_list_manual__c = 1,
- SFDA_Expiration_Date__c = Date.today(),
- Category5__c = 'test05',
- Manual_Entry__c = false
- );
- Product2 prod06 = new Product2(
- Name = 'Test06',
- ProductCode = 'Test06',
- Asset_Model_No__c = 'Test06',
- SFDA_Status__c = '鏈夊姽',
- Dealer_special_Object__c = true,
- Packing_list_manual__c = 1,
- SFDA_Expiration_Date__c = Date.today(),
- Category5__c = 'test06',
- Manual_Entry__c = false
- );
- insert new List<Product2>{ prod01, prod02, prod03, prod04, prod05, prod06 };
- Product2__c pro1 = new Product2__c(Name = 'Pro001', OT_CODE_Text__c = 'Test001', Product2__c = prod01.Id);
- Product2__c pro2 = new Product2__c(Name = 'Pro002', OT_CODE_Text__c = 'Test002', Product2__c = prod02.Id);
- Product2__c pro3 = new Product2__c(Name = 'Pro004', OT_CODE_Text__c = 'Test004', Product2__c = prod03.Id);
- Product2__c pro4 = new Product2__c(Name = 'Pro005', OT_CODE_Text__c = 'Test005', Product2__c = prod04.Id);
- Product2__c pro5 = new Product2__c(Name = 'Pro003', OT_CODE_Text__c = 'Test003', Product2__c = prod05.Id);
- Product2__c pro6 = new Product2__c(Name = 'Pro006', OT_CODE_Text__c = 'Test006', Product2__c = prod06.Id);
- insert new List<Product2__c>{ pro4, pro5, pro6, pro1, pro2, pro3 };
- List<Consumable_order__c> orderList = new List<Consumable_order__c>();
+ Product2 prod01 = new Product2(Name='Test01',ProductCode='Test01',Asset_Model_No__c = 'Test01',SFDA_Status__c = '鏈夊姽',Dealer_special_Object__c = true,Packing_list_manual__c=1,SFDA_Expiration_Date__c= Date.today(),Category5__c = 'test01',Manual_Entry__c = false);
+ Product2 prod02 = new Product2(Name='Test02',ProductCode='Test02',Asset_Model_No__c = 'Test02',SFDA_Status__c = '鏈夊姽',Dealer_special_Object__c = true,Packing_list_manual__c=1,SFDA_Expiration_Date__c= Date.today(),Category5__c = 'test02',Manual_Entry__c = false);
+ Product2 prod03 = new Product2(Name='Test03',ProductCode='Test03',Asset_Model_No__c = 'Test03',SFDA_Status__c = '鏈夊姽',Dealer_special_Object__c = true,Packing_list_manual__c=1,SFDA_Expiration_Date__c= Date.today(),Category5__c = 'test03',Manual_Entry__c = false);
+ Product2 prod04 = new Product2(Name='Test04',ProductCode='Test04',Asset_Model_No__c = 'Test04',SFDA_Status__c = '鏈夊姽',Dealer_special_Object__c = true,Packing_list_manual__c=2,SFDA_Expiration_Date__c= Date.today(),Category5__c = 'test04',Manual_Entry__c = false);
+ Product2 prod05 = new Product2(Name='Test05',ProductCode='Test05',Asset_Model_No__c = 'Test05',SFDA_Status__c = '鏈夊姽',Dealer_special_Object__c = true,Packing_list_manual__c=1,SFDA_Expiration_Date__c= Date.today(),Category5__c = 'test05',Manual_Entry__c = false);
+ Product2 prod06 = new Product2(Name='Test06',ProductCode='Test06',Asset_Model_No__c = 'Test06',SFDA_Status__c = '鏈夊姽',Dealer_special_Object__c = true,Packing_list_manual__c=1,SFDA_Expiration_Date__c= Date.today(),Category5__c = 'test06',Manual_Entry__c = false);
+ insert new Product2[] {prod01, prod02,prod03,prod04, prod05, prod06};
+ Product2__c pro1 = new Product2__c(Name='Pro001',OT_CODE_Text__c='Test001',Product2__c = prod01.Id);
+ Product2__c pro2 = new Product2__c(Name='Pro002',OT_CODE_Text__c='Test002',Product2__c = prod02.Id);
+ Product2__c pro3 = new Product2__c(Name='Pro004',OT_CODE_Text__c='Test004',Product2__c = prod03.Id);
+ Product2__c pro4 = new Product2__c(Name='Pro005',OT_CODE_Text__c='Test005',Product2__c = prod04.Id);
+ Product2__c pro5 = new Product2__c(Name='Pro003',OT_CODE_Text__c='Test003',Product2__c = prod05.Id);
+ Product2__c pro6 = new Product2__c(Name='Pro006',OT_CODE_Text__c='Test006',Product2__c = prod06.Id);
+ insert new Product2__c[] {pro4, pro5,pro6,pro1, pro2, pro3};
+ List<Consumable_order__c> orderList = new List<Consumable_order__c>();
//閿�鍞�
Consumable_order__c Order1 = new Consumable_order__c();
Order1.Name = 'OCM_01';
@@ -660,7 +411,7 @@
Order1.RecordTypeid = '01210000000c9duAAA';
Order1.Order_ProType__c = 'ENG';
orderList.add(Order1);
- //杩斿搧
+ //杩斿搧
Consumable_order__c Order2 = new Consumable_order__c();
Order2.Name = 'OCM_01';
Order2.Order_status__c = '鎵瑰噯';
@@ -690,9 +441,9 @@
orderList.add(Order4);
insert orderList;
- List<Consumable_order_details2__c> conList = new List<Consumable_order_details2__c>();
- List<Consumable_order_details2__c> conList1 = new List<Consumable_order_details2__c>();
- List<Consumable_order_details2__c> conList2 = new List<Consumable_order_details2__c>();
+ List<Consumable_order_details2__c> conList = new List<Consumable_order_details2__c> ();
+ List<Consumable_order_details2__c> conList1 = new List<Consumable_order_details2__c> ();
+ List<Consumable_order_details2__c> conList2 = new List<Consumable_order_details2__c> ();
//鎷嗙洅宸查攢鍞�
Consumable_order_details2__c con4 = new Consumable_order_details2__c();
con4.Arrive_date__c = Date.today();
@@ -703,7 +454,7 @@
con4.Used_date__c = Date.today();
con4.Lose_Flag__c = false;
con4.Box_Piece__c = '涓�';
- con4.RemoveBox_date__c = Date.today();
+ con4.RemoveBox_date__c = Date.today();
con4.RecordTypeId = '01210000000kUDKAA2';
con4.Consumable_Product__c = pro2.Id;
con4.Bar_Code__c = '100611';
@@ -719,7 +470,7 @@
con5.Sterilization_limit__c = Date.today();
con5.Used_date__c = Date.today();
con5.Box_Piece__c = '涓�';
- con5.RemoveBox_date__c = Date.today();
+ con5.RemoveBox_date__c = Date.today();
con5.RecordTypeId = '01210000000kUDPAA2';
con5.Consumable_Product__c = pro2.Id;
con5.Consumable_order_minor__c = Order4.Id;
@@ -742,7 +493,7 @@
conList2.add(con6);
insert conList2;
- List<Consumable_order_details2__c> conList3 = new List<Consumable_order_details2__c>();
+ List<Consumable_order_details2__c> conList3 = new List<Consumable_order_details2__c> ();
//鎷嗙洅宸插嚭璐�
Consumable_order_details2__c con3 = new Consumable_order_details2__c();
con3.Arrive_date__c = Date.today();
@@ -751,7 +502,7 @@
con3.Used_date__c = null;
con3.Lose_Flag__c = false;
con3.Box_Piece__c = '涓�';
- con3.Deliver_date__c = Date.today();
+ con3.Deliver_date__c = Date.today();
con3.RemoveBox_date__c = Date.today();
con3.RecordTypeId = '01210000000kUDKAA2';
con3.Consumable_Product__c = pro2.Id;
@@ -760,6 +511,7 @@
con3.Sterilization_limit__c = Date.today();
conList3.add(con3);
insert conList3;
+
//reset
// Consumable_order_details2__c con1 = new Consumable_order_details2__c();
@@ -795,6 +547,8 @@
// conList3.add(con9);
// LexCancelRemoveBoxController.searchConsumableorderdetails('100112','Testaccount003','閲嶅簡','ET');
+
+
//orderDetails2
// Consumable_order_details2__c con00 = new Consumable_order_details2__c();
// con00.Box_Piece__c = '涓�';
@@ -808,25 +562,12 @@
// insert conList3;
System.Test.startTest();
LexCancelRemoveBoxController CancelRemoveBoxController = new LexCancelRemoveBoxController();
- LexCancelRemoveBoxController.searchConsumableorderdetails(
- '100611\n10078\n10099\n1009999\n100999',
- 'Testaccount003',
- '閲嶅簡',
- 'ET'
- );
- LexCancelRemoveBoxController.searchConsumableorderdetails(
- '100611\n10078\n10061\n10051\n10041\n10031\n10021\n10011',
- 'Testaccount003',
- '鍖椾含',
- 'ET'
- );
- LexCancelRemoveBoxController.searchConsumableorderdetails(
- '100611\n10078\n10061\n10051\n10041\n10031\n10021\n10011',
- 'Testaccount003',
- '閲嶅簡',
- 'ET'
- );
+ LexCancelRemoveBoxController.searchConsumableorderdetails('100611\n10078\n10099\n1009999\n100999','Testaccount003','閲嶅簡','ET');
+ LexCancelRemoveBoxController.searchConsumableorderdetails('100611\n10078\n10061\n10051\n10041\n10031\n10021\n10011','Testaccount003','鍖椾含','ET');
+ LexCancelRemoveBoxController.searchConsumableorderdetails('100611\n10078\n10061\n10051\n10041\n10031\n10021\n10011','Testaccount003','閲嶅簡','ET');
System.Test.stopTest();
+
+
}
}
-}
+}
\ No newline at end of file
diff --git a/force-app/main/default/classes/LexCancelRemoveBoxControllerTest.cls-meta.xml b/force-app/main/default/classes/LexCancelRemoveBoxControllerTest.cls-meta.xml
index a9fd6e9..754ecb1 100644
--- a/force-app/main/default/classes/LexCancelRemoveBoxControllerTest.cls-meta.xml
+++ b/force-app/main/default/classes/LexCancelRemoveBoxControllerTest.cls-meta.xml
@@ -1,4 +1,4 @@
-<?xml version="1.0" encoding="UTF-8" ?>
+<?xml version="1.0" encoding="UTF-8"?>
<ApexClass xmlns="http://soap.sforce.com/2006/04/metadata">
<apiVersion>57.0</apiVersion>
<status>Active</status>
diff --git a/force-app/main/default/classes/LexConInvoiceListTest.cls b/force-app/main/default/classes/LexConInvoiceListTest.cls
index 6e2c1ed..87f57b6 100644
--- a/force-app/main/default/classes/LexConInvoiceListTest.cls
+++ b/force-app/main/default/classes/LexConInvoiceListTest.cls
@@ -1,83 +1,34 @@
@isTest
-private class LexConInvoiceListTest {
- static testMethod void conInvoiceListTestinit() {
+private class LexConInvoiceListTest
+{
+ static testMethod void conInvoiceListTestinit(){
user myUser_test;
Account myAccount2;
Account myAccount1;
- User thisUser = [SELECT Id FROM User WHERE Id = :UserInfo.getUserId()];
- System.runAs(thisUser) {
- Profile prof = [
- SELECT Id
- FROM Profile
- WHERE Name = '901_缁忛攢鍟嗙ぞ鍖烘櫘閫氭潈闄恄2閲嶉獙璇�(ET)'
- ];
- List<RecordType> rectCo = [
- SELECT Id
- FROM RecordType
- WHERE IsActive = TRUE AND SobjectType = 'Account' AND Name = '璨╁2搴�'
- ];
+ User thisUser = [ select Id from User where Id = :UserInfo.getUserId()];
+ system.runAs(thisUser){
+ Profile prof = [select Id from Profile where Name ='901_缁忛攢鍟嗙ぞ鍖烘櫘閫氭潈闄恄2閲嶉獙璇�(ET)'];
+ List<RecordType> rectCo = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '璨╁2搴�'];
if (rectCo.size() == 0) {
return;
}
- List<RecordType> rectHos = [
- SELECT Id
- FROM RecordType
- WHERE IsActive = TRUE AND SobjectType = 'Account' AND Name = '鐥呴櫌'
- ];
+ List<RecordType> rectHos = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '鐥呴櫌'];
if (rectHos.size() == 0) {
return;
}
- myAccount1 = new Account(name = 'testaccount001', RecordTypeId = rectCo[0].Id);
- myAccount2 = new Account(name = 'testaccount002', RecordTypeId = rectHos[0].Id);
+ myAccount1 = new Account(name='testaccount001',RecordTypeId = rectCo[0].Id );
+ myAccount2 = new Account(name='testaccount002',RecordTypeId = rectHos[0].Id );
insert myAccount1;
- Contact core = new Contact(
- email = 'jplumber@salesforce.com',
- firstname = 'Joe',
- lastname = 'Plumber',
- accountid = myAccount1.id
- );
+ Contact core = new Contact(email='jplumber@salesforce.com', firstname='Joe',lastname='Plumber',accountid=myAccount1.id);
insert core;
- myUser_test = new User(
- ContactId = core.id,
- Alias = 'newUser',
- Email = 'newuser@testorg.com',
- EmailEncodingKey = 'UTF-8',
- LastName = 'testUser',
- LanguageLocaleKey = 'zh_CN',
- LocaleSidKey = 'zh_CN',
- ProfileId = prof.Id,
- TimeZoneSidKey = 'Asia/Shanghai',
- UserName = 'testUser@testorg.com',
- Work_Location__c = '鍖椾含'
- );
+ myUser_test = New User(ContactId = core.id,Alias = 'newUser',Email='newuser@testorg.com',EmailEncodingKey='UTF-8', LastName='testUser', LanguageLocaleKey='zh_CN',LocaleSidKey='zh_CN', ProfileId = prof.Id,TimeZoneSidKey='Asia/Shanghai', UserName='testUser@testorg.com',Work_Location__c = '鍖椾含');
insert myUser_test;
+
}
- System.runAs(myUser_test) {
- Consumable_order__c TestList1 = new Consumable_order__c(
- Name = 'Test1',
- Invoice_Date__c = Date.today(),
- Dealer_info__c = myAccount1.Id,
- Invoice_status__c = '鑽夋涓�',
- Order_ForHospital__c = myAccount2.Id,
- SummonsForDirction__c = '鐩存帴閿�鍞粰鍖婚櫌',
- Order_status__c = '鑽夋涓�',
- Order_type__c = '鍙戠エ',
- recordtypeid = System.Label.RT_ConOrder_Invoice,
- Order_ProType__c = 'ET'
- );
- Consumable_order__c TestList2 = new Consumable_order__c(
- Name = 'Test2',
- Invoice_Date__c = Date.today(),
- Dealer_info__c = myAccount1.Id,
- Invoice_status__c = '鎻愪氦',
- Order_ForHospital__c = myAccount2.Id,
- SummonsForDirction__c = '鐩存帴閿�鍞粰鍖婚櫌',
- Order_status__c = '鑽夋涓�',
- Order_type__c = '鍙戠エ',
- recordtypeid = System.Label.RT_ConOrder_Invoice,
- Order_ProType__c = 'ET'
- );
- insert new List<Consumable_order__c>{ TestList1, TestList2 };
+ system.runAs(myUser_test){
+ Consumable_order__c TestList1 = new Consumable_order__c(Name='Test1',Invoice_Date__c=Date.today(),Dealer_info__c=myAccount1.Id,Invoice_status__c='鑽夋涓�',Order_ForHospital__c =myAccount2.Id,SummonsForDirction__c='鐩存帴閿�鍞粰鍖婚櫌',Order_status__c='鑽夋涓�',Order_type__c='鍙戠エ',recordtypeid = System.Label.RT_ConOrder_Invoice,Order_ProType__c = 'ET');
+ Consumable_order__c TestList2 = new Consumable_order__c(Name='Test2',Invoice_Date__c=Date.today(),Dealer_info__c=myAccount1.Id,Invoice_status__c='鎻愪氦',Order_ForHospital__c =myAccount2.Id,SummonsForDirction__c='鐩存帴閿�鍞粰鍖婚櫌',Order_status__c='鑽夋涓�',Order_type__c='鍙戠エ',recordtypeid = System.Label.RT_ConOrder_Invoice,Order_ProType__c = 'ET');
+ insert new Consumable_order__c[]{TestList1,TestList2};
LexConInvoiceList.init();
// ConInvoiceListController CDC = new ConInvoiceListController();
// CDC.init();
@@ -89,88 +40,38 @@
}
}
//妫�绱�
- static testMethod void invoiceCodeSearchTest() {
+ static testMethod void invoiceCodeSearchTest(){
user myUser_test;
Account myAccount2;
Account myAccount1;
- User thisUser = [SELECT Id FROM User WHERE Id = :UserInfo.getUserId()];
- System.runAs(thisUser) {
- Profile prof = [
- SELECT Id
- FROM Profile
- WHERE Name = '901_缁忛攢鍟嗙ぞ鍖烘櫘閫氭潈闄恄2閲嶉獙璇�(ET)'
- ];
- List<RecordType> rectCo = [
- SELECT Id
- FROM RecordType
- WHERE IsActive = TRUE AND SobjectType = 'Account' AND Name = '璨╁2搴�'
- ];
+ User thisUser = [ select Id from User where Id = :UserInfo.getUserId()];
+ system.runAs(thisUser){
+ Profile prof = [select Id from Profile where Name ='901_缁忛攢鍟嗙ぞ鍖烘櫘閫氭潈闄恄2閲嶉獙璇�(ET)'];
+ List<RecordType> rectCo = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '璨╁2搴�'];
if (rectCo.size() == 0) {
return;
}
- List<RecordType> rectHos = [
- SELECT Id
- FROM RecordType
- WHERE IsActive = TRUE AND SobjectType = 'Account' AND Name = '鐥呴櫌'
- ];
+ List<RecordType> rectHos = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '鐥呴櫌'];
if (rectHos.size() == 0) {
return;
}
- myAccount1 = new Account(name = 'testaccount001', RecordTypeId = rectCo[0].Id);
- myAccount2 = new Account(name = 'testaccount002', RecordTypeId = rectHos[0].Id);
+ myAccount1 = new Account(name='testaccount001',RecordTypeId = rectCo[0].Id );
+ myAccount2 = new Account(name='testaccount002',RecordTypeId = rectHos[0].Id );
insert myAccount1;
- Contact core = new Contact(
- email = 'jplumber@salesforce.com',
- firstname = 'Joe',
- lastname = 'Plumber',
- accountid = myAccount1.id
- );
+ Contact core = new Contact(email='jplumber@salesforce.com', firstname='Joe',lastname='Plumber',accountid=myAccount1.id);
insert core;
- myUser_test = new User(
- ContactId = core.id,
- Alias = 'newUser',
- Email = 'newuser@testorg.com',
- EmailEncodingKey = 'UTF-8',
- LastName = 'testUser',
- LanguageLocaleKey = 'zh_CN',
- LocaleSidKey = 'zh_CN',
- ProfileId = prof.Id,
- TimeZoneSidKey = 'Asia/Shanghai',
- UserName = 'testUser@testorg.com',
- Work_Location__c = '鍖椾含'
- );
+ myUser_test = New User(ContactId = core.id,Alias = 'newUser',Email='newuser@testorg.com',EmailEncodingKey='UTF-8', LastName='testUser', LanguageLocaleKey='zh_CN',LocaleSidKey='zh_CN', ProfileId = prof.Id,TimeZoneSidKey='Asia/Shanghai', UserName='testUser@testorg.com',Work_Location__c = '鍖椾含');
insert myUser_test;
- }
- System.runAs(myUser_test) {
- Consumable_order__c TestList1 = new Consumable_order__c(
- Name = 'Test1',
- Invoice_Date__c = Date.today(),
- Dealer_info__c = myAccount1.Id,
- Invoice_status__c = '鑽夋涓�',
- Order_ForHospital__c = myAccount2.Id,
- SummonsForDirction__c = '鐩存帴閿�鍞粰鍖婚櫌',
- Order_status__c = '鑽夋涓�',
- Order_type__c = '鍙戠エ',
- recordtypeid = System.Label.RT_ConOrder_Invoice,
- Order_ProType__c = 'ET'
- );
- Consumable_order__c TestList2 = new Consumable_order__c(
- Name = 'Test2',
- Invoice_Date__c = Date.today(),
- Dealer_info__c = myAccount1.Id,
- Invoice_status__c = '鎻愪氦',
- Order_ForHospital__c = myAccount2.Id,
- SummonsForDirction__c = '鐩存帴閿�鍞粰鍖婚櫌',
- Order_status__c = '鑽夋涓�',
- Order_type__c = '鍙戠エ',
- recordtypeid = System.Label.RT_ConOrder_Invoice,
- Order_ProType__c = 'ET'
- );
- insert new List<Consumable_order__c>{ TestList1, TestList2 };
+ }
+
+ system.runAs(myUser_test){
+ Consumable_order__c TestList1 = new Consumable_order__c(Name='Test1',Invoice_Date__c=Date.today(),Dealer_info__c=myAccount1.Id,Invoice_status__c='鑽夋涓�',Order_ForHospital__c =myAccount2.Id,SummonsForDirction__c='鐩存帴閿�鍞粰鍖婚櫌',Order_status__c='鑽夋涓�',Order_type__c='鍙戠エ',recordtypeid = System.Label.RT_ConOrder_Invoice,Order_ProType__c = 'ET');
+ Consumable_order__c TestList2 = new Consumable_order__c(Name='Test2',Invoice_Date__c=Date.today(),Dealer_info__c=myAccount1.Id,Invoice_status__c='鎻愪氦',Order_ForHospital__c =myAccount2.Id,SummonsForDirction__c='鐩存帴閿�鍞粰鍖婚櫌',Order_status__c='鑽夋涓�',Order_type__c='鍙戠エ',recordtypeid = System.Label.RT_ConOrder_Invoice,Order_ProType__c = 'ET');
+ insert new Consumable_order__c[]{TestList1,TestList2};
LexConInvoiceList CDC = new LexConInvoiceList();
LexConInvoiceList.init();
- LexConInvoiceList.invoiceCodeSearch(Date.today(), Date.today(), '鎻愪氦', 'test', 'test1', '0010l00001ajxZ2AAI', '鍖椾含', 'ET');
+ LexConInvoiceList.invoiceCodeSearch(Date.today(),Date.today(),'鎻愪氦','test','test1','0010l00001ajxZ2AAI','鍖椾含','ET');
// CDC.init();
// System.assertEquals('Test1', CDC.raesList[0].name);
// System.assertEquals('Test2', CDC.raesList[1].name);
@@ -181,4 +82,4 @@
// System.assertEquals(2, CDC.raesList.size());
}
}
-}
+}
\ No newline at end of file
diff --git a/force-app/main/default/classes/LexConInvoiceListTest.cls-meta.xml b/force-app/main/default/classes/LexConInvoiceListTest.cls-meta.xml
index a9fd6e9..754ecb1 100644
--- a/force-app/main/default/classes/LexConInvoiceListTest.cls-meta.xml
+++ b/force-app/main/default/classes/LexConInvoiceListTest.cls-meta.xml
@@ -1,4 +1,4 @@
-<?xml version="1.0" encoding="UTF-8" ?>
+<?xml version="1.0" encoding="UTF-8"?>
<ApexClass xmlns="http://soap.sforce.com/2006/04/metadata">
<apiVersion>57.0</apiVersion>
<status>Active</status>
diff --git a/force-app/main/default/classes/LexConInvoiceViewController.cls b/force-app/main/default/classes/LexConInvoiceViewController.cls
index f36b7a4..5a2f230 100644
--- a/force-app/main/default/classes/LexConInvoiceViewController.cls
+++ b/force-app/main/default/classes/LexConInvoiceViewController.cls
@@ -102,11 +102,7 @@
}
userId = UserInfo.getUserId();
List<user> Useracc = new List<user>();
- Useracc = [
- SELECT accountid, Work_Location__c, UserPro_Type__c
- FROM user
- WHERE id = :userId
- ];
+ Useracc = [SELECT accountid, Work_Location__c, UserPro_Type__c FROM user WHERE id = :userId];
accountid = Useracc[0].accountid;
userWorkLocation = Useracc[0].Work_Location__c;
agencyProType = Useracc[0].UserPro_Type__c;
@@ -392,11 +388,7 @@
// attachmentRecoeds.add(new InvoiceOrderInfo(attachmentinfo[i]));
// }
// }
- List<ContentDocumentLink> links = [
- SELECT Id, ContentDocumentId
- FROM ContentDocumentLink
- WHERE LinkedEntityId = :invoiceId
- ];
+ List<ContentDocumentLink> links = [SELECT Id, ContentDocumentId FROM ContentDocumentLink WHERE LinkedEntityId = :invoiceId];
if (links != null && links.size() > 0) {
List<String> documentIds = new List<String>();
for (ContentDocumentLink link : links) {
@@ -407,7 +399,7 @@
FROM ContentVersion
WHERE ContentDocumentId IN :documentIds
];
-
+
if (cvInfo.size() > 0) {
for (Integer i = 0; i < cvInfo.size(); i++) {
attachmentRecoeds.add(new InvoiceOrderInfo(cvInfo[i]));
@@ -637,8 +629,8 @@
invoiceHead.Order_ForDealer__c = SecondDealer;
}
invoiceHead.Order_ForDealerText__c = coc.Order_ForDealerText__c;
- if (Test.isRunningTest()) {
- invoiceHead.Order_ForHospital__c = null;
+ if(Test.isRunningTest()){
+ invoiceHead.Order_ForHospital__c = null;
}
insert invoiceHead;
invoiceId = invoiceHead.Id;
@@ -737,8 +729,8 @@
invoiceHead.Order_ForDealer__c = SecondDealer;
}
invoiceHead.Order_ForDealerText__c = coc.Order_ForDealerText__c;
- if (Test.isRunningTest()) {
- invoiceHead.Order_ForHospital__c = null;
+ if(Test.isRunningTest()){
+ invoiceHead.Order_ForHospital__c = null;
}
insert invoiceHead;
System.debug('invoiceHead = ' + invoiceHead);
@@ -1688,4 +1680,4 @@
return null;
}
}
-}
+}
\ No newline at end of file
diff --git a/force-app/main/default/classes/LexConInvoiceViewControllerTest.cls b/force-app/main/default/classes/LexConInvoiceViewControllerTest.cls
index 82f618f..f6d9e72 100644
--- a/force-app/main/default/classes/LexConInvoiceViewControllerTest.cls
+++ b/force-app/main/default/classes/LexConInvoiceViewControllerTest.cls
@@ -1,5 +1,6 @@
@isTest
-private class LexConInvoiceViewControllerTest { //鏂板缓鍙戠エ 浠ュ強缂栬緫鍙戠エ invoiceId<>null
+private class LexConInvoiceViewControllerTest
+{ //鏂板缓鍙戠エ 浠ュ強缂栬緫鍙戠エ invoiceId<>null
public static user myUser_test;
public static Account myAccount1;
public static Account hosp1;
@@ -8,165 +9,93 @@
public static Account agency2;
@testSetup
static void setupTestData() {
- User thisUser = [SELECT Id FROM User WHERE Id = :UserInfo.getUserId()];
- System.runAs(thisUser) {
- // Profile prof = [select Id from Profile where Name ='901_缁忛攢鍟嗙ぞ鍖烘櫘閫氭潈闄恄2閲嶉獙璇�'];
- Profile prof = [
- SELECT Id
- FROM Profile
- WHERE Name = '901_缁忛攢鍟嗙ぞ鍖烘櫘閫氭潈闄恄2閲嶉獙璇�(ET)'
- ];
- List<RecordType> rectCo = [
- SELECT Id
- FROM RecordType
- WHERE IsActive = TRUE AND SobjectType = 'Account' AND Name = '璨╁2搴�'
- ];
- if (rectCo.size() == 0) {
- return;
- }
- List<RecordType> rectHos = [
- SELECT Id
- FROM RecordType
- WHERE IsActive = TRUE AND SobjectType = 'Account' AND Name = '鐥呴櫌'
- ];
- if (rectHos.size() == 0) {
- return;
- }
- //浜岀骇缁忛攢鍟哠econdDealer
- agency1 = new Account(name = 'Testhosp001', Dealer_discount__c = 10, RecordTypeId = rectCo[0].Id);
- agency2 = new Account(name = 'Testhosp002', Dealer_discount__c = 10, RecordTypeId = rectCo[0].Id);
- //缁忛攢鍟�
- myAccount1 = new Account(name = 'Testaccount002', Dealer_discount__c = 20, RecordTypeId = rectCo[0].Id);
- insert agency1;
- insert agency2;
- insert myAccount1;
- //瀹㈡埛鍚岺ospitalInfo
- hosp1 = new Account(name = 'Testhosp001', Dealer_discount__c = 10, RecordTypeId = rectHos[0].Id);
- Account hosp2 = new Account(name = 'Testhosp002', Dealer_discount__c = 10, RecordTypeId = rectHos[0].Id);
- insert hosp1;
-
- Dealer_elationship__c dealerelationship = new Dealer_elationship__c(
- Dealer_principal__c = myAccount1.id,
- Dealer_subordinate__c = agency1.id
- );
- insert dealerelationship;
- Dealer_elationship__c dealerelationship1 = new Dealer_elationship__c(
- Dealer_principal__c = myAccount1.id,
- Dealer_subordinate__c = agency2.id
- );
- insert dealerelationship1;
-
- Agency_Hospital_Link__c agencyHospitalLink1 = new Agency_Hospital_Link__c(Hospital__c = hosp1.id, Agency__c = myAccount1.id);
- insert agencyHospitalLink1;
-
- Contact core = new Contact(
- email = 'jplumber@salesforce.com',
- firstname = 'Joe',
- lastname = 'Plumber',
- accountid = myAccount1.id
- );
- insert core;
- MyUser_Test = new User(
- ContactId = core.id,
- Alias = 'newUser',
- Email = 'newuser@testorg.com',
- EmailEncodingKey = 'UTF-8',
- LastName = 'TestUser',
- LanguageLocaleKey = 'zh_CN',
- LocaleSidKey = 'zh_CN',
- ProfileId = prof.Id,
- TimeZoneSidKey = 'Asia/Shanghai',
- UserName = 'testUser@testorg.com',
- Work_Location__c = '閲嶅簡'
- );
- insert MyUser_Test;
+ User thisUser = [ select Id from User where Id = :UserInfo.getUserId()];
+ System.runAs(thisUser){
+ // Profile prof = [select Id from Profile where Name ='901_缁忛攢鍟嗙ぞ鍖烘櫘閫氭潈闄恄2閲嶉獙璇�'];
+ Profile prof = [select Id from Profile where Name ='901_缁忛攢鍟嗙ぞ鍖烘櫘閫氭潈闄恄2閲嶉獙璇�(ET)'];
+ List<RecordType> rectCo = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '璨╁2搴�'];
+ if (rectCo.size() == 0) {
+ return;
}
+ List<RecordType> rectHos = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '鐥呴櫌'];
+ if (rectHos.size() == 0) {
+ return;
+ }
+ //浜岀骇缁忛攢鍟哠econdDealer
+ agency1 = new Account(name='Testhosp001',Dealer_discount__c =10,RecordTypeId = rectCo[0].Id);
+ agency2 = new Account(name='Testhosp002',Dealer_discount__c =10,RecordTypeId = rectCo[0].Id);
+ //缁忛攢鍟�
+ myAccount1 = new Account(name='Testaccount002',Dealer_discount__c =20,RecordTypeId = rectCo[0].Id);
+ insert agency1;
+ insert agency2;
+ insert myAccount1;
+ //瀹㈡埛鍚岺ospitalInfo
+ hosp1 = new Account(name='Testhosp001',Dealer_discount__c =10,RecordTypeId = rectHos[0].Id);
+ Account hosp2 = new Account(name='Testhosp002',Dealer_discount__c =10,RecordTypeId = rectHos[0].Id);
+ insert hosp1;
+
+ Dealer_elationship__c dealerelationship = new Dealer_elationship__c(Dealer_principal__c = myAccount1.id,Dealer_subordinate__c = agency1.id);
+ insert dealerelationship;
+ Dealer_elationship__c dealerelationship1 = new Dealer_elationship__c(Dealer_principal__c = myAccount1.id,Dealer_subordinate__c = agency2.id);
+ insert dealerelationship1;
+
+ Agency_Hospital_Link__c agencyHospitalLink1 = new Agency_Hospital_Link__c(Hospital__c = hosp1.id,Agency__c = myAccount1.id);
+ insert agencyHospitalLink1;
+
+ Contact core = new Contact(email='jplumber@salesforce.com', firstname='Joe',lastname='Plumber',accountid=myAccount1.id);
+ insert core;
+ MyUser_Test = New User(ContactId = core.id,Alias = 'newUser',Email='newuser@testorg.com',EmailEncodingKey='UTF-8', LastName='TestUser', LanguageLocaleKey='zh_CN',LocaleSidKey='zh_CN', ProfileId = prof.Id,TimeZoneSidKey='Asia/Shanghai', UserName='testUser@testorg.com',Work_Location__c ='閲嶅簡');
+ insert MyUser_Test;
+ }
+
}
- static testMethod void conInvoiceViewTestedit_1() {
+ static testMethod void conInvoiceViewTestedit_1(){
user curUser = [SELECT Id FROM User WHERE LastName = 'TestUser' LIMIT 1];
- Account acc = [
- SELECT Id
- FROM Account
- WHERE name = 'Testaccount002'
- LIMIT 1
- ];
- Account hosp1 = [SELECT Id FROM Account WHERE name = 'Testhosp001' LIMIT 1];
- Account agency1 = [
- SELECT Id
- FROM Account
- WHERE name = 'Testhosp001'
- LIMIT 1
- ];
- Account agency2 = [
- SELECT Id
- FROM Account
- WHERE name = 'Testhosp002'
- LIMIT 1
- ];
+ Account acc = [SELECT Id FROM Account WHERE name='Testaccount002' LIMIT 1];
+ Account hosp1 = [SELECT Id FROM Account WHERE name='Testhosp001' LIMIT 1];
+ Account agency1 = [SELECT Id FROM Account WHERE name='Testhosp001' LIMIT 1];
+ Account agency2 = [SELECT Id FROM Account WHERE name='Testhosp002' LIMIT 1];
+
- System.runAs(curUser) {
+ system.runAs(curUser){
//浜у搧淇℃伅
- Product2 prod01 = new Product2(
- Name = 'Test01',
- ProductCode = 'Test01',
- Asset_Model_No__c = 'Test01',
- SFDA_Status__c = '鏈夊姽',
- Dealer_special_Object__c = true,
- Manual_Entry__c = false
- );
- Product2 prod02 = new Product2(
- Name = 'Test02',
- ProductCode = 'Test02',
- Asset_Model_No__c = 'Test02',
- SFDA_Status__c = '鏈夊姽',
- Dealer_special_Object__c = true,
- Manual_Entry__c = false
- );
- insert new List<Product2>{ prod01, prod02 };
+ Product2 prod01 = new Product2(Name='Test01',ProductCode='Test01',Asset_Model_No__c = 'Test01',SFDA_Status__c = '鏈夊姽',Dealer_special_Object__c = true,Manual_Entry__c = false);
+ Product2 prod02 = new Product2(Name='Test02',ProductCode='Test02',Asset_Model_No__c = 'Test02',SFDA_Status__c = '鏈夊姽',Dealer_special_Object__c = true,Manual_Entry__c = false);
+ insert new Product2[] {prod01, prod02};
- Product2__c pro1 = new Product2__c(Name = 'Pro001', OT_CODE_Text__c = 'Test001', Product2__c = prod01.Id);
- Product2__c pro2 = new Product2__c(Name = 'Pro002', OT_CODE_Text__c = 'Test002', Product2__c = prod02.Id);
- insert new List<Product2__c>{ pro1, pro2 };
+ Product2__c pro1 = new Product2__c(Name='Pro001',OT_CODE_Text__c='Test001',Product2__c = prod01.Id);
+ Product2__c pro2 = new Product2__c(Name='Pro002',OT_CODE_Text__c='Test002',Product2__c = prod02.Id);
+ insert new Product2__c[] {pro1, pro2};
//鍙戠エ淇℃伅
Consumable_order__c invoiceorder = new Consumable_order__c();
- invoiceorder.Name = 'invoice01';
+ invoiceorder.Name='invoice01';
invoiceorder.Order_type__c = '鍙戠エ';
- invoiceorder.Invoice_status__c = '鑽夋涓�';
+ invoiceorder.Invoice_status__c='鑽夋涓�';
invoiceorder.Invoice_Date__c = Date.today();
invoiceorder.RecordTypeid = System.Label.RT_ConOrder_Invoice;
//invoiceorder.Order_ForHospital__c =hosp1.Id;
// invoiceorder.Order_ForDealer__c = agency1.Id;
- invoiceorder.Dealer_Info__c = acc.Id;
+ invoiceorder.Dealer_Info__c=acc.Id;
//invoiceorder.Order_ProType__c = 'ET';
insert invoiceorder;
- invoiceorder = [
- SELECT id, Name
- FROM Consumable_order__c
- WHERE id = :invoiceorder.id
- ];
+ invoiceorder = [select id,Name from Consumable_order__c where id =:invoiceorder.id];
//鍑哄簱鍗�
-
+
Consumable_order__c testList1 = new Consumable_order__c(
- Name = 'Test1',
- Summons_Sale_Status__c = '鍑鸿揣',
- SummonsStatus_c__c = '宸插畬鎴�',
- SummonsForDirction__c = '鐩存帴閿�鍞粰鍖婚櫌',
- Order_status__c = '鑽夋涓�',
- Order_type__c = '浼犵エ',
- Dealer_info__c = acc.Id
- );
+ Name='Test1',
+ Summons_Sale_Status__c='鍑鸿揣',
+ SummonsStatus_c__c='宸插畬鎴�',
+ SummonsForDirction__c='鐩存帴閿�鍞粰鍖婚櫌',
+ Order_status__c='鑽夋涓�',
+ Order_type__c='浼犵エ',
+ Dealer_info__c=acc.Id);
- Consumable_order__c testList2 = new Consumable_order__c(
- Name = 'Test2',
- Summons_Sale_Status__c = '鍑鸿揣',
- SummonsStatus_c__c = '宸插畬鎴�',
- SummonsForDirction__c = '鐩存帴閿�鍞粰鍖婚櫌',
- Order_status__c = '宸叉彁浜�',
- Order_type__c = '浼犵エ',
- Dealer_info__c = acc.Id
- );
+ Consumable_order__c testList2 = new Consumable_order__c(Name='Test2',Summons_Sale_Status__c='鍑鸿揣',
+ SummonsStatus_c__c='宸插畬鎴�',SummonsForDirction__c='鐩存帴閿�鍞粰鍖婚櫌',
+ Order_status__c='宸叉彁浜�',Order_type__c='浼犵エ',
+ Dealer_info__c=acc.Id);
TestList1.Order_date__c = Date.today().addDays(2);
TestList2.Order_date__c = Date.today().addDays(2);
TestList1.Deliver_date__c = Date.today();
@@ -174,11 +103,7 @@
insert testList1;
insert testList2;
System.Test.startTest();
- Consumable_order_LinkTable__c order_LinkTable1 = new Consumable_order_LinkTable__c(
- Name = 'order_LinkTable1',
- Outboundorder_Code_link__c = testList1.Id,
- Invoice_Code_link__c = invoiceorder.Id
- );
+ Consumable_order_LinkTable__c order_LinkTable1 = new Consumable_order_LinkTable__c(Name='order_LinkTable1',Outboundorder_Code_link__c = testList1.Id,Invoice_Code_link__c =invoiceorder.Id);
insert order_LinkTable1;
//鍑哄簱鍗�1鏄庣粏1
@@ -206,51 +131,32 @@
orderdet3.RecordTypeId = System.Label.RT_ConOrderDetail1_Invoice;
orderdet3.Consumable_count__c = 1;
orderdet3.Consumable_product__c = pro1.Id;
- insert new List<Consumable_orderdetails__c>{ orderdet1, orderdet2, orderdet3 };
+ insert new Consumable_orderdetails__c[]{orderdet1,orderdet2,orderdet3};
+
LexConInvoiceViewController conTest = new LexConInvoiceViewController();
- LexConInvoiceViewController.HospitalInfo = hosp1.id;
- LexConInvoiceViewController.SecondDealer = agency1.id;
- LexConInvoiceViewController.invoiceId = invoiceorder.Id;
- LexConInvoiceViewController.init(invoiceorder.Id, 'Redirect', testList1.Id);
- LexConInvoiceViewController.init(invoiceorder.Id, '', testList1.Id);
- LexConInvoiceViewController.init('', '', '');
- LexConInvoiceViewController.init('', '', testList1.Id);
- LexConInvoiceViewController.init('', 'Redirect', testList1.Id);
+ LexConInvoiceViewController.HospitalInfo = hosp1.id;
+ LexConInvoiceViewController.SecondDealer = agency1.id;
+ LexConInvoiceViewController.invoiceId = invoiceorder.Id;
+ LexConInvoiceViewController.init(invoiceorder.Id,'Redirect',testList1.Id);
+ LexConInvoiceViewController.init(invoiceorder.Id,'',testList1.Id);
+ LexConInvoiceViewController.init('','','');
+ LexConInvoiceViewController.init('','',testList1.Id);
+ LexConInvoiceViewController.init('','Redirect',testList1.Id);
String invoiceOrderRecoedschangeLwc = JSON.serialize(LexConInvoiceViewController.invoiceOrderRecoedschange);
String invoiceOrderRecoeds = JSON.serialize(LexConInvoiceViewController.invoiceOrderRecoeds);
- LexConInvoiceViewController.save(
- testList1,
- '娴庡畞浠诲煄鍎掓祹鍖婚櫌',
- hosp1.id,
- agency1.id,
- invoiceOrderRecoeds,
- testList1.Id,
- invoiceorder.Id,
- acc.Id,
- 'ET',
- '',
- invoiceOrderRecoedschangeLwc
- );
- LexConInvoiceViewController.saveAttachment(JSON.serialize(LexConInvoiceViewController.attachmentRecoeds), invoiceorder.Id);
- LexConInvoiceViewController.InvoiceorderSearch(
- testList1,
- invoiceorder.Id,
- acc.Id,
- '閲嶅簡',
- 'ET',
- hosp1.id,
- agency1.id,
- invoiceOrderRecoeds
- );
- LexConInvoiceViewController.deleteButton(testList1.Id, testList1);
- LexConInvoiceViewController.deleteButton('234567', testList1);
+ LexConInvoiceViewController.save(testList1,'娴庡畞浠诲煄鍎掓祹鍖婚櫌',hosp1.id,agency1.id,invoiceOrderRecoeds,testList1.Id,invoiceorder.Id,acc.Id,'ET','',invoiceOrderRecoedschangeLwc);
+ LexConInvoiceViewController.saveAttachment(JSON.serialize(LexConInvoiceViewController.attachmentRecoeds),invoiceorder.Id);
+ LexConInvoiceViewController.InvoiceorderSearch(testList1,invoiceorder.Id,acc.Id,'閲嶅簡','ET',hosp1.id,agency1.id,invoiceOrderRecoeds);
+ LexConInvoiceViewController.deleteButton(testList1.Id,testList1);
+ LexConInvoiceViewController.deleteButton('234567',testList1);
// LexConInvoiceViewController.saveFile(invoiceorder.Id,'Test','TmFtZSxTdW1tb25zRm9yRGlyY3Rpb25fX2MsSG9zcGl0YWxDb2RlLE9yZGVyX0Zvckhvc3BpdGFsX19jLE9yZGVyX0ZvckN1c3RvbWVyVGV4dF9fYyxPcmRlcl9Gb3JEZWFsZXJfX2MsQmFyX0NvZGVfX2MsU2hpcG1lbnRfQ291bnRfX2MsRGVsaXZlcnlfTGlzdF9STUJfX2MsQm94X1BpZWNlX19jLFVuaXRwcmljZV9Ub19hZ2VuY3lfX2MsT3V0Ym91bmRfRGF0ZV9fYyxMb3NlX3JlYXNvbl9fYw0KREItRlkyMDI0LTA2LVozMTAwMDIs55u05o6l6ZSA5ZSu57uZ5Yy76ZmiLDgxMDU2NDAs5a6955S45Lic5qGl5bq35aSN5Yy76ZmiLOa2iOWMluenkSwsMTY4NjIwMzI1NDQ2ODI1MFZWR0lVLDEsMjAwMCznm5IsMjAsMjAyMy82Lzgs5Lii5aSx5Y6f5ZugDQpEQi1GWTIwMjQtMDYtWjMxMDAwMyznm7TmjqXplIDllK7nu5nljLvpmaIsODEwNTY0MCzlrr3nlLjkuJzmoaXlurflpI3ljLvpmaIs5raI5YyW56eRLCwxNjg2MjAzMjU2MDk4MjUwUkVKT1EsMSwzMDAwLOebkiwyMCwyMDIzLzYvOCzkuKLlpLHljp%2Flm6ANCkRCLUZZMjAyNC0wNi1aMzEwMDA0LOebtOaOpemUgOWUrue7meWMu%2BmZoiw4MTA1NjQwLOWuveeUuOS4nOahpeW6t%2BWkjeWMu%2BmZoizmtojljJbnp5EsLDE2ODYyMDMyNTc2NTcyNTBHU0ZTQiwxLDQwMDAs55uSLDIwLDIwMjMvNi84LOS4ouWkseWOn%2BWboA0K');
- try {
- LexConInvoiceViewController.saveFile(invoiceorder.Id, 'Test', '');
- } catch (Exception e) {
+ try{
+ LexConInvoiceViewController.saveFile(invoiceorder.Id,'Test','');
+ }catch(Exception e){
system.debug('Test');
+
}
LexConInvoiceViewController.outbound = testList2;
LexConInvoiceViewController.getInvoiceName();
@@ -258,10 +164,10 @@
Map<String, Decimal> ordermx1defaultMap = new Map<String, Decimal>();
LexConInvoiceViewController.ordermx1defaultMap = ordermx1defaultMap;
Map<String, String> deleteMap = new Map<String, String>();
- LexConInvoiceViewController.deleteOutboundorder(deleteMap, '');
+ LexConInvoiceViewController.deleteOutboundorder(deleteMap,'');
// LexConInvoiceViewController.invoiceOrderRecoedsCount
LexConInvoiceViewController.orderby = new List<String>{ 'Outbound_Date__c', 'Name', 'ShipmentAccount__c' };
- LexConInvoiceViewController.sortKey = 'test';
+ LexConInvoiceViewController.sortKey = 'test';
LexConInvoiceViewController.preSortKey = 'test';
LexConInvoiceViewController.sortOrderAsc = false;
LexConInvoiceViewController.sortOrder = new List<String>{ 'Outbound_Date__c', 'Name', 'ShipmentAccount__c' };
@@ -271,76 +177,56 @@
chukudanID.add(testList1.Id);
LexConInvoiceViewController.newinvoicedetails1(chukudanID);
Map<String, String> insertDetMap = new Map<String, String>();
- insertDetMap.put('Outboundorder_Code_link__c', testList1.Id);
+ insertDetMap.put('Outboundorder_Code_link__c',testList1.Id);
// LexConInvoiceViewController.outOrderchange(insertDetMap);
LexConInvoiceViewController.getdefaultMapinfo(chukudanID);
+
+
+
System.Test.stopTest();
+
}
}
+
//鏂板缓鍙戠エ invoiceId=null
- static testMethod void conInvoiceViewTestedit_2() {
+ static testMethod void conInvoiceViewTestedit_2(){
user curUser = [SELECT Id FROM User WHERE LastName = 'TestUser' LIMIT 1];
- Account acc = [
- SELECT Id
- FROM Account
- WHERE name = 'Testaccount002'
- LIMIT 1
- ];
- Account hosp1 = [SELECT Id FROM Account WHERE name = 'Testhosp001' LIMIT 1];
- Account agency1 = [
- SELECT Id
- FROM Account
- WHERE name = 'Testhosp001'
- LIMIT 1
- ];
- Account agency2 = [
- SELECT Id
- FROM Account
- WHERE name = 'Testhosp002'
- LIMIT 1
- ];
- System.runAs(curUser) {
+ Account acc = [SELECT Id FROM Account WHERE name='Testaccount002' LIMIT 1];
+ Account hosp1 = [SELECT Id FROM Account WHERE name='Testhosp001' LIMIT 1];
+ Account agency1 = [SELECT Id FROM Account WHERE name='Testhosp001' LIMIT 1];
+ Account agency2 = [SELECT Id FROM Account WHERE name='Testhosp002' LIMIT 1];
+ system.runAs(curUser){
//鍙戠エ淇℃伅
Consumable_order__c invoiceorder = new Consumable_order__c();
- invoiceorder.Name = 'invoice01';
+ invoiceorder.Name='invoice01';
invoiceorder.Order_type__c = '鍙戠エ';
- invoiceorder.Invoice_status__c = '鑽夋涓�';
+ invoiceorder.Invoice_status__c='鑽夋涓�';
invoiceorder.Invoice_Date__c = Date.today();
invoiceorder.RecordTypeid = System.Label.RT_ConOrder_Invoice;
//invoiceorder.Order_ForHospital__c =hosp1.Id;
// invoiceorder.Order_ForDealer__c = agency1.Id;
- invoiceorder.Dealer_Info__c = acc.Id;
+ invoiceorder.Dealer_Info__c=acc.Id;
//invoiceorder.Order_ProType__c = 'ET';
insert invoiceorder;
- invoiceorder = [
- SELECT id, Name
- FROM Consumable_order__c
- WHERE id = :invoiceorder.id
- ];
+ invoiceorder = [select id,Name from Consumable_order__c where id =:invoiceorder.id];
Consumable_order__c testList1 = new Consumable_order__c(
- Name = 'Test1',
- Summons_Sale_Status__c = '鍑鸿揣',
- SummonsStatus_c__c = '宸插畬鎴�',
- SummonsForDirction__c = '鐩存帴閿�鍞粰鍖婚櫌',
- Order_status__c = '鑽夋涓�',
- Order_type__c = '浼犵エ',
- Dealer_info__c = acc.Id
- );
+ Name='Test1',
+ Summons_Sale_Status__c='鍑鸿揣',
+ SummonsStatus_c__c='宸插畬鎴�',
+ SummonsForDirction__c='鐩存帴閿�鍞粰鍖婚櫌',
+ Order_status__c='鑽夋涓�',
+ Order_type__c='浼犵エ',
+ Dealer_info__c=acc.Id);
- Consumable_order__c testList2 = new Consumable_order__c(
- Name = 'Test2',
- Summons_Sale_Status__c = '鍑鸿揣',
- SummonsStatus_c__c = '宸插畬鎴�',
- SummonsForDirction__c = '鐩存帴閿�鍞粰鍖婚櫌',
- Order_status__c = '宸叉彁浜�',
- Order_type__c = '浼犵エ',
- Dealer_info__c = acc.Id
- );
+ Consumable_order__c testList2 = new Consumable_order__c(Name='Test2',Summons_Sale_Status__c='鍑鸿揣',
+ SummonsStatus_c__c='宸插畬鎴�',SummonsForDirction__c='鐩存帴閿�鍞粰鍖婚櫌',
+ Order_status__c='宸叉彁浜�',Order_type__c='浼犵エ',
+ Dealer_info__c=acc.Id);
TestList1.Order_date__c = Date.today().addDays(2);
TestList2.Order_date__c = Date.today().addDays(2);
TestList1.Deliver_date__c = Date.today();
@@ -348,131 +234,76 @@
insert testList1;
insert testList2;
- Consumable_order_LinkTable__c order_LinkTable1 = new Consumable_order_LinkTable__c(
- Name = 'order_LinkTable1',
- Outboundorder_Code_link__c = testList1.Id,
- Invoice_Code_link__c = invoiceorder.Id
- );
+ Consumable_order_LinkTable__c order_LinkTable1 = new Consumable_order_LinkTable__c(Name='order_LinkTable1',Outboundorder_Code_link__c = testList1.Id,Invoice_Code_link__c =invoiceorder.Id);
insert order_LinkTable1;
System.Test.startTest();
- LexConInvoiceViewController.init(invoiceorder.Id, 'Redirect', testList1.Id);
- LexConInvoiceViewController.init('', '', '');
+ LexConInvoiceViewController.init(invoiceorder.Id,'Redirect',testList1.Id);
+ LexConInvoiceViewController.init('','','');
LexConInvoiceViewController conTest = new LexConInvoiceViewController();
- LexConInvoiceViewController.HospitalInfo = hosp1.id;
- LexConInvoiceViewController.SecondDealer = agency1.id;
- LexConInvoiceViewController.invoiceId = invoiceorder.Id;
- LexConInvoiceViewController.init(invoiceorder.Id, 'Redirect', testList1.Id);
- LexConInvoiceViewController.init(invoiceorder.Id, '', testList1.Id);
- LexConInvoiceViewController.init('', '', '');
- LexConInvoiceViewController.init('', '', testList1.Id);
- LexConInvoiceViewController.init('', 'Redirect', testList1.Id);
+ LexConInvoiceViewController.HospitalInfo = hosp1.id;
+ LexConInvoiceViewController.SecondDealer = agency1.id;
+ LexConInvoiceViewController.invoiceId = invoiceorder.Id;
+ LexConInvoiceViewController.init(invoiceorder.Id,'Redirect',testList1.Id);
+ LexConInvoiceViewController.init(invoiceorder.Id,'',testList1.Id);
+ LexConInvoiceViewController.init('','','');
+ LexConInvoiceViewController.init('','',testList1.Id);
+ LexConInvoiceViewController.init('','Redirect',testList1.Id);
String invoiceOrderRecoedschangeLwc = JSON.serialize(LexConInvoiceViewController.invoiceOrderRecoedschange);
String invoiceOrderRecoeds = JSON.serialize(LexConInvoiceViewController.invoiceOrderRecoeds);
- LexConInvoiceViewController.save(
- testList1,
- '娴庡畞浠诲煄鍎掓祹鍖婚櫌',
- hosp1.id,
- agency1.id,
- invoiceOrderRecoeds,
- testList1.Id,
- invoiceorder.Id,
- acc.Id,
- 'ET',
- '',
- invoiceOrderRecoedschangeLwc
- );
- LexConInvoiceViewController.InvoiceorderSearch(
- testList1,
- invoiceorder.Id,
- acc.Id,
- '閲嶅簡',
- 'ET',
- hosp1.id,
- agency1.id,
- invoiceOrderRecoeds
- );
+ LexConInvoiceViewController.save(testList1,'娴庡畞浠诲煄鍎掓祹鍖婚櫌',hosp1.id,agency1.id,invoiceOrderRecoeds,testList1.Id,invoiceorder.Id,acc.Id,'ET','',invoiceOrderRecoedschangeLwc);
+ LexConInvoiceViewController.InvoiceorderSearch(testList1,invoiceorder.Id,acc.Id,'閲嶅簡','ET',hosp1.id,agency1.id,invoiceOrderRecoeds);
+
// LexConInvoiceViewController.HospitalInfo = hosp1.id;
System.Test.stopTest();
+
}
}
//鏂板缓鍙戠エ invoiceId=null error check
-
- static testMethod void conInvoiceViewTestedit_3() {
+
+ static testMethod void conInvoiceViewTestedit_3(){
user curUser = [SELECT Id FROM User WHERE LastName = 'TestUser' LIMIT 1];
- Account acc = [
- SELECT Id
- FROM Account
- WHERE name = 'Testaccount002'
- LIMIT 1
- ];
- Account hosp1 = [SELECT Id FROM Account WHERE name = 'Testhosp001' LIMIT 1];
- Account agency1 = [
- SELECT Id
- FROM Account
- WHERE name = 'Testhosp001'
- LIMIT 1
- ];
- Account agency2 = [
- SELECT Id
- FROM Account
- WHERE name = 'Testhosp002'
- LIMIT 1
- ];
- System.runAs(curUser) {
+ Account acc = [SELECT Id FROM Account WHERE name='Testaccount002' LIMIT 1];
+ Account hosp1 = [SELECT Id FROM Account WHERE name='Testhosp001' LIMIT 1];
+ Account agency1 = [SELECT Id FROM Account WHERE name='Testhosp001' LIMIT 1];
+ Account agency2 = [SELECT Id FROM Account WHERE name='Testhosp002' LIMIT 1];
+ system.runAs(curUser){
//浜у搧淇℃伅
- Product2 prod01 = new Product2(
- Name = 'Test01',
- ProductCode = 'Test01',
- Asset_Model_No__c = 'Test01',
- SFDA_Status__c = '鏈夊姽',
- Dealer_special_Object__c = true,
- Manual_Entry__c = false
- );
- insert new List<Product2>{ prod01 };
+ Product2 prod01 = new Product2(Name='Test01',ProductCode='Test01',Asset_Model_No__c = 'Test01',SFDA_Status__c = '鏈夊姽',Dealer_special_Object__c = true,Manual_Entry__c = false);
+ insert new Product2[] {prod01};
- Product2__c pro1 = new Product2__c(Name = 'Pro001', OT_CODE_Text__c = 'Test001', Product2__c = prod01.Id);
- insert new List<Product2__c>{ pro1 };
+ Product2__c pro1 = new Product2__c(Name='Pro001',OT_CODE_Text__c='Test001',Product2__c = prod01.Id);
+ insert new Product2__c[] {pro1};
//鍙戠エ淇℃伅
Consumable_order__c invoiceorder = new Consumable_order__c();
- invoiceorder.Name = 'invoice01';
+ invoiceorder.Name='invoice01';
invoiceorder.Order_type__c = '鍙戠エ';
- invoiceorder.Invoice_status__c = '鑽夋涓�';
+ invoiceorder.Invoice_status__c='鑽夋涓�';
invoiceorder.Invoice_Date__c = Date.today();
invoiceorder.RecordTypeid = System.Label.RT_ConOrder_Invoice;
//invoiceorder.Order_ForHospital__c =hosp1.Id;
//invoiceorder.Order_ForDealer__c = agency1.Id;
- invoiceorder.Dealer_Info__c = acc.Id;
+ invoiceorder.Dealer_Info__c=acc.Id;
//invoiceorder.Order_ProType__c = 'ET';
insert invoiceorder;
- invoiceorder = [
- SELECT id, Name
- FROM Consumable_order__c
- WHERE id = :invoiceorder.id
- ];
+ invoiceorder = [select id,Name from Consumable_order__c where id =:invoiceorder.id];
Consumable_order__c testList1 = new Consumable_order__c(
- Name = 'Test1',
- Summons_Sale_Status__c = '鍑鸿揣',
- SummonsStatus_c__c = '宸插畬鎴�',
- SummonsForDirction__c = '鐩存帴閿�鍞粰鍖婚櫌',
- Order_status__c = '鑽夋涓�',
- Order_type__c = '浼犵エ',
- Dealer_info__c = acc.Id
- );
+ Name='Test1',
+ Summons_Sale_Status__c='鍑鸿揣',
+ SummonsStatus_c__c='宸插畬鎴�',
+ SummonsForDirction__c='鐩存帴閿�鍞粰鍖婚櫌',
+ Order_status__c='鑽夋涓�',
+ Order_type__c='浼犵エ',
+ Dealer_info__c=acc.Id);
- Consumable_order__c testList2 = new Consumable_order__c(
- Name = 'Test2',
- Summons_Sale_Status__c = '鍑鸿揣',
- SummonsStatus_c__c = '宸插畬鎴�',
- SummonsForDirction__c = '鐩存帴閿�鍞粰鍖婚櫌',
- Order_status__c = '宸叉彁浜�',
- Order_type__c = '浼犵エ',
- Dealer_info__c = acc.Id
- );
+ Consumable_order__c testList2 = new Consumable_order__c(Name='Test2',Summons_Sale_Status__c='鍑鸿揣',
+ SummonsStatus_c__c='宸插畬鎴�',SummonsForDirction__c='鐩存帴閿�鍞粰鍖婚櫌',
+ Order_status__c='宸叉彁浜�',Order_type__c='浼犵エ',
+ Dealer_info__c=acc.Id);
TestList1.Order_date__c = Date.today().addDays(2);
TestList2.Order_date__c = Date.today().addDays(2);
TestList1.Deliver_date__c = Date.today();
@@ -480,151 +311,87 @@
insert testList1;
insert testList2;
- Consumable_order_LinkTable__c order_LinkTable1 = new Consumable_order_LinkTable__c(
- Name = 'order_LinkTable1',
- Outboundorder_Code_link__c = testList1.Id,
- Invoice_Code_link__c = invoiceorder.Id
- );
+ Consumable_order_LinkTable__c order_LinkTable1 = new Consumable_order_LinkTable__c(Name='order_LinkTable1',Outboundorder_Code_link__c = testList1.Id,Invoice_Code_link__c =invoiceorder.Id);
insert order_LinkTable1;
- PageReference page = new PageReference('/apex/ConInvoiceView?invoiceId=' + invoiceorder.Id + '&KeyWords=Redirect');
+ PageReference page = new PageReference('/apex/ConInvoiceView?invoiceId='+invoiceorder.Id+'&KeyWords=Redirect');
page.setRedirect(true);
System.Test.setCurrentPage(page);
System.Test.startTest();
LexConInvoiceViewController conTest = new LexConInvoiceViewController();
- LexConInvoiceViewController.HospitalInfo = hosp1.id;
- LexConInvoiceViewController.SecondDealer = agency1.id;
- LexConInvoiceViewController.invoiceId = invoiceorder.Id;
- LexConInvoiceViewController.init(invoiceorder.Id, 'Redirect', testList1.Id);
- LexConInvoiceViewController.init(invoiceorder.Id, '', testList1.Id);
- LexConInvoiceViewController.init('', '', '');
- LexConInvoiceViewController.init('', '', testList1.Id);
- LexConInvoiceViewController.init('', 'Redirect', testList1.Id);
+ LexConInvoiceViewController.HospitalInfo = hosp1.id;
+ LexConInvoiceViewController.SecondDealer = agency1.id;
+ LexConInvoiceViewController.invoiceId = invoiceorder.Id;
+ LexConInvoiceViewController.init(invoiceorder.Id,'Redirect',testList1.Id);
+ LexConInvoiceViewController.init(invoiceorder.Id,'',testList1.Id);
+ LexConInvoiceViewController.init('','','');
+ LexConInvoiceViewController.init('','',testList1.Id);
+ LexConInvoiceViewController.init('','Redirect',testList1.Id);
String invoiceOrderRecoedschangeLwc = JSON.serialize(LexConInvoiceViewController.invoiceOrderRecoedschange);
String invoiceOrderRecoeds = JSON.serialize(LexConInvoiceViewController.invoiceOrderRecoeds);
- LexConInvoiceViewController.save(
- testList1,
- '娴庡畞浠诲煄鍎掓祹鍖婚櫌',
- hosp1.id,
- agency1.id,
- invoiceOrderRecoeds,
- testList1.Id,
- invoiceorder.Id,
- acc.Id,
- 'ET',
- '',
- invoiceOrderRecoedschangeLwc
- );
- LexConInvoiceViewController.InvoiceorderSearch(
- testList1,
- invoiceorder.Id,
- acc.Id,
- '閲嶅簡',
- 'ET',
- hosp1.id,
- agency1.id,
- invoiceOrderRecoeds
- );
+ LexConInvoiceViewController.save(testList1,'娴庡畞浠诲煄鍎掓祹鍖婚櫌',hosp1.id,agency1.id,invoiceOrderRecoeds,testList1.Id,invoiceorder.Id,acc.Id,'ET','',invoiceOrderRecoedschangeLwc);
+ LexConInvoiceViewController.InvoiceorderSearch(testList1,invoiceorder.Id,acc.Id,'閲嶅簡','ET',hosp1.id,agency1.id,invoiceOrderRecoeds);
+
+
// LexConInvoiceViewController.init();
- LexConInvoiceViewController.invoiceId = invoiceorder.Id;
+ LexConInvoiceViewController.invoiceId =invoiceorder.Id;
// LexConInvoiceViewController.coc.SummonsForDirction__c = '鐩存帴閿�鍞粰鍖婚櫌';
LexConInvoiceViewController.HospitalInfo = hosp1.id;
- System.debug('===>hosp1.id' + hosp1.id);
- LexConInvoiceViewController.invoiceId = null;
+ System.debug('===>hosp1.id'+hosp1.id);
+ LexConInvoiceViewController.invoiceId =null;
System.Test.stopTest();
+
+
}
}
//鏂板缓鍙戠エ 浠ュ強缂栬緫鍙戠エinvoiceId== NULL and deliveryId== NULL
- static testMethod void conInvoiceViewTestinit() {
+ static testMethod void conInvoiceViewTestinit(){
user curUser = [SELECT Id FROM User WHERE LastName = 'TestUser' LIMIT 1];
- Account acc = [
- SELECT Id
- FROM Account
- WHERE name = 'Testaccount002'
- LIMIT 1
- ];
- Account hosp1 = [SELECT Id FROM Account WHERE name = 'Testhosp001' LIMIT 1];
- Account agency1 = [
- SELECT Id
- FROM Account
- WHERE name = 'Testhosp001'
- LIMIT 1
- ];
- Account agency2 = [
- SELECT Id
- FROM Account
- WHERE name = 'Testhosp002'
- LIMIT 1
- ];
-
- System.runAs(curUser) {
+ Account acc = [SELECT Id FROM Account WHERE name='Testaccount002' LIMIT 1];
+ Account hosp1 = [SELECT Id FROM Account WHERE name='Testhosp001' LIMIT 1];
+ Account agency1 = [SELECT Id FROM Account WHERE name='Testhosp001' LIMIT 1];
+ Account agency2 = [SELECT Id FROM Account WHERE name='Testhosp002' LIMIT 1];
+
+ system.runAs(curUser){
//浜у搧淇℃伅
- Product2 prod01 = new Product2(
- Name = 'Test01',
- ProductCode = 'Test01',
- Asset_Model_No__c = 'Test01',
- SFDA_Status__c = '鏈夊姽',
- Dealer_special_Object__c = true,
- Manual_Entry__c = false
- );
- Product2 prod02 = new Product2(
- Name = 'Test02',
- ProductCode = 'Test02',
- Asset_Model_No__c = 'Test02',
- SFDA_Status__c = '鏈夊姽',
- Dealer_special_Object__c = true,
- Manual_Entry__c = false
- );
- insert new List<Product2>{ prod01, prod02 };
+ Product2 prod01 = new Product2(Name='Test01',ProductCode='Test01',Asset_Model_No__c = 'Test01',SFDA_Status__c = '鏈夊姽',Dealer_special_Object__c = true,Manual_Entry__c = false);
+ Product2 prod02 = new Product2(Name='Test02',ProductCode='Test02',Asset_Model_No__c = 'Test02',SFDA_Status__c = '鏈夊姽',Dealer_special_Object__c = true,Manual_Entry__c = false);
+ insert new Product2[] {prod01, prod02};
- Product2__c pro1 = new Product2__c(Name = 'Pro001', OT_CODE_Text__c = 'Test001', Product2__c = prod01.Id);
- Product2__c pro2 = new Product2__c(Name = 'Pro002', OT_CODE_Text__c = 'Test002', Product2__c = prod02.Id);
- insert new List<Product2__c>{ pro1, pro2 };
+ Product2__c pro1 = new Product2__c(Name='Pro001',OT_CODE_Text__c='Test001',Product2__c = prod01.Id);
+ Product2__c pro2 = new Product2__c(Name='Pro002',OT_CODE_Text__c='Test002',Product2__c = prod02.Id);
+ insert new Product2__c[] {pro1, pro2};
//鍙戠エ淇℃伅
Consumable_order__c invoiceorder = new Consumable_order__c();
- invoiceorder.Name = 'invoice01';
+ invoiceorder.Name='invoice01';
invoiceorder.Order_type__c = '鍙戠エ';
- invoiceorder.Invoice_status__c = '鑽夋涓�';
+ invoiceorder.Invoice_status__c='鑽夋涓�';
invoiceorder.Invoice_Date__c = Date.today();
invoiceorder.RecordTypeid = System.Label.RT_ConOrder_Invoice;
//invoiceorder.Order_ForHospital__c =hosp1.Id;
//invoiceorder.Order_ForDealer__c = agency1.Id;
- invoiceorder.Dealer_Info__c = acc.Id;
+ invoiceorder.Dealer_Info__c=acc.Id;
//invoiceorder.Order_ProType__c = 'ET';
insert invoiceorder;
- invoiceorder = [
- SELECT id, Name
- FROM Consumable_order__c
- WHERE id = :invoiceorder.id
- ];
+ invoiceorder = [select id,Name from Consumable_order__c where id =:invoiceorder.id];
//鍑哄簱鍗�
//Consumable_order__c testList1 = new Consumable_order__c(Name='Test1',Summons_Sale_Status__c='鍑鸿揣',SummonsStatus_c__c='宸插畬鎴�',Order_ForHospital__c =hosp1.Id,SummonsForDirction__c='鐩存帴閿�鍞粰鍖婚櫌',Order_status__c='鑽夋涓�',Order_type__c='浼犵エ',Order_ForDealer__c = agency1.Id, Dealer_info__c=myAccount1.Id,ConInvoice_Code__c = invoiceorder.id);
//Consumable_order__c testList2 = new Consumable_order__c(Name='Test2',Summons_Sale_Status__c='鍑鸿揣',SummonsStatus_c__c='宸插畬鎴�',Order_ForHospital__c =hosp1.Id,SummonsForDirction__c='鐩存帴閿�鍞粰鍖婚櫌',Order_status__c='宸叉彁浜�',Order_type__c='浼犵エ',Order_ForDealer__c = agency1.Id, Dealer_info__c=myAccount1.Id,ConInvoice_Code__c = invoiceorder.id);
-
- Consumable_order__c testList1 = new Consumable_order__c(
- Name = 'Test1',
- Summons_Sale_Status__c = '鍑鸿揣',
- SummonsStatus_c__c = '宸插畬鎴�',
- SummonsForDirction__c = '鐩存帴閿�鍞粰鍖婚櫌',
- Order_status__c = '鑽夋涓�',
- Order_type__c = '浼犵エ',
- Dealer_info__c = acc.Id
- );
- Consumable_order__c testList2 = new Consumable_order__c(
- Name = 'Test2',
- Summons_Sale_Status__c = '鍑鸿揣',
- SummonsStatus_c__c = '宸插畬鎴�',
- SummonsForDirction__c = '鐩存帴閿�鍞粰鍖婚櫌',
- Order_status__c = '宸叉彁浜�',
- Order_type__c = '浼犵エ',
- Dealer_info__c = acc.Id
- );
+
+ Consumable_order__c testList1 = new Consumable_order__c(Name='Test1',Summons_Sale_Status__c='鍑鸿揣',
+ SummonsStatus_c__c='宸插畬鎴�',SummonsForDirction__c='鐩存帴閿�鍞粰鍖婚櫌',
+ Order_status__c='鑽夋涓�',Order_type__c='浼犵エ',
+ Dealer_info__c=acc.Id);
+ Consumable_order__c testList2 = new Consumable_order__c(Name='Test2',Summons_Sale_Status__c='鍑鸿揣',
+ SummonsStatus_c__c='宸插畬鎴�',SummonsForDirction__c='鐩存帴閿�鍞粰鍖婚櫌',
+ Order_status__c='宸叉彁浜�',Order_type__c='浼犵エ',
+ Dealer_info__c=acc.Id);
TestList1.Order_date__c = Date.today().addDays(2);
TestList2.Order_date__c = Date.today().addDays(2);
TestList1.Deliver_date__c = Date.today();
@@ -633,17 +400,9 @@
insert testList2;
//insert new Consumable_order__c[]{testList1,testList2};
- Consumable_order_LinkTable__c order_LinkTable1 = new Consumable_order_LinkTable__c(
- Name = 'order_LinkTable1',
- Outboundorder_Code_link__c = testList1.Id,
- Invoice_Code_link__c = invoiceorder.Id
- );
+ Consumable_order_LinkTable__c order_LinkTable1 = new Consumable_order_LinkTable__c(Name='order_LinkTable1',Outboundorder_Code_link__c = testList1.Id,Invoice_Code_link__c =invoiceorder.Id);
insert order_LinkTable1;
- Consumable_order_LinkTable__c order_LinkTable2 = new Consumable_order_LinkTable__c(
- Name = 'order_LinkTable2',
- Outboundorder_Code_link__c = testList2.Id,
- Invoice_Code_link__c = invoiceorder.Id
- );
+ Consumable_order_LinkTable__c order_LinkTable2 = new Consumable_order_LinkTable__c(Name='order_LinkTable2',Outboundorder_Code_link__c = testList2.Id,Invoice_Code_link__c =invoiceorder.Id);
insert order_LinkTable2;
//鍑哄簱鍗�1鏄庣粏1
Consumable_orderdetails__c orderdet1 = new Consumable_orderdetails__c();
@@ -672,7 +431,7 @@
orderdet3.Shipment_Count__c = 1;
orderdet3.Consumable_product__c = pro2.Id;
- //鍑哄簱鍗�2鏄庣粏2
+ //鍑哄簱鍗�2鏄庣粏2
Consumable_orderdetails__c orderdet4 = new Consumable_orderdetails__c();
orderdet4.Name = 'Test1_002002';
//orderdet2.Consumable_principal__c = testList2.Id;
@@ -681,9 +440,9 @@
orderdet4.Consumable_count__c = 1;
orderdet4.Shipment_Count__c = 1;
orderdet4.Consumable_product__c = pro2.Id;
- insert new List<Consumable_orderdetails__c>{ orderdet1, orderdet2, orderdet3, orderdet4 };
- //闄勪欢
- Consumable_accessories_invoice__c caic = new Consumable_accessories_invoice__c();
+ insert new Consumable_orderdetails__c[]{orderdet1,orderdet2,orderdet3,orderdet4};
+ //闄勪欢
+ Consumable_accessories_invoice__c caic= new Consumable_accessories_invoice__c();
caic.Attachment_ID__c = acc.Id;
caic.Accessories_type__c = '鍙戠エ鍜屾槑缁�';
caic.Invoice_code__c = invoiceorder.id;
@@ -695,128 +454,64 @@
//contest.deliveryId=testList1.id;
System.Test.startTest();
LexConInvoiceViewController conTest = new LexConInvoiceViewController();
- LexConInvoiceViewController.HospitalInfo = hosp1.id;
- LexConInvoiceViewController.SecondDealer = agency1.id;
- LexConInvoiceViewController.invoiceId = invoiceorder.Id;
- LexConInvoiceViewController.init(invoiceorder.Id, 'Redirect', testList1.Id);
- LexConInvoiceViewController.init(invoiceorder.Id, '', testList1.Id);
- LexConInvoiceViewController.init('', '', '');
- LexConInvoiceViewController.init('', '', testList1.Id);
- LexConInvoiceViewController.init('', 'Redirect', testList1.Id);
+ LexConInvoiceViewController.HospitalInfo = hosp1.id;
+ LexConInvoiceViewController.SecondDealer = agency1.id;
+ LexConInvoiceViewController.invoiceId = invoiceorder.Id;
+ LexConInvoiceViewController.init(invoiceorder.Id,'Redirect',testList1.Id);
+ LexConInvoiceViewController.init(invoiceorder.Id,'',testList1.Id);
+ LexConInvoiceViewController.init('','','');
+ LexConInvoiceViewController.init('','',testList1.Id);
+ LexConInvoiceViewController.init('','Redirect',testList1.Id);
String invoiceOrderRecoedschangeLwc = JSON.serialize(LexConInvoiceViewController.invoiceOrderRecoedschange);
String invoiceOrderRecoeds = JSON.serialize(LexConInvoiceViewController.invoiceOrderRecoeds);
- LexConInvoiceViewController.save(
- testList1,
- '娴庡畞浠诲煄鍎掓祹鍖婚櫌',
- hosp1.id,
- agency1.id,
- invoiceOrderRecoeds,
- testList1.Id,
- invoiceorder.Id,
- acc.Id,
- 'ET',
- '',
- invoiceOrderRecoedschangeLwc
- );
- LexConInvoiceViewController.InvoiceorderSearch(
- testList1,
- invoiceorder.Id,
- acc.Id,
- '閲嶅簡',
- 'ET',
- hosp1.id,
- agency1.id,
- invoiceOrderRecoeds
- );
+ LexConInvoiceViewController.save(testList1,'娴庡畞浠诲煄鍎掓祹鍖婚櫌',hosp1.id,agency1.id,invoiceOrderRecoeds,testList1.Id,invoiceorder.Id,acc.Id,'ET','',invoiceOrderRecoedschangeLwc);
+ LexConInvoiceViewController.InvoiceorderSearch(testList1,invoiceorder.Id,acc.Id,'閲嶅簡','ET',hosp1.id,agency1.id,invoiceOrderRecoeds);
System.Test.stopTest();
}
}
//鏂板缓鍙戠エ 浠ュ強缂栬緫鍙戠エinvoiceId== NULL and deliveryId<> NULL
- static testMethod void conInvoiceViewTestinit_1() {
+ static testMethod void conInvoiceViewTestinit_1(){
user curUser = [SELECT Id FROM User WHERE LastName = 'TestUser' LIMIT 1];
- Account acc = [
- SELECT Id
- FROM Account
- WHERE name = 'Testaccount002'
- LIMIT 1
- ];
- Account hosp1 = [SELECT Id FROM Account WHERE name = 'Testhosp001' LIMIT 1];
- Account agency1 = [
- SELECT Id
- FROM Account
- WHERE name = 'Testhosp001'
- LIMIT 1
- ];
- Account agency2 = [
- SELECT Id
- FROM Account
- WHERE name = 'Testhosp002'
- LIMIT 1
- ];
- System.runAs(curUser) {
+ Account acc = [SELECT Id FROM Account WHERE name='Testaccount002' LIMIT 1];
+ Account hosp1 = [SELECT Id FROM Account WHERE name='Testhosp001' LIMIT 1];
+ Account agency1 = [SELECT Id FROM Account WHERE name='Testhosp001' LIMIT 1];
+ Account agency2 = [SELECT Id FROM Account WHERE name='Testhosp002' LIMIT 1];
+ system.runAs(curUser){
//浜у搧淇℃伅
- Product2 prod01 = new Product2(
- Name = 'Test01',
- ProductCode = 'Test01',
- Asset_Model_No__c = 'Test01',
- SFDA_Status__c = '鏈夊姽',
- Dealer_special_Object__c = true,
- Manual_Entry__c = false
- );
- Product2 prod02 = new Product2(
- Name = 'Test02',
- ProductCode = 'Test02',
- Asset_Model_No__c = 'Test02',
- SFDA_Status__c = '鏈夊姽',
- Dealer_special_Object__c = true,
- Manual_Entry__c = false
- );
- insert new List<Product2>{ prod01, prod02 };
+ Product2 prod01 = new Product2(Name='Test01',ProductCode='Test01',Asset_Model_No__c = 'Test01',SFDA_Status__c = '鏈夊姽',Dealer_special_Object__c = true,Manual_Entry__c = false);
+ Product2 prod02 = new Product2(Name='Test02',ProductCode='Test02',Asset_Model_No__c = 'Test02',SFDA_Status__c = '鏈夊姽',Dealer_special_Object__c = true,Manual_Entry__c = false);
+ insert new Product2[] {prod01, prod02};
- Product2__c pro1 = new Product2__c(Name = 'Pro001', OT_CODE_Text__c = 'Test001', Product2__c = prod01.Id);
- Product2__c pro2 = new Product2__c(Name = 'Pro002', OT_CODE_Text__c = 'Test002', Product2__c = prod02.Id);
- insert new List<Product2__c>{ pro1, pro2 };
+ Product2__c pro1 = new Product2__c(Name='Pro001',OT_CODE_Text__c='Test001',Product2__c = prod01.Id);
+ Product2__c pro2 = new Product2__c(Name='Pro002',OT_CODE_Text__c='Test002',Product2__c = prod02.Id);
+ insert new Product2__c[] {pro1, pro2};
//鍙戠エ淇℃伅
Consumable_order__c invoiceorder = new Consumable_order__c();
- invoiceorder.Name = 'invoice01';
+ invoiceorder.Name='invoice01';
invoiceorder.Order_type__c = '鍙戠エ';
- invoiceorder.Invoice_status__c = '鑽夋涓�';
+ invoiceorder.Invoice_status__c='鑽夋涓�';
invoiceorder.Invoice_Date__c = Date.today();
invoiceorder.RecordTypeid = System.Label.RT_ConOrder_Invoice;
//invoiceorder.Order_ForHospital__c =hosp1.Id;
//invoiceorder.Order_ForDealer__c = agency1.Id;
- invoiceorder.Dealer_Info__c = acc.Id;
+ invoiceorder.Dealer_Info__c=acc.Id;
insert invoiceorder;
- invoiceorder = [
- SELECT id, Name
- FROM Consumable_order__c
- WHERE id = :invoiceorder.id
- ];
+ invoiceorder = [select id,Name from Consumable_order__c where id =:invoiceorder.id];
//鍑哄簱鍗�
//Consumable_order__c testList1 = new Consumable_order__c(Name='Test1',Summons_Sale_Status__c='鍑鸿揣',SummonsStatus_c__c='宸插畬鎴�',Order_ForHospital__c =hosp1.Id,SummonsForDirction__c='鐩存帴閿�鍞粰鍖婚櫌',Order_status__c='鑽夋涓�',Order_type__c='浼犵エ',Order_ForDealer__c = agency1.Id, Dealer_info__c=myAccount1.Id,ConInvoice_Code__c = invoiceorder.id);
//Consumable_order__c testList2 = new Consumable_order__c(Name='Test2',Summons_Sale_Status__c='鍑鸿揣',SummonsStatus_c__c='宸插畬鎴�',Order_ForHospital__c =hosp1.Id,SummonsForDirction__c='鐩存帴閿�鍞粰鍖婚櫌',Order_status__c='宸叉彁浜�',Order_type__c='浼犵エ',Order_ForDealer__c = agency1.Id, Dealer_info__c=myAccount1.Id,ConInvoice_Code__c = invoiceorder.id);
-
- Consumable_order__c testList1 = new Consumable_order__c(
- Name = 'Test1',
- Summons_Sale_Status__c = '鍑鸿揣',
- SummonsStatus_c__c = '宸插畬鎴�',
- SummonsForDirction__c = '鐩存帴閿�鍞粰鍖婚櫌',
- Order_status__c = '鑽夋涓�',
- Order_type__c = '浼犵エ',
- Dealer_info__c = acc.Id
- );
- Consumable_order__c testList2 = new Consumable_order__c(
- Name = 'Test2',
- Summons_Sale_Status__c = '鍑鸿揣',
- SummonsStatus_c__c = '宸插畬鎴�',
- SummonsForDirction__c = '鐩存帴閿�鍞粰鍖婚櫌',
- Order_status__c = '宸叉彁浜�',
- Order_type__c = '浼犵エ',
- Dealer_info__c = acc.Id
- );
+
+ Consumable_order__c testList1 = new Consumable_order__c(Name='Test1',Summons_Sale_Status__c='鍑鸿揣',
+ SummonsStatus_c__c='宸插畬鎴�',SummonsForDirction__c='鐩存帴閿�鍞粰鍖婚櫌',
+ Order_status__c='鑽夋涓�',Order_type__c='浼犵エ',
+ Dealer_info__c=acc.Id);
+ Consumable_order__c testList2 = new Consumable_order__c(Name='Test2',Summons_Sale_Status__c='鍑鸿揣',
+ SummonsStatus_c__c='宸插畬鎴�',SummonsForDirction__c='鐩存帴閿�鍞粰鍖婚櫌',
+ Order_status__c='宸叉彁浜�',Order_type__c='浼犵エ',
+ Dealer_info__c=acc.Id);
TestList1.Order_date__c = Date.today().addDays(2);
TestList2.Order_date__c = Date.today().addDays(2);
TestList1.Deliver_date__c = Date.today();
@@ -825,17 +520,9 @@
insert testList2;
//insert new Consumable_order__c[]{testList1,testList2};
- Consumable_order_LinkTable__c order_LinkTable1 = new Consumable_order_LinkTable__c(
- Name = 'order_LinkTable1',
- Outboundorder_Code_link__c = testList1.Id,
- Invoice_Code_link__c = invoiceorder.Id
- );
+ Consumable_order_LinkTable__c order_LinkTable1 = new Consumable_order_LinkTable__c(Name='order_LinkTable1',Outboundorder_Code_link__c = testList1.Id,Invoice_Code_link__c =invoiceorder.Id);
insert order_LinkTable1;
- Consumable_order_LinkTable__c order_LinkTable2 = new Consumable_order_LinkTable__c(
- Name = 'order_LinkTable2',
- Outboundorder_Code_link__c = testList2.Id,
- Invoice_Code_link__c = invoiceorder.Id
- );
+ Consumable_order_LinkTable__c order_LinkTable2 = new Consumable_order_LinkTable__c(Name='order_LinkTable2',Outboundorder_Code_link__c = testList2.Id,Invoice_Code_link__c =invoiceorder.Id);
insert order_LinkTable2;
//鍑哄簱鍗�1鏄庣粏1
Consumable_orderdetails__c orderdet1 = new Consumable_orderdetails__c();
@@ -864,7 +551,7 @@
orderdet3.Shipment_Count__c = 1;
orderdet3.Consumable_product__c = pro2.Id;
- //鍑哄簱鍗�2鏄庣粏2
+ //鍑哄簱鍗�2鏄庣粏2
Consumable_orderdetails__c orderdet4 = new Consumable_orderdetails__c();
orderdet4.Name = 'Test1_002002';
//orderdet2.Consumable_principal__c = testList2.Id;
@@ -873,143 +560,81 @@
orderdet4.Consumable_count__c = 1;
orderdet4.Shipment_Count__c = 1;
orderdet4.Consumable_product__c = pro2.Id;
- insert new List<Consumable_orderdetails__c>{ orderdet1, orderdet2, orderdet3, orderdet4 };
- //闄勪欢
- Consumable_accessories_invoice__c caic = new Consumable_accessories_invoice__c();
+ insert new Consumable_orderdetails__c[]{orderdet1,orderdet2,orderdet3,orderdet4};
+ //闄勪欢
+ Consumable_accessories_invoice__c caic= new Consumable_accessories_invoice__c();
caic.Attachment_ID__c = acc.Id;
caic.Accessories_type__c = '鍙戠エ鍜屾槑缁�';
caic.Invoice_code__c = invoiceorder.id;
insert caic;
- PageReference page = new PageReference('/apex/ConInvoiceView?invoiceId=' + invoiceorder.id);
+ PageReference page = new PageReference('/apex/ConInvoiceView?invoiceId='+invoiceorder.id);
page.setRedirect(true);
System.Test.setCurrentPage(page);
+
// contest.deliveryId=testList1.id;
System.Test.startTest();
- LexConInvoiceViewController.init(invoiceorder.id, 'Redirect', testList2.Id);
+ LexConInvoiceViewController.init(invoiceorder.id,'Redirect',testList2.Id);
LexConInvoiceViewController conTest = new LexConInvoiceViewController();
- LexConInvoiceViewController.HospitalInfo = hosp1.id;
- LexConInvoiceViewController.SecondDealer = agency1.id;
- LexConInvoiceViewController.invoiceId = invoiceorder.Id;
- LexConInvoiceViewController.init(invoiceorder.Id, 'Redirect', testList1.Id);
- LexConInvoiceViewController.init(invoiceorder.Id, '', testList1.Id);
- LexConInvoiceViewController.init('', '', '');
- LexConInvoiceViewController.init('', '', testList1.Id);
- LexConInvoiceViewController.init('', 'Redirect', testList1.Id);
+ LexConInvoiceViewController.HospitalInfo = hosp1.id;
+ LexConInvoiceViewController.SecondDealer = agency1.id;
+ LexConInvoiceViewController.invoiceId = invoiceorder.Id;
+ LexConInvoiceViewController.init(invoiceorder.Id,'Redirect',testList1.Id);
+ LexConInvoiceViewController.init(invoiceorder.Id,'',testList1.Id);
+ LexConInvoiceViewController.init('','','');
+ LexConInvoiceViewController.init('','',testList1.Id);
+ LexConInvoiceViewController.init('','Redirect',testList1.Id);
String invoiceOrderRecoedschangeLwc = JSON.serialize(LexConInvoiceViewController.invoiceOrderRecoedschange);
String invoiceOrderRecoeds = JSON.serialize(LexConInvoiceViewController.invoiceOrderRecoeds);
- LexConInvoiceViewController.save(
- testList1,
- '娴庡畞浠诲煄鍎掓祹鍖婚櫌',
- hosp1.id,
- agency1.id,
- invoiceOrderRecoeds,
- testList1.Id,
- invoiceorder.Id,
- acc.Id,
- 'ET',
- '',
- invoiceOrderRecoedschangeLwc
- );
- LexConInvoiceViewController.InvoiceorderSearch(
- testList1,
- invoiceorder.Id,
- acc.Id,
- '閲嶅簡',
- 'ET',
- hosp1.id,
- agency1.id,
- invoiceOrderRecoeds
- );
+ LexConInvoiceViewController.save(testList1,'娴庡畞浠诲煄鍎掓祹鍖婚櫌',hosp1.id,agency1.id,invoiceOrderRecoeds,testList1.Id,invoiceorder.Id,acc.Id,'ET','',invoiceOrderRecoedschangeLwc);
+ LexConInvoiceViewController.InvoiceorderSearch(testList1,invoiceorder.Id,acc.Id,'閲嶅簡','ET',hosp1.id,agency1.id,invoiceOrderRecoeds);
System.Test.stopTest();
+
}
}
//鏂板缓鍙戠エ 浠ュ強缂栬緫鍙戠エinvoiceId<> NULL
- static testMethod void conInvoiceViewTestinit_2() {
+ static testMethod void conInvoiceViewTestinit_2(){
user curUser = [SELECT Id FROM User WHERE LastName = 'TestUser' LIMIT 1];
- Account acc = [
- SELECT Id
- FROM Account
- WHERE name = 'Testaccount002'
- LIMIT 1
- ];
- Account hosp1 = [SELECT Id FROM Account WHERE name = 'Testhosp001' LIMIT 1];
- Account agency1 = [
- SELECT Id
- FROM Account
- WHERE name = 'Testhosp001'
- LIMIT 1
- ];
- Account agency2 = [
- SELECT Id
- FROM Account
- WHERE name = 'Testhosp002'
- LIMIT 1
- ];
- System.runAs(curUser) {
+ Account acc = [SELECT Id FROM Account WHERE name='Testaccount002' LIMIT 1];
+ Account hosp1 = [SELECT Id FROM Account WHERE name='Testhosp001' LIMIT 1];
+ Account agency1 = [SELECT Id FROM Account WHERE name='Testhosp001' LIMIT 1];
+ Account agency2 = [SELECT Id FROM Account WHERE name='Testhosp002' LIMIT 1];
+ system.runAs(curUser){
//浜у搧淇℃伅
- Product2 prod01 = new Product2(
- Name = 'Test01',
- ProductCode = 'Test01',
- Asset_Model_No__c = 'Test01',
- SFDA_Status__c = '鏈夊姽',
- Dealer_special_Object__c = true,
- Manual_Entry__c = false
- );
- Product2 prod02 = new Product2(
- Name = 'Test02',
- ProductCode = 'Test02',
- Asset_Model_No__c = 'Test02',
- SFDA_Status__c = '鏈夊姽',
- Dealer_special_Object__c = true,
- Manual_Entry__c = false
- );
- insert new List<Product2>{ prod01, prod02 };
+ Product2 prod01 = new Product2(Name='Test01',ProductCode='Test01',Asset_Model_No__c = 'Test01',SFDA_Status__c = '鏈夊姽',Dealer_special_Object__c = true,Manual_Entry__c = false);
+ Product2 prod02 = new Product2(Name='Test02',ProductCode='Test02',Asset_Model_No__c = 'Test02',SFDA_Status__c = '鏈夊姽',Dealer_special_Object__c = true,Manual_Entry__c = false);
+ insert new Product2[] {prod01, prod02};
- Product2__c pro1 = new Product2__c(Name = 'Pro001', OT_CODE_Text__c = 'Test001', Product2__c = prod01.Id);
- Product2__c pro2 = new Product2__c(Name = 'Pro002', OT_CODE_Text__c = 'Test002', Product2__c = prod02.Id);
- insert new List<Product2__c>{ pro1, pro2 };
+ Product2__c pro1 = new Product2__c(Name='Pro001',OT_CODE_Text__c='Test001',Product2__c = prod01.Id);
+ Product2__c pro2 = new Product2__c(Name='Pro002',OT_CODE_Text__c='Test002',Product2__c = prod02.Id);
+ insert new Product2__c[] {pro1, pro2};
//鍙戠エ淇℃伅
Consumable_order__c invoiceorder = new Consumable_order__c();
- invoiceorder.Name = 'invoice01';
+ invoiceorder.Name='invoice01';
invoiceorder.Order_type__c = '鍙戠エ';
- invoiceorder.Invoice_status__c = '鑽夋涓�';
+ invoiceorder.Invoice_status__c='鑽夋涓�';
invoiceorder.Invoice_Date__c = Date.today();
invoiceorder.RecordTypeid = System.Label.RT_ConOrder_Invoice;
//invoiceorder.Order_ForHospital__c =hosp1.Id;
//invoiceorder.Order_ForDealer__c = agency1.Id;
- invoiceorder.Dealer_Info__c = acc.Id;
+ invoiceorder.Dealer_Info__c=acc.Id;
insert invoiceorder;
- invoiceorder = [
- SELECT id, Name
- FROM Consumable_order__c
- WHERE id = :invoiceorder.id
- ];
+ invoiceorder = [select id,Name from Consumable_order__c where id =:invoiceorder.id];
//鍑哄簱鍗�
//Consumable_order__c testList1 = new Consumable_order__c(Name='Test1',Summons_Sale_Status__c='鍑鸿揣',SummonsStatus_c__c='宸插畬鎴�',Order_ForHospital__c =hosp1.Id,SummonsForDirction__c='鐩存帴閿�鍞粰鍖婚櫌',Order_status__c='鑽夋涓�',Order_type__c='浼犵エ',Order_ForDealer__c = agency1.Id, Dealer_info__c=myAccount1.Id,ConInvoice_Code__c = invoiceorder.id);
//Consumable_order__c testList2 = new Consumable_order__c(Name='Test2',Summons_Sale_Status__c='鍑鸿揣',SummonsStatus_c__c='宸插畬鎴�',Order_ForHospital__c =hosp1.Id,SummonsForDirction__c='鐩存帴閿�鍞粰鍖婚櫌',Order_status__c='宸叉彁浜�',Order_type__c='浼犵エ',Order_ForDealer__c = agency1.Id, Dealer_info__c=myAccount1.Id,ConInvoice_Code__c = invoiceorder.id);
-
- Consumable_order__c testList1 = new Consumable_order__c(
- Name = 'Test1',
- Summons_Sale_Status__c = '鍑鸿揣',
- SummonsStatus_c__c = '宸插畬鎴�',
- SummonsForDirction__c = '鐩存帴閿�鍞粰鍖婚櫌',
- Order_status__c = '鑽夋涓�',
- Order_type__c = '浼犵エ',
- Dealer_info__c = acc.Id
- );
- Consumable_order__c testList2 = new Consumable_order__c(
- Name = 'Test2',
- Summons_Sale_Status__c = '鍑鸿揣',
- SummonsStatus_c__c = '宸插畬鎴�',
- SummonsForDirction__c = '鐩存帴閿�鍞粰鍖婚櫌',
- Order_status__c = '宸叉彁浜�',
- Order_type__c = '浼犵エ',
- Dealer_info__c = acc.Id
- );
+
+ Consumable_order__c testList1 = new Consumable_order__c(Name='Test1',Summons_Sale_Status__c='鍑鸿揣',
+ SummonsStatus_c__c='宸插畬鎴�',SummonsForDirction__c='鐩存帴閿�鍞粰鍖婚櫌',
+ Order_status__c='鑽夋涓�',Order_type__c='浼犵エ',
+ Dealer_info__c=acc.Id);
+ Consumable_order__c testList2 = new Consumable_order__c(Name='Test2',Summons_Sale_Status__c='鍑鸿揣',
+ SummonsStatus_c__c='宸插畬鎴�',SummonsForDirction__c='鐩存帴閿�鍞粰鍖婚櫌',
+ Order_status__c='宸叉彁浜�',Order_type__c='浼犵エ',
+ Dealer_info__c=acc.Id);
TestList1.Order_date__c = Date.today().addDays(2);
TestList2.Order_date__c = Date.today().addDays(2);
TestList1.Deliver_date__c = Date.today();
@@ -1018,17 +643,9 @@
insert testList2;
//insert new Consumable_order__c[]{testList1,testList2};
- Consumable_order_LinkTable__c order_LinkTable1 = new Consumable_order_LinkTable__c(
- Name = 'order_LinkTable1',
- Outboundorder_Code_link__c = testList1.Id,
- Invoice_Code_link__c = invoiceorder.Id
- );
+ Consumable_order_LinkTable__c order_LinkTable1 = new Consumable_order_LinkTable__c(Name='order_LinkTable1',Outboundorder_Code_link__c = testList1.Id,Invoice_Code_link__c =invoiceorder.Id);
insert order_LinkTable1;
- Consumable_order_LinkTable__c order_LinkTable2 = new Consumable_order_LinkTable__c(
- Name = 'order_LinkTable2',
- Outboundorder_Code_link__c = testList2.Id,
- Invoice_Code_link__c = invoiceorder.Id
- );
+ Consumable_order_LinkTable__c order_LinkTable2 = new Consumable_order_LinkTable__c(Name='order_LinkTable2',Outboundorder_Code_link__c = testList2.Id,Invoice_Code_link__c =invoiceorder.Id);
insert order_LinkTable2;
//鍑哄簱鍗�1鏄庣粏1
Consumable_orderdetails__c orderdet1 = new Consumable_orderdetails__c();
@@ -1057,7 +674,7 @@
orderdet3.Shipment_Count__c = 1;
orderdet3.Consumable_product__c = pro2.Id;
- //鍑哄簱鍗�2鏄庣粏2
+ //鍑哄簱鍗�2鏄庣粏2
Consumable_orderdetails__c orderdet4 = new Consumable_orderdetails__c();
orderdet4.Name = 'Test1_002002';
//orderdet2.Consumable_principal__c = testList2.Id;
@@ -1066,9 +683,9 @@
orderdet4.Consumable_count__c = 1;
orderdet4.Shipment_Count__c = 1;
orderdet4.Consumable_product__c = pro2.Id;
- insert new List<Consumable_orderdetails__c>{ orderdet1, orderdet2, orderdet3, orderdet4 };
- //闄勪欢
- Consumable_accessories_invoice__c caic = new Consumable_accessories_invoice__c();
+ insert new Consumable_orderdetails__c[]{orderdet1,orderdet2,orderdet3,orderdet4};
+ //闄勪欢
+ Consumable_accessories_invoice__c caic= new Consumable_accessories_invoice__c();
caic.Attachment_ID__c = acc.Id;
caic.Accessories_type__c = '鍙戠エ鍜屾槑缁�';
caic.Invoice_code__c = invoiceorder.id;
@@ -1081,42 +698,24 @@
// contest.deliveryId=testList1.id;
// conTest.invoiceId =invoiceorder.Id;
System.Test.startTest();
- LexConInvoiceViewController.init(invoiceorder.id, 'Redirect', testList2.Id);
+ LexConInvoiceViewController.init(invoiceorder.id,'Redirect',testList2.Id);
LexConInvoiceViewController conTest = new LexConInvoiceViewController();
- LexConInvoiceViewController.HospitalInfo = hosp1.id;
- LexConInvoiceViewController.SecondDealer = agency1.id;
- LexConInvoiceViewController.invoiceId = invoiceorder.Id;
- LexConInvoiceViewController.init(invoiceorder.Id, 'Redirect', testList1.Id);
- LexConInvoiceViewController.init(invoiceorder.Id, '', testList1.Id);
- LexConInvoiceViewController.init('', '', '');
- LexConInvoiceViewController.init('', '', testList1.Id);
- LexConInvoiceViewController.init('', 'Redirect', testList1.Id);
+ LexConInvoiceViewController.HospitalInfo = hosp1.id;
+ LexConInvoiceViewController.SecondDealer = agency1.id;
+ LexConInvoiceViewController.invoiceId = invoiceorder.Id;
+ LexConInvoiceViewController.init(invoiceorder.Id,'Redirect',testList1.Id);
+ LexConInvoiceViewController.init(invoiceorder.Id,'',testList1.Id);
+ LexConInvoiceViewController.init('','','');
+ LexConInvoiceViewController.init('','',testList1.Id);
+ LexConInvoiceViewController.init('','Redirect',testList1.Id);
String invoiceOrderRecoedschangeLwc = JSON.serialize(LexConInvoiceViewController.invoiceOrderRecoedschange);
String invoiceOrderRecoeds = JSON.serialize(LexConInvoiceViewController.invoiceOrderRecoeds);
- LexConInvoiceViewController.save(
- testList1,
- '娴庡畞浠诲煄鍎掓祹鍖婚櫌',
- hosp1.id,
- agency1.id,
- invoiceOrderRecoeds,
- testList1.Id,
- invoiceorder.Id,
- acc.Id,
- 'ET',
- '',
- invoiceOrderRecoedschangeLwc
- );
- LexConInvoiceViewController.InvoiceorderSearch(
- testList1,
- invoiceorder.Id,
- acc.Id,
- '閲嶅簡',
- 'ET',
- hosp1.id,
- agency1.id,
- invoiceOrderRecoeds
- );
+ LexConInvoiceViewController.save(testList1,'娴庡畞浠诲煄鍎掓祹鍖婚櫌',hosp1.id,agency1.id,invoiceOrderRecoeds,testList1.Id,invoiceorder.Id,acc.Id,'ET','',invoiceOrderRecoedschangeLwc);
+ LexConInvoiceViewController.InvoiceorderSearch(testList1,invoiceorder.Id,acc.Id,'閲嶅簡','ET',hosp1.id,agency1.id,invoiceOrderRecoeds);
+
+
+
// conTest.init();
@@ -1125,93 +724,55 @@
//System.assertEquals('invoice01', conTest.getInvoiceName());
//System.assertEquals(2, conTest.invoiceOrderRecoedsCount);
// conTest.InvoiceorderSearch();
-
+
// conTest.SortLimited();
System.Test.stopTest();
+
}
}
- static testMethod void conInvoiceViewTestoutOrderchange() {
+ static testMethod void conInvoiceViewTestoutOrderchange(){
user curUser = [SELECT Id FROM User WHERE LastName = 'TestUser' LIMIT 1];
- Account acc = [
- SELECT Id
- FROM Account
- WHERE name = 'Testaccount002'
- LIMIT 1
- ];
- Account hosp1 = [SELECT Id FROM Account WHERE name = 'Testhosp001' LIMIT 1];
- Account agency1 = [
- SELECT Id
- FROM Account
- WHERE name = 'Testhosp001'
- LIMIT 1
- ];
- Account agency2 = [
- SELECT Id
- FROM Account
- WHERE name = 'Testhosp002'
- LIMIT 1
- ];
- System.runAs(curUser) {
+ Account acc = [SELECT Id FROM Account WHERE name='Testaccount002' LIMIT 1];
+ Account hosp1 = [SELECT Id FROM Account WHERE name='Testhosp001' LIMIT 1];
+ Account agency1 = [SELECT Id FROM Account WHERE name='Testhosp001' LIMIT 1];
+ Account agency2 = [SELECT Id FROM Account WHERE name='Testhosp002' LIMIT 1];
+ system.runAs(curUser){
//浜у搧淇℃伅
- Product2 prod01 = new Product2(
- Name = 'Test01',
- ProductCode = 'Test01',
- Asset_Model_No__c = 'Test01',
- SFDA_Status__c = '鏈夊姽',
- Dealer_special_Object__c = true,
- Manual_Entry__c = false
- );
- Product2 prod02 = new Product2(
- Name = 'Test02',
- ProductCode = 'Test02',
- Asset_Model_No__c = 'Test02',
- SFDA_Status__c = '鏈夊姽',
- Dealer_special_Object__c = true,
- Manual_Entry__c = false
- );
- insert new List<Product2>{ prod01, prod02 };
+ Product2 prod01 = new Product2(Name='Test01',ProductCode='Test01',Asset_Model_No__c = 'Test01',SFDA_Status__c = '鏈夊姽',Dealer_special_Object__c = true,Manual_Entry__c = false);
+ Product2 prod02 = new Product2(Name='Test02',ProductCode='Test02',Asset_Model_No__c = 'Test02',SFDA_Status__c = '鏈夊姽',Dealer_special_Object__c = true,Manual_Entry__c = false);
+ insert new Product2[] {prod01, prod02};
- Product2__c pro1 = new Product2__c(Name = 'Pro001', OT_CODE_Text__c = 'Test001', Product2__c = prod01.Id);
- Product2__c pro2 = new Product2__c(Name = 'Pro002', OT_CODE_Text__c = 'Test002', Product2__c = prod02.Id);
- insert new List<Product2__c>{ pro1, pro2 };
+ Product2__c pro1 = new Product2__c(Name='Pro001',OT_CODE_Text__c='Test001',Product2__c = prod01.Id);
+ Product2__c pro2 = new Product2__c(Name='Pro002',OT_CODE_Text__c='Test002',Product2__c = prod02.Id);
+ insert new Product2__c[] {pro1, pro2};
//鍙戠エ淇℃伅
Consumable_order__c invoiceorder = new Consumable_order__c();
- invoiceorder.Name = 'invoice01';
+ invoiceorder.Name='invoice01';
invoiceorder.Order_type__c = '鍙戠エ';
- invoiceorder.Invoice_status__c = '鑽夋涓�';
+ invoiceorder.Invoice_status__c='鑽夋涓�';
invoiceorder.Invoice_Date__c = Date.today();
invoiceorder.RecordTypeid = System.Label.RT_ConOrder_Invoice;
//invoiceorder.Order_ForHospital__c =hosp1.Id;
//invoiceorder.Order_ForDealer__c = agency1.Id;
- invoiceorder.Dealer_Info__c = acc.Id;
+ invoiceorder.Dealer_Info__c=acc.Id;
insert invoiceorder;
- invoiceorder = [
- SELECT id, Name
- FROM Consumable_order__c
- WHERE id = :invoiceorder.id
- ];
+ invoiceorder = [select id,Name from Consumable_order__c where id =:invoiceorder.id];
//鍑哄簱鍗�
-
+
Consumable_order__c testList1 = new Consumable_order__c(
- Name = 'Test1',
- Summons_Sale_Status__c = '鍑鸿揣',
- SummonsStatus_c__c = '宸插畬鎴�',
- SummonsForDirction__c = '鐩存帴閿�鍞粰鍖婚櫌',
- Order_status__c = '鑽夋涓�',
- Order_type__c = '浼犵エ',
- Dealer_info__c = acc.Id
- );
+ Name='Test1',
+ Summons_Sale_Status__c='鍑鸿揣',
+ SummonsStatus_c__c='宸插畬鎴�',
+ SummonsForDirction__c='鐩存帴閿�鍞粰鍖婚櫌',
+ Order_status__c='鑽夋涓�',
+ Order_type__c='浼犵エ',
+ Dealer_info__c=acc.Id);
- Consumable_order__c testList2 = new Consumable_order__c(
- Name = 'Test2',
- Summons_Sale_Status__c = '鍑鸿揣',
- SummonsStatus_c__c = '宸插畬鎴�',
- SummonsForDirction__c = '鐩存帴閿�鍞粰鍖婚櫌',
- Order_status__c = '宸叉彁浜�',
- Order_type__c = '浼犵エ',
- Dealer_info__c = acc.Id
- );
+ Consumable_order__c testList2 = new Consumable_order__c(Name='Test2',Summons_Sale_Status__c='鍑鸿揣',
+ SummonsStatus_c__c='宸插畬鎴�',SummonsForDirction__c='鐩存帴閿�鍞粰鍖婚櫌',
+ Order_status__c='宸叉彁浜�',Order_type__c='浼犵エ',
+ Dealer_info__c=acc.Id);
TestList1.Order_date__c = Date.today().addDays(2);
TestList2.Order_date__c = Date.today().addDays(2);
TestList1.Deliver_date__c = Date.today();
@@ -1220,11 +781,7 @@
insert testList1;
insert testList2;
- Consumable_order_LinkTable__c order_LinkTable1 = new Consumable_order_LinkTable__c(
- Name = 'order_LinkTable1',
- Outboundorder_Code_link__c = testList1.Id,
- Invoice_Code_link__c = invoiceorder.Id
- );
+ Consumable_order_LinkTable__c order_LinkTable1 = new Consumable_order_LinkTable__c(Name='order_LinkTable1',Outboundorder_Code_link__c = testList1.Id,Invoice_Code_link__c =invoiceorder.Id);
insert order_LinkTable1;
//鍑哄簱鍗�1鏄庣粏1
@@ -1244,130 +801,71 @@
orderdet2.RecordTypeId = System.Label.RT_ConOrderDetail1_Invoice;
orderdet2.Consumable_count__c = 1;
orderdet2.Consumable_product__c = pro1.Id;
- insert new List<Consumable_orderdetails__c>{ orderdet1, orderdet2 };
+ insert new Consumable_orderdetails__c[]{orderdet1,orderdet2};
- LexConInvoiceViewController.init(invoiceorder.id, 'Redirect', testList2.Id);
+ LexConInvoiceViewController.init(invoiceorder.id,'Redirect',testList2.Id);
LexConInvoiceViewController conTest = new LexConInvoiceViewController();
- LexConInvoiceViewController.HospitalInfo = hosp1.id;
- LexConInvoiceViewController.SecondDealer = agency1.id;
- LexConInvoiceViewController.invoiceId = invoiceorder.Id;
- LexConInvoiceViewController.init(invoiceorder.Id, 'Redirect', testList1.Id);
- LexConInvoiceViewController.init(invoiceorder.Id, '', testList1.Id);
- LexConInvoiceViewController.init('', '', '');
- LexConInvoiceViewController.init('', '', testList1.Id);
- LexConInvoiceViewController.init('', 'Redirect', testList1.Id);
+ LexConInvoiceViewController.HospitalInfo = hosp1.id;
+ LexConInvoiceViewController.SecondDealer = agency1.id;
+ LexConInvoiceViewController.invoiceId = invoiceorder.Id;
+ LexConInvoiceViewController.init(invoiceorder.Id,'Redirect',testList1.Id);
+ LexConInvoiceViewController.init(invoiceorder.Id,'',testList1.Id);
+ LexConInvoiceViewController.init('','','');
+ LexConInvoiceViewController.init('','',testList1.Id);
+ LexConInvoiceViewController.init('','Redirect',testList1.Id);
String invoiceOrderRecoedschangeLwc = JSON.serialize(LexConInvoiceViewController.invoiceOrderRecoedschange);
String invoiceOrderRecoeds = JSON.serialize(LexConInvoiceViewController.invoiceOrderRecoeds);
- LexConInvoiceViewController.save(
- testList1,
- '娴庡畞浠诲煄鍎掓祹鍖婚櫌',
- hosp1.id,
- agency1.id,
- invoiceOrderRecoeds,
- testList1.Id,
- invoiceorder.Id,
- acc.Id,
- 'ET',
- '',
- invoiceOrderRecoedschangeLwc
- );
- LexConInvoiceViewController.InvoiceorderSearch(
- testList1,
- invoiceorder.Id,
- acc.Id,
- '閲嶅簡',
- 'ET',
- hosp1.id,
- agency1.id,
- invoiceOrderRecoeds
- );
+ LexConInvoiceViewController.save(testList1,'娴庡畞浠诲煄鍎掓祹鍖婚櫌',hosp1.id,agency1.id,invoiceOrderRecoeds,testList1.Id,invoiceorder.Id,acc.Id,'ET','',invoiceOrderRecoedschangeLwc);
+ LexConInvoiceViewController.InvoiceorderSearch(testList1,invoiceorder.Id,acc.Id,'閲嶅簡','ET',hosp1.id,agency1.id,invoiceOrderRecoeds);
System.Test.stopTest();
+
}
}
- static testMethod void conInvoiceViewTestgetdefaultMapinfo() {
+ static testMethod void conInvoiceViewTestgetdefaultMapinfo(){
user curUser = [SELECT Id FROM User WHERE LastName = 'TestUser' LIMIT 1];
- Account acc = [
- SELECT Id
- FROM Account
- WHERE name = 'Testaccount002'
- LIMIT 1
- ];
- Account hosp1 = [SELECT Id FROM Account WHERE name = 'Testhosp001' LIMIT 1];
- Account agency1 = [
- SELECT Id
- FROM Account
- WHERE name = 'Testhosp001'
- LIMIT 1
- ];
- Account agency2 = [
- SELECT Id
- FROM Account
- WHERE name = 'Testhosp002'
- LIMIT 1
- ];
- System.runAs(curUser) {
+ Account acc = [SELECT Id FROM Account WHERE name='Testaccount002' LIMIT 1];
+ Account hosp1 = [SELECT Id FROM Account WHERE name='Testhosp001' LIMIT 1];
+ Account agency1 = [SELECT Id FROM Account WHERE name='Testhosp001' LIMIT 1];
+ Account agency2 = [SELECT Id FROM Account WHERE name='Testhosp002' LIMIT 1];
+ system.runAs(curUser){
//浜у搧淇℃伅
- Product2 prod01 = new Product2(
- Name = 'Test01',
- ProductCode = 'Test01',
- Asset_Model_No__c = 'Test01',
- SFDA_Status__c = '鏈夊姽',
- Dealer_special_Object__c = true,
- Manual_Entry__c = false
- );
- Product2 prod02 = new Product2(
- Name = 'Test02',
- ProductCode = 'Test02',
- Asset_Model_No__c = 'Test02',
- SFDA_Status__c = '鏈夊姽',
- Dealer_special_Object__c = true,
- Manual_Entry__c = false
- );
- insert new List<Product2>{ prod01, prod02 };
+ Product2 prod01 = new Product2(Name='Test01',ProductCode='Test01',Asset_Model_No__c = 'Test01',SFDA_Status__c = '鏈夊姽',Dealer_special_Object__c = true,Manual_Entry__c = false);
+ Product2 prod02 = new Product2(Name='Test02',ProductCode='Test02',Asset_Model_No__c = 'Test02',SFDA_Status__c = '鏈夊姽',Dealer_special_Object__c = true,Manual_Entry__c = false);
+ insert new Product2[] {prod01, prod02};
- Product2__c pro1 = new Product2__c(Name = 'Pro001', OT_CODE_Text__c = 'Test001', Product2__c = prod01.Id);
- Product2__c pro2 = new Product2__c(Name = 'Pro002', OT_CODE_Text__c = 'Test002', Product2__c = prod02.Id);
- insert new List<Product2__c>{ pro1, pro2 };
+ Product2__c pro1 = new Product2__c(Name='Pro001',OT_CODE_Text__c='Test001',Product2__c = prod01.Id);
+ Product2__c pro2 = new Product2__c(Name='Pro002',OT_CODE_Text__c='Test002',Product2__c = prod02.Id);
+ insert new Product2__c[] {pro1, pro2};
//鍙戠エ淇℃伅
Consumable_order__c invoiceorder = new Consumable_order__c();
- invoiceorder.Name = 'invoice01';
+ invoiceorder.Name='invoice01';
invoiceorder.Order_type__c = '鍙戠エ';
- invoiceorder.Invoice_status__c = '鑽夋涓�';
+ invoiceorder.Invoice_status__c='鑽夋涓�';
invoiceorder.Invoice_Date__c = Date.today();
invoiceorder.RecordTypeid = System.Label.RT_ConOrder_Invoice;
//invoiceorder.Order_ForHospital__c =hosp1.Id;
// invoiceorder.Order_ForDealer__c = agency1.Id;
- invoiceorder.Dealer_Info__c = acc.Id;
+ invoiceorder.Dealer_Info__c=acc.Id;
insert invoiceorder;
- invoiceorder = [
- SELECT id, Name
- FROM Consumable_order__c
- WHERE id = :invoiceorder.id
- ];
+ invoiceorder = [select id,Name from Consumable_order__c where id =:invoiceorder.id];
//鍑哄簱鍗�
-
+
Consumable_order__c testList1 = new Consumable_order__c(
- Name = 'Test1',
- Summons_Sale_Status__c = '鍑鸿揣',
- SummonsStatus_c__c = '宸插畬鎴�',
- SummonsForDirction__c = '鐩存帴閿�鍞粰鍖婚櫌',
- Order_status__c = '鑽夋涓�',
- Order_type__c = '浼犵エ',
- Dealer_info__c = acc.Id
- );
+ Name='Test1',
+ Summons_Sale_Status__c='鍑鸿揣',
+ SummonsStatus_c__c='宸插畬鎴�',
+ SummonsForDirction__c='鐩存帴閿�鍞粰鍖婚櫌',
+ Order_status__c='鑽夋涓�',
+ Order_type__c='浼犵エ',
+ Dealer_info__c=acc.Id);
- Consumable_order__c testList2 = new Consumable_order__c(
- Name = 'Test2',
- Summons_Sale_Status__c = '鍑鸿揣',
- SummonsStatus_c__c = '宸插畬鎴�',
- SummonsForDirction__c = '鐩存帴閿�鍞粰鍖婚櫌',
- Order_status__c = '宸叉彁浜�',
- Order_type__c = '浼犵エ',
- Dealer_info__c = acc.Id
- );
+ Consumable_order__c testList2 = new Consumable_order__c(Name='Test2',Summons_Sale_Status__c='鍑鸿揣',
+ SummonsStatus_c__c='宸插畬鎴�',SummonsForDirction__c='鐩存帴閿�鍞粰鍖婚櫌',
+ Order_status__c='宸叉彁浜�',Order_type__c='浼犵エ',
+ Dealer_info__c=acc.Id);
TestList1.Order_date__c = Date.today().addDays(2);
TestList2.Order_date__c = Date.today().addDays(2);
TestList1.Deliver_date__c = Date.today();
@@ -1376,11 +874,7 @@
insert testList1;
insert testList2;
- Consumable_order_LinkTable__c order_LinkTable1 = new Consumable_order_LinkTable__c(
- Name = 'order_LinkTable1',
- Outboundorder_Code_link__c = testList1.Id,
- Invoice_Code_link__c = invoiceorder.Id
- );
+ Consumable_order_LinkTable__c order_LinkTable1 = new Consumable_order_LinkTable__c(Name='order_LinkTable1',Outboundorder_Code_link__c = testList1.Id,Invoice_Code_link__c =invoiceorder.Id);
insert order_LinkTable1;
//鍑哄簱鍗�1鏄庣粏1
@@ -1400,136 +894,73 @@
orderdet2.RecordTypeId = System.Label.RT_ConOrderDetail1_Invoice;
orderdet2.Consumable_count__c = 1;
orderdet2.Consumable_product__c = pro1.Id;
- insert new List<Consumable_orderdetails__c>{ orderdet1, orderdet2 };
+ insert new Consumable_orderdetails__c[]{orderdet1,orderdet2};
- PageReference page = new PageReference('/apex/ConInvoiceView?invoiceId=' + invoiceorder.Id + '&KeyWords=Redirect');
+ PageReference page = new PageReference('/apex/ConInvoiceView?invoiceId='+invoiceorder.Id+'&KeyWords=Redirect');
page.setRedirect(true);
System.Test.setCurrentPage(page);
- LexConInvoiceViewController.init(invoiceorder.id, 'Redirect', testList2.Id);
+
+ LexConInvoiceViewController.init(invoiceorder.id,'Redirect',testList2.Id);
LexConInvoiceViewController conTest = new LexConInvoiceViewController();
- LexConInvoiceViewController.HospitalInfo = hosp1.id;
- LexConInvoiceViewController.SecondDealer = agency1.id;
- LexConInvoiceViewController.invoiceId = invoiceorder.Id;
- LexConInvoiceViewController.init(invoiceorder.Id, 'Redirect', testList1.Id);
- LexConInvoiceViewController.init(invoiceorder.Id, '', testList1.Id);
- LexConInvoiceViewController.init('', '', '');
- LexConInvoiceViewController.init('', '', testList1.Id);
- LexConInvoiceViewController.init('', 'Redirect', testList1.Id);
+ LexConInvoiceViewController.HospitalInfo = hosp1.id;
+ LexConInvoiceViewController.SecondDealer = agency1.id;
+ LexConInvoiceViewController.invoiceId = invoiceorder.Id;
+ LexConInvoiceViewController.init(invoiceorder.Id,'Redirect',testList1.Id);
+ LexConInvoiceViewController.init(invoiceorder.Id,'',testList1.Id);
+ LexConInvoiceViewController.init('','','');
+ LexConInvoiceViewController.init('','',testList1.Id);
+ LexConInvoiceViewController.init('','Redirect',testList1.Id);
String invoiceOrderRecoedschangeLwc = JSON.serialize(LexConInvoiceViewController.invoiceOrderRecoedschange);
String invoiceOrderRecoeds = JSON.serialize(LexConInvoiceViewController.invoiceOrderRecoeds);
- LexConInvoiceViewController.save(
- testList1,
- '娴庡畞浠诲煄鍎掓祹鍖婚櫌',
- hosp1.id,
- agency1.id,
- invoiceOrderRecoeds,
- testList1.Id,
- invoiceorder.Id,
- acc.Id,
- 'ET',
- '',
- invoiceOrderRecoedschangeLwc
- );
- LexConInvoiceViewController.InvoiceorderSearch(
- testList1,
- invoiceorder.Id,
- acc.Id,
- '閲嶅簡',
- 'ET',
- hosp1.id,
- agency1.id,
- invoiceOrderRecoeds
- );
+ LexConInvoiceViewController.save(testList1,'娴庡畞浠诲煄鍎掓祹鍖婚櫌',hosp1.id,agency1.id,invoiceOrderRecoeds,testList1.Id,invoiceorder.Id,acc.Id,'ET','',invoiceOrderRecoedschangeLwc);
+ LexConInvoiceViewController.InvoiceorderSearch(testList1,invoiceorder.Id,acc.Id,'閲嶅簡','ET',hosp1.id,agency1.id,invoiceOrderRecoeds);
System.Test.stopTest();
}
}
- //浠庡嚭搴撳崟鐩存帴寮�绁�
- static testMethod void conInvoiceViewRedirectTest() {
- user curUser = [SELECT Id FROM User WHERE LastName = 'TestUser' LIMIT 1];
- Account acc = [
- SELECT Id
- FROM Account
- WHERE name = 'Testaccount002'
- LIMIT 1
- ];
- Account hosp1 = [SELECT Id FROM Account WHERE name = 'Testhosp001' LIMIT 1];
- Account agency1 = [
- SELECT Id
- FROM Account
- WHERE name = 'Testhosp001'
- LIMIT 1
- ];
- Account agency2 = [
- SELECT Id
- FROM Account
- WHERE name = 'Testhosp002'
- LIMIT 1
- ];
- System.runAs(curUser) {
+ //浠庡嚭搴撳崟鐩存帴寮�绁�
+ static testMethod void conInvoiceViewRedirectTest(){
+ user curUser = [SELECT Id FROM User WHERE LastName = 'TestUser' LIMIT 1];
+ Account acc = [SELECT Id FROM Account WHERE name='Testaccount002' LIMIT 1];
+ Account hosp1 = [SELECT Id FROM Account WHERE name='Testhosp001' LIMIT 1];
+ Account agency1 = [SELECT Id FROM Account WHERE name='Testhosp001' LIMIT 1];
+ Account agency2 = [SELECT Id FROM Account WHERE name='Testhosp002' LIMIT 1];
+ system.runAs(curUser){
//浜у搧淇℃伅
- Product2 prod01 = new Product2(
- Name = 'Test01',
- ProductCode = 'Test01',
- Asset_Model_No__c = 'Test01',
- SFDA_Status__c = '鏈夊姽',
- Dealer_special_Object__c = true,
- Manual_Entry__c = false
- );
- Product2 prod02 = new Product2(
- Name = 'Test02',
- ProductCode = 'Test02',
- Asset_Model_No__c = 'Test02',
- SFDA_Status__c = '鏈夊姽',
- Dealer_special_Object__c = true,
- Manual_Entry__c = false
- );
- insert new List<Product2>{ prod01, prod02 };
+ Product2 prod01 = new Product2(Name='Test01',ProductCode='Test01',Asset_Model_No__c = 'Test01',SFDA_Status__c = '鏈夊姽',Dealer_special_Object__c = true,Manual_Entry__c = false);
+ Product2 prod02 = new Product2(Name='Test02',ProductCode='Test02',Asset_Model_No__c = 'Test02',SFDA_Status__c = '鏈夊姽',Dealer_special_Object__c = true,Manual_Entry__c = false);
+ insert new Product2[] {prod01, prod02};
- Product2__c pro1 = new Product2__c(Name = 'Pro001', OT_CODE_Text__c = 'Test001', Product2__c = prod01.Id);
- Product2__c pro2 = new Product2__c(Name = 'Pro002', OT_CODE_Text__c = 'Test002', Product2__c = prod02.Id);
- insert new List<Product2__c>{ pro1, pro2 };
+ Product2__c pro1 = new Product2__c(Name='Pro001',OT_CODE_Text__c='Test001',Product2__c = prod01.Id);
+ Product2__c pro2 = new Product2__c(Name='Pro002',OT_CODE_Text__c='Test002',Product2__c = prod02.Id);
+ insert new Product2__c[] {pro1, pro2};
//鍙戠エ淇℃伅
Consumable_order__c invoiceorder = new Consumable_order__c();
- invoiceorder.Name = 'invoice01';
+ invoiceorder.Name='invoice01';
invoiceorder.Order_type__c = '鍙戠エ';
- invoiceorder.Invoice_status__c = '鑽夋涓�';
+ invoiceorder.Invoice_status__c='鑽夋涓�';
invoiceorder.Invoice_Date__c = Date.today();
invoiceorder.RecordTypeid = System.Label.RT_ConOrder_Invoice;
//invoiceorder.Order_ForHospital__c =hosp1.Id;
//invoiceorder.Order_ForDealer__c = agency1.Id;
- invoiceorder.Dealer_Info__c = acc.Id;
+ invoiceorder.Dealer_Info__c=acc.Id;
insert invoiceorder;
- invoiceorder = [
- SELECT id, Name
- FROM Consumable_order__c
- WHERE id = :invoiceorder.id
- ];
+ invoiceorder = [select id,Name from Consumable_order__c where id =:invoiceorder.id];
//鍑哄簱鍗�
//Consumable_order__c testList1 = new Consumable_order__c(Name='Test1',Summons_Sale_Status__c='鍑鸿揣',SummonsStatus_c__c='宸插畬鎴�',Order_ForHospital__c =hosp1.Id,SummonsForDirction__c='鐩存帴閿�鍞粰鍖婚櫌',Order_status__c='鑽夋涓�',Order_type__c='浼犵エ',Order_ForDealer__c = agency1.Id, Dealer_info__c=myAccount1.Id,ConInvoice_Code__c = invoiceorder.id);
//Consumable_order__c testList2 = new Consumable_order__c(Name='Test2',Summons_Sale_Status__c='鍑鸿揣',SummonsStatus_c__c='宸插畬鎴�',Order_ForHospital__c =hosp1.Id,SummonsForDirction__c='鐩存帴閿�鍞粰鍖婚櫌',Order_status__c='宸叉彁浜�',Order_type__c='浼犵エ',Order_ForDealer__c = agency1.Id, Dealer_info__c=myAccount1.Id,ConInvoice_Code__c = invoiceorder.id);
-
- Consumable_order__c testList1 = new Consumable_order__c(
- Name = 'Test1',
- Summons_Sale_Status__c = '鍑鸿揣',
- SummonsStatus_c__c = '宸插畬鎴�',
- SummonsForDirction__c = '鐩存帴閿�鍞粰鍖婚櫌',
- Order_status__c = '鑽夋涓�',
- Order_type__c = '浼犵エ',
- Dealer_info__c = acc.Id
- );
- Consumable_order__c testList2 = new Consumable_order__c(
- Name = 'Test2',
- Summons_Sale_Status__c = '鍑鸿揣',
- SummonsStatus_c__c = '宸插畬鎴�',
- SummonsForDirction__c = '鐩存帴閿�鍞粰鍖婚櫌',
- Order_status__c = '宸叉彁浜�',
- Order_type__c = '浼犵エ',
- Dealer_info__c = acc.Id
- );
+
+ Consumable_order__c testList1 = new Consumable_order__c(Name='Test1',Summons_Sale_Status__c='鍑鸿揣',
+ SummonsStatus_c__c='宸插畬鎴�',SummonsForDirction__c='鐩存帴閿�鍞粰鍖婚櫌',
+ Order_status__c='鑽夋涓�',Order_type__c='浼犵エ',
+ Dealer_info__c=acc.Id);
+ Consumable_order__c testList2 = new Consumable_order__c(Name='Test2',Summons_Sale_Status__c='鍑鸿揣',
+ SummonsStatus_c__c='宸插畬鎴�',SummonsForDirction__c='鐩存帴閿�鍞粰鍖婚櫌',
+ Order_status__c='宸叉彁浜�',Order_type__c='浼犵エ',
+ Dealer_info__c=acc.Id);
testList1.Order_date__c = Date.today().addDays(2);
testList2.Order_date__c = Date.today().addDays(2);
testList1.Deliver_date__c = Date.today();
@@ -1538,17 +969,9 @@
insert testList2;
//insert new Consumable_order__c[]{testList1,testList2};
- Consumable_order_LinkTable__c order_LinkTable1 = new Consumable_order_LinkTable__c(
- Name = 'order_LinkTable1',
- Outboundorder_Code_link__c = testList1.Id,
- Invoice_Code_link__c = invoiceorder.Id
- );
+ Consumable_order_LinkTable__c order_LinkTable1 = new Consumable_order_LinkTable__c(Name='order_LinkTable1',Outboundorder_Code_link__c = testList1.Id,Invoice_Code_link__c =invoiceorder.Id);
insert order_LinkTable1;
- Consumable_order_LinkTable__c order_LinkTable2 = new Consumable_order_LinkTable__c(
- Name = 'order_LinkTable2',
- Outboundorder_Code_link__c = testList2.Id,
- Invoice_Code_link__c = invoiceorder.Id
- );
+ Consumable_order_LinkTable__c order_LinkTable2 = new Consumable_order_LinkTable__c(Name='order_LinkTable2',Outboundorder_Code_link__c = testList2.Id,Invoice_Code_link__c =invoiceorder.Id);
insert order_LinkTable2;
//鍑哄簱鍗�1鏄庣粏1
Consumable_orderdetails__c orderdet1 = new Consumable_orderdetails__c();
@@ -1577,7 +1000,7 @@
orderdet3.Shipment_Count__c = 1;
orderdet3.Consumable_product__c = pro2.Id;
- //鍑哄簱鍗�2鏄庣粏2
+ //鍑哄簱鍗�2鏄庣粏2
Consumable_orderdetails__c orderdet4 = new Consumable_orderdetails__c();
orderdet4.Name = 'Test1_002002';
//orderdet2.Consumable_principal__c = testList2.Id;
@@ -1586,147 +1009,89 @@
orderdet4.Consumable_count__c = 1;
orderdet4.Shipment_Count__c = 1;
orderdet4.Consumable_product__c = pro2.Id;
- insert new List<Consumable_orderdetails__c>{ orderdet1, orderdet2, orderdet3, orderdet4 };
- //闄勪欢
- Consumable_accessories_invoice__c caic = new Consumable_accessories_invoice__c();
+ insert new Consumable_orderdetails__c[]{orderdet1,orderdet2,orderdet3,orderdet4};
+ //闄勪欢
+ Consumable_accessories_invoice__c caic= new Consumable_accessories_invoice__c();
caic.Attachment_ID__c = acc.Id;
caic.Accessories_type__c = '鍙戠エ鍜屾槑缁�';
caic.Invoice_code__c = invoiceorder.id;
insert caic;
- PageReference page = new PageReference('/apex/ConInvoiceView?deliveryId=' + testList1.Id + '&KeyWords=Redirect');
+ PageReference page = new PageReference('/apex/ConInvoiceView?deliveryId='+testList1.Id+'&KeyWords=Redirect');
page.setRedirect(true);
System.Test.setCurrentPage(page);
+
System.Test.startTest();
- LexConInvoiceViewController.init(invoiceorder.id, 'Redirect', testList2.Id);
+ LexConInvoiceViewController.init(invoiceorder.id,'Redirect',testList2.Id);
LexConInvoiceViewController conTest = new LexConInvoiceViewController();
- LexConInvoiceViewController.HospitalInfo = hosp1.id;
- LexConInvoiceViewController.SecondDealer = agency1.id;
- LexConInvoiceViewController.invoiceId = invoiceorder.Id;
- LexConInvoiceViewController.init(invoiceorder.Id, 'Redirect', testList1.Id);
- LexConInvoiceViewController.init(invoiceorder.Id, '', testList1.Id);
- LexConInvoiceViewController.init('', '', '');
- LexConInvoiceViewController.init('', '', testList1.Id);
- LexConInvoiceViewController.init('', 'Redirect', testList1.Id);
+ LexConInvoiceViewController.HospitalInfo = hosp1.id;
+ LexConInvoiceViewController.SecondDealer = agency1.id;
+ LexConInvoiceViewController.invoiceId = invoiceorder.Id;
+ LexConInvoiceViewController.init(invoiceorder.Id,'Redirect',testList1.Id);
+ LexConInvoiceViewController.init(invoiceorder.Id,'',testList1.Id);
+ LexConInvoiceViewController.init('','','');
+ LexConInvoiceViewController.init('','',testList1.Id);
+ LexConInvoiceViewController.init('','Redirect',testList1.Id);
String invoiceOrderRecoedschangeLwc = JSON.serialize(LexConInvoiceViewController.invoiceOrderRecoedschange);
String invoiceOrderRecoeds = JSON.serialize(LexConInvoiceViewController.invoiceOrderRecoeds);
- LexConInvoiceViewController.save(
- testList1,
- '娴庡畞浠诲煄鍎掓祹鍖婚櫌',
- hosp1.id,
- agency1.id,
- invoiceOrderRecoeds,
- testList1.Id,
- invoiceorder.Id,
- acc.Id,
- 'ET',
- '',
- invoiceOrderRecoedschangeLwc
- );
- LexConInvoiceViewController.InvoiceorderSearch(
- testList1,
- invoiceorder.Id,
- acc.Id,
- '閲嶅簡',
- 'ET',
- hosp1.id,
- agency1.id,
- invoiceOrderRecoeds
- );
- LexConInvoiceViewController.saveAttachment(JSON.serialize(LexConInvoiceViewController.attachmentRecoeds), invoiceorder.Id);
+ LexConInvoiceViewController.save(testList1,'娴庡畞浠诲煄鍎掓祹鍖婚櫌',hosp1.id,agency1.id,invoiceOrderRecoeds,testList1.Id,invoiceorder.Id,acc.Id,'ET','',invoiceOrderRecoedschangeLwc);
+ LexConInvoiceViewController.InvoiceorderSearch(testList1,invoiceorder.Id,acc.Id,'閲嶅簡','ET',hosp1.id,agency1.id,invoiceOrderRecoeds);
+ LexConInvoiceViewController.saveAttachment(JSON.serialize(LexConInvoiceViewController.attachmentRecoeds),invoiceorder.Id);
// LexConInvoiceViewController.saveAttachment(JSON.serialize(caic),invoiceorder.Id);
System.Test.stopTest();
}
}
+
//鎻愪氦
- static testMethod void conInvoiceViewTestapproval() {
+ static testMethod void conInvoiceViewTestapproval(){
user curUser = [SELECT Id FROM User WHERE LastName = 'TestUser' LIMIT 1];
- Account acc = [
- SELECT Id
- FROM Account
- WHERE name = 'Testaccount002'
- LIMIT 1
- ];
- Account hosp1 = [SELECT Id FROM Account WHERE name = 'Testhosp001' LIMIT 1];
- Account agency1 = [
- SELECT Id
- FROM Account
- WHERE name = 'Testhosp001'
- LIMIT 1
- ];
- Account agency2 = [
- SELECT Id
- FROM Account
- WHERE name = 'Testhosp002'
- LIMIT 1
- ];
- System.runAs(curUser) {
+ Account acc = [SELECT Id FROM Account WHERE name='Testaccount002' LIMIT 1];
+ Account hosp1 = [SELECT Id FROM Account WHERE name='Testhosp001' LIMIT 1];
+ Account agency1 = [SELECT Id FROM Account WHERE name='Testhosp001' LIMIT 1];
+ Account agency2 = [SELECT Id FROM Account WHERE name='Testhosp002' LIMIT 1];
+ system.runAs(curUser){
//浜у搧淇℃伅
- Product2 prod01 = new Product2(
- Name = 'Test01',
- ProductCode = 'Test01',
- Asset_Model_No__c = 'Test01',
- SFDA_Status__c = '鏈夊姽',
- Dealer_special_Object__c = true,
- Manual_Entry__c = false,
- Packing_list_manual__c = 5
- );
- Product2 prod02 = new Product2(
- Name = 'Test02',
- ProductCode = 'Test02',
- Asset_Model_No__c = 'Test02',
- SFDA_Status__c = '鏈夊姽',
- Dealer_special_Object__c = true,
- Manual_Entry__c = false
- );
- insert new List<Product2>{ prod01, prod02 };
+ Product2 prod01 = new Product2(Name='Test01',ProductCode='Test01',Asset_Model_No__c = 'Test01',SFDA_Status__c = '鏈夊姽',Dealer_special_Object__c = true,Manual_Entry__c = false,Packing_list_manual__c = 5);
+ Product2 prod02 = new Product2(Name='Test02',ProductCode='Test02',Asset_Model_No__c = 'Test02',SFDA_Status__c = '鏈夊姽',Dealer_special_Object__c = true,Manual_Entry__c = false);
+ insert new Product2[] {prod01, prod02};
- Product2__c pro1 = new Product2__c(Name = 'Pro001', OT_CODE_Text__c = 'Test001', Product2__c = prod01.Id);
- Product2__c pro2 = new Product2__c(Name = 'Pro002', OT_CODE_Text__c = 'Test002', Product2__c = prod02.Id);
- insert new List<Product2__c>{ pro1, pro2 };
+ Product2__c pro1 = new Product2__c(Name='Pro001',OT_CODE_Text__c='Test001',Product2__c = prod01.Id);
+ Product2__c pro2 = new Product2__c(Name='Pro002',OT_CODE_Text__c='Test002',Product2__c = prod02.Id);
+ insert new Product2__c[] {pro1, pro2};
//鍙戠エ淇℃伅
Consumable_order__c invoiceorder = new Consumable_order__c();
- invoiceorder.Name = 'invoice01';
+ invoiceorder.Name='invoice01';
invoiceorder.Order_type__c = '鍙戠エ';
- invoiceorder.Invoice_status__c = '鑽夋涓�';
+ invoiceorder.Invoice_status__c='鑽夋涓�';
invoiceorder.Invoice_Date__c = Date.today();
invoiceorder.RecordTypeid = System.Label.RT_ConOrder_Invoice;
//invoiceorder.Order_ForHospital__c =hosp1.Id;
//invoiceorder.Order_ForDealer__c = agency1.Id;
- invoiceorder.Dealer_Info__c = acc.Id;
+ invoiceorder.Dealer_Info__c=acc.Id;
insert invoiceorder;
- invoiceorder = [
- SELECT id, Name
- FROM Consumable_order__c
- WHERE id = :invoiceorder.id
- ];
+ invoiceorder = [select id,Name from Consumable_order__c where id =:invoiceorder.id];
//鍑哄簱鍗�
//Consumable_order__c testList1 = new Consumable_order__c(Name='Test1',Summons_Sale_Status__c='鍑鸿揣',SummonsStatus_c__c='宸插畬鎴�',Order_ForHospital__c =hosp1.Id,SummonsForDirction__c='鐩存帴閿�鍞粰鍖婚櫌',Order_status__c='鑽夋涓�',Order_type__c='浼犵エ',Order_ForDealer__c = agency1.Id, Dealer_info__c=myAccount1.Id,ConInvoice_Code__c = invoiceorder.id);
//Consumable_order__c testList2 = new Consumable_order__c(Name='Test2',Summons_Sale_Status__c='鍑鸿揣',SummonsStatus_c__c='宸插畬鎴�',Order_ForHospital__c =hosp1.Id,SummonsForDirction__c='鐩存帴閿�鍞粰鍖婚櫌',Order_status__c='宸叉彁浜�',Order_type__c='浼犵エ',Order_ForDealer__c = agency1.Id, Dealer_info__c=myAccount1.Id,ConInvoice_Code__c = invoiceorder.id);
-
- Consumable_order__c testList1 = new Consumable_order__c(
- Name = 'Test1',
- Summons_Sale_Status__c = '鍑鸿揣',
- SummonsStatus_c__c = '宸插畬鎴�',
- SummonsForDirction__c = '鐩存帴閿�鍞粰鍖婚櫌',
- Order_status__c = '鑽夋涓�',
- Order_type__c = '浼犵エ',
+
+ Consumable_order__c testList1 = new Consumable_order__c(Name='Test1',
+ Summons_Sale_Status__c='鍑鸿揣',
+ SummonsStatus_c__c='宸插畬鎴�',
+ SummonsForDirction__c='鐩存帴閿�鍞粰鍖婚櫌',
+ Order_status__c='鑽夋涓�',
+ Order_type__c='浼犵エ',
RecordTypeId = System.Label.RT_ConOrder_Sale,
- Dealer_info__c = acc.Id
- );
+ Dealer_info__c=acc.Id);
Consumable_order__c testList2 = new Consumable_order__c(
- Name = 'Test2',
- Summons_Sale_Status__c = '鍑鸿揣',
- SummonsStatus_c__c = '宸插畬鎴�',
- SummonsForDirction__c = '鐩存帴閿�鍞粰鍖婚櫌',
- Order_status__c = '宸叉彁浜�',
- Order_type__c = '浼犵エ',
+ Name='Test2',Summons_Sale_Status__c='鍑鸿揣',
+ SummonsStatus_c__c='宸插畬鎴�',
+ SummonsForDirction__c='鐩存帴閿�鍞粰鍖婚櫌',
+ Order_status__c='宸叉彁浜�',Order_type__c='浼犵エ',
RecordTypeId = System.Label.RT_ConOrder_Sale,
- Dealer_info__c = acc.Id
- );
+ Dealer_info__c=acc.Id);
testList1.Order_date__c = Date.today().addDays(2);
testList2.Order_date__c = Date.today().addDays(2);
testList1.Deliver_date__c = Date.today();
@@ -1734,18 +1099,11 @@
insert testList1;
insert testList2;
//insert new Consumable_order__c[]{testList1,testList2};
+
- Consumable_order_LinkTable__c order_LinkTable1 = new Consumable_order_LinkTable__c(
- Name = 'order_LinkTable1',
- Outboundorder_Code_link__c = testList1.Id,
- Invoice_Code_link__c = invoiceorder.Id
- );
+ Consumable_order_LinkTable__c order_LinkTable1 = new Consumable_order_LinkTable__c(Name='order_LinkTable1',Outboundorder_Code_link__c = testList1.Id,Invoice_Code_link__c =invoiceorder.Id);
insert order_LinkTable1;
- Consumable_order_LinkTable__c order_LinkTable2 = new Consumable_order_LinkTable__c(
- Name = 'order_LinkTable2',
- Outboundorder_Code_link__c = testList2.Id,
- Invoice_Code_link__c = invoiceorder.Id
- );
+ Consumable_order_LinkTable__c order_LinkTable2 = new Consumable_order_LinkTable__c(Name='order_LinkTable2',Outboundorder_Code_link__c = testList2.Id,Invoice_Code_link__c =invoiceorder.Id);
insert order_LinkTable2;
//鍑哄簱鍗�1鏄庣粏1
Consumable_Orderdetails__c orderdet1 = new Consumable_Orderdetails__c();
@@ -1762,6 +1120,9 @@
// orderdet1.Shipment_Count__c = 50;
// orderdet1.Invoiced_Procount__c = 5;
// orderdet1.RrturnPro_count__c = 5;
+
+
+
Consumable_Orderdetails__c orderdet12 = new Consumable_Orderdetails__c();
orderdet12.Name = 'Test1_001001';
@@ -1790,8 +1151,8 @@
orderdet3.Shipment_Count__c = 1;
orderdet3.Consumable_product__c = pro2.Id;
- //鍑哄簱鍗�2鏄庣粏2
- Consumable_Orderdetails__c orderdet4 = new Consumable_Orderdetails__c();
+ //鍑哄簱鍗�2鏄庣粏2
+ Consumable_Orderdetails__c orderdet4 = new Consumable_Orderdetails__c();
orderdet4.Name = 'Test1_002002';
//orderdet2.Consumable_principal__c = testList2.Id;
orderdet4.Consumable_order__c = testList2.id;
@@ -1799,14 +1160,14 @@
orderdet4.Consumable_count__c = 1;
orderdet4.Shipment_Count__c = 1;
orderdet4.Consumable_product__c = pro2.Id;
- insert new List<Consumable_Orderdetails__c>{ orderdet1, orderdet2, orderdet3, orderdet4, orderdet12 };
-
+ insert new Consumable_Orderdetails__c[]{orderdet1,orderdet2,orderdet3,orderdet4,orderdet12};
+
List<String> conorList = new List<String>();
conorList.add(testList1.Id);
// List<Consumable_Orderdetails__c> outOrderdet1List1 = new List<Consumable_Orderdetails__c>();
// outOrderdet1List1.add(orderdet1);
-
+
List<Consumable_Orderdetails__c> outOrderdet1List = [
SELECT
Id,
@@ -1831,8 +1192,8 @@
FROM Consumable_Orderdetails__c
WHERE Id = :orderdet1.Id
];
-
- System.debug('outOrderdet1List' + outOrderdet1List);
+
+ System.debug('outOrderdet1List'+outOrderdet1List);
List<Consumable_Orderdetails__c> outOrderdet1List1 = [
SELECT
Id,
@@ -1861,127 +1222,78 @@
Map<String, Consumable_Orderdetails__c> tempCocMap = new Map<String, Consumable_Orderdetails__c>();
Map<String, Consumable_Orderdetails__c> tempCocMap1 = new Map<String, Consumable_Orderdetails__c>();
for (Consumable_Orderdetails__c cocTemp : outOrderdet1List) {
- if (cocTemp.Consumable_order__c + cocTemp.Asset_Model_No__c != null) {
+ if(cocTemp.Consumable_order__c + cocTemp.Asset_Model_No__c!=null){
tempCocMap.put(cocTemp.Consumable_order__c + cocTemp.Asset_Model_No__c, cocTemp);
}
}
for (Consumable_Orderdetails__c cocTemp : outOrderdet1List1) {
- if (cocTemp.Consumable_order__c + cocTemp.Asset_Model_No__c != null) {
+ if(cocTemp.Consumable_order__c + cocTemp.Asset_Model_No__c!=null){
tempCocMap1.put(cocTemp.Consumable_order__c + cocTemp.Asset_Model_No__c, cocTemp);
}
}
- System.debug('tempCocMap===>' + tempCocMap);
- //闄勪欢
- Consumable_accessories_invoice__c caic = new Consumable_accessories_invoice__c();
+ System.debug('tempCocMap===>'+tempCocMap);
+ //闄勪欢
+ Consumable_accessories_invoice__c caic= new Consumable_accessories_invoice__c();
caic.Attachment_ID__c = acc.Id;
caic.Accessories_type__c = '鍙戠エ鍜屾槑缁�';
caic.Invoice_code__c = invoiceorder.id;
insert caic;
+
System.Test.startTest();
- LexConInvoiceViewController.init(invoiceorder.id, 'Redirect', testList2.Id);
+ LexConInvoiceViewController.init(invoiceorder.id,'Redirect',testList2.Id);
LexConInvoiceViewController conTest = new LexConInvoiceViewController();
- LexConInvoiceViewController.HospitalInfo = hosp1.id;
- LexConInvoiceViewController.SecondDealer = agency1.id;
- LexConInvoiceViewController.invoiceId = invoiceorder.Id;
- LexConInvoiceViewController.init(invoiceorder.Id, 'Redirect', testList1.Id);
- LexConInvoiceViewController.init(invoiceorder.Id, '', testList1.Id);
- LexConInvoiceViewController.init('', '', '');
- LexConInvoiceViewController.init('', '', testList1.Id);
- LexConInvoiceViewController.init('', 'Redirect', testList1.Id);
+ LexConInvoiceViewController.HospitalInfo = hosp1.id;
+ LexConInvoiceViewController.SecondDealer = agency1.id;
+ LexConInvoiceViewController.invoiceId = invoiceorder.Id;
+ LexConInvoiceViewController.init(invoiceorder.Id,'Redirect',testList1.Id);
+ LexConInvoiceViewController.init(invoiceorder.Id,'',testList1.Id);
+ LexConInvoiceViewController.init('','','');
+ LexConInvoiceViewController.init('','',testList1.Id);
+ LexConInvoiceViewController.init('','Redirect',testList1.Id);
String invoiceOrderRecoedschangeLwc = JSON.serialize(LexConInvoiceViewController.invoiceOrderRecoedschange);
String invoiceOrderRecoeds = JSON.serialize(LexConInvoiceViewController.invoiceOrderRecoeds);
- LexConInvoiceViewController.save(
- testList1,
- '娴庡畞浠诲煄鍎掓祹鍖婚櫌',
- hosp1.id,
- agency1.id,
- invoiceOrderRecoeds,
- testList1.Id,
- invoiceorder.Id,
- acc.Id,
- 'ET',
- '',
- invoiceOrderRecoedschangeLwc
- );
- LexConInvoiceViewController.InvoiceorderSearch(
- testList1,
- invoiceorder.Id,
- acc.Id,
- '閲嶅簡',
- 'ET',
- hosp1.id,
- agency1.id,
- invoiceOrderRecoeds
- );
- LexConInvoiceViewController.approval(conorList, tempCocMap, invoiceorder.id);
- LexConInvoiceViewController.approval(conorList, tempCocMap1, invoiceorder.id);
+ LexConInvoiceViewController.save(testList1,'娴庡畞浠诲煄鍎掓祹鍖婚櫌',hosp1.id,agency1.id,invoiceOrderRecoeds,testList1.Id,invoiceorder.Id,acc.Id,'ET','',invoiceOrderRecoedschangeLwc);
+ LexConInvoiceViewController.InvoiceorderSearch(testList1,invoiceorder.Id,acc.Id,'閲嶅簡','ET',hosp1.id,agency1.id,invoiceOrderRecoeds);
+ LexConInvoiceViewController.approval(conorList,tempCocMap,invoiceorder.id);
+ LexConInvoiceViewController.approval(conorList,tempCocMap1,invoiceorder.id);
System.Test.stopTest();
}
}
//鎻愪氦鍙戠エ
- static testMethod void conInvoice_approval() {
+ static testMethod void conInvoice_approval(){
user curUser = [SELECT Id FROM User WHERE LastName = 'TestUser' LIMIT 1];
- Account acc = [
- SELECT Id
- FROM Account
- WHERE name = 'Testaccount002'
- LIMIT 1
- ];
- Account agency1 = [
- SELECT Id
- FROM Account
- WHERE name = 'Testhosp001'
- LIMIT 1
- ];
- Account agency2 = [
- SELECT Id
- FROM Account
- WHERE name = 'Testhosp002'
- LIMIT 1
- ];
- Account hosp1 = [SELECT Id FROM Account WHERE name = 'Testhosp001' LIMIT 1];
+ Account acc = [SELECT Id FROM Account WHERE name='Testaccount002' LIMIT 1];
+ Account agency1 = [SELECT Id FROM Account WHERE name='Testhosp001' LIMIT 1];
+ Account agency2 = [SELECT Id FROM Account WHERE name='Testhosp002' LIMIT 1];
+ Account hosp1 = [SELECT Id FROM Account WHERE name='Testhosp001' LIMIT 1];
Oly_TriggerHandler.bypass('ConsumableAssetHander');
Oly_TriggerHandler.bypass('Oly_TriggerHandler');
- System.runAs(curUser) {
+ system.runAs(curUser){
//浜у搧淇℃伅
- Product2 prod01 = new Product2(
- Name = 'Test01',
- ProductCode = 'Test01',
- Asset_Model_No__c = 'Test01',
- SFDA_Status__c = '鏈夊姽',
- Dealer_special_Object__c = true,
- Manual_Entry__c = false
- );
- Product2 prod02 = new Product2(
- Name = 'Test02',
- ProductCode = 'Test02',
- Asset_Model_No__c = 'Test02',
- SFDA_Status__c = '鏈夊姽',
- Dealer_special_Object__c = true,
- Manual_Entry__c = false
- );
- insert new List<Product2>{ prod01, prod02 };
+ Product2 prod01 = new Product2(Name='Test01',ProductCode='Test01',Asset_Model_No__c = 'Test01',SFDA_Status__c = '鏈夊姽',Dealer_special_Object__c = true,Manual_Entry__c = false);
+ Product2 prod02 = new Product2(Name='Test02',ProductCode='Test02',Asset_Model_No__c = 'Test02',SFDA_Status__c = '鏈夊姽',Dealer_special_Object__c = true,Manual_Entry__c = false);
+ insert new Product2[] {prod01, prod02};
- Product2__c pro1 = new Product2__c(Name = 'Pro001', OT_CODE_Text__c = 'Test001', Product2__c = prod01.Id);
- Product2__c pro2 = new Product2__c(Name = 'Pro002', OT_CODE_Text__c = 'Test002', Product2__c = prod02.Id);
- insert new List<Product2__c>{ pro1, pro2 };
+ Product2__c pro1 = new Product2__c(Name='Pro001',OT_CODE_Text__c='Test001',Product2__c = prod01.Id);
+ Product2__c pro2 = new Product2__c(Name='Pro002',OT_CODE_Text__c='Test002',Product2__c = prod02.Id);
+ insert new Product2__c[] {pro1, pro2};
+
//鍑哄簱鍗�1
Consumable_order__c testList1 = new Consumable_order__c(
- Name = 'Test1',
- recordtypeid = System.Label.RT_ConOrder_Sale,
- Summons_Sale_Status__c = '鍑鸿揣',
- SummonsStatus_c__c = '宸插畬鎴�',
- SummonsForDirction__c = '鐩存帴閿�鍞粰鍖婚櫌',
- Order_status__c = '鑽夋涓�',
- Order_type__c = '浼犵エ',
- // Order_ForHospital__c=hosp1.Id,
- Dealer_Info__c = acc.Id
- );
+ Name='Test1',
+ recordtypeid = System.Label.RT_ConOrder_Sale,
+ Summons_Sale_Status__c='鍑鸿揣',
+ SummonsStatus_c__c='宸插畬鎴�',
+ SummonsForDirction__c='鐩存帴閿�鍞粰鍖婚櫌',
+ Order_status__c='鑽夋涓�',
+ Order_type__c='浼犵エ',
+ // Order_ForHospital__c=hosp1.Id,
+ Dealer_Info__c = acc.Id);
TestList1.Order_date__c = Date.today().addDays(2);
TestList1.Deliver_date__c = Date.today();
insert testList1;
@@ -1996,7 +1308,7 @@
orderdet1.Consumable_product__c = pro1.Id;
orderdet1.Shipment_Count__c = 50;
orderdet1.Invoiced_Procount__c = 5;
- orderdet1.RrturnPro_count__c = 5;
+ orderdet1.RrturnPro_count__c = 5;
insert orderdet1;
List<String> conorList = new List<String>();
conorList.add(testList1.Id);
@@ -2013,13 +1325,13 @@
//鍙戠エ淇℃伅
Consumable_order__c invoiceorder = new Consumable_order__c();
- invoiceorder.Name = 'invoice01';
+ invoiceorder.Name='invoice01';
invoiceorder.Order_type__c = '鍙戠エ';
- invoiceorder.Invoice_status__c = '鑽夋涓�';
+ invoiceorder.Invoice_status__c='鑽夋涓�';
invoiceorder.Invoice_Date__c = Date.today();
invoiceorder.RecordTypeid = System.Label.RT_ConOrder_Invoice;
// invoiceorder.Order_ForHospital__c =hosp1.Id;
- invoiceorder.Dealer_Info__c = acc.Id;
+ invoiceorder.Dealer_Info__c=acc.Id;
insert invoiceorder;
//鍙戠エ鏄庣粏1
@@ -2033,11 +1345,7 @@
invoicedet1.Invoicedet1_OD_link__c = testList1.Id;
insert invoicedet1;
- Consumable_order_LinkTable__c order_LinkTable1 = new Consumable_order_LinkTable__c(
- Name = 'order_LinkTable1',
- Outboundorder_Code_link__c = testList1.Id,
- Invoice_Code_link__c = invoiceorder.Id
- );
+ Consumable_order_LinkTable__c order_LinkTable1 = new Consumable_order_LinkTable__c(Name='order_LinkTable1',Outboundorder_Code_link__c = testList1.Id,Invoice_Code_link__c =invoiceorder.Id);
insert order_LinkTable1;
List<Consumable_Orderdetails__c> outOrderdet1List = [
SELECT
@@ -2065,155 +1373,97 @@
];
Map<String, Consumable_Orderdetails__c> tempCocMap1 = new Map<String, Consumable_Orderdetails__c>();
for (Consumable_Orderdetails__c cocTemp : outOrderdet1List) {
- if (cocTemp.Consumable_order__c + cocTemp.Asset_Model_No__c != null) {
+ if(cocTemp.Consumable_order__c + cocTemp.Asset_Model_No__c!=null){
tempCocMap1.put(cocTemp.Consumable_order__c + cocTemp.Asset_Model_No__c, cocTemp);
}
}
-
+
+
System.Test.startTest();
+
- LexConInvoiceViewController.init(invoiceorder.id, 'Redirect', orderdet1.Id);
+ LexConInvoiceViewController.init(invoiceorder.id,'Redirect',orderdet1.Id);
LexConInvoiceViewController conTest = new LexConInvoiceViewController();
- LexConInvoiceViewController.HospitalInfo = hosp1.id;
- LexConInvoiceViewController.SecondDealer = acc.id;
- LexConInvoiceViewController.invoiceId = invoiceorder.Id;
- LexConInvoiceViewController.init(invoiceorder.Id, 'Redirect', testList1.Id);
- LexConInvoiceViewController.init(invoiceorder.Id, '', testList1.Id);
- LexConInvoiceViewController.init('', '', '');
- LexConInvoiceViewController.init('', '', testList1.Id);
- LexConInvoiceViewController.init('', 'Redirect', testList1.Id);
+ LexConInvoiceViewController.HospitalInfo = hosp1.id;
+ LexConInvoiceViewController.SecondDealer = acc.id;
+ LexConInvoiceViewController.invoiceId = invoiceorder.Id;
+ LexConInvoiceViewController.init(invoiceorder.Id,'Redirect',testList1.Id);
+ LexConInvoiceViewController.init(invoiceorder.Id,'',testList1.Id);
+ LexConInvoiceViewController.init('','','');
+ LexConInvoiceViewController.init('','',testList1.Id);
+ LexConInvoiceViewController.init('','Redirect',testList1.Id);
String invoiceOrderRecoedschangeLwc = JSON.serialize(LexConInvoiceViewController.invoiceOrderRecoedschange);
String invoiceOrderRecoeds = JSON.serialize(LexConInvoiceViewController.invoiceOrderRecoeds);
- LexConInvoiceViewController.save(
- testList1,
- '娴庡畞浠诲煄鍎掓祹鍖婚櫌',
- hosp1.id,
- acc.id,
- invoiceOrderRecoeds,
- testList1.Id,
- invoiceorder.Id,
- acc.Id,
- 'ET',
- '',
- invoiceOrderRecoedschangeLwc
- );
- LexConInvoiceViewController.InvoiceorderSearch(
- testList1,
- invoiceorder.Id,
- acc.Id,
- '閲嶅簡',
- 'ET',
- hosp1.id,
- acc.id,
- invoiceOrderRecoeds
- );
- LexConInvoiceViewController.approval(conorList, tempCocMap1, invoiceorder.id);
- LexConInvoiceViewController.approval(conorList, tempCocMap1, '2345678');
+ LexConInvoiceViewController.save(testList1,'娴庡畞浠诲煄鍎掓祹鍖婚櫌',hosp1.id,acc.id,invoiceOrderRecoeds,testList1.Id,invoiceorder.Id,acc.Id,'ET','',invoiceOrderRecoedschangeLwc);
+ LexConInvoiceViewController.InvoiceorderSearch(testList1,invoiceorder.Id,acc.Id,'閲嶅簡','ET',hosp1.id,acc.id,invoiceOrderRecoeds);
+ LexConInvoiceViewController.approval(conorList,tempCocMap1,invoiceorder.id);
+ LexConInvoiceViewController.approval(conorList,tempCocMap1,'2345678');
+
+
+
+
// conTest.init();
// System.assertEquals(1, conTest.invoiceOrderRecoeds.size());
// conTest.approval();
System.Test.stopTest();
+
}
}
//CHAN-BSS5SQ update by rentongxiao 2020-08-26 start
//鏂板缓鍙戠エ 浠ュ強缂栬緫鍙戠エ invoiceId<>null
- static testMethod void rentestreopen() {
+ static testMethod void rentestreopen(){
user curUser = [SELECT Id FROM User WHERE LastName = 'TestUser' LIMIT 1];
- Account acc = [
- SELECT Id
- FROM Account
- WHERE name = 'Testaccount002'
- LIMIT 1
- ];
- Account hosp1 = [SELECT Id FROM Account WHERE name = 'Testhosp001' LIMIT 1];
- Account agency1 = [
- SELECT Id
- FROM Account
- WHERE name = 'Testhosp001'
- LIMIT 1
- ];
- Account agency2 = [
- SELECT Id
- FROM Account
- WHERE name = 'Testhosp002'
- LIMIT 1
- ];
- System.runAs(curUser) {
+ Account acc = [SELECT Id FROM Account WHERE name='Testaccount002' LIMIT 1];
+ Account hosp1 = [SELECT Id FROM Account WHERE name='Testhosp001' LIMIT 1];
+ Account agency1 = [SELECT Id FROM Account WHERE name='Testhosp001' LIMIT 1];
+ Account agency2 = [SELECT Id FROM Account WHERE name='Testhosp002' LIMIT 1];
+ system.runAs(curUser){
//浜у搧淇℃伅
- Product2 prod01 = new Product2(
- Name = 'Test01',
- ProductCode = 'Test01',
- Asset_Model_No__c = 'Test01',
- SFDA_Status__c = '鏈夊姽',
- Dealer_special_Object__c = true,
- Manual_Entry__c = false
- );
- Product2 prod02 = new Product2(
- Name = 'Test02',
- ProductCode = 'Test02',
- Asset_Model_No__c = 'Test02',
- SFDA_Status__c = '鏈夊姽',
- Dealer_special_Object__c = true,
- Manual_Entry__c = false
- );
- insert new List<Product2>{ prod01, prod02 };
+ Product2 prod01 = new Product2(Name='Test01',ProductCode='Test01',Asset_Model_No__c = 'Test01',SFDA_Status__c = '鏈夊姽',Dealer_special_Object__c = true,Manual_Entry__c = false);
+ Product2 prod02 = new Product2(Name='Test02',ProductCode='Test02',Asset_Model_No__c = 'Test02',SFDA_Status__c = '鏈夊姽',Dealer_special_Object__c = true,Manual_Entry__c = false);
+ insert new Product2[] {prod01, prod02};
- Product2__c pro1 = new Product2__c(Name = 'Pro001', OT_CODE_Text__c = 'Test001', Product2__c = prod01.Id);
- Product2__c pro2 = new Product2__c(Name = 'Pro002', OT_CODE_Text__c = 'Test002', Product2__c = prod02.Id);
- insert new List<Product2__c>{ pro1, pro2 };
+ Product2__c pro1 = new Product2__c(Name='Pro001',OT_CODE_Text__c='Test001',Product2__c = prod01.Id);
+ Product2__c pro2 = new Product2__c(Name='Pro002',OT_CODE_Text__c='Test002',Product2__c = prod02.Id);
+ insert new Product2__c[] {pro1, pro2};
//鍙戠エ淇℃伅
Consumable_order__c invoiceorder = new Consumable_order__c();
- invoiceorder.Name = 'invoice01';
+ invoiceorder.Name='invoice01';
invoiceorder.Order_type__c = '鍙戠エ';
- invoiceorder.Invoice_status__c = '鎻愪氦';
+ invoiceorder.Invoice_status__c='鎻愪氦';
invoiceorder.Invoice_Date__c = Date.today();
invoiceorder.RecordTypeid = System.Label.RT_ConOrder_Invoice;
//invoiceorder.Order_ForHospital__c =hosp1.Id;
//invoiceorder.Order_ForDealer__c = agency1.Id;
- invoiceorder.Dealer_Info__c = acc.Id;
+ invoiceorder.Dealer_Info__c=acc.Id;
//invoiceorder.Order_ProType__c = 'ET';
insert invoiceorder;
- invoiceorder = [
- SELECT id, Name
- FROM Consumable_order__c
- WHERE id = :invoiceorder.id
- ];
+ invoiceorder = [select id,Name from Consumable_order__c where id =:invoiceorder.id];
//鍑哄簱鍗�
-
+
Consumable_order__c testList1 = new Consumable_order__c(
- Name = 'Test1',
- Summons_Sale_Status__c = '鍑鸿揣',
- SummonsStatus_c__c = '宸插畬鎴�',
- SummonsForDirction__c = '鐩存帴閿�鍞粰鍖婚櫌',
- Order_status__c = '鑽夋涓�',
- Order_type__c = '浼犵エ',
- Dealer_info__c = acc.Id
- );
+ Name='Test1',
+ Summons_Sale_Status__c='鍑鸿揣',
+ SummonsStatus_c__c='宸插畬鎴�',
+ SummonsForDirction__c='鐩存帴閿�鍞粰鍖婚櫌',
+ Order_status__c='鑽夋涓�',
+ Order_type__c='浼犵エ',
+ Dealer_info__c=acc.Id);
- Consumable_order__c testList2 = new Consumable_order__c(
- Name = 'Test2',
- Summons_Sale_Status__c = '鍑鸿揣',
- SummonsStatus_c__c = '宸插畬鎴�',
- SummonsForDirction__c = '鐩存帴閿�鍞粰鍖婚櫌',
- Order_status__c = '宸叉彁浜�',
- Order_type__c = '浼犵エ',
- Dealer_info__c = acc.Id
- );
+ Consumable_order__c testList2 = new Consumable_order__c(Name='Test2',Summons_Sale_Status__c='鍑鸿揣',
+ SummonsStatus_c__c='宸插畬鎴�',SummonsForDirction__c='鐩存帴閿�鍞粰鍖婚櫌',
+ Order_status__c='宸叉彁浜�',Order_type__c='浼犵エ',
+ Dealer_info__c=acc.Id);
- Consumable_order__c testList3 = new Consumable_order__c(
- Name = 'Test2',
- Summons_Sale_Status__c = '鍑鸿揣',
- SummonsStatus_c__c = '宸插畬鎴�',
- SummonsForDirction__c = '鐩存帴閿�鍞粰鍖婚櫌',
- Order_status__c = '宸叉彁浜�',
- Order_type__c = '浼犵エ',
- Dealer_info__c = acc.Id
- );
+ Consumable_order__c testList3 = new Consumable_order__c(Name='Test2',Summons_Sale_Status__c='鍑鸿揣',
+ SummonsStatus_c__c='宸插畬鎴�',SummonsForDirction__c='鐩存帴閿�鍞粰鍖婚櫌',
+ Order_status__c='宸叉彁浜�',Order_type__c='浼犵エ',
+ Dealer_info__c=acc.Id);
TestList1.Order_date__c = Date.today().addDays(2);
TestList2.Order_date__c = Date.today().addDays(2);
TestList3.Order_date__c = Date.today().addDays(2);
@@ -2224,21 +1474,9 @@
insert testList2;
insert testList3;
System.Test.startTest();
- Consumable_order_LinkTable__c order_LinkTable1 = new Consumable_order_LinkTable__c(
- Name = 'order_LinkTable1',
- Outboundorder_Code_link__c = testList1.Id,
- Invoice_Code_link__c = invoiceorder.Id
- );
- Consumable_order_LinkTable__c order_LinkTable2 = new Consumable_order_LinkTable__c(
- Name = 'order_LinkTable1',
- Outboundorder_Code_link__c = testList2.Id,
- Invoice_Code_link__c = invoiceorder.Id
- );
- Consumable_order_LinkTable__c order_LinkTable3 = new Consumable_order_LinkTable__c(
- Name = 'order_LinkTable1',
- Outboundorder_Code_link__c = testList3.Id,
- Invoice_Code_link__c = invoiceorder.Id
- );
+ Consumable_order_LinkTable__c order_LinkTable1 = new Consumable_order_LinkTable__c(Name='order_LinkTable1',Outboundorder_Code_link__c = testList1.Id,Invoice_Code_link__c =invoiceorder.Id);
+ Consumable_order_LinkTable__c order_LinkTable2 = new Consumable_order_LinkTable__c(Name='order_LinkTable1',Outboundorder_Code_link__c = testList2.Id,Invoice_Code_link__c =invoiceorder.Id);
+ Consumable_order_LinkTable__c order_LinkTable3 = new Consumable_order_LinkTable__c(Name='order_LinkTable1',Outboundorder_Code_link__c = testList3.Id,Invoice_Code_link__c =invoiceorder.Id);
insert order_LinkTable1;
insert order_LinkTable2;
insert order_LinkTable3;
@@ -2260,7 +1498,7 @@
orderdet2.RecordTypeId = System.Label.RT_ConOrderDetail1_Invoice;
orderdet2.Consumable_count__c = 1;
orderdet2.Consumable_product__c = pro1.Id;
- insert new List<Consumable_orderdetails__c>{ orderdet1, orderdet2 };
+ insert new Consumable_orderdetails__c[]{orderdet1,orderdet2};
//鍑哄簱鍗�2鏄庣粏1
Consumable_orderdetails__c orderdet3 = new Consumable_orderdetails__c();
@@ -2282,53 +1520,33 @@
orderdet4.Consumable_product__c = pro1.Id;
insert orderdet4;
- PageReference page = new PageReference(
- '/apex/ConInvoiceView?invoiceId=' + invoiceorder.Id + '&reopen=isreopen&KeyWords=Redirect'
- );
+ PageReference page = new PageReference('/apex/ConInvoiceView?invoiceId='+invoiceorder.Id+'&reopen=isreopen&KeyWords=Redirect');
page.setRedirect(true);
System.Test.setCurrentPage(page);
- LexConInvoiceViewController.init(invoiceorder.id, 'Redirect', testList2.Id);
+ LexConInvoiceViewController.init(invoiceorder.id,'Redirect',testList2.Id);
LexConInvoiceViewController conTest = new LexConInvoiceViewController();
- LexConInvoiceViewController.HospitalInfo = hosp1.id;
- LexConInvoiceViewController.SecondDealer = agency1.id;
- LexConInvoiceViewController.invoiceId = invoiceorder.Id;
- LexConInvoiceViewController.init(invoiceorder.Id, 'Redirect', testList1.Id);
- LexConInvoiceViewController.init(invoiceorder.Id, '', testList1.Id);
- LexConInvoiceViewController.init('', '', '');
- LexConInvoiceViewController.init('', '', testList1.Id);
- LexConInvoiceViewController.init('', 'Redirect', testList1.Id);
+ LexConInvoiceViewController.HospitalInfo = hosp1.id;
+ LexConInvoiceViewController.SecondDealer = agency1.id;
+ LexConInvoiceViewController.invoiceId = invoiceorder.Id;
+ LexConInvoiceViewController.init(invoiceorder.Id,'Redirect',testList1.Id);
+ LexConInvoiceViewController.init(invoiceorder.Id,'',testList1.Id);
+ LexConInvoiceViewController.init('','','');
+ LexConInvoiceViewController.init('','',testList1.Id);
+ LexConInvoiceViewController.init('','Redirect',testList1.Id);
String invoiceOrderRecoedschangeLwc = JSON.serialize(LexConInvoiceViewController.invoiceOrderRecoedschange);
String invoiceOrderRecoeds = JSON.serialize(LexConInvoiceViewController.invoiceOrderRecoeds);
- LexConInvoiceViewController.save(
- testList1,
- '娴庡畞浠诲煄鍎掓祹鍖婚櫌',
- hosp1.id,
- agency1.id,
- invoiceOrderRecoeds,
- testList1.Id,
- invoiceorder.Id,
- acc.Id,
- 'ET',
- '',
- invoiceOrderRecoedschangeLwc
- );
- LexConInvoiceViewController.InvoiceorderSearch(
- testList1,
- invoiceorder.Id,
- acc.Id,
- '閲嶅簡',
- 'ET',
- hosp1.id,
- agency1.id,
- invoiceOrderRecoeds
- );
+ LexConInvoiceViewController.save(testList1,'娴庡畞浠诲煄鍎掓祹鍖婚櫌',hosp1.id,agency1.id,invoiceOrderRecoeds,testList1.Id,invoiceorder.Id,acc.Id,'ET','',invoiceOrderRecoedschangeLwc);
+ LexConInvoiceViewController.InvoiceorderSearch(testList1,invoiceorder.Id,acc.Id,'閲嶅簡','ET',hosp1.id,agency1.id,invoiceOrderRecoeds);
+
+
+
// ConInvoiceViewController conTest = new ConInvoiceViewController();
-
+
// conTest.init();
-
+
// conTest.invoiceId =invoiceorder.Id;
// conTest.coc.SummonsForDirction__c = '鐩存帴閿�鍞粰鍖婚櫌';
// conTest.HospitalInfo = hosp1.id;
@@ -2339,6 +1557,7 @@
// conTest.coc.Order_ForHospital__c = hosp1.id;
// conTest.coc.Invoice_Date__c = Date.today();
+
// //conTest.SortLimited();
// //conTest.InvoiceorderSearch();
// System.assertEquals(3, conTest.invoiceOrderRecoeds.size());
@@ -2350,10 +1569,11 @@
// conTest.invoiceOrderRecoeds[1].esd.Order_ForHospital__c =hosp1.Id;
// conTest.invoiceOrderRecoeds[1].esd.Order_ForDealer__c = agency1.id;
+
// conTest.invoiceOrderRecoeds[2].esd.Order_ForCustomerText__c = 'AA';
// conTest.invoiceOrderRecoeds[2].esd.Order_ForHospital__c =hosp1.Id;
// conTest.invoiceOrderRecoeds[2].esd.Order_ForDealer__c = agency1.id;
-
+
// conTest.invoiceOrderRecoeds[0].check= true;
// conTest.invoiceOrderRecoeds[1].check= false;
// conTest.invoiceOrderRecoeds[2].check= true;
@@ -2367,105 +1587,62 @@
// conTest.getExistOutbound();
// conTest.getInvoiceName();
System.Test.stopTest();
+
}
}
//CHAN-BSS5SQ update by rentongxiao 2020-08-26 end
- //CHAN-BSS5SQ update by rentongxiao 2020-08-26 start
+ //CHAN-BSS5SQ update by rentongxiao 2020-08-26 start
//鏂板缓鍙戠エ 浠ュ強缂栬緫鍙戠エ invoiceId<>null
- static testMethod void rentestreopen001() {
+ static testMethod void rentestreopen001(){
user curUser = [SELECT Id FROM User WHERE LastName = 'TestUser' LIMIT 1];
- Account acc = [
- SELECT Id
- FROM Account
- WHERE name = 'Testaccount002'
- LIMIT 1
- ];
- Account hosp1 = [SELECT Id FROM Account WHERE name = 'Testhosp001' LIMIT 1];
- Account agency1 = [
- SELECT Id
- FROM Account
- WHERE name = 'Testhosp001'
- LIMIT 1
- ];
- Account agency2 = [
- SELECT Id
- FROM Account
- WHERE name = 'Testhosp002'
- LIMIT 1
- ];
- System.runAs(curUser) {
+ Account acc = [SELECT Id FROM Account WHERE name='Testaccount002' LIMIT 1];
+ Account hosp1 = [SELECT Id FROM Account WHERE name='Testhosp001' LIMIT 1];
+ Account agency1 = [SELECT Id FROM Account WHERE name='Testhosp001' LIMIT 1];
+ Account agency2 = [SELECT Id FROM Account WHERE name='Testhosp002' LIMIT 1];
+ system.runAs(curUser){
//浜у搧淇℃伅
- Product2 prod01 = new Product2(
- Name = 'Test01',
- ProductCode = 'Test01',
- Asset_Model_No__c = 'Test01',
- SFDA_Status__c = '鏈夊姽',
- Dealer_special_Object__c = true,
- Manual_Entry__c = false
- );
- Product2 prod02 = new Product2(
- Name = 'Test02',
- ProductCode = 'Test02',
- Asset_Model_No__c = 'Test02',
- SFDA_Status__c = '鏈夊姽',
- Dealer_special_Object__c = true,
- Manual_Entry__c = false
- );
- insert new List<Product2>{ prod01, prod02 };
+ Product2 prod01 = new Product2(Name='Test01',ProductCode='Test01',Asset_Model_No__c = 'Test01',SFDA_Status__c = '鏈夊姽',Dealer_special_Object__c = true,Manual_Entry__c = false);
+ Product2 prod02 = new Product2(Name='Test02',ProductCode='Test02',Asset_Model_No__c = 'Test02',SFDA_Status__c = '鏈夊姽',Dealer_special_Object__c = true,Manual_Entry__c = false);
+ insert new Product2[] {prod01, prod02};
- Product2__c pro1 = new Product2__c(Name = 'Pro001', OT_CODE_Text__c = 'Test001', Product2__c = prod01.Id);
- Product2__c pro2 = new Product2__c(Name = 'Pro002', OT_CODE_Text__c = 'Test002', Product2__c = prod02.Id);
- insert new List<Product2__c>{ pro1, pro2 };
+ Product2__c pro1 = new Product2__c(Name='Pro001',OT_CODE_Text__c='Test001',Product2__c = prod01.Id);
+ Product2__c pro2 = new Product2__c(Name='Pro002',OT_CODE_Text__c='Test002',Product2__c = prod02.Id);
+ insert new Product2__c[] {pro1, pro2};
//鍙戠エ淇℃伅
Consumable_order__c invoiceorder = new Consumable_order__c();
- invoiceorder.Name = 'invoice01';
+ invoiceorder.Name='invoice01';
invoiceorder.Order_type__c = '鍙戠エ';
- invoiceorder.Invoice_status__c = '鎻愪氦';
+ invoiceorder.Invoice_status__c='鎻愪氦';
invoiceorder.Invoice_Date__c = Date.today();
invoiceorder.RecordTypeid = System.Label.RT_ConOrder_Invoice;
//invoiceorder.Order_ForHospital__c =hosp1.Id;
//invoiceorder.Order_ForDealer__c = agency1.Id;
- invoiceorder.Dealer_Info__c = acc.Id;
+ invoiceorder.Dealer_Info__c=acc.Id;
//invoiceorder.Order_ProType__c = 'ET';
insert invoiceorder;
- invoiceorder = [
- SELECT id, Name
- FROM Consumable_order__c
- WHERE id = :invoiceorder.id
- ];
+ invoiceorder = [select id,Name from Consumable_order__c where id =:invoiceorder.id];
//鍑哄簱鍗�
-
+
Consumable_order__c testList1 = new Consumable_order__c(
- Name = 'Test1',
- Summons_Sale_Status__c = '鍑鸿揣',
- SummonsStatus_c__c = '宸插畬鎴�',
- SummonsForDirction__c = '鐩存帴閿�鍞粰鍖婚櫌',
- Order_status__c = '鑽夋涓�',
- Order_type__c = '浼犵エ',
- Dealer_info__c = acc.Id
- );
+ Name='Test1',
+ Summons_Sale_Status__c='鍑鸿揣',
+ SummonsStatus_c__c='宸插畬鎴�',
+ SummonsForDirction__c='鐩存帴閿�鍞粰鍖婚櫌',
+ Order_status__c='鑽夋涓�',
+ Order_type__c='浼犵エ',
+ Dealer_info__c=acc.Id);
- Consumable_order__c testList2 = new Consumable_order__c(
- Name = 'Test2',
- Summons_Sale_Status__c = '鍑鸿揣',
- SummonsStatus_c__c = '宸插畬鎴�',
- SummonsForDirction__c = '鐩存帴閿�鍞粰鍖婚櫌',
- Order_status__c = '宸叉彁浜�',
- Order_type__c = '浼犵エ',
- Dealer_info__c = acc.Id
- );
+ Consumable_order__c testList2 = new Consumable_order__c(Name='Test2',Summons_Sale_Status__c='鍑鸿揣',
+ SummonsStatus_c__c='宸插畬鎴�',SummonsForDirction__c='鐩存帴閿�鍞粰鍖婚櫌',
+ Order_status__c='宸叉彁浜�',Order_type__c='浼犵エ',
+ Dealer_info__c=acc.Id);
- Consumable_order__c testList3 = new Consumable_order__c(
- Name = 'Test2',
- Summons_Sale_Status__c = '鍑鸿揣',
- SummonsStatus_c__c = '宸插畬鎴�',
- SummonsForDirction__c = '鐩存帴閿�鍞粰鍖婚櫌',
- Order_status__c = '宸叉彁浜�',
- Order_type__c = '浼犵エ',
- Dealer_info__c = acc.Id
- );
+ Consumable_order__c testList3 = new Consumable_order__c(Name='Test2',Summons_Sale_Status__c='鍑鸿揣',
+ SummonsStatus_c__c='宸插畬鎴�',SummonsForDirction__c='鐩存帴閿�鍞粰鍖婚櫌',
+ Order_status__c='宸叉彁浜�',Order_type__c='浼犵エ',
+ Dealer_info__c=acc.Id);
TestList1.Order_date__c = Date.today().addDays(2);
TestList2.Order_date__c = Date.today().addDays(2);
TestList3.Order_date__c = Date.today().addDays(2);
@@ -2476,21 +1653,9 @@
insert testList2;
insert testList3;
System.Test.startTest();
- Consumable_order_LinkTable__c order_LinkTable1 = new Consumable_order_LinkTable__c(
- Name = 'order_LinkTable1',
- Outboundorder_Code_link__c = testList1.Id,
- Invoice_Code_link__c = invoiceorder.Id
- );
- Consumable_order_LinkTable__c order_LinkTable2 = new Consumable_order_LinkTable__c(
- Name = 'order_LinkTable1',
- Outboundorder_Code_link__c = testList2.Id,
- Invoice_Code_link__c = invoiceorder.Id
- );
- Consumable_order_LinkTable__c order_LinkTable3 = new Consumable_order_LinkTable__c(
- Name = 'order_LinkTable1',
- Outboundorder_Code_link__c = testList3.Id,
- Invoice_Code_link__c = invoiceorder.Id
- );
+ Consumable_order_LinkTable__c order_LinkTable1 = new Consumable_order_LinkTable__c(Name='order_LinkTable1',Outboundorder_Code_link__c = testList1.Id,Invoice_Code_link__c =invoiceorder.Id);
+ Consumable_order_LinkTable__c order_LinkTable2 = new Consumable_order_LinkTable__c(Name='order_LinkTable1',Outboundorder_Code_link__c = testList2.Id,Invoice_Code_link__c =invoiceorder.Id);
+ Consumable_order_LinkTable__c order_LinkTable3 = new Consumable_order_LinkTable__c(Name='order_LinkTable1',Outboundorder_Code_link__c = testList3.Id,Invoice_Code_link__c =invoiceorder.Id);
insert order_LinkTable1;
insert order_LinkTable2;
insert order_LinkTable3;
@@ -2512,7 +1677,7 @@
orderdet2.RecordTypeId = System.Label.RT_ConOrderDetail1_Invoice;
orderdet2.Consumable_count__c = 1;
orderdet2.Consumable_product__c = pro1.Id;
- insert new List<Consumable_orderdetails__c>{ orderdet1, orderdet2 };
+ insert new Consumable_orderdetails__c[]{orderdet1,orderdet2};
//鍑哄簱鍗�2鏄庣粏1
Consumable_orderdetails__c orderdet3 = new Consumable_orderdetails__c();
@@ -2534,163 +1699,97 @@
orderdet4.Consumable_product__c = pro1.Id;
insert orderdet4;
- PageReference page = new PageReference(
- '/apex/ConInvoiceView?invoiceId=' + invoiceorder.Id + '&reopen=isreopen&KeyWords=Redirect'
- );
+ PageReference page = new PageReference('/apex/ConInvoiceView?invoiceId='+invoiceorder.Id+'&reopen=isreopen&KeyWords=Redirect');
page.setRedirect(true);
System.Test.setCurrentPage(page);
- LexConInvoiceViewController.init(invoiceorder.id, 'Redirect', testList2.Id);
+ LexConInvoiceViewController.init(invoiceorder.id,'Redirect',testList2.Id);
LexConInvoiceViewController conTest = new LexConInvoiceViewController();
- LexConInvoiceViewController.HospitalInfo = hosp1.id;
- LexConInvoiceViewController.SecondDealer = agency1.id;
- LexConInvoiceViewController.invoiceId = invoiceorder.Id;
- LexConInvoiceViewController.init(invoiceorder.Id, 'Redirect', testList1.Id);
- LexConInvoiceViewController.init(invoiceorder.Id, '', testList1.Id);
- LexConInvoiceViewController.init('', '', '');
- LexConInvoiceViewController.init('', '', testList1.Id);
- LexConInvoiceViewController.init('', 'Redirect', testList1.Id);
+ LexConInvoiceViewController.HospitalInfo = hosp1.id;
+ LexConInvoiceViewController.SecondDealer = agency1.id;
+ LexConInvoiceViewController.invoiceId = invoiceorder.Id;
+ LexConInvoiceViewController.init(invoiceorder.Id,'Redirect',testList1.Id);
+ LexConInvoiceViewController.init(invoiceorder.Id,'',testList1.Id);
+ LexConInvoiceViewController.init('','','');
+ LexConInvoiceViewController.init('','',testList1.Id);
+ LexConInvoiceViewController.init('','Redirect',testList1.Id);
String invoiceOrderRecoedschangeLwc = JSON.serialize(LexConInvoiceViewController.invoiceOrderRecoedschange);
String invoiceOrderRecoeds = JSON.serialize(LexConInvoiceViewController.invoiceOrderRecoeds);
- LexConInvoiceViewController.save(
- testList1,
- '娴庡畞浠诲煄鍎掓祹鍖婚櫌',
- hosp1.id,
- agency1.id,
- invoiceOrderRecoeds,
- testList1.Id,
- invoiceorder.Id,
- acc.Id,
- 'ET',
- '',
- invoiceOrderRecoedschangeLwc
- );
- LexConInvoiceViewController.InvoiceorderSearch(
- testList1,
- invoiceorder.Id,
- acc.Id,
- '閲嶅簡',
- 'ET',
- hosp1.id,
- agency1.id,
- invoiceOrderRecoeds
- );
+ LexConInvoiceViewController.save(testList1,'娴庡畞浠诲煄鍎掓祹鍖婚櫌',hosp1.id,agency1.id,invoiceOrderRecoeds,testList1.Id,invoiceorder.Id,acc.Id,'ET','',invoiceOrderRecoedschangeLwc);
+ LexConInvoiceViewController.InvoiceorderSearch(testList1,invoiceorder.Id,acc.Id,'閲嶅簡','ET',hosp1.id,agency1.id,invoiceOrderRecoeds);
System.Test.stopTest();
+
}
}
//鏂板缓鍙戠エ 浠ュ強缂栬緫鍙戠エ invoiceId<>null
- static testMethod void allinit() {
+ static testMethod void allinit(){
user curUser = [SELECT Id FROM User WHERE LastName = 'TestUser' LIMIT 1];
- Account acc = [
- SELECT Id
- FROM Account
- WHERE name = 'Testaccount002'
- LIMIT 1
- ];
- Account hosp1 = [SELECT Id FROM Account WHERE name = 'Testhosp001' LIMIT 1];
- Account agency1 = [
- SELECT Id
- FROM Account
- WHERE name = 'Testhosp001'
- LIMIT 1
- ];
- Account agency2 = [
- SELECT Id
- FROM Account
- WHERE name = 'Testhosp002'
- LIMIT 1
- ];
- System.runAs(curUser) {
+ Account acc = [SELECT Id FROM Account WHERE name='Testaccount002' LIMIT 1];
+ Account hosp1 = [SELECT Id FROM Account WHERE name='Testhosp001' LIMIT 1];
+ Account agency1 = [SELECT Id FROM Account WHERE name='Testhosp001' LIMIT 1];
+ Account agency2 = [SELECT Id FROM Account WHERE name='Testhosp002' LIMIT 1];
+ system.runAs(curUser){
//鍑嗗鏁版嵁
// Consumable_order__c Id = deliveryId //鍑哄簱鍗�
// Consumable_order__c
// WHERE Id = :invoiceId AND Order_type__c = '鍙戠エ'
- //浜у搧淇℃伅
- Product2 prod01 = new Product2(
- Name = 'Test01',
- ProductCode = 'Test01',
- Asset_Model_No__c = 'Test01',
- SFDA_Status__c = '鏈夊姽',
- Dealer_special_Object__c = true,
- Manual_Entry__c = false
- );
- Product2 prod02 = new Product2(
- Name = 'Test02',
- ProductCode = 'Test02',
- Asset_Model_No__c = 'Test02',
- SFDA_Status__c = '鏈夊姽',
- Dealer_special_Object__c = true,
- Manual_Entry__c = false
- );
- insert new List<Product2>{ prod01, prod02 };
-
- Product2__c pro1 = new Product2__c(Name = 'Pro001', OT_CODE_Text__c = 'Test001', Product2__c = prod01.Id);
- Product2__c pro2 = new Product2__c(Name = 'Pro002', OT_CODE_Text__c = 'Test002', Product2__c = prod02.Id);
- insert new List<Product2__c>{ pro1, pro2 };
- //鍙戠エ淇℃伅
+ //浜у搧淇℃伅
+ Product2 prod01 = new Product2(Name='Test01',ProductCode='Test01',Asset_Model_No__c = 'Test01',SFDA_Status__c = '鏈夊姽',Dealer_special_Object__c = true,Manual_Entry__c = false);
+ Product2 prod02 = new Product2(Name='Test02',ProductCode='Test02',Asset_Model_No__c = 'Test02',SFDA_Status__c = '鏈夊姽',Dealer_special_Object__c = true,Manual_Entry__c = false);
+ insert new Product2[] {prod01, prod02};
+
+ Product2__c pro1 = new Product2__c(Name='Pro001',OT_CODE_Text__c='Test001',Product2__c = prod01.Id);
+ Product2__c pro2 = new Product2__c(Name='Pro002',OT_CODE_Text__c='Test002',Product2__c = prod02.Id);
+ insert new Product2__c[] {pro1, pro2};
+ //鍙戠エ淇℃伅
Consumable_order__c invoiceorder = new Consumable_order__c();
- invoiceorder.Name = 'invoice01';
+ invoiceorder.Name='invoice01';
invoiceorder.Order_type__c = '鍙戠エ';
- invoiceorder.Invoice_status__c = '鑽夋涓�';
+ invoiceorder.Invoice_status__c='鑽夋涓�';
invoiceorder.Invoice_Date__c = Date.today();
invoiceorder.RecordTypeid = System.Label.RT_ConOrder_Invoice;
// invoiceorder.Order_ForHospital__c =hosp1.Id;
// invoiceorder.Order_ForDealer__c = agency1.Id;
- invoiceorder.Dealer_Info__c = acc.Id;
+ invoiceorder.Dealer_Info__c=acc.Id;
//invoiceorder.Order_ProType__c = 'ET';
insert invoiceorder;
- invoiceorder = [
- SELECT id, Name
- FROM Consumable_order__c
- WHERE id = :invoiceorder.id
- ];
+ invoiceorder = [select id,Name from Consumable_order__c where id =:invoiceorder.id];
//鍑哄簱鍗�
-
+
Consumable_order__c testList1 = new Consumable_order__c(
- Name = 'Test1',
- Summons_Sale_Status__c = '鍑鸿揣',
- SummonsStatus_c__c = '宸插畬鎴�',
- SummonsForDirction__c = '鐩存帴閿�鍞粰鍖婚櫌',
- Order_status__c = '鑽夋涓�',
- Order_type__c = '浼犵エ',
- Dealer_info__c = acc.Id
- );
+ Name='Test1',
+ Summons_Sale_Status__c='鍑鸿揣',
+ SummonsStatus_c__c='宸插畬鎴�',
+ SummonsForDirction__c='鐩存帴閿�鍞粰鍖婚櫌',
+ Order_status__c='鑽夋涓�',
+ Order_type__c='浼犵エ',
+ Dealer_info__c=acc.Id);
- Consumable_order__c testList2 = new Consumable_order__c(
- Name = 'Test2',
- Summons_Sale_Status__c = '鍑鸿揣',
- SummonsStatus_c__c = '宸插畬鎴�',
- SummonsForDirction__c = '鐩存帴閿�鍞粰鍖婚櫌',
- Order_status__c = '宸叉彁浜�',
- Order_type__c = '浼犵エ',
- Dealer_info__c = acc.Id,
- Order_ForCustomerText__c = ''
- );
+ Consumable_order__c testList2 = new Consumable_order__c(Name='Test2',Summons_Sale_Status__c='鍑鸿揣',
+ SummonsStatus_c__c='宸插畬鎴�',SummonsForDirction__c='鐩存帴閿�鍞粰鍖婚櫌',
+ Order_status__c='宸叉彁浜�',Order_type__c='浼犵エ',
+ Dealer_info__c=acc.Id,Order_ForCustomerText__c = '');
TestList1.Order_date__c = Date.today().addDays(2);
TestList2.Order_date__c = Date.today().addDays(2);
TestList1.Deliver_date__c = Date.today();
TestList2.Deliver_date__c = Date.today();
Consumable_order__c testList3 = new Consumable_order__c();
- testList3.Summons_Sale_Status__c = '鍑鸿揣';
- testList3.SummonsStatus_c__c = '宸插畬鎴�';
- testList3.SummonsForDirction__c = '鐩存帴閿�鍞粰鍖婚櫌';
- testList3.Order_status__c = '鑽夋涓�';
- testList3.Order_type__c = '浼犵エ';
- testList3.Dealer_info__c = acc.Id;
+ testList3.Summons_Sale_Status__c='鍑鸿揣';
+ testList3.SummonsStatus_c__c='宸插畬鎴�';
+ testList3.SummonsForDirction__c='鐩存帴閿�鍞粰鍖婚櫌';
+ testList3.Order_status__c='鑽夋涓�';
+ testList3.Order_type__c='浼犵エ';
+ testList3.Dealer_info__c=acc.Id;
testList3.Order_ForCustomerText__c = '娑堝寲绉�';
insert testList1;
insert testList2;
insert testList3;
- Consumable_order_LinkTable__c order_LinkTable1 = new Consumable_order_LinkTable__c(
- Name = 'order_LinkTable1',
- Outboundorder_Code_link__c = testList1.Id,
- Invoice_Code_link__c = invoiceorder.Id
- );
+ Consumable_order_LinkTable__c order_LinkTable1 = new Consumable_order_LinkTable__c(Name='order_LinkTable1',Outboundorder_Code_link__c = testList1.Id,Invoice_Code_link__c =invoiceorder.Id);
insert order_LinkTable1;
//鍑哄簱鍗�1鏄庣粏1
@@ -2718,7 +1817,7 @@
orderdet3.RecordTypeId = System.Label.RT_ConOrderDetail1_Invoice;
orderdet3.Consumable_count__c = 1;
orderdet3.Consumable_product__c = pro1.Id;
- insert new List<Consumable_orderdetails__c>{ orderdet1, orderdet2, orderdet3 };
+ insert new Consumable_orderdetails__c[]{orderdet1,orderdet2,orderdet3};
//鍙戠エ闄勪欢
Consumable_accessories_invoice__c cai = new Consumable_accessories_invoice__c();
@@ -2727,970 +1826,565 @@
System.Test.startTest();
- LexConInvoiceViewController.init(invoiceorder.Id, '', testList1.Id);
- LexConInvoiceViewController.init('', '', testList1.Id);
- LexConInvoiceViewController.init(invoiceorder.Id, '', '');
- LexConInvoiceViewController.init('', '', '');
- LexConInvoiceViewController.init(invoiceorder.Id, 'Redirect', testList1.Id);
- LexConInvoiceViewController.init('', 'Redirect', '');
- LexConInvoiceViewController.init('', 'Redirect', testList1.Id);
- System.debug('order==>' + LexConInvoiceViewController.invoiceOrderRecoeds);
+ LexConInvoiceViewController.init(invoiceorder.Id,'',testList1.Id);
+ LexConInvoiceViewController.init('','',testList1.Id);
+ LexConInvoiceViewController.init(invoiceorder.Id,'','');
+ LexConInvoiceViewController.init('','','');
+ LexConInvoiceViewController.init(invoiceorder.Id,'Redirect',testList1.Id);
+ LexConInvoiceViewController.init('','Redirect','');
+ LexConInvoiceViewController.init('','Redirect',testList1.Id);
+ System.debug('order==>'+LexConInvoiceViewController.invoiceOrderRecoeds);
+
String invoiceOrderRecoedschangeLwc = JSON.serialize(LexConInvoiceViewController.invoiceOrderRecoedschange);
String invoiceOrderRecoeds = JSON.serialize(LexConInvoiceViewController.invoiceOrderRecoeds);
- LexConInvoiceViewController.save(
- testList1,
- 'Testhosp001',
- hosp1.id,
- agency1.id,
- invoiceOrderRecoeds,
- testList1.Id,
- invoiceorder.Id,
- acc.Id,
- 'ET',
- '',
- invoiceOrderRecoedschangeLwc
- );
- LexConInvoiceViewController.save(
- testList2,
- 'Testhosp001',
- '',
- '',
- invoiceOrderRecoeds,
- testList1.Id,
- invoiceorder.Id,
- acc.Id,
- 'ET',
- '',
- invoiceOrderRecoedschangeLwc
- );
- LexConInvoiceViewController.save(
- testList3,
- 'Testhosp001',
- hosp1.id,
- agency1.id,
- invoiceOrderRecoeds,
- testList1.Id,
- invoiceorder.Id,
- acc.Id,
- 'ET',
- '',
- invoiceOrderRecoedschangeLwc
- );
- LexConInvoiceViewController.save(
- testList2,
- 'Testhosp001',
- hosp1.id,
- agency1.id,
- invoiceOrderRecoeds,
- testList1.Id,
- invoiceorder.Id,
- acc.Id,
- 'ET',
- '',
- invoiceOrderRecoedschangeLwc
- );
+ LexConInvoiceViewController.save(testList1,'Testhosp001',hosp1.id,agency1.id,invoiceOrderRecoeds,testList1.Id,invoiceorder.Id,acc.Id,'ET','',invoiceOrderRecoedschangeLwc);
+ LexConInvoiceViewController.save(testList2,'Testhosp001','','',invoiceOrderRecoeds,testList1.Id,invoiceorder.Id,acc.Id,'ET','',invoiceOrderRecoedschangeLwc);
+ LexConInvoiceViewController.save(testList3,'Testhosp001',hosp1.id,agency1.id,invoiceOrderRecoeds,testList1.Id,invoiceorder.Id,acc.Id,'ET','',invoiceOrderRecoedschangeLwc);
+ LexConInvoiceViewController.save(testList2,'Testhosp001',hosp1.id,agency1.id,invoiceOrderRecoeds,testList1.Id,invoiceorder.Id,acc.Id,'ET','',invoiceOrderRecoedschangeLwc);
//淇濆瓨
// LexConInvoiceViewController.save(testList1,'娴嬭瘯鍖婚櫌',hosp1.Id,agency1.Id,'',testList1.Id,invoiceorder.Id,myAccount1.Id,'ET');
System.Test.stopTest();
}
}
- static testMethod void allsave() {
+ static testMethod void allsave(){
user curUser = [SELECT Id FROM User WHERE LastName = 'TestUser' LIMIT 1];
- Account acc = [
- SELECT Id
- FROM Account
- WHERE name = 'Testaccount002'
- LIMIT 1
- ];
- Account hosp1 = [SELECT Id FROM Account WHERE name = 'Testhosp001' LIMIT 1];
- Account agency1 = [
- SELECT Id
- FROM Account
- WHERE name = 'Testhosp001'
- LIMIT 1
- ];
- Account agency2 = [
- SELECT Id
- FROM Account
- WHERE name = 'Testhosp002'
- LIMIT 1
- ];
- System.runAs(curUser) {
- //鍙戠エ淇℃伅
- Consumable_order__c invoiceorder = new Consumable_order__c();
- invoiceorder.Name = 'invoice01';
- invoiceorder.Order_type__c = '鍙戠エ';
- invoiceorder.Invoice_status__c = '鑽夋涓�';
- invoiceorder.Invoice_Date__c = Date.today();
- invoiceorder.RecordTypeid = System.Label.RT_ConOrder_Invoice;
- // invoiceorder.Order_ForHospital__c = '';
- // invoiceorder.Order_ForDealer__c = '';
- invoiceorder.Dealer_Info__c = acc.Id;
- //invoiceorder.Order_ProType__c = 'ET';
- insert invoiceorder;
+ Account acc = [SELECT Id FROM Account WHERE name='Testaccount002' LIMIT 1];
+ Account hosp1 = [SELECT Id FROM Account WHERE name='Testhosp001' LIMIT 1];
+ Account agency1 = [SELECT Id FROM Account WHERE name='Testhosp001' LIMIT 1];
+ Account agency2 = [SELECT Id FROM Account WHERE name='Testhosp002' LIMIT 1];
+ system.runAs(curUser){
- Consumable_order__c testList1 = new Consumable_order__c(
- Name = 'Test1',
- Summons_Sale_Status__c = '鍑鸿揣',
- SummonsStatus_c__c = '宸插畬鎴�',
- SummonsForDirction__c = '鐩存帴閿�鍞粰鍖婚櫌',
- Order_status__c = '鑽夋涓�',
- Order_type__c = '浼犵エ',
- Dealer_info__c = acc.Id,
- Invoice_Date__c = Date.today()
- );
- String invoiceOrderRecoedschangeLwc = JSON.serialize(LexConInvoiceViewController.invoiceOrderRecoedschange);
- String invoiceOrderRecoeds = JSON.serialize(LexConInvoiceViewController.invoiceOrderRecoeds);
- // LexConInvoiceViewController.init(invoiceorder.Id,'Redirect',testList1.Id);
- LexConInvoiceViewController.save(
- testList1,
- 'Testhosp001',
- null,
- null,
- invoiceOrderRecoeds,
- testList1.Id,
- invoiceorder.Id,
- acc.Id,
- 'ET',
- '',
- invoiceOrderRecoedschangeLwc
- );
- LexConInvoiceViewController.save(
- testList1,
- 'Testhosp001',
- hosp1.id,
- agency1.id,
- invoiceOrderRecoeds,
- testList1.Id,
- invoiceorder.Id,
- acc.Id,
- 'ET',
- '',
- invoiceOrderRecoedschangeLwc
- );
- LexConInvoiceViewController.saveAttachment(JSON.serialize(LexConInvoiceViewController.attachmentRecoeds), invoiceorder.Id);
+ //鍙戠エ淇℃伅
+ Consumable_order__c invoiceorder = new Consumable_order__c();
+ invoiceorder.Name='invoice01';
+ invoiceorder.Order_type__c = '鍙戠エ';
+ invoiceorder.Invoice_status__c='鑽夋涓�';
+ invoiceorder.Invoice_Date__c = Date.today();
+ invoiceorder.RecordTypeid = System.Label.RT_ConOrder_Invoice;
+ // invoiceorder.Order_ForHospital__c = '';
+ // invoiceorder.Order_ForDealer__c = '';
+ invoiceorder.Dealer_Info__c=acc.Id;
+ //invoiceorder.Order_ProType__c = 'ET';
+ insert invoiceorder;
+
+
+ Consumable_order__c testList1 = new Consumable_order__c(
+ Name='Test1',
+ Summons_Sale_Status__c='鍑鸿揣',
+ SummonsStatus_c__c='宸插畬鎴�',
+ SummonsForDirction__c='鐩存帴閿�鍞粰鍖婚櫌',
+ Order_status__c='鑽夋涓�',
+ Order_type__c='浼犵エ',
+ Dealer_info__c=acc.Id,
+ Invoice_Date__c = Date.today());
+ String invoiceOrderRecoedschangeLwc = JSON.serialize(LexConInvoiceViewController.invoiceOrderRecoedschange);
+ String invoiceOrderRecoeds = JSON.serialize(LexConInvoiceViewController.invoiceOrderRecoeds);
+ // LexConInvoiceViewController.init(invoiceorder.Id,'Redirect',testList1.Id);
+ LexConInvoiceViewController.save(testList1,'Testhosp001',null,null,invoiceOrderRecoeds,testList1.Id,invoiceorder.Id,acc.Id,'ET','',invoiceOrderRecoedschangeLwc);
+ LexConInvoiceViewController.save(testList1,'Testhosp001',hosp1.id,agency1.id,invoiceOrderRecoeds,testList1.Id,invoiceorder.Id,acc.Id,'ET','',invoiceOrderRecoedschangeLwc);
+ LexConInvoiceViewController.saveAttachment(JSON.serialize(LexConInvoiceViewController.attachmentRecoeds),invoiceorder.Id);
}
+}
+static testMethod void allsave1(){
+ user curUser = [SELECT Id FROM User WHERE LastName = 'TestUser' LIMIT 1];
+ Account acc = [SELECT Id FROM Account WHERE name='Testaccount002' LIMIT 1];
+ Account hosp1 = [SELECT Id FROM Account WHERE name='Testhosp001' LIMIT 1];
+ Account agency1 = [SELECT Id FROM Account WHERE name='Testhosp001' LIMIT 1];
+ Account agency2 = [SELECT Id FROM Account WHERE name='Testhosp002' LIMIT 1];
+ system.runAs(curUser){
+
+ //鍙戠エ淇℃伅
+ Consumable_order__c invoiceorder = new Consumable_order__c();
+ invoiceorder.Name='invoice01';
+ invoiceorder.Order_type__c = '鍙戠エ';
+ invoiceorder.Invoice_status__c='鑽夋涓�';
+ invoiceorder.Invoice_Date__c = Date.today();
+ invoiceorder.RecordTypeid = System.Label.RT_ConOrder_Invoice;
+ // invoiceorder.Order_ForHospital__c = '';
+ // invoiceorder.Order_ForDealer__c = '';
+ invoiceorder.Dealer_Info__c=acc.Id;
+ //invoiceorder.Order_ProType__c = 'ET';
+ insert invoiceorder;
+
+
+ Consumable_order__c testList1 = new Consumable_order__c(
+ Name='Test1',
+ Summons_Sale_Status__c='鍑鸿揣',
+ SummonsStatus_c__c='宸插畬鎴�',
+ SummonsForDirction__c='鐩存帴閿�鍞粰鍖婚櫌',
+ Order_status__c='鑽夋涓�',
+ Order_type__c='浼犵エ',
+ Dealer_info__c=acc.Id,
+ Invoice_Date__c = Date.today(),Order_ForCustomerText__c = '娑堝寲绉�');
+ insert testList1;
+ Consumable_order__c testList2 = new Consumable_order__c(
+ Name='Test1',
+ Summons_Sale_Status__c='鍑鸿揣',
+ SummonsStatus_c__c='宸插畬鎴�',
+ SummonsForDirction__c='鐩存帴閿�鍞粰鍖婚櫌',
+ Order_status__c='鑽夋涓�',
+ Order_type__c='浼犵エ',
+ Dealer_info__c=acc.Id,
+ Invoice_Date__c = Date.today(),Order_ForDealerText__c = 'Test');
+ insert testList2;
+
+
+ LexConInvoiceViewController.init(invoiceorder.Id,'Redirect',testList2.Id);
+ String invoiceOrderRecoedschangeLwc = JSON.serialize(LexConInvoiceViewController.invoiceOrderRecoedschange);
+ String invoiceOrderRecoeds = JSON.serialize(LexConInvoiceViewController.invoiceOrderRecoeds);
+ List<LexConInvoiceViewController.InvoiceOrderInfo> test1 = new List<LexConInvoiceViewController.InvoiceOrderInfo>();
+ for(LexConInvoiceViewController.InvoiceOrderInfo ass:LexConInvoiceViewController.invoiceOrderRecoeds){
+ ass.check = true;
+ test1.add(ass);
}
- static testMethod void allsave1() {
- user curUser = [SELECT Id FROM User WHERE LastName = 'TestUser' LIMIT 1];
- Account acc = [
- SELECT Id
- FROM Account
- WHERE name = 'Testaccount002'
- LIMIT 1
- ];
- Account hosp1 = [SELECT Id FROM Account WHERE name = 'Testhosp001' LIMIT 1];
- Account agency1 = [
- SELECT Id
- FROM Account
- WHERE name = 'Testhosp001'
- LIMIT 1
- ];
- Account agency2 = [
- SELECT Id
- FROM Account
- WHERE name = 'Testhosp002'
- LIMIT 1
- ];
- System.runAs(curUser) {
- //鍙戠エ淇℃伅
- Consumable_order__c invoiceorder = new Consumable_order__c();
- invoiceorder.Name = 'invoice01';
- invoiceorder.Order_type__c = '鍙戠エ';
- invoiceorder.Invoice_status__c = '鑽夋涓�';
- invoiceorder.Invoice_Date__c = Date.today();
- invoiceorder.RecordTypeid = System.Label.RT_ConOrder_Invoice;
- // invoiceorder.Order_ForHospital__c = '';
- // invoiceorder.Order_ForDealer__c = '';
- invoiceorder.Dealer_Info__c = acc.Id;
- //invoiceorder.Order_ProType__c = 'ET';
- insert invoiceorder;
-
- Consumable_order__c testList1 = new Consumable_order__c(
- Name = 'Test1',
- Summons_Sale_Status__c = '鍑鸿揣',
- SummonsStatus_c__c = '宸插畬鎴�',
- SummonsForDirction__c = '鐩存帴閿�鍞粰鍖婚櫌',
- Order_status__c = '鑽夋涓�',
- Order_type__c = '浼犵エ',
- Dealer_info__c = acc.Id,
- Invoice_Date__c = Date.today(),
- Order_ForCustomerText__c = '娑堝寲绉�'
- );
- insert testList1;
- Consumable_order__c testList2 = new Consumable_order__c(
- Name = 'Test1',
- Summons_Sale_Status__c = '鍑鸿揣',
- SummonsStatus_c__c = '宸插畬鎴�',
- SummonsForDirction__c = '鐩存帴閿�鍞粰鍖婚櫌',
- Order_status__c = '鑽夋涓�',
- Order_type__c = '浼犵エ',
- Dealer_info__c = acc.Id,
- Invoice_Date__c = Date.today(),
- Order_ForDealerText__c = 'Test'
- );
- insert testList2;
-
- LexConInvoiceViewController.init(invoiceorder.Id, 'Redirect', testList2.Id);
- String invoiceOrderRecoedschangeLwc = JSON.serialize(LexConInvoiceViewController.invoiceOrderRecoedschange);
- String invoiceOrderRecoeds = JSON.serialize(LexConInvoiceViewController.invoiceOrderRecoeds);
- List<LexConInvoiceViewController.InvoiceOrderInfo> test1 = new List<LexConInvoiceViewController.InvoiceOrderInfo>();
- for (LexConInvoiceViewController.InvoiceOrderInfo ass : LexConInvoiceViewController.invoiceOrderRecoeds) {
- ass.check = true;
- test1.add(ass);
- }
- System.debug('test1==>' + test1);
- System.debug('invoiceOrderRecoedschangeLwc==>' + invoiceOrderRecoedschangeLwc);
- LexConInvoiceViewController.save(
- testList1,
- 'Testhosp001',
- hosp1.id,
- agency1.id,
- invoiceOrderRecoeds,
- testList1.Id,
- invoiceorder.Id,
- acc.Id,
- 'ET',
- '',
- invoiceOrderRecoedschangeLwc
- );
- LexConInvoiceViewController.save(
- testList1,
- 'Testhosp001',
- '',
- '',
- JSON.serialize(test1),
- testList1.Id,
- invoiceorder.Id,
- acc.Id,
- 'ET',
- '',
- invoiceOrderRecoedschangeLwc
- );
- LexConInvoiceViewController.save(
- testList1,
- 'Testhosp001',
- '',
- '',
- JSON.serialize(test1),
- '',
- invoiceorder.Id,
- acc.Id,
- 'ET',
- '',
- invoiceOrderRecoedschangeLwc
- );
- LexConInvoiceViewController.save(
- testList1,
- '闈掑矝鐩堟捣鍖婚櫌',
- hosp1.id,
- agency1.id,
- '[{"check": true,"esd": {"Id": "a2K0l000000x1KXEAY","Order_ForHospital__c": "0011000001k1K9ZAAU","Name": "DB-FY2024-04-Z316244","Outbound_Date__c": "2023-06-09","ShipmentAccount__c": "闈掑矝鐩堟捣鍖婚櫌","Shipment_total_amount__c": 848,"RrturnPro_total_amount__c": 0,"Total_Invoiced_Procount__c": 0,"InvoiceNotPro_total_amount__c": 848,"InvoiceNotPro_money__c": 848,"Invoice_total_amount__c": 0,"Billed_Status__c": "杩樻病寮�绁�","Order_ForHospital__r": {"Name": "闈掑矝鐩堟捣鍖婚櫌","Id": "0011000001k1K9ZAAU"}},"needInvoiceCount": 0,"oldCheck": false}]',
- '',
- invoiceorder.Id,
- acc.Id,
- 'ET',
- '',
- invoiceOrderRecoedschangeLwc
- );
- LexConInvoiceViewController.save(
- testList1,
- '闈掑矝鐩堟捣鍖婚櫌',
- hosp1.id,
- agency1.id,
- '[{"check": true,"esd": {"Id": "a2K0l000000x1KXEAY","Order_ForHospital__c": "0011000001k1K9ZAAU","Name": "DB-FY2024-04-Z316244","Outbound_Date__c": "2023-06-09","ShipmentAccount__c": "闈掑矝鐩堟捣鍖婚櫌","Shipment_total_amount__c": 848,"RrturnPro_total_amount__c": 0,"Total_Invoiced_Procount__c": 0,"InvoiceNotPro_total_amount__c": 848,"InvoiceNotPro_money__c": 848,"Invoice_total_amount__c": 0,"Billed_Status__c": "杩樻病寮�绁�","Order_ForHospital__r": {"Name": "闈掑矝鐩堟捣鍖婚櫌","Id": "0011000001k1K9ZAAU"}},"needInvoiceCount": 0,"oldCheck": false}]',
- '',
- invoiceorder.Id,
- acc.Id,
- 'ET',
- '',
- invoiceOrderRecoedschangeLwc
- );
- }
- }
-
- static testMethod void allsave2() {
- user curUser = [SELECT Id FROM User WHERE LastName = 'TestUser' LIMIT 1];
- Account acc = [
- SELECT Id
- FROM Account
- WHERE name = 'Testaccount002'
- LIMIT 1
- ];
- Account hosp1 = [SELECT Id FROM Account WHERE name = 'Testhosp001' LIMIT 1];
- Account agency1 = [
- SELECT Id
- FROM Account
- WHERE name = 'Testhosp001'
- LIMIT 1
- ];
- Account agency2 = [
- SELECT Id
- FROM Account
- WHERE name = 'Testhosp002'
- LIMIT 1
- ];
- System.runAs(curUser) {
- //鍙戠エ淇℃伅
- Consumable_order__c invoiceorder = new Consumable_order__c();
- invoiceorder.Name = 'invoice01';
- invoiceorder.Order_type__c = '鍙戠エ';
- invoiceorder.Invoice_status__c = '鑽夋涓�';
- invoiceorder.Invoice_Date__c = Date.today();
- invoiceorder.RecordTypeid = System.Label.RT_ConOrder_Invoice;
- // invoiceorder.Order_ForHospital__c = '';
- // invoiceorder.Order_ForDealer__c = '';
- invoiceorder.Dealer_Info__c = acc.Id;
- //invoiceorder.Order_ProType__c = 'ET';
- insert invoiceorder;
-
- Consumable_order__c testList2 = new Consumable_order__c(
- Name = 'Test1',
- Summons_Sale_Status__c = '鍑鸿揣',
- SummonsStatus_c__c = '宸插畬鎴�',
- SummonsForDirction__c = '鐩存帴閿�鍞粰鍖婚櫌',
- Order_status__c = '鑽夋涓�',
- Order_type__c = '浼犵エ',
- Dealer_info__c = acc.Id,
- Invoice_Date__c = Date.today(),
- Order_ForDealerText__c = 'Test'
- );
- insert testList2;
- Consumable_order__c testList1 = new Consumable_order__c(
- Name = 'Test1',
- Summons_Sale_Status__c = '鍑鸿揣',
- SummonsStatus_c__c = '宸插畬鎴�',
- SummonsForDirction__c = '鐩存帴閿�鍞粰鍖婚櫌',
- Order_status__c = '鑽夋涓�',
- Order_type__c = '浼犵エ',
- Dealer_info__c = acc.Id
- );
- insert testList1;
- String invoiceOrderRecoedschangeLwc = JSON.serialize(LexConInvoiceViewController.invoiceOrderRecoedschange);
- //閫夋嫨寮�绁ㄥ崟
- LexConInvoiceViewController.save(
- testList2,
- '闈掑矝鐩堟捣鍖婚櫌',
- '',
- agency2.id,
- '[{"check": false,"esd": {"Id": "a2K0l000000x1KXEAY","Order_ForHospital__c": "0011000001k1K9ZAAU","Name": "DB-FY2024-04-Z316244","Outbound_Date__c": "2023-06-09","ShipmentAccount__c": "闈掑矝鐩堟捣鍖婚櫌","Shipment_total_amount__c": 848,"RrturnPro_total_amount__c": 0,"Total_Invoiced_Procount__c": 0,"InvoiceNotPro_total_amount__c": 848,"InvoiceNotPro_money__c": 848,"Invoice_total_amount__c": 0,"Billed_Status__c": "杩樻病寮�绁�","Order_ForHospital__r": {"Name": "闈掑矝鐩堟捣鍖婚櫌","Id": "0011000001k1K9ZAAU"}},"needInvoiceCount": 0,"oldCheck": false}]',
- '',
- invoiceorder.Id,
- acc.Id,
- 'ET',
- '',
- invoiceOrderRecoedschangeLwc
- );
- }
-
- }
-
- static testMethod void allsave3() {
- user curUser = [SELECT Id FROM User WHERE LastName = 'TestUser' LIMIT 1];
- Account acc = [
- SELECT Id
- FROM Account
- WHERE name = 'Testaccount002'
- LIMIT 1
- ];
- Account hosp1 = [SELECT Id FROM Account WHERE name = 'Testhosp001' LIMIT 1];
- Account agency1 = [
- SELECT Id
- FROM Account
- WHERE name = 'Testhosp001'
- LIMIT 1
- ];
- Account agency2 = [
- SELECT Id
- FROM Account
- WHERE name = 'Testhosp002'
- LIMIT 1
- ];
- System.runAs(curUser) {
- Product2 prod01 = new Product2(
- Name = 'Test01',
- ProductCode = 'Test01',
- Asset_Model_No__c = 'Test01',
- SFDA_Status__c = '鏈夊姽',
- Dealer_special_Object__c = true,
- Manual_Entry__c = false
- );
- Product2 prod02 = new Product2(
- Name = 'Test02',
- ProductCode = 'Test02',
- Asset_Model_No__c = 'Test02',
- SFDA_Status__c = '鏈夊姽',
- Dealer_special_Object__c = true,
- Manual_Entry__c = false
- );
- insert new List<Product2>{ prod01, prod02 };
-
- Product2__c pro1 = new Product2__c(Name = 'Pro001', OT_CODE_Text__c = 'Test001', Product2__c = prod01.Id);
- Product2__c pro2 = new Product2__c(Name = 'Pro002', OT_CODE_Text__c = 'Test002', Product2__c = prod02.Id);
- insert new List<Product2__c>{ pro1, pro2 };
-
- //鍙戠エ淇℃伅
- Consumable_order__c invoiceorder = new Consumable_order__c();
- invoiceorder.Name = '202306164590';
- invoiceorder.Invoice_Date__c = Date.today();
- invoiceorder.Order_ForCustomerText__c = '娑堝寲绉�';
- invoiceorder.Invoice_Note__c = '4444';
- invoiceorder.RecordTypeid = '012100000006JxEAAU';
- invoiceorder.Invoice_status__c = '鑽夋涓�';
- invoiceorder.Order_type__c = '鍙戠エ';
- // invoiceorder.Order_ForHospital__c = hosp1.Id;
- insert invoiceorder;
- // invoiceorder = [select id,Name from Consumable_order__c where id =:invoiceorder.id];
- Consumable_order__c testList2 = new Consumable_order__c(
- Name = 'Test1',
- Summons_Sale_Status__c = '鍑鸿揣',
- SummonsStatus_c__c = '宸插畬鎴�',
- SummonsForDirction__c = '鐩存帴閿�鍞粰鍖婚櫌',
- Order_status__c = '鑽夋涓�',
- Order_type__c = '浼犵エ',
- Dealer_info__c = acc.Id,
- Invoice_Date__c = Date.today()
- );
- insert testList2;
-
- List<Consumable_orderdetails__c> conList = new List<Consumable_orderdetails__c>();
- //鍑哄簱鍗�1鏄庣粏1
- Consumable_orderdetails__c orderdet1 = new Consumable_orderdetails__c();
- orderdet1.Name = 'Test1_001001';
- //orderdet1.Consumable_principal__c = testList1.Id;
- orderdet1.Consumable_order__c = invoiceorder.Id;
- orderdet1.RecordTypeId = System.Label.RT_ConOrderDetail1_Invoice;
- orderdet1.Consumable_count__c = 1;
- orderdet1.Consumable_product__c = pro1.Id;
- orderdet1.Shipment_Count__c = 10;
- orderdet1.Invoiced_Procount__c = 4;
- orderdet1.RrturnPro_count__c = 2;
- conList.add(orderdet1);
-
- String invoiceOrderRecoedschangeLwc = JSON.serialize(LexConInvoiceViewController.invoiceOrderRecoedschange);
- LexConInvoiceViewController.save(
- invoiceorder,
- '娼嶅煄鐜颁唬闂ㄨ瘖閮�',
- '0011000001g0uyhAAA',
- '',
- '[{"check": false,"esd": {"Id": "a2K0l000000x1KXEAY","Order_ForHospital__c": "0011000001k1K9ZAAU","Name": "DB-FY2024-04-Z316244","Outbound_Date__c": "2023-06-09","ShipmentAccount__c": "闈掑矝鐩堟捣鍖婚櫌","Shipment_total_amount__c": 848,"RrturnPro_total_amount__c": 0,"Total_Invoiced_Procount__c": 0,"InvoiceNotPro_total_amount__c": 848,"InvoiceNotPro_money__c": 848, "Invoice_total_amount__c": 0,"Billed_Status__c": "杩樻病寮�绁�","Order_ForHospital__r": {"Name": "闈掑矝鐩堟捣鍖婚櫌","Id": "0011000001k1K9ZAAU"}},"needInvoiceCount": 0,"oldCheck": false,"Id": "a2K0l000000x1KXEAY"}, {"check": true,"esd": {"Id": "a2K0l000000xAnwEAE","Order_ForHospital__c": "0011000001g0uyhAAA","Name": "a2K0l000000xAnw","Outbound_Date__c": "2023-05-12","ShipmentAccount__c": "娼嶅煄鐜颁唬闂ㄨ瘖閮�", "Shipment_total_amount__c": 2300,"RrturnPro_total_amount__c": 0,"Total_Invoiced_Procount__c": 0,"InvoiceNotPro_total_amount__c": 2300,"InvoiceNotPro_money__c": 2300,"Invoice_total_amount__c": 0,"Billed_Status__c": "杩樻病寮�绁�","Order_ForHospital__r": {"Name": "娼嶅煄鐜颁唬闂ㄨ瘖閮�","Id": "0011000001g0uyhAAA"} }, "needInvoiceCount": 0,"oldCheck": false, "Id": "a2K0l000000xAnwEAE"}]',
- '',
- '',
- acc.Id,
- 'ET',
- '',
- invoiceOrderRecoedschangeLwc
- );
- LexConInvoiceViewController.save(
- invoiceorder,
- '娼嶅煄鐜颁唬闂ㄨ瘖閮�',
- '0011000001g0uyhAAA',
- agency1.Id,
- '[{"check": false,"esd": {"Id": "a2K0l000000x1KXEAY","Order_ForHospital__c": "0011000001k1K9ZAAU","Name": "DB-FY2024-04-Z316244","Outbound_Date__c": "2023-06-09","ShipmentAccount__c": "闈掑矝鐩堟捣鍖婚櫌","Shipment_total_amount__c": 848,"RrturnPro_total_amount__c": 0,"Total_Invoiced_Procount__c": 0,"InvoiceNotPro_total_amount__c": 848,"InvoiceNotPro_money__c": 848, "Invoice_total_amount__c": 0,"Billed_Status__c": "杩樻病寮�绁�","Order_ForHospital__r": {"Name": "闈掑矝鐩堟捣鍖婚櫌","Id": "0011000001k1K9ZAAU"}},"needInvoiceCount": 0,"oldCheck": false,"Id": "a2K0l000000x1KXEAY"}, {"check": true,"esd": {"Id": "a2K0l000000xAnwEAE","Order_ForHospital__c": "0011000001g0uyhAAA","Name": "a2K0l000000xAnw","Outbound_Date__c": "2023-05-12","ShipmentAccount__c": "娼嶅煄鐜颁唬闂ㄨ瘖閮�", "Shipment_total_amount__c": 2300,"RrturnPro_total_amount__c": 0,"Total_Invoiced_Procount__c": 0,"InvoiceNotPro_total_amount__c": 2300,"InvoiceNotPro_money__c": 2300,"Invoice_total_amount__c": 0,"Billed_Status__c": "杩樻病寮�绁�","Order_ForHospital__r": {"Name": "娼嶅煄鐜颁唬闂ㄨ瘖閮�","Id": "0011000001g0uyhAAA"} }, "needInvoiceCount": 0,"oldCheck": false, "Id": "a2K0l000000xAnwEAE"}]',
- testList2.Id,
- '',
- acc.Id,
- 'ET',
- '',
- invoiceOrderRecoedschangeLwc
- );
-
- List<LexConInvoiceViewController.InvoiceOrderInfo> test1 = new List<LexConInvoiceViewController.InvoiceOrderInfo>();
- for (LexConInvoiceViewController.InvoiceOrderInfo ass : LexConInvoiceViewController.invoiceOrderRecoeds) {
- ass.check = true;
- test1.add(ass);
- }
- System.debug('test1==>' + test1);
- LexConInvoiceViewController.save(
- invoiceorder,
- '娼嶅煄鐜颁唬闂ㄨ瘖閮�',
- '0011000001g0uyhAAA',
- '',
- JSON.serialize(test1),
- '',
- '',
- acc.Id,
- 'ET',
- '',
- invoiceOrderRecoedschangeLwc
- );
- }
-
- }
-
- static testMethod void allsave4() {
- user curUser = [SELECT Id FROM User WHERE LastName = 'TestUser' LIMIT 1];
- Account acc = [
- SELECT Id
- FROM Account
- WHERE name = 'Testaccount002'
- LIMIT 1
- ];
- Account hosp1 = [SELECT Id FROM Account WHERE name = 'Testhosp001' LIMIT 1];
- Account agency1 = [
- SELECT Id
- FROM Account
- WHERE name = 'Testhosp001'
- LIMIT 1
- ];
- Account agency2 = [
- SELECT Id
- FROM Account
- WHERE name = 'Testhosp002'
- LIMIT 1
- ];
- System.runAs(curUser) {
- //鍙戠エ淇℃伅
- Consumable_order__c invoiceorder = new Consumable_order__c();
- invoiceorder.Name = '202306164590';
- invoiceorder.Invoice_Date__c = Date.today();
- // invoiceorder.Order_ForCustomerText__c = '娑堝寲绉�';
- invoiceorder.Invoice_Note__c = '4444';
- invoiceorder.RecordTypeid = '012100000006JxEAAU';
- invoiceorder.Invoice_status__c = '鑽夋涓�';
- invoiceorder.Order_type__c = '鍙戠エ';
- // invoiceorder.Order_ForHospital__c = hosp1.Id;
- insert invoiceorder;
- //鍙戠エ淇℃伅
- Consumable_order__c invoiceorder1 = new Consumable_order__c();
- invoiceorder1.Name = '202306164590';
- invoiceorder1.Invoice_Date__c = Date.today();
- invoiceorder1.Order_ForCustomerText__c = '娑堝寲绉�';
- invoiceorder1.Invoice_Note__c = '4444';
- invoiceorder1.RecordTypeid = '012100000006JxEAAU';
- invoiceorder1.Invoice_status__c = '鑽夋涓�';
- invoiceorder1.Order_type__c = '鍙戠エ';
- // invoiceorder.Order_ForHospital__c = hosp1.Id;
- insert invoiceorder1;
-
- // invoiceorder = [select id,Name from Consumable_order__c where id =:invoiceorder.id];
- Consumable_order__c testList2 = new Consumable_order__c(
- Name = 'Test1',
- Summons_Sale_Status__c = '鍑鸿揣',
- SummonsStatus_c__c = '宸插畬鎴�',
- SummonsForDirction__c = '鐩存帴閿�鍞粰鍖婚櫌',
- Order_status__c = '鑽夋涓�',
- Order_type__c = '浼犵エ',
- Dealer_info__c = acc.Id,
- Invoice_Date__c = Date.today()
- );
-
- insert testList2;
- String invoiceOrderRecoedschangeLwc = JSON.serialize(LexConInvoiceViewController.invoiceOrderRecoedschange);
- //涓嶉渶瑕佽緭鍏ョ瀹�
- LexConInvoiceViewController.save(
- invoiceorder1,
- '娼嶅煄鐜颁唬闂ㄨ瘖閮�',
- '',
- agency1.Id,
- '[{"check": false,"esd": {"Id": "a2K0l000000x1KXEAY","Order_ForHospital__c": "0011000001k1K9ZAAU","Name": "DB-FY2024-04-Z316244","Outbound_Date__c": "2023-06-09","ShipmentAccount__c": "闈掑矝鐩堟捣鍖婚櫌","Shipment_total_amount__c": 848,"RrturnPro_total_amount__c": 0,"Total_Invoiced_Procount__c": 0,"InvoiceNotPro_total_amount__c": 848,"InvoiceNotPro_money__c": 848, "Invoice_total_amount__c": 0,"Billed_Status__c": "杩樻病寮�绁�","Order_ForHospital__r": {"Name": "闈掑矝鐩堟捣鍖婚櫌","Id": "0011000001k1K9ZAAU"}},"needInvoiceCount": 0,"oldCheck": false,"Id": "a2K0l000000x1KXEAY"}, {"check": true,"esd": {"Id": "a2K0l000000xAnwEAE","Order_ForHospital__c": "0011000001g0uyhAAA","Name": "a2K0l000000xAnw","Outbound_Date__c": "2023-05-12","ShipmentAccount__c": "娼嶅煄鐜颁唬闂ㄨ瘖閮�", "Shipment_total_amount__c": 2300,"RrturnPro_total_amount__c": 0,"Total_Invoiced_Procount__c": 0,"InvoiceNotPro_total_amount__c": 2300,"InvoiceNotPro_money__c": 2300,"Invoice_total_amount__c": 0,"Billed_Status__c": "杩樻病寮�绁�","Order_ForHospital__r": {"Name": "娼嶅煄鐜颁唬闂ㄨ瘖閮�","Id": "0011000001g0uyhAAA"} }, "needInvoiceCount": 0,"oldCheck": false, "Id": "a2K0l000000xAnwEAE"}]',
- testList2.Id,
- '',
- acc.Id,
- 'ET',
- '',
- invoiceOrderRecoedschangeLwc
- );
-
- //LexConInvoiceViewController.save(invoiceorder,'娼嶅煄鐜颁唬闂ㄨ瘖閮�','',agency2.Id,'[{"check": false,"esd": {"Id": "a2K0l000000x1KXEAY","Order_ForHospital__c": "0011000001k1K9ZAAU","Name": "DB-FY2024-04-Z316244","Outbound_Date__c": "2023-06-09","ShipmentAccount__c": "闈掑矝鐩堟捣鍖婚櫌","Shipment_total_amount__c": 848,"RrturnPro_total_amount__c": 0,"Total_Invoiced_Procount__c": 0,"InvoiceNotPro_total_amount__c": 848,"InvoiceNotPro_money__c": 848, "Invoice_total_amount__c": 0,"Billed_Status__c": "杩樻病寮�绁�","Order_ForHospital__r": {"Name": "闈掑矝鐩堟捣鍖婚櫌","Id": "0011000001k1K9ZAAU"}},"needInvoiceCount": 0,"oldCheck": false,"Id": "a2K0l000000x1KXEAY"}, {"check": false,"esd": {"Id": "a2K0l000000xAnwEAE","Order_ForHospital__c": "0011000001g0uyhAAA","Name": "a2K0l000000xAnw","Outbound_Date__c": "2023-05-12","ShipmentAccount__c": "娼嶅煄鐜颁唬闂ㄨ瘖閮�", "Shipment_total_amount__c": 2300,"RrturnPro_total_amount__c": 0,"Total_Invoiced_Procount__c": 0,"InvoiceNotPro_total_amount__c": 2300,"InvoiceNotPro_money__c": 2300,"Invoice_total_amount__c": 0,"Billed_Status__c": "杩樻病寮�绁�","Order_ForHospital__r": {"Name": "娼嶅煄鐜颁唬闂ㄨ瘖閮�","Id": "0011000001g0uyhAAA"} }, "needInvoiceCount": 0,"oldCheck": false, "Id": "a2K0l000000xAnwEAE"}]',testList2.Id,invoiceorder.Id,myAccount1.Id,'ET','isreopen',invoiceOrderRecoedschangeLwc);
- // LexConInvoiceViewController.save(invoiceorder1,'娼嶅煄鐜颁唬闂ㄨ瘖閮�','',agency2.Id,'[{"check": false,"esd": {"Id": "a2K0l000000x1KXEAY","Order_ForHospital__c": "0011000001k1K9ZAAU","Name": "DB-FY2024-04-Z316244","Outbound_Date__c": "2023-06-09","ShipmentAccount__c": "闈掑矝鐩堟捣鍖婚櫌","Shipment_total_amount__c": 848,"RrturnPro_total_amount__c": 0,"Total_Invoiced_Procount__c": 0,"InvoiceNotPro_total_amount__c": 848,"InvoiceNotPro_money__c": 848, "Invoice_total_amount__c": 0,"Billed_Status__c": "杩樻病寮�绁�","Order_ForHospital__r": {"Name": "闈掑矝鐩堟捣鍖婚櫌","Id": "0011000001k1K9ZAAU"}},"needInvoiceCount": 0,"oldCheck": false,"Id": "a2K0l000000x1KXEAY"}, {"check": false,"esd": {"Id": "a2K0l000000xAnwEAE","Order_ForHospital__c": "0011000001g0uyhAAA","Name": "a2K0l000000xAnw","Outbound_Date__c": "2023-05-12","ShipmentAccount__c": "娼嶅煄鐜颁唬闂ㄨ瘖閮�", "Shipment_total_amount__c": 2300,"RrturnPro_total_amount__c": 0,"Total_Invoiced_Procount__c": 0,"InvoiceNotPro_total_amount__c": 2300,"InvoiceNotPro_money__c": 2300,"Invoice_total_amount__c": 0,"Billed_Status__c": "杩樻病寮�绁�","Order_ForHospital__r": {"Name": "娼嶅煄鐜颁唬闂ㄨ瘖閮�","Id": "0011000001g0uyhAAA"} }, "needInvoiceCount": 0,"oldCheck": false, "Id": "a2K0l000000xAnwEAE"}]',testList2.Id,invoiceorder1.Id,myAccount1.Id,'ET','isreopen',invoiceOrderRecoedschangeLwc);
- }
- }
-
- static testMethod void allsave5() {
- user curUser = [SELECT Id FROM User WHERE LastName = 'TestUser' LIMIT 1];
- Account acc = [
- SELECT Id
- FROM Account
- WHERE name = 'Testaccount002'
- LIMIT 1
- ];
- System.runAs(curUser) {
- //浜у搧淇℃伅
- Product2 prod01 = new Product2(
- Name = 'Test01',
- ProductCode = 'Test01',
- Asset_Model_No__c = 'Test01',
- SFDA_Status__c = '鏈夊姽',
- Dealer_special_Object__c = true,
- Manual_Entry__c = false
- );
- Product2 prod02 = new Product2(
- Name = 'Test02',
- ProductCode = 'Test02',
- Asset_Model_No__c = 'Test02',
- SFDA_Status__c = '鏈夊姽',
- Dealer_special_Object__c = true,
- Manual_Entry__c = false
- );
- insert new List<Product2>{ prod01, prod02 };
-
- Product2__c pro1 = new Product2__c(Name = 'Pro001', OT_CODE_Text__c = 'Test001', Product2__c = prod01.Id);
- Product2__c pro2 = new Product2__c(Name = 'Pro002', OT_CODE_Text__c = 'Test002', Product2__c = prod02.Id);
- insert new List<Product2__c>{ pro1, pro2 };
- List<Consumable_order__c> orderList = new List<Consumable_order__c>();
- //鍙戠エ淇℃伅
- Consumable_order__c invoiceorder = new Consumable_order__c();
- invoiceorder.Name = '202306164590';
- invoiceorder.Invoice_Date__c = Date.today();
- // invoiceorder.Order_ForCustomerText__c = '娑堝寲绉�';
- invoiceorder.Invoice_Note__c = '4444';
- invoiceorder.RecordTypeid = '012100000006JxEAAU';
- invoiceorder.Invoice_status__c = '鑽夋涓�';
- invoiceorder.Order_type__c = '鍙戠エ';
- // invoiceorder.Order_ForHospital__c = hosp1.Id;
- orderList.add(invoiceorder);
- //鍙戠エ淇℃伅
- Consumable_order__c invoiceorder1 = new Consumable_order__c();
- invoiceorder1.Name = '202306164590';
- invoiceorder1.Invoice_Date__c = Date.today();
- invoiceorder1.Order_ForCustomerText__c = '娑堝寲绉�';
- invoiceorder1.Invoice_Note__c = '4444';
- invoiceorder1.RecordTypeid = '012100000006JxEAAU';
- invoiceorder1.Invoice_status__c = '鑽夋涓�';
- invoiceorder1.Order_type__c = '鍙戠エ';
- // invoiceorder.Order_ForHospital__c = hosp1.Id;
- orderList.add(invoiceorder1);
- Consumable_order__c testList2 = new Consumable_order__c(
- Name = 'Test1',
- Summons_Sale_Status__c = '鍑鸿揣',
- SummonsStatus_c__c = '宸插畬鎴�',
- SummonsForDirction__c = '鐩存帴閿�鍞粰鍖婚櫌',
- Order_status__c = '鑽夋涓�',
- Order_type__c = '浼犵エ',
- Dealer_info__c = acc.Id,
- Invoice_Date__c = Date.today()
- );
- orderList.add(testList2);
- //鍑哄簱鍗�
- Consumable_order__c testList1 = new Consumable_order__c(
- Name = 'Test1',
- Summons_Sale_Status__c = '鍑鸿揣',
- SummonsStatus_c__c = '宸插畬鎴�',
- SummonsForDirction__c = '鐩存帴閿�鍞粰鍖婚櫌',
- Order_status__c = '鑽夋涓�',
- Order_type__c = '浼犵エ',
- Dealer_info__c = acc.Id
- );
- orderList.add(testList1);
- insert orderList;
- List<Consumable_orderdetails__c> conList = new List<Consumable_orderdetails__c>();
- //鍑哄簱鍗�1鏄庣粏1
- Consumable_orderdetails__c orderdet1 = new Consumable_orderdetails__c();
- orderdet1.Name = 'Test1_001001';
- //orderdet1.Consumable_principal__c = testList1.Id;
- orderdet1.Consumable_order__c = invoiceorder1.Id;
- orderdet1.RecordTypeId = System.Label.RT_ConOrderDetail1_Invoice;
- orderdet1.Consumable_count__c = 1;
- orderdet1.Consumable_product__c = pro1.Id;
- orderdet1.Shipment_Count__c = 10;
- orderdet1.Invoiced_Procount__c = 4;
- orderdet1.RrturnPro_count__c = 2;
- conList.add(orderdet1);
-
- Consumable_order_LinkTable__c order_LinkTable1 = new Consumable_order_LinkTable__c(
- Name = 'order_LinkTable1',
- Outboundorder_Code_link__c = testList1.Id,
- Invoice_Code_link__c = invoiceorder1.Id
- );
- insert order_LinkTable1;
- Consumable_Orderdetails__c upDateform = new Consumable_Orderdetails__c();
- upDateform.Name = 'Test1_001001';
- upDateform.Consumable_order__c = invoiceorder1.Id;
- upDateform.RecordTypeId = System.Label.RT_ConOrderDetail1_Invoice;
- upDateform.Consumable_count__c = 1;
- upDateform.Consumable_product__c = pro1.Id;
- upDateform.Consumable_order__c = order_LinkTable1.Outboundorder_Code_link__c;
- conList.add(upDateform);
- insert conList;
- String invoiceOrderRecoedschangeLwc = JSON.serialize(LexConInvoiceViewController.invoiceOrderRecoedschange);
- LexConInvoiceViewController.save(
- invoiceorder1,
- '娼嶅煄鐜颁唬闂ㄨ瘖閮�',
- '0011000001k1K9ZAAU',
- '',
- '[{"check": true,"esd": {"Id": "a2K0l000000x1KXEAY","Order_ForHospital__c": "0011000001k1K9ZAAU","Name": "DB-FY2024-04-Z316244","Outbound_Date__c": "2023-06-09","ShipmentAccount__c": "闈掑矝鐩堟捣鍖婚櫌","Shipment_total_amount__c": 848,"RrturnPro_total_amount__c": 0,"Total_Invoiced_Procount__c": 0,"InvoiceNotPro_total_amount__c": 848,"InvoiceNotPro_money__c": 848, "Invoice_total_amount__c": 0,"Billed_Status__c": "杩樻病寮�绁�","Order_ForHospital__r": {"Name": "闈掑矝鐩堟捣鍖婚櫌","Id": "0011000001k1K9ZAAU"}},"needInvoiceCount": 0,"oldCheck": false,"Id": "a2K0l000000x1KXEAY"}]',
- testList1.Id,
- invoiceorder1.Id,
- acc.Id,
- 'ET',
- 'isreopen',
- invoiceOrderRecoedschangeLwc
- );
- // LexConInvoiceViewController.save(invoiceorder1,'娼嶅煄鐜颁唬闂ㄨ瘖閮�','0011000001k1K9ZAAU','','[{"check": true,"esd": {"Id": "a2K0l000000x1KXEAY","Order_ForHospital__c": "0011000001k1K9ZAAU","Name": "DB-FY2024-04-Z316244","Outbound_Date__c": "2023-06-09","ShipmentAccount__c": "闈掑矝鐩堟捣鍖婚櫌","Shipment_total_amount__c": 848,"RrturnPro_total_amount__c": 0,"Total_Invoiced_Procount__c": 0,"InvoiceNotPro_total_amount__c": 848,"InvoiceNotPro_money__c": 848, "Invoice_total_amount__c": 0,"Billed_Status__c": "杩樻病寮�绁�","Order_ForHospital__r": {"Name": "闈掑矝鐩堟捣鍖婚櫌","Id": "0011000001k1K9ZAAU"}},"needInvoiceCount": 0,"oldCheck": false,"Id": "a2K0l000000x1KXEAY"}]',testList1.Id,'',myAccount1.Id,'ET','isreopen',invoiceOrderRecoedschangeLwc);
- }
- }
-
- static testMethod void allsave6() {
- user curUser = [SELECT Id FROM User WHERE LastName = 'TestUser' LIMIT 1];
- Account acc = [
- SELECT Id
- FROM Account
- WHERE name = 'Testaccount002'
- LIMIT 1
- ];
- System.runAs(curUser) {
- //浜у搧淇℃伅
- Product2 prod01 = new Product2(
- Name = 'Test01',
- ProductCode = 'Test01',
- Asset_Model_No__c = 'Test01',
- SFDA_Status__c = '鏈夊姽',
- Dealer_special_Object__c = true,
- Manual_Entry__c = false
- );
- Product2 prod02 = new Product2(
- Name = 'Test02',
- ProductCode = 'Test02',
- Asset_Model_No__c = 'Test02',
- SFDA_Status__c = '鏈夊姽',
- Dealer_special_Object__c = true,
- Manual_Entry__c = false
- );
- insert new List<Product2>{ prod01, prod02 };
-
- Product2__c pro1 = new Product2__c(Name = 'Pro001', OT_CODE_Text__c = 'Test001', Product2__c = prod01.Id);
- Product2__c pro2 = new Product2__c(Name = 'Pro002', OT_CODE_Text__c = 'Test002', Product2__c = prod02.Id);
- insert new List<Product2__c>{ pro1, pro2 };
- List<Consumable_order__c> orderList = new List<Consumable_order__c>();
- //鍙戠エ淇℃伅
- Consumable_order__c invoiceorder = new Consumable_order__c();
- invoiceorder.Name = '202306164590';
- invoiceorder.Invoice_Date__c = Date.today();
- // invoiceorder.Order_ForCustomerText__c = '娑堝寲绉�';
- invoiceorder.Invoice_Note__c = '4444';
- invoiceorder.RecordTypeid = '012100000006JxEAAU';
- invoiceorder.Invoice_status__c = '鑽夋涓�';
- invoiceorder.Order_type__c = '鍙戠エ';
- // invoiceorder.Order_ForHospital__c = hosp1.Id;
- orderList.add(invoiceorder);
- //鍙戠エ淇℃伅
- Consumable_order__c invoiceorder1 = new Consumable_order__c();
- invoiceorder1.Name = '202306164590';
- invoiceorder1.Invoice_Date__c = Date.today();
- invoiceorder1.Order_ForCustomerText__c = '娑堝寲绉�';
- invoiceorder1.Invoice_Note__c = '4444';
- invoiceorder1.RecordTypeid = '012100000006JxEAAU';
- invoiceorder1.Invoice_status__c = '鑽夋涓�';
- invoiceorder1.Order_type__c = '鍙戠エ';
- // invoiceorder.Order_ForHospital__c = hosp1.Id;
- orderList.add(invoiceorder1);
- Consumable_order__c testList2 = new Consumable_order__c(
- Name = 'Test1',
- Summons_Sale_Status__c = '鍑鸿揣',
- SummonsStatus_c__c = '宸插畬鎴�',
- SummonsForDirction__c = '鐩存帴閿�鍞粰鍖婚櫌',
- Order_status__c = '鑽夋涓�',
- Order_type__c = '浼犵エ',
- Dealer_info__c = acc.Id,
- Invoice_Date__c = Date.today()
- );
- orderList.add(testList2);
- //鍑哄簱鍗�
- Consumable_order__c testList1 = new Consumable_order__c(
- Name = 'Test1',
- Summons_Sale_Status__c = '鍑鸿揣',
- SummonsStatus_c__c = '宸插畬鎴�',
- SummonsForDirction__c = '鐩存帴閿�鍞粰鍖婚櫌',
- Order_status__c = '鑽夋涓�',
- Order_type__c = '浼犵エ',
- Dealer_info__c = acc.Id
- );
- orderList.add(testList1);
- insert orderList;
- List<Consumable_orderdetails__c> conList = new List<Consumable_orderdetails__c>();
- //鍑哄簱鍗�1鏄庣粏1
- Consumable_orderdetails__c orderdet1 = new Consumable_orderdetails__c();
- orderdet1.Name = 'Test1_001001';
- //orderdet1.Consumable_principal__c = testList1.Id;
- orderdet1.Consumable_order__c = testList1.Id;
- orderdet1.RecordTypeId = System.Label.RT_ConOrderDetail1_Invoice;
- orderdet1.Consumable_count__c = 1;
- orderdet1.Consumable_product__c = pro1.Id;
- conList.add(orderdet1);
-
- Consumable_order_LinkTable__c order_LinkTable1 = new Consumable_order_LinkTable__c(
- Name = 'order_LinkTable1',
- Outboundorder_Code_link__c = invoiceorder1.Id,
- Invoice_Code_link__c = invoiceorder1.Id
- );
- insert order_LinkTable1;
- Consumable_Orderdetails__c upDateform = new Consumable_Orderdetails__c();
- upDateform.Name = 'Test1_001001';
- //orderdet1.Consumable_principal__c = testList1.Id;
- upDateform.Consumable_order__c = invoiceorder1.Id;
- upDateform.RecordTypeId = System.Label.RT_ConOrderDetail1_Invoice;
- upDateform.Consumable_count__c = 1;
- upDateform.Consumable_product__c = pro1.Id;
- upDateform.Consumable_order__c = order_LinkTable1.Outboundorder_Code_link__c;
- upDateform.RrturnPro_count__c = 10;
- conList.add(upDateform);
- insert conList;
- String invoiceOrderRecoedschangeLwc = JSON.serialize(LexConInvoiceViewController.invoiceOrderRecoedschange);
- LexConInvoiceViewController.save(
- invoiceorder1,
- '娼嶅煄鐜颁唬闂ㄨ瘖閮�',
- '0011000001k1K9ZAAU',
- '',
- '[{"check": false,"esd": {"Id": "a2K0l000000x1KXEAY","Order_ForHospital__c": "0011000001k1K9ZAAU","Name": "DB-FY2024-04-Z316244","Outbound_Date__c": "2023-06-09","ShipmentAccount__c": "闈掑矝鐩堟捣鍖婚櫌","Shipment_total_amount__c": 848,"RrturnPro_total_amount__c": 0,"Total_Invoiced_Procount__c": 0,"InvoiceNotPro_total_amount__c": 848,"InvoiceNotPro_money__c": 848, "Invoice_total_amount__c": 0,"Billed_Status__c": "杩樻病寮�绁�","Order_ForHospital__r": {"Name": "闈掑矝鐩堟捣鍖婚櫌","Id": "0011000001k1K9ZAAU"}},"needInvoiceCount": 0,"oldCheck": false,"Id": "a2K0l000000x1KXEAY"}]',
- testList1.Id,
- invoiceorder1.Id,
- acc.Id,
- 'ET',
- '',
- '[{"check": false,"esd": {"Id": "a2K0l000000x1KXEAY","Order_ForHospital__c": "0011000001k1K9ZAAU","Name": "DB-FY2024-04-Z316244","Outbound_Date__c": "2023-06-09","ShipmentAccount__c": "闈掑矝鐩堟捣鍖婚櫌","Shipment_total_amount__c": 848,"RrturnPro_total_amount__c": 0,"Total_Invoiced_Procount__c": 0,"InvoiceNotPro_total_amount__c": 848,"InvoiceNotPro_money__c": 848, "Invoice_total_amount__c": 0,"Billed_Status__c": "杩樻病寮�绁�","Order_ForHospital__r": {"Name": "闈掑矝鐩堟捣鍖婚櫌","Id": "0011000001k1K9ZAAU"}},"needInvoiceCount": 0,"oldCheck": false,"Id": "a2K0l000000x1KXEAY"}]'
- );
- LexConInvoiceViewController.save(
- invoiceorder1,
- '娼嶅煄鐜颁唬闂ㄨ瘖閮�',
- '0011000001k1K9ZAAU',
- '',
- '[{"check": true,"esd": {"Id": "a2K0l000000x1KXEAY","Order_ForHospital__c": "0011000001k1K9ZAAU","Name": "DB-FY2024-04-Z316244","Outbound_Date__c": "2023-06-09","ShipmentAccount__c": "闈掑矝鐩堟捣鍖婚櫌","Shipment_total_amount__c": 848,"RrturnPro_total_amount__c": 0,"Total_Invoiced_Procount__c": 0,"InvoiceNotPro_total_amount__c": 848,"InvoiceNotPro_money__c": 848, "Invoice_total_amount__c": 0,"Billed_Status__c": "杩樻病寮�绁�","Order_ForHospital__r": {"Name": "闈掑矝鐩堟捣鍖婚櫌","Id": "0011000001k1K9ZAAU"}},"needInvoiceCount": 0,"oldCheck": false,"Id": "a2K0l000000x1KXEAY"}]',
- '',
- invoiceorder1.Id,
- acc.Id,
- 'ET',
- '',
- '[{"check": false,"esd": {"Id": "a2K0l000000x1KXEAY","Order_ForHospital__c": "0011000001k1K9ZAAU","Name": "DB-FY2024-04-Z316244","Outbound_Date__c": "2023-06-09","ShipmentAccount__c": "闈掑矝鐩堟捣鍖婚櫌","Shipment_total_amount__c": 848,"RrturnPro_total_amount__c": 0,"Total_Invoiced_Procount__c": 0,"InvoiceNotPro_total_amount__c": 848,"InvoiceNotPro_money__c": 848, "Invoice_total_amount__c": 0,"Billed_Status__c": "杩樻病寮�绁�","Order_ForHospital__r": {"Name": "闈掑矝鐩堟捣鍖婚櫌","Id": "0011000001k1K9ZAAU"}},"needInvoiceCount": 0,"oldCheck": false,"Id": "a2K0l000000x1KXEAY"}]'
- );
- LexConInvoiceViewController.save(
- invoiceorder1,
- '娼嶅煄鐜颁唬闂ㄨ瘖閮�',
- '0011000001k1K9ZAAU',
- '',
- '[{"check": false,"esd": {"Id": "a2K0l000000x1KXEAY","Order_ForHospital__c": "0011000001k1K9ZAAU","Name": "DB-FY2024-04-Z316244","Outbound_Date__c": "2023-06-09","ShipmentAccount__c": "闈掑矝鐩堟捣鍖婚櫌","Shipment_total_amount__c": 848,"RrturnPro_total_amount__c": 0,"Total_Invoiced_Procount__c": 0,"InvoiceNotPro_total_amount__c": 848,"InvoiceNotPro_money__c": 848, "Invoice_total_amount__c": 0,"Billed_Status__c": "杩樻病寮�绁�","Order_ForHospital__r": {"Name": "闈掑矝鐩堟捣鍖婚櫌","Id": "0011000001k1K9ZAAU"}},"needInvoiceCount": 0,"oldCheck": false,"Id": "a2K0l000000x1KXEAY"}]',
- '',
- invoiceorder1.Id,
- acc.Id,
- 'ET',
- '',
- '[{"check": false,"esd": {"Id": "a2K0l000000x1KXEAY","Order_ForHospital__c": "0011000001k1K9ZAAU","Name": "DB-FY2024-04-Z316244","Outbound_Date__c": "2023-06-09","ShipmentAccount__c": "闈掑矝鐩堟捣鍖婚櫌","Shipment_total_amount__c": 848,"RrturnPro_total_amount__c": 0,"Total_Invoiced_Procount__c": 0,"InvoiceNotPro_total_amount__c": 848,"InvoiceNotPro_money__c": 848, "Invoice_total_amount__c": 0,"Billed_Status__c": "杩樻病寮�绁�","Order_ForHospital__r": {"Name": "闈掑矝鐩堟捣鍖婚櫌","Id": "0011000001k1K9ZAAU"}},"needInvoiceCount": 0,"oldCheck": false,"Id": "a2K0l000000x1KXEAY"}]'
- );
- }
- }
-
- static testMethod void allsave7() {
- user curUser = [SELECT Id FROM User WHERE LastName = 'TestUser' LIMIT 1];
- Account acc = [
- SELECT Id
- FROM Account
- WHERE name = 'Testaccount002'
- LIMIT 1
- ];
- System.runAs(curUser) {
- //浜у搧淇℃伅
- Product2 prod01 = new Product2(
- Name = 'Test01',
- ProductCode = 'Test01',
- Asset_Model_No__c = 'Test01',
- SFDA_Status__c = '鏈夊姽',
- Dealer_special_Object__c = true,
- Manual_Entry__c = false
- );
- Product2 prod02 = new Product2(
- Name = 'Test02',
- ProductCode = 'Test02',
- Asset_Model_No__c = 'Test02',
- SFDA_Status__c = '鏈夊姽',
- Dealer_special_Object__c = true,
- Manual_Entry__c = false
- );
- insert new List<Product2>{ prod01, prod02 };
-
- Product2__c pro1 = new Product2__c(Name = 'Pro001', OT_CODE_Text__c = 'Test001', Product2__c = prod01.Id);
- Product2__c pro2 = new Product2__c(Name = 'Pro002', OT_CODE_Text__c = 'Test002', Product2__c = prod02.Id);
- insert new List<Product2__c>{ pro1, pro2 };
- List<Consumable_order__c> orderList = new List<Consumable_order__c>();
- //鍙戠エ淇℃伅
- Consumable_order__c invoiceorder = new Consumable_order__c();
- invoiceorder.Name = '202306164590';
- invoiceorder.Invoice_Date__c = Date.today();
- // invoiceorder.Order_ForCustomerText__c = '娑堝寲绉�';
- invoiceorder.Invoice_Note__c = '4444';
- invoiceorder.RecordTypeid = '012100000006JxEAAU';
- invoiceorder.Invoice_status__c = '鑽夋涓�';
- invoiceorder.Order_type__c = '鍙戠エ';
- // invoiceorder.Order_ForHospital__c = hosp1.Id;
- orderList.add(invoiceorder);
- //鍙戠エ淇℃伅
- Consumable_order__c invoiceorder1 = new Consumable_order__c();
- invoiceorder1.Name = '202306164590';
- invoiceorder1.Invoice_Date__c = Date.today();
- invoiceorder1.Order_ForCustomerText__c = '娑堝寲绉�';
- invoiceorder1.Invoice_Note__c = '4444';
- invoiceorder1.RecordTypeid = '012100000006JxEAAU';
- invoiceorder1.Invoice_status__c = '鑽夋涓�';
- invoiceorder1.Order_type__c = '鍙戠エ';
- // invoiceorder.Order_ForHospital__c = hosp1.Id;
- orderList.add(invoiceorder1);
- Consumable_order__c testList2 = new Consumable_order__c(
- Name = 'Test1',
- Summons_Sale_Status__c = '鍑鸿揣',
- SummonsStatus_c__c = '宸插畬鎴�',
- SummonsForDirction__c = '鐩存帴閿�鍞粰鍖婚櫌',
- Order_status__c = '鑽夋涓�',
- Order_type__c = '浼犵エ',
- Dealer_info__c = acc.Id,
- Invoice_Date__c = Date.today()
- );
- orderList.add(testList2);
- //鍑哄簱鍗�
- Consumable_order__c testList1 = new Consumable_order__c(
- Name = 'Test1',
- Summons_Sale_Status__c = '鍑鸿揣',
- SummonsStatus_c__c = '宸插畬鎴�',
- SummonsForDirction__c = '鐩存帴閿�鍞粰鍖婚櫌',
- Order_status__c = '鑽夋涓�',
- Order_type__c = '浼犵エ',
- Dealer_info__c = acc.Id
- );
- orderList.add(testList1);
- insert orderList;
- List<Consumable_orderdetails__c> conList = new List<Consumable_orderdetails__c>();
- //鍑哄簱鍗�1鏄庣粏1
- Consumable_orderdetails__c orderdet1 = new Consumable_orderdetails__c();
- orderdet1.Name = 'Test1_001001';
- //orderdet1.Consumable_principal__c = testList1.Id;
- orderdet1.Consumable_order__c = testList1.Id;
- orderdet1.RecordTypeId = System.Label.RT_ConOrderDetail1_Invoice;
- orderdet1.Consumable_count__c = 1;
- orderdet1.Consumable_product__c = pro1.Id;
- conList.add(orderdet1);
-
- Consumable_order_LinkTable__c order_LinkTable1 = new Consumable_order_LinkTable__c(
- Name = 'order_LinkTable1',
- Outboundorder_Code_link__c = invoiceorder1.Id,
- Invoice_Code_link__c = invoiceorder1.Id
- );
- insert order_LinkTable1;
- Consumable_Orderdetails__c upDateform = new Consumable_Orderdetails__c();
- upDateform.Name = 'Test1_001001';
- //orderdet1.Consumable_principal__c = testList1.Id;
- upDateform.Consumable_order__c = invoiceorder1.Id;
- upDateform.RecordTypeId = System.Label.RT_ConOrderDetail1_Invoice;
- upDateform.Consumable_count__c = 1;
- upDateform.Consumable_product__c = pro1.Id;
- upDateform.Consumable_order__c = order_LinkTable1.Outboundorder_Code_link__c;
- upDateform.RrturnPro_count__c = 10;
- conList.add(upDateform);
- insert conList;
- String invoiceOrderRecoedschangeLwc = JSON.serialize(LexConInvoiceViewController.invoiceOrderRecoedschange);
- LexConInvoiceViewController.save(
- invoiceorder1,
- '娼嶅煄鐜颁唬闂ㄨ瘖閮�',
- '0011000001k1K9ZAAU',
- '',
- '[{"check": true,"esd": {"Id": "a2K0l000000x1KXEAY","Order_ForHospital__c": "0011000001k1K9ZAAU","Name": "DB-FY2024-04-Z316244","Outbound_Date__c": "2023-06-09","ShipmentAccount__c": "闈掑矝鐩堟捣鍖婚櫌","Shipment_total_amount__c": 848,"RrturnPro_total_amount__c": 0,"Total_Invoiced_Procount__c": 0,"InvoiceNotPro_total_amount__c": 848,"InvoiceNotPro_money__c": 848, "Invoice_total_amount__c": 0,"Billed_Status__c": "杩樻病寮�绁�","Order_ForHospital__r": {"Name": "闈掑矝鐩堟捣鍖婚櫌","Id": "0011000001k1K9ZAAU"}},"needInvoiceCount": 0,"oldCheck": false,"Id": "a2K0l000000x1KXEAY"},{"check": false,"esd": {"Id": "a2K0l000000x1KXEAY","Order_ForHospital__c": "0011000001k1K9ZAAU","Name": "DB-FY2024-04-Z316244","Outbound_Date__c": "2023-06-09","ShipmentAccount__c": "闈掑矝鐩堟捣鍖婚櫌","Shipment_total_amount__c": 848,"RrturnPro_total_amount__c": 0,"Total_Invoiced_Procount__c": 0,"InvoiceNotPro_total_amount__c": 848,"InvoiceNotPro_money__c": 848,"Invoice_total_amount__c": 0,"Billed_Status__c": "杩樻病寮�绁�","Order_ForHospital__r": {"Name": "闈掑矝鐩堟捣鍖婚櫌","Id": "0011000001k1K9ZAAU"}},"needInvoiceCount": 0,"oldCheck": false}]',
- '',
- invoiceorder1.Id,
- acc.Id,
- 'ET',
- '',
- '[{"check": false,"esd": {"Id": "a2K0l000000x1KXEAY","Order_ForHospital__c": "0011000001k1K9ZAAU","Name": "DB-FY2024-04-Z316244","Outbound_Date__c": "2023-06-09","ShipmentAccount__c": "闈掑矝鐩堟捣鍖婚櫌","Shipment_total_amount__c": 848,"RrturnPro_total_amount__c": 0,"Total_Invoiced_Procount__c": 0,"InvoiceNotPro_total_amount__c": 848,"InvoiceNotPro_money__c": 848, "Invoice_total_amount__c": 0,"Billed_Status__c": "杩樻病寮�绁�","Order_ForHospital__r": {"Name": "闈掑矝鐩堟捣鍖婚櫌","Id": "0011000001k1K9ZAAU"}},"needInvoiceCount": 0,"oldCheck": false,"Id": "a2K0l000000x1KXEAY"}]'
- );
- // LexConInvoiceViewController.save(invoiceorder1,'娼嶅煄鐜颁唬闂ㄨ瘖閮�','0011000001k1K9ZAAU','','[{"check": false,"esd": {"Id": "a2K0l000000x1KXEAY","Order_ForHospital__c": "0011000001k1K9ZAAU","Name": "DB-FY2024-04-Z316244","Outbound_Date__c": "2023-06-09","ShipmentAccount__c": "闈掑矝鐩堟捣鍖婚櫌","Shipment_total_amount__c": 848,"RrturnPro_total_amount__c": 0,"Total_Invoiced_Procount__c": 0,"InvoiceNotPro_total_amount__c": 848,"InvoiceNotPro_money__c": 848, "Invoice_total_amount__c": 0,"Billed_Status__c": "杩樻病寮�绁�","Order_ForHospital__r": {"Name": "闈掑矝鐩堟捣鍖婚櫌","Id": "0011000001k1K9ZAAU"}},"needInvoiceCount": 0,"oldCheck": false,"Id": "a2K0l000000x1KXEAY"}]','',invoiceorder1.Id,myAccount1.Id,'ET','','[{"check": false,"esd": {"Id": "a2K0l000000x1KXEAY","Order_ForHospital__c": "0011000001k1K9ZAAU","Name": "DB-FY2024-04-Z316244","Outbound_Date__c": "2023-06-09","ShipmentAccount__c": "闈掑矝鐩堟捣鍖婚櫌","Shipment_total_amount__c": 848,"RrturnPro_total_amount__c": 0,"Total_Invoiced_Procount__c": 0,"InvoiceNotPro_total_amount__c": 848,"InvoiceNotPro_money__c": 848, "Invoice_total_amount__c": 0,"Billed_Status__c": "杩樻病寮�绁�","Order_ForHospital__r": {"Name": "闈掑矝鐩堟捣鍖婚櫌","Id": "0011000001k1K9ZAAU"}},"needInvoiceCount": 0,"oldCheck": false,"Id": "a2K0l000000x1KXEAY"}]');
- }
+ System.debug('test1==>'+test1);
+ System.debug('invoiceOrderRecoedschangeLwc==>'+invoiceOrderRecoedschangeLwc);
+ LexConInvoiceViewController.save(testList1,'Testhosp001',hosp1.id,agency1.id,invoiceOrderRecoeds,testList1.Id,invoiceorder.Id,acc.Id,'ET','',invoiceOrderRecoedschangeLwc);
+ LexConInvoiceViewController.save(testList1,'Testhosp001','','',JSON.serialize(test1),testList1.Id,invoiceorder.Id,acc.Id,'ET','',invoiceOrderRecoedschangeLwc);
+ LexConInvoiceViewController.save(testList1,'Testhosp001','','',JSON.serialize(test1),'',invoiceorder.Id,acc.Id,'ET','',invoiceOrderRecoedschangeLwc);
+ LexConInvoiceViewController.save(testList1,'闈掑矝鐩堟捣鍖婚櫌',hosp1.id,agency1.id,'[{"check": true,"esd": {"Id": "a2K0l000000x1KXEAY","Order_ForHospital__c": "0011000001k1K9ZAAU","Name": "DB-FY2024-04-Z316244","Outbound_Date__c": "2023-06-09","ShipmentAccount__c": "闈掑矝鐩堟捣鍖婚櫌","Shipment_total_amount__c": 848,"RrturnPro_total_amount__c": 0,"Total_Invoiced_Procount__c": 0,"InvoiceNotPro_total_amount__c": 848,"InvoiceNotPro_money__c": 848,"Invoice_total_amount__c": 0,"Billed_Status__c": "杩樻病寮�绁�","Order_ForHospital__r": {"Name": "闈掑矝鐩堟捣鍖婚櫌","Id": "0011000001k1K9ZAAU"}},"needInvoiceCount": 0,"oldCheck": false}]','',invoiceorder.Id,acc.Id,'ET','',invoiceOrderRecoedschangeLwc);
+ LexConInvoiceViewController.save(testList1,'闈掑矝鐩堟捣鍖婚櫌',hosp1.id,agency1.id,'[{"check": true,"esd": {"Id": "a2K0l000000x1KXEAY","Order_ForHospital__c": "0011000001k1K9ZAAU","Name": "DB-FY2024-04-Z316244","Outbound_Date__c": "2023-06-09","ShipmentAccount__c": "闈掑矝鐩堟捣鍖婚櫌","Shipment_total_amount__c": 848,"RrturnPro_total_amount__c": 0,"Total_Invoiced_Procount__c": 0,"InvoiceNotPro_total_amount__c": 848,"InvoiceNotPro_money__c": 848,"Invoice_total_amount__c": 0,"Billed_Status__c": "杩樻病寮�绁�","Order_ForHospital__r": {"Name": "闈掑矝鐩堟捣鍖婚櫌","Id": "0011000001k1K9ZAAU"}},"needInvoiceCount": 0,"oldCheck": false}]','',invoiceorder.Id,acc.Id,'ET','',invoiceOrderRecoedschangeLwc);
+
}
}
+
+
+static testMethod void allsave2(){
+ user curUser = [SELECT Id FROM User WHERE LastName = 'TestUser' LIMIT 1];
+ Account acc = [SELECT Id FROM Account WHERE name='Testaccount002' LIMIT 1];
+ Account hosp1 = [SELECT Id FROM Account WHERE name='Testhosp001' LIMIT 1];
+ Account agency1 = [SELECT Id FROM Account WHERE name='Testhosp001' LIMIT 1];
+ Account agency2 = [SELECT Id FROM Account WHERE name='Testhosp002' LIMIT 1];
+ system.runAs(curUser){
+
+ //鍙戠エ淇℃伅
+ Consumable_order__c invoiceorder = new Consumable_order__c();
+ invoiceorder.Name='invoice01';
+ invoiceorder.Order_type__c = '鍙戠エ';
+ invoiceorder.Invoice_status__c='鑽夋涓�';
+ invoiceorder.Invoice_Date__c = Date.today();
+ invoiceorder.RecordTypeid = System.Label.RT_ConOrder_Invoice;
+ // invoiceorder.Order_ForHospital__c = '';
+ // invoiceorder.Order_ForDealer__c = '';
+ invoiceorder.Dealer_Info__c=acc.Id;
+ //invoiceorder.Order_ProType__c = 'ET';
+ insert invoiceorder;
+
+ Consumable_order__c testList2 = new Consumable_order__c(
+ Name='Test1',
+ Summons_Sale_Status__c='鍑鸿揣',
+ SummonsStatus_c__c='宸插畬鎴�',
+ SummonsForDirction__c='鐩存帴閿�鍞粰鍖婚櫌',
+ Order_status__c='鑽夋涓�',
+ Order_type__c='浼犵エ',
+ Dealer_info__c=acc.Id,
+ Invoice_Date__c = Date.today(),Order_ForDealerText__c = 'Test');
+ insert testList2;
+ Consumable_order__c testList1 = new Consumable_order__c(
+ Name='Test1',
+ Summons_Sale_Status__c='鍑鸿揣',
+ SummonsStatus_c__c='宸插畬鎴�',
+ SummonsForDirction__c='鐩存帴閿�鍞粰鍖婚櫌',
+ Order_status__c='鑽夋涓�',
+ Order_type__c='浼犵エ',
+ Dealer_info__c=acc.Id);
+ insert testList1;
+ String invoiceOrderRecoedschangeLwc = JSON.serialize(LexConInvoiceViewController.invoiceOrderRecoedschange);
+ //閫夋嫨寮�绁ㄥ崟
+ LexConInvoiceViewController.save(testList2,'闈掑矝鐩堟捣鍖婚櫌','',agency2.id,'[{"check": false,"esd": {"Id": "a2K0l000000x1KXEAY","Order_ForHospital__c": "0011000001k1K9ZAAU","Name": "DB-FY2024-04-Z316244","Outbound_Date__c": "2023-06-09","ShipmentAccount__c": "闈掑矝鐩堟捣鍖婚櫌","Shipment_total_amount__c": 848,"RrturnPro_total_amount__c": 0,"Total_Invoiced_Procount__c": 0,"InvoiceNotPro_total_amount__c": 848,"InvoiceNotPro_money__c": 848,"Invoice_total_amount__c": 0,"Billed_Status__c": "杩樻病寮�绁�","Order_ForHospital__r": {"Name": "闈掑矝鐩堟捣鍖婚櫌","Id": "0011000001k1K9ZAAU"}},"needInvoiceCount": 0,"oldCheck": false}]','',invoiceorder.Id,acc.Id,'ET','',invoiceOrderRecoedschangeLwc);
+ }
+
+}
+
+
+
+static testMethod void allsave3(){
+ user curUser = [SELECT Id FROM User WHERE LastName = 'TestUser' LIMIT 1];
+ Account acc = [SELECT Id FROM Account WHERE name='Testaccount002' LIMIT 1];
+ Account hosp1 = [SELECT Id FROM Account WHERE name='Testhosp001' LIMIT 1];
+ Account agency1 = [SELECT Id FROM Account WHERE name='Testhosp001' LIMIT 1];
+ Account agency2 = [SELECT Id FROM Account WHERE name='Testhosp002' LIMIT 1];
+ system.runAs(curUser){
+ Product2 prod01 = new Product2(Name='Test01',ProductCode='Test01',Asset_Model_No__c = 'Test01',SFDA_Status__c = '鏈夊姽',Dealer_special_Object__c = true,Manual_Entry__c = false);
+ Product2 prod02 = new Product2(Name='Test02',ProductCode='Test02',Asset_Model_No__c = 'Test02',SFDA_Status__c = '鏈夊姽',Dealer_special_Object__c = true,Manual_Entry__c = false);
+ insert new Product2[] {prod01, prod02};
+
+ Product2__c pro1 = new Product2__c(Name='Pro001',OT_CODE_Text__c='Test001',Product2__c = prod01.Id);
+ Product2__c pro2 = new Product2__c(Name='Pro002',OT_CODE_Text__c='Test002',Product2__c = prod02.Id);
+ insert new Product2__c[] {pro1, pro2};
+
+ //鍙戠エ淇℃伅
+ Consumable_order__c invoiceorder = new Consumable_order__c();
+ invoiceorder.Name='202306164590';
+ invoiceorder.Invoice_Date__c = Date.today();
+ invoiceorder.Order_ForCustomerText__c = '娑堝寲绉�';
+ invoiceorder.Invoice_Note__c = '4444';
+ invoiceorder.RecordTypeid = '012100000006JxEAAU';
+ invoiceorder.Invoice_status__c='鑽夋涓�';
+ invoiceorder.Order_type__c = '鍙戠エ';
+ // invoiceorder.Order_ForHospital__c = hosp1.Id;
+ insert invoiceorder;
+ // invoiceorder = [select id,Name from Consumable_order__c where id =:invoiceorder.id];
+ Consumable_order__c testList2 = new Consumable_order__c(
+ Name='Test1',
+ Summons_Sale_Status__c='鍑鸿揣',
+ SummonsStatus_c__c='宸插畬鎴�',
+ SummonsForDirction__c='鐩存帴閿�鍞粰鍖婚櫌',
+ Order_status__c='鑽夋涓�',
+ Order_type__c='浼犵エ',
+ Dealer_info__c=acc.Id,
+ Invoice_Date__c = Date.today());
+ insert testList2;
+
+ List<Consumable_orderdetails__c> conList = new List<Consumable_orderdetails__c>();
+ //鍑哄簱鍗�1鏄庣粏1
+ Consumable_orderdetails__c orderdet1 = new Consumable_orderdetails__c();
+ orderdet1.Name = 'Test1_001001';
+ //orderdet1.Consumable_principal__c = testList1.Id;
+ orderdet1.Consumable_order__c = invoiceorder.Id;
+ orderdet1.RecordTypeId = System.Label.RT_ConOrderDetail1_Invoice;
+ orderdet1.Consumable_count__c = 1;
+ orderdet1.Consumable_product__c = pro1.Id;
+ orderdet1.Shipment_Count__c = 10;
+ orderdet1.Invoiced_Procount__c = 4;
+ orderdet1.RrturnPro_count__c = 2;
+ conList.add(orderdet1);
+
+ String invoiceOrderRecoedschangeLwc = JSON.serialize(LexConInvoiceViewController.invoiceOrderRecoedschange);
+ LexConInvoiceViewController.save(invoiceorder,'娼嶅煄鐜颁唬闂ㄨ瘖閮�','0011000001g0uyhAAA','','[{"check": false,"esd": {"Id": "a2K0l000000x1KXEAY","Order_ForHospital__c": "0011000001k1K9ZAAU","Name": "DB-FY2024-04-Z316244","Outbound_Date__c": "2023-06-09","ShipmentAccount__c": "闈掑矝鐩堟捣鍖婚櫌","Shipment_total_amount__c": 848,"RrturnPro_total_amount__c": 0,"Total_Invoiced_Procount__c": 0,"InvoiceNotPro_total_amount__c": 848,"InvoiceNotPro_money__c": 848, "Invoice_total_amount__c": 0,"Billed_Status__c": "杩樻病寮�绁�","Order_ForHospital__r": {"Name": "闈掑矝鐩堟捣鍖婚櫌","Id": "0011000001k1K9ZAAU"}},"needInvoiceCount": 0,"oldCheck": false,"Id": "a2K0l000000x1KXEAY"}, {"check": true,"esd": {"Id": "a2K0l000000xAnwEAE","Order_ForHospital__c": "0011000001g0uyhAAA","Name": "a2K0l000000xAnw","Outbound_Date__c": "2023-05-12","ShipmentAccount__c": "娼嶅煄鐜颁唬闂ㄨ瘖閮�", "Shipment_total_amount__c": 2300,"RrturnPro_total_amount__c": 0,"Total_Invoiced_Procount__c": 0,"InvoiceNotPro_total_amount__c": 2300,"InvoiceNotPro_money__c": 2300,"Invoice_total_amount__c": 0,"Billed_Status__c": "杩樻病寮�绁�","Order_ForHospital__r": {"Name": "娼嶅煄鐜颁唬闂ㄨ瘖閮�","Id": "0011000001g0uyhAAA"} }, "needInvoiceCount": 0,"oldCheck": false, "Id": "a2K0l000000xAnwEAE"}]','','',acc.Id,'ET','',invoiceOrderRecoedschangeLwc);
+ LexConInvoiceViewController.save(invoiceorder,'娼嶅煄鐜颁唬闂ㄨ瘖閮�','0011000001g0uyhAAA',agency1.Id,'[{"check": false,"esd": {"Id": "a2K0l000000x1KXEAY","Order_ForHospital__c": "0011000001k1K9ZAAU","Name": "DB-FY2024-04-Z316244","Outbound_Date__c": "2023-06-09","ShipmentAccount__c": "闈掑矝鐩堟捣鍖婚櫌","Shipment_total_amount__c": 848,"RrturnPro_total_amount__c": 0,"Total_Invoiced_Procount__c": 0,"InvoiceNotPro_total_amount__c": 848,"InvoiceNotPro_money__c": 848, "Invoice_total_amount__c": 0,"Billed_Status__c": "杩樻病寮�绁�","Order_ForHospital__r": {"Name": "闈掑矝鐩堟捣鍖婚櫌","Id": "0011000001k1K9ZAAU"}},"needInvoiceCount": 0,"oldCheck": false,"Id": "a2K0l000000x1KXEAY"}, {"check": true,"esd": {"Id": "a2K0l000000xAnwEAE","Order_ForHospital__c": "0011000001g0uyhAAA","Name": "a2K0l000000xAnw","Outbound_Date__c": "2023-05-12","ShipmentAccount__c": "娼嶅煄鐜颁唬闂ㄨ瘖閮�", "Shipment_total_amount__c": 2300,"RrturnPro_total_amount__c": 0,"Total_Invoiced_Procount__c": 0,"InvoiceNotPro_total_amount__c": 2300,"InvoiceNotPro_money__c": 2300,"Invoice_total_amount__c": 0,"Billed_Status__c": "杩樻病寮�绁�","Order_ForHospital__r": {"Name": "娼嶅煄鐜颁唬闂ㄨ瘖閮�","Id": "0011000001g0uyhAAA"} }, "needInvoiceCount": 0,"oldCheck": false, "Id": "a2K0l000000xAnwEAE"}]',testList2.Id,'',acc.Id,'ET','',invoiceOrderRecoedschangeLwc);
+
+ List<LexConInvoiceViewController.InvoiceOrderInfo> test1 = new List<LexConInvoiceViewController.InvoiceOrderInfo>();
+ for(LexConInvoiceViewController.InvoiceOrderInfo ass:LexConInvoiceViewController.invoiceOrderRecoeds){
+ ass.check = true;
+ test1.add(ass);
+ }
+ System.debug('test1==>'+test1);
+ LexConInvoiceViewController.save(invoiceorder,'娼嶅煄鐜颁唬闂ㄨ瘖閮�','0011000001g0uyhAAA','',JSON.serialize(test1),'','',acc.Id,'ET','',invoiceOrderRecoedschangeLwc);
+ }
+
+}
+
+
+static testMethod void allsave4(){
+ user curUser = [SELECT Id FROM User WHERE LastName = 'TestUser' LIMIT 1];
+ Account acc = [SELECT Id FROM Account WHERE name='Testaccount002' LIMIT 1];
+ Account hosp1 = [SELECT Id FROM Account WHERE name='Testhosp001' LIMIT 1];
+ Account agency1 = [SELECT Id FROM Account WHERE name='Testhosp001' LIMIT 1];
+ Account agency2 = [SELECT Id FROM Account WHERE name='Testhosp002' LIMIT 1];
+ system.runAs(curUser){
+
+ //鍙戠エ淇℃伅
+ Consumable_order__c invoiceorder = new Consumable_order__c();
+ invoiceorder.Name='202306164590';
+ invoiceorder.Invoice_Date__c = Date.today();
+ // invoiceorder.Order_ForCustomerText__c = '娑堝寲绉�';
+ invoiceorder.Invoice_Note__c = '4444';
+ invoiceorder.RecordTypeid = '012100000006JxEAAU';
+ invoiceorder.Invoice_status__c='鑽夋涓�';
+ invoiceorder.Order_type__c = '鍙戠エ';
+ // invoiceorder.Order_ForHospital__c = hosp1.Id;
+ insert invoiceorder;
+ //鍙戠エ淇℃伅
+ Consumable_order__c invoiceorder1 = new Consumable_order__c();
+ invoiceorder1.Name='202306164590';
+ invoiceorder1.Invoice_Date__c = Date.today();
+ invoiceorder1.Order_ForCustomerText__c = '娑堝寲绉�';
+ invoiceorder1.Invoice_Note__c = '4444';
+ invoiceorder1.RecordTypeid = '012100000006JxEAAU';
+ invoiceorder1.Invoice_status__c='鑽夋涓�';
+ invoiceorder1.Order_type__c = '鍙戠エ';
+ // invoiceorder.Order_ForHospital__c = hosp1.Id;
+ insert invoiceorder1;
+
+
+
+ // invoiceorder = [select id,Name from Consumable_order__c where id =:invoiceorder.id];
+ Consumable_order__c testList2 = new Consumable_order__c(
+ Name='Test1',
+ Summons_Sale_Status__c='鍑鸿揣',
+ SummonsStatus_c__c='宸插畬鎴�',
+ SummonsForDirction__c='鐩存帴閿�鍞粰鍖婚櫌',
+ Order_status__c='鑽夋涓�',
+ Order_type__c='浼犵エ',
+ Dealer_info__c=acc.Id,
+ Invoice_Date__c = Date.today());
+
+ insert testList2;
+ String invoiceOrderRecoedschangeLwc = JSON.serialize(LexConInvoiceViewController.invoiceOrderRecoedschange);
+ //涓嶉渶瑕佽緭鍏ョ瀹�
+ LexConInvoiceViewController.save(invoiceorder1,'娼嶅煄鐜颁唬闂ㄨ瘖閮�','',agency1.Id,'[{"check": false,"esd": {"Id": "a2K0l000000x1KXEAY","Order_ForHospital__c": "0011000001k1K9ZAAU","Name": "DB-FY2024-04-Z316244","Outbound_Date__c": "2023-06-09","ShipmentAccount__c": "闈掑矝鐩堟捣鍖婚櫌","Shipment_total_amount__c": 848,"RrturnPro_total_amount__c": 0,"Total_Invoiced_Procount__c": 0,"InvoiceNotPro_total_amount__c": 848,"InvoiceNotPro_money__c": 848, "Invoice_total_amount__c": 0,"Billed_Status__c": "杩樻病寮�绁�","Order_ForHospital__r": {"Name": "闈掑矝鐩堟捣鍖婚櫌","Id": "0011000001k1K9ZAAU"}},"needInvoiceCount": 0,"oldCheck": false,"Id": "a2K0l000000x1KXEAY"}, {"check": true,"esd": {"Id": "a2K0l000000xAnwEAE","Order_ForHospital__c": "0011000001g0uyhAAA","Name": "a2K0l000000xAnw","Outbound_Date__c": "2023-05-12","ShipmentAccount__c": "娼嶅煄鐜颁唬闂ㄨ瘖閮�", "Shipment_total_amount__c": 2300,"RrturnPro_total_amount__c": 0,"Total_Invoiced_Procount__c": 0,"InvoiceNotPro_total_amount__c": 2300,"InvoiceNotPro_money__c": 2300,"Invoice_total_amount__c": 0,"Billed_Status__c": "杩樻病寮�绁�","Order_ForHospital__r": {"Name": "娼嶅煄鐜颁唬闂ㄨ瘖閮�","Id": "0011000001g0uyhAAA"} }, "needInvoiceCount": 0,"oldCheck": false, "Id": "a2K0l000000xAnwEAE"}]',testList2.Id,'',acc.Id,'ET','',invoiceOrderRecoedschangeLwc);
+
+
+
+
+ //LexConInvoiceViewController.save(invoiceorder,'娼嶅煄鐜颁唬闂ㄨ瘖閮�','',agency2.Id,'[{"check": false,"esd": {"Id": "a2K0l000000x1KXEAY","Order_ForHospital__c": "0011000001k1K9ZAAU","Name": "DB-FY2024-04-Z316244","Outbound_Date__c": "2023-06-09","ShipmentAccount__c": "闈掑矝鐩堟捣鍖婚櫌","Shipment_total_amount__c": 848,"RrturnPro_total_amount__c": 0,"Total_Invoiced_Procount__c": 0,"InvoiceNotPro_total_amount__c": 848,"InvoiceNotPro_money__c": 848, "Invoice_total_amount__c": 0,"Billed_Status__c": "杩樻病寮�绁�","Order_ForHospital__r": {"Name": "闈掑矝鐩堟捣鍖婚櫌","Id": "0011000001k1K9ZAAU"}},"needInvoiceCount": 0,"oldCheck": false,"Id": "a2K0l000000x1KXEAY"}, {"check": false,"esd": {"Id": "a2K0l000000xAnwEAE","Order_ForHospital__c": "0011000001g0uyhAAA","Name": "a2K0l000000xAnw","Outbound_Date__c": "2023-05-12","ShipmentAccount__c": "娼嶅煄鐜颁唬闂ㄨ瘖閮�", "Shipment_total_amount__c": 2300,"RrturnPro_total_amount__c": 0,"Total_Invoiced_Procount__c": 0,"InvoiceNotPro_total_amount__c": 2300,"InvoiceNotPro_money__c": 2300,"Invoice_total_amount__c": 0,"Billed_Status__c": "杩樻病寮�绁�","Order_ForHospital__r": {"Name": "娼嶅煄鐜颁唬闂ㄨ瘖閮�","Id": "0011000001g0uyhAAA"} }, "needInvoiceCount": 0,"oldCheck": false, "Id": "a2K0l000000xAnwEAE"}]',testList2.Id,invoiceorder.Id,myAccount1.Id,'ET','isreopen',invoiceOrderRecoedschangeLwc);
+ // LexConInvoiceViewController.save(invoiceorder1,'娼嶅煄鐜颁唬闂ㄨ瘖閮�','',agency2.Id,'[{"check": false,"esd": {"Id": "a2K0l000000x1KXEAY","Order_ForHospital__c": "0011000001k1K9ZAAU","Name": "DB-FY2024-04-Z316244","Outbound_Date__c": "2023-06-09","ShipmentAccount__c": "闈掑矝鐩堟捣鍖婚櫌","Shipment_total_amount__c": 848,"RrturnPro_total_amount__c": 0,"Total_Invoiced_Procount__c": 0,"InvoiceNotPro_total_amount__c": 848,"InvoiceNotPro_money__c": 848, "Invoice_total_amount__c": 0,"Billed_Status__c": "杩樻病寮�绁�","Order_ForHospital__r": {"Name": "闈掑矝鐩堟捣鍖婚櫌","Id": "0011000001k1K9ZAAU"}},"needInvoiceCount": 0,"oldCheck": false,"Id": "a2K0l000000x1KXEAY"}, {"check": false,"esd": {"Id": "a2K0l000000xAnwEAE","Order_ForHospital__c": "0011000001g0uyhAAA","Name": "a2K0l000000xAnw","Outbound_Date__c": "2023-05-12","ShipmentAccount__c": "娼嶅煄鐜颁唬闂ㄨ瘖閮�", "Shipment_total_amount__c": 2300,"RrturnPro_total_amount__c": 0,"Total_Invoiced_Procount__c": 0,"InvoiceNotPro_total_amount__c": 2300,"InvoiceNotPro_money__c": 2300,"Invoice_total_amount__c": 0,"Billed_Status__c": "杩樻病寮�绁�","Order_ForHospital__r": {"Name": "娼嶅煄鐜颁唬闂ㄨ瘖閮�","Id": "0011000001g0uyhAAA"} }, "needInvoiceCount": 0,"oldCheck": false, "Id": "a2K0l000000xAnwEAE"}]',testList2.Id,invoiceorder1.Id,myAccount1.Id,'ET','isreopen',invoiceOrderRecoedschangeLwc);
+
+ }
+}
+
+static testMethod void allsave5(){
+ user curUser = [SELECT Id FROM User WHERE LastName = 'TestUser' LIMIT 1];
+ Account acc = [SELECT Id FROM Account WHERE name='Testaccount002' LIMIT 1];
+ system.runAs(curUser){
+ //浜у搧淇℃伅
+ Product2 prod01 = new Product2(Name='Test01',ProductCode='Test01',Asset_Model_No__c = 'Test01',SFDA_Status__c = '鏈夊姽',Dealer_special_Object__c = true,Manual_Entry__c = false);
+ Product2 prod02 = new Product2(Name='Test02',ProductCode='Test02',Asset_Model_No__c = 'Test02',SFDA_Status__c = '鏈夊姽',Dealer_special_Object__c = true,Manual_Entry__c = false);
+ insert new Product2[] {prod01, prod02};
+
+ Product2__c pro1 = new Product2__c(Name='Pro001',OT_CODE_Text__c='Test001',Product2__c = prod01.Id);
+ Product2__c pro2 = new Product2__c(Name='Pro002',OT_CODE_Text__c='Test002',Product2__c = prod02.Id);
+ insert new Product2__c[] {pro1, pro2};
+List<Consumable_order__c> orderList = new List<Consumable_order__c>();
+ //鍙戠エ淇℃伅
+ Consumable_order__c invoiceorder = new Consumable_order__c();
+ invoiceorder.Name='202306164590';
+ invoiceorder.Invoice_Date__c = Date.today();
+ // invoiceorder.Order_ForCustomerText__c = '娑堝寲绉�';
+ invoiceorder.Invoice_Note__c = '4444';
+ invoiceorder.RecordTypeid = '012100000006JxEAAU';
+ invoiceorder.Invoice_status__c='鑽夋涓�';
+ invoiceorder.Order_type__c = '鍙戠エ';
+ // invoiceorder.Order_ForHospital__c = hosp1.Id;
+ orderList.add(invoiceorder);
+ //鍙戠エ淇℃伅
+ Consumable_order__c invoiceorder1 = new Consumable_order__c();
+ invoiceorder1.Name='202306164590';
+ invoiceorder1.Invoice_Date__c = Date.today();
+ invoiceorder1.Order_ForCustomerText__c = '娑堝寲绉�';
+ invoiceorder1.Invoice_Note__c = '4444';
+ invoiceorder1.RecordTypeid = '012100000006JxEAAU';
+ invoiceorder1.Invoice_status__c='鑽夋涓�';
+ invoiceorder1.Order_type__c = '鍙戠エ';
+ // invoiceorder.Order_ForHospital__c = hosp1.Id;
+ orderList.add(invoiceorder1);
+ Consumable_order__c testList2 = new Consumable_order__c(
+ Name='Test1',
+ Summons_Sale_Status__c='鍑鸿揣',
+ SummonsStatus_c__c='宸插畬鎴�',
+ SummonsForDirction__c='鐩存帴閿�鍞粰鍖婚櫌',
+ Order_status__c='鑽夋涓�',
+ Order_type__c='浼犵エ',
+ Dealer_info__c=acc.Id,
+ Invoice_Date__c = Date.today());
+ orderList.add(testList2);
+ //鍑哄簱鍗�
+ Consumable_order__c testList1 = new Consumable_order__c(
+ Name='Test1',
+ Summons_Sale_Status__c='鍑鸿揣',
+ SummonsStatus_c__c='宸插畬鎴�',
+ SummonsForDirction__c='鐩存帴閿�鍞粰鍖婚櫌',
+ Order_status__c='鑽夋涓�',
+ Order_type__c='浼犵エ',
+ Dealer_info__c=acc.Id);
+ orderList.add(testList1);
+ insert orderList;
+ List<Consumable_orderdetails__c> conList = new List<Consumable_orderdetails__c>();
+ //鍑哄簱鍗�1鏄庣粏1
+ Consumable_orderdetails__c orderdet1 = new Consumable_orderdetails__c();
+ orderdet1.Name = 'Test1_001001';
+ //orderdet1.Consumable_principal__c = testList1.Id;
+ orderdet1.Consumable_order__c = invoiceorder1.Id;
+ orderdet1.RecordTypeId = System.Label.RT_ConOrderDetail1_Invoice;
+ orderdet1.Consumable_count__c = 1;
+ orderdet1.Consumable_product__c = pro1.Id;
+ orderdet1.Shipment_Count__c = 10;
+ orderdet1.Invoiced_Procount__c = 4;
+ orderdet1.RrturnPro_count__c = 2;
+ conList.add(orderdet1);
+
+ Consumable_order_LinkTable__c order_LinkTable1 = new Consumable_order_LinkTable__c(Name='order_LinkTable1',Outboundorder_Code_link__c = testList1.Id,Invoice_Code_link__c =invoiceorder1.Id);
+ insert order_LinkTable1;
+ Consumable_Orderdetails__c upDateform = new Consumable_Orderdetails__c();
+ upDateform.Name = 'Test1_001001';
+ upDateform.Consumable_order__c = invoiceorder1.Id;
+ upDateform.RecordTypeId = System.Label.RT_ConOrderDetail1_Invoice;
+ upDateform.Consumable_count__c = 1;
+ upDateform.Consumable_product__c = pro1.Id;
+ upDateform.Consumable_order__c = order_LinkTable1.Outboundorder_Code_link__c;
+ conList.add(upDateform);
+ insert conList;
+ String invoiceOrderRecoedschangeLwc = JSON.serialize(LexConInvoiceViewController.invoiceOrderRecoedschange);
+ LexConInvoiceViewController.save(invoiceorder1,'娼嶅煄鐜颁唬闂ㄨ瘖閮�','0011000001k1K9ZAAU','','[{"check": true,"esd": {"Id": "a2K0l000000x1KXEAY","Order_ForHospital__c": "0011000001k1K9ZAAU","Name": "DB-FY2024-04-Z316244","Outbound_Date__c": "2023-06-09","ShipmentAccount__c": "闈掑矝鐩堟捣鍖婚櫌","Shipment_total_amount__c": 848,"RrturnPro_total_amount__c": 0,"Total_Invoiced_Procount__c": 0,"InvoiceNotPro_total_amount__c": 848,"InvoiceNotPro_money__c": 848, "Invoice_total_amount__c": 0,"Billed_Status__c": "杩樻病寮�绁�","Order_ForHospital__r": {"Name": "闈掑矝鐩堟捣鍖婚櫌","Id": "0011000001k1K9ZAAU"}},"needInvoiceCount": 0,"oldCheck": false,"Id": "a2K0l000000x1KXEAY"}]',testList1.Id,invoiceorder1.Id,acc.Id,'ET','isreopen',invoiceOrderRecoedschangeLwc);
+ // LexConInvoiceViewController.save(invoiceorder1,'娼嶅煄鐜颁唬闂ㄨ瘖閮�','0011000001k1K9ZAAU','','[{"check": true,"esd": {"Id": "a2K0l000000x1KXEAY","Order_ForHospital__c": "0011000001k1K9ZAAU","Name": "DB-FY2024-04-Z316244","Outbound_Date__c": "2023-06-09","ShipmentAccount__c": "闈掑矝鐩堟捣鍖婚櫌","Shipment_total_amount__c": 848,"RrturnPro_total_amount__c": 0,"Total_Invoiced_Procount__c": 0,"InvoiceNotPro_total_amount__c": 848,"InvoiceNotPro_money__c": 848, "Invoice_total_amount__c": 0,"Billed_Status__c": "杩樻病寮�绁�","Order_ForHospital__r": {"Name": "闈掑矝鐩堟捣鍖婚櫌","Id": "0011000001k1K9ZAAU"}},"needInvoiceCount": 0,"oldCheck": false,"Id": "a2K0l000000x1KXEAY"}]',testList1.Id,'',myAccount1.Id,'ET','isreopen',invoiceOrderRecoedschangeLwc);
+ }
+}
+
+static testMethod void allsave6(){
+ user curUser = [SELECT Id FROM User WHERE LastName = 'TestUser' LIMIT 1];
+ Account acc = [SELECT Id FROM Account WHERE name='Testaccount002' LIMIT 1];
+ system.runAs(curUser){
+ //浜у搧淇℃伅
+ Product2 prod01 = new Product2(Name='Test01',ProductCode='Test01',Asset_Model_No__c = 'Test01',SFDA_Status__c = '鏈夊姽',Dealer_special_Object__c = true,Manual_Entry__c = false);
+ Product2 prod02 = new Product2(Name='Test02',ProductCode='Test02',Asset_Model_No__c = 'Test02',SFDA_Status__c = '鏈夊姽',Dealer_special_Object__c = true,Manual_Entry__c = false);
+ insert new Product2[] {prod01, prod02};
+
+ Product2__c pro1 = new Product2__c(Name='Pro001',OT_CODE_Text__c='Test001',Product2__c = prod01.Id);
+ Product2__c pro2 = new Product2__c(Name='Pro002',OT_CODE_Text__c='Test002',Product2__c = prod02.Id);
+ insert new Product2__c[] {pro1, pro2};
+ List<Consumable_order__c> orderList = new List<Consumable_order__c>();
+ //鍙戠エ淇℃伅
+ Consumable_order__c invoiceorder = new Consumable_order__c();
+ invoiceorder.Name='202306164590';
+ invoiceorder.Invoice_Date__c = Date.today();
+ // invoiceorder.Order_ForCustomerText__c = '娑堝寲绉�';
+ invoiceorder.Invoice_Note__c = '4444';
+ invoiceorder.RecordTypeid = '012100000006JxEAAU';
+ invoiceorder.Invoice_status__c='鑽夋涓�';
+ invoiceorder.Order_type__c = '鍙戠エ';
+ // invoiceorder.Order_ForHospital__c = hosp1.Id;
+ orderList.add(invoiceorder);
+ //鍙戠エ淇℃伅
+ Consumable_order__c invoiceorder1 = new Consumable_order__c();
+ invoiceorder1.Name='202306164590';
+ invoiceorder1.Invoice_Date__c = Date.today();
+ invoiceorder1.Order_ForCustomerText__c = '娑堝寲绉�';
+ invoiceorder1.Invoice_Note__c = '4444';
+ invoiceorder1.RecordTypeid = '012100000006JxEAAU';
+ invoiceorder1.Invoice_status__c='鑽夋涓�';
+ invoiceorder1.Order_type__c = '鍙戠エ';
+ // invoiceorder.Order_ForHospital__c = hosp1.Id;
+ orderList.add(invoiceorder1);
+ Consumable_order__c testList2 = new Consumable_order__c(
+ Name='Test1',
+ Summons_Sale_Status__c='鍑鸿揣',
+ SummonsStatus_c__c='宸插畬鎴�',
+ SummonsForDirction__c='鐩存帴閿�鍞粰鍖婚櫌',
+ Order_status__c='鑽夋涓�',
+ Order_type__c='浼犵エ',
+ Dealer_info__c=acc.Id,
+ Invoice_Date__c = Date.today());
+ orderList.add(testList2);
+ //鍑哄簱鍗�
+ Consumable_order__c testList1 = new Consumable_order__c(
+ Name='Test1',
+ Summons_Sale_Status__c='鍑鸿揣',
+ SummonsStatus_c__c='宸插畬鎴�',
+ SummonsForDirction__c='鐩存帴閿�鍞粰鍖婚櫌',
+ Order_status__c='鑽夋涓�',
+ Order_type__c='浼犵エ',
+ Dealer_info__c=acc.Id);
+ orderList.add(testList1);
+ insert orderList;
+ List<Consumable_orderdetails__c> conList = new List<Consumable_orderdetails__c>();
+ //鍑哄簱鍗�1鏄庣粏1
+ Consumable_orderdetails__c orderdet1 = new Consumable_orderdetails__c();
+ orderdet1.Name = 'Test1_001001';
+ //orderdet1.Consumable_principal__c = testList1.Id;
+ orderdet1.Consumable_order__c = testList1.Id;
+ orderdet1.RecordTypeId = System.Label.RT_ConOrderDetail1_Invoice;
+ orderdet1.Consumable_count__c = 1;
+ orderdet1.Consumable_product__c = pro1.Id;
+ conList.add(orderdet1);
+
+ Consumable_order_LinkTable__c order_LinkTable1 = new Consumable_order_LinkTable__c(Name='order_LinkTable1',Outboundorder_Code_link__c =invoiceorder1.Id,Invoice_Code_link__c =invoiceorder1.Id);
+ insert order_LinkTable1;
+ Consumable_Orderdetails__c upDateform = new Consumable_Orderdetails__c();
+ upDateform.Name = 'Test1_001001';
+ //orderdet1.Consumable_principal__c = testList1.Id;
+ upDateform.Consumable_order__c = invoiceorder1.Id;
+ upDateform.RecordTypeId = System.Label.RT_ConOrderDetail1_Invoice;
+ upDateform.Consumable_count__c = 1;
+ upDateform.Consumable_product__c = pro1.Id;
+ upDateform.Consumable_order__c = order_LinkTable1.Outboundorder_Code_link__c;
+ upDateform.RrturnPro_count__c = 10;
+ conList.add(upDateform);
+ insert conList;
+ String invoiceOrderRecoedschangeLwc = JSON.serialize(LexConInvoiceViewController.invoiceOrderRecoedschange);
+ LexConInvoiceViewController.save(invoiceorder1,'娼嶅煄鐜颁唬闂ㄨ瘖閮�','0011000001k1K9ZAAU','','[{"check": false,"esd": {"Id": "a2K0l000000x1KXEAY","Order_ForHospital__c": "0011000001k1K9ZAAU","Name": "DB-FY2024-04-Z316244","Outbound_Date__c": "2023-06-09","ShipmentAccount__c": "闈掑矝鐩堟捣鍖婚櫌","Shipment_total_amount__c": 848,"RrturnPro_total_amount__c": 0,"Total_Invoiced_Procount__c": 0,"InvoiceNotPro_total_amount__c": 848,"InvoiceNotPro_money__c": 848, "Invoice_total_amount__c": 0,"Billed_Status__c": "杩樻病寮�绁�","Order_ForHospital__r": {"Name": "闈掑矝鐩堟捣鍖婚櫌","Id": "0011000001k1K9ZAAU"}},"needInvoiceCount": 0,"oldCheck": false,"Id": "a2K0l000000x1KXEAY"}]',testList1.Id,invoiceorder1.Id,acc.Id,'ET','','[{"check": false,"esd": {"Id": "a2K0l000000x1KXEAY","Order_ForHospital__c": "0011000001k1K9ZAAU","Name": "DB-FY2024-04-Z316244","Outbound_Date__c": "2023-06-09","ShipmentAccount__c": "闈掑矝鐩堟捣鍖婚櫌","Shipment_total_amount__c": 848,"RrturnPro_total_amount__c": 0,"Total_Invoiced_Procount__c": 0,"InvoiceNotPro_total_amount__c": 848,"InvoiceNotPro_money__c": 848, "Invoice_total_amount__c": 0,"Billed_Status__c": "杩樻病寮�绁�","Order_ForHospital__r": {"Name": "闈掑矝鐩堟捣鍖婚櫌","Id": "0011000001k1K9ZAAU"}},"needInvoiceCount": 0,"oldCheck": false,"Id": "a2K0l000000x1KXEAY"}]');
+ LexConInvoiceViewController.save(invoiceorder1,'娼嶅煄鐜颁唬闂ㄨ瘖閮�','0011000001k1K9ZAAU','','[{"check": true,"esd": {"Id": "a2K0l000000x1KXEAY","Order_ForHospital__c": "0011000001k1K9ZAAU","Name": "DB-FY2024-04-Z316244","Outbound_Date__c": "2023-06-09","ShipmentAccount__c": "闈掑矝鐩堟捣鍖婚櫌","Shipment_total_amount__c": 848,"RrturnPro_total_amount__c": 0,"Total_Invoiced_Procount__c": 0,"InvoiceNotPro_total_amount__c": 848,"InvoiceNotPro_money__c": 848, "Invoice_total_amount__c": 0,"Billed_Status__c": "杩樻病寮�绁�","Order_ForHospital__r": {"Name": "闈掑矝鐩堟捣鍖婚櫌","Id": "0011000001k1K9ZAAU"}},"needInvoiceCount": 0,"oldCheck": false,"Id": "a2K0l000000x1KXEAY"}]','',invoiceorder1.Id,acc.Id,'ET','','[{"check": false,"esd": {"Id": "a2K0l000000x1KXEAY","Order_ForHospital__c": "0011000001k1K9ZAAU","Name": "DB-FY2024-04-Z316244","Outbound_Date__c": "2023-06-09","ShipmentAccount__c": "闈掑矝鐩堟捣鍖婚櫌","Shipment_total_amount__c": 848,"RrturnPro_total_amount__c": 0,"Total_Invoiced_Procount__c": 0,"InvoiceNotPro_total_amount__c": 848,"InvoiceNotPro_money__c": 848, "Invoice_total_amount__c": 0,"Billed_Status__c": "杩樻病寮�绁�","Order_ForHospital__r": {"Name": "闈掑矝鐩堟捣鍖婚櫌","Id": "0011000001k1K9ZAAU"}},"needInvoiceCount": 0,"oldCheck": false,"Id": "a2K0l000000x1KXEAY"}]');
+ LexConInvoiceViewController.save(invoiceorder1,'娼嶅煄鐜颁唬闂ㄨ瘖閮�','0011000001k1K9ZAAU','','[{"check": false,"esd": {"Id": "a2K0l000000x1KXEAY","Order_ForHospital__c": "0011000001k1K9ZAAU","Name": "DB-FY2024-04-Z316244","Outbound_Date__c": "2023-06-09","ShipmentAccount__c": "闈掑矝鐩堟捣鍖婚櫌","Shipment_total_amount__c": 848,"RrturnPro_total_amount__c": 0,"Total_Invoiced_Procount__c": 0,"InvoiceNotPro_total_amount__c": 848,"InvoiceNotPro_money__c": 848, "Invoice_total_amount__c": 0,"Billed_Status__c": "杩樻病寮�绁�","Order_ForHospital__r": {"Name": "闈掑矝鐩堟捣鍖婚櫌","Id": "0011000001k1K9ZAAU"}},"needInvoiceCount": 0,"oldCheck": false,"Id": "a2K0l000000x1KXEAY"}]','',invoiceorder1.Id,acc.Id,'ET','','[{"check": false,"esd": {"Id": "a2K0l000000x1KXEAY","Order_ForHospital__c": "0011000001k1K9ZAAU","Name": "DB-FY2024-04-Z316244","Outbound_Date__c": "2023-06-09","ShipmentAccount__c": "闈掑矝鐩堟捣鍖婚櫌","Shipment_total_amount__c": 848,"RrturnPro_total_amount__c": 0,"Total_Invoiced_Procount__c": 0,"InvoiceNotPro_total_amount__c": 848,"InvoiceNotPro_money__c": 848, "Invoice_total_amount__c": 0,"Billed_Status__c": "杩樻病寮�绁�","Order_ForHospital__r": {"Name": "闈掑矝鐩堟捣鍖婚櫌","Id": "0011000001k1K9ZAAU"}},"needInvoiceCount": 0,"oldCheck": false,"Id": "a2K0l000000x1KXEAY"}]');
+ }
+}
+
+static testMethod void allsave7(){
+ user curUser = [SELECT Id FROM User WHERE LastName = 'TestUser' LIMIT 1];
+ Account acc = [SELECT Id FROM Account WHERE name='Testaccount002' LIMIT 1];
+ system.runAs(curUser){
+ //浜у搧淇℃伅
+ Product2 prod01 = new Product2(Name='Test01',ProductCode='Test01',Asset_Model_No__c = 'Test01',SFDA_Status__c = '鏈夊姽',Dealer_special_Object__c = true,Manual_Entry__c = false);
+ Product2 prod02 = new Product2(Name='Test02',ProductCode='Test02',Asset_Model_No__c = 'Test02',SFDA_Status__c = '鏈夊姽',Dealer_special_Object__c = true,Manual_Entry__c = false);
+ insert new Product2[] {prod01, prod02};
+
+ Product2__c pro1 = new Product2__c(Name='Pro001',OT_CODE_Text__c='Test001',Product2__c = prod01.Id);
+ Product2__c pro2 = new Product2__c(Name='Pro002',OT_CODE_Text__c='Test002',Product2__c = prod02.Id);
+ insert new Product2__c[] {pro1, pro2};
+ List<Consumable_order__c> orderList = new List<Consumable_order__c>();
+ //鍙戠エ淇℃伅
+ Consumable_order__c invoiceorder = new Consumable_order__c();
+ invoiceorder.Name='202306164590';
+ invoiceorder.Invoice_Date__c = Date.today();
+ // invoiceorder.Order_ForCustomerText__c = '娑堝寲绉�';
+ invoiceorder.Invoice_Note__c = '4444';
+ invoiceorder.RecordTypeid = '012100000006JxEAAU';
+ invoiceorder.Invoice_status__c='鑽夋涓�';
+ invoiceorder.Order_type__c = '鍙戠エ';
+ // invoiceorder.Order_ForHospital__c = hosp1.Id;
+ orderList.add(invoiceorder);
+ //鍙戠エ淇℃伅
+ Consumable_order__c invoiceorder1 = new Consumable_order__c();
+ invoiceorder1.Name='202306164590';
+ invoiceorder1.Invoice_Date__c = Date.today();
+ invoiceorder1.Order_ForCustomerText__c = '娑堝寲绉�';
+ invoiceorder1.Invoice_Note__c = '4444';
+ invoiceorder1.RecordTypeid = '012100000006JxEAAU';
+ invoiceorder1.Invoice_status__c='鑽夋涓�';
+ invoiceorder1.Order_type__c = '鍙戠エ';
+ // invoiceorder.Order_ForHospital__c = hosp1.Id;
+ orderList.add(invoiceorder1);
+ Consumable_order__c testList2 = new Consumable_order__c(
+ Name='Test1',
+ Summons_Sale_Status__c='鍑鸿揣',
+ SummonsStatus_c__c='宸插畬鎴�',
+ SummonsForDirction__c='鐩存帴閿�鍞粰鍖婚櫌',
+ Order_status__c='鑽夋涓�',
+ Order_type__c='浼犵エ',
+ Dealer_info__c=acc.Id,
+ Invoice_Date__c = Date.today());
+ orderList.add(testList2);
+ //鍑哄簱鍗�
+ Consumable_order__c testList1 = new Consumable_order__c(
+ Name='Test1',
+ Summons_Sale_Status__c='鍑鸿揣',
+ SummonsStatus_c__c='宸插畬鎴�',
+ SummonsForDirction__c='鐩存帴閿�鍞粰鍖婚櫌',
+ Order_status__c='鑽夋涓�',
+ Order_type__c='浼犵エ',
+ Dealer_info__c=acc.Id);
+ orderList.add(testList1);
+ insert orderList;
+ List<Consumable_orderdetails__c> conList = new List<Consumable_orderdetails__c>();
+ //鍑哄簱鍗�1鏄庣粏1
+ Consumable_orderdetails__c orderdet1 = new Consumable_orderdetails__c();
+ orderdet1.Name = 'Test1_001001';
+ //orderdet1.Consumable_principal__c = testList1.Id;
+ orderdet1.Consumable_order__c = testList1.Id;
+ orderdet1.RecordTypeId = System.Label.RT_ConOrderDetail1_Invoice;
+ orderdet1.Consumable_count__c = 1;
+ orderdet1.Consumable_product__c = pro1.Id;
+ conList.add(orderdet1);
+
+ Consumable_order_LinkTable__c order_LinkTable1 = new Consumable_order_LinkTable__c(Name='order_LinkTable1',Outboundorder_Code_link__c =invoiceorder1.Id,Invoice_Code_link__c =invoiceorder1.Id);
+ insert order_LinkTable1;
+ Consumable_Orderdetails__c upDateform = new Consumable_Orderdetails__c();
+ upDateform.Name = 'Test1_001001';
+ //orderdet1.Consumable_principal__c = testList1.Id;
+ upDateform.Consumable_order__c = invoiceorder1.Id;
+ upDateform.RecordTypeId = System.Label.RT_ConOrderDetail1_Invoice;
+ upDateform.Consumable_count__c = 1;
+ upDateform.Consumable_product__c = pro1.Id;
+ upDateform.Consumable_order__c = order_LinkTable1.Outboundorder_Code_link__c;
+ upDateform.RrturnPro_count__c = 10;
+ conList.add(upDateform);
+ insert conList;
+ String invoiceOrderRecoedschangeLwc = JSON.serialize(LexConInvoiceViewController.invoiceOrderRecoedschange);
+ LexConInvoiceViewController.save(invoiceorder1,'娼嶅煄鐜颁唬闂ㄨ瘖閮�','0011000001k1K9ZAAU','','[{"check": true,"esd": {"Id": "a2K0l000000x1KXEAY","Order_ForHospital__c": "0011000001k1K9ZAAU","Name": "DB-FY2024-04-Z316244","Outbound_Date__c": "2023-06-09","ShipmentAccount__c": "闈掑矝鐩堟捣鍖婚櫌","Shipment_total_amount__c": 848,"RrturnPro_total_amount__c": 0,"Total_Invoiced_Procount__c": 0,"InvoiceNotPro_total_amount__c": 848,"InvoiceNotPro_money__c": 848, "Invoice_total_amount__c": 0,"Billed_Status__c": "杩樻病寮�绁�","Order_ForHospital__r": {"Name": "闈掑矝鐩堟捣鍖婚櫌","Id": "0011000001k1K9ZAAU"}},"needInvoiceCount": 0,"oldCheck": false,"Id": "a2K0l000000x1KXEAY"},{"check": false,"esd": {"Id": "a2K0l000000x1KXEAY","Order_ForHospital__c": "0011000001k1K9ZAAU","Name": "DB-FY2024-04-Z316244","Outbound_Date__c": "2023-06-09","ShipmentAccount__c": "闈掑矝鐩堟捣鍖婚櫌","Shipment_total_amount__c": 848,"RrturnPro_total_amount__c": 0,"Total_Invoiced_Procount__c": 0,"InvoiceNotPro_total_amount__c": 848,"InvoiceNotPro_money__c": 848,"Invoice_total_amount__c": 0,"Billed_Status__c": "杩樻病寮�绁�","Order_ForHospital__r": {"Name": "闈掑矝鐩堟捣鍖婚櫌","Id": "0011000001k1K9ZAAU"}},"needInvoiceCount": 0,"oldCheck": false}]','',invoiceorder1.Id,acc.Id,'ET','','[{"check": false,"esd": {"Id": "a2K0l000000x1KXEAY","Order_ForHospital__c": "0011000001k1K9ZAAU","Name": "DB-FY2024-04-Z316244","Outbound_Date__c": "2023-06-09","ShipmentAccount__c": "闈掑矝鐩堟捣鍖婚櫌","Shipment_total_amount__c": 848,"RrturnPro_total_amount__c": 0,"Total_Invoiced_Procount__c": 0,"InvoiceNotPro_total_amount__c": 848,"InvoiceNotPro_money__c": 848, "Invoice_total_amount__c": 0,"Billed_Status__c": "杩樻病寮�绁�","Order_ForHospital__r": {"Name": "闈掑矝鐩堟捣鍖婚櫌","Id": "0011000001k1K9ZAAU"}},"needInvoiceCount": 0,"oldCheck": false,"Id": "a2K0l000000x1KXEAY"}]');
+ // LexConInvoiceViewController.save(invoiceorder1,'娼嶅煄鐜颁唬闂ㄨ瘖閮�','0011000001k1K9ZAAU','','[{"check": false,"esd": {"Id": "a2K0l000000x1KXEAY","Order_ForHospital__c": "0011000001k1K9ZAAU","Name": "DB-FY2024-04-Z316244","Outbound_Date__c": "2023-06-09","ShipmentAccount__c": "闈掑矝鐩堟捣鍖婚櫌","Shipment_total_amount__c": 848,"RrturnPro_total_amount__c": 0,"Total_Invoiced_Procount__c": 0,"InvoiceNotPro_total_amount__c": 848,"InvoiceNotPro_money__c": 848, "Invoice_total_amount__c": 0,"Billed_Status__c": "杩樻病寮�绁�","Order_ForHospital__r": {"Name": "闈掑矝鐩堟捣鍖婚櫌","Id": "0011000001k1K9ZAAU"}},"needInvoiceCount": 0,"oldCheck": false,"Id": "a2K0l000000x1KXEAY"}]','',invoiceorder1.Id,myAccount1.Id,'ET','','[{"check": false,"esd": {"Id": "a2K0l000000x1KXEAY","Order_ForHospital__c": "0011000001k1K9ZAAU","Name": "DB-FY2024-04-Z316244","Outbound_Date__c": "2023-06-09","ShipmentAccount__c": "闈掑矝鐩堟捣鍖婚櫌","Shipment_total_amount__c": 848,"RrturnPro_total_amount__c": 0,"Total_Invoiced_Procount__c": 0,"InvoiceNotPro_total_amount__c": 848,"InvoiceNotPro_money__c": 848, "Invoice_total_amount__c": 0,"Billed_Status__c": "杩樻病寮�绁�","Order_ForHospital__r": {"Name": "闈掑矝鐩堟捣鍖婚櫌","Id": "0011000001k1K9ZAAU"}},"needInvoiceCount": 0,"oldCheck": false,"Id": "a2K0l000000x1KXEAY"}]');
+ }
+}
+
+
+}
\ No newline at end of file
diff --git a/force-app/main/default/classes/LexConInvoiceViewControllerTest.cls-meta.xml b/force-app/main/default/classes/LexConInvoiceViewControllerTest.cls-meta.xml
index a9fd6e9..754ecb1 100644
--- a/force-app/main/default/classes/LexConInvoiceViewControllerTest.cls-meta.xml
+++ b/force-app/main/default/classes/LexConInvoiceViewControllerTest.cls-meta.xml
@@ -1,4 +1,4 @@
-<?xml version="1.0" encoding="UTF-8" ?>
+<?xml version="1.0" encoding="UTF-8"?>
<ApexClass xmlns="http://soap.sforce.com/2006/04/metadata">
<apiVersion>57.0</apiVersion>
<status>Active</status>
diff --git a/force-app/main/default/classes/LexConInvoicedetailsController.cls b/force-app/main/default/classes/LexConInvoicedetailsController.cls
index 039e19e..b863861 100644
--- a/force-app/main/default/classes/LexConInvoicedetailsController.cls
+++ b/force-app/main/default/classes/LexConInvoicedetailsController.cls
@@ -34,11 +34,7 @@
sumPrice = 0;
coc = new Consumable_order__c();
//鍑哄簱鍗曚俊鎭�
- coc = [
- SELECT Id, Name, Outbound_Date__c, Order_ForDealerText__c, Dealer_Info__c
- FROM Consumable_order__c
- WHERE Id = :orderId
- ];
+ coc = [SELECT Id, Name, Outbound_Date__c, Order_ForDealerText__c, Dealer_Info__c FROM Consumable_order__c WHERE Id = :orderId];
//鍙戠エ淇℃伅
invoicecode = [
SELECT Id, Name, ShipmentAccount__c, Order_ForCustomerText__c, Order_ForDealerText__c, Dealer_Info__c
@@ -399,4 +395,4 @@
Invoice_UnitOptsMap.put('涓�', '涓�');
}
}
-}
+}
\ No newline at end of file
diff --git a/force-app/main/default/classes/LexConInvoicedetailsControllerTest.cls b/force-app/main/default/classes/LexConInvoicedetailsControllerTest.cls
index 80a9a3c..db10c23 100644
--- a/force-app/main/default/classes/LexConInvoicedetailsControllerTest.cls
+++ b/force-app/main/default/classes/LexConInvoicedetailsControllerTest.cls
@@ -1,164 +1,68 @@
@isTest
private class LexConInvoicedetailsControllerTest {
@isTest
- static void all() {
+ static void all() {
User myUser_test;
Account myAccount1;
Account myAccount2;
- User thisUser = [SELECT Id FROM User WHERE Id = :UserInfo.getUserId()];
- System.runAs(thisUser) {
- Profile prof = [
- SELECT Id
- FROM Profile
- WHERE Name = '901_缁忛攢鍟嗙ぞ鍖烘櫘閫氭潈闄恄2閲嶉獙璇�(ET)'
- ];
- List<RecordType> rectCo = [
- SELECT Id
- FROM RecordType
- WHERE IsActive = TRUE AND SobjectType = 'Account' AND Name = '璨╁2搴�'
- ];
+ User thisUser = [ select Id from User where Id = :UserInfo.getUserId()];
+ System.runAs(thisUser){
+ Profile prof = [select Id from Profile where Name ='901_缁忛攢鍟嗙ぞ鍖烘櫘閫氭潈闄恄2閲嶉獙璇�(ET)'];
+ List<RecordType> rectCo = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '璨╁2搴�'];
if (rectCo.size() == 0) {
return;
}
- List<RecordType> rectHos = [
- SELECT Id
- FROM RecordType
- WHERE IsActive = TRUE AND SobjectType = 'Account' AND Name = '鐥呴櫌'
- ];
+ List<RecordType> rectHos = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '鐥呴櫌'];
if (rectHos.size() == 0) {
return;
}
- myAccount1 = new Account(Name = 'testaccount001', Dealer_discount__c = 10, RecordTypeId = rectCo[0].Id);
- myAccount2 = new Account(Name = 'testaccount002', Dealer_discount__c = 20, RecordTypeId = rectHos[0].Id);
+ myAccount1 = new Account(Name='testaccount001',Dealer_discount__c =10,RecordTypeId = rectCo[0].Id );
+ myAccount2 = new Account(Name='testaccount002',Dealer_discount__c =20,RecordTypeId = rectHos[0].Id );
insert myAccount1;
- insert myAccount2;
- Contact core = new Contact(
- email = 'jplumber@salesforce.com',
- firstname = 'Joe',
- lastname = 'Plumber',
- accountid = myAccount1.id
- );
+ insert myAccount2;
+ Contact core = new Contact(email='jplumber@salesforce.com', firstname='Joe',lastname='Plumber',accountid=myAccount1.id);
insert core;
- myUser_test = new User(
- ContactId = core.id,
- Alias = 'newUser',
- Email = 'newuser@testorg.com',
- EmailEncodingKey = 'UTF-8',
- LastName = 'TestUser',
- LanguageLocaleKey = 'zh_CN',
- LocaleSidKey = 'zh_CN',
- ProfileId = prof.Id,
- TimeZoneSidKey = 'Asia/Shanghai',
- UserName = 'testUser@testorg.com',
- UserPro_Type__c = 'ENG',
- Work_Location__c = '鍖椾含'
- );
+ myUser_test = New User(ContactId = core.id, Alias = 'newUser', Email='newuser@testorg.com', EmailEncodingKey='UTF-8', LastName='TestUser', LanguageLocaleKey='zh_CN', LocaleSidKey='zh_CN', ProfileId = prof.Id, TimeZoneSidKey='Asia/Shanghai', UserName='testUser@testorg.com', UserPro_Type__c='ENG', Work_Location__c='鍖椾含');
insert myUser_test;
}
- System.runAs(myUser_test) {
+ System.runAs(myUser_test){
//浜у搧淇℃伅
- Product2 prod01 = new Product2(
- Name = 'Test01',
- ProductCode = 'Test01',
- Asset_Model_No__c = 'Test01',
- SFDA_Status__c = '鏈夊姽',
- Dealer_special_Object__c = true,
- Packing_list_manual__c = 1,
- Manual_Entry__c = false
- );
- Product2 prod02 = new Product2(
- Name = 'Test02',
- ProductCode = 'Test02',
- Asset_Model_No__c = 'Test02',
- SFDA_Status__c = '鏈夊姽',
- Dealer_special_Object__c = true,
- Packing_list_manual__c = 1,
- Manual_Entry__c = false
- );
- Product2 prod03 = new Product2(
- Name = 'Test03',
- ProductCode = 'Test03',
- Asset_Model_No__c = 'Test03',
- SFDA_Status__c = '鏈夊姽',
- Dealer_special_Object__c = true,
- Packing_list_manual__c = 1,
- Manual_Entry__c = false
- );
- Product2 prod04 = new Product2(
- Name = 'Test04',
- ProductCode = 'Test04',
- Asset_Model_No__c = 'Test04',
- SFDA_Status__c = '鏈夊姽',
- Dealer_special_Object__c = true,
- Packing_list_manual__c = 2,
- Manual_Entry__c = false
- );
- Product2 prod05 = new Product2(
- Name = 'Test05',
- ProductCode = 'Test05',
- Asset_Model_No__c = 'Test05',
- SFDA_Status__c = '鏈夊姽',
- Dealer_special_Object__c = true,
- Packing_list_manual__c = 1,
- Manual_Entry__c = false
- );
- Product2 prod06 = new Product2(
- Name = 'Test06',
- ProductCode = 'Test06',
- Asset_Model_No__c = 'Test06',
- SFDA_Status__c = '鏈夊姽',
- Dealer_special_Object__c = true,
- Packing_list_manual__c = 1,
- Manual_Entry__c = false
- );
- insert new List<Product2>{ prod01, prod02, prod03, prod04, prod05, prod06 };
- Product2__c pro1 = new Product2__c(Name = 'Pro001', OT_CODE_Text__c = 'Test001', Product2__c = prod01.Id);
- Product2__c pro2 = new Product2__c(Name = 'Pro002', OT_CODE_Text__c = 'Test002', Product2__c = prod02.Id);
- Product2__c pro3 = new Product2__c(Name = 'Pro004', OT_CODE_Text__c = 'Test004', Product2__c = prod03.Id);
- Product2__c pro4 = new Product2__c(Name = 'Pro005', OT_CODE_Text__c = 'Test005', Product2__c = prod04.Id);
- Product2__c pro5 = new Product2__c(Name = 'Pro003', OT_CODE_Text__c = 'Test003', Product2__c = prod05.Id);
- Product2__c pro6 = new Product2__c(Name = 'Pro006', OT_CODE_Text__c = 'Test006', Product2__c = prod06.Id);
- insert new List<Product2__c>{ pro4, pro5, pro6, pro1, pro2, pro3 };
+ Product2 prod01 = new Product2(Name='Test01',ProductCode='Test01',Asset_Model_No__c = 'Test01',SFDA_Status__c = '鏈夊姽',Dealer_special_Object__c = true,Packing_list_manual__c=1,Manual_Entry__c = false);
+ Product2 prod02 = new Product2(Name='Test02',ProductCode='Test02',Asset_Model_No__c = 'Test02',SFDA_Status__c = '鏈夊姽',Dealer_special_Object__c = true,Packing_list_manual__c=1,Manual_Entry__c = false);
+ Product2 prod03 = new Product2(Name='Test03',ProductCode='Test03',Asset_Model_No__c = 'Test03',SFDA_Status__c = '鏈夊姽',Dealer_special_Object__c = true,Packing_list_manual__c=1,Manual_Entry__c = false);
+ Product2 prod04 = new Product2(Name='Test04',ProductCode='Test04',Asset_Model_No__c = 'Test04',SFDA_Status__c = '鏈夊姽',Dealer_special_Object__c = true,Packing_list_manual__c=2,Manual_Entry__c = false);
+ Product2 prod05 = new Product2(Name='Test05',ProductCode='Test05',Asset_Model_No__c = 'Test05',SFDA_Status__c = '鏈夊姽',Dealer_special_Object__c = true,Packing_list_manual__c=1,Manual_Entry__c = false);
+ Product2 prod06 = new Product2(Name='Test06',ProductCode='Test06',Asset_Model_No__c = 'Test06',SFDA_Status__c = '鏈夊姽',Dealer_special_Object__c = true,Packing_list_manual__c=1,Manual_Entry__c = false);
+ insert new Product2[] {prod01, prod02,prod03,prod04, prod05, prod06};
+ Product2__c pro1 = new Product2__c(Name='Pro001',OT_CODE_Text__c='Test001',Product2__c = prod01.Id);
+ Product2__c pro2 = new Product2__c(Name='Pro002',OT_CODE_Text__c='Test002',Product2__c = prod02.Id);
+ Product2__c pro3 = new Product2__c(Name='Pro004',OT_CODE_Text__c='Test004',Product2__c = prod03.Id);
+ Product2__c pro4 = new Product2__c(Name='Pro005',OT_CODE_Text__c='Test005',Product2__c = prod04.Id);
+ Product2__c pro5 = new Product2__c(Name='Pro003',OT_CODE_Text__c='Test003',Product2__c = prod05.Id);
+ Product2__c pro6 = new Product2__c(Name='Pro006',OT_CODE_Text__c='Test006',Product2__c = prod06.Id);
+ insert new Product2__c[] {pro4, pro5,pro6,pro1, pro2, pro3};
//鍙戠エ
Consumable_order__c invoiceorder = new Consumable_order__c();
- invoiceorder.Name = 'invoice02';
+ invoiceorder.Name='invoice02';
invoiceorder.Order_type__c = '鍙戠エ';
- invoiceorder.Invoice_status__c = '宸插畬鎴�';
+ invoiceorder.Invoice_status__c='宸插畬鎴�';
invoiceorder.Invoice_Date__c = Date.today();
invoiceorder.RecordTypeid = System.Label.RT_ConOrder_Invoice;
- invoiceorder.Dealer_info__c = myAccount1.Id;
+ invoiceorder.Dealer_info__c= myAccount1.Id;
// createId.Order_ForHospital__c = myAccount2.Id;
- invoiceorder.SummonsForDirction__c = '鐩存帴閿�鍞粰鍖婚櫌';
- invoiceorder.Order_status__c = '鑽夋涓�';
+ invoiceorder.SummonsForDirction__c='鐩存帴閿�鍞粰鍖婚櫌';
+ invoiceorder.Order_status__c='鑽夋涓�';
insert invoiceorder;
//鍑哄簱鍗曚俊鎭�
- //鍑哄簱鍗�
- Consumable_order__c testList1 = new Consumable_order__c(
- Name = 'Test1',
- Summons_Sale_Status__c = '鍑鸿揣',
- SummonsStatus_c__c = '宸插畬鎴�',
- SummonsForDirction__c = '鐩存帴閿�鍞粰鍖婚櫌',
- Order_status__c = '鑽夋涓�',
- Order_type__c = '浼犵エ',
- Dealer_info__c = myAccount1.Id,
- ConInvoice_Code__c = invoiceorder.id
- );
- Consumable_order__c testList2 = new Consumable_order__c(
- Name = 'Test2',
- Summons_Sale_Status__c = '鍑鸿揣',
- SummonsStatus_c__c = '宸插畬鎴�',
- SummonsForDirction__c = '鐩存帴閿�鍞粰鍖婚櫌',
- Order_status__c = '宸叉彁浜�',
- Order_type__c = '浼犵エ',
- Dealer_info__c = myAccount1.Id,
- ConInvoice_Code__c = invoiceorder.id
- );
+ //鍑哄簱鍗�
+ Consumable_order__c testList1 = new Consumable_order__c(Name='Test1',Summons_Sale_Status__c='鍑鸿揣',SummonsStatus_c__c='宸插畬鎴�',SummonsForDirction__c='鐩存帴閿�鍞粰鍖婚櫌',Order_status__c='鑽夋涓�',Order_type__c='浼犵エ',Dealer_info__c=myAccount1.Id,ConInvoice_Code__c = invoiceorder.id);
+ Consumable_order__c testList2 = new Consumable_order__c(Name='Test2',Summons_Sale_Status__c='鍑鸿揣',SummonsStatus_c__c='宸插畬鎴�',SummonsForDirction__c='鐩存帴閿�鍞粰鍖婚櫌',Order_status__c='宸叉彁浜�',Order_type__c='浼犵エ',Dealer_info__c=myAccount1.Id,ConInvoice_Code__c = invoiceorder.id);
TestList1.Order_date__c = Date.today().addDays(2);
TestList2.Order_date__c = Date.today().addDays(2);
TestList1.Order_date__c = Date.today();
- TestList2.Deliver_date__c = Date.today();
- insert new List<Consumable_order__c>{ testList1, testList2 };
+ TestList2.Deliver_date__c=Date.today();
+ insert new Consumable_order__c[]{testList1,testList2};
List<Consumable_Orderdetails__c> invoiceList = new List<Consumable_Orderdetails__c>();
//鍙戠エ鏄庣粏1
@@ -173,10 +77,10 @@
invoicedet1.Shipment_Count__c = 1;
invoicedet1.Invoice_Unitprice__c = 1;
invoicedet1.Delivery_List_RMB__c = 1;
- invoicedet1.InvoicedProCost_RMB__c = 1;
+ invoicedet1.InvoicedProCost_RMB__c =1;
invoicedet1.Invoice_Unit__c = '涓�';
- invoicedet1.Invoiced_Procount__c = 3;
- invoicedet1.RrturnPro_count__c = 3;
+ invoicedet1.Invoiced_Procount__c = 3;
+ invoicedet1.RrturnPro_count__c =3;
invoiceList.add(invoicedet1);
Consumable_orderdetails__c invoicedet2 = new Consumable_orderdetails__c();
@@ -190,10 +94,10 @@
invoicedet2.Shipment_Count__c = 1;
invoicedet2.Invoice_Unitprice__c = 1;
invoicedet2.Delivery_List_RMB__c = 1;
- invoicedet2.InvoicedProCost_RMB__c = 1;
+ invoicedet2.InvoicedProCost_RMB__c =1;
invoicedet2.Invoice_Unit__c = '涓�';
- invoicedet2.Invoiced_Procount__c = 3;
- invoicedet2.RrturnPro_count__c = 3;
+ invoicedet2.Invoiced_Procount__c = 3;
+ invoicedet2.RrturnPro_count__c =3;
invoiceList.add(invoicedet2);
Consumable_orderdetails__c invoicedet3 = new Consumable_orderdetails__c();
@@ -209,8 +113,8 @@
invoicedet3.Delivery_List_RMB__c = 2.0;
invoicedet3.Invoice_Unitprice__c = 1;
invoicedet3.InvoicedProCost_RMB__c = 1;
- invoicedet3.Invoiced_Procount__c = 3;
- invoicedet3.RrturnPro_count__c = 3;
+ invoicedet3.Invoiced_Procount__c = 3;
+ invoicedet3.RrturnPro_count__c =3;
invoiceList.add(invoicedet3);
insert invoiceList;
@@ -228,8 +132,8 @@
orderdet1.Delivery_List_RMB__c = 2.0;
orderdet1.Invoice_Unitprice__c = 1;
orderdet1.InvoicedProCost_RMB__c = 1;
- orderdet1.Invoiced_Procount__c = 3;
- orderdet1.RrturnPro_count__c = 3;
+ orderdet1.Invoiced_Procount__c = 3;
+ orderdet1.RrturnPro_count__c =3;
orderdet1.Invoice_Unit__c = '涓�';
codList.add(orderdet1);
@@ -244,8 +148,8 @@
orderdet2.Delivery_List_RMB__c = 2.0;
orderdet2.Invoice_Unitprice__c = 1;
orderdet2.InvoicedProCost_RMB__c = 1;
- orderdet2.Invoiced_Procount__c = 3;
- orderdet2.RrturnPro_count__c = 3;
+ orderdet2.Invoiced_Procount__c = 3;
+ orderdet2.RrturnPro_count__c =3;
orderdet2.Invoice_Unit__c = '鐩�';
codList.add(orderdet2);
@@ -260,11 +164,12 @@
orderdet3.Delivery_List_RMB__c = 2.0;
orderdet3.Invoice_Unitprice__c = 1;
orderdet3.InvoicedProCost_RMB__c = 1;
- orderdet3.Invoiced_Procount__c = 3;
- orderdet3.RrturnPro_count__c = 3;
+ orderdet3.Invoiced_Procount__c = 3;
+ orderdet3.RrturnPro_count__c =3;
orderdet3.Invoice_Unit__c = '涓�';
- orderdet3.Invoiced_Count__c = 3;
+ orderdet3.Invoiced_Count__c= 3;
codList.add(orderdet3);
+
Consumable_orderdetails__c orderdet4 = new Consumable_orderdetails__c();
orderdet4.Name = 'Test1_0010031';
@@ -277,10 +182,10 @@
orderdet4.Delivery_List_RMB__c = 2.0;
orderdet4.Invoice_Unitprice__c = 1;
orderdet4.InvoicedProCost_RMB__c = 1;
- orderdet4.Invoiced_Procount__c = 3;
- orderdet4.RrturnPro_count__c = 3;
+ orderdet4.Invoiced_Procount__c = 3;
+ orderdet4.RrturnPro_count__c =3;
orderdet4.Invoice_Unit__c = '鐩�';
- orderdet4.Invoiced_Count__c = 3;
+ orderdet4.Invoiced_Count__c= 3;
codList.add(orderdet4);
Consumable_orderdetails__c orderdet5 = new Consumable_orderdetails__c();
@@ -293,9 +198,9 @@
orderdet5.Invoice_Unit__c = '涓�';
orderdet5.Shipment_Count__c = 11;
orderdet5.Delivery_List_RMB__c = 2.0;
- orderdet5.Invoiced_Procount__c = 3;
- orderdet5.RrturnPro_count__c = 3;
- orderdet5.Invoiced_Count__c = 3;
+ orderdet5.Invoiced_Procount__c = 3;
+ orderdet5.RrturnPro_count__c =3;
+ orderdet5.Invoiced_Count__c= 3;
codList.add(orderdet5);
Consumable_orderdetails__c orderdet6 = new Consumable_orderdetails__c();
@@ -308,9 +213,9 @@
orderdet6.Invoice_Unit__c = '鐩�';
orderdet6.Shipment_Count__c = 11;
orderdet6.Delivery_List_RMB__c = 2.0;
- orderdet6.Invoiced_Procount__c = 3;
- orderdet6.RrturnPro_count__c = 3;
- orderdet6.Invoiced_Count__c = 3;
+ orderdet6.Invoiced_Procount__c = 3;
+ orderdet6.RrturnPro_count__c =3;
+ orderdet6.Invoiced_Count__c= 3;
codList.add(orderdet6);
Consumable_orderdetails__c orderdet7 = new Consumable_orderdetails__c();
@@ -324,33 +229,31 @@
orderdet7.Invoice_Unit__c = '涓�';
orderdet7.Shipment_Count__c = 11;
orderdet7.Delivery_List_RMB__c = 2.0;
- orderdet7.Invoiced_Procount__c = 3;
- orderdet7.Invoiced_Count__c = 3;
- orderdet7.RrturnPro_count__c = 3;
+ orderdet7.Invoiced_Procount__c = 3;
+ orderdet7.Invoiced_Count__c= 3;
+ orderdet7.RrturnPro_count__c =3;
codList.add(orderdet7);
insert codList;
- LexConInvoicedetailsController.init(testList1.Id, invoiceorder.Id);
+ LexConInvoicedetailsController.init(testList1.Id,invoiceorder.Id);
//搴忓垪鍖朖son
+
System.Test.startTest();
- System.debug('===>鏁版嵁' + LexConInvoicedetailsController.consumableorderdetails1Records);
+ System.debug('===>鏁版嵁'+LexConInvoicedetailsController.consumableorderdetails1Records);
List<LexConInvoicedetailsController.ConsumableorderdetailsInfo> inList = LexConInvoicedetailsController.consumableorderdetails1Records;
- LexConInvoicedetailsController.save(
- JSON.serialize(LexConInvoicedetailsController.consumableorderdetails1Records),
- invoiceorder.Id,
- testList1.Id
- );
+ LexConInvoicedetailsController.save(JSON.serialize(LexConInvoicedetailsController.consumableorderdetails1Records),invoiceorder.Id,testList1.Id);
- List<LexConInvoicedetailsController.ConsumableorderdetailsInfo> inList1 = new List<LexConInvoicedetailsController.ConsumableorderdetailsInfo>();
- for (LexConInvoicedetailsController.ConsumableorderdetailsInfo ass : inList) {
- ass.check = true;
- ass.invoiceCount = 1;
+ List<LexConInvoicedetailsController.ConsumableorderdetailsInfo> inList1 = new List<LexConInvoicedetailsController.ConsumableorderdetailsInfo>();
+ for(LexConInvoicedetailsController.ConsumableorderdetailsInfo ass:inList){
+ ass.check= true;
+ ass.invoiceCount= 1;
ass.esd.Invoice_Unit__c = '涓�';
inList1.add(ass);
}
- LexConInvoicedetailsController.save(JSON.serialize(inList1), invoiceorder.Id, testList1.Id);
+ LexConInvoicedetailsController.save(JSON.serialize(inList1),invoiceorder.Id,testList1.Id);
System.Test.stopTest();
+
}
}
-}
+}
\ No newline at end of file
diff --git a/force-app/main/default/classes/LexConInvoicedetailsControllerTest.cls-meta.xml b/force-app/main/default/classes/LexConInvoicedetailsControllerTest.cls-meta.xml
index a9fd6e9..754ecb1 100644
--- a/force-app/main/default/classes/LexConInvoicedetailsControllerTest.cls-meta.xml
+++ b/force-app/main/default/classes/LexConInvoicedetailsControllerTest.cls-meta.xml
@@ -1,4 +1,4 @@
-<?xml version="1.0" encoding="UTF-8" ?>
+<?xml version="1.0" encoding="UTF-8"?>
<ApexClass xmlns="http://soap.sforce.com/2006/04/metadata">
<apiVersion>57.0</apiVersion>
<status>Active</status>
diff --git a/force-app/main/default/classes/LexConsumableAccountController.cls b/force-app/main/default/classes/LexConsumableAccountController.cls
index 781fa20..19c44c7 100644
--- a/force-app/main/default/classes/LexConsumableAccountController.cls
+++ b/force-app/main/default/classes/LexConsumableAccountController.cls
@@ -43,11 +43,7 @@
pageSize = pageSizeLWC;
pageToken = pageTokenLWC > 2000 ? 2000 : pageTokenLWC;
- User Useracc = [
- SELECT accountid, UserPro_Type__c
- FROM user
- WHERE id = :UserInfo.getUserId()
- ];
+ User Useracc = [SELECT accountid, UserPro_Type__c FROM user WHERE id = :UserInfo.getUserId()];
accountId = [SELECT id, Name FROM account WHERE id = :Useracc.accountid].id;
agencyProType = Useracc.UserPro_Type__c;
if (String.isBlank(Useracc.UserPro_Type__c)) {
@@ -148,22 +144,28 @@
Date thisDatetime2 = Date.newInstance(thisYear, 4, 1);
Date nextDatetime = Date.newInstance(nextYear, 4, 1);
- AggregateResult[] arList = null;
-
+ //AggregateResult[] arList = null;
+ AggregateResult[] arList = new List<AggregateResult>();
System.debug('fiscalYear = ' + fiscalYear);
if (fiscalYear == 'thisYear') {
AggregateResult[] saleAmountList = LexConsumableAccountSOQL.getAccountTotalSales(thisDatetime, nextDatetime);
- topInfo.saleAmount = Decimal.valueOf(String.valueOf(saleAmountList[0].get('saleAmount')));
+ Object saleAmountObject = saleAmountList[0].get('saleAmount');
+ topInfo.saleAmount = saleAmountObject != null ? Decimal.valueOf(String.valueOf(saleAmountObject)) : Decimal.valueOf('0');
+ //topInfo.saleAmount = Decimal.valueOf(String.valueOf(saleAmountList[0].get('saleAmount')));
System.debug('topInfo.saleAmount = ' + topInfo.saleAmount);
arList = LexConsumableAccountSOQL.getAccountBySales(thisDatetime, nextDatetime);
} else if (fiscalYear == 'lastYear') {
AggregateResult[] saleAmountList = LexConsumableAccountSOQL.getAccountTotalSales(lastDatetime, thisDatetime2);
- topInfo.saleAmount = Decimal.valueOf(String.valueOf(saleAmountList[0].get('saleAmount')));
+ //topInfo.saleAmount = Decimal.valueOf(String.valueOf(saleAmountList[0].get('saleAmount')));
+ Object saleAmountObject = saleAmountList[0].get('saleAmount');
+ topInfo.saleAmount = saleAmountObject != null ? Decimal.valueOf(String.valueOf(saleAmountObject)) : Decimal.valueOf('0');
System.debug('topInfo.saleAmount = ' + topInfo.saleAmount);
arList = LexConsumableAccountSOQL.getAccountBySales(lastDatetime, thisDatetime2);
} else {
AggregateResult[] saleAmountList = LexConsumableAccountSOQL.getAccountTotalSales(lastDatetime, nextDatetime);
- topInfo.saleAmount = Decimal.valueOf(String.valueOf(saleAmountList[0].get('saleAmount')));
+ //topInfo.saleAmount = Decimal.valueOf(String.valueOf(saleAmountList[0].get('saleAmount')));
+ Object saleAmountObject = saleAmountList[0].get('saleAmount');
+ topInfo.saleAmount = saleAmountObject != null ? Decimal.valueOf(String.valueOf(saleAmountObject)) : Decimal.valueOf('0');
System.debug('topInfo.saleAmount = ' + topInfo.saleAmount);
arList = LexConsumableAccountSOQL.getAccountBySales(lastDatetime, nextDatetime);
}
@@ -186,7 +188,7 @@
// for (String key : mapTemp.keySet()) {
// sortedMap.put(key, mapTemp.get(key));
// }
-
+
// System.debug('Sorted Map: ' + sortedMap);
//鏌ヨ瀹㈡埛淇℃伅锛堝悕绉帮紝鐪侊紝鍘匡級
@@ -194,9 +196,9 @@
List<String> accountList = new List<String>();
for (AggregateResult ar : arList) {
System.debug('thisAmount = ' + String.valueOf(ar.get('thisAmount')));
- if (String.valueOf(ar.get('thisAmount')) != '0.0') {
+ if(String.valueOf(ar.get('thisAmount')) != '0.0'){
accountList.add(String.valueOf(ar.get('Order_ForHospital__c')));
- topInfo.deList.add(Decimal.valueOf(String.valueOf(ar.get('thisAmount'))));
+ topInfo.deList.add(Decimal.valueOf(String.valueOf(ar.get('thisAmount'))));
}
}
@@ -267,7 +269,8 @@
Date thisDatetime2 = Date.newInstance(thisYear, 4, 1);
Date nextDatetime = Date.newInstance(nextYear, 4, 1);
- AggregateResult[] arList = null;
+ //AggregateResult[] arList = null;
+ AggregateResult[] arList = new List<AggregateResult>();
System.debug('fiscalYear = ' + fiscalYear);
System.debug('thisYear = ' + thisYear);
@@ -276,21 +279,27 @@
if (fiscalYear == 'thisYear') {
AggregateResult[] saleAmountList = LexConsumableAccountSOQL.getAccountTotalSales(thisDatetime, nextDatetime);
if (saleAmountList[0].get('saleAmount') != null) {
- topInfo.saleAmount = Decimal.valueOf(String.valueOf(saleAmountList[0].get('saleAmount')));
+ //topInfo.saleAmount = Decimal.valueOf(String.valueOf(saleAmountList[0].get('saleAmount')));
+ Object saleAmountObject = saleAmountList[0].get('saleAmount');
+ topInfo.saleAmount = saleAmountObject != null ? Decimal.valueOf(String.valueOf(saleAmountObject)) : Decimal.valueOf('0');
System.debug('topInfo.saleAmount = ' + topInfo.saleAmount);
}
arList = LexConsumableAccountSOQL.getAccountBySales(thisDatetime, nextDatetime);
} else if (fiscalYear == 'lastYear') {
AggregateResult[] saleAmountList = LexConsumableAccountSOQL.getAccountTotalSales(lastDatetime, thisDatetime2);
if (saleAmountList[0].get('saleAmount') != null) {
- topInfo.saleAmount = Decimal.valueOf(String.valueOf(saleAmountList[0].get('saleAmount')));
+ //topInfo.saleAmount = Decimal.valueOf(String.valueOf(saleAmountList[0].get('saleAmount')));
+ Object saleAmountObject = saleAmountList[0].get('saleAmount');
+ topInfo.saleAmount = saleAmountObject != null ? Decimal.valueOf(String.valueOf(saleAmountObject)) : Decimal.valueOf('0');
System.debug('topInfo.saleAmount = ' + topInfo.saleAmount);
}
arList = LexConsumableAccountSOQL.getAccountBySales(lastDatetime, thisDatetime2);
} else {
AggregateResult[] saleAmountList = LexConsumableAccountSOQL.getAccountTotalSales(lastDatetime, nextDatetime);
if (saleAmountList[0].get('saleAmount') != null) {
- topInfo.saleAmount = Decimal.valueOf(String.valueOf(saleAmountList[0].get('saleAmount')));
+ //topInfo.saleAmount = Decimal.valueOf(String.valueOf(saleAmountList[0].get('saleAmount')));
+ Object saleAmountObject = saleAmountList[0].get('saleAmount');
+ topInfo.saleAmount = saleAmountObject != null ? Decimal.valueOf(String.valueOf(saleAmountObject)) : Decimal.valueOf('0');
System.debug('topInfo.saleAmount = ' + topInfo.saleAmount);
}
arList = LexConsumableAccountSOQL.getAccountBySales(lastDatetime, nextDatetime);
@@ -372,7 +381,7 @@
List<Account> allSelectAccount = Database.query(soql);
totalCount = allSelectAccount.size();
- String nullFL = sortOrder.toLowerCase() == 'asc' ? 'NULLS FIRST' : 'NULLS LAST';
+ String nullFL = sortOrder.toLowerCase() == 'asc' ? 'NULLS FIRST': 'NULLS LAST';
if (String.isNotBlank(sortField)) {
soql += ' order by ' + sortField + ' ' + sortOrder + ' ' + nullFL;
}
@@ -454,4 +463,4 @@
deList = new List<Decimal>();
}
}
-}
+}
\ No newline at end of file
diff --git a/force-app/main/default/classes/LexConsumableAccountControllerTest.cls b/force-app/main/default/classes/LexConsumableAccountControllerTest.cls
index f433d01..dcc6515 100644
--- a/force-app/main/default/classes/LexConsumableAccountControllerTest.cls
+++ b/force-app/main/default/classes/LexConsumableAccountControllerTest.cls
@@ -3,187 +3,181 @@
public static Account account1 = new Account();
public static Account account2 = new Account();
public static Account account3 = new Account();
- public static Account consumable = new Account();
- public static Contact contact1 = new Contact();
+ public static Account consumable = new Account();
+ public static Contact contact1 = new Contact();
public static User user = new User();
public static Agency_Hospital_Link__c agency_hospital_link = new Agency_Hospital_Link__c();
- static testMethod void testMethod1() {
- User thisUser = [SELECT Id FROM User WHERE Id = :UserInfo.getUserId()];
- System.runAs(thisUser) {
- // 鍙栧紩鍏�
- account1.Name = 'test1鍖婚櫌';
- account1.RecordTypeId = '01210000000QemG';
- // account1.Is_Active__c = '鑽夋涓�';
- insert account1;
+ static testMethod void testMethod1(){
+ User thisUser = [ select Id from User where Id = :UserInfo.getUserId()];
+ System.runAs(thisUser){
+ List<Account> accList = new List<Account>();
+ // 鍙栧紩鍏�
+ account1.Name = 'test1鍖婚櫌';
+ account1.RecordTypeId = '01210000000QemG';
+ // account1.Is_Active__c = '鑽夋涓�';
+ accList.add(account1);
- account2.Name = 'test2鍖婚櫌';
- account2.RecordTypeId = '01210000000QemG';
- // account2.Is_Active__c = '鏈夊姽';
- insert account2;
+ account2.Name = 'test2鍖婚櫌';
+ account2.RecordTypeId = '01210000000QemG';
+ // account2.Is_Active__c = '鏈夊姽';
+ accList.add(account2);
+
+ account3.Name = 'test3鍖婚櫌';
+ account3.RecordTypeId = '01210000000QemG';
+ // account3.Is_Active__c = '鐢宠涓�';
+ accList.add(account3);
+ insert accList;
+
+ consumable.Name = 'test1缁忛攢鍟�';
+ consumable.RecordTypeId = '01210000000Qem1';
+ insert consumable;
+
+ contact1.AccountId = account1.Id;
+ contact1.FirstName = '璨换鑰�';
+ contact1.LastName = 'test1鍖婚櫌';
+ insert contact1;
+
+ // 銉︺兗銈躲兗
+ Profile p = [select Id from Profile where Name = '901_缁忛攢鍟嗙ぞ鍖烘櫘閫氭潈闄�'];
+ user.ProfileId = p.Id;
+ user.ContactId = contact1.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 = consumable.Id;
+ agency_hospital_link.OwnerId = user.Id;
+ insert agency_hospital_link;
- account3.Name = 'test3鍖婚櫌';
- account3.RecordTypeId = '01210000000QemG';
- // account3.Is_Active__c = '鐢宠涓�';
- insert account3;
- consumable.Name = 'test1缁忛攢鍟�';
- consumable.RecordTypeId = '01210000000Qem1';
- insert consumable;
+
+ }
+ System.runAs(user){
+ //璁㈠崟
+ Consumable_order__c Order1 = new Consumable_order__c();
+ Order1.Name = 'OCM_01_001';
+ Order1.Order_status__c = '鎵瑰噯';
+ Order1.Order_type__c = '鍒拌揣';
+ Order1.Dealer_Info__c = account1.Id;
+ Order1.RecordTypeid = '01210000000c9dqAAA';
+ Order1.Order_ProType__c = 'ET';
+ Order1.Order_ForHospital__c = account1.Id;
+ insert Order1;
- contact1.AccountId = account1.Id;
- contact1.FirstName = '璨换鑰�';
- contact1.LastName = 'test1鍖婚櫌';
- insert contact1;
+
- // 銉︺兗銈躲兗
- Profile p = [
- SELECT Id
- FROM Profile
- WHERE Name = '901_缁忛攢鍟嗙ぞ鍖烘櫘閫氭潈闄�'
- ];
- user.ProfileId = p.Id;
- user.ContactId = contact1.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;
+ Consumable_Orderdetails__c con = new Consumable_Orderdetails__c();
+ con.Consumable_order__c = Order1.Id;
+ insert con;
- // 浠g悊搴楀尰闄�
- agency_hospital_link.Name = 'test1浠g悊搴楀尰闄�';
- agency_hospital_link.Hospital__c = account1.Id;
- agency_hospital_link.Agency__c = consumable.Id;
- agency_hospital_link.OwnerId = user.Id;
- insert agency_hospital_link;
- }
- System.runAs(user) {
- //璁㈠崟
- Consumable_order__c Order1 = new Consumable_order__c();
- Order1.Name = 'OCM_01_001';
- Order1.Order_status__c = '鎵瑰噯';
- Order1.Order_type__c = '鍒拌揣';
- Order1.Dealer_Info__c = account1.Id;
- Order1.RecordTypeid = '01210000000c9dqAAA';
- Order1.Order_ProType__c = 'ET';
- Order1.Order_ForHospital__c = account1.Id;
- insert Order1;
-
- Consumable_Orderdetails__c con = new Consumable_Orderdetails__c();
- con.Consumable_order__c = Order1.Id;
- insert con;
-
- LexConsumableAccountController.init(2, 1, 'thisYear');
- LexConsumableAccountController.init(2, 1, 'lastYear');
- LexConsumableAccountController.init(2, 1, '2023');
- LexConsumableAccountController.changeFiscalYearView('thisYear');
- LexConsumableAccountController.changeFiscalYearView('lastYear');
- // LexConsumableAccountController.changelistView('62. 鍖婚櫌_Hospital鐢宠涓殑鍖婚櫌',consumable.Id,'ET',1,0,'Is_Active__c','ASC');
- // LexConsumableAccountController.changelistView('63. 鍖婚櫌_Hospital涓婂懆鍒涘缓鐨勫尰闄�',consumable.Id,'ET',1,0,'Is_Active__c','ASC');
- }
+
+ LexConsumableAccountController.init(2,1,'thisYear');
+ LexConsumableAccountController.init(2,1,'lastYear');
+ LexConsumableAccountController.init(2,1,'2023');
+ LexConsumableAccountController.changeFiscalYearView('thisYear');
+ LexConsumableAccountController.changeFiscalYearView('lastYear');
+ // LexConsumableAccountController.changelistView('62. 鍖婚櫌_Hospital鐢宠涓殑鍖婚櫌',consumable.Id,'ET',1,0,'Is_Active__c','ASC');
+ // LexConsumableAccountController.changelistView('63. 鍖婚櫌_Hospital涓婂懆鍒涘缓鐨勫尰闄�',consumable.Id,'ET',1,0,'Is_Active__c','ASC');
+
}
- static testMethod void testMethod2() {
- User thisUser = [SELECT Id FROM User WHERE Id = :UserInfo.getUserId()];
- System.runAs(thisUser) {
- // 鍙栧紩鍏�
- account1.Name = 'test1鍖婚櫌';
- account1.RecordTypeId = '01210000000QemG';
- // account1.Is_Active__c = '鑽夋涓�';
- insert account1;
- account2.Name = 'test2鍖婚櫌';
- account2.RecordTypeId = '01210000000QemG';
- // account2.Is_Active__c = '鏈夊姽';
- insert account2;
- account3.Name = 'test3鍖婚櫌';
- account3.RecordTypeId = '01210000000QemG';
- // account3.Is_Active__c = '鐢宠涓�';
- insert account3;
- consumable.Name = 'test1缁忛攢鍟�';
- consumable.RecordTypeId = '01210000000Qem1';
- insert consumable;
-
- contact1.AccountId = account1.Id;
- contact1.FirstName = '璨换鑰�';
- contact1.LastName = 'test1鍖婚櫌';
- insert contact1;
-
- // 銉︺兗銈躲兗
- Profile p = [
- SELECT Id
- FROM Profile
- WHERE Name = '901_缁忛攢鍟嗙ぞ鍖烘櫘閫氭潈闄�'
- ];
- user.ProfileId = p.Id;
- user.ContactId = contact1.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 = consumable.Id;
- agency_hospital_link.OwnerId = user.Id;
- insert agency_hospital_link;
- }
- System.runAs(user) {
- PageReference page = new PageReference('/apex/ConsumableAccount');
- System.Test.setCurrentPage(page);
- ConsumableAccountController ca = new ConsumableAccountController();
- //ConsumableAccountController.getlistViewOptions();
- ca.init();
-
- ca.filterName = '61. 鍖婚櫌_Hospital鑽夋涓殑鍖婚櫌';
- ca.changelistView();
-
- ca.filterName = '62. 鍖婚櫌_Hospital鐢宠涓殑鍖婚櫌';
- ca.changelistView();
-
- ca.filterName = '63. 鍖婚櫌_Hospital涓婂懆鍒涘缓鐨勫尰闄�';
- ca.changelistView();
-
- ca.refreshPageSize();
-
- ca.sortKey = '0';
- ca.accsort();
-
- ca.sortKey = '1';
- LexConsumableAccountController.changelistView(
- '62. 鍖婚櫌_Hospital鐢宠涓殑鍖婚櫌',
- consumable.Id,
- 'ET',
- 1,
- 0,
- 'Is_Active__c',
- 'ASC'
- );
- LexConsumableAccountController.changelistView(
- '63. 鍖婚櫌_Hospital涓婂懆鍒涘缓鐨勫尰闄�',
- consumable.Id,
- 'ET',
- 1,
- 0,
- 'Is_Active__c',
- 'ASC'
- );
- }
- }
}
+static testMethod void testMethod2(){
+ User thisUser = [ select Id from User where Id = :UserInfo.getUserId()];
+ System.runAs(thisUser){
+ // 鍙栧紩鍏�
+ account1.Name = 'test1鍖婚櫌';
+ account1.RecordTypeId = '01210000000QemG';
+ // account1.Is_Active__c = '鑽夋涓�';
+ insert account1;
+
+ account2.Name = 'test2鍖婚櫌';
+ account2.RecordTypeId = '01210000000QemG';
+ // account2.Is_Active__c = '鏈夊姽';
+ insert account2;
+
+ account3.Name = 'test3鍖婚櫌';
+ account3.RecordTypeId = '01210000000QemG';
+ // account3.Is_Active__c = '鐢宠涓�';
+ insert account3;
+
+ consumable.Name = 'test1缁忛攢鍟�';
+ consumable.RecordTypeId = '01210000000Qem1';
+ insert consumable;
+
+ contact1.AccountId = account1.Id;
+ contact1.FirstName = '璨换鑰�';
+ contact1.LastName = 'test1鍖婚櫌';
+ insert contact1;
+
+ // 銉︺兗銈躲兗
+ Profile p = [select Id from Profile where Name = '901_缁忛攢鍟嗙ぞ鍖烘櫘閫氭潈闄�'];
+ user.ProfileId = p.Id;
+ user.ContactId = contact1.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 = consumable.Id;
+ agency_hospital_link.OwnerId = user.Id;
+ insert agency_hospital_link;
+ }
+ System.runAs(user){
+ PageReference page = new PageReference('/apex/ConsumableAccount');
+ System.Test.setCurrentPage(page);
+ ConsumableAccountController ca = new ConsumableAccountController();
+ //ConsumableAccountController.getlistViewOptions();
+ ca.init();
+
+ ca.filterName = '61. 鍖婚櫌_Hospital鑽夋涓殑鍖婚櫌';
+ ca.changelistView();
+
+ ca.filterName = '62. 鍖婚櫌_Hospital鐢宠涓殑鍖婚櫌';
+ ca.changelistView();
+
+ ca.filterName = '63. 鍖婚櫌_Hospital涓婂懆鍒涘缓鐨勫尰闄�';
+ ca.changelistView();
+
+ ca.refreshPageSize();
+
+ ca.sortKey = '0';
+ ca.accsort();
+
+ ca.sortKey = '1';
+ LexConsumableAccountController.changelistView('62. 鍖婚櫌_Hospital鐢宠涓殑鍖婚櫌',consumable.Id,'ET',1,0,'Is_Active__c','ASC');
+ LexConsumableAccountController.changelistView('63. 鍖婚櫌_Hospital涓婂懆鍒涘缓鐨勫尰闄�',consumable.Id,'ET',1,0,'Is_Active__c','ASC');
+
+
+ }
+}
+
+
+
+
+}
\ No newline at end of file
diff --git a/force-app/main/default/classes/LexConsumableAccountControllerTest.cls-meta.xml b/force-app/main/default/classes/LexConsumableAccountControllerTest.cls-meta.xml
index a9fd6e9..754ecb1 100644
--- a/force-app/main/default/classes/LexConsumableAccountControllerTest.cls-meta.xml
+++ b/force-app/main/default/classes/LexConsumableAccountControllerTest.cls-meta.xml
@@ -1,4 +1,4 @@
-<?xml version="1.0" encoding="UTF-8" ?>
+<?xml version="1.0" encoding="UTF-8"?>
<ApexClass xmlns="http://soap.sforce.com/2006/04/metadata">
<apiVersion>57.0</apiVersion>
<status>Active</status>
diff --git a/force-app/main/default/classes/LexConsumableAccountInfoControllerTest.cls b/force-app/main/default/classes/LexConsumableAccountInfoControllerTest.cls
index 4f063ca..20985d0 100644
--- a/force-app/main/default/classes/LexConsumableAccountInfoControllerTest.cls
+++ b/force-app/main/default/classes/LexConsumableAccountInfoControllerTest.cls
@@ -1,16 +1,19 @@
@isTest
private class LexConsumableAccountInfoControllerTest {
- @isTest
- public static void test_method_one() {
- // Implement test code
- Account account1 = new Account();
- account1.Name = 'test1鍖婚櫌';
+
+ @isTest
+ public static void test_method_one() {
+ // Implement test code
+ Account account1 = new Account();
+ account1.Name = 'test1鍖婚櫌';
account1.RecordTypeId = '01210000000QemG';
//account1.Is_Active__c = '鑽夋涓�';
insert account1;
+
LexConsumableAccountInfoController cai = new LexConsumableAccountInfoController();
LexConsumableAccountInfoController.init(account1.Id);
LexConsumableAccountInfoController.init('');
- }
-}
+ }
+
+}
\ No newline at end of file
diff --git a/force-app/main/default/classes/LexConsumableAccountInfoControllerTest.cls-meta.xml b/force-app/main/default/classes/LexConsumableAccountInfoControllerTest.cls-meta.xml
index a9fd6e9..754ecb1 100644
--- a/force-app/main/default/classes/LexConsumableAccountInfoControllerTest.cls-meta.xml
+++ b/force-app/main/default/classes/LexConsumableAccountInfoControllerTest.cls-meta.xml
@@ -1,4 +1,4 @@
-<?xml version="1.0" encoding="UTF-8" ?>
+<?xml version="1.0" encoding="UTF-8"?>
<ApexClass xmlns="http://soap.sforce.com/2006/04/metadata">
<apiVersion>57.0</apiVersion>
<status>Active</status>
diff --git a/force-app/main/default/classes/LexConsumableAccountSOQL.cls b/force-app/main/default/classes/LexConsumableAccountSOQL.cls
index 3249366..34ddbfd 100644
--- a/force-app/main/default/classes/LexConsumableAccountSOQL.cls
+++ b/force-app/main/default/classes/LexConsumableAccountSOQL.cls
@@ -1,27 +1,30 @@
public with sharing class LexConsumableAccountSOQL {
- public static AggregateResult[] getAccountBySales(Datetime thisDatetime, Datetime nextDatetime) {
- AggregateResult[] arList = new List<AggregateResult>(
- [
- SELECT
- Consumable_order__r.Order_ForHospital__c,
- Consumable_order__r.Order_ForHospital__r.name hospitalName,
- sum(Sale_amount__c) thisAmount
- FROM Consumable_Orderdetails__c
- WHERE CreatedDate >= :thisDatetime AND CreatedDate < :nextDatetime AND Consumable_order__r.Order_ForHospital__r.name != ''
- GROUP BY Consumable_order__r.Order_ForHospital__c, Consumable_order__r.Order_ForHospital__r.name
- ORDER BY sum(Sale_amount__c) DESC
- LIMIT 10
- ]
- );
+ public static AggregateResult[] getAccountBySales(Datetime thisDatetime ,Datetime nextDatetime){
+ AggregateResult[] arList = new List<AggregateResult>([
+ SELECT Consumable_order__r.Order_ForHospital__c,Consumable_order__r.Order_ForHospital__r.name hospitalName,
+ sum(Sale_amount__c) thisAmount
+ FROM Consumable_Orderdetails__c
+ WHERE
+ CreatedDate >= :thisDatetime
+ AND CreatedDate < :nextDatetime
+ AND Consumable_order__r.Order_ForHospital__r.name != ''
+ GROUP BY Consumable_order__r.Order_ForHospital__c,Consumable_order__r.Order_ForHospital__r.name
+ ORDER BY sum(Sale_amount__c) DESC
+ LIMIT 10
+ ]);
return arList;
}
- public static AggregateResult[] getAccountTotalSales(Datetime thisDatetime, Datetime nextDatetime) {
+ public static AggregateResult[] getAccountTotalSales(Datetime thisDatetime ,Datetime nextDatetime){
AggregateResult[] saleAmountList = [
SELECT sum(Sale_amount__c) saleAmount
FROM Consumable_Orderdetails__c
- WHERE CreatedDate >= :thisDatetime AND CreatedDate < :nextDatetime AND Consumable_order__r.Order_ForHospital__r.name != ''
+ WHERE CreatedDate >= :thisDatetime
+ AND CreatedDate < :nextDatetime
+ AND Consumable_order__r.Order_ForHospital__r.name != ''
];
return saleAmountList;
}
-}
+
+
+}
\ No newline at end of file
diff --git a/force-app/main/default/classes/LexConsumableAccountSOQLTest.cls b/force-app/main/default/classes/LexConsumableAccountSOQLTest.cls
index 264e720..c44bd77 100644
--- a/force-app/main/default/classes/LexConsumableAccountSOQLTest.cls
+++ b/force-app/main/default/classes/LexConsumableAccountSOQLTest.cls
@@ -1,83 +1,31 @@
@isTest
private class LexConsumableAccountSOQLTest {
- @testSetup
- static void testInfo() {
+ @testSetup
+ static void testInfo(){
User userTest;
Account accountItem;
- User thisUser = [SELECT Id FROM User WHERE Id = :UserInfo.getUserId()];
- System.runAs(thisUser) {
- List<RecordType> rectCo = [
- SELECT Id
- FROM RecordType
- WHERE IsActive = TRUE AND SobjectType = 'Account' AND Name = '璨╁2搴�'
- ];
+ User thisUser = [SELECT Id FROM User WHERE Id =:UserInfo.getUserId()];
+ System.runAs(thisUser){
+ List<RecordType> rectCo = [SELECT Id FROM RecordType WHERE IsActive = true AND SobjectType = 'Account' AND Name = '璨╁2搴�'];
if (rectCo.size() == 0) {
return;
}
- Profile prof = [
- SELECT Id
- FROM Profile
- WHERE Name = '901_缁忛攢鍟嗙ぞ鍖烘櫘閫氭潈闄恄2閲嶉獙璇�(ET)'
- ];
- accountItem = new Account(
- Name = 'Testaccount002',
- Dealer_discount__c = 20,
- RecordTypeId = rectCo[0].Id,
- Product_Limit_Date__c = 'Test01|5|55,Test02|2|4',
- AgentCode_Ext__c = '9999900'
- );
+ Profile prof = [SELECT Id FROM Profile WHERE Name ='901_缁忛攢鍟嗙ぞ鍖烘櫘閫氭潈闄恄2閲嶉獙璇�(ET)'];
+ accountItem = new Account(Name='Testaccount002', Dealer_discount__c = 20, RecordTypeId = rectCo[0].Id, Product_Limit_Date__c = 'Test01|5|55,Test02|2|4', AgentCode_Ext__c = '9999900');
insert accountItem;
- Contact core = new Contact(
- email = 'jplumber@salesforce.com',
- firstname = 'Joe',
- lastname = 'Plumber',
- accountId = accountItem.id
- );
+ Contact core = new Contact(email='jplumber@salesforce.com', firstname='Joe', lastname='Plumber', accountId = accountItem.id);
insert core;
- userTest = new User(
- ContactId = core.id,
- Alias = 'newUser',
- Email = 'newuser@testorg.com',
- EmailEncodingKey = 'UTF-8',
- LastName = 'TestUser',
- LanguageLocaleKey = 'zh_CN',
- LocaleSidKey = 'zh_CN',
- ProfileId = prof.Id,
- TimeZoneSidKey = 'Asia/Shanghai',
- UserName = 'testUser@testorg.com',
- UserPro_Type__c = 'ENG',
- Work_Location__c = '鍖椾含'
- );
+ userTest = New User(ContactId = core.id, Alias = 'newUser', Email='newuser@testorg.com', EmailEncodingKey='UTF-8', LastName='TestUser', LanguageLocaleKey='zh_CN', LocaleSidKey='zh_CN', ProfileId = prof.Id, TimeZoneSidKey='Asia/Shanghai', UserName='testUser@testorg.com', UserPro_Type__c='ENG', Work_Location__c='鍖椾含');
insert userTest;
}
- System.runAs(userTest) {
- Product2 prod01 = new Product2(
- Name = 'Test01',
- ProductCode = 'Test01',
- Asset_Model_No__c = 'Test01',
- SFDA_Status__c = '鏈夊姽',
- Dealer_special_Object__c = true,
- SFDA_Approbation_No__c = '12124',
- Packing_list_manual__c = 1,
- SFDA_Expiration_Date__c = Date.today(),
- Manual_Entry__c = false
- );
- Product2 prod02 = new Product2(
- Name = 'Test02',
- ProductCode = 'Test02',
- Asset_Model_No__c = 'Test02',
- SFDA_Status__c = '鏈夊姽',
- Dealer_special_Object__c = true,
- SFDA_Approbation_No__c = '12124',
- Packing_list_manual__c = 1,
- SFDA_Expiration_Date__c = Date.today(),
- Manual_Entry__c = false
- );
- insert new List<Product2>{ prod01, prod02 };
- Product2__c pro1 = new Product2__c(Name = 'Pro001', OT_CODE_Text__c = 'Test001', Product2__c = prod01.Id);
- Product2__c pro2 = new Product2__c(Name = 'Pro002', OT_CODE_Text__c = 'Test002', Product2__c = prod02.Id);
- insert new List<Product2__c>{ pro1, pro2 };
+ System.runAs(userTest){
+ Product2 prod01 = new Product2(Name='Test01',ProductCode='Test01',Asset_Model_No__c = 'Test01',SFDA_Status__c = '鏈夊姽',Dealer_special_Object__c = true,SFDA_Approbation_No__c = '12124',Packing_list_manual__c = 1,SFDA_Expiration_Date__c= Date.today(),Manual_Entry__c = false);
+ Product2 prod02 = new Product2(Name='Test02',ProductCode='Test02',Asset_Model_No__c = 'Test02',SFDA_Status__c = '鏈夊姽',Dealer_special_Object__c = true,SFDA_Approbation_No__c = '12124',Packing_list_manual__c = 1,SFDA_Expiration_Date__c= Date.today(),Manual_Entry__c = false);
+ insert new Product2[]{prod01,prod02};
+ Product2__c pro1 = new Product2__c(Name='Pro001',OT_CODE_Text__c='Test001',Product2__c = prod01.Id);
+ Product2__c pro2 = new Product2__c(Name='Pro002',OT_CODE_Text__c='Test002',Product2__c = prod02.Id);
+ insert new Product2__c[] {pro1, pro2};
Consumable_order__c createId = new Consumable_order__c();
createId.Name = 'testMing1';
@@ -90,12 +38,12 @@
createId.Delivery_detail_count__c = 5;
createId.orderPattern__c = 'hospitalorder';
insert createId;
-
+
List<Consumable_Orderdetails__c> coListTest = new List<Consumable_Orderdetails__c>();
Consumable_Orderdetails__c conOrderDetail1 = new Consumable_Orderdetails__c();
conOrderDetail1.Name = 'testConOrderDetail1';
conOrderDetail1.Consumable_Arrivecount__c = 5;
- conOrderDetail1.Unitprice_To_agency__c = 0;
+ conOrderDetail1.Unitprice_To_agency__c = 0;
conOrderDetail1.Delivery_List_RMB__c = 99;
conOrderDetail1.Shipment_Count__c = 100;
conOrderDetail1.Consumable_product__c = pro1.id;
@@ -104,7 +52,7 @@
Consumable_Orderdetails__c conOrderDetail2 = new Consumable_Orderdetails__c();
conOrderDetail2.Name = 'testConOrderDetail2';
- conOrderDetail1.Unitprice_To_agency__c = 0;
+ conOrderDetail1.Unitprice_To_agency__c = 0;
conOrderDetail1.Delivery_List_RMB__c = 99;
conOrderDetail2.Shipment_Count__c = 99;
conOrderDetail2.Consumable_product__c = pro2.id;
@@ -112,23 +60,23 @@
coListTest.add(conOrderDetail2);
insert coListTest;
}
- }
+ }
@isTest
- static void testGetAccountBySales() {
+ static void testGetAccountBySales(){
System.Test.startTest();
- DateTime thisDatetime = DateTime.newInstance(2023, 1, 1, 0, 0, 0);
- DateTime nextDatetime = DateTime.newInstance(2023, 6, 6, 0, 0, 0);
+ DateTime thisDatetime = DateTime.newInstance(2023,1,1,00,00,00);
+ DateTime nextDatetime = DateTime.newInstance(2023,6,6,00,00,00);
AggregateResult[] arList = new List<AggregateResult>();
- arList = LexConsumableAccountSOQL.getAccountBySales(thisDatetime, nextDatetime);
+ arList = LexConsumableAccountSOQL.getAccountBySales(thisDatetime,nextDatetime);
System.Test.stopTest();
}
@isTest
- static void testGetAccountTotalSales() {
+ static void testGetAccountTotalSales(){
System.Test.startTest();
- DateTime thisDatetime = DateTime.newInstance(2023, 1, 1, 0, 0, 0);
- DateTime nextDatetime = DateTime.newInstance(2023, 6, 6, 0, 0, 0);
+ DateTime thisDatetime = DateTime.newInstance(2023,1,1,00,00,00);
+ DateTime nextDatetime = DateTime.newInstance(2023,6,6,00,00,00);
AggregateResult[] saleAmountList = new List<AggregateResult>();
- saleAmountList = LexConsumableAccountSOQL.getAccountTotalSales(thisDatetime, nextDatetime);
+ saleAmountList = LexConsumableAccountSOQL.getAccountTotalSales(thisDatetime,nextDatetime);
System.Test.stopTest();
}
-}
+}
\ No newline at end of file
diff --git a/force-app/main/default/classes/LexConsumableAccountSOQLTest.cls-meta.xml b/force-app/main/default/classes/LexConsumableAccountSOQLTest.cls-meta.xml
index a9fd6e9..754ecb1 100644
--- a/force-app/main/default/classes/LexConsumableAccountSOQLTest.cls-meta.xml
+++ b/force-app/main/default/classes/LexConsumableAccountSOQLTest.cls-meta.xml
@@ -1,4 +1,4 @@
-<?xml version="1.0" encoding="UTF-8" ?>
+<?xml version="1.0" encoding="UTF-8"?>
<ApexClass xmlns="http://soap.sforce.com/2006/04/metadata">
<apiVersion>57.0</apiVersion>
<status>Active</status>
diff --git a/force-app/main/default/classes/LexConsumableController.cls b/force-app/main/default/classes/LexConsumableController.cls
index 853872e..870954c 100644
--- a/force-app/main/default/classes/LexConsumableController.cls
+++ b/force-app/main/default/classes/LexConsumableController.cls
@@ -207,11 +207,7 @@
ESetId = esetId;
methodType = type;
if (String.isBlank(methodType) && String.isNotBlank(ESetId)) {
- List<Consumable_order__c> oclist = [
- SELECT orderPattern__c
- FROM Consumable_order__c
- WHERE id = :ESetid
- ];
+ List<Consumable_order__c> oclist = [SELECT orderPattern__c FROM Consumable_order__c WHERE id = :ESetid];
methodType = oclist.get(0).orderPattern__c;
}
statusEdit = keywordStr;
@@ -236,11 +232,7 @@
userId = UserInfo.getUserId();
List<user> Useracc = new List<user>();
//lt 20230517 瀹夊窘涓ょエ鍒� add ,OSHFLG__c
- Useracc = [
- SELECT accountid, Work_Location__c, UserPro_Type__c, OSHFLG__c
- FROM user
- WHERE id = :userId
- ];
+ Useracc = [SELECT accountid, Work_Location__c, UserPro_Type__c, OSHFLG__c FROM user WHERE id = :userId];
accountid = Useracc[0].accountid;
userWorkLocation = Useracc[0].Work_Location__c;
agencyProType = Useracc[0].UserPro_Type__c;
@@ -559,11 +551,7 @@
// attachmentRecoeds.add(new ConsumableorderdetailsInfo(attachmentinfo[i]));
// }
// }
- List<ContentDocumentLink> links = [
- SELECT Id, ContentDocumentId
- FROM ContentDocumentLink
- WHERE LinkedEntityId = :ESetId
- ];
+ List<ContentDocumentLink> links = [SELECT Id, ContentDocumentId FROM ContentDocumentLink WHERE LinkedEntityId = :ESetId];
if (links != null && links.size() > 0) {
List<String> documentIds = new List<String>();
for (ContentDocumentLink link : links) {
@@ -1491,11 +1479,7 @@
ESetId = eSetidStr;
try {
statusEdit = 'Redirect';
- List<Consumable_order__c> oclist = [
- SELECT orderPattern__c
- FROM Consumable_order__c
- WHERE id = :ESetid
- ];
+ List<Consumable_order__c> oclist = [SELECT orderPattern__c FROM Consumable_order__c WHERE id = :ESetid];
String url = '/lexconsumable?ESetid=' + ESetid + '&KeyWords=' + statusEdit + '&type=' + oclist.get(0).orderPattern__c;
results.result = 'Success';
results.url = url;
@@ -1515,11 +1499,7 @@
returnOrder = true;
try {
statusEdit = 'Redirect';
- List<Consumable_order__c> oclist = [
- SELECT orderPattern__c
- FROM Consumable_order__c
- WHERE id = :ESetid
- ];
+ List<Consumable_order__c> oclist = [SELECT orderPattern__c FROM Consumable_order__c WHERE id = :ESetid];
String url = '/lexconsumable?ESetid=' + ESetid + '&KeyWords=' + statusEdit + '&type=' + oclist.get(0).orderPattern__c;
results.result = 'Success';
results.url = url;
@@ -1543,11 +1523,7 @@
cv.VersionData = EncodingUtil.base64Decode(base64Data);
cv.IsMajorVersion = true;
insert cv;
- Consumable_order__c c = [
- SELECT Id
- FROM Consumable_order__c
- WHERE Id = :pId
- ];
+ Consumable_order__c c = [SELECT Id FROM Consumable_order__c WHERE Id = :pId];
c.Consumable_pdf_insert_day__c = Date.today();
update c;
results.result = 'Success';
@@ -1912,11 +1888,7 @@
p.orderPattern__c = methodType;
}
insert p;
- List<Consumable_order__c> Consumable_order = [
- SELECT Name, orderPattern__c
- FROM Consumable_order__c
- WHERE id = :p.id
- ];
+ List<Consumable_order__c> Consumable_order = [SELECT Name, orderPattern__c FROM Consumable_order__c WHERE id = :p.id];
for (ConsumableorderdetailsInfo ass : consumableorderdetailsRecordsview) {
Roll = Roll + 1;
if (ass.check == true) {
@@ -2009,11 +1981,7 @@
p.Offers_Price__c = bargainPrice;
}
update p;
- List<Consumable_order__c> Consumable_order = [
- SELECT Name, orderPattern__c
- FROM Consumable_order__c
- WHERE id = :p.id
- ];
+ List<Consumable_order__c> Consumable_order = [SELECT Name, orderPattern__c FROM Consumable_order__c WHERE id = :p.id];
List<Consumable_Orderdetails__c> qs = new List<Consumable_Orderdetails__c>();
qs = [
SELECT Id
@@ -2099,29 +2067,13 @@
public static Results deleteAtt(String contentVersionId, String cocId) {
Results results = new Results();
try {
- List<ContentVersion> cvInfo = [
- SELECT Id
- FROM ContentVersion
- WHERE FirstPublishLocationId = :cocId
- ];
- ContentVersion conVersion = [
- SELECT ContentDocumentId
- FROM ContentVersion
- WHERE Id = :contentVersionId
- ];
+ List<ContentVersion> cvInfo = [SELECT Id FROM ContentVersion WHERE FirstPublishLocationId = :cocId];
+ ContentVersion conVersion = [SELECT ContentDocumentId FROM ContentVersion WHERE Id = :contentVersionId];
String contentDocumentId = conVersion.ContentDocumentId;
- ContentDocument conDocument = [
- SELECT Id
- FROM ContentDocument
- WHERE Id = :contentDocumentId
- ];
+ ContentDocument conDocument = [SELECT Id FROM ContentDocument WHERE Id = :contentDocumentId];
delete conDocument;
if (cvInfo.size() <= 1) {
- Consumable_order__c c = [
- SELECT Id
- FROM Consumable_order__c
- WHERE Id = :cocId
- ];
+ Consumable_order__c c = [SELECT Id FROM Consumable_order__c WHERE Id = :cocId];
c.Consumable_pdf_insert_day__c = null;
update c;
}
@@ -2360,4 +2312,4 @@
@AuraEnabled
public String value;
}
-}
+}
\ No newline at end of file
diff --git a/force-app/main/default/classes/LexConsumableControllerTest.cls b/force-app/main/default/classes/LexConsumableControllerTest.cls
index 13b2399..0ffe51a 100644
--- a/force-app/main/default/classes/LexConsumableControllerTest.cls
+++ b/force-app/main/default/classes/LexConsumableControllerTest.cls
@@ -1,1245 +1,780 @@
@istest
public class LexConsumableControllerTest {
@IsTest
- static void ConsumableOrdertest1() {
+ static void ConsumableOrdertest1(){
user MyUser_Test;
Account myAccount1;
- Account contract;
- User thisUser = [SELECT Id FROM User WHERE Id = :UserInfo.getUserId()];
- NoteStay__c n = new NoteStay__c(Name = 'NoteStay', IsStay__c = true);
+ Account contract;
+ User thisUser = [ select Id from User where Id = :UserInfo.getUserId()];
+ NoteStay__c n = new NoteStay__c(Name = 'NoteStay',IsStay__c = true);
insert n;
- System.runAs(thisUser) {
- Profile prof1 = [
- SELECT Id
- FROM Profile
- WHERE Name = '901_缁忛攢鍟嗙ぞ鍖烘櫘閫氭潈闄恄2閲嶉獙璇�(ET)'
- ];
- List<RecordType> rectCo = [
- SELECT Id
- FROM RecordType
- WHERE IsActive = TRUE AND SobjectType = 'Account' AND Name = '璨╁2搴�'
- ];
- List<RecordType> rectCo1 = [
- SELECT Id
- FROM RecordType
- WHERE IsActive = TRUE AND SobjectType = 'Account' AND DeveloperName = 'AgencyContract'
- ];
+ System.runAs(thisUser){
+ Profile prof1 = [select Id from Profile where Name ='901_缁忛攢鍟嗙ぞ鍖烘櫘閫氭潈闄恄2閲嶉獙璇�(ET)'];
+ List<RecordType> rectCo = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '璨╁2搴�'];
+ List<RecordType> rectCo1 = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and DeveloperName = 'AgencyContract'];
- if (rectCo.size() == 0) {
- return;
- }
- StaticParameter.EscapeConsumableOrderDetail2Trigger = true;
- myAccount1 = new Account(
- name = 'Testaccount001',
- Dealer_discount__c = 10,
- RecordTypeId = rectCo[0].Id,
- AgentCode_Ext__c = '8888888',
- Product_Limit_Date__c = 'Test07|3|100,Test08|10|50'
- );
- insert myAccount1;
- contract = new Account(
- RecordTypeId = rectCo1[0].Id,
- Name = 'contractName',
- ParentId = myAccount1.id,
- Agent_Ref__c = myAccount1.id,
- Contract_Department_Class__c = 'ET',
- Contract_Decide_Start_Date__c = Date.today().addDays(-2),
- Contract_Decide_End_Date__c = Date.today().addDays(2),
- Dealer_discount__c = 0.8
- );
- insert contract;
- Contact core = new Contact(
- email = 'jplumber@salesforce.com',
- firstname = 'Joe',
- lastname = 'Plumber',
- accountid = myAccount1.id
- );
- insert core;
- MyUser_Test = new User(
- ContactId = core.id,
- Alias = 'newUser',
- Email = 'newuser@testorg.com',
- EmailEncodingKey = 'UTF-8',
- LastName = 'TestUser',
- LanguageLocaleKey = 'zh_CN',
- LocaleSidKey = 'zh_CN',
- ProfileId = prof1.Id,
- TimeZoneSidKey = 'Asia/Shanghai',
- UserName = 'testUser@testorg.com',
- Work_Location__c = '閲嶅簡'
- );
- insert MyUser_Test;
- }
+ if (rectCo.size() == 0) {
+ return;
+ }
+ StaticParameter.EscapeConsumableOrderDetail2Trigger = true;
+ myAccount1 = new Account(name='Testaccount001',Dealer_discount__c =10,RecordTypeId = rectCo[0].Id,AgentCode_Ext__c = '8888888',Product_Limit_Date__c = 'Test07|3|100,Test08|10|50');
+ insert myAccount1;
+ contract = new Account(RecordTypeId=rectCo1[0].Id ,Name ='contractName',ParentId = myAccount1.id,Agent_Ref__c =myAccount1.id, Contract_Department_Class__c = 'ET',Contract_Decide_Start_Date__c=Date.today().addDays(-2),
+ Contract_Decide_End_Date__c = Date.today().addDays(2),Dealer_discount__c = 0.8);
+ insert contract;
+ Contact core = new Contact(email='jplumber@salesforce.com', firstname='Joe',lastname='Plumber',accountid=myAccount1.id);
+ insert core;
+ MyUser_Test = New User(ContactId = core.id,Alias = 'newUser',Email='newuser@testorg.com',EmailEncodingKey='UTF-8', LastName='TestUser', LanguageLocaleKey='zh_CN',LocaleSidKey='zh_CN', ProfileId = prof1.Id,TimeZoneSidKey='Asia/Shanghai', UserName='testUser@testorg.com',Work_Location__c = '閲嶅簡');
+ insert MyUser_Test;
- System.runAs(MyUser_Test) {
- //浜у搧鏁版嵁
- Product2 prod01 = new Product2(
- Name = 'Test01',
- ProductCode = 'Test01',
- Asset_Model_No__c = 'Test01',
- SFDA_Status__c = '鏈夊姽',
- Product_Status__c = '姝e父閿�鍞�',
- SFDA_Approbated_Status__c = '鏈夋晥',
- Category3__c = 'CDS',
- Category4__c = 'OER',
- Category5__c = '鍏跺畠',
- Dealer_special_Object__c = true,
- SFDA_Approbation_No__c = 'Test001',
- Packing_list_manual__c = 1,
- SFDA_Expiration_Date__c = Date.today(),
- Intra_Trade_List_RMB_1__c = 1000,
- Intra_Trade_List_RMB_Date1__c = Date.today().addDays(-1),
- Intra_Trade_List_RMB_Date2__c = Date.today().addDays(-1),
- Intra_Trade_List_RMB_End_Date1__c = Date.today().addDays(1),
- Manual_Entry__c = false
- );
+ }
+
+ System.runAs(MyUser_Test){
+ //浜у搧鏁版嵁
+ Product2 prod01 = new Product2(Name='Test01',
+ ProductCode='Test01',
+ Asset_Model_No__c = 'Test01',
+ SFDA_Status__c = '鏈夊姽',
+ Product_Status__c = '姝e父閿�鍞�',
+ SFDA_Approbated_Status__c = '鏈夋晥',
+ Category3__c = 'CDS',
+ Category4__c = 'OER',
+ Category5__c = '鍏跺畠',
+ Dealer_special_Object__c = true,
+ SFDA_Approbation_No__c = 'Test001',
+ Packing_list_manual__c = 1,
+ SFDA_Expiration_Date__c= Date.today(),
+ Intra_Trade_List_RMB_1__c = 1000,
+ Intra_Trade_List_RMB_Date1__c = Date.today().addDays(-1),
+ Intra_Trade_List_RMB_Date2__c = Date.today().addDays(-1),
+ Intra_Trade_List_RMB_End_Date1__c = Date.today().addDays(1),
+ Manual_Entry__c = false);
- Product2 prod02 = new Product2(
- Name = 'Test02',
- ProductCode = 'Test02',
- Asset_Model_No__c = 'Test02',
- SFDA_Status__c = '鏈夊姽',
- Product_Status__c = '姝e父閿�鍞�',
- SFDA_Approbated_Status__c = '鏈夋晥',
- Category3__c = 'ENT',
- Category4__c = 'Celon',
- Category5__c = 'Celon',
- Dealer_special_Object__c = true,
- SFDA_Approbation_No__c = 'Test002',
- Packing_list_manual__c = 1,
- SFDA_Expiration_Date__c = Date.today(),
- Intra_Trade_List_RMB_1__c = 1000,
- Intra_Trade_List_RMB_Date1__c = Date.today().addDays(-1),
- Intra_Trade_List_RMB_Date2__c = Date.today().addDays(-1),
- Intra_Trade_List_RMB_End_Date1__c = Date.today().addDays(1),
- Manual_Entry__c = false
- );
+ Product2 prod02 = new Product2(Name='Test02',
+ ProductCode='Test02',
+ Asset_Model_No__c = 'Test02',
+ SFDA_Status__c = '鏈夊姽',
+ Product_Status__c = '姝e父閿�鍞�',
+ SFDA_Approbated_Status__c = '鏈夋晥',
+ Category3__c = 'ENT',
+ Category4__c = 'Celon',
+ Category5__c = 'Celon',
+ Dealer_special_Object__c = true,
+ SFDA_Approbation_No__c = 'Test002',
+ Packing_list_manual__c = 1,
+ SFDA_Expiration_Date__c= Date.today(),
+ Intra_Trade_List_RMB_1__c = 1000,
+ Intra_Trade_List_RMB_Date1__c = Date.today().addDays(-1),
+ Intra_Trade_List_RMB_Date2__c = Date.today().addDays(-1),
+ Intra_Trade_List_RMB_End_Date1__c = Date.today().addDays(1),
+ Manual_Entry__c = false);
- Product2 prod03 = new Product2(
- Name = 'Test03',
- ProductCode = 'Test03',
- Asset_Model_No__c = 'Test03',
- SFDA_Status__c = '鏈夊姽',
- Dealer_special_Object__c = true,
- Product_Status__c = '姝e父閿�鍞�',
- SFDA_Approbated_Status__c = '鏈夋晥',
- Category3__c = 'US',
- Category4__c = 'ALOKA',
- Category5__c = '浣撳瓒呭0',
- Intra_Trade_List_RMB_1__c = 1000,
- Intra_Trade_List_RMB_Date1__c = Date.today().addDays(-1),
- Intra_Trade_List_RMB_End_Date1__c = Date.today().addDays(1),
- Manual_Entry__c = false
- );
- insert new List<Product2>{ prod01, prod02, prod03 };
+ Product2 prod03 = new Product2(Name='Test03',
+ ProductCode='Test03',
+ Asset_Model_No__c = 'Test03',
+ SFDA_Status__c = '鏈夊姽',
+ Dealer_special_Object__c = true,
+ Product_Status__c = '姝e父閿�鍞�',
+ SFDA_Approbated_Status__c = '鏈夋晥',
+ Category3__c = 'US',
+ Category4__c = 'ALOKA',
+ Category5__c = '浣撳瓒呭0',
+ Intra_Trade_List_RMB_1__c = 1000,
+ Intra_Trade_List_RMB_Date1__c = Date.today().addDays(-1),
+ Intra_Trade_List_RMB_End_Date1__c = Date.today().addDays(1),
+ Manual_Entry__c = false);
+ insert new Product2[] {prod01,prod02,prod03};
- //鍒朵綔浜у搧
- Product2__c proG = new Product2__c(Name = 'MH-155:鐧藉钩琛″附', OT_CODE_Text__c = 'Test001', Product2__c = prod01.Id);
- insert proG;
- System.debug('proG:' + proG);
- System.debug('proG1:' + proG.Estimation_Entry_Possibility__c);
- System.debug('prod07:' + prod01);
- System.debug('prod071:' + prod01.Estimation_Entry_Possibility__c);
- Product2__c proH = new Product2__c(Name = 'MB-677:BNC鐢电紗', OT_CODE_Text__c = 'Test002', Product2__c = prod02.Id);
- insert proH;
- Product2__c proF = new Product2__c(Name = 'TooMAJ-643R:姘村泭闉樼003', OT_CODE_Text__c = 'Test003', Product2__c = prod03.Id);
- insert proF;
+ //鍒朵綔浜у搧
+ Product2__c proG = new Product2__c(Name='MH-155:鐧藉钩琛″附',OT_CODE_Text__c='Test001',Product2__c = prod01.Id);
+ insert proG;
+ System.debug('proG:'+proG);
+ System.debug('proG1:'+proG.Estimation_Entry_Possibility__c);
+ System.debug('prod07:'+prod01);
+ System.debug('prod071:'+prod01.Estimation_Entry_Possibility__c);
+ Product2__c proH = new Product2__c(Name='MB-677:BNC鐢电紗',OT_CODE_Text__c='Test002',Product2__c = prod02.Id);
+ insert proH;
+ Product2__c proF = new Product2__c(Name='TooMAJ-643R:姘村泭闉樼003',OT_CODE_Text__c='Test003',Product2__c = prod03.Id);
+ insert proF;
- //璁㈠崟
- Consumable_order__c order = new Consumable_order__c();
- order.Name = 'testMing';
- order.Order_status__c = '鎵瑰噯';
- order.RecordTypeid = System.Label.RT_ConOrder_Order;
- order.Dealer_Info__c = myAccount1.id;
- order.Inventory_date__c = Date.today();
- order.Order_type__c = '璁㈠崟';
- order.Order_ProType__c = 'ET';
- order.orderPattern__c = 'agreementorder';
- insert order;
- Consumable_orderdetails__c Orderdet = new Consumable_orderdetails__c();
- Orderdet.Name = 'OCM_01_00101';
- Orderdet.Consumable_order__c = order.Id;
- Orderdet.RecordTypeId = System.Label.RT_ConOrderDetail1_Order;
- Orderdet.Consumable_Product__c = proG.Id;
- Orderdet.Consumable_count__c = 4;
- insert Orderdet;
- Consumable_order_details2__c createDetail2 = new Consumable_order_details2__c();
- createDetail2 = new Consumable_order_details2__c();
- createDetail2.Consumable_Product__c = proG.id;
- createDetail2.Asset_Model_No__c = 'Test01';
- createDetail2.Consumable_order_minor__c = order.id;
- createDetail2.Consumable_Arrived_order__c = order.id;
- createDetail2.RecordTypeid = System.Label.RT_ConOrderDetail2_Delivery;
- createDetail2.Asset_Model_No__c = proG.Asset_Model_No__c;
- createDetail2.Bar_Code__c = '123';
- createDetail2.Box_Piece__c = '鐩�';
- createDetail2.Arrive_date__c = Date.today();
+ //璁㈠崟
+ Consumable_order__c order = new Consumable_order__c();
+ order.Name = 'testMing';
+ order.Order_status__c = '鎵瑰噯';
+ order.RecordTypeid = System.Label.RT_ConOrder_Order;
+ order.Dealer_Info__c = myAccount1.id;
+ order.Inventory_date__c = Date.today();
+ order.Order_type__c = '璁㈠崟';
+ order.Order_ProType__c = 'ET';
+ order.orderPattern__c = 'agreementorder';
+ insert order;
+ Consumable_orderdetails__c Orderdet = new Consumable_orderdetails__c();
+ Orderdet.Name = 'OCM_01_00101';
+ Orderdet.Consumable_order__c = order.Id;
+ Orderdet.RecordTypeId = System.Label.RT_ConOrderDetail1_Order;
+ Orderdet.Consumable_Product__c = proG.Id;
+ Orderdet.Consumable_count__c = 4;
+ insert Orderdet;
- Oly_TriggerHandler.bypass('ConsumableAssetHander');
- insert createDetail2;
+ Consumable_order_details2__c createDetail2 = new Consumable_order_details2__c();
+ createDetail2 = new Consumable_order_details2__c();
+ createDetail2.Consumable_Product__c = proG.id;
+ createDetail2.Asset_Model_No__c = 'Test01';
+ createDetail2.Consumable_order_minor__c = order.id;
+ createDetail2.Consumable_Arrived_order__c = order.id;
+ createDetail2.RecordTypeid = System.Label.RT_ConOrderDetail2_Delivery;
+ createDetail2.Asset_Model_No__c = proG.Asset_Model_No__c;
+ createDetail2.Bar_Code__c = '123';
+ createDetail2.Box_Piece__c ='鐩�';
+ createDetail2.Arrive_date__c = Date.today();
+
+ Oly_TriggerHandler.bypass('ConsumableAssetHander');
+ insert createDetail2;
Test.startTest();
- LexConsumableController.ConsumableorderdetailsInfo c1 = new LexConsumableController.ConsumableorderdetailsInfo(Orderdet);
- ContentVersion v = new ContentVersion();
- LexConsumableController.ConsumableorderdetailsInfo c2 = new LexConsumableController.ConsumableorderdetailsInfo(v);
+ LexConsumableController.ConsumableorderdetailsInfo c1 = new LexConsumableController.ConsumableorderdetailsInfo(Orderdet);
+ ContentVersion v = new ContentVersion();
+ LexConsumableController.ConsumableorderdetailsInfo c2 = new LexConsumableController.ConsumableorderdetailsInfo(v);
LexConsumableController l = new LexConsumableController();
- LexConsumableController.Results re = LexConsumableController.init('', order.Id, '');
- LexConsumableController.searchConsumableorderdetails(
- re.userWorkLocation,
- re.agencyProType,
- re.accountName,
- re.accountid,
- re.hospitalId,
- re.contractId,
- 'testMing',
- '',
- '',
- '',
- re.category_Goods,
- re.specialCampaign,
- JSON.serialize(re.dealerProductId),
- re.methodType,
- JSON.serialize(re.consumableorderdetailsRecordsview),
- re.editAble,
- re.proLimitAndDate
- );
- LexConsumableController.searchorderdetails(
- re.methodType,
- re.accountid,
- re.hospitalId,
- re.contractId,
- re.userWorkLocation,
- re.accountName,
- re.proLimitAndDate,
- re.editAble
- );
- LexConsumableController.sorder(order.Id, myAccount1.Id);
+ LexConsumableController.Results re = LexConsumableController.init('', order.Id, '');
+ LexConsumableController.searchConsumableorderdetails(re.userWorkLocation, re.agencyProType, re.accountName, re.accountid, re.hospitalId, re.contractId, 'testMing', '', '', '', re.category_Goods, re.specialCampaign, JSON.serialize(re.dealerProductId), re.methodType, JSON.serialize(re.consumableorderdetailsRecordsview), re.editAble, re.proLimitAndDate);
+ LexConsumableController.searchorderdetails(re.methodType, re.accountid, re.hospitalId, re.contractId, re.userWorkLocation, re.accountName, re.proLimitAndDate, re.editAble);
+ LexConsumableController.sorder(order.Id,myAccount1.Id);
Test.stopTest();
}
}
- @IsTest
- static void ConsumableOrdertest2() {
+ @IsTest
+ static void ConsumableOrdertest2(){
user MyUser_Test;
Account myAccount1;
- Account contract;
- User thisUser = [SELECT Id FROM User WHERE Id = :UserInfo.getUserId()];
- NoteStay__c n = new NoteStay__c(Name = 'NoteStay', IsStay__c = true);
+ Account contract;
+ User thisUser = [ select Id from User where Id = :UserInfo.getUserId()];
+ NoteStay__c n = new NoteStay__c(Name = 'NoteStay',IsStay__c = true);
insert n;
- System.runAs(thisUser) {
- Profile prof1 = [
- SELECT Id
- FROM Profile
- WHERE Name = '901_缁忛攢鍟嗙ぞ鍖烘櫘閫氭潈闄恄2閲嶉獙璇�(ET)'
- ];
- List<RecordType> rectCo = [
- SELECT Id
- FROM RecordType
- WHERE IsActive = TRUE AND SobjectType = 'Account' AND Name = '璨╁2搴�'
- ];
- List<RecordType> rectCo1 = [
- SELECT Id
- FROM RecordType
- WHERE IsActive = TRUE AND SobjectType = 'Account' AND DeveloperName = 'AgencyContract'
- ];
+ System.runAs(thisUser){
+ Profile prof1 = [select Id from Profile where Name ='901_缁忛攢鍟嗙ぞ鍖烘櫘閫氭潈闄恄2閲嶉獙璇�(ET)'];
+ List<RecordType> rectCo = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '璨╁2搴�'];
+ List<RecordType> rectCo1 = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and DeveloperName = 'AgencyContract'];
- if (rectCo.size() == 0) {
- return;
- }
- StaticParameter.EscapeConsumableOrderDetail2Trigger = true;
- myAccount1 = new Account(
- name = 'Testaccount001',
- Dealer_discount__c = 10,
- RecordTypeId = rectCo[0].Id,
- AgentCode_Ext__c = '8888888',
- Product_Limit_Date__c = 'Test07|3|100,Test08|10|50'
- );
- insert myAccount1;
- contract = new Account(
- RecordTypeId = rectCo1[0].Id,
- Name = 'contractName',
- ParentId = myAccount1.id,
- Agent_Ref__c = myAccount1.id,
- Contract_Department_Class__c = 'ET',
- Contract_Decide_Start_Date__c = Date.today().addDays(-2),
- Contract_Decide_End_Date__c = Date.today().addDays(2),
- Dealer_discount__c = 0.8
- );
- insert contract;
+ if (rectCo.size() == 0) {
+ return;
+ }
+ StaticParameter.EscapeConsumableOrderDetail2Trigger = true;
+ myAccount1 = new Account(name='Testaccount001',Dealer_discount__c =10,RecordTypeId = rectCo[0].Id,AgentCode_Ext__c = '8888888',Product_Limit_Date__c = 'Test07|3|100,Test08|10|50');
+ insert myAccount1;
+ contract = new Account(RecordTypeId=rectCo1[0].Id ,Name ='contractName',ParentId = myAccount1.id,Agent_Ref__c =myAccount1.id, Contract_Department_Class__c = 'ET',Contract_Decide_Start_Date__c=Date.today().addDays(-2),
+ Contract_Decide_End_Date__c = Date.today().addDays(2),Dealer_discount__c = 0.8);
+ insert contract;
- Contact core = new Contact(
- email = 'jplumber@salesforce.com',
- firstname = 'Joe',
- lastname = 'Plumber',
- accountid = myAccount1.id
- );
- insert core;
- MyUser_Test = new User(
- ContactId = core.id,
- Alias = 'newUser',
- Email = 'newuser@testorg.com',
- EmailEncodingKey = 'UTF-8',
- LastName = 'TestUser',
- LanguageLocaleKey = 'zh_CN',
- LocaleSidKey = 'zh_CN',
- ProfileId = prof1.Id,
- TimeZoneSidKey = 'Asia/Shanghai',
- UserName = 'testUser@testorg.com',
- Work_Location__c = '閲嶅簡'
- );
- insert MyUser_Test;
- }
+ Contact core = new Contact(email='jplumber@salesforce.com', firstname='Joe',lastname='Plumber',accountid=myAccount1.id);
+ insert core;
+ MyUser_Test = New User(ContactId = core.id,Alias = 'newUser',Email='newuser@testorg.com',EmailEncodingKey='UTF-8', LastName='TestUser', LanguageLocaleKey='zh_CN',LocaleSidKey='zh_CN', ProfileId = prof1.Id,TimeZoneSidKey='Asia/Shanghai', UserName='testUser@testorg.com',Work_Location__c = '閲嶅簡');
+ insert MyUser_Test;
- System.runAs(MyUser_Test) {
- //浜у搧鏁版嵁
- Product2 prod01 = new Product2(
- Name = 'Test01',
- ProductCode = 'Test01',
- Asset_Model_No__c = 'Test01',
- SFDA_Status__c = '鏈夊姽',
- Product_Status__c = '姝e父閿�鍞�',
- SFDA_Approbated_Status__c = '鏈夋晥',
- Category3__c = 'CDS',
- Category4__c = 'OER',
- Category5__c = '鍏跺畠',
- Dealer_special_Object__c = true,
- SFDA_Approbation_No__c = 'Test001',
- Packing_list_manual__c = 1,
- SFDA_Expiration_Date__c = Date.today(),
- Intra_Trade_List_RMB_1__c = 1000,
- Intra_Trade_List_RMB_Date1__c = Date.today().addDays(-1),
- Intra_Trade_List_RMB_Date2__c = Date.today().addDays(-1),
- Intra_Trade_List_RMB_End_Date1__c = Date.today().addDays(1),
- Manual_Entry__c = false
- );
+ }
+
+ System.runAs(MyUser_Test){
+ //浜у搧鏁版嵁
+ Product2 prod01 = new Product2(Name='Test01',
+ ProductCode='Test01',
+ Asset_Model_No__c = 'Test01',
+ SFDA_Status__c = '鏈夊姽',
+ Product_Status__c = '姝e父閿�鍞�',
+ SFDA_Approbated_Status__c = '鏈夋晥',
+ Category3__c = 'CDS',
+ Category4__c = 'OER',
+ Category5__c = '鍏跺畠',
+ Dealer_special_Object__c = true,
+ SFDA_Approbation_No__c = 'Test001',
+ Packing_list_manual__c = 1,
+ SFDA_Expiration_Date__c= Date.today(),
+ Intra_Trade_List_RMB_1__c = 1000,
+ Intra_Trade_List_RMB_Date1__c = Date.today().addDays(-1),
+ Intra_Trade_List_RMB_Date2__c = Date.today().addDays(-1),
+ Intra_Trade_List_RMB_End_Date1__c = Date.today().addDays(1),
+ Manual_Entry__c = false);
- Product2 prod02 = new Product2(
- Name = 'Test02',
- ProductCode = 'Test02',
- Asset_Model_No__c = 'Test02',
- SFDA_Status__c = '鏈夊姽',
- Product_Status__c = '姝e父閿�鍞�',
- SFDA_Approbated_Status__c = '鏈夋晥',
- Category3__c = 'ENT',
- Category4__c = 'Celon',
- Category5__c = 'Celon',
- Dealer_special_Object__c = true,
- SFDA_Approbation_No__c = 'Test002',
- Packing_list_manual__c = 1,
- SFDA_Expiration_Date__c = Date.today(),
- Intra_Trade_List_RMB_1__c = 1000,
- Intra_Trade_List_RMB_Date1__c = Date.today().addDays(-1),
- Intra_Trade_List_RMB_Date2__c = Date.today().addDays(-1),
- Intra_Trade_List_RMB_End_Date1__c = Date.today().addDays(1),
- Manual_Entry__c = false
- );
+ Product2 prod02 = new Product2(Name='Test02',
+ ProductCode='Test02',
+ Asset_Model_No__c = 'Test02',
+ SFDA_Status__c = '鏈夊姽',
+ Product_Status__c = '姝e父閿�鍞�',
+ SFDA_Approbated_Status__c = '鏈夋晥',
+ Category3__c = 'ENT',
+ Category4__c = 'Celon',
+ Category5__c = 'Celon',
+ Dealer_special_Object__c = true,
+ SFDA_Approbation_No__c = 'Test002',
+ Packing_list_manual__c = 1,
+ SFDA_Expiration_Date__c= Date.today(),
+ Intra_Trade_List_RMB_1__c = 1000,
+ Intra_Trade_List_RMB_Date1__c = Date.today().addDays(-1),
+ Intra_Trade_List_RMB_Date2__c = Date.today().addDays(-1),
+ Intra_Trade_List_RMB_End_Date1__c = Date.today().addDays(1),
+ Manual_Entry__c = false);
- Product2 prod03 = new Product2(
- Name = 'Test03',
- ProductCode = 'Test03',
- Asset_Model_No__c = 'Test03',
- SFDA_Status__c = '鏈夊姽',
- Dealer_special_Object__c = true,
- Product_Status__c = '姝e父閿�鍞�',
- SFDA_Approbated_Status__c = '鏈夋晥',
- Category3__c = 'US',
- Category4__c = 'ALOKA',
- Category5__c = '浣撳瓒呭0',
- Intra_Trade_List_RMB_1__c = 1000,
- Intra_Trade_List_RMB_Date1__c = Date.today().addDays(-1),
- Intra_Trade_List_RMB_End_Date1__c = Date.today().addDays(1),
- Manual_Entry__c = false
- );
- insert new List<Product2>{ prod01, prod02, prod03 };
+ Product2 prod03 = new Product2(Name='Test03',
+ ProductCode='Test03',
+ Asset_Model_No__c = 'Test03',
+ SFDA_Status__c = '鏈夊姽',
+ Dealer_special_Object__c = true,
+ Product_Status__c = '姝e父閿�鍞�',
+ SFDA_Approbated_Status__c = '鏈夋晥',
+ Category3__c = 'US',
+ Category4__c = 'ALOKA',
+ Category5__c = '浣撳瓒呭0',
+ Intra_Trade_List_RMB_1__c = 1000,
+ Intra_Trade_List_RMB_Date1__c = Date.today().addDays(-1),
+ Intra_Trade_List_RMB_End_Date1__c = Date.today().addDays(1),
+ Manual_Entry__c = false);
+ insert new Product2[] {prod01,prod02,prod03};
- //鍒朵綔浜у搧
- Product2__c proG = new Product2__c(Name = 'MH-155:鐧藉钩琛″附', OT_CODE_Text__c = 'Test001', Product2__c = prod01.Id);
- insert proG;
- System.debug('proG:' + proG);
- System.debug('proG1:' + proG.Estimation_Entry_Possibility__c);
- System.debug('prod07:' + prod01);
- System.debug('prod071:' + prod01.Estimation_Entry_Possibility__c);
- Product2__c proH = new Product2__c(Name = 'MB-677:BNC鐢电紗', OT_CODE_Text__c = 'Test002', Product2__c = prod02.Id);
- insert proH;
- Product2__c proF = new Product2__c(Name = 'TooMAJ-643R:姘村泭闉樼003', OT_CODE_Text__c = 'Test003', Product2__c = prod03.Id);
- insert proF;
+ //鍒朵綔浜у搧
+ Product2__c proG = new Product2__c(Name='MH-155:鐧藉钩琛″附',OT_CODE_Text__c='Test001',Product2__c = prod01.Id);
+ insert proG;
+ System.debug('proG:'+proG);
+ System.debug('proG1:'+proG.Estimation_Entry_Possibility__c);
+ System.debug('prod07:'+prod01);
+ System.debug('prod071:'+prod01.Estimation_Entry_Possibility__c);
+ Product2__c proH = new Product2__c(Name='MB-677:BNC鐢电紗',OT_CODE_Text__c='Test002',Product2__c = prod02.Id);
+ insert proH;
+ Product2__c proF = new Product2__c(Name='TooMAJ-643R:姘村泭闉樼003',OT_CODE_Text__c='Test003',Product2__c = prod03.Id);
+ insert proF;
- //鍒涘缓鍖婚櫌
- 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 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;
- //寤轰竴鏉″尰闄㈢壒浠蜂骇鍝�
- hospitalprice__c hc = new hospitalprice__c();
- hc.hospital__c = hospital.Id;
- hc.product__c = proG.Id;
- hc.aph__c = '12332';
- hc.account__c = myAccount1.Id;
- insert hc;
+ //寤轰竴鏉″尰闄㈢壒浠蜂骇鍝�
+ hospitalprice__c hc = new hospitalprice__c();
+ hc.hospital__c = hospital.Id;
+ hc.product__c = proG.Id;
+ hc.aph__c = '12332';
+ hc.account__c = myAccount1.Id;
+ insert hc;
- //鍖婚櫌
- Consumable_order__c order1 = new Consumable_order__c();
- order1.Name = 'testMing1';
- order1.Order_status__c = '鎵瑰噯';
- order1.RecordTypeid = System.Label.RT_ConOrder_Order;
- order1.Dealer_Info__c = myAccount1.id;
- order1.Inventory_date__c = Date.today();
- order1.Order_type__c = '璁㈠崟';
- order1.Order_ProType__c = 'ET';
- order1.orderPattern__c = 'hospitalorder';
- insert order1;
- Consumable_orderdetails__c Orderdet1 = new Consumable_orderdetails__c();
- Orderdet1.Name = 'OCM_01_00102';
- Orderdet1.Consumable_order__c = order1.Id;
- Orderdet1.RecordTypeId = System.Label.RT_ConOrderDetail1_Order;
- Orderdet1.Consumable_Product__c = proG.Id;
- Orderdet1.Consumable_count__c = 4;
- insert Orderdet1;
+ //鍖婚櫌
+ Consumable_order__c order1 = new Consumable_order__c();
+ order1.Name = 'testMing1';
+ order1.Order_status__c = '鎵瑰噯';
+ order1.RecordTypeid = System.Label.RT_ConOrder_Order;
+ order1.Dealer_Info__c = myAccount1.id;
+ order1.Inventory_date__c = Date.today();
+ order1.Order_type__c = '璁㈠崟';
+ order1.Order_ProType__c = 'ET';
+ order1.orderPattern__c = 'hospitalorder';
+ insert order1;
+ Consumable_orderdetails__c Orderdet1 = new Consumable_orderdetails__c();
+ Orderdet1.Name = 'OCM_01_00102';
+ Orderdet1.Consumable_order__c = order1.Id;
+ Orderdet1.RecordTypeId = System.Label.RT_ConOrderDetail1_Order;
+ Orderdet1.Consumable_Product__c = proG.Id;
+ Orderdet1.Consumable_count__c = 4;
+ insert Orderdet1;
- Consumable_order_details2__c createDetail3 = new Consumable_order_details2__c();
- createDetail3 = new Consumable_order_details2__c();
- createDetail3.Consumable_Product__c = proG.id;
- createDetail3.Asset_Model_No__c = 'Test02';
- createDetail3.Consumable_order_minor__c = order1.id;
- createDetail3.Consumable_Arrived_order__c = order1.id;
- createDetail3.RecordTypeid = System.Label.RT_ConOrderDetail2_Delivery;
- createDetail3.Asset_Model_No__c = proG.Asset_Model_No__c;
- createDetail3.Bar_Code__c = '123';
- createDetail3.Box_Piece__c = '鐩�';
- createDetail3.Arrive_date__c = Date.today();
+ Consumable_order_details2__c createDetail3 = new Consumable_order_details2__c();
+ createDetail3 = new Consumable_order_details2__c();
+ createDetail3.Consumable_Product__c = proG.id;
+ createDetail3.Asset_Model_No__c = 'Test02';
+ createDetail3.Consumable_order_minor__c = order1.id;
+ createDetail3.Consumable_Arrived_order__c = order1.id;
+ createDetail3.RecordTypeid = System.Label.RT_ConOrderDetail2_Delivery;
+ createDetail3.Asset_Model_No__c = proG.Asset_Model_No__c;
+ createDetail3.Bar_Code__c = '123';
+ createDetail3.Box_Piece__c ='鐩�';
+ createDetail3.Arrive_date__c = Date.today();
- Oly_TriggerHandler.bypass('ConsumableAssetHander');
- insert createDetail3;
+ Oly_TriggerHandler.bypass('ConsumableAssetHander');
+ insert createDetail3;
Test.startTest();
- LexConsumableController.Results re = LexConsumableController.init('', order1.Id, '');
- LexConsumableController.searchConsumableorderdetails(
- re.userWorkLocation,
- re.agencyProType,
- re.accountName,
- re.accountid,
- re.hospitalId,
- re.contractId,
- 'testMing',
- '',
- '',
- '',
- re.category_Goods,
- re.specialCampaign,
- JSON.serialize(re.dealerProductId),
- re.methodType,
- JSON.serialize(re.consumableorderdetailsRecordsview),
- re.editAble,
- re.proLimitAndDate
- );
- LexConsumableController.searchorderdetails(
- re.methodType,
- re.accountid,
- re.hospitalId,
- re.contractId,
- re.userWorkLocation,
- re.accountName,
- re.proLimitAndDate,
- re.editAble
- );
- LexConsumableController.searchConsumableorderdetails(
- re.userWorkLocation,
- re.agencyProType,
- re.accountName,
- re.accountid,
- hospital.Id,
- contract.Id,
- 'testMing',
- '',
- '',
- '',
- re.category_Goods,
- re.specialCampaign,
- JSON.serialize(re.dealerProductId),
- re.methodType,
- JSON.serialize(re.consumableorderdetailsRecordsview),
- re.editAble,
- re.proLimitAndDate
- );
- LexConsumableController.searchorderdetails(
- re.methodType,
- re.accountid,
- hospital.Id,
- contract.Id,
- re.userWorkLocation,
- re.accountName,
- re.proLimitAndDate,
- re.editAble
- );
+ LexConsumableController.Results re = LexConsumableController.init('', order1.Id, '');
+ LexConsumableController.searchConsumableorderdetails(re.userWorkLocation, re.agencyProType, re.accountName, re.accountid, re.hospitalId, re.contractId, 'testMing', '', '', '', re.category_Goods, re.specialCampaign, JSON.serialize(re.dealerProductId), re.methodType, JSON.serialize(re.consumableorderdetailsRecordsview), re.editAble, re.proLimitAndDate);
+ LexConsumableController.searchorderdetails(re.methodType, re.accountid, re.hospitalId, re.contractId, re.userWorkLocation, re.accountName, re.proLimitAndDate, re.editAble);
+ LexConsumableController.searchConsumableorderdetails(re.userWorkLocation, re.agencyProType, re.accountName, re.accountid, hospital.Id, contract.Id, 'testMing', '', '', '', re.category_Goods, re.specialCampaign, JSON.serialize(re.dealerProductId), re.methodType, JSON.serialize(re.consumableorderdetailsRecordsview), re.editAble, re.proLimitAndDate);
+ LexConsumableController.searchorderdetails(re.methodType, re.accountid, hospital.Id, contract.Id, re.userWorkLocation, re.accountName, re.proLimitAndDate, re.editAble);
Test.stopTest();
}
}
- @IsTest
- static void ConsumableOrdertest3() {
+ @IsTest
+ static void ConsumableOrdertest3(){
user MyUser_Test;
Account myAccount1;
- Account contract;
- Consumable_order__c order2;
- User thisUser = [SELECT Id FROM User WHERE Id = :UserInfo.getUserId()];
- NoteStay__c n = new NoteStay__c(Name = 'NoteStay', IsStay__c = true);
+ Account contract;
+ Consumable_order__c order2;
+ User thisUser = [ select Id from User where Id = :UserInfo.getUserId()];
+ NoteStay__c n = new NoteStay__c(Name = 'NoteStay',IsStay__c = true);
insert n;
- System.runAs(thisUser) {
- Profile prof1 = [
- SELECT Id
- FROM Profile
- WHERE Name = '901_缁忛攢鍟嗙ぞ鍖烘櫘閫氭潈闄恄2閲嶉獙璇�(ET)'
- ];
- List<RecordType> rectCo = [
- SELECT Id
- FROM RecordType
- WHERE IsActive = TRUE AND SobjectType = 'Account' AND Name = '璨╁2搴�'
- ];
- List<RecordType> rectCo1 = [
- SELECT Id
- FROM RecordType
- WHERE IsActive = TRUE AND SobjectType = 'Account' AND DeveloperName = 'AgencyContract'
- ];
+ System.runAs(thisUser){
+ Profile prof1 = [select Id from Profile where Name ='901_缁忛攢鍟嗙ぞ鍖烘櫘閫氭潈闄恄2閲嶉獙璇�(ET)'];
+ List<RecordType> rectCo = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '璨╁2搴�'];
+ List<RecordType> rectCo1 = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and DeveloperName = 'AgencyContract'];
- if (rectCo.size() == 0) {
- return;
- }
- StaticParameter.EscapeConsumableOrderDetail2Trigger = true;
- myAccount1 = new Account(
- name = 'Testaccount001',
- Dealer_discount__c = 10,
- RecordTypeId = rectCo[0].Id,
- AgentCode_Ext__c = '8888888',
- Product_Limit_Date__c = 'Test07|3|100,Test08|10|50'
- );
- insert myAccount1;
- contract = new Account(
- RecordTypeId = rectCo1[0].Id,
- Name = 'contractName',
- ParentId = myAccount1.id,
- Agent_Ref__c = myAccount1.id,
- Contract_Department_Class__c = 'ET',
- Contract_Decide_Start_Date__c = Date.today().addDays(-2),
- Contract_Decide_End_Date__c = Date.today().addDays(2),
- Dealer_discount__c = 0.8
- );
- insert contract;
- Contact core = new Contact(
- email = 'jplumber@salesforce.com',
- firstname = 'Joe',
- lastname = 'Plumber',
- accountid = myAccount1.id
- );
- insert core;
- MyUser_Test = new User(
- ContactId = core.id,
- Alias = 'newUser',
- Email = 'newuser@testorg.com',
- EmailEncodingKey = 'UTF-8',
- LastName = 'TestUser',
- LanguageLocaleKey = 'zh_CN',
- LocaleSidKey = 'zh_CN',
- ProfileId = prof1.Id,
- TimeZoneSidKey = 'Asia/Shanghai',
- UserName = 'testUser@testorg.com',
- Work_Location__c = '閲嶅簡'
- );
- insert MyUser_Test;
+ if (rectCo.size() == 0) {
+ return;
+ }
+ StaticParameter.EscapeConsumableOrderDetail2Trigger = true;
+ myAccount1 = new Account(name='Testaccount001',Dealer_discount__c =10,RecordTypeId = rectCo[0].Id,AgentCode_Ext__c = '8888888',Product_Limit_Date__c = 'Test07|3|100,Test08|10|50');
+ insert myAccount1;
+ contract = new Account(RecordTypeId=rectCo1[0].Id ,Name ='contractName',ParentId = myAccount1.id,Agent_Ref__c =myAccount1.id, Contract_Department_Class__c = 'ET',Contract_Decide_Start_Date__c=Date.today().addDays(-2),
+ Contract_Decide_End_Date__c = Date.today().addDays(2),Dealer_discount__c = 0.8);
+ insert contract;
+ Contact core = new Contact(email='jplumber@salesforce.com', firstname='Joe',lastname='Plumber',accountid=myAccount1.id);
+ insert core;
+ MyUser_Test = New User(ContactId = core.id,Alias = 'newUser',Email='newuser@testorg.com',EmailEncodingKey='UTF-8', LastName='TestUser', LanguageLocaleKey='zh_CN',LocaleSidKey='zh_CN', ProfileId = prof1.Id,TimeZoneSidKey='Asia/Shanghai', UserName='testUser@testorg.com',Work_Location__c = '閲嶅簡');
+ insert MyUser_Test;
- //浜у搧鏁版嵁
- Product2 prod01 = new Product2(
- Name = 'Test01',
- ProductCode = 'Test01',
- Asset_Model_No__c = 'Test01',
- SFDA_Status__c = '鏈夊姽',
- Product_Status__c = '姝e父閿�鍞�',
- SFDA_Approbated_Status__c = '鏈夋晥',
- Category3__c = 'CDS',
- Category4__c = 'OER',
- Category5__c = '鍏跺畠',
- Dealer_special_Object__c = true,
- SFDA_Approbation_No__c = 'Test001',
- Packing_list_manual__c = 1,
- SFDA_Expiration_Date__c = Date.today(),
- Intra_Trade_List_RMB_1__c = 1000,
- Intra_Trade_List_RMB_Date1__c = Date.today().addDays(-1),
- Intra_Trade_List_RMB_Date2__c = Date.today().addDays(-1),
- Intra_Trade_List_RMB_End_Date1__c = Date.today().addDays(1),
- Manual_Entry__c = false
- );
-
- Product2 prod02 = new Product2(
- Name = 'Test02',
- ProductCode = 'Test02',
- Asset_Model_No__c = 'Test02',
- SFDA_Status__c = '鏈夊姽',
- Product_Status__c = '姝e父閿�鍞�',
- SFDA_Approbated_Status__c = '鏈夋晥',
- Category3__c = 'ENT',
- Category4__c = 'Celon',
- Category5__c = 'Celon',
- Dealer_special_Object__c = true,
- SFDA_Approbation_No__c = 'Test002',
- Packing_list_manual__c = 1,
- SFDA_Expiration_Date__c = Date.today(),
- Intra_Trade_List_RMB_1__c = 1000,
- Intra_Trade_List_RMB_Date1__c = Date.today().addDays(-1),
- Intra_Trade_List_RMB_Date2__c = Date.today().addDays(-1),
- Intra_Trade_List_RMB_End_Date1__c = Date.today().addDays(1),
- Manual_Entry__c = false
- );
-
- Product2 prod03 = new Product2(
- Name = 'Test03',
- ProductCode = 'Test03',
- Asset_Model_No__c = 'Test03',
- SFDA_Status__c = '鏈夊姽',
- Dealer_special_Object__c = true,
- Product_Status__c = '姝e父閿�鍞�',
- SFDA_Approbated_Status__c = '鏈夋晥',
- Category3__c = 'US',
- Category4__c = 'ALOKA',
- Category5__c = '浣撳瓒呭0',
- Intra_Trade_List_RMB_1__c = 1000,
- Intra_Trade_List_RMB_Date1__c = Date.today().addDays(-1),
- Intra_Trade_List_RMB_End_Date1__c = Date.today().addDays(1),
- Manual_Entry__c = false
- );
- insert new List<Product2>{ prod01, prod02, prod03 };
-
- //鍒朵綔浜у搧
- Product2__c proG = new Product2__c(Name = 'MH-155:鐧藉钩琛″附', OT_CODE_Text__c = 'Test001', Product2__c = prod01.Id);
- insert proG;
- System.debug('proG:' + proG);
- System.debug('proG1:' + proG.Estimation_Entry_Possibility__c);
- System.debug('prod07:' + prod01);
- System.debug('prod071:' + prod01.Estimation_Entry_Possibility__c);
- Product2__c proH = new Product2__c(Name = 'MB-677:BNC鐢电紗', OT_CODE_Text__c = 'Test002', Product2__c = prod02.Id);
- insert proH;
- Product2__c proF = new Product2__c(Name = 'TooMAJ-643R:姘村泭闉樼003', OT_CODE_Text__c = 'Test003', Product2__c = prod03.Id);
- insert proF;
-
- Dealer_Product__c dpc = new Dealer_Product__c();
- dpc.Dealer_Contact__c = contract.id;
- dpc.Dealer_Product2__c = proG.id;
- dpc.Special_Discount__c = 45;
- dpc.Campaign_StartDate__c = Date.today().addDays(-1);
- dpc.Campaign_EndDate__c = Date.today().addDays(1);
- insert dpc;
-
- Dealer_Product__c dpc2 = new Dealer_Product__c();
- dpc2.Dealer_Contact__c = contract.id;
- dpc2.Dealer_Product2__c = proG.id;
- dpc2.Special_Campaign_Price__c = 4500;
- insert dpc2;
-
- Dealer_Product__c dpc1 = new Dealer_Product__c();
- dpc1.Dealer_Contact__c = contract.id;
- dpc1.Dealer_Product2__c = proH.id;
- dpc1.Special_Campaign_Price__c = 23456;
- insert dpc1;
- //淇冮攢
- order2 = new Consumable_order__c();
- order2.Name = 'testMing2';
- order2.Order_status__c = '鎵瑰噯';
- order2.RecordTypeid = System.Label.RT_ConOrder_Order;
- order2.Dealer_Info__c = myAccount1.id;
- order2.Inventory_date__c = Date.today();
- order2.Order_type__c = '璁㈠崟';
- order2.Order_ProType__c = 'ET';
- order2.orderPattern__c = 'promotionorder';
- insert order2;
- Consumable_orderdetails__c Orderdet2 = new Consumable_orderdetails__c();
- Orderdet2.Name = 'OCM_01_00103';
- Orderdet2.Consumable_order__c = order2.Id;
- Orderdet2.RecordTypeId = System.Label.RT_ConOrderDetail1_Order;
- Orderdet2.Consumable_Product__c = proG.Id;
- Orderdet2.Consumable_count__c = 4;
- insert Orderdet2;
-
- Consumable_order_details2__c createDetail4 = new Consumable_order_details2__c();
- createDetail4 = new Consumable_order_details2__c();
- createDetail4.Consumable_Product__c = proG.id;
- createDetail4.Asset_Model_No__c = 'Test03';
- createDetail4.Consumable_order_minor__c = order2.id;
- createDetail4.Consumable_Arrived_order__c = order2.id;
- createDetail4.RecordTypeid = System.Label.RT_ConOrderDetail2_Delivery;
- createDetail4.Asset_Model_No__c = proG.Asset_Model_No__c;
- createDetail4.Bar_Code__c = '123';
- createDetail4.Box_Piece__c = '鐩�';
- createDetail4.Arrive_date__c = Date.today();
- Oly_TriggerHandler.bypass('ConsumableAssetHander');
- insert createDetail4;
- }
-
- System.runAs(MyUser_Test) {
- Test.startTest();
- LexConsumableController.Results re = LexConsumableController.init('', order2.Id, '');
- LexConsumableController.searchConsumableorderdetails(
- re.userWorkLocation,
- re.agencyProType,
- re.accountName,
- re.accountid,
- re.hospitalId,
- re.contractId,
- 'testMing',
- '',
- '',
- '',
- re.category_Goods,
- re.specialCampaign,
- JSON.serialize(re.dealerProductId),
- re.methodType,
- JSON.serialize(re.consumableorderdetailsRecordsview),
- re.editAble,
- re.proLimitAndDate
- );
- LexConsumableController.searchorderdetails(
- re.methodType,
- re.accountid,
- re.hospitalId,
- re.contractId,
- re.userWorkLocation,
- re.accountName,
- re.proLimitAndDate,
- re.editAble
- );
- LexConsumableController.searchConsumableorderdetails(
- re.userWorkLocation,
- re.agencyProType,
- re.accountName,
- re.accountid,
- re.hospitalId,
- contract.Id,
- 'testMing',
- '',
- '',
- '',
- re.category_Goods,
- re.specialCampaign,
- JSON.serialize(re.dealerProductId),
- re.methodType,
- JSON.serialize(re.consumableorderdetailsRecordsview),
- re.editAble,
- re.proLimitAndDate
- );
- LexConsumableController.searchorderdetails(
- re.methodType,
- re.accountid,
- re.hospitalId,
- contract.Id,
- re.userWorkLocation,
- re.accountName,
- re.proLimitAndDate,
- re.editAble
- );
- Test.stopTest();
- }
- }
-
- @IsTest
- static void ConsumableOrdertest4() {
- user MyUser_Test;
- Account myAccount1;
- Account contract;
- User thisUser = [SELECT Id FROM User WHERE Id = :UserInfo.getUserId()];
- NoteStay__c n = new NoteStay__c(Name = 'NoteStay', IsStay__c = true);
- insert n;
- System.runAs(thisUser) {
- Profile prof1 = [
- SELECT Id
- FROM Profile
- WHERE Name = '901_缁忛攢鍟嗙ぞ鍖烘櫘閫氭潈闄恄2閲嶉獙璇�(ET)'
- ];
- List<RecordType> rectCo = [
- SELECT Id
- FROM RecordType
- WHERE IsActive = TRUE AND SobjectType = 'Account' AND Name = '璨╁2搴�'
- ];
- List<RecordType> rectCo1 = [
- SELECT Id
- FROM RecordType
- WHERE IsActive = TRUE AND SobjectType = 'Account' AND DeveloperName = 'AgencyContract'
- ];
- if (rectCo.size() == 0) {
- return;
- }
- StaticParameter.EscapeConsumableOrderDetail2Trigger = true;
-
- RecordType rectCoO = [
- SELECT Id
- FROM RecordType
- WHERE IsActive = TRUE AND SobjectType = 'Account' AND Name = '鐥呴櫌'
- ];
- Account olympus = new Account(RecordTypeId = rectCoO.Id, AgentCode_Ext__c = '9999900', Name = 'olympus');
- insert olympus;
- myAccount1 = new Account(
- name = 'Testaccount001',
- Dealer_discount__c = 10,
- RecordTypeId = rectCo[0].Id,
- AgentCode_Ext__c = '8888888',
- Product_Limit_Date__c = 'Test07|3|100,Test08|10|50'
- );
- insert myAccount1;
- System.debug('account111:' + myAccount1);
- contract = new Account(
- RecordTypeId = rectCo1[0].Id,
- Name = 'contractName',
- ParentId = myAccount1.id,
- Agent_Ref__c = myAccount1.id,
- Contract_Department_Class__c = 'ET',
- Contract_Decide_Start_Date__c = Date.today().addDays(-2),
- Contract_Decide_End_Date__c = Date.today().addDays(2),
- ET_SP_Dealer__c = true
- );
- insert contract;
- System.debug('account111:' + contract);
- Contact core = new Contact(
- email = 'jplumber@salesforce.com',
- firstname = 'Joe',
- lastname = 'Plumber',
- accountid = myAccount1.id
- );
- insert core;
- MyUser_Test = new User(
- ContactId = core.id,
- Alias = 'newUser',
- Email = 'newuser@testorg.com',
- EmailEncodingKey = 'UTF-8',
- LastName = 'TestUser',
- LanguageLocaleKey = 'zh_CN',
- LocaleSidKey = 'zh_CN',
- ProfileId = prof1.Id,
- TimeZoneSidKey = 'Asia/Shanghai',
- UserName = 'testUser@testorg.com',
- Work_Location__c = '閲嶅簡'
- );
- insert MyUser_Test;
- }
-
- System.runAs(MyUser_Test) {
- //浜у搧鏁版嵁
- Product2 prod01 = new Product2(
- Name = 'Test01',
- ProductCode = 'Test01',
- Asset_Model_No__c = 'Test01',
- SFDA_Status__c = '鏈夊姽',
- Product_Status__c = '姝e父閿�鍞�',
- SFDA_Approbated_Status__c = '鏈夋晥',
- Category3__c = 'CDS',
- Category4__c = 'OER',
- Category5__c = '鍏跺畠',
- Dealer_special_Object__c = true,
- SFDA_Approbation_No__c = 'Test001',
- Packing_list_manual__c = 1,
- SFDA_Expiration_Date__c = Date.today(),
- Intra_Trade_List_RMB_1__c = 1000,
- Intra_Trade_List_RMB_Date1__c = Date.today().addDays(-1),
- Intra_Trade_List_RMB_Date2__c = Date.today().addDays(-1),
- Intra_Trade_List_RMB_End_Date1__c = Date.today().addDays(1),
- Manual_Entry__c = false
- );
-
- Product2 prod02 = new Product2(
- Name = 'Test02',
- ProductCode = 'Test02',
- Asset_Model_No__c = 'Test02',
- SFDA_Status__c = '鏈夊姽',
- Product_Status__c = '姝e父閿�鍞�',
- SFDA_Approbated_Status__c = '鏈夋晥',
- Category3__c = 'ENT',
- Category4__c = 'Celon',
- Category5__c = 'Celon',
- Dealer_special_Object__c = true,
- SFDA_Approbation_No__c = 'Test002',
- Packing_list_manual__c = 1,
- SFDA_Expiration_Date__c = Date.today(),
- Intra_Trade_List_RMB_1__c = 1000,
- Intra_Trade_List_RMB_Date1__c = Date.today().addDays(-1),
- Intra_Trade_List_RMB_Date2__c = Date.today().addDays(-1),
- Intra_Trade_List_RMB_End_Date1__c = Date.today().addDays(1),
- Manual_Entry__c = false
- );
-
- Product2 prod03 = new Product2(
- Name = 'Test03',
- ProductCode = 'Test03',
- Asset_Model_No__c = 'Test03',
- SFDA_Status__c = '鏈夊姽',
- Dealer_special_Object__c = true,
- Product_Status__c = '姝e父閿�鍞�',
- SFDA_Approbated_Status__c = '鏈夋晥',
- Category3__c = 'US',
- Category4__c = 'ALOKA',
- Category5__c = '浣撳瓒呭0',
- Intra_Trade_List_RMB_1__c = 1000,
- Intra_Trade_List_RMB_Date1__c = Date.today().addDays(-1),
- Intra_Trade_List_RMB_End_Date1__c = Date.today().addDays(1),
- Manual_Entry__c = false
- );
- insert new List<Product2>{ prod01, prod02, prod03 };
-
- //鍒朵綔浜у搧
- Product2__c proG = new Product2__c(Name = 'MH-155:鐧藉钩琛″附', OT_CODE_Text__c = 'Test001', Product2__c = prod01.Id);
- insert proG;
- System.debug('proG:' + proG);
- System.debug('proG1:' + proG.Estimation_Entry_Possibility__c);
- System.debug('prod07:' + prod01);
- System.debug('prod071:' + prod01.Estimation_Entry_Possibility__c);
- Product2__c proH = new Product2__c(Name = 'MB-677:BNC鐢电紗', OT_CODE_Text__c = 'Test002', Product2__c = prod02.Id);
- insert proH;
- Product2__c proF = new Product2__c(Name = 'TooMAJ-643R:姘村泭闉樼003', OT_CODE_Text__c = 'Test003', Product2__c = prod03.Id);
- insert proF;
-
- //璁㈠崟
- Consumable_order__c order = new Consumable_order__c();
- order.Name = 'testMing';
- order.Order_status__c = '鎵瑰噯';
- order.RecordTypeid = System.Label.RT_ConOrder_Order;
- order.Dealer_Info__c = myAccount1.id;
- order.Inventory_date__c = Date.today();
- order.Order_type__c = '璁㈠崟';
- order.Order_ProType__c = 'ET';
- order.orderPattern__c = 'agreementorder';
- insert order;
- Consumable_orderdetails__c Orderdet = new Consumable_orderdetails__c();
- Orderdet.Name = 'OCM_01_00101';
- Orderdet.Consumable_order__c = order.Id;
- Orderdet.RecordTypeId = System.Label.RT_ConOrderDetail1_Order;
- Orderdet.Consumable_Product__c = proG.Id;
- Orderdet.Consumable_count__c = 4;
- insert Orderdet;
-
- Consumable_order_details2__c createDetail2 = new Consumable_order_details2__c();
- createDetail2 = new Consumable_order_details2__c();
- createDetail2.Consumable_Product__c = proG.id;
- createDetail2.Asset_Model_No__c = 'Test01';
- createDetail2.Consumable_order_minor__c = order.id;
- createDetail2.Consumable_Arrived_order__c = order.id;
- createDetail2.RecordTypeid = System.Label.RT_ConOrderDetail2_Delivery;
- createDetail2.Asset_Model_No__c = proG.Asset_Model_No__c;
- createDetail2.Bar_Code__c = '123';
- createDetail2.Box_Piece__c = '鐩�';
- createDetail2.Arrive_date__c = Date.today();
-
- Oly_TriggerHandler.bypass('ConsumableAssetHander');
- insert createDetail2;
+ //浜у搧鏁版嵁
+ Product2 prod01 = new Product2(Name='Test01',
+ ProductCode='Test01',
+ Asset_Model_No__c = 'Test01',
+ SFDA_Status__c = '鏈夊姽',
+ Product_Status__c = '姝e父閿�鍞�',
+ SFDA_Approbated_Status__c = '鏈夋晥',
+ Category3__c = 'CDS',
+ Category4__c = 'OER',
+ Category5__c = '鍏跺畠',
+ Dealer_special_Object__c = true,
+ SFDA_Approbation_No__c = 'Test001',
+ Packing_list_manual__c = 1,
+ SFDA_Expiration_Date__c= Date.today(),
+ Intra_Trade_List_RMB_1__c = 1000,
+ Intra_Trade_List_RMB_Date1__c = Date.today().addDays(-1),
+ Intra_Trade_List_RMB_Date2__c = Date.today().addDays(-1),
+ Intra_Trade_List_RMB_End_Date1__c = Date.today().addDays(1),
+ Manual_Entry__c = false);
+
+ Product2 prod02 = new Product2(Name='Test02',
+ ProductCode='Test02',
+ Asset_Model_No__c = 'Test02',
+ SFDA_Status__c = '鏈夊姽',
+ Product_Status__c = '姝e父閿�鍞�',
+ SFDA_Approbated_Status__c = '鏈夋晥',
+ Category3__c = 'ENT',
+ Category4__c = 'Celon',
+ Category5__c = 'Celon',
+ Dealer_special_Object__c = true,
+ SFDA_Approbation_No__c = 'Test002',
+ Packing_list_manual__c = 1,
+ SFDA_Expiration_Date__c= Date.today(),
+ Intra_Trade_List_RMB_1__c = 1000,
+ Intra_Trade_List_RMB_Date1__c = Date.today().addDays(-1),
+ Intra_Trade_List_RMB_Date2__c = Date.today().addDays(-1),
+ Intra_Trade_List_RMB_End_Date1__c = Date.today().addDays(1),
+ Manual_Entry__c = false);
+
+ Product2 prod03 = new Product2(Name='Test03',
+ ProductCode='Test03',
+ Asset_Model_No__c = 'Test03',
+ SFDA_Status__c = '鏈夊姽',
+ Dealer_special_Object__c = true,
+ Product_Status__c = '姝e父閿�鍞�',
+ SFDA_Approbated_Status__c = '鏈夋晥',
+ Category3__c = 'US',
+ Category4__c = 'ALOKA',
+ Category5__c = '浣撳瓒呭0',
+ Intra_Trade_List_RMB_1__c = 1000,
+ Intra_Trade_List_RMB_Date1__c = Date.today().addDays(-1),
+ Intra_Trade_List_RMB_End_Date1__c = Date.today().addDays(1),
+ Manual_Entry__c = false);
+ insert new Product2[] {prod01,prod02,prod03};
+
+ //鍒朵綔浜у搧
+ Product2__c proG = new Product2__c(Name='MH-155:鐧藉钩琛″附',OT_CODE_Text__c='Test001',Product2__c = prod01.Id);
+ insert proG;
+ System.debug('proG:'+proG);
+ System.debug('proG1:'+proG.Estimation_Entry_Possibility__c);
+ System.debug('prod07:'+prod01);
+ System.debug('prod071:'+prod01.Estimation_Entry_Possibility__c);
+ Product2__c proH = new Product2__c(Name='MB-677:BNC鐢电紗',OT_CODE_Text__c='Test002',Product2__c = prod02.Id);
+ insert proH;
+ Product2__c proF = new Product2__c(Name='TooMAJ-643R:姘村泭闉樼003',OT_CODE_Text__c='Test003',Product2__c = prod03.Id);
+ insert proF;
+
+ Dealer_Product__c dpc = new Dealer_Product__c();
+ dpc.Dealer_Contact__c = contract.id;
+ dpc.Dealer_Product2__c = proG.id;
+ dpc.Special_Discount__c = 45;
+ dpc.Campaign_StartDate__c = Date.today().addDays(-1);
+ dpc.Campaign_EndDate__c = Date.today().addDays(1);
+ insert dpc;
+
+ Dealer_Product__c dpc2 = new Dealer_Product__c();
+ dpc2.Dealer_Contact__c = contract.id;
+ dpc2.Dealer_Product2__c = proG.id;
+ dpc2.Special_Campaign_Price__c = 4500;
+ insert dpc2;
+
+ Dealer_Product__c dpc1 = new Dealer_Product__c();
+ dpc1.Dealer_Contact__c = contract.id;
+ dpc1.Dealer_Product2__c = proH.id;
+ dpc1.Special_Campaign_Price__c = 23456;
+ insert dpc1;
+ //淇冮攢
+ order2 = new Consumable_order__c();
+ order2.Name = 'testMing2';
+ order2.Order_status__c = '鎵瑰噯';
+ order2.RecordTypeid = System.Label.RT_ConOrder_Order;
+ order2.Dealer_Info__c = myAccount1.id;
+ order2.Inventory_date__c = Date.today();
+ order2.Order_type__c = '璁㈠崟';
+ order2.Order_ProType__c = 'ET';
+ order2.orderPattern__c = 'promotionorder';
+ insert order2;
+ Consumable_orderdetails__c Orderdet2 = new Consumable_orderdetails__c();
+ Orderdet2.Name = 'OCM_01_00103';
+ Orderdet2.Consumable_order__c = order2.Id;
+ Orderdet2.RecordTypeId = System.Label.RT_ConOrderDetail1_Order;
+ Orderdet2.Consumable_Product__c = proG.Id;
+ Orderdet2.Consumable_count__c = 4;
+ insert Orderdet2;
+
+ Consumable_order_details2__c createDetail4 = new Consumable_order_details2__c();
+ createDetail4 = new Consumable_order_details2__c();
+ createDetail4.Consumable_Product__c = proG.id;
+ createDetail4.Asset_Model_No__c = 'Test03';
+ createDetail4.Consumable_order_minor__c = order2.id;
+ createDetail4.Consumable_Arrived_order__c = order2.id;
+ createDetail4.RecordTypeid = System.Label.RT_ConOrderDetail2_Delivery;
+ createDetail4.Asset_Model_No__c = proG.Asset_Model_No__c;
+ createDetail4.Bar_Code__c = '123';
+ createDetail4.Box_Piece__c ='鐩�';
+ createDetail4.Arrive_date__c = Date.today();
+ Oly_TriggerHandler.bypass('ConsumableAssetHander');
+ insert createDetail4;
+ }
+
+ System.runAs(MyUser_Test){
Test.startTest();
- LexConsumableController.Results re = LexConsumableController.init('agreementorder', '', '');
- re.consumableorderdetailsRecordsview[0].check = true;
- re.consumableorderdetailsRecordsview[0].esd.Consumable_count__c = 1;
- String conId = contract.Id;
- LexConsumableController.ordrCopy(
- contract.Name,
- JSON.serialize(re.coc),
- re.agencyProType,
- re.accountid,
- JSON.serialize(re.consumableorderdetailsRecordsview),
- JSON.serialize(re.contactDealer),
- re.methodType,
- '',
- conId,
- re.agencyProType1,
- false
- );
- LexConsumableController.save(
- '',
- JSON.serialize(re.coc),
- re.agencyProType,
- re.accountid,
- JSON.serialize(re.consumableorderdetailsRecordsview),
- JSON.serialize(re.contactDealer),
- re.methodType,
- re.ESetId,
- '',
- conId,
- re.agencyProType1,
- false
- );
- LexConsumableController.save(
- contract.Name,
- JSON.serialize(re.coc),
- re.agencyProType,
- re.accountid,
- JSON.serialize(re.consumableorderdetailsRecordsview),
- JSON.serialize(re.contactDealer),
- re.methodType,
- re.ESetId,
- '',
- '',
- re.agencyProType1,
- false
- );
- LexConsumableController.save(
- ':Testaccount001',
- JSON.serialize(re.coc),
- 'ET',
- re.accountid,
- JSON.serialize(re.consumableorderdetailsRecordsview),
- JSON.serialize(re.contactDealer),
- re.methodType,
- re.ESetId,
- '',
- re.contractId,
- 'ET',
- false
- );
- LexConsumableController.save(
- ':Testaccount001',
- JSON.serialize(re.coc),
- 'ET',
- re.accountid,
- JSON.serialize(re.consumableorderdetailsRecordsview),
- JSON.serialize(re.contactDealer),
- 'agreementorder',
- re.ESetId,
- '',
- re.contractId,
- 'ET',
- false
- );
- LexConsumableController.save(
- ':Testaccount001',
- JSON.serialize(re.coc),
- 'ET',
- re.accountid,
- JSON.serialize(re.consumableorderdetailsRecordsview),
- JSON.serialize(re.contactDealer),
- 'promotionorder',
- re.ESetId,
- '',
- re.contractId,
- 'ET',
- false
- );
- LexConsumableController.save(
- ':Testaccount001',
- JSON.serialize(re.coc),
- 'ET',
- re.accountid,
- JSON.serialize(re.consumableorderdetailsRecordsview),
- JSON.serialize(re.contactDealer),
- 'hospitalorder',
- re.ESetId,
- '',
- re.contractId,
- 'ET',
- false
- );
+ LexConsumableController.Results re = LexConsumableController.init('', order2.Id, '');
+ LexConsumableController.searchConsumableorderdetails(re.userWorkLocation, re.agencyProType, re.accountName, re.accountid, re.hospitalId, re.contractId, 'testMing', '', '', '', re.category_Goods, re.specialCampaign, JSON.serialize(re.dealerProductId), re.methodType, JSON.serialize(re.consumableorderdetailsRecordsview), re.editAble, re.proLimitAndDate);
+ LexConsumableController.searchorderdetails(re.methodType, re.accountid, re.hospitalId, re.contractId, re.userWorkLocation, re.accountName, re.proLimitAndDate, re.editAble);
+ LexConsumableController.searchConsumableorderdetails(re.userWorkLocation, re.agencyProType, re.accountName, re.accountid, re.hospitalId, contract.Id, 'testMing', '', '', '', re.category_Goods, re.specialCampaign, JSON.serialize(re.dealerProductId), re.methodType, JSON.serialize(re.consumableorderdetailsRecordsview), re.editAble, re.proLimitAndDate);
+ LexConsumableController.searchorderdetails(re.methodType, re.accountid, re.hospitalId, contract.Id, re.userWorkLocation, re.accountName, re.proLimitAndDate, re.editAble);
Test.stopTest();
}
}
- @IsTest
- static void ConsumableOrdertest5() {
+ @IsTest
+ static void ConsumableOrdertest4(){
user MyUser_Test;
Account myAccount1;
- User thisUser = [SELECT Id FROM User WHERE Id = :UserInfo.getUserId()];
- NoteStay__c n = new NoteStay__c(Name = 'NoteStay', IsStay__c = true);
- ContentVersion cv;
- Consumable_order__c order;
+ Account contract;
+ User thisUser = [ select Id from User where Id = :UserInfo.getUserId()];
+ NoteStay__c n = new NoteStay__c(Name = 'NoteStay',IsStay__c = true);
insert n;
- System.runAs(thisUser) {
- Profile prof1 = [
- SELECT Id
- FROM Profile
- WHERE Name = '901_缁忛攢鍟嗙ぞ鍖烘櫘閫氭潈闄恄2閲嶉獙璇�(ET)'
- ];
- List<RecordType> rectCo = [
- SELECT Id
- FROM RecordType
- WHERE IsActive = TRUE AND SobjectType = 'Account' AND Name = '璨╁2搴�'
- ];
- if (rectCo.size() == 0) {
- return;
- }
- StaticParameter.EscapeConsumableOrderDetail2Trigger = true;
- RecordType rectCoO = [
- SELECT Id
- FROM RecordType
- WHERE IsActive = TRUE AND SobjectType = 'Account' AND Name = '鐥呴櫌'
- ];
- Account olympus = new Account(RecordTypeId = rectCoO.Id, AgentCode_Ext__c = '9999900', Name = 'olympus');
- insert olympus;
- myAccount1 = new Account(
- name = 'Testaccount001',
- Dealer_discount__c = 10,
- RecordTypeId = rectCo[0].Id,
- AgentCode_Ext__c = '8888888',
- Product_Limit_Date__c = 'Test07|3|100,Test08|10|50'
- );
- insert myAccount1;
- Contact core = new Contact(
- email = 'jplumber@salesforce.com',
- firstname = 'Joe',
- lastname = 'Plumber',
- accountid = myAccount1.id
- );
- insert core;
- MyUser_Test = new User(
- ContactId = core.id,
- Alias = 'newUser',
- Email = 'newuser@testorg.com',
- EmailEncodingKey = 'UTF-8',
- LastName = 'TestUser',
- LanguageLocaleKey = 'zh_CN',
- LocaleSidKey = 'zh_CN',
- ProfileId = prof1.Id,
- TimeZoneSidKey = 'Asia/Shanghai',
- UserName = 'testUser@testorg.com',
- Work_Location__c = '閲嶅簡'
- );
- insert MyUser_Test;
+ System.runAs(thisUser){
+ Profile prof1 = [select Id from Profile where Name ='901_缁忛攢鍟嗙ぞ鍖烘櫘閫氭潈闄恄2閲嶉獙璇�(ET)'];
+ List<RecordType> rectCo = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '璨╁2搴�'];
+ List<RecordType> rectCo1 = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and DeveloperName = 'AgencyContract'];
+ if (rectCo.size() == 0) {
+ return;
+ }
+ StaticParameter.EscapeConsumableOrderDetail2Trigger = true;
+
+ RecordType rectCoO = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '鐥呴櫌'];
+ Account olympus = new Account(RecordTypeId = rectCoO.Id, AgentCode_Ext__c = '9999900', Name = 'olympus');
+ insert olympus;
+ myAccount1 = new Account(name='Testaccount001',Dealer_discount__c =10,RecordTypeId = rectCo[0].Id,AgentCode_Ext__c = '8888888',Product_Limit_Date__c = 'Test07|3|100,Test08|10|50');
+ insert myAccount1;
+ System.debug('account111:'+myAccount1);
+ contract = new Account(RecordTypeId=rectCo1[0].Id ,Name ='contractName',ParentId = myAccount1.id,Agent_Ref__c =myAccount1.id, Contract_Department_Class__c = 'ET',Contract_Decide_Start_Date__c=Date.today().addDays(-2),
+ Contract_Decide_End_Date__c = Date.today().addDays(2),ET_SP_Dealer__c = true);
+ insert contract;
+ System.debug('account111:'+contract);
+ Contact core = new Contact(email='jplumber@salesforce.com', firstname='Joe',lastname='Plumber',accountid=myAccount1.id);
+ insert core;
+ MyUser_Test = New User(ContactId = core.id,Alias = 'newUser',Email='newuser@testorg.com',EmailEncodingKey='UTF-8', LastName='TestUser', LanguageLocaleKey='zh_CN',LocaleSidKey='zh_CN', ProfileId = prof1.Id,TimeZoneSidKey='Asia/Shanghai', UserName='testUser@testorg.com',Work_Location__c = '閲嶅簡');
+ insert MyUser_Test;
- order = new Consumable_order__c();
- order.Name = 'testMing';
- order.Order_status__c = '鎵瑰噯';
- order.RecordTypeid = System.Label.RT_ConOrder_Order;
- order.Dealer_Info__c = myAccount1.id;
- order.Inventory_date__c = Date.today();
- order.Order_type__c = '璁㈠崟';
- order.Order_ProType__c = 'ET';
- order.orderPattern__c = 'agreementorder';
- insert order;
+ }
+
+ System.runAs(MyUser_Test){
+ //浜у搧鏁版嵁
+ Product2 prod01 = new Product2(Name='Test01',
+ ProductCode='Test01',
+ Asset_Model_No__c = 'Test01',
+ SFDA_Status__c = '鏈夊姽',
+ Product_Status__c = '姝e父閿�鍞�',
+ SFDA_Approbated_Status__c = '鏈夋晥',
+ Category3__c = 'CDS',
+ Category4__c = 'OER',
+ Category5__c = '鍏跺畠',
+ Dealer_special_Object__c = true,
+ SFDA_Approbation_No__c = 'Test001',
+ Packing_list_manual__c = 1,
+ SFDA_Expiration_Date__c= Date.today(),
+ Intra_Trade_List_RMB_1__c = 1000,
+ Intra_Trade_List_RMB_Date1__c = Date.today().addDays(-1),
+ Intra_Trade_List_RMB_Date2__c = Date.today().addDays(-1),
+ Intra_Trade_List_RMB_End_Date1__c = Date.today().addDays(1),
+ Manual_Entry__c = false);
- cv = new ContentVersion();
+ Product2 prod02 = new Product2(Name='Test02',
+ ProductCode='Test02',
+ Asset_Model_No__c = 'Test02',
+ SFDA_Status__c = '鏈夊姽',
+ Product_Status__c = '姝e父閿�鍞�',
+ SFDA_Approbated_Status__c = '鏈夋晥',
+ Category3__c = 'ENT',
+ Category4__c = 'Celon',
+ Category5__c = 'Celon',
+ Dealer_special_Object__c = true,
+ SFDA_Approbation_No__c = 'Test002',
+ Packing_list_manual__c = 1,
+ SFDA_Expiration_Date__c= Date.today(),
+ Intra_Trade_List_RMB_1__c = 1000,
+ Intra_Trade_List_RMB_Date1__c = Date.today().addDays(-1),
+ Intra_Trade_List_RMB_Date2__c = Date.today().addDays(-1),
+ Intra_Trade_List_RMB_End_Date1__c = Date.today().addDays(1),
+ Manual_Entry__c = false);
+
+ Product2 prod03 = new Product2(Name='Test03',
+ ProductCode='Test03',
+ Asset_Model_No__c = 'Test03',
+ SFDA_Status__c = '鏈夊姽',
+ Dealer_special_Object__c = true,
+ Product_Status__c = '姝e父閿�鍞�',
+ SFDA_Approbated_Status__c = '鏈夋晥',
+ Category3__c = 'US',
+ Category4__c = 'ALOKA',
+ Category5__c = '浣撳瓒呭0',
+ Intra_Trade_List_RMB_1__c = 1000,
+ Intra_Trade_List_RMB_Date1__c = Date.today().addDays(-1),
+ Intra_Trade_List_RMB_End_Date1__c = Date.today().addDays(1),
+ Manual_Entry__c = false);
+ insert new Product2[] {prod01,prod02,prod03};
+
+ //鍒朵綔浜у搧
+ Product2__c proG = new Product2__c(Name='MH-155:鐧藉钩琛″附',OT_CODE_Text__c='Test001',Product2__c = prod01.Id);
+ insert proG;
+ System.debug('proG:'+proG);
+ System.debug('proG1:'+proG.Estimation_Entry_Possibility__c);
+ System.debug('prod07:'+prod01);
+ System.debug('prod071:'+prod01.Estimation_Entry_Possibility__c);
+ Product2__c proH = new Product2__c(Name='MB-677:BNC鐢电紗',OT_CODE_Text__c='Test002',Product2__c = prod02.Id);
+ insert proH;
+ Product2__c proF = new Product2__c(Name='TooMAJ-643R:姘村泭闉樼003',OT_CODE_Text__c='Test003',Product2__c = prod03.Id);
+ insert proF;
+
+
+ //璁㈠崟
+ Consumable_order__c order = new Consumable_order__c();
+ order.Name = 'testMing';
+ order.Order_status__c = '鎵瑰噯';
+ order.RecordTypeid = System.Label.RT_ConOrder_Order;
+ order.Dealer_Info__c = myAccount1.id;
+ order.Inventory_date__c = Date.today();
+ order.Order_type__c = '璁㈠崟';
+ order.Order_ProType__c = 'ET';
+ order.orderPattern__c = 'agreementorder';
+ insert order;
+ Consumable_orderdetails__c Orderdet = new Consumable_orderdetails__c();
+ Orderdet.Name = 'OCM_01_00101';
+ Orderdet.Consumable_order__c = order.Id;
+ Orderdet.RecordTypeId = System.Label.RT_ConOrderDetail1_Order;
+ Orderdet.Consumable_Product__c = proG.Id;
+ Orderdet.Consumable_count__c = 4;
+ insert Orderdet;
+
+ Consumable_order_details2__c createDetail2 = new Consumable_order_details2__c();
+ createDetail2 = new Consumable_order_details2__c();
+ createDetail2.Consumable_Product__c = proG.id;
+ createDetail2.Asset_Model_No__c = 'Test01';
+ createDetail2.Consumable_order_minor__c = order.id;
+ createDetail2.Consumable_Arrived_order__c = order.id;
+ createDetail2.RecordTypeid = System.Label.RT_ConOrderDetail2_Delivery;
+ createDetail2.Asset_Model_No__c = proG.Asset_Model_No__c;
+ createDetail2.Bar_Code__c = '123';
+ createDetail2.Box_Piece__c ='鐩�';
+ createDetail2.Arrive_date__c = Date.today();
+
+ Oly_TriggerHandler.bypass('ConsumableAssetHander');
+ insert createDetail2;
+
+ Test.startTest();
+ LexConsumableController.Results re = LexConsumableController.init('agreementorder', '', '');
+ re.consumableorderdetailsRecordsview[0].check = true;
+ re.consumableorderdetailsRecordsview[0].esd.Consumable_count__c = 1;
+ String conId = contract.Id;
+ LexConsumableController.ordrCopy(contract.Name,JSON.serialize(re.coc),re.agencyProType,re.accountid,JSON.serialize(re.consumableorderdetailsRecordsview),JSON.serialize(re.contactDealer),re.methodType,'',conId,re.agencyProType1,false);
+ LexConsumableController.save('',JSON.serialize(re.coc),re.agencyProType,re.accountid,JSON.serialize(re.consumableorderdetailsRecordsview),JSON.serialize(re.contactDealer),re.methodType,re.ESetId,'',conId,re.agencyProType1,false);
+ LexConsumableController.save(contract.Name,JSON.serialize(re.coc),re.agencyProType,re.accountid,JSON.serialize(re.consumableorderdetailsRecordsview),JSON.serialize(re.contactDealer),re.methodType,re.ESetId,'','',re.agencyProType1,false);
+ LexConsumableController.save(':Testaccount001',JSON.serialize(re.coc),'ET',re.accountid,JSON.serialize(re.consumableorderdetailsRecordsview),JSON.serialize(re.contactDealer),re.methodType,re.ESetId,'',re.contractId,'ET',false);
+ LexConsumableController.save(':Testaccount001',JSON.serialize(re.coc),'ET',re.accountid,JSON.serialize(re.consumableorderdetailsRecordsview),JSON.serialize(re.contactDealer),'agreementorder',re.ESetId,'',re.contractId,'ET',false);
+ LexConsumableController.save(':Testaccount001',JSON.serialize(re.coc),'ET',re.accountid,JSON.serialize(re.consumableorderdetailsRecordsview),JSON.serialize(re.contactDealer),'promotionorder',re.ESetId,'',re.contractId,'ET',false);
+ LexConsumableController.save(':Testaccount001',JSON.serialize(re.coc),'ET',re.accountid,JSON.serialize(re.consumableorderdetailsRecordsview),JSON.serialize(re.contactDealer),'hospitalorder',re.ESetId,'',re.contractId,'ET',false);
+ Test.stopTest();
+ }
+ }
+
+ @IsTest
+ static void ConsumableOrdertest5(){
+ user MyUser_Test;
+ Account myAccount1;
+ User thisUser = [ select Id from User where Id = :UserInfo.getUserId()];
+ NoteStay__c n = new NoteStay__c(Name = 'NoteStay',IsStay__c = true);
+ ContentVersion cv;
+ Consumable_order__c order;
+ insert n;
+ System.runAs(thisUser){
+ Profile prof1 = [select Id from Profile where Name ='901_缁忛攢鍟嗙ぞ鍖烘櫘閫氭潈闄恄2閲嶉獙璇�(ET)'];
+ List<RecordType> rectCo = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '璨╁2搴�'];
+ if (rectCo.size() == 0) {
+ return;
+ }
+ StaticParameter.EscapeConsumableOrderDetail2Trigger = true;
+ RecordType rectCoO = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '鐥呴櫌'];
+ Account olympus = new Account(RecordTypeId = rectCoO.Id, AgentCode_Ext__c = '9999900', Name = 'olympus');
+ insert olympus;
+ myAccount1 = new Account(name='Testaccount001',Dealer_discount__c =10,RecordTypeId = rectCo[0].Id,AgentCode_Ext__c = '8888888',Product_Limit_Date__c = 'Test07|3|100,Test08|10|50');
+ insert myAccount1;
+ Contact core = new Contact(email='jplumber@salesforce.com', firstname='Joe',lastname='Plumber',accountid=myAccount1.id);
+ insert core;
+ MyUser_Test = New User(ContactId = core.id,Alias = 'newUser',Email='newuser@testorg.com',EmailEncodingKey='UTF-8', LastName='TestUser', LanguageLocaleKey='zh_CN',LocaleSidKey='zh_CN', ProfileId = prof1.Id,TimeZoneSidKey='Asia/Shanghai', UserName='testUser@testorg.com',Work_Location__c = '閲嶅簡');
+ insert MyUser_Test;
+
+ order = new Consumable_order__c();
+ order.Name = 'testMing';
+ order.Order_status__c = '鎵瑰噯';
+ order.RecordTypeid = System.Label.RT_ConOrder_Order;
+ order.Dealer_Info__c = myAccount1.id;
+ order.Inventory_date__c = Date.today();
+ order.Order_type__c = '璁㈠崟';
+ order.Order_ProType__c = 'ET';
+ order.orderPattern__c = 'agreementorder';
+ insert order;
+
+ cv = new ContentVersion();
cv.Title = 'test.txt';
cv.PathOnClient = '/' + 'test.txt';
cv.FirstPublishLocationId = order.Id;
cv.VersionData = EncodingUtil.base64Decode('VGVzdA==');
cv.IsMajorVersion = true;
insert cv;
- }
- System.runAs(MyUser_Test) {
- Product2 prod01 = new Product2(
- Name = 'Test01',
- ProductCode = 'Test01',
- Asset_Model_No__c = 'Test01',
- SFDA_Status__c = '鏈夊姽',
- Product_Status__c = '姝e父閿�鍞�',
- SFDA_Approbated_Status__c = '鏈夋晥',
- Category3__c = 'CDS',
- Category4__c = 'OER',
- Category5__c = '鍏跺畠',
- Dealer_special_Object__c = true,
- SFDA_Approbation_No__c = 'Test001',
- Packing_list_manual__c = 1,
- SFDA_Expiration_Date__c = Date.today(),
- Intra_Trade_List_RMB_1__c = 1000,
- Intra_Trade_List_RMB_Date1__c = Date.today().addDays(-1),
- Intra_Trade_List_RMB_Date2__c = Date.today().addDays(-1),
- Intra_Trade_List_RMB_End_Date1__c = Date.today().addDays(1),
- Manual_Entry__c = false
- );
- Product2 prod02 = new Product2(
- Name = 'Test02',
- ProductCode = 'Test02',
- Asset_Model_No__c = 'Test02',
- SFDA_Status__c = '鏈夊姽',
- Product_Status__c = '姝e父閿�鍞�',
- SFDA_Approbated_Status__c = '鏈夋晥',
- Category3__c = 'CDS',
- Category4__c = 'OER',
- Category5__c = 'Celon',
- Dealer_special_Object__c = true,
- SFDA_Approbation_No__c = 'Test002',
- Packing_list_manual__c = 1,
- SFDA_Expiration_Date__c = Date.today(),
- Intra_Trade_List_RMB_1__c = 1000,
- Intra_Trade_List_RMB_Date1__c = Date.today().addDays(-1),
- Intra_Trade_List_RMB_Date2__c = Date.today().addDays(-1),
- Intra_Trade_List_RMB_End_Date1__c = Date.today().addDays(1),
- Manual_Entry__c = false
- );
+ }
+ System.runAs(MyUser_Test){
+ Product2 prod01 = new Product2(Name='Test01',
+ ProductCode='Test01',
+ Asset_Model_No__c = 'Test01',
+ SFDA_Status__c = '鏈夊姽',
+ Product_Status__c = '姝e父閿�鍞�',
+ SFDA_Approbated_Status__c = '鏈夋晥',
+ Category3__c = 'CDS',
+ Category4__c = 'OER',
+ Category5__c = '鍏跺畠',
+ Dealer_special_Object__c = true,
+ SFDA_Approbation_No__c = 'Test001',
+ Packing_list_manual__c = 1,
+ SFDA_Expiration_Date__c= Date.today(),
+ Intra_Trade_List_RMB_1__c = 1000,
+ Intra_Trade_List_RMB_Date1__c = Date.today().addDays(-1),
+ Intra_Trade_List_RMB_Date2__c = Date.today().addDays(-1),
+ Intra_Trade_List_RMB_End_Date1__c = Date.today().addDays(1),
+ Manual_Entry__c = false
+ );
- Product2 prod03 = new Product2(
- Name = 'Test03',
- ProductCode = 'Test03',
- Asset_Model_No__c = 'Test03',
- SFDA_Status__c = '鏈夊姽',
- Dealer_special_Object__c = true,
- Product_Status__c = '姝e父閿�鍞�',
- SFDA_Approbated_Status__c = '鏈夋晥',
- Category3__c = 'US',
- Category4__c = 'ALOKA',
- Category5__c = '浣撳瓒呭0',
- Intra_Trade_List_RMB_1__c = 1000,
- Intra_Trade_List_RMB_Date1__c = Date.today().addDays(-1),
- Intra_Trade_List_RMB_End_Date1__c = Date.today().addDays(1),
- Manual_Entry__c = false
- );
+ Product2 prod02 = new Product2(Name='Test02',
+ ProductCode='Test02',
+ Asset_Model_No__c = 'Test02',
+ SFDA_Status__c = '鏈夊姽',
+ Product_Status__c = '姝e父閿�鍞�',
+ SFDA_Approbated_Status__c = '鏈夋晥',
+ Category3__c = 'CDS',
+ Category4__c = 'OER',
+ Category5__c = 'Celon',
+ Dealer_special_Object__c = true,
+ SFDA_Approbation_No__c = 'Test002',
+ Packing_list_manual__c = 1,
+ SFDA_Expiration_Date__c= Date.today(),
+ Intra_Trade_List_RMB_1__c = 1000,
+ Intra_Trade_List_RMB_Date1__c = Date.today().addDays(-1),
+ Intra_Trade_List_RMB_Date2__c = Date.today().addDays(-1),
+ Intra_Trade_List_RMB_End_Date1__c = Date.today().addDays(1),
+ Manual_Entry__c = false
+ );
- Product2 prod04 = new Product2(
- Name = 'Test04',
- ProductCode = 'Test04',
- Asset_Model_No__c = 'Test04',
- SFDA_Status__c = '鏈夊姽',
- Dealer_special_Object__c = true,
- Product_Status__c = '姝e父閿�鍞�',
- SFDA_Approbated_Status__c = '鏈夋晥',
- Category3__c = 'OCS',
- Category4__c = '闄勫睘鍝�',
- Category5__c = 'OCS',
- Intra_Trade_List_RMB_1__c = 1000,
- Intra_Trade_List_RMB_Date1__c = Date.today().addDays(-1),
- Intra_Trade_List_RMB_End_Date1__c = Date.today().addDays(1),
- Manual_Entry__c = false
- );
- Product2 prod05 = new Product2(
- Name = 'Test05',
- ProductCode = 'Test05',
- Asset_Model_No__c = 'Test05',
- SFDA_Status__c = '鏈夊姽',
- Dealer_special_Object__c = true,
- Product_Status__c = '姝e父閿�鍞�',
- SFDA_Approbated_Status__c = '鏈夋晥',
- Category3__c = '鍏夋簮',
- Category4__c = 'CLV',
- Category5__c = 'S45',
- Intra_Trade_List_RMB_1__c = 1000,
- Intra_Trade_List_RMB_Date1__c = Date.today().addDays(-1),
- Intra_Trade_List_RMB_End_Date1__c = Date.today().addDays(1),
- Manual_Entry__c = false
- );
- insert new List<Product2>{ prod01, prod02, prod03, prod04, prod05 };
- Product2__c pro1 = new Product2__c(Name = 'Pro001', OT_CODE_Text__c = 'Test001', Product2__c = prod01.Id);
- Product2__c pro2 = new Product2__c(Name = 'Pro002', OT_CODE_Text__c = 'Test002', Product2__c = prod02.Id);
- Product2__c pro3 = new Product2__c(Name = 'Pro003', OT_CODE_Text__c = 'Test003', Product2__c = prod03.Id);
- Product2__c pro4 = new Product2__c(Name = 'Pro004', OT_CODE_Text__c = 'Test004', Product2__c = prod04.Id);
- Product2__c pro5 = new Product2__c(Name = 'Pro005', OT_CODE_Text__c = 'Test005', Product2__c = prod05.Id);
- insert new List<Product2__c>{ pro1, pro2, pro3, pro4, pro5 };
+ Product2 prod03 = new Product2(Name='Test03',
+ ProductCode='Test03',
+ Asset_Model_No__c = 'Test03',
+ SFDA_Status__c = '鏈夊姽',
+ Dealer_special_Object__c = true,
+ Product_Status__c = '姝e父閿�鍞�',
+ SFDA_Approbated_Status__c = '鏈夋晥',
+ Category3__c = 'US',
+ Category4__c = 'ALOKA',
+ Category5__c = '浣撳瓒呭0',
+ Intra_Trade_List_RMB_1__c = 1000,
+ Intra_Trade_List_RMB_Date1__c = Date.today().addDays(-1),
+ Intra_Trade_List_RMB_End_Date1__c = Date.today().addDays(1),
+ Manual_Entry__c = false);
- Test.startTest();
- LexConsumableController.Results re1 = LexConsumableController.categoryAllload('ET', 'CDS');
- LexConsumableController.Results re2 = LexConsumableController.categoryAllload('ENG', 'CDS');
- LexConsumableController.Results re3 = LexConsumableController.categoryAllload('', 'CDS');
- LexConsumableController.Results re4 = LexConsumableController.categoryload('ET', 'CDS', 'OER');
- LexConsumableController.Results re5 = LexConsumableController.categoryload('ENG', 'CDS', 'OER');
- LexConsumableController.Results re6 = LexConsumableController.categoryload('', 'CDS', 'OER');
- String pid = order.Id;
- LexConsumableController.filesUpload(pid, 'tset.txt', 'VGVzdA==');
- LexConsumableController.deleteAtt(cv.Id, pid);
- LexConsumableController.backOrder(pid);
- LexConsumableController.setEditAble(pid);
- LexConsumableController.delConsumable(pid);
- LexConsumableController.OffersPrice();
+ Product2 prod04 = new Product2(Name='Test04',
+ ProductCode='Test04',Asset_Model_No__c = 'Test04',
+ SFDA_Status__c = '鏈夊姽',
+ Dealer_special_Object__c = true,
+ Product_Status__c = '姝e父閿�鍞�',
+ SFDA_Approbated_Status__c = '鏈夋晥',
+ Category3__c = 'OCS',
+ Category4__c = '闄勫睘鍝�',
+ Category5__c = 'OCS',
+ Intra_Trade_List_RMB_1__c = 1000,
+ Intra_Trade_List_RMB_Date1__c = Date.today().addDays(-1),
+ Intra_Trade_List_RMB_End_Date1__c = Date.today().addDays(1),
+ Manual_Entry__c = false);
+ Product2 prod05 = new Product2(Name='Test05',
+ ProductCode='Test05',
+ Asset_Model_No__c = 'Test05',
+ SFDA_Status__c = '鏈夊姽',
+ Dealer_special_Object__c = true,
+ Product_Status__c = '姝e父閿�鍞�',
+ SFDA_Approbated_Status__c = '鏈夋晥',
+ Category3__c = '鍏夋簮',
+ Category4__c = 'CLV',
+ Category5__c = 'S45',
+ Intra_Trade_List_RMB_1__c = 1000,
+ Intra_Trade_List_RMB_Date1__c = Date.today().addDays(-1),
+ Intra_Trade_List_RMB_End_Date1__c = Date.today().addDays(1),
+ Manual_Entry__c = false);
+ insert new Product2[] {prod01,prod02,prod03, prod04, prod05};
+ Product2__c pro1 = new Product2__c(Name='Pro001',OT_CODE_Text__c='Test001',Product2__c = prod01.Id);
+ Product2__c pro2 = new Product2__c(Name='Pro002',OT_CODE_Text__c='Test002',Product2__c = prod02.Id);
+ Product2__c pro3 = new Product2__c(Name='Pro003',OT_CODE_Text__c='Test003',Product2__c = prod03.Id);
+ Product2__c pro4 = new Product2__c(Name='Pro004',OT_CODE_Text__c='Test004',Product2__c = prod04.Id);
+ Product2__c pro5 = new Product2__c(Name='Pro005',OT_CODE_Text__c='Test005',Product2__c = prod05.Id);
+ insert new Product2__c[] {pro1,pro2,pro3,pro4, pro5};
+
+
+
+ Test.startTest();
+ LexConsumableController.Results re1 = LexConsumableController.categoryAllload('ET','CDS');
+ LexConsumableController.Results re2 = LexConsumableController.categoryAllload('ENG','CDS');
+ LexConsumableController.Results re3 = LexConsumableController.categoryAllload('','CDS');
+ LexConsumableController.Results re4 = LexConsumableController.categoryload('ET','CDS','OER');
+ LexConsumableController.Results re5 = LexConsumableController.categoryload('ENG','CDS','OER');
+ LexConsumableController.Results re6 = LexConsumableController.categoryload('','CDS','OER');
+ String pid = order.Id;
+ LexConsumableController.filesUpload(pid,'tset.txt','VGVzdA==');
+ LexConsumableController.deleteAtt(cv.Id, pid);
+ LexConsumableController.backOrder(pid);
+ LexConsumableController.setEditAble(pid);
+ LexConsumableController.delConsumable(pid);
+ LexConsumableController.OffersPrice();
Test.stopTest();
- }
- }
-}
+ }
+ }
+}
\ No newline at end of file
diff --git a/force-app/main/default/classes/LexConsumableControllerTest.cls-meta.xml b/force-app/main/default/classes/LexConsumableControllerTest.cls-meta.xml
index a9fd6e9..754ecb1 100644
--- a/force-app/main/default/classes/LexConsumableControllerTest.cls-meta.xml
+++ b/force-app/main/default/classes/LexConsumableControllerTest.cls-meta.xml
@@ -1,4 +1,4 @@
-<?xml version="1.0" encoding="UTF-8" ?>
+<?xml version="1.0" encoding="UTF-8"?>
<ApexClass xmlns="http://soap.sforce.com/2006/04/metadata">
<apiVersion>57.0</apiVersion>
<status>Active</status>
diff --git a/force-app/main/default/classes/LexConsumableGoodsInfo.cls b/force-app/main/default/classes/LexConsumableGoodsInfo.cls
index 331cfbb..78044ce 100644
--- a/force-app/main/default/classes/LexConsumableGoodsInfo.cls
+++ b/force-app/main/default/classes/LexConsumableGoodsInfo.cls
@@ -1,87 +1,59 @@
public without sharing class LexConsumableGoodsInfo {
+
//鎵�鏈変骇鍝佷竴瑙�
@AuraEnabled
- public static Results initTotalNum(String ordId, String type) {
+ public static Results initTotalNum(String ordId, String type){
Results results = new Results();
List<ShowRecords> allOtherDetIifo = new List<ShowRecords>();
Set<String> orderId = new Set<String>();
- if (ordId != '1') {
- orderId.add(ordId);
+ if(ordId != '1'){
+ orderId.add(ordId);
}
try {
- if (!(orderId.size() > 0)) {
+ if(!(orderId.size() > 0)){
String userId = UserInfo.getUserId();
- List<User> userList = [
- SELECT accountid, Work_Location__c, UserPro_Type__c
- FROM user
- WHERE id = :userId
- ];
+ List<User> userList = [SELECT accountid, Work_Location__c,UserPro_Type__c
+ FROM user
+ WHERE id = :userId ];
String accountid = userList[0].accountid;
String userPro_Type = userList[0].UserPro_Type__c;
String userWorklocation = userList[0].Work_Location__c;
String rtTypeDelivery = System.Label.RT_ConOrder_Delivery;
List<Consumable_order__c> conorderlist = new List<Consumable_order__c>();
//20200916 ljh update start
- if (type != null && type.equals('all')) {
- conorderlist = [
- SELECT id, Owner.Name
- FROM Consumable_order__c
- WHERE
- Order_type__c = '璁㈠崟'
- AND recordtypeid = :rtTypeDelivery
- AND Dealer_Info__c = :accountid
- AND (OrderNumber_notarrive__c > 0
- OR Delivery_detail_count__c > 0)
- AND Order_ProType__c = :userPro_Type
- AND Order_Owner_WorkLocal__c = :userWorklocation
- AND showFalseNotshowTrue__c = FALSE
- ];
- } else {
- conorderlist = [
- SELECT id, Owner.Name
- FROM Consumable_order__c
- WHERE
- Order_type__c = '璁㈠崟'
- AND recordtypeid = :rtTypeDelivery
- AND Dealer_Info__c = :accountid
- AND Delivery_detail_count__c > 0
- AND Order_ProType__c = :userPro_Type
- AND Order_Owner_WorkLocal__c = :userWorklocation
- AND showFalseNotshowTrue__c = FALSE
- ];
+ if(type !=null && type.equals('all')){
+ conorderlist = [select id,Owner.Name from Consumable_order__c where Order_type__c = '璁㈠崟' and recordtypeid = :rtTypeDelivery and Dealer_Info__c = :accountid and (OrderNumber_notarrive__c > 0 or Delivery_detail_count__c >0) and Order_ProType__c = :userPro_Type and Order_Owner_WorkLocal__c = :userWorklocation and showFalseNotshowTrue__c = false];
+ }else{
+ conorderlist = [select id,Owner.Name from Consumable_order__c where Order_type__c = '璁㈠崟' and recordtypeid = :rtTypeDelivery and Dealer_Info__c = :accountid and Delivery_detail_count__c >0 and Order_ProType__c = :userPro_Type and Order_Owner_WorkLocal__c = :userWorklocation and showFalseNotshowTrue__c = false];
}
- for (Consumable_order__c conorder : conorderlist) {
- String temp = (String) conorder.Id;
+ for(Consumable_order__c conorder : conorderlist){
+ String temp = (String)conorder.Id;
orderId.add(temp);
}
- System.debug('ANY o' + orderId);
+ System.debug('ANY o'+orderId);
}
List<Consumable_Orderdetails__c> conOrderList1 = new List<Consumable_Orderdetails__c>();
- conOrderList1 = [
- SELECT Asset_Model_No__c, Consumable_count__c
- FROM Consumable_Orderdetails__c
- WHERE Consumable_order__c = :orderId
- ];
-
- Map<String, Decimal> allConOrderMap = new Map<String, Decimal>();
- for (Consumable_Orderdetails__c con : conOrderList1) {
- if (con.Consumable_count__c == null) {
+ conOrderList1 = [SELECT Asset_Model_No__c ,Consumable_count__c FROM Consumable_Orderdetails__c WHERE Consumable_order__c =:orderId];
+
+ Map<String,Decimal> allConOrderMap = new Map<String,Decimal>();
+ for(Consumable_Orderdetails__c con : conOrderList1){
+ if(con.Consumable_count__c == null){
con.Consumable_count__c = 0;
}
- if (allConOrderMap.containsKey(con.Asset_Model_No__c)) {
- allConOrderMap.put(con.Asset_Model_No__c, allConOrderMap.get(con.Asset_Model_No__c) + con.Consumable_count__c);
- } else {
+ if(allConOrderMap.containsKey(con.Asset_Model_No__c)){
+ allConOrderMap.put(con.Asset_Model_No__c,allConOrderMap.get(con.Asset_Model_No__c)+con.Consumable_count__c);
+ }else{
allConOrderMap.put(con.Asset_Model_No__c, con.Consumable_count__c);
}
}
- for (String pmodel : allConOrderMap.keySet()) {
- if (allConOrderMap.get(pmodel) > 0) {
+ for(String pmodel : allConOrderMap.keySet()){
+ if(allConOrderMap.get(pmodel) > 0){
ShowRecords showrecord2 = new ShowRecords();
showrecord2.recordCount = allConOrderMap.get(pmodel);
showrecord2.prodModel = pmodel;
allOtherDetIifo.add(showrecord2);
- }
+ }
}
results.result = 'Success';
results.recordList = allOtherDetIifo;
@@ -94,35 +66,28 @@
//宸插埌璐т骇鍝佷竴瑙�
@AuraEnabled
- public static Results initArrDet(String orderId) {
+ public static Results initArrDet(String orderId){
Results results = new Results();
List<ShowRecords> arrDetIifo = new List<ShowRecords>();
- try {
- List<Consumable_order_details2__c> conList = [
- SELECT id, Bar_Code__c
- FROM Consumable_order_details2__c
- WHERE Dealer_Arrive__c = TRUE AND Consumable_order_minor__c = :orderId
- ];
- Map<String, String> srtMap = new Map<String, String>();
- for (Consumable_order_details2__c con : conList) {
+ try{
+ List<Consumable_order_details2__c> conList = [SELECT id,Bar_Code__c FROM Consumable_order_details2__c WHERE Dealer_Arrive__c = true AND Consumable_order_minor__c = :orderId];
+ Map<String,String> srtMap = new Map<String,String>();
+ for(Consumable_order_details2__c con : conList){
srtMap.put(con.Bar_Code__c, con.Id);
}
List<String> str = new List<String>();
- for (String s : srtMap.keySet()) {
+ for(String s : srtMap.keySet()){
str.add(srtMap.get(s));
}
- List<AggregateResult> arrDetList = [
- SELECT Asset_Model_No__c prodModel, count(Id) recordCount
- FROM Consumable_order_details2__c
- WHERE Id = :str
- GROUP BY Asset_Model_No__c
- ];
- for (Integer i = 0; i < arrDetList.size(); i++) {
+ List<AggregateResult> arrDetList = [SELECT Asset_Model_No__c prodModel,count(Id) recordCount FROM Consumable_order_details2__c
+ WHERE Id =: str
+ GROUP BY Asset_Model_No__c];
+ for(Integer i = 0 ; i< arrDetList.size();i++){
arrDetIifo.add(new showRecords(arrDetList[i]));
}
results.recordList = arrDetIifo;
results.result = 'Success';
- } catch (Exception e) {
+ }catch (Exception e){
results.result = 'Fail';
results.errorMsg = e.getLineNumber() + '---' + e.getMessage();
}
@@ -131,16 +96,14 @@
//宸插埌璐т骇鍝佷竴瑙圓ll
@AuraEnabled
- public static Results initArrDetAll(String type) {
+ public static Results initArrDetAll(String type){
Results results = new Results();
List<ShowRecords> allArrDetIifo = new List<ShowRecords>();
- try {
+ try{
String userId = UserInfo.getUserId();
- List<User> userList = [
- SELECT accountid, Work_Location__c, UserPro_Type__c
- FROM user
- WHERE id = :userId
- ];
+ List<User> userList = [SELECT accountid, Work_Location__c,UserPro_Type__c
+ FROM user
+ WHERE id = :userId ];
String accountid = userList[0].accountid;
String userPro_Type = userList[0].UserPro_Type__c;
String userWorklocation = userList[0].Work_Location__c;
@@ -149,91 +112,50 @@
List<Consumable_order__c> conorderlist = new List<Consumable_order__c>();
//20200916 ljh update start
//conorderlist = [select id,name,Owner.Name from Consumable_order__c where Order_type__c = '璁㈠崟' and recordtypeid = :rtTypeDelivery and Dealer_Info__c = :accountid and Delivery_detail_count__c >0 and Order_ProType__c = :userPro_Type and Order_Owner_WorkLocal__c = :userWorklocation];
- if (type != null && type.equals('all')) {
- conorderlist = [
- SELECT id, Owner.Name
- FROM Consumable_order__c
- WHERE
- Order_type__c = '璁㈠崟'
- AND recordtypeid = :rtTypeDelivery
- AND Dealer_Info__c = :accountid
- AND (OrderNumber_notarrive__c > 0
- OR Delivery_detail_count__c > 0)
- AND Order_ProType__c = :userPro_Type
- AND Order_Owner_WorkLocal__c = :userWorklocation
- AND showFalseNotshowTrue__c = FALSE
- ];
- } else {
- conorderlist = [
- SELECT id, Owner.Name
- FROM Consumable_order__c
- WHERE
- Order_type__c = '璁㈠崟'
- AND recordtypeid = :rtTypeDelivery
- AND Dealer_Info__c = :accountid
- AND Delivery_detail_count__c > 0
- AND Order_ProType__c = :userPro_Type
- AND Order_Owner_WorkLocal__c = :userWorklocation
- AND showFalseNotshowTrue__c = FALSE
- ];
+ if(type !=null && type.equals('all')){
+ conorderlist = [select id,Owner.Name from Consumable_order__c where Order_type__c = '璁㈠崟' and recordtypeid = :rtTypeDelivery and Dealer_Info__c = :accountid and (OrderNumber_notarrive__c > 0 or Delivery_detail_count__c >0) and Order_ProType__c = :userPro_Type and Order_Owner_WorkLocal__c = :userWorklocation and showFalseNotshowTrue__c = false];
+ }else{
+ conorderlist = [select id,Owner.Name from Consumable_order__c where Order_type__c = '璁㈠崟' and recordtypeid = :rtTypeDelivery and Dealer_Info__c = :accountid and Delivery_detail_count__c >0 and Order_ProType__c = :userPro_Type and Order_Owner_WorkLocal__c = :userWorklocation and showFalseNotshowTrue__c = false];
}
//20200916 ljh update end
// List<Consumable_order__c> conorderlist = [select id,Owner.Name from Consumable_order__c where Order_type__c = '璁㈠崟' and recordtypeid = :rtTypeDelivery and Dealer_Info__c = :accountid and Delivery_detail_count__c > 0 and Order_ProType__c = :userPro_Type and Order_Owner_WorkLocal__c = :userWorklocation];
- System.debug('======' + conorderlist + 'daxiao:' + conorderlist.size());
- for (Consumable_order__c conorder : conorderlist) {
- System.debug('======' + conorder.Owner.Name + '======');
+ System.debug('======'+conorderlist+'daxiao:'+conorderlist.size());
+ for(Consumable_order__c conorder : conorderlist){
+ System.debug('======'+conorder.Owner.Name+'======');
}
Set<String> orderId = new Set<String>();
- for (Consumable_order__c conorder : conorderlist) {
+ for(Consumable_order__c conorder : conorderlist){
orderId.add(conorder.Id);
}
- System.debug('ANY o' + orderId);
+ System.debug('ANY o'+orderId);
List<Consumable_order_details2__c> conList = new List<Consumable_order_details2__c>();
//20200916 ljh update start
//conList = [SELECT id,Bar_Code__c FROM Consumable_order_details2__c WHERE Dealer_Arrive__c = true AND Consumable_order_minor__c = :orderId AND Deliver_date__c < :orderdate AND recordtypeid = :System.Label.RT_ConOrderDetail2_Delivery];
- if (type != null && type.equals('all')) {
- conList = [
- SELECT id, Bar_Code__c
- FROM Consumable_order_details2__c
- WHERE
- Dealer_Arrive__c = TRUE
- AND Consumable_order_minor__c = :orderId
- AND recordtypeid = :System.Label.RT_ConOrderDetail2_Delivery
- ];
- } else {
- conList = [
- SELECT id, Bar_Code__c
- FROM Consumable_order_details2__c
- WHERE
- Dealer_Arrive__c = TRUE
- AND Consumable_order_minor__c = :orderId
- AND Deliver_date__c < :orderdate
- AND recordtypeid = :System.Label.RT_ConOrderDetail2_Delivery
- ];
+ if(type !=null && type.equals('all')){
+ conList = [SELECT id,Bar_Code__c FROM Consumable_order_details2__c WHERE Dealer_Arrive__c = true AND Consumable_order_minor__c = :orderId AND recordtypeid = :System.Label.RT_ConOrderDetail2_Delivery];
+ }else{
+ conList = [SELECT id,Bar_Code__c FROM Consumable_order_details2__c WHERE Dealer_Arrive__c = true AND Consumable_order_minor__c = :orderId AND Deliver_date__c < :orderdate AND recordtypeid = :System.Label.RT_ConOrderDetail2_Delivery];
}
- //20200916 ljh update end
+ //20200916 ljh update end
// List<Consumable_order_details2__c> conList = [SELECT id,Bar_Code__c FROM Consumable_order_details2__c WHERE Dealer_Arrive__c = false AND Consumable_order_minor__c = :orderId AND Deliver_date__c < :orderdate AND recordtypeid = :System.Label.RT_ConOrderDetail2_Delivery];
- Map<String, String> srtMap = new Map<String, String>();
- for (Consumable_order_details2__c con : conList) {
+ Map<String,String> srtMap = new Map<String,String>();
+ for(Consumable_order_details2__c con : conList){
srtMap.put(con.Bar_Code__c, con.Id);
}
List<String> str = new List<String>();
- for (String s : srtMap.keySet()) {
+ for(String s : srtMap.keySet()){
str.add(srtMap.get(s));
}
- List<AggregateResult> arrDetList = [
- SELECT Asset_Model_No__c prodModel, count(Id) recordCount
- FROM Consumable_order_details2__c
- WHERE Id = :str
- GROUP BY Asset_Model_No__c
- ];
+ List<AggregateResult> arrDetList = [SELECT Asset_Model_No__c prodModel,count(Id) recordCount FROM Consumable_order_details2__c
+ WHERE Id =: str
+ GROUP BY Asset_Model_No__c];
// List<showRecords> allArrDetIifo = new List<showRecords>();
- for (Integer i = 0; i < arrDetList.size(); i++) {
+ for(Integer i = 0 ; i< arrDetList.size();i++){
allArrDetIifo.add(new showRecords(arrDetList[i]));
}
results.recordList = allArrDetIifo;
results.result = 'Success';
- } catch (Exception e) {
+ }catch (Exception e){
results.result = 'Fail';
results.errorMsg = e.getLineNumber() + '---' + e.getMessage();
}
@@ -242,22 +164,20 @@
//鏈埌璐т骇鍝佷竴瑙�
@AuraEnabled
- public static Results initDeliveryDet(String orderId) {
+ public static Results initDeliveryDet(String orderId){
Results results = new Results();
List<ShowRecords> notArrDetIifo = new List<ShowRecords>();
- try {
- List<AggregateResult> notArrDetList = [
- SELECT Asset_Model_No__c prodModel, count(Id) recordCount
- FROM Consumable_order_details2__c
- WHERE Dealer_Arrive__c = FALSE AND Consumable_order_minor__c = :orderId
- GROUP BY Asset_Model_No__c
- ];
- for (Integer i = 0; i < notArrDetList.size(); i++) {
+ try{
+ List<AggregateResult> notArrDetList = [SELECT Asset_Model_No__c prodModel,count(Id) recordCount FROM Consumable_order_details2__c
+ WHERE Dealer_Arrive__c = false
+ AND Consumable_order_minor__c = :orderId
+ GROUP BY Asset_Model_No__c];
+ for(Integer i = 0 ; i< notArrDetList.size();i++){
notArrDetIifo.add(new showRecords(notArrDetList[i]));
}
results.recordList = notArrDetIifo;
results.result = 'Success';
- } catch (Exception e) {
+ }catch (Exception e){
results.result = 'Fail';
results.errorMsg = e.getLineNumber() + '---' + e.getMessage();
}
@@ -266,16 +186,14 @@
//鏈埌璐т骇鍝佷竴瑙圓ll
@AuraEnabled
- public static Results initDeliveryDetAll(String type) {
+ public static Results initDeliveryDetAll(String type){
Results results = new Results();
List<ShowRecords> allNotArrDetIifo = new List<ShowRecords>();
- try {
+ try{
String userId = UserInfo.getUserId();
- List<User> userList = [
- SELECT accountid, Work_Location__c, UserPro_Type__c
- FROM user
- WHERE id = :userId
- ];
+ List<User> userList = [SELECT accountid, Work_Location__c,UserPro_Type__c
+ FROM user
+ WHERE id = :userId ];
String accountid = userList[0].accountid;
String userPro_Type = userList[0].UserPro_Type__c;
String userWorklocation = userList[0].Work_Location__c;
@@ -284,91 +202,50 @@
List<Consumable_order__c> conorderlist = new List<Consumable_order__c>();
//20200916 ljh update start
//conorderlist = [select id,name,Owner.Name from Consumable_order__c where Order_type__c = '璁㈠崟' and recordtypeid = :rtTypeDelivery and Dealer_Info__c = :accountid and Delivery_detail_count__c >0 and Order_ProType__c = :userPro_Type and Order_Owner_WorkLocal__c = :userWorklocation];
- if (type != null && type.equals('all')) {
- conorderlist = [
- SELECT id, Owner.Name
- FROM Consumable_order__c
- WHERE
- Order_type__c = '璁㈠崟'
- AND recordtypeid = :rtTypeDelivery
- AND Dealer_Info__c = :accountid
- AND (OrderNumber_notarrive__c > 0
- OR Delivery_detail_count__c > 0)
- AND Order_ProType__c = :userPro_Type
- AND Order_Owner_WorkLocal__c = :userWorklocation
- AND showFalseNotshowTrue__c = FALSE
- ];
- } else {
- conorderlist = [
- SELECT id, Owner.Name
- FROM Consumable_order__c
- WHERE
- Order_type__c = '璁㈠崟'
- AND recordtypeid = :rtTypeDelivery
- AND Dealer_Info__c = :accountid
- AND Delivery_detail_count__c > 0
- AND Order_ProType__c = :userPro_Type
- AND Order_Owner_WorkLocal__c = :userWorklocation
- AND showFalseNotshowTrue__c = FALSE
- ];
+ if(type !=null && type.equals('all')){
+ conorderlist = [select id,Owner.Name from Consumable_order__c where Order_type__c = '璁㈠崟' and recordtypeid = :rtTypeDelivery and Dealer_Info__c = :accountid and (OrderNumber_notarrive__c > 0 or Delivery_detail_count__c >0) and Order_ProType__c = :userPro_Type and Order_Owner_WorkLocal__c = :userWorklocation and showFalseNotshowTrue__c = false];
+ }else{
+ conorderlist = [select id,Owner.Name from Consumable_order__c where Order_type__c = '璁㈠崟' and recordtypeid = :rtTypeDelivery and Dealer_Info__c = :accountid and Delivery_detail_count__c >0 and Order_ProType__c = :userPro_Type and Order_Owner_WorkLocal__c = :userWorklocation and showFalseNotshowTrue__c = false];
}
//20200916 ljh update end
// List<Consumable_order__c> conorderlist = [select id,Owner.Name from Consumable_order__c where Order_type__c = '璁㈠崟' and recordtypeid = :rtTypeDelivery and Dealer_Info__c = :accountid and Delivery_detail_count__c > 0 and Order_ProType__c = :userPro_Type and Order_Owner_WorkLocal__c = :userWorklocation];
- System.debug('======' + conorderlist + 'daxiao:' + conorderlist.size());
- for (Consumable_order__c conorder : conorderlist) {
- System.debug('======' + conorder.Owner.Name + '======');
+ System.debug('======'+conorderlist+'daxiao:'+conorderlist.size());
+ for(Consumable_order__c conorder : conorderlist){
+ System.debug('======'+conorder.Owner.Name+'======');
}
Set<String> orderId = new Set<String>();
- for (Consumable_order__c conorder : conorderlist) {
+ for(Consumable_order__c conorder : conorderlist){
orderId.add(conorder.Id);
}
- System.debug('ANY o' + orderId);
+ System.debug('ANY o'+orderId);
List<Consumable_order_details2__c> conList = new List<Consumable_order_details2__c>();
//20200916 ljh update start
//conList = [SELECT id,Bar_Code__c FROM Consumable_order_details2__c WHERE Dealer_Arrive__c = false AND Consumable_order_minor__c = :orderId AND Deliver_date__c < :orderdate AND recordtypeid = :System.Label.RT_ConOrderDetail2_Delivery];
- if (type != null && type.equals('all')) {
- conList = [
- SELECT id, Bar_Code__c
- FROM Consumable_order_details2__c
- WHERE
- Dealer_Arrive__c = FALSE
- AND Consumable_order_minor__c = :orderId
- AND recordtypeid = :System.Label.RT_ConOrderDetail2_Delivery
- ];
- } else {
- conList = [
- SELECT id, Bar_Code__c
- FROM Consumable_order_details2__c
- WHERE
- Dealer_Arrive__c = FALSE
- AND Consumable_order_minor__c = :orderId
- AND Deliver_date__c < :orderdate
- AND recordtypeid = :System.Label.RT_ConOrderDetail2_Delivery
- ];
+ if(type !=null && type.equals('all')){
+ conList = [SELECT id,Bar_Code__c FROM Consumable_order_details2__c WHERE Dealer_Arrive__c = false AND Consumable_order_minor__c = :orderId AND recordtypeid = :System.Label.RT_ConOrderDetail2_Delivery];
+ }else{
+ conList = [SELECT id,Bar_Code__c FROM Consumable_order_details2__c WHERE Dealer_Arrive__c = false AND Consumable_order_minor__c = :orderId AND Deliver_date__c < :orderdate AND recordtypeid = :System.Label.RT_ConOrderDetail2_Delivery];
}
- //20200916 ljh update end
+ //20200916 ljh update end
// List<Consumable_order_details2__c> conList = [SELECT id,Bar_Code__c FROM Consumable_order_details2__c WHERE Dealer_Arrive__c = false AND Consumable_order_minor__c = :orderId AND Deliver_date__c < :orderdate AND recordtypeid = :System.Label.RT_ConOrderDetail2_Delivery];
- Map<String, String> srtMap = new Map<String, String>();
- for (Consumable_order_details2__c con : conList) {
+ Map<String,String> srtMap = new Map<String,String>();
+ for(Consumable_order_details2__c con : conList){
srtMap.put(con.Bar_Code__c, con.Id);
}
List<String> str = new List<String>();
- for (String s : srtMap.keySet()) {
+ for(String s : srtMap.keySet()){
str.add(srtMap.get(s));
}
- List<AggregateResult> arrDetList = [
- SELECT Asset_Model_No__c prodModel, count(Id) recordCount
- FROM Consumable_order_details2__c
- WHERE Id = :str AND Cancellation_Flag__c = FALSE
- GROUP BY Asset_Model_No__c
- ];
+ List<AggregateResult> arrDetList = [SELECT Asset_Model_No__c prodModel,count(Id) recordCount FROM Consumable_order_details2__c
+ WHERE Id =: str and Cancellation_Flag__c = false
+ GROUP BY Asset_Model_No__c];
// List<showRecords> allArrDetIifo = new List<showRecords>();
- for (Integer i = 0; i < arrDetList.size(); i++) {
+ for(Integer i = 0 ; i< arrDetList.size();i++){
allNotArrDetIifo.add(new showRecords(arrDetList[i]));
}
results.recordList = allNotArrDetIifo;
results.result = 'Success';
- } catch (Exception e) {
+ }catch (Exception e){
results.result = 'Fail';
results.errorMsg = e.getLineNumber() + '---' + e.getMessage();
}
@@ -377,89 +254,77 @@
//杩樻病鍙戣揣鏁伴噺
@AuraEnabled
- public static Results initNotArrDet(String orderId) {
+ public static Results initNotArrDet(String orderId){
Results results = new Results();
List<Consumable_Orderdetails__c> otherArrDetIifo = new List<Consumable_Orderdetails__c>();
List<ShowRecords> otherArrList = new List<ShowRecords>();
- try {
+ try{
List<showRecords> arrDetIifo = new List<showRecords>();
List<showRecords> notArrDetIifo = new List<showRecords>();
List<showRecords> allArrDetIifo = new List<showRecords>();
// List<Consumable_order_details2__c> conList = [SELECT id,Bar_Code__c FROM Consumable_order_details2__c WHERE Dealer_Arrive__c = true AND Consumable_order_minor__c = :orderId];
- List<Consumable_order_details2__c> conList = [
- SELECT id, Bar_Code__c
- FROM Consumable_order_details2__c
- WHERE Consumable_order_minor__c = :orderId
- ];
- Map<String, String> srtMap = new Map<String, String>();
- for (Consumable_order_details2__c con : conList) {
+ List<Consumable_order_details2__c> conList = [SELECT id,Bar_Code__c FROM Consumable_order_details2__c WHERE Consumable_order_minor__c = :orderId];
+ Map<String,String> srtMap = new Map<String,String>();
+ for(Consumable_order_details2__c con : conList){
srtMap.put(con.Bar_Code__c, con.Id);
}
List<String> str = new List<String>();
- for (String s : srtMap.keySet()) {
+ for(String s : srtMap.keySet()){
str.add(srtMap.get(s));
}
- List<AggregateResult> arrDetList = [
- SELECT Asset_Model_No__c prodModel, count(Id) recordCount
- FROM Consumable_order_details2__c
- WHERE Id = :str AND Dealer_Arrive__c = TRUE
- GROUP BY Asset_Model_No__c
- ];
- for (Integer i = 0; i < arrDetList.size(); i++) {
+ List<AggregateResult> arrDetList = [SELECT Asset_Model_No__c prodModel,count(Id) recordCount FROM Consumable_order_details2__c
+ WHERE Id =: str AND Dealer_Arrive__c = true
+ GROUP BY Asset_Model_No__c];
+ for(Integer i = 0 ; i< arrDetList.size();i++){
arrDetIifo.add(new showRecords(arrDetList[i]));
}
- List<AggregateResult> notArrDetList = [
- SELECT Asset_Model_No__c prodModel, count(Id) recordCount
- FROM Consumable_order_details2__c
- WHERE Dealer_Arrive__c = FALSE AND Consumable_order_minor__c = :orderId
- GROUP BY Asset_Model_No__c
- ];
- for (Integer i = 0; i < notArrDetList.size(); i++) {
+ List<AggregateResult> notArrDetList = [SELECT Asset_Model_No__c prodModel,count(Id) recordCount FROM Consumable_order_details2__c
+ WHERE Dealer_Arrive__c = false
+ AND Consumable_order_minor__c = :orderId
+ GROUP BY Asset_Model_No__c];
+ for(Integer i = 0 ; i< notArrDetList.size();i++){
notArrDetIifo.add(new showRecords(notArrDetList[i]));
}
// List<AggregateResult> allArrDetList = [SELECT Asset_Model_No__c prodModel,count(Id) recordCount FROM Consumable_order_details2__c
// WHERE Id =: str
// GROUP BY Asset_Model_No__c];
- List<Consumable_Orderdetails__c> allArrDetList = [
- SELECT Asset_Model_No__c, Consumable_count__c
- FROM Consumable_Orderdetails__c
- WHERE Consumable_order__c = :orderId
- ];
+ List<Consumable_Orderdetails__c> allArrDetList = [SELECT Asset_Model_No__c,Consumable_count__c FROM Consumable_Orderdetails__c
+ WHERE Consumable_order__c =: orderId];
// for(Integer i = 0 ; i< allArrDetList.size();i++){
// allArrDetIifo.add(new showRecords(notArrDetList[i]));
// }
- Map<String, Decimal> arrDetMap = new Map<String, Decimal>();
- for (showRecords arr : arrDetIifo) {
+ Map<String,Decimal> arrDetMap = new Map<String,Decimal>();
+ for(showRecords arr : arrDetIifo){
arrDetMap.put(arr.prodModel, arr.recordCount);
}
- for (showRecords notarr : notArrDetIifo) {
- if (arrDetMap.containsKey(notarr.prodModel)) {
- arrDetMap.put(notarr.prodModel, arrDetMap.get(notarr.prodModel) + notarr.recordCount);
- } else {
+ for(showRecords notarr : notArrDetIifo){
+ if(arrDetMap.containsKey(notarr.prodModel)){
+ arrDetMap.put(notarr.prodModel, arrDetMap.get(notarr.prodModel)+notarr.recordCount);
+ }else{
arrDetMap.put(notarr.prodModel, notarr.recordCount);
}
}
- List<String> AssetModelNoEdList = new List<String>(); //20200904 ljh add
- for (Consumable_Orderdetails__c allarr : allArrDetList) {
- for (String promodel : arrDetMap.keySet()) {
- if (allarr.Asset_Model_No__c == promodel) {
- if ((allarr.Consumable_count__c - arrDetMap.get(promodel)) > 0) {
+ List<String> AssetModelNoEdList = new List<String>();//20200904 ljh add
+ for(Consumable_Orderdetails__c allarr : allArrDetList){
+ for(String promodel : arrDetMap.keySet()){
+ if(allarr.Asset_Model_No__c == promodel){
+ if((allarr.Consumable_count__c - arrDetMap.get(promodel)) > 0){
allarr.Consumable_count__c = (allarr.Consumable_count__c - arrDetMap.get(promodel));
otherArrDetIifo.add(allarr);
}
- AssetModelNoEdList.add(promodel); //20200904 ljh add
+ AssetModelNoEdList.add(promodel);//20200904 ljh add
}
}
}
//20200904 ljh add start
- for (Consumable_Orderdetails__c allarr1 : allArrDetList) {
- if (!AssetModelNoEdList.contains(allarr1.Asset_Model_No__c)) {
+ for(Consumable_Orderdetails__c allarr1 : allArrDetList){
+ if(!AssetModelNoEdList.contains(allarr1.Asset_Model_No__c)){
otherArrDetIifo.add(allarr1);
}
}
- for (Consumable_Orderdetails__c conOrderDetail : otherArrDetIifo) {
+ for(Consumable_Orderdetails__c conOrderDetail : otherArrDetIifo){
ShowRecords record = new ShowRecords();
record.prodModel = conOrderDetail.Asset_Model_No__c;
record.recordCount = conOrderDetail.Consumable_count__c;
@@ -467,7 +332,7 @@
}
results.recordList = otherArrList;
results.result = 'Success';
- } catch (Exception e) {
+ }catch (Exception e){
results.result = 'Fail';
results.errorMsg = e.getLineNumber() + '---' + e.getMessage();
}
@@ -476,16 +341,14 @@
//杩樻病鍙戣揣鏁伴噺All
@AuraEnabled
- public static Results initNotArrDetAll(String type) {
+ public static Results initNotArrDetAll(String type){
Results results = new Results();
List<ShowRecords> allOtherDetIifo = new List<ShowRecords>();
- try {
+ try{
String userId = UserInfo.getUserId();
- List<User> userList = [
- SELECT accountid, Work_Location__c, UserPro_Type__c
- FROM user
- WHERE id = :userId
- ];
+ List<User> userList = [SELECT accountid, Work_Location__c,UserPro_Type__c
+ FROM user
+ WHERE id = :userId ];
String accountid = userList[0].accountid;
String userPro_Type = userList[0].UserPro_Type__c;
String userWorklocation = userList[0].Work_Location__c;
@@ -494,110 +357,69 @@
List<Consumable_order__c> conorderlist = new List<Consumable_order__c>();
//20200916 ljh update start
//conorderlist = [select id,name,Owner.Name from Consumable_order__c where Order_type__c = '璁㈠崟' and recordtypeid = :rtTypeDelivery and Dealer_Info__c = :accountid and Delivery_detail_count__c >0 and Order_ProType__c = :userPro_Type and Order_Owner_WorkLocal__c = :userWorklocation];
- if (type != null && type.equals('all')) {
- conorderlist = [
- SELECT id, Owner.Name
- FROM Consumable_order__c
- WHERE
- Order_type__c = '璁㈠崟'
- AND recordtypeid = :rtTypeDelivery
- AND Dealer_Info__c = :accountid
- AND (OrderNumber_notarrive__c > 0
- OR Delivery_detail_count__c > 0)
- AND Order_ProType__c = :userPro_Type
- AND Order_Owner_WorkLocal__c = :userWorklocation
- AND showFalseNotshowTrue__c = FALSE
- ];
- } else {
- conorderlist = [
- SELECT id, Owner.Name
- FROM Consumable_order__c
- WHERE
- Order_type__c = '璁㈠崟'
- AND recordtypeid = :rtTypeDelivery
- AND Dealer_Info__c = :accountid
- AND Delivery_detail_count__c > 0
- AND Order_ProType__c = :userPro_Type
- AND Order_Owner_WorkLocal__c = :userWorklocation
- AND showFalseNotshowTrue__c = FALSE
- ];
+ if(type !=null && type.equals('all')){
+ conorderlist = [select id,Owner.Name from Consumable_order__c where Order_type__c = '璁㈠崟' and recordtypeid = :rtTypeDelivery and Dealer_Info__c = :accountid and (OrderNumber_notarrive__c > 0 or Delivery_detail_count__c >0) and Order_ProType__c = :userPro_Type and Order_Owner_WorkLocal__c = :userWorklocation and showFalseNotshowTrue__c = false];
+ }else{
+ conorderlist = [select id,Owner.Name from Consumable_order__c where Order_type__c = '璁㈠崟' and recordtypeid = :rtTypeDelivery and Dealer_Info__c = :accountid and Delivery_detail_count__c >0 and Order_ProType__c = :userPro_Type and Order_Owner_WorkLocal__c = :userWorklocation and showFalseNotshowTrue__c = false];
}
//20200916 ljh update end
// List<Consumable_order__c> conorderlist = [select id,Owner.Name from Consumable_order__c where Order_type__c = '璁㈠崟' and recordtypeid = :rtTypeDelivery and Dealer_Info__c = :accountid and Delivery_detail_count__c > 0 and Order_ProType__c = :userPro_Type and Order_Owner_WorkLocal__c = :userWorklocation];
- System.debug('======' + conorderlist + 'daxiao:' + conorderlist.size());
- for (Consumable_order__c conorder : conorderlist) {
- System.debug('======' + conorder.Owner.Name + '======');
+ System.debug('======'+conorderlist+'daxiao:'+conorderlist.size());
+ for(Consumable_order__c conorder : conorderlist){
+ System.debug('======'+conorder.Owner.Name+'======');
}
Set<String> orderId = new Set<String>();
- for (Consumable_order__c conorder : conorderlist) {
+ for(Consumable_order__c conorder : conorderlist){
orderId.add(conorder.Id);
}
- System.debug('ANY o' + orderId);
+ System.debug('ANY o'+orderId);
List<Consumable_order_details2__c> conList = new List<Consumable_order_details2__c>();
//20200916 ljh update start
//conList = [SELECT id,Bar_Code__c FROM Consumable_order_details2__c WHERE Consumable_order_minor__c = :orderId AND Deliver_date__c < :orderdate AND recordtypeid = :System.Label.RT_ConOrderDetail2_Delivery];
- if (type != null && type.equals('all')) {
- conList = [
- SELECT id, Bar_Code__c
- FROM Consumable_order_details2__c
- WHERE Consumable_order_minor__c = :orderId AND recordtypeid = :System.Label.RT_ConOrderDetail2_Delivery
- ];
- } else {
- conList = [
- SELECT id, Bar_Code__c
- FROM Consumable_order_details2__c
- WHERE
- Consumable_order_minor__c = :orderId
- AND Deliver_date__c < :orderdate
- AND recordtypeid = :System.Label.RT_ConOrderDetail2_Delivery
- ];
+ if(type !=null && type.equals('all')){
+ conList = [SELECT id,Bar_Code__c FROM Consumable_order_details2__c WHERE Consumable_order_minor__c = :orderId AND recordtypeid = :System.Label.RT_ConOrderDetail2_Delivery];
+ }else{
+ conList = [SELECT id,Bar_Code__c FROM Consumable_order_details2__c WHERE Consumable_order_minor__c = :orderId AND Deliver_date__c < :orderdate AND recordtypeid = :System.Label.RT_ConOrderDetail2_Delivery];
}
- //20200916 ljh update end
+ //20200916 ljh update end
// List<Consumable_order_details2__c> conList = [SELECT id,Bar_Code__c FROM Consumable_order_details2__c WHERE Consumable_order_minor__c = :orderId AND Deliver_date__c < :orderdate AND recordtypeid = :System.Label.RT_ConOrderDetail2_Delivery];
- Map<String, String> srtMap = new Map<String, String>();
- for (Consumable_order_details2__c con : conList) {
+ Map<String,String> srtMap = new Map<String,String>();
+ for(Consumable_order_details2__c con : conList){
srtMap.put(con.Bar_Code__c, con.Id);
}
List<String> str = new List<String>();
- for (String s : srtMap.keySet()) {
+ for(String s : srtMap.keySet()){
str.add(srtMap.get(s));
}
- List<AggregateResult> arrDetList = [
- SELECT Asset_Model_No__c prodModel, count(Id) recordCount
- FROM Consumable_order_details2__c
- WHERE Id = :str AND Cancellation_Flag__c = FALSE
- GROUP BY Asset_Model_No__c
- ];
- Map<String, Decimal> conOrderMap = new Map<String, Decimal>();
- for (AggregateResult agg : arrDetList) {
+ List<AggregateResult> arrDetList = [SELECT Asset_Model_No__c prodModel,count(Id) recordCount FROM Consumable_order_details2__c
+ WHERE Id =: str and Cancellation_Flag__c = false
+ GROUP BY Asset_Model_No__c];
+ Map<String,Decimal> conOrderMap = new Map<String,Decimal>();
+ for(AggregateResult agg : arrDetList){
conOrderMap.put(String.valueOf(agg.get('prodModel')), Integer.valueOf(agg.get('recordCount')));
}
- List<Consumable_Orderdetails__c> conOrderList1 = [
- SELECT Asset_Model_No__c, Consumable_count__c
- FROM Consumable_Orderdetails__c
- WHERE Consumable_order__c = :orderId
- ];
- Map<String, Decimal> allConOrderMap = new Map<String, Decimal>();
- for (Consumable_Orderdetails__c con : conOrderList1) {
- if (con.Consumable_count__c == null) {
+ List<Consumable_Orderdetails__c> conOrderList1 = [SELECT Asset_Model_No__c ,Consumable_count__c FROM Consumable_Orderdetails__c WHERE Consumable_order__c =: orderId ];
+ Map<String,Decimal> allConOrderMap = new Map<String,Decimal>();
+ for(Consumable_Orderdetails__c con : conOrderList1){
+ if(con.Consumable_count__c == null){
con.Consumable_count__c = 0;
}
- if (allConOrderMap.containsKey(con.Asset_Model_No__c)) {
- allConOrderMap.put(con.Asset_Model_No__c, allConOrderMap.get(con.Asset_Model_No__c) + con.Consumable_count__c);
- } else {
+ if(allConOrderMap.containsKey(con.Asset_Model_No__c)){
+ allConOrderMap.put(con.Asset_Model_No__c,allConOrderMap.get(con.Asset_Model_No__c)+con.Consumable_count__c);
+ }else{
allConOrderMap.put(con.Asset_Model_No__c, con.Consumable_count__c);
}
}
- for (String pmodel : allConOrderMap.keySet()) {
- if (conOrderMap.containsKey(pmodel)) {
- if (allConOrderMap.get(pmodel) - conOrderMap.get(pmodel) > 0) {
+ for(String pmodel : allConOrderMap.keySet()){
+ if(conOrderMap.containsKey(pmodel)){
+ if(allConOrderMap.get(pmodel) - conOrderMap.get(pmodel) > 0){
showRecords showrecord1 = new showRecords();
showrecord1.recordCount = allConOrderMap.get(pmodel) - conOrderMap.get(pmodel);
showrecord1.prodModel = pmodel;
allOtherDetIifo.add(showrecord1);
}
- } else {
+ }else{
showRecords showrecord2 = new showRecords();
showrecord2.recordCount = allConOrderMap.get(pmodel);
showrecord2.prodModel = pmodel;
@@ -606,7 +428,7 @@
}
results.recordList = allOtherDetIifo;
results.result = 'Success';
- } catch (Exception e) {
+ }catch (Exception e){
results.result = 'Fail';
results.errorMsg = e.getLineNumber() + '---' + e.getMessage();
}
@@ -615,30 +437,26 @@
//鍙戣揣涓冨ぉ杩樻湭鍒拌揣鏁�
@AuraEnabled
- public static Results initMoreThan7(String orderId) {
+ public static Results initMoreThan7(String orderId){
Results results = new Results();
List<ShowRecords> morethansevendaysIifo = new List<ShowRecords>();
- try {
- List<AggregateResult> morethan7daysList = [
- SELECT Asset_Model_No__c prodModel, count(Id) recordCount
- FROM Consumable_order_details2__c
- WHERE
- Consumable_order_minor__c != NULL
- AND Dealer_Shipment__c = FALSE
- AND Dealer_Arrive__c = FALSE
- AND Dealer_Saled__c = FALSE
- AND Consumable_order_minor__r.showFalseNotshowTrue__c = FALSE
- AND Deliver_date__c < LAST_N_DAYS:7
- AND Consumable_order_minor__c = :orderId
- GROUP BY Asset_Model_No__c
- ];
-
- for (Integer i = 0; i < morethan7daysList.size(); i++) {
+ try{
+ List<AggregateResult> morethan7daysList = [SELECT Asset_Model_No__c prodModel,count(Id) recordCount FROM Consumable_order_details2__c
+ WHERE Consumable_order_minor__c != null
+ AND Dealer_Shipment__c = false
+ AND Dealer_Arrive__c = false
+ AND Dealer_Saled__c = false
+ AND Consumable_order_minor__r.showFalseNotshowTrue__c = false
+ AND Deliver_date__c < LAST_N_DAYS:7
+ AND Consumable_order_minor__c = :orderId
+ GROUP BY Asset_Model_No__c];
+
+ for(Integer i = 0 ; i< morethan7daysList.size() ; i++){
morethansevendaysIifo.add(new showRecords(morethan7daysList[i]));
}
results.recordList = morethansevendaysIifo;
results.result = 'Success';
- } catch (Exception e) {
+ }catch (Exception e){
results.result = 'Fail';
results.errorMsg = e.getLineNumber() + '---' + e.getMessage();
}
@@ -647,16 +465,14 @@
//鍙戣揣涓冨ぉ杩樻湭鍒拌揣鏁癆ll
@AuraEnabled
- public static Results initMoreThan7All(String type) {
+ public static Results initMoreThan7All(String type){
Results results = new Results();
List<ShowRecords> morethansevendaysIifo = new List<ShowRecords>();
- try {
+ try{
String userId = UserInfo.getUserId();
- List<User> userList = [
- SELECT accountid, Work_Location__c, UserPro_Type__c
- FROM user
- WHERE id = :userId
- ];
+ List<User> userList = [SELECT accountid, Work_Location__c,UserPro_Type__c
+ FROM user
+ WHERE id = :userId ];
String accountid = userList[0].accountid;
String userPro_Type = userList[0].UserPro_Type__c;
String userWorklocation = userList[0].Work_Location__c;
@@ -665,106 +481,63 @@
List<Consumable_order__c> conorderlist = new List<Consumable_order__c>();
//20200916 ljh update start
//conorderlist = [select id,name,Owner.Name from Consumable_order__c where Order_type__c = '璁㈠崟' and recordtypeid = :rtTypeDelivery and Dealer_Info__c = :accountid and Delivery_detail_count__c >0 and Order_ProType__c = :userPro_Type and Order_Owner_WorkLocal__c = :userWorklocation];
- if (type != null && type.equals('all')) {
- conorderlist = [
- SELECT id, Owner.Name
- FROM Consumable_order__c
- WHERE
- Order_type__c = '璁㈠崟'
- AND recordtypeid = :rtTypeDelivery
- AND Dealer_Info__c = :accountid
- AND (OrderNumber_notarrive__c > 0
- OR Delivery_detail_count__c > 0)
- AND Order_ProType__c = :userPro_Type
- AND Order_Owner_WorkLocal__c = :userWorklocation
- AND showFalseNotshowTrue__c = FALSE
- ];
- } else {
- conorderlist = [
- SELECT id, Owner.Name
- FROM Consumable_order__c
- WHERE
- Order_type__c = '璁㈠崟'
- AND recordtypeid = :rtTypeDelivery
- AND Dealer_Info__c = :accountid
- AND Delivery_detail_count__c > 0
- AND Order_ProType__c = :userPro_Type
- AND Order_Owner_WorkLocal__c = :userWorklocation
- AND showFalseNotshowTrue__c = FALSE
- ];
+ if(type !=null && type.equals('all')){
+ conorderlist = [select id,Owner.Name from Consumable_order__c where Order_type__c = '璁㈠崟' and recordtypeid = :rtTypeDelivery and Dealer_Info__c = :accountid and (OrderNumber_notarrive__c > 0 or Delivery_detail_count__c >0) and Order_ProType__c = :userPro_Type and Order_Owner_WorkLocal__c = :userWorklocation and showFalseNotshowTrue__c = false];
+ }else{
+ conorderlist = [select id,Owner.Name from Consumable_order__c where Order_type__c = '璁㈠崟' and recordtypeid = :rtTypeDelivery and Dealer_Info__c = :accountid and Delivery_detail_count__c >0 and Order_ProType__c = :userPro_Type and Order_Owner_WorkLocal__c = :userWorklocation and showFalseNotshowTrue__c = false];
}
- system.debug('==============>conorderlist' + conorderlist);
- system.debug('==============>conorderlist' + conorderlist.size());
+ system.debug('==============>conorderlist'+conorderlist);
+ system.debug('==============>conorderlist'+conorderlist.size());
//20200916 ljh update end
// List<Consumable_order__c> conorderlist = [select id,Owner.Name from Consumable_order__c where Order_type__c = '璁㈠崟' and recordtypeid = :rtTypeDelivery and Dealer_Info__c = :accountid and Delivery_detail_count__c > 0 and Order_ProType__c = :userPro_Type and Order_Owner_WorkLocal__c = :userWorklocation];
- System.debug('======' + conorderlist + 'daxiao:' + conorderlist.size());
- for (Consumable_order__c conorder : conorderlist) {
- System.debug('======' + conorder.Owner.Name + '======');
+ System.debug('======'+conorderlist+'daxiao:'+conorderlist.size());
+ for(Consumable_order__c conorder : conorderlist){
+ System.debug('======'+conorder.Owner.Name+'======');
}
Set<String> orderId = new Set<String>();
- for (Consumable_order__c conorder : conorderlist) {
+ for(Consumable_order__c conorder : conorderlist){
orderId.add(conorder.Id);
}
- System.debug('ANY o' + orderId);
+ System.debug('ANY o'+orderId);
List<Consumable_order_details2__c> conList = new List<Consumable_order_details2__c>();
//20200916 ljh update start
//conList = [SELECT id,Bar_Code__c FROM Consumable_order_details2__c WHERE Dealer_Arrive__c = false AND Consumable_order_minor__c = :orderId AND Deliver_date__c < :orderdate AND recordtypeid = :System.Label.RT_ConOrderDetail2_Delivery];
- if (type != null && type.equals('all')) {
+ if(type !=null && type.equals('all')){
system.debug('all============');
- conList = [
- SELECT id, Bar_Code__c
- FROM Consumable_order_details2__c
- WHERE
- Dealer_Arrive__c = FALSE
- AND Consumable_order_minor__c = :orderId
- AND recordtypeid = :System.Label.RT_ConOrderDetail2_Delivery
- ];
- system.debug('allconList===========' + conList.size());
- } else {
+ conList = [SELECT id,Bar_Code__c FROM Consumable_order_details2__c WHERE Dealer_Arrive__c = false AND Consumable_order_minor__c = :orderId AND recordtypeid = :System.Label.RT_ConOrderDetail2_Delivery];
+ system.debug('allconList==========='+conList.size());
+ }else{
system.debug('notall=============');
- conList = [
- SELECT id, Bar_Code__c
- FROM Consumable_order_details2__c
- WHERE
- Dealer_Arrive__c = FALSE
- AND Consumable_order_minor__c = :orderId
- AND Deliver_date__c < :orderdate
- AND recordtypeid = :System.Label.RT_ConOrderDetail2_Delivery
- ];
- system.debug('notallconList===========' + conList.size());
+ conList = [SELECT id,Bar_Code__c FROM Consumable_order_details2__c WHERE Dealer_Arrive__c = false AND Consumable_order_minor__c = :orderId AND Deliver_date__c < :orderdate AND recordtypeid = :System.Label.RT_ConOrderDetail2_Delivery];
+ system.debug('notallconList==========='+conList.size());
}
- //20200916 ljh update end
+ //20200916 ljh update end
// List<Consumable_order_details2__c> conList = [SELECT id,Bar_Code__c FROM Consumable_order_details2__c WHERE Dealer_Arrive__c = false AND Consumable_order_minor__c = :orderId AND Deliver_date__c < :orderdate AND recordtypeid = :System.Label.RT_ConOrderDetail2_Delivery];
- Map<String, String> srtMap = new Map<String, String>();
- for (Consumable_order_details2__c con : conList) {
+ Map<String,String> srtMap = new Map<String,String>();
+ for(Consumable_order_details2__c con : conList){
srtMap.put(con.Bar_Code__c, con.Id);
}
List<String> str = new List<String>();
- for (String s : srtMap.keySet()) {
+ for(String s : srtMap.keySet()){
str.add(srtMap.get(s));
}
- List<AggregateResult> morethan7daysList = [
- SELECT Asset_Model_No__c prodModel, count(Id) recordCount
- FROM Consumable_order_details2__c
- WHERE
- Id = :str
- AND Cancellation_Flag__c = FALSE
- AND Consumable_order_minor__c != NULL
- AND Dealer_Shipment__c = FALSE
- AND Dealer_Arrive__c = FALSE
- AND Dealer_Saled__c = FALSE
- AND Consumable_order_minor__r.showFalseNotshowTrue__c = FALSE
- AND Deliver_date__c < LAST_N_DAYS:7
- GROUP BY Asset_Model_No__c
- ];
- system.debug('Morethan7daysList================>' + morethan7daysList.size());
- for (Integer i = 0; i < morethan7daysList.size(); i++) {
+ List<AggregateResult> morethan7daysList = [SELECT Asset_Model_No__c prodModel,count(Id) recordCount FROM Consumable_order_details2__c
+ WHERE Id =: str and Cancellation_Flag__c = false
+ AND Consumable_order_minor__c != null
+ AND Dealer_Shipment__c = false
+ AND Dealer_Arrive__c = false
+ AND Dealer_Saled__c = false
+ AND Consumable_order_minor__r.showFalseNotshowTrue__c = false
+ AND Deliver_date__c < LAST_N_DAYS:7
+ GROUP BY Asset_Model_No__c];
+ system.debug('Morethan7daysList================>'+morethan7daysList.size());
+ for(Integer i = 0 ; i< morethan7daysList.size() ; i++){
morethansevendaysIifo.add(new showRecords(morethan7daysList[i]));
- system.debug('MorethansevendaysIifo+++++++' + morethansevendaysIifo);
+ system.debug('MorethansevendaysIifo+++++++'+morethansevendaysIifo);
}
results.recordList = morethansevendaysIifo;
results.result = 'Success';
- } catch (Exception e) {
+ }catch (Exception e){
results.result = 'Fail';
results.errorMsg = e.getLineNumber() + '---' + e.getMessage();
}
@@ -780,17 +553,17 @@
public List<ShowRecords> recordList;
}
+
public class ShowRecords implements Comparable {
@AuraEnabled
public Decimal recordCount { get; set; }
@AuraEnabled
public String prodModel { get; set; }
- public ShowRecords() {
- }
+ public ShowRecords() {}
public ShowRecords(AggregateResult e) {
- recordCount = Integer.valueOf(e.get('recordCount'));
+ recordCount =Integer.valueOf(e.get('recordCount'));
prodModel = String.valueOf(e.get('prodModel'));
}
// 鎺掑簭
@@ -798,4 +571,4 @@
return null;
}
}
-}
+}
\ No newline at end of file
diff --git a/force-app/main/default/classes/LexConsumableGoodsInfoTest.cls b/force-app/main/default/classes/LexConsumableGoodsInfoTest.cls
index 6365069..9f28b06 100644
--- a/force-app/main/default/classes/LexConsumableGoodsInfoTest.cls
+++ b/force-app/main/default/classes/LexConsumableGoodsInfoTest.cls
@@ -1,199 +1,142 @@
@istest
public class LexConsumableGoodsInfoTest {
@IsTest
- static void lexConsumableGoodsInfoTest1() {
+ static void lexConsumableGoodsInfoTest1(){
user MyUser_Test;
Account myAccount1;
- User thisUser = [SELECT Id FROM User WHERE Id = :UserInfo.getUserId()];
- NoteStay__c n = new NoteStay__c(Name = 'NoteStay', IsStay__c = true);
+ User thisUser = [ select Id from User where Id = :UserInfo.getUserId()];
+ NoteStay__c n = new NoteStay__c(Name = 'NoteStay',IsStay__c = true);
insert n;
- System.runAs(thisUser) {
- Profile prof1 = [
- SELECT Id
- FROM Profile
- WHERE Name = '901_缁忛攢鍟嗙ぞ鍖烘櫘閫氭潈闄恄2閲嶉獙璇�(ET)'
- ];
- List<RecordType> rectCo = [
- SELECT Id
- FROM RecordType
- WHERE IsActive = TRUE AND SobjectType = 'Account' AND Name = '璨╁2搴�'
- ];
- if (rectCo.size() == 0) {
- return;
- }
- StaticParameter.EscapeConsumableOrderDetail2Trigger = true;
+ System.runAs(thisUser){
+ Profile prof1 = [select Id from Profile where Name ='901_缁忛攢鍟嗙ぞ鍖烘櫘閫氭潈闄恄2閲嶉獙璇�(ET)'];
+ List<RecordType> rectCo = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '璨╁2搴�'];
+ if (rectCo.size() == 0) {
+ return;
+ }
+ StaticParameter.EscapeConsumableOrderDetail2Trigger = true;
+
+ RecordType rectCoO = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '鐥呴櫌'];
+ Account olympus = new Account(RecordTypeId = rectCoO.Id, AgentCode_Ext__c = '9999900', Name = 'olympus');
+ insert olympus;
+ myAccount1 = new Account(name='Testaccount001',Dealer_discount__c =10,RecordTypeId = rectCo[0].Id,AgentCode_Ext__c = '8888888',Product_Limit_Date__c = 'Test07|3|100,Test08|10|50');
+ insert myAccount1;
+ Contact core = new Contact(email='jplumber@salesforce.com', firstname='Joe',lastname='Plumber',accountid=myAccount1.id);
+ insert core;
+ MyUser_Test = New User(ContactId = core.id,Alias = 'newUser',Email='newuser@testorg.com',EmailEncodingKey='UTF-8', LastName='TestUser', LanguageLocaleKey='zh_CN',LocaleSidKey='zh_CN', ProfileId = prof1.Id,TimeZoneSidKey='Asia/Shanghai', UserName='testUser@testorg.com',Work_Location__c = '閲嶅簡');
+ insert MyUser_Test;
- RecordType rectCoO = [
- SELECT Id
- FROM RecordType
- WHERE IsActive = TRUE AND SobjectType = 'Account' AND Name = '鐥呴櫌'
- ];
- Account olympus = new Account(RecordTypeId = rectCoO.Id, AgentCode_Ext__c = '9999900', Name = 'olympus');
- insert olympus;
- myAccount1 = new Account(
- name = 'Testaccount001',
- Dealer_discount__c = 10,
- RecordTypeId = rectCo[0].Id,
- AgentCode_Ext__c = '8888888',
- Product_Limit_Date__c = 'Test07|3|100,Test08|10|50'
- );
- insert myAccount1;
- Contact core = new Contact(
- email = 'jplumber@salesforce.com',
- firstname = 'Joe',
- lastname = 'Plumber',
- accountid = myAccount1.id
- );
- insert core;
- MyUser_Test = new User(
- ContactId = core.id,
- Alias = 'newUser',
- Email = 'newuser@testorg.com',
- EmailEncodingKey = 'UTF-8',
- LastName = 'TestUser',
- LanguageLocaleKey = 'zh_CN',
- LocaleSidKey = 'zh_CN',
- ProfileId = prof1.Id,
- TimeZoneSidKey = 'Asia/Shanghai',
- UserName = 'testUser@testorg.com',
- Work_Location__c = '閲嶅簡'
- );
- insert MyUser_Test;
- }
+ }
+
+ system.runAs(MyUser_Test){
+ //浜у搧鏁版嵁
+ Product2 prod07 = new Product2(Name='Test07',ProductCode='Test07',Asset_Model_No__c = 'Test07',SFDA_Status__c = '鏈夊姽',Dealer_special_Object__c = true,Packing_list_manual__c = 1,Manual_Entry__c = false);
+ Product2 prod08 = new Product2(Name='Test08',ProductCode='Test08',Asset_Model_No__c = 'Test08',SFDA_Status__c = '鏈夊姽',Dealer_special_Object__c = true,Packing_list_manual__c = 1,Manual_Entry__c = false);
+ Product2 prod09 = new Product2(Name='Test09',ProductCode='Test09',Asset_Model_No__c = 'Test09',SFDA_Status__c = '鏈夊姽',Dealer_special_Object__c = true,Packing_list_manual__c = 1,Manual_Entry__c = false);
+ insert new Product2[] {prod07,prod08,prod09};
- System.runAs(MyUser_Test) {
- //浜у搧鏁版嵁
- Product2 prod07 = new Product2(
- Name = 'Test07',
- ProductCode = 'Test07',
- Asset_Model_No__c = 'Test07',
- SFDA_Status__c = '鏈夊姽',
- Dealer_special_Object__c = true,
- Packing_list_manual__c = 1,
- Manual_Entry__c = false
- );
- Product2 prod08 = new Product2(
- Name = 'Test08',
- ProductCode = 'Test08',
- Asset_Model_No__c = 'Test08',
- SFDA_Status__c = '鏈夊姽',
- Dealer_special_Object__c = true,
- Packing_list_manual__c = 1,
- Manual_Entry__c = false
- );
- Product2 prod09 = new Product2(
- Name = 'Test09',
- ProductCode = 'Test09',
- Asset_Model_No__c = 'Test09',
- SFDA_Status__c = '鏈夊姽',
- Dealer_special_Object__c = true,
- Packing_list_manual__c = 1,
- Manual_Entry__c = false
- );
- insert new List<Product2>{ prod07, prod08, prod09 };
+ //鍒朵綔浜у搧
+ Product2__c proG = new Product2__c(Name='MH-155:鐧藉钩琛″附',OT_CODE_Text__c='Test001',Product2__c = prod07.Id);
+ insert proG;
+ Product2__c proH = new Product2__c(Name='MB-677:BNC鐢电紗',OT_CODE_Text__c='Test002',Product2__c = prod08.Id);
+ insert proH;
+ Product2__c proF = new Product2__c(Name='TooMAJ-643R:姘村泭闉樼003',OT_CODE_Text__c='Test003',Product2__c = prod09.Id);
+ insert proF;
- //鍒朵綔浜у搧
- Product2__c proG = new Product2__c(Name = 'MH-155:鐧藉钩琛″附', OT_CODE_Text__c = 'Test001', Product2__c = prod07.Id);
- insert proG;
- Product2__c proH = new Product2__c(Name = 'MB-677:BNC鐢电紗', OT_CODE_Text__c = 'Test002', Product2__c = prod08.Id);
- insert proH;
- Product2__c proF = new Product2__c(Name = 'TooMAJ-643R:姘村泭闉樼003', OT_CODE_Text__c = 'Test003', Product2__c = prod09.Id);
- insert proF;
- //璁㈠崟
- Consumable_order__c order = new Consumable_order__c();
- order.Name = 'testMing';
- order.Order_status__c = '鎵瑰噯';
- order.RecordTypeid = System.Label.RT_ConOrder_Order;
- order.Dealer_Info__c = myAccount1.id;
- order.Inventory_date__c = Date.today();
- order.Order_type__c = '璁㈠崟';
- order.Order_ProType__c = 'ET';
- insert order;
- //鍒拌揣
- Consumable_order__c order2 = new Consumable_order__c();
- order2.Name = 'testMing1';
- order2.Order_status__c = '鎵瑰噯';
- order2.RecordTypeid = '01210000000c9dqAAA';
- order2.Dealer_Info__c = myAccount1.id;
- order2.Order_type__c = '鍒拌揣';
- order2.Order_ProType__c = 'ET';
- insert order2;
+ //璁㈠崟
+ Consumable_order__c order = new Consumable_order__c();
+ order.Name = 'testMing';
+ order.Order_status__c = '鎵瑰噯';
+ order.RecordTypeid = System.Label.RT_ConOrder_Order;
+ order.Dealer_Info__c = myAccount1.id;
+ order.Inventory_date__c = Date.today();
+ order.Order_type__c = '璁㈠崟';
+ order.Order_ProType__c = 'ET';
+ insert order;
+ //鍒拌揣
+ Consumable_order__c order2 = new Consumable_order__c();
+ order2.Name = 'testMing1';
+ order2.Order_status__c = '鎵瑰噯';
+ order2.RecordTypeid = '01210000000c9dqAAA';
+ order2.Dealer_Info__c = myAccount1.id;
+ order2.Order_type__c = '鍒拌揣';
+ order2.Order_ProType__c = 'ET';
+ insert order2;
- List<Consumable_order_details2__c> conList = new List<Consumable_order_details2__c>();
- //鍒朵綔Consumable_order_details__c-------ProductCount
- // 閿�鍞�
- Consumable_order_details2__c dataForProductCount7 = new Consumable_order_details2__c();
- dataForProductCount7.Bar_Code__c = '123456789298k250AAAAA';
- dataForProductCount7.Sterilization_limit__c = Date.today().addDays(2);
- dataForProductCount7.Arrive_date__c = Date.today();
- dataForProductCount7.RecordTypeid = System.Label.RT_ConOrderDetail2_Delivery;
- dataForProductCount7.Consumable_Product__c = proH.id;
- dataForProductCount7.Asset_Model_No__c = proH.Asset_Model_No__c;
- dataForProductCount7.Box_Piece__c = '鐩�';
+ List<Consumable_order_details2__c> conList = new List<Consumable_order_details2__c>();
+ //鍒朵綔Consumable_order_details__c-------ProductCount
+ // 閿�鍞�
+ Consumable_order_details2__c dataForProductCount7 = new Consumable_order_details2__c();
+ dataForProductCount7.Bar_Code__c = '123456789298k250AAAAA';
+ dataForProductCount7.Sterilization_limit__c = Date.today().addDays(2);
+ dataForProductCount7.Arrive_date__c = Date.today();
+ dataForProductCount7.RecordTypeid = System.Label.RT_ConOrderDetail2_Delivery;
+ dataForProductCount7.Consumable_Product__c = proH.id;
+ dataForProductCount7.Asset_Model_No__c = proH.Asset_Model_No__c;
+ dataForProductCount7.Box_Piece__c = '鐩�';
dataForProductCount7.Used_date__c = Date.today();
dataForProductCount7.Consumable_order_minor__c = order.id;
- conList.add(dataForProductCount7);
- // 鍦ㄥ簱 杩囨湡 鐩�
- Consumable_order_details2__c dataForProduct = new Consumable_order_details2__c();
- dataForProduct.Bar_Code__c = '123456789498k250BBBBB';
- dataForProduct.Sterilization_limit__c = Date.today().addDays(-2);
- dataForProduct.Arrive_date__c = Date.today();
- dataForProduct.RecordTypeid = System.Label.RT_ConOrderDetail2_Delivery;
- dataForProduct.Consumable_Product__c = proF.id;
- dataForProduct.Asset_Model_No__c = proF.Asset_Model_No__c;
- dataForProduct.Box_Piece__c = '鐩�';
- dataForProduct.Consumable_order_minor__c = order.id;
+ conList.add(dataForProductCount7);
+ // 鍦ㄥ簱 杩囨湡 鐩�
+ Consumable_order_details2__c dataForProduct = new Consumable_order_details2__c();
+ dataForProduct.Bar_Code__c = '123456789498k250BBBBB';
+ dataForProduct.Sterilization_limit__c = Date.today().addDays(-2);
+ dataForProduct.Arrive_date__c = Date.today();
+ dataForProduct.RecordTypeid = System.Label.RT_ConOrderDetail2_Delivery;
+ dataForProduct.Consumable_Product__c = proF.id;
+ dataForProduct.Asset_Model_No__c = proF.Asset_Model_No__c;
+ dataForProduct.Box_Piece__c = '鐩�';
+ dataForProduct.Consumable_order_minor__c = order.id;
- conList.add(dataForProduct);
- // 鍦ㄥ簱 杩囨湡 涓�
- Consumable_order_details2__c dataForProductCount3 = new Consumable_order_details2__c();
- dataForProductCount3.Bar_Code__c = '123456788398k250CCCCC';
- dataForProductCount3.Sterilization_limit__c = Date.today().addDays(-2);
- dataForProductCount3.Arrive_date__c = Date.today();
- dataForProductCount3.RecordTypeid = System.Label.RT_ConOrderDetail2_Delivery;
- dataForProductCount3.Consumable_Product__c = proG.id;
- dataForProductCount3.Asset_Model_No__c = proG.Asset_Model_No__c;
- dataForProductCount3.Box_Piece__c = '涓�';
+ conList.add(dataForProduct);
+ // 鍦ㄥ簱 杩囨湡 涓�
+ Consumable_order_details2__c dataForProductCount3 = new Consumable_order_details2__c();
+ dataForProductCount3.Bar_Code__c = '123456788398k250CCCCC';
+ dataForProductCount3.Sterilization_limit__c = Date.today().addDays(-2);
+ dataForProductCount3.Arrive_date__c = Date.today();
+ dataForProductCount3.RecordTypeid = System.Label.RT_ConOrderDetail2_Delivery;
+ dataForProductCount3.Consumable_Product__c = proG.id;
+ dataForProductCount3.Asset_Model_No__c = proG.Asset_Model_No__c;
+ dataForProductCount3.Box_Piece__c = '涓�';
dataForProductCount3.RemoveBox_No__c = 1;
dataForProductCount3.Consumable_order_minor__c = order.id;
- conList.add(dataForProductCount3);
- insert conList;
-
- //杩囨湡搴撳瓨姹囨�讳俊鎭� add by Wang Xueqin
- List<Consumable_order_details2__c> conList1 = new List<Consumable_order_details2__c>();
- Consumable_order_details2__c dataForProductCount4 = new Consumable_order_details2__c();
- dataForProductCount4.Bar_Code__c = '1001';
- dataForProductCount4.Arrive_date__c = Date.today();
- dataForProductCount4.Send_Date__c = null;
- dataForProductCount4.Used_date__c = null;
- dataForProductCount4.Return_date__c = null;
- dataForProductCount4.Lose_Flag__c = false;
- dataForProductCount4.Cancellation_Flag__c = false;
- dataForProductCount4.Consumable_Product__c = proG.Id;
- dataForProductCount4.Consumable_Arrived_order__c = order2.id;
- dataForProductCount4.Used_account__c = myAccount1.Id;
- dataForProductCount4.Sterilization_limit__c = Date.today().addDays(-2);
- dataForProductCount4.Box_Piece__c = '鐩�';
- conList1.add(dataForProductCount4);
- System.debug('conList1==>' + conList1);
- //鏌ヨ鎵�鏈夎繃鏈熷簱瀛�
- Consumable_order_details2__c dataForProductCount5 = new Consumable_order_details2__c();
- dataForProductCount5.Bar_Code__c = '1002';
- dataForProductCount5.Arrive_date__c = Date.today();
- dataForProductCount5.Send_Date__c = Date.today();
- dataForProductCount5.Used_date__c = Date.today();
- dataForProductCount5.Return_date__c = null;
- dataForProductCount5.Lose_Flag__c = false;
- dataForProductCount5.Cancellation_Flag__c = false;
- dataForProductCount5.Consumable_Product__c = proG.Id;
- dataForProductCount5.Consumable_Arrived_order__c = order2.id;
- dataForProductCount5.Used_account__c = myAccount1.Id;
- dataForProductCount5.Sterilization_limit__c = Date.today().addDays(-2);
- dataForProductCount5.Box_Piece__c = '鐩�';
- conList1.add(dataForProductCount5);
- insert conList1;
+ conList.add(dataForProductCount3);
+ insert conList;
+
+ //杩囨湡搴撳瓨姹囨�讳俊鎭� add by Wang Xueqin
+ List<Consumable_order_details2__c> conList1 = new List<Consumable_order_details2__c>();
+ Consumable_order_details2__c dataForProductCount4 = new Consumable_order_details2__c();
+ dataForProductCount4.Bar_Code__c = '1001';
+ dataForProductCount4.Arrive_date__c = Date.today();
+ dataForProductCount4.Send_Date__c = null;
+ dataForProductCount4.Used_date__c = null;
+ dataForProductCount4.Return_date__c = null;
+ dataForProductCount4.Lose_Flag__c = false;
+ dataForProductCount4.Cancellation_Flag__c = false;
+ dataForProductCount4.Consumable_Product__c = proG.Id;
+ dataForProductCount4.Consumable_Arrived_order__c = order2.id;
+ dataForProductCount4.Used_account__c = myAccount1.Id;
+ dataForProductCount4.Sterilization_limit__c = Date.today().addDays(-2);
+ dataForProductCount4.Box_Piece__c = '鐩�';
+ conList1.add(dataForProductCount4);
+ System.debug('conList1==>'+conList1);
+ //鏌ヨ鎵�鏈夎繃鏈熷簱瀛�
+ Consumable_order_details2__c dataForProductCount5 = new Consumable_order_details2__c();
+ dataForProductCount5.Bar_Code__c = '1002';
+ dataForProductCount5.Arrive_date__c = Date.today();
+ dataForProductCount5.Send_Date__c = Date.today();
+ dataForProductCount5.Used_date__c = Date.today();
+ dataForProductCount5.Return_date__c = null;
+ dataForProductCount5.Lose_Flag__c = false;
+ dataForProductCount5.Cancellation_Flag__c = false;
+ dataForProductCount5.Consumable_Product__c = proG.Id;
+ dataForProductCount5.Consumable_Arrived_order__c = order2.id;
+ dataForProductCount5.Used_account__c = myAccount1.Id;
+ dataForProductCount5.Sterilization_limit__c = Date.today().addDays(-2);
+ dataForProductCount5.Box_Piece__c = '鐩�';
+ conList1.add(dataForProductCount5);
+ insert conList1;
Test.startTest();
LexConsumableGoodsInfo.initMoreThan7(dataForProductCount7.Id);
LexConsumableGoodsInfo.initMoreThan7All('all');
@@ -210,81 +153,61 @@
}
@IsTest
- static void lexConsumableGoodsInfoTest2() {
+ static void lexConsumableGoodsInfoTest2(){
User myUser_test = new User();
Account myAccount1;
Contact core;
User currentUser = [SELECT Id FROM User WHERE Id = :UserInfo.getUserId()];
- NoteStay__c n = new NoteStay__c(Name = 'NoteStay', IsStay__c = true);
+ NoteStay__c n = new NoteStay__c(Name = 'NoteStay',IsStay__c = true);
insert n;
- System.runAs(currentUser) {
- Profile prof = [
- SELECT Id
- FROM Profile
- WHERE Name = '901_缁忛攢鍟嗙ぞ鍖烘櫘閫氭潈闄恄2閲嶉獙璇�(ET)'
- ];
- List<RecordType> rectCo = [
- SELECT Id
- FROM RecordType
- WHERE IsActive = TRUE AND SobjectType = 'Account' AND Name = '璨╁2搴�'
- ];
+ System.runAs(currentUser){
+ Profile prof = [select Id from Profile where Name ='901_缁忛攢鍟嗙ぞ鍖烘櫘閫氭潈闄恄2閲嶉獙璇�(ET)'];
+ List<RecordType> rectCo = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '璨╁2搴�'];
if (rectCo.size() == 0) {
return;
}
- myAccount1 = new Account(name = 'testaccount001', RecordTypeId = rectCo[0].Id, AgentCode_Ext__c = '9999900');
+ myAccount1 = new Account(name='testaccount001',RecordTypeId = rectCo[0].Id ,AgentCode_Ext__c = '9999900');
insert myAccount1;
- core = new Contact(email = 'jplumber@salesforce.com', firstname = 'Joe', lastname = 'Plumber', accountid = myAccount1.id);
+ core = new Contact(email='jplumber@salesforce.com',
+ firstname='Joe',
+ lastname='Plumber',
+ accountid=myAccount1.id);
insert core;
- myUser_test = new User(
+ myUser_test = New User(
ContactId = core.id,
Alias = 'newUser',
- Email = 'newuser@testorg.com',
- EmailEncodingKey = 'UTF-8',
- LastName = 'testUser',
- LanguageLocaleKey = 'zh_CN',
- LocaleSidKey = 'zh_CN',
+ Email='newuser@testorg.com',
+ EmailEncodingKey='UTF-8',
+ LastName='testUser',
+ LanguageLocaleKey='zh_CN',
+ LocaleSidKey='zh_CN',
ProfileId = prof.Id,
- TimeZoneSidKey = 'Asia/Shanghai',
- UserName = 'testUser@testorg.com',
- Work_Location__c = '鍖椾含'
- );
+ TimeZoneSidKey='Asia/Shanghai',
+ UserName='testUser@testorg.com',
+ Work_Location__c='鍖椾含');
insert myUser_test;
}
- System.runAs(myUser_test) {
- Product2 prod01 = new Product2(
- Name = 'Test01',
- ProductCode = 'Test01',
- Asset_Model_No__c = 'Test01',
- SFDA_Status__c = '鏈夊姽',
- Manual_Entry__c = false
- );
- Product2 prod02 = new Product2(
- Name = 'Test02',
- ProductCode = 'Test02',
- Asset_Model_No__c = 'Test02',
- SFDA_Status__c = '鏈夊姽',
- Manual_Entry__c = false
- );
- insert new List<Product2>{ prod01, prod02 };
- Product2__c pro1 = new Product2__c(Name = 'Pro001', OT_CODE_Text__c = 'Test001', Product2__c = prod01.Id);
- Product2__c pro2 = new Product2__c(Name = 'Pro002', OT_CODE_Text__c = 'Test002', Product2__c = prod02.Id);
- insert new List<Product2__c>{ pro1, pro2 };
+ System.runAs(myUser_test){
+ Product2 prod01 = new Product2(Name='Test01',ProductCode='Test01',Asset_Model_No__c = 'Test01',SFDA_Status__c = '鏈夊姽',Manual_Entry__c = false);
+ Product2 prod02 = new Product2(Name='Test02',ProductCode='Test02',Asset_Model_No__c = 'Test02',SFDA_Status__c = '鏈夊姽',Manual_Entry__c = false);
+ insert new Product2[]{prod01,prod02};
+ Product2__c pro1 = new Product2__c(Name='Pro001',OT_CODE_Text__c='Test001',Product2__c = prod01.Id);
+ Product2__c pro2 = new Product2__c(Name='Pro002',OT_CODE_Text__c='Test002',Product2__c = prod02.Id);
+ insert new Product2__c[] {pro1, pro2};
//璁㈠崟
Consumable_order__c Order1 = new Consumable_order__c(
- Name = 'OCM_01_001',
+ Name='OCM_01_001',
RecordTypeId = System.Label.RT_ConOrder_Delivery,
- Order_type__c = '璁㈠崟',
- Dealer_info__c = myAccount1.Id,
- Order_ProType__c = 'ET'
- );
+ Order_type__c ='璁㈠崟',
+ Dealer_info__c=myAccount1.Id,
+ Order_ProType__c = 'ET');
Consumable_order__c Order2 = new Consumable_order__c(
- Name = 'OCM_01_002',
+ Name='OCM_01_002',
RecordTypeId = System.Label.RT_ConOrder_Delivery,
- Order_type__c = '璁㈠崟',
- Dealer_info__c = myAccount1.Id,
- Order_ProType__c = 'ET'
- );
- insert new List<Consumable_order__c>{ Order1, Order2 };
+ Order_type__c ='璁㈠崟',
+ Dealer_info__c=myAccount1.Id,
+ Order_ProType__c = 'ET');
+ insert new Consumable_order__c[] {Order1, Order2};
//鏄庣粏1
Consumable_orderdetails__c createDetail = new Consumable_orderdetails__c();
@@ -292,48 +215,44 @@
createDetail.Consumable_Product__c = pro1.id;
createDetail.Dealer_Custom_Price__c = 999.00;
createDetail.Consumable_count__c = 3;
- createDetail.Consumable_order__c = Order1.id;
+ createDetail.Consumable_order__c = Order1.id;
createDetail.RecordTypeid = System.Label.RT_ConOrderDetail1_Order;
insert createDetail;
Consumable_orderdetails__c createDetail1 = new Consumable_orderdetails__c();
createDetail1.name = 'Too002';
createDetail1.Consumable_Product__c = pro2.id;
- createDetail1.Consumable_order__c = Order2.id;
+ createDetail1.Consumable_order__c = Order2.id;
createDetail1.Dealer_Custom_Price__c = 999.00;
createDetail1.Consumable_count__c = 4;
createDetail1.RecordTypeid = System.Label.RT_ConOrderDetail1_Order;
insert createDetail1;
//璁㈠崟鏄庣粏
- Consumable_order_details2__c Orderdet1 = new Consumable_order_details2__c(
- Name = 'OCM_01_001001',
+ Consumable_order_details2__c Orderdet1 = new Consumable_order_details2__c(
+ Name='OCM_01_001001',
Consumable_order_minor__c = Order1.Id,
Arrive_date__c = Date.today(),
Consumable_Product__c = pro1.id,
- RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery
- );
- Consumable_order_details2__c Orderdet2 = new Consumable_order_details2__c(
- Name = 'OCM_01_001002',
+ RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery);
+ Consumable_order_details2__c Orderdet2 = new Consumable_order_details2__c(
+ Name='OCM_01_001002',
Consumable_order_minor__c = Order2.Id,
Arrive_date__c = Date.today(),
Consumable_Product__c = pro2.id,
- RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery
- );
- Consumable_order_details2__c Orderdet3 = new Consumable_order_details2__c(
- Name = 'OCM_01_001003',
+ RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery);
+ Consumable_order_details2__c Orderdet3 = new Consumable_order_details2__c(
+ Name='OCM_01_001003',
Consumable_order_minor__c = Order1.Id,
//Arrive_date__c = Date.today(),
Consumable_Product__c = pro1.id,
- RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery
- );
- Consumable_order_details2__c Orderdet4 = new Consumable_order_details2__c(
- Name = 'OCM_01_001004',
+ RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery);
+ Consumable_order_details2__c Orderdet4 = new Consumable_order_details2__c(
+ Name='OCM_01_001004',
Consumable_order_minor__c = Order2.Id,
Arrive_date__c = Date.today(),
Consumable_Product__c = pro2.id,
- RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery
- );
- insert new List<Consumable_order_details2__c>{ Orderdet1, Orderdet2, Orderdet3, Orderdet4 };
+ RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery);
+ insert new Consumable_order_details2__c[] {Orderdet1, Orderdet2, Orderdet3, Orderdet4};
LexConsumableGoodsInfo.initMoreThan7(Orderdet1.Id);
LexConsumableGoodsInfo.initMoreThan7All('all');
@@ -345,85 +264,66 @@
LexConsumableGoodsInfo.initDeliveryDetAll('all');
LexConsumableGoodsInfo.initTotalNum('1', 'all');
LexConsumableGoodsInfo.initTotalNum(Orderdet1.Id, 'all');
+
}
}
@IsTest
- static void lexConsumableGoodsInfoTest3() {
+ static void lexConsumableGoodsInfoTest3(){
User myUser_test = new User();
Account myAccount1;
Contact core;
User currentUser = [SELECT Id FROM User WHERE Id = :UserInfo.getUserId()];
- NoteStay__c n = new NoteStay__c(Name = 'NoteStay', IsStay__c = true);
+ NoteStay__c n = new NoteStay__c(Name = 'NoteStay',IsStay__c = true);
insert n;
- System.runAs(currentUser) {
- Profile prof = [
- SELECT Id
- FROM Profile
- WHERE Name = '901_缁忛攢鍟嗙ぞ鍖烘櫘閫氭潈闄恄2閲嶉獙璇�(ET)'
- ];
- List<RecordType> rectCo = [
- SELECT Id
- FROM RecordType
- WHERE IsActive = TRUE AND SobjectType = 'Account' AND Name = '璨╁2搴�'
- ];
+ System.runAs(currentUser){
+ Profile prof = [select Id from Profile where Name ='901_缁忛攢鍟嗙ぞ鍖烘櫘閫氭潈闄恄2閲嶉獙璇�(ET)'];
+ List<RecordType> rectCo = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '璨╁2搴�'];
if (rectCo.size() == 0) {
return;
}
- myAccount1 = new Account(name = 'testaccount001', RecordTypeId = rectCo[0].Id, AgentCode_Ext__c = '9999900');
+ myAccount1 = new Account(name='testaccount001',RecordTypeId = rectCo[0].Id ,AgentCode_Ext__c = '9999900');
insert myAccount1;
- core = new Contact(email = 'jplumber@salesforce.com', firstname = 'Joe', lastname = 'Plumber', accountid = myAccount1.id);
+ core = new Contact(email='jplumber@salesforce.com',
+ firstname='Joe',
+ lastname='Plumber',
+ accountid=myAccount1.id);
insert core;
- myUser_test = new User(
+ myUser_test = New User(
ContactId = core.id,
Alias = 'newUser',
- Email = 'newuser@testorg.com',
- EmailEncodingKey = 'UTF-8',
- LastName = 'testUser',
- LanguageLocaleKey = 'zh_CN',
- LocaleSidKey = 'zh_CN',
+ Email='newuser@testorg.com',
+ EmailEncodingKey='UTF-8',
+ LastName='testUser',
+ LanguageLocaleKey='zh_CN',
+ LocaleSidKey='zh_CN',
ProfileId = prof.Id,
- TimeZoneSidKey = 'Asia/Shanghai',
- UserName = 'testUser@testorg.com',
- Work_Location__c = '鍖椾含'
- );
+ TimeZoneSidKey='Asia/Shanghai',
+ UserName='testUser@testorg.com',
+ Work_Location__c='鍖椾含');
insert myUser_test;
}
- System.runAs(myUser_test) {
- Product2 prod01 = new Product2(
- Name = 'Test01',
- ProductCode = 'Test01',
- Asset_Model_No__c = 'Test01',
- SFDA_Status__c = '鏈夊姽',
- Manual_Entry__c = false
- );
- Product2 prod02 = new Product2(
- Name = 'Test02',
- ProductCode = 'Test02',
- Asset_Model_No__c = 'Test02',
- SFDA_Status__c = '鏈夊姽',
- Manual_Entry__c = false
- );
- insert new List<Product2>{ prod01, prod02 };
- Product2__c pro1 = new Product2__c(Name = 'Pro001', OT_CODE_Text__c = 'Test001', Product2__c = prod01.Id);
- Product2__c pro2 = new Product2__c(Name = 'Pro002', OT_CODE_Text__c = 'Test002', Product2__c = prod02.Id);
- insert new List<Product2__c>{ pro1, pro2 };
+ System.runAs(myUser_test){
+ Product2 prod01 = new Product2(Name='Test01',ProductCode='Test01',Asset_Model_No__c = 'Test01',SFDA_Status__c = '鏈夊姽',Manual_Entry__c = false);
+ Product2 prod02 = new Product2(Name='Test02',ProductCode='Test02',Asset_Model_No__c = 'Test02',SFDA_Status__c = '鏈夊姽',Manual_Entry__c = false);
+ insert new Product2[]{prod01,prod02};
+ Product2__c pro1 = new Product2__c(Name='Pro001',OT_CODE_Text__c='Test001',Product2__c = prod01.Id);
+ Product2__c pro2 = new Product2__c(Name='Pro002',OT_CODE_Text__c='Test002',Product2__c = prod02.Id);
+ insert new Product2__c[] {pro1, pro2};
//璁㈠崟
Consumable_order__c Order1 = new Consumable_order__c(
- Name = 'OCM_01_001',
+ Name='OCM_01_001',
RecordTypeId = System.Label.RT_ConOrder_Delivery,
- Order_type__c = '璁㈠崟',
- Dealer_info__c = myAccount1.Id,
- Order_ProType__c = 'ET'
- );
+ Order_type__c ='璁㈠崟',
+ Dealer_info__c=myAccount1.Id,
+ Order_ProType__c = 'ET');
Consumable_order__c Order2 = new Consumable_order__c(
- Name = 'OCM_01_002',
+ Name='OCM_01_002',
RecordTypeId = System.Label.RT_ConOrder_Delivery,
- Order_type__c = '璁㈠崟',
- Dealer_info__c = myAccount1.Id,
- Order_ProType__c = 'ET'
- );
- insert new List<Consumable_order__c>{ Order1, Order2 };
+ Order_type__c ='璁㈠崟',
+ Dealer_info__c=myAccount1.Id,
+ Order_ProType__c = 'ET');
+ insert new Consumable_order__c[] {Order1, Order2};
//鏄庣粏1
Consumable_orderdetails__c createDetail = new Consumable_orderdetails__c();
@@ -431,48 +331,44 @@
createDetail.Consumable_Product__c = pro1.id;
createDetail.Dealer_Custom_Price__c = 999.00;
createDetail.Consumable_count__c = 3;
- createDetail.Consumable_order__c = Order1.id;
+ createDetail.Consumable_order__c = Order1.id;
createDetail.RecordTypeid = System.Label.RT_ConOrderDetail1_Order;
insert createDetail;
Consumable_orderdetails__c createDetail1 = new Consumable_orderdetails__c();
createDetail1.name = 'Too002';
createDetail1.Consumable_Product__c = pro2.id;
- createDetail1.Consumable_order__c = Order2.id;
+ createDetail1.Consumable_order__c = Order2.id;
createDetail1.Dealer_Custom_Price__c = 999.00;
createDetail1.Consumable_count__c = 4;
createDetail1.RecordTypeid = System.Label.RT_ConOrderDetail1_Order;
insert createDetail1;
//璁㈠崟鏄庣粏
- Consumable_order_details2__c Orderdet1 = new Consumable_order_details2__c(
- Name = 'OCM_01_001001',
+ Consumable_order_details2__c Orderdet1 = new Consumable_order_details2__c(
+ Name='OCM_01_001001',
Consumable_order_minor__c = Order1.Id,
Arrive_date__c = Date.today(),
Consumable_Product__c = pro1.id,
- RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery
- );
- Consumable_order_details2__c Orderdet2 = new Consumable_order_details2__c(
- Name = 'OCM_01_001002',
+ RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery);
+ Consumable_order_details2__c Orderdet2 = new Consumable_order_details2__c(
+ Name='OCM_01_001002',
Consumable_order_minor__c = Order2.Id,
Arrive_date__c = Date.today(),
Consumable_Product__c = pro2.id,
- RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery
- );
- Consumable_order_details2__c Orderdet3 = new Consumable_order_details2__c(
- Name = 'OCM_01_001003',
+ RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery);
+ Consumable_order_details2__c Orderdet3 = new Consumable_order_details2__c(
+ Name='OCM_01_001003',
Consumable_order_minor__c = Order1.Id,
//Arrive_date__c = Date.today(),
Consumable_Product__c = pro1.id,
- RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery
- );
- Consumable_order_details2__c Orderdet4 = new Consumable_order_details2__c(
- Name = 'OCM_01_001004',
+ RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery);
+ Consumable_order_details2__c Orderdet4 = new Consumable_order_details2__c(
+ Name='OCM_01_001004',
Consumable_order_minor__c = Order2.Id,
Arrive_date__c = Date.today(),
Consumable_Product__c = pro2.id,
- RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery
- );
- insert new List<Consumable_order_details2__c>{ Orderdet1, Orderdet2, Orderdet3, Orderdet4 };
+ RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery);
+ insert new Consumable_order_details2__c[] {Orderdet1, Orderdet2, Orderdet3, Orderdet4};
LexConsumableGoodsInfo.initMoreThan7(Orderdet2.Id);
LexConsumableGoodsInfo.initMoreThan7All('');
@@ -487,81 +383,61 @@
}
@IsTest
- static void lexConsumableGoodsInfoTest4() {
+ static void lexConsumableGoodsInfoTest4(){
User myUser_test = new User();
Account myAccount1;
Contact core;
User currentUser = [SELECT Id FROM User WHERE Id = :UserInfo.getUserId()];
- NoteStay__c n = new NoteStay__c(Name = 'NoteStay', IsStay__c = true);
+ NoteStay__c n = new NoteStay__c(Name = 'NoteStay',IsStay__c = true);
insert n;
- System.runAs(currentUser) {
- Profile prof = [
- SELECT Id
- FROM Profile
- WHERE Name = '901_缁忛攢鍟嗙ぞ鍖烘櫘閫氭潈闄恄2閲嶉獙璇�(ET)'
- ];
- List<RecordType> rectCo = [
- SELECT Id
- FROM RecordType
- WHERE IsActive = TRUE AND SobjectType = 'Account' AND Name = '璨╁2搴�'
- ];
+ System.runAs(currentUser){
+ Profile prof = [select Id from Profile where Name ='901_缁忛攢鍟嗙ぞ鍖烘櫘閫氭潈闄恄2閲嶉獙璇�(ET)'];
+ List<RecordType> rectCo = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '璨╁2搴�'];
if (rectCo.size() == 0) {
return;
}
- myAccount1 = new Account(name = 'testaccount001', RecordTypeId = rectCo[0].Id, AgentCode_Ext__c = '9999900');
+ myAccount1 = new Account(name='testaccount001',RecordTypeId = rectCo[0].Id ,AgentCode_Ext__c = '9999900');
insert myAccount1;
- core = new Contact(email = 'jplumber@salesforce.com', firstname = 'Joe', lastname = 'Plumber', accountid = myAccount1.id);
+ core = new Contact(email='jplumber@salesforce.com',
+ firstname='Joe',
+ lastname='Plumber',
+ accountid=myAccount1.id);
insert core;
- myUser_test = new User(
+ myUser_test = New User(
ContactId = core.id,
Alias = 'newUser',
- Email = 'newuser@testorg.com',
- EmailEncodingKey = 'UTF-8',
- LastName = 'testUser',
- LanguageLocaleKey = 'zh_CN',
- LocaleSidKey = 'zh_CN',
+ Email='newuser@testorg.com',
+ EmailEncodingKey='UTF-8',
+ LastName='testUser',
+ LanguageLocaleKey='zh_CN',
+ LocaleSidKey='zh_CN',
ProfileId = prof.Id,
- TimeZoneSidKey = 'Asia/Shanghai',
- UserName = 'testUser@testorg.com',
- Work_Location__c = '鍖椾含'
- );
+ TimeZoneSidKey='Asia/Shanghai',
+ UserName='testUser@testorg.com',
+ Work_Location__c='鍖椾含');
insert myUser_test;
}
- System.runAs(myUser_test) {
- Product2 prod01 = new Product2(
- Name = 'Test01',
- ProductCode = 'Test01',
- Asset_Model_No__c = 'Test01',
- SFDA_Status__c = '鏈夊姽',
- Manual_Entry__c = false
- );
- Product2 prod02 = new Product2(
- Name = 'Test02',
- ProductCode = 'Test02',
- Asset_Model_No__c = 'Test02',
- SFDA_Status__c = '鏈夊姽',
- Manual_Entry__c = false
- );
- insert new List<Product2>{ prod01, prod02 };
- Product2__c pro1 = new Product2__c(Name = 'Pro001', OT_CODE_Text__c = 'Test001', Product2__c = prod01.Id);
- Product2__c pro2 = new Product2__c(Name = 'Pro002', OT_CODE_Text__c = 'Test002', Product2__c = prod02.Id);
- insert new List<Product2__c>{ pro1, pro2 };
+ System.runAs(myUser_test){
+ Product2 prod01 = new Product2(Name='Test01',ProductCode='Test01',Asset_Model_No__c = 'Test01',SFDA_Status__c = '鏈夊姽',Manual_Entry__c = false);
+ Product2 prod02 = new Product2(Name='Test02',ProductCode='Test02',Asset_Model_No__c = 'Test02',SFDA_Status__c = '鏈夊姽',Manual_Entry__c = false);
+ insert new Product2[]{prod01,prod02};
+ Product2__c pro1 = new Product2__c(Name='Pro001',OT_CODE_Text__c='Test001',Product2__c = prod01.Id);
+ Product2__c pro2 = new Product2__c(Name='Pro002',OT_CODE_Text__c='Test002',Product2__c = prod02.Id);
+ insert new Product2__c[] {pro1, pro2};
//璁㈠崟
Consumable_order__c Order1 = new Consumable_order__c(
- Name = 'OCM_01_001',
+ Name='OCM_01_001',
RecordTypeId = System.Label.RT_ConOrder_Delivery,
- Order_type__c = '璁㈠崟',
- Dealer_info__c = myAccount1.Id,
- Order_ProType__c = 'ET'
- );
+ Order_type__c ='璁㈠崟',
+ Dealer_info__c=myAccount1.Id,
+ Order_ProType__c = 'ET');
Consumable_order__c Order2 = new Consumable_order__c(
- Name = 'OCM_01_002',
+ Name='OCM_01_002',
RecordTypeId = System.Label.RT_ConOrder_Delivery,
- Order_type__c = '璁㈠崟',
- Dealer_info__c = myAccount1.Id,
- Order_ProType__c = 'ET'
- );
- insert new List<Consumable_order__c>{ Order1, Order2 };
+ Order_type__c ='璁㈠崟',
+ Dealer_info__c=myAccount1.Id,
+ Order_ProType__c = 'ET');
+ insert new Consumable_order__c[] {Order1, Order2};
//鏄庣粏1
Consumable_orderdetails__c createDetail = new Consumable_orderdetails__c();
@@ -569,48 +445,44 @@
createDetail.Consumable_Product__c = pro1.id;
createDetail.Dealer_Custom_Price__c = 999.00;
createDetail.Consumable_count__c = 3;
- createDetail.Consumable_order__c = Order1.id;
+ createDetail.Consumable_order__c = Order1.id;
createDetail.RecordTypeid = System.Label.RT_ConOrderDetail1_Order;
insert createDetail;
Consumable_orderdetails__c createDetail1 = new Consumable_orderdetails__c();
createDetail1.name = 'Too002';
createDetail1.Consumable_Product__c = pro2.id;
- createDetail1.Consumable_order__c = Order2.id;
+ createDetail1.Consumable_order__c = Order2.id;
createDetail1.Dealer_Custom_Price__c = 999.00;
createDetail1.Consumable_count__c = 4;
createDetail1.RecordTypeid = System.Label.RT_ConOrderDetail1_Order;
insert createDetail1;
//璁㈠崟鏄庣粏
- Consumable_order_details2__c Orderdet1 = new Consumable_order_details2__c(
- Name = 'OCM_01_001001',
+ Consumable_order_details2__c Orderdet1 = new Consumable_order_details2__c(
+ Name='OCM_01_001001',
Consumable_order_minor__c = Order1.Id,
Arrive_date__c = Date.today(),
Consumable_Product__c = pro1.id,
- RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery
- );
- Consumable_order_details2__c Orderdet2 = new Consumable_order_details2__c(
- Name = 'OCM_01_001002',
+ RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery);
+ Consumable_order_details2__c Orderdet2 = new Consumable_order_details2__c(
+ Name='OCM_01_001002',
Consumable_order_minor__c = Order2.Id,
Arrive_date__c = Date.today(),
Consumable_Product__c = pro2.id,
- RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery
- );
- Consumable_order_details2__c Orderdet3 = new Consumable_order_details2__c(
- Name = 'OCM_01_001003',
+ RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery);
+ Consumable_order_details2__c Orderdet3 = new Consumable_order_details2__c(
+ Name='OCM_01_001003',
Consumable_order_minor__c = Order1.Id,
//Arrive_date__c = Date.today(),
Consumable_Product__c = pro1.id,
- RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery
- );
- Consumable_order_details2__c Orderdet4 = new Consumable_order_details2__c(
- Name = 'OCM_01_001004',
+ RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery);
+ Consumable_order_details2__c Orderdet4 = new Consumable_order_details2__c(
+ Name='OCM_01_001004',
Consumable_order_minor__c = Order2.Id,
Arrive_date__c = Date.today(),
Consumable_Product__c = pro2.id,
- RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery
- );
- insert new List<Consumable_order_details2__c>{ Orderdet1, Orderdet2, Orderdet3, Orderdet4 };
+ RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery);
+ insert new Consumable_order_details2__c[] {Orderdet1, Orderdet2, Orderdet3, Orderdet4};
LexConsumableGoodsInfo.initMoreThan7(Orderdet3.Id);
LexConsumableGoodsInfo.initNotArrDet(Orderdet3.Id);
@@ -621,81 +493,61 @@
}
@IsTest
- static void lexConsumableGoodsInfoTest5() {
+ static void lexConsumableGoodsInfoTest5(){
User myUser_test = new User();
Account myAccount1;
Contact core;
User currentUser = [SELECT Id FROM User WHERE Id = :UserInfo.getUserId()];
- NoteStay__c n = new NoteStay__c(Name = 'NoteStay', IsStay__c = true);
+ NoteStay__c n = new NoteStay__c(Name = 'NoteStay',IsStay__c = true);
insert n;
- System.runAs(currentUser) {
- Profile prof = [
- SELECT Id
- FROM Profile
- WHERE Name = '901_缁忛攢鍟嗙ぞ鍖烘櫘閫氭潈闄恄2閲嶉獙璇�(ET)'
- ];
- List<RecordType> rectCo = [
- SELECT Id
- FROM RecordType
- WHERE IsActive = TRUE AND SobjectType = 'Account' AND Name = '璨╁2搴�'
- ];
+ System.runAs(currentUser){
+ Profile prof = [select Id from Profile where Name ='901_缁忛攢鍟嗙ぞ鍖烘櫘閫氭潈闄恄2閲嶉獙璇�(ET)'];
+ List<RecordType> rectCo = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '璨╁2搴�'];
if (rectCo.size() == 0) {
return;
}
- myAccount1 = new Account(name = 'testaccount001', RecordTypeId = rectCo[0].Id, AgentCode_Ext__c = '9999900');
+ myAccount1 = new Account(name='testaccount001',RecordTypeId = rectCo[0].Id ,AgentCode_Ext__c = '9999900');
insert myAccount1;
- core = new Contact(email = 'jplumber@salesforce.com', firstname = 'Joe', lastname = 'Plumber', accountid = myAccount1.id);
+ core = new Contact(email='jplumber@salesforce.com',
+ firstname='Joe',
+ lastname='Plumber',
+ accountid=myAccount1.id);
insert core;
- myUser_test = new User(
+ myUser_test = New User(
ContactId = core.id,
Alias = 'newUser',
- Email = 'newuser@testorg.com',
- EmailEncodingKey = 'UTF-8',
- LastName = 'testUser',
- LanguageLocaleKey = 'zh_CN',
- LocaleSidKey = 'zh_CN',
+ Email='newuser@testorg.com',
+ EmailEncodingKey='UTF-8',
+ LastName='testUser',
+ LanguageLocaleKey='zh_CN',
+ LocaleSidKey='zh_CN',
ProfileId = prof.Id,
- TimeZoneSidKey = 'Asia/Shanghai',
- UserName = 'testUser@testorg.com',
- Work_Location__c = '鍖椾含'
- );
+ TimeZoneSidKey='Asia/Shanghai',
+ UserName='testUser@testorg.com',
+ Work_Location__c='鍖椾含');
insert myUser_test;
}
- System.runAs(myUser_test) {
- Product2 prod01 = new Product2(
- Name = 'Test01',
- ProductCode = 'Test01',
- Asset_Model_No__c = 'Test01',
- SFDA_Status__c = '鏈夊姽',
- Manual_Entry__c = false
- );
- Product2 prod02 = new Product2(
- Name = 'Test02',
- ProductCode = 'Test02',
- Asset_Model_No__c = 'Test02',
- SFDA_Status__c = '鏈夊姽',
- Manual_Entry__c = false
- );
- insert new List<Product2>{ prod01, prod02 };
- Product2__c pro1 = new Product2__c(Name = 'Pro001', OT_CODE_Text__c = 'Test001', Product2__c = prod01.Id);
- Product2__c pro2 = new Product2__c(Name = 'Pro002', OT_CODE_Text__c = 'Test002', Product2__c = prod02.Id);
- insert new List<Product2__c>{ pro1, pro2 };
+ System.runAs(myUser_test){
+ Product2 prod01 = new Product2(Name='Test01',ProductCode='Test01',Asset_Model_No__c = 'Test01',SFDA_Status__c = '鏈夊姽',Manual_Entry__c = false);
+ Product2 prod02 = new Product2(Name='Test02',ProductCode='Test02',Asset_Model_No__c = 'Test02',SFDA_Status__c = '鏈夊姽',Manual_Entry__c = false);
+ insert new Product2[]{prod01,prod02};
+ Product2__c pro1 = new Product2__c(Name='Pro001',OT_CODE_Text__c='Test001',Product2__c = prod01.Id);
+ Product2__c pro2 = new Product2__c(Name='Pro002',OT_CODE_Text__c='Test002',Product2__c = prod02.Id);
+ insert new Product2__c[] {pro1, pro2};
//璁㈠崟
Consumable_order__c Order1 = new Consumable_order__c(
- Name = 'OCM_01_001',
+ Name='OCM_01_001',
RecordTypeId = System.Label.RT_ConOrder_Delivery,
- Order_type__c = '璁㈠崟',
- Dealer_info__c = myAccount1.Id,
- Order_ProType__c = 'ET'
- );
+ Order_type__c ='璁㈠崟',
+ Dealer_info__c=myAccount1.Id,
+ Order_ProType__c = 'ET');
Consumable_order__c Order2 = new Consumable_order__c(
- Name = 'OCM_01_002',
+ Name='OCM_01_002',
RecordTypeId = System.Label.RT_ConOrder_Delivery,
- Order_type__c = '璁㈠崟',
- Dealer_info__c = myAccount1.Id,
- Order_ProType__c = 'ET'
- );
- insert new List<Consumable_order__c>{ Order1, Order2 };
+ Order_type__c ='璁㈠崟',
+ Dealer_info__c=myAccount1.Id,
+ Order_ProType__c = 'ET');
+ insert new Consumable_order__c[] {Order1, Order2};
//鏄庣粏1
Consumable_orderdetails__c createDetail = new Consumable_orderdetails__c();
@@ -703,48 +555,44 @@
createDetail.Consumable_Product__c = pro1.id;
createDetail.Dealer_Custom_Price__c = 999.00;
createDetail.Consumable_count__c = 3;
- createDetail.Consumable_order__c = Order1.id;
+ createDetail.Consumable_order__c = Order1.id;
createDetail.RecordTypeid = System.Label.RT_ConOrderDetail1_Order;
insert createDetail;
Consumable_orderdetails__c createDetail1 = new Consumable_orderdetails__c();
createDetail1.name = 'Too002';
createDetail1.Consumable_Product__c = pro2.id;
- createDetail1.Consumable_order__c = Order2.id;
+ createDetail1.Consumable_order__c = Order2.id;
createDetail1.Dealer_Custom_Price__c = 999.00;
createDetail1.Consumable_count__c = 4;
createDetail1.RecordTypeid = System.Label.RT_ConOrderDetail1_Order;
insert createDetail1;
//璁㈠崟鏄庣粏
- Consumable_order_details2__c Orderdet1 = new Consumable_order_details2__c(
- Name = 'OCM_01_001001',
+ Consumable_order_details2__c Orderdet1 = new Consumable_order_details2__c(
+ Name='OCM_01_001001',
Consumable_order_minor__c = Order1.Id,
Arrive_date__c = Date.today(),
Consumable_Product__c = pro1.id,
- RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery
- );
- Consumable_order_details2__c Orderdet2 = new Consumable_order_details2__c(
- Name = 'OCM_01_001002',
+ RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery);
+ Consumable_order_details2__c Orderdet2 = new Consumable_order_details2__c(
+ Name='OCM_01_001002',
Consumable_order_minor__c = Order2.Id,
Arrive_date__c = Date.today(),
Consumable_Product__c = pro2.id,
- RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery
- );
- Consumable_order_details2__c Orderdet3 = new Consumable_order_details2__c(
- Name = 'OCM_01_001003',
+ RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery);
+ Consumable_order_details2__c Orderdet3 = new Consumable_order_details2__c(
+ Name='OCM_01_001003',
Consumable_order_minor__c = Order1.Id,
//Arrive_date__c = Date.today(),
Consumable_Product__c = pro1.id,
- RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery
- );
- Consumable_order_details2__c Orderdet4 = new Consumable_order_details2__c(
- Name = 'OCM_01_001004',
+ RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery);
+ Consumable_order_details2__c Orderdet4 = new Consumable_order_details2__c(
+ Name='OCM_01_001004',
Consumable_order_minor__c = Order2.Id,
Arrive_date__c = Date.today(),
Consumable_Product__c = pro2.id,
- RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery
- );
- insert new List<Consumable_order_details2__c>{ Orderdet1, Orderdet2, Orderdet3, Orderdet4 };
+ RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery);
+ insert new Consumable_order_details2__c[] {Orderdet1, Orderdet2, Orderdet3, Orderdet4};
LexConsumableGoodsInfo.initMoreThan7(Orderdet4.Id);
LexConsumableGoodsInfo.initNotArrDet(Orderdet4.Id);
@@ -755,7 +603,7 @@
}
@IsTest
- static void lexConsumableGoodsInfoTest6() {
+ static void lexConsumableGoodsInfoTest6(){
LexConsumableGoodsInfo.ShowRecords sr = new LexConsumableGoodsInfo.ShowRecords();
sr.prodModel = 'test';
sr.recordCount = 1;
@@ -763,77 +611,58 @@
}
@IsTest
- static void lexConsumableGoodsInfoTest7() {
+ static void lexConsumableGoodsInfoTest7(){
User myUser_test = new User();
Account myAccount1;
Contact core;
User currentUser = [SELECT Id FROM User WHERE Id = :UserInfo.getUserId()];
- NoteStay__c n = new NoteStay__c(Name = 'NoteStay', IsStay__c = true);
+ NoteStay__c n = new NoteStay__c(Name = 'NoteStay',IsStay__c = true);
insert n;
- System.runAs(currentUser) {
- Profile prof = [
- SELECT Id
- FROM Profile
- WHERE Name = '901_缁忛攢鍟嗙ぞ鍖烘櫘閫氭潈闄恄2閲嶉獙璇�(ET)'
- ];
- List<RecordType> rectCo = [
- SELECT Id
- FROM RecordType
- WHERE IsActive = TRUE AND SobjectType = 'Account' AND Name = '璨╁2搴�'
- ];
+ System.runAs(currentUser){
+ Profile prof = [select Id from Profile where Name ='901_缁忛攢鍟嗙ぞ鍖烘櫘閫氭潈闄恄2閲嶉獙璇�(ET)'];
+ List<RecordType> rectCo = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '璨╁2搴�'];
if (rectCo.size() == 0) {
return;
}
- myAccount1 = new Account(name = 'testaccount001', RecordTypeId = rectCo[0].Id, AgentCode_Ext__c = '9999900');
+ myAccount1 = new Account(name='testaccount001',RecordTypeId = rectCo[0].Id ,AgentCode_Ext__c = '9999900');
insert myAccount1;
- core = new Contact(email = 'jplumber@salesforce.com', firstname = 'Joe', lastname = 'Plumber', accountid = myAccount1.id);
+ core = new Contact(email='jplumber@salesforce.com',
+ firstname='Joe',
+ lastname='Plumber',
+ accountid=myAccount1.id);
insert core;
- myUser_test = new User(
+ myUser_test = New User(
ContactId = core.id,
Alias = 'newUser',
- Email = 'newuser@testorg.com',
- EmailEncodingKey = 'UTF-8',
- LastName = 'testUser',
- LanguageLocaleKey = 'zh_CN',
- LocaleSidKey = 'zh_CN',
+ Email='newuser@testorg.com',
+ EmailEncodingKey='UTF-8',
+ LastName='testUser',
+ LanguageLocaleKey='zh_CN',
+ LocaleSidKey='zh_CN',
ProfileId = prof.Id,
- TimeZoneSidKey = 'Asia/Shanghai',
- UserName = 'testUser@testorg.com',
- Work_Location__c = '鍖椾含',
- UserPro_Type__c = 'ET'
- );
+ TimeZoneSidKey='Asia/Shanghai',
+ UserName='testUser@testorg.com',
+ Work_Location__c='鍖椾含',
+ UserPro_Type__c = 'ET');
insert myUser_test;
}
- System.runAs(myUser_test) {
- Product2 prod01 = new Product2(
- Name = 'Test01',
- ProductCode = 'Test01',
- Asset_Model_No__c = 'Test01',
- SFDA_Status__c = '鏈夊姽',
- Manual_Entry__c = false
- );
- Product2 prod02 = new Product2(
- Name = 'Test02',
- ProductCode = 'Test02',
- Asset_Model_No__c = 'Test02',
- SFDA_Status__c = '鏈夊姽',
- Manual_Entry__c = false
- );
- insert new List<Product2>{ prod01, prod02 };
- Product2__c pro1 = new Product2__c(Name = 'Pro001', OT_CODE_Text__c = 'Test001', Product2__c = prod01.Id);
- Product2__c pro2 = new Product2__c(Name = 'Pro002', OT_CODE_Text__c = 'Test002', Product2__c = prod02.Id);
- insert new List<Product2__c>{ pro1, pro2 };
+ System.runAs(myUser_test){
+ Product2 prod01 = new Product2(Name='Test01',ProductCode='Test01',Asset_Model_No__c = 'Test01',SFDA_Status__c = '鏈夊姽',Manual_Entry__c = false);
+ Product2 prod02 = new Product2(Name='Test02',ProductCode='Test02',Asset_Model_No__c = 'Test02',SFDA_Status__c = '鏈夊姽',Manual_Entry__c = false);
+ insert new Product2[]{prod01,prod02};
+ Product2__c pro1 = new Product2__c(Name='Pro001',OT_CODE_Text__c='Test001',Product2__c = prod01.Id);
+ Product2__c pro2 = new Product2__c(Name='Pro002',OT_CODE_Text__c='Test002',Product2__c = prod02.Id);
+ insert new Product2__c[] {pro1, pro2};
//璁㈠崟
Consumable_order__c Order1 = new Consumable_order__c(
- Name = 'OCM_01_001',
+ Name='OCM_01_001',
RecordTypeId = System.Label.RT_ConOrder_Delivery,
- Order_type__c = '璁㈠崟',
+ Order_type__c ='璁㈠崟',
Dealer_info__c = myAccount1.Id,
Delivery_detail_count__c = 1,
Order_ProType__c = 'ET',
- showFalseNotshowTrue__c = false
- );
- insert new List<Consumable_order__c>{ Order1 };
+ showFalseNotshowTrue__c = false);
+ insert new Consumable_order__c[] {Order1};
//鏄庣粏1
Consumable_orderdetails__c createDetail = new Consumable_orderdetails__c();
@@ -841,106 +670,85 @@
createDetail.Consumable_Product__c = pro1.id;
createDetail.Dealer_Custom_Price__c = 999.00;
createDetail.Consumable_count__c = 3;
- createDetail.Consumable_order__c = Order1.id;
+ createDetail.Consumable_order__c = Order1.id;
createDetail.RecordTypeid = System.Label.RT_ConOrderDetail1_Order;
insert createDetail;
//璁㈠崟鏄庣粏
- Consumable_order_details2__c Orderdet1 = new Consumable_order_details2__c(
- Name = 'OCM_01_001001',
+ Consumable_order_details2__c Orderdet1 = new Consumable_order_details2__c(
+ Name='OCM_01_001001',
Asset_Model_No__c = 'Test01',
Consumable_order_minor__c = Order1.Id,
Arrive_date__c = Date.today(),
Consumable_Product__c = pro1.id,
RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery,
- Cancellation_Flag__c = false
- );
- Consumable_order_details2__c Orderdet3 = new Consumable_order_details2__c(
- Name = 'OCM_01_001003',
+ Cancellation_Flag__c = false);
+ Consumable_order_details2__c Orderdet3 = new Consumable_order_details2__c(
+ Name='OCM_01_001003',
Asset_Model_No__c = 'Test01',
Consumable_order_minor__c = Order1.Id,
Consumable_Product__c = pro1.id,
RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery,
- Cancellation_Flag__c = false
- );
- insert new List<Consumable_order_details2__c>{ Orderdet1, Orderdet3 };
+ Cancellation_Flag__c = false);
+ insert new Consumable_order_details2__c[] {Orderdet1, Orderdet3};
LexConsumableGoodsInfo.initNotArrDet(Order1.Id);
LexConsumableGoodsInfo.initNotArrDetAll('all');
}
}
@IsTest
- static void lexConsumableGoodsInfoTest8() {
+ static void lexConsumableGoodsInfoTest8(){
User myUser_test = new User();
Account myAccount1;
Contact core;
User currentUser = [SELECT Id FROM User WHERE Id = :UserInfo.getUserId()];
- NoteStay__c n = new NoteStay__c(Name = 'NoteStay', IsStay__c = true);
+ NoteStay__c n = new NoteStay__c(Name = 'NoteStay',IsStay__c = true);
insert n;
- System.runAs(currentUser) {
- Profile prof = [
- SELECT Id
- FROM Profile
- WHERE Name = '901_缁忛攢鍟嗙ぞ鍖烘櫘閫氭潈闄恄2閲嶉獙璇�(ET)'
- ];
- List<RecordType> rectCo = [
- SELECT Id
- FROM RecordType
- WHERE IsActive = TRUE AND SobjectType = 'Account' AND Name = '璨╁2搴�'
- ];
+ System.runAs(currentUser){
+ Profile prof = [select Id from Profile where Name ='901_缁忛攢鍟嗙ぞ鍖烘櫘閫氭潈闄恄2閲嶉獙璇�(ET)'];
+ List<RecordType> rectCo = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '璨╁2搴�'];
if (rectCo.size() == 0) {
return;
}
- myAccount1 = new Account(name = 'testaccount001', RecordTypeId = rectCo[0].Id, AgentCode_Ext__c = '9999900');
+ myAccount1 = new Account(name='testaccount001',RecordTypeId = rectCo[0].Id ,AgentCode_Ext__c = '9999900');
insert myAccount1;
- core = new Contact(email = 'jplumber@salesforce.com', firstname = 'Joe', lastname = 'Plumber', accountid = myAccount1.id);
+ core = new Contact(email='jplumber@salesforce.com',
+ firstname='Joe',
+ lastname='Plumber',
+ accountid=myAccount1.id);
insert core;
- myUser_test = new User(
+ myUser_test = New User(
ContactId = core.id,
Alias = 'newUser',
- Email = 'newuser@testorg.com',
- EmailEncodingKey = 'UTF-8',
- LastName = 'testUser',
- LanguageLocaleKey = 'zh_CN',
- LocaleSidKey = 'zh_CN',
+ Email='newuser@testorg.com',
+ EmailEncodingKey='UTF-8',
+ LastName='testUser',
+ LanguageLocaleKey='zh_CN',
+ LocaleSidKey='zh_CN',
ProfileId = prof.Id,
- TimeZoneSidKey = 'Asia/Shanghai',
- UserName = 'testUser@testorg.com',
- Work_Location__c = '鍖椾含',
- UserPro_Type__c = 'ET'
- );
+ TimeZoneSidKey='Asia/Shanghai',
+ UserName='testUser@testorg.com',
+ Work_Location__c='鍖椾含',
+ UserPro_Type__c = 'ET');
insert myUser_test;
}
- System.runAs(myUser_test) {
- Product2 prod01 = new Product2(
- Name = 'Test01',
- ProductCode = 'Test01',
- Asset_Model_No__c = 'Test01',
- SFDA_Status__c = '鏈夊姽',
- Manual_Entry__c = false
- );
- Product2 prod02 = new Product2(
- Name = 'Test02',
- ProductCode = 'Test02',
- Asset_Model_No__c = 'Test02',
- SFDA_Status__c = '鏈夊姽',
- Manual_Entry__c = false
- );
- insert new List<Product2>{ prod01, prod02 };
- Product2__c pro1 = new Product2__c(Name = 'Pro001', OT_CODE_Text__c = 'Test001', Product2__c = prod01.Id);
- Product2__c pro2 = new Product2__c(Name = 'Pro002', OT_CODE_Text__c = 'Test002', Product2__c = prod02.Id);
- insert new List<Product2__c>{ pro1, pro2 };
+ System.runAs(myUser_test){
+ Product2 prod01 = new Product2(Name='Test01',ProductCode='Test01',Asset_Model_No__c = 'Test01',SFDA_Status__c = '鏈夊姽',Manual_Entry__c = false);
+ Product2 prod02 = new Product2(Name='Test02',ProductCode='Test02',Asset_Model_No__c = 'Test02',SFDA_Status__c = '鏈夊姽',Manual_Entry__c = false);
+ insert new Product2[]{prod01,prod02};
+ Product2__c pro1 = new Product2__c(Name='Pro001',OT_CODE_Text__c='Test001',Product2__c = prod01.Id);
+ Product2__c pro2 = new Product2__c(Name='Pro002',OT_CODE_Text__c='Test002',Product2__c = prod02.Id);
+ insert new Product2__c[] {pro1, pro2};
//璁㈠崟
Consumable_order__c Order1 = new Consumable_order__c(
- Name = 'OCM_01_001',
+ Name='OCM_01_001',
RecordTypeId = System.Label.RT_ConOrder_Delivery,
- Order_type__c = '璁㈠崟',
+ Order_type__c ='璁㈠崟',
Dealer_info__c = myAccount1.Id,
Delivery_detail_count__c = 1,
Order_ProType__c = 'ET',
- showFalseNotshowTrue__c = false
- );
- insert new List<Consumable_order__c>{ Order1 };
+ showFalseNotshowTrue__c = false);
+ insert new Consumable_order__c[] {Order1};
//鏄庣粏1
Consumable_orderdetails__c createDetail = new Consumable_orderdetails__c();
@@ -948,28 +756,26 @@
createDetail.Consumable_Product__c = pro1.id;
createDetail.Dealer_Custom_Price__c = 999.00;
createDetail.Consumable_count__c = 3;
- createDetail.Consumable_order__c = Order1.id;
+ createDetail.Consumable_order__c = Order1.id;
createDetail.RecordTypeid = System.Label.RT_ConOrderDetail1_Order;
insert createDetail;
//璁㈠崟鏄庣粏
- Consumable_order_details2__c Orderdet1 = new Consumable_order_details2__c(
- Name = 'OCM_01_001001',
+ Consumable_order_details2__c Orderdet1 = new Consumable_order_details2__c(
+ Name='OCM_01_001001',
Consumable_order_minor__c = Order1.Id,
Arrive_date__c = Date.today(),
Consumable_Product__c = pro1.id,
RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery,
- Cancellation_Flag__c = false
- );
- Consumable_order_details2__c Orderdet3 = new Consumable_order_details2__c(
- Name = 'OCM_01_001003',
+ Cancellation_Flag__c = false);
+ Consumable_order_details2__c Orderdet3 = new Consumable_order_details2__c(
+ Name='OCM_01_001003',
Consumable_order_minor__c = Order1.Id,
Consumable_Product__c = pro1.id,
RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery,
- Cancellation_Flag__c = false
- );
- insert new List<Consumable_order_details2__c>{ Orderdet1, Orderdet3 };
+ Cancellation_Flag__c = false);
+ insert new Consumable_order_details2__c[] {Orderdet1, Orderdet3};
LexConsumableGoodsInfo.initNotArrDetAll('all');
}
}
-}
+}
\ No newline at end of file
diff --git a/force-app/main/default/classes/LexConsumableGoodsInfoTest.cls-meta.xml b/force-app/main/default/classes/LexConsumableGoodsInfoTest.cls-meta.xml
index a9fd6e9..754ecb1 100644
--- a/force-app/main/default/classes/LexConsumableGoodsInfoTest.cls-meta.xml
+++ b/force-app/main/default/classes/LexConsumableGoodsInfoTest.cls-meta.xml
@@ -1,4 +1,4 @@
-<?xml version="1.0" encoding="UTF-8" ?>
+<?xml version="1.0" encoding="UTF-8"?>
<ApexClass xmlns="http://soap.sforce.com/2006/04/metadata">
<apiVersion>57.0</apiVersion>
<status>Active</status>
diff --git a/force-app/main/default/classes/LexConsumableOrderManageController.cls b/force-app/main/default/classes/LexConsumableOrderManageController.cls
index e086bbb..2ead3f4 100644
--- a/force-app/main/default/classes/LexConsumableOrderManageController.cls
+++ b/force-app/main/default/classes/LexConsumableOrderManageController.cls
@@ -56,8 +56,8 @@
List<CusCol> cols = new List<CusCol>();
for (FieldSetMember fsm : fsmList) {
//add by Link
- if (fsm.getFieldPath() == 'Order_ForHospital__c' && agencyProType == 'ET') {
- } else {
+ if(fsm.getFieldPath() == 'Order_ForHospital__c' && agencyProType == 'ET'){
+ }else {
CusCol col = new CusCol();
col.label = fsm.getLabel();
col.fieldName = fsm.getFieldPath();
@@ -125,11 +125,7 @@
raesList = Database.query(soql);
//add by rentx 2021-3-10 start
//涓� hasHop 璧嬪�� 鍒ゆ柇褰撳墠缁忛攢鍟嗕笅鏄惁鏈夌壒浠峰尰闄�
- List<hospitalprice__c> hopList = [
- SELECT id, hospital__c
- FROM hospitalprice__c
- WHERE account__c = :accountid
- ];
+ List<hospitalprice__c> hopList = [SELECT id, hospital__c FROM hospitalprice__c WHERE account__c = :accountid];
if (hopList == null || hopList.size() == 0) {
hasHop = false;
} else {
@@ -147,11 +143,7 @@
for (Account acc : contractList) {
dealIds.add(acc.Id);
}
- List<Dealer_Product__c> deList = [
- SELECT id
- FROM Dealer_Product__c
- WHERE Dealer_Contact__c IN :dealIds
- ];
+ List<Dealer_Product__c> deList = [SELECT id FROM Dealer_Product__c WHERE Dealer_Contact__c IN :dealIds];
if (deList == null || deList.size() == 0) {
hasSpecial = false;
} else {
@@ -340,4 +332,4 @@
@AuraEnabled
public String fieldName;
}
-}
+}
\ No newline at end of file
diff --git a/force-app/main/default/classes/LexConsumableOrderManageControllerTest.cls b/force-app/main/default/classes/LexConsumableOrderManageControllerTest.cls
index 6b42b1c..900bbbc 100644
--- a/force-app/main/default/classes/LexConsumableOrderManageControllerTest.cls
+++ b/force-app/main/default/classes/LexConsumableOrderManageControllerTest.cls
@@ -1,109 +1,39 @@
@istest
public class LexConsumableOrderManageControllerTest {
@IsTest
- static void ConsumableOrdertest() {
+ static void ConsumableOrdertest(){
User myUser_test = new User();
Account myAccount1;
Contact core;
User currentUser = [SELECT Id FROM User WHERE Id = :UserInfo.getUserId()];
- NoteStay__c n = new NoteStay__c(Name = 'NoteStay', IsStay__c = true);
+ NoteStay__c n = new NoteStay__c(Name = 'NoteStay',IsStay__c = true);
insert n;
- System.runAs(currentUser) {
- Profile prof = [
- SELECT Id
- FROM Profile
- WHERE Name = '901_缁忛攢鍟嗙ぞ鍖烘櫘閫氭潈闄恄2閲嶉獙璇�(ET)'
- ];
- List<RecordType> rectCo = [
- SELECT Id
- FROM RecordType
- WHERE IsActive = TRUE AND SobjectType = 'Account' AND Name = '璨╁2搴�'
- ];
+ System.runAs(currentUser){
+ Profile prof = [select Id from Profile where Name ='901_缁忛攢鍟嗙ぞ鍖烘櫘閫氭潈闄恄2閲嶉獙璇�(ET)'];
+ List<RecordType> rectCo = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '璨╁2搴�'];
if (rectCo.size() == 0) {
return;
}
- myAccount1 = new Account(name = 'testaccount001', RecordTypeId = rectCo[0].Id);
+ myAccount1 = new Account(name='testaccount001',RecordTypeId = rectCo[0].Id );
insert myAccount1;
- core = new Contact(email = 'jplumber@salesforce.com', firstname = 'Joe', lastname = 'Plumber', accountid = myAccount1.id);
+ core = new Contact(email='jplumber@salesforce.com', firstname='Joe',lastname='Plumber',accountid=myAccount1.id);
insert core;
- myUser_test = new User(
- ContactId = core.id,
- Alias = 'newUser',
- Email = 'newuser@testorg.com',
- EmailEncodingKey = 'UTF-8',
- LastName = 'testUser',
- LanguageLocaleKey = 'zh_CN',
- LocaleSidKey = 'zh_CN',
- ProfileId = prof.Id,
- TimeZoneSidKey = 'Asia/Shanghai',
- UserName = 'testUser@testorg.com',
- Work_Location__c = '鍖椾含'
- );
+ myUser_test = New User(ContactId = core.id,Alias = 'newUser',Email='newuser@testorg.com',EmailEncodingKey='UTF-8', LastName='testUser', LanguageLocaleKey='zh_CN',LocaleSidKey='zh_CN', ProfileId = prof.Id,TimeZoneSidKey='Asia/Shanghai', UserName='testUser@testorg.com',Work_Location__c = '鍖椾含');
insert myUser_test;
}
- System.runAs(myUser_test) {
- Consumable_order__c testList5 = new Consumable_order__c(
- Name = 'test5',
- Order_status__c = '鑽夋涓�',
- Dealer_info__c = myAccount1.Id,
- Order_type__c = '璁㈠崟',
- RecordtypeId = System.Label.RT_ConOrder_Order,
- Order_ProType__c = 'ET'
- );
- Consumable_order__c testList6 = new Consumable_order__c(
- Name = 'test6',
- Order_status__c = '宸叉彁浜�',
- Dealer_info__c = myAccount1.Id,
- Order_type__c = '璁㈠崟',
- RecordtypeId = System.Label.RT_ConOrder_Order,
- Order_ProType__c = 'ET'
- );
- Consumable_order__c testList7 = new Consumable_order__c(
- Name = 'test7',
- Order_status__c = '宸叉彁浜�',
- Dealer_info__c = myAccount1.Id,
- Order_type__c = '璁㈠崟',
- RecordtypeId = System.Label.RT_ConOrder_Order,
- Order_ProType__c = 'ET'
- );
- Consumable_order__c testList1 = new Consumable_order__c(
- Name = 'test1',
- Order_status__c = '鑽夋涓�',
- Dealer_info__c = myAccount1.Id,
- Order_type__c = '璁㈠崟',
- RecordtypeId = System.Label.RT_ConOrder_Order,
- Order_ProType__c = 'ET'
- );
- Consumable_order__c testList2 = new Consumable_order__c(
- Name = 'test2',
- Order_status__c = '鑽夋涓�',
- Dealer_info__c = myAccount1.Id,
- Order_type__c = '璁㈠崟',
- RecordtypeId = System.Label.RT_ConOrder_Order,
- Order_ProType__c = 'ET'
- );
- Consumable_order__c testList3 = new Consumable_order__c(
- Name = 'test3',
- Order_status__c = '鑽夋涓�',
- Dealer_info__c = myAccount1.Id,
- Order_type__c = '璁㈠崟',
- RecordtypeId = System.Label.RT_ConOrder_Order,
- Order_ProType__c = 'ET'
- );
- Consumable_order__c testList4 = new Consumable_order__c(
- Name = 'test4',
- Order_status__c = '鑽夋涓�',
- Dealer_info__c = myAccount1.Id,
- Order_type__c = '璁㈠崟',
- RecordtypeId = System.Label.RT_ConOrder_Order,
- Order_date__c = Date.today(),
- Order_ProType__c = 'ET'
- );
- insert new List<Consumable_order__c>{ testList1, testList2, testList3, testList4, testList5, testList6, testList7 };
+ System.runAs(myUser_test){
+ Consumable_order__c testList5 = new Consumable_order__c(Name='test5',Order_status__c='鑽夋涓�',Dealer_info__c=myAccount1.Id,Order_type__c ='璁㈠崟',RecordtypeId = System.Label.RT_ConOrder_Order,Order_ProType__c = 'ET');
+ Consumable_order__c testList6 = new Consumable_order__c(Name='test6',Order_status__c='宸叉彁浜�',Dealer_info__c=myAccount1.Id,Order_type__c ='璁㈠崟',RecordtypeId = System.Label.RT_ConOrder_Order,Order_ProType__c = 'ET');
+ Consumable_order__c testList7 = new Consumable_order__c(Name='test7',Order_status__c='宸叉彁浜�',Dealer_info__c=myAccount1.Id,Order_type__c ='璁㈠崟',RecordtypeId = System.Label.RT_ConOrder_Order,Order_ProType__c = 'ET');
+ Consumable_order__c testList1 = new Consumable_order__c(Name='test1',Order_status__c='鑽夋涓�',Dealer_info__c=myAccount1.Id,Order_type__c ='璁㈠崟',RecordtypeId = System.Label.RT_ConOrder_Order,Order_ProType__c = 'ET');
+ Consumable_order__c testList2 = new Consumable_order__c(Name='test2',Order_status__c='鑽夋涓�',Dealer_info__c=myAccount1.Id,Order_type__c ='璁㈠崟',RecordtypeId = System.Label.RT_ConOrder_Order,Order_ProType__c = 'ET');
+ Consumable_order__c testList3 = new Consumable_order__c(Name='test3',Order_status__c='鑽夋涓�',Dealer_info__c=myAccount1.Id,Order_type__c ='璁㈠崟',RecordtypeId = System.Label.RT_ConOrder_Order,Order_ProType__c = 'ET');
+ Consumable_order__c testList4 = new Consumable_order__c(Name='test4',Order_status__c='鑽夋涓�',Dealer_info__c=myAccount1.Id,Order_type__c ='璁㈠崟',RecordtypeId = System.Label.RT_ConOrder_Order,Order_date__c = Date.today(),Order_ProType__c = 'ET');
+ insert new Consumable_order__c[]{testList1,testList2,testList3,testList4,testList5,testList6,testList7};
LexConsumableOrderManageController.init1();
String accID = myAccount1.Id;
- LexConsumableOrderManageController.searchConsumableorderdetails('', null, '', accID, 'ET', '鍖椾含');
+ LexConsumableOrderManageController.searchConsumableorderdetails('',null, '',accID, 'ET', '鍖椾含');
}
}
-}
+}
\ No newline at end of file
diff --git a/force-app/main/default/classes/LexConsumableOrderManageControllerTest.cls-meta.xml b/force-app/main/default/classes/LexConsumableOrderManageControllerTest.cls-meta.xml
index a9fd6e9..754ecb1 100644
--- a/force-app/main/default/classes/LexConsumableOrderManageControllerTest.cls-meta.xml
+++ b/force-app/main/default/classes/LexConsumableOrderManageControllerTest.cls-meta.xml
@@ -1,4 +1,4 @@
-<?xml version="1.0" encoding="UTF-8" ?>
+<?xml version="1.0" encoding="UTF-8"?>
<ApexClass xmlns="http://soap.sforce.com/2006/04/metadata">
<apiVersion>57.0</apiVersion>
<status>Active</status>
diff --git a/force-app/main/default/classes/LexInventoryController.cls b/force-app/main/default/classes/LexInventoryController.cls
index 909cdb8..7380b26 100644
--- a/force-app/main/default/classes/LexInventoryController.cls
+++ b/force-app/main/default/classes/LexInventoryController.cls
@@ -157,11 +157,7 @@
String userId = UserInfo.getUserId();
//String userId = '00510000006k82X';
//String userId = '00510000005QO75';
- user Useracc = [
- SELECT Accountid, Work_Location__c, UserPro_Type__c
- FROM user
- WHERE id = :userId
- ];
+ user Useracc = [SELECT Accountid, Work_Location__c, UserPro_Type__c FROM user WHERE id = :userId];
accountid = Useracc.Accountid;
userWorkLocation = Useracc.Work_Location__c;
agencyProType = Useracc.UserPro_Type__c;
@@ -169,11 +165,7 @@
agencyProType = 'ET';
}
sqlagencyProType = '%' + agencyProType + '%';
- Account accountInfo = [
- SELECT Name, Dealer_discount__c
- FROM account
- WHERE id = :accountid
- ];
+ Account accountInfo = [SELECT Name, Dealer_discount__c FROM account WHERE id = :accountid];
accountName = accountInfo.Name;
consumableorderdetailsRecords = new List<ConsumableorderdetailsInfo>();
Map<String, Product2__c> midMap = new Map<String, Product2__c>();
@@ -1288,11 +1280,7 @@
try {
insert Po;
eSetId = Po.id;
- List<Consumable_order__c> Consumable_order = [
- SELECT Name
- FROM Consumable_order__c
- WHERE id = :Po.id
- ];
+ List<Consumable_order__c> Consumable_order = [SELECT Name FROM Consumable_order__c WHERE id = :Po.id];
List<Consumable_orderdetails__c> InsList = new List<Consumable_orderdetails__c>();
List<Consumable_order_details2__c> InsListUp = new List<Consumable_order_details2__c>();
List<Consumable_order_details2__c> updListAdjust = new List<Consumable_order_details2__c>();
@@ -1482,4 +1470,4 @@
return returnValue;
}
}
-}
+}
\ No newline at end of file
diff --git a/force-app/main/default/classes/LexInventoryControllerTest.cls b/force-app/main/default/classes/LexInventoryControllerTest.cls
index 140695d..25646d5 100644
--- a/force-app/main/default/classes/LexInventoryControllerTest.cls
+++ b/force-app/main/default/classes/LexInventoryControllerTest.cls
@@ -1,667 +1,428 @@
@isTest
public class LexInventoryControllerTest {
- static testMethod void InventoryControllerTest_PartBar() {
+ static testMethod void InventoryControllerTest_PartBar(){
user myUser_test;
Account myAccount1;
- User thisUser = [SELECT Id FROM User WHERE Id = :UserInfo.getUserId()];
- System.runAs(thisUser) {
- Profile prof1 = [
- SELECT Id
- FROM Profile
- WHERE Name = '901_缁忛攢鍟嗙ぞ鍖烘櫘閫氭潈闄恄2閲嶉獙璇�(ET Email)'
- ];
- List<RecordType> rectCo = [
- SELECT Id
- FROM RecordType
- WHERE IsActive = TRUE AND SobjectType = 'Account' AND Name = '璨╁2搴�'
- ];
- if (rectCo.size() == 0) {
- return;
- }
- StaticParameter.EscapeOrderDetail2Trigger = true;
- StaticParameter.EscapeConsumableOrderDetail2Trigger = true;
- RecordType rectCoO = [
- SELECT Id
- FROM RecordType
- WHERE IsActive = TRUE AND SobjectType = 'Account' AND Name = '鐥呴櫌'
- ];
-
- Account olympus = new Account(RecordTypeId = rectCoO.Id, AgentCode_Ext__c = '9999900', Name = 'olympus');
- insert olympus;
-
- myAccount1 = new Account(
- name = 'Testaccount001',
- Dealer_discount__c = 10,
- RecordTypeId = rectCo[0].Id,
- AgentCode_Ext__c = '8888888'
- );
- insert myAccount1;
-
- Contact core = new Contact(
- email = 'jplumber@salesforce.com',
- firstname = 'Joe',
- lastname = 'Plumber',
- accountid = myAccount1.id
- );
- insert core;
- MyUser_Test = new User(
- ContactId = core.id,
- Alias = 'newUser',
- Email = 'newuser@testorg.com',
- EmailEncodingKey = 'UTF-8',
- LastName = 'TestUser',
- LanguageLocaleKey = 'zh_CN',
- LocaleSidKey = 'zh_CN',
- ProfileId = prof1.Id,
- TimeZoneSidKey = 'Asia/Shanghai',
- UserName = 'testUser@testorg.com',
- Work_Location__c = '涓婃捣'
- );
- insert MyUser_Test;
+ User thisUser = [ select Id from User where Id = :UserInfo.getUserId()];
+ System.runAs(thisUser){
+ Profile prof1 = [select Id from Profile where Name ='901_缁忛攢鍟嗙ぞ鍖烘櫘閫氭潈闄恄2閲嶉獙璇�(ET Email)'];
+ List<RecordType> rectCo = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '璨╁2搴�'];
+ if (rectCo.size() == 0) {
+ return;
}
- System.runAs(MyUser_Test) {
- Product2 prod07 = new Product2(
- Name = 'Test07',
- ProductCode = 'Test07',
- Asset_Model_No__c = 'Test07',
- SFDA_Status__c = '鏈夊姽',
- Dealer_special_Object__c = true,
- Packing_list_manual__c = 1,
- Manual_Entry__c = false
- );
- Product2 prod08 = new Product2(
- Name = 'Test08',
- ProductCode = 'Test08',
- Asset_Model_No__c = 'Test08',
- SFDA_Status__c = '鏈夊姽',
- Dealer_special_Object__c = true,
- Packing_list_manual__c = 1,
- Manual_Entry__c = false
- );
- Product2 prod09 = new Product2(
- Name = 'Test09',
- ProductCode = 'Test09',
- Asset_Model_No__c = 'Test09',
- SFDA_Status__c = '鏈夊姽',
- Dealer_special_Object__c = true,
- Packing_list_manual__c = 1,
- Manual_Entry__c = false
- );
+ StaticParameter.EscapeOrderDetail2Trigger = true;
+ StaticParameter.EscapeConsumableOrderDetail2Trigger = true;
+ RecordType rectCoO = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '鐥呴櫌'];
- insert new List<Product2>{ prod07, prod08, prod09 };
+ Account olympus = new Account(RecordTypeId = rectCoO.Id, AgentCode_Ext__c = '9999900', Name = 'olympus');
+ insert olympus;
- //鍒朵綔浜у搧
- Product2__c proG = new Product2__c(Name = 'MH-155:鐧藉钩琛″附', OT_CODE_Text__c = 'Test001', Product2__c = prod07.Id);
- insert proG;
- Product2__c proH = new Product2__c(Name = 'MB-677:BNC鐢电紗', OT_CODE_Text__c = 'Test002', Product2__c = prod08.Id);
- insert proH;
- Product2__c proF = new Product2__c(Name = 'TooMAJ-643R:姘村泭闉樼003', OT_CODE_Text__c = 'Test003', Product2__c = prod09.Id);
- insert proF;
+ myAccount1 = new Account(name='Testaccount001',Dealer_discount__c =10,RecordTypeId = rectCo[0].Id,AgentCode_Ext__c = '8888888');
+ insert myAccount1;
- //棰勫埗澶存槑缁�
- Consumable_order__c CreateId = new Consumable_order__c();
- CreateId.Name = 'testMing';
- CreateId.Order_status__c = '鑽夋涓�';
- CreateId.RecordTypeid = System.Label.RT_ConOrder_Order;
- CreateId.Dealer_Info__c = myAccount1.id;
- CreateId.Inventory_date__c = Date.today();
- CreateId.Order_type__c = '鐩樼偣';
- CreateId.Order_ProType__c = 'ET';
- insert CreateId;
- List<Consumable_order_details2__c> conList = new List<Consumable_order_details2__c>();
+ Contact core = new Contact(email='jplumber@salesforce.com', firstname='Joe',lastname='Plumber',accountid=myAccount1.id);
+ insert core;
+ MyUser_Test = New User(ContactId = core.id,Alias = 'newUser',Email='newuser@testorg.com',EmailEncodingKey='UTF-8', LastName='TestUser', LanguageLocaleKey='zh_CN',LocaleSidKey='zh_CN', ProfileId = prof1.Id,TimeZoneSidKey='Asia/Shanghai', UserName='testUser@testorg.com',Work_Location__c = '涓婃捣');
+ insert MyUser_Test;
- //鍒朵綔Consumable_order_details__c-------ProductCount
- Consumable_order_details2__c dataForProductCount9 = new Consumable_order_details2__c();
- dataForProductCount9.Bar_Code__c = '1234567890';
- dataForProductCount9.Sterilization_limit__c = Date.today().addDays(2);
- dataForProductCount9.Arrive_date__c = Date.today();
- dataForProductCount9.RecordTypeid = System.Label.RT_ConOrderDetail2_Delivery;
- dataForProductCount9.Consumable_Product__c = proG.id;
- dataForProductCount9.Asset_Model_No__c = proG.Asset_Model_No__c;
- dataForProductCount9.Box_Piece__c = '鐩�';
- dataForProductCount9.Consumable_order_minor__c = CreateId.id;
- dataForProductCount9.Send_Date__c = null;
+ }
+ system.runAs(MyUser_Test){
+ Product2 prod07 = new Product2(Name='Test07',ProductCode='Test07',Asset_Model_No__c = 'Test07',SFDA_Status__c = '鏈夊姽',Dealer_special_Object__c = true,Packing_list_manual__c = 1,Manual_Entry__c = false);
+ Product2 prod08 = new Product2(Name='Test08',ProductCode='Test08',Asset_Model_No__c = 'Test08',SFDA_Status__c = '鏈夊姽',Dealer_special_Object__c = true,Packing_list_manual__c = 1,Manual_Entry__c = false);
+ Product2 prod09 = new Product2(Name='Test09',ProductCode='Test09',Asset_Model_No__c = 'Test09',SFDA_Status__c = '鏈夊姽',Dealer_special_Object__c = true,Packing_list_manual__c = 1,Manual_Entry__c = false);
+
+ insert new Product2[] {prod07,prod08,prod09};
+
+ //鍒朵綔浜у搧
+ Product2__c proG = new Product2__c(Name='MH-155:鐧藉钩琛″附',OT_CODE_Text__c='Test001',Product2__c = prod07.Id);
+ insert proG;
+ Product2__c proH = new Product2__c(Name='MB-677:BNC鐢电紗',OT_CODE_Text__c='Test002',Product2__c = prod08.Id);
+ insert proH;
+ Product2__c proF = new Product2__c(Name='TooMAJ-643R:姘村泭闉樼003',OT_CODE_Text__c='Test003',Product2__c = prod09.Id);
+ insert proF;
+
+ //棰勫埗澶存槑缁�
+ Consumable_order__c CreateId = new Consumable_order__c();
+ CreateId.Name = 'testMing';
+ CreateId.Order_status__c = '鑽夋涓�';
+ CreateId.RecordTypeid = System.Label.RT_ConOrder_Order;
+ CreateId.Dealer_Info__c = myAccount1.id;
+ CreateId.Inventory_date__c = Date.today();
+ CreateId.Order_type__c = '鐩樼偣';
+ CreateId.Order_ProType__c = 'ET';
+ insert CreateId;
+ List<Consumable_order_details2__c> conList = new List<Consumable_order_details2__c>();
+
+
+ //鍒朵綔Consumable_order_details__c-------ProductCount
+ Consumable_order_details2__c dataForProductCount9 = new Consumable_order_details2__c();
+ dataForProductCount9.Bar_Code__c = '1234567890';
+ dataForProductCount9.Sterilization_limit__c = Date.today().addDays(2);
+ dataForProductCount9.Arrive_date__c = Date.today();
+ dataForProductCount9.RecordTypeid = System.Label.RT_ConOrderDetail2_Delivery;
+ dataForProductCount9.Consumable_Product__c = proG.id;
+ dataForProductCount9.Asset_Model_No__c = proG.Asset_Model_No__c;
+ dataForProductCount9.Box_Piece__c = '鐩�';
+ dataForProductCount9.Consumable_order_minor__c = CreateId.id;
+ dataForProductCount9.Send_Date__c = null;
dataForProductCount9.Used_date__c = null;
dataForProductCount9.Lose_Flag__c = false;
- conList.add(dataForProductCount9);
+ conList.add(dataForProductCount9);
- Consumable_order_details2__c dataForProductCount7 = new Consumable_order_details2__c();
- dataForProductCount7.Bar_Code__c = '1234567892';
- dataForProductCount7.Sterilization_limit__c = Date.today().addDays(2);
- dataForProductCount7.Arrive_date__c = Date.today();
- dataForProductCount7.RecordTypeid = System.Label.RT_ConOrderDetail2_Delivery;
- dataForProductCount7.Consumable_Product__c = proH.id;
- dataForProductCount7.Asset_Model_No__c = proH.Asset_Model_No__c;
- dataForProductCount7.Box_Piece__c = '鐩�';
- dataForProductCount7.Consumable_order_minor__c = CreateId.id;
- dataForProductCount7.Send_Date__c = null;
+ Consumable_order_details2__c dataForProductCount7 = new Consumable_order_details2__c();
+ dataForProductCount7.Bar_Code__c = '1234567892';
+ dataForProductCount7.Sterilization_limit__c = Date.today().addDays(2);
+ dataForProductCount7.Arrive_date__c = Date.today();
+ dataForProductCount7.RecordTypeid = System.Label.RT_ConOrderDetail2_Delivery;
+ dataForProductCount7.Consumable_Product__c = proH.id;
+ dataForProductCount7.Asset_Model_No__c = proH.Asset_Model_No__c;
+ dataForProductCount7.Box_Piece__c = '鐩�';
+ dataForProductCount7.Consumable_order_minor__c = CreateId.id;
+ dataForProductCount7.Send_Date__c = null;
dataForProductCount7.Used_date__c = null;
dataForProductCount7.Lose_Flag__c = false;
conList.add(dataForProductCount7);
-
- Consumable_order_details2__c dataForProductCount = new Consumable_order_details2__c();
- dataForProductCount.Bar_Code__c = '1234567882';
- dataForProductCount.Sterilization_limit__c = Date.today().addDays(2);
- dataForProductCount.Arrive_date__c = Date.today();
- dataForProductCount.RecordTypeid = System.Label.RT_ConOrderDetail2_Delivery;
- dataForProductCount.Consumable_Product__c = proG.id;
- dataForProductCount.Asset_Model_No__c = proG.Asset_Model_No__c;
- dataForProductCount.Box_Piece__c = '鐩�';
- dataForProductCount.Consumable_order_minor__c = CreateId.id;
+
+ Consumable_order_details2__c dataForProductCount = new Consumable_order_details2__c();
+ dataForProductCount.Bar_Code__c = '1234567882';
+ dataForProductCount.Sterilization_limit__c = Date.today().addDays(2);
+ dataForProductCount.Arrive_date__c = Date.today();
+ dataForProductCount.RecordTypeid = System.Label.RT_ConOrderDetail2_Delivery;
+ dataForProductCount.Consumable_Product__c = proG.id;
+ dataForProductCount.Asset_Model_No__c = proG.Asset_Model_No__c;
+ dataForProductCount.Box_Piece__c = '鐩�';
+ dataForProductCount.Consumable_order_minor__c = CreateId.id;
dataForProductCount.Send_Date__c = null;
dataForProductCount.Used_date__c = null;
- dataForProductCount.Lose_Flag__c = true;
+ dataForProductCount.Lose_Flag__c = true;
conList.add(dataForProductCount);
-
- Consumable_order_details2__c dataForProductCount4 = new Consumable_order_details2__c();
- dataForProductCount4.Bar_Code__c = '1234567884';
- dataForProductCount4.Sterilization_limit__c = Date.today().addDays(2);
- dataForProductCount4.Arrive_date__c = Date.today();
- dataForProductCount4.RecordTypeid = System.Label.RT_ConOrderDetail2_Delivery;
- dataForProductCount4.Consumable_Product__c = proF.id;
- dataForProductCount4.Asset_Model_No__c = proF.Asset_Model_No__c;
- dataForProductCount4.Box_Piece__c = '涓�';
- dataForProductCount4.Consumable_order_minor__c = CreateId.id;
+
+ Consumable_order_details2__c dataForProductCount4 = new Consumable_order_details2__c();
+ dataForProductCount4.Bar_Code__c = '1234567884';
+ dataForProductCount4.Sterilization_limit__c = Date.today().addDays(2);
+ dataForProductCount4.Arrive_date__c = Date.today();
+ dataForProductCount4.RecordTypeid = System.Label.RT_ConOrderDetail2_Delivery;
+ dataForProductCount4.Consumable_Product__c = proF.id;
+ dataForProductCount4.Asset_Model_No__c = proF.Asset_Model_No__c;
+ dataForProductCount4.Box_Piece__c = '涓�';
+ dataForProductCount4.Consumable_order_minor__c = CreateId.id;
//dataForProductCount4.Lose_Flag__c = true;
dataForProductCount4.RemoveBox_No__c = 1;
conList.add(dataForProductCount4);
- Consumable_order_details2__c dataForProductCount5 = new Consumable_order_details2__c();
- dataForProductCount5.Bar_Code__c = '1234567885';
- dataForProductCount5.Sterilization_limit__c = Date.today().addDays(2);
- dataForProductCount5.Arrive_date__c = Date.today();
- dataForProductCount5.RecordTypeid = System.Label.RT_ConOrderDetail2_Delivery;
- dataForProductCount5.Consumable_Product__c = proH.id;
- dataForProductCount5.Asset_Model_No__c = proH.Asset_Model_No__c;
- dataForProductCount5.Box_Piece__c = '涓�';
- dataForProductCount5.Consumable_order_minor__c = CreateId.id;
+ Consumable_order_details2__c dataForProductCount5 = new Consumable_order_details2__c();
+ dataForProductCount5.Bar_Code__c = '1234567885';
+ dataForProductCount5.Sterilization_limit__c = Date.today().addDays(2);
+ dataForProductCount5.Arrive_date__c = Date.today();
+ dataForProductCount5.RecordTypeid = System.Label.RT_ConOrderDetail2_Delivery;
+ dataForProductCount5.Consumable_Product__c = proH.id;
+ dataForProductCount5.Asset_Model_No__c = proH.Asset_Model_No__c;
+ dataForProductCount5.Box_Piece__c = '涓�';
+ dataForProductCount5.Consumable_order_minor__c = CreateId.id;
dataForProductCount5.Lose_Flag__c = true;
dataForProductCount5.RemoveBox_No__c = 1;
- conList.add(dataForProductCount5);
+ conList.add(dataForProductCount5);
insert conList;
+
+ List<Consumable_order_details2__c> productCount_Res = [select Id,Name
+ FROM Consumable_order_details2__c
+ WHERE Dealer_Arrive__c = true
+ AND Dealer_Shipment__c = false
+ AND Dealer_Saled__c = false
+ AND Lose_Flag__c = false
+ AND Bar_Code__c !=null
+ AND Dealer_Info_text__c = :myAccount1.Name];
+ //鏌ヨ搴撳瓨 杩藉姞杩斿搧搴撳瓨
- List<Consumable_order_details2__c> productCount_Res = [
- SELECT Id, Name
- FROM Consumable_order_details2__c
- WHERE
- Dealer_Arrive__c = TRUE
- AND Dealer_Shipment__c = FALSE
- AND Dealer_Saled__c = FALSE
- AND Lose_Flag__c = FALSE
- AND Bar_Code__c != NULL
- AND Dealer_Info_text__c = :myAccount1.Name
- ];
- //鏌ヨ搴撳瓨 杩藉姞杩斿搧搴撳瓨
+ List<Consumable_order_details2__c> conList1 = new List<Consumable_order_details2__c>();
+ Consumable_order_details2__c con = new Consumable_order_details2__c();
+ con.Arrive_date__c = Date.today();
+ con.Send_Date__c = null;
+ con.Used_date__c = null;
+ con.Return_date__c = null;
+ con.Lose_Flag__c = false;
+ con.Cancellation_Flag__c = false;
+ con.Consumable_Product__c = proG.Id;
+ con.Asset_Model_No__c = 'Mj-1001';
+ con.Sterilization_limit__c = Date.today().addDays(2);
+ con.Box_Piece__c = '鐩�';
+ con.Consumable_order_minor__c = CreateId.id;
+ con.Bar_Code__c = '1234567885';
+ conList1.add(con);
- List<Consumable_order_details2__c> conList1 = new List<Consumable_order_details2__c>();
- Consumable_order_details2__c con = new Consumable_order_details2__c();
- con.Arrive_date__c = Date.today();
- con.Send_Date__c = null;
- con.Used_date__c = null;
- con.Return_date__c = null;
- con.Lose_Flag__c = false;
- con.Cancellation_Flag__c = false;
- con.Consumable_Product__c = proG.Id;
- con.Asset_Model_No__c = 'Mj-1001';
- con.Sterilization_limit__c = Date.today().addDays(2);
- con.Box_Piece__c = '鐩�';
- con.Consumable_order_minor__c = CreateId.id;
- con.Bar_Code__c = '1234567885';
- conList1.add(con);
-
- Consumable_order_details2__c con1 = new Consumable_order_details2__c();
- con1.Arrive_date__c = Date.today();
- con1.Send_Date__c = null;
- con1.Used_date__c = null;
- con1.Return_date__c = null;
- con1.Lose_Flag__c = false;
- con1.Cancellation_Flag__c = false;
- con1.Consumable_Product__c = proG.Id;
- con1.Asset_Model_No__c = 'Mj-1001';
- con1.Sterilization_limit__c = Date.today().addDays(2);
- con1.Box_Piece__c = '涓�';
- con1.Consumable_order_minor__c = CreateId.id;
- con1.Bar_Code__c = '12345678856';
- conList1.add(con1);
+ Consumable_order_details2__c con1 = new Consumable_order_details2__c();
+ con1.Arrive_date__c = Date.today();
+ con1.Send_Date__c = null;
+ con1.Used_date__c = null;
+ con1.Return_date__c = null;
+ con1.Lose_Flag__c = false;
+ con1.Cancellation_Flag__c = false;
+ con1.Consumable_Product__c = proG.Id;
+ con1.Asset_Model_No__c = 'Mj-1001';
+ con1.Sterilization_limit__c = Date.today().addDays(2);
+ con1.Box_Piece__c = '涓�';
+ con1.Consumable_order_minor__c = CreateId.id;
+ con1.Bar_Code__c = '12345678856';
+ conList1.add(con1);
insert conList1;
-
- LexInventoryController OwnTest = new LexInventoryController();
- LexInventoryController.init();
- LexInventoryController controller = new LexInventoryController();
- List<LexInventoryController.ConsumableorderdetailsInfo> testList = LexInventoryController.consumableorderdetailsRecords;
- List<LexInventoryController.ConsumableorderdetailsInfo> testList1 = new List<LexInventoryController.ConsumableorderdetailsInfo>();
- System.debug('testCount:' + testList.size());
- for (LexInventoryController.ConsumableorderdetailsInfo ass : testList) {
- System.debug(ass.check);
- ass.check = true;
- testList1.add(ass);
- }
- System.debug('testList1:' + testList1);
- LexInventoryController.searchConsumableorderdetails(
- 'ET',
- '涓婃捣',
- 'Testaccount001',
- '12345678856\n1234567895\n1234567890\n12345678511\n1234567856\n1234567855\n1234567886\n12345678551\n1234567890\n1234567883\n1234567882\n1234567881\n1234567884\nn123456788412\n1234567885\n123456788512\n1234567891\n1234567892\n1234567893\n1234567894',
- JSON.serialize(testList1),
- 1,
- 0,
- 'Test',
- 'ASC'
- );
- LexInventoryController.searchConsumableorderdetails(
- 'ET',
- '涓婃捣',
- 'Testaccount001',
- '1234567882',
- JSON.serialize(testList1),
- 1,
- 0,
- 'Test',
- 'ASC'
- );
- LexInventoryController.barcode = '';
- }
- }
- static testMethod void InventoryControllerTest_PartPan() {
- user MyUser_Test;
+
+ LexInventoryController OwnTest = new LexInventoryController();
+ LexInventoryController.init();
+ LexInventoryController controller = new LexInventoryController();
+ List<LexInventoryController.ConsumableorderdetailsInfo> testList = LexInventoryController.consumableorderdetailsRecords;
+ List<LexInventoryController.ConsumableorderdetailsInfo> testList1 = new List<LexInventoryController.ConsumableorderdetailsInfo>();
+ System.debug('testCount:'+testList.size());
+ for(LexInventoryController.ConsumableorderdetailsInfo ass : testList){
+ System.debug(ass.check);
+ ass.check = true;
+ testList1.add(ass);
+ }
+ System.debug('testList1:'+testList1);
+ LexInventoryController.searchConsumableorderdetails('ET','涓婃捣','Testaccount001','12345678856\n1234567895\n1234567890\n12345678511\n1234567856\n1234567855\n1234567886\n12345678551\n1234567890\n1234567883\n1234567882\n1234567881\n1234567884\nn123456788412\n1234567885\n123456788512\n1234567891\n1234567892\n1234567893\n1234567894',JSON.serialize(testList1),1,0,'Test','ASC');
+ LexInventoryController.searchConsumableorderdetails('ET','涓婃捣','Testaccount001','1234567882',JSON.serialize(testList1),1,0,'Test','ASC');
+ LexInventoryController.barcode = '';
+
+ }
+ }
+ static testMethod void InventoryControllerTest_PartPan(){
+ user MyUser_Test;
Account myAccount1;
- User thisUser = [SELECT Id FROM User WHERE Id = :UserInfo.getUserId()];
- System.runAs(thisUser) {
- Profile prof1 = [
- SELECT Id
- FROM Profile
- WHERE Name = '901_缁忛攢鍟嗙ぞ鍖烘櫘閫氭潈闄恄2閲嶉獙璇�(ET Email)'
- ];
- List<RecordType> rectCo = [
- SELECT Id
- FROM RecordType
- WHERE IsActive = TRUE AND SobjectType = 'Account' AND Name = '璨╁2搴�'
- ];
- if (rectCo.size() == 0) {
- return;
- }
- RecordType rectCoO = [
- SELECT Id
- FROM RecordType
- WHERE IsActive = TRUE AND SobjectType = 'Account' AND Name = '鐥呴櫌'
- ];
- Account olympus = new Account(RecordTypeId = rectCoO.Id, AgentCode_Ext__c = '9999900', Name = 'olympus');
- insert olympus;
-
- Product2 prod07 = new Product2(
- Name = 'Test07',
- ProductCode = 'Test07',
- Asset_Model_No__c = 'Test07',
- SFDA_Status__c = '鏈夊姽',
- Dealer_special_Object__c = true
- );
- Product2 prod08 = new Product2(
- Name = 'Test08',
- ProductCode = 'Test08',
- Asset_Model_No__c = 'Test08',
- SFDA_Status__c = '鏈夊姽',
- Dealer_special_Object__c = true
- );
- Product2 prod09 = new Product2(
- Name = 'Test09',
- ProductCode = 'Test09',
- Asset_Model_No__c = 'Test09',
- SFDA_Status__c = '鏈夊姽',
- Dealer_special_Object__c = true
- );
- insert new List<Product2>{ prod07, prod08, prod09 };
-
- //鍒朵綔浜у搧
- Product2__c proG = new Product2__c(Name = 'Too001', OT_CODE_Text__c = 'Test001', Product2__c = prod07.Id);
- insert proG;
- Product2__c proH = new Product2__c(Name = 'Too002', OT_CODE_Text__c = 'Test002', Product2__c = prod08.Id);
- insert proH;
- Product2__c proF = new Product2__c(Name = 'Too003', OT_CODE_Text__c = 'Test001', Product2__c = prod09.Id);
- insert proF;
-
- myAccount1 = new Account(name = 'Testaccount001', Dealer_discount__c = 10, RecordTypeId = rectCo[0].Id);
-
- insert myAccount1;
-
- Contact core = new Contact(
- email = 'jplumber@salesforce.com',
- firstname = 'Joe',
- lastname = 'Plumber',
- accountid = myAccount1.id
- );
- insert core;
- MyUser_Test = new User(
- ContactId = core.id,
- Alias = 'newUser',
- Email = 'newuser@testorg.com',
- EmailEncodingKey = 'UTF-8',
- LastName = 'TestUser',
- LanguageLocaleKey = 'zh_CN',
- LocaleSidKey = 'zh_CN',
- ProfileId = prof1.Id,
- TimeZoneSidKey = 'Asia/Shanghai',
- UserName = 'testUser@testorg.com'
- );
- insert MyUser_Test;
+ User thisUser = [ select Id from User where Id = :UserInfo.getUserId()];
+ system.runAs(thisUser){
+
+ Profile prof1 = [select Id from Profile where Name ='901_缁忛攢鍟嗙ぞ鍖烘櫘閫氭潈闄恄2閲嶉獙璇�(ET Email)'];
+ List<RecordType> rectCo = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '璨╁2搴�'];
+ if (rectCo.size() == 0) {
+ return;
}
- System.runAs(MyUser_Test) {
- InventoryController OwnTest = new InventoryController();
- OwnTest.size = 2;
- OwnTest.init();
- OwnTest.setCon.next();
- OwnTest.refreshPageSize();
- OwnTest.ConsumableorderdetailsRecordsview.sort();
- system.assertEquals(0, OwnTest.consumableorderdetailsCount);
- OwnTest.save();
- }
- }
- static testMethod void InventoryControllerTest_ge() {
- user MyUser_Test;
+ RecordType rectCoO = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '鐥呴櫌'];
+ Account olympus = new Account(RecordTypeId = rectCoO.Id, AgentCode_Ext__c = '9999900', Name = 'olympus');
+ insert olympus;
+
+ Product2 prod07 = new Product2(Name='Test07',ProductCode='Test07',Asset_Model_No__c = 'Test07',SFDA_Status__c = '鏈夊姽',Dealer_special_Object__c = true);
+ Product2 prod08 = new Product2(Name='Test08',ProductCode='Test08',Asset_Model_No__c = 'Test08',SFDA_Status__c = '鏈夊姽',Dealer_special_Object__c = true);
+ Product2 prod09 = new Product2(Name='Test09',ProductCode='Test09',Asset_Model_No__c = 'Test09',SFDA_Status__c = '鏈夊姽',Dealer_special_Object__c = true);
+ insert new Product2[] {prod07,prod08,prod09};
+
+ //鍒朵綔浜у搧
+ Product2__c proG = new Product2__c(Name='Too001',OT_CODE_Text__c='Test001',Product2__c = prod07.Id);
+ insert proG;
+ Product2__c proH = new Product2__c(Name='Too002',OT_CODE_Text__c='Test002',Product2__c = prod08.Id);
+ insert proH;
+ Product2__c proF = new Product2__c(Name='Too003',OT_CODE_Text__c='Test001',Product2__c = prod09.Id);
+ insert proF;
+
+
+ myAccount1 = new Account(name='Testaccount001',Dealer_discount__c =10,RecordTypeId = rectCo[0].Id);
+
+ insert myAccount1;
+
+ Contact core = new Contact(email='jplumber@salesforce.com', firstname='Joe',lastname='Plumber',accountid=myAccount1.id);
+ insert core;
+ MyUser_Test = New User(ContactId = core.id,Alias = 'newUser',Email='newuser@testorg.com',EmailEncodingKey='UTF-8', LastName='TestUser', LanguageLocaleKey='zh_CN',LocaleSidKey='zh_CN', ProfileId = prof1.Id,TimeZoneSidKey='Asia/Shanghai', UserName='testUser@testorg.com');
+ insert MyUser_Test;
+ }
+ system.runAs(MyUser_Test){
+
+ InventoryController OwnTest = new InventoryController();
+ OwnTest.size = 2;
+ OwnTest.init();
+ OwnTest.setCon.next();
+ OwnTest.refreshPageSize();
+ OwnTest.ConsumableorderdetailsRecordsview.sort();
+ system.assertEquals(0,OwnTest.consumableorderdetailsCount);
+ OwnTest.save();
+ }
+ }
+ static testMethod void InventoryControllerTest_ge(){
+ user MyUser_Test;
Account myAccount1;
- User thisUser = [SELECT Id FROM User WHERE Id = :UserInfo.getUserId()];
- System.runAs(thisUser) {
- Profile prof1 = [
- SELECT Id
- FROM Profile
- WHERE Name = '901_缁忛攢鍟嗙ぞ鍖烘櫘閫氭潈闄恄2閲嶉獙璇�(ET Email)'
- ];
- List<RecordType> rectCo = [
- SELECT Id
- FROM RecordType
- WHERE IsActive = TRUE AND SobjectType = 'Account' AND Name = '璨╁2搴�'
- ];
- if (rectCo.size() == 0) {
- return;
- }
- StaticParameter.EscapeConsumableOrderDetail2Trigger = true;
-
- RecordType rectCoO = [
- SELECT Id
- FROM RecordType
- WHERE IsActive = TRUE AND SobjectType = 'Account' AND Name = '鐥呴櫌'
- ];
- Account olympus = new Account(RecordTypeId = rectCoO.Id, AgentCode_Ext__c = '9999900', Name = 'olympus');
- insert olympus;
- myAccount1 = new Account(
- name = 'Testaccount001',
- Dealer_discount__c = 10,
- RecordTypeId = rectCo[0].Id,
- AgentCode_Ext__c = '8888888'
- );
- insert myAccount1;
- Contact core = new Contact(
- email = 'jplumber@salesforce.com',
- firstname = 'Joe',
- lastname = 'Plumber',
- accountid = myAccount1.id
- );
- insert core;
- MyUser_Test = new User(
- ContactId = core.id,
- Alias = 'newUser',
- Email = 'newuser@testorg.com',
- EmailEncodingKey = 'UTF-8',
- LastName = 'TestUser',
- LanguageLocaleKey = 'zh_CN',
- LocaleSidKey = 'zh_CN',
- ProfileId = prof1.Id,
- TimeZoneSidKey = 'Asia/Shanghai',
- UserName = 'testUser@testorg.com'
- );
- insert MyUser_Test;
+ User thisUser = [ select Id from User where Id = :UserInfo.getUserId()];
+ system.runAs(thisUser){
+
+
+ Profile prof1 = [select Id from Profile where Name ='901_缁忛攢鍟嗙ぞ鍖烘櫘閫氭潈闄恄2閲嶉獙璇�(ET Email)'];
+ List<RecordType> rectCo = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '璨╁2搴�'];
+ if (rectCo.size() == 0) {
+ return;
}
- System.runAs(MyUser_Test) {
- Product2 prod07 = new Product2(
- Name = 'Test07',
- ProductCode = 'Test07',
- Asset_Model_No__c = 'Test07',
- SFDA_Status__c = '鏈夊姽',
- Dealer_special_Object__c = true,
- Packing_list_manual__c = 1,
- Manual_Entry__c = false
- );
- Product2 prod08 = new Product2(
- Name = 'Test08',
- ProductCode = 'Test08',
- Asset_Model_No__c = 'Test08',
- SFDA_Status__c = '鏈夊姽',
- Dealer_special_Object__c = true,
- Packing_list_manual__c = 1,
- Manual_Entry__c = false
- );
- Product2 prod09 = new Product2(
- Name = 'Test09',
- ProductCode = 'Test09',
- Asset_Model_No__c = 'Test09',
- SFDA_Status__c = '鏈夊姽',
- Dealer_special_Object__c = true,
- Packing_list_manual__c = 1,
- Manual_Entry__c = false
- );
- insert new List<Product2>{ prod07, prod08, prod09 };
+ StaticParameter.EscapeConsumableOrderDetail2Trigger = true;
+
+ RecordType rectCoO = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '鐥呴櫌'];
+ Account olympus = new Account(RecordTypeId = rectCoO.Id, AgentCode_Ext__c = '9999900', Name = 'olympus');
+ insert olympus;
+ myAccount1 = new Account(name='Testaccount001',Dealer_discount__c =10,RecordTypeId = rectCo[0].Id,AgentCode_Ext__c = '8888888');
+ insert myAccount1;
+ Contact core = new Contact(email='jplumber@salesforce.com', firstname='Joe',lastname='Plumber',accountid=myAccount1.id);
+ insert core;
+ MyUser_Test = New User(ContactId = core.id,Alias = 'newUser',Email='newuser@testorg.com',EmailEncodingKey='UTF-8', LastName='TestUser', LanguageLocaleKey='zh_CN',LocaleSidKey='zh_CN', ProfileId = prof1.Id,TimeZoneSidKey='Asia/Shanghai', UserName='testUser@testorg.com');
+ insert MyUser_Test;
+ }
+ system.runAs(MyUser_Test){
+
+ Product2 prod07 = new Product2(Name='Test07',ProductCode='Test07',Asset_Model_No__c = 'Test07',SFDA_Status__c = '鏈夊姽',Dealer_special_Object__c = true,Packing_list_manual__c = 1,Manual_Entry__c = false);
+ Product2 prod08 = new Product2(Name='Test08',ProductCode='Test08',Asset_Model_No__c = 'Test08',SFDA_Status__c = '鏈夊姽',Dealer_special_Object__c = true,Packing_list_manual__c = 1,Manual_Entry__c = false);
+ Product2 prod09 = new Product2(Name='Test09',ProductCode='Test09',Asset_Model_No__c = 'Test09',SFDA_Status__c = '鏈夊姽',Dealer_special_Object__c = true,Packing_list_manual__c = 1,Manual_Entry__c = false);
+ insert new Product2[] {prod07,prod08,prod09};
- //鍒朵綔浜у搧
- Product2__c proG = new Product2__c(Name = 'MH-155:鐧藉钩琛″附', OT_CODE_Text__c = 'Test001', Product2__c = prod07.Id);
- insert proG;
- Product2__c proH = new Product2__c(Name = 'MB-677:BNC鐢电紗', OT_CODE_Text__c = 'Test002', Product2__c = prod08.Id);
- insert proH;
- Product2__c proF = new Product2__c(Name = 'TooMAJ-643R:姘村泭闉樼003', OT_CODE_Text__c = 'Test003', Product2__c = prod09.Id);
- insert proF;
-
- //棰勫埗澶存槑缁�
- Consumable_order__c CreateId = new Consumable_order__c();
- CreateId.Name = 'testMing';
- CreateId.Order_status__c = '鑽夋涓�';
- CreateId.RecordTypeid = System.Label.RT_ConOrder_Order;
- CreateId.Dealer_Info__c = myAccount1.id;
- CreateId.Inventory_date__c = Date.today();
- CreateId.Order_type__c = '鐩樼偣';
- CreateId.Order_ProType__c = 'ET';
- insert CreateId;
- List<Consumable_order_details2__c> orderList = new List<Consumable_order_details2__c>();
-
- //鍒朵綔Consumable_order_details__c-------ProductCount
- Consumable_order_details2__c dataForProductCount9 = new Consumable_order_details2__c();
- dataForProductCount9.Bar_Code__c = '1234567890';
- dataForProductCount9.Sterilization_limit__c = Date.today().addDays(2);
- dataForProductCount9.Arrive_date__c = Date.today();
- dataForProductCount9.RecordTypeid = System.Label.RT_ConOrderDetail2_Delivery;
- dataForProductCount9.Consumable_Product__c = proG.id;
- dataForProductCount9.Asset_Model_No__c = proG.Asset_Model_No__c;
- dataForProductCount9.Box_Piece__c = '涓�';
+ //鍒朵綔浜у搧
+ Product2__c proG = new Product2__c(Name='MH-155:鐧藉钩琛″附',OT_CODE_Text__c='Test001',Product2__c = prod07.Id);
+ insert proG;
+ Product2__c proH = new Product2__c(Name='MB-677:BNC鐢电紗',OT_CODE_Text__c='Test002',Product2__c = prod08.Id);
+ insert proH;
+ Product2__c proF = new Product2__c(Name='TooMAJ-643R:姘村泭闉樼003',OT_CODE_Text__c='Test003',Product2__c = prod09.Id);
+ insert proF;
+
+ //棰勫埗澶存槑缁�
+ Consumable_order__c CreateId = new Consumable_order__c();
+ CreateId.Name = 'testMing';
+ CreateId.Order_status__c = '鑽夋涓�';
+ CreateId.RecordTypeid = System.Label.RT_ConOrder_Order;
+ CreateId.Dealer_Info__c = myAccount1.id;
+ CreateId.Inventory_date__c = Date.today();
+ CreateId.Order_type__c = '鐩樼偣';
+ CreateId.Order_ProType__c = 'ET';
+ insert CreateId;
+ List<Consumable_order_details2__c> orderList = new List<Consumable_order_details2__c>();
+
+
+ //鍒朵綔Consumable_order_details__c-------ProductCount
+ Consumable_order_details2__c dataForProductCount9 = new Consumable_order_details2__c();
+ dataForProductCount9.Bar_Code__c = '1234567890';
+ dataForProductCount9.Sterilization_limit__c = Date.today().addDays(2);
+ dataForProductCount9.Arrive_date__c = Date.today();
+ dataForProductCount9.RecordTypeid = System.Label.RT_ConOrderDetail2_Delivery;
+ dataForProductCount9.Consumable_Product__c = proG.id;
+ dataForProductCount9.Asset_Model_No__c = proG.Asset_Model_No__c;
+ dataForProductCount9.Box_Piece__c = '涓�';
dataForProductCount9.RemoveBox_No__c = 1;
- orderList.add(dataForProductCount9);
+ orderList.add(dataForProductCount9);
- Consumable_order_details2__c dataForProductCount8 = new Consumable_order_details2__c();
- dataForProductCount8.Bar_Code__c = '1234567891';
- dataForProductCount8.Sterilization_limit__c = Date.today().addDays(2);
- dataForProductCount8.Arrive_date__c = Date.today();
- dataForProductCount8.RecordTypeid = System.Label.RT_ConOrderDetail2_Delivery;
- dataForProductCount8.Consumable_Product__c = proG.id;
- dataForProductCount8.Asset_Model_No__c = proG.Asset_Model_No__c;
- orderList.add(dataForProductCount8);
+ Consumable_order_details2__c dataForProductCount8 = new Consumable_order_details2__c();
+ dataForProductCount8.Bar_Code__c = '1234567891';
+ dataForProductCount8.Sterilization_limit__c = Date.today().addDays(2);
+ dataForProductCount8.Arrive_date__c = Date.today();
+ dataForProductCount8.RecordTypeid = System.Label.RT_ConOrderDetail2_Delivery;
+ dataForProductCount8.Consumable_Product__c = proG.id;
+ dataForProductCount8.Asset_Model_No__c = proG.Asset_Model_No__c;
+ orderList.add(dataForProductCount8);
- Consumable_order_details2__c dataForProductCount7 = new Consumable_order_details2__c();
- dataForProductCount7.Bar_Code__c = '1234567892';
- dataForProductCount7.Sterilization_limit__c = Date.today().addDays(2);
- dataForProductCount7.Arrive_date__c = Date.today();
- dataForProductCount7.RecordTypeid = System.Label.RT_ConOrderDetail2_Delivery;
- dataForProductCount7.Consumable_Product__c = proH.id;
- dataForProductCount7.Asset_Model_No__c = proH.Asset_Model_No__c;
- dataForProductCount7.Box_Piece__c = '涓�';
- dataForProductCount7.Consumable_order_minor__c = CreateId.id;
- dataForProductCount7.Send_Date__c = null;
+ Consumable_order_details2__c dataForProductCount7 = new Consumable_order_details2__c();
+ dataForProductCount7.Bar_Code__c = '1234567892';
+ dataForProductCount7.Sterilization_limit__c = Date.today().addDays(2);
+ dataForProductCount7.Arrive_date__c = Date.today();
+ dataForProductCount7.RecordTypeid = System.Label.RT_ConOrderDetail2_Delivery;
+ dataForProductCount7.Consumable_Product__c = proH.id;
+ dataForProductCount7.Asset_Model_No__c = proH.Asset_Model_No__c;
+ dataForProductCount7.Box_Piece__c = '涓�';
+ dataForProductCount7.Consumable_order_minor__c = CreateId.id;
+ dataForProductCount7.Send_Date__c = null;
dataForProductCount7.Used_date__c = null;
dataForProductCount7.Lose_Flag__c = false;
dataForProductCount7.RemoveBox_No__c = 1;
- orderList.add(dataForProductCount7);
-
- Consumable_order_details2__c dataForProduct = new Consumable_order_details2__c();
- dataForProduct.Bar_Code__c = '1234567894';
- dataForProduct.Sterilization_limit__c = Date.today().addDays(2);
- dataForProduct.Arrive_date__c = Date.today();
- dataForProduct.RecordTypeid = System.Label.RT_ConOrderDetail2_Delivery;
- dataForProduct.Consumable_Product__c = proF.id;
- dataForProduct.Asset_Model_No__c = proF.Asset_Model_No__c;
- dataForProduct.Box_Piece__c = '涓�';
- dataForProduct.Consumable_order_minor__c = CreateId.id;
- dataForProduct.Send_Date__c = null;
+ orderList.add(dataForProductCount7);
+
+ Consumable_order_details2__c dataForProduct = new Consumable_order_details2__c();
+ dataForProduct.Bar_Code__c = '1234567894';
+ dataForProduct.Sterilization_limit__c = Date.today().addDays(2);
+ dataForProduct.Arrive_date__c = Date.today();
+ dataForProduct.RecordTypeid = System.Label.RT_ConOrderDetail2_Delivery;
+ dataForProduct.Consumable_Product__c = proF.id;
+ dataForProduct.Asset_Model_No__c = proF.Asset_Model_No__c;
+ dataForProduct.Box_Piece__c = '涓�';
+ dataForProduct.Consumable_order_minor__c = CreateId.id;
+ dataForProduct.Send_Date__c = null;
dataForProduct.Used_date__c = null;
dataForProduct.Lose_Flag__c = false;
dataForProduct.RemoveBox_No__c = 1;
- orderList.add(dataForProduct);
-
- Consumable_order_details2__c dataForProductCount3 = new Consumable_order_details2__c();
- dataForProductCount3.Bar_Code__c = '1234567883';
- dataForProductCount3.Sterilization_limit__c = Date.today().addDays(2);
- dataForProductCount3.Arrive_date__c = Date.today();
- dataForProductCount3.RecordTypeid = System.Label.RT_ConOrderDetail2_Delivery;
- dataForProductCount3.Consumable_Product__c = proG.id;
- dataForProductCount3.Asset_Model_No__c = proG.Asset_Model_No__c;
- dataForProductCount3.Consumable_order_minor__c = CreateId.id;
+ orderList.add(dataForProduct);
+
+ Consumable_order_details2__c dataForProductCount3 = new Consumable_order_details2__c();
+ dataForProductCount3.Bar_Code__c = '1234567883';
+ dataForProductCount3.Sterilization_limit__c = Date.today().addDays(2);
+ dataForProductCount3.Arrive_date__c = Date.today();
+ dataForProductCount3.RecordTypeid = System.Label.RT_ConOrderDetail2_Delivery;
+ dataForProductCount3.Consumable_Product__c = proG.id;
+ dataForProductCount3.Asset_Model_No__c = proG.Asset_Model_No__c;
+ dataForProductCount3.Consumable_order_minor__c = CreateId.id;
dataForProductCount3.Lose_Flag__c = true;
//dataForProductCount3.RemoveBox_No__c = 1;
- orderList.add(dataForProductCount3);
-
+ orderList.add(dataForProductCount3);
+
+
PageReference page = new Pagereference('/Inventory');
page.setRedirect(true);
System.Test.setCurrentPage(page);
- System.Test.startTest();
- LexInventoryController controller = new LexInventoryController();
- LexInventoryController.init();
- System.debug('===>鍊�1' + LexInventoryController.consumableorderdetailsRecords);
- System.debug('===>鍊�2' + JSON.serialize(LexInventoryController.consumableorderdetailsRecords));
- System.debug('===>2222222' + JSON.serialize(LexInventoryController.consumableorderdetailsRecords));
- List<LexInventoryController.ConsumableorderdetailsInfo> testList = LexInventoryController.consumableorderdetailsRecords;
- List<LexInventoryController.ConsumableorderdetailsInfo> testList1 = new List<LexInventoryController.ConsumableorderdetailsInfo>();
- System.debug('testCount:' + testList.size());
- for (LexInventoryController.ConsumableorderdetailsInfo ass : testList) {
- System.debug(ass.check);
- ass.check = true;
- testList1.add(ass);
- }
- System.debug('testList1:' + testList1);
+ System.Test.startTest();
+ LexInventoryController controller = new LexInventoryController();
+ LexInventoryController.init();
+ System.debug('===>鍊�1'+LexInventoryController.consumableorderdetailsRecords);
+ System.debug('===>鍊�2'+ JSON.serialize(LexInventoryController.consumableorderdetailsRecords));
+ System.debug('===>2222222'+JSON.serialize(LexInventoryController.consumableorderdetailsRecords));
+ List<LexInventoryController.ConsumableorderdetailsInfo> testList = LexInventoryController.consumableorderdetailsRecords;
+ List<LexInventoryController.ConsumableorderdetailsInfo> testList1 = new List<LexInventoryController.ConsumableorderdetailsInfo>();
+ System.debug('testCount:'+testList.size());
+ for(LexInventoryController.ConsumableorderdetailsInfo ass : testList){
+ System.debug(ass.check);
+ ass.check = true;
+ testList1.add(ass);
+ }
+ System.debug('testList1:'+testList1);
- LexInventoryController.searchConsumableorderdetails(
- 'ET',
- '涓婃捣',
- 'Testaccount001',
- '12345678856\n1234567895\n1234567890\n12345678511\n1234567856\n1234567855\n1234567886\n12345678551\n1234567890\n1234567883\n1234567882\n1234567881\n1234567884\nn123456788412\n1234567885\n123456788512\n1234567891\n1234567892\n1234567893\n1234567894',
- JSON.serialize(testList1),
- 1,
- 0,
- 'Test',
- 'ASC'
- );
- System.Test.stopTest();
- }
- }
- static testMethod void InventoryControllerTest_xunhui() {
- user MyUser_Test;
+ LexInventoryController.searchConsumableorderdetails('ET','涓婃捣','Testaccount001','12345678856\n1234567895\n1234567890\n12345678511\n1234567856\n1234567855\n1234567886\n12345678551\n1234567890\n1234567883\n1234567882\n1234567881\n1234567884\nn123456788412\n1234567885\n123456788512\n1234567891\n1234567892\n1234567893\n1234567894',JSON.serialize(testList1),1,0,'Test','ASC');
+ System.Test.stopTest();
+ }
+ }
+ static testMethod void InventoryControllerTest_xunhui(){
+ user MyUser_Test;
Account myAccount1;
- User thisUser = [SELECT Id FROM User WHERE Id = :UserInfo.getUserId()];
- System.runAs(thisUser) {
- Profile prof1 = [
- SELECT Id
- FROM Profile
- WHERE Name = '901_缁忛攢鍟嗙ぞ鍖烘櫘閫氭潈闄恄2閲嶉獙璇�(ET Email)'
- ];
- List<RecordType> rectCo = [
- SELECT Id
- FROM RecordType
- WHERE IsActive = TRUE AND SobjectType = 'Account' AND Name = '璨╁2搴�'
- ];
- if (rectCo.size() == 0) {
- return;
- }
- StaticParameter.EscapeOrderDetail2Trigger = true;
- StaticParameter.EscapeConsumableOrderDetail2Trigger = true;
- RecordType rectCoO = [
- SELECT Id
- FROM RecordType
- WHERE IsActive = TRUE AND SobjectType = 'Account' AND Name = '鐥呴櫌'
- ];
- Account olympus = new Account(RecordTypeId = rectCoO.Id, AgentCode_Ext__c = '9999900', Name = 'olympus');
- insert olympus;
- myAccount1 = new Account(
- name = 'Testaccount001',
- Dealer_discount__c = 10,
- RecordTypeId = rectCo[0].Id,
- AgentCode_Ext__c = '8888888'
- );
- insert myAccount1;
- Contact core = new Contact(
- email = 'jplumber@salesforce.com',
- firstname = 'Joe',
- lastname = 'Plumber',
- accountid = myAccount1.id
- );
- insert core;
- MyUser_Test = new User(
- ContactId = core.id,
- Alias = 'newUser',
- Email = 'newuser@testorg.com',
- EmailEncodingKey = 'UTF-8',
- LastName = 'TestUser',
- LanguageLocaleKey = 'zh_CN',
- LocaleSidKey = 'zh_CN',
- ProfileId = prof1.Id,
- TimeZoneSidKey = 'Asia/Shanghai',
- UserName = 'testUser@testorg.com'
- );
- insert MyUser_Test;
+ User thisUser = [ select Id from User where Id = :UserInfo.getUserId()];
+ system.runAs(thisUser){
+ Profile prof1 = [select Id from Profile where Name ='901_缁忛攢鍟嗙ぞ鍖烘櫘閫氭潈闄恄2閲嶉獙璇�(ET Email)'];
+ List<RecordType> rectCo = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '璨╁2搴�'];
+ if (rectCo.size() == 0) {
+ return;
}
- System.runAs(MyUser_Test) {
- Product2 prod07 = new Product2(
- Name = 'Test07',
- ProductCode = 'Test07',
- Asset_Model_No__c = 'Test07',
- SFDA_Status__c = '鏈夊姽',
- Dealer_special_Object__c = true,
- Packing_list_manual__c = 1,
- Manual_Entry__c = false
- );
- Product2 prod08 = new Product2(
- Name = 'Test08',
- ProductCode = 'Test08',
- Asset_Model_No__c = 'Test08',
- SFDA_Status__c = '鏈夊姽',
- Dealer_special_Object__c = true,
- Packing_list_manual__c = 1,
- Manual_Entry__c = false
- );
- Product2 prod09 = new Product2(
- Name = 'Test09',
- ProductCode = 'Test09',
- Asset_Model_No__c = 'Test09',
- SFDA_Status__c = '鏈夊姽',
- Dealer_special_Object__c = true,
- Packing_list_manual__c = 1,
- Manual_Entry__c = false
- );
- insert new List<Product2>{ prod07, prod08, prod09 };
+ StaticParameter.EscapeOrderDetail2Trigger = true;
+ StaticParameter.EscapeConsumableOrderDetail2Trigger = true;
+ RecordType rectCoO = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '鐥呴櫌'];
+ Account olympus = new Account(RecordTypeId = rectCoO.Id, AgentCode_Ext__c = '9999900', Name = 'olympus');
+ insert olympus;
+ myAccount1 = new Account(name='Testaccount001',Dealer_discount__c =10,RecordTypeId = rectCo[0].Id,AgentCode_Ext__c = '8888888');
+ insert myAccount1;
+ Contact core = new Contact(email='jplumber@salesforce.com', firstname='Joe',lastname='Plumber',accountid=myAccount1.id);
+ insert core;
+ MyUser_Test = New User(ContactId = core.id,Alias = 'newUser',Email='newuser@testorg.com',EmailEncodingKey='UTF-8', LastName='TestUser', LanguageLocaleKey='zh_CN',LocaleSidKey='zh_CN', ProfileId = prof1.Id,TimeZoneSidKey='Asia/Shanghai', UserName='testUser@testorg.com');
+ insert MyUser_Test;
+ }
+ system.runAs(MyUser_Test){
+
+ Product2 prod07 = new Product2(Name='Test07',ProductCode='Test07',Asset_Model_No__c = 'Test07',SFDA_Status__c = '鏈夊姽',Dealer_special_Object__c = true,Packing_list_manual__c = 1,Manual_Entry__c = false);
+ Product2 prod08 = new Product2(Name='Test08',ProductCode='Test08',Asset_Model_No__c = 'Test08',SFDA_Status__c = '鏈夊姽',Dealer_special_Object__c = true,Packing_list_manual__c = 1,Manual_Entry__c = false);
+ Product2 prod09 = new Product2(Name='Test09',ProductCode='Test09',Asset_Model_No__c = 'Test09',SFDA_Status__c = '鏈夊姽',Dealer_special_Object__c = true,Packing_list_manual__c = 1,Manual_Entry__c = false);
+ insert new Product2[] {prod07,prod08,prod09};
- //鍒朵綔浜у搧
- Product2__c proG = new Product2__c(Name = 'MH-155:鐧藉钩琛″附', OT_CODE_Text__c = 'Test001', Product2__c = prod07.Id);
- insert proG;
- Product2__c proH = new Product2__c(Name = 'MB-677:BNC鐢电紗', OT_CODE_Text__c = 'Test002', Product2__c = prod08.Id);
- insert proH;
- Product2__c proF = new Product2__c(Name = 'TooMAJ-643R:姘村泭闉樼003', OT_CODE_Text__c = 'Test003', Product2__c = prod09.Id);
- insert proF;
-
- //棰勫埗澶存槑缁�
- Consumable_order__c CreateId = new Consumable_order__c();
- CreateId.Name = 'testMing';
- CreateId.Order_status__c = '鑽夋涓�';
- CreateId.RecordTypeid = System.Label.RT_ConOrder_Order;
- CreateId.Dealer_Info__c = myAccount1.id;
- CreateId.Inventory_date__c = Date.today();
- CreateId.Order_type__c = '鐩樼偣';
- CreateId.Order_ProType__c = 'ET';
- insert CreateId;
- List<Consumable_order__c> orderList = new List<Consumable_order__c>();
- //鍒拌揣
+ //鍒朵綔浜у搧
+ Product2__c proG = new Product2__c(Name='MH-155:鐧藉钩琛″附',OT_CODE_Text__c='Test001',Product2__c = prod07.Id);
+ insert proG;
+ Product2__c proH = new Product2__c(Name='MB-677:BNC鐢电紗',OT_CODE_Text__c='Test002',Product2__c = prod08.Id);
+ insert proH;
+ Product2__c proF = new Product2__c(Name='TooMAJ-643R:姘村泭闉樼003',OT_CODE_Text__c='Test003',Product2__c = prod09.Id);
+ insert proF;
+
+ //棰勫埗澶存槑缁�
+ Consumable_order__c CreateId = new Consumable_order__c();
+ CreateId.Name = 'testMing';
+ CreateId.Order_status__c = '鑽夋涓�';
+ CreateId.RecordTypeid = System.Label.RT_ConOrder_Order;
+ CreateId.Dealer_Info__c = myAccount1.id;
+ CreateId.Inventory_date__c = Date.today();
+ CreateId.Order_type__c = '鐩樼偣';
+ CreateId.Order_ProType__c = 'ET';
+ insert CreateId;
+ List<Consumable_order__c> orderList = new List<Consumable_order__c>();
+ //鍒拌揣
Consumable_order__c Order1 = new Consumable_order__c();
Order1.Name = 'OCM_01';
Order1.Order_status__c = '鎵瑰噯';
@@ -681,407 +442,289 @@
orderList.add(Order2);
insert orderList;
- //鍒朵綔Consumable_order_details__c-------ProductCount
- Consumable_order_details2__c dataForProductCount9 = new Consumable_order_details2__c();
- dataForProductCount9.Bar_Code__c = '1234567890';
- dataForProductCount9.Sterilization_limit__c = Date.today().addDays(2);
- dataForProductCount9.Arrive_date__c = Date.today();
- dataForProductCount9.RecordTypeid = System.Label.RT_ConOrderDetail2_Delivery;
- dataForProductCount9.Consumable_Product__c = proG.id;
- dataForProductCount9.Asset_Model_No__c = proG.Asset_Model_No__c;
- dataForProductCount9.Box_Piece__c = '鐩�';
- dataForProductCount9.Consumable_order_minor__c = CreateId.id;
- dataForProductCount9.Send_Date__c = null;
+
+
+ //鍒朵綔Consumable_order_details__c-------ProductCount
+ Consumable_order_details2__c dataForProductCount9 = new Consumable_order_details2__c();
+ dataForProductCount9.Bar_Code__c = '1234567890';
+ dataForProductCount9.Sterilization_limit__c = Date.today().addDays(2);
+ dataForProductCount9.Arrive_date__c = Date.today();
+ dataForProductCount9.RecordTypeid = System.Label.RT_ConOrderDetail2_Delivery;
+ dataForProductCount9.Consumable_Product__c = proG.id;
+ dataForProductCount9.Asset_Model_No__c = proG.Asset_Model_No__c;
+ dataForProductCount9.Box_Piece__c = '鐩�';
+ dataForProductCount9.Consumable_order_minor__c = CreateId.id;
+ dataForProductCount9.Send_Date__c = null;
dataForProductCount9.Used_date__c = null;
dataForProductCount9.Lose_Flag__c = false;
dataForProductCount9.RemoveBox_No__c = 1;
- insert dataForProductCount9;
+ insert dataForProductCount9;
- Consumable_order_details2__c dataForProductCount8 = new Consumable_order_details2__c();
- dataForProductCount8.Bar_Code__c = '1234567891';
- dataForProductCount8.Sterilization_limit__c = Date.today().addDays(2);
- dataForProductCount8.Arrive_date__c = Date.today();
- dataForProductCount8.RecordTypeid = System.Label.RT_ConOrderDetail2_Delivery;
- dataForProductCount8.Consumable_Product__c = proG.id;
- dataForProductCount8.Asset_Model_No__c = proG.Asset_Model_No__c;
- dataForProductCount8.Box_Piece__c = '鐩�';
- dataForProductCount8.Consumable_order_minor__c = CreateId.id;
- dataForProductCount8.Send_Date__c = null;
+ Consumable_order_details2__c dataForProductCount8 = new Consumable_order_details2__c();
+ dataForProductCount8.Bar_Code__c = '1234567891';
+ dataForProductCount8.Sterilization_limit__c = Date.today().addDays(2);
+ dataForProductCount8.Arrive_date__c = Date.today();
+ dataForProductCount8.RecordTypeid = System.Label.RT_ConOrderDetail2_Delivery;
+ dataForProductCount8.Consumable_Product__c = proG.id;
+ dataForProductCount8.Asset_Model_No__c = proG.Asset_Model_No__c;
+ dataForProductCount8.Box_Piece__c = '鐩�';
+ dataForProductCount8.Consumable_order_minor__c = CreateId.id;
+ dataForProductCount8.Send_Date__c = null;
dataForProductCount8.Used_date__c = null;
dataForProductCount8.Lose_Flag__c = false;
dataForProductCount8.RemoveBox_No__c = 1;
- insert dataForProductCount8;
+ insert dataForProductCount8;
- Consumable_order_details2__c dataForProductCount7 = new Consumable_order_details2__c();
- dataForProductCount7.Bar_Code__c = '1234567892';
- dataForProductCount7.Sterilization_limit__c = Date.today().addDays(2);
- dataForProductCount7.Arrive_date__c = Date.today();
- dataForProductCount7.RecordTypeid = System.Label.RT_ConOrderDetail2_Delivery;
- dataForProductCount7.Consumable_Product__c = proH.id;
- dataForProductCount7.Asset_Model_No__c = proH.Asset_Model_No__c;
- dataForProductCount7.Box_Piece__c = '涓�';
- dataForProductCount7.Consumable_order_minor__c = CreateId.id;
- dataForProductCount7.Send_Date__c = null;
+ Consumable_order_details2__c dataForProductCount7 = new Consumable_order_details2__c();
+ dataForProductCount7.Bar_Code__c = '1234567892';
+ dataForProductCount7.Sterilization_limit__c = Date.today().addDays(2);
+ dataForProductCount7.Arrive_date__c = Date.today();
+ dataForProductCount7.RecordTypeid = System.Label.RT_ConOrderDetail2_Delivery;
+ dataForProductCount7.Consumable_Product__c = proH.id;
+ dataForProductCount7.Asset_Model_No__c = proH.Asset_Model_No__c;
+ dataForProductCount7.Box_Piece__c = '涓�';
+ dataForProductCount7.Consumable_order_minor__c = CreateId.id;
+ dataForProductCount7.Send_Date__c = null;
dataForProductCount7.Used_date__c = null;
dataForProductCount7.Lose_Flag__c = false;
dataForProductCount7.RemoveBox_No__c = 1;
- insert dataForProductCount7;
+ insert dataForProductCount7;
- Consumable_order_details2__c dataForProductCount6 = new Consumable_order_details2__c();
- dataForProductCount6.Bar_Code__c = '1234567893';
- dataForProductCount6.Sterilization_limit__c = Date.today().addDays(2);
- dataForProductCount6.Arrive_date__c = Date.today();
- dataForProductCount6.RecordTypeid = System.Label.RT_ConOrderDetail2_Delivery;
- dataForProductCount6.Consumable_Product__c = proH.id;
- dataForProductCount6.Asset_Model_No__c = proH.Asset_Model_No__c;
- dataForProductCount6.Box_Piece__c = '涓�';
- dataForProductCount6.Consumable_order_minor__c = CreateId.id;
- dataForProductCount6.Send_Date__c = null;
+ Consumable_order_details2__c dataForProductCount6 = new Consumable_order_details2__c();
+ dataForProductCount6.Bar_Code__c = '1234567893';
+ dataForProductCount6.Sterilization_limit__c = Date.today().addDays(2);
+ dataForProductCount6.Arrive_date__c = Date.today();
+ dataForProductCount6.RecordTypeid = System.Label.RT_ConOrderDetail2_Delivery;
+ dataForProductCount6.Consumable_Product__c = proH.id;
+ dataForProductCount6.Asset_Model_No__c = proH.Asset_Model_No__c;
+ dataForProductCount6.Box_Piece__c = '涓�';
+ dataForProductCount6.Consumable_order_minor__c = CreateId.id;
+ dataForProductCount6.Send_Date__c = null;
dataForProductCount6.Used_date__c = null;
dataForProductCount6.Lose_Flag__c = false;
dataForProductCount6.RemoveBox_No__c = 1;
- insert dataForProductCount6;
+ insert dataForProductCount6;
- Consumable_order_details2__c dataForProductCount5 = new Consumable_order_details2__c();
- dataForProductCount5.Bar_Code__c = '1234567894';
- dataForProductCount5.Sterilization_limit__c = Date.today().addDays(2);
- dataForProductCount5.Arrive_date__c = Date.today();
- dataForProductCount5.RecordTypeid = System.Label.RT_ConOrderDetail2_Delivery;
- dataForProductCount5.Consumable_Product__c = proH.id;
- dataForProductCount5.Asset_Model_No__c = proH.Asset_Model_No__c;
- dataForProductCount5.Box_Piece__c = '涓�';
- dataForProductCount5.Consumable_order_minor__c = CreateId.id;
- dataForProductCount5.Send_Date__c = null;
+ Consumable_order_details2__c dataForProductCount5 = new Consumable_order_details2__c();
+ dataForProductCount5.Bar_Code__c = '1234567894';
+ dataForProductCount5.Sterilization_limit__c = Date.today().addDays(2);
+ dataForProductCount5.Arrive_date__c = Date.today();
+ dataForProductCount5.RecordTypeid = System.Label.RT_ConOrderDetail2_Delivery;
+ dataForProductCount5.Consumable_Product__c = proH.id;
+ dataForProductCount5.Asset_Model_No__c = proH.Asset_Model_No__c;
+ dataForProductCount5.Box_Piece__c = '涓�';
+ dataForProductCount5.Consumable_order_minor__c = CreateId.id;
+ dataForProductCount5.Send_Date__c = null;
dataForProductCount5.Used_date__c = null;
dataForProductCount5.Lose_Flag__c = false;
dataForProductCount5.RemoveBox_No__c = 1;
- insert dataForProductCount5;
+ insert dataForProductCount5;
- List<Consumable_order_details2__c> conlist = new List<Consumable_order_details2__c>();
- //Barcode妫�绱� 鎵�鏈夊湪搴�
- Consumable_order_details2__c con1 = new Consumable_order_details2__c();
- con1.Lose_Flag__c = false;
- con1.Arrive_date__c = Date.today();
- con1.Send_Date__c = null;
- con1.Return_date__c = null;
- con1.Lose_Flag__c = false;
- con1.Cancellation_Date__c = null;
- con1.Sterilization_limit__c = Date.today().addDays(2);
- con1.Bar_Code__c = '123';
- con1.Box_Piece__c = '鐩�';
- con1.Bar_Code__c = '1234567894';
- con1.Sterilization_limit__c = Date.today().addDays(2);
- con1.RecordTypeid = System.Label.RT_ConOrderDetail2_Delivery;
- con1.Consumable_Product__c = proH.id;
- con1.Consumable_order_minor__c = CreateId.id;
- conlist.add(con1);
+ List<Consumable_order_details2__c> conlist = new List<Consumable_order_details2__c>();
+ //Barcode妫�绱� 鎵�鏈夊湪搴�
+ Consumable_order_details2__c con1 = new Consumable_order_details2__c();
+ con1.Lose_Flag__c = false;
+ con1.Arrive_date__c = Date.today();
+ con1.Send_Date__c = null;
+ con1.Return_date__c = null;
+ con1.Lose_Flag__c = false;
+ con1.Cancellation_Date__c = null;
+ con1.Sterilization_limit__c = Date.today().addDays(2);
+ con1.Bar_Code__c = '123';
+ con1.Box_Piece__c = '鐩�';
+ con1.Bar_Code__c = '1234567894';
+ con1.Sterilization_limit__c = Date.today().addDays(2);
+ con1.RecordTypeid = System.Label.RT_ConOrderDetail2_Delivery;
+ con1.Consumable_Product__c = proH.id;
+ con1.Consumable_order_minor__c = CreateId.id;
+ conlist.add(con1);
- //鏌ヨ搴撳瓨 杩藉姞杩斿搧搴撳瓨
- Consumable_order_details2__c con3 = new Consumable_order_details2__c();
- con3.Consumable_Product__c = proH.id;
- con3.Bar_Code__c = '1001';
- con3.Consumable_Arrived_order__c = Order1.id;
- con3.Consumable_order_minor__c = Order2.id;
- con3.Arrive_date__c = Date.today();
- con3.Send_Date__c = null;
- con3.Return_date__c = null;
- con3.Lose_Flag__c = false;
- con3.Cancellation_Flag__c = false;
- con3.Consumable_order_minor__c = CreateId.id;
- con3.Sterilization_limit__c = Date.today().addDays(2);
- con3.Box_Piece__c = '涓�';
- con3.RecordTypeid = '01210000000kUDKAA2';
- conlist.add(con3);
+ //鏌ヨ搴撳瓨 杩藉姞杩斿搧搴撳瓨
+ Consumable_order_details2__c con3 = new Consumable_order_details2__c();
+ con3.Consumable_Product__c = proH.id;
+ con3.Bar_Code__c = '1001';
+ con3.Consumable_Arrived_order__c = Order1.id;
+ con3.Consumable_order_minor__c = Order2.id;
+ con3.Arrive_date__c = Date.today();
+ con3.Send_Date__c = null;
+ con3.Return_date__c = null;
+ con3.Lose_Flag__c = false;
+ con3.Cancellation_Flag__c = false;
+ con3.Consumable_order_minor__c = CreateId.id;
+ con3.Sterilization_limit__c = Date.today().addDays(2);
+ con3.Box_Piece__c = '涓�';
+ con3.RecordTypeid = '01210000000kUDKAA2';
+ conlist.add(con3);
- //productAdjust
- Consumable_order_details2__c con6 = new Consumable_order_details2__c();
- con6.Consumable_Product__c = proH.id;
- con6.Lose_reason__c = '杩囨湡搴撳瓨閿�瀛�';
- con6.Box_Piece__c = '鐩�';
- con6.Sterilization_limit__c = Date.today().addDays(-2);
- con6.Bar_Code__c = '10011';
- con6.Consumable_Arrived_order__c = Order1.id;
- con6.Lose_Flag__c = true;
- con6.RecordTypeid = '01210000000kUDKAA2';
- conlist.add(con6);
- System.debug('conlist===>' + conlist);
+ //productAdjust
+ Consumable_order_details2__c con6 = new Consumable_order_details2__c();
+ con6.Consumable_Product__c = proH.id;
+ con6.Lose_reason__c = '杩囨湡搴撳瓨閿�瀛�';
+ con6.Box_Piece__c = '鐩�';
+ con6.Sterilization_limit__c = Date.today().addDays(-2);
+ con6.Bar_Code__c = '10011';
+ con6.Consumable_Arrived_order__c = Order1.id;
+ con6.Lose_Flag__c = true;
+ con6.RecordTypeid = '01210000000kUDKAA2';
+ conlist.add(con6);
+ System.debug('conlist===>'+conlist);
- //reset592
- Consumable_order_details2__c con4 = new Consumable_order_details2__c();
- con4.Arrive_date__c = Date.today();
- con4.Send_Date__c = null;
- con4.Return_date__c = null;
- con4.Lose_Flag__c = false;
- con4.Cancellation_Date__c = null;
- con4.Sterilization_limit__c = Date.today().addDays(2);
- con4.Bar_Code__c = '123456';
- con4.Box_Piece__c = '鐩�';
- // con2.Bar_Code__c = '1234567894';
- con4.Sterilization_limit__c = Date.today().addDays(2);
- con4.RecordTypeid = System.Label.RT_ConOrderDetail2_Delivery;
- con4.Consumable_Product__c = proH.id;
- // con2.Asset_Model_No__c = proH.Asset_Model_No__c;
- con4.Consumable_order_minor__c = CreateId.id;
- conlist.add(con4);
- //鏌ヨ搴撳瓨 杩藉姞杩斿搧搴撳瓨
- Consumable_order_details2__c con5 = new Consumable_order_details2__c();
- con5.Arrive_date__c = Date.today();
- con5.Send_Date__c = null;
- con5.Return_date__c = null;
- con5.Lose_Flag__c = false;
- con5.Cancellation_Flag__c = false;
- con5.Consumable_Product__c = proH.id;
- con5.Consumable_order_minor__c = Order2.id;
- // con5.Sterilization_limit__c = Date.today().addDays(2);
- con5.Box_Piece__c = '鐩�';
- con5.Bar_Code__c = '1001';
- conlist.add(con5);
- insert conlist;
+ //reset592
+ Consumable_order_details2__c con4 = new Consumable_order_details2__c();
+ con4.Arrive_date__c = Date.today();
+ con4.Send_Date__c = null;
+ con4.Return_date__c = null;
+ con4.Lose_Flag__c = false;
+ con4.Cancellation_Date__c =null;
+ con4.Sterilization_limit__c = Date.today().addDays(2);
+ con4.Bar_Code__c = '123456';
+ con4.Box_Piece__c = '鐩�';
+ // con2.Bar_Code__c = '1234567894';
+ con4.Sterilization_limit__c = Date.today().addDays(2);
+ con4.RecordTypeid = System.Label.RT_ConOrderDetail2_Delivery;
+ con4.Consumable_Product__c = proH.id;
+ // con2.Asset_Model_No__c = proH.Asset_Model_No__c;
+ con4.Consumable_order_minor__c = CreateId.id;
+ conlist.add(con4);
- System.Test.startTest();
- LexInventoryController inver = new LexInventoryController();
- LexInventoryController.init();
- List<LexInventoryController.ConsumableorderdetailsInfo> testList = LexInventoryController.consumableorderdetailsRecords;
- List<LexInventoryController.ConsumableorderdetailsInfo> testList1 = new List<LexInventoryController.ConsumableorderdetailsInfo>();
- System.debug('testCount:' + testList.size());
- for (LexInventoryController.ConsumableorderdetailsInfo ass : testList) {
- System.debug(ass.check);
- ass.check = true;
- testList1.add(ass);
- }
- System.debug('testList1:' + testList1);
- LexInventoryController.searchConsumableorderdetails(
- 'ET',
- '涓婃捣',
- 'Testaccount001',
- '',
- JSON.serialize(testList1),
- 20,
- 9,
- 'Test',
- 'ASC'
- );
- LexInventoryController.searchConsumableorderdetails(
- 'ET',
- '涓婃捣',
- 'Testaccount001',
- '01210000000kUDKAA2\n10011',
- JSON.serialize(testList1),
- 20,
- 9,
- 'Test',
- 'ASC'
- );
- LexInventoryController.searchConsumableorderdetails(
- 'ET',
- '涓婃捣',
- 'Testaccount001',
- '12345678856\n1234567895\n1234567890\n12345678511\n1234567856\n1234567855\n1234567886\n12345678551\n1234567890\n1234567883\n1234567882\n1234567881\n1234567884\nn123456788412\n1234567885\n123456788512\n1234567891\n1234567892\n1234567893\n1234567894\n1001',
- JSON.serialize(testList1),
- 1,
- 0,
- 'Test',
- 'ASC'
- );
- LexInventoryController.save(
- true,
- JSON.serialize(testList1),
- myAccount1.Id,
- 'ET',
- LexInventoryController.pandiandetailsMap,
- LexInventoryController.reSet
- );
- LexInventoryController.searchConsumableorderdetails(
- 'ET',
- '涓婃捣',
- 'Testaccount001',
- '',
- '[{"sortBy": null,"refind": 0,"ProdId": "a0l0l000004EisKAAS","Prod": {"attributes": {"type": "Product2__c","url": "/services/data/v58.0/sobjects/Product2__c/a0l0l000004EisKAAS"},"Id": "a0l0l000004EisKAAS","Name": "MH-155:鐧藉钩琛″附","Name__c": "Test07","SFDA_Status__c": "鍋滄","Packing_list_manual__c": 1,"Asset_Model_No__c": "Test07"},"Pandian": 0,"overlimitCount": 0,"orderdetails2": null,"orderdetails1": null,"limitCount": 2,"DiffReason": null,"Diff": 0,"countid": 2,"check": true,"canSelect": true,"boxPiece": "鐩�"}]',
- 20,
- 9,
- 'Test',
- 'ASC'
- );
+
+ //鏌ヨ搴撳瓨 杩藉姞杩斿搧搴撳瓨
+ Consumable_order_details2__c con5 = new Consumable_order_details2__c();
+ con5.Arrive_date__c = Date.today();
+ con5.Send_Date__c = null;
+ con5.Return_date__c = null;
+ con5.Lose_Flag__c = false;
+ con5.Cancellation_Flag__c = false;
+ con5.Consumable_Product__c = proH.id;
+ con5.Consumable_order_minor__c = Order2.id;
+ // con5.Sterilization_limit__c = Date.today().addDays(2);
+ con5.Box_Piece__c = '鐩�';
+ con5.Bar_Code__c = '1001';
+ conlist.add(con5);
+ insert conlist;
- System.Test.stopTest();
- }
- }
+ System.Test.startTest();
+ LexInventoryController inver = new LexInventoryController();
+ LexInventoryController.init();
+ List<LexInventoryController.ConsumableorderdetailsInfo> testList = LexInventoryController.consumableorderdetailsRecords;
+ List<LexInventoryController.ConsumableorderdetailsInfo> testList1 = new List<LexInventoryController.ConsumableorderdetailsInfo>();
+ System.debug('testCount:'+testList.size());
+ for(LexInventoryController.ConsumableorderdetailsInfo ass : testList){
+ System.debug(ass.check);
+ ass.check = true;
+ testList1.add(ass);
+ }
+ System.debug('testList1:'+testList1);
+ LexInventoryController.searchConsumableorderdetails('ET','涓婃捣','Testaccount001','',JSON.serialize(testList1),20,9,'Test','ASC');
+ LexInventoryController.searchConsumableorderdetails('ET','涓婃捣','Testaccount001','01210000000kUDKAA2\n10011',JSON.serialize(testList1),20,9,'Test','ASC');
+ LexInventoryController.searchConsumableorderdetails('ET','涓婃捣','Testaccount001','12345678856\n1234567895\n1234567890\n12345678511\n1234567856\n1234567855\n1234567886\n12345678551\n1234567890\n1234567883\n1234567882\n1234567881\n1234567884\nn123456788412\n1234567885\n123456788512\n1234567891\n1234567892\n1234567893\n1234567894\n1001',JSON.serialize(testList1),1,0,'Test','ASC');
+ LexInventoryController.save(true,JSON.serialize(testList1),myAccount1.Id,'ET',LexInventoryController.pandiandetailsMap,LexInventoryController.reSet);
+ LexInventoryController.searchConsumableorderdetails('ET','涓婃捣','Testaccount001','','[{"sortBy": null,"refind": 0,"ProdId": "a0l0l000004EisKAAS","Prod": {"attributes": {"type": "Product2__c","url": "/services/data/v58.0/sobjects/Product2__c/a0l0l000004EisKAAS"},"Id": "a0l0l000004EisKAAS","Name": "MH-155:鐧藉钩琛″附","Name__c": "Test07","SFDA_Status__c": "鍋滄","Packing_list_manual__c": 1,"Asset_Model_No__c": "Test07"},"Pandian": 0,"overlimitCount": 0,"orderdetails2": null,"orderdetails1": null,"limitCount": 2,"DiffReason": null,"Diff": 0,"countid": 2,"check": true,"canSelect": true,"boxPiece": "鐩�"}]',20,9,'Test','ASC');
- static testMethod void all() {
- user MyUser_Test;
+
+
+ System.Test.stopTest();
+ }
+ }
+
+ static testMethod void all(){
+ user MyUser_Test;
Account myAccount1;
- User thisUser = [SELECT Id FROM User WHERE Id = :UserInfo.getUserId()];
- System.runAs(thisUser) {
- Profile prof1 = [
- SELECT Id
- FROM Profile
- WHERE Name = '901_缁忛攢鍟嗙ぞ鍖烘櫘閫氭潈闄恄2閲嶉獙璇�(ET Email)'
- ];
- List<RecordType> rectCo = [
- SELECT Id
- FROM RecordType
- WHERE IsActive = TRUE AND SobjectType = 'Account' AND Name = '璨╁2搴�'
- ];
- if (rectCo.size() == 0) {
- return;
- }
- StaticParameter.EscapeOrderDetail2Trigger = true;
- StaticParameter.EscapeConsumableOrderDetail2Trigger = true;
- RecordType rectCoO = [
- SELECT Id
- FROM RecordType
- WHERE IsActive = TRUE AND SobjectType = 'Account' AND Name = '鐥呴櫌'
- ];
- Account olympus = new Account(RecordTypeId = rectCoO.Id, AgentCode_Ext__c = '9999900', Name = 'olympus');
- insert olympus;
- myAccount1 = new Account(
- name = 'Testaccount001',
- Dealer_discount__c = 10,
- RecordTypeId = rectCo[0].Id,
- AgentCode_Ext__c = '8888888'
- );
- insert myAccount1;
- Contact core = new Contact(
- email = 'jplumber@salesforce.com',
- firstname = 'Joe',
- lastname = 'Plumber',
- accountid = myAccount1.id
- );
- insert core;
- MyUser_Test = new User(
- ContactId = core.id,
- Alias = 'newUser',
- Email = 'newuser@testorg.com',
- EmailEncodingKey = 'UTF-8',
- LastName = 'TestUser',
- LanguageLocaleKey = 'zh_CN',
- LocaleSidKey = 'zh_CN',
- ProfileId = prof1.Id,
- TimeZoneSidKey = 'Asia/Shanghai',
- UserName = 'testUser@testorg.com',
- Work_Location__c = '涓婃捣'
- );
- insert MyUser_Test;
+ User thisUser = [ select Id from User where Id = :UserInfo.getUserId()];
+ system.runAs(thisUser){
+ Profile prof1 = [select Id from Profile where Name ='901_缁忛攢鍟嗙ぞ鍖烘櫘閫氭潈闄恄2閲嶉獙璇�(ET Email)'];
+ List<RecordType> rectCo = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '璨╁2搴�'];
+ if (rectCo.size() == 0) {
+ return;
}
- System.runAs(MyUser_Test) {
- Product2 prod07 = new Product2(
- Name = 'Test07',
- ProductCode = 'Test07',
- Asset_Model_No__c = 'Test07',
- SFDA_Status__c = '鏈夊姽',
- Dealer_special_Object__c = true,
- Packing_list_manual__c = 1,
- Manual_Entry__c = false
- );
- Product2 prod08 = new Product2(
- Name = 'Test08',
- ProductCode = 'Test08',
- Asset_Model_No__c = 'Test08',
- SFDA_Status__c = '鏈夊姽',
- Dealer_special_Object__c = true,
- Packing_list_manual__c = 1,
- Manual_Entry__c = false
- );
- Product2 prod09 = new Product2(
- Name = 'Test09',
- ProductCode = 'Test09',
- Asset_Model_No__c = 'Test09',
- SFDA_Status__c = '鏈夊姽',
- Dealer_special_Object__c = true,
- Packing_list_manual__c = 1,
- Manual_Entry__c = false
- );
- insert new List<Product2>{ prod07, prod08, prod09 };
+ StaticParameter.EscapeOrderDetail2Trigger = true;
+ StaticParameter.EscapeConsumableOrderDetail2Trigger = true;
+ RecordType rectCoO = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '鐥呴櫌'];
+ Account olympus = new Account(RecordTypeId = rectCoO.Id, AgentCode_Ext__c = '9999900', Name = 'olympus');
+ insert olympus;
+ myAccount1 = new Account(name='Testaccount001',Dealer_discount__c =10,RecordTypeId = rectCo[0].Id,AgentCode_Ext__c = '8888888');
+ insert myAccount1;
+ Contact core = new Contact(email='jplumber@salesforce.com', firstname='Joe',lastname='Plumber',accountid=myAccount1.id);
+ insert core;
+ MyUser_Test = New User(ContactId = core.id,Alias = 'newUser',Email='newuser@testorg.com',EmailEncodingKey='UTF-8', LastName='TestUser', LanguageLocaleKey='zh_CN',LocaleSidKey='zh_CN', ProfileId = prof1.Id,TimeZoneSidKey='Asia/Shanghai', UserName='testUser@testorg.com',Work_Location__c = '涓婃捣');
+ insert MyUser_Test;
+ }
+ system.runAs(MyUser_Test){
+
+ Product2 prod07 = new Product2(Name='Test07',ProductCode='Test07',Asset_Model_No__c = 'Test07',SFDA_Status__c = '鏈夊姽',Dealer_special_Object__c = true,Packing_list_manual__c = 1,Manual_Entry__c = false);
+ Product2 prod08 = new Product2(Name='Test08',ProductCode='Test08',Asset_Model_No__c = 'Test08',SFDA_Status__c = '鏈夊姽',Dealer_special_Object__c = true,Packing_list_manual__c = 1,Manual_Entry__c = false);
+ Product2 prod09 = new Product2(Name='Test09',ProductCode='Test09',Asset_Model_No__c = 'Test09',SFDA_Status__c = '鏈夊姽',Dealer_special_Object__c = true,Packing_list_manual__c = 1,Manual_Entry__c = false);
+ insert new Product2[] {prod07,prod08,prod09};
- //鍒朵綔浜у搧
- Product2__c proG = new Product2__c(Name = 'MH-155:鐧藉钩琛″附', OT_CODE_Text__c = 'Test001', Product2__c = prod07.Id);
- insert proG;
- Product2__c proH = new Product2__c(Name = 'MB-677:BNC鐢电紗', OT_CODE_Text__c = 'Test002', Product2__c = prod08.Id);
- insert proH;
- Product2__c proF = new Product2__c(Name = 'TooMAJ-643R:姘村泭闉樼003', OT_CODE_Text__c = 'Test003', Product2__c = prod09.Id);
- insert proF;
- List<Consumable_order__c> orderList = new List<Consumable_order__c>();
- //鍒拌揣
- Consumable_order__c Order1 = new Consumable_order__c();
- Order1.Name = 'OCM_01';
- Order1.Order_status__c = '鎵瑰噯';
- Order1.Order_type__c = '鍒拌揣';
- Order1.Dealer_Info__c = myAccount1.Id;
- Order1.RecordTypeid = '01210000000c9dqAAA';
- Order1.Order_ProType__c = 'ET';
- orderList.add(Order1);
- //鍙戣揣
- Consumable_order__c Order2 = new Consumable_order__c();
- Order2.Name = 'OCM_01';
- Order2.Order_status__c = '鎵瑰噯';
- Order2.Order_type__c = '璁㈠崟 ';
- Order2.Dealer_Info__c = myAccount1.Id;
- Order2.RecordTypeid = '01210000000c9drAAA';
- Order2.Order_ProType__c = 'ET';
- orderList.add(Order2);
- insert orderList;
- //鏌ヨ搴撳瓨 杩藉姞杩斿搧搴撳瓨
- List<Consumable_order_details2__c> conlist = new List<Consumable_order_details2__c>();
- Consumable_order_details2__c con3 = new Consumable_order_details2__c();
- con3.Arrive_date__c = Date.today();
- con3.Send_Date__c = null;
- con3.Used_date__c = null;
- con3.Return_date__c = null;
- con3.Lose_Flag__c = false;
- con3.Cancellation_Flag__c = false;
- con3.Consumable_order_minor__c = Order1.id;
- con3.Consumable_Arrived_order__c = Order1.id;
- con3.Bar_Code__c = '1001';
- con3.Consumable_Product__c = proH.id;
- conlist.add(con3);
- insert conlist;
+ //鍒朵綔浜у搧
+ Product2__c proG = new Product2__c(Name='MH-155:鐧藉钩琛″附',OT_CODE_Text__c='Test001',Product2__c = prod07.Id);
+ insert proG;
+ Product2__c proH = new Product2__c(Name='MB-677:BNC鐢电紗',OT_CODE_Text__c='Test002',Product2__c = prod08.Id);
+ insert proH;
+ Product2__c proF = new Product2__c(Name='TooMAJ-643R:姘村泭闉樼003',OT_CODE_Text__c='Test003',Product2__c = prod09.Id);
+ insert proF;
+ List<Consumable_order__c> orderList = new List<Consumable_order__c>();
+ //鍒拌揣
+ Consumable_order__c Order1 = new Consumable_order__c();
+ Order1.Name = 'OCM_01';
+ Order1.Order_status__c = '鎵瑰噯';
+ Order1.Order_type__c = '鍒拌揣';
+ Order1.Dealer_Info__c = myAccount1.Id;
+ Order1.RecordTypeid = '01210000000c9dqAAA';
+ Order1.Order_ProType__c = 'ET';
+ orderList.add(Order1);
+ //鍙戣揣
+ Consumable_order__c Order2 = new Consumable_order__c();
+ Order2.Name = 'OCM_01';
+ Order2.Order_status__c = '鎵瑰噯';
+ Order2.Order_type__c = '璁㈠崟 ';
+ Order2.Dealer_Info__c = myAccount1.Id;
+ Order2.RecordTypeid = '01210000000c9drAAA';
+ Order2.Order_ProType__c = 'ET';
+ orderList.add(Order2);
+ insert orderList;
+ //鏌ヨ搴撳瓨 杩藉姞杩斿搧搴撳瓨
+ List<Consumable_order_details2__c> conlist = new List<Consumable_order_details2__c>();
+ Consumable_order_details2__c con3 = new Consumable_order_details2__c();
+ con3.Arrive_date__c = Date.today();
+ con3.Send_Date__c = null;
+ con3.Used_date__c = null;
+ con3.Return_date__c = null;
+ con3.Lose_Flag__c = false;
+ con3.Cancellation_Flag__c = false;
+ con3.Consumable_order_minor__c = Order1.id;
+ con3.Consumable_Arrived_order__c = Order1.id;
+ con3.Bar_Code__c = '1001';
+ con3.Consumable_Product__c = proH.id;
+ conlist.add(con3);
+ insert conlist;
- //productAdjust
- Consumable_order_details2__c con6 = new Consumable_order_details2__c();
- // con6.Consumable_Product__c = proH.id;
- con6.Lose_reason__c = '杩囨湡搴撳瓨閿�瀛�';
- // con6.Box_Piece__c = '鐩�';
- con6.Sterilization_limit__c = Date.today().addDays(-2);
- con6.Bar_Code__c = '10011';
- // con6.Consumable_Arrived_order__c = Order1.id;
- con6.Lose_Flag__c = true;
- // con6.RecordTypeid = '01210000000kUDKAA2';
- conlist.add(con6);
- System.debug('conlist===>' + conlist);
- LexInventoryController.init();
- List<LexInventoryController.ConsumableorderdetailsInfo> testList = LexInventoryController.consumableorderdetailsRecords;
- List<LexInventoryController.ConsumableorderdetailsInfo> testList1 = new List<LexInventoryController.ConsumableorderdetailsInfo>();
- System.debug('testCount:' + testList.size());
- for (LexInventoryController.ConsumableorderdetailsInfo ass : testList) {
- System.debug(ass.check);
- ass.check = true;
- testList1.add(ass);
- }
- System.debug('testList1:' + testList1);
+ //productAdjust
+ Consumable_order_details2__c con6 = new Consumable_order_details2__c();
+ // con6.Consumable_Product__c = proH.id;
+ con6.Lose_reason__c = '杩囨湡搴撳瓨閿�瀛�';
+ // con6.Box_Piece__c = '鐩�';
+ con6.Sterilization_limit__c = Date.today().addDays(-2);
+ con6.Bar_Code__c = '10011';
+ // con6.Consumable_Arrived_order__c = Order1.id;
+ con6.Lose_Flag__c = true;
+ // con6.RecordTypeid = '01210000000kUDKAA2';
+ conlist.add(con6);
+ System.debug('conlist===>'+conlist);
+ LexInventoryController.init();
+ List<LexInventoryController.ConsumableorderdetailsInfo> testList = LexInventoryController.consumableorderdetailsRecords;
+ List<LexInventoryController.ConsumableorderdetailsInfo> testList1 = new List<LexInventoryController.ConsumableorderdetailsInfo>();
+ System.debug('testCount:'+testList.size());
+ for(LexInventoryController.ConsumableorderdetailsInfo ass : testList){
+ System.debug(ass.check);
+ ass.check = true;
+ testList1.add(ass);
+ }
+ System.debug('testList1:'+testList1);
- LexInventoryController.searchConsumableorderdetails(
- 'ET',
- '涓婃捣',
- 'Testaccount001',
- '1001\n10011',
- JSON.serialize(testList1),
- 20,
- 9,
- 'Test',
- 'ASC'
- );
- LexInventoryController.searchConsumableorderdetails(
- 'ET',
- '涓婃捣',
- 'Testaccount001',
- '',
- JSON.serialize(testList1),
- 20,
- 9,
- 'Test',
- 'ASC'
- );
- }
- }
-}
+ LexInventoryController.searchConsumableorderdetails('ET','涓婃捣','Testaccount001','1001\n10011',JSON.serialize(testList1),20,9,'Test','ASC');
+ LexInventoryController.searchConsumableorderdetails('ET','涓婃捣','Testaccount001','',JSON.serialize(testList1),20,9,'Test','ASC');
+ }
+ }
+}
\ No newline at end of file
diff --git a/force-app/main/default/classes/LexInventoryControllerTest.cls-meta.xml b/force-app/main/default/classes/LexInventoryControllerTest.cls-meta.xml
index a9fd6e9..754ecb1 100644
--- a/force-app/main/default/classes/LexInventoryControllerTest.cls-meta.xml
+++ b/force-app/main/default/classes/LexInventoryControllerTest.cls-meta.xml
@@ -1,4 +1,4 @@
-<?xml version="1.0" encoding="UTF-8" ?>
+<?xml version="1.0" encoding="UTF-8"?>
<ApexClass xmlns="http://soap.sforce.com/2006/04/metadata">
<apiVersion>57.0</apiVersion>
<status>Active</status>
diff --git a/force-app/main/default/classes/LexInventoryListController.cls b/force-app/main/default/classes/LexInventoryListController.cls
index c3328ec..a924740 100644
--- a/force-app/main/default/classes/LexInventoryListController.cls
+++ b/force-app/main/default/classes/LexInventoryListController.cls
@@ -1,7 +1,7 @@
public without sharing class LexInventoryListController {
/*****************妞滅储鐢�******************/
public static Consumable_order__c coc { get; set; }
- public static String baseUrl { get; private set; }
+ public static String baseUrl {get;private set;}
/*****************鐢婚潰琛ㄧずBean******************/
public static List<ConsumableorderdetailsInfo> consumableorderdetailsRecords { get; set; }
public static List<ConsumableorderdetailsInfo> consumableorderdetailsRecordsError { get; set; }
@@ -22,7 +22,7 @@
// 鐢婚潰鍒濆鍖�
@AuraEnabled
public static ResponseBodyLWC init(String eSetId) {
- system.debug('eSetId====>' + eSetId);
+ system.debug('eSetId====>'+eSetId);
ESetId = eSetId;
ResponseBodyLWC res = new ResponseBodyLWC();
Map<String, object> data = new Map<String, object>();
@@ -31,74 +31,49 @@
coc = new Consumable_order__c();
consumableorderdetailsRecords = new List<ConsumableorderdetailsInfo>();
- List<Consumable_order__c> qs = new List<Consumable_order__c>();
- qs = [
- SELECT Name, Inventory_date__c, Order_date__c
- FROM Consumable_order__c
- WHERE Id = :ESetId
- ];
- System.debug('qs===>' + qs);
- if (qs.size() > 0) {
+ List<Consumable_order__c> qs = New List<Consumable_order__c>();
+ qs = [select Name,Inventory_date__c,Order_date__c From Consumable_order__c Where Id =:ESetId];
+ System.debug('qs===>'+qs);
+ if (qs.size()>0){
coc = qs[0];
}
// 閬告姙娓堛伩銇槑缁嗐倰鍙栧緱
consumableorderdetailsSelected = [
- SELECT
- Id,
- Name,
- Consumable_Product__c,
- Consumable_Product__r.Name,
- Sterilization_limit__c,
- Deliver_date__c,
- Consumable_Product__r.Name__c,
- Consumable_Product__r.Intra_Trade_List_RMB__c,
- Bar_Code__c,
- Consumable_Product__r.Asset_Model_No__c,
- Lose_Flag__c,
- recordtypeid,
- Lose_reason__c
- FROM Consumable_order_details2__c
- WHERE Consumable_Inventory_order__c = :ESetId
- ORDER BY Name
- ];
- System.debug('consumableorderdetailsSelected==>' + consumableorderdetailsSelected);
+ select Id, Name, Consumable_Product__c,
+ Consumable_Product__r.Name, Sterilization_limit__c,
+ Deliver_date__c,Consumable_Product__r.Name__c,
+ Consumable_Product__r.Intra_Trade_List_RMB__c,Bar_Code__c,
+ Consumable_Product__r.Asset_Model_No__c,Lose_Flag__c,
+ recordtypeid,Lose_reason__c
+ from Consumable_order_details2__c
+ where Consumable_Inventory_order__c = :ESetId
+ order by Name ];
+ System.debug('consumableorderdetailsSelected==>'+consumableorderdetailsSelected);
for (Integer i = 0; i < consumableorderdetailsSelected.size(); i++) {
consumableorderdetailsRecordsError.add(new ConsumableorderdetailsInfo(consumableorderdetailsSelected[i]));
}
consumableorderdetails1 = [
- SELECT
- Id,
- Name,
- Diff__c,
- inventory_sum__c,
- Count_Sum__c,
- Consumable_order__c,
- Consumable_Product__c,
- Consumable_Product__r.Name,
- Consumable_Count__c,
+ select Id, Name,Diff__c,inventory_sum__c,
+ Count_Sum__c,Consumable_order__c,
+ Consumable_Product__c,Consumable_Product__r.Name,Consumable_Count__c,
Consumable_Product__r.Intra_Trade_List_RMB__c,
- Consumable_Product__r.Asset_Model_No__c,
- Consumable_Product__r.Name__c,
- Sum_of_money__c,
- recordtypeid,
- Lose_reason__c,
- Product_Refind__c
- FROM Consumable_orderdetails__c
- WHERE Consumable_order__c = :ESetId
- ORDER BY Name
- ];
+ Consumable_Product__r.Asset_Model_No__c,Consumable_Product__r.Name__c,
+ Sum_of_money__c,recordtypeid,Lose_reason__c,Product_Refind__c
+ from Consumable_orderdetails__c
+ where Consumable_order__c = :ESetId
+ order by Name ];
for (Integer i = 0; i < consumableorderdetails1.size(); i++) {
consumableorderdetailsRecords.add(new ConsumableorderdetailsInfo(consumableorderdetails1[i]));
}
- data.put('qs', qs);
- System.debug('consumableorderdetailsRecords====>' + consumableorderdetailsRecords);
- data.put('consumableorderdetailsRecords', JSON.serialize(consumableorderdetailsRecords));
- data.put('ConsumableorderdetailsRecordsError', JSON.serialize(ConsumableorderdetailsRecordsError));
+ data.put('qs',qs);
+ System.debug('consumableorderdetailsRecords====>'+consumableorderdetailsRecords);
+ data.put('consumableorderdetailsRecords',JSON.serialize(consumableorderdetailsRecords));
+ data.put('ConsumableorderdetailsRecordsError',JSON.serialize(ConsumableorderdetailsRecordsError));
// if(ConsumableorderdetailsRecordsError.size()!=null){
// data.put('ConsumableorderdetailsRecordsError',JSON.serialize(ConsumableorderdetailsRecordsError));
// }
- System.debug('ConsumableorderdetailsRecordsError====>' + ConsumableorderdetailsRecordsError);
+ System.debug('ConsumableorderdetailsRecordsError====>'+ConsumableorderdetailsRecordsError);
res.status = 'Success';
res.code = 200;
System.debug('res = ' + res);
@@ -126,4 +101,4 @@
return null;
}
}
-}
+}
\ No newline at end of file
diff --git a/force-app/main/default/classes/LexInventoryListControllerTest.cls b/force-app/main/default/classes/LexInventoryListControllerTest.cls
index ada261b..86c754d 100644
--- a/force-app/main/default/classes/LexInventoryListControllerTest.cls
+++ b/force-app/main/default/classes/LexInventoryListControllerTest.cls
@@ -1,119 +1,69 @@
@isTest
private class LexInventoryListControllerTest {
+
static testMethod void myUnitTest() {
Oly_TriggerHandler.bypass('ConsumableAssetHander');
Oly_TriggerHandler.bypass('Oly_TriggerHandler');
User myUser_test;
Account myAccount2;
- User thisUser = [SELECT Id FROM User WHERE Id = :UserInfo.getUserId()];
- System.runAs(thisUser) {
- List<RecordType> rectCo = [
- SELECT Id
- FROM RecordType
- WHERE IsActive = TRUE AND SobjectType = 'Account' AND Name = '璨╁2搴�'
- ];
+ User thisUser = [ select Id from User where Id = :UserInfo.getUserId()];
+ System.runAs(thisUser){
+ List<RecordType> rectCo = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '璨╁2搴�'];
if (rectCo.size() == 0) {
return;
}
- Profile prof = [
- SELECT Id
- FROM Profile
- WHERE Name = '901_缁忛攢鍟嗙ぞ鍖烘櫘閫氭潈闄恄2閲嶉獙璇�(ET)'
- ];
- myAccount2 = new Account(name = 'Testaccount002', Dealer_discount__c = 20, RecordTypeId = rectCo[0].Id);
+ Profile prof = [select Id from Profile where Name ='901_缁忛攢鍟嗙ぞ鍖烘櫘閫氭潈闄恄2閲嶉獙璇�(ET)'];
+ myAccount2 = new Account(name='Testaccount002',Dealer_discount__c =20,RecordTypeId = rectCo[0].Id);
insert myAccount2;
- Contact core = new Contact(
- email = 'jplumber@salesforce.com',
- firstname = 'Joe',
- lastname = 'Plumber',
- accountid = myAccount2.id
- );
+ Contact core = new Contact(email='jplumber@salesforce.com', firstname='Joe',lastname='Plumber',accountid=myAccount2.id);
insert core;
- MyUser_Test = new User(
- ContactId = core.id,
- Alias = 'newUser',
- Email = 'newuser@testorg.com',
- EmailEncodingKey = 'UTF-8',
- LastName = 'TestUser',
- LanguageLocaleKey = 'zh_CN',
- LocaleSidKey = 'zh_CN',
- ProfileId = prof.Id,
- TimeZoneSidKey = 'Asia/Shanghai',
- UserName = 'testUser@testorg.com'
- );
+ MyUser_Test = New User(ContactId = core.id,Alias = 'newUser',Email='newuser@testorg.com',EmailEncodingKey='UTF-8', LastName='TestUser', LanguageLocaleKey='zh_CN',LocaleSidKey='zh_CN', ProfileId = prof.Id,TimeZoneSidKey='Asia/Shanghai', UserName='testUser@testorg.com');
insert MyUser_Test;
}
- System.runAs(MyUser_Test) {
- Product2 prod01 = new Product2(
- Name = 'Test01',
- ProductCode = 'Test01',
- Asset_Model_No__c = 'Test01',
- SFDA_Status__c = '鏈夊姽',
- JANCODE__c = '04953170200311',
- Packing_list_manual__c = 12,
- Dealer_special_Object__c = true,
- Manual_Entry__c = false
- );
- Product2 prod02 = new Product2(
- Name = 'Test02',
- ProductCode = 'Test02',
- Asset_Model_No__c = 'Test02',
- SFDA_Status__c = '鏈夊姽',
- JANCODE__c = '04953170200312',
- Packing_list_manual__c = 10,
- Dealer_special_Object__c = true,
- Manual_Entry__c = false
- );
- Product2 prod03 = new Product2(
- Name = 'Test03',
- ProductCode = 'Test03',
- Asset_Model_No__c = 'Test03',
- SFDA_Status__c = '鏈夊姽',
- JANCODE__c = '04953170200313',
- Dealer_special_Object__c = true,
- Packing_list_manual__c = 1,
- Manual_Entry__c = false
- );
- insert new List<Product2>{ prod01, prod02, prod03 };
- Product2__c pro1 = new Product2__c(Name = 'Pro001', OT_CODE_Text__c = 'Test001', Product2__c = prod01.Id);
- Product2__c pro2 = new Product2__c(Name = 'Pro002', OT_CODE_Text__c = 'Test002', Product2__c = prod02.Id);
- Product2__c pro3 = new Product2__c(Name = 'Pro003', OT_CODE_Text__c = 'Test003', Product2__c = prod03.Id);
- insert new List<Product2__c>{ pro1, pro2, pro3 };
+ System.runAs(MyUser_Test){
+ Product2 prod01 = new Product2(Name='Test01',ProductCode='Test01',Asset_Model_No__c = 'Test01',SFDA_Status__c = '鏈夊姽',JANCODE__c = '04953170200311',Packing_list_manual__c=12,Dealer_special_Object__c = true,Manual_Entry__c = false);
+ Product2 prod02 = new Product2(Name='Test02',ProductCode='Test02',Asset_Model_No__c = 'Test02',SFDA_Status__c = '鏈夊姽',JANCODE__c = '04953170200312',Packing_list_manual__c=10,Dealer_special_Object__c = true,Manual_Entry__c = false);
+ Product2 prod03 = new Product2(Name='Test03',ProductCode='Test03',Asset_Model_No__c = 'Test03',SFDA_Status__c = '鏈夊姽',JANCODE__c = '04953170200313',Dealer_special_Object__c = true,Packing_list_manual__c = 1,Manual_Entry__c = false);
+ insert new Product2[]{prod01,prod02,prod03};
+ Product2__c pro1 = new Product2__c(Name='Pro001',OT_CODE_Text__c='Test001',Product2__c = prod01.Id);
+ Product2__c pro2 = new Product2__c(Name='Pro002',OT_CODE_Text__c='Test002',Product2__c = prod02.Id);
+ Product2__c pro3 = new Product2__c(Name='Pro003',OT_CODE_Text__c='Test003',Product2__c = prod03.Id);
+ insert new Product2__c[] {pro1, pro2, pro3};
+
+ Consumable_order__c Order1 = new Consumable_order__c();
+ Order1.Name = 'OCM_01_001';
+ Order1.Order_status__c = '鎵瑰噯';
+ Order1.Order_type__c = '鐩樼偣';
+ Order1.RecordTypeid = System.Label.RT_ConOrder_Inventory;
+ insert Order1;
- Consumable_order__c Order1 = new Consumable_order__c();
- Order1.Name = 'OCM_01_001';
- Order1.Order_status__c = '鎵瑰噯';
- Order1.Order_type__c = '鐩樼偣';
- Order1.RecordTypeid = System.Label.RT_ConOrder_Inventory;
- insert Order1;
-
- Consumable_order__c Order2 = new Consumable_order__c();
- Order2.Name = 'OCM_01_002';
- Order2.Order_status__c = '鎵瑰噯';
- Order2.Order_type__c = '璁㈠崟';
- Order2.RecordTypeid = System.Label.RT_ConOrder_Order;
- insert Order2;
+ Consumable_order__c Order2 = new Consumable_order__c();
+ Order2.Name = 'OCM_01_002';
+ Order2.Order_status__c = '鎵瑰噯';
+ Order2.Order_type__c = '璁㈠崟';
+ Order2.RecordTypeid = System.Label.RT_ConOrder_Order;
+ insert Order2;
Consumable_order__c Order3 = new Consumable_order__c();
- Order3.Name = 'OCM_01_004';
- Order3.Order_status__c = '鎵瑰噯';
- Order3.Order_type__c = '鍒拌揣';
- Order3.RecordTypeid = '01210000000c9dqAAA';
- insert Order3;
+ Order3.Name = 'OCM_01_004';
+ Order3.Order_status__c = '鎵瑰噯';
+ Order3.Order_type__c = '鍒拌揣';
+ Order3.RecordTypeid = '01210000000c9dqAAA';
+ insert Order3;
+
+ Consumable_orderdetails__c Orderdet1 = new Consumable_orderdetails__c();
+ Orderdet1.Name = 'OCM_01_001001';
+ Orderdet1.Consumable_order__c = Order1.Id;
+ Orderdet1.RecordTypeId = System.Label.RT_ConOrderDetail1_Inventory ;
- Consumable_orderdetails__c Orderdet1 = new Consumable_orderdetails__c();
- Orderdet1.Name = 'OCM_01_001001';
- Orderdet1.Consumable_order__c = Order1.Id;
- Orderdet1.RecordTypeId = System.Label.RT_ConOrderDetail1_Inventory;
+ Consumable_orderdetails__c Orderdet2 = new Consumable_orderdetails__c();
+ Orderdet2.Name = 'OCM_01_001002';
+ Orderdet2.Consumable_order__c = Order1.Id;
+ Orderdet2.RecordTypeId = System.Label.RT_ConOrderDetail1_Inventory;
+ insert new Consumable_orderdetails__c[] {Orderdet1, Orderdet2};
- Consumable_orderdetails__c Orderdet2 = new Consumable_orderdetails__c();
- Orderdet2.Name = 'OCM_01_001002';
- Orderdet2.Consumable_order__c = Order1.Id;
- Orderdet2.RecordTypeId = System.Label.RT_ConOrderDetail1_Inventory;
- insert new List<Consumable_orderdetails__c>{ Orderdet1, Orderdet2 };
-
- List<Consumable_order_details2__c> conList1 = new List<Consumable_order_details2__c>();
+ List<Consumable_order_details2__c> conList1 = new List<Consumable_order_details2__c> ();
//浜у搧绫诲瀷涓嶅悓
Consumable_order_details2__c con = new Consumable_order_details2__c();
con.Name = 'OCM_01_001001';
@@ -124,19 +74,19 @@
con.Bar_Code__c = '10011';
con.Used_date__c = null;
con.Lose_Flag__c = false;
- con.Return_date__c = null;
- con.Send_Date__c = null;
+ con.Return_date__c= null;
+ con.Send_Date__c= null;
con.Box_Piece__c = '鐩�';
conList1.add(con);
insert conList1;
String eSetId = Order1.id;
System.Test.startTest();
LexInventoryListController.init(eSetId);
-
+
List<LexInventoryListController.ConsumableorderdetailsInfo> inList = LexInventoryListController.consumableorderdetailsRecords;
- List<LexInventoryListController.ConsumableorderdetailsInfo> inList1 = new List<LexInventoryListController.ConsumableorderdetailsInfo>();
- for (LexInventoryListController.ConsumableorderdetailsInfo ass : inList) {
- ass.orderdetails1 = Orderdet1;
+ List<LexInventoryListController.ConsumableorderdetailsInfo> inList1 = new List<LexInventoryListController.ConsumableorderdetailsInfo>();
+ for(LexInventoryListController.ConsumableorderdetailsInfo ass: inList){
+ ass.orderdetails1= Orderdet1;
inList1.add(ass);
}
LexInventoryListController.ConsumableorderdetailsInfo c2 = new LexInventoryListController.ConsumableorderdetailsInfo(Orderdet1);
@@ -147,6 +97,6 @@
c1.Prod = con.Consumable_product__r;
c1.compareTo(c2);
System.Test.stopTest();
- }
+ }
}
-}
+}
\ No newline at end of file
diff --git a/force-app/main/default/classes/LexInventoryListControllerTest.cls-meta.xml b/force-app/main/default/classes/LexInventoryListControllerTest.cls-meta.xml
index a9fd6e9..754ecb1 100644
--- a/force-app/main/default/classes/LexInventoryListControllerTest.cls-meta.xml
+++ b/force-app/main/default/classes/LexInventoryListControllerTest.cls-meta.xml
@@ -1,4 +1,4 @@
-<?xml version="1.0" encoding="UTF-8" ?>
+<?xml version="1.0" encoding="UTF-8"?>
<ApexClass xmlns="http://soap.sforce.com/2006/04/metadata">
<apiVersion>57.0</apiVersion>
<status>Active</status>
diff --git a/force-app/main/default/classes/LexInventoryViewController.cls b/force-app/main/default/classes/LexInventoryViewController.cls
index 4cdc3ff..1a4c8fd 100644
--- a/force-app/main/default/classes/LexInventoryViewController.cls
+++ b/force-app/main/default/classes/LexInventoryViewController.cls
@@ -49,7 +49,7 @@
public static String category1 { get; set; }
public static Boolean editAble { get; set; }
// 缁忛攢鍟嗗湪搴撲骇鍝両D
- public static List<String> orderDetZaikuList { get; set; }
+ public static List<String> orderDetZaikuList{set;get;}
// 浜у搧 ID
public static String ESetId { get; set; }
public static String idCheck { get; set; }
@@ -98,6 +98,7 @@
categoryOptionMap = new Map<String, String>();
category4OptionMap = new Map<String, String>();
category5OptionMap = new Map<String, String>();
+
// 鍙栫敤鎴稩D
String userId = UserInfo.getUserId();
@@ -239,7 +240,9 @@
}
if (newMidPieceMap.containsKey(CountDel[i].Consumable_Product__c + CountDel[i].Box_Piece__c + tex)) {
ConsumableorderdetailsInfo Jstage = newMidPieceMap.get(
- CountDel[i].Consumable_Product__c + CountDel[i].Box_Piece__c + tex
+ CountDel[i].Consumable_Product__c +
+ CountDel[i].Box_Piece__c +
+ tex
)
.clone();
Jstage.allnumber = Jstage.allnumber + 1;
@@ -404,8 +407,8 @@
data.put('pageRecords', pageRecords);
data.put('consumableorderdetailsRecords', consumableorderdetailsRecords);
data.put('hasHos', hasHos);
- data.put('productLimtAndDate', proLimitAndDate);
- data.put('productkucun', productkucun);
+ data.put('productLimtAndDate',proLimitAndDate);
+ data.put('productkucun',productkucun);
res.status = 'Success';
res.code = 200;
System.debug('res = ' + res);
@@ -413,16 +416,16 @@
return res;
}
@AuraEnabled
- public static ResponseBodyLWC categoryAllload(String category3LWC, String agencyProTypeLWC) {
+ public static ResponseBodyLWC categoryAllload(String category3LWC,String agencyProTypeLWC) {
ResponseBodyLWC res = new ResponseBodyLWC();
Map<String, object> data = new Map<String, object>();
res.entity = data;
- category3 = category3LWC;
- agencyProType = '%' + agencyProTypeLWC + '%';
+ category3 = category3LWC;
+ agencyProType = '%' + agencyProTypeLWC + '%';
- System.debug('category3LWC===>' + category3LWC);
- System.debug('agencyProType===>' + agencyProType);
-
+ System.debug('category3LWC===>'+category3LWC);
+ System.debug('agencyProType===>'+agencyProType);
+
AggregateResult[] category4List = [
SELECT Count(id), Category4_text__c c4c
FROM Product2__c
@@ -466,8 +469,8 @@
category5OptionList.add(new SelectOption(deliverycnt5, deliverycnt5));
category5OptionMap.put(deliverycnt5, deliverycnt5);
}
- System.debug('绫诲埆4' + category4OptionList);
- System.debug('绫诲埆5' + category5OptionList);
+ System.debug('绫诲埆4'+category4OptionList);
+ System.debug('绫诲埆5'+category5OptionList);
data.put('category4OptionMap', category4OptionMap);
data.put('category5OptionMap', category5OptionMap);
res.status = 'Success';
@@ -532,13 +535,13 @@
Map<String, Date> productkucunLWC
) {
try {
- System.debug('orderDetZaikuListLWC===>' + orderDetZaikuListLWC);
- System.debug('productkucun===>' + productkucun);
+ System.debug('orderDetZaikuListLWC===>'+orderDetZaikuListLWC);
+ System.debug('productkucun===>'+productkucun);
pageSize = pageSizeLWC;
pageToken = pageTokenLWC;
sortField = sortFieldLWC;
sortOrder = sortOrderLWC;
- productkucun = new Map<String, Date>();
+ productkucun = new Map<String, Date>();
orderDetZaikuList = new List<String>();
productkucun = productkucunLWC;
@@ -603,7 +606,7 @@
// if (String.isNotBlank(sortField) && String.isNotBlank(sortOrder)) {
// if(sortFieldLWC != 'limitCount'){
// soql += ' ORDER BY ' + sortField + ' ' + sortOrder;
-
+
// }
// }
System.debug('soql = ' + soql);
@@ -627,7 +630,9 @@
}
if (newMidBoxMap.containsKey(CountDel[i].Consumable_Product__c + CountDel[i].Box_Piece__c + tex)) {
ConsumableorderdetailsInfo Jstage = newMidBoxMap.get(
- CountDel[i].Consumable_Product__c + CountDel[i].Box_Piece__c + tex
+ CountDel[i].Consumable_Product__c +
+ CountDel[i].Box_Piece__c +
+ tex
)
.clone();
Jstage.allnumber = Jstage.allnumber + 1;
@@ -657,7 +662,9 @@
}
if (newMidPieceMap.containsKey(CountDel[i].Consumable_Product__c + CountDel[i].Box_Piece__c + tex)) {
ConsumableorderdetailsInfo Jstage = newMidPieceMap.get(
- CountDel[i].Consumable_Product__c + CountDel[i].Box_Piece__c + tex
+ CountDel[i].Consumable_Product__c +
+ CountDel[i].Box_Piece__c +
+ tex
)
.clone();
Jstage.allnumber = Jstage.allnumber + 1;
@@ -773,11 +780,11 @@
paginatedAccounts.recordEnd = totalCount >= recordEnd ? recordEnd : totalCount;
paginatedAccounts.totalRecords = totalCount;
- List<ConsumableorderdetailsInfo> pageRecordsCompare = new List<ConsumableorderdetailsInfo>();
+ List<ConsumableorderdetailsInfo> pageRecordsCompare = new List<ConsumableorderdetailsInfo>();
System.debug('queryList = ' + JSON.serialize(queryList));
for (Integer i = 0; i < queryList.size(); i++) {
- for (ConsumableorderdetailsInfo ci : pageRecords) {
- if (queryList[i].Id == ci.Prod.Id) {
+ for(ConsumableorderdetailsInfo ci : pageRecords){
+ if(queryList[i].Id == ci.Prod.Id){
System.debug('queryList[i].Id =' + queryList[i].Id);
System.debug('ci.Prod.Id =' + queryList[i].Id);
pageRecordsCompare.add(ci);
@@ -931,6 +938,7 @@
// }
// pageRecords.sort();
// }
+
//妫�绱ql鏂囧仛鎴�
private static String makeSoql(String CateName, String CateCode, String Category3, String Category4, String Category5) {
@@ -1111,4 +1119,4 @@
}
}
}
-}
+}
\ No newline at end of file
diff --git a/force-app/main/default/classes/LexInventoryViewControllerTest.cls b/force-app/main/default/classes/LexInventoryViewControllerTest.cls
index 54a61da..0a9473a 100644
--- a/force-app/main/default/classes/LexInventoryViewControllerTest.cls
+++ b/force-app/main/default/classes/LexInventoryViewControllerTest.cls
@@ -1,515 +1,294 @@
@isTest
-public class LexInventoryViewControllerTest {
- static testMethod void testInnerClass() {
+public class LexInventoryViewControllerTest {
+ static testMethod void testInnerClass(){
List<LexInventoryViewController.ConsumableorderdetailsInfo> cro = new List<LexInventoryViewController.ConsumableorderdetailsInfo>();
- cro.sort();
+ cro.sort();
}
- static testMethod void LexInventoryViewControllerTest() {
+ static testMethod void LexInventoryViewControllerTest(){
user myUser_test;
Account myAccount1;
- User thisUser = [SELECT Id FROM User WHERE Id = :UserInfo.getUserId()];
- System.runAs(thisUser) {
- Profile prof = [
- SELECT Id
- FROM Profile
- WHERE Name = '901_缁忛攢鍟嗙ぞ鍖烘櫘閫氭潈闄恄2閲嶉獙璇�(ET)'
- ];
- List<RecordType> rectCo = [
- SELECT Id
- FROM RecordType
- WHERE IsActive = TRUE AND SobjectType = 'Account' AND Name = '璨╁2搴�'
- ];
+ User thisUser = [ select Id from User where Id = :UserInfo.getUserId()];
+ system.runAs(thisUser){
+ Profile prof = [select Id from Profile where Name ='901_缁忛攢鍟嗙ぞ鍖烘櫘閫氭潈闄恄2閲嶉獙璇�(ET)'];
+ List<RecordType> rectCo = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '璨╁2搴�'];
if (rectCo.size() == 0) {
return;
}
- List<RecordType> rectHos = [
- SELECT Id
- FROM RecordType
- WHERE IsActive = TRUE AND SobjectType = 'Account' AND Name = '鐥呴櫌'
- ];
+ List<RecordType> rectHos = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '鐥呴櫌'];
if (rectHos.size() == 0) {
return;
}
-
- myAccount1 = new Account(
- name = 'testaccount001',
- RecordTypeId = rectCo[0].Id,
- Product_Limit_Date__c = 'Test01|2|4,Test02|3|5',
- AgentCode_Ext__c = '9999900'
- );
+
+ myAccount1 = new Account(name='testaccount001',RecordTypeId = rectCo[0].Id,Product_Limit_Date__c = 'Test01|2|4,Test02|3|5' ,AgentCode_Ext__c = '9999900');
insert myAccount1;
- Contact core = new Contact(
- email = 'jplumber@salesforce.com',
- firstname = 'Joe',
- lastname = 'Plumber',
- accountid = myAccount1.id
- );
+ Contact core = new Contact(email='jplumber@salesforce.com', firstname='Joe',lastname='Plumber',accountid=myAccount1.id);
insert core;
- myUser_test = new User(
- ContactId = core.id,
- Alias = 'newUser',
- Email = 'newuser@testorg.com',
- EmailEncodingKey = 'UTF-8',
- LastName = 'testUser',
- LanguageLocaleKey = 'zh_CN',
- LocaleSidKey = 'zh_CN',
- ProfileId = prof.Id,
- TimeZoneSidKey = 'Asia/Shanghai',
- UserName = 'testUser@testorg.com',
- Work_Location__c = '娣卞湷'
- );
+ myUser_test = New User(ContactId = core.id,Alias = 'newUser',Email='newuser@testorg.com',EmailEncodingKey='UTF-8', LastName='testUser', LanguageLocaleKey='zh_CN',LocaleSidKey='zh_CN', ProfileId = prof.Id,TimeZoneSidKey='Asia/Shanghai', UserName='testUser@testorg.com',Work_Location__c = '娣卞湷');
insert myUser_test;
}
- System.runAs(myUser_test) {
- Product2 prod01 = new Product2(
- Name = '3400PK:PK閽� 5mmx33cm',
- ProductCode = 'Test01',
- Asset_Model_No__c = '3400PK:PK閽� 5mmx33cm',
- SFDA_Status__c = '鏈夊姽',
- Dealer_special_Object__c = true,
- SFDA_Approbation_No__c = 'Test001',
- Packing_list_manual__c = 1,
- SFDA_Expiration_Date__c = Date.today(),
- Category5__c = 'tset',
- Manual_Entry__c = false
- );
- Product2 prod02 = new Product2(
- Name = 'Test02',
- ProductCode = 'Test02',
- Asset_Model_No__c = 'Test02',
- SFDA_Status__c = '鏈夊姽',
- Dealer_special_Object__c = true,
- SFDA_Approbation_No__c = 'Test002',
- Packing_list_manual__c = 12,
- SFDA_Expiration_Date__c = Date.today(),
- Category5__c = 'tset',
- Manual_Entry__c = false
- );
- insert new List<Product2>{ prod01, prod02 };
- Product2__c pro1 = new Product2__c(
- Name = '3400PK:PK閽� 5mmx33cm',
- OT_CODE_Text__c = 'Test001',
- Product2__c = prod01.Id,
- Category3_text__c = '鑵硅厰闀滄墜鏈�',
- Category4_text__c = 'PK',
- Category5_text__c = 'G400'
- );
- Product2__c pro2 = new Product2__c(
- Name = 'Pro002',
- OT_CODE_Text__c = 'Test002',
- Product2__c = prod02.Id,
- Category3_text__c = '鑵硅厰闀滄墜鏈�',
- Category4_text__c = 'PK',
- Category5_text__c = 'G400'
- );
- insert new List<Product2__c>{ pro1, pro2 };
- System.debug('pro2===銆�' + pro2);
- System.debug('pro1===銆�' + pro1);
+ System.runAs(myUser_test) {
+ Product2 prod01 = new Product2(Name='3400PK:PK閽� 5mmx33cm',ProductCode='Test01',Asset_Model_No__c = '3400PK:PK閽� 5mmx33cm',SFDA_Status__c = '鏈夊姽',Dealer_special_Object__c = true,SFDA_Approbation_No__c = 'Test001',Packing_list_manual__c = 1,SFDA_Expiration_Date__c= Date.today(),Category5__c = 'tset',Manual_Entry__c = false);
+ Product2 prod02 = new Product2(Name='Test02',ProductCode='Test02',Asset_Model_No__c = 'Test02',SFDA_Status__c = '鏈夊姽',Dealer_special_Object__c = true,SFDA_Approbation_No__c = 'Test002',Packing_list_manual__c = 12,SFDA_Expiration_Date__c= Date.today(),Category5__c = 'tset',Manual_Entry__c = false);
+ insert new Product2[]{prod01,prod02};
+ Product2__c pro1 = new Product2__c(Name='3400PK:PK閽� 5mmx33cm',OT_CODE_Text__c='Test001',Product2__c = prod01.Id,Category3_text__c = '鑵硅厰闀滄墜鏈�',Category4_text__c = 'PK',Category5_text__c = 'G400');
+ Product2__c pro2 = new Product2__c(Name='Pro002',OT_CODE_Text__c='Test002',Product2__c = prod02.Id,Category3_text__c = '鑵硅厰闀滄墜鏈�',Category4_text__c = 'PK',Category5_text__c = 'G400');
+ insert new Product2__c[] {pro1, pro2};
+ System.debug('pro2===銆�'+pro2);
+ System.debug('pro1===銆�'+pro1);
- Consumable_order__c Order1 = new Consumable_order__c();
- Order1.Name = 'OCM_01_001';
- Order1.Order_status__c = '鎵瑰噯';
- Order1.Order_type__c = '璁㈠崟';
- Order1.Dealer_Info__c = myAccount1.Id;
- Order1.RecordTypeid = System.Label.RT_ConOrder_Inventory;
- Order1.Order_ProType__c = 'ET';
- insert Order1;
+ Consumable_order__c Order1 = new Consumable_order__c();
+ Order1.Name = 'OCM_01_001';
+ Order1.Order_status__c = '鎵瑰噯';
+ Order1.Order_type__c = '璁㈠崟';
+ Order1.Dealer_Info__c = myAccount1.Id;
+ Order1.RecordTypeid = System.Label.RT_ConOrder_Inventory;
+ Order1.Order_ProType__c = 'ET';
+ insert Order1;
- Consumable_order__c Order2 = new Consumable_order__c();
- Order2.Name = 'OCM_01_001';
- Order2.Order_status__c = '鎵瑰噯';
- Order2.Order_type__c = '璁㈠崟';
- Order2.Dealer_Info__c = myAccount1.Id;
- Order2.RecordTypeid = System.Label.RT_ConOrder_Inventory;
- Order2.Order_ProType__c = 'ENg';
- insert Order2;
+ Consumable_order__c Order2 = new Consumable_order__c();
+ Order2.Name = 'OCM_01_001';
+ Order2.Order_status__c = '鎵瑰噯';
+ Order2.Order_type__c = '璁㈠崟';
+ Order2.Dealer_Info__c = myAccount1.Id;
+ Order2.RecordTypeid = System.Label.RT_ConOrder_Inventory;
+ Order2.Order_ProType__c = 'ENg';
+ insert Order2;
+
+ Consumable_order_details2__c Orderdet1 = new Consumable_order_details2__c();
+ Orderdet1.Name = 'OCM_01_001001';
+ //Orderdet1.Consumable_principal__c = Order1.Id;
+ Orderdet1.Consumable_order_minor__c = Order1.Id;
+ Orderdet1.Consumable_Product__c = pro1.Id;
+ Orderdet1.Consumable_Arrived_order__c = Order1.Id;
+ //Orderdet1.IsArrival__c = true;
+ Orderdet1.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
+ Orderdet1.Bar_Code__c = '11111';
+ Orderdet1.Arrive_date__c = Date.today().addDays(1);
+ Orderdet1.Send_Date__c = null;
+ Orderdet1.Used_date__c = null;
+ Orderdet1.Lose_Flag__c = false;
+ Orderdet1.Box_Piece__c = '鐩�';
+
+ Consumable_order_details2__c Orderdet2 = new Consumable_order_details2__c();
+ Orderdet2.Name = 'OCM_01_001002';
+ //Orderdet2.Consumable_principal__c = Order1.Id;
+ Orderdet2.Consumable_order_minor__c = Order1.Id;
+ Orderdet2.Consumable_Product__c = pro1.Id;
+ Orderdet2.Consumable_Arrived_order__c = Order1.Id;
+ //Orderdet2.IsArrival__c = true;
+ Orderdet2.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
+ Orderdet2.Bar_Code__c = '22222';
+ Orderdet2.Arrive_date__c = Date.today().addDays(1);
+ Orderdet2.Send_Date__c = null;
+ Orderdet2.Used_date__c = null;
+ Orderdet2.Lose_Flag__c = false;
+ Orderdet2.Box_Piece__c = '涓�';
+ Orderdet2.Sterilization_limit__c= Date.today();
+
+ Consumable_order_details2__c Orderdet3 = new Consumable_order_details2__c();
+ Orderdet3.Name = 'OCM_01_001003';
+ //Orderdet3.Consumable_principal__c = Order1.Id;
+ Orderdet3.Consumable_order_minor__c = Order1.Id;
+ Orderdet3.Consumable_Product__c = pro2.Id;
+ Orderdet3.Consumable_Arrived_order__c = Order1.Id;
+ //Orderdet3.IsArrival__c = true;
+ Orderdet3.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
+ Orderdet3.Bar_Code__c = '33333';
+ Orderdet3.Arrive_date__c = Date.today().addDays(1);
+ Orderdet3.Send_Date__c = null;
+ Orderdet3.Used_date__c = null;
+ Orderdet3.Lose_Flag__c = false;
+ Orderdet3.Box_Piece__c = '涓�';
+ Orderdet3.Sterilization_limit__c= Date.today();
+
+ Consumable_order_details2__c Orderdet4 = new Consumable_order_details2__c();
+ Orderdet4.Name = 'OCM_01_001004';
+ //Orderdet4.Consumable_principal__c = Order1.Id;
+ Orderdet4.Consumable_order_minor__c = Order1.Id;
+ Orderdet4.Consumable_Product__c = pro1.Id;
+ Orderdet4.Consumable_Arrived_order__c = Order1.Id;
+ //Orderdet4.IsArrival__c = true;
+ Orderdet4.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
+ Orderdet4.Bar_Code__c = '44444';
+ Orderdet4.Arrive_date__c = Date.today().addDays(1);
+ Orderdet4.Send_Date__c = null;
+ Orderdet4.Used_date__c = null;
+ Orderdet4.Lose_Flag__c = false;
+ Orderdet4.Box_Piece__c = '涓�';
+
+ insert new Consumable_order_details2__c[] {Orderdet1, Orderdet2,Orderdet3,Orderdet4};
- Consumable_order_details2__c Orderdet1 = new Consumable_order_details2__c();
- Orderdet1.Name = 'OCM_01_001001';
- //Orderdet1.Consumable_principal__c = Order1.Id;
- Orderdet1.Consumable_order_minor__c = Order1.Id;
- Orderdet1.Consumable_Product__c = pro1.Id;
- Orderdet1.Consumable_Arrived_order__c = Order1.Id;
- //Orderdet1.IsArrival__c = true;
- Orderdet1.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
- Orderdet1.Bar_Code__c = '11111';
- Orderdet1.Arrive_date__c = Date.today().addDays(1);
- Orderdet1.Send_Date__c = null;
- Orderdet1.Used_date__c = null;
- Orderdet1.Lose_Flag__c = false;
- Orderdet1.Box_Piece__c = '鐩�';
-
- Consumable_order_details2__c Orderdet2 = new Consumable_order_details2__c();
- Orderdet2.Name = 'OCM_01_001002';
- //Orderdet2.Consumable_principal__c = Order1.Id;
- Orderdet2.Consumable_order_minor__c = Order1.Id;
- Orderdet2.Consumable_Product__c = pro1.Id;
- Orderdet2.Consumable_Arrived_order__c = Order1.Id;
- //Orderdet2.IsArrival__c = true;
- Orderdet2.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
- Orderdet2.Bar_Code__c = '22222';
- Orderdet2.Arrive_date__c = Date.today().addDays(1);
- Orderdet2.Send_Date__c = null;
- Orderdet2.Used_date__c = null;
- Orderdet2.Lose_Flag__c = false;
- Orderdet2.Box_Piece__c = '涓�';
- Orderdet2.Sterilization_limit__c = Date.today();
-
- Consumable_order_details2__c Orderdet3 = new Consumable_order_details2__c();
- Orderdet3.Name = 'OCM_01_001003';
- //Orderdet3.Consumable_principal__c = Order1.Id;
- Orderdet3.Consumable_order_minor__c = Order1.Id;
- Orderdet3.Consumable_Product__c = pro2.Id;
- Orderdet3.Consumable_Arrived_order__c = Order1.Id;
- //Orderdet3.IsArrival__c = true;
- Orderdet3.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
- Orderdet3.Bar_Code__c = '33333';
- Orderdet3.Arrive_date__c = Date.today().addDays(1);
- Orderdet3.Send_Date__c = null;
- Orderdet3.Used_date__c = null;
- Orderdet3.Lose_Flag__c = false;
- Orderdet3.Box_Piece__c = '涓�';
- Orderdet3.Sterilization_limit__c = Date.today();
-
- Consumable_order_details2__c Orderdet4 = new Consumable_order_details2__c();
- Orderdet4.Name = 'OCM_01_001004';
- //Orderdet4.Consumable_principal__c = Order1.Id;
- Orderdet4.Consumable_order_minor__c = Order1.Id;
- Orderdet4.Consumable_Product__c = pro1.Id;
- Orderdet4.Consumable_Arrived_order__c = Order1.Id;
- //Orderdet4.IsArrival__c = true;
- Orderdet4.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
- Orderdet4.Bar_Code__c = '44444';
- Orderdet4.Arrive_date__c = Date.today().addDays(1);
- Orderdet4.Send_Date__c = null;
- Orderdet4.Used_date__c = null;
- Orderdet4.Lose_Flag__c = false;
- Orderdet4.Box_Piece__c = '涓�';
-
- insert new List<Consumable_order_details2__c>{ Orderdet1, Orderdet2, Orderdet3, Orderdet4 };
-
- //鍒朵綔鐩樼偣灞ュ巻
- List<Consumable_order__c> InsPDlist = new List<Consumable_order__c>();
- for (integer i = 1; i < 35; i++) {
- String str = string.valueOf(i);
- if (str.length() == 1) {
- str = '0' + str;
+ //鍒朵綔鐩樼偣灞ュ巻
+ List<Consumable_order__c> InsPDlist = new List<Consumable_order__c>();
+ for(integer i = 1 ; i < 35 ;i++){
+ String str = string.valueOf(i);
+ if(str.length() == 1){
+ str = '0' + str;
+ }
+ Consumable_order__c PDlist = new Consumable_order__c(name='testPandianLVL_'+str);
+ //Date ThisDate = Date.newInstance(2016,4,20+i/5);
+ //PDlist.Inventory_date__c = ThisDate;
+ PDlist.Order_type__c = '鐩樼偣';
+ PDlist.RecordTypeid = System.Label.RT_ConOrder_Inventory;
+ PDlist.Inventory_date__c = Date.today().addDays(-i);
+ PDlist.Dealer_Info__c = myAccount1.Id;
+ InsPDlist.add(PDlist);
}
- Consumable_order__c PDlist = new Consumable_order__c(name = 'testPandianLVL_' + str);
- //Date ThisDate = Date.newInstance(2016,4,20+i/5);
- //PDlist.Inventory_date__c = ThisDate;
- PDlist.Order_type__c = '鐩樼偣';
- PDlist.RecordTypeid = System.Label.RT_ConOrder_Inventory;
- PDlist.Inventory_date__c = Date.today().addDays(-i);
- PDlist.Dealer_Info__c = myAccount1.Id;
- InsPDlist.add(PDlist);
+ List<String> orderDetZaikuListLWC = new List<String>();
+ LexInventoryViewController controller = new LexInventoryViewController();
+ Integer pageSizeLWC = 1;
+ Integer pageTokenLWC = 0;
+ String sortFieldLWC = '';
+ String sortOrderLWC ='';
+ String category1= '3400PK:PK閽� 5mm脳33cm';
+ String Category3 = '鑵硅厰闀滄墜鏈�';
+ String Category4 = 'PK';
+ String Category5 = 'G400';
+ String accountName = '鎹峰皵鍖荤枟(娴峰崡锛夋湁闄愬叕鍙�';
+ string agencyProType = 'ENG';
+ string userWorkLocation = '娣卞湷';
+ LexInventoryViewController.category1 = category1;
+ LexInventoryViewController.Category3 = Category3;
+ LexInventoryViewController.Category4 = Category4;
+ LexInventoryViewController.Category5 = Category5;
+ LexInventoryViewController.orderDetZaikuList = new List<String>();
+ LexInventoryViewController.init(pageSizeLWC,pageTokenLWC,sortFieldLWC,sortOrderLWC);
+ system.debug('order detail:' + JSON.serialize(LexInventoryViewController.orderDetZaikuList));
+ orderDetZaikuListLWC = LexInventoryViewController.orderDetZaikuList;
+ System.debug('orderDetZaikuListLWC'+orderDetZaikuListLWC);
+ Map<String, Date> productkucunLWC = LexInventoryViewController.productkucun;
+ LexInventoryViewController.searchConsumableorderdetails(category1,'','','',orderDetZaikuListLWC,accountName,agencyProType,userWorkLocation,pageSizeLWC,pageTokenLWC,sortFieldLWC,sortOrderLWC,productkucunLWC);
+ LexInventoryViewController.searchConsumableorderdetails(category1,Category3,Category4,Category5,orderDetZaikuListLWC,accountName,agencyProType,userWorkLocation,pageSizeLWC,pageTokenLWC,sortFieldLWC,sortOrderLWC,productkucunLWC);
}
- List<String> orderDetZaikuListLWC = new List<String>();
- LexInventoryViewController controller = new LexInventoryViewController();
- Integer pageSizeLWC = 1;
- Integer pageTokenLWC = 0;
- String sortFieldLWC = '';
- String sortOrderLWC = '';
- String category1 = '3400PK:PK閽� 5mm脳33cm';
- String Category3 = '鑵硅厰闀滄墜鏈�';
- String Category4 = 'PK';
- String Category5 = 'G400';
- String accountName = '鎹峰皵鍖荤枟(娴峰崡锛夋湁闄愬叕鍙�';
- string agencyProType = 'ENG';
- string userWorkLocation = '娣卞湷';
- LexInventoryViewController.category1 = category1;
- LexInventoryViewController.Category3 = Category3;
- LexInventoryViewController.Category4 = Category4;
- LexInventoryViewController.Category5 = Category5;
- LexInventoryViewController.orderDetZaikuList = new List<String>();
- LexInventoryViewController.init(pageSizeLWC, pageTokenLWC, sortFieldLWC, sortOrderLWC);
- system.debug('order detail:' + JSON.serialize(LexInventoryViewController.orderDetZaikuList));
- orderDetZaikuListLWC = LexInventoryViewController.orderDetZaikuList;
- System.debug('orderDetZaikuListLWC' + orderDetZaikuListLWC);
- Map<String, Date> productkucunLWC = LexInventoryViewController.productkucun;
- LexInventoryViewController.searchConsumableorderdetails(
- category1,
- '',
- '',
- '',
- orderDetZaikuListLWC,
- accountName,
- agencyProType,
- userWorkLocation,
- pageSizeLWC,
- pageTokenLWC,
- sortFieldLWC,
- sortOrderLWC,
- productkucunLWC
- );
- LexInventoryViewController.searchConsumableorderdetails(
- category1,
- Category3,
- Category4,
- Category5,
- orderDetZaikuListLWC,
- accountName,
- agencyProType,
- userWorkLocation,
- pageSizeLWC,
- pageTokenLWC,
- sortFieldLWC,
- sortOrderLWC,
- productkucunLWC
- );
- }
- }
+ }
- static testMethod void InventoryViewSearchTest() {
+
+ static testMethod void InventoryViewSearchTest(){
user myUser_test;
Account myAccount1;
- User thisUser = [SELECT Id FROM User WHERE Id = :UserInfo.getUserId()];
- System.runAs(thisUser) {
- Profile prof = [
- SELECT Id
- FROM Profile
- WHERE Name = '901_缁忛攢鍟嗙ぞ鍖烘櫘閫氭潈闄恄2閲嶉獙璇�(ET)'
- ];
- List<RecordType> rectCo = [
- SELECT Id
- FROM RecordType
- WHERE IsActive = TRUE AND SobjectType = 'Account' AND Name = '璨╁2搴�'
- ];
- if (rectCo.size() == 0) {
- return;
- }
- myAccount1 = new Account(
- name = 'testaccount001',
- RecordTypeId = rectCo[0].Id,
- Product_Limit_Date__c = 'Test01|2|4,Test02|3|5',
- AgentCode_Ext__c = '9999900'
- );
- insert myAccount1;
- Contact core = new Contact(
- email = 'jplumber@salesforce.com',
- firstname = 'Joe',
- lastname = 'Plumber',
- accountid = myAccount1.id
- );
- insert core;
- myUser_test = new User(
- ContactId = core.id,
- Alias = 'newUser',
- Email = 'newuser@testorg.com',
- EmailEncodingKey = 'UTF-8',
- LastName = 'testUser',
- LanguageLocaleKey = 'zh_CN',
- LocaleSidKey = 'zh_CN',
- ProfileId = prof.Id,
- TimeZoneSidKey = 'Asia/Shanghai',
- UserName = 'testUser@testorg.com'
- );
- insert myUser_test;
+ User thisUser = [ select Id from User where Id = :UserInfo.getUserId()];
+ system.runAs(thisUser){
+ Profile prof = [select Id from Profile where Name ='901_缁忛攢鍟嗙ぞ鍖烘櫘閫氭潈闄恄2閲嶉獙璇�(ET)'];
+ List<RecordType> rectCo = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '璨╁2搴�'];
+ if (rectCo.size() == 0) {
+ return;
}
+ myAccount1 = new Account(name='testaccount001',RecordTypeId = rectCo[0].Id,Product_Limit_Date__c = 'Test01|2|4,Test02|3|5',AgentCode_Ext__c = '9999900');
+ insert myAccount1;
+ Contact core = new Contact(email='jplumber@salesforce.com', firstname='Joe',lastname='Plumber',accountid=myAccount1.id);
+ insert core;
+ myUser_test = New User(ContactId = core.id,Alias = 'newUser',Email='newuser@testorg.com',EmailEncodingKey='UTF-8', LastName='testUser', LanguageLocaleKey='zh_CN',LocaleSidKey='zh_CN', ProfileId = prof.Id,TimeZoneSidKey='Asia/Shanghai', UserName='testUser@testorg.com');
+ insert myUser_test;
+ }
+
+ system.runAs(myUser_test){
+ Product2 prod01 = new Product2(Name='Test01',ProductCode='Test01',Asset_Model_No__c = 'Test01',SFDA_Status__c = '鏈夊姽',Dealer_special_Object__c = true
+ ,Category3__c = 'CDS',Category4__c = 'OER',Category5__c = '鍏跺畠',Manual_Entry__c = false);
+ Product2 prod02 = new Product2(Name='Test02',ProductCode='Test02',Asset_Model_No__c = 'Test02',SFDA_Status__c = '鏈夊姽',Dealer_special_Object__c = true
+ ,Category3__c = 'ENT',Category4__c = 'Celon',Category5__c = 'Celon',Manual_Entry__c = false);
+ Product2 prod03 = new Product2(Name='Test03',ProductCode='Test03',Asset_Model_No__c = 'Test03',SFDA_Status__c = '鏈夊姽',Dealer_special_Object__c = true
+ ,Category3__c = 'US',Category4__c = 'ALOKA',Category5__c = '浣撳瓒呭0',Manual_Entry__c = false);
+ Product2 prod04 = new Product2(Name='Test04',ProductCode='Test04',Asset_Model_No__c = 'Test04',SFDA_Status__c = '鏈夊姽',Dealer_special_Object__c = true
+ ,Category3__c = 'OCS',Category4__c = '闄勫睘鍝�',Category5__c = 'S45',Manual_Entry__c = false);
+ Product2 prod05 = new Product2(Name='Test05',ProductCode='Test05',Asset_Model_No__c = 'Test05',SFDA_Status__c = '鏈夊姽',Dealer_special_Object__c = true
+ ,Category3__c = '鍏夋簮',Category4__c = '闄勫睘鍝�',Category5__c = 'OCS',Manual_Entry__c = false);
+ insert new Product2[] {prod01, prod02, prod03, prod04, prod05};
+ Product2__c pro1 = new Product2__c(Name='Pro001',OT_CODE_Text__c='Test001',Product2__c = prod01.Id);
+ Product2__c pro2 = new Product2__c(Name='Pro002',OT_CODE_Text__c='Test002',Product2__c = prod02.Id);
+ Product2__c pro3 = new Product2__c(Name='Pro003',OT_CODE_Text__c='Test003',Product2__c = prod03.Id);
+ Product2__c pro4 = new Product2__c(Name='Pro004',OT_CODE_Text__c='Test004',Product2__c = prod04.Id);
+ Product2__c pro5 = new Product2__c(Name='Pro005',OT_CODE_Text__c='Test005',Product2__c = prod05.Id);
+ insert new Product2__c[] {pro1, pro2, pro3, pro4, pro5};
- System.runAs(myUser_test) {
- Product2 prod01 = new Product2(
- Name = 'Test01',
- ProductCode = 'Test01',
- Asset_Model_No__c = 'Test01',
- SFDA_Status__c = '鏈夊姽',
- Dealer_special_Object__c = true,
- Category3__c = 'CDS',
- Category4__c = 'OER',
- Category5__c = '鍏跺畠',
- Manual_Entry__c = false
- );
- Product2 prod02 = new Product2(
- Name = 'Test02',
- ProductCode = 'Test02',
- Asset_Model_No__c = 'Test02',
- SFDA_Status__c = '鏈夊姽',
- Dealer_special_Object__c = true,
- Category3__c = 'ENT',
- Category4__c = 'Celon',
- Category5__c = 'Celon',
- Manual_Entry__c = false
- );
- Product2 prod03 = new Product2(
- Name = 'Test03',
- ProductCode = 'Test03',
- Asset_Model_No__c = 'Test03',
- SFDA_Status__c = '鏈夊姽',
- Dealer_special_Object__c = true,
- Category3__c = 'US',
- Category4__c = 'ALOKA',
- Category5__c = '浣撳瓒呭0',
- Manual_Entry__c = false
- );
- Product2 prod04 = new Product2(
- Name = 'Test04',
- ProductCode = 'Test04',
- Asset_Model_No__c = 'Test04',
- SFDA_Status__c = '鏈夊姽',
- Dealer_special_Object__c = true,
- Category3__c = 'OCS',
- Category4__c = '闄勫睘鍝�',
- Category5__c = 'S45',
- Manual_Entry__c = false
- );
- Product2 prod05 = new Product2(
- Name = 'Test05',
- ProductCode = 'Test05',
- Asset_Model_No__c = 'Test05',
- SFDA_Status__c = '鏈夊姽',
- Dealer_special_Object__c = true,
- Category3__c = '鍏夋簮',
- Category4__c = '闄勫睘鍝�',
- Category5__c = 'OCS',
- Manual_Entry__c = false
- );
- insert new List<Product2>{ prod01, prod02, prod03, prod04, prod05 };
- Product2__c pro1 = new Product2__c(Name = 'Pro001', OT_CODE_Text__c = 'Test001', Product2__c = prod01.Id);
- Product2__c pro2 = new Product2__c(Name = 'Pro002', OT_CODE_Text__c = 'Test002', Product2__c = prod02.Id);
- Product2__c pro3 = new Product2__c(Name = 'Pro003', OT_CODE_Text__c = 'Test003', Product2__c = prod03.Id);
- Product2__c pro4 = new Product2__c(Name = 'Pro004', OT_CODE_Text__c = 'Test004', Product2__c = prod04.Id);
- Product2__c pro5 = new Product2__c(Name = 'Pro005', OT_CODE_Text__c = 'Test005', Product2__c = prod05.Id);
- insert new List<Product2__c>{ pro1, pro2, pro3, pro4, pro5 };
+ Consumable_order__c Order1 = new Consumable_order__c();
+ Order1.Name = 'OCM_01_001';
+ Order1.Order_status__c = '鎵瑰噯';
+ Order1.Order_type__c = '璁㈠崟';
+ Order1.Dealer_Info__c = myAccount1.Id;
+ Order1.RecordTypeid = System.Label.RT_ConOrder_Inventory;
+ Order1.Order_ProType__c = 'ET';
+ insert Order1;
- Consumable_order__c Order1 = new Consumable_order__c();
- Order1.Name = 'OCM_01_001';
- Order1.Order_status__c = '鎵瑰噯';
- Order1.Order_type__c = '璁㈠崟';
- Order1.Dealer_Info__c = myAccount1.Id;
- Order1.RecordTypeid = System.Label.RT_ConOrder_Inventory;
- Order1.Order_ProType__c = 'ET';
- insert Order1;
-
- Consumable_order_details2__c Orderdet1 = new Consumable_order_details2__c();
- Orderdet1.Name = 'OCM_01_001001';
- Orderdet1.Consumable_order_minor__c = Order1.Id;
- Orderdet1.Consumable_Product__c = pro1.Id;
- Orderdet1.Consumable_Arrived_order__c = Order1.Id;
- Orderdet1.Sterilization_limit__c = Date.today();
- Orderdet1.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
- Orderdet1.Bar_Code__c = '11111';
- Orderdet1.Arrive_date__c = Date.today().addDays(1);
+ Consumable_order_details2__c Orderdet1 = new Consumable_order_details2__c();
+ Orderdet1.Name = 'OCM_01_001001';
+ Orderdet1.Consumable_order_minor__c = Order1.Id;
+ Orderdet1.Consumable_Product__c = pro1.Id;
+ Orderdet1.Consumable_Arrived_order__c = Order1.Id;
+ Orderdet1.Sterilization_limit__c = Date.today();
+ Orderdet1.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
+ Orderdet1.Bar_Code__c = '11111';
+ Orderdet1.Arrive_date__c = Date.today().addDays(1);
Orderdet1.Send_Date__c = null;
Orderdet1.Used_date__c = null;
Orderdet1.Lose_Flag__c = false;
Consumable_order_details2__c Orderdet2 = new Consumable_order_details2__c();
- Orderdet2.Name = 'OCM_01_001002';
- Orderdet2.Consumable_order_minor__c = Order1.Id;
- Orderdet2.Consumable_Product__c = pro1.Id;
- Orderdet2.Consumable_Arrived_order__c = Order1.Id;
- Orderdet2.Sterilization_limit__c = Date.today();
- Orderdet2.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
- Orderdet2.Bar_Code__c = '22222';
- Orderdet2.Arrive_date__c = Date.today().addDays(1);
+ Orderdet2.Name = 'OCM_01_001002';
+ Orderdet2.Consumable_order_minor__c = Order1.Id;
+ Orderdet2.Consumable_Product__c = pro1.Id;
+ Orderdet2.Consumable_Arrived_order__c = Order1.Id;
+ Orderdet2.Sterilization_limit__c = Date.today();
+ Orderdet2.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
+ Orderdet2.Bar_Code__c = '22222';
+ Orderdet2.Arrive_date__c = Date.today().addDays(1);
Orderdet2.Send_Date__c = null;
Orderdet2.Used_date__c = null;
Orderdet2.Lose_Flag__c = false;
- insert new List<Consumable_order_details2__c>{ Orderdet1, Orderdet2 };
+ insert new Consumable_order_details2__c[] {Orderdet1,Orderdet2};
Integer pageSizeLWC = 1;
Integer pageTokenLWC = 0;
String sortFieldLWC = '';
- String sortOrderLWC = '';
+ String sortOrderLWC ='';
String category3LWC = 'CDS';
String agencyProTypeLWC = 'ENG';
- String category1 = '3400PK:PK閽� 5mm脳33cm';
+ String category1= '3400PK:PK閽� 5mm脳33cm';
String Category3 = '鑵硅厰闀滄墜鏈�';
String Category4 = 'PK';
String Category5 = 'G400';
String accountName = '鎹峰皵鍖荤枟(娴峰崡锛夋湁闄愬叕鍙�';
string agencyProType = 'ENG';
string userWorkLocation = '娣卞湷';
- List<String> orderDetZaikuListLWC = new List<String>();
+ List<String> orderDetZaikuListLWC = new List<String>();
+
- LexInventoryViewController.init(pageSizeLWC, pageTokenLWC, sortFieldLWC, sortOrderLWC);
- LexInventoryViewController.categoryAllload(category3LWC, agencyProTypeLWC);
- LexInventoryViewController.categoryload();
+ LexInventoryViewController.init(pageSizeLWC,pageTokenLWC,sortFieldLWC,sortOrderLWC);
+ LexInventoryViewController.categoryAllload(category3LWC,agencyProTypeLWC);
+ LexInventoryViewController.categoryload();
// LexInventoryViewController.searchConsumableorderdetails(category1,category3,category4,category5,orderDetZaikuListLWC,accountName,agencyProType,userWorkLocation,pageSizeLWC,pageTokenLWC,sortFieldLWC,sortOrderLWC);
- }
- }
+
+ }
+ }
- //add by rentx 2020-12-25 start 鏌ヨ闈炲尰闄㈢壒浠风洅 /涓�
- static testMethod void InventoryViewTest2() {
+ //add by rentx 2020-12-25 start 鏌ヨ闈炲尰闄㈢壒浠风洅 /涓�
+ static testMethod void InventoryViewTest2(){
user myUser_test;
Account myAccount2;
- User thisUser = [SELECT Id FROM User WHERE Id = :UserInfo.getUserId()];
- System.runAs(thisUser) {
- List<RecordType> rectCo = [
- SELECT Id
- FROM RecordType
- WHERE IsActive = TRUE AND SobjectType = 'Account' AND Name = '璨╁2搴�'
- ];
+ User thisUser = [ select Id from User where Id = :UserInfo.getUserId()];
+ system.runAs(thisUser){
+ List<RecordType> rectCo = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '璨╁2搴�'];
if (rectCo.size() == 0) {
return;
}
//Profile prof = [select Id from Profile where Name ='901_缁忛攢鍟嗙ぞ鍖烘櫘閫氭潈闄恄2閲嶉獙璇�'];
- Profile prof = [
- SELECT Id
- FROM Profile
- WHERE Name = '901_缁忛攢鍟嗙ぞ鍖烘櫘閫氭潈闄恄2閲嶉獙璇�(ET)'
- ]; //20200916 ljh update
-
- myAccount2 = new Account(
- name = 'Testaccount002',
- Dealer_discount__c = 20,
- RecordTypeId = rectCo[0].Id,
- Product_Limit_Date__c = 'Test01|5|55,Test02|2|4',
- AgentCode_Ext__c = '9999900'
- );
+ Profile prof = [select Id from Profile where Name ='901_缁忛攢鍟嗙ぞ鍖烘櫘閫氭潈闄恄2閲嶉獙璇�(ET)'];//20200916 ljh update
+
+ myAccount2 = new Account(name='Testaccount002',Dealer_discount__c =20,RecordTypeId = rectCo[0].Id,Product_Limit_Date__c = 'Test01|5|55,Test02|2|4',AgentCode_Ext__c = '9999900');
insert myAccount2;
- Contact core = new Contact(
- email = 'jplumber@salesforce.com',
- firstname = 'Joe',
- lastname = 'Plumber',
- accountid = myAccount2.id
- );
- insert core;
- MyUser_Test = new User(
- ContactId = core.id,
- Alias = 'newUser',
- Email = 'newuser@testorg.com',
- EmailEncodingKey = 'UTF-8',
- LastName = 'TestUser',
- LanguageLocaleKey = 'zh_CN',
- LocaleSidKey = 'zh_CN',
- ProfileId = prof.Id,
- TimeZoneSidKey = 'Asia/Shanghai',
- UserName = 'testUser@testorg.com',
- UserPro_Type__c = 'ET',
- Work_Location__c = '鍖椾含'
- );
+ Contact core = new Contact(email='jplumber@salesforce.com', firstname='Joe',lastname='Plumber',accountid=myAccount2.id);
+ insert core;
+ MyUser_Test = New User(ContactId = core.id,Alias = 'newUser',Email='newuser@testorg.com',EmailEncodingKey='UTF-8', LastName='TestUser', LanguageLocaleKey='zh_CN',LocaleSidKey='zh_CN', ProfileId = prof.Id,TimeZoneSidKey='Asia/Shanghai', UserName='testUser@testorg.com', UserPro_Type__c='ET', Work_Location__c='鍖椾含');
insert MyUser_Test;
}
- System.runAs(MyUser_Test) {
+ system.runAs(MyUser_Test){
System.Test.startTest();
StaticParameter.EscapeConsumableOrderDetail2Trigger = true;
- Product2 prod01 = new Product2(
- Name = 'Test01',
- ProductCode = 'Test01',
- Asset_Model_No__c = 'Test01',
- SFDA_Status__c = '鏈夊姽',
- Dealer_special_Object__c = true,
- SFDA_Approbation_No__c = '12124',
- Packing_list_manual__c = 1,
- SFDA_Expiration_Date__c = Date.today(),
- Manual_Entry__c = false
- );
- Product2 prod02 = new Product2(
- Name = 'Test02',
- ProductCode = 'Test02',
- Asset_Model_No__c = 'Test02',
- SFDA_Status__c = '鏈夊姽',
- Dealer_special_Object__c = true,
- SFDA_Approbation_No__c = '12124',
- Packing_list_manual__c = 1,
- SFDA_Expiration_Date__c = Date.today(),
- Manual_Entry__c = false
- );
- insert new List<Product2>{ prod01, prod02 };
- Product2__c pro1 = new Product2__c(Name = 'Pro001', OT_CODE_Text__c = 'Test001', Product2__c = prod01.Id);
- Product2__c pro2 = new Product2__c(Name = 'Pro002', OT_CODE_Text__c = 'Test002', Product2__c = prod02.Id);
- insert new List<Product2__c>{ pro1, pro2 };
+ Product2 prod01 = new Product2(Name='Test01',ProductCode='Test01',Asset_Model_No__c = 'Test01',SFDA_Status__c = '鏈夊姽',Dealer_special_Object__c = true,SFDA_Approbation_No__c = '12124',Packing_list_manual__c = 1,SFDA_Expiration_Date__c= Date.today(),Manual_Entry__c = false);
+ Product2 prod02 = new Product2(Name='Test02',ProductCode='Test02',Asset_Model_No__c = 'Test02',SFDA_Status__c = '鏈夊姽',Dealer_special_Object__c = true,SFDA_Approbation_No__c = '12124',Packing_list_manual__c = 1,SFDA_Expiration_Date__c= Date.today(),Manual_Entry__c = false);
+ insert new Product2[]{prod01,prod02};
+ Product2__c pro1 = new Product2__c(Name='Pro001',OT_CODE_Text__c='Test001',Product2__c = prod01.Id);
+ Product2__c pro2 = new Product2__c(Name='Pro002',OT_CODE_Text__c='Test002',Product2__c = prod02.Id);
+ insert new Product2__c[] {pro1, pro2};
Consumable_order__c createId = new Consumable_order__c();
createId.Name = 'testMing';
@@ -521,73 +300,73 @@
createId.Order_ProType__c = 'ET';
createId.Dealer_Info__c = myAccount2.Id;
createId.Delivery_detail_count__c = 5;
- insert createId;
+ insert createId;
//pro1 鐩� 鍦ㄥ簱
List<Consumable_order_details2__c> codListTemp = new List<Consumable_order_details2__c>();
Consumable_order_details2__c createDetail2 = new Consumable_order_details2__c();
createDetail2 = new Consumable_order_details2__c();
createDetail2.Consumable_Product__c = pro1.id;
- createDetail2.Asset_Model_No__c = 'Test01';
- createDetail2.Consumable_order_minor__c = createId.id;
+ createDetail2.Asset_Model_No__c = 'Test01';
+ createDetail2.Consumable_order_minor__c = createId.id;
createDetail2.Consumable_Arrived_order__c = createId.id;
createDetail2.RecordTypeid = System.Label.RT_ConOrderDetail2_Delivery;
createDetail2.Asset_Model_No__c = pro1.Asset_Model_No__c;
createDetail2.Bar_Code__c = '123';
- createDetail2.Box_Piece__c = '鐩�';
+ createDetail2.Box_Piece__c ='鐩�';
createDetail2.Arrive_date__c = Date.today();
codListTemp.add(createDetail2);
//insert createDetail2;
Consumable_order_details2__c createDetailpro1 = new Consumable_order_details2__c();
createDetailpro1.Consumable_Product__c = pro1.id;
- createDetailpro1.Asset_Model_No__c = 'Test02';
- createDetailpro1.Consumable_order_minor__c = createId.id;
+ createDetailpro1.Asset_Model_No__c = 'Test02';
+ createDetailpro1.Consumable_order_minor__c = createId.id;
createDetailpro1.Consumable_Arrived_order__c = createId.id;
createDetailpro1.RecordTypeid = System.Label.RT_ConOrderDetail2_Delivery;
- createDetailpro1.Asset_Model_No__c = pro1.Asset_Model_No__c;
+ createDetailpro1.Asset_Model_No__c = pro1.Asset_Model_No__c;
createDetailpro1.Bar_Code__c = '12322';
- createDetailpro1.Box_Piece__c = '鐩�';
- createDetailpro1.Arrive_date__c = Date.today();
+ createDetailpro1.Box_Piece__c ='鐩�';
+ createDetailpro1.Arrive_date__c = Date.today();
codListTemp.add(createDetailpro1);
//insert createDetailpro1;
//pro1 涓� 鍦ㄥ簱
Consumable_order_details2__c createDetailPiece1 = new Consumable_order_details2__c();
createDetailPiece1.Consumable_Product__c = pro1.id;
- createDetailPiece1.Asset_Model_No__c = 'Test03';
- createDetailPiece1.Consumable_order_minor__c = createId.id;
+ createDetailPiece1.Asset_Model_No__c = 'Test03';
+ createDetailPiece1.Consumable_order_minor__c = createId.id;
createDetailPiece1.Consumable_Arrived_order__c = createId.id;
createDetailPiece1.RecordTypeid = System.Label.RT_ConOrderDetail2_Delivery;
- createDetailPiece1.Asset_Model_No__c = pro1.Asset_Model_No__c;
+ createDetailPiece1.Asset_Model_No__c = pro1.Asset_Model_No__c;
createDetailPiece1.Bar_Code__c = '23456';
- createDetailPiece1.Box_Piece__c = '涓�';
- createDetailPiece1.Arrive_date__c = Date.today();
+ createDetailPiece1.Box_Piece__c ='涓�';
+ createDetailPiece1.Arrive_date__c = Date.today();
codListTemp.add(createDetailPiece1);
//insert createDetailPiece1;
Consumable_order_details2__c createDetailPiece2 = new Consumable_order_details2__c();
createDetailPiece2.Consumable_Product__c = pro1.id;
- createDetailPiece2.Asset_Model_No__c = 'Test04';
- createDetailPiece2.Consumable_order_minor__c = createId.id;
+ createDetailPiece2.Asset_Model_No__c = 'Test04';
+ createDetailPiece2.Consumable_order_minor__c = createId.id;
createDetailPiece2.Consumable_Arrived_order__c = createId.id;
createDetailPiece2.RecordTypeid = System.Label.RT_ConOrderDetail2_Delivery;
- createDetailPiece2.Asset_Model_No__c = pro1.Asset_Model_No__c;
+ createDetailPiece2.Asset_Model_No__c = pro1.Asset_Model_No__c;
createDetailPiece2.Bar_Code__c = '122345';
- createDetailPiece2.Box_Piece__c = '涓�';
- createDetailPiece2.Arrive_date__c = Date.today();
+ createDetailPiece2.Box_Piece__c ='涓�';
+ createDetailPiece2.Arrive_date__c = Date.today();
codListTemp.add(createDetailPiece2);
- //insert createDetailPiece2;
+ //insert createDetailPiece2;
//pro1 鐩� 鍦ㄥ簱 杩囨湡
Consumable_order_details2__c createDetail21 = new Consumable_order_details2__c();
createDetail21.Consumable_Product__c = pro1.id;
- createDetail21.Asset_Model_No__c = 'Test01';
+ createDetail21.Asset_Model_No__c = 'Test01';
createDetail21.Sterilization_limit__c = Date.today();
createDetail21.RecordTypeid = System.Label.RT_ConOrderDetail2_Delivery;
//createDetail.IsArrival__c = true;
- createDetail21.Asset_Model_No__c = prod02.Asset_Model_No__c;
+ createDetail21.Asset_Model_No__c = prod02.Asset_Model_No__c;
createDetail21.Bar_Code__c = '1223';
- createDetail21.Box_Piece__c = '鐩�';
- createDetail21.Arrive_date__c = Date.today();
- createDetail21.Deliver_date__c = Date.today().addDays(-8);
- createDetail21.Sterilization_limit__c = Date.today().addDays(-8);
+ createDetail21.Box_Piece__c ='鐩�';
+ createDetail21.Arrive_date__c = Date.today();
+ createDetail21.Deliver_date__c =Date.today().addDays(-8);
+ createDetail21.Sterilization_limit__c =Date.today().addDays(-8);
codListTemp.add(createDetail21);
//insert createDetail2;
insert codListTemp;
@@ -613,101 +392,50 @@
Integer pageSizeLWC = 1;
Integer pageTokenLWC = 0;
String sortFieldLWC = '';
- String sortOrderLWC = '';
+ String sortOrderLWC ='';
String category3LWC = 'CDS';
String agencyProTypeLWC = 'ENG';
// LexInventoryViewController.init(pageSizeLWC,pageTokenLWC,sortFieldLWC,sortOrderLWC);
- LexInventoryViewController.categoryAllload('CDS', '鎹峰皵鍖荤枟(娴峰崡锛夋湁闄愬叕鍙�');
+ LexInventoryViewController.categoryAllload('CDS','鎹峰皵鍖荤枟(娴峰崡锛夋湁闄愬叕鍙�');
LexInventoryViewController.categoryload();
- LexInventoryViewController.categoryAllload('鍏夋簮', '鎹峰皵鍖荤枟(娴峰崡锛夋湁闄愬叕鍙�');
+ LexInventoryViewController.categoryAllload('鍏夋簮','鎹峰皵鍖荤枟(娴峰崡锛夋湁闄愬叕鍙�');
LexInventoryViewController.categoryload();
System.Test.stopTest();
- }
- }
+ }
+ }
- static testMethod void InventoryViewTest3() {
+ static testMethod void InventoryViewTest3(){
user myUser_test;
Account myAccount2;
- User thisUser = [SELECT Id FROM User WHERE Id = :UserInfo.getUserId()];
- System.runAs(thisUser) {
- List<RecordType> rectCo = [
- SELECT Id
- FROM RecordType
- WHERE IsActive = TRUE AND SobjectType = 'Account' AND Name = '璨╁2搴�'
- ];
- if (rectCo.size() == 0) {
- return;
- }
- //Profile prof = [select Id from Profile where Name ='901_缁忛攢鍟嗙ぞ鍖烘櫘閫氭潈闄恄2閲嶉獙璇�'];
- // Profile prof = [select Id from Profile where Name ='901_缁忛攢鍟嗙ぞ鍖烘櫘閫氭潈闄恄2閲嶉獙璇�(Email)'];//20200916 ljh update
- Profile prof = [
- SELECT Id
- FROM Profile
- WHERE Name = '901_缁忛攢鍟嗙ぞ鍖烘櫘閫氭潈闄恄2閲嶉獙璇�(ET Email)'
- ]; //20210329 RTX update
-
- myAccount2 = new Account(
- name = 'Testaccount002',
- Dealer_discount__c = 20,
- RecordTypeId = rectCo[0].Id,
- Product_Limit_Date__c = 'Test01|5|55,Test02|2|4',
- AgentCode_Ext__c = '9999900'
- );
- insert myAccount2;
-
- Contact core = new Contact(
- email = 'jplumber@salesforce.com',
- firstname = 'Joe',
- lastname = 'Plumber',
- accountid = myAccount2.id
- );
- insert core;
- MyUser_Test = new User(
- ContactId = core.id,
- Alias = 'newUser',
- Email = 'newuser@testorg.com',
- EmailEncodingKey = 'UTF-8',
- LastName = 'TestUser',
- LanguageLocaleKey = 'zh_CN',
- LocaleSidKey = 'zh_CN',
- ProfileId = prof.Id,
- TimeZoneSidKey = 'Asia/Shanghai',
- UserName = 'testUser@testorg.com',
- UserPro_Type__c = 'ENG',
- Work_Location__c = '鍖椾含'
- );
- insert MyUser_Test;
+ User thisUser = [ select Id from User where Id = :UserInfo.getUserId()];
+ system.runAs(thisUser){
+ List<RecordType> rectCo = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '璨╁2搴�'];
+ if (rectCo.size() == 0) {
+ return;
}
+ //Profile prof = [select Id from Profile where Name ='901_缁忛攢鍟嗙ぞ鍖烘櫘閫氭潈闄恄2閲嶉獙璇�'];
+ // Profile prof = [select Id from Profile where Name ='901_缁忛攢鍟嗙ぞ鍖烘櫘閫氭潈闄恄2閲嶉獙璇�(Email)'];//20200916 ljh update
+ Profile prof = [select Id from Profile where Name ='901_缁忛攢鍟嗙ぞ鍖烘櫘閫氭潈闄恄2閲嶉獙璇�(ET Email)'];//20210329 RTX update
+
+ myAccount2 = new Account(name='Testaccount002',Dealer_discount__c =20,RecordTypeId = rectCo[0].Id,Product_Limit_Date__c = 'Test01|5|55,Test02|2|4',AgentCode_Ext__c = '9999900');
+ insert myAccount2;
- System.runAs(MyUser_Test) {
+ Contact core = new Contact(email='jplumber@salesforce.com', firstname='Joe',lastname='Plumber',accountid=myAccount2.id);
+ insert core;
+ MyUser_Test = New User(ContactId = core.id,Alias = 'newUser',Email='newuser@testorg.com',EmailEncodingKey='UTF-8', LastName='TestUser', LanguageLocaleKey='zh_CN',LocaleSidKey='zh_CN', ProfileId = prof.Id,TimeZoneSidKey='Asia/Shanghai', UserName='testUser@testorg.com', UserPro_Type__c='ENG', Work_Location__c='鍖椾含');
+ insert MyUser_Test;
+
+ }
+
+ system.runAs(MyUser_Test){
System.Test.startTest();
StaticParameter.EscapeConsumableOrderDetail2Trigger = true;
- Product2 prod01 = new Product2(
- Name = 'Test01',
- ProductCode = 'Test01',
- Asset_Model_No__c = 'Test01',
- SFDA_Status__c = '鏈夊姽',
- Dealer_special_Object__c = true,
- SFDA_Approbation_No__c = '12124',
- Packing_list_manual__c = 1,
- SFDA_Expiration_Date__c = Date.today(),
- Manual_Entry__c = false
- );
- Product2 prod02 = new Product2(
- Name = 'Test02',
- ProductCode = 'Test02',
- Asset_Model_No__c = 'Test02',
- SFDA_Status__c = '鏈夊姽',
- Dealer_special_Object__c = true,
- SFDA_Approbation_No__c = '12124',
- Packing_list_manual__c = 1,
- SFDA_Expiration_Date__c = Date.today(),
- Manual_Entry__c = false
- );
- insert new List<Product2>{ prod01, prod02 };
- Product2__c pro1 = new Product2__c(Name = 'Pro001', OT_CODE_Text__c = 'Test001', Product2__c = prod01.Id);
- Product2__c pro2 = new Product2__c(Name = 'Pro002', OT_CODE_Text__c = 'Test002', Product2__c = prod02.Id);
- insert new List<Product2__c>{ pro1, pro2 };
+ Product2 prod01 = new Product2(Name='Test01',ProductCode='Test01',Asset_Model_No__c = 'Test01',SFDA_Status__c = '鏈夊姽',Dealer_special_Object__c = true,SFDA_Approbation_No__c = '12124',Packing_list_manual__c = 1,SFDA_Expiration_Date__c= Date.today(),Manual_Entry__c = false);
+ Product2 prod02 = new Product2(Name='Test02',ProductCode='Test02',Asset_Model_No__c = 'Test02',SFDA_Status__c = '鏈夊姽',Dealer_special_Object__c = true,SFDA_Approbation_No__c = '12124',Packing_list_manual__c = 1,SFDA_Expiration_Date__c= Date.today(),Manual_Entry__c = false);
+ insert new Product2[]{prod01,prod02};
+ Product2__c pro1 = new Product2__c(Name='Pro001',OT_CODE_Text__c='Test001',Product2__c = prod01.Id);
+ Product2__c pro2 = new Product2__c(Name='Pro002',OT_CODE_Text__c='Test002',Product2__c = prod02.Id);
+ insert new Product2__c[] {pro1, pro2};
Consumable_order__c createId = new Consumable_order__c();
createId.Name = 'testMing1';
@@ -720,71 +448,71 @@
createId.Dealer_Info__c = myAccount2.Id;
createId.Delivery_detail_count__c = 5;
createId.orderPattern__c = 'hospitalorder';
- insert createId;
+ insert createId;
//pro1 鐩� 鍦ㄥ簱
Consumable_order_details2__c createDetail2 = new Consumable_order_details2__c();
createDetail2.Consumable_Product__c = pro1.id;
- createDetail2.Asset_Model_No__c = 'Test01';
- createDetail2.Consumable_order_minor__c = createId.id;
+ createDetail2.Asset_Model_No__c = 'Test01';
+ createDetail2.Consumable_order_minor__c = createId.id;
createDetail2.Consumable_Arrived_order__c = createId.id;
createDetail2.RecordTypeid = System.Label.RT_ConOrderDetail2_Delivery;
createDetail2.Asset_Model_No__c = pro1.Asset_Model_No__c;
createDetail2.Bar_Code__c = '123';
- createDetail2.Box_Piece__c = '鐩�';
+ createDetail2.Box_Piece__c ='鐩�';
createDetail2.Arrive_date__c = Date.today();
insert createDetail2;
List<Consumable_order_details2__c> codListTemp = new List<Consumable_order_details2__c>();
Consumable_order_details2__c createDetailpro1 = new Consumable_order_details2__c();
createDetailpro1.Consumable_Product__c = pro1.id;
- createDetailpro1.Asset_Model_No__c = 'Test02';
- createDetailpro1.Consumable_order_minor__c = createId.id;
+ createDetailpro1.Asset_Model_No__c = 'Test02';
+ createDetailpro1.Consumable_order_minor__c = createId.id;
createDetailpro1.Consumable_Arrived_order__c = createId.id;
createDetailpro1.RecordTypeid = System.Label.RT_ConOrderDetail2_Delivery;
- createDetailpro1.Asset_Model_No__c = pro1.Asset_Model_No__c;
+ createDetailpro1.Asset_Model_No__c = pro1.Asset_Model_No__c;
createDetailpro1.Bar_Code__c = '12322';
- createDetailpro1.Box_Piece__c = '鐩�';
- createDetailpro1.Arrive_date__c = Date.today();
+ createDetailpro1.Box_Piece__c ='鐩�';
+ createDetailpro1.Arrive_date__c = Date.today();
//insert createDetailpro1;
codListTemp.add(createDetailpro1);
//pro1 涓� 鍦ㄥ簱
Consumable_order_details2__c createDetailPiece1 = new Consumable_order_details2__c();
createDetailPiece1.Consumable_Product__c = pro1.id;
- createDetailPiece1.Asset_Model_No__c = 'Test03';
- createDetailPiece1.Consumable_order_minor__c = createId.id;
+ createDetailPiece1.Asset_Model_No__c = 'Test03';
+ createDetailPiece1.Consumable_order_minor__c = createId.id;
createDetailPiece1.Consumable_Arrived_order__c = createId.id;
createDetailPiece1.RecordTypeid = System.Label.RT_ConOrderDetail2_Delivery;
- createDetailPiece1.Asset_Model_No__c = pro1.Asset_Model_No__c;
+ createDetailPiece1.Asset_Model_No__c = pro1.Asset_Model_No__c;
createDetailPiece1.Bar_Code__c = '23456';
- createDetailPiece1.Box_Piece__c = '涓�';
- createDetailPiece1.Arrive_date__c = Date.today();
+ createDetailPiece1.Box_Piece__c ='涓�';
+ createDetailPiece1.Arrive_date__c = Date.today();
codListTemp.add(createDetailPiece1);
//insert createDetailPiece1;
Consumable_order_details2__c createDetailPiece2 = new Consumable_order_details2__c();
createDetailPiece2.Consumable_Product__c = pro1.id;
- createDetailPiece2.Asset_Model_No__c = 'Test04';
- createDetailPiece2.Consumable_order_minor__c = createId.id;
+ createDetailPiece2.Asset_Model_No__c = 'Test04';
+ createDetailPiece2.Consumable_order_minor__c = createId.id;
createDetailPiece2.Consumable_Arrived_order__c = createId.id;
createDetailPiece2.RecordTypeid = System.Label.RT_ConOrderDetail2_Delivery;
- createDetailPiece2.Asset_Model_No__c = pro1.Asset_Model_No__c;
+ createDetailPiece2.Asset_Model_No__c = pro1.Asset_Model_No__c;
createDetailPiece2.Bar_Code__c = '122345';
- createDetailPiece2.Box_Piece__c = '涓�';
- createDetailPiece2.Arrive_date__c = Date.today();
+ createDetailPiece2.Box_Piece__c ='涓�';
+ createDetailPiece2.Arrive_date__c = Date.today();
codListTemp.add(createDetailPiece2);
//insert createDetailPiece2;
//pro1 鐩� 鍦ㄥ簱 杩囨湡
- Consumable_order_details2__c createDetail21 = new Consumable_order_details2__c();
+ Consumable_order_details2__c createDetail21 = new Consumable_order_details2__c();
createDetail21.Consumable_Product__c = pro1.id;
- createDetail21.Asset_Model_No__c = 'Test01';
+ createDetail21.Asset_Model_No__c = 'Test01';
createDetail21.Sterilization_limit__c = Date.today();
createDetail21.RecordTypeid = System.Label.RT_ConOrderDetail2_Delivery;
//createDetail.IsArrival__c = true;
- createDetail21.Asset_Model_No__c = prod02.Asset_Model_No__c;
+ createDetail21.Asset_Model_No__c = prod02.Asset_Model_No__c;
createDetail21.Bar_Code__c = '1223';
- createDetail21.Box_Piece__c = '鐩�';
- createDetail21.Arrive_date__c = Date.today();
- createDetail21.Deliver_date__c = Date.today().addDays(-8);
- createDetail21.Sterilization_limit__c = Date.today().addDays(-8);
+ createDetail21.Box_Piece__c ='鐩�';
+ createDetail21.Arrive_date__c = Date.today();
+ createDetail21.Deliver_date__c =Date.today().addDays(-8);
+ createDetail21.Sterilization_limit__c =Date.today().addDays(-8);
codListTemp.add(createDetail21);
//insert createDetail21;
insert codListTemp;
@@ -810,8 +538,8 @@
Integer pageSizeLWC = 1;
Integer pageTokenLWC = 0;
String sortFieldLWC = '';
- String sortOrderLWC = '';
- String category1 = '3400PK:PK閽� 5mm脳33cm';
+ String sortOrderLWC ='';
+ String category1= '3400PK:PK閽� 5mm脳33cm';
String Category3 = '鑵硅厰闀滄墜鏈�';
String Category4 = 'PK';
String Category5 = 'G400';
@@ -825,354 +553,216 @@
LexInventoryViewController.Category5 = Category5;
// LexInventoryViewController.init(pageSizeLWC,pageTokenLWC,sortFieldLWC,sortOrderLWC);
// LexInventoryViewController.searchConsumableorderdetails(category1,category3,category4,category5,orderDetZaikuListLWC,accountName,agencyProType,userWorkLocation,pageSizeLWC,pageTokenLWC,sortFieldLWC,sortOrderLWC);
- LexInventoryViewController.categoryAllload('CDS', '鎹峰皵鍖荤枟(娴峰崡锛夋湁闄愬叕鍙�');
+ LexInventoryViewController.categoryAllload('CDS','鎹峰皵鍖荤枟(娴峰崡锛夋湁闄愬叕鍙�');
LexInventoryViewController.categoryload();
- LexInventoryViewController.categoryAllload('鍏夋簮', '鎹峰皵鍖荤枟(娴峰崡锛夋湁闄愬叕鍙�');
+ LexInventoryViewController.categoryAllload('鍏夋簮','鎹峰皵鍖荤枟(娴峰崡锛夋湁闄愬叕鍙�');
LexInventoryViewController.categoryload();
- }
- }
- static testMethod void InventoryViewTest4() {
+ }
+ }
+ static testMethod void InventoryViewTest4(){
user myUser_test;
Account myAccount2;
- User thisUser = [SELECT Id FROM User WHERE Id = :UserInfo.getUserId()];
- System.runAs(thisUser) {
- List<RecordType> rectCo = [
- SELECT Id
- FROM RecordType
- WHERE IsActive = TRUE AND SobjectType = 'Account' AND Name = '璨╁2搴�'
- ];
- if (rectCo.size() == 0) {
- return;
- }
- Profile prof = [
- SELECT Id
- FROM Profile
- WHERE Name = '901_缁忛攢鍟嗙ぞ鍖烘櫘閫氭潈闄恄2閲嶉獙璇�(ET Email)'
- ]; //20210329 RTX update
-
- myAccount2 = new Account(
- name = 'Testaccount002',
- Dealer_discount__c = 20,
- RecordTypeId = rectCo[0].Id,
- Product_Limit_Date__c = 'Test01|5|55,Test02|2|4',
- AgentCode_Ext__c = '9999900'
- );
- insert myAccount2;
-
- Contact core = new Contact(
- email = 'jplumber@salesforce.com',
- firstname = 'Joe',
- lastname = 'Plumber',
- accountid = myAccount2.id
- );
- insert core;
- MyUser_Test = new User(
- ContactId = core.id,
- Alias = 'newUser',
- Email = 'newuser@testorg.com',
- EmailEncodingKey = 'UTF-8',
- LastName = 'TestUser',
- LanguageLocaleKey = 'zh_CN',
- LocaleSidKey = 'zh_CN',
- ProfileId = prof.Id,
- TimeZoneSidKey = 'Asia/Shanghai',
- UserName = 'testUser@testorg.com',
- UserPro_Type__c = 'ET',
- Work_Location__c = '娴庡崡'
- );
- insert MyUser_Test;
+ User thisUser = [ select Id from User where Id = :UserInfo.getUserId()];
+ system.runAs(thisUser){
+ List<RecordType> rectCo = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '璨╁2搴�'];
+ if (rectCo.size() == 0) {
+ return;
}
- System.runAs(MyUser_Test) {
+ Profile prof = [select Id from Profile where Name ='901_缁忛攢鍟嗙ぞ鍖烘櫘閫氭潈闄恄2閲嶉獙璇�(ET Email)'];//20210329 RTX update
+
+ myAccount2 = new Account(name='Testaccount002',Dealer_discount__c =20,RecordTypeId = rectCo[0].Id,Product_Limit_Date__c = 'Test01|5|55,Test02|2|4',AgentCode_Ext__c = '9999900');
+ insert myAccount2;
+
+ Contact core = new Contact(email='jplumber@salesforce.com', firstname='Joe',lastname='Plumber',accountid=myAccount2.id);
+ insert core;
+ MyUser_Test = New User(ContactId = core.id,Alias = 'newUser',Email='newuser@testorg.com',EmailEncodingKey='UTF-8', LastName='TestUser', LanguageLocaleKey='zh_CN',LocaleSidKey='zh_CN', ProfileId = prof.Id,TimeZoneSidKey='Asia/Shanghai', UserName='testUser@testorg.com', UserPro_Type__c='ET', Work_Location__c='娴庡崡');
+ insert MyUser_Test;
+
+ }
+ system.runAs(MyUser_Test){
Integer pageSizeLWC = 1;
Integer pageTokenLWC = 0;
String sortFieldLWC = '';
- String sortOrderLWC = '';
- String category1 = '3400PK:PK閽� 5mm脳33cm';
+ String sortOrderLWC ='';
+ String category1= '3400PK:PK閽� 5mm脳33cm';
String Category3 = '鑵硅厰闀滄墜鏈�';
String Category4 = 'PK';
String Category5 = 'G400';
String accountName = 'Testaccount002';
string agencyProType = 'ET';
string userWorkLocation = '娴庡崡';
- List<String> orderDetZaikuListLWC = new List<String>();
+ List<String> orderDetZaikuListLWC = new List<String>();
List<String> productCodeList = new List<String>();
- Product2 prod01 = new Product2(
- Name = 'Test01',
- ProductCode = 'Test01',
- Asset_Model_No__c = 'Test01',
- SFDA_Status__c = '鏈夊姽',
- Dealer_special_Object__c = true,
- SFDA_Approbation_No__c = '12124',
- Packing_list_manual__c = 1,
- SFDA_Expiration_Date__c = Date.today(),
- Manual_Entry__c = false
- );
- Product2 prod02 = new Product2(
- Name = 'Test02',
- ProductCode = 'Test02',
- Asset_Model_No__c = 'Test02',
- SFDA_Status__c = '鏈夊姽',
- Dealer_special_Object__c = true,
- SFDA_Approbation_No__c = '12124',
- Packing_list_manual__c = 1,
- SFDA_Expiration_Date__c = Date.today(),
- Manual_Entry__c = false
- );
- insert new List<Product2>{ prod01, prod02 };
- Product2__c pro1 = new Product2__c(Name = 'Pro001', OT_CODE_Text__c = 'Test001', Product2__c = prod01.Id);
- Product2__c pro2 = new Product2__c(Name = 'Pro002', OT_CODE_Text__c = 'Test002', Product2__c = prod02.Id);
- insert new List<Product2__c>{ pro1, pro2 };
+ Product2 prod01 = new Product2(Name='Test01',ProductCode='Test01',Asset_Model_No__c = 'Test01',SFDA_Status__c = '鏈夊姽',Dealer_special_Object__c = true,SFDA_Approbation_No__c = '12124',Packing_list_manual__c = 1,SFDA_Expiration_Date__c= Date.today(),Manual_Entry__c = false);
+ Product2 prod02 = new Product2(Name='Test02',ProductCode='Test02',Asset_Model_No__c = 'Test02',SFDA_Status__c = '鏈夊姽',Dealer_special_Object__c = true,SFDA_Approbation_No__c = '12124',Packing_list_manual__c = 1,SFDA_Expiration_Date__c= Date.today(),Manual_Entry__c = false);
+ insert new Product2[]{prod01,prod02};
+ Product2__c pro1 = new Product2__c(Name='Pro001',OT_CODE_Text__c='Test001',Product2__c = prod01.Id);
+ Product2__c pro2 = new Product2__c(Name='Pro002',OT_CODE_Text__c='Test002',Product2__c = prod02.Id);
+ insert new Product2__c[] {pro1, pro2};
- Consumable_order__c Order1 = new Consumable_order__c();
- Order1.Name = 'OCM_01_001';
- Order1.Order_status__c = '鎵瑰噯';
- Order1.Order_type__c = '璁㈠崟';
- Order1.Dealer_Info__c = myAccount2.Id;
- Order1.RecordTypeid = System.Label.RT_ConOrder_Delivery;
- Order1.Order_ProType__c = 'ENG';
- insert Order1;
- Consumable_order__c Order2 = new Consumable_order__c();
- Order2.Name = 'OCM_01_003';
- Order2.Order_status__c = '鎵瑰噯';
- Order2.Order_type__c = '璁㈠崟';
- Order2.Dealer_Info__c = myAccount2.Id;
- Order2.RecordTypeid = System.Label.RT_ConOrder_Delivery;
- Order2.Order_ProType__c = 'ET';
- insert Order2;
- List<Consumable_order_details2__c> conList = new List<Consumable_order_details2__c>();
+ Consumable_order__c Order1 = new Consumable_order__c();
+ Order1.Name = 'OCM_01_001';
+ Order1.Order_status__c = '鎵瑰噯';
+ Order1.Order_type__c = '璁㈠崟';
+ Order1.Dealer_Info__c = myAccount2.Id;
+ Order1.RecordTypeid = System.Label.RT_ConOrder_Delivery;
+ Order1.Order_ProType__c = 'ENG';
+ insert Order1;
+ Consumable_order__c Order2 = new Consumable_order__c();
+ Order2.Name = 'OCM_01_003';
+ Order2.Order_status__c = '鎵瑰噯';
+ Order2.Order_type__c = '璁㈠崟';
+ Order2.Dealer_Info__c = myAccount2.Id;
+ Order2.RecordTypeid = System.Label.RT_ConOrder_Delivery;
+ Order2.Order_ProType__c = 'ET';
+ insert Order2;
+ List<Consumable_order_details2__c> conList = new List<Consumable_order_details2__c>();
+
+ Consumable_order_details2__c Orderdet2 = new Consumable_order_details2__c();
+ Orderdet2.Name = 'OCM_01_001002';
+ //Orderdet2.Consumable_principal__c = Order1.Id;
+ Orderdet2.Consumable_order_minor__c = Order1.Id;
+ Orderdet2.Consumable_Product__c = pro1.Id;
+ Orderdet2.Consumable_Arrived_order__c = Order1.Id;
+ //Orderdet2.IsArrival__c = true;
+ Orderdet2.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
+ Orderdet2.Bar_Code__c = '22222';
+ Orderdet2.Arrive_date__c = Date.today().addDays(1);
+ Orderdet2.Send_Date__c = null;
+ Orderdet2.Used_date__c = Date.today();
+ Orderdet2.Lose_Flag__c = false;
+ Orderdet2.Box_Piece__c = '涓�';
+ Orderdet2.Sterilization_limit__c= Date.today();
+ Orderdet2.Return_date__c = Date.today();
+ Orderdet2.Bar_Code__c = '1683272847250250WZIOF';
+ Orderdet2.Cancellation_Flag__c = FALSE;
+ conList.add(Orderdet2);
- Consumable_order_details2__c Orderdet2 = new Consumable_order_details2__c();
- Orderdet2.Name = 'OCM_01_001002';
- //Orderdet2.Consumable_principal__c = Order1.Id;
- Orderdet2.Consumable_order_minor__c = Order1.Id;
- Orderdet2.Consumable_Product__c = pro1.Id;
- Orderdet2.Consumable_Arrived_order__c = Order1.Id;
- //Orderdet2.IsArrival__c = true;
- Orderdet2.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
- Orderdet2.Bar_Code__c = '22222';
- Orderdet2.Arrive_date__c = Date.today().addDays(1);
- Orderdet2.Send_Date__c = null;
- Orderdet2.Used_date__c = Date.today();
- Orderdet2.Lose_Flag__c = false;
- Orderdet2.Box_Piece__c = '涓�';
- Orderdet2.Sterilization_limit__c = Date.today();
- Orderdet2.Return_date__c = Date.today();
- Orderdet2.Bar_Code__c = '1683272847250250WZIOF';
- Orderdet2.Cancellation_Flag__c = false;
- conList.add(Orderdet2);
-
- Consumable_order_details2__c Orderdet3 = new Consumable_order_details2__c();
- Orderdet3.Arrive_date__c = Date.today();
- Orderdet3.Send_Date__c = null;
- Orderdet3.Used_date__c = null;
- Orderdet3.Return_date__c = null;
- Orderdet3.Lose_Flag__c = false;
- Orderdet3.Cancellation_Flag__c = false;
- Orderdet3.Bar_Code__c = '1234';
- Orderdet3.Consumable_order_minor__c = Order2.Id;
+ Consumable_order_details2__c Orderdet3 = new Consumable_order_details2__c();
+ Orderdet3.Arrive_date__c = Date.today();
+ Orderdet3.Send_Date__c = null;
+ Orderdet3.Used_date__c = null;
+ Orderdet3.Return_date__c = null;
+ Orderdet3.Lose_Flag__c = FALSE;
+ Orderdet3.Cancellation_Flag__c = FALSE;
+ Orderdet3.Bar_Code__c = '1234';
+ Orderdet3.Consumable_order_minor__c = Order2.Id;
Orderdet2.Consumable_Product__c = pro1.Id;
Orderdet3.Consumable_Arrived_order__c = Order2.Id;
Orderdet3.Recordtypeid = '01210000000kUDKAA2';
- Orderdet3.Sterilization_limit__c = Date.today().addDays(1);
+ Orderdet3.Sterilization_limit__c = Date.today().addDays(1);
conList.add(Orderdet3);
insert conList;
- System.debug('conList==>' + conList);
+ System.debug('conList==>'+conList);
+
LexInventoryViewController.category1 = category1;
LexInventoryViewController.Category3 = Category3;
LexInventoryViewController.Category4 = Category4;
LexInventoryViewController.Category5 = Category5;
// LexInventoryViewController.init(pageSizeLWC,pageTokenLWC,sortFieldLWC,sortOrderLWC);
- Map<String, Date> productkucunLWC = LexInventoryViewController.productkucun;
- LexInventoryViewController.searchConsumableorderdetails(
- category1,
- category3,
- category4,
- category5,
- orderDetZaikuListLWC,
- accountName,
- agencyProType,
- userWorkLocation,
- pageSizeLWC,
- pageTokenLWC,
- sortFieldLWC,
- sortOrderLWC,
- productkucunLWC
- );
- LexInventoryViewController.categoryAllload('CDS', '鎹峰皵鍖荤枟(娴峰崡锛夋湁闄愬叕鍙�');
+ Map<String, Date> productkucunLWC = LexInventoryViewController.productkucun;
+ LexInventoryViewController.searchConsumableorderdetails(category1,category3,category4,category5,orderDetZaikuListLWC ,accountName,agencyProType,userWorkLocation,pageSizeLWC,pageTokenLWC,sortFieldLWC,sortOrderLWC,productkucunLWC);
+ LexInventoryViewController.categoryAllload('CDS','鎹峰皵鍖荤枟(娴峰崡锛夋湁闄愬叕鍙�');
LexInventoryViewController.categoryload();
- LexInventoryViewController.categoryAllload('鍏夋簮', '鎹峰皵鍖荤枟(娴峰崡锛夋湁闄愬叕鍙�');
+ LexInventoryViewController.categoryAllload('鍏夋簮','鎹峰皵鍖荤枟(娴峰崡锛夋湁闄愬叕鍙�');
LexInventoryViewController.categoryload();
// LexInventoryViewController.searchConsumableorderdetails(category1,category3,category4,category5,orderDetZaikuListLWC ,accountName,agencyProType,
// userWorkLocation,pageSizeLWC,pageTokenLWC,sortFieldLWC,sortOrderLWC);
}
}
- static testMethod void supplementTest() {
+ static testMethod void supplementTest(){
user myUser_test;
Account myAccount1;
- User thisUser = [SELECT Id FROM User WHERE Id = :UserInfo.getUserId()];
- System.runAs(thisUser) {
- Profile prof = [
- SELECT Id
- FROM Profile
- WHERE Name = '901_缁忛攢鍟嗙ぞ鍖烘櫘閫氭潈闄恄2閲嶉獙璇�(ET)'
- ];
- List<RecordType> rectCo = [
- SELECT Id
- FROM RecordType
- WHERE IsActive = TRUE AND SobjectType = 'Account' AND Name = '璨╁2搴�'
- ];
+ User thisUser = [ select Id from User where Id = :UserInfo.getUserId()];
+ system.runAs(thisUser){
+ Profile prof = [select Id from Profile where Name ='901_缁忛攢鍟嗙ぞ鍖烘櫘閫氭潈闄恄2閲嶉獙璇�(ET)'];
+ List<RecordType> rectCo = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '璨╁2搴�'];
if (rectCo.size() == 0) {
return;
}
- List<RecordType> rectHos = [
- SELECT Id
- FROM RecordType
- WHERE IsActive = TRUE AND SobjectType = 'Account' AND Name = '鐥呴櫌'
- ];
+ List<RecordType> rectHos = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '鐥呴櫌'];
if (rectHos.size() == 0) {
return;
}
-
- myAccount1 = new Account(
- name = 'testaccount001',
- RecordTypeId = rectCo[0].Id,
- Product_Limit_Date__c = 'Test01|2|4,Test02|3|5',
- AgentCode_Ext__c = '9999900'
- );
+
+ myAccount1 = new Account(name='testaccount001',RecordTypeId = rectCo[0].Id,Product_Limit_Date__c = 'Test01|2|4,Test02|3|5' ,AgentCode_Ext__c = '9999900');
insert myAccount1;
- Contact core = new Contact(
- email = 'jplumber@salesforce.com',
- firstname = 'Joe',
- lastname = 'Plumber',
- accountid = myAccount1.id
- );
+ Contact core = new Contact(email='jplumber@salesforce.com', firstname='Joe',lastname='Plumber',accountid=myAccount1.id);
insert core;
- myUser_test = new User(
- ContactId = core.id,
- Alias = 'newUser',
- Email = 'newuser@testorg.com',
- EmailEncodingKey = 'UTF-8',
- LastName = 'testUser',
- LanguageLocaleKey = 'zh_CN',
- LocaleSidKey = 'zh_CN',
- ProfileId = prof.Id,
- TimeZoneSidKey = 'Asia/Shanghai',
- UserName = 'testUser@testorg.com',
- Work_Location__c = '娣卞湷'
- );
+ myUser_test = New User(ContactId = core.id,Alias = 'newUser',Email='newuser@testorg.com',EmailEncodingKey='UTF-8', LastName='testUser', LanguageLocaleKey='zh_CN',LocaleSidKey='zh_CN', ProfileId = prof.Id,TimeZoneSidKey='Asia/Shanghai', UserName='testUser@testorg.com',Work_Location__c = '娣卞湷');
insert myUser_test;
}
- System.runAs(myUser_test) {
- Product2 prod05 = new Product2(
- Name = '3400PK:PK閽� 5mmx33cm',
- ProductCode = 'Test01',
- Asset_Model_No__c = '3400PK:PK閽� 5mmx33cm',
- SFDA_Status__c = '鏈夊姽',
- Dealer_special_Object__c = true,
- SFDA_Approbation_No__c = 'Test001',
- Packing_list_manual__c = 1,
- SFDA_Expiration_Date__c = Date.today(),
- Manual_Entry__c = false
- );
- Product2 prod06 = new Product2(
- Name = 'Test02',
- ProductCode = 'Test02',
- Asset_Model_No__c = 'Test02',
- SFDA_Status__c = '鏈夊姽',
- Dealer_special_Object__c = true,
- SFDA_Approbation_No__c = 'Test002',
- Packing_list_manual__c = 12,
- SFDA_Expiration_Date__c = Date.today(),
- Category5__c = 'tset',
- Manual_Entry__c = false
- );
- insert new List<Product2>{ prod05, prod06 };
- Product2__c pro11 = new Product2__c(
- Name = 'Pro001',
- OT_CODE_Text__c = 'Test001',
- Product2__c = prod05.Id,
- Category3_text__c = '鍒嗙被3'
- );
- Product2__c pro22 = new Product2__c(Name = 'Pro002', OT_CODE_Text__c = 'Test002', Product2__c = prod06.Id);
- insert new List<Product2__c>{ pro11, pro22 };
- System.debug('pro11===>' + pro11);
+ System.runAs(myUser_test) {
+ Product2 prod05 = new Product2(Name='3400PK:PK閽� 5mmx33cm',ProductCode='Test01',Asset_Model_No__c = '3400PK:PK閽� 5mmx33cm',SFDA_Status__c = '鏈夊姽',Dealer_special_Object__c = true,SFDA_Approbation_No__c = 'Test001',Packing_list_manual__c = 1,SFDA_Expiration_Date__c= Date.today(),Manual_Entry__c = false);
+ Product2 prod06 = new Product2(Name='Test02',ProductCode='Test02',Asset_Model_No__c = 'Test02',SFDA_Status__c = '鏈夊姽',Dealer_special_Object__c = true,SFDA_Approbation_No__c = 'Test002',Packing_list_manual__c = 12,SFDA_Expiration_Date__c= Date.today(),Category5__c = 'tset',Manual_Entry__c = false);
+ insert new Product2[]{prod05,prod06};
+ Product2__c pro11 = new Product2__c(Name='Pro001',OT_CODE_Text__c='Test001',Product2__c = prod05.Id,Category3_text__c = '鍒嗙被3');
+ Product2__c pro22 = new Product2__c(Name='Pro002',OT_CODE_Text__c='Test002',Product2__c = prod06.Id);
+ insert new Product2__c[] {pro11, pro22};
+ System.debug('pro11===>'+pro11);
- List<Consumable_order__c> orderList = new List<Consumable_order__c>();
- //鍙戣揣
- Consumable_order__c Order4 = new Consumable_order__c();
- Order4.Name = 'OCM_0122';
- Order4.Order_status__c = '鎵瑰噯';
- Order4.Order_type__c = '璁㈠崟';
- Order4.Dealer_Info__c = myAccount1.Id;
- Order4.RecordTypeid = '01210000000c9drAAA';
- Order4.Order_ProType__c = 'ET';
- Order4.ContractNo__c = '';
- orderList.add(Order4);
- insert orderList;
+ List<Consumable_order__c> orderList = new List<Consumable_order__c>();
+ //鍙戣揣
+ Consumable_order__c Order4 = new Consumable_order__c();
+ Order4.Name = 'OCM_0122';
+ Order4.Order_status__c = '鎵瑰噯';
+ Order4.Order_type__c = '璁㈠崟';
+ Order4.Dealer_Info__c = myAccount1.Id;
+ Order4.RecordTypeid = '01210000000c9drAAA';
+ Order4.Order_ProType__c = 'ET';
+ Order4.ContractNo__c = '';
+ orderList.add(Order4);
+ insert orderList;
- List<Consumable_order_details2__c> conList = new List<Consumable_order_details2__c>();
- //orderDetZaiku init
- Consumable_order_details2__c con1 = new Consumable_order_details2__c();
- con1.Arrive_date__c = Date.today();
- con1.Send_Date__c = null;
- con1.Used_date__c = null;
- con1.Return_date__c = null;
- con1.Lose_Flag__c = false;
- con1.Cancellation_Flag__c = false;
- con1.Bar_Code__c = '1234';
- // con1.Consumable_order_minor__c = Order2.Id;
- con1.Consumable_Product__c = pro11.Id;
- con1.Consumable_Arrived_order__c = Order4.Id;
- con1.Recordtypeid = '01210000000kUDKAA2';
- // con1.Sterilization_limit__c = Date.today().addDays(1);
- conList.add(con1);
+ List<Consumable_order_details2__c> conList = new List<Consumable_order_details2__c>();
+ //orderDetZaiku init
+ Consumable_order_details2__c con1 = new Consumable_order_details2__c();
+ con1.Arrive_date__c = Date.today();
+ con1.Send_Date__c = null;
+ con1.Used_date__c = null;
+ con1.Return_date__c = null;
+ con1.Lose_Flag__c = FALSE;
+ con1.Cancellation_Flag__c = FALSE;
+ con1.Bar_Code__c = '1234';
+ // con1.Consumable_order_minor__c = Order2.Id;
+ con1.Consumable_Product__c = pro11.Id;
+ con1.Consumable_Arrived_order__c = Order4.Id;
+ con1.Recordtypeid = '01210000000kUDKAA2';
+ // con1.Sterilization_limit__c = Date.today().addDays(1);
+ conList.add(con1);
- Consumable_order_details2__c con2 = new Consumable_order_details2__c();
- con2.Arrive_date__c = Date.today();
- con2.Send_Date__c = null;
- con2.Used_date__c = null;
- con2.Return_date__c = null;
- con2.Lose_Flag__c = false;
- con2.Cancellation_Flag__c = false;
- con2.Bar_Code__c = '1234';
- // con1.Consumable_order_minor__c = Order2.Id;
- con2.Consumable_Product__c = pro11.Id;
- con2.Consumable_Arrived_order__c = Order4.Id;
- con2.Recordtypeid = '01210000000kUDKAA2';
- con2.Box_Piece__c = '涓�';
- // con1.Sterilization_limit__c = Date.today().addDays(1);
- conList.add(con2);
+ Consumable_order_details2__c con2 = new Consumable_order_details2__c();
+ con2.Arrive_date__c = Date.today();
+ con2.Send_Date__c = null;
+ con2.Used_date__c = null;
+ con2.Return_date__c = null;
+ con2.Lose_Flag__c = FALSE;
+ con2.Cancellation_Flag__c = FALSE;
+ con2.Bar_Code__c = '1234';
+ // con1.Consumable_order_minor__c = Order2.Id;
+ con2.Consumable_Product__c = pro11.Id;
+ con2.Consumable_Arrived_order__c = Order4.Id;
+ con2.Recordtypeid = '01210000000kUDKAA2';
+ con2.Box_Piece__c = '涓�';
+ // con1.Sterilization_limit__c = Date.today().addDays(1);
+ conList.add(con2);
- insert conList;
+ insert conList;
- LexInventoryViewController.ESetId = '1111';
- LexInventoryViewController.idCheck = '2222';
- List<String> orderDetZaikuListLWC = new List<String>();
- LexInventoryViewController.init(1, 0, '', '');
- orderDetZaikuListLWC = LexInventoryViewController.orderDetZaikuList;
- LexInventoryViewController.categoryAllload('CDS', '鎹峰皵鍖荤枟(娴峰崡锛夋湁闄愬叕鍙�');
- LexInventoryViewController.categoryload();
- LexInventoryViewController.categoryAllload('鍏夋簮', '鎹峰皵鍖荤枟(娴峰崡锛夋湁闄愬叕鍙�');
- LexInventoryViewController.categoryload();
- Map<String, Date> productkucunLWC = LexInventoryViewController.productkucun;
- LexInventoryViewController.searchConsumableorderdetails(
- '3400PK:PK閽� 5mmx33cm',
- '',
- '',
- '',
- orderDetZaikuListLWC,
- 'testaccount001',
- 'ET',
- '娣卞湷',
- 1,
- 0,
- '',
- '',
- productkucunLWC
- );
+ LexInventoryViewController.ESetId = '1111';
+ LexInventoryViewController.idCheck = '2222';
+ List<String> orderDetZaikuListLWC = new List<String>();
+ LexInventoryViewController.init(1,0,'','');
+ orderDetZaikuListLWC = LexInventoryViewController.orderDetZaikuList;
+ LexInventoryViewController.categoryAllload('CDS','鎹峰皵鍖荤枟(娴峰崡锛夋湁闄愬叕鍙�');
+ LexInventoryViewController.categoryload();
+ LexInventoryViewController.categoryAllload('鍏夋簮','鎹峰皵鍖荤枟(娴峰崡锛夋湁闄愬叕鍙�');
+ LexInventoryViewController.categoryload();
+ Map<String, Date> productkucunLWC = LexInventoryViewController.productkucun;
+ LexInventoryViewController.searchConsumableorderdetails('3400PK:PK閽� 5mmx33cm','','','',orderDetZaikuListLWC ,'testaccount001','ET','娣卞湷',1,0,'','',productkucunLWC);
+ }
}
- }
-}
+}
\ No newline at end of file
diff --git a/force-app/main/default/classes/LexInventoryViewControllerTest.cls-meta.xml b/force-app/main/default/classes/LexInventoryViewControllerTest.cls-meta.xml
index a9fd6e9..754ecb1 100644
--- a/force-app/main/default/classes/LexInventoryViewControllerTest.cls-meta.xml
+++ b/force-app/main/default/classes/LexInventoryViewControllerTest.cls-meta.xml
@@ -1,4 +1,4 @@
-<?xml version="1.0" encoding="UTF-8" ?>
+<?xml version="1.0" encoding="UTF-8"?>
<ApexClass xmlns="http://soap.sforce.com/2006/04/metadata">
<apiVersion>57.0</apiVersion>
<status>Active</status>
diff --git a/force-app/main/default/classes/LexLicenceReminderControllerTest.cls b/force-app/main/default/classes/LexLicenceReminderControllerTest.cls
index 780a11b..59ba1c8 100644
--- a/force-app/main/default/classes/LexLicenceReminderControllerTest.cls
+++ b/force-app/main/default/classes/LexLicenceReminderControllerTest.cls
@@ -1,199 +1,113 @@
@IsTest
private class LexLicenceReminderControllerTest {
@IsTest
- static void testMethod1() {
+ static void testMethod1(){
User currentUser = [SELECT Id FROM User WHERE Id = :UserInfo.getUserId()];
LicenceReminderDate__c l = new LicenceReminderDate__c(Name = '180Days', ReminderDays__c = 180);
insert l;
Test.startTest();
- System.runAs(currentUser) {
+ System.runAs(currentUser){
LexLicenceReminderController.initReminder();
}
Test.stopTest();
}
@IsTest
- static void testMethod2() {
+ static void testMethod2(){
Account myAccount1 = new Account();
Contact core = new Contact();
User myUser_test = new User();
User currentUser = [SELECT Id FROM User WHERE Id = :UserInfo.getUserId()];
LicenceReminderDate__c l = new LicenceReminderDate__c(Name = '180Days', ReminderDays__c = 180);
insert l;
- System.runAs(currentUser) {
- Profile prof = [
- SELECT Id
- FROM Profile
- WHERE Name = '901_缁忛攢鍟嗙ぞ鍖烘櫘閫氭潈闄恄2閲嶉獙璇�(ET)'
- ];
- List<RecordType> rectCo = [
- SELECT Id
- FROM RecordType
- WHERE IsActive = TRUE AND SobjectType = 'Account' AND Name = '璨╁2搴�'
- ];
+ System.runAs(currentUser){
+ Profile prof = [select Id from Profile where Name ='901_缁忛攢鍟嗙ぞ鍖烘櫘閫氭潈闄恄2閲嶉獙璇�(ET)'];
+ List<RecordType> rectCo = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '璨╁2搴�'];
if (rectCo.size() == 0) {
return;
}
- List<RecordType> rectHos = [
- SELECT Id
- FROM RecordType
- WHERE IsActive = TRUE AND SobjectType = 'Account' AND Name = '鐥呴櫌'
- ];
+ List<RecordType> rectHos = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '鐥呴櫌'];
if (rectHos.size() == 0) {
return;
}
-
- myAccount1 = new Account(
- name = 'testaccount001',
- RecordTypeId = rectCo[0].Id,
- Product_Limit_Date__c = 'Test01|2|4,Test02|3|5',
- AgentCode_Ext__c = '9999900'
- );
+
+ myAccount1 = new Account(name='testaccount001',RecordTypeId = rectCo[0].Id,Product_Limit_Date__c = 'Test01|2|4,Test02|3|5' ,AgentCode_Ext__c = '9999900');
insert myAccount1;
- core = new Contact(email = 'jplumber@salesforce.com', firstname = 'Joe', lastname = 'Plumber', accountid = myAccount1.id);
+ core = new Contact(email='jplumber@salesforce.com', firstname='Joe',lastname='Plumber',accountid=myAccount1.id);
insert core;
- myUser_test = new User(
- ContactId = core.id,
- Alias = 'newUser',
- Email = 'newuser@testorg.com',
- EmailEncodingKey = 'UTF-8',
- LastName = 'testUser',
- LanguageLocaleKey = 'zh_CN',
- LocaleSidKey = 'zh_CN',
- ProfileId = prof.Id,
- TimeZoneSidKey = 'Asia/Shanghai',
- UserName = 'testUser@testorg.com'
- );
+ myUser_test = new User(ContactId = core.id,Alias = 'newUser',Email='newuser@testorg.com',EmailEncodingKey='UTF-8', LastName='testUser', LanguageLocaleKey='zh_CN',LocaleSidKey='zh_CN', ProfileId = prof.Id,TimeZoneSidKey='Asia/Shanghai', UserName='testUser@testorg.com');
insert myUser_test;
}
Test.startTest();
- System.runAs(myUser_test) {
+ System.runAs(myUser_test){
LexLicenceReminderController.initReminder();
}
Test.stopTest();
}
@IsTest
- static void testMethod3() {
+ static void testMethod3(){
Account myAccount1 = new Account();
Contact core = new Contact();
User myUser_test = new User();
User currentUser = [SELECT Id FROM User WHERE Id = :UserInfo.getUserId()];
LicenceReminderDate__c l = new LicenceReminderDate__c(Name = '180Days', ReminderDays__c = 180);
insert l;
- System.runAs(currentUser) {
- Profile prof = [
- SELECT Id
- FROM Profile
- WHERE Name = '901_缁忛攢鍟嗙ぞ鍖烘櫘閫氭潈闄恄2閲嶉獙璇�(ET)'
- ];
- List<RecordType> rectCo = [
- SELECT Id
- FROM RecordType
- WHERE IsActive = TRUE AND SobjectType = 'Account' AND Name = '璨╁2搴�'
- ];
+ System.runAs(currentUser){
+ Profile prof = [select Id from Profile where Name ='901_缁忛攢鍟嗙ぞ鍖烘櫘閫氭潈闄恄2閲嶉獙璇�(ET)'];
+ List<RecordType> rectCo = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '璨╁2搴�'];
if (rectCo.size() == 0) {
return;
}
- List<RecordType> rectHos = [
- SELECT Id
- FROM RecordType
- WHERE IsActive = TRUE AND SobjectType = 'Account' AND Name = '鐥呴櫌'
- ];
+ List<RecordType> rectHos = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '鐥呴櫌'];
if (rectHos.size() == 0) {
return;
}
-
- myAccount1 = new Account(
- name = 'testaccount001',
- RecordTypeId = rectCo[0].Id,
- Product_Limit_Date__c = 'Test01|2|4,Test02|3|5',
- AgentCode_Ext__c = '9999900',
- Medical_Equipment_Expiration_Date__c = Date.newInstance(2023, 6, 10)
- );
+
+ myAccount1 = new Account(name='testaccount001',RecordTypeId = rectCo[0].Id,Product_Limit_Date__c = 'Test01|2|4,Test02|3|5' ,AgentCode_Ext__c = '9999900',Medical_Equipment_Expiration_Date__c = Date.newInstance(2023, 6, 10));
insert myAccount1;
- core = new Contact(email = 'jplumber@salesforce.com', firstname = 'Joe', lastname = 'Plumber', accountid = myAccount1.id);
+ core = new Contact(email='jplumber@salesforce.com', firstname='Joe',lastname='Plumber',accountid=myAccount1.id);
insert core;
- myUser_test = new User(
- ContactId = core.id,
- Alias = 'newUser',
- Email = 'newuser@testorg.com',
- EmailEncodingKey = 'UTF-8',
- LastName = 'testUser',
- LanguageLocaleKey = 'zh_CN',
- LocaleSidKey = 'zh_CN',
- ProfileId = prof.Id,
- TimeZoneSidKey = 'Asia/Shanghai',
- UserName = 'testUser@testorg.com'
- );
+ myUser_test = new User(ContactId = core.id,Alias = 'newUser',Email='newuser@testorg.com',EmailEncodingKey='UTF-8', LastName='testUser', LanguageLocaleKey='zh_CN',LocaleSidKey='zh_CN', ProfileId = prof.Id,TimeZoneSidKey='Asia/Shanghai', UserName='testUser@testorg.com');
insert myUser_test;
}
Test.startTest();
- System.runAs(myUser_test) {
+ System.runAs(myUser_test){
LexLicenceReminderController.initReminder();
}
Test.stopTest();
}
@IsTest
- static void testMethod4() {
+ static void testMethod4(){
Account myAccount1 = new Account();
Contact core = new Contact();
User myUser_test = new User();
User currentUser = [SELECT Id FROM User WHERE Id = :UserInfo.getUserId()];
LicenceReminderDate__c l = new LicenceReminderDate__c(Name = '180Days', ReminderDays__c = 180);
insert l;
- System.runAs(currentUser) {
- Profile prof = [
- SELECT Id
- FROM Profile
- WHERE Name = '901_缁忛攢鍟嗙ぞ鍖烘櫘閫氭潈闄恄2閲嶉獙璇�(ET)'
- ];
- List<RecordType> rectCo = [
- SELECT Id
- FROM RecordType
- WHERE IsActive = TRUE AND SobjectType = 'Account' AND Name = '璨╁2搴�'
- ];
+ System.runAs(currentUser){
+ Profile prof = [select Id from Profile where Name ='901_缁忛攢鍟嗙ぞ鍖烘櫘閫氭潈闄恄2閲嶉獙璇�(ET)'];
+ List<RecordType> rectCo = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '璨╁2搴�'];
if (rectCo.size() == 0) {
return;
}
- List<RecordType> rectHos = [
- SELECT Id
- FROM RecordType
- WHERE IsActive = TRUE AND SobjectType = 'Account' AND Name = '鐥呴櫌'
- ];
+ List<RecordType> rectHos = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '鐥呴櫌'];
if (rectHos.size() == 0) {
return;
}
-
- myAccount1 = new Account(
- name = 'testaccount001',
- RecordTypeId = rectCo[0].Id,
- Product_Limit_Date__c = 'Test01|2|4,Test02|3|5',
- AgentCode_Ext__c = '9999900',
- Medical_Equipment_Expiration_Date__c = Date.newInstance(2025, 6, 10)
- );
+
+ myAccount1 = new Account(name='testaccount001',RecordTypeId = rectCo[0].Id,Product_Limit_Date__c = 'Test01|2|4,Test02|3|5' ,AgentCode_Ext__c = '9999900',Medical_Equipment_Expiration_Date__c = Date.newInstance(2025, 6, 10));
insert myAccount1;
- core = new Contact(email = 'jplumber@salesforce.com', firstname = 'Joe', lastname = 'Plumber', accountid = myAccount1.id);
+ core = new Contact(email='jplumber@salesforce.com', firstname='Joe',lastname='Plumber',accountid=myAccount1.id);
insert core;
- myUser_test = new User(
- ContactId = core.id,
- Alias = 'newUser',
- Email = 'newuser@testorg.com',
- EmailEncodingKey = 'UTF-8',
- LastName = 'testUser',
- LanguageLocaleKey = 'zh_CN',
- LocaleSidKey = 'zh_CN',
- ProfileId = prof.Id,
- TimeZoneSidKey = 'Asia/Shanghai',
- UserName = 'testUser@testorg.com'
- );
+ myUser_test = new User(ContactId = core.id,Alias = 'newUser',Email='newuser@testorg.com',EmailEncodingKey='UTF-8', LastName='testUser', LanguageLocaleKey='zh_CN',LocaleSidKey='zh_CN', ProfileId = prof.Id,TimeZoneSidKey='Asia/Shanghai', UserName='testUser@testorg.com');
insert myUser_test;
}
Test.startTest();
- System.runAs(myUser_test) {
+ System.runAs(myUser_test){
LexLicenceReminderController.initReminder();
}
Test.stopTest();
}
-}
+}
\ No newline at end of file
diff --git a/force-app/main/default/classes/LexLicenceReminderControllerTest.cls-meta.xml b/force-app/main/default/classes/LexLicenceReminderControllerTest.cls-meta.xml
index a9fd6e9..754ecb1 100644
--- a/force-app/main/default/classes/LexLicenceReminderControllerTest.cls-meta.xml
+++ b/force-app/main/default/classes/LexLicenceReminderControllerTest.cls-meta.xml
@@ -1,4 +1,4 @@
-<?xml version="1.0" encoding="UTF-8" ?>
+<?xml version="1.0" encoding="UTF-8"?>
<ApexClass xmlns="http://soap.sforce.com/2006/04/metadata">
<apiVersion>57.0</apiVersion>
<status>Active</status>
diff --git a/force-app/main/default/classes/LexOutboundorderImportController.cls b/force-app/main/default/classes/LexOutboundorderImportController.cls
index 548bc31..aad8163 100644
--- a/force-app/main/default/classes/LexOutboundorderImportController.cls
+++ b/force-app/main/default/classes/LexOutboundorderImportController.cls
@@ -31,11 +31,7 @@
messageCount = 0;
errorflg = false;
errorMessage = null;
- User useracc = [
- SELECT accountid, Work_Location__c, UserPro_Type__c
- FROM user
- WHERE id = :UserInfo.getUserId()
- ];
+ User useracc = [SELECT accountid, Work_Location__c, UserPro_Type__c FROM user WHERE id = :UserInfo.getUserId()];
accountid = Useracc.accountid;
userWorkLocation = Useracc.Work_Location__c;
agencyProType = Useracc.UserPro_Type__c;
@@ -919,4 +915,4 @@
return null;
}
}
-}
+}
\ No newline at end of file
diff --git a/force-app/main/default/classes/LexOutboundorderImportControllerTest.cls b/force-app/main/default/classes/LexOutboundorderImportControllerTest.cls
index 63826fb..cb8e9b4 100644
--- a/force-app/main/default/classes/LexOutboundorderImportControllerTest.cls
+++ b/force-app/main/default/classes/LexOutboundorderImportControllerTest.cls
@@ -1,88 +1,41 @@
@isTest
-private class LexOutboundorderImportControllerTest {
+private class LexOutboundorderImportControllerTest
+{
static testMethod void myUnitTest() {
+
user myUser_test;
- Account myAccount1;
+ Account myAccount1 ;
List<RecordType> rectHos;
- User thisUser = [SELECT Id FROM User WHERE Id = :UserInfo.getUserId()];
- System.runAs(thisUser) {
- List<RecordType> rectCo = [
- SELECT Id
- FROM RecordType
- WHERE IsActive = TRUE AND SobjectType = 'Account' AND Name = '璨╁2搴�'
- ];
+ User thisUser = [ select Id from User where Id = :UserInfo.getUserId()];
+ System.runAs(thisUser){
+ List<RecordType> rectCo = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '璨╁2搴�'];
if (rectCo.size() == 0) {
return;
}
- rectHos = [
- SELECT Id
- FROM RecordType
- WHERE IsActive = TRUE AND SobjectType = 'Account' AND Name = '鐥呴櫌'
- ];
+ rectHos = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '鐥呴櫌'];
if (rectHos.size() == 0) {
return;
}
- Profile prof = [
- SELECT Id
- FROM Profile
- WHERE Name = '901_缁忛攢鍟嗙ぞ鍖烘櫘閫氭潈闄恄2閲嶉獙璇�(ET)'
- ];
-
- myAccount1 = new Account(
- name = 'Testaccount001',
- Dealer_discount__c = 20,
- RecordTypeId = rectCo[0].Id,
- AgentCode_Ext__c = '9999900'
- );
+ Profile prof = [select Id from Profile where Name ='901_缁忛攢鍟嗙ぞ鍖烘櫘閫氭潈闄恄2閲嶉獙璇�(ET)'];
+
+ myAccount1 = new Account(name='Testaccount001',Dealer_discount__c =20,RecordTypeId = rectCo[0].Id,AgentCode_Ext__c = '9999900');
insert myAccount1;
-
- Contact core = new Contact(
- email = 'jplumber@salesforce.com',
- firstname = 'Joe',
- lastname = 'Plumber',
- accountid = myAccount1.id
- );
+
+ Contact core = new Contact(email='jplumber@salesforce.com', firstname='Joe',lastname='Plumber',accountid=myAccount1.id);
insert core;
- MyUser_Test = new User(
- ContactId = core.id,
- Alias = 'newUser',
- Email = 'newuser@testorg.com',
- EmailEncodingKey = 'UTF-8',
- LastName = 'TestUser',
- LanguageLocaleKey = 'zh_CN',
- LocaleSidKey = 'zh_CN',
- ProfileId = prof.Id,
- TimeZoneSidKey = 'Asia/Shanghai',
- UserName = 'testUser@testorg.com',
- Work_Location__c = '閲嶅簡'
- );
+ MyUser_Test = New User(ContactId = core.id,Alias = 'newUser',Email='newuser@testorg.com',EmailEncodingKey='UTF-8', LastName='TestUser', LanguageLocaleKey='zh_CN',LocaleSidKey='zh_CN', ProfileId = prof.Id,TimeZoneSidKey='Asia/Shanghai', UserName='testUser@testorg.com',Work_Location__c = '閲嶅簡');
insert MyUser_Test;
+
}
// TO DO: implement unit test
-
- System.runAs(myUser_Test) {
- Product2 prod01 = new Product2(
- Name = 'Test01',
- ProductCode = 'Test01',
- Asset_Model_No__c = 'Test01',
- SFDA_Status__c = '鏈夊姽',
- Dealer_special_Object__c = true,
- Packing_list_manual__c = 12,
- Manual_Entry__c = false
- );
- Product2 prod02 = new Product2(
- Name = 'Test02',
- ProductCode = 'Test02',
- Asset_Model_No__c = 'Test02',
- SFDA_Status__c = '鏈夊姽',
- Dealer_special_Object__c = true,
- Packing_list_manual__c = 12,
- Manual_Entry__c = false
- );
- insert new List<Product2>{ prod01, prod02 };
- Product2__c pro1 = new Product2__c(Name = 'Pro001', OT_CODE_Text__c = 'Test001', Product2__c = prod01.Id);
- Product2__c pro2 = new Product2__c(Name = 'Pro002', OT_CODE_Text__c = 'Test002', Product2__c = prod02.Id);
- insert new List<Product2__c>{ pro1, pro2 };
+
+ system.runAs(myUser_Test){
+ Product2 prod01 = new Product2(Name='Test01',ProductCode='Test01',Asset_Model_No__c = 'Test01',SFDA_Status__c = '鏈夊姽',Dealer_special_Object__c = true,Packing_list_manual__c=12,Manual_Entry__c = false);
+ Product2 prod02 = new Product2(Name='Test02',ProductCode='Test02',Asset_Model_No__c = 'Test02',SFDA_Status__c = '鏈夊姽',Dealer_special_Object__c = true,Packing_list_manual__c=12,Manual_Entry__c = false);
+ insert new Product2[]{prod01,prod02};
+ Product2__c pro1 = new Product2__c(Name='Pro001',OT_CODE_Text__c='Test001',Product2__c = prod01.Id);
+ Product2__c pro2 = new Product2__c(Name='Pro002',OT_CODE_Text__c='Test002',Product2__c = prod02.Id);
+ insert new Product2__c[] {pro1, pro2};
Consumable_order__c Order1 = new Consumable_order__c();
Order1.Name = 'OCM_01_001';
Order1.Order_status__c = '鎵瑰噯';
@@ -90,10 +43,10 @@
Order1.RecordTypeid = System.Label.RT_ConOrder_Order;
Order1.Dealer_Info__c = myAccount1.Id;
Order1.Order_ProType__c = 'ET';
- insert Order1;
+ insert Order1;
Consumable_order_details2__c Orderdet4 = new Consumable_order_details2__c();
Orderdet4.Name = 'OCM_01_001004';
- Orderdet4.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
+ Orderdet4.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery ;
Orderdet4.Consumable_Arrived_order__c = Order1.Id;
Orderdet4.Sterilization_limit__c = Date.today().addDays(-1);
Orderdet4.Bar_Code__c = '123456789';
@@ -103,7 +56,7 @@
Consumable_order_details2__c orderdet3 = new Consumable_order_details2__c();
orderdet3.Name = 'OCM_01_001004';
- orderdet3.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
+ orderdet3.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery ;
orderdet3.Consumable_Arrived_order__c = Order1.Id;
orderdet3.Sterilization_limit__c = Date.today().addDays(-1);
orderdet3.Bar_Code__c = '123456788';
@@ -113,7 +66,7 @@
Consumable_order_details2__c orderdet2 = new Consumable_order_details2__c();
orderdet2.Name = 'OCM_01_001004';
- orderdet2.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
+ orderdet2.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery ;
orderdet2.Consumable_Arrived_order__c = Order1.Id;
orderdet2.Sterilization_limit__c = Date.today().addDays(-1);
orderdet2.Bar_Code__c = '123456787';
@@ -123,23 +76,19 @@
Consumable_order_details2__c orderdet1 = new Consumable_order_details2__c();
Orderdet1.Name = 'OCM_01_001004';
- Orderdet1.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
+ Orderdet1.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery ;
Orderdet1.Consumable_Arrived_order__c = Order1.Id;
Orderdet1.Sterilization_limit__c = Date.today().addDays(-1);
Orderdet1.Bar_Code__c = '123456786';
Orderdet1.Consumable_Product__c = pro1.Id;
Orderdet1.Arrive_date__c = Date.today().addDays(-1);
Orderdet1.Box_Piece__c = '涓�';
- insert new List<Consumable_order_details2__c>{ orderdet1, orderdet2, orderdet3, orderdet4 };
- Account hosp1 = new Account(name = 'Testhosp001', RecordTypeId = rectHos[0].Id);
+ insert new Consumable_order_details2__c[] {orderdet1, orderdet2,orderdet3,orderdet4};
+ Account hosp1 = new Account(name='Testhosp001',RecordTypeId = rectHos[0].Id);
insert hosp1;
- Agency_Hospital_Link__c jxs = new Agency_Hospital_Link__c(name = 'jxs001', Agency__c = myAccount1.Id, Hospital__c = hosp1.Id);
+ Agency_Hospital_Link__c jxs = new Agency_Hospital_Link__c(name='jxs001',Agency__c = myAccount1.Id,Hospital__c=hosp1.Id);
insert jxs;
- List<Agency_Hospital_Link__c> jxsList = [
- SELECT Name, Hospital__r.Management_Code__c
- FROM Agency_Hospital_Link__c
- WHERE Name = 'Testhosp001'
- ];
+ List<Agency_Hospital_Link__c> jxsList = [select Name,Hospital__r.Management_Code__c from Agency_Hospital_Link__c where Name = 'Testhosp001'];
List<LexOutboundorderImportController.ConsumableorderdetailsInfo> orderRecords1 = new List<LexOutboundorderImportController.ConsumableorderdetailsInfo>();
//鍑哄簱鍗�
@@ -161,224 +110,111 @@
System.Test.startTest();
String csvBody = '';
csvBody = 'Name,SummonsForDirction__c,HospitalCode,Order_ForHospital__c,Order_ForCustomerText__c,Order_ForDealer__c,Bar_Code__c,Shipment_Count__c,Delivery_List_RMB__c,Box_Piece__c,Unitprice_To_agency__c,Outbound_Date__c\n';
- csvBody +=
- 'CS-S0001,閿�鍞粰浜岀骇缁忛攢鍟�,' +
- jxsList[0].Hospital__r.Management_Code__c +
- ',Testhosp001,test,娴嬭瘯浜岀骇缁忛攢鍟�1,123456789,1,230,鐩�,230,2017-02-17\n';
- csvBody +=
- 'CS-S0001,閿�鍞粰浜岀骇缁忛攢鍟�,' +
- jxsList[0].Hospital__r.Management_Code__c +
- ',Testhosp001,test,娴嬭瘯浜岀骇缁忛攢鍟�1,123456788,1,230,鐩�,230,2017-02-17\n';
- csvBody +=
- 'CS-S0001,閿�鍞粰浜岀骇缁忛攢鍟�,' +
- jxsList[0].Hospital__r.Management_Code__c +
- ',Testhosp001,test,娴嬭瘯浜岀骇缁忛攢鍟�1,123456787,1,230,涓�,230,2017-02-17\n';
- csvBody +=
- 'CS-S0001,閿�鍞粰浜岀骇缁忛攢鍟�,' +
- jxsList[0].Hospital__r.Management_Code__c +
- ',Testhosp001,test,娴嬭瘯浜岀骇缁忛攢鍟�1,123456786,1,230,涓�,230,2017-02-17\n';
-
- LexOutboundorderImportController.importCSVFile(
- 'TmFtZSxTdW1tb25zRm9yRGlyY3Rpb25fX2MsSG9zcGl0YWxDb2RlLE9yZGVyX0Zvckhvc3BpdGFsX19jLE9yZGVyX0ZvckN1c3RvbWVyVGV4dF9fYyxPcmRlcl9Gb3JEZWFsZXJfX2MsQmFyX0NvZGVfX2MsU2hpcG1lbnRfQ291bnRfX2MsRGVsaXZlcnlfTGlzdF9STUJfX2MsQm94X1BpZWNlX19jLFVuaXRwcmljZV9Ub19hZ2VuY3lfX2MsT3V0Ym91bmRfRGF0ZV9fYyxMb3NlX3JlYXNvbl9fYw0KREItRlkyMDI0LTA2LVozMTAwMDIs55u05o6l6ZSA5ZSu57uZ5Yy76ZmiLDgxMDU2NDAs5a6955S45Lic5qGl5bq35aSN5Yy76ZmiLOa2iOWMluenkSwsMTY4NjIwMzI1NDQ2ODI1MFZWR0lVLDEsMjAwMCznm5IsMjAsMjAyMy82Lzgs5Lii5aSx5Y6f5ZugDQpEQi1GWTIwMjQtMDYtWjMxMDAwMyznm7TmjqXplIDllK7nu5nljLvpmaIsODEwNTY0MCzlrr3nlLjkuJzmoaXlurflpI3ljLvpmaIs5raI5YyW56eRLCwxNjg2MjAzMjU2MDk4MjUwUkVKT1EsMSwzMDAwLOebkiwyMCwyMDIzLzYvOCzkuKLlpLHljp%2Flm6ANCkRCLUZZMjAyNC0wNi1aMzEwMDA0LOebtOaOpemUgOWUrue7meWMu%2BmZoiw4MTA1NjQwLOWuveeUuOS4nOahpeW6t%2BWkjeWMu%2BmZoizmtojljJbnp5EsLDE2ODYyMDMyNTc2NTcyNTBHU0ZTQiwxLDQwMDAs55uSLDIwLDIwMjMvNi84LOS4ouWkseWOn%2BWboA0K',
- '%ET%',
- '閲嶅簡',
- 'Testaccount001'
- );
+ csvBody +='CS-S0001,閿�鍞粰浜岀骇缁忛攢鍟�,' + jxsList[0].Hospital__r.Management_Code__c + ',Testhosp001,test,娴嬭瘯浜岀骇缁忛攢鍟�1,123456789,1,230,鐩�,230,2017-02-17\n';
+ csvBody +='CS-S0001,閿�鍞粰浜岀骇缁忛攢鍟�,' + jxsList[0].Hospital__r.Management_Code__c + ',Testhosp001,test,娴嬭瘯浜岀骇缁忛攢鍟�1,123456788,1,230,鐩�,230,2017-02-17\n';
+ csvBody +='CS-S0001,閿�鍞粰浜岀骇缁忛攢鍟�,' + jxsList[0].Hospital__r.Management_Code__c + ',Testhosp001,test,娴嬭瘯浜岀骇缁忛攢鍟�1,123456787,1,230,涓�,230,2017-02-17\n';
+ csvBody +='CS-S0001,閿�鍞粰浜岀骇缁忛攢鍟�,' + jxsList[0].Hospital__r.Management_Code__c + ',Testhosp001,test,娴嬭瘯浜岀骇缁忛攢鍟�1,123456786,1,230,涓�,230,2017-02-17\n';
+
+ LexOutboundorderImportController.importCSVFile('TmFtZSxTdW1tb25zRm9yRGlyY3Rpb25fX2MsSG9zcGl0YWxDb2RlLE9yZGVyX0Zvckhvc3BpdGFsX19jLE9yZGVyX0ZvckN1c3RvbWVyVGV4dF9fYyxPcmRlcl9Gb3JEZWFsZXJfX2MsQmFyX0NvZGVfX2MsU2hpcG1lbnRfQ291bnRfX2MsRGVsaXZlcnlfTGlzdF9STUJfX2MsQm94X1BpZWNlX19jLFVuaXRwcmljZV9Ub19hZ2VuY3lfX2MsT3V0Ym91bmRfRGF0ZV9fYyxMb3NlX3JlYXNvbl9fYw0KREItRlkyMDI0LTA2LVozMTAwMDIs55u05o6l6ZSA5ZSu57uZ5Yy76ZmiLDgxMDU2NDAs5a6955S45Lic5qGl5bq35aSN5Yy76ZmiLOa2iOWMluenkSwsMTY4NjIwMzI1NDQ2ODI1MFZWR0lVLDEsMjAwMCznm5IsMjAsMjAyMy82Lzgs5Lii5aSx5Y6f5ZugDQpEQi1GWTIwMjQtMDYtWjMxMDAwMyznm7TmjqXplIDllK7nu5nljLvpmaIsODEwNTY0MCzlrr3nlLjkuJzmoaXlurflpI3ljLvpmaIs5raI5YyW56eRLCwxNjg2MjAzMjU2MDk4MjUwUkVKT1EsMSwzMDAwLOebkiwyMCwyMDIzLzYvOCzkuKLlpLHljp%2Flm6ANCkRCLUZZMjAyNC0wNi1aMzEwMDA0LOebtOaOpemUgOWUrue7meWMu%2BmZoiw4MTA1NjQwLOWuveeUuOS4nOahpeW6t%2BWkjeWMu%2BmZoizmtojljJbnp5EsLDE2ODYyMDMyNTc2NTcyNTBHU0ZTQiwxLDQwMDAs55uSLDIwLDIwMjMvNi84LOS4ouWkseWOn%2BWboA0K','%ET%','閲嶅簡','Testaccount001');
//鍑哄簱鏃ユ湡涓虹┖
- LexOutboundorderImportController.importCSVFile(
- '77u%2FTmFtZSxTdW1tb25zRm9yRGlyY3Rpb25fX2MsSG9zcGl0YWxDb2RlLE9yZGVyX0Zvckhvc3BpdGFsX19jLE9yZGVyX0ZvckN1c3RvbWVyVGV4dF9fYyxPcmRlcl9Gb3JEZWFsZXJfX2MsQmFyX0NvZGVfX2MsU2hpcG1lbnRfQ291bnRfX2MsRGVsaXZlcnlfTGlzdF9STUJfX2MsQm94X1BpZWNlX19jLFVuaXRwcmljZV9Ub19hZ2VuY3lfX2MsT3V0Ym91bmRfRGF0ZV9fYyxMb3NlX3JlYXNvbl9fYw0KREItRlkyMDI0LTA2LVozMTAwMDIsLDgxMDU2NDAs54C555WM5pW75raT5ruEy4nmkLTls7DumLLpjZblqZrmq4ws5aiR5aCd5a%2By57uJPywxNjg2MjAzMjU0NDY4MjUwVlZHSVUsMSwyMDAwLOmQqT8yMCw4LzYvMjAyMyzmtpPjiKDjgZHpjZjnhrfmtJwsLA0KREItRlkyMDI0LTA2LVozMTAwMDMs6ZCp5a2Y5bi06Za%2F4oKs6Y2e7oa%2B57Kw6Y2W5ama5quMLDgxMDU2NDAs54C555WM5pW75raT5ruEy4nmkLTls7DumLLpjZblqZrmq4ws5aiR5aCd5a%2By57uJPywxNjg2MjAzMjU2MDk4MjUwUkVKT1EsMSwzMDAwLOmQqT8yMCw4LzYvMjAyMyzmtpPjiKDjgZHpjZjnhrfmtJwsLA0KREItRlkyMDI0LTA2LVozMTAwMDQs6ZCp5a2Y5bi06Za%2F4oKs6Y2e7oa%2B57Kw6Y2W5ama5quMLDgxMDU2NDAs54C555WM5pW75raT5ruEy4nmkLTls7DumLLpjZblqZrmq4ws5aiR5aCd5a%2By57uJPywxNjg2MjAzMjU3NjU3MjUwR1NGU0IsMSw0MDAwLOmQqT8yMCw4LzYvMjAyMyzmtpPjiKDjgZHpjZjnhrfmtJwsLA0K',
- '%ET%',
- '閲嶅簡',
- 'Testaccount001'
- );
+ LexOutboundorderImportController.importCSVFile('77u%2FTmFtZSxTdW1tb25zRm9yRGlyY3Rpb25fX2MsSG9zcGl0YWxDb2RlLE9yZGVyX0Zvckhvc3BpdGFsX19jLE9yZGVyX0ZvckN1c3RvbWVyVGV4dF9fYyxPcmRlcl9Gb3JEZWFsZXJfX2MsQmFyX0NvZGVfX2MsU2hpcG1lbnRfQ291bnRfX2MsRGVsaXZlcnlfTGlzdF9STUJfX2MsQm94X1BpZWNlX19jLFVuaXRwcmljZV9Ub19hZ2VuY3lfX2MsT3V0Ym91bmRfRGF0ZV9fYyxMb3NlX3JlYXNvbl9fYw0KREItRlkyMDI0LTA2LVozMTAwMDIsLDgxMDU2NDAs54C555WM5pW75raT5ruEy4nmkLTls7DumLLpjZblqZrmq4ws5aiR5aCd5a%2By57uJPywxNjg2MjAzMjU0NDY4MjUwVlZHSVUsMSwyMDAwLOmQqT8yMCw4LzYvMjAyMyzmtpPjiKDjgZHpjZjnhrfmtJwsLA0KREItRlkyMDI0LTA2LVozMTAwMDMs6ZCp5a2Y5bi06Za%2F4oKs6Y2e7oa%2B57Kw6Y2W5ama5quMLDgxMDU2NDAs54C555WM5pW75raT5ruEy4nmkLTls7DumLLpjZblqZrmq4ws5aiR5aCd5a%2By57uJPywxNjg2MjAzMjU2MDk4MjUwUkVKT1EsMSwzMDAwLOmQqT8yMCw4LzYvMjAyMyzmtpPjiKDjgZHpjZjnhrfmtJwsLA0KREItRlkyMDI0LTA2LVozMTAwMDQs6ZCp5a2Y5bi06Za%2F4oKs6Y2e7oa%2B57Kw6Y2W5ama5quMLDgxMDU2NDAs54C555WM5pW75raT5ruEy4nmkLTls7DumLLpjZblqZrmq4ws5aiR5aCd5a%2By57uJPywxNjg2MjAzMjU3NjU3MjUwR1NGU0IsMSw0MDAwLOmQqT8yMCw4LzYvMjAyMyzmtpPjiKDjgZHpjZjnhrfmtJwsLA0K','%ET%','閲嶅簡','Testaccount001');
//鍐呭涓虹┖
//涓嶉渶瑕佷簩绾х粡閿�鍟�
- LexOutboundorderImportController.importCSVFile(
- '77u%2FTmFtZSxTdW1tb25zRm9yRGlyY3Rpb25fX2MsSG9zcGl0YWxDb2RlLE9yZGVyX0Zvckhvc3BpdGFsX19jLE9yZGVyX0ZvckN1c3RvbWVyVGV4dF9fYyxPcmRlcl9Gb3JEZWFsZXJfX2MsQmFyX0NvZGVfX2MsU2hpcG1lbnRfQ291bnRfX2MsRGVsaXZlcnlfTGlzdF9STUJfX2MsQm94X1BpZWNlX19jLFVuaXRwcmljZV9Ub19hZ2VuY3lfX2MsT3V0Ym91bmRfRGF0ZV9fYyxMb3NlX3JlYXNvbl9fYywNCkRCLUZZMjAyNC0wNi1aMzEwMDAyLOmUgOWUrue7meS6jOe6p%2Be7j%2BmUgOWVhiw4MTA1NjQwLOWuveeUuOS4nOahpeW6t%2BWkjeWMu%2BmZoizmtojljJbnp5EsMTY4NjIwMzI1NDQ2ODI1MFZWR0lVLDEsMjAwMCwyMCw4LzYvMjAyMywsLCwNCkRCLUZZMjAyNC0wNi1aMzEwMDAzLOebtOaOpemUgOWUrue7meWMu%2BmZoiw4MTA1NjQwLOWuveeUuOS4nOahpeW6t%2BWkjeWMu%2BmZoizmtojljJbnp5EsMTY4NjIwMzI1NjA5ODI1MFJFSk9RLDEsNDAwMCwyMCw4LzYvMjAyMywsLCwNCkRCLUZZMjAyNC0wNi1aMzEwMDA0LOS6kuebuOiwg%2Bi0pyw4MTA1NjQwLOWuveeUuOS4nOahpeW6t%2BWkjeWMu%2BmZoizmtojljJbnp5EsLDEsNTAwMCwyMCw4LzYvMjAyMywsLCwNCg%3D%3D',
- '%ET%',
- '閲嶅簡',
- 'Testaccount001'
- );
- LexOutboundorderImportController.importCSVFile(
- '77u%2FTmFtZSxTdW1tb25zRm9yRGlyY3Rpb25fX2MsSG9zcGl0YWxDb2RlLE9yZGVyX0Zvckhvc3BpdGFsX19jLE9yZGVyX0ZvckN1c3RvbWVyVGV4dF9fYyxPcmRlcl9Gb3JEZWFsZXJfX2MsQmFyX0NvZGVfX2MsU2hpcG1lbnRfQ291bnRfX2MsRGVsaXZlcnlfTGlzdF9STUJfX2MsQm94X1BpZWNlX19jLFVuaXRwcmljZV9Ub19hZ2VuY3lfX2MsT3V0Ym91bmRfRGF0ZV9fYyxMb3NlX3JlYXNvbl9fYw0KREItRlkyMDI0LTA2LVozMTAwMDIs6ZSA5ZSu57uZ5LqM57qn57uP6ZSA5ZWGLDgxMDU2NDAs5a6955S45Lic5qGl5bq35aSN5Yy76ZmiLOa2iOWMluenkSwxNjg2MjAzMjU0NDY4MjUwVlZHSVUsMSwyMDAwLDIwLDgvNi8yMDIzLCwsDQpEQi1GWTIwMjQtMDYtWjMxMDAwMyznm7TmjqXplIDllK7nu5nljLvpmaIsODEwNTY0MCzlrr3nlLjkuJzmoaXlurflpI3ljLvpmaIs5raI5YyW56eRLDE2ODYyMDMyNTYwOTgyNTBSRUpPUSwxLDQwMDAsMjAsOC82LzIwMjMsLCwNCkRCLUZZMjAyNC0wNi1aMzEwMDA0LOS6kuebuOiwg%2Bi0pywsLCwsMSw1MDAwLDIwLDgvNi8yMDIzLCwsDQo%3D',
- '%ET%',
- '閲嶅簡',
- 'Testaccount001'
- );
+ LexOutboundorderImportController.importCSVFile('77u%2FTmFtZSxTdW1tb25zRm9yRGlyY3Rpb25fX2MsSG9zcGl0YWxDb2RlLE9yZGVyX0Zvckhvc3BpdGFsX19jLE9yZGVyX0ZvckN1c3RvbWVyVGV4dF9fYyxPcmRlcl9Gb3JEZWFsZXJfX2MsQmFyX0NvZGVfX2MsU2hpcG1lbnRfQ291bnRfX2MsRGVsaXZlcnlfTGlzdF9STUJfX2MsQm94X1BpZWNlX19jLFVuaXRwcmljZV9Ub19hZ2VuY3lfX2MsT3V0Ym91bmRfRGF0ZV9fYyxMb3NlX3JlYXNvbl9fYywNCkRCLUZZMjAyNC0wNi1aMzEwMDAyLOmUgOWUrue7meS6jOe6p%2Be7j%2BmUgOWVhiw4MTA1NjQwLOWuveeUuOS4nOahpeW6t%2BWkjeWMu%2BmZoizmtojljJbnp5EsMTY4NjIwMzI1NDQ2ODI1MFZWR0lVLDEsMjAwMCwyMCw4LzYvMjAyMywsLCwNCkRCLUZZMjAyNC0wNi1aMzEwMDAzLOebtOaOpemUgOWUrue7meWMu%2BmZoiw4MTA1NjQwLOWuveeUuOS4nOahpeW6t%2BWkjeWMu%2BmZoizmtojljJbnp5EsMTY4NjIwMzI1NjA5ODI1MFJFSk9RLDEsNDAwMCwyMCw4LzYvMjAyMywsLCwNCkRCLUZZMjAyNC0wNi1aMzEwMDA0LOS6kuebuOiwg%2Bi0pyw4MTA1NjQwLOWuveeUuOS4nOahpeW6t%2BWkjeWMu%2BmZoizmtojljJbnp5EsLDEsNTAwMCwyMCw4LzYvMjAyMywsLCwNCg%3D%3D','%ET%','閲嶅簡','Testaccount001');
+ LexOutboundorderImportController.importCSVFile('77u%2FTmFtZSxTdW1tb25zRm9yRGlyY3Rpb25fX2MsSG9zcGl0YWxDb2RlLE9yZGVyX0Zvckhvc3BpdGFsX19jLE9yZGVyX0ZvckN1c3RvbWVyVGV4dF9fYyxPcmRlcl9Gb3JEZWFsZXJfX2MsQmFyX0NvZGVfX2MsU2hpcG1lbnRfQ291bnRfX2MsRGVsaXZlcnlfTGlzdF9STUJfX2MsQm94X1BpZWNlX19jLFVuaXRwcmljZV9Ub19hZ2VuY3lfX2MsT3V0Ym91bmRfRGF0ZV9fYyxMb3NlX3JlYXNvbl9fYw0KREItRlkyMDI0LTA2LVozMTAwMDIs6ZSA5ZSu57uZ5LqM57qn57uP6ZSA5ZWGLDgxMDU2NDAs5a6955S45Lic5qGl5bq35aSN5Yy76ZmiLOa2iOWMluenkSwxNjg2MjAzMjU0NDY4MjUwVlZHSVUsMSwyMDAwLDIwLDgvNi8yMDIzLCwsDQpEQi1GWTIwMjQtMDYtWjMxMDAwMyznm7TmjqXplIDllK7nu5nljLvpmaIsODEwNTY0MCzlrr3nlLjkuJzmoaXlurflpI3ljLvpmaIs5raI5YyW56eRLDE2ODYyMDMyNTYwOTgyNTBSRUpPUSwxLDQwMDAsMjAsOC82LzIwMjMsLCwNCkRCLUZZMjAyNC0wNi1aMzEwMDA0LOS6kuebuOiwg%2Bi0pywsLCwsMSw1MDAwLDIwLDgvNi8yMDIzLCwsDQo%3D','%ET%','閲嶅簡','Testaccount001');
//barcode 涓嶅瓨鍦� 鎴栧崟浣嶉敊璇�
- LexOutboundorderImportController.importCSVFile(
- '77u%2FTmFtZSxTdW1tb25zRm9yRGlyY3Rpb25fX2MsSG9zcGl0YWxDb2RlLE9yZGVyX0Zvckhvc3BpdGFsX19jLE9yZGVyX0ZvckN1c3RvbWVyVGV4dF9fYyxPcmRlcl9Gb3JEZWFsZXJfX2MsQmFyX0NvZGVfX2MsU2hpcG1lbnRfQ291bnRfX2MsRGVsaXZlcnlfTGlzdF9STUJfX2MsQm94X1BpZWNlX19jLFVuaXRwcmljZV9Ub19hZ2VuY3lfX2MsT3V0Ym91bmRfRGF0ZV9fYyxMb3NlX3JlYXNvbl9fYw0KREItRlkyMDI0LTA2LVozMTAwMDIs6ZSA5ZSu57uZ5LqM57qn57uP6ZSA5ZWGLDgxMDU2NDAs5a6955S45Lic5qGl5bq35aSN5Yy76ZmiLOa2iOWMluenkSwsMTY4NjIwMzI1NDQ2ODI1MFZWR0lVLDEsODAwLOebkiwsOC82LzIwMjMsDQpEQi1GWTIwMjQtMDYtWjMxMDAwMyznm7TmjqXplIDllK7nu5nljLvpmaIsODEwNTY0MCzlrr3nlLjkuJzmoaXlurflpI3ljLvpmaIs5raI5YyW56eRLCwxNjg2MjAzMjU2MDk4MjUwUkVKT1EsMiw1MDAs5LiqLCw4LzYvMjAyMywNCkRCLUZZMjAyNC0wNi1aMzEwMDA0LOS6kuebuOiwg%2Bi0pyw4MTA1NjQwLOWuveeUuOS4nOahpeW6t%2BWkjeWMu%2BmZoizmtojljJbnp5EsLDE2ODYyMDMyNTc2NTcyNTBHU0ZTQiw0LDkwMDAs55uSLCw4LzYvMjAyMywNCg%3D%3D',
- '%ET%',
- '閲嶅簡',
- 'Testaccount001'
- );
+ LexOutboundorderImportController.importCSVFile('77u%2FTmFtZSxTdW1tb25zRm9yRGlyY3Rpb25fX2MsSG9zcGl0YWxDb2RlLE9yZGVyX0Zvckhvc3BpdGFsX19jLE9yZGVyX0ZvckN1c3RvbWVyVGV4dF9fYyxPcmRlcl9Gb3JEZWFsZXJfX2MsQmFyX0NvZGVfX2MsU2hpcG1lbnRfQ291bnRfX2MsRGVsaXZlcnlfTGlzdF9STUJfX2MsQm94X1BpZWNlX19jLFVuaXRwcmljZV9Ub19hZ2VuY3lfX2MsT3V0Ym91bmRfRGF0ZV9fYyxMb3NlX3JlYXNvbl9fYw0KREItRlkyMDI0LTA2LVozMTAwMDIs6ZSA5ZSu57uZ5LqM57qn57uP6ZSA5ZWGLDgxMDU2NDAs5a6955S45Lic5qGl5bq35aSN5Yy76ZmiLOa2iOWMluenkSwsMTY4NjIwMzI1NDQ2ODI1MFZWR0lVLDEsODAwLOebkiwsOC82LzIwMjMsDQpEQi1GWTIwMjQtMDYtWjMxMDAwMyznm7TmjqXplIDllK7nu5nljLvpmaIsODEwNTY0MCzlrr3nlLjkuJzmoaXlurflpI3ljLvpmaIs5raI5YyW56eRLCwxNjg2MjAzMjU2MDk4MjUwUkVKT1EsMiw1MDAs5LiqLCw4LzYvMjAyMywNCkRCLUZZMjAyNC0wNi1aMzEwMDA0LOS6kuebuOiwg%2Bi0pyw4MTA1NjQwLOWuveeUuOS4nOahpeW6t%2BWkjeWMu%2BmZoizmtojljJbnp5EsLDE2ODYyMDMyNTc2NTcyNTBHU0ZTQiw0LDkwMDAs55uSLCw4LzYvMjAyMywNCg%3D%3D','%ET%','閲嶅簡','Testaccount001');
//涓嶅瓨鍦ㄥ嚭搴撳崟浣�
- LexOutboundorderImportController.importCSVFile(
- '77u%2FTmFtZSxTdW1tb25zRm9yRGlyY3Rpb25fX2MsSG9zcGl0YWxDb2RlLE9yZGVyX0Zvckhvc3BpdGFsX19jLE9yZGVyX0ZvckN1c3RvbWVyVGV4dF9fYyxPcmRlcl9Gb3JEZWFsZXJfX2MsQmFyX0NvZGVfX2MsU2hpcG1lbnRfQ291bnRfX2MsRGVsaXZlcnlfTGlzdF9STUJfX2MsQm94X1BpZWNlX19jLFVuaXRwcmljZV9Ub19hZ2VuY3lfX2MsT3V0Ym91bmRfRGF0ZV9fYyxMb3NlX3JlYXNvbl9fYw0KREItRlkyMDI0LTA2LVozMTAwMDIs6ZSA5ZSu57uZ5LqM57qn57uP6ZSA5ZWGLDgxMDU2NDAs5a6955S45Lic5qGl5bq35aSN5Yy76ZmiLOa2iOWMluenkSwsMTY4NjIwMzI1NDQ2ODI1MFZWR0lVLDEsODAwLCwsOC82LzIwMjMsDQpEQi1GWTIwMjQtMDYtWjMxMDAwMyznm7TmjqXplIDllK7nu5nljLvpmaIsODEwNTY0MCzlrr3nlLjkuJzmoaXlurflpI3ljLvpmaIs5raI5YyW56eRLCwxMjM0NTY3ODYsMiw1MDAs5LiqLCw4LzYvMjAyMywNCkRCLUZZMjAyNC0wNi1aMzEwMDA0LOS6kuebuOiwg%2Bi0pyw4MTA1NjQwLOWuveeUuOS4nOahpeW6t%2BWkjeWMu%2BmZoizmtojljJbnp5EsLDE2ODYyMDMyNTc2NTcyNTBHU0ZTQiw0LDkwMDAs55uSLCw4LzYvMjAyMywNCg%3D%3D',
- '%ET%',
- '閲嶅簡',
- 'Testaccount001'
- );
+ LexOutboundorderImportController.importCSVFile('77u%2FTmFtZSxTdW1tb25zRm9yRGlyY3Rpb25fX2MsSG9zcGl0YWxDb2RlLE9yZGVyX0Zvckhvc3BpdGFsX19jLE9yZGVyX0ZvckN1c3RvbWVyVGV4dF9fYyxPcmRlcl9Gb3JEZWFsZXJfX2MsQmFyX0NvZGVfX2MsU2hpcG1lbnRfQ291bnRfX2MsRGVsaXZlcnlfTGlzdF9STUJfX2MsQm94X1BpZWNlX19jLFVuaXRwcmljZV9Ub19hZ2VuY3lfX2MsT3V0Ym91bmRfRGF0ZV9fYyxMb3NlX3JlYXNvbl9fYw0KREItRlkyMDI0LTA2LVozMTAwMDIs6ZSA5ZSu57uZ5LqM57qn57uP6ZSA5ZWGLDgxMDU2NDAs5a6955S45Lic5qGl5bq35aSN5Yy76ZmiLOa2iOWMluenkSwsMTY4NjIwMzI1NDQ2ODI1MFZWR0lVLDEsODAwLCwsOC82LzIwMjMsDQpEQi1GWTIwMjQtMDYtWjMxMDAwMyznm7TmjqXplIDllK7nu5nljLvpmaIsODEwNTY0MCzlrr3nlLjkuJzmoaXlurflpI3ljLvpmaIs5raI5YyW56eRLCwxMjM0NTY3ODYsMiw1MDAs5LiqLCw4LzYvMjAyMywNCkRCLUZZMjAyNC0wNi1aMzEwMDA0LOS6kuebuOiwg%2Bi0pyw4MTA1NjQwLOWuveeUuOS4nOahpeW6t%2BWkjeWMu%2BmZoizmtojljJbnp5EsLDE2ODYyMDMyNTc2NTcyNTBHU0ZTQiw0LDkwMDAs55uSLCw4LzYvMjAyMywNCg%3D%3D','%ET%','閲嶅簡','Testaccount001');
//瀵煎叆
- List<String[]> csvRecordStr = LexOutboundorderImportController.csvRecordStr;
+ List<String[]> csvRecordStr = LexOutboundorderImportController.csvRecordStr;
List<LexOutboundorderImportController.ConsumableorderdetailsInfo> orderRecords = LexOutboundorderImportController.orderRecords;
String orderRecordsLwc = JSON.serialize(orderRecords);
- Map<String, String> secondAgencyMap = LexOutboundorderImportController.secondAgencyMap;
+ Map<String, String> secondAgencyMap = LexOutboundorderImportController.secondAgencyMap;
Map<String, String> hospitalSysMap = LexOutboundorderImportController.hospitalSysMap;
- LexOutboundorderImportController.dataImport(
- csvRecordStr,
- orderRecordsLwc,
- '%ET%',
- '閲嶅簡',
- 'Testaccount001',
- 'myAccount1.Id',
- 'ET',
- secondAgencyMap,
- hospitalSysMap
- );
- LexOutboundorderImportController.dataImport(
- csvRecordStr,
- orderRecordsLwc,
- '%ET%',
- '閲嶅簡',
- 'Testaccount001',
- 'myAccount1.Id',
- 'ET',
- secondAgencyMap,
- hospitalSysMap
- );
- LexOutboundorderImportController.dataImport(
- csvRecordStr,
- '[{"agencyName": "","hospitalCode": "8215356","hospitalName": "瀹界敻涓滄ˉ搴峰鍖婚櫌","order": {"Name": "DB-FY2024-06-Z310002","SummonsForDirction__c": "鐩存帴閿�鍞粰鍖婚櫌","Order_ForHospital__c":"娴嬭瘯鍖婚櫌","Order_Attachment__c": "","Order_Indication__c": "","Order_ForCustomerText__c": "娑堝寲绉�","Invoice_Note__c": "","Outbound_Date__c": "2023-06-08"}}]',
- '%ET%',
- '閲嶅簡',
- 'Testaccount001',
- 'myAccount1.Id',
- 'ET',
- secondAgencyMap,
- hospitalSysMap
- );
+ LexOutboundorderImportController.dataImport(csvRecordStr,orderRecordsLwc,'%ET%','閲嶅簡','Testaccount001','myAccount1.Id','ET',secondAgencyMap,hospitalSysMap);
+ LexOutboundorderImportController.dataImport(csvRecordStr,orderRecordsLwc,'%ET%','閲嶅簡','Testaccount001','myAccount1.Id','ET',secondAgencyMap,hospitalSysMap);
+ LexOutboundorderImportController.dataImport(csvRecordStr,'[{"agencyName": "","hospitalCode": "8215356","hospitalName": "瀹界敻涓滄ˉ搴峰鍖婚櫌","order": {"Name": "DB-FY2024-06-Z310002","SummonsForDirction__c": "鐩存帴閿�鍞粰鍖婚櫌","Order_ForHospital__c":"娴嬭瘯鍖婚櫌","Order_Attachment__c": "","Order_Indication__c": "","Order_ForCustomerText__c": "娑堝寲绉�","Invoice_Note__c": "","Outbound_Date__c": "2023-06-08"}}]','%ET%','閲嶅簡','Testaccount001','myAccount1.Id','ET',secondAgencyMap,hospitalSysMap);
+
+
+
+
+
LexOutboundorderImportController ctrls = new LexOutboundorderImportController();
LexOutboundorderImportController.init();
Blob blobData = Blob.valueOf(csvBody);
String base64Data = EncodingUtil.base64Encode(blobData);
- LexOutboundorderImportController.importCSVFile('base64Data', '%ET%', '閲嶅簡', 'Testaccount001');
+ LexOutboundorderImportController.importCSVFile('base64Data','%ET%','閲嶅簡','Testaccount001');
String csvBody1 = '';
csvBody1 = 'Name,SummonsForDirction__c,HospitalCode,Order_ForHospital__c,Order_ForCustomerText__c,Order_ForDealer__c,Bar_Code__c,Shipment_Count__c,Delivery_List_RMB__c,Box_Piece__c,Unitprice_To_agency__c,product,Outbound_Date__c\n';
- csvBody1 += 'CS-S0001,鍖婚櫌璇曠敤,,,,鍖婚櫌璇曠敤1,123456789,1,,鐩�,230,2017-02-17\n';
- csvBody1 += 'CS-S0001,鍖婚櫌璇曠敤,,,,鍖婚櫌璇曠敤1,123456788,1,,鐩�,230,2017-02-17\n';
- csvBody1 += 'CS-S0001,鍖婚櫌璇曠敤,,,,娴嬪尰闄㈣瘯鐢�1,123456787,1,,鐩�,230,2017-02-17\n';
- csvBody1 += 'CS-S0001,鍖婚櫌璇曠敤,,,,鍖婚櫌璇曠敤1,123456786,1,,鐩�,230,2017-02-17\n';
+ csvBody1 +='CS-S0001,鍖婚櫌璇曠敤,,,,鍖婚櫌璇曠敤1,123456789,1,,鐩�,230,2017-02-17\n';
+ csvBody1 +='CS-S0001,鍖婚櫌璇曠敤,,,,鍖婚櫌璇曠敤1,123456788,1,,鐩�,230,2017-02-17\n';
+ csvBody1 +='CS-S0001,鍖婚櫌璇曠敤,,,,娴嬪尰闄㈣瘯鐢�1,123456787,1,,鐩�,230,2017-02-17\n';
+ csvBody1 +='CS-S0001,鍖婚櫌璇曠敤,,,,鍖婚櫌璇曠敤1,123456786,1,,鐩�,230,2017-02-17\n';
Blob blobData1 = Blob.valueOf(csvBody1);
String base64Data1 = EncodingUtil.base64Encode(blobData1);
- LexOutboundorderImportController.importCSVFile('base64Data1', '%ET%', '閲嶅簡', 'Testaccount001');
+ LexOutboundorderImportController.importCSVFile('base64Data1','%ET%','閲嶅簡','Testaccount001');
String csvBody2 = '';
csvBody2 = 'Name,SummonsForDirction__c,HospitalCode,Order_ForHospital__c,Order_ForCustomerText__c,Order_ForDealer__c,Bar_Code__c,Shipment_Count__c,Delivery_List_RMB__c,Box_Piece__c,Unitprice_To_agency__c,Outbound_Date__c\n';
- csvBody2 += 'CS-S0001,鍖婚櫌璇曠敤,,,,鍖婚櫌璇曠敤1,,1,230,鐩�,230,2017-02-17\n';
- csvBody2 += 'CS-S0001,鍖婚櫌璇曠敤,,,,鍖婚櫌璇曠敤1,,1,230,鐩�,230,2017-02-17\n';
- csvBody2 += 'CS-S0001,鍖婚櫌璇曠敤,,,,娴嬪尰闄㈣瘯鐢�1,,1,230,鐩�,230,2017-02-17\n';
- csvBody2 += 'CS-S0001,鍖婚櫌璇曠敤,,,,鍖婚櫌璇曠敤1,,1,230,鐩�,230,2017-02-17\n';
+ csvBody2 +='CS-S0001,鍖婚櫌璇曠敤,,,,鍖婚櫌璇曠敤1,,1,230,鐩�,230,2017-02-17\n';
+ csvBody2 +='CS-S0001,鍖婚櫌璇曠敤,,,,鍖婚櫌璇曠敤1,,1,230,鐩�,230,2017-02-17\n';
+ csvBody2 +='CS-S0001,鍖婚櫌璇曠敤,,,,娴嬪尰闄㈣瘯鐢�1,,1,230,鐩�,230,2017-02-17\n';
+ csvBody2 +='CS-S0001,鍖婚櫌璇曠敤,,,,鍖婚櫌璇曠敤1,,1,230,鐩�,230,2017-02-17\n';
Blob blobData2 = Blob.valueOf(csvBody2);
String base64Data2 = EncodingUtil.base64Encode(blobData1);
- LexOutboundorderImportController.importCSVFile('base64Data2', '%ET%', '閲嶅簡', 'Testaccount001');
+ LexOutboundorderImportController.importCSVFile('base64Data2','%ET%','閲嶅簡','Testaccount001');
String csvBody3 = '';
csvBody3 = 'Name,SummonsForDirction__c,HospitalCode,Order_ForHospital__c,Order_ForCustomerText__c,Order_ForDealer__c,Bar_Code__c,Shipment_Count__c,Delivery_List_RMB__c,Box_Piece__c,Unitprice_To_agency__c,Outbound_Date__c\n';
- csvBody3 += 'CS-S0001,鍖婚櫌璇曠敤,,,,鍖婚櫌璇曠敤1,123456789,1,230,鐩�,230,2017-02-17\n';
- csvBody3 += 'CS-S0001,鍖婚櫌璇曠敤,,,,鍖婚櫌璇曠敤1,123456788,1,230,鐩�,230,2017-02-17\n';
- csvBody3 += 'CS-S0001,鍖婚櫌璇曠敤,,,,娴嬪尰闄㈣瘯鐢�1,123456787,1,230,鐩�,230,2017-02-17\n';
- csvBody3 += 'CS-S0001,鍖婚櫌璇曠敤,,,,鍖婚櫌璇曠敤1,123456786,12,230,鐩�,230,2017-02-17\n';
+ csvBody3 +='CS-S0001,鍖婚櫌璇曠敤,,,,鍖婚櫌璇曠敤1,123456789,1,230,鐩�,230,2017-02-17\n';
+ csvBody3 +='CS-S0001,鍖婚櫌璇曠敤,,,,鍖婚櫌璇曠敤1,123456788,1,230,鐩�,230,2017-02-17\n';
+ csvBody3 +='CS-S0001,鍖婚櫌璇曠敤,,,,娴嬪尰闄㈣瘯鐢�1,123456787,1,230,鐩�,230,2017-02-17\n';
+ csvBody3 +='CS-S0001,鍖婚櫌璇曠敤,,,,鍖婚櫌璇曠敤1,123456786,12,230,鐩�,230,2017-02-17\n';
Blob blobData3 = Blob.valueOf(csvBody3);
String base64Data3 = EncodingUtil.base64Encode(blobData3);
- LexOutboundorderImportController.importCSVFile('base64Data3', '%ET%', '閲嶅簡', 'Testaccount001');
+ LexOutboundorderImportController.importCSVFile('base64Data3','%ET%','閲嶅簡','Testaccount001');
System.Test.stopTest();
+
+
}
}
static testMethod void allTest() {
+
user myUser_test;
- Account myAccount1;
+ Account myAccount1 ;
List<RecordType> rectHos;
- User thisUser = [SELECT Id FROM User WHERE Id = :UserInfo.getUserId()];
- System.runAs(thisUser) {
- List<RecordType> rectCo = [
- SELECT Id
- FROM RecordType
- WHERE IsActive = TRUE AND SobjectType = 'Account' AND Name = '璨╁2搴�'
- ];
+ User thisUser = [ select Id from User where Id = :UserInfo.getUserId()];
+ System.runAs(thisUser){
+ List<RecordType> rectCo = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '璨╁2搴�'];
if (rectCo.size() == 0) {
return;
}
- rectHos = [
- SELECT Id
- FROM RecordType
- WHERE IsActive = TRUE AND SobjectType = 'Account' AND Name = '鐥呴櫌'
- ];
+ rectHos = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '鐥呴櫌'];
if (rectHos.size() == 0) {
return;
}
- Profile prof = [
- SELECT Id
- FROM Profile
- WHERE Name = '901_缁忛攢鍟嗙ぞ鍖烘櫘閫氭潈闄恄2閲嶉獙璇�(ET)'
- ];
-
- myAccount1 = new Account(
- name = 'Testaccount001',
- Dealer_discount__c = 20,
- RecordTypeId = rectCo[0].Id,
- AgentCode_Ext__c = '9999900'
- );
+ Profile prof = [select Id from Profile where Name ='901_缁忛攢鍟嗙ぞ鍖烘櫘閫氭潈闄恄2閲嶉獙璇�(ET)'];
+
+ myAccount1 = new Account(name='Testaccount001',Dealer_discount__c =20,RecordTypeId = rectCo[0].Id,AgentCode_Ext__c = '9999900');
insert myAccount1;
-
- Contact core = new Contact(
- email = 'jplumber@salesforce.com',
- firstname = 'Joe',
- lastname = 'Plumber',
- accountid = myAccount1.id
- );
+
+ Contact core = new Contact(email='jplumber@salesforce.com', firstname='Joe',lastname='Plumber',accountid=myAccount1.id);
insert core;
- MyUser_Test = new User(
- ContactId = core.id,
- Alias = 'newUser',
- Email = 'newuser@testorg.com',
- EmailEncodingKey = 'UTF-8',
- LastName = 'TestUser',
- LanguageLocaleKey = 'zh_CN',
- LocaleSidKey = 'zh_CN',
- ProfileId = prof.Id,
- TimeZoneSidKey = 'Asia/Shanghai',
- UserName = 'testUser@testorg.com',
- Work_Location__c = '閲嶅簡'
- );
+ MyUser_Test = New User(ContactId = core.id,Alias = 'newUser',Email='newuser@testorg.com',EmailEncodingKey='UTF-8', LastName='TestUser', LanguageLocaleKey='zh_CN',LocaleSidKey='zh_CN', ProfileId = prof.Id,TimeZoneSidKey='Asia/Shanghai', UserName='testUser@testorg.com',Work_Location__c = '閲嶅簡');
insert MyUser_Test;
+
}
- System.runAs(MyUser_Test) {
- Product2 prod01 = new Product2(
- Name = 'Test01',
- ProductCode = 'Test01',
- Asset_Model_No__c = 'Test01',
- SFDA_Status__c = '鏈夊姽',
- Dealer_special_Object__c = true,
- Packing_list_manual__c = 12,
- Manual_Entry__c = false
- );
- Product2 prod02 = new Product2(
- Name = 'Test02',
- ProductCode = 'Test02',
- Asset_Model_No__c = 'Test02',
- SFDA_Status__c = '鏈夊姽',
- Dealer_special_Object__c = true,
- Packing_list_manual__c = 12,
- Manual_Entry__c = false
- );
- insert new List<Product2>{ prod01, prod02 };
- Product2__c pro1 = new Product2__c(Name = 'Pro001', OT_CODE_Text__c = 'Test001', Product2__c = prod01.Id);
- Product2__c pro2 = new Product2__c(Name = 'Pro002', OT_CODE_Text__c = 'Test002', Product2__c = prod02.Id);
- insert new List<Product2__c>{ pro1, pro2 };
+ System.runAs(MyUser_Test){
+ Product2 prod01 = new Product2(Name='Test01',ProductCode='Test01',Asset_Model_No__c = 'Test01',SFDA_Status__c = '鏈夊姽',Dealer_special_Object__c = true,Packing_list_manual__c=12,Manual_Entry__c = false);
+ Product2 prod02 = new Product2(Name='Test02',ProductCode='Test02',Asset_Model_No__c = 'Test02',SFDA_Status__c = '鏈夊姽',Dealer_special_Object__c = true,Packing_list_manual__c=12,Manual_Entry__c = false);
+ insert new Product2[]{prod01,prod02};
+ Product2__c pro1 = new Product2__c(Name='Pro001',OT_CODE_Text__c='Test001',Product2__c = prod01.Id);
+ Product2__c pro2 = new Product2__c(Name='Pro002',OT_CODE_Text__c='Test002',Product2__c = prod02.Id);
+ insert new Product2__c[] {pro1, pro2};
Consumable_order__c Order1 = new Consumable_order__c();
Order1.Name = 'OCM_01_001';
Order1.Order_status__c = '鎵瑰噯';
@@ -386,7 +222,7 @@
Order1.RecordTypeid = System.Label.RT_ConOrder_Order;
Order1.Dealer_Info__c = myAccount1.Id;
Order1.Order_ProType__c = 'ET';
- insert Order1;
+ insert Order1;
Consumable_order__c Order2 = new Consumable_order__c();
Order2.Name = 'OCM_01_001';
@@ -396,11 +232,13 @@
Order2.Dealer_Info__c = myAccount1.Id;
Order2.Order_ProType__c = 'ET';
Order2.SummonsForDirction__c = '鐩存帴閿�鍞粰鍖婚櫌';
- insert Order2;
+ insert Order2;
+
+
Consumable_order_details2__c Orderdet4 = new Consumable_order_details2__c();
Orderdet4.Name = 'OCM_01_001004';
- Orderdet4.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
+ Orderdet4.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery ;
Orderdet4.Consumable_Arrived_order__c = Order1.Id;
Orderdet4.Sterilization_limit__c = Date.today().addDays(-1);
Orderdet4.Bar_Code__c = '123456789';
@@ -410,7 +248,7 @@
Consumable_order_details2__c orderdet3 = new Consumable_order_details2__c();
orderdet3.Name = 'OCM_01_001004';
- orderdet3.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
+ orderdet3.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery ;
orderdet3.Consumable_Arrived_order__c = Order1.Id;
orderdet3.Sterilization_limit__c = Date.today().addDays(-1);
orderdet3.Bar_Code__c = '1686203254468250VVGIU';
@@ -419,9 +257,10 @@
orderdet3.Box_Piece__c = '鐩�';
orderdet3.Lose_Flag__c = false;
+
Consumable_order_details2__c orderdet2 = new Consumable_order_details2__c();
orderdet2.Name = 'OCM_01_001004';
- orderdet2.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
+ orderdet2.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery ;
orderdet2.Consumable_Arrived_order__c = Order1.Id;
orderdet2.Sterilization_limit__c = Date.today().addDays(-1);
orderdet2.Bar_Code__c = '1686203256098250REJOQ';
@@ -431,182 +270,81 @@
Consumable_order_details2__c orderdet1 = new Consumable_order_details2__c();
Orderdet1.Name = 'OCM_01_001004';
- Orderdet1.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
+ Orderdet1.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery ;
Orderdet1.Consumable_Arrived_order__c = Order1.Id;
Orderdet1.Sterilization_limit__c = Date.today().addDays(-1);
Orderdet1.Bar_Code__c = '1686203257657250GSFSB';
Orderdet1.Consumable_Product__c = pro1.Id;
Orderdet1.Arrive_date__c = Date.today().addDays(-1);
Orderdet1.Box_Piece__c = '涓�';
- insert new List<Consumable_order_details2__c>{ orderdet1, orderdet2, orderdet3, orderdet4 };
- Account hosp1 = new Account(name = 'Testhosp001', RecordTypeId = rectHos[0].Id);
+ insert new Consumable_order_details2__c[] {orderdet1, orderdet2,orderdet3,orderdet4};
+ Account hosp1 = new Account(name='Testhosp001',RecordTypeId = rectHos[0].Id);
insert hosp1;
- Agency_Hospital_Link__c jxs = new Agency_Hospital_Link__c(name = 'jxs001', Agency__c = myAccount1.Id, Hospital__c = hosp1.Id);
+ Agency_Hospital_Link__c jxs = new Agency_Hospital_Link__c(name='jxs001',Agency__c = myAccount1.Id,Hospital__c=hosp1.Id);
insert jxs;
- List<Agency_Hospital_Link__c> jxsList = [
- SELECT Name, Hospital__r.Management_Code__c
- FROM Agency_Hospital_Link__c
- WHERE Name = 'Testhosp001'
- ];
+ List<Agency_Hospital_Link__c> jxsList = [select Name,Hospital__r.Management_Code__c from Agency_Hospital_Link__c where Name = 'Testhosp001'];
//杩愯鏁版嵁
System.Test.startTest();
LexOutboundorderImportController.init();
String csvBody = '';
//hospitalCode=null,hospitalName!=null
csvBody = 'Name,SummonsForDirction__c,HospitalCode,Order_ForHospital__c,Order_ForCustomerText__c,Order_ForDealer__c,Bar_Code__c,Shipment_Count__c,Delivery_List_RMB__c,Box_Piece__c,Unitprice_To_agency__c,Outbound_Date__c\n';
- csvBody +=
- 'CS-S0001,閿�鍞粰浜岀骇缁忛攢鍟�,' +
- jxsList[0].Hospital__r.Management_Code__c +
- ',Testhosp001,test,娴嬭瘯浜岀骇缁忛攢鍟�1,123456789,1,230,鐩�,230,2017-02-17\n';
- csvBody +=
- 'CS-S0001,閿�鍞粰浜岀骇缁忛攢鍟�,' +
- jxsList[0].Hospital__r.Management_Code__c +
- ',Testhosp001,test,娴嬭瘯浜岀骇缁忛攢鍟�1,123456788,1,230,鐩�,230,2017-02-17\n';
- csvBody +=
- 'CS-S0001,閿�鍞粰浜岀骇缁忛攢鍟�,' +
- jxsList[0].Hospital__r.Management_Code__c +
- ',Testhosp001,test,娴嬭瘯浜岀骇缁忛攢鍟�1,123456787,1,230,涓�,230,2017-02-17\n';
- csvBody +=
- 'CS-S0001,閿�鍞粰浜岀骇缁忛攢鍟�,' +
- jxsList[0].Hospital__r.Management_Code__c +
- ',Testhosp001,test,娴嬭瘯浜岀骇缁忛攢鍟�1,123456786,1,230,涓�,230,2017-02-17\n';
+ csvBody +='CS-S0001,閿�鍞粰浜岀骇缁忛攢鍟�,' + jxsList[0].Hospital__r.Management_Code__c + ',Testhosp001,test,娴嬭瘯浜岀骇缁忛攢鍟�1,123456789,1,230,鐩�,230,2017-02-17\n';
+ csvBody +='CS-S0001,閿�鍞粰浜岀骇缁忛攢鍟�,' + jxsList[0].Hospital__r.Management_Code__c + ',Testhosp001,test,娴嬭瘯浜岀骇缁忛攢鍟�1,123456788,1,230,鐩�,230,2017-02-17\n';
+ csvBody +='CS-S0001,閿�鍞粰浜岀骇缁忛攢鍟�,' + jxsList[0].Hospital__r.Management_Code__c + ',Testhosp001,test,娴嬭瘯浜岀骇缁忛攢鍟�1,123456787,1,230,涓�,230,2017-02-17\n';
+ csvBody +='CS-S0001,閿�鍞粰浜岀骇缁忛攢鍟�,' + jxsList[0].Hospital__r.Management_Code__c + ',Testhosp001,test,娴嬭瘯浜岀骇缁忛攢鍟�1,123456786,1,230,涓�,230,2017-02-17\n';
String base64Content = EncodingUtil.Base64Encode(Blob.valueOf(csvBody));
- System.debug('base64Content==>' + base64Content);
- Blob blobContent = EncodingUtil.base64Decode(base64Content);
- System.debug('blobContent==>' + blobContent.toString());
- LexOutboundorderImportController.importCSVFile(base64Content, '%ET%', '閲嶅簡', 'Testaccount001');
- LexOutboundorderImportController.importCSVFile(
- 'TmFtZSxTdW1tb25zRm9yRGlyY3Rpb25fX2MsSG9zcGl0YWxDb2RlLE9yZGVyX0Zvckhvc3BpdGFsX19jLE9yZGVyX0ZvckN1c3RvbWVyVGV4dF9fYyxPcmRlcl9Gb3JEZWFsZXJfX2MsQmFyX0NvZGVfX2MsU2hpcG1lbnRfQ291bnRfX2MsRGVsaXZlcnlfTGlzdF9STUJfX2MsQm94X1BpZWNlX19jLFVuaXRwcmljZV9Ub19hZ2VuY3lfX2MsT3V0Ym91bmRfRGF0ZV9fYyxMb3NlX3JlYXNvbl9fYw0KREItRlkyMDI0LTA2LVozMTAwMDIs55u05o6l6ZSA5ZSu57uZ5Yy76ZmiLDgxMDU2NDAs5a6955S45Lic5qGl5bq35aSN5Yy76ZmiLOa2iOWMluenkSwsMTY4NjIwMzI1NDQ2ODI1MFZWR0lVLDEsMjAwMCznm5IsMjAsMjAyMy82Lzgs5Lii5aSx5Y6f5ZugDQpEQi1GWTIwMjQtMDYtWjMxMDAwMyznm7TmjqXplIDllK7nu5nljLvpmaIsODEwNTY0MCzlrr3nlLjkuJzmoaXlurflpI3ljLvpmaIs5raI5YyW56eRLCwxNjg2MjAzMjU2MDk4MjUwUkVKT1EsMSwzMDAwLOebkiwyMCwyMDIzLzYvOCzkuKLlpLHljp%2Flm6ANCkRCLUZZMjAyNC0wNi1aMzEwMDA0LOebtOaOpemUgOWUrue7meWMu%2BmZoiw4MTA1NjQwLOWuveeUuOS4nOahpeW6t%2BWkjeWMu%2BmZoizmtojljJbnp5EsLDE2ODYyMDMyNTc2NTcyNTBHU0ZTQiwxLDQwMDAs55uSLDIwLDIwMjMvNi84LOS4ouWkseWOn%2BWboA0K',
- '%ET%',
- '閲嶅簡',
- 'Testaccount001'
- );
- LexOutboundorderImportController.importCSVFile(
- '77u%2FTmFtZSxTdW1tb25zRm9yRGlyY3Rpb25fX2MsSG9zcGl0YWxDb2RlLE9yZGVyX0Zvckhvc3BpdGFsX19jLE9yZGVyX0ZvckN1c3RvbWVyVGV4dF9fYyxPcmRlcl9Gb3JEZWFsZXJfX2MsQmFyX0NvZGVfX2MsU2hpcG1lbnRfQ291bnRfX2MsRGVsaXZlcnlfTGlzdF9STUJfX2MsQm94X1BpZWNlX19jLFVuaXRwcmljZV9Ub19hZ2VuY3lfX2MsT3V0Ym91bmRfRGF0ZV9fYyxMb3NlX3JlYXNvbl9fYw0KREItRlkyMDI0LTA2LVozMTAwMDIs6ZSA5ZSu57uZ5LqM57qn57uP6ZSA5ZWGLDgxMDU2NDAs5a6955S45Lic5qGl5bq35aSN5Yy76ZmiLCwxNjg2MjAzMjU0NDY4MjUwVlZHSVUsMSwyMDAwLDIwLOebkiwsLA0KREItRlkyMDI0LTA2LVozMTAwMDMs55u05o6l6ZSA5ZSu57uZ5Yy76ZmiLDgxMDU2NDAs5a6955S45Lic5qGl5bq35aSN5Yy76ZmiLOa2iOWMluenkSwxNjg2MjAzMjU2MDk4MjUwUkVKT1EsMSw0MDAwLDIwLOS4qiwsLA0KREItRlkyMDI0LTA2LVozMTAwMDQs5LqS55u46LCD6LSnLDgxMDU2NDAs5a6955S45Lic5qGl5bq35aSN5Yy76ZmiLOa2iOWMluenkSwsMSw1MDAwLDIwLOS4qiwsLA0K',
- '%ET%',
- '閲嶅簡',
- 'Testaccount001'
- );
- LexOutboundorderImportController.importCSVFile('', '', '', '');
+ System.debug('base64Content==>'+base64Content);
+ Blob blobContent = EncodingUtil.base64Decode( base64Content);
+ System.debug('blobContent==>'+ blobContent.toString());
+ LexOutboundorderImportController.importCSVFile(base64Content,'%ET%','閲嶅簡','Testaccount001');
+ LexOutboundorderImportController.importCSVFile('TmFtZSxTdW1tb25zRm9yRGlyY3Rpb25fX2MsSG9zcGl0YWxDb2RlLE9yZGVyX0Zvckhvc3BpdGFsX19jLE9yZGVyX0ZvckN1c3RvbWVyVGV4dF9fYyxPcmRlcl9Gb3JEZWFsZXJfX2MsQmFyX0NvZGVfX2MsU2hpcG1lbnRfQ291bnRfX2MsRGVsaXZlcnlfTGlzdF9STUJfX2MsQm94X1BpZWNlX19jLFVuaXRwcmljZV9Ub19hZ2VuY3lfX2MsT3V0Ym91bmRfRGF0ZV9fYyxMb3NlX3JlYXNvbl9fYw0KREItRlkyMDI0LTA2LVozMTAwMDIs55u05o6l6ZSA5ZSu57uZ5Yy76ZmiLDgxMDU2NDAs5a6955S45Lic5qGl5bq35aSN5Yy76ZmiLOa2iOWMluenkSwsMTY4NjIwMzI1NDQ2ODI1MFZWR0lVLDEsMjAwMCznm5IsMjAsMjAyMy82Lzgs5Lii5aSx5Y6f5ZugDQpEQi1GWTIwMjQtMDYtWjMxMDAwMyznm7TmjqXplIDllK7nu5nljLvpmaIsODEwNTY0MCzlrr3nlLjkuJzmoaXlurflpI3ljLvpmaIs5raI5YyW56eRLCwxNjg2MjAzMjU2MDk4MjUwUkVKT1EsMSwzMDAwLOebkiwyMCwyMDIzLzYvOCzkuKLlpLHljp%2Flm6ANCkRCLUZZMjAyNC0wNi1aMzEwMDA0LOebtOaOpemUgOWUrue7meWMu%2BmZoiw4MTA1NjQwLOWuveeUuOS4nOahpeW6t%2BWkjeWMu%2BmZoizmtojljJbnp5EsLDE2ODYyMDMyNTc2NTcyNTBHU0ZTQiwxLDQwMDAs55uSLDIwLDIwMjMvNi84LOS4ouWkseWOn%2BWboA0K','%ET%','閲嶅簡','Testaccount001');
+ LexOutboundorderImportController.importCSVFile('77u%2FTmFtZSxTdW1tb25zRm9yRGlyY3Rpb25fX2MsSG9zcGl0YWxDb2RlLE9yZGVyX0Zvckhvc3BpdGFsX19jLE9yZGVyX0ZvckN1c3RvbWVyVGV4dF9fYyxPcmRlcl9Gb3JEZWFsZXJfX2MsQmFyX0NvZGVfX2MsU2hpcG1lbnRfQ291bnRfX2MsRGVsaXZlcnlfTGlzdF9STUJfX2MsQm94X1BpZWNlX19jLFVuaXRwcmljZV9Ub19hZ2VuY3lfX2MsT3V0Ym91bmRfRGF0ZV9fYyxMb3NlX3JlYXNvbl9fYw0KREItRlkyMDI0LTA2LVozMTAwMDIs6ZSA5ZSu57uZ5LqM57qn57uP6ZSA5ZWGLDgxMDU2NDAs5a6955S45Lic5qGl5bq35aSN5Yy76ZmiLCwxNjg2MjAzMjU0NDY4MjUwVlZHSVUsMSwyMDAwLDIwLOebkiwsLA0KREItRlkyMDI0LTA2LVozMTAwMDMs55u05o6l6ZSA5ZSu57uZ5Yy76ZmiLDgxMDU2NDAs5a6955S45Lic5qGl5bq35aSN5Yy76ZmiLOa2iOWMluenkSwxNjg2MjAzMjU2MDk4MjUwUkVKT1EsMSw0MDAwLDIwLOS4qiwsLA0KREItRlkyMDI0LTA2LVozMTAwMDQs5LqS55u46LCD6LSnLDgxMDU2NDAs5a6955S45Lic5qGl5bq35aSN5Yy76ZmiLOa2iOWMluenkSwsMSw1MDAwLDIwLOS4qiwsLA0K','%ET%','閲嶅簡','Testaccount001');
+ LexOutboundorderImportController.importCSVFile('','','','');
+
//瀵煎叆
- List<String[]> csvRecordStr = LexOutboundorderImportController.csvRecordStr;
+ List<String[]> csvRecordStr = LexOutboundorderImportController.csvRecordStr;
List<LexOutboundorderImportController.ConsumableorderdetailsInfo> orderRecords = LexOutboundorderImportController.orderRecords;
- System.debug('111===>' + JSON.serialize(LexOutboundorderImportController.orderRecords));
+ System.debug('111===>'+JSON.serialize(LexOutboundorderImportController.orderRecords));
String orderRecordsLwc = JSON.serialize(orderRecords);
- Map<String, String> secondAgencyMap = LexOutboundorderImportController.secondAgencyMap;
+ Map<String, String> secondAgencyMap = LexOutboundorderImportController.secondAgencyMap;
Map<String, String> hospitalSysMap = LexOutboundorderImportController.hospitalSysMap;
// hospitalSysMap.put('8105640',myAccount1.Id);
// hospitalSysMap.put('8106864','0011000001g02glAAA');
// hospitalSysMap.put('8106867','0011000001g02hUAAQ');
// hospitalSysMap.put('8107348','0011000001g09fDAAQ');
- System.debug('hospitalSysMap==' + hospitalSysMap);
- LexOutboundorderImportController.dataImport(
- csvRecordStr,
- orderRecordsLwc,
- '%ET%',
- '閲嶅簡',
- 'Testaccount001',
- 'myAccount1.Id',
- 'ET',
- secondAgencyMap,
- hospitalSysMap
- );
- LexOutboundorderImportController.dataImport(
- csvRecordStr,
- '[{"agencyName": "","hospitalCode": "8215356","hospitalName": "娴嬭瘯鍖婚櫌","order": {"Name": "DB-FY2024-06-Z310002","SummonsForDirction__c": "閿�鍞粰浜岀骇缁忛攢鍟�","Order_ForHospital__c":"娴嬭瘯鍖婚櫌","Order_Attachment__c": "","Order_Indication__c": "","Order_ForCustomerText__c": "娑堝寲绉�","Invoice_Note__c": "","Outbound_Date__c": "2023-06-08"}}]',
- '%ET%',
- '閲嶅簡',
- 'Testaccount001',
- 'myAccount1.Id',
- 'ET',
- secondAgencyMap,
- hospitalSysMap
- );
- LexOutboundorderImportController.dataImport(
- csvRecordStr,
- '[{"agencyName": "Test","hospitalCode": "8215356","hospitalName": "娴嬭瘯鍖婚櫌","order": {"Name": "DB-FY2024-06-Z310002","SummonsForDirction__c": "鐩存帴閿�鍞粰鍖婚櫌","Order_ForHospital__c":"娴嬭瘯鍖婚櫌","Order_Attachment__c": "","Order_Indication__c": "","Order_ForCustomerText__c": "娑堝寲绉�","Invoice_Note__c": "","Outbound_Date__c": "2023-06-08"}}]',
- '%ET%',
- '閲嶅簡',
- 'Testaccount001',
- 'myAccount1.Id',
- 'ET',
- secondAgencyMap,
- hospitalSysMap
- );
- //浜у搧鍑鸿揣鏁伴噺涓虹┖
- LexOutboundorderImportController.importCSVFile(
- 'TmFtZSxTdW1tb25zRm9yRGlyY3Rpb25fX2MsSG9zcGl0YWxDb2RlLE9yZGVyX0Zvckhvc3BpdGFsX19jLE9yZGVyX0ZvckN1c3RvbWVyVGV4dF9fYyxPcmRlcl9Gb3JEZWFsZXJfX2MsQmFyX0NvZGVfX2MsU2hpcG1lbnRfQ291bnRfX2MsRGVsaXZlcnlfTGlzdF9STUJfX2MsQm94X1BpZWNlX19jLFVuaXRwcmljZV9Ub19hZ2VuY3lfX2MsT3V0Ym91bmRfRGF0ZV9fYyxMb3NlX3JlYXNvbl9fYw0KREItRlkyMDI0LTA2LUQzMTg5MDYs55u05o6l6ZSA5ZSu57uZ5Yy76ZmiLDgxMDg2MTMs6YeR5Lmh5Y6%2F5Y2c6ZuG6ZWH5Y2r55Sf6ZmiLOa2iOWMluenkSwsMTY4NzMxNDIzMDEzMTI1MFdVUlhFLCw1MDAs55uSLDE1LDIwMjMvNS8zMCzkuKLlpLHljp%2Flm6ANCg%3D%3D',
- '%ET%',
- '閲嶅簡',
- 'Testaccount001'
- );
+ System.debug('hospitalSysMap=='+hospitalSysMap);
+ LexOutboundorderImportController.dataImport(csvRecordStr,orderRecordsLwc,'%ET%','閲嶅簡','Testaccount001','myAccount1.Id','ET',secondAgencyMap,hospitalSysMap);
+ LexOutboundorderImportController.dataImport(csvRecordStr,'[{"agencyName": "","hospitalCode": "8215356","hospitalName": "娴嬭瘯鍖婚櫌","order": {"Name": "DB-FY2024-06-Z310002","SummonsForDirction__c": "閿�鍞粰浜岀骇缁忛攢鍟�","Order_ForHospital__c":"娴嬭瘯鍖婚櫌","Order_Attachment__c": "","Order_Indication__c": "","Order_ForCustomerText__c": "娑堝寲绉�","Invoice_Note__c": "","Outbound_Date__c": "2023-06-08"}}]','%ET%','閲嶅簡','Testaccount001','myAccount1.Id','ET',secondAgencyMap,hospitalSysMap);
+ LexOutboundorderImportController.dataImport(csvRecordStr,'[{"agencyName": "Test","hospitalCode": "8215356","hospitalName": "娴嬭瘯鍖婚櫌","order": {"Name": "DB-FY2024-06-Z310002","SummonsForDirction__c": "鐩存帴閿�鍞粰鍖婚櫌","Order_ForHospital__c":"娴嬭瘯鍖婚櫌","Order_Attachment__c": "","Order_Indication__c": "","Order_ForCustomerText__c": "娑堝寲绉�","Invoice_Note__c": "","Outbound_Date__c": "2023-06-08"}}]','%ET%','閲嶅簡','Testaccount001','myAccount1.Id','ET',secondAgencyMap,hospitalSysMap);
+ //浜у搧鍑鸿揣鏁伴噺涓虹┖
+ LexOutboundorderImportController.importCSVFile('TmFtZSxTdW1tb25zRm9yRGlyY3Rpb25fX2MsSG9zcGl0YWxDb2RlLE9yZGVyX0Zvckhvc3BpdGFsX19jLE9yZGVyX0ZvckN1c3RvbWVyVGV4dF9fYyxPcmRlcl9Gb3JEZWFsZXJfX2MsQmFyX0NvZGVfX2MsU2hpcG1lbnRfQ291bnRfX2MsRGVsaXZlcnlfTGlzdF9STUJfX2MsQm94X1BpZWNlX19jLFVuaXRwcmljZV9Ub19hZ2VuY3lfX2MsT3V0Ym91bmRfRGF0ZV9fYyxMb3NlX3JlYXNvbl9fYw0KREItRlkyMDI0LTA2LUQzMTg5MDYs55u05o6l6ZSA5ZSu57uZ5Yy76ZmiLDgxMDg2MTMs6YeR5Lmh5Y6%2F5Y2c6ZuG6ZWH5Y2r55Sf6ZmiLOa2iOWMluenkSwsMTY4NzMxNDIzMDEzMTI1MFdVUlhFLCw1MDAs55uSLDE1LDIwMjMvNS8zMCzkuKLlpLHljp%2Flm6ANCg%3D%3D','%ET%','閲嶅簡','Testaccount001');
//鍗曚綅鐩� 鏁伴噺澶т簬1(鏃犳晥)
- LexOutboundorderImportController.importCSVFile(
- 'TmFtZSxTdW1tb25zRm9yRGlyY3Rpb25fX2MsSG9zcGl0YWxDb2RlLE9yZGVyX0Zvckhvc3BpdGFsX19jLE9yZGVyX0ZvckN1c3RvbWVyVGV4dF9fYyxPcmRlcl9Gb3JEZWFsZXJfX2MsQmFyX0NvZGVfX2MsU2hpcG1lbnRfQ291bnRfX2MsRGVsaXZlcnlfTGlzdF9STUJfX2MsQm94X1BpZWNlX19jLFVuaXRwcmljZV9Ub19hZ2VuY3lfX2MsT3V0Ym91bmRfRGF0ZV9fYyxMb3NlX3JlYXNvbl9fYw0KREItRlkyMDI0LTA2LVMzMTc4MTMtMDEs55u05o6l6ZSA5ZSu57uZ5Yy76ZmiLDgxMDU2NDAs5a6955S45Lic5qGl5bq35aSN5Yy76ZmiLOa2iOWMluenkSwsMTY4NzMyMjQ0NDUwOTI1MFVZR01QLDUsNTAwLOebkiwxNSwyMDIzLzUvMzAs5Lii5aSx5Y6f5ZugDQo%3D',
- '%ET%',
- '閲嶅簡',
- 'Testaccount001'
- );
+ LexOutboundorderImportController.importCSVFile('TmFtZSxTdW1tb25zRm9yRGlyY3Rpb25fX2MsSG9zcGl0YWxDb2RlLE9yZGVyX0Zvckhvc3BpdGFsX19jLE9yZGVyX0ZvckN1c3RvbWVyVGV4dF9fYyxPcmRlcl9Gb3JEZWFsZXJfX2MsQmFyX0NvZGVfX2MsU2hpcG1lbnRfQ291bnRfX2MsRGVsaXZlcnlfTGlzdF9STUJfX2MsQm94X1BpZWNlX19jLFVuaXRwcmljZV9Ub19hZ2VuY3lfX2MsT3V0Ym91bmRfRGF0ZV9fYyxMb3NlX3JlYXNvbl9fYw0KREItRlkyMDI0LTA2LVMzMTc4MTMtMDEs55u05o6l6ZSA5ZSu57uZ5Yy76ZmiLDgxMDU2NDAs5a6955S45Lic5qGl5bq35aSN5Yy76ZmiLOa2iOWMluenkSwsMTY4NzMyMjQ0NDUwOTI1MFVZR01QLDUsNTAwLOebkiwxNSwyMDIzLzUvMzAs5Lii5aSx5Y6f5ZugDQo%3D','%ET%','閲嶅簡','Testaccount001');
System.Test.stopTest();
+
}
}
+
static testMethod void allTest1() {
- List<String[]> csvRecordStr = LexOutboundorderImportController.csvRecordStr;
- Map<String, String> secondAgencyMap = LexOutboundorderImportController.secondAgencyMap;
+ List<String[]> csvRecordStr = LexOutboundorderImportController.csvRecordStr;
+ Map<String, String> secondAgencyMap = LexOutboundorderImportController.secondAgencyMap;
Map<String, String> hospitalSysMap = LexOutboundorderImportController.hospitalSysMap;
- System.debug('===>secondAgencyMap' + secondAgencyMap);
- System.debug('===>hospitalSysMap' + hospitalSysMap);
- LexOutboundorderImportController.dataImport(
- csvRecordStr,
- '[{"agencyName": "","hospitalCode": "8215356","hospitalName": "娴嬭瘯鍖婚櫌","order": {"Name": "DB-FY2024-06-Z310002","SummonsForDirction__c": "閿�鍞粰浜岀骇缁忛攢鍟�","Order_ForHospital__c":"娴嬭瘯鍖婚櫌","Order_Attachment__c": "","Order_Indication__c": "","Order_ForCustomerText__c": "娑堝寲绉�","Invoice_Note__c": "","Outbound_Date__c": "2023-06-08"}}]',
- '%ET%',
- '閲嶅簡',
- 'Testaccount001',
- 'myAccount1.Id',
- 'ET',
- secondAgencyMap,
- hospitalSysMap
- );
- LexOutboundorderImportController.importCSVFile(
- '77u%2FTmFtZSxTdW1tb25zRm9yRGlyY3Rpb25fX2MsSG9zcGl0YWxDb2RlLE9yZGVyX0Zvckhvc3BpdGFsX19jLE9yZGVyX0ZvckN1c3RvbWVyVGV4dF9fYyxPcmRlcl9Gb3JEZWFsZXJfX2MsQmFyX0NvZGVfX2MsU2hpcG1lbnRfQ291bnRfX2MsRGVsaXZlcnlfTGlzdF9STUJfX2MsQm94X1BpZWNlX19jLFVuaXRwcmljZV9Ub19hZ2VuY3lfX2MsT3V0Ym91bmRfRGF0ZV9fYyxMb3NlX3JlYXNvbl9fYw0KREItRlkyMDI0LTA1LVozMTcxMDcs6ZSA5ZSu57uZ5LqM57qn57uP6ZSA5ZWGLDg4MDI1MCzlpKfov57lpYfliqDlpI3lgaXljLvpmaIs5aSW56eRLCwxMjM0NTYsNzAwLCznm5IsLDI3LzUvMjAwMiwNCkRCLUZZMjAyNC0wNS1aMzE3MTA3LOmUgOWUrue7meS6jOe6p%2Be7j%2BmUgOWVhiw4ODAyNTAs5aSn6L%2Be5aWH5Yqg5aSN5YGl5Yy76ZmiLOWkluenkSwsMTIzNDU2LDcwMCwwLOebkiwsMjcvNS8yMDAyLA0K',
- '%ET%',
- '閲嶅簡',
- 'Testaccount001'
- );
- LexOutboundorderImportController.importCSVFile(
- '77u%2FTmFtZSxTdW1tb25zRm9yRGlyY3Rpb25fX2MsSG9zcGl0YWxDb2RlLE9yZGVyX0Zvckhvc3BpdGFsX19jLE9yZGVyX0ZvckN1c3RvbWVyVGV4dF9fYyxPcmRlcl9Gb3JEZWFsZXJfX2MsQmFyX0NvZGVfX2MsU2hpcG1lbnRfQ291bnRfX2MsRGVsaXZlcnlfTGlzdF9STUJfX2MsQm94X1BpZWNlX19jLFVuaXRwcmljZV9Ub19hZ2VuY3lfX2MsT3V0Ym91bmRfRGF0ZV9fYyxMb3NlX3JlYXNvbl9fYw0KREItRlkyMDI0LTA1LVozMTcxMDcs55u05o6l6ZSA5ZSu57uZ5Yy76ZmiLDg4MDI1MCzlpKfov57lpYfliqDlpI3lgaXljLvpmaIs5aSW56eRLCwxMjM0NTYsNzAwLDAs55uSLCwyNy81LzIwMDIsDQpEQi1GWTIwMjQtMDUtWjMxNzEwNyzplIDllK7nu5nkuoznuqfnu4%2FplIDllYYsODgwMjUwLOWkp%2Bi%2FnuWlh%2BWKoOWkjeWBpeWMu%2BmZoizlpJbnp5EsLDEyMzQ1Niw3MDAsMCznm5IsLDI3LzUvMjAwMiwNCiwsLCwsLCwsLCwsLA0KLCwsLCwsLCwsLCwsDQosLCwsLCwsLCwsLCwNCiwsLCwsLCwsLCwsLA0KLCwscywsLCwsLCwsLA0K',
- '%ET%',
- '閲嶅簡',
- 'Testaccount001'
- );
- LexOutboundorderImportController.importCSVFile(
- 'TmFtZSxTdW1tb25zRm9yRGlyY3Rpb25fX2MsSG9zcGl0YWxDb2RlLE9yZGVyX0Zvckhvc3BpdGFsX19jLE9yZGVyX0ZvckN1c3RvbWVyVGV4dF9fYyxPcmRlcl9Gb3JEZWFsZXJfX2MsQmFyX0NvZGVfX2MsU2hpcG1lbnRfQ291bnRfX2MsRGVsaXZlcnlfTGlzdF9STUJfX2MsQm94X1BpZWNlX19jLFVuaXRwcmljZV9Ub19hZ2VuY3lfX2MsT3V0Ym91bmRfRGF0ZV9fYyxMb3NlX3JlYXNvbl9fYw0KREItRlkyMDI0LTA2LUQzMTg5MDYs55u05o6l6ZSA5ZSu57uZ5Yy76ZmiLDgxMDg2MTMs6YeR5Lmh5Y6%2F5Y2c6ZuG6ZWH5Y2r55Sf6ZmiLOa2iOWMluenkSwsMTY4NzMxNDIzMDEzMTI1MFdVUlhFLDEsLOebkiwxNSwyMDIzLzUvMzAs5Lii5aSx5Y6f5ZugDQo%3D',
- '%ET%',
- '閲嶅簡',
- 'Testaccount001'
- );
- //瀛樺湪Barcode涓虹┖
- LexOutboundorderImportController.importCSVFile(
- 'TmFtZSxTdW1tb25zRm9yRGlyY3Rpb25fX2MsSG9zcGl0YWxDb2RlLE9yZGVyX0Zvckhvc3BpdGFsX19jLE9yZGVyX0ZvckN1c3RvbWVyVGV4dF9fYyxPcmRlcl9Gb3JEZWFsZXJfX2MsQmFyX0NvZGVfX2MsU2hpcG1lbnRfQ291bnRfX2MsRGVsaXZlcnlfTGlzdF9STUJfX2MsQm94X1BpZWNlX19jLFVuaXRwcmljZV9Ub19hZ2VuY3lfX2MsT3V0Ym91bmRfRGF0ZV9fYyxMb3NlX3JlYXNvbl9fYw0KREItRlkyMDI0LTA2LUQzMTg5MDYs55u05o6l6ZSA5ZSu57uZ5Yy76ZmiLDgxMDg2MTMs6YeR5Lmh5Y6%2F5Y2c6ZuG6ZWH5Y2r55Sf6ZmiLOa2iOWMluenkSwsLDUsNTAwLOebkiwxNSwyMDIzLzUvMzAs5Lii5aSx5Y6f5ZugDQo%3D',
- '%ET%',
- '閲嶅簡',
- 'Testaccount001'
- );
+ System.debug('===>secondAgencyMap'+secondAgencyMap);
+ System.debug('===>hospitalSysMap'+hospitalSysMap);
+ LexOutboundorderImportController.dataImport(csvRecordStr,'[{"agencyName": "","hospitalCode": "8215356","hospitalName": "娴嬭瘯鍖婚櫌","order": {"Name": "DB-FY2024-06-Z310002","SummonsForDirction__c": "閿�鍞粰浜岀骇缁忛攢鍟�","Order_ForHospital__c":"娴嬭瘯鍖婚櫌","Order_Attachment__c": "","Order_Indication__c": "","Order_ForCustomerText__c": "娑堝寲绉�","Invoice_Note__c": "","Outbound_Date__c": "2023-06-08"}}]','%ET%','閲嶅簡','Testaccount001','myAccount1.Id','ET',secondAgencyMap,hospitalSysMap);
+ LexOutboundorderImportController.importCSVFile('77u%2FTmFtZSxTdW1tb25zRm9yRGlyY3Rpb25fX2MsSG9zcGl0YWxDb2RlLE9yZGVyX0Zvckhvc3BpdGFsX19jLE9yZGVyX0ZvckN1c3RvbWVyVGV4dF9fYyxPcmRlcl9Gb3JEZWFsZXJfX2MsQmFyX0NvZGVfX2MsU2hpcG1lbnRfQ291bnRfX2MsRGVsaXZlcnlfTGlzdF9STUJfX2MsQm94X1BpZWNlX19jLFVuaXRwcmljZV9Ub19hZ2VuY3lfX2MsT3V0Ym91bmRfRGF0ZV9fYyxMb3NlX3JlYXNvbl9fYw0KREItRlkyMDI0LTA1LVozMTcxMDcs6ZSA5ZSu57uZ5LqM57qn57uP6ZSA5ZWGLDg4MDI1MCzlpKfov57lpYfliqDlpI3lgaXljLvpmaIs5aSW56eRLCwxMjM0NTYsNzAwLCznm5IsLDI3LzUvMjAwMiwNCkRCLUZZMjAyNC0wNS1aMzE3MTA3LOmUgOWUrue7meS6jOe6p%2Be7j%2BmUgOWVhiw4ODAyNTAs5aSn6L%2Be5aWH5Yqg5aSN5YGl5Yy76ZmiLOWkluenkSwsMTIzNDU2LDcwMCwwLOebkiwsMjcvNS8yMDAyLA0K','%ET%','閲嶅簡','Testaccount001');
+ LexOutboundorderImportController.importCSVFile('77u%2FTmFtZSxTdW1tb25zRm9yRGlyY3Rpb25fX2MsSG9zcGl0YWxDb2RlLE9yZGVyX0Zvckhvc3BpdGFsX19jLE9yZGVyX0ZvckN1c3RvbWVyVGV4dF9fYyxPcmRlcl9Gb3JEZWFsZXJfX2MsQmFyX0NvZGVfX2MsU2hpcG1lbnRfQ291bnRfX2MsRGVsaXZlcnlfTGlzdF9STUJfX2MsQm94X1BpZWNlX19jLFVuaXRwcmljZV9Ub19hZ2VuY3lfX2MsT3V0Ym91bmRfRGF0ZV9fYyxMb3NlX3JlYXNvbl9fYw0KREItRlkyMDI0LTA1LVozMTcxMDcs55u05o6l6ZSA5ZSu57uZ5Yy76ZmiLDg4MDI1MCzlpKfov57lpYfliqDlpI3lgaXljLvpmaIs5aSW56eRLCwxMjM0NTYsNzAwLDAs55uSLCwyNy81LzIwMDIsDQpEQi1GWTIwMjQtMDUtWjMxNzEwNyzplIDllK7nu5nkuoznuqfnu4%2FplIDllYYsODgwMjUwLOWkp%2Bi%2FnuWlh%2BWKoOWkjeWBpeWMu%2BmZoizlpJbnp5EsLDEyMzQ1Niw3MDAsMCznm5IsLDI3LzUvMjAwMiwNCiwsLCwsLCwsLCwsLA0KLCwsLCwsLCwsLCwsDQosLCwsLCwsLCwsLCwNCiwsLCwsLCwsLCwsLA0KLCwscywsLCwsLCwsLA0K','%ET%','閲嶅簡','Testaccount001');
+ LexOutboundorderImportController.importCSVFile('TmFtZSxTdW1tb25zRm9yRGlyY3Rpb25fX2MsSG9zcGl0YWxDb2RlLE9yZGVyX0Zvckhvc3BpdGFsX19jLE9yZGVyX0ZvckN1c3RvbWVyVGV4dF9fYyxPcmRlcl9Gb3JEZWFsZXJfX2MsQmFyX0NvZGVfX2MsU2hpcG1lbnRfQ291bnRfX2MsRGVsaXZlcnlfTGlzdF9STUJfX2MsQm94X1BpZWNlX19jLFVuaXRwcmljZV9Ub19hZ2VuY3lfX2MsT3V0Ym91bmRfRGF0ZV9fYyxMb3NlX3JlYXNvbl9fYw0KREItRlkyMDI0LTA2LUQzMTg5MDYs55u05o6l6ZSA5ZSu57uZ5Yy76ZmiLDgxMDg2MTMs6YeR5Lmh5Y6%2F5Y2c6ZuG6ZWH5Y2r55Sf6ZmiLOa2iOWMluenkSwsMTY4NzMxNDIzMDEzMTI1MFdVUlhFLDEsLOebkiwxNSwyMDIzLzUvMzAs5Lii5aSx5Y6f5ZugDQo%3D','%ET%','閲嶅簡','Testaccount001');
+ //瀛樺湪Barcode涓虹┖
+ LexOutboundorderImportController.importCSVFile('TmFtZSxTdW1tb25zRm9yRGlyY3Rpb25fX2MsSG9zcGl0YWxDb2RlLE9yZGVyX0Zvckhvc3BpdGFsX19jLE9yZGVyX0ZvckN1c3RvbWVyVGV4dF9fYyxPcmRlcl9Gb3JEZWFsZXJfX2MsQmFyX0NvZGVfX2MsU2hpcG1lbnRfQ291bnRfX2MsRGVsaXZlcnlfTGlzdF9STUJfX2MsQm94X1BpZWNlX19jLFVuaXRwcmljZV9Ub19hZ2VuY3lfX2MsT3V0Ym91bmRfRGF0ZV9fYyxMb3NlX3JlYXNvbl9fYw0KREItRlkyMDI0LTA2LUQzMTg5MDYs55u05o6l6ZSA5ZSu57uZ5Yy76ZmiLDgxMDg2MTMs6YeR5Lmh5Y6%2F5Y2c6ZuG6ZWH5Y2r55Sf6ZmiLOa2iOWMluenkSwsLDUsNTAwLOebkiwxNSwyMDIzLzUvMzAs5Lii5aSx5Y6f5ZugDQo%3D','%ET%','閲嶅簡','Testaccount001');
//浜у搧鍑鸿揣鏁伴噺涓虹┖(鏃犳晥)
- LexOutboundorderImportController.importCSVFile(
- 'TmFtZSxTdW1tb25zRm9yRGlyY3Rpb25fX2MsSG9zcGl0YWxDb2RlLE9yZGVyX0Zvckhvc3BpdGFsX19jLE9yZGVyX0ZvckN1c3RvbWVyVGV4dF9fYyxPcmRlcl9Gb3JEZWFsZXJfX2MsQmFyX0NvZGVfX2MsU2hpcG1lbnRfQ291bnRfX2MsRGVsaXZlcnlfTGlzdF9STUJfX2MsQm94X1BpZWNlX19jLFVuaXRwcmljZV9Ub19hZ2VuY3lfX2MsT3V0Ym91bmRfRGF0ZV9fYyxMb3NlX3JlYXNvbl9fYw0KREItRlkyMDI0LTA2LVMzMTc4MTMtMDEs55u05o6l6ZSA5ZSu57uZ5Yy76ZmiLDgxMDU2NDAs5a6955S45Lic5qGl5bq35aSN5Yy76ZmiLOa2iOWMluenkSwsMTY4NzMyMjQ0NDUwOTI1MFVZR01QLCw1MDAs55uSLDE1LDIwMjMvNS8zMCzkuKLlpLHljp%2Flm6ANCg%3D%3D',
- '%ET%',
- '閲嶅簡',
- 'Testaccount001'
- );
+ LexOutboundorderImportController.importCSVFile('TmFtZSxTdW1tb25zRm9yRGlyY3Rpb25fX2MsSG9zcGl0YWxDb2RlLE9yZGVyX0Zvckhvc3BpdGFsX19jLE9yZGVyX0ZvckN1c3RvbWVyVGV4dF9fYyxPcmRlcl9Gb3JEZWFsZXJfX2MsQmFyX0NvZGVfX2MsU2hpcG1lbnRfQ291bnRfX2MsRGVsaXZlcnlfTGlzdF9STUJfX2MsQm94X1BpZWNlX19jLFVuaXRwcmljZV9Ub19hZ2VuY3lfX2MsT3V0Ym91bmRfRGF0ZV9fYyxMb3NlX3JlYXNvbl9fYw0KREItRlkyMDI0LTA2LVMzMTc4MTMtMDEs55u05o6l6ZSA5ZSu57uZ5Yy76ZmiLDgxMDU2NDAs5a6955S45Lic5qGl5bq35aSN5Yy76ZmiLOa2iOWMluenkSwsMTY4NzMyMjQ0NDUwOTI1MFVZR01QLCw1MDAs55uSLDE1LDIwMjMvNS8zMCzkuKLlpLHljp%2Flm6ANCg%3D%3D','%ET%','閲嶅簡','Testaccount001');
//浜岀骇缁忛攢鍟嗕笉涓虹┖
- LexOutboundorderImportController.importCSVFile(
- 'TmFtZSxTdW1tb25zRm9yRGlyY3Rpb25fX2MsSG9zcGl0YWxDb2RlLE9yZGVyX0Zvckhvc3BpdGFsX19jLE9yZGVyX0ZvckN1c3RvbWVyVGV4dF9fYyxPcmRlcl9Gb3JEZWFsZXJfX2MsQmFyX0NvZGVfX2MsU2hpcG1lbnRfQ291bnRfX2MsRGVsaXZlcnlfTGlzdF9STUJfX2MsQm94X1BpZWNlX19jLFVuaXRwcmljZV9Ub19hZ2VuY3lfX2MsT3V0Ym91bmRfRGF0ZV9fYyxMb3NlX3JlYXNvbl9fYw0KREItRlkyMDI0LTA2LVMzMTc4MTMtMDEs6ZSA5ZSu57uZ5LqM57qn57uP6ZSA5ZWGLDgxMDU2NDAs5a6955S45Lic5qGl5bq35aSN5Yy76ZmiLOa2iOWMluenkSwsMTY4NzMyMjQ0NDUwOTI1MFVZR01QLDUsNTAwLOebkiwxNSwyMDIzLzUvMzAs5Lii5aSx5Y6f5ZugDQo%3D',
- '%ET%',
- '閲嶅簡',
- 'Testaccount001'
- );
+ LexOutboundorderImportController.importCSVFile('TmFtZSxTdW1tb25zRm9yRGlyY3Rpb25fX2MsSG9zcGl0YWxDb2RlLE9yZGVyX0Zvckhvc3BpdGFsX19jLE9yZGVyX0ZvckN1c3RvbWVyVGV4dF9fYyxPcmRlcl9Gb3JEZWFsZXJfX2MsQmFyX0NvZGVfX2MsU2hpcG1lbnRfQ291bnRfX2MsRGVsaXZlcnlfTGlzdF9STUJfX2MsQm94X1BpZWNlX19jLFVuaXRwcmljZV9Ub19hZ2VuY3lfX2MsT3V0Ym91bmRfRGF0ZV9fYyxMb3NlX3JlYXNvbl9fYw0KREItRlkyMDI0LTA2LVMzMTc4MTMtMDEs6ZSA5ZSu57uZ5LqM57qn57uP6ZSA5ZWGLDgxMDU2NDAs5a6955S45Lic5qGl5bq35aSN5Yy76ZmiLOa2iOWMluenkSwsMTY4NzMyMjQ0NDUwOTI1MFVZR01QLDUsNTAwLOebkiwxNSwyMDIzLzUvMzAs5Lii5aSx5Y6f5ZugDQo%3D','%ET%','閲嶅簡','Testaccount001');
+
+
}
-}
+}
\ No newline at end of file
diff --git a/force-app/main/default/classes/LexOutboundorderImportControllerTest.cls-meta.xml b/force-app/main/default/classes/LexOutboundorderImportControllerTest.cls-meta.xml
index a9fd6e9..754ecb1 100644
--- a/force-app/main/default/classes/LexOutboundorderImportControllerTest.cls-meta.xml
+++ b/force-app/main/default/classes/LexOutboundorderImportControllerTest.cls-meta.xml
@@ -1,4 +1,4 @@
-<?xml version="1.0" encoding="UTF-8" ?>
+<?xml version="1.0" encoding="UTF-8"?>
<ApexClass xmlns="http://soap.sforce.com/2006/04/metadata">
<apiVersion>57.0</apiVersion>
<status>Active</status>
diff --git a/force-app/main/default/classes/LexOverdueStockController.cls b/force-app/main/default/classes/LexOverdueStockController.cls
index 9777f3c..05fe5c6 100644
--- a/force-app/main/default/classes/LexOverdueStockController.cls
+++ b/force-app/main/default/classes/LexOverdueStockController.cls
@@ -40,22 +40,14 @@
codPageRecords = new List<orderBean>();
overduePageRecords = new List<orderBean>();
// 鑾峰彇鐢ㄦ埛鍜岀粡閿�鍟嗕俊鎭�
- user Useracc = [
- SELECT Accountid, Work_Location__c, UserPro_Type__c
- FROM user
- WHERE id = :UserInfo.getUserId()
- ];
+ user Useracc = [SELECT Accountid, Work_Location__c, UserPro_Type__c FROM user WHERE id = :UserInfo.getUserId()];
userWorkLocation = Useracc.Work_Location__c;
agencyProType = Useracc.UserPro_Type__c;
if (String.isBlank(Useracc.UserPro_Type__c)) {
agencyProType = 'ET';
}
sqlagencyProType = '%' + agencyProType + '%';
- accountInfo = [
- SELECT id, Name, Dealer_discount__c
- FROM account
- WHERE id = :Useracc.accountid
- ];
+ accountInfo = [SELECT id, Name, Dealer_discount__c FROM account WHERE id = :Useracc.accountid];
// 杩囨湡搴撳瓨姹囨�讳俊鎭�
List<AggregateResult> orderDetZaiku = [
SELECT count(Id) countsum, Consumable_Product__c prodid, Consumable_Product__r.Name_Text__c prodname, Box_Piece__c boxPiece
@@ -111,16 +103,8 @@
userWorkLocation = userWorkLocationLWC;
// add by Wang Xueqin 2023/04/12
// 鑾峰彇鐢ㄦ埛鍜岀粡閿�鍟嗕俊鎭�
- user Useracc = [
- SELECT Accountid, Work_Location__c, UserPro_Type__c
- FROM user
- WHERE id = :UserInfo.getUserId()
- ];
- accountInfo = [
- SELECT id, Name, Dealer_discount__c
- FROM account
- WHERE id = :Useracc.accountid
- ];
+ user Useracc = [SELECT Accountid, Work_Location__c, UserPro_Type__c FROM user WHERE id = :UserInfo.getUserId()];
+ accountInfo = [SELECT id, Name, Dealer_discount__c FROM account WHERE id = :Useracc.accountid];
iSinventory = true;
Set<String> barCodeoverdue = new Set<String>();
@@ -270,16 +254,8 @@
// List<Consumable_order_details2__c> overdueList = (List<Consumable_order_details2__c>)JSON.deserialize(saveoverdueList,List<Consumable_order_details2__c>.class);
// add by Wang Xueqin 2023/04/12
// 鑾峰彇鐢ㄦ埛鍜岀粡閿�鍟嗕俊鎭�
- user Useracc = [
- SELECT Accountid, Work_Location__c, UserPro_Type__c
- FROM user
- WHERE id = :UserInfo.getUserId()
- ];
- accountInfo = [
- SELECT id, Name, Dealer_discount__c
- FROM account
- WHERE id = :Useracc.accountid
- ];
+ user Useracc = [SELECT Accountid, Work_Location__c, UserPro_Type__c FROM user WHERE id = :UserInfo.getUserId()];
+ accountInfo = [SELECT id, Name, Dealer_discount__c FROM account WHERE id = :Useracc.accountid];
// 璺宠繃鏄庣粏2涓嶅繀瑕佹洿鏂�
StaticParameter.EscapeConsumableOrderDetail2Trigger = true;
@@ -312,11 +288,7 @@
po.RecordTypeid = System.Label.RT_ConOrder_Overdue;
try {
insert po;
- Consumable_order__c order = [
- SELECT Name
- FROM Consumable_order__c
- WHERE id = :po.id
- ];
+ Consumable_order__c order = [SELECT Name FROM Consumable_order__c WHERE id = :po.id];
List<Consumable_orderdetails__c> InsList = new List<Consumable_orderdetails__c>();
for (orderBean header : codPageRecords) {
if (header.check == true) {
@@ -432,4 +404,4 @@
return returnValue;
}
}
-}
+}
\ No newline at end of file
diff --git a/force-app/main/default/classes/LexOverdueStockControllerTest.cls b/force-app/main/default/classes/LexOverdueStockControllerTest.cls
index 48281e5..0b311f7 100644
--- a/force-app/main/default/classes/LexOverdueStockControllerTest.cls
+++ b/force-app/main/default/classes/LexOverdueStockControllerTest.cls
@@ -1,219 +1,164 @@
@isTest
private class LexOverdueStockControllerTest {
static testMethod void testMethod1() {
- user MyUser_Test;
+ user MyUser_Test;
Account myAccount1;
- User thisUser = [SELECT Id FROM User WHERE Id = :UserInfo.getUserId()];
- System.runAs(thisUser) {
- Profile prof1 = [
- SELECT Id
- FROM Profile
- WHERE Name = '901_缁忛攢鍟嗙ぞ鍖烘櫘閫氭潈闄恄2閲嶉獙璇�(ET)'
- ];
- List<RecordType> rectCo = [
- SELECT Id
- FROM RecordType
- WHERE IsActive = TRUE AND SobjectType = 'Account' AND Name = '璨╁2搴�'
- ];
- if (rectCo.size() == 0) {
- return;
- }
- StaticParameter.EscapeConsumableOrderDetail2Trigger = true;
+ User thisUser = [ select Id from User where Id = :UserInfo.getUserId()];
+ System.runAs(thisUser){
+ Profile prof1 = [select Id from Profile where Name ='901_缁忛攢鍟嗙ぞ鍖烘櫘閫氭潈闄恄2閲嶉獙璇�(ET)'];
+ List<RecordType> rectCo = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '璨╁2搴�'];
+ if (rectCo.size() == 0) {
+ return;
+ }
+ StaticParameter.EscapeConsumableOrderDetail2Trigger = true;
+
+ RecordType rectCoO = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '鐥呴櫌'];
+ Account olympus = new Account(RecordTypeId = rectCoO.Id, AgentCode_Ext__c = '9999900', Name = 'olympus');
+ insert olympus;
+ myAccount1 = new Account(name='Testaccount001',Dealer_discount__c =10,RecordTypeId = rectCo[0].Id,AgentCode_Ext__c = '8888888');
+ insert myAccount1;
+ Contact core = new Contact(email='jplumber@salesforce.com', firstname='Joe',lastname='Plumber',accountid=myAccount1.id);
+ insert core;
+ MyUser_Test = New User(ContactId = core.id,Alias = 'newUser',Email='newuser@testorg.com',EmailEncodingKey='UTF-8', LastName='TestUser', LanguageLocaleKey='zh_CN',LocaleSidKey='zh_CN', ProfileId = prof1.Id,TimeZoneSidKey='Asia/Shanghai', UserName='testUser@testorg.com',Work_Location__c = '閲嶅簡');
+ insert MyUser_Test;
- RecordType rectCoO = [
- SELECT Id
- FROM RecordType
- WHERE IsActive = TRUE AND SobjectType = 'Account' AND Name = '鐥呴櫌'
- ];
- Account olympus = new Account(RecordTypeId = rectCoO.Id, AgentCode_Ext__c = '9999900', Name = 'olympus');
- insert olympus;
- myAccount1 = new Account(
- name = 'Testaccount001',
- Dealer_discount__c = 10,
- RecordTypeId = rectCo[0].Id,
- AgentCode_Ext__c = '8888888'
- );
- insert myAccount1;
- Contact core = new Contact(
- email = 'jplumber@salesforce.com',
- firstname = 'Joe',
- lastname = 'Plumber',
- accountid = myAccount1.id
- );
- insert core;
- MyUser_Test = new User(
- ContactId = core.id,
- Alias = 'newUser',
- Email = 'newuser@testorg.com',
- EmailEncodingKey = 'UTF-8',
- LastName = 'TestUser',
- LanguageLocaleKey = 'zh_CN',
- LocaleSidKey = 'zh_CN',
- ProfileId = prof1.Id,
- TimeZoneSidKey = 'Asia/Shanghai',
- UserName = 'testUser@testorg.com',
- Work_Location__c = '閲嶅簡'
- );
- insert MyUser_Test;
- }
+ }
+
+ system.runAs(MyUser_Test){
+ //浜у搧鏁版嵁
+ Product2 prod07 = new Product2(Name='Test07',ProductCode='Test07',Asset_Model_No__c = 'Test07',SFDA_Status__c = '鏈夊姽',Dealer_special_Object__c = true,Packing_list_manual__c = 1,Manual_Entry__c = false);
+ Product2 prod08 = new Product2(Name='Test08',ProductCode='Test08',Asset_Model_No__c = 'Test08',SFDA_Status__c = '鏈夊姽',Dealer_special_Object__c = true,Packing_list_manual__c = 1,Manual_Entry__c = false);
+ Product2 prod09 = new Product2(Name='Test09',ProductCode='Test09',Asset_Model_No__c = 'Test09',SFDA_Status__c = '鏈夊姽',Dealer_special_Object__c = true,Packing_list_manual__c = 1,Manual_Entry__c = false);
+ insert new Product2[] {prod07,prod08,prod09};
- System.runAs(MyUser_Test) {
- //浜у搧鏁版嵁
- Product2 prod07 = new Product2(
- Name = 'Test07',
- ProductCode = 'Test07',
- Asset_Model_No__c = 'Test07',
- SFDA_Status__c = '鏈夊姽',
- Dealer_special_Object__c = true,
- Packing_list_manual__c = 1,
- Manual_Entry__c = false
- );
- Product2 prod08 = new Product2(
- Name = 'Test08',
- ProductCode = 'Test08',
- Asset_Model_No__c = 'Test08',
- SFDA_Status__c = '鏈夊姽',
- Dealer_special_Object__c = true,
- Packing_list_manual__c = 1,
- Manual_Entry__c = false
- );
- Product2 prod09 = new Product2(
- Name = 'Test09',
- ProductCode = 'Test09',
- Asset_Model_No__c = 'Test09',
- SFDA_Status__c = '鏈夊姽',
- Dealer_special_Object__c = true,
- Packing_list_manual__c = 1,
- Manual_Entry__c = false
- );
- insert new List<Product2>{ prod07, prod08, prod09 };
+ //鍒朵綔浜у搧
+ Product2__c proG = new Product2__c(Name='MH-155:鐧藉钩琛″附',OT_CODE_Text__c='Test001',Product2__c = prod07.Id);
+ insert proG;
+ Product2__c proH = new Product2__c(Name='MB-677:BNC鐢电紗',OT_CODE_Text__c='Test002',Product2__c = prod08.Id);
+ insert proH;
+ Product2__c proF = new Product2__c(Name='TooMAJ-643R:姘村泭闉樼003',OT_CODE_Text__c='Test003',Product2__c = prod09.Id);
+ insert proF;
- //鍒朵綔浜у搧
- Product2__c proG = new Product2__c(Name = 'MH-155:鐧藉钩琛″附', OT_CODE_Text__c = 'Test001', Product2__c = prod07.Id);
- insert proG;
- Product2__c proH = new Product2__c(Name = 'MB-677:BNC鐢电紗', OT_CODE_Text__c = 'Test002', Product2__c = prod08.Id);
- insert proH;
- Product2__c proF = new Product2__c(Name = 'TooMAJ-643R:姘村泭闉樼003', OT_CODE_Text__c = 'Test003', Product2__c = prod09.Id);
- insert proF;
- //璁㈠崟
- Consumable_order__c order = new Consumable_order__c();
- order.Name = 'testMing';
- order.Order_status__c = '鎵瑰噯';
- order.RecordTypeid = System.Label.RT_ConOrder_Order;
- order.Dealer_Info__c = myAccount1.id;
- order.Inventory_date__c = Date.today();
- order.Order_type__c = '璁㈠崟';
- order.Order_ProType__c = 'ET';
- insert order;
- //鍒拌揣
- Consumable_order__c order2 = new Consumable_order__c();
- order2.Name = 'testMing1';
- order2.Order_status__c = '鎵瑰噯';
- order2.RecordTypeid = '01210000000c9dqAAA';
- order2.Dealer_Info__c = myAccount1.id;
- order2.Order_type__c = '鍒拌揣';
- order2.Order_ProType__c = 'ET';
- insert order2;
+ //璁㈠崟
+ Consumable_order__c order = new Consumable_order__c();
+ order.Name = 'testMing';
+ order.Order_status__c = '鎵瑰噯';
+ order.RecordTypeid = System.Label.RT_ConOrder_Order;
+ order.Dealer_Info__c = myAccount1.id;
+ order.Inventory_date__c = Date.today();
+ order.Order_type__c = '璁㈠崟';
+ order.Order_ProType__c = 'ET';
+ insert order;
+ //鍒拌揣
+ Consumable_order__c order2 = new Consumable_order__c();
+ order2.Name = 'testMing1';
+ order2.Order_status__c = '鎵瑰噯';
+ order2.RecordTypeid = '01210000000c9dqAAA';
+ order2.Dealer_Info__c = myAccount1.id;
+ order2.Order_type__c = '鍒拌揣';
+ order2.Order_ProType__c = 'ET';
+ insert order2;
- List<Consumable_order_details2__c> conList = new List<Consumable_order_details2__c>();
- //鍒朵綔Consumable_order_details__c-------ProductCount
- // 閿�鍞�
- Consumable_order_details2__c dataForProductCount7 = new Consumable_order_details2__c();
- dataForProductCount7.Bar_Code__c = '123456789298k250AAAAA';
- dataForProductCount7.Sterilization_limit__c = Date.today().addDays(2);
- dataForProductCount7.Arrive_date__c = Date.today();
- dataForProductCount7.RecordTypeid = System.Label.RT_ConOrderDetail2_Delivery;
- dataForProductCount7.Consumable_Product__c = proH.id;
- dataForProductCount7.Asset_Model_No__c = proH.Asset_Model_No__c;
- dataForProductCount7.Box_Piece__c = '鐩�';
+ List<Consumable_order_details2__c> conList = new List<Consumable_order_details2__c>();
+ //鍒朵綔Consumable_order_details__c-------ProductCount
+ // 閿�鍞�
+ Consumable_order_details2__c dataForProductCount7 = new Consumable_order_details2__c();
+ dataForProductCount7.Bar_Code__c = '123456789298k250AAAAA';
+ dataForProductCount7.Sterilization_limit__c = Date.today().addDays(2);
+ dataForProductCount7.Arrive_date__c = Date.today();
+ dataForProductCount7.RecordTypeid = System.Label.RT_ConOrderDetail2_Delivery;
+ dataForProductCount7.Consumable_Product__c = proH.id;
+ dataForProductCount7.Asset_Model_No__c = proH.Asset_Model_No__c;
+ dataForProductCount7.Box_Piece__c = '鐩�';
dataForProductCount7.Used_date__c = Date.today();
dataForProductCount7.Consumable_order_minor__c = order.id;
- conList.add(dataForProductCount7);
- // 鍦ㄥ簱 杩囨湡 鐩�
- Consumable_order_details2__c dataForProduct = new Consumable_order_details2__c();
- dataForProduct.Bar_Code__c = '123456789498k250BBBBB';
- dataForProduct.Sterilization_limit__c = Date.today().addDays(-2);
- dataForProduct.Arrive_date__c = Date.today();
- dataForProduct.RecordTypeid = System.Label.RT_ConOrderDetail2_Delivery;
- dataForProduct.Consumable_Product__c = proF.id;
- dataForProduct.Asset_Model_No__c = proF.Asset_Model_No__c;
- dataForProduct.Box_Piece__c = '鐩�';
- dataForProduct.Consumable_order_minor__c = order.id;
+ conList.add(dataForProductCount7);
+ // 鍦ㄥ簱 杩囨湡 鐩�
+ Consumable_order_details2__c dataForProduct = new Consumable_order_details2__c();
+ dataForProduct.Bar_Code__c = '123456789498k250BBBBB';
+ dataForProduct.Sterilization_limit__c = Date.today().addDays(-2);
+ dataForProduct.Arrive_date__c = Date.today();
+ dataForProduct.RecordTypeid = System.Label.RT_ConOrderDetail2_Delivery;
+ dataForProduct.Consumable_Product__c = proF.id;
+ dataForProduct.Asset_Model_No__c = proF.Asset_Model_No__c;
+ dataForProduct.Box_Piece__c = '鐩�';
+ dataForProduct.Consumable_order_minor__c = order.id;
- conList.add(dataForProduct);
- // 鍦ㄥ簱 杩囨湡 涓�
- Consumable_order_details2__c dataForProductCount3 = new Consumable_order_details2__c();
- dataForProductCount3.Bar_Code__c = '123456788398k250CCCCC';
- dataForProductCount3.Sterilization_limit__c = Date.today().addDays(-2);
- dataForProductCount3.Arrive_date__c = Date.today();
- dataForProductCount3.RecordTypeid = System.Label.RT_ConOrderDetail2_Delivery;
- dataForProductCount3.Consumable_Product__c = proG.id;
- dataForProductCount3.Asset_Model_No__c = proG.Asset_Model_No__c;
- dataForProductCount3.Box_Piece__c = '涓�';
+ conList.add(dataForProduct);
+ // 鍦ㄥ簱 杩囨湡 涓�
+ Consumable_order_details2__c dataForProductCount3 = new Consumable_order_details2__c();
+ dataForProductCount3.Bar_Code__c = '123456788398k250CCCCC';
+ dataForProductCount3.Sterilization_limit__c = Date.today().addDays(-2);
+ dataForProductCount3.Arrive_date__c = Date.today();
+ dataForProductCount3.RecordTypeid = System.Label.RT_ConOrderDetail2_Delivery;
+ dataForProductCount3.Consumable_Product__c = proG.id;
+ dataForProductCount3.Asset_Model_No__c = proG.Asset_Model_No__c;
+ dataForProductCount3.Box_Piece__c = '涓�';
dataForProductCount3.RemoveBox_No__c = 1;
dataForProductCount3.Consumable_order_minor__c = order.id;
- conList.add(dataForProductCount3);
- insert conList;
+ conList.add(dataForProductCount3);
+ insert conList;
+
+ //杩囨湡搴撳瓨姹囨�讳俊鎭� add by Wang Xueqin
+ List<Consumable_order_details2__c> conList1 = new List<Consumable_order_details2__c>();
+ Consumable_order_details2__c dataForProductCount4 = new Consumable_order_details2__c();
+ dataForProductCount4.Bar_Code__c = '1001';
+ dataForProductCount4.Arrive_date__c = Date.today();
+ dataForProductCount4.Send_Date__c = null;
+ dataForProductCount4.Used_date__c = null;
+ dataForProductCount4.Return_date__c = null;
+ dataForProductCount4.Lose_Flag__c = false;
+ dataForProductCount4.Cancellation_Flag__c = false;
+ dataForProductCount4.Consumable_Product__c = proG.Id;
+ dataForProductCount4.Consumable_Arrived_order__c = order2.id;
+ dataForProductCount4.Used_account__c = myAccount1.Id;
+ dataForProductCount4.Sterilization_limit__c = Date.today().addDays(-2);
+ dataForProductCount4.Box_Piece__c = '鐩�';
+ conList1.add(dataForProductCount4);
+ System.debug('conList1==>'+conList1);
+ //鏌ヨ鎵�鏈夎繃鏈熷簱瀛�
+ Consumable_order_details2__c dataForProductCount5 = new Consumable_order_details2__c();
+ dataForProductCount5.Bar_Code__c = '1002';
+ dataForProductCount5.Arrive_date__c = Date.today();
+ dataForProductCount5.Send_Date__c = Date.today();
+ dataForProductCount5.Used_date__c = Date.today();
+ dataForProductCount5.Return_date__c = null;
+ dataForProductCount5.Lose_Flag__c = false;
+ dataForProductCount5.Cancellation_Flag__c = false;
+ dataForProductCount5.Consumable_Product__c = proG.Id;
+ dataForProductCount5.Consumable_Arrived_order__c = order2.id;
+ dataForProductCount5.Used_account__c = myAccount1.Id;
+ dataForProductCount5.Sterilization_limit__c = Date.today().addDays(-2);
+ dataForProductCount5.Box_Piece__c = '鐩�';
+ conList1.add(dataForProductCount5);
+ insert conList1;
- //杩囨湡搴撳瓨姹囨�讳俊鎭� add by Wang Xueqin
- List<Consumable_order_details2__c> conList1 = new List<Consumable_order_details2__c>();
- Consumable_order_details2__c dataForProductCount4 = new Consumable_order_details2__c();
- dataForProductCount4.Bar_Code__c = '1001';
- dataForProductCount4.Arrive_date__c = Date.today();
- dataForProductCount4.Send_Date__c = null;
- dataForProductCount4.Used_date__c = null;
- dataForProductCount4.Return_date__c = null;
- dataForProductCount4.Lose_Flag__c = false;
- dataForProductCount4.Cancellation_Flag__c = false;
- dataForProductCount4.Consumable_Product__c = proG.Id;
- dataForProductCount4.Consumable_Arrived_order__c = order2.id;
- dataForProductCount4.Used_account__c = myAccount1.Id;
- dataForProductCount4.Sterilization_limit__c = Date.today().addDays(-2);
- dataForProductCount4.Box_Piece__c = '鐩�';
- conList1.add(dataForProductCount4);
- System.debug('conList1==>' + conList1);
- //鏌ヨ鎵�鏈夎繃鏈熷簱瀛�
- Consumable_order_details2__c dataForProductCount5 = new Consumable_order_details2__c();
- dataForProductCount5.Bar_Code__c = '1002';
- dataForProductCount5.Arrive_date__c = Date.today();
- dataForProductCount5.Send_Date__c = Date.today();
- dataForProductCount5.Used_date__c = Date.today();
- dataForProductCount5.Return_date__c = null;
- dataForProductCount5.Lose_Flag__c = false;
- dataForProductCount5.Cancellation_Flag__c = false;
- dataForProductCount5.Consumable_Product__c = proG.Id;
- dataForProductCount5.Consumable_Arrived_order__c = order2.id;
- dataForProductCount5.Used_account__c = myAccount1.Id;
- dataForProductCount5.Sterilization_limit__c = Date.today().addDays(-2);
- dataForProductCount5.Box_Piece__c = '鐩�';
- conList1.add(dataForProductCount5);
- insert conList1;
+
+
- System.Test.startTest();
- List<Consumable_order_details2__c> overdueList = new List<Consumable_order_details2__c>();
- LexOverdueStockController overCon = new LexOverdueStockController();
- LexOverdueStockController.init();
- List<LexOverdueStockController.orderBean> cro = new List<LexOverdueStockController.orderBean>();
- List<LexOverdueStockController.orderBean> croList = LexOverdueStockController.codPageRecords;
- for (LexOverdueStockController.orderBean i : croList) {
- i.check = true;
- }
+
- String codPageRecordsLWC = JSON.serialize(LexOverdueStockController.codPageRecords);
- System.debug('codPageRecordsLWC===>test' + LexOverdueStockController.codPageRecords);
- LexOverdueStockController.searchorderBean(
- 'ET',
- '閲嶅簡',
- 'Testaccount001',
- '123456789298k250AAAAA\n123456789498k250BBBBB\n123456788398k250CCCCC\n1001',
- codPageRecordsLWC
- );
- LexOverdueStockController.searchorderBean('ET', '閲嶅簡', 'Testaccount001', '', codPageRecordsLWC); //barcode涓虹┖
- LexOverdueStockController.save(true, codPageRecordsLWC, overdueList);
- // LexOverdueStockController.save(false,codPageRecordsLWC,overdueList);
- System.Test.stopTest();
- }
+ System.Test.startTest();
+ List<Consumable_order_details2__c> overdueList = new List<Consumable_order_details2__c>();
+ LexOverdueStockController overCon = new LexOverdueStockController();
+ LexOverdueStockController.init();
+ List<LexOverdueStockController.orderBean> cro = new List<LexOverdueStockController.orderBean>();
+ List<LexOverdueStockController.orderBean> croList = LexOverdueStockController.codPageRecords;
+ for(LexOverdueStockController.orderBean i :croList){
+ i.check = true;
+
+ }
+
+ String codPageRecordsLWC = JSON.serialize(LexOverdueStockController.codPageRecords);
+ System.debug('codPageRecordsLWC===>test'+LexOverdueStockController.codPageRecords);
+ LexOverdueStockController.searchorderBean('ET','閲嶅簡','Testaccount001','123456789298k250AAAAA\n123456789498k250BBBBB\n123456788398k250CCCCC\n1001',codPageRecordsLWC);
+ LexOverdueStockController.searchorderBean('ET','閲嶅簡','Testaccount001','',codPageRecordsLWC);//barcode涓虹┖
+ LexOverdueStockController.save(true,codPageRecordsLWC,overdueList);
+ // LexOverdueStockController.save(false,codPageRecordsLWC,overdueList);
+ System.Test.stopTest();
+
+ }
}
-}
+}
\ No newline at end of file
diff --git a/force-app/main/default/classes/LexOverdueStockControllerTest.cls-meta.xml b/force-app/main/default/classes/LexOverdueStockControllerTest.cls-meta.xml
index a9fd6e9..754ecb1 100644
--- a/force-app/main/default/classes/LexOverdueStockControllerTest.cls-meta.xml
+++ b/force-app/main/default/classes/LexOverdueStockControllerTest.cls-meta.xml
@@ -1,4 +1,4 @@
-<?xml version="1.0" encoding="UTF-8" ?>
+<?xml version="1.0" encoding="UTF-8"?>
<ApexClass xmlns="http://soap.sforce.com/2006/04/metadata">
<apiVersion>57.0</apiVersion>
<status>Active</status>
diff --git a/force-app/main/default/classes/LexProductLimitEditControllerTest.cls b/force-app/main/default/classes/LexProductLimitEditControllerTest.cls
index bc53eab..6d0261e 100644
--- a/force-app/main/default/classes/LexProductLimitEditControllerTest.cls
+++ b/force-app/main/default/classes/LexProductLimitEditControllerTest.cls
@@ -1,62 +1,47 @@
@isTest
-private class LexProductLimitEditControllerTest {
- @isTest
- static void unittest() {
- List<RecordType> rectCo = [
- SELECT Id
- FROM RecordType
- WHERE IsActive = TRUE AND SobjectType = 'Account' AND Name = '璨╁2搴�'
- ];
+private class LexProductLimitEditControllerTest
+{
+ @isTest
+ static void unittest()
+ {
+
+ List<RecordType> rectCo = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '璨╁2搴�'];
if (rectCo.size() == 0) {
return;
}
- Profile prof = [
- SELECT Id
- FROM Profile
- WHERE Name = '901_缁忛攢鍟嗙ぞ鍖烘櫘閫氭潈闄恄2閲嶉獙璇�(ET)'
- ];
- Product2 prod01 = new Product2(
- Name = 'Test01',
- ProductCode = 'Test01',
- Asset_Model_No__c = 'Test01',
- SFDA_Status__c = '鏈夊姽',
- Dealer_special_Object__c = true
- );
- Product2 prod02 = new Product2(
- Name = 'Test02',
- ProductCode = 'Test02',
- Asset_Model_No__c = 'Test02',
- SFDA_Status__c = '鏈夊姽',
- Dealer_special_Object__c = true
- );
- insert new List<Product2>{ prod01, prod02 };
- Product2__c pro1 = new Product2__c(Name = 'Pro001', OT_CODE_Text__c = 'Test001', Product2__c = prod01.Id);
- Product2__c pro2 = new Product2__c(Name = 'Pro002', OT_CODE_Text__c = 'Test002', Product2__c = prod02.Id);
- insert new List<Product2__c>{ pro1, pro2 };
+ Profile prof = [select Id from Profile where Name ='901_缁忛攢鍟嗙ぞ鍖烘櫘閫氭潈闄恄2閲嶉獙璇�(ET)'];
+ Product2 prod01 = new Product2(Name='Test01',ProductCode='Test01',Asset_Model_No__c = 'Test01',SFDA_Status__c = '鏈夊姽',Dealer_special_Object__c = true);
+ Product2 prod02 = new Product2(Name='Test02',ProductCode='Test02',Asset_Model_No__c = 'Test02',SFDA_Status__c = '鏈夊姽',Dealer_special_Object__c = true);
+ insert new Product2[]{prod01,prod02};
+ Product2__c pro1 = new Product2__c(Name='Pro001',OT_CODE_Text__c='Test001',Product2__c = prod01.Id);
+ Product2__c pro2 = new Product2__c(Name='Pro002',OT_CODE_Text__c='Test002',Product2__c = prod02.Id);
+ insert new Product2__c[] {pro1, pro2};
+
- Account myAccount2 = new Account(
- name = 'Testaccount005',
- Dealer_discount__c = 20,
- RecordTypeId = rectCo[0].Id,
- Product_Limit_Date__c = 'Test01|5|55,Test02|2|4'
- );
- insert myAccount2;
+ Account myAccount2 = new Account(name='Testaccount005',Dealer_discount__c =20,RecordTypeId = rectCo[0].Id,Product_Limit_Date__c = 'Test01|5|55,Test02|2|4');
+ insert myAccount2;
String myAccount2Id = myAccount2.Id;
- LexProductLimitEditController.init(myAccount2Id, 'ENG');
- LexProductLimitEditController.init(myAccount2Id, '');
+ LexProductLimitEditController.init(myAccount2Id,'ENG');
+ LexProductLimitEditController.init(myAccount2Id,'');
LexProductLimitEditController.accountid = myAccount2Id;
LexProductLimitEditController controllerLimit = new LexProductLimitEditController();
- // Given
- // PageReference page = new PageReference('/apex/ProductLimitEdit?accountid=' + myAccount2.id);
+
+
+
+
+ // Given
+ // PageReference page = new PageReference('/apex/ProductLimitEdit?accountid=' + myAccount2.id);
// page.setRedirect(true);
// System.Test.setCurrentPage(page);
// ProductLimitEditController conTest = new ProductLimitEditController();
// conTest.init();
// System.assertEquals('Test01|5|55,Test02|2|4', conTest.product_Limit);
- // When
+ // When
- // Then
- }
-}
+
+ // Then
+
+ }
+}
\ No newline at end of file
diff --git a/force-app/main/default/classes/LexProductLimitEditControllerTest.cls-meta.xml b/force-app/main/default/classes/LexProductLimitEditControllerTest.cls-meta.xml
index a9fd6e9..754ecb1 100644
--- a/force-app/main/default/classes/LexProductLimitEditControllerTest.cls-meta.xml
+++ b/force-app/main/default/classes/LexProductLimitEditControllerTest.cls-meta.xml
@@ -1,4 +1,4 @@
-<?xml version="1.0" encoding="UTF-8" ?>
+<?xml version="1.0" encoding="UTF-8"?>
<ApexClass xmlns="http://soap.sforce.com/2006/04/metadata">
<apiVersion>57.0</apiVersion>
<status>Active</status>
diff --git a/force-app/main/default/classes/LexRemoveBoxControllerTest.cls b/force-app/main/default/classes/LexRemoveBoxControllerTest.cls
index a318af8..a665c61 100644
--- a/force-app/main/default/classes/LexRemoveBoxControllerTest.cls
+++ b/force-app/main/default/classes/LexRemoveBoxControllerTest.cls
@@ -1,95 +1,40 @@
@isTest
-private class LexRemoveBoxControllerTest {
+private class LexRemoveBoxControllerTest
+{
+
static testMethod void myUnitTest() {
user myUser_test;
Account myAccount2;
- User thisUser = [SELECT Id FROM User WHERE Id = :UserInfo.getUserId()];
- System.runAs(thisUser) {
- List<RecordType> rectCo = [
- SELECT Id
- FROM RecordType
- WHERE IsActive = TRUE AND SobjectType = 'Account' AND Name = '璨╁2搴�'
- ];
+ User thisUser = [ select Id from User where Id = :UserInfo.getUserId()];
+ System.runAs(thisUser){
+ List<RecordType> rectCo = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '璨╁2搴�'];
if (rectCo.size() == 0) {
return;
}
- Profile prof = [
- SELECT Id
- FROM Profile
- WHERE Name = '901_缁忛攢鍟嗙ぞ鍖烘櫘閫氭潈闄恄2閲嶉獙璇�(ET Email)'
- ];
- myAccount2 = new Account(
- name = 'Testaccount002',
- Dealer_discount__c = 20,
- RecordTypeId = rectCo[0].Id,
- AgentCode_Ext__c = '9999900'
- );
+ Profile prof = [select Id from Profile where Name ='901_缁忛攢鍟嗙ぞ鍖烘櫘閫氭潈闄恄2閲嶉獙璇�(ET Email)'];
+ myAccount2 = new Account(name='Testaccount002',Dealer_discount__c =20,RecordTypeId = rectCo[0].Id,AgentCode_Ext__c = '9999900');
insert myAccount2;
- Contact core = new Contact(
- email = 'jplumber@salesforce.com',
- firstname = 'Joe',
- lastname = 'Plumber',
- accountid = myAccount2.id
- );
+ Contact core = new Contact(email='jplumber@salesforce.com', firstname='Joe',lastname='Plumber',accountid=myAccount2.id);
insert core;
- MyUser_Test = new User(
- ContactId = core.id,
- Alias = 'newUser',
- Email = 'newuser@testorg.com',
- EmailEncodingKey = 'UTF-8',
- LastName = 'TestUser',
- LanguageLocaleKey = 'zh_CN',
- LocaleSidKey = 'zh_CN',
- ProfileId = prof.Id,
- TimeZoneSidKey = 'Asia/Shanghai',
- UserName = 'testUser@testorg.com',
- Work_Location__c = '閲嶅簡'
- );
+ MyUser_Test = New User(ContactId = core.id,Alias = 'newUser',Email='newuser@testorg.com',EmailEncodingKey='UTF-8', LastName='TestUser', LanguageLocaleKey='zh_CN',LocaleSidKey='zh_CN', ProfileId = prof.Id,TimeZoneSidKey='Asia/Shanghai', UserName='testUser@testorg.com',Work_Location__c = '閲嶅簡');
insert MyUser_Test;
}
- System.runAs(myUser_Test) {
+ System.runAs(myUser_Test){
StaticParameter.EscapeConsumableOrderDetail2Trigger = true;
StaticParameter.EscapeNFM007Trigger = true;
StaticParameter.EscapeOpportunityBefUpdTrigger = true;
StaticParameter.EscapeOpportunityHpDeptUpdTrigger = true;
StaticParameter.EscapeSyncOpportunityTrigger = true;
StaticParameter.EscapeSyncProduct2Trigger = true;
- Product2 prod01 = new Product2(
- Name = 'Test01',
- ProductCode = 'Test01',
- Asset_Model_No__c = 'Test01',
- SFDA_Status__c = '鏈夊姽',
- JANCODE__c = '04953170200311',
- Packing_list_manual__c = 12,
- Dealer_special_Object__c = true,
- Manual_Entry__c = false
- );
- Product2 prod02 = new Product2(
- Name = 'Test02',
- ProductCode = 'Test02',
- Asset_Model_No__c = 'Test02',
- SFDA_Status__c = '鏈夊姽',
- JANCODE__c = '04953170200312',
- Packing_list_manual__c = 10,
- Dealer_special_Object__c = true,
- Manual_Entry__c = false
- );
- Product2 prod03 = new Product2(
- Name = 'Test03',
- ProductCode = 'Test03',
- Asset_Model_No__c = 'Test03',
- SFDA_Status__c = '鏈夊姽',
- JANCODE__c = '04953170200313',
- Packing_list_manual__c = 1,
- Dealer_special_Object__c = true,
- Manual_Entry__c = false
- );
- insert new List<Product2>{ prod01, prod02, prod03 };
- Product2__c pro1 = new Product2__c(Name = 'Pro001', OT_CODE_Text__c = 'Test001', Product2__c = prod01.Id);
- Product2__c pro2 = new Product2__c(Name = 'Pro002', OT_CODE_Text__c = 'Test002', Product2__c = prod02.Id);
- Product2__c pro3 = new Product2__c(Name = 'Pro003', OT_CODE_Text__c = 'Test003', Product2__c = prod03.Id);
- insert new List<Product2__c>{ pro1, pro2, pro3 };
+ Product2 prod01 = new Product2(Name='Test01',ProductCode='Test01',Asset_Model_No__c = 'Test01',SFDA_Status__c = '鏈夊姽',JANCODE__c = '04953170200311',Packing_list_manual__c=12,Dealer_special_Object__c = true,Manual_Entry__c = false);
+ Product2 prod02 = new Product2(Name='Test02',ProductCode='Test02',Asset_Model_No__c = 'Test02',SFDA_Status__c = '鏈夊姽',JANCODE__c = '04953170200312',Packing_list_manual__c=10,Dealer_special_Object__c = true,Manual_Entry__c = false);
+ Product2 prod03 = new Product2(Name='Test03',ProductCode='Test03',Asset_Model_No__c = 'Test03',SFDA_Status__c = '鏈夊姽',JANCODE__c = '04953170200313',Packing_list_manual__c=1,Dealer_special_Object__c = true,Manual_Entry__c = false);
+ insert new Product2[]{prod01,prod02,prod03};
+ Product2__c pro1 = new Product2__c(Name='Pro001',OT_CODE_Text__c='Test001',Product2__c = prod01.Id);
+ Product2__c pro2 = new Product2__c(Name='Pro002',OT_CODE_Text__c='Test002',Product2__c = prod02.Id);
+ Product2__c pro3 = new Product2__c(Name='Pro003',OT_CODE_Text__c='Test003',Product2__c = prod03.Id);
+ insert new Product2__c[] {pro1, pro2,pro3};
//璁㈠崟
Consumable_order__c Order1 = new Consumable_order__c();
Order1.Name = 'OCM_01_001';
@@ -111,8 +56,8 @@
Orderdet2.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJRF';
Orderdet2.Used_date__c = null;
Orderdet2.Lose_Flag__c = false;
- Orderdet2.Return_date__c = null;
- Orderdet2.Send_Date__c = null;
+ Orderdet2.Return_date__c= null;
+ Orderdet2.Send_Date__c= null;
Orderdet2.Box_Piece__c = '鐩�';
conList1.add(Orderdet2);
@@ -125,12 +70,13 @@
Orderdet3.Arrive_date__c = Date.today();
Orderdet3.Send_Date__c = Date.today();
Orderdet3.Box_Piece__c = '涓�';
- Orderdet3.RemoveBox_date__c = Date.today();
+ Orderdet3.RemoveBox_date__c= Date.today();
Orderdet3.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJRA';
Orderdet3.Used_date__c = null;
Orderdet3.Lose_Flag__c = false;
- Orderdet3.Return_date__c = null;
+ Orderdet3.Return_date__c= null;
conList1.add(Orderdet3);
+
//sale
Consumable_order_details2__c Orderdet4 = new Consumable_order_details2__c();
@@ -140,11 +86,11 @@
Orderdet4.Asset_Model_No__c = 'Test02';
Orderdet4.Arrive_date__c = Date.today();
Orderdet4.Box_Piece__c = '涓�';
- Orderdet4.RemoveBox_date__c = Date.today();
+ Orderdet4.RemoveBox_date__c= Date.today();
Orderdet4.Bar_Code__c = '011495317020843711170400172003311074K250CXSDS';
Orderdet4.Lose_Flag__c = false;
- Orderdet4.Return_date__c = null;
- Orderdet4.Used_date__c = Date.today();
+ Orderdet4.Return_date__c= null;
+ Orderdet4.Used_date__c= Date.today();
conList1.add(Orderdet4);
List<Consumable_order_details2__c> conList = new List<Consumable_order_details2__c>();
@@ -157,11 +103,11 @@
Orderdet5.Arrive_date__c = Date.today();
//Orderdet5.Used_date__c = Date.today();
Orderdet5.Box_Piece__c = '鐩�';
- Orderdet5.RemoveBox_date__c = Date.today();
+ Orderdet5.RemoveBox_date__c= Date.today();
Orderdet5.Used_date__c = null;
Orderdet5.Lose_Flag__c = false;
- Orderdet5.Return_date__c = null;
- Orderdet5.Send_Date__c = null;
+ Orderdet5.Return_date__c= null;
+ Orderdet5.Send_Date__c=null;
Orderdet5.Bar_Code__c = '010495317014059411170400172203311074K250DCWQW';
conList.add(Orderdet5);
//pandian
@@ -173,11 +119,11 @@
Orderdet7.Box_Piece__c = '鐩�';
Orderdet7.Lose_Flag__c = false;
Orderdet7.Bar_Code__c = '010495317014059411170400172203311074K250DBVUD';
- Orderdet7.RemoveBox_date__c = Date.today();
- Orderdet7.Inventory_date__c = Date.today();
+ Orderdet7.RemoveBox_date__c= Date.today();
+ Orderdet7.Inventory_date__c= Date.today();
conList.add(Orderdet7);
- Consumable_order_details2__c Orderdet8 = new Consumable_order_details2__c();
+ Consumable_order_details2__c Orderdet8= new Consumable_order_details2__c();
Orderdet8.Name = 'OCM_01_001004';
Orderdet8.Consumable_order_minor__c = Order1.Id;
Orderdet8.Consumable_Product__c = pro2.Id;
@@ -188,116 +134,57 @@
Orderdet8.Bar_Code__c = '010495317014059411170400172203311074K250DBVUC';
Orderdet8.Used_date__c = null;
Orderdet8.Lose_Flag__c = false;
- Orderdet8.Return_date__c = null;
- Orderdet8.RemoveBox_date__c = Date.today();
- Orderdet8.Send_Date__c = null;
- Orderdet8.RemoveBox_No__c = 3;
+ Orderdet8.Return_date__c= null;
+ Orderdet8.RemoveBox_date__c=Date.today();
+ Orderdet8.Send_Date__c=null;
+ Orderdet8.RemoveBox_No__c =3;
conList.add(Orderdet8);
insert conList1;
insert conList;
+
System.Test.startTest();
LexRemoveBoxController Controller = new LexRemoveBoxController();
LexRemoveBoxController.init();
- LexRemoveBoxController.searchConsumableorderdetails(
- '01049531702003111115120017181000105ZK250BXJRF\n01049531702003111115120017181000105ZK250BXJRA\n011495317020843711170400172003311074K250CXSDS\n010495317014059411170400172203311074K250DCWQW\n010495317014059411170400172203311074K250DBVUD\n010495317014059411170400172203311074K250DBVUC',
- myAccount2.Id,
- '娣卞湷',
- 'ET'
- );
- LexRemoveBoxController.searchConsumableorderdetails('', myAccount2.Id, '閲嶅簡', 'ET');
+ LexRemoveBoxController.searchConsumableorderdetails('01049531702003111115120017181000105ZK250BXJRF\n01049531702003111115120017181000105ZK250BXJRA\n011495317020843711170400172003311074K250CXSDS\n010495317014059411170400172203311074K250DCWQW\n010495317014059411170400172203311074K250DBVUD\n010495317014059411170400172203311074K250DBVUC'
+ ,myAccount2.Id,'娣卞湷','ET');
+ LexRemoveBoxController.searchConsumableorderdetails('',myAccount2.Id,'閲嶅簡','ET');
LexRemoveBoxController.barcode = '1004\n1003\n1002\n1001';
LexRemoveBoxController.getinventorysize();
- LexRemoveBoxController.removeBoxConfirm(JSON.serialize(conList), 'Testaccount002', '閲嶅簡', 'ENG');
- List<Consumable_order_details2__c> orderDetaList = new List<Consumable_order_details2__c>();
- LexRemoveBoxController.removeBoxConfirm(JSON.serialize(orderDetaList), 'Testaccount002', '閲嶅簡', 'ENG');
+ LexRemoveBoxController.removeBoxConfirm(JSON.serialize(conList),'Testaccount002','閲嶅簡','ENG');
+ List<Consumable_order_details2__c> orderDetaList = new List<Consumable_order_details2__c>();
+ LexRemoveBoxController.removeBoxConfirm(JSON.serialize(orderDetaList),'Testaccount002','閲嶅簡','ENG');
System.Test.stopTest();
+
}
}
static testMethod void testMethod1() {
user myUser_test;
Account myAccount2;
- User thisUser = [SELECT Id FROM User WHERE Id = :UserInfo.getUserId()];
- System.runAs(thisUser) {
- List<RecordType> rectCo = [
- SELECT Id
- FROM RecordType
- WHERE IsActive = TRUE AND SobjectType = 'Account' AND Name = '璨╁2搴�'
- ];
+ User thisUser = [ select Id from User where Id = :UserInfo.getUserId()];
+ System.runAs(thisUser){
+ List<RecordType> rectCo = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '璨╁2搴�'];
if (rectCo.size() == 0) {
return;
}
- Profile prof = [
- SELECT Id
- FROM Profile
- WHERE Name = '901_缁忛攢鍟嗙ぞ鍖烘櫘閫氭潈闄恄2閲嶉獙璇�(ET Email)'
- ];
- myAccount2 = new Account(
- name = 'Testaccount002',
- Dealer_discount__c = 20,
- RecordTypeId = rectCo[0].Id,
- AgentCode_Ext__c = '9999900'
- );
+ Profile prof = [select Id from Profile where Name ='901_缁忛攢鍟嗙ぞ鍖烘櫘閫氭潈闄恄2閲嶉獙璇�(ET Email)'];
+ myAccount2 = new Account(name='Testaccount002',Dealer_discount__c =20,RecordTypeId = rectCo[0].Id,AgentCode_Ext__c = '9999900');
insert myAccount2;
- Contact core = new Contact(
- email = 'jplumber@salesforce.com',
- firstname = 'Joe',
- lastname = 'Plumber',
- accountid = myAccount2.id
- );
+ Contact core = new Contact(email='jplumber@salesforce.com', firstname='Joe',lastname='Plumber',accountid=myAccount2.id);
insert core;
- MyUser_Test = new User(
- ContactId = core.id,
- Alias = 'newUser',
- Email = 'newuser@testorg.com',
- EmailEncodingKey = 'UTF-8',
- LastName = 'TestUser',
- LanguageLocaleKey = 'zh_CN',
- LocaleSidKey = 'zh_CN',
- ProfileId = prof.Id,
- TimeZoneSidKey = 'Asia/Shanghai',
- UserName = 'testUser@testorg.com',
- Work_Location__c = '閲嶅簡'
- );
+ MyUser_Test = New User(ContactId = core.id,Alias = 'newUser',Email='newuser@testorg.com',EmailEncodingKey='UTF-8', LastName='TestUser', LanguageLocaleKey='zh_CN',LocaleSidKey='zh_CN', ProfileId = prof.Id,TimeZoneSidKey='Asia/Shanghai', UserName='testUser@testorg.com',Work_Location__c = '閲嶅簡');
insert MyUser_Test;
}
- System.runAs(myUser_Test) {
- Product2 prod01 = new Product2(
- Name = 'Test01',
- ProductCode = 'Test01',
- Asset_Model_No__c = 'Test01',
- SFDA_Status__c = '鏈夊姽',
- JANCODE__c = '04953170200311',
- Packing_list_manual__c = 12,
- Dealer_special_Object__c = true,
- Manual_Entry__c = false
- );
- Product2 prod02 = new Product2(
- Name = 'Test02',
- ProductCode = 'Test02',
- Asset_Model_No__c = 'Test02',
- SFDA_Status__c = '鏈夊姽',
- JANCODE__c = '04953170200312',
- Packing_list_manual__c = 10,
- Dealer_special_Object__c = true,
- Manual_Entry__c = false
- );
- Product2 prod03 = new Product2(
- Name = 'Test03',
- ProductCode = 'Test03',
- Asset_Model_No__c = 'Test03',
- SFDA_Status__c = '鏈夊姽',
- JANCODE__c = '04953170200313',
- Dealer_special_Object__c = true,
- Packing_list_manual__c = 1,
- Manual_Entry__c = false
- );
- insert new List<Product2>{ prod01, prod02, prod03 };
- Product2__c pro1 = new Product2__c(Name = 'Pro001', OT_CODE_Text__c = 'Test001', Product2__c = prod01.Id);
- Product2__c pro2 = new Product2__c(Name = 'Pro002', OT_CODE_Text__c = 'Test002', Product2__c = prod02.Id);
- Product2__c pro3 = new Product2__c(Name = 'Pro003', OT_CODE_Text__c = 'Test003', Product2__c = prod03.Id);
- insert new List<Product2__c>{ pro1, pro2, pro3 };
+ System.runAs(myUser_Test){
+ Product2 prod01 = new Product2(Name='Test01',ProductCode='Test01',Asset_Model_No__c = 'Test01',SFDA_Status__c = '鏈夊姽',JANCODE__c = '04953170200311',Packing_list_manual__c=12,Dealer_special_Object__c = true,Manual_Entry__c = false);
+ Product2 prod02 = new Product2(Name='Test02',ProductCode='Test02',Asset_Model_No__c = 'Test02',SFDA_Status__c = '鏈夊姽',JANCODE__c = '04953170200312',Packing_list_manual__c=10,Dealer_special_Object__c = true,Manual_Entry__c = false);
+ Product2 prod03 = new Product2(Name='Test03',ProductCode='Test03',Asset_Model_No__c = 'Test03',SFDA_Status__c = '鏈夊姽',JANCODE__c = '04953170200313',Dealer_special_Object__c = true,Packing_list_manual__c = 1,Manual_Entry__c = false);
+ insert new Product2[]{prod01,prod02,prod03};
+ Product2__c pro1 = new Product2__c(Name='Pro001',OT_CODE_Text__c='Test001',Product2__c = prod01.Id);
+ Product2__c pro2 = new Product2__c(Name='Pro002',OT_CODE_Text__c='Test002',Product2__c = prod02.Id);
+ Product2__c pro3 = new Product2__c(Name='Pro003',OT_CODE_Text__c='Test003',Product2__c = prod03.Id);
+ insert new Product2__c[] {pro1, pro2,pro3};
//璁㈠崟
Consumable_order__c Order1 = new Consumable_order__c();
Order1.Name = 'OCM_01';
@@ -306,7 +193,7 @@
Order1.Dealer_Info__c = myAccount2.Id;
Order1.RecordTypeid = System.Label.RT_ConOrder_Delivery;
Order1.Order_ProType__c = 'ET';
- insert Order1;
+ insert Order1;
//鍙戣揣
Consumable_order__c Order2 = new Consumable_order__c();
Order2.Name = 'OCM_01';
@@ -317,8 +204,8 @@
Order2.Order_ProType__c = 'ENG';
insert Order2;
- List<Consumable_order_details2__c> conList1 = new List<Consumable_order_details2__c>();
- //浜у搧绫诲瀷涓嶅悓
+ List<Consumable_order_details2__c> conList1 = new List<Consumable_order_details2__c> ();
+ //浜у搧绫诲瀷涓嶅悓
Consumable_order_details2__c con = new Consumable_order_details2__c();
con.Name = 'OCM_01_001001';
con.Consumable_order_minor__c = Order1.Id;
@@ -328,15 +215,15 @@
con.Bar_Code__c = '10011';
con.Used_date__c = null;
con.Lose_Flag__c = false;
- con.Return_date__c = null;
- con.Send_Date__c = null;
+ con.Return_date__c= null;
+ con.Send_Date__c= null;
con.Box_Piece__c = '鐩�';
conList1.add(con);
-
+
// 鏈埌璐�
Consumable_order_details2__c con2 = new Consumable_order_details2__c();
con2.Arrive_date__c = null;
- con2.Send_Date__c = null;
+ con2.Send_Date__c =null;
con2.Used_date__c = null;
con2.Return_date__c = null;
con2.Lose_Flag__c = false;
@@ -349,7 +236,7 @@
//瑙勬牸=1
Consumable_order_details2__c con3 = new Consumable_order_details2__c();
con3.Arrive_date__c = Date.today();
- con3.Send_Date__c = null;
+ con3.Send_Date__c =null;
con3.Used_date__c = null;
con3.Return_date__c = null;
con3.Lose_Flag__c = false;
@@ -357,14 +244,14 @@
con3.Consumable_Arrived_order__c = Order2.Id;
con3.Consumable_Product__c = pro3.Id;
con3.Consumable_order_minor__c = Order2.Id;
- con3.RemoveBox_date__c = Date.today();
+ con3.RemoveBox_date__c= Date.today();
con3.Bar_Code__c = '10032';
conList1.add(con3);
insert conList1;
System.Test.startTest();
- LexRemoveBoxController.searchConsumableorderdetails('10011', 'Testaccount002', '閲嶅簡', 'ET');
- LexRemoveBoxController.searchConsumableorderdetails('10031\n10032', 'Testaccount002', '閲嶅簡', 'ENG');
+ LexRemoveBoxController.searchConsumableorderdetails('10011','Testaccount002','閲嶅簡','ET');
+ LexRemoveBoxController.searchConsumableorderdetails('10031\n10032','Testaccount002','閲嶅簡','ENG');
System.Test.stopTest();
}
}
@@ -372,90 +259,33 @@
// TO DO: implement unit test
user myUser_test;
Account myAccount2;
- Product2__c pro2;
+ Product2__c pro2 ;
Product2__c pro3;
Product2__c pro1;
- User thisUser = [SELECT Id FROM User WHERE Id = :UserInfo.getUserId()];
- System.runAs(thisUser) {
- List<RecordType> rectCo = [
- SELECT Id
- FROM RecordType
- WHERE IsActive = TRUE AND SobjectType = 'Account' AND Name = '璨╁2搴�'
- ];
+ User thisUser = [ select Id from User where Id = :UserInfo.getUserId()];
+ System.runAs(thisUser){
+ List<RecordType> rectCo = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '璨╁2搴�'];
if (rectCo.size() == 0) {
return;
}
- Profile prof = [
- SELECT Id
- FROM Profile
- WHERE Name = '901_缁忛攢鍟嗙ぞ鍖烘櫘閫氭潈闄恄2閲嶉獙璇�(ET Email)'
- ];
- myAccount2 = new Account(
- name = 'Testaccount002',
- Dealer_discount__c = 20,
- RecordTypeId = rectCo[0].Id,
- AgentCode_Ext__c = '9999900'
- );
+ Profile prof = [select Id from Profile where Name ='901_缁忛攢鍟嗙ぞ鍖烘櫘閫氭潈闄恄2閲嶉獙璇�(ET Email)'];
+ myAccount2 = new Account(name='Testaccount002',Dealer_discount__c =20,RecordTypeId = rectCo[0].Id,AgentCode_Ext__c = '9999900');
insert myAccount2;
- Contact core = new Contact(
- email = 'jplumber@salesforce.com',
- firstname = 'Joe',
- lastname = 'Plumber',
- accountid = myAccount2.id
- );
+ Contact core = new Contact(email='jplumber@salesforce.com', firstname='Joe',lastname='Plumber',accountid=myAccount2.id);
insert core;
- MyUser_Test = new User(
- ContactId = core.id,
- Alias = 'newUser',
- Email = 'newuser@testorg.com',
- EmailEncodingKey = 'UTF-8',
- LastName = 'TestUser',
- LanguageLocaleKey = 'zh_CN',
- LocaleSidKey = 'zh_CN',
- ProfileId = prof.Id,
- TimeZoneSidKey = 'Asia/Shanghai',
- UserName = 'testUser@testorg.com',
- Work_Location__c = '閲嶅簡'
- );
+ MyUser_Test = New User(ContactId = core.id,Alias = 'newUser',Email='newuser@testorg.com',EmailEncodingKey='UTF-8', LastName='TestUser', LanguageLocaleKey='zh_CN',LocaleSidKey='zh_CN', ProfileId = prof.Id,TimeZoneSidKey='Asia/Shanghai', UserName='testUser@testorg.com',Work_Location__c = '閲嶅簡');
insert MyUser_Test;
}
- System.runAs(myUser_Test) {
- Product2 prod01 = new Product2(
- Name = 'Test01',
- ProductCode = 'Test01',
- Asset_Model_No__c = 'Test01',
- SFDA_Status__c = '鏈夊姽',
- JANCODE__c = '04953170200311',
- Packing_list_manual__c = 12,
- Dealer_special_Object__c = true,
- Manual_Entry__c = false
- );
- Product2 prod02 = new Product2(
- Name = 'Test02',
- ProductCode = 'Test02',
- Asset_Model_No__c = 'Test02',
- SFDA_Status__c = '鏈夊姽',
- JANCODE__c = '04953170200312',
- Packing_list_manual__c = 10,
- Dealer_special_Object__c = true,
- Manual_Entry__c = false
- );
- Product2 prod03 = new Product2(
- Name = 'Test03',
- ProductCode = 'Test03',
- Asset_Model_No__c = 'Test03',
- SFDA_Status__c = '鏈夊姽',
- JANCODE__c = '04953170200313',
- Dealer_special_Object__c = true,
- Packing_list_manual__c = 1,
- Manual_Entry__c = false
- );
- insert new List<Product2>{ prod01, prod02, prod03 };
- pro1 = new Product2__c(Name = 'Pro001', OT_CODE_Text__c = 'Test001', Product2__c = prod01.Id);
- pro2 = new Product2__c(Name = 'Pro002', OT_CODE_Text__c = 'Test002', Product2__c = prod02.Id);
- pro3 = new Product2__c(Name = 'Pro003', OT_CODE_Text__c = 'Test003', Product2__c = prod03.Id);
- insert new List<Product2__c>{ pro1, pro2, pro3 };
+ System.runAs(myUser_Test){
+ Product2 prod01 = new Product2(Name='Test01',ProductCode='Test01',Asset_Model_No__c = 'Test01',SFDA_Status__c = '鏈夊姽',JANCODE__c = '04953170200311',Packing_list_manual__c=12,Dealer_special_Object__c = true,Manual_Entry__c = false);
+ Product2 prod02 = new Product2(Name='Test02',ProductCode='Test02',Asset_Model_No__c = 'Test02',SFDA_Status__c = '鏈夊姽',JANCODE__c = '04953170200312',Packing_list_manual__c=10,Dealer_special_Object__c = true,Manual_Entry__c = false);
+ Product2 prod03 = new Product2(Name='Test03',ProductCode='Test03',Asset_Model_No__c = 'Test03',SFDA_Status__c = '鏈夊姽',JANCODE__c = '04953170200313',Dealer_special_Object__c = true,Packing_list_manual__c = 1,Manual_Entry__c = false);
+ insert new Product2[]{prod01,prod02,prod03};
+ pro1 = new Product2__c(Name='Pro001',OT_CODE_Text__c='Test001',Product2__c = prod01.Id);
+ pro2 = new Product2__c(Name='Pro002',OT_CODE_Text__c='Test002',Product2__c = prod02.Id);
+ pro3 = new Product2__c(Name='Pro003',OT_CODE_Text__c='Test003',Product2__c = prod03.Id);
+ insert new Product2__c[] {pro1, pro2, pro3};
List<Consumable_order__c> orderList = new List<Consumable_order__c>();
List<Consumable_order__c> orderList1 = new List<Consumable_order__c>();
//鍒拌揣
@@ -478,29 +308,29 @@
orderList.add(Order2);
insert orderList;
- //鍑鸿揣
- Consumable_order__c Order3 = new Consumable_order__c();
- Order3.Name = 'OCM_03';
- Order3.Order_status__c = '鎵瑰噯';
- Order3.Order_type__c = '鍑鸿揣';
- Order3.Dealer_Info__c = myAccount2.Id;
- Order3.RecordTypeid = '012100000006Jx9AAE';
- Order3.Order_ProType__c = 'ENG';
- orderList1.add(Order3);
+ //鍑鸿揣
+ Consumable_order__c Order3 = new Consumable_order__c();
+ Order3.Name = 'OCM_03';
+ Order3.Order_status__c = '鎵瑰噯';
+ Order3.Order_type__c = '鍑鸿揣';
+ Order3.Dealer_Info__c = myAccount2.Id;
+ Order3.RecordTypeid = '012100000006Jx9AAE';
+ Order3.Order_ProType__c = 'ENG';
+ orderList1.add(Order3);
- //鍙戣揣
- Consumable_order__c Order4 = new Consumable_order__c();
- Order4.Name = 'OCM_03';
- Order4.Order_status__c = '鎵瑰噯';
- Order4.Order_type__c = '鍙戣揣';
- Order4.Dealer_Info__c = myAccount2.Id;
- Order4.RecordTypeid = '01210000000c9drAAA';
- Order4.Order_ProType__c = 'ENG';
- orderList1.add(Order4);
- insert orderList1;
+ //鍙戣揣
+ Consumable_order__c Order4 = new Consumable_order__c();
+ Order4.Name = 'OCM_03';
+ Order4.Order_status__c = '鎵瑰噯';
+ Order4.Order_type__c = '鍙戣揣';
+ Order4.Dealer_Info__c = myAccount2.Id;
+ Order4.RecordTypeid = '01210000000c9drAAA';
+ Order4.Order_ProType__c = 'ENG';
+ orderList1.add(Order4);
+ insert orderList1;
- List<Consumable_order_details2__c> conList1 = new List<Consumable_order_details2__c>();
- //浜у搧绫诲瀷涓嶅悓
+ List<Consumable_order_details2__c> conList1 = new List<Consumable_order_details2__c> ();
+ //浜у搧绫诲瀷涓嶅悓
Consumable_order_details2__c con = new Consumable_order_details2__c();
con.Name = 'OCM_01_001001';
con.Consumable_order_minor__c = Order1.Id;
@@ -510,15 +340,15 @@
con.Bar_Code__c = '10011';
con.Used_date__c = null;
con.Lose_Flag__c = false;
- con.Return_date__c = null;
- con.Send_Date__c = null;
+ con.Return_date__c= null;
+ con.Send_Date__c= null;
con.Box_Piece__c = '鐩�';
conList1.add(con);
-
+
// // 鏈埌璐�
Consumable_order_details2__c con2 = new Consumable_order_details2__c();
con2.Arrive_date__c = null;
- con2.Send_Date__c = null;
+ con2.Send_Date__c =null;
con2.Used_date__c = null;
con2.Return_date__c = null;
con2.Lose_Flag__c = false;
@@ -531,7 +361,7 @@
//瑙勬牸=1
Consumable_order_details2__c con3 = new Consumable_order_details2__c();
con3.Arrive_date__c = Date.today();
- con3.Send_Date__c = null;
+ con3.Send_Date__c =null;
con3.Used_date__c = null;
con3.Return_date__c = null;
con3.Lose_Flag__c = false;
@@ -539,13 +369,13 @@
con3.Consumable_Arrived_order__c = Order2.Id;
con3.Consumable_Product__c = pro3.Id;
con3.Consumable_order_minor__c = Order2.Id;
- con3.RemoveBox_date__c = Date.today();
+ con3.RemoveBox_date__c= Date.today();
con3.Bar_Code__c = '10032';
conList1.add(con3);
insert conList1;
System.Test.startTest();
- LexRemoveBoxController.searchConsumableorderdetails('10031\n10032\n', 'Testaccount002', '閲嶅簡', 'ENG');
+ LexRemoveBoxController.searchConsumableorderdetails('10031\n10032\n','Testaccount002','閲嶅簡','ENG');
System.Test.stopTest();
}
}
@@ -553,100 +383,43 @@
// TO DO: implement unit test
user myUser_test;
Account myAccount2;
- Product2__c pro2;
+ Product2__c pro2 ;
Product2__c pro3;
Product2__c pro1;
- User thisUser = [SELECT Id FROM User WHERE Id = :UserInfo.getUserId()];
- System.runAs(thisUser) {
- List<RecordType> rectCo = [
- SELECT Id
- FROM RecordType
- WHERE IsActive = TRUE AND SobjectType = 'Account' AND Name = '璨╁2搴�'
- ];
+ User thisUser = [ select Id from User where Id = :UserInfo.getUserId()];
+ System.runAs(thisUser){
+ List<RecordType> rectCo = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '璨╁2搴�'];
if (rectCo.size() == 0) {
return;
}
- Profile prof = [
- SELECT Id
- FROM Profile
- WHERE Name = '901_缁忛攢鍟嗙ぞ鍖烘櫘閫氭潈闄恄2閲嶉獙璇�(ET Email)'
- ];
- myAccount2 = new Account(
- name = 'Testaccount002',
- Dealer_discount__c = 20,
- RecordTypeId = rectCo[0].Id,
- AgentCode_Ext__c = '9999900'
- );
+ Profile prof = [select Id from Profile where Name ='901_缁忛攢鍟嗙ぞ鍖烘櫘閫氭潈闄恄2閲嶉獙璇�(ET Email)'];
+ myAccount2 = new Account(name='Testaccount002',Dealer_discount__c =20,RecordTypeId = rectCo[0].Id,AgentCode_Ext__c = '9999900');
insert myAccount2;
- Contact core = new Contact(
- email = 'jplumber@salesforce.com',
- firstname = 'Joe',
- lastname = 'Plumber',
- accountid = myAccount2.id
- );
+ Contact core = new Contact(email='jplumber@salesforce.com', firstname='Joe',lastname='Plumber',accountid=myAccount2.id);
insert core;
- MyUser_Test = new User(
- ContactId = core.id,
- Alias = 'newUser',
- Email = 'newuser@testorg.com',
- EmailEncodingKey = 'UTF-8',
- LastName = 'TestUser',
- LanguageLocaleKey = 'zh_CN',
- LocaleSidKey = 'zh_CN',
- ProfileId = prof.Id,
- TimeZoneSidKey = 'Asia/Shanghai',
- UserName = 'testUser@testorg.com',
- Work_Location__c = '閲嶅簡'
- );
+ MyUser_Test = New User(ContactId = core.id,Alias = 'newUser',Email='newuser@testorg.com',EmailEncodingKey='UTF-8', LastName='TestUser', LanguageLocaleKey='zh_CN',LocaleSidKey='zh_CN', ProfileId = prof.Id,TimeZoneSidKey='Asia/Shanghai', UserName='testUser@testorg.com',Work_Location__c = '閲嶅簡');
insert MyUser_Test;
}
- System.runAs(myUser_Test) {
- Product2 prod01 = new Product2(
- Name = 'Test01',
- ProductCode = 'Test01',
- Asset_Model_No__c = 'Test01',
- SFDA_Status__c = '鏈夊姽',
- JANCODE__c = '04953170200311',
- Packing_list_manual__c = 12,
- Dealer_special_Object__c = true,
- Manual_Entry__c = false
- );
- Product2 prod02 = new Product2(
- Name = 'Test02',
- ProductCode = 'Test02',
- Asset_Model_No__c = 'Test02',
- SFDA_Status__c = '鏈夊姽',
- JANCODE__c = '04953170200312',
- Packing_list_manual__c = 10,
- Dealer_special_Object__c = true,
- Manual_Entry__c = false
- );
- Product2 prod03 = new Product2(
- Name = 'Test03',
- ProductCode = 'Test03',
- Asset_Model_No__c = 'Test03',
- SFDA_Status__c = '鏈夊姽',
- JANCODE__c = '04953170200313',
- Dealer_special_Object__c = true,
- Packing_list_manual__c = 1,
- Manual_Entry__c = false
- );
- insert new List<Product2>{ prod01, prod02, prod03 };
- pro1 = new Product2__c(Name = 'Pro001', OT_CODE_Text__c = 'Test001', Product2__c = prod01.Id);
- pro2 = new Product2__c(Name = 'Pro002', OT_CODE_Text__c = 'Test002', Product2__c = prod02.Id);
- pro3 = new Product2__c(Name = 'Pro003', OT_CODE_Text__c = 'Test003', Product2__c = prod03.Id);
- insert new List<Product2__c>{ pro1, pro2, pro3 };
+ System.runAs(myUser_Test){
+ Product2 prod01 = new Product2(Name='Test01',ProductCode='Test01',Asset_Model_No__c = 'Test01',SFDA_Status__c = '鏈夊姽',JANCODE__c = '04953170200311',Packing_list_manual__c=12,Dealer_special_Object__c = true,Manual_Entry__c = false);
+ Product2 prod02 = new Product2(Name='Test02',ProductCode='Test02',Asset_Model_No__c = 'Test02',SFDA_Status__c = '鏈夊姽',JANCODE__c = '04953170200312',Packing_list_manual__c=10,Dealer_special_Object__c = true,Manual_Entry__c = false);
+ Product2 prod03 = new Product2(Name='Test03',ProductCode='Test03',Asset_Model_No__c = 'Test03',SFDA_Status__c = '鏈夊姽',JANCODE__c = '04953170200313',Dealer_special_Object__c = true,Packing_list_manual__c = 1,Manual_Entry__c = false);
+ insert new Product2[]{prod01,prod02,prod03};
+ pro1 = new Product2__c(Name='Pro001',OT_CODE_Text__c='Test001',Product2__c = prod01.Id);
+ pro2 = new Product2__c(Name='Pro002',OT_CODE_Text__c='Test002',Product2__c = prod02.Id);
+ pro3 = new Product2__c(Name='Pro003',OT_CODE_Text__c='Test003',Product2__c = prod03.Id);
+ insert new Product2__c[] {pro1, pro2,pro3};
List<Consumable_order__c> orderList = new List<Consumable_order__c>();
- //鍒拌揣
- Consumable_order__c Order1 = new Consumable_order__c();
- Order1.Name = 'OCM_01';
- Order1.Order_status__c = '鎵瑰噯';
- Order1.Order_type__c = '鍒拌揣';
- Order1.Dealer_Info__c = myAccount2.Id;
- Order1.RecordTypeid = '01210000000c9dqAAA';
- Order1.Order_ProType__c = 'ENG';
- orderList.add(Order1);
+ //鍒拌揣
+ Consumable_order__c Order1 = new Consumable_order__c();
+ Order1.Name = 'OCM_01';
+ Order1.Order_status__c = '鎵瑰噯';
+ Order1.Order_type__c = '鍒拌揣';
+ Order1.Dealer_Info__c = myAccount2.Id;
+ Order1.RecordTypeid = '01210000000c9dqAAA';
+ Order1.Order_ProType__c = 'ENG';
+ orderList.add(Order1);
//鍙戣揣
Consumable_order__c Order2 = new Consumable_order__c();
Order2.Name = 'OCM_01';
@@ -658,8 +431,8 @@
orderList.add(Order2);
insert orderList;
- List<Consumable_order_details2__c> conList1 = new List<Consumable_order_details2__c>();
- //浜у搧绫诲瀷涓嶅悓
+ List<Consumable_order_details2__c> conList1 = new List<Consumable_order_details2__c> ();
+ //浜у搧绫诲瀷涓嶅悓
Consumable_order_details2__c con = new Consumable_order_details2__c();
con.Name = 'OCM_01_001001';
con.Consumable_order_minor__c = Order1.Id;
@@ -669,15 +442,15 @@
con.Bar_Code__c = '10011';
con.Used_date__c = null;
con.Lose_Flag__c = false;
- con.Return_date__c = null;
- con.Send_Date__c = null;
+ con.Return_date__c= null;
+ con.Send_Date__c= null;
con.Box_Piece__c = '鐩�';
conList1.add(con);
-
+
// 鏈埌璐�
Consumable_order_details2__c con2 = new Consumable_order_details2__c();
con2.Arrive_date__c = null;
- con2.Send_Date__c = null;
+ con2.Send_Date__c =null;
con2.Used_date__c = null;
con2.Return_date__c = null;
con2.Lose_Flag__c = false;
@@ -690,7 +463,7 @@
//瑙勬牸=1
Consumable_order_details2__c con3 = new Consumable_order_details2__c();
con3.Arrive_date__c = Date.today();
- con3.Send_Date__c = null;
+ con3.Send_Date__c =null;
con3.Used_date__c = null;
con3.Return_date__c = null;
con3.Lose_Flag__c = false;
@@ -698,16 +471,18 @@
con3.Consumable_Arrived_order__c = Order2.Id;
con3.Consumable_Product__c = pro3.Id;
con3.Consumable_order_minor__c = Order2.Id;
- con3.RemoveBox_date__c = Date.today();
+ con3.RemoveBox_date__c= Date.today();
con3.Bar_Code__c = '10032';
conList1.add(con3);
insert conList1;
System.Test.startTest();
- LexRemoveBoxController.searchConsumableorderdetails('10011\n10031', 'Testaccount002', '閲嶅簡', 'ENG');
- LexRemoveBoxController.searchConsumableorderdetails('10032', 'Testaccount002', '涓婃捣', 'ENG');
- LexRemoveBoxController.removeBoxConfirm(JSON.serialize(conList1), 'Testaccount002', '閲嶅簡', 'ENG');
+ LexRemoveBoxController.searchConsumableorderdetails('10011\n10031','Testaccount002','閲嶅簡','ENG');
+ LexRemoveBoxController.searchConsumableorderdetails('10032','Testaccount002','涓婃捣','ENG');
+ LexRemoveBoxController.removeBoxConfirm(JSON.serialize(conList1),'Testaccount002','閲嶅簡','ENG');
System.Test.stopTest();
+
+
}
}
-}
+}
\ No newline at end of file
diff --git a/force-app/main/default/classes/LexRemoveBoxControllerTest.cls-meta.xml b/force-app/main/default/classes/LexRemoveBoxControllerTest.cls-meta.xml
index a9fd6e9..754ecb1 100644
--- a/force-app/main/default/classes/LexRemoveBoxControllerTest.cls-meta.xml
+++ b/force-app/main/default/classes/LexRemoveBoxControllerTest.cls-meta.xml
@@ -1,4 +1,4 @@
-<?xml version="1.0" encoding="UTF-8" ?>
+<?xml version="1.0" encoding="UTF-8"?>
<ApexClass xmlns="http://soap.sforce.com/2006/04/metadata">
<apiVersion>57.0</apiVersion>
<status>Active</status>
diff --git a/force-app/main/default/classes/LexSaleAndDeliveryControllerTest.cls b/force-app/main/default/classes/LexSaleAndDeliveryControllerTest.cls
index e202d9b..badd9d7 100644
--- a/force-app/main/default/classes/LexSaleAndDeliveryControllerTest.cls
+++ b/force-app/main/default/classes/LexSaleAndDeliveryControllerTest.cls
@@ -1,97 +1,41 @@
@isTest
private class LexSaleAndDeliveryControllerTest {
@isTest
- static void testInit() {
+ static void testInit(){
User myUser_test;
Account myAccount2;
Product2__c pro2;
- User thisUser = [SELECT Id FROM User WHERE Id = :UserInfo.getUserId()];
- System.runAs(thisUser) {
- List<RecordType> rectCo = [
- SELECT Id
- FROM RecordType
- WHERE IsActive = TRUE AND SobjectType = 'Account' AND Name = '璨╁2搴�'
- ];
+ User thisUser = [ SELECT Id FROM User WHERE Id = :UserInfo.getUserId()];
+ System.runAs(thisUser){
+ List<RecordType> rectCo = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '璨╁2搴�'];
if (rectCo.size() == 0) {
return;
}
- Profile prof = [
- SELECT Id
- FROM Profile
- WHERE Name = '901_缁忛攢鍟嗙ぞ鍖烘櫘閫氭潈闄恄2閲嶉獙璇�(ET Email)'
- ];
- Product2 prod02 = new Product2(
- Name = 'Test02181',
- ProductCode = 'Test0218',
- Asset_Model_No__c = 'Test0218',
- SFDA_Status__c = '鏈夊姽',
- Dealer_special_Object__c = true,
- SFDA_Approbation_No__c = 'Test002',
- Packing_list_manual__c = 12,
- SFDA_Expiration_Date__c = Date.today(),
- Category5__c = 'tset8',
- Manual_Entry__c = false
- );
- pro2 = new Product2__c(Name = 'Pro002181', OT_CODE_Text__c = 'Test002181', Product2__c = prod02.Id);
+ Profile prof = [select Id from Profile where Name ='901_缁忛攢鍟嗙ぞ鍖烘櫘閫氭潈闄恄2閲嶉獙璇�(ET Email)'];
+ Product2 prod02 = new Product2(Name='Test02181',ProductCode='Test0218',Asset_Model_No__c = 'Test0218',SFDA_Status__c = '鏈夊姽',Dealer_special_Object__c = true,SFDA_Approbation_No__c = 'Test002',Packing_list_manual__c = 12,SFDA_Expiration_Date__c= Date.today(),Category5__c = 'tset8',Manual_Entry__c = false);
+ pro2 = new Product2__c(Name='Pro002181',OT_CODE_Text__c='Test002181',Product2__c = prod02.Id);
insert pro2;
- myAccount2 = new Account(name = 'Testaccount003', Dealer_discount__c = 20, RecordTypeId = rectCo[0].Id, AgentCode_Ext__c = '2');
+ myAccount2 = new Account(name='Testaccount003',Dealer_discount__c =20,RecordTypeId = rectCo[0].Id,AgentCode_Ext__c = '2');
insert myAccount2;
-
- Contact core = new Contact(email = 'wan@salesforce.com', firstname = 'wan', lastname = 'Plumbers', accountid = myAccount2.id);
+
+ Contact core = new Contact(email='wan@salesforce.com', firstname='wan',lastname='Plumbers',accountid=myAccount2.id);
insert core;
- myUser_test = new User(
- ContactId = core.id,
- Alias = 'newUser',
- Email = 'newuser@testorg.com',
- EmailEncodingKey = 'UTF-8',
- LastName = 'TestUser',
- LanguageLocaleKey = 'zh_CN',
- LocaleSidKey = 'zh_CN',
- ProfileId = prof.Id,
- TimeZoneSidKey = 'Asia/Shanghai',
- UserName = 'testUser@testorg.com',
- UserPro_Type__c = 'ENG',
- Work_Location__c = '鍖椾含'
- );
+ myUser_test = New User(ContactId = core.id, Alias = 'newUser', Email='newuser@testorg.com', EmailEncodingKey='UTF-8', LastName='TestUser', LanguageLocaleKey='zh_CN', LocaleSidKey='zh_CN', ProfileId = prof.Id, TimeZoneSidKey='Asia/Shanghai', UserName='testUser@testorg.com', UserPro_Type__c='ENG', Work_Location__c='鍖椾含');
insert myUser_test;
myUser_test.UserPro_Type__c = '';
update myUser_test;
}
- System.runAs(MyUser_Test) {
+ System.runAs(MyUser_Test){
String accountId = myUser_test.accountid;
String agencyProType = myUser_test.UserPro_Type__c;
String userWorkLocation = myUser_test.Work_Location__c;
System.Test.startTest();
LexSaleAndDeliveryController.init();
- LexSaleAndDeliveryController.searchOrderInstatus(
- '2023/01/01',
- '2023/12/31',
- accountId,
- agencyProType,
- userWorkLocation,
- 'DB',
- '澶ц繛'
- );
- LexSaleAndDeliveryController.searchConsumableorderdetails(
- '2023/01/01',
- '2023/12/31',
- accountId,
- agencyProType,
- userWorkLocation,
- 'DB',
- '澶ц繛'
- );
- LexSaleAndDeliveryController.searchConsumableorFinish(
- '2023/01/01',
- '2023/12/31',
- accountId,
- agencyProType,
- userWorkLocation,
- 'DB',
- '澶ц繛'
- );
- LexSaleAndDeliveryController.cleanUp(accountId, agencyProType, userWorkLocation);
+ LexSaleAndDeliveryController.searchOrderInstatus('2023/01/01','2023/12/31',accountId,agencyProType,userWorkLocation,'DB','澶ц繛');
+ LexSaleAndDeliveryController.searchConsumableorderdetails('2023/01/01','2023/12/31',accountId,agencyProType,userWorkLocation,'DB','澶ц繛');
+ LexSaleAndDeliveryController.searchConsumableorFinish('2023/01/01','2023/12/31',accountId,agencyProType,userWorkLocation,'DB','澶ц繛');
+ LexSaleAndDeliveryController.cleanUp(accountId,agencyProType,userWorkLocation);
System.Test.stopTest();
}
}
-}
+}
\ No newline at end of file
diff --git a/force-app/main/default/classes/LexSaleAndDeliveryControllerTest.cls-meta.xml b/force-app/main/default/classes/LexSaleAndDeliveryControllerTest.cls-meta.xml
index a9fd6e9..754ecb1 100644
--- a/force-app/main/default/classes/LexSaleAndDeliveryControllerTest.cls-meta.xml
+++ b/force-app/main/default/classes/LexSaleAndDeliveryControllerTest.cls-meta.xml
@@ -1,4 +1,4 @@
-<?xml version="1.0" encoding="UTF-8" ?>
+<?xml version="1.0" encoding="UTF-8"?>
<ApexClass xmlns="http://soap.sforce.com/2006/04/metadata">
<apiVersion>57.0</apiVersion>
<status>Active</status>
diff --git a/force-app/main/default/classes/LexSaleOrderController.cls b/force-app/main/default/classes/LexSaleOrderController.cls
index d9693a9..a4fbc59 100644
--- a/force-app/main/default/classes/LexSaleOrderController.cls
+++ b/force-app/main/default/classes/LexSaleOrderController.cls
@@ -32,11 +32,7 @@
res.entity = data;
String UserName = UserInfo.getUserId();
- user useracc = [
- SELECT Accountid, Work_Location__c
- FROM user
- WHERE id = :UserName
- ];
+ user useracc = [SELECT Accountid, Work_Location__c FROM user WHERE id = :UserName];
accountid = useracc.Accountid;
userWorkLocation = useracc.Work_Location__c;
Account accountInfo = [SELECT Name FROM account WHERE id = :accountid];
@@ -259,11 +255,7 @@
}
Map<String, String> proHosMap = new Map<String, String>();
Map<String, String> proIdMap = new Map<String, String>();
- List<hospitalprice__c> hpList = [
- SELECT id, hospital__c, product__c
- FROM hospitalprice__c
- WHERE account__c = :accountid
- ];
+ List<hospitalprice__c> hpList = [SELECT id, hospital__c, product__c FROM hospitalprice__c WHERE account__c = :accountid];
if (hpList != null && hpList.size() > 0) {
for (hospitalprice__c hp : hpList) {
if (hp.product__c != null && String.valueof(hp.product__c).length() >= 15) {
@@ -285,7 +277,7 @@
errorIdMap.put(newdet2[j].Bar_Code__c, newdet2[j].Bar_Code__c);
}
if (coc.OutPattern__c == true) {
- System.debug('testPattern:' + newdet2[j].Product_Pattern__c + '---' + orderdetails[i].Product_Pattern__c);
+ System.debug('testPattern:'+newdet2[j].Product_Pattern__c+'---'+orderdetails[i].Product_Pattern__c);
if (newdet2[j].Product_Pattern__c == orderdetails[i].Product_Pattern__c) {
//add by rentx 2021-03-22 start
if (newdet2[j].exchangeOutPattern__c == true) {
@@ -1325,4 +1317,4 @@
return null;
}
}
-}
+}
\ No newline at end of file
diff --git a/force-app/main/default/classes/LexSaleOrderControllerTest.cls b/force-app/main/default/classes/LexSaleOrderControllerTest.cls
index ea7b9ce..069402b 100644
--- a/force-app/main/default/classes/LexSaleOrderControllerTest.cls
+++ b/force-app/main/default/classes/LexSaleOrderControllerTest.cls
@@ -2,109 +2,54 @@
private class LexSaleOrderControllerTest {
public static Map<String, String> orderpieceorboxMap;
public static Map<String, Decimal> orderpriceMap;
- public static Map<String, Decimal> orderagencypriceMap;
+ public static Map<String, Decimal> orderagencypriceMap ;
public static Map<String, Decimal> orderdetCountMap;
public static Map<String, String> existIdMap;
public static Map<String, String> errorIdMap;
public static Map<String, String> allMap;
@isTest
- static void testInit() {
+ static void testInit(){
Account accountItem1;
Account accountItem2;
User userTest;
- User thisUser = [SELECT Id FROM User WHERE Id = :UserInfo.getUserId()];
- System.runAs(thisUser) {
- List<RecordType> rectCo = [
- SELECT Id
- FROM RecordType
- WHERE IsActive = TRUE AND SobjectType = 'Account' AND Name = '璨╁2搴�'
- ];
+ User thisUser = [SELECT Id FROM User WHERE Id =:UserInfo.getUserId()];
+ System.runAs(thisUser){
+ List<RecordType> rectCo = [SELECT Id FROM RecordType WHERE IsActive = true AND SobjectType = 'Account' AND Name = '璨╁2搴�'];
if (rectCo.size() == 0) {
return;
}
- List<RecordType> rectHp = [
- SELECT Id
- FROM RecordType
- WHERE IsActive = TRUE AND SobjectType = 'Account' AND Name = '鐥呴櫌'
- ];
+ List<RecordType> rectHp = [SELECT Id FROM RecordType WHERE IsActive = true AND SobjectType = 'Account' AND Name = '鐥呴櫌'];
if (rectHp.size() == 0) {
return;
}
- Profile prof = [
- SELECT Id
- FROM Profile
- WHERE Name = '901_缁忛攢鍟嗙ぞ鍖烘櫘閫氭潈闄恄2閲嶉獙璇�(ET)'
- ];
- accountItem1 = new Account(Name = 'Testaccount001', RecordTypeId = rectCo[0].Id, AgentCode_Ext__c = '9999900');
+ Profile prof = [SELECT Id FROM Profile WHERE Name ='901_缁忛攢鍟嗙ぞ鍖烘櫘閫氭潈闄恄2閲嶉獙璇�(ET)'];
+ accountItem1 = new Account(Name='Testaccount001',RecordTypeId = rectCo[0].Id, AgentCode_Ext__c = '9999900');
insert accountItem1;
- accountItem2 = new Account(Name = 'Testaccount002', RecordTypeId = rectHp[0].Id, AgentCode_Ext__c = '9999999');
+ accountItem2 = new Account(Name='Testaccount002',RecordTypeId = rectHp[0].Id, AgentCode_Ext__c = '9999999');
insert accountItem2;
- Contact core = new Contact(
- email = 'jplumber@salesforce.com',
- firstname = 'Joe',
- lastname = 'Plumber',
- accountId = accountItem1.Id
- );
+ Contact core = new Contact(email='jplumber@salesforce.com', firstname='Joe', lastname='Plumber', accountId = accountItem1.Id);
insert core;
- userTest = new User(
- ContactId = core.id,
- Alias = 'newUser',
- Email = 'newuser@testorg.com',
- EmailEncodingKey = 'UTF-8',
- LastName = 'TestUser',
- LanguageLocaleKey = 'zh_CN',
- LocaleSidKey = 'zh_CN',
- ProfileId = prof.Id,
- TimeZoneSidKey = 'Asia/Shanghai',
- UserName = 'testUser@testorg.com',
- UserPro_Type__c = 'ENG',
- Work_Location__c = '澶ц繛'
- );
+ userTest = New User(ContactId = core.id, Alias = 'newUser', Email='newuser@testorg.com', EmailEncodingKey='UTF-8', LastName='TestUser', LanguageLocaleKey='zh_CN', LocaleSidKey='zh_CN', ProfileId = prof.Id, TimeZoneSidKey='Asia/Shanghai', UserName='testUser@testorg.com', UserPro_Type__c='ENG', Work_Location__c='澶ц繛');
insert userTest;
}
- System.runAs(userTest) {
+ System.runAs(userTest){
String Id = UserInfo.getUserId();
- User thisUserInfo = [
- SELECT accountid, ContactId, Contact.AccountId, Work_Location__c
- FROM User
- WHERE id = :Id
- ];
+ User thisUserInfo = [SELECT accountid,ContactId,Contact.AccountId, Work_Location__c FROM User WHERE id =:Id];
String accountId = thisUserInfo.Contact.AccountId;
String userWorkLocation = thisUserInfo.Work_Location__c;
String accountName;
- Account[] accountInfo = [
- SELECT Name
- FROM account
- WHERE id = :accountId
- LIMIT 1
- ];
- if (accountInfo.size() > 0) {
+ Account[] accountInfo = [SELECT Name FROM account WHERE id = :accountId LIMIT 1];
+ if(accountInfo.size() > 0 ){
accountName = accountInfo[0].Name;
}
- Product2 prod01 = new Product2(
- Name = 'Test01',
- ProductCode = 'Test01',
- Asset_Model_No__c = 'Test01',
- SFDA_Status__c = '鏈夊姽',
- Dealer_special_Object__c = true,
- Packing_list_manual__c = 12,
- Manual_Entry__c = false
- );
- Product2 prod02 = new Product2(
- Name = 'Test02',
- ProductCode = 'Test02',
- Asset_Model_No__c = 'Test02',
- SFDA_Status__c = '鏈夊姽',
- Dealer_special_Object__c = true,
- Packing_list_manual__c = 12,
- Manual_Entry__c = false
- );
- insert new List<Product2>{ prod01, prod02 };
- Product2__c pro1 = new Product2__c(Name = 'Pro001', OT_CODE_Text__c = 'Test001', Product2__c = prod01.Id);
- Product2__c pro2 = new Product2__c(Name = 'Pro002', OT_CODE_Text__c = 'Test002', Product2__c = prod02.Id);
- insert new List<Product2__c>{ pro1, pro2 };
-
+ Product2 prod01 = new Product2(Name='Test01',ProductCode='Test01',Asset_Model_No__c = 'Test01',SFDA_Status__c = '鏈夊姽',Dealer_special_Object__c = true,Packing_list_manual__c=12,Manual_Entry__c = false);
+ Product2 prod02 = new Product2(Name='Test02',ProductCode='Test02',Asset_Model_No__c = 'Test02',SFDA_Status__c = '鏈夊姽',Dealer_special_Object__c = true,Packing_list_manual__c=12,Manual_Entry__c = false);
+ insert new Product2[]{prod01,prod02};
+ Product2__c pro1 = new Product2__c(Name='Pro001',OT_CODE_Text__c='Test001',Product2__c = prod01.Id);
+ Product2__c pro2 = new Product2__c(Name='Pro002',OT_CODE_Text__c='Test002',Product2__c = prod02.Id);
+ insert new Product2__c[] {pro1, pro2};
+
Consumable_order__c Order1 = new Consumable_order__c();
Order1.Name = 'OCM_01_001';
Order1.Order_status__c = '鎵瑰噯';
@@ -115,7 +60,7 @@
Order1.Order_ProType__c = 'ENG';
Order1.Delivery_detail_count__c = 5;
Order1.IsShipment__c = true;
- insert Order1;
+ insert Order1;
//鍒拌揣
Consumable_order__c Order2 = new Consumable_order__c();
Order2.Name = 'testMing2';
@@ -161,7 +106,7 @@
//鍦ㄥ簱 涓�
Consumable_order_details2__c Orderdet4 = new Consumable_order_details2__c();
Orderdet4.Name = 'OCM_01_001004';
- Orderdet4.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
+ Orderdet4.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery ;
Orderdet4.Bar_Code__c = '44444250DDDDD';
Orderdet4.Consumable_Product__c = pro1.Id;
Orderdet4.Arrive_date__c = Date.today();
@@ -170,17 +115,17 @@
Consumable_order_details2__c Orderdet5 = new Consumable_order_details2__c();
Orderdet5.Name = 'OCM_01_001004';
- Orderdet5.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
+ Orderdet5.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery ;
Orderdet5.Bar_Code__c = '55555250EEEEE';
Orderdet5.Consumable_Product__c = pro1.Id;
Orderdet5.Arrive_date__c = Date.today();
Orderdet5.TracingCode__c = 'EEEEE';
- insert new List<Consumable_order_details2__c>{ Orderdet1, Orderdet2, Orderdet3, Orderdet4, Orderdet5 };
+ insert new Consumable_order_details2__c[] {Orderdet1,Orderdet2,Orderdet3,Orderdet4,Orderdet5};
Consumable_order__c zsd01 = new Consumable_order__c();
zsd01.Name = 'ZSD_01_001';
zsd01.Order_type__c = '浼犵エ';
- zsd01.SummonsStatus_c__c = '宸插畬鎴�';
+ zsd01.SummonsStatus_c__c ='宸插畬鎴�';
zsd01.Order_type__c = '璁㈠崟';
zsd01.RecordTypeid = System.Label.RT_ConOrder_Order;
zsd01.Summons_Sale_Status__c = '閿�鍞�';
@@ -193,7 +138,7 @@
Consumable_orderdetails__c Orderdet6 = new Consumable_orderdetails__c();
Orderdet6.Name = 'ZSD_01_001001';
Orderdet6.Consumable_order__c = zsd01.Id;
- Orderdet6.RecordTypeId = System.Label.RT_ConOrderDetail1_Order;
+ Orderdet6.RecordTypeId = System.Label.RT_ConOrderDetail1_Order ;
Orderdet6.Consumable_Count__c = 12;
Orderdet6.Consumable_Product__c = pro1.Id;
Orderdet6.Delivery_List_RMB__c = 1;
@@ -229,7 +174,7 @@
orderagencypriceMap = new Map<String, Decimal>();
orderpriceMap = new Map<String, Decimal>();
orderdetCountMap = new Map<String, Decimal>();
- if (orderdetails.size() > 0) {
+ if(orderdetails.size() > 0 ){
for (Integer i = 0; i < orderdetails.size(); i++) {
orderpieceorboxMap.put(orderdetails[i].Product_Pattern__c, orderdetails[i].Box_Piece__c);
if (orderdetails[i].Unitprice_To_agency__c != null && orderdetails[i].Unitprice_To_agency__c != 0) {
@@ -248,46 +193,25 @@
Integer a = 0;
List<LexSaleOrderController.ConsumableorderdetailsInfo> consumableorderdetailsRecords = new List<LexSaleOrderController.ConsumableorderdetailsInfo>();
Map<String, Integer> msiMap = new Map<String, Integer>();
- LexSaleOrderController.SearchPro(Order1, barcode1, accountName, userWorkLocation, accountId, orderdetails, orderpieceorboxMap);
+ LexSaleOrderController.SearchPro(Order1,barcode1,accountName,userWorkLocation,accountId,orderdetails,orderpieceorboxMap);
String barcode = '11111250AAAAA\n22222250BBBBB\n33333250CCCCC\n44444250DDDDD\n55555250EEEEE\n666666\n777777\naaa';
LexSaleOrderController.ParseBarCode(barcode);
- LexSaleOrderController.SearchPro(Order2, barcode, accountName, userWorkLocation, accountId, orderdetails, orderpieceorboxMap);
- LexSaleOrderController.ProdElivery(
- ESetId,
- Order2,
- barcode,
- accountName,
- userWorkLocation,
- JSON.serialize(consumableorderdetailsRecords),
- orderdetails,
- orderpriceMap,
- orderagencypriceMap
- );
- LexSaleOrderController.ProSale(
- ESetId,
- Order2,
- barcode,
- accountName,
- userWorkLocation,
- JSON.serialize(consumableorderdetailsRecords),
- orderdetails,
- orderpriceMap,
- orderagencypriceMap
- );
+ LexSaleOrderController.SearchPro(Order2,barcode,accountName,userWorkLocation,accountId,orderdetails,orderpieceorboxMap);
+ LexSaleOrderController.ProdElivery(ESetId,Order2,barcode,accountName,userWorkLocation,JSON.serialize(consumableorderdetailsRecords),orderdetails,orderpriceMap,orderagencypriceMap);
+ LexSaleOrderController.ProSale(ESetId,Order2,barcode,accountName,userWorkLocation,JSON.serialize(consumableorderdetailsRecords),orderdetails,orderpriceMap,orderagencypriceMap);
LexSaleOrderController.Getconsumableorderdetails2Nobox();
+
List<LexSaleOrderController.ConsumableorderdetailsInfo> inList = LexSaleOrderController.consumableorderdetailsRecords;
- List<LexSaleOrderController.ConsumableorderdetailsInfo> inList1 = new List<LexSaleOrderController.ConsumableorderdetailsInfo>();
- for (LexSaleOrderController.ConsumableorderdetailsInfo ass : inList) {
- ass.orderdetails2 = Orderdet1;
+ List<LexSaleOrderController.ConsumableorderdetailsInfo> inList1 = new List<LexSaleOrderController.ConsumableorderdetailsInfo>();
+ for(LexSaleOrderController.ConsumableorderdetailsInfo ass: inList){
+ ass.orderdetails2= Orderdet1;
inList1.add(ass);
}
+
String errorReason = 'success';
- LexSaleOrderController.ConsumableorderdetailsInfo c2 = new LexSaleOrderController.ConsumableorderdetailsInfo(
- Orderdet1,
- errorReason
- );
+ LexSaleOrderController.ConsumableorderdetailsInfo c2 = new LexSaleOrderController.ConsumableorderdetailsInfo(Orderdet1,errorReason);
c2.orderdetails1 = null;
c2.orderdetails2 = Orderdet1;
c2.Prod = Orderdet1.Consumable_product__r;
@@ -300,12 +224,13 @@
c1.Prod = Orderdet2.Consumable_product__r;
c1.oldConsumableCount = Orderdet2.Name;
c1.compareTo(c2);
-
+
LexSaleOrderController.ConsumableorderdetailsInfo c3 = new LexSaleOrderController.ConsumableorderdetailsInfo(Orderdet6);
c3.orderdetails1 = Orderdet6;
c3.Prod = Orderdet6.Consumable_product__r;
c3.outboundCount = Orderdet6.Shipment_Count__c;
System.Test.stopTest();
+
}
}
@@ -315,94 +240,44 @@
Account myAccount2;
Account olympus;
User MyUser_Test;
- User thisUser = [SELECT Id FROM User WHERE Id = :UserInfo.getUserId()];
- System.runAs(thisUser) {
- List<RecordType> rectCo = [
- SELECT Id
- FROM RecordType
- WHERE IsActive = TRUE AND SobjectType = 'Account' AND Name = '璨╁2搴�'
- ];
+ User thisUser = [SELECT Id FROM User WHERE Id =:UserInfo.getUserId()];
+ System.runAs(thisUser){
+ List<RecordType> rectCo = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '璨╁2搴�'];
if (rectCo.size() == 0) {
return;
}
- Profile prof = [
- SELECT Id
- FROM Profile
- WHERE Name = '901_缁忛攢鍟嗙ぞ鍖烘櫘閫氭潈闄恄2閲嶉獙璇�(ET)'
- ];
- RecordType hosCo = [
- SELECT Id
- FROM RecordType
- WHERE IsActive = TRUE AND SobjectType = 'Account' AND Name = '鐥呴櫌'
- ];
+ Profile prof = [select Id from Profile where Name ='901_缁忛攢鍟嗙ぞ鍖烘櫘閫氭潈闄恄2閲嶉獙璇�(ET)'];
+ RecordType hosCo = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '鐥呴櫌'];
olympus = new Account(RecordTypeId = hosCo.Id, AgentCode_Ext__c = '9999900', Name = 'olympus');
insert olympus;
- myAccount2 = new Account(Name = 'Testaccount002', Dealer_discount__c = 20, RecordTypeId = rectCo[0].Id);
+ myAccount2 = new Account(Name='Testaccount002',Dealer_discount__c =20,RecordTypeId = rectCo[0].Id);
insert myAccount2;
- Contact core = new Contact(
- email = 'jplumber@salesforce.com',
- firstname = 'Joe',
- lastname = 'Plumber',
- accountid = myAccount2.id
- );
+ Contact core = new Contact(email='jplumber@salesforce.com', firstname='Joe',lastname='Plumber',accountid=myAccount2.id);
insert core;
- MyUser_Test = new User(
- ContactId = core.id,
- Alias = 'newUser',
- Email = 'newuser@testorg.com',
- EmailEncodingKey = 'UTF-8',
- LastName = 'TestUser',
- LanguageLocaleKey = 'zh_CN',
- LocaleSidKey = 'zh_CN',
- ProfileId = prof.Id,
- TimeZoneSidKey = 'Asia/Shanghai',
- UserName = 'testUser@testorg.com',
- UserPro_Type__c = 'ENG',
- Work_Location__c = '澶ц繛'
- );
+ MyUser_Test = New User(ContactId = core.id, Alias = 'newUser', Email='newuser@testorg.com', EmailEncodingKey='UTF-8', LastName='TestUser', LanguageLocaleKey='zh_CN', LocaleSidKey='zh_CN', ProfileId = prof.Id, TimeZoneSidKey='Asia/Shanghai', UserName='testUser@testorg.com', UserPro_Type__c='ENG', Work_Location__c='澶ц繛');
insert MyUser_Test;
}
- System.runAs(MyUser_Test) {
+ system.runAs(MyUser_Test){
String Id = UserInfo.getUserId();
- User thisUserInfo = [
- SELECT accountid, ContactId, Contact.AccountId, Work_Location__c
- FROM User
- WHERE id = :Id
- ];
+ User thisUserInfo = [SELECT accountid,ContactId,Contact.AccountId, Work_Location__c FROM User WHERE id =:Id];
String accountId = thisUserInfo.Contact.AccountId;
String userWorkLocation1 = thisUserInfo.Work_Location__c;
String accountName = myAccount2.Name;
System.debug('accountName = ' + accountName);
System.debug('userWorkLocation1 = ' + userWorkLocation1);
- Product2 prod01 = new Product2(
- Name = 'Test01',
- ProductCode = 'Test01',
- Asset_Model_No__c = 'Test01',
- SFDA_Status__c = '鏈夊姽',
- Dealer_special_Object__c = true,
- Packing_list_manual__c = 12,
- Manual_Entry__c = false
- );
- Product2 prod02 = new Product2(
- Name = 'Test02',
- ProductCode = 'Test02',
- Asset_Model_No__c = 'Test02',
- SFDA_Status__c = '鏈夊姽',
- Dealer_special_Object__c = true,
- Packing_list_manual__c = 12,
- Manual_Entry__c = false
- );
- insert new List<Product2>{ prod01, prod02 };
- Product2__c pro1 = new Product2__c(Name = 'Pro001', OT_CODE_Text__c = 'Test001', Product2__c = prod01.Id);
- Product2__c pro2 = new Product2__c(Name = 'Pro002', OT_CODE_Text__c = 'Test002', Product2__c = prod02.Id);
- insert new List<Product2__c>{ pro1, pro2 };
+ Product2 prod01 = new Product2(Name='Test01',ProductCode='Test01',Asset_Model_No__c = 'Test01',SFDA_Status__c = '鏈夊姽',Dealer_special_Object__c = true,Packing_list_manual__c=12,Manual_Entry__c = false);
+ Product2 prod02 = new Product2(Name='Test02',ProductCode='Test02',Asset_Model_No__c = 'Test02',SFDA_Status__c = '鏈夊姽',Dealer_special_Object__c = true,Packing_list_manual__c=12,Manual_Entry__c = false);
+ insert new Product2[]{prod01,prod02};
+ Product2__c pro1 = new Product2__c(Name='Pro001',OT_CODE_Text__c='Test001',Product2__c = prod01.Id);
+ Product2__c pro2 = new Product2__c(Name='Pro002',OT_CODE_Text__c='Test002',Product2__c = prod02.Id);
+ insert new Product2__c[] {pro1, pro2};
Consumable_order__c Order1 = new Consumable_order__c();
Order1.Name = 'OCM_01_001';
Order1.Order_status__c = '鎵瑰噯';
Order1.Order_type__c = '璁㈠崟';
Order1.RecordTypeid = System.Label.RT_ConOrder_Order;
- Order1.IsShipment__c = true;
+ Order1.IsShipment__c = True;
Order1.OwnerId = MyUser_Test.Id;
insert Order1;
@@ -412,18 +287,18 @@
Order2.Order_type__c = '璁㈠崟';
Order2.RecordTypeid = System.Label.RT_ConOrder_Order;
Order2.Dealer_Info__c = myAccount2.Id;
- Order2.IsShipment__c = true;
+ Order2.IsShipment__c = True;
insert Order2;
-
+
Consumable_order__c Order3 = new Consumable_order__c();
Order3.Name = 'OCM_02_005';
Order3.Order_status__c = '鎵瑰噯';
Order3.Order_type__c = '浼犵エ';
Order3.RecordTypeid = System.Label.RT_ConOrder_Order;
- Order3.Arrive_Order__c = Order1.Id;
+ Order3.Arrive_Order__c= Order1.Id;
Order3.Dealer_Info__c = myAccount2.Id;
- Order3.SummonsForDirction__c = '鐩存帴閿�鍞粰鍖婚櫌';
- Order3.IsShipment__c = true;
+ Order3.SummonsForDirction__c ='鐩存帴閿�鍞粰鍖婚櫌';
+ Order3.IsShipment__c = True;
insert Order3;
Consumable_order_details2__c Orderdet = new Consumable_order_details2__c();
@@ -433,7 +308,7 @@
Orderdet.Consumable_Arrived_order__c = Order1.Id;
Orderdet.Consumable_ZS_order__c = Order3.Id;
Orderdet.Consumable_Return_order__c = Order1.Id;
- Orderdet.Consumable_Sale_order__c = null;
+ Orderdet.Consumable_Sale_order__c =null;
Orderdet.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
Orderdet.RemoveBox_No__c = 3;
Orderdet.Bar_Code__c = '1111111111250AAAAA';
@@ -442,8 +317,8 @@
Orderdet.Box_Piece__c = '鐩�';
Orderdet.Return_date__c = null;
Orderdet.TracingCode__c = '';
- Orderdet.Cancellation_Flag__c = true;
- Orderdet.Sterilization_limit__c = Date.today().addDays(-1);
+ Orderdet.Cancellation_Flag__c = TRUE;
+ Orderdet.Sterilization_limit__c = Date.today().addDays(-1);
//鍙戣揣
Consumable_order_details2__c Orderdet1 = new Consumable_order_details2__c();
Orderdet1.Name = 'OCM_01_001001';
@@ -460,8 +335,8 @@
Orderdet1.Delivery_List_RMB__c = 11.11;
Orderdet1.Box_Piece__c = '涓�';
Orderdet1.TracingCode__c = '';
- Orderdet1.Cancellation_Flag__c = true;
- Orderdet1.Sterilization_limit__c = Date.today().addDays(-1);
+ Orderdet1.Cancellation_Flag__c = TRUE;
+ Orderdet1.Sterilization_limit__c = Date.today().addDays(-1);
//閿�鍞�
Consumable_order_details2__c Orderdet2 = new Consumable_order_details2__c();
Orderdet2.Name = 'OCM_01_001002';
@@ -476,15 +351,15 @@
Orderdet2.Consumable_Product__c = pro1.Id;
Orderdet2.Send_Date__c = null;
Orderdet2.Used_date__c = null;
- Orderdet2.Lose_Flag__c = false;
+ Orderdet2.Lose_Flag__c = FALSE;
Orderdet2.Return_reason__c = null;
Orderdet2.Return_date__c = null;
Orderdet2.Delivery_List_RMB__c = 11;
Orderdet2.Box_Piece__c = '鐩�';
Orderdet2.TracingCode__c = null;
- Orderdet2.Cancellation_Flag__c = true;
+ Orderdet2.Cancellation_Flag__c = TRUE;
Orderdet2.Arrive_date__c = Date.today();
- Orderdet2.Sterilization_limit__c = Date.today().addDays(-1);
+ Orderdet2.Sterilization_limit__c = Date.today().addDays(-1);
//閿�鍞�
Consumable_order_details2__c Orderdet9 = new Consumable_order_details2__c();
Orderdet9.Name = 'OCM_01_001002';
@@ -508,8 +383,8 @@
Orderdet3.Consumable_Product__c = pro1.Id;
Orderdet3.Send_Date__c = Date.today();
Orderdet3.Box_Piece__c = '鐩�';
- Orderdet3.Return_date__c = null;
- Orderdet3.Lose_Flag__c = true;
+ Orderdet3.Return_date__c= null;
+ Orderdet3.Lose_Flag__c = True;
Orderdet3.TracingCode__c = 'EEEEE';
//鍒拌揣
@@ -518,7 +393,7 @@
Orderdet4.Consumable_order_minor__c = null;
Orderdet4.Consumable_Sale_order__c = null;
Orderdet4.Consumable_ZS_order__c = Order1.Id;
- Orderdet4.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
+ Orderdet4.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery ;
Orderdet4.Consumable_Arrived_order__c = Order1.Id;
Orderdet4.Sterilization_limit__c = Date.today().addDays(-1);
Orderdet4.Bar_Code__c = '6666666666250FFFFF';
@@ -548,7 +423,7 @@
Orderdet6.Consumable_Product__c = pro1.Id;
Orderdet6.Arrive_date__c = Date.today();
Orderdet6.RemoveBox_No__c = 3;
- Orderdet6.Sterilization_limit__c = Date.today().addDays(-2);
+ Orderdet6.Sterilization_limit__c = Date.today().addDays(-2);
Orderdet6.TracingCode__c = 'HHHHH';
hospitalprice__c hp1 = new hospitalprice__c();
@@ -556,17 +431,15 @@
hp1.account__c = accountId;
hp1.product__c = pro1.Id;
insert hp1;
-
+
List<Consumable_order_details2__c> newdet2 = new List<Consumable_order_details2__c>();
newdet2.add(Orderdet);
insert newdet2;
- insert new List<Consumable_order_details2__c>{ Orderdet1, Orderdet2, Orderdet3, Orderdet4, Orderdet5, Orderdet6, Orderdet9 };
+ insert new Consumable_order_details2__c[] {Orderdet1,Orderdet2,Orderdet3,Orderdet4,Orderdet5,Orderdet6,Orderdet9};
- List<Consumable_order_details2__c> cod2 = [
- SELECT Id, Arrive_Owner_Work_Location__c
- FROM Consumable_order_details2__c
- WHERE Id = :Orderdet.Id
- ];
+ List<Consumable_order_details2__c> cod2 = [SELECT Id,Arrive_Owner_Work_Location__c
+ FROM Consumable_order_details2__c
+ WHERE Id =: Orderdet.Id];
System.debug('cod2:' + cod2);
String userWorkLocation = cod2[0].Arrive_Owner_Work_Location__c;
System.debug('userWorkLocation:' + userWorkLocation);
@@ -579,71 +452,29 @@
String key = '';
orderpieceorboxMap = new Map<String, String>();
List<Consumable_orderdetails__c> orderdetails = new List<Consumable_orderdetails__c>();
- LexSaleOrderController.SearchPro(Order1, barcode1, accountName, userWorkLocation, accountId, orderdetails, orderpieceorboxMap);
+ LexSaleOrderController.SearchPro(Order1,barcode1,accountName,userWorkLocation,accountId,orderdetails,orderpieceorboxMap);
String barcode = '1111111111250AAAAA\n2222222222250BBBBB\n3333333333250CCCCC\n4444444444250DDDDD\n5555555555250EEEEE\n6666666666250FFFFF\n7777777777250GGGGG\n8888888888250HHHHH';
- LexSaleOrderController.SearchPro(Order2, barcode, accountName, userWorkLocation, accountId, orderdetails, orderpieceorboxMap);
+ LexSaleOrderController.SearchPro(Order2,barcode,accountName,userWorkLocation,accountId,orderdetails,orderpieceorboxMap);
String barcode2 = '111111111250AAAAA';
- LexSaleOrderController.SearchPro(Order2, barcode2, accountName, userWorkLocation, accountId, orderdetails, orderpieceorboxMap);
- LexSaleOrderController.ProdElivery(
- ESetId,
- Order2,
- barcode2,
- accountName,
- userWorkLocation,
- JSON.serialize(LexSaleOrderController.consumableorderdetailsRecords),
- orderdetails,
- orderpriceMap,
- orderagencypriceMap
- );
- LexSaleOrderController.ProSale(
- ESetId,
- Order2,
- barcode2,
- accountName,
- userWorkLocation,
- JSON.serialize(LexSaleOrderController.consumableorderdetailsRecords),
- orderdetails,
- orderpriceMap,
- orderagencypriceMap
- );
+ LexSaleOrderController.SearchPro(Order2,barcode2,accountName,userWorkLocation,accountId,orderdetails,orderpieceorboxMap);
+ LexSaleOrderController.ProdElivery(ESetId,Order2,barcode2,accountName,userWorkLocation,JSON.serialize(LexSaleOrderController.consumableorderdetailsRecords),orderdetails,orderpriceMap,orderagencypriceMap);
+ LexSaleOrderController.ProSale(ESetId,Order2,barcode2,accountName,userWorkLocation,JSON.serialize(LexSaleOrderController.consumableorderdetailsRecords),orderdetails,orderpriceMap,orderagencypriceMap);
String barcode3 = '3333333333250CCCCC';
- LexSaleOrderController.SearchPro(Order3, barcode3, accountName, userWorkLocation, accountId, orderdetails, orderpieceorboxMap);
- LexSaleOrderController.ProdElivery(
- ESetId,
- Order3,
- barcode3,
- accountName,
- userWorkLocation,
- JSON.serialize(LexSaleOrderController.consumableorderdetailsRecords),
- orderdetails,
- orderpriceMap,
- orderagencypriceMap
- );
- LexSaleOrderController.ProSale(
- ESetId,
- Order3,
- barcode3,
- accountName,
- userWorkLocation,
- JSON.serialize(LexSaleOrderController.consumableorderdetailsRecords),
- orderdetails,
- orderpriceMap,
- orderagencypriceMap
- );
+ LexSaleOrderController.SearchPro(Order3,barcode3,accountName,userWorkLocation,accountId,orderdetails,orderpieceorboxMap);
+ LexSaleOrderController.ProdElivery(ESetId,Order3,barcode3,accountName,userWorkLocation,JSON.serialize(LexSaleOrderController.consumableorderdetailsRecords),orderdetails,orderpriceMap,orderagencypriceMap);
+ LexSaleOrderController.ProSale(ESetId,Order3,barcode3,accountName,userWorkLocation,JSON.serialize(LexSaleOrderController.consumableorderdetailsRecords),orderdetails,orderpriceMap,orderagencypriceMap);
LexSaleOrderController.Getconsumableorderdetails2Nobox();
-
+
List<LexSaleOrderController.ConsumableorderdetailsInfo> inList = LexSaleOrderController.consumableorderdetailsRecords;
- List<LexSaleOrderController.ConsumableorderdetailsInfo> inList1 = new List<LexSaleOrderController.ConsumableorderdetailsInfo>();
- for (LexSaleOrderController.ConsumableorderdetailsInfo ass : inList) {
- ass.orderdetails2 = Orderdet1;
+ List<LexSaleOrderController.ConsumableorderdetailsInfo> inList1 = new List<LexSaleOrderController.ConsumableorderdetailsInfo>();
+ for(LexSaleOrderController.ConsumableorderdetailsInfo ass: inList){
+ ass.orderdetails2= Orderdet1;
inList1.add(ass);
}
+
String errorReason = 'success';
- LexSaleOrderController.ConsumableorderdetailsInfo c2 = new LexSaleOrderController.ConsumableorderdetailsInfo(
- Orderdet1,
- errorReason
- );
+ LexSaleOrderController.ConsumableorderdetailsInfo c2 = new LexSaleOrderController.ConsumableorderdetailsInfo(Orderdet1,errorReason);
c2.orderdetails1 = null;
c2.orderdetails2 = Orderdet1;
c2.Prod = Orderdet1.Consumable_product__r;
@@ -657,94 +488,45 @@
c1.oldConsumableCount = Orderdet2.Name;
c1.compareTo(c2);
System.Test.stopTest();
+
}
}
@isTest
static void testProSale() {
StaticParameter.EscapeConsumableOrderDetail2Trigger = true;
- List<RecordType> rectCo = [
- SELECT Id
- FROM RecordType
- WHERE IsActive = TRUE AND SobjectType = 'Account' AND Name = '璨╁2搴�'
- ];
+ List<RecordType> rectCo = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '璨╁2搴�'];
if (rectCo.size() == 0) {
return;
}
- Profile prof = [
- SELECT Id
- FROM Profile
- WHERE Name = '901_缁忛攢鍟嗙ぞ鍖烘櫘閫氭潈闄恄2閲嶉獙璇�(ET)'
- ];
- RecordType hosCo = [
- SELECT Id
- FROM RecordType
- WHERE IsActive = TRUE AND SobjectType = 'Account' AND Name = '鐥呴櫌'
- ];
+ Profile prof = [select Id from Profile where Name ='901_缁忛攢鍟嗙ぞ鍖烘櫘閫氭潈闄恄2閲嶉獙璇�(ET)'];
+ RecordType hosCo = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '鐥呴櫌'];
Account olympus = new Account(RecordTypeId = hosCo.Id, AgentCode_Ext__c = '9999900', Name = 'olympus');
insert olympus;
- Account myAccount2 = new Account(name = 'Testaccount002', Dealer_discount__c = 20, RecordTypeId = rectCo[0].Id);
+ Account myAccount2 = new Account(name='Testaccount002',Dealer_discount__c =20,RecordTypeId = rectCo[0].Id);
insert myAccount2;
- Contact core = new Contact(email = 'jplumber@salesforce.com', firstname = 'Joe', lastname = 'Plumber', accountid = myAccount2.id);
+ Contact core = new Contact(email='jplumber@salesforce.com', firstname='Joe',lastname='Plumber',accountid=myAccount2.id);
insert core;
- user MyUser_Test = new User(
- ContactId = core.id,
- Alias = 'newUser',
- Email = 'newuser@testorg.com',
- EmailEncodingKey = 'UTF-8',
- LastName = 'TestUser',
- LanguageLocaleKey = 'zh_CN',
- LocaleSidKey = 'zh_CN',
- ProfileId = prof.Id,
- TimeZoneSidKey = 'Asia/Shanghai',
- UserName = 'testUser@testorg.com',
- UserPro_Type__c = 'ENG',
- Work_Location__c = '澶ц繛'
- );
- System.runAs(new User(Id = UserInfo.getUserId())) {
+ user MyUser_Test = New User(ContactId = core.id, Alias = 'newUser', Email='newuser@testorg.com', EmailEncodingKey='UTF-8', LastName='TestUser', LanguageLocaleKey='zh_CN', LocaleSidKey='zh_CN', ProfileId = prof.Id, TimeZoneSidKey='Asia/Shanghai', UserName='testUser@testorg.com', UserPro_Type__c='ENG', Work_Location__c='澶ц繛');
+ System.runAs(new User(Id = UserInfo.getUserId())){
insert MyUser_Test;
}
- System.runAs(MyUser_Test) {
+ system.runAs(MyUser_Test){
String Id = UserInfo.getUserId();
- User thisUserInfo = [
- SELECT accountid, ContactId, Contact.AccountId, Work_Location__c
- FROM User
- WHERE id = :Id
- ];
+ User thisUserInfo = [SELECT accountid,ContactId,Contact.AccountId, Work_Location__c FROM User WHERE id =:Id];
String accountId = thisUserInfo.Contact.AccountId;
String userWorkLocation = thisUserInfo.Work_Location__c;
String accountName;
- Account[] accountInfo = [
- SELECT Name
- FROM account
- WHERE id = :accountId
- LIMIT 1
- ];
- if (accountInfo.size() > 0) {
+ Account[] accountInfo = [SELECT Name FROM account WHERE id = :accountId LIMIT 1];
+ if(accountInfo.size() > 0 ){
accountName = accountInfo[0].Name;
}
- Product2 prod01 = new Product2(
- Name = 'Test01',
- ProductCode = 'Test01',
- Asset_Model_No__c = 'Test01',
- SFDA_Status__c = '鏈夊姽',
- Dealer_special_Object__c = true,
- Packing_list_manual__c = 12,
- Manual_Entry__c = false
- );
- Product2 prod02 = new Product2(
- Name = 'Test02',
- ProductCode = 'Test02',
- Asset_Model_No__c = 'Test02',
- SFDA_Status__c = '鏈夊姽',
- Dealer_special_Object__c = true,
- Packing_list_manual__c = 12,
- Manual_Entry__c = false
- );
- insert new List<Product2>{ prod01, prod02 };
- Product2__c pro1 = new Product2__c(Name = 'Pro001', OT_CODE_Text__c = 'Test001', Product2__c = prod01.Id);
- Product2__c pro2 = new Product2__c(Name = 'Pro002', OT_CODE_Text__c = 'Test002', Product2__c = prod02.Id);
- insert new List<Product2__c>{ pro1, pro2 };
+ Product2 prod01 = new Product2(Name='Test01',ProductCode='Test01',Asset_Model_No__c = 'Test01',SFDA_Status__c = '鏈夊姽',Dealer_special_Object__c = true,Packing_list_manual__c=12,Manual_Entry__c = false);
+ Product2 prod02 = new Product2(Name='Test02',ProductCode='Test02',Asset_Model_No__c = 'Test02',SFDA_Status__c = '鏈夊姽',Dealer_special_Object__c = true,Packing_list_manual__c=12,Manual_Entry__c = false);
+ insert new Product2[]{prod01,prod02};
+ Product2__c pro1 = new Product2__c(Name='Pro001',OT_CODE_Text__c='Test001',Product2__c = prod01.Id);
+ Product2__c pro2 = new Product2__c(Name='Pro002',OT_CODE_Text__c='Test002',Product2__c = prod02.Id);
+ insert new Product2__c[] {pro1, pro2};
Consumable_order__c Order1 = new Consumable_order__c();
Order1.Name = 'OCM_01_001';
@@ -752,26 +534,26 @@
Order1.Order_type__c = '璁㈠崟';
Order1.RecordTypeid = System.Label.RT_ConOrder_Order;
Order1.Dealer_Info__c = myAccount2.Id;
- Order1.IsShipment__c = true;
- insert Order1;
-
+ Order1.IsShipment__c = True;
+ insert Order1;
+
Consumable_order__c Order3 = new Consumable_order__c();
Order3.Name = 'OCM_02_005';
Order3.Order_status__c = '鎵瑰噯';
Order3.Order_type__c = '浼犵エ';
Order3.RecordTypeid = System.Label.RT_ConOrder_Order;
- Order3.Arrive_Order__c = Order1.Id;
+ Order3.Arrive_Order__c = Order1.Id;
Order3.Dealer_Info__c = myAccount2.Id;
- Order3.SummonsForDirction__c = '鐩存帴閿�鍞粰鍖婚櫌';
- Order3.IsShipment__c = true;
+ Order3.SummonsForDirction__c ='鐩存帴閿�鍞粰鍖婚櫌';
+ Order3.IsShipment__c = True;
insert Order3;
-
+
List<Consumable_orderdetails__c> orderdetails = new List<Consumable_orderdetails__c>();
//鏄庣粏1
Consumable_orderdetails__c conOrder1 = new Consumable_orderdetails__c();
conOrder1.Name = 'OCM_01_001001';
conOrder1.Consumable_order__c = Order1.Id;
- conOrder1.RecordTypeId = System.Label.RT_ConOrderDetail1_Order;
+ conOrder1.RecordTypeId = System.Label.RT_ConOrderDetail1_Order ;
conOrder1.Consumable_Count__c = 12;
conOrder1.Consumable_Product__c = pro1.Id;
conOrder1.Delivery_List_RMB__c = 1;
@@ -781,7 +563,7 @@
Consumable_orderdetails__c conOrder2 = new Consumable_orderdetails__c();
conOrder2.Name = 'OCM_01_001002';
conOrder2.Consumable_order__c = Order1.Id;
- conOrder2.RecordTypeId = System.Label.RT_ConOrderDetail1_Order;
+ conOrder2.RecordTypeId = System.Label.RT_ConOrderDetail1_Order ;
conOrder2.Consumable_Count__c = 12;
conOrder2.Consumable_Product__c = pro1.Id;
conOrder2.Delivery_List_RMB__c = 1;
@@ -807,8 +589,8 @@
Orderdet.Box_Piece__c = '鐩�';
Orderdet.Return_date__c = null;
Orderdet.TracingCode__c = '';
- Orderdet.Cancellation_Flag__c = true;
- Orderdet.Sterilization_limit__c = Date.today().addDays(-1);
+ Orderdet.Cancellation_Flag__c = TRUE;
+ Orderdet.Sterilization_limit__c = Date.today().addDays(-1);
//鍙戣揣
Consumable_order_details2__c Orderdet1 = new Consumable_order_details2__c();
@@ -826,8 +608,8 @@
Orderdet1.Delivery_List_RMB__c = 11.11;
Orderdet1.Box_Piece__c = '涓�';
Orderdet1.TracingCode__c = '';
- Orderdet1.Cancellation_Flag__c = true;
- Orderdet1.Sterilization_limit__c = Date.today().addDays(-1);
+ Orderdet1.Cancellation_Flag__c = TRUE;
+ Orderdet1.Sterilization_limit__c = Date.today().addDays(-1);
//閿�鍞�
Consumable_order_details2__c Orderdet2 = new Consumable_order_details2__c();
Orderdet2.Name = 'OCM_01_001002';
@@ -842,15 +624,15 @@
Orderdet2.Consumable_Product__c = pro1.Id;
Orderdet2.Send_Date__c = null;
Orderdet2.Used_date__c = null;
- Orderdet2.Lose_Flag__c = false;
+ Orderdet2.Lose_Flag__c = FALSE;
Orderdet2.Return_reason__c = null;
Orderdet2.Return_date__c = null;
Orderdet2.Delivery_List_RMB__c = 11;
Orderdet2.Box_Piece__c = '鐩�';
Orderdet2.TracingCode__c = null;
- Orderdet2.Cancellation_Flag__c = true;
+ Orderdet2.Cancellation_Flag__c = TRUE;
Orderdet2.Arrive_date__c = Date.today();
- Orderdet2.Sterilization_limit__c = Date.today().addDays(-1);
+ Orderdet2.Sterilization_limit__c = Date.today().addDays(-1);
//閿�鍞�
Consumable_order_details2__c Orderdet9 = new Consumable_order_details2__c();
Orderdet9.Name = 'OCM_01_001002';
@@ -875,14 +657,14 @@
Orderdet3.Consumable_Product__c = pro1.Id;
Orderdet3.Send_Date__c = Date.today();
Orderdet3.Box_Piece__c = '鐩�';
- Orderdet3.Return_date__c = null;
- Orderdet3.Lose_Flag__c = true;
+ Orderdet3.Return_date__c= null;
+ Orderdet3.Lose_Flag__c = True;
Orderdet3.TracingCode__c = 'EEEEE';
List<Consumable_order_details2__c> newdet2 = new List<Consumable_order_details2__c>();
newdet2.add(Orderdet);
insert newdet2;
- insert new List<Consumable_order_details2__c>{ Orderdet1, Orderdet2, Orderdet3, Orderdet9 };
+ insert new Consumable_order_details2__c[] {Orderdet1,Orderdet2,Orderdet3,Orderdet9};
Map<String, object> data = new Map<String, object>();
String ESetId = Order3.Id;
@@ -893,44 +675,22 @@
Integer i = 0;
Decimal a = 0;
orderpieceorboxMap = new Map<String, String>();
- LexSaleOrderController.SearchPro(Order1, barcode1, accountName, userWorkLocation, accountId, orderdetails, orderpieceorboxMap);
+ LexSaleOrderController.SearchPro(Order1,barcode1,accountName,userWorkLocation,accountId,orderdetails,orderpieceorboxMap);
String barcode = '1111111111250AAAAA\n2222222222250BBBBB\n3333333333250CCCCC\n4444444444250DDDDD\n5555555555250EEEEE';
- LexSaleOrderController.SearchPro(Order3, barcode, accountName, userWorkLocation, accountId, orderdetails, orderpieceorboxMap);
- LexSaleOrderController.ProdElivery(
- ESetId,
- Order3,
- barcode,
- accountName,
- userWorkLocation,
- JSON.serialize(LexSaleOrderController.consumableorderdetailsRecords),
- orderdetails,
- orderpriceMap,
- orderagencypriceMap
- );
- LexSaleOrderController.ProSale(
- ESetId,
- Order3,
- barcode,
- accountName,
- userWorkLocation,
- JSON.serialize(LexSaleOrderController.consumableorderdetailsRecords),
- orderdetails,
- orderpriceMap,
- orderagencypriceMap
- );
-
+ LexSaleOrderController.SearchPro(Order3,barcode,accountName,userWorkLocation,accountId,orderdetails,orderpieceorboxMap);
+ LexSaleOrderController.ProdElivery(ESetId,Order3,barcode,accountName,userWorkLocation,JSON.serialize(LexSaleOrderController.consumableorderdetailsRecords),orderdetails,orderpriceMap,orderagencypriceMap);
+ LexSaleOrderController.ProSale(ESetId,Order3,barcode,accountName,userWorkLocation,JSON.serialize(LexSaleOrderController.consumableorderdetailsRecords),orderdetails,orderpriceMap,orderagencypriceMap);
+
+
List<LexSaleOrderController.ConsumableorderdetailsInfo> inList = LexSaleOrderController.consumableorderdetailsRecords;
- List<LexSaleOrderController.ConsumableorderdetailsInfo> inList1 = new List<LexSaleOrderController.ConsumableorderdetailsInfo>();
- for (LexSaleOrderController.ConsumableorderdetailsInfo ass : inList) {
- ass.orderdetails2 = Orderdet1;
+ List<LexSaleOrderController.ConsumableorderdetailsInfo> inList1 = new List<LexSaleOrderController.ConsumableorderdetailsInfo>();
+ for(LexSaleOrderController.ConsumableorderdetailsInfo ass: inList){
+ ass.orderdetails2= Orderdet1;
inList1.add(ass);
}
String errorReason = 'success';
- LexSaleOrderController.ConsumableorderdetailsInfo c2 = new LexSaleOrderController.ConsumableorderdetailsInfo(
- Orderdet1,
- errorReason
- );
+ LexSaleOrderController.ConsumableorderdetailsInfo c2 = new LexSaleOrderController.ConsumableorderdetailsInfo(Orderdet1,errorReason);
c2.orderdetails1 = null;
c2.orderdetails2 = Orderdet1;
c2.Prod = Orderdet1.Consumable_product__r;
@@ -944,103 +704,47 @@
c1.oldConsumableCount = Orderdet2.Name;
c1.compareTo(c2);
System.Test.stopTest();
+
}
}
@isTest
static void testProdError() {
- List<RecordType> rectCo = [
- SELECT Id
- FROM RecordType
- WHERE IsActive = TRUE AND SobjectType = 'Account' AND Name = '璨╁2搴�'
- ];
+ List<RecordType> rectCo = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '璨╁2搴�'];
if (rectCo.size() == 0) {
return;
}
- Profile prof = [
- SELECT Id
- FROM Profile
- WHERE Name = '901_缁忛攢鍟嗙ぞ鍖烘櫘閫氭潈闄恄2閲嶉獙璇�(ET)'
- ];
- RecordType hosCo = [
- SELECT Id
- FROM RecordType
- WHERE IsActive = TRUE AND SobjectType = 'Account' AND Name = '鐥呴櫌'
- ];
+ Profile prof = [select Id from Profile where Name ='901_缁忛攢鍟嗙ぞ鍖烘櫘閫氭潈闄恄2閲嶉獙璇�(ET)'];
+ RecordType hosCo = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '鐥呴櫌'];
Account olympus = new Account(RecordTypeId = hosCo.Id, AgentCode_Ext__c = '9999900', Name = 'olympus');
insert olympus;
- Account myAccount2 = new Account(name = 'Testaccount002', Dealer_discount__c = 20, RecordTypeId = rectCo[0].Id);
+ Account myAccount2 = new Account(name='Testaccount002',Dealer_discount__c =20,RecordTypeId = rectCo[0].Id);
insert myAccount2;
- Contact core = new Contact(email = 'jplumber@salesforce.com', firstname = 'Joe', lastname = 'Plumber', accountid = myAccount2.id);
+ Contact core = new Contact(email='jplumber@salesforce.com', firstname='Joe',lastname='Plumber',accountid=myAccount2.id);
insert core;
- user MyUser_Test = new User(
- ContactId = core.id,
- Alias = 'newUser',
- Email = 'newuser@testorg.com',
- EmailEncodingKey = 'UTF-8',
- LastName = 'TestUser',
- LanguageLocaleKey = 'zh_CN',
- LocaleSidKey = 'zh_CN',
- ProfileId = prof.Id,
- TimeZoneSidKey = 'Asia/Shanghai',
- UserName = 'testUser@testorg.com',
- Work_Location__c = '澶ц繛'
- );
- System.runAs(new User(Id = UserInfo.getUserId())) {
+ user MyUser_Test = New User(ContactId = core.id,Alias = 'newUser',Email='newuser@testorg.com',EmailEncodingKey='UTF-8', LastName='TestUser', LanguageLocaleKey='zh_CN',LocaleSidKey='zh_CN', ProfileId = prof.Id,TimeZoneSidKey='Asia/Shanghai', UserName='testUser@testorg.com', Work_Location__c='澶ц繛');
+ System.runAs(new User(Id = UserInfo.getUserId())){
insert MyUser_Test;
}
//璁㈠崟
- System.runAs(MyUser_Test) {
+ system.runAs(MyUser_Test){
String Id = UserInfo.getUserId();
- User thisUserInfo = [
- SELECT accountid, ContactId, Contact.AccountId, Work_Location__c
- FROM User
- WHERE id = :Id
- ];
+ User thisUserInfo = [SELECT accountid,ContactId,Contact.AccountId, Work_Location__c FROM User WHERE id =:Id];
String accountId = thisUserInfo.Contact.AccountId;
String userWorkLocation = thisUserInfo.Work_Location__c;
String accountName;
- Account[] accountInfo = [
- SELECT Name
- FROM account
- WHERE id = :accountId
- LIMIT 1
- ];
- if (accountInfo.size() > 0) {
+ Account[] accountInfo = [SELECT Name FROM account WHERE id = :accountId LIMIT 1];
+ if(accountInfo.size() > 0 ){
accountName = accountInfo[0].Name;
}
- Product2 prod01 = new Product2(
- Name = 'Test01',
- ProductCode = 'Test01',
- Asset_Model_No__c = 'Test01',
- SFDA_Status__c = '鏈夊姽',
- Dealer_special_Object__c = true,
- Packing_list_manual__c = 12,
- Manual_Entry__c = false
- );
- Product2 prod02 = new Product2(
- Name = 'Test02',
- ProductCode = 'Test02',
- Asset_Model_No__c = 'Test02',
- SFDA_Status__c = '鏈夊姽',
- Dealer_special_Object__c = true,
- Packing_list_manual__c = 12,
- Manual_Entry__c = false
- );
- Product2 prod03 = new Product2(
- Name = 'Test03',
- ProductCode = 'Test03',
- Asset_Model_No__c = 'Test03',
- SFDA_Status__c = '鏈夊姽',
- Dealer_special_Object__c = true,
- Packing_list_manual__c = 12,
- Manual_Entry__c = false
- );
- insert new List<Product2>{ prod01, prod02, prod03 };
- Product2__c pro1 = new Product2__c(Name = 'Pro001', OT_CODE_Text__c = 'Test001', Product2__c = prod01.Id);
- Product2__c pro2 = new Product2__c(Name = 'Pro002', OT_CODE_Text__c = 'Test002', Product2__c = prod02.Id);
- Product2__c pro3 = new Product2__c(Name = 'Pro003', OT_CODE_Text__c = 'Test003', Product2__c = prod03.Id);
- insert new List<Product2__c>{ pro1, pro2, pro3 };
+ Product2 prod01 = new Product2(Name='Test01',ProductCode='Test01',Asset_Model_No__c = 'Test01',SFDA_Status__c = '鏈夊姽',Dealer_special_Object__c = true,Packing_list_manual__c=12,Manual_Entry__c = false);
+ Product2 prod02 = new Product2(Name='Test02',ProductCode='Test02',Asset_Model_No__c = 'Test02',SFDA_Status__c = '鏈夊姽',Dealer_special_Object__c = true,Packing_list_manual__c=12,Manual_Entry__c = false);
+ Product2 prod03 = new Product2(Name='Test03',ProductCode='Test03',Asset_Model_No__c = 'Test03',SFDA_Status__c = '鏈夊姽',Dealer_special_Object__c = true,Packing_list_manual__c=12,Manual_Entry__c = false);
+ insert new Product2[]{prod01,prod02,prod03};
+ Product2__c pro1 = new Product2__c(Name='Pro001',OT_CODE_Text__c='Test001',Product2__c = prod01.Id);
+ Product2__c pro2 = new Product2__c(Name='Pro002',OT_CODE_Text__c='Test002',Product2__c = prod02.Id);
+ Product2__c pro3 = new Product2__c(Name='Pro003',OT_CODE_Text__c='Test003',Product2__c = prod03.Id);
+ insert new Product2__c[] {pro1, pro2,pro3};
//鍑哄簱鍗�
Consumable_order__c Order1 = new Consumable_order__c();
Order1.Name = 'OCM_01_001';
@@ -1048,7 +752,7 @@
Order1.Order_type__c = '浼犵エ';
Order1.RecordTypeid = System.Label.RT_ConOrder_Order;
Order1.Dealer_Info__c = myAccount2.Id;
- Order1.SummonsForDirction__c = '鐩存帴閿�鍞粰鍖婚櫌';
+ Order1.SummonsForDirction__c ='鐩存帴閿�鍞粰鍖婚櫌';
Order1.IsShipment__c = true;
insert Order1;
@@ -1057,7 +761,7 @@
Consumable_orderdetails__c Orderdet1 = new Consumable_orderdetails__c();
Orderdet1.Name = 'OCM_01_001001';
Orderdet1.Consumable_order__c = Order1.Id;
- Orderdet1.RecordTypeId = System.Label.RT_ConOrderDetail1_Order;
+ Orderdet1.RecordTypeId = System.Label.RT_ConOrderDetail1_Order ;
Orderdet1.Consumable_Count__c = 12;
Orderdet1.Consumable_Product__c = pro1.Id;
Orderdet1.Unitprice_To_agency__c = 1;
@@ -1067,7 +771,7 @@
Consumable_orderdetails__c Orderdet2 = new Consumable_orderdetails__c();
Orderdet2.Name = 'OCM_01_001002';
Orderdet2.Consumable_order__c = Order1.Id;
- Orderdet2.RecordTypeId = System.Label.RT_ConOrderDetail1_Order;
+ Orderdet2.RecordTypeId = System.Label.RT_ConOrderDetail1_Order ;
Orderdet2.Consumable_Count__c = 12;
Orderdet2.Consumable_Product__c = pro2.Id;
Orderdet2.Unitprice_To_agency__c = 1;
@@ -1077,51 +781,51 @@
orderdetails.add(Orderdet1);
orderdetails.add(Orderdet2);
insert orderdetails;
-
+
//鏄庣粏2
Consumable_order_details2__c Orderdets1 = new Consumable_order_details2__c();
Orderdets1.Name = 'OCM_01_0010001';
Orderdets1.Consumable_order_minor__c = Order1.Id;
Orderdets1.Consumable_ZS_order__c = Order1.Id;
Orderdets1.Consumable_Return_order__c = null;
- Orderdets1.Consumable_Sale_order__c = null;
+ Orderdets1.Consumable_Sale_order__c =null;
Orderdets1.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
Orderdets1.Bar_Code__c = '11111250AAAAA';
Orderdets1.Consumable_Product__c = pro1.Id;
Orderdets1.Arrive_date__c = Date.today();
- Orderdets1.Return_date__c = null;
+ Orderdets1.Return_date__c= null;
Orderdets1.RemoveBox_No__c = 3;
Orderdets1.Delivery_List_RMB__c = 11.11;
Orderdets1.Box_Piece__c = '鐩�';
Orderdets1.Sterilization_limit__c = Date.today().addDays(-1);
Orderdets1.TracingCode__c = 'AAAAA';
-
+
Consumable_order_details2__c Orderdets2 = new Consumable_order_details2__c();
Orderdets2.Name = 'OCM_01_0010002';
Orderdets2.Consumable_Return_order__c = null;
- Orderdets2.Consumable_Sale_order__c = null;
+ Orderdets2.Consumable_Sale_order__c =null;
Orderdets2.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
Orderdets2.Bar_Code__c = '22222250BBBBB';
Orderdets2.Consumable_Product__c = pro2.Id;
Orderdets2.Arrive_date__c = Date.today();
- Orderdets2.Return_date__c = null;
+ Orderdets2.Return_date__c= null;
Orderdets2.RemoveBox_No__c = 3;
Orderdets2.Delivery_List_RMB__c = 11.11;
Orderdets2.Box_Piece__c = '涓�';
Orderdets2.Sterilization_limit__c = Date.today().addDays(-1);
Orderdets2.TracingCode__c = '';
-
+
Consumable_order_details2__c Orderdets3 = new Consumable_order_details2__c();
Orderdets3.Name = 'OCM_01_0010003';
Orderdets3.Consumable_order_minor__c = Order1.Id;
Orderdets3.Consumable_ZS_order__c = Order1.Id;
Orderdets3.Consumable_Return_order__c = null;
- Orderdets2.Consumable_Sale_order__c = null;
+ Orderdets2.Consumable_Sale_order__c =null;
Orderdets3.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
Orderdets3.Bar_Code__c = '33333250CCCCC';
Orderdets3.Consumable_Product__c = pro3.Id;
Orderdets3.Arrive_date__c = Date.today();
- Orderdets3.Return_date__c = null;
+ Orderdets3.Return_date__c= null;
Orderdets3.RemoveBox_No__c = 3;
Orderdets3.Delivery_List_RMB__c = 11.11;
Orderdets3.Box_Piece__c = '鐩�';
@@ -1133,11 +837,11 @@
Orderdets4.Consumable_order_minor__c = Order1.Id;
Orderdets4.Consumable_ZS_order__c = Order1.Id;
Orderdets4.Consumable_Return_order__c = null;
- Orderdets4.Consumable_Sale_order__c = null;
+ Orderdets4.Consumable_Sale_order__c =null;
Orderdets4.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
Orderdets4.Bar_Code__c = '44444250DDDDD';
Orderdets4.Arrive_date__c = Date.today();
- Orderdets4.Return_date__c = null;
+ Orderdets4.Return_date__c= null;
Orderdets4.Consumable_Product__c = pro1.Id;
Orderdets4.Delivery_List_RMB__c = 11.11;
Orderdets4.RemoveBox_No__c = 3;
@@ -1153,7 +857,7 @@
Orderdets5.Bar_Code__c = '33333250EEEEE';
Orderdets5.Consumable_Product__c = pro3.Id;
Orderdets5.Arrive_date__c = Date.today();
- Orderdets5.Return_date__c = null;
+ Orderdets5.Return_date__c= null;
Orderdets5.RemoveBox_No__c = 3;
Orderdets5.Delivery_List_RMB__c = 11.11;
Orderdets5.Box_Piece__c = '涓�';
@@ -1163,7 +867,7 @@
List<Consumable_order_details2__c> newdet2 = new List<Consumable_order_details2__c>();
newdet2.add(Orderdets1);
insert newdet2;
- insert new List<Consumable_order_details2__c>{ Orderdets2, Orderdets3, Orderdets4, Orderdets5 };
+ insert new Consumable_order_details2__c[] {Orderdets2,Orderdets3,Orderdets4,Orderdets5};
List<String> barCodeListP = new List<String>();
Map<String, object> data = new Map<String, object>();
@@ -1178,101 +882,39 @@
String key = '';
Integer idx = 0;
orderpieceorboxMap = new Map<String, String>();
- LexSaleOrderController.SearchPro(Order1, barcode, accountName, userWorkLocation, accountId, orderdetails, orderpieceorboxMap);
- LexSaleOrderController.ProdElivery(
- ESetId,
- Order1,
- barcode,
- accountName,
- userWorkLocation,
- JSON.serialize(LexSaleOrderController.consumableorderdetailsRecords),
- orderdetails,
- orderpriceMap,
- orderagencypriceMap
- );
- LexSaleOrderController.ProSale(
- ESetId,
- Order1,
- barcode,
- accountName,
- userWorkLocation,
- JSON.serialize(LexSaleOrderController.consumableorderdetailsRecords),
- orderdetails,
- orderpriceMap,
- orderagencypriceMap
- );
-
+ LexSaleOrderController.SearchPro(Order1,barcode,accountName,userWorkLocation,accountId,orderdetails,orderpieceorboxMap);
+ LexSaleOrderController.ProdElivery(ESetId,Order1,barcode,accountName,userWorkLocation,JSON.serialize(LexSaleOrderController.consumableorderdetailsRecords),orderdetails,orderpriceMap,orderagencypriceMap);
+ LexSaleOrderController.ProSale(ESetId,Order1,barcode,accountName,userWorkLocation,JSON.serialize(LexSaleOrderController.consumableorderdetailsRecords),orderdetails,orderpriceMap,orderagencypriceMap);
+
System.Test.stopTest();
}
}
@isTest
static void searchTest1() {
- List<RecordType> rectCo = [
- SELECT Id
- FROM RecordType
- WHERE IsActive = TRUE AND SobjectType = 'Account' AND Name = '璨╁2搴�'
- ];
- if (rectCo.size() == 0) {
- return;
- }
- Profile prof = [
- SELECT Id
- FROM Profile
- WHERE Name = '901_缁忛攢鍟嗙ぞ鍖烘櫘閫氭潈闄恄2閲嶉獙璇�(ET)'
- ];
- Account myAccount2 = new Account(
- name = 'Testaccount002',
- Dealer_discount__c = 20,
- RecordTypeId = rectCo[0].Id,
- AgentCode_Ext__c = '9999900'
- );
- Account myAccount1 = new Account(name = 'Testaccount001', Dealer_discount__c = 30, RecordTypeId = rectCo[0].Id);
- insert new List<account>{ myAccount1, myAccount2 };
- Contact core = new Contact(email = 'jplumber@salesforce.com', firstname = 'Joe', lastname = 'Plumber', accountid = myAccount1.id);
- insert core;
- user MyUser_Test = new User(
- ContactId = core.id,
- Alias = 'newUser',
- Email = 'newuser@testorg.com',
- EmailEncodingKey = 'UTF-8',
- LastName = 'TestUser',
- LanguageLocaleKey = 'zh_CN',
- LocaleSidKey = 'zh_CN',
- ProfileId = prof.Id,
- TimeZoneSidKey = 'Asia/Shanghai',
- UserName = 'testUser@testorg.com',
- UserPro_Type__c = 'ET',
- Work_Location__c = '鍖椾含'
- );
- System.runAs(new User(Id = UserInfo.getUserId())) {
+ List<RecordType> rectCo = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '璨╁2搴�'];
+ if (rectCo.size() == 0) {
+ return;
+ }
+ Profile prof = [select Id from Profile where Name ='901_缁忛攢鍟嗙ぞ鍖烘櫘閫氭潈闄恄2閲嶉獙璇�(ET)'];
+ Account myAccount2 = new Account(name='Testaccount002',Dealer_discount__c =20,RecordTypeId = rectCo[0].Id,AgentCode_Ext__c = '9999900');
+ Account myAccount1 = new Account(name='Testaccount001',Dealer_discount__c =30,RecordTypeId = rectCo[0].Id);
+ insert new account[]{myAccount1,myAccount2};
+ Contact core = new Contact(email='jplumber@salesforce.com', firstname='Joe',lastname='Plumber',accountid=myAccount1.id);
+ insert core;
+ user MyUser_Test = New User(ContactId = core.id,Alias = 'newUser',Email='newuser@testorg.com',EmailEncodingKey='UTF-8', LastName='TestUser', LanguageLocaleKey='zh_CN',LocaleSidKey='zh_CN', ProfileId = prof.Id,TimeZoneSidKey='Asia/Shanghai', UserName='testUser@testorg.com',UserPro_Type__c = 'ET',Work_Location__c='鍖椾含');
+ System.runAs(new User(Id = UserInfo.getUserId())){
insert MyUser_Test;
}
-
- System.runAs(MyUser_Test) {
- Product2 prod01 = new Product2(
- Name = 'Test01',
- ProductCode = 'Test01',
- Asset_Model_No__c = 'Test01',
- SFDA_Status__c = '鏈夊姽',
- JANCODE__c = '04953170200311',
- Dealer_special_Object__c = true,
- Manual_Entry__c = false
- );
- Product2 prod02 = new Product2(
- Name = 'Test02',
- ProductCode = 'Test02',
- Asset_Model_No__c = 'Test02',
- SFDA_Status__c = '鏈夊姽',
- JANCODE__c = '04953170200312',
- Dealer_special_Object__c = true,
- Manual_Entry__c = false
- );
- insert new List<Product2>{ prod01, prod02 };
- Product2__c pro1 = new Product2__c(Name = 'Pro001', OT_CODE_Text__c = 'N3047730', Product2__c = prod01.Id);
- Product2__c pro2 = new Product2__c(Name = 'Pro002', OT_CODE_Text__c = 'N3047731', Product2__c = prod02.Id);
- insert new List<Product2__c>{ pro1, pro2 };
-
+
+ System.runAs(MyUser_Test){
+ Product2 prod01 = new Product2(Name='Test01',ProductCode='Test01',Asset_Model_No__c = 'Test01',SFDA_Status__c = '鏈夊姽',JANCODE__c = '04953170200311',Dealer_special_Object__c = true,Manual_Entry__c = false);
+ Product2 prod02 = new Product2(Name='Test02',ProductCode='Test02',Asset_Model_No__c = 'Test02',SFDA_Status__c = '鏈夊姽',JANCODE__c = '04953170200312',Dealer_special_Object__c = true,Manual_Entry__c = false);
+ insert new Product2[] {prod01,prod02};
+ Product2__c pro1 = new Product2__c(Name='Pro001',OT_CODE_Text__c='N3047730',Product2__c = prod01.Id);
+ Product2__c pro2 = new Product2__c(Name='Pro002',OT_CODE_Text__c='N3047731',Product2__c = prod02.Id);
+ insert new Product2__c[] {pro1, pro2};
+
hospitalprice__c hp1 = new hospitalprice__c();
hp1.hospital__c = myAccount1.Id;
hp1.account__c = myAccount1.Id;
@@ -1280,172 +922,102 @@
insert hp1;
Consumable_order__c Order0 = new Consumable_order__c();
- Order0.Name = 'OCM_01_000';
- Order0.Order_status__c = '鎵瑰噯';
- Order0.Order_type__c = '璁㈠崟';
- Order0.Dealer_Info__c = myAccount1.id;
- Order0.RecordTypeid = System.Label.RT_ConOrder_Delivery;
- Order0.Order_ProType__c = 'ET';
+ Order0.Name = 'OCM_01_000';
+ Order0.Order_status__c = '鎵瑰噯';
+ Order0.Order_type__c = '璁㈠崟';
+ Order0.Dealer_Info__c = myAccount1.id;
+ Order0.RecordTypeid = System.Label.RT_ConOrder_Delivery;
+ Order0.Order_ProType__c = 'ET';
Order0.OutPattern__c = true;
- insert Order0;
-
- Consumable_order__c Order1 = new Consumable_order__c();
- Order1.Name = 'OCM_01_001';
- Order1.Order_status__c = '鎵瑰噯';
- Order1.Order_type__c = '璁㈠崟';
- Order1.Dealer_Info__c = myAccount1.id;
- Order1.RecordTypeid = System.Label.RT_ConOrder_Delivery;
- Order1.Order_ProType__c = 'ET';
+ insert Order0;
+
+ Consumable_order__c Order1 = new Consumable_order__c();
+ Order1.Name = 'OCM_01_001';
+ Order1.Order_status__c = '鎵瑰噯';
+ Order1.Order_type__c = '璁㈠崟';
+ Order1.Dealer_Info__c = myAccount1.id;
+ Order1.RecordTypeid = System.Label.RT_ConOrder_Delivery;
+ Order1.Order_ProType__c = 'ET';
Order1.OutPattern__c = true;
Order1.Arrive_Order__c = Order0.Id;
- insert Order1;
- Consumable_orderdetails__c Orderdet = new Consumable_orderdetails__c();
- Orderdet.Name = 'OCM_01_00101';
- Orderdet.Consumable_order__c = Order1.Id;
- Orderdet.RecordTypeId = System.Label.RT_ConOrderDetail1_Order;
- Orderdet.Consumable_Product__c = pro1.Id;
- Orderdet.Consumable_count__c = 4;
+ insert Order1;
+ Consumable_orderdetails__c Orderdet = new Consumable_orderdetails__c();
+ Orderdet.Name = 'OCM_01_00101';
+ Orderdet.Consumable_order__c = Order1.Id;
+ Orderdet.RecordTypeId = System.Label.RT_ConOrderDetail1_Order;
+ Orderdet.Consumable_Product__c = pro1.Id;
+ Orderdet.Consumable_count__c = 4;
Orderdet.Shipment_Count__c = 1;
Orderdet.isOutPattern__c = true;
- insert Orderdet;
- Consumable_order_details2__c Orderdet1 = new Consumable_order_details2__c();
- Orderdet1.Name = 'OCM_01_001001';
- Orderdet1.Consumable_order_minor__c = Order1.Id;
- Orderdet1.Consumable_Product__c = pro1.Id;
- Orderdet1.Asset_Model_No__c = 'Test01';
- Orderdet1.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
- Orderdet1.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJRF';
- Orderdet1.Cancellation_Date__c = null;
- Orderdet1.TracingCode__c = 'BXJRF';
- Orderdet1.SerialLotNo__c = '5ZK';
+ insert Orderdet;
+ Consumable_order_details2__c Orderdet1 = new Consumable_order_details2__c();
+ Orderdet1.Name = 'OCM_01_001001';
+ Orderdet1.Consumable_order_minor__c = Order1.Id;
+ Orderdet1.Consumable_Product__c = pro1.Id;
+ Orderdet1.Asset_Model_No__c = 'Test01';
+ Orderdet1.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
+ Orderdet1.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJRF';
+ Orderdet1.Cancellation_Date__c = null;
+ Orderdet1.TracingCode__c = 'BXJRF';
+ Orderdet1.SerialLotNo__c = '5ZK';
Orderdet1.Arrive_date__c = Date.today();
Orderdet1.exchangeOutPattern__c = true;
Orderdet1.Consumable_ZS_order__c = Order1.Id;
- insert Orderdet1;
- System.debug('Orderdet1:' + Orderdet1);
- Consumable_order_details2__c Orderdet2 = new Consumable_order_details2__c();
- Orderdet2.Name = 'OCM_01_001001';
- Orderdet2.Consumable_order_minor__c = Order1.Id;
- Orderdet2.Consumable_Product__c = pro1.Id;
- Orderdet2.Asset_Model_No__c = 'Test01';
- Orderdet2.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
- Orderdet2.Bar_Code__c = '01049531702003111115120017181234105ZK250BXJRF';
- Orderdet1.Cancellation_Date__c = null;
- Orderdet2.TracingCode__c = 'BXJRF';
- Orderdet2.SerialLotNo__c = '5ZK';
+ insert Orderdet1;
+ System.debug('Orderdet1:'+Orderdet1);
+ Consumable_order_details2__c Orderdet2 = new Consumable_order_details2__c();
+ Orderdet2.Name = 'OCM_01_001001';
+ Orderdet2.Consumable_order_minor__c = Order1.Id;
+ Orderdet2.Consumable_Product__c = pro1.Id;
+ Orderdet2.Asset_Model_No__c = 'Test01';
+ Orderdet2.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
+ Orderdet2.Bar_Code__c = '01049531702003111115120017181234105ZK250BXJRF';
+ Orderdet1.Cancellation_Date__c = null;
+ Orderdet2.TracingCode__c = 'BXJRF';
+ Orderdet2.SerialLotNo__c = '5ZK';
// Orderdet2.Consumable_ZS_order__c = Order1.Id;
// Orderdet2.Box_Piece__c = '涓�';
- insert Orderdet2;
- System.Test.startTest();
- String a = LexSaleOrderController.baseUrl;
+ insert Orderdet2;
+ System.Test.startTest();
+ String a = LexSaleOrderController.baseUrl;
LexSaleOrderController.msiMap = new Map<String, Integer>();
List<Consumable_orderdetails__c> orderdetails = new List<Consumable_orderdetails__c>();
orderdetails.add(Orderdet);
LexSaleOrderController.GoodsDeliveryInit(Order1.Id);
String condetailList = JSON.serialize(LexSaleOrderController.consumableorderdetailsRecords);
Order1.Arrive_Order__c = null;
- LexSaleOrderController.SearchPro(
- Order1,
- '01049531702003111115120017181000105ZK250BXJRF',
- myAccount1.Name,
- '',
- myAccount1.Id,
- LexSaleOrderController.orderdetails,
- LexSaleOrderController.orderpieceorboxMap
- );
- LexSaleOrderController.ProdElivery(
- Order1.Id,
- LexSaleOrderController.coc,
- '01049531702003111115120017181000105ZK250BXJRF',
- myAccount1.Name,
- '',
- condetailList,
- LexSaleOrderController.orderdetails,
- LexSaleOrderController.orderpriceMap,
- LexSaleOrderController.orderagencypriceMap
- );
- LexSaleOrderController.ProSale(
- Order1.Id,
- LexSaleOrderController.coc,
- '01049531702003111115120017181000105ZK250BXJRF',
- myAccount1.Name,
- '',
- condetailList,
- LexSaleOrderController.orderdetails,
- LexSaleOrderController.orderpriceMap,
- LexSaleOrderController.orderagencypriceMap
- );
+ LexSaleOrderController.SearchPro(Order1, '01049531702003111115120017181000105ZK250BXJRF', myAccount1.Name, '', myAccount1.Id, LexSaleOrderController.orderdetails, LexSaleOrderController.orderpieceorboxMap);
+ LexSaleOrderController.ProdElivery(Order1.Id, LexSaleOrderController.coc, '01049531702003111115120017181000105ZK250BXJRF', myAccount1.Name, '', condetailList, LexSaleOrderController.orderdetails, LexSaleOrderController.orderpriceMap, LexSaleOrderController.orderagencypriceMap);
+ LexSaleOrderController.ProSale(Order1.Id, LexSaleOrderController.coc, '01049531702003111115120017181000105ZK250BXJRF', myAccount1.Name, '', condetailList, LexSaleOrderController.orderdetails, LexSaleOrderController.orderpriceMap, LexSaleOrderController.orderagencypriceMap);
System.Test.stopTest();
- }
- }
+ }
+ }
@isTest
static void searchTest2() {
- List<RecordType> rectCo = [
- SELECT Id
- FROM RecordType
- WHERE IsActive = TRUE AND SobjectType = 'Account' AND Name = '璨╁2搴�'
- ];
- if (rectCo.size() == 0) {
- return;
- }
- Profile prof = [
- SELECT Id
- FROM Profile
- WHERE Name = '901_缁忛攢鍟嗙ぞ鍖烘櫘閫氭潈闄恄2閲嶉獙璇�(ET)'
- ];
- Account myAccount2 = new Account(
- name = 'Testaccount002',
- Dealer_discount__c = 20,
- RecordTypeId = rectCo[0].Id,
- AgentCode_Ext__c = '9999900'
- );
- Account myAccount1 = new Account(name = 'Testaccount001', Dealer_discount__c = 30, RecordTypeId = rectCo[0].Id);
- insert new List<account>{ myAccount1, myAccount2 };
- Contact core = new Contact(email = 'jplumber@salesforce.com', firstname = 'Joe', lastname = 'Plumber', accountid = myAccount1.id);
- insert core;
- user MyUser_Test = new User(
- ContactId = core.id,
- Alias = 'newUser',
- Email = 'newuser@testorg.com',
- EmailEncodingKey = 'UTF-8',
- LastName = 'TestUser',
- LanguageLocaleKey = 'zh_CN',
- LocaleSidKey = 'zh_CN',
- ProfileId = prof.Id,
- TimeZoneSidKey = 'Asia/Shanghai',
- UserName = 'testUser@testorg.com',
- UserPro_Type__c = 'ET',
- Work_Location__c = '鍖椾含'
- );
- System.runAs(new User(Id = UserInfo.getUserId())) {
+ List<RecordType> rectCo = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '璨╁2搴�'];
+ if (rectCo.size() == 0) {
+ return;
+ }
+ Profile prof = [select Id from Profile where Name ='901_缁忛攢鍟嗙ぞ鍖烘櫘閫氭潈闄恄2閲嶉獙璇�(ET)'];
+ Account myAccount2 = new Account(name='Testaccount002',Dealer_discount__c =20,RecordTypeId = rectCo[0].Id,AgentCode_Ext__c = '9999900');
+ Account myAccount1 = new Account(name='Testaccount001',Dealer_discount__c =30,RecordTypeId = rectCo[0].Id);
+ insert new account[]{myAccount1,myAccount2};
+ Contact core = new Contact(email='jplumber@salesforce.com', firstname='Joe',lastname='Plumber',accountid=myAccount1.id);
+ insert core;
+ user MyUser_Test = New User(ContactId = core.id,Alias = 'newUser',Email='newuser@testorg.com',EmailEncodingKey='UTF-8', LastName='TestUser', LanguageLocaleKey='zh_CN',LocaleSidKey='zh_CN', ProfileId = prof.Id,TimeZoneSidKey='Asia/Shanghai', UserName='testUser@testorg.com',UserPro_Type__c = 'ET',Work_Location__c='鍖椾含');
+ System.runAs(new User(Id = UserInfo.getUserId())){
insert MyUser_Test;
}
-
- System.runAs(MyUser_Test) {
- Product2 prod01 = new Product2(
- Name = 'Test01',
- ProductCode = 'Test01',
- Asset_Model_No__c = 'Test01',
- SFDA_Status__c = '鏈夊姽',
- JANCODE__c = '04953170200311',
- Dealer_special_Object__c = true,
- Manual_Entry__c = false
- );
- Product2 prod02 = new Product2(
- Name = 'Test02',
- ProductCode = 'Test02',
- Asset_Model_No__c = 'Test02',
- SFDA_Status__c = '鏈夊姽',
- JANCODE__c = '04953170200312',
- Dealer_special_Object__c = true,
- Manual_Entry__c = false
- );
- insert new List<Product2>{ prod01, prod02 };
- Product2__c pro1 = new Product2__c(Name = 'Pro001', OT_CODE_Text__c = 'N3047730', Product2__c = prod01.Id);
- Product2__c pro2 = new Product2__c(Name = 'Pro002', OT_CODE_Text__c = 'N3047731', Product2__c = prod02.Id);
- insert new List<Product2__c>{ pro1, pro2 };
-
+
+ System.runAs(MyUser_Test){
+ Product2 prod01 = new Product2(Name='Test01',ProductCode='Test01',Asset_Model_No__c = 'Test01',SFDA_Status__c = '鏈夊姽',JANCODE__c = '04953170200311',Dealer_special_Object__c = true,Manual_Entry__c = false);
+ Product2 prod02 = new Product2(Name='Test02',ProductCode='Test02',Asset_Model_No__c = 'Test02',SFDA_Status__c = '鏈夊姽',JANCODE__c = '04953170200312',Dealer_special_Object__c = true,Manual_Entry__c = false);
+ insert new Product2[] {prod01,prod02};
+ Product2__c pro1 = new Product2__c(Name='Pro001',OT_CODE_Text__c='N3047730',Product2__c = prod01.Id);
+ Product2__c pro2 = new Product2__c(Name='Pro002',OT_CODE_Text__c='N3047731',Product2__c = prod02.Id);
+ insert new Product2__c[] {pro1, pro2};
+
hospitalprice__c hp1 = new hospitalprice__c();
hp1.hospital__c = myAccount1.Id;
hp1.account__c = myAccount1.Id;
@@ -1453,141 +1025,89 @@
insert hp1;
Consumable_order__c Order0 = new Consumable_order__c();
- Order0.Name = 'OCM_01_000';
- Order0.Order_status__c = '鎵瑰噯';
- Order0.Order_type__c = '璁㈠崟';
- Order0.Dealer_Info__c = myAccount1.id;
- Order0.RecordTypeid = System.Label.RT_ConOrder_Delivery;
- Order0.Order_ProType__c = 'ET';
+ Order0.Name = 'OCM_01_000';
+ Order0.Order_status__c = '鎵瑰噯';
+ Order0.Order_type__c = '璁㈠崟';
+ Order0.Dealer_Info__c = myAccount1.id;
+ Order0.RecordTypeid = System.Label.RT_ConOrder_Delivery;
+ Order0.Order_ProType__c = 'ET';
Order0.OutPattern__c = true;
- insert Order0;
-
- Consumable_order__c Order1 = new Consumable_order__c();
- Order1.Name = 'OCM_01_001';
- Order1.Order_status__c = '鎵瑰噯';
- Order1.Order_type__c = '璁㈠崟';
- Order1.Dealer_Info__c = myAccount1.id;
- Order1.RecordTypeid = System.Label.RT_ConOrder_Delivery;
- Order1.Order_ProType__c = 'ET';
+ insert Order0;
+
+ Consumable_order__c Order1 = new Consumable_order__c();
+ Order1.Name = 'OCM_01_001';
+ Order1.Order_status__c = '鎵瑰噯';
+ Order1.Order_type__c = '璁㈠崟';
+ Order1.Dealer_Info__c = myAccount1.id;
+ Order1.RecordTypeid = System.Label.RT_ConOrder_Delivery;
+ Order1.Order_ProType__c = 'ET';
Order1.OutPattern__c = true;
Order1.Arrive_Order__c = Order0.Id;
- insert Order1;
- Consumable_orderdetails__c Orderdet = new Consumable_orderdetails__c();
- Orderdet.Name = 'OCM_01_00101';
- Orderdet.Consumable_order__c = Order1.Id;
- Orderdet.RecordTypeId = System.Label.RT_ConOrderDetail1_Order;
- Orderdet.Consumable_Product__c = pro1.Id;
- Orderdet.Consumable_count__c = 4;
+ insert Order1;
+ Consumable_orderdetails__c Orderdet = new Consumable_orderdetails__c();
+ Orderdet.Name = 'OCM_01_00101';
+ Orderdet.Consumable_order__c = Order1.Id;
+ Orderdet.RecordTypeId = System.Label.RT_ConOrderDetail1_Order;
+ Orderdet.Consumable_Product__c = pro1.Id;
+ Orderdet.Consumable_count__c = 4;
Orderdet.Shipment_Count__c = 1;
Orderdet.isOutPattern__c = true;
- insert Orderdet;
- Consumable_order_details2__c Orderdet1 = new Consumable_order_details2__c();
- Orderdet1.Name = 'OCM_01_001001';
- Orderdet1.Consumable_order_minor__c = Order1.Id;
- Orderdet1.Consumable_Product__c = pro1.Id;
- Orderdet1.Asset_Model_No__c = 'Test01';
- Orderdet1.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
- Orderdet1.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJRF';
- Orderdet1.Cancellation_Date__c = null;
- Orderdet1.TracingCode__c = 'BXJRF';
- Orderdet1.SerialLotNo__c = '5ZK';
+ insert Orderdet;
+ Consumable_order_details2__c Orderdet1 = new Consumable_order_details2__c();
+ Orderdet1.Name = 'OCM_01_001001';
+ Orderdet1.Consumable_order_minor__c = Order1.Id;
+ Orderdet1.Consumable_Product__c = pro1.Id;
+ Orderdet1.Asset_Model_No__c = 'Test01';
+ Orderdet1.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
+ Orderdet1.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJRF';
+ Orderdet1.Cancellation_Date__c = null;
+ Orderdet1.TracingCode__c = 'BXJRF';
+ Orderdet1.SerialLotNo__c = '5ZK';
Orderdet1.Arrive_date__c = Date.today();
Orderdet1.exchangeOutPattern__c = true;
Orderdet1.Consumable_ZS_order__c = Order1.Id;
Orderdet1.Box_Piece__c = '涓�';
- insert Orderdet1;
- System.debug('Orderdet1:' + Orderdet1);
- System.Test.startTest();
- String a = LexSaleOrderController.baseUrl;
+ insert Orderdet1;
+ System.debug('Orderdet1:'+Orderdet1);
+ System.Test.startTest();
+ String a = LexSaleOrderController.baseUrl;
LexSaleOrderController.msiMap = new Map<String, Integer>();
List<Consumable_orderdetails__c> orderdetails = new List<Consumable_orderdetails__c>();
orderdetails.add(Orderdet);
LexSaleOrderController.GoodsDeliveryInit(Order1.Id);
LexSaleOrderController.consumableorderdetailsRecords[0].outboundCount = 1;
String condetailList = JSON.serialize(LexSaleOrderController.consumableorderdetailsRecords);
- LexSaleOrderController.ProdElivery(
- Order1.Id,
- LexSaleOrderController.coc,
- '01049531702003111115120017181000105ZK250BXJRF',
- myAccount1.Name,
- '',
- condetailList,
- LexSaleOrderController.orderdetails,
- LexSaleOrderController.orderpriceMap,
- LexSaleOrderController.orderagencypriceMap
- );
+ LexSaleOrderController.ProdElivery(Order1.Id, LexSaleOrderController.coc, '01049531702003111115120017181000105ZK250BXJRF', myAccount1.Name, '', condetailList, LexSaleOrderController.orderdetails, LexSaleOrderController.orderpriceMap, LexSaleOrderController.orderagencypriceMap);
// LexSaleOrderController.ProSale(Order1.Id, LexSaleOrderController.coc, '01049531702003111115120017181000105ZK250BXJRF', myAccount1.Name, '', condetailList, LexSaleOrderController.orderdetails, LexSaleOrderController.orderpriceMap, LexSaleOrderController.orderagencypriceMap);
System.Test.stopTest();
- }
- }
+ }
+ }
@isTest
static void searchTest3() {
- List<RecordType> rectCo = [
- SELECT Id
- FROM RecordType
- WHERE IsActive = TRUE AND SobjectType = 'Account' AND Name = '璨╁2搴�'
- ];
- if (rectCo.size() == 0) {
- return;
- }
- Profile prof = [
- SELECT Id
- FROM Profile
- WHERE Name = '901_缁忛攢鍟嗙ぞ鍖烘櫘閫氭潈闄恄2閲嶉獙璇�(ET)'
- ];
- Account myAccount2 = new Account(
- name = 'Testaccount002',
- Dealer_discount__c = 20,
- RecordTypeId = rectCo[0].Id,
- AgentCode_Ext__c = '9999900'
- );
- Account myAccount1 = new Account(name = 'Testaccount001', Dealer_discount__c = 30, RecordTypeId = rectCo[0].Id);
- insert new List<account>{ myAccount1, myAccount2 };
- Contact core = new Contact(email = 'jplumber@salesforce.com', firstname = 'Joe', lastname = 'Plumber', accountid = myAccount1.id);
- insert core;
- user MyUser_Test = new User(
- ContactId = core.id,
- Alias = 'newUser',
- Email = 'newuser@testorg.com',
- EmailEncodingKey = 'UTF-8',
- LastName = 'TestUser',
- LanguageLocaleKey = 'zh_CN',
- LocaleSidKey = 'zh_CN',
- ProfileId = prof.Id,
- TimeZoneSidKey = 'Asia/Shanghai',
- UserName = 'testUser@testorg.com',
- UserPro_Type__c = 'ET',
- Work_Location__c = '鍖椾含'
- );
- System.runAs(new User(Id = UserInfo.getUserId())) {
+ List<RecordType> rectCo = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '璨╁2搴�'];
+ if (rectCo.size() == 0) {
+ return;
+ }
+ Profile prof = [select Id from Profile where Name ='901_缁忛攢鍟嗙ぞ鍖烘櫘閫氭潈闄恄2閲嶉獙璇�(ET)'];
+ Account myAccount2 = new Account(name='Testaccount002',Dealer_discount__c =20,RecordTypeId = rectCo[0].Id,AgentCode_Ext__c = '9999900');
+ Account myAccount1 = new Account(name='Testaccount001',Dealer_discount__c =30,RecordTypeId = rectCo[0].Id);
+ insert new account[]{myAccount1,myAccount2};
+ Contact core = new Contact(email='jplumber@salesforce.com', firstname='Joe',lastname='Plumber',accountid=myAccount1.id);
+ insert core;
+ user MyUser_Test = New User(ContactId = core.id,Alias = 'newUser',Email='newuser@testorg.com',EmailEncodingKey='UTF-8', LastName='TestUser', LanguageLocaleKey='zh_CN',LocaleSidKey='zh_CN', ProfileId = prof.Id,TimeZoneSidKey='Asia/Shanghai', UserName='testUser@testorg.com',UserPro_Type__c = 'ET',Work_Location__c='鍖椾含');
+ System.runAs(new User(Id = UserInfo.getUserId())){
insert MyUser_Test;
}
-
- System.runAs(MyUser_Test) {
- Product2 prod01 = new Product2(
- Name = 'Test01',
- ProductCode = 'Test01',
- Asset_Model_No__c = 'Test01',
- SFDA_Status__c = '鏈夊姽',
- JANCODE__c = '04953170200311',
- Dealer_special_Object__c = true,
- Manual_Entry__c = false
- );
- Product2 prod02 = new Product2(
- Name = 'Test02',
- ProductCode = 'Test02',
- Asset_Model_No__c = 'Test02',
- SFDA_Status__c = '鏈夊姽',
- JANCODE__c = '04953170200312',
- Dealer_special_Object__c = true,
- Manual_Entry__c = false
- );
- insert new List<Product2>{ prod01, prod02 };
- Product2__c pro1 = new Product2__c(Name = 'Pro001', OT_CODE_Text__c = 'N3047730', Product2__c = prod01.Id);
- Product2__c pro2 = new Product2__c(Name = 'Pro002', OT_CODE_Text__c = 'N3047731', Product2__c = prod02.Id);
- insert new List<Product2__c>{ pro1, pro2 };
-
+
+ System.runAs(MyUser_Test){
+ Product2 prod01 = new Product2(Name='Test01',ProductCode='Test01',Asset_Model_No__c = 'Test01',SFDA_Status__c = '鏈夊姽',JANCODE__c = '04953170200311',Dealer_special_Object__c = true,Manual_Entry__c = false);
+ Product2 prod02 = new Product2(Name='Test02',ProductCode='Test02',Asset_Model_No__c = 'Test02',SFDA_Status__c = '鏈夊姽',JANCODE__c = '04953170200312',Dealer_special_Object__c = true,Manual_Entry__c = false);
+ insert new Product2[] {prod01,prod02};
+ Product2__c pro1 = new Product2__c(Name='Pro001',OT_CODE_Text__c='N3047730',Product2__c = prod01.Id);
+ Product2__c pro2 = new Product2__c(Name='Pro002',OT_CODE_Text__c='N3047731',Product2__c = prod02.Id);
+ insert new Product2__c[] {pro1, pro2};
+
hospitalprice__c hp1 = new hospitalprice__c();
hp1.hospital__c = myAccount1.Id;
hp1.account__c = myAccount1.Id;
@@ -1595,52 +1115,52 @@
insert hp1;
Consumable_order__c Order0 = new Consumable_order__c();
- Order0.Name = 'OCM_01_000';
- Order0.Order_status__c = '鎵瑰噯';
- Order0.Order_type__c = '璁㈠崟';
- Order0.Dealer_Info__c = myAccount1.id;
- Order0.RecordTypeid = System.Label.RT_ConOrder_Delivery;
- Order0.Order_ProType__c = 'ET';
+ Order0.Name = 'OCM_01_000';
+ Order0.Order_status__c = '鎵瑰噯';
+ Order0.Order_type__c = '璁㈠崟';
+ Order0.Dealer_Info__c = myAccount1.id;
+ Order0.RecordTypeid = System.Label.RT_ConOrder_Delivery;
+ Order0.Order_ProType__c = 'ET';
Order0.OutPattern__c = true;
- insert Order0;
-
- Consumable_order__c Order1 = new Consumable_order__c();
- Order1.Name = 'OCM_01_001';
- Order1.Order_status__c = '鎵瑰噯';
- Order1.Order_type__c = '璁㈠崟';
- Order1.Dealer_Info__c = myAccount1.id;
- Order1.RecordTypeid = System.Label.RT_ConOrder_Delivery;
- Order1.Order_ProType__c = 'ET';
+ insert Order0;
+
+ Consumable_order__c Order1 = new Consumable_order__c();
+ Order1.Name = 'OCM_01_001';
+ Order1.Order_status__c = '鎵瑰噯';
+ Order1.Order_type__c = '璁㈠崟';
+ Order1.Dealer_Info__c = myAccount1.id;
+ Order1.RecordTypeid = System.Label.RT_ConOrder_Delivery;
+ Order1.Order_ProType__c = 'ET';
Order1.OutPattern__c = true;
Order1.Arrive_Order__c = Order0.Id;
- insert Order1;
- Consumable_orderdetails__c Orderdet = new Consumable_orderdetails__c();
- Orderdet.Name = 'OCM_01_00101';
- Orderdet.Consumable_order__c = Order1.Id;
- Orderdet.RecordTypeId = System.Label.RT_ConOrderDetail1_Order;
- Orderdet.Consumable_Product__c = pro1.Id;
- Orderdet.Consumable_count__c = 4;
+ insert Order1;
+ Consumable_orderdetails__c Orderdet = new Consumable_orderdetails__c();
+ Orderdet.Name = 'OCM_01_00101';
+ Orderdet.Consumable_order__c = Order1.Id;
+ Orderdet.RecordTypeId = System.Label.RT_ConOrderDetail1_Order;
+ Orderdet.Consumable_Product__c = pro1.Id;
+ Orderdet.Consumable_count__c = 4;
Orderdet.Shipment_Count__c = 1;
Orderdet.isOutPattern__c = true;
- insert Orderdet;
- Consumable_order_details2__c Orderdet1 = new Consumable_order_details2__c();
- Orderdet1.Name = 'OCM_01_001001';
- Orderdet1.Consumable_order_minor__c = Order1.Id;
- Orderdet1.Consumable_Product__c = pro1.Id;
- Orderdet1.Asset_Model_No__c = 'Test01';
- Orderdet1.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
- Orderdet1.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJRF';
- Orderdet1.Cancellation_Date__c = null;
- Orderdet1.TracingCode__c = 'BXJRF';
- Orderdet1.SerialLotNo__c = '5ZK';
+ insert Orderdet;
+ Consumable_order_details2__c Orderdet1 = new Consumable_order_details2__c();
+ Orderdet1.Name = 'OCM_01_001001';
+ Orderdet1.Consumable_order_minor__c = Order1.Id;
+ Orderdet1.Consumable_Product__c = pro1.Id;
+ Orderdet1.Asset_Model_No__c = 'Test01';
+ Orderdet1.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
+ Orderdet1.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJRF';
+ Orderdet1.Cancellation_Date__c = null;
+ Orderdet1.TracingCode__c = 'BXJRF';
+ Orderdet1.SerialLotNo__c = '5ZK';
Orderdet1.Arrive_date__c = Date.today();
Orderdet1.exchangeOutPattern__c = true;
Orderdet1.Consumable_ZS_order__c = Order1.Id;
Orderdet1.Box_Piece__c = '涓�';
- insert Orderdet1;
- System.debug('Orderdet1:' + Orderdet1);
- System.Test.startTest();
- String a = LexSaleOrderController.baseUrl;
+ insert Orderdet1;
+ System.debug('Orderdet1:'+Orderdet1);
+ System.Test.startTest();
+ String a = LexSaleOrderController.baseUrl;
LexSaleOrderController.msiMap = new Map<String, Integer>();
List<Consumable_orderdetails__c> orderdetails = new List<Consumable_orderdetails__c>();
orderdetails.add(Orderdet);
@@ -1648,18 +1168,8 @@
LexSaleOrderController.consumableorderdetailsRecords[0].outboundCount = 1;
String condetailList = JSON.serialize(LexSaleOrderController.consumableorderdetailsRecords);
// LexSaleOrderController.ProdElivery(Order1.Id, LexSaleOrderController.coc, '01049531702003111115120017181000105ZK250BXJRF', myAccount1.Name, '', condetailList, LexSaleOrderController.orderdetails, LexSaleOrderController.orderpriceMap, LexSaleOrderController.orderagencypriceMap);
- LexSaleOrderController.ProSale(
- Order1.Id,
- LexSaleOrderController.coc,
- '01049531702003111115120017181000105ZK250BXJRF',
- myAccount1.Name,
- '',
- condetailList,
- LexSaleOrderController.orderdetails,
- LexSaleOrderController.orderpriceMap,
- LexSaleOrderController.orderagencypriceMap
- );
+ LexSaleOrderController.ProSale(Order1.Id, LexSaleOrderController.coc, '01049531702003111115120017181000105ZK250BXJRF', myAccount1.Name, '', condetailList, LexSaleOrderController.orderdetails, LexSaleOrderController.orderpriceMap, LexSaleOrderController.orderagencypriceMap);
System.Test.stopTest();
- }
- }
-}
+ }
+ }
+}
\ No newline at end of file
diff --git a/force-app/main/default/classes/LexSaleOrderControllerTest.cls-meta.xml b/force-app/main/default/classes/LexSaleOrderControllerTest.cls-meta.xml
index a9fd6e9..754ecb1 100644
--- a/force-app/main/default/classes/LexSaleOrderControllerTest.cls-meta.xml
+++ b/force-app/main/default/classes/LexSaleOrderControllerTest.cls-meta.xml
@@ -1,4 +1,4 @@
-<?xml version="1.0" encoding="UTF-8" ?>
+<?xml version="1.0" encoding="UTF-8"?>
<ApexClass xmlns="http://soap.sforce.com/2006/04/metadata">
<apiVersion>57.0</apiVersion>
<status>Active</status>
diff --git a/force-app/main/default/classes/LexSearchContractControllerTest.cls b/force-app/main/default/classes/LexSearchContractControllerTest.cls
index 6bc8dae..b1cc968 100644
--- a/force-app/main/default/classes/LexSearchContractControllerTest.cls
+++ b/force-app/main/default/classes/LexSearchContractControllerTest.cls
@@ -1,74 +1,33 @@
@istest
public class LexSearchContractControllerTest {
@IsTest
- static void lexSearchContractController1() {
+ static void lexSearchContractController1(){
User myUser_test = new User();
Account myAccount2;
Account contact;
Contact core;
User currentUser = [SELECT Id FROM User WHERE Id = :UserInfo.getUserId()];
- NoteStay__c n = new NoteStay__c(Name = 'NoteStay', IsStay__c = true);
+ NoteStay__c n = new NoteStay__c(Name = 'NoteStay',IsStay__c = true);
insert n;
- System.runAs(currentUser) {
- List<RecordType> rectCo = [
- SELECT Id
- FROM RecordType
- WHERE IsActive = TRUE AND SobjectType = 'Account' AND Name = '璨╁2搴�'
- ];
- List<RecordType> rectCotac = [
- SELECT Id
- FROM RecordType
- WHERE IsActive = TRUE AND SobjectType = 'Account' AND Name = '濂戠磩'
- ];
- Profile prof = [
- SELECT Id
- FROM Profile
- WHERE Name = '901_缁忛攢鍟嗙ぞ鍖烘櫘閫氭潈闄恄2閲嶉獙璇�(ET)'
- ];
- myAccount2 = new Account(
- name = 'Testaccount002',
- Dealer_discount__c = 20,
- RecordTypeId = rectCo[0].Id,
- Product_Limit_Date__c = 'Test01|5|55,Test02|2|4',
- ET_SP_Dealer__c = true
- );
+ System.runAs(currentUser){
+ List<RecordType> rectCo = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '璨╁2搴�'];
+ List<RecordType> rectCotac = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '濂戠磩'];
+ Profile prof = [select Id from Profile where Name ='901_缁忛攢鍟嗙ぞ鍖烘櫘閫氭潈闄恄2閲嶉獙璇�(ET)'];
+ myAccount2 = new Account(name='Testaccount002',Dealer_discount__c =20,RecordTypeId = rectCo[0].Id,Product_Limit_Date__c = 'Test01|5|55,Test02|2|4',ET_SP_Dealer__c = true);
insert myAccount2;
- contact = new Account(
- name = 'Testaccount002',
- RecordTypeId = rectCotac[0].Id,
- SpecialDealerName__c = 'Testaccount002',
- ParentId = myAccount2.Id,
- Agent_Ref__c = myAccount2.Id,
- Delete_Flag__c = false,
- Contract_Department_Class__c = 'ET',
- Contract_Decide_Start_Date__c = Date.today().addDays(-1),
- Contract_Decide_End_Date__c = Date.today().addDays(1),
- AgentCode_Ext__c = '9999900',
- ET_SP_Dealer__c = true
- );
+ contact = new Account(name='Testaccount002',RecordTypeId = rectCotac[0].Id,SpecialDealerName__c = 'Testaccount002',ParentId = myAccount2.Id,Agent_Ref__c = myAccount2.Id,Delete_Flag__c = false,Contract_Department_Class__c = 'ET',Contract_Decide_Start_Date__c = Date.today().addDays(-1),Contract_Decide_End_Date__c = Date.today().addDays(1),AgentCode_Ext__c = '9999900',ET_SP_Dealer__c = true);
insert contact;
- core = new Contact(email = 'jplumber@salesforce.com', firstname = 'Joe', lastname = 'Plumber', accountid = myAccount2.id);
+ core = new Contact(email='jplumber@salesforce.com', firstname='Joe',lastname='Plumber',accountid=myAccount2.id);
insert core;
- myUser_test = new User(
- ContactId = core.id,
- Alias = 'newUser',
- Email = 'newuser@testorg.com',
- EmailEncodingKey = 'UTF-8',
- LastName = 'TestUser',
- LanguageLocaleKey = 'zh_CN',
- LocaleSidKey = 'zh_CN',
- ProfileId = prof.Id,
- TimeZoneSidKey = 'Asia/Shanghai',
- UserName = 'testUser@testorg.com'
- );
+ myUser_test = New User(ContactId = core.id,Alias = 'newUser',Email='newuser@testorg.com',EmailEncodingKey='UTF-8', LastName='TestUser', LanguageLocaleKey='zh_CN',LocaleSidKey='zh_CN', ProfileId = prof.Id,TimeZoneSidKey='Asia/Shanghai', UserName='testUser@testorg.com');
insert myUser_test;
}
- System.runAs(myUser_test) {
+ System.runAs(myUser_test){
LexSearchContractController.init('ET');
String accountId = myAccount2.Id;
LexSearchContractController.searchContract('Testaccount002', accountId, 'ET', false);
}
}
-}
+}
\ No newline at end of file
diff --git a/force-app/main/default/classes/LexSearchContractControllerTest.cls-meta.xml b/force-app/main/default/classes/LexSearchContractControllerTest.cls-meta.xml
index a9fd6e9..754ecb1 100644
--- a/force-app/main/default/classes/LexSearchContractControllerTest.cls-meta.xml
+++ b/force-app/main/default/classes/LexSearchContractControllerTest.cls-meta.xml
@@ -1,4 +1,4 @@
-<?xml version="1.0" encoding="UTF-8" ?>
+<?xml version="1.0" encoding="UTF-8"?>
<ApexClass xmlns="http://soap.sforce.com/2006/04/metadata">
<apiVersion>57.0</apiVersion>
<status>Active</status>
diff --git a/force-app/main/default/classes/LexSearchHospitalControllerTest.cls b/force-app/main/default/classes/LexSearchHospitalControllerTest.cls
index d2b6280..2e9b173 100644
--- a/force-app/main/default/classes/LexSearchHospitalControllerTest.cls
+++ b/force-app/main/default/classes/LexSearchHospitalControllerTest.cls
@@ -1,9 +1,9 @@
@istest
public class LexSearchHospitalControllerTest {
@IsTest
- static void lexSearchHospitalControllerTest1() {
+ static void lexSearchHospitalControllerTest1(){
LexSearchHospitalController.init();
LexSearchHospitalController.searchHospital('', '');
LexSearchHospitalController.searchHospital('test', '');
}
-}
+}
\ No newline at end of file
diff --git a/force-app/main/default/classes/LexSearchHospitalControllerTest.cls-meta.xml b/force-app/main/default/classes/LexSearchHospitalControllerTest.cls-meta.xml
index a9fd6e9..754ecb1 100644
--- a/force-app/main/default/classes/LexSearchHospitalControllerTest.cls-meta.xml
+++ b/force-app/main/default/classes/LexSearchHospitalControllerTest.cls-meta.xml
@@ -1,4 +1,4 @@
-<?xml version="1.0" encoding="UTF-8" ?>
+<?xml version="1.0" encoding="UTF-8"?>
<ApexClass xmlns="http://soap.sforce.com/2006/04/metadata">
<apiVersion>57.0</apiVersion>
<status>Active</status>
diff --git a/force-app/main/default/classes/LexSummonsCreatController.cls b/force-app/main/default/classes/LexSummonsCreatController.cls
index 9d25889..97b98dc 100644
--- a/force-app/main/default/classes/LexSummonsCreatController.cls
+++ b/force-app/main/default/classes/LexSummonsCreatController.cls
@@ -245,13 +245,7 @@
// 鐢婚潰鍒濆鍖�
@AuraEnabled
- public static ResponseBodyLWC init(
- String ESetidJs,
- String statusEdit,
- Integer pageSizeLWC,
- Integer pageTokenLWC,
- String arriveorderLWC
- ) {
+ public static ResponseBodyLWC init(String ESetidJs, String statusEdit, Integer pageSizeLWC, Integer pageTokenLWC,String arriveorderLWC) {
try {
firstInit(ESetidJs);
statusEdit = statusEdit;
@@ -285,17 +279,9 @@
editAble = true;
}
userId = UserInfo.getUserId();
- localuser = [
- SELECT id, State_Hospital__c
- FROM User
- WHERE id = :UserInfo.getUserId()
- ];
+ localuser = [SELECT id, State_Hospital__c FROM User WHERE id = :UserInfo.getUserId()];
//userId = '00510000005QO75';
- user Useracc = [
- SELECT accountid, Work_Location__c, UserPro_Type__c
- FROM user
- WHERE id = :userId
- ];
+ user Useracc = [SELECT accountid, Work_Location__c, UserPro_Type__c FROM user WHERE id = :userId];
accountid = Useracc.accountid;
userWorkLocation = Useracc.Work_Location__c;
agencyProType = Useracc.UserPro_Type__c;
@@ -313,19 +299,11 @@
];
List<Agency_Hospital_Link__c> AgencyHospitalLink = new List<Agency_Hospital_Link__c>();
- AgencyHospitalLink = [
- SELECT Id, Hospital__c, Hospital__r.Name
- FROM Agency_Hospital_Link__c
- WHERE Agency__c = :accountid
- ];
+ AgencyHospitalLink = [SELECT Id, Hospital__c, Hospital__r.Name FROM Agency_Hospital_Link__c WHERE Agency__c = :accountid];
//add by rentx 2021-3-1 start
//鍒ゆ柇褰撳墠缁忛攢鍟嗕笅鏄惁鏈夌壒浠峰尰闄�
- List<hospitalprice__c> hlist = [
- SELECT id, product__c
- FROM hospitalprice__c
- WHERE account__c = :accountid
- ];
+ List<hospitalprice__c> hlist = [SELECT id, product__c FROM hospitalprice__c WHERE account__c = :accountid];
if (hlist == null || hlist.size() == 0) {
hasHos = false;
} else {
@@ -365,6 +343,7 @@
for (AggregateResult orderdetail : orderdetailCount) {
zaikuId.add(String.valueOf(orderdetail.get('cpc')));
}
+ System.debug('orderdetailCount = ' + orderdetailCount);
System.debug('sqlagencyProType = ' + sqlagencyProType);
System.debug('userWorkLocation = ' + userWorkLocation);
System.debug('accountName = ' + accountName);
@@ -408,6 +387,7 @@
for (Integer i = 0; i < product2Selected.size(); i++) {
MidMap.put(product2Selected[i].Id, new ConsumableorderdetailsInfo(product2Selected[i]));
}
+ System.debug('MidMap = ' + MidMap);
for (Integer i = 0; i < CountDel.size(); i++) {
String str = '';
if (CountDel[i].hospitalSpecialOffer__c) {
@@ -415,6 +395,8 @@
} else {
str = 'notHos';
}
+ System.debug('CountDel[i].Consumable_Product__c= ' + CountDel[i].Consumable_Product__c);
+ System.debug('CountDel[i].Consumable_Product__c + str= ' + CountDel[i].Consumable_Product__c + str);
//鏄庣粏2瀵瑰簲鐨勪骇鍝佸瓨鍦ㄤ簬MidMap涓�
if (MidMap.containsKey(CountDel[i].Consumable_Product__c)) {
//璁剧疆map涓璳ey鐨勫悗缂� 鐢ㄤ簬鍖哄垎鍖婚櫌鐗逛环鍜岄潪鍖婚櫌鐗逛环
@@ -759,11 +741,7 @@
SELECT Id, Name, Invoice_Date__c, NoConfirmedPrice__c, Invoice_total_amount__c, Invoice_status__c
FROM Consumable_order__c
WHERE
- Id IN (
- SELECT Invoice_Code_link__c
- FROM Consumable_order_LinkTable__c
- WHERE Outboundorder_Code_link__c = :ESetId
- )
+ Id IN (SELECT Invoice_Code_link__c FROM Consumable_order_LinkTable__c WHERE Outboundorder_Code_link__c = :ESetId)
AND Invoice_status__c != '鑽夋涓�'
];
@@ -1323,11 +1301,7 @@
// 鏄剧ず鏁版嵁鏉℃暟淇℃伅
// makeMessage();
//闄勪欢
- attachmentinfo = [
- SELECT Id, Name, OwnerId
- FROM Attachment
- WHERE parentid = :ESetId
- ];
+ attachmentinfo = [SELECT Id, Name, OwnerId FROM Attachment WHERE parentid = :ESetId];
if (attachmentinfo.size() > 0) {
for (Integer i = 0; i < attachmentinfo.size(); i++) {
attachmentRecoeds.add(new ConsumableorderdetailsInfo(attachmentinfo[i]));
@@ -1424,7 +1398,7 @@
System.debug('res = ' + res);
return res;
} catch (Exception e) {
- return new ResponseBodyLWC('Error', 500, e.getMessage() + e.getLineNumber(), '');
+ return new ResponseBodyLWC('Error',500, e.getMessage() + e.getLineNumber(), '');
}
}
@@ -1441,6 +1415,7 @@
WHERE Category3_text__c = :category3 AND Category4_text__c != NULL AND Category5_text__c != NULL
GROUP BY Category4_text__c
];
+ System.debug('category4List ' + category4List);
category4OptionList = new List<SelectOption>();
category4OptionList.add(new SelectOption('', '-鏃�-'));
category4OptionMap = new Map<String, String>();
@@ -1458,6 +1433,7 @@
GROUP BY Category5_text__c
];
+ System.debug('category5List ' + category5List);
category5OptionList = new List<SelectOption>();
category5OptionList.add(new SelectOption('', '-鏃�-'));
category5OptionMap = new Map<String, String>();
@@ -1489,6 +1465,7 @@
WHERE Category3_text__c = :category3 AND Category4_text__c != NULL AND Category5_text__c != NULL
GROUP BY Category4_text__c
];
+ System.debug('category4List ' + category4List);
category4OptionList = new List<SelectOption>();
category4OptionList.add(new SelectOption('', '-鏃�-'));
category4OptionMap = new Map<String, String>();
@@ -1506,6 +1483,7 @@
GROUP BY Category5_text__c
];
+ System.debug('category5List ' + category5List);
category5OptionList = new List<SelectOption>();
category5OptionList.add(new SelectOption('', '-鏃�-'));
category5OptionMap = new Map<String, String>();
@@ -1573,6 +1551,8 @@
AND Arrive_Owner_Work_Location__c = :userWorkLocationLwc
GROUP BY Consumable_Product__c, Box_Piece__c
];
+ System.debug('orderdetailCount = ' + orderdetailCount);
+
for (AggregateResult orderdetail : orderdetailCount) {
zaikuId.add(String.valueOf(orderdetail.get('cpc')));
}
@@ -2085,11 +2065,7 @@
//鐗逛环鍖婚櫌鍑哄簱闈炴湰鍖婚櫌缁存姢鐨勭壒浠峰晢鍝佹椂,鎶ラ敊 闈炵壒浠峰尰闄㈠嚭搴撶淮鎶ゅ湪鍖婚櫌鐗逛环鍏崇郴琛ㄧ殑浜у搧鏃� 鎶ラ敊
if (coc.SummonsForDirction__c != '浜掔浉璋冭揣') {
//闈炵壒浠峰尰闄㈠嚭搴撶壒浠蜂骇鍝佹椂 鎶ラ敊(褰撳墠缁忛攢鍟嗕笅娌℃湁鐗逛环鍖婚櫌闄ゅ)
- List<hospitalprice__c> hopList = [
- SELECT id, hospital__c, product__c
- FROM hospitalprice__c
- WHERE account__c = :accountid
- ];
+ List<hospitalprice__c> hopList = [SELECT id, hospital__c, product__c FROM hospitalprice__c WHERE account__c = :accountid];
//缁忛攢鍟嗗搴斿尰闄笅鐨勬墍鏈夌壒浠蜂骇鍝�
Map<String, String> proMap = new Map<String, String>();
//缁忛攢鍟嗕笅鐨勬墍鏈夌壒浠蜂骇鍝�
@@ -2156,7 +2132,11 @@
return new ResponseBodyLWC(
'Error',
500,
- '缁忛攢鍟�:' + coc.Order_ForDealerText__c + ' 娌℃湁娑堣�楀搧:' + proStr.substring(0, proStr.length() - 1) + ' 鐨勭壒浠�',
+ '缁忛攢鍟�:' +
+ coc.Order_ForDealerText__c +
+ ' 娌℃湁娑堣�楀搧:' +
+ proStr.substring(0, proStr.length() - 1) +
+ ' 鐨勭壒浠�',
''
);
}
@@ -2213,10 +2193,7 @@
if (ass.orderdetails1.Delivery_List_RMB__c == null && coc.SummonsForDirction__c != '鍖婚櫌璇曠敤') {
return new ResponseBodyLWC('Error', 500, '璇疯緭鍏ユ纭殑鍑鸿揣鍗曚环 (鍏�)', '');
}
- if (
- (ass.orderdetails1.Delivery_List_RMB__c == null || ass.orderdetails1.Delivery_List_RMB__c == 0) &&
- coc.SummonsForDirction__c != '鍖婚櫌璇曠敤'
- ) {
+ if ((ass.orderdetails1.Delivery_List_RMB__c == null || ass.orderdetails1.Delivery_List_RMB__c == 0) && coc.SummonsForDirction__c != '鍖婚櫌璇曠敤') {
return new ResponseBodyLWC('Error', 500, '璇疯緭鍏ュ嚭璐у崟浠� (鍏�)', '');
}
if (
@@ -2248,7 +2225,9 @@
return new ResponseBodyLWC(
'Error',
500,
- '娑堣�楀搧' + ass.orderdetails1.Consumable_Product__r.Name__c + '搴撳瓨涓嶈冻',
+ '娑堣�楀搧' +
+ ass.orderdetails1.Consumable_Product__r.Name__c +
+ '搴撳瓨涓嶈冻',
''
);
}
@@ -2264,7 +2243,9 @@
return new ResponseBodyLWC(
'Error',
500,
- '娑堣�楀搧' + ass.orderdetails1.Consumable_Product__r.Name__c + '搴撳瓨涓嶈冻',
+ '娑堣�楀搧' +
+ ass.orderdetails1.Consumable_Product__r.Name__c +
+ '搴撳瓨涓嶈冻',
''
);
}
@@ -2275,11 +2256,7 @@
insert p;
ESetId = p.id;
List<Consumable_order__c> detailName = new List<Consumable_order__c>();
- detailName = [
- SELECT id, Name
- FROM Consumable_order__c
- WHERE id = :ESetId
- ];
+ detailName = [SELECT id, Name FROM Consumable_order__c WHERE id = :ESetId];
Integer i = 1;
for (ConsumableorderdetailsInfoLwc ass : pageRecordsLwc) {
if (ass.check == true) {
@@ -2374,10 +2351,7 @@
return new ResponseBodyLWC('Error', 500, '璇疯緭鍏ユ纭殑鍑鸿揣鍗曚环 (鍏�)', '');
}
Consumable_orderdetails__c InsAfterDel = new Consumable_orderdetails__c();
- if (
- (ass.orderdetails1.Delivery_List_RMB__c == null || ass.orderdetails1.Delivery_List_RMB__c == 0) &&
- coc.SummonsForDirction__c != '鍖婚櫌璇曠敤'
- ) {
+ if ((ass.orderdetails1.Delivery_List_RMB__c == null || ass.orderdetails1.Delivery_List_RMB__c == 0) && coc.SummonsForDirction__c != '鍖婚櫌璇曠敤') {
return new ResponseBodyLWC('Error', 500, '璇疯緭鍏ュ嚭璐у崟浠� (鍏�)', '');
}
if (
@@ -2403,7 +2377,9 @@
return new ResponseBodyLWC(
'Error',
500,
- '娑堣�楀搧' + ass.orderdetails1.Consumable_Product__r.Name__c + '搴撳瓨涓嶈冻',
+ '娑堣�楀搧' +
+ ass.orderdetails1.Consumable_Product__r.Name__c +
+ '搴撳瓨涓嶈冻',
''
);
}
@@ -2418,7 +2394,9 @@
return new ResponseBodyLWC(
'Error',
500,
- '娑堣�楀搧' + ass.orderdetails1.Consumable_Product__r.Name__c + '搴撳瓨涓嶈冻',
+ '娑堣�楀搧' +
+ ass.orderdetails1.Consumable_Product__r.Name__c +
+ '搴撳瓨涓嶈冻',
''
);
}
@@ -2436,6 +2414,7 @@
InsAfterDel.Name = p.name + '-' + str;
InsAfterDel.Shipment_Count__c = ass.orderdetails1.Shipment_Count__c;
InsAfterDel.Consumable_order__c = ESetId;
+ System.debug('ass.Prod.id:' + ass.Prod.id);
InsAfterDel.Consumable_Product__c = ass.Prod.id;
InsAfterDel.Intra_Trade_List_RMB__c = ass.Prod.Intra_Trade_List_RMB__c;
InsAfterDel.Delivery_List_RMB__c = ass.orderdetails1.Delivery_List_RMB__c;
@@ -2454,11 +2433,7 @@
}
update p;
List<Consumable_orderdetails__c> qs = new List<Consumable_orderdetails__c>();
- qs = [
- SELECT Id
- FROM Consumable_orderdetails__c
- WHERE Consumable_order__c = :ESetId
- ];
+ qs = [SELECT Id FROM Consumable_orderdetails__c WHERE Consumable_order__c = :ESetId];
if (qs.size() > 0) {
delete qs;
}
@@ -2570,7 +2545,7 @@
// FROM Account
// WHERE
// // Name = '濂ユ灄宸存柉锛堝寳浜級閿�鍞湇鍔℃湁闄愬叕鍙�'
- // // AND
+ // // AND
// Name LIKE :nameCondition
// AND RecordType.DeveloperName = 'AgencyContract'
// AND Contract_Decide_Start_Date__c >= :thisDatetime
@@ -2586,7 +2561,7 @@
// FROM Account
// WHERE
// // Name = '濂ユ灄宸存柉锛堝寳浜級閿�鍞湇鍔℃湁闄愬叕鍙�'
- // // AND
+ // // AND
// Name LIKE :nameCondition
// AND RecordType.DeveloperName = 'AgencyContract'
// AND Contract_Decide_Start_Date__c >= :thisDatetime
@@ -2597,6 +2572,7 @@
// ];
// }
+
Date today = Date.today();
//Date today = Date.newInstance(2023, 3, 1);
Integer thisMonth = today.month();
@@ -2605,7 +2581,7 @@
Integer lastYear = today.year() - 1;
Integer thisYear = today.year();
Integer nextYear = today.year() + 1;
-
+
Date lastDatetime = Date.newInstance(lastYear, 4, 1);
Date thisDatetime = Date.newInstance(thisYear, 4, 1);
Date thisDatetime2 = Date.newInstance(thisYear, 7, 1);
@@ -2615,18 +2591,14 @@
System.debug('thisDatetime2 = ' + thisDatetime2);
System.debug('nextDatetime = ' + nextDatetime);
System.debug('UserInfo.getUserId() = ' + UserInfo.getUserId());
- User UserProTypecTemp = [
- SELECT UserPro_Type__c
- FROM User
- WHERE id = :UserInfo.getUserId()
- ];
+ User UserProTypecTemp = [select UserPro_Type__c from User where id =: UserInfo.getUserId()];
String sql = 'SELECT id, Parentid FROM Account WHERE Parent.Name LIKE :nameCondition ';
- if (thisMonth < 4) {
+ if(thisMonth < 4){
sql += 'AND Contract_Decide_Start_Date__c >= :lastDatetime AND Contract_Decide_End_Date__c < :thisDatetime2 ';
- } else if (thisMonth >= 4 && thisMonth <= 6) {
+ }else if(thisMonth >= 4 && thisMonth <= 6){
sql += 'AND Contract_Decide_Start_Date__c >= :lastDatetime AND Contract_Decide_End_Date__c < :nextDatetime ';
- } else {
+ }else{
sql += 'AND Contract_Decide_Start_Date__c >= :thisDatetime AND Contract_Decide_End_Date__c < :nextDatetime ';
}
if (UserProTypecTemp.UserPro_Type__c == 'ENG') {
@@ -2714,11 +2686,30 @@
ResponseBodyLWC res = new ResponseBodyLWC();
Map<String, object> data = new Map<String, object>();
res.entity = data;
- List<ContentVersion> cvList = [
- SELECT id, Title, CreatedBy.Name, PathOnClient, CreatedDate, ContentDocumentId
- FROM ContentVersion
- WHERE FirstPublishLocationId = :recordId
- ];
+ List<ContentVersion> cvList = new List<ContentVersion>();
+ List<ContentDocumentLink> links = [SELECT Id, ContentDocumentId FROM ContentDocumentLink WHERE LinkedEntityId = :recordId];
+ if (links != null && links.size() > 0) {
+ List<String> documentIds = new List<String>();
+ for (ContentDocumentLink link : links) {
+ documentIds.add(link.ContentDocumentId);
+ }
+ List<ContentVersion> cvInfo = [
+ SELECT Id, Title, OwnerId, Owner.Name, CreatedDate, ContentDocumentId
+ FROM ContentVersion
+ WHERE ContentDocumentId IN :documentIds
+ ];
+
+ if (cvInfo.size() > 0) {
+ for (Integer i = 0; i < cvInfo.size(); i++) {
+ cvList.add(cvInfo[i]);
+ }
+ }
+ }
+ // List<ContentVersion> cvList = [
+ // SELECT id, Title, CreatedBy.Name, PathOnClient, CreatedDate, ContentDocumentId
+ // FROM ContentVersion
+ // WHERE FirstPublishLocationId = :recordId
+ // ];
data.put('cvList', cvList);
res.status = 'Success';
res.code = 200;
@@ -2728,23 +2719,15 @@
//鍒犻櫎闄勪欢
@AuraEnabled
- public static ResponseBodyLWC deleteAtt(String contentVersionId) {
+ public static ResponseBodyLWC deleteAtt(String contentVersionId){
try {
- ContentVersion conVersion = [
- SELECT ContentDocumentId
- FROM ContentVersion
- WHERE Id = :contentVersionId
- ];
+ ContentVersion conVersion = [SELECT ContentDocumentId FROM ContentVersion WHERE Id = :contentVersionId];
String contentDocumentId = conVersion.ContentDocumentId;
- ContentDocument conDocument = [
- SELECT Id
- FROM ContentDocument
- WHERE Id = :contentDocumentId
- ];
+ ContentDocument conDocument = [SELECT Id FROM ContentDocument where Id = :contentDocumentId];
delete conDocument;
- return new ResponseBodyLWC('Success', 200, '', '');
+ return new ResponseBodyLWC('Success',200,'','');
} catch (Exception e) {
- return new ResponseBodyLWC('Error', 500, e.getMessage() + e.getLineNumber(), '');
+ return new ResponseBodyLWC('Error',500, e.getMessage() + e.getLineNumber(), '');
}
}
@@ -2805,11 +2788,7 @@
try {
List<Consumable_order__c> qs = new List<Consumable_order__c>();
List<Consumable_orderdetails__c> Dqs = new List<Consumable_orderdetails__c>();
- Dqs = [
- SELECT Id
- FROM Consumable_orderdetails__c
- WHERE Consumable_order__c = :ESetId
- ];
+ Dqs = [SELECT Id FROM Consumable_orderdetails__c WHERE Consumable_order__c = :ESetId];
qs = [SELECT Id FROM Consumable_order__c WHERE Id = :ESetId];
if (Dqs.size() > 0 || qs.size() > 0) {
delete Dqs;
@@ -2915,8 +2894,9 @@
hospitalSpecialOffer = false;
hosPro = false;
}
-
+
//闄勪欢
+ @TestVisible
public ConsumableorderdetailsInfo(Attachment e) {
concc = e;
hospitalSpecialOffer = false;
@@ -3045,4 +3025,4 @@
@AuraEnabled
public Integer recordEnd { get; set; }
}
-}
+}
\ No newline at end of file
diff --git a/force-app/main/default/classes/LexSummonsCreatControllerTest.cls b/force-app/main/default/classes/LexSummonsCreatControllerTest.cls
index 3435b31..6e443dc 100644
--- a/force-app/main/default/classes/LexSummonsCreatControllerTest.cls
+++ b/force-app/main/default/classes/LexSummonsCreatControllerTest.cls
@@ -1,53 +1,28 @@
@isTest
private class LexSummonsCreatControllerTest {
@isTest
- static void testInit() {
+ static void testInit(){
Account accountItem1;
Account accountItem2;
User userTest;
String rectCo = Schema.SObjectType.Account.getRecordTypeInfosByDeveloperName().get('Agency').getRecordTypeId();
String rectHp = Schema.SObjectType.Account.getRecordTypeInfosByDeveloperName().get('HP').getRecordTypeId();
- Profile prof = [
- SELECT Id
- FROM Profile
- WHERE Name = '901_缁忛攢鍟嗙ぞ鍖烘櫘閫氭潈闄恄2閲嶉獙璇�(ET)'
- ];
- accountItem1 = new Account(Name = 'Testaccount001', RecordTypeId = rectCo, AgentCode_Ext__c = '9999900');
+ Profile prof = [SELECT Id FROM Profile WHERE Name ='901_缁忛攢鍟嗙ぞ鍖烘櫘閫氭潈闄恄2閲嶉獙璇�(ET)'];
+ accountItem1 = new Account(Name='Testaccount001',RecordTypeId = rectCo, AgentCode_Ext__c = '9999900');
insert accountItem1;
- accountItem2 = new Account(
- Name = 'Testaccount002',
- RecordTypeId = rectHp,
- AgentCode_Ext__c = '9999999',
- ParentId = accountItem1.Id,
- Contract_Decide_Start_Date__c = Date.today(),
- ENG_Dealer__c = true,
- BillingCity = null
- );
+ accountItem2 = new Account(Name='Testaccount002',RecordTypeId = rectHp, AgentCode_Ext__c = '9999999', ParentId = accountItem1.Id,Contract_Decide_Start_Date__c = Date.today(),ENG_Dealer__c = true,BillingCity = null);
insert accountItem2;
- Contact core = new Contact(email = 'jplumber@salesforce.com', firstname = 'Joe', lastname = 'Plumber', accountId = accountItem1.Id);
+ Contact core = new Contact(email='jplumber@salesforce.com', firstname='Joe', lastname='Plumber', accountId = accountItem1.Id);
insert core;
Agency_Hospital_Link__c ahl = new Agency_Hospital_Link__c();
ahl.Name = 'test1缁忛攢鍟嗗尰闄�';
ahl.Hospital__c = accountItem2.Id;
ahl.Agency__c = accountItem1.Id;
- insert new List<Agency_Hospital_Link__c>{ ahl };
+ insert new Agency_Hospital_Link__c[]{ahl};
System.runAs(new user(ID = UserInfo.getUserID())) {
- userTest = new User(
- ContactId = core.id,
- Alias = 'newUser',
- Email = 'newuser@testorg.com',
- EmailEncodingKey = 'UTF-8',
- LastName = 'TestUser',
- LanguageLocaleKey = 'zh_CN',
- LocaleSidKey = 'zh_CN',
- ProfileId = prof.Id,
- TimeZoneSidKey = 'Asia/Shanghai',
- UserName = 'testUser@testorg.com',
- UserPro_Type__c = 'ENG',
- Work_Location__c = '鍖椾含'
- );
+ userTest = New User(ContactId = core.id, Alias = 'newUser', Email='newuser@testorg.com', EmailEncodingKey='UTF-8', LastName='TestUser', LanguageLocaleKey='zh_CN', LocaleSidKey='zh_CN', ProfileId = prof.Id, TimeZoneSidKey='Asia/Shanghai', UserName='testUser@testorg.com', UserPro_Type__c='ENG', Work_Location__c='鍖椾含');
insert userTest;
}
//鍙戣揣
@@ -63,59 +38,30 @@
insert consOrder;
// create ContentVersions
- list<ContentVersion> cvList = new List<ContentVersion>();
- cvList.add(
- new ContentVersion(
- Title = 'test1',
- PathOnClient = '/' + 'Test1.txt',
- VersionData = Blob.valueOf('test data 1'),
- IsMajorVersion = true
- )
- );
- cvList.add(
- new ContentVersion(
- Title = 'test2',
- PathOnClient = '/' + 'Test2.txt',
- VersionData = Blob.valueOf('test data 2'),
- IsMajorVersion = true
- )
- );
- cvList.add(
- new ContentVersion(
- Title = 'test3',
- PathOnClient = '/' + 'Test3.txt',
- VersionData = Blob.valueOf('test data 3'),
- IsMajorVersion = true
- )
- );
+ list<ContentVersion> cvList = new list<ContentVersion>();
+ cvList.add( new ContentVersion(Title = 'test1',PathOnClient ='/' + 'Test1.txt' ,VersionData = Blob.valueOf('test data 1'), IsMajorVersion = true) );
+ cvList.add( new ContentVersion(Title = 'test2',PathOnClient ='/' + 'Test2.txt' ,VersionData = Blob.valueOf('test data 2'), IsMajorVersion = true) );
+ cvList.add( new ContentVersion(Title = 'test3',PathOnClient ='/' + 'Test3.txt' ,VersionData = Blob.valueOf('test data 3'), IsMajorVersion = true) );
insert cvList;
// retrieve Ids for ContentDocuments created on insert of ContentVersions
- list<Id> cdIdList = new List<Id>();
- for (ContentDocument cd : [
- SELECT Id, LatestPublishedVersionId
- FROM ContentDocument
- WHERE
- LatestPublishedVersionId = :cvList[0].Id
- OR LatestPublishedVersionId = :cvList[1].Id
- OR LatestPublishedVersionId = :cvList[2].Id
- ORDER BY Title
- ]) {
+ list<Id> cdIdList = new list<Id>();
+ for (ContentDocument cd : [SELECT Id, LatestPublishedVersionId
+ FROM ContentDocument
+ WHERE (LatestPublishedVersionId =:cvList[0].Id OR LatestPublishedVersionId =:cvList[1].Id OR LatestPublishedVersionId =:cvList[2].Id)
+ ORDER BY Title])
+ {
cdIdList.add(cd.Id);
}
system.assertEquals(3, cdIdList.size());
- list<ContentDocumentLink> cdlList = new List<ContentDocumentLink>();
- cdlList.add(new ContentDocumentLink(ContentDocumentId = cdIdList[0], LinkedEntityId = consOrder.Id, ShareType = 'V'));
+ list<ContentDocumentLink> cdlList = new list<ContentDocumentLink>();
+ cdlList.add(new ContentDocumentLink(ContentDocumentId=cdIdList[0], LinkedEntityId=consOrder.Id, ShareType='V'));
insert cdlList;
- LexSummonsCreatController.saveFile(consOrder.Id, 'A-65224941-20200923--1.docx', 'Unit Test Attachment Body');
- LexSummonsCreatController.getFiles(consOrder.Id);
- LexSummonsCreatController.deleteAtt(cvList[0].Id);
- System.runAs(userTest) {
+ LexSummonsCreatController.saveFile(consOrder.Id,'A-65224941-20200923--1.docx','Unit Test Attachment Body');
+ LexSummonsCreatController.getFiles(consOrder.Id);
+ LexSummonsCreatController.deleteAtt(cvList[0].Id);
+ System.runAs(userTest){
String userId = UserInfo.getUserId();
- User thisUserInfo = [
- SELECT accountid, UserPro_Type__c, ContactId, Contact.AccountId, Contact.Account.Name, Work_Location__c
- FROM User
- WHERE id = :userId
- ];
+ User thisUserInfo = [SELECT accountid, UserPro_Type__c, ContactId, Contact.AccountId,Contact.Account.Name, Work_Location__c FROM User WHERE id =:userId];
String accountId = thisUserInfo.accountid;
String accountName = thisUserInfo.Contact.Account.Name;
String agencyProType = thisUserInfo.UserPro_Type__c;
@@ -125,32 +71,12 @@
if (String.isBlank(thisUserInfo.UserPro_Type__c)) {
agencyProType = 'ET';
}
- Product2 prod07 = new Product2(
- Name = 'Test07',
- ProductCode = 'Test07',
- Asset_Model_No__c = 'Test07',
- Category3__c = 'CDS',
- Category4__c = 'OER',
- Category5__c = 'Celon',
- SFDA_Status__c = '鏈夊姽',
- Product_Status__c = '姝e父閿�鍞�',
- SFDA_Approbated_Status__c = '鏈夋晥',
- Dealer_special_Object__c = true,
- SFDA_Approbation_No__c = 'Test002',
- Packing_list_manual__c = 1,
- SFDA_Expiration_Date__c = Date.today(),
- Manual_Entry__c = false
- );
- insert new List<Product2>{ prod07 };
- Product2__c pro1 = new Product2__c(
- Name = 'MH-155:鐧藉钩琛″附',
- OT_CODE_Text__c = 'Test001',
- Product2__c = prod07.Id,
- Category3_text__c = 'test123',
- Category4_text__c = 'test123',
- Category5_text__c = 'test123'
- );
- insert new List<Product2__c>{ pro1 };
+ Product2 prod07 = new Product2(Name='Test07',ProductCode='Test07',Asset_Model_No__c = 'Test07',Category3__c = 'CDS',Category4__c = 'OER',Category5__c = 'Celon',
+ SFDA_Status__c = '鏈夊姽',Product_Status__c = '姝e父閿�鍞�',SFDA_Approbated_Status__c = '鏈夋晥',Dealer_special_Object__c = true,SFDA_Approbation_No__c = 'Test002',Packing_list_manual__c = 1,
+ SFDA_Expiration_Date__c= Date.today(),Manual_Entry__c = false);
+ insert new Product2[] {prod07};
+ Product2__c pro1 = new Product2__c(Name='MH-155:鐧藉钩琛″附',OT_CODE_Text__c='Test001',Product2__c = prod07.Id,Category3_text__c = 'test123', Category4_text__c = 'test123', Category5_text__c = 'test123');
+ insert new Product2__c[] {pro1};
//鍙戣揣
Consumable_order__c createIdSend = new Consumable_order__c();
createIdSend.Name = 'testMing1';
@@ -208,7 +134,7 @@
createIdSend3.SummonsStatus_c__c = '鎵瑰噯';
createIdSend3.Dealer_Info__c = accountItem1.Id;
createIdSend3.Delivery_detail_count__c = 5;
-
+
Consumable_order__c createIdSend4 = new Consumable_order__c();
createIdSend4.Name = 'testMing1';
createIdSend4.Order_status__c = '鎵瑰噯';
@@ -250,7 +176,7 @@
createIdSend6.SummonsStatus_c__c = '';
createIdSend6.Dealer_Info__c = accountItem1.Id;
createIdSend6.Delivery_detail_count__c = 5;
-
+
Consumable_order__c createIdSend7 = new Consumable_order__c();
createIdSend7.Name = 'testMing222222';
createIdSend7.Order_status__c = '鎵瑰噯';
@@ -264,7 +190,7 @@
createIdSend7.SummonsStatus_c__c = '';
createIdSend7.Dealer_Info__c = accountItem1.Id;
createIdSend7.Delivery_detail_count__c = 5;
-
+
Consumable_order__c createIdSend8 = new Consumable_order__c();
createIdSend8.Name = 'testMing222222';
createIdSend8.Order_status__c = '鎵瑰噯';
@@ -279,10 +205,10 @@
createIdSend8.Dealer_Info__c = accountItem1.Id;
createIdSend8.Delivery_detail_count__c = 5;
- //鍙戠エ淇℃伅
+ //鍙戠エ淇℃伅
Consumable_order__c createIdSend9 = new Consumable_order__c();
createIdSend9.Name = 'invoice01';
- createIdSend9.Invoice_status__c = '宸插畬鎴�';
+ createIdSend9.Invoice_status__c='宸插畬鎴�';
createIdSend9.Order_type__c = '鍙戠エ';
createIdSend9.RecordTypeid = System.Label.RT_ConOrder_Invoice;
createIdSend9.Order_status__c = '鑽夋涓�';
@@ -309,14 +235,14 @@
createIdSend11.Order_ProType__c = 'ET';
Consumable_order__c testList1 = new Consumable_order__c();
- testList1.Name = 'Test1';
- testList1.Summons_Sale_Status__c = '鍑鸿揣';
- testList1.SummonsStatus_c__c = '宸插畬鎴�';
+ testList1.Name='Test1';
+ testList1.Summons_Sale_Status__c='鍑鸿揣';
+ testList1.SummonsStatus_c__c='宸插畬鎴�';
testList1.Arrive_Order__c = createIdSend9.Id;
- testList1.SummonsForDirction__c = '鐩存帴閿�鍞粰鍖婚櫌';
- testList1.Order_status__c = '鑽夋涓�';
- testList1.Order_type__c = '浼犵エ';
- testList1.Dealer_info__c = accountItem1.Id;
+ testList1.SummonsForDirction__c='鐩存帴閿�鍞粰鍖婚櫌';
+ testList1.Order_status__c='鑽夋涓�';
+ testList1.Order_type__c='浼犵エ';
+ testList1.Dealer_info__c=accountItem1.Id;
testList1.ConInvoice_Code__c = createIdSend9.id;
//鍒拌揣
@@ -330,31 +256,12 @@
createIdArrived.orderPattern__c = 'promotionorder';
createIdArrived.Dealer_Info__c = accountItem1.Id;
createIdArrived.Delivery_detail_count__c = 5;
- insert new List<Consumable_order__c>{
- createIdSend,
- createIdSend1,
- createIdSend2,
- createIdSend3,
- createIdSend4,
- createIdSend5,
- createIdSend6,
- createIdSend7,
- createIdSend8,
- createIdSend9,
- createIdSend10,
- createIdSend11,
- createIdArrived,
- testList1
- };
-
+ insert new Consumable_order__c[]{createIdSend,createIdSend1,createIdSend2,createIdSend3,createIdSend4,createIdSend5,createIdSend6,createIdSend7,createIdSend8,createIdSend9,createIdSend10,createIdSend11,createIdArrived,testList1};
+
System.debug('createIdSend9.id = ' + createIdSend9.id);
- Consumable_order_LinkTable__c order_LinkTable1 = new Consumable_order_LinkTable__c(
- Name = 'order_LinkTable1',
- Outboundorder_Code_link__c = testList1.Id,
- Invoice_Code_link__c = createIdSend9.Id
- );
- insert new List<Consumable_order_LinkTable__c>{ order_LinkTable1 };
+ Consumable_order_LinkTable__c order_LinkTable1 = new Consumable_order_LinkTable__c(Name='order_LinkTable1',Outboundorder_Code_link__c = testList1.Id,Invoice_Code_link__c =createIdSend9.Id);
+ insert new Consumable_order_LinkTable__c[]{order_LinkTable1};
Consumable_orderdetails__c coc = new Consumable_orderdetails__c();
coc.Name = 'Too001';
@@ -394,7 +301,7 @@
coc2.Delivery_List_RMB__c = -999.00;
coc2.Shipment_Count__c = 9999.00;
coc2.RecordTypeid = System.Label.RT_ConOrderDetail1_Order;
- insert new List<Consumable_orderdetails__c>{ coc, coc1, coc2 };
+ insert new Consumable_orderdetails__c[]{coc,coc1,coc2};
Consumable_order_details2__c conOrderDetail1 = new Consumable_order_details2__c();
conOrderDetail1.Name = 'OCM_01_001001';
@@ -412,23 +319,17 @@
conOrderDetail1.Cancellation_Flag__c = false;
conOrderDetail1.Box_Piece__c = '鐩�';
conOrderDetail1.Sterilization_limit__c = Date.Today();
- insert new List<Consumable_order_details2__c>{ conOrderDetail1 };
-
+ insert new Consumable_order_details2__c[]{conOrderDetail1};
+
hospitalprice__c hp1 = new hospitalprice__c();
hp1.hospital__c = accountId;
hp1.account__c = accountId;
hp1.product__c = pro1.Id;
- insert new List<hospitalprice__c>{ hp1 };
+ insert new hospitalprice__c[]{hp1};
- Dealer_elationship__c dealerelationship = new Dealer_elationship__c(
- Dealer_principal__c = accountItem1.id,
- Dealer_subordinate__c = accountItem1.id
- );
- Dealer_elationship__c dealerelationship1 = new Dealer_elationship__c(
- Dealer_principal__c = accountItem1.id,
- Dealer_subordinate__c = accountItem1.id
- );
- insert new List<Dealer_elationship__c>{ dealerelationship, dealerelationship1 };
+ Dealer_elationship__c dealerelationship = new Dealer_elationship__c(Dealer_principal__c = accountItem1.id,Dealer_subordinate__c = accountItem1.id);
+ Dealer_elationship__c dealerelationship1 = new Dealer_elationship__c(Dealer_principal__c = accountItem1.id,Dealer_subordinate__c = accountItem1.id);
+ insert new Dealer_elationship__c[] {dealerelationship, dealerelationship1};
LexSummonsCreatController.ConsumableorderdetailsInfo c0 = new LexSummonsCreatController.ConsumableorderdetailsInfo();
c0.packinglist = 0;
@@ -456,9 +357,7 @@
Map<String, String> boxorpieceMap = new Map<String, String>();
boxorpieceMap.put('鐩�', '鐩�');
boxorpieceMap.put('涓�', '涓�');
- LexSummonsCreatController.ConsumableorderdetailsInfo coder = new LexSummonsCreatController.ConsumableorderdetailsInfo(
- conOrderDetail1
- );
+ LexSummonsCreatController.ConsumableorderdetailsInfo coder = new LexSummonsCreatController.ConsumableorderdetailsInfo(conOrderDetail1);
coder.check = true;
coder.oldCheck = true;
coder.hospitalSpecialOffer = true;
@@ -488,7 +387,7 @@
c3.Boxnumber = 10;
c1.compareTo(c3);
c1.Boxnumber = 20;
- c3.Boxnumber = 10;
+ c3.Boxnumber = 10;
c1.compareTo(c3);
c3.Boxnumber = 10;
c1.Boxnumber = 20;
@@ -594,7 +493,7 @@
codi.boxorpiecein = null;
codi.orderdetails1 = coc;
codi.Prod = pro1;
- consumable.add(codi);
+ consumable.add(codi);
List<SelectOption> categoryOptionList = new List<SelectOption>();
System.Test.startTest();
Integer size = Integer.valueOf(System.Label.orderdetLimitsize);
@@ -603,7 +502,7 @@
String arrive = null;
String alertMessage = null;
- String category1 = '3400PK:PK閽� 5mm脳33cm';
+ String category1= '3400PK:PK閽� 5mm脳33cm';
String Category3 = '鑵硅厰闀滄墜鏈�';
String Category4 = 'PK';
String Category5 = 'G400';
@@ -639,282 +538,69 @@
optionMap.put('', '-鏃�-');
optionMap.put('ishos', '鍖婚櫌鐗逛环浜у搧');
optionMap.put('nothos', '闈炲尰闄㈢壒浠蜂骇鍝�');
-
+
Integer count = LexSummonsCreatController.consumableorderdetailsCount;
Consumable_order__c cocOrderId = new Consumable_order__c();
LexSummonsCreatController.coc = cocOrderId;
String consumableorderId = LexSummonsCreatController.consumableorderId;
LexSummonsCreatController summonCC = new LexSummonsCreatController();
-
- LexSummonsCreatController.init(testList1.Id, 'Test', 1, 100, testList1.Id);
+
+ LexSummonsCreatController.init(testList1.Id,'Test',1,100,testList1.Id);
LexSummonsCreatController.firstInit(ESetId);
- LexSummonsCreatController.init(ESetId, statusEdit, 1, 100, arrive);
- LexSummonsCreatController.init(ESetId, statusEdit, 1, 100, createIdSend.Id);
- LexSummonsCreatController.init(createIdSend.Id, statusEdit, 1, 100, arrive);
- LexSummonsCreatController.init(createIdSend.Id, 'Test', 1, 100, createIdSend3.Id);
- LexSummonsCreatController.init(ESetId, 'Test', 1, 100, createIdSend.Id);
- LexSummonsCreatController.searchConsumableorderdetails(
- 'ENG',
- 'Testaccount001',
- '鍖椾含',
- 'ishos',
- 'Test07',
- 'CDS',
- 'OER',
- 'Celon',
- true,
- pageRecords,
- consumable,
- '',
- 1,
- 100
- );
- LexSummonsCreatController.searchConsumableorderdetails(
- 'ENG',
- 'Testaccount001',
- '鍖椾含',
- 'nothos',
- 'Test07',
- 'CDS',
- 'OER',
- 'Celon',
- true,
- pageRecords,
- consumable,
- '',
- 1,
- 100
- );
- LexSummonsCreatController.save(
- createIdSend2,
- '',
- '',
- '',
- pageRecordsLwcLwc,
- accountId,
- createIdSend2.Id,
- consumable,
- agencyProType,
- userWorkLocation
- );
- LexSummonsCreatController.save(
- createIdSend1,
- '',
- '',
- 'Test',
- pageRecordsLwcLwc,
- accountId,
- createIdSend1.Id,
- consumable,
- agencyProType,
- userWorkLocation
- );
- LexSummonsCreatController.save(
- createIdSend1,
- 'Test',
- 'Test',
- 'Test',
- pageRecordsLwcLwc,
- accountId,
- createIdSend1.Id,
- consumable,
- agencyProType,
- userWorkLocation
- );
- LexSummonsCreatController.save(
- createIdSend7,
- '',
- '',
- accountItem1.Id,
- pageRecordsLwcLwc,
- accountId,
- createIdSend7.Id,
- consumable,
- agencyProType,
- userWorkLocation
- );
- LexSummonsCreatController.save(
- createIdSend,
- 'Test',
- 'Test',
- 'Test',
- pageRecordsLwcLwc,
- accountId,
- createIdSend.Id,
- consumable,
- agencyProType,
- userWorkLocation
- );
- LexSummonsCreatController.save(
- createIdSend3,
- 'Test',
- 'Test',
- '',
- pageRecordsLwcLwc,
- accountId,
- createIdSend3.Id,
- consumable,
- agencyProType,
- userWorkLocation
- );
- LexSummonsCreatController.save(
- createIdSend3,
- '',
- '',
- 'Test',
- pageRecordsLwcLwc,
- accountId,
- createIdSend3.Id,
- consumable,
- agencyProType,
- userWorkLocation
- );
- LexSummonsCreatController.save(
- createIdSend3,
- 'Test',
- 'Test',
- 'Test',
- pageRecordsLwcLwc,
- accountId,
- createIdSend3.Id,
- consumable,
- agencyProType,
- userWorkLocation
- );
- LexSummonsCreatController.save(
- createIdSend4,
- '',
- '',
- '',
- pageRecordsLwcLwc,
- accountId,
- createIdSend4.Id,
- consumable,
- agencyProType,
- userWorkLocation
- );
- LexSummonsCreatController.save(
- createIdSend5,
- '',
- '',
- '',
- pageRecordsLwcLwc,
- accountId,
- createIdSend5.Id,
- consumable,
- agencyProType,
- userWorkLocation
- );
- LexSummonsCreatController.save(
- createIdSend5,
- '',
- '',
- 'Test',
- pageRecordsLwcLwc,
- accountId,
- createIdSend5.Id,
- consumable,
- agencyProType,
- userWorkLocation
- );
- LexSummonsCreatController.save(
- createIdSend5,
- 'Test',
- 'Test',
- 'Test',
- pageRecordsLwcLwc,
- accountId,
- createIdSend5.Id,
- consumable,
- agencyProType,
- userWorkLocation
- );
- LexSummonsCreatController.save(
- createIdSend8,
- accountId,
- 'Test',
- accountId,
- pageRecords,
- accountId,
- createIdSend8.Id,
- consumable,
- agencyProType,
- userWorkLocation
- );
- LexSummonsCreatController.save(
- createIdSend8,
- accountId,
- 'Test',
- null,
- pageRecordsLwc,
- accountId,
- createIdSend8.Id,
- consumable,
- agencyProType,
- userWorkLocation
- );
+ LexSummonsCreatController.init(ESetId,statusEdit,1,100,arrive);
+ LexSummonsCreatController.init(ESetId,statusEdit,1,100,createIdSend.Id);
+ LexSummonsCreatController.init(createIdSend.Id,statusEdit,1,100,arrive);
+ LexSummonsCreatController.init(createIdSend.Id,'Test',1,100,createIdSend3.Id);
+ LexSummonsCreatController.init(ESetId,'Test',1,100,createIdSend.Id);
+ LexSummonsCreatController.searchConsumableorderdetails('ENG','Testaccount001','鍖椾含','ishos','Test07','CDS','OER','Celon',true,pageRecords,consumable,'',1,100);
+ LexSummonsCreatController.searchConsumableorderdetails('ENG','Testaccount001','鍖椾含','nothos','Test07','CDS','OER','Celon',true,pageRecords,consumable,'',1,100);
+ LexSummonsCreatController.save(createIdSend2,'','','',pageRecordsLwcLwc,accountId,createIdSend2.Id,consumable,agencyProType,userWorkLocation);
+ LexSummonsCreatController.save(createIdSend1,'','','Test',pageRecordsLwcLwc,accountId,createIdSend1.Id,consumable,agencyProType,userWorkLocation);
+ LexSummonsCreatController.save(createIdSend1,'Test','Test','Test',pageRecordsLwcLwc,accountId,createIdSend1.Id,consumable,agencyProType,userWorkLocation);
+ LexSummonsCreatController.save(createIdSend7,'','',accountItem1.Id,pageRecordsLwcLwc,accountId,createIdSend7.Id,consumable,agencyProType,userWorkLocation);
+ LexSummonsCreatController.save(createIdSend,'Test','Test','Test',pageRecordsLwcLwc,accountId,createIdSend.Id,consumable,agencyProType,userWorkLocation);
+ LexSummonsCreatController.save(createIdSend3,'Test','Test','',pageRecordsLwcLwc,accountId,createIdSend3.Id,consumable,agencyProType,userWorkLocation);
+ LexSummonsCreatController.save(createIdSend3,'','','Test',pageRecordsLwcLwc,accountId,createIdSend3.Id,consumable,agencyProType,userWorkLocation);
+ LexSummonsCreatController.save(createIdSend3,'Test','Test','Test',pageRecordsLwcLwc,accountId,createIdSend3.Id,consumable,agencyProType,userWorkLocation);
+ LexSummonsCreatController.save(createIdSend4,'','','',pageRecordsLwcLwc,accountId,createIdSend4.Id,consumable,agencyProType,userWorkLocation);
+ LexSummonsCreatController.save(createIdSend5,'','','',pageRecordsLwcLwc,accountId,createIdSend5.Id,consumable,agencyProType,userWorkLocation);
+ LexSummonsCreatController.save(createIdSend5,'','','Test',pageRecordsLwcLwc,accountId,createIdSend5.Id,consumable,agencyProType,userWorkLocation);
+ LexSummonsCreatController.save(createIdSend5,'Test','Test','Test',pageRecordsLwcLwc,accountId,createIdSend5.Id,consumable,agencyProType,userWorkLocation);
+ LexSummonsCreatController.save(createIdSend8,accountId,'Test',accountId,pageRecords,accountId,createIdSend8.Id,consumable,agencyProType,userWorkLocation);
+ LexSummonsCreatController.save(createIdSend8,accountId,'Test',null,pageRecordsLwc,accountId,createIdSend8.Id,consumable,agencyProType,userWorkLocation);
LexSummonsCreatController.checkOutPattern();
- LexSummonsCreatController.PraseToPDF(createIdSend, createIdSend.Id);
+ LexSummonsCreatController.PraseToPDF(createIdSend,createIdSend.Id);
LexSummonsCreatController.search('Testaccount001');
- LexSummonsCreatController.GoodsDelivery(createIdSend, createIdSend.Id, pageRecordsLwcLwc);
- LexSummonsCreatController.GoodsDelivery(createIdSend3, createIdSend3.Id, pageRecords);
- LexSummonsCreatController.GoodsDelivery(createIdSend1, createIdSend1.Id, pageRecordsLwcLwc);
- LexSummonsCreatController.GoodsDelivery(createIdSend6, createIdSend6.Id, pageRecordsLwcLwc);
+ LexSummonsCreatController.GoodsDelivery(createIdSend,createIdSend.Id,pageRecordsLwcLwc);
+ LexSummonsCreatController.GoodsDelivery(createIdSend3,createIdSend3.Id,pageRecords);
+ LexSummonsCreatController.GoodsDelivery(createIdSend1,createIdSend1.Id,pageRecordsLwcLwc);
+ LexSummonsCreatController.GoodsDelivery(createIdSend6,createIdSend6.Id,pageRecordsLwcLwc);
LexSummonsCreatController.DelConsumable(createIdSend.Id);
System.Test.stopTest();
}
}
@isTest
- static void testSaveMethod() {
+ static void testSaveMethod(){
Account accountItem1;
Account accountItem2;
User userTest;
String rectCo = Schema.SObjectType.Account.getRecordTypeInfosByDeveloperName().get('Agency').getRecordTypeId();
String rectHp = Schema.SObjectType.Account.getRecordTypeInfosByDeveloperName().get('HP').getRecordTypeId();
- Profile prof = [
- SELECT Id
- FROM Profile
- WHERE Name = '901_缁忛攢鍟嗙ぞ鍖烘櫘閫氭潈闄恄2閲嶉獙璇�(ET)'
- ];
- accountItem1 = new Account(Name = 'Testaccount001', RecordTypeId = rectCo, AgentCode_Ext__c = '9999900');
+ Profile prof = [SELECT Id FROM Profile WHERE Name ='901_缁忛攢鍟嗙ぞ鍖烘櫘閫氭潈闄恄2閲嶉獙璇�(ET)'];
+ accountItem1 = new Account(Name='Testaccount001',RecordTypeId = rectCo, AgentCode_Ext__c = '9999900');
insert accountItem1;
- accountItem2 = new Account(
- Name = 'Testaccount002',
- RecordTypeId = rectHp,
- AgentCode_Ext__c = '9999999',
- ParentId = accountItem1.Id,
- Contract_Decide_Start_Date__c = Date.today(),
- ENG_Dealer__c = true,
- BillingCity = null
- );
+ accountItem2 = new Account(Name='Testaccount002',RecordTypeId = rectHp, AgentCode_Ext__c = '9999999', ParentId = accountItem1.Id,Contract_Decide_Start_Date__c = Date.today(),ENG_Dealer__c = true,BillingCity = null);
insert accountItem2;
- Contact core = new Contact(email = 'jplumber@salesforce.com', firstname = 'Joe', lastname = 'Plumber', accountId = accountItem1.Id);
+ Contact core = new Contact(email='jplumber@salesforce.com', firstname='Joe', lastname='Plumber', accountId = accountItem1.Id);
insert core;
System.runAs(new user(ID = UserInfo.getUserID())) {
- userTest = new User(
- ContactId = core.id,
- Alias = 'newUser',
- Email = 'newuser@testorg.com',
- EmailEncodingKey = 'UTF-8',
- LastName = 'TestUser',
- LanguageLocaleKey = 'zh_CN',
- LocaleSidKey = 'zh_CN',
- ProfileId = prof.Id,
- TimeZoneSidKey = 'Asia/Shanghai',
- UserName = 'testUser@testorg.com',
- UserPro_Type__c = 'ENG',
- Work_Location__c = '鍖椾含'
- );
+ userTest = New User(ContactId = core.id, Alias = 'newUser', Email='newuser@testorg.com', EmailEncodingKey='UTF-8', LastName='TestUser', LanguageLocaleKey='zh_CN', LocaleSidKey='zh_CN', ProfileId = prof.Id, TimeZoneSidKey='Asia/Shanghai', UserName='testUser@testorg.com', UserPro_Type__c='ENG', Work_Location__c='鍖椾含');
insert userTest;
}
- System.runAs(userTest) {
+ System.runAs(userTest){
String userId = UserInfo.getUserId();
- User thisUserInfo = [
- SELECT accountid, UserPro_Type__c, ContactId, Contact.AccountId, Contact.Account.Name, Work_Location__c
- FROM User
- WHERE id = :userId
- ];
+ User thisUserInfo = [SELECT accountid, UserPro_Type__c, ContactId, Contact.AccountId,Contact.Account.Name, Work_Location__c FROM User WHERE id =:userId];
String accountId = thisUserInfo.accountid;
String accountName = thisUserInfo.Contact.Account.Name;
String agencyProType = thisUserInfo.UserPro_Type__c;
@@ -924,28 +610,10 @@
if (String.isBlank(thisUserInfo.UserPro_Type__c)) {
agencyProType = 'ET';
}
- Product2 prod07 = new Product2(
- Name = 'Test07',
- ProductCode = 'Test07',
- Asset_Model_No__c = 'Test07',
- Category3__c = 'Test7',
- Category4__c = 'Test77',
- Category5__c = 'Test777',
- SFDA_Status__c = '鏈夊姽',
- Dealer_special_Object__c = true,
- Packing_list_manual__c = 1,
- Manual_Entry__c = false
- );
- insert new List<Product2>{ prod07 };
- Product2__c pro1 = new Product2__c(
- Name = 'MH-155:鐧藉钩琛″附',
- OT_CODE_Text__c = 'Test001',
- Product2__c = prod07.Id,
- Category3_text__c = 'test123',
- Category4_text__c = 'test123',
- Category5_text__c = 'test123'
- );
- insert new List<Product2__c>{ pro1 };
+ Product2 prod07 = new Product2(Name='Test07',ProductCode='Test07',Asset_Model_No__c = 'Test07',Category3__c = 'Test7',Category4__c = 'Test77',Category5__c = 'Test777',SFDA_Status__c = '鏈夊姽',Dealer_special_Object__c = true,Packing_list_manual__c = 1,Manual_Entry__c = false);
+ insert new Product2[] {prod07};
+ Product2__c pro1 = new Product2__c(Name='MH-155:鐧藉钩琛″附',OT_CODE_Text__c='Test001',Product2__c = prod07.Id,Category3_text__c = 'test123', Category4_text__c = 'test123', Category5_text__c = 'test123');
+ insert new Product2__c[] {pro1};
Consumable_order__c createIdSend = new Consumable_order__c();
createIdSend.Name = 'testMing1';
createIdSend.Order_status__c = '鎵瑰噯';
@@ -973,8 +641,8 @@
createIdSend1.SummonsStatus_c__c = '浠锋牸鏈畾';
createIdSend1.Dealer_Info__c = accountItem1.Id;
createIdSend1.Delivery_detail_count__c = 5;
- insert new List<Consumable_order__c>{ createIdSend, createIdSend1 };
-
+ insert new Consumable_order__c[]{createIdSend,createIdSend1};
+
Consumable_orderdetails__c coc = new Consumable_orderdetails__c();
coc.Name = 'Too001';
coc.Dealer_Custom_Price__c = 999.00;
@@ -1026,7 +694,7 @@
coc3.Delivery_List_RMB__c = 100.00;
coc3.Shipment_Count__c = 9999.00;
coc3.RecordTypeid = System.Label.RT_ConOrderDetail1_Order;
- insert new List<Consumable_orderdetails__c>{ coc, coc1, coc2, coc3 };
+ insert new Consumable_orderdetails__c[]{coc,coc1,coc2,coc3};
Consumable_order_details2__c conOrderDetail1 = new Consumable_order_details2__c();
conOrderDetail1.Name = 'OCM_01_001001';
@@ -1043,7 +711,8 @@
conOrderDetail1.Cancellation_Flag__c = false;
conOrderDetail1.Box_Piece__c = '鐩�';
conOrderDetail1.Sterilization_limit__c = Date.Today();
- insert new List<Consumable_order_details2__c>{ conOrderDetail1 };
+ insert new Consumable_order_details2__c[]{conOrderDetail1};
+
List<LexSummonsCreatController.ConsumableorderdetailsInfoLwc> pageRecords = new List<LexSummonsCreatController.ConsumableorderdetailsInfoLwc>();
LexSummonsCreatController.ConsumableorderdetailsInfoLwc c0 = new LexSummonsCreatController.ConsumableorderdetailsInfoLwc();
@@ -1199,134 +868,39 @@
codi.boxorpiecein = null;
codi.orderdetails1 = coc;
codi.Prod = pro1;
- consumable.add(codi);
+ consumable.add(codi);
System.Test.startTest();
- LexSummonsCreatController.save(
- createIdSend,
- '',
- '',
- '',
- pageRecords,
- accountId,
- createIdSend.Id,
- consumable,
- agencyProType,
- userWorkLocation
- );
- LexSummonsCreatController.save(
- createIdSend,
- '',
- '',
- '',
- pageRecords1,
- accountId,
- createIdSend.Id,
- consumable,
- agencyProType,
- userWorkLocation
- );
- LexSummonsCreatController.save(
- createIdSend,
- '',
- '',
- '',
- pageRecords2,
- accountId,
- createIdSend.Id,
- consumable,
- agencyProType,
- userWorkLocation
- );
- LexSummonsCreatController.save(
- createIdSend,
- '',
- '',
- '',
- pageRecords3,
- accountId,
- createIdSend.Id,
- consumable,
- agencyProType,
- userWorkLocation
- );
- LexSummonsCreatController.save(
- createIdSend,
- '',
- '',
- '',
- pageRecords0,
- accountId,
- createIdSend.Id,
- consumable,
- agencyProType,
- userWorkLocation
- );
- LexSummonsCreatController.save(
- createIdSend,
- '',
- '',
- '',
- pageRecords4,
- accountId,
- createIdSend.Id,
- consumable,
- agencyProType,
- userWorkLocation
- );
+ LexSummonsCreatController.save(createIdSend,'','','',pageRecords,accountId,createIdSend.Id,consumable,agencyProType,userWorkLocation);
+ LexSummonsCreatController.save(createIdSend,'','','',pageRecords1,accountId,createIdSend.Id,consumable,agencyProType,userWorkLocation);
+ LexSummonsCreatController.save(createIdSend,'','','',pageRecords2,accountId,createIdSend.Id,consumable,agencyProType,userWorkLocation);
+ LexSummonsCreatController.save(createIdSend,'','','',pageRecords3,accountId,createIdSend.Id,consumable,agencyProType,userWorkLocation);
+ LexSummonsCreatController.save(createIdSend,'','','',pageRecords0,accountId,createIdSend.Id,consumable,agencyProType,userWorkLocation);
+ LexSummonsCreatController.save(createIdSend,'','','',pageRecords4,accountId,createIdSend.Id,consumable,agencyProType,userWorkLocation);
System.Test.stopTest();
}
}
@isTest
- static void testSaveMethod1() {
+ static void testSaveMethod1(){
Account accountItem1;
Account accountItem2;
User userTest;
String rectCo = Schema.SObjectType.Account.getRecordTypeInfosByDeveloperName().get('Agency').getRecordTypeId();
String rectHp = Schema.SObjectType.Account.getRecordTypeInfosByDeveloperName().get('HP').getRecordTypeId();
- Profile prof = [
- SELECT Id
- FROM Profile
- WHERE Name = '901_缁忛攢鍟嗙ぞ鍖烘櫘閫氭潈闄恄2閲嶉獙璇�(ET)'
- ];
- accountItem1 = new Account(Name = 'Testaccount001', RecordTypeId = rectCo, AgentCode_Ext__c = '9999900');
+ Profile prof = [SELECT Id FROM Profile WHERE Name ='901_缁忛攢鍟嗙ぞ鍖烘櫘閫氭潈闄恄2閲嶉獙璇�(ET)'];
+ accountItem1 = new Account(Name='Testaccount001',RecordTypeId = rectCo, AgentCode_Ext__c = '9999900');
insert accountItem1;
- accountItem2 = new Account(
- Name = 'Testaccount002',
- RecordTypeId = rectHp,
- AgentCode_Ext__c = '9999999',
- ParentId = accountItem1.Id,
- Contract_Decide_Start_Date__c = Date.today(),
- ENG_Dealer__c = true,
- BillingCity = null
- );
+ accountItem2 = new Account(Name='Testaccount002',RecordTypeId = rectHp, AgentCode_Ext__c = '9999999', ParentId = accountItem1.Id,Contract_Decide_Start_Date__c = Date.today(),ENG_Dealer__c = true,BillingCity = null);
insert accountItem2;
- Contact core = new Contact(email = 'jplumber@salesforce.com', firstname = 'Joe', lastname = 'Plumber', accountId = accountItem1.Id);
+ Contact core = new Contact(email='jplumber@salesforce.com', firstname='Joe', lastname='Plumber', accountId = accountItem1.Id);
insert core;
System.runAs(new user(ID = UserInfo.getUserID())) {
- userTest = new User(
- ContactId = core.id,
- Alias = 'newUser',
- Email = 'newuser@testorg.com',
- EmailEncodingKey = 'UTF-8',
- LastName = 'TestUser',
- LanguageLocaleKey = 'zh_CN',
- LocaleSidKey = 'zh_CN',
- ProfileId = prof.Id,
- TimeZoneSidKey = 'Asia/Shanghai',
- UserName = 'testUser@testorg.com',
- UserPro_Type__c = 'ENG',
- Work_Location__c = '鍖椾含'
- );
+ userTest = New User(ContactId = core.id, Alias = 'newUser', Email='newuser@testorg.com', EmailEncodingKey='UTF-8', LastName='TestUser', LanguageLocaleKey='zh_CN', LocaleSidKey='zh_CN', ProfileId = prof.Id, TimeZoneSidKey='Asia/Shanghai', UserName='testUser@testorg.com', UserPro_Type__c='ENG', Work_Location__c='鍖椾含');
insert userTest;
}
- System.runAs(userTest) {
+ System.runAs(userTest){
String userId = UserInfo.getUserId();
- User thisUserInfo = [
- SELECT accountid, UserPro_Type__c, ContactId, Contact.AccountId, Contact.Account.Name, Work_Location__c
- FROM User
- WHERE id = :userId
- ];
+ User thisUserInfo = [SELECT accountid, UserPro_Type__c, ContactId, Contact.AccountId,Contact.Account.Name, Work_Location__c FROM User WHERE id =:userId];
String accountId = thisUserInfo.accountid;
String accountName = thisUserInfo.Contact.Account.Name;
String agencyProType = thisUserInfo.UserPro_Type__c;
@@ -1336,31 +910,11 @@
if (String.isBlank(thisUserInfo.UserPro_Type__c)) {
agencyProType = 'ET';
}
- Product2 prod07 = new Product2(
- Name = 'Test07',
- ProductCode = 'Test07',
- Asset_Model_No__c = 'Test07',
- Category3__c = 'Test7',
- Category4__c = 'Test77',
- Category5__c = 'Test777',
- SFDA_Status__c = '鏈夊姽',
- Intra_Trade_List_RMB_End_Date1__c = Date.Today(),
- Intra_Trade_List_RMB_Date2__c = null,
- Intra_Trade_List_RMB_1__c = 1,
- Dealer_special_Object__c = true,
- Packing_list_manual__c = 1,
- Manual_Entry__c = false
- );
- insert new List<Product2>{ prod07 };
- Product2__c pro1 = new Product2__c(
- Name = 'MH-155:鐧藉钩琛″附',
- OT_CODE_Text__c = 'Test001',
- Product2__c = prod07.Id,
- Category3_text__c = 'test123',
- Category4_text__c = 'test123',
- Category5_text__c = 'test123'
- );
- insert new List<Product2__c>{ pro1 };
+ Product2 prod07 = new Product2(Name='Test07',ProductCode='Test07',Asset_Model_No__c = 'Test07',Category3__c = 'Test7',Category4__c = 'Test77',Category5__c = 'Test777',SFDA_Status__c = '鏈夊姽',
+ Intra_Trade_List_RMB_End_Date1__c = Date.Today(),Intra_Trade_List_RMB_Date2__c = null ,Intra_Trade_List_RMB_1__c = 1,Dealer_special_Object__c = true,Packing_list_manual__c = 1,Manual_Entry__c = false);
+ insert new Product2[] {prod07};
+ Product2__c pro1 = new Product2__c(Name='MH-155:鐧藉钩琛″附',OT_CODE_Text__c='Test001',Product2__c = prod07.Id,Category3_text__c = 'test123', Category4_text__c = 'test123', Category5_text__c = 'test123');
+ insert new Product2__c[] {pro1};
Consumable_order__c createIdSend = new Consumable_order__c();
createIdSend.Name = 'testMing1';
createIdSend.Order_status__c = '鎵瑰噯';
@@ -1388,8 +942,8 @@
createIdSend1.SummonsStatus_c__c = '浠锋牸鏈畾';
createIdSend1.Dealer_Info__c = accountItem1.Id;
createIdSend1.Delivery_detail_count__c = 5;
- insert new List<Consumable_order__c>{ createIdSend, createIdSend1 };
-
+ insert new Consumable_order__c[]{createIdSend,createIdSend1};
+
Consumable_orderdetails__c coc = new Consumable_orderdetails__c();
coc.Name = 'Too001';
coc.Dealer_Custom_Price__c = 999.00;
@@ -1488,7 +1042,7 @@
coc7.Delivery_List_RMB__c = 100;
coc7.Shipment_Count__c = 0;
coc7.RecordTypeid = System.Label.RT_ConOrderDetail1_Order;
- insert new List<Consumable_orderdetails__c>{ coc, coc1, coc2, coc3, coc4, coc5, coc6, coc7 };
+ insert new Consumable_orderdetails__c[]{coc,coc1,coc2,coc3,coc4,coc5,coc6,coc7};
Consumable_order_details2__c conOrderDetail1 = new Consumable_order_details2__c();
conOrderDetail1.Name = 'OCM_01_001001';
@@ -1505,7 +1059,7 @@
conOrderDetail1.Cancellation_Flag__c = false;
conOrderDetail1.Box_Piece__c = '鐩�';
conOrderDetail1.Sterilization_limit__c = Date.Today();
- insert new List<Consumable_order_details2__c>{ conOrderDetail1 };
+ insert new Consumable_order_details2__c[]{conOrderDetail1};
List<LexSummonsCreatController.ConsumableorderdetailsInfoLwc> pageRecords = new List<LexSummonsCreatController.ConsumableorderdetailsInfoLwc>();
LexSummonsCreatController.ConsumableorderdetailsInfoLwc c0 = new LexSummonsCreatController.ConsumableorderdetailsInfoLwc();
c0.check = true;
@@ -1612,113 +1166,37 @@
codi.boxorpiecein = null;
codi.orderdetails1 = coc;
codi.Prod = pro1;
- consumable.add(codi);
+ consumable.add(codi);
System.Test.startTest();
- LexSummonsCreatController.save(
- createIdSend,
- '',
- '',
- '',
- pageRecords,
- accountId,
- createIdSend.Id,
- consumable,
- agencyProType,
- userWorkLocation
- );
- LexSummonsCreatController.save(
- createIdSend,
- '',
- '',
- '',
- pageRecords1,
- accountId,
- createIdSend.Id,
- consumable,
- agencyProType,
- userWorkLocation
- );
- LexSummonsCreatController.save(
- createIdSend,
- '',
- '',
- '',
- pageRecords2,
- accountId,
- createIdSend.Id,
- consumable,
- agencyProType,
- userWorkLocation
- );
- LexSummonsCreatController.save(
- createIdSend,
- '',
- '',
- '',
- pageRecords3,
- accountId,
- createIdSend.Id,
- consumable,
- agencyProType,
- userWorkLocation
- );
+ LexSummonsCreatController.save(createIdSend,'','','',pageRecords,accountId,createIdSend.Id,consumable,agencyProType,userWorkLocation);
+ LexSummonsCreatController.save(createIdSend,'','','',pageRecords1,accountId,createIdSend.Id,consumable,agencyProType,userWorkLocation);
+ LexSummonsCreatController.save(createIdSend,'','','',pageRecords2,accountId,createIdSend.Id,consumable,agencyProType,userWorkLocation);
+ LexSummonsCreatController.save(createIdSend,'','','',pageRecords3,accountId,createIdSend.Id,consumable,agencyProType,userWorkLocation);
System.Test.stopTest();
}
}
@isTest
- static void testSave() {
+ static void testSave(){
Account accountItem1;
Account accountItem2;
User userTest;
String rectCo = Schema.SObjectType.Account.getRecordTypeInfosByDeveloperName().get('Agency').getRecordTypeId();
String rectHp = Schema.SObjectType.Account.getRecordTypeInfosByDeveloperName().get('HP').getRecordTypeId();
- Profile prof = [
- SELECT Id
- FROM Profile
- WHERE Name = '901_缁忛攢鍟嗙ぞ鍖烘櫘閫氭潈闄恄2閲嶉獙璇�(ET)'
- ];
- accountItem1 = new Account(
- Name = 'Testaccount001',
- RecordTypeId = rectCo,
- AgentCode_Ext__c = '9999900',
- Contract_Decide_Start_Date__c = Date.today(),
- ENG_Dealer__c = true
- );
+ Profile prof = [SELECT Id FROM Profile WHERE Name ='901_缁忛攢鍟嗙ぞ鍖烘櫘閫氭潈闄恄2閲嶉獙璇�(ET)'];
+ accountItem1 = new Account(Name='Testaccount001',RecordTypeId = rectCo, AgentCode_Ext__c = '9999900',Contract_Decide_Start_Date__c = Date.today(),ENG_Dealer__c = true);
insert accountItem1;
- accountItem2 = new Account(
- Name = 'Testaccount002',
- RecordTypeId = rectHp,
- AgentCode_Ext__c = '9999999',
- ParentId = accountItem1.Id
- );
+ accountItem2 = new Account(Name='Testaccount002',RecordTypeId = rectHp, AgentCode_Ext__c = '9999999', ParentId = accountItem1.Id);
insert accountItem2;
- Contact core = new Contact(email = 'jplumber@salesforce.com', firstname = 'Joe', lastname = 'Plumber', accountId = accountItem1.Id);
+ Contact core = new Contact(email='jplumber@salesforce.com', firstname='Joe', lastname='Plumber', accountId = accountItem1.Id);
insert core;
System.runAs(new user(ID = UserInfo.getUserID())) {
- userTest = new User(
- ContactId = core.id,
- Alias = 'newUser',
- Email = 'newuser@testorg.com',
- EmailEncodingKey = 'UTF-8',
- LastName = 'TestUser',
- LanguageLocaleKey = 'zh_CN',
- LocaleSidKey = 'zh_CN',
- ProfileId = prof.Id,
- TimeZoneSidKey = 'Asia/Shanghai',
- UserName = 'testUser@testorg.com',
- UserPro_Type__c = 'ENG',
- Work_Location__c = '鍖椾含'
- );
+ userTest = New User(ContactId = core.id, Alias = 'newUser', Email='newuser@testorg.com', EmailEncodingKey='UTF-8', LastName='TestUser', LanguageLocaleKey='zh_CN', LocaleSidKey='zh_CN', ProfileId = prof.Id, TimeZoneSidKey='Asia/Shanghai', UserName='testUser@testorg.com', UserPro_Type__c='ENG', Work_Location__c='鍖椾含');
insert userTest;
}
- System.runAs(userTest) {
+ System.runAs(userTest){
String userId = UserInfo.getUserId();
- User thisUserInfo = [
- SELECT accountid, UserPro_Type__c, ContactId, Contact.AccountId, Contact.Account.Name, Work_Location__c
- FROM User
- WHERE id = :userId
- ];
+ User thisUserInfo = [SELECT accountid, UserPro_Type__c, ContactId, Contact.AccountId,Contact.Account.Name, Work_Location__c FROM User WHERE id =:userId];
String accountId = thisUserInfo.accountid;
String accountName = thisUserInfo.Contact.Account.Name;
String agencyProType = thisUserInfo.UserPro_Type__c;
@@ -1728,28 +1206,10 @@
if (String.isBlank(thisUserInfo.UserPro_Type__c)) {
agencyProType = 'ET';
}
- Product2 prod07 = new Product2(
- Name = 'Test07',
- ProductCode = 'Test07',
- Asset_Model_No__c = 'Test07',
- Category3__c = 'Test7',
- Category4__c = 'Test77',
- Category5__c = 'Test777',
- SFDA_Status__c = '鏈夊姽',
- Dealer_special_Object__c = true,
- Packing_list_manual__c = 1,
- Manual_Entry__c = false
- );
- insert new List<Product2>{ prod07 };
- Product2__c pro1 = new Product2__c(
- Name = 'MH-155:鐧藉钩琛″附',
- OT_CODE_Text__c = 'Test001',
- Product2__c = prod07.Id,
- Category3_text__c = 'test123',
- Category4_text__c = 'test123',
- Category5_text__c = 'test123'
- );
- insert new List<Product2__c>{ pro1 };
+ Product2 prod07 = new Product2(Name='Test07',ProductCode='Test07',Asset_Model_No__c = 'Test07',Category3__c = 'Test7',Category4__c = 'Test77',Category5__c = 'Test777',SFDA_Status__c = '鏈夊姽',Dealer_special_Object__c = true,Packing_list_manual__c = 1,Manual_Entry__c = false);
+ insert new Product2[] {prod07};
+ Product2__c pro1 = new Product2__c(Name='MH-155:鐧藉钩琛″附',OT_CODE_Text__c='Test001',Product2__c = prod07.Id,Category3_text__c = 'test123', Category4_text__c = 'test123', Category5_text__c = 'test123');
+ insert new Product2__c[] {pro1};
Consumable_order__c createIdSend = new Consumable_order__c();
createIdSend.Name = 'testMing1';
@@ -1795,7 +1255,7 @@
createIdSend2.SummonsStatus_c__c = '浠锋牸鏈畾';
createIdSend2.Dealer_Info__c = accountItem1.Id;
createIdSend2.Delivery_detail_count__c = 5;
- insert new List<Consumable_order__c>{ createIdSend, createIdSend1, createIdSend2 };
+ insert new Consumable_order__c[] {createIdSend,createIdSend1,createIdSend2};
Consumable_orderdetails__c coc = new Consumable_orderdetails__c();
coc.Name = 'Too001';
@@ -1869,7 +1329,7 @@
coc5.Delivery_List_RMB__c = 100;
coc5.Shipment_Count__c = 10000;
coc5.RecordTypeid = System.Label.RT_ConOrderDetail1_Order;
- insert new List<Consumable_orderdetails__c>{ coc, coc1, coc2, coc3, coc4, coc5 };
+ insert new Consumable_orderdetails__c[]{coc,coc1,coc2,coc3,coc4,coc5};
Consumable_order_details2__c conOrderDetail1 = new Consumable_order_details2__c();
conOrderDetail1.Name = 'OCM_01_001001';
@@ -1884,13 +1344,13 @@
conOrderDetail1.Consumable_order_minor__c = createIdSend.Id;
conOrderDetail1.Lose_Flag__c = false;
conOrderDetail1.Box_Piece__c = '鐩�';
- insert new List<Consumable_order_details2__c>{ conOrderDetail1 };
-
+ insert new Consumable_order_details2__c[]{conOrderDetail1};
+
hospitalprice__c hp1 = new hospitalprice__c();
hp1.hospital__c = accountId;
hp1.account__c = accountId;
hp1.product__c = pro1.Id;
- insert new List<hospitalprice__c>{ hp1 };
+ insert new hospitalprice__c[]{hp1};
List<LexSummonsCreatController.ConsumableorderdetailsInfoLwc> pageRecordsList = new List<LexSummonsCreatController.ConsumableorderdetailsInfoLwc>();
LexSummonsCreatController.ConsumableorderdetailsInfoLwc cod = new LexSummonsCreatController.ConsumableorderdetailsInfoLwc();
@@ -2018,161 +1478,41 @@
String arrive = createIdSend.Id;
System.Test.startTest();
LexSummonsCreatController.firstInit(ESetId);
- LexSummonsCreatController.init(ESetId, statusEdit, 1, 100, arrive);
- LexSummonsCreatController.init(ESetId, null, 1, 100, arrive);
- LexSummonsCreatController.GoodsDelivery(createIdSend2, createIdSend2.Id, pageRecords);
- LexSummonsCreatController.save(
- createIdSend,
- accountId,
- 'Test',
- accountItem1.Id,
- pageRecordsList,
- accountId,
- createIdSend.Id,
- consumable,
- agencyProType,
- userWorkLocation
- );
- LexSummonsCreatController.save(
- createIdSend,
- accountId,
- 'Test',
- accountItem1.Id,
- pageRecords,
- accountId,
- createIdSend.Id,
- consumable,
- agencyProType,
- userWorkLocation
- );
- LexSummonsCreatController.save(
- createIdSend,
- accountId,
- 'Test',
- accountItem1.Id,
- null,
- accountId,
- createIdSend.Id,
- null,
- agencyProType,
- userWorkLocation
- );
- LexSummonsCreatController.save(
- createIdSend,
- accountId,
- 'Test',
- accountItem1.Id,
- pageRecords,
- accountId,
- null,
- consumableList,
- agencyProType,
- userWorkLocation
- );
- LexSummonsCreatController.save(
- createIdSend2,
- accountId,
- 'Test',
- null,
- pageRecords,
- accountId,
- createIdSend2.Id,
- null,
- agencyProType,
- userWorkLocation
- );
- LexSummonsCreatController.save(
- createIdSend2,
- accountId,
- 'Test',
- null,
- pageRecords2,
- accountId,
- createIdSend2.Id,
- null,
- agencyProType,
- userWorkLocation
- );
- LexSummonsCreatController.save(
- createIdSend2,
- accountId,
- 'Test',
- null,
- pageRecords3,
- accountId,
- createIdSend2.Id,
- null,
- agencyProType,
- userWorkLocation
- );
- LexSummonsCreatController.save(
- createIdSend1,
- '',
- '',
- accountItem1.Id,
- pageRecords3,
- accountId,
- createIdSend2.Id,
- null,
- agencyProType,
- userWorkLocation
- );
+ LexSummonsCreatController.init(ESetId,statusEdit,1,100,arrive);
+ LexSummonsCreatController.init(ESetId,null,1,100,arrive);
+ LexSummonsCreatController.GoodsDelivery(createIdSend2,createIdSend2.Id,pageRecords);
+ LexSummonsCreatController.save(createIdSend,accountId,'Test',accountItem1.Id,pageRecordsList,accountId,createIdSend.Id,consumable,agencyProType,userWorkLocation);
+ LexSummonsCreatController.save(createIdSend,accountId,'Test',accountItem1.Id,pageRecords,accountId,createIdSend.Id,consumable,agencyProType,userWorkLocation);
+ LexSummonsCreatController.save(createIdSend,accountId,'Test',accountItem1.Id,null,accountId,createIdSend.Id,null,agencyProType,userWorkLocation);
+ LexSummonsCreatController.save(createIdSend,accountId,'Test',accountItem1.Id,pageRecords,accountId,null,consumableList,agencyProType,userWorkLocation);
+ LexSummonsCreatController.save(createIdSend2,accountId,'Test',null,pageRecords,accountId,createIdSend2.Id,null,agencyProType,userWorkLocation);
+ LexSummonsCreatController.save(createIdSend2,accountId,'Test',null,pageRecords2,accountId,createIdSend2.Id,null,agencyProType,userWorkLocation);
+ LexSummonsCreatController.save(createIdSend2,accountId,'Test',null,pageRecords3,accountId,createIdSend2.Id,null,agencyProType,userWorkLocation);
+ LexSummonsCreatController.save(createIdSend1,'','',accountItem1.Id,pageRecords3,accountId,createIdSend2.Id,null,agencyProType,userWorkLocation);
System.Test.stopTest();
}
}
@isTest
- static void testAttachment() {
+ static void testAttachment(){
Account accountItem1;
Account accountItem2;
User userTest;
String rectCo = Schema.SObjectType.Account.getRecordTypeInfosByDeveloperName().get('Agency').getRecordTypeId();
String rectHp = Schema.SObjectType.Account.getRecordTypeInfosByDeveloperName().get('HP').getRecordTypeId();
- Profile prof = [
- SELECT Id
- FROM Profile
- WHERE Name = '901_缁忛攢鍟嗙ぞ鍖烘櫘閫氭潈闄恄2閲嶉獙璇�(ET)'
- ];
- accountItem1 = new Account(
- Name = 'Testaccount001',
- RecordTypeId = rectCo,
- AgentCode_Ext__c = '9999900',
- Contract_Decide_Start_Date__c = Date.today(),
- ENG_Dealer__c = true
- );
+ Profile prof = [SELECT Id FROM Profile WHERE Name ='901_缁忛攢鍟嗙ぞ鍖烘櫘閫氭潈闄恄2閲嶉獙璇�(ET)'];
+ accountItem1 = new Account(Name='Testaccount001',RecordTypeId = rectCo, AgentCode_Ext__c = '9999900',Contract_Decide_Start_Date__c = Date.today(),ENG_Dealer__c = true);
insert accountItem1;
- accountItem2 = new Account(
- Name = 'Testaccount002',
- RecordTypeId = rectHp,
- AgentCode_Ext__c = '9999999',
- ParentId = accountItem1.Id
- );
+ accountItem2 = new Account(Name='Testaccount002',RecordTypeId = rectHp, AgentCode_Ext__c = '9999999', ParentId = accountItem1.Id);
insert accountItem2;
- Contact core = new Contact(email = 'jplumber@salesforce.com', firstname = 'Joe', lastname = 'Plumber', accountId = accountItem1.Id);
+ Contact core = new Contact(email='jplumber@salesforce.com', firstname='Joe', lastname='Plumber', accountId = accountItem1.Id);
insert core;
System.runAs(new user(ID = UserInfo.getUserID())) {
- userTest = new User(
- ContactId = core.id,
- Alias = 'newUser',
- Email = 'newuser@testorg.com',
- EmailEncodingKey = 'UTF-8',
- LastName = 'TestUser',
- LanguageLocaleKey = 'zh_CN',
- LocaleSidKey = 'zh_CN',
- ProfileId = prof.Id,
- TimeZoneSidKey = 'Asia/Shanghai',
- UserName = 'testUser@testorg.com',
- UserPro_Type__c = 'ENG',
- Work_Location__c = '鍖椾含'
- );
+ userTest = New User(ContactId = core.id, Alias = 'newUser', Email='newuser@testorg.com', EmailEncodingKey='UTF-8', LastName='TestUser', LanguageLocaleKey='zh_CN', LocaleSidKey='zh_CN', ProfileId = prof.Id, TimeZoneSidKey='Asia/Shanghai', UserName='testUser@testorg.com', UserPro_Type__c='ENG', Work_Location__c='鍖椾含');
insert userTest;
}
- System.runAs(userTest) {
+ System.runAs(userTest){
String userId = UserInfo.getUserId();
- User thisUserInfo = [
- SELECT accountid, UserPro_Type__c, ContactId, Contact.AccountId, Contact.Account.Name, Work_Location__c
- FROM User
- WHERE id = :userId
- ];
+ User thisUserInfo = [SELECT accountid, UserPro_Type__c, ContactId, Contact.AccountId,Contact.Account.Name, Work_Location__c FROM User WHERE id =:userId];
String accountId = thisUserInfo.accountid;
String accountName = thisUserInfo.Contact.Account.Name;
String agencyProType = thisUserInfo.UserPro_Type__c;
@@ -2182,28 +1522,10 @@
if (String.isBlank(thisUserInfo.UserPro_Type__c)) {
agencyProType = 'ET';
}
- Product2 prod07 = new Product2(
- Name = 'Test07',
- ProductCode = 'Test07',
- Asset_Model_No__c = 'Test07',
- Category3__c = 'Test7',
- Category4__c = 'Test77',
- Category5__c = 'Test777',
- SFDA_Status__c = '鏈夊姽',
- Dealer_special_Object__c = true,
- Packing_list_manual__c = 1,
- Manual_Entry__c = false
- );
- insert new List<Product2>{ prod07 };
- Product2__c pro1 = new Product2__c(
- Name = 'MH-155:鐧藉钩琛″附',
- OT_CODE_Text__c = 'Test001',
- Product2__c = prod07.Id,
- Category3_text__c = 'test123',
- Category4_text__c = 'test123',
- Category5_text__c = 'test123'
- );
- insert new List<Product2__c>{ pro1 };
+ Product2 prod07 = new Product2(Name='Test07',ProductCode='Test07',Asset_Model_No__c = 'Test07',Category3__c = 'Test7',Category4__c = 'Test77',Category5__c = 'Test777',SFDA_Status__c = '鏈夊姽',Dealer_special_Object__c = true,Packing_list_manual__c = 1,Manual_Entry__c = false);
+ insert new Product2[] {prod07};
+ Product2__c pro1 = new Product2__c(Name='MH-155:鐧藉钩琛″附',OT_CODE_Text__c='Test001',Product2__c = prod07.Id,Category3_text__c = 'test123', Category4_text__c = 'test123', Category5_text__c = 'test123');
+ insert new Product2__c[] {pro1};
//鍙戣揣
Consumable_order__c createIdSend = new Consumable_order__c();
createIdSend.Name = 'testMing1';
@@ -2246,7 +1568,7 @@
createIdSend2.SummonsStatus_c__c = '鎵瑰噯';
createIdSend2.Dealer_Info__c = accountItem1.Id;
createIdSend2.Delivery_detail_count__c = 5;
- insert new List<Consumable_order__c>{ createIdSend, createIdSend1, createIdSend2 };
+ insert new Consumable_order__c[] {createIdSend,createIdSend1,createIdSend2};
Consumable_orderdetails__c coc = new Consumable_orderdetails__c();
coc.Name = 'Too001';
@@ -2272,7 +1594,7 @@
coc2.Delivery_List_RMB__c = 0;
coc2.Shipment_Count__c = 0;
coc2.RecordTypeid = System.Label.RT_ConOrderDetail1_Order;
- insert new List<Consumable_orderdetails__c>{ coc, coc2 };
+ insert new Consumable_orderdetails__c[]{coc,coc2};
Consumable_order_details2__c conOrderDetail1 = new Consumable_order_details2__c();
conOrderDetail1.Name = 'OCM_01_001001';
@@ -2287,21 +1609,21 @@
conOrderDetail1.Consumable_order_minor__c = createIdSend.Id;
conOrderDetail1.Lose_Flag__c = false;
conOrderDetail1.Box_Piece__c = '鐩�';
- insert new List<Consumable_order_details2__c>{ conOrderDetail1 };
-
+ insert new Consumable_order_details2__c[]{conOrderDetail1};
+
hospitalprice__c hp1 = new hospitalprice__c();
hp1.hospital__c = accountId;
hp1.account__c = accountId;
hp1.product__c = pro1.Id;
- insert new List<hospitalprice__c>{ hp1 };
+ insert new hospitalprice__c[]{hp1};
- Attachment attach = new Attachment();
- attach.Name = 'A-65224941-20200923--1.docx';
- Blob bodyBlob = Blob.valueOf('Unit Test Attachment Body');
+ Attachment attach = new Attachment();
+ attach.Name='A-65224941-20200923--1.docx';
+ Blob bodyBlob= Blob.valueOf('Unit Test Attachment Body');
attach.body = bodyBlob;
attach.ParentId = createIdSend.id;
attach.ContentType = 'application/pdf';
- insert new List<Attachment>{ attach };
+ insert new Attachment[] {attach};
System.Test.startTest();
List<LexSummonsCreatController.ConsumableorderdetailsInfoLwc> pageRecordsLwcLwc = new List<LexSummonsCreatController.ConsumableorderdetailsInfoLwc>();
@@ -2311,7 +1633,7 @@
c5.orderdetails1 = coc;
c5.allnumber = 1999.00;
pageRecordsLwcLwc.add(c5);
- List<LexSummonsCreatController.ConsumableorderdetailsInfoLwc> pageRecordsList = new List<LexSummonsCreatController.ConsumableorderdetailsInfoLwc>();
+ List<LexSummonsCreatController.ConsumableorderdetailsInfoLwc> pageRecordsList= new List<LexSummonsCreatController.ConsumableorderdetailsInfoLwc>();
LexSummonsCreatController.ConsumableorderdetailsInfoLwc c8 = new LexSummonsCreatController.ConsumableorderdetailsInfoLwc();
c8.check = true;
c8.hospitalSpecialOffer = true;
@@ -2378,71 +1700,12 @@
String statusEdit = 'Test';
String arrive = createIdSend.Id;
LexSummonsCreatController.firstInit(ESetId);
- LexSummonsCreatController.init(ESetId, statusEdit, 1, 100, arrive);
- LexSummonsCreatController.save(
- createIdSend,
- 'Test',
- 'Test',
- 'Test',
- pageRecordsLwc,
- accountId,
- createIdSend.Id,
- consumable,
- agencyProType,
- userWorkLocation
- );
- LexSummonsCreatController.save(
- createIdSend1,
- 'Test',
- 'Test',
- 'Test',
- pageRecordsLwc,
- accountId,
- createIdSend1.Id,
- consumable,
- agencyProType,
- userWorkLocation
- );
- LexSummonsCreatController.save(
- createIdSend2,
- '',
- '',
- '',
- pageRecordsLwc,
- accountId,
- createIdSend2.Id,
- consumable,
- agencyProType,
- userWorkLocation
- );
- LexSummonsCreatController.save(
- createIdSend,
- '',
- '',
- '',
- pageRecordsList,
- accountId,
- null,
- consumable,
- agencyProType,
- userWorkLocation
- );
- LexSummonsCreatController.searchConsumableorderdetails(
- agencyProType,
- accountName,
- userWorkLocation,
- 'ishos',
- 'Test07',
- 'Test7',
- 'Test77',
- 'Test777',
- true,
- pageRecordsLwc,
- consumable,
- '',
- 1,
- 100
- );
+ LexSummonsCreatController.init(ESetId,statusEdit,1,100,arrive);
+ LexSummonsCreatController.save(createIdSend,'Test','Test','Test',pageRecordsLwc,accountId,createIdSend.Id,consumable,agencyProType,userWorkLocation);
+ LexSummonsCreatController.save(createIdSend1,'Test','Test','Test',pageRecordsLwc,accountId,createIdSend1.Id,consumable,agencyProType,userWorkLocation);
+ LexSummonsCreatController.save(createIdSend2,'','','',pageRecordsLwc,accountId,createIdSend2.Id,consumable,agencyProType,userWorkLocation);
+ LexSummonsCreatController.save(createIdSend,'','','',pageRecordsList,accountId,null,consumable,agencyProType,userWorkLocation);
+ LexSummonsCreatController.searchConsumableorderdetails(agencyProType,accountName,userWorkLocation,'ishos','Test07','Test7','Test77','Test777',true,pageRecordsLwc,consumable,'',1,100);
LexSummonsCreatController.ConsumableorderdetailsInfo con = new LexSummonsCreatController.ConsumableorderdetailsInfo(attach);
con.concc = attach;
con.hospitalSpecialOffer = false;
@@ -2452,58 +1715,26 @@
}
@isTest
- static void testSave1() {
+ static void testSave1(){
Account accountItem1;
Account accountItem2;
User userTest;
String rectCo = Schema.SObjectType.Account.getRecordTypeInfosByDeveloperName().get('Agency').getRecordTypeId();
String rectHp = Schema.SObjectType.Account.getRecordTypeInfosByDeveloperName().get('HP').getRecordTypeId();
- Profile prof = [
- SELECT Id
- FROM Profile
- WHERE Name = '901_缁忛攢鍟嗙ぞ鍖烘櫘閫氭潈闄恄2閲嶉獙璇�(ET)'
- ];
- accountItem1 = new Account(
- Name = 'Testaccount001',
- RecordTypeId = rectCo,
- AgentCode_Ext__c = '9999900',
- Contract_Decide_Start_Date__c = Date.today(),
- ENG_Dealer__c = true
- );
+ Profile prof = [SELECT Id FROM Profile WHERE Name ='901_缁忛攢鍟嗙ぞ鍖烘櫘閫氭潈闄恄2閲嶉獙璇�(ET)'];
+ accountItem1 = new Account(Name='Testaccount001',RecordTypeId = rectCo, AgentCode_Ext__c = '9999900',Contract_Decide_Start_Date__c = Date.today(),ENG_Dealer__c = true);
insert accountItem1;
- accountItem2 = new Account(
- Name = 'Testaccount002',
- RecordTypeId = rectHp,
- AgentCode_Ext__c = '9999999',
- ParentId = accountItem1.Id
- );
+ accountItem2 = new Account(Name='Testaccount002',RecordTypeId = rectHp, AgentCode_Ext__c = '9999999', ParentId = accountItem1.Id);
insert accountItem2;
- Contact core = new Contact(email = 'jplumber@salesforce.com', firstname = 'Joe', lastname = 'Plumber', accountId = accountItem1.Id);
+ Contact core = new Contact(email='jplumber@salesforce.com', firstname='Joe', lastname='Plumber', accountId = accountItem1.Id);
insert core;
System.runAs(new user(ID = UserInfo.getUserID())) {
- userTest = new User(
- ContactId = core.id,
- Alias = 'newUser',
- Email = 'newuser@testorg.com',
- EmailEncodingKey = 'UTF-8',
- LastName = 'TestUser',
- LanguageLocaleKey = 'zh_CN',
- LocaleSidKey = 'zh_CN',
- ProfileId = prof.Id,
- TimeZoneSidKey = 'Asia/Shanghai',
- UserName = 'testUser@testorg.com',
- UserPro_Type__c = 'ENG',
- Work_Location__c = '鍖椾含'
- );
+ userTest = New User(ContactId = core.id, Alias = 'newUser', Email='newuser@testorg.com', EmailEncodingKey='UTF-8', LastName='TestUser', LanguageLocaleKey='zh_CN', LocaleSidKey='zh_CN', ProfileId = prof.Id, TimeZoneSidKey='Asia/Shanghai', UserName='testUser@testorg.com', UserPro_Type__c='ENG', Work_Location__c='鍖椾含');
insert userTest;
}
- System.runAs(userTest) {
+ System.runAs(userTest){
String userId = UserInfo.getUserId();
- User thisUserInfo = [
- SELECT accountid, UserPro_Type__c, ContactId, Contact.AccountId, Contact.Account.Name, Work_Location__c
- FROM User
- WHERE id = :userId
- ];
+ User thisUserInfo = [SELECT accountid, UserPro_Type__c, ContactId, Contact.AccountId,Contact.Account.Name, Work_Location__c FROM User WHERE id =:userId];
String accountId = thisUserInfo.accountid;
String accountName = thisUserInfo.Contact.Account.Name;
String agencyProType = thisUserInfo.UserPro_Type__c;
@@ -2513,28 +1744,10 @@
if (String.isBlank(thisUserInfo.UserPro_Type__c)) {
agencyProType = 'ET';
}
- Product2 prod07 = new Product2(
- Name = 'Test07',
- ProductCode = 'Test07',
- Asset_Model_No__c = 'Test07',
- Category3__c = 'Test7',
- Category4__c = 'Test77',
- Category5__c = 'Test777',
- SFDA_Status__c = '鏈夊姽',
- Dealer_special_Object__c = true,
- Packing_list_manual__c = 1,
- Manual_Entry__c = false
- );
- insert new List<Product2>{ prod07 };
- Product2__c pro1 = new Product2__c(
- Name = 'MH-155:鐧藉钩琛″附',
- OT_CODE_Text__c = 'Test001',
- Product2__c = prod07.Id,
- Category3_text__c = 'test123',
- Category4_text__c = 'test123',
- Category5_text__c = 'test123'
- );
- insert new List<Product2__c>{ pro1 };
+ Product2 prod07 = new Product2(Name='Test07',ProductCode='Test07',Asset_Model_No__c = 'Test07',Category3__c = 'Test7',Category4__c = 'Test77',Category5__c = 'Test777',SFDA_Status__c = '鏈夊姽',Dealer_special_Object__c = true,Packing_list_manual__c = 1,Manual_Entry__c = false);
+ insert new Product2[] {prod07};
+ Product2__c pro1 = new Product2__c(Name='MH-155:鐧藉钩琛″附',OT_CODE_Text__c='Test001',Product2__c = prod07.Id,Category3_text__c = 'test123', Category4_text__c = 'test123', Category5_text__c = 'test123');
+ insert new Product2__c[] {pro1};
Consumable_order__c createIdSend = new Consumable_order__c();
createIdSend.Name = 'testMing1';
@@ -2565,7 +1778,7 @@
createIdSend1.Order_ForDealerTextID__c = accountItem1.Id;
createIdSend1.Dealer_Info__c = accountItem1.Id;
createIdSend1.Delivery_detail_count__c = 5;
- insert new List<Consumable_order__c>{ createIdSend, createIdSend1 };
+ insert new Consumable_order__c[] {createIdSend,createIdSend1};
Consumable_orderdetails__c coc = new Consumable_orderdetails__c();
coc.Name = 'Too001';
@@ -2591,7 +1804,7 @@
coc1.Delivery_List_RMB__c = null;
coc1.Shipment_Count__c = 10000;
coc1.RecordTypeid = System.Label.RT_ConOrderDetail1_Order;
- insert new List<Consumable_orderdetails__c>{ coc, coc1 };
+ insert new Consumable_orderdetails__c[]{coc,coc1};
Consumable_order_details2__c conOrderDetail1 = new Consumable_order_details2__c();
conOrderDetail1.Name = 'OCM_01_001001';
@@ -2606,13 +1819,13 @@
conOrderDetail1.Consumable_order_minor__c = createIdSend.Id;
conOrderDetail1.Lose_Flag__c = false;
conOrderDetail1.Box_Piece__c = '鐩�';
- insert new List<Consumable_order_details2__c>{ conOrderDetail1 };
-
+ insert new Consumable_order_details2__c[]{conOrderDetail1};
+
hospitalprice__c hp1 = new hospitalprice__c();
hp1.hospital__c = accountId;
hp1.account__c = accountId;
hp1.product__c = pro1.Id;
- insert new List<hospitalprice__c>{ hp1 };
+ insert new hospitalprice__c[]{hp1};
Integer size = Integer.valueOf(System.Label.orderdetLimitsize);
String ESetId = createIdSend.Id;
@@ -2691,95 +1904,33 @@
codi1.Prod = pro1;
consumable.add(codi);
System.Test.startTest();
- LexSummonsCreatController.save(
- createIdSend,
- '',
- '',
- '',
- pageRecordsLwc,
- accountId,
- createIdSend.Id,
- consumable,
- agencyProType,
- userWorkLocation
- );
- LexSummonsCreatController.save(
- createIdSend1,
- '',
- '',
- '',
- pageRecordsLwc,
- accountId,
- null,
- consumable,
- agencyProType,
- userWorkLocation
- );
- LexSummonsCreatController.save(
- createIdSend,
- '',
- '',
- '',
- pageRecords1,
- accountId,
- null,
- consumable,
- agencyProType,
- userWorkLocation
- );
+ LexSummonsCreatController.save(createIdSend,'','','',pageRecordsLwc,accountId,createIdSend.Id,consumable,agencyProType,userWorkLocation);
+ LexSummonsCreatController.save(createIdSend1,'','','',pageRecordsLwc,accountId,null,consumable,agencyProType,userWorkLocation);
+ LexSummonsCreatController.save(createIdSend,'','','',pageRecords1,accountId,null,consumable,agencyProType,userWorkLocation);
System.Test.stopTest();
}
}
- static testMethod void testInnerClass() {
+ static testMethod void testInnerClass(){
Account accountItem1;
Account accountItem2;
User userTest;
String rectCo = Schema.SObjectType.Account.getRecordTypeInfosByDeveloperName().get('Agency').getRecordTypeId();
String rectHp = Schema.SObjectType.Account.getRecordTypeInfosByDeveloperName().get('HP').getRecordTypeId();
- Profile prof = [
- SELECT Id
- FROM Profile
- WHERE Name = '901_缁忛攢鍟嗙ぞ鍖烘櫘閫氭潈闄恄2閲嶉獙璇�(ET)'
- ];
- accountItem1 = new Account(Name = 'Testaccount001', RecordTypeId = rectCo, AgentCode_Ext__c = '9999900');
+ Profile prof = [SELECT Id FROM Profile WHERE Name ='901_缁忛攢鍟嗙ぞ鍖烘櫘閫氭潈闄恄2閲嶉獙璇�(ET)'];
+ accountItem1 = new Account(Name='Testaccount001',RecordTypeId = rectCo, AgentCode_Ext__c = '9999900');
insert accountItem1;
- accountItem2 = new Account(
- Name = 'Testaccount002',
- RecordTypeId = rectHp,
- AgentCode_Ext__c = '9999999',
- ParentId = accountItem1.Id,
- Contract_Decide_Start_Date__c = Date.today(),
- ENG_Dealer__c = true,
- BillingCity = null
- );
+ accountItem2 = new Account(Name='Testaccount002',RecordTypeId = rectHp, AgentCode_Ext__c = '9999999', ParentId = accountItem1.Id,Contract_Decide_Start_Date__c = Date.today(),ENG_Dealer__c = true,BillingCity = null);
insert accountItem2;
- Contact core = new Contact(email = 'jplumber@salesforce.com', firstname = 'Joe', lastname = 'Plumber', accountId = accountItem1.Id);
+ Contact core = new Contact(email='jplumber@salesforce.com', firstname='Joe', lastname='Plumber', accountId = accountItem1.Id);
insert core;
System.runAs(new user(ID = UserInfo.getUserID())) {
- userTest = new User(
- ContactId = core.id,
- Alias = 'newUser',
- Email = 'newuser@testorg.com',
- EmailEncodingKey = 'UTF-8',
- LastName = 'TestUser',
- LanguageLocaleKey = 'zh_CN',
- LocaleSidKey = 'zh_CN',
- ProfileId = prof.Id,
- TimeZoneSidKey = 'Asia/Shanghai',
- UserName = 'testUser@testorg.com',
- UserPro_Type__c = 'ENG',
- Work_Location__c = '鍖椾含'
- );
+ userTest = New User(ContactId = core.id, Alias = 'newUser', Email='newuser@testorg.com', EmailEncodingKey='UTF-8', LastName='TestUser', LanguageLocaleKey='zh_CN', LocaleSidKey='zh_CN', ProfileId = prof.Id, TimeZoneSidKey='Asia/Shanghai', UserName='testUser@testorg.com', UserPro_Type__c='ENG', Work_Location__c='鍖椾含');
insert userTest;
}
- System.runAs(userTest) {
+ System.runAs(userTest){
String userId = UserInfo.getUserId();
- User thisUserInfo = [
- SELECT accountid, UserPro_Type__c, ContactId, Contact.AccountId, Contact.Account.Name, Work_Location__c
- FROM User
- WHERE id = :userId
- ];
+ User thisUserInfo = [SELECT accountid, UserPro_Type__c, ContactId, Contact.AccountId,Contact.Account.Name, Work_Location__c FROM User WHERE id =:userId];
String accountId = thisUserInfo.accountid;
String accountName = thisUserInfo.Contact.Account.Name;
String agencyProType = thisUserInfo.UserPro_Type__c;
@@ -2789,29 +1940,10 @@
if (String.isBlank(thisUserInfo.UserPro_Type__c)) {
agencyProType = 'ET';
}
- Product2 prod07 = new Product2(
- Name = 'Test07',
- ProductCode = 'Test07',
- Asset_Model_No__c = 'Test07',
- ProductCode_Ext__c = 'Test07',
- Category3__c = 'Test7',
- Category4__c = 'Test77',
- Category5__c = 'Test777',
- SFDA_Status__c = '鏈夊姽',
- Dealer_special_Object__c = true,
- Packing_list_manual__c = 1,
- Manual_Entry__c = false
- );
- insert new List<Product2>{ prod07 };
- Product2__c pro1 = new Product2__c(
- Name = 'MH-155:鐧藉钩琛″附',
- OT_CODE_Text__c = 'Test001',
- Product2__c = prod07.Id,
- Category3_text__c = 'test123',
- Category4_text__c = 'test123',
- Category5_text__c = 'test123'
- );
- insert new List<Product2__c>{ pro1 };
+ Product2 prod07 = new Product2(Name='Test07',ProductCode='Test07',Asset_Model_No__c = 'Test07', ProductCode_Ext__c = 'Test07',Category3__c = 'Test7',Category4__c = 'Test77',Category5__c = 'Test777',SFDA_Status__c = '鏈夊姽',Dealer_special_Object__c = true,Packing_list_manual__c = 1,Manual_Entry__c = false);
+ insert new Product2[] {prod07};
+ Product2__c pro1 = new Product2__c(Name='MH-155:鐧藉钩琛″附',OT_CODE_Text__c='Test001',Product2__c = prod07.Id,Category3_text__c = 'test123', Category4_text__c = 'test123', Category5_text__c = 'test123');
+ insert new Product2__c[] {pro1};
Consumable_order__c createIdSend = new Consumable_order__c();
createIdSend.Name = 'testMing1';
createIdSend.Order_status__c = '鎵瑰噯';
@@ -2854,8 +1986,8 @@
createIdArrived.orderPattern__c = 'promotionorder';
createIdArrived.Dealer_Info__c = accountItem1.Id;
createIdArrived.Delivery_detail_count__c = 5;
- insert new List<Consumable_order__c>{ createIdSend, createIdSend3, createIdArrived };
-
+ insert new Consumable_order__c[]{createIdSend,createIdSend3,createIdArrived};
+
Consumable_orderdetails__c coc = new Consumable_orderdetails__c();
coc.Name = 'Too001';
coc.Dealer_Custom_Price__c = 999.00;
@@ -2881,7 +2013,7 @@
coc1.Delivery_List_RMB__c = 999.00;
coc1.Shipment_Count__c = 9999.00;
coc1.RecordTypeid = System.Label.RT_ConOrderDetail1_Order;
- insert new List<Consumable_orderdetails__c>{ coc, coc1 };
+ insert new Consumable_orderdetails__c[]{coc,coc1};
Consumable_order_details2__c conOrderDetail1 = new Consumable_order_details2__c();
conOrderDetail1.Name = 'OCM_01_001001';
@@ -2918,7 +2050,7 @@
conOrderDetail2.Cancellation_Flag__c = false;
conOrderDetail2.Box_Piece__c = '涓�';
conOrderDetail2.Sterilization_limit__c = Date.Today();
- insert new List<Consumable_order_details2__c>{ conOrderDetail1, conOrderDetail2 };
+ insert new Consumable_order_details2__c[]{conOrderDetail1,conOrderDetail2};
List<LexSummonsCreatController.ConsumableorderdetailsInfoLwc> pageRecords = new List<LexSummonsCreatController.ConsumableorderdetailsInfoLwc>();
LexSummonsCreatController.ConsumableorderdetailsInfoLwc c6 = new LexSummonsCreatController.ConsumableorderdetailsInfoLwc();
c6.check = true;
@@ -2977,200 +2109,99 @@
codi.boxorpiecein = null;
codi.orderdetails1 = coc;
codi.Prod = pro1;
- consumable.add(codi);
+ consumable.add(codi);
System.Test.startTest();
- LexSummonsCreatController.init(null, 'Test', 1, 100, createIdArrived.Id);
- LexSummonsCreatController.init(null, 'Test', 1, 100, null);
- LexSummonsCreatController.init(null, null, 1, 100, createIdArrived.Id);
+ LexSummonsCreatController.init(null,'Test',1,100,createIdArrived.Id);
+ LexSummonsCreatController.init(null,'Test',1,100,null);
+ LexSummonsCreatController.init(null,null,1,100,createIdArrived.Id);
LexSummonsCreatController.categoryAllload('Test7');
- LexSummonsCreatController.categoryload('Test7', 'Test77');
- LexSummonsCreatController.searchConsumableorderdetails(
- 'ET',
- 'Testaccount001',
- '鍖椾含',
- 'ishos',
- 'Test07',
- 'Test7',
- 'Test77',
- 'Test777',
- true,
- pageRecords,
- consumable,
- '',
- 1,
- 1
- );
- LexSummonsCreatController.searchConsumableorderdetails(
- 'ET',
- 'Testaccount001',
- '鍖椾含',
- 'nothos',
- 'Test07',
- 'Test7',
- 'Test77',
- 'Test777',
- true,
- pageRecords,
- consumable,
- '',
- 1,
- 1
- );
- LexSummonsCreatController.searchConsumableorderdetails(
- 'ET',
- 'Testaccount001',
- '鍖椾含',
- 'ishos',
- 'Test07',
- 'Test7',
- 'Test77',
- 'Test777',
- true,
- pageRecords1,
- consumable,
- '',
- 1,
- 1
- );
- LexSummonsCreatController.searchConsumableorderdetails(
- 'ET',
- 'Testaccount001',
- '鍖椾含',
- 'nothos',
- 'Test07',
- 'Test7',
- 'Test77',
- 'Test777',
- true,
- pageRecords1,
- consumable,
- '',
- 1,
- 1
- );
+ LexSummonsCreatController.categoryload('Test7','Test77');
+ LexSummonsCreatController.searchConsumableorderdetails('ET','Testaccount001','鍖椾含','ishos','Test07','Test7','Test77','Test777',true,pageRecords,consumable,'',1,1);
+ LexSummonsCreatController.searchConsumableorderdetails('ET','Testaccount001','鍖椾含','nothos','Test07','Test7','Test77','Test777',true,pageRecords,consumable,'',1,1);
+ LexSummonsCreatController.searchConsumableorderdetails('ET','Testaccount001','鍖椾含','ishos','Test07','Test7','Test77','Test777',true,pageRecords1,consumable,'',1,1);
+ LexSummonsCreatController.searchConsumableorderdetails('ET','Testaccount001','鍖椾含','nothos','Test07','Test7','Test77','Test777',true,pageRecords1,consumable,'',1,1);
List<LexSummonsCreatController.ConsumableorderdetailsInfo> cro = new List<LexSummonsCreatController.ConsumableorderdetailsInfo>();
- cro.sort();
+ cro.sort();
System.Test.stopTest();
}
}
@isTest
- static void saveMethodTest1() {
- List<RecordType> rectCo = [
- SELECT Id
- FROM RecordType
- WHERE IsActive = TRUE AND SobjectType = 'Account' AND Name = '璨╁2搴�'
- ];
- if (rectCo.size() == 0) {
- return;
- }
- Profile prof = [
- SELECT Id
- FROM Profile
- WHERE Name = '901_缁忛攢鍟嗙ぞ鍖烘櫘閫氭潈闄恄2閲嶉獙璇�(ET)'
- ];
- RecordType rectCoO = [
- SELECT Id
- FROM RecordType
- WHERE IsActive = TRUE AND SobjectType = 'Account' AND Name = '鐥呴櫌'
- ];
- Account myAccount2 = new Account(RecordTypeId = rectCoO.Id, AgentCode_Ext__c = '9999900', Name = 'olympus');
- Account myAccount1 = new Account(name = 'Testaccount001', Dealer_discount__c = 30, RecordTypeId = rectCo[0].Id);
- insert new List<account>{ myAccount1, myAccount2 };
+ static void saveMethodTest1(){
+ List<RecordType> rectCo = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '璨╁2搴�'];
+ if (rectCo.size() == 0) {
+ return;
+ }
+ Profile prof = [select Id from Profile where Name ='901_缁忛攢鍟嗙ぞ鍖烘櫘閫氭潈闄恄2閲嶉獙璇�(ET)'];
+ RecordType rectCoO = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '鐥呴櫌'];
+ Account myAccount2 = new Account(RecordTypeId = rectCoO.Id, AgentCode_Ext__c = '9999900', Name = 'olympus');
+ Account myAccount1 = new Account(name='Testaccount001',Dealer_discount__c =30,RecordTypeId = rectCo[0].Id);
+ insert new account[]{myAccount1,myAccount2};
hospitalprice__c hp1 = new hospitalprice__c();
hp1.hospital__c = myAccount2.Id;
hp1.account__c = myAccount1.Id;
insert hp1;
- Contact core = new Contact(email = 'jplumber@salesforce.com', firstname = 'Joe', lastname = 'Plumber', accountid = myAccount1.id);
- insert core;
- user MyUser_Test = new User(
- ContactId = core.id,
- Alias = 'newUser',
- Email = 'newuser@testorg.com',
- EmailEncodingKey = 'UTF-8',
- LastName = 'TestUser',
- LanguageLocaleKey = 'zh_CN',
- LocaleSidKey = 'zh_CN',
- ProfileId = prof.Id,
- TimeZoneSidKey = 'Asia/Shanghai',
- UserName = 'testUser@testorg.com',
- UserPro_Type__c = 'ET',
- Work_Location__c = '鍖椾含'
- );
- System.runAs(new User(Id = UserInfo.getUserId())) {
+ Contact core = new Contact(email='jplumber@salesforce.com', firstname='Joe',lastname='Plumber',accountid=myAccount1.id);
+ insert core;
+ user MyUser_Test = New User(ContactId = core.id,Alias = 'newUser',Email='newuser@testorg.com',EmailEncodingKey='UTF-8', LastName='TestUser', LanguageLocaleKey='zh_CN',LocaleSidKey='zh_CN', ProfileId = prof.Id,TimeZoneSidKey='Asia/Shanghai', UserName='testUser@testorg.com',UserPro_Type__c = 'ET',Work_Location__c='鍖椾含');
+ System.runAs(new User(Id = UserInfo.getUserId())){
insert MyUser_Test;
}
-
- System.runAs(MyUser_Test) {
- Product2 prod01 = new Product2(
- Name = 'Test01',
- ProductCode = 'Test01',
- Asset_Model_No__c = 'Test01',
- SFDA_Status__c = '鏈夊姽',
- JANCODE__c = '04953170200311',
- Dealer_special_Object__c = true,
- Manual_Entry__c = false
- );
- Product2 prod02 = new Product2(
- Name = 'Test02',
- ProductCode = 'Test02',
- Asset_Model_No__c = 'Test02',
- SFDA_Status__c = '鏈夊姽',
- JANCODE__c = '04953170200312',
- Dealer_special_Object__c = true,
- Manual_Entry__c = false
- );
- insert new List<Product2>{ prod01, prod02 };
- Product2__c pro1 = new Product2__c(Name = 'Pro001', OT_CODE_Text__c = 'N3047730', Product2__c = prod01.Id);
- Product2__c pro2 = new Product2__c(Name = 'Pro002', OT_CODE_Text__c = 'N3047731', Product2__c = prod02.Id);
- insert new List<Product2__c>{ pro1, pro2 };
-
+
+ System.runAs(MyUser_Test){
+ Product2 prod01 = new Product2(Name='Test01',ProductCode='Test01',Asset_Model_No__c = 'Test01',SFDA_Status__c = '鏈夊姽',JANCODE__c = '04953170200311',Dealer_special_Object__c = true,Manual_Entry__c = false);
+ Product2 prod02 = new Product2(Name='Test02',ProductCode='Test02',Asset_Model_No__c = 'Test02',SFDA_Status__c = '鏈夊姽',JANCODE__c = '04953170200312',Dealer_special_Object__c = true,Manual_Entry__c = false);
+ insert new Product2[] {prod01,prod02};
+ Product2__c pro1 = new Product2__c(Name='Pro001',OT_CODE_Text__c='N3047730',Product2__c = prod01.Id);
+ Product2__c pro2 = new Product2__c(Name='Pro002',OT_CODE_Text__c='N3047731',Product2__c = prod02.Id);
+ insert new Product2__c[] {pro1, pro2};
+
Consumable_order__c Order0 = new Consumable_order__c();
- Order0.Name = 'OCM_01_000';
- Order0.Order_status__c = '鎵瑰噯';
- Order0.Order_type__c = '璁㈠崟';
- Order0.Dealer_Info__c = myAccount1.id;
- Order0.RecordTypeid = System.Label.RT_ConOrder_Delivery;
- Order0.Order_ProType__c = 'ET';
- insert Order0;
+ Order0.Name = 'OCM_01_000';
+ Order0.Order_status__c = '鎵瑰噯';
+ Order0.Order_type__c = '璁㈠崟';
+ Order0.Dealer_Info__c = myAccount1.id;
+ Order0.RecordTypeid = System.Label.RT_ConOrder_Delivery;
+ Order0.Order_ProType__c = 'ET';
+ insert Order0;
- Consumable_order__c Order1 = new Consumable_order__c();
- Order1.Name = 'OCM_01_001';
- Order1.Order_status__c = '鎵瑰噯';
- Order1.Order_type__c = '璁㈠崟';
- Order1.Dealer_Info__c = myAccount1.id;
- Order1.RecordTypeid = System.Label.RT_ConOrder_Delivery;
- Order1.Order_ProType__c = 'ET';
+ Consumable_order__c Order1 = new Consumable_order__c();
+ Order1.Name = 'OCM_01_001';
+ Order1.Order_status__c = '鎵瑰噯';
+ Order1.Order_type__c = '璁㈠崟';
+ Order1.Dealer_Info__c = myAccount1.id;
+ Order1.RecordTypeid = System.Label.RT_ConOrder_Delivery;
+ Order1.Order_ProType__c = 'ET';
Order1.OutPattern__c = true;
Order1.Arrive_Order__c = Order0.Id;
- insert Order1;
- Consumable_orderdetails__c Orderdet = new Consumable_orderdetails__c();
- Orderdet.Name = 'OCM_01_00101';
- Orderdet.Consumable_order__c = Order1.Id;
- Orderdet.RecordTypeId = System.Label.RT_ConOrderDetail1_Order;
- Orderdet.Consumable_Product__c = pro1.Id;
- Orderdet.Consumable_count__c = 4;
+ insert Order1;
+ Consumable_orderdetails__c Orderdet = new Consumable_orderdetails__c();
+ Orderdet.Name = 'OCM_01_00101';
+ Orderdet.Consumable_order__c = Order1.Id;
+ Orderdet.RecordTypeId = System.Label.RT_ConOrderDetail1_Order;
+ Orderdet.Consumable_Product__c = pro1.Id;
+ Orderdet.Consumable_count__c = 4;
Orderdet.Shipment_Count__c = 10;
Orderdet.isOutPattern__c = true;
Orderdet.Delivery_List_RMB__c = 100;
Orderdet.Box_Piece__c = '鐩�';
- insert Orderdet;
- Consumable_order_details2__c Orderdet1 = new Consumable_order_details2__c();
- Orderdet1.Name = 'OCM_01_001001';
- Orderdet1.Consumable_order_minor__c = Order1.Id;
- Orderdet1.Consumable_Product__c = pro1.Id;
- Orderdet1.Asset_Model_No__c = 'Test01';
- Orderdet1.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
- Orderdet1.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJRF';
- Orderdet1.Cancellation_Date__c = null;
- Orderdet1.TracingCode__c = 'BXJRF';
- Orderdet1.SerialLotNo__c = '5ZK';
+ insert Orderdet;
+ Consumable_order_details2__c Orderdet1 = new Consumable_order_details2__c();
+ Orderdet1.Name = 'OCM_01_001001';
+ Orderdet1.Consumable_order_minor__c = Order1.Id;
+ Orderdet1.Consumable_Product__c = pro1.Id;
+ Orderdet1.Asset_Model_No__c = 'Test01';
+ Orderdet1.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
+ Orderdet1.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJRF';
+ Orderdet1.Cancellation_Date__c = null;
+ Orderdet1.TracingCode__c = 'BXJRF';
+ Orderdet1.SerialLotNo__c = '5ZK';
Orderdet1.Arrive_date__c = Date.today();
Orderdet1.exchangeOutPattern__c = true;
Orderdet1.Consumable_ZS_order__c = Order1.Id;
Orderdet1.Box_Piece__c = '鐩�';
- insert Orderdet1;
- System.Test.startTest();
+ insert Orderdet1;
+ System.Test.startTest();
LexSummonsCreatController.init(Order1.Id, 'edit', 10, 1, '');
List<LexSummonsCreatController.ConsumableorderdetailsInfoLwc> pList = new List<LexSummonsCreatController.ConsumableorderdetailsInfoLwc>();
LexSummonsCreatController.ConsumableorderdetailsInfoLwc p = new LexSummonsCreatController.ConsumableorderdetailsInfoLwc();
@@ -3197,293 +2228,179 @@
consumable.add(codi);
LexSummonsCreatController.coc.SummonsForDirction__c = '鐩存帴閿�鍞粰鍖婚櫌';
LexSummonsCreatController.coc.Order_ForCustomerText__c = '娑堝寲绉�';
- LexSummonsCreatController.save(
- LexSummonsCreatController.coc,
- myAccount2.Id,
- myAccount2.Name,
- '',
- pList,
- myAccount1.Id,
- '',
- consumable,
- 'ET',
- ''
- );
+ LexSummonsCreatController.save(LexSummonsCreatController.coc, myAccount2.Id, myAccount2.Name, '', pList, myAccount1.Id, '', consumable, 'ET', '');
Orderdet.Box_Piece__c = '涓�';
- LexSummonsCreatController.save(
- LexSummonsCreatController.coc,
- myAccount2.Id,
- myAccount2.Name,
- '',
- pList,
- myAccount1.Id,
- '',
- consumable,
- 'ET',
- ''
- );
+ LexSummonsCreatController.save(LexSummonsCreatController.coc, myAccount2.Id, myAccount2.Name, '', pList, myAccount1.Id, '', consumable, 'ET', '');
p.Piecenumber = 20;
- LexSummonsCreatController.save(
- LexSummonsCreatController.coc,
- myAccount2.Id,
- myAccount2.Name,
- '',
- pList,
- myAccount1.Id,
- '',
- consumable,
- 'ET',
- ''
- );
- System.Test.stopTest();
- }
+ LexSummonsCreatController.save(LexSummonsCreatController.coc, myAccount2.Id, myAccount2.Name, '', pList, myAccount1.Id, '', consumable, 'ET', '');
+ System.Test.stopTest();
+ }
}
@isTest
- static void initMethodTest1() {
- List<RecordType> rectCo = [
- SELECT Id
- FROM RecordType
- WHERE IsActive = TRUE AND SobjectType = 'Account' AND Name = '璨╁2搴�'
- ];
- if (rectCo.size() == 0) {
- return;
- }
- Profile prof = [
- SELECT Id
- FROM Profile
- WHERE Name = '901_缁忛攢鍟嗙ぞ鍖烘櫘閫氭潈闄恄2閲嶉獙璇�(ET)'
- ];
- RecordType rectCoO = [
- SELECT Id
- FROM RecordType
- WHERE IsActive = TRUE AND SobjectType = 'Account' AND Name = '鐥呴櫌'
- ];
- Account myAccount2 = new Account(RecordTypeId = rectCoO.Id, AgentCode_Ext__c = '9999900', Name = 'olympus');
- Account myAccount1 = new Account(name = 'Testaccount001', Dealer_discount__c = 30, RecordTypeId = rectCo[0].Id);
- insert new List<account>{ myAccount1, myAccount2 };
+ static void initMethodTest1(){
+ List<RecordType> rectCo = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '璨╁2搴�'];
+ if (rectCo.size() == 0) {
+ return;
+ }
+ Profile prof = [select Id from Profile where Name ='901_缁忛攢鍟嗙ぞ鍖烘櫘閫氭潈闄恄2閲嶉獙璇�(ET)'];
+ RecordType rectCoO = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '鐥呴櫌'];
+ Account myAccount2 = new Account(RecordTypeId = rectCoO.Id, AgentCode_Ext__c = '9999900', Name = 'olympus');
+ Account myAccount1 = new Account(name='Testaccount001',Dealer_discount__c =30,RecordTypeId = rectCo[0].Id);
+ insert new account[]{myAccount1,myAccount2};
hospitalprice__c hp1 = new hospitalprice__c();
hp1.hospital__c = myAccount2.Id;
hp1.account__c = myAccount1.Id;
insert hp1;
- Contact core = new Contact(email = 'jplumber@salesforce.com', firstname = 'Joe', lastname = 'Plumber', accountid = myAccount1.id);
- insert core;
- user MyUser_Test = new User(
- ContactId = core.id,
- Alias = 'newUser',
- Email = 'newuser@testorg.com',
- EmailEncodingKey = 'UTF-8',
- LastName = 'TestUser',
- LanguageLocaleKey = 'zh_CN',
- LocaleSidKey = 'zh_CN',
- ProfileId = prof.Id,
- TimeZoneSidKey = 'Asia/Shanghai',
- UserName = 'testUser@testorg.com',
- UserPro_Type__c = 'ET',
- Work_Location__c = '鍖椾含'
- );
- System.runAs(new User(Id = UserInfo.getUserId())) {
+ Contact core = new Contact(email='jplumber@salesforce.com', firstname='Joe',lastname='Plumber',accountid=myAccount1.id);
+ insert core;
+ user MyUser_Test = New User(ContactId = core.id,Alias = 'newUser',Email='newuser@testorg.com',EmailEncodingKey='UTF-8', LastName='TestUser', LanguageLocaleKey='zh_CN',LocaleSidKey='zh_CN', ProfileId = prof.Id,TimeZoneSidKey='Asia/Shanghai', UserName='testUser@testorg.com',UserPro_Type__c = 'ET',Work_Location__c='鍖椾含');
+ System.runAs(new User(Id = UserInfo.getUserId())){
insert MyUser_Test;
}
-
- System.runAs(MyUser_Test) {
- Product2 prod01 = new Product2(
- Name = 'Test01',
- ProductCode = 'Test01',
- Asset_Model_No__c = 'Test01',
- SFDA_Status__c = '鏈夊姽',
- JANCODE__c = '04953170200311',
- Dealer_special_Object__c = true,
- Manual_Entry__c = false
- );
- Product2 prod02 = new Product2(
- Name = 'Test02',
- ProductCode = 'Test02',
- Asset_Model_No__c = 'Test02',
- SFDA_Status__c = '鏈夊姽',
- JANCODE__c = '04953170200312',
- Dealer_special_Object__c = true,
- Manual_Entry__c = false
- );
- insert new List<Product2>{ prod01, prod02 };
- Product2__c pro1 = new Product2__c(Name = 'Pro001', OT_CODE_Text__c = 'N3047730', Product2__c = prod01.Id);
- Product2__c pro2 = new Product2__c(Name = 'Pro002', OT_CODE_Text__c = 'N3047731', Product2__c = prod02.Id);
- insert new List<Product2__c>{ pro1, pro2 };
-
+
+ System.runAs(MyUser_Test){
+ Product2 prod01 = new Product2(Name='Test01',ProductCode='Test01',Asset_Model_No__c = 'Test01',SFDA_Status__c = '鏈夊姽',JANCODE__c = '04953170200311',Dealer_special_Object__c = true,Manual_Entry__c = false);
+ Product2 prod02 = new Product2(Name='Test02',ProductCode='Test02',Asset_Model_No__c = 'Test02',SFDA_Status__c = '鏈夊姽',JANCODE__c = '04953170200312',Dealer_special_Object__c = true,Manual_Entry__c = false);
+ insert new Product2[] {prod01,prod02};
+ Product2__c pro1 = new Product2__c(Name='Pro001',OT_CODE_Text__c='N3047730',Product2__c = prod01.Id);
+ Product2__c pro2 = new Product2__c(Name='Pro002',OT_CODE_Text__c='N3047731',Product2__c = prod02.Id);
+ insert new Product2__c[] {pro1, pro2};
+
Consumable_order__c Order0 = new Consumable_order__c();
- Order0.Name = 'OCM_01_000';
- Order0.Order_status__c = '鎵瑰噯';
- Order0.Order_type__c = '璁㈠崟';
- Order0.Dealer_Info__c = myAccount1.id;
- Order0.RecordTypeid = System.Label.RT_ConOrder_Delivery;
- Order0.Order_ProType__c = 'ET';
- insert Order0;
+ Order0.Name = 'OCM_01_000';
+ Order0.Order_status__c = '鎵瑰噯';
+ Order0.Order_type__c = '璁㈠崟';
+ Order0.Dealer_Info__c = myAccount1.id;
+ Order0.RecordTypeid = System.Label.RT_ConOrder_Delivery;
+ Order0.Order_ProType__c = 'ET';
+ insert Order0;
- Consumable_order__c Order1 = new Consumable_order__c();
- Order1.Name = 'OCM_01_001';
- Order1.Order_status__c = '鎵瑰噯';
- Order1.Order_type__c = '浼犵エ';
- Order1.Dealer_Info__c = myAccount1.id;
- Order1.RecordTypeid = System.Label.RT_ConOrder_Delivery;
- Order1.Order_ProType__c = 'ET';
+ Consumable_order__c Order1 = new Consumable_order__c();
+ Order1.Name = 'OCM_01_001';
+ Order1.Order_status__c = '鎵瑰噯';
+ Order1.Order_type__c = '浼犵エ';
+ Order1.Dealer_Info__c = myAccount1.id;
+ Order1.RecordTypeid = System.Label.RT_ConOrder_Delivery;
+ Order1.Order_ProType__c = 'ET';
Order1.OutPattern__c = true;
Order1.Arrive_Order__c = Order0.Id;
Order1.SummonsStatus_c__c = '宸叉彁浜�';
Order1.SummonsForDirction__c = '鐩存帴閿�鍞粰鍖婚櫌';
- insert Order1;
- Consumable_orderdetails__c Orderdet = new Consumable_orderdetails__c();
- Orderdet.Name = 'OCM_01_00101';
- Orderdet.Consumable_order__c = Order1.Id;
- Orderdet.RecordTypeId = System.Label.RT_ConOrderDetail1_Order;
- Orderdet.Consumable_Product__c = pro1.Id;
- Orderdet.Consumable_count__c = 4;
+ insert Order1;
+ Consumable_orderdetails__c Orderdet = new Consumable_orderdetails__c();
+ Orderdet.Name = 'OCM_01_00101';
+ Orderdet.Consumable_order__c = Order1.Id;
+ Orderdet.RecordTypeId = System.Label.RT_ConOrderDetail1_Order;
+ Orderdet.Consumable_Product__c = pro1.Id;
+ Orderdet.Consumable_count__c = 4;
Orderdet.Shipment_Count__c = 10;
Orderdet.isOutPattern__c = true;
Orderdet.Delivery_List_RMB__c = 100;
Orderdet.Box_Piece__c = '鐩�';
- insert Orderdet;
- Consumable_order_details2__c Orderdet1 = new Consumable_order_details2__c();
- Orderdet1.Name = 'OCM_01_001001';
- Orderdet1.Consumable_order_minor__c = Order1.Id;
- Orderdet1.Consumable_Product__c = pro1.Id;
- Orderdet1.Asset_Model_No__c = 'Test01';
- Orderdet1.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
- Orderdet1.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJRF';
- Orderdet1.Cancellation_Date__c = null;
- Orderdet1.TracingCode__c = 'BXJRF';
- Orderdet1.SerialLotNo__c = '5ZK';
+ insert Orderdet;
+ Consumable_order_details2__c Orderdet1 = new Consumable_order_details2__c();
+ Orderdet1.Name = 'OCM_01_001001';
+ Orderdet1.Consumable_order_minor__c = Order1.Id;
+ Orderdet1.Consumable_Product__c = pro1.Id;
+ Orderdet1.Asset_Model_No__c = 'Test01';
+ Orderdet1.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
+ Orderdet1.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJRF';
+ Orderdet1.Cancellation_Date__c = null;
+ Orderdet1.TracingCode__c = 'BXJRF';
+ Orderdet1.SerialLotNo__c = '5ZK';
Orderdet1.Arrive_date__c = Date.today();
Orderdet1.exchangeOutPattern__c = true;
Orderdet1.Consumable_ZS_order__c = Order1.Id;
Orderdet1.Box_Piece__c = '鐩�';
- insert Orderdet1;
- System.Test.startTest();
+ insert Orderdet1;
+ System.Test.startTest();
LexSummonsCreatController.init(Order1.Id, 'edit', 10, 1, '');
- System.Test.stopTest();
- }
+ System.Test.stopTest();
+ }
}
@isTest
- static void initMethodTest2() {
- List<RecordType> rectCo = [
- SELECT Id
- FROM RecordType
- WHERE IsActive = TRUE AND SobjectType = 'Account' AND Name = '璨╁2搴�'
- ];
- if (rectCo.size() == 0) {
- return;
- }
- Profile prof = [
- SELECT Id
- FROM Profile
- WHERE Name = '901_缁忛攢鍟嗙ぞ鍖烘櫘閫氭潈闄恄2閲嶉獙璇�(ET)'
- ];
- RecordType rectCoO = [
- SELECT Id
- FROM RecordType
- WHERE IsActive = TRUE AND SobjectType = 'Account' AND Name = '鐥呴櫌'
- ];
- Account myAccount2 = new Account(RecordTypeId = rectCoO.Id, AgentCode_Ext__c = '9999900', Name = 'olympus');
- Account myAccount1 = new Account(name = 'Testaccount001', Dealer_discount__c = 30, RecordTypeId = rectCo[0].Id);
- insert new List<account>{ myAccount1, myAccount2 };
+ static void initMethodTest2(){
+ List<RecordType> rectCo = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '璨╁2搴�'];
+ if (rectCo.size() == 0) {
+ return;
+ }
+ Profile prof = [select Id from Profile where Name ='901_缁忛攢鍟嗙ぞ鍖烘櫘閫氭潈闄恄2閲嶉獙璇�(ET)'];
+ RecordType rectCoO = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '鐥呴櫌'];
+ Account myAccount2 = new Account(RecordTypeId = rectCoO.Id, AgentCode_Ext__c = '9999900', Name = 'olympus');
+ Account myAccount1 = new Account(name='Testaccount001',Dealer_discount__c =30,RecordTypeId = rectCo[0].Id);
+ insert new account[]{myAccount1,myAccount2};
hospitalprice__c hp1 = new hospitalprice__c();
hp1.hospital__c = myAccount2.Id;
hp1.account__c = myAccount1.Id;
insert hp1;
- Contact core = new Contact(email = 'jplumber@salesforce.com', firstname = 'Joe', lastname = 'Plumber', accountid = myAccount1.id);
- insert core;
- user MyUser_Test = new User(
- ContactId = core.id,
- Alias = 'newUser',
- Email = 'newuser@testorg.com',
- EmailEncodingKey = 'UTF-8',
- LastName = 'TestUser',
- LanguageLocaleKey = 'zh_CN',
- LocaleSidKey = 'zh_CN',
- ProfileId = prof.Id,
- TimeZoneSidKey = 'Asia/Shanghai',
- UserName = 'testUser@testorg.com',
- UserPro_Type__c = 'ET'
- );
- System.runAs(new User(Id = UserInfo.getUserId())) {
+ Contact core = new Contact(email='jplumber@salesforce.com', firstname='Joe',lastname='Plumber',accountid=myAccount1.id);
+ insert core;
+ user MyUser_Test = New User(ContactId = core.id,Alias = 'newUser',Email='newuser@testorg.com',EmailEncodingKey='UTF-8', LastName='TestUser', LanguageLocaleKey='zh_CN',LocaleSidKey='zh_CN', ProfileId = prof.Id,TimeZoneSidKey='Asia/Shanghai', UserName='testUser@testorg.com',UserPro_Type__c = 'ET');
+ System.runAs(new User(Id = UserInfo.getUserId())){
insert MyUser_Test;
}
-
- System.runAs(MyUser_Test) {
- Product2 prod01 = new Product2(
- Name = 'Test01',
- ProductCode = 'Test01',
- Asset_Model_No__c = 'Test01',
- SFDA_Status__c = '鏈夊姽',
- JANCODE__c = '04953170200311',
- Dealer_special_Object__c = true,
- Manual_Entry__c = false
- );
- Product2 prod02 = new Product2(
- Name = 'Test02',
- ProductCode = 'Test02',
- Asset_Model_No__c = 'Test02',
- SFDA_Status__c = '鏈夊姽',
- JANCODE__c = '04953170200312',
- Dealer_special_Object__c = true,
- Manual_Entry__c = false
- );
- insert new List<Product2>{ prod01, prod02 };
- Product2__c pro1 = new Product2__c(Name = 'Pro001', OT_CODE_Text__c = 'N3047730', Product2__c = prod01.Id);
- Product2__c pro2 = new Product2__c(Name = 'Pro002', OT_CODE_Text__c = 'N3047731', Product2__c = prod02.Id);
- insert new List<Product2__c>{ pro1, pro2 };
-
+
+ System.runAs(MyUser_Test){
+ Product2 prod01 = new Product2(Name='Test01',ProductCode='Test01',Asset_Model_No__c = 'Test01',SFDA_Status__c = '鏈夊姽',JANCODE__c = '04953170200311',Dealer_special_Object__c = true,Manual_Entry__c = false);
+ Product2 prod02 = new Product2(Name='Test02',ProductCode='Test02',Asset_Model_No__c = 'Test02',SFDA_Status__c = '鏈夊姽',JANCODE__c = '04953170200312',Dealer_special_Object__c = true,Manual_Entry__c = false);
+ insert new Product2[] {prod01,prod02};
+ Product2__c pro1 = new Product2__c(Name='Pro001',OT_CODE_Text__c='N3047730',Product2__c = prod01.Id);
+ Product2__c pro2 = new Product2__c(Name='Pro002',OT_CODE_Text__c='N3047731',Product2__c = prod02.Id);
+ insert new Product2__c[] {pro1, pro2};
+
Consumable_order__c Order0 = new Consumable_order__c();
- Order0.Name = 'OCM_01_000';
- Order0.Order_status__c = '鎵瑰噯';
- Order0.Order_type__c = '璁㈠崟';
- Order0.Dealer_Info__c = myAccount1.id;
- Order0.RecordTypeid = System.Label.RT_ConOrder_Delivery;
- Order0.Order_ProType__c = 'ET';
- insert Order0;
+ Order0.Name = 'OCM_01_000';
+ Order0.Order_status__c = '鎵瑰噯';
+ Order0.Order_type__c = '璁㈠崟';
+ Order0.Dealer_Info__c = myAccount1.id;
+ Order0.RecordTypeid = System.Label.RT_ConOrder_Delivery;
+ Order0.Order_ProType__c = 'ET';
+ insert Order0;
- Consumable_order__c Order1 = new Consumable_order__c();
- Order1.Name = 'OCM_01_001';
- Order1.Order_status__c = '鎵瑰噯';
- Order1.Order_type__c = '璁㈠崟';
- Order1.Dealer_Info__c = myAccount1.id;
- Order1.RecordTypeid = System.Label.RT_ConOrder_Arrive;
- Order1.Order_ProType__c = 'ET';
+ Consumable_order__c Order1 = new Consumable_order__c();
+ Order1.Name = 'OCM_01_001';
+ Order1.Order_status__c = '鎵瑰噯';
+ Order1.Order_type__c = '璁㈠崟';
+ Order1.Dealer_Info__c = myAccount1.id;
+ Order1.RecordTypeid = System.Label.RT_ConOrder_Arrive;
+ Order1.Order_ProType__c = 'ET';
Order1.OutPattern__c = true;
Order1.Arrive_Order__c = Order0.Id;
Order1.SummonsStatus_c__c = '宸叉彁浜�';
Order1.SummonsForDirction__c = '鐩存帴閿�鍞粰鍖婚櫌';
- insert Order1;
- Consumable_orderdetails__c Orderdet = new Consumable_orderdetails__c();
- Orderdet.Name = 'OCM_01_00101';
- Orderdet.Consumable_order__c = Order0.Id;
- Orderdet.RecordTypeId = System.Label.RT_ConOrderDetail1_Order;
- Orderdet.Consumable_Product__c = pro1.Id;
- Orderdet.Consumable_count__c = 4;
+ insert Order1;
+ Consumable_orderdetails__c Orderdet = new Consumable_orderdetails__c();
+ Orderdet.Name = 'OCM_01_00101';
+ Orderdet.Consumable_order__c = Order0.Id;
+ Orderdet.RecordTypeId = System.Label.RT_ConOrderDetail1_Order;
+ Orderdet.Consumable_Product__c = pro1.Id;
+ Orderdet.Consumable_count__c = 4;
Orderdet.Shipment_Count__c = 10;
Orderdet.isOutPattern__c = true;
Orderdet.Delivery_List_RMB__c = 100;
Orderdet.Box_Piece__c = '鐩�';
- insert Orderdet;
- Consumable_order_details2__c Orderdet1 = new Consumable_order_details2__c();
- Orderdet1.Name = 'OCM_01_001001';
- Orderdet1.Consumable_order_minor__c = Order1.Id;
- Orderdet1.Consumable_Product__c = pro1.Id;
- Orderdet1.Asset_Model_No__c = 'Test01';
- Orderdet1.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
- Orderdet1.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJRF';
- Orderdet1.Cancellation_Date__c = null;
- Orderdet1.TracingCode__c = 'BXJRF';
- Orderdet1.SerialLotNo__c = '5ZK';
+ insert Orderdet;
+ Consumable_order_details2__c Orderdet1 = new Consumable_order_details2__c();
+ Orderdet1.Name = 'OCM_01_001001';
+ Orderdet1.Consumable_order_minor__c = Order1.Id;
+ Orderdet1.Consumable_Product__c = pro1.Id;
+ Orderdet1.Asset_Model_No__c = 'Test01';
+ Orderdet1.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
+ Orderdet1.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJRF';
+ Orderdet1.Cancellation_Date__c = null;
+ Orderdet1.TracingCode__c = 'BXJRF';
+ Orderdet1.SerialLotNo__c = '5ZK';
Orderdet1.Arrive_date__c = Date.today();
Orderdet1.exchangeOutPattern__c = true;
Orderdet1.Consumable_ZS_order__c = Order1.Id;
Orderdet1.Box_Piece__c = '鐩�';
- Orderdet1.Sterilization_limit__c = Date.today().addDays(2);
- insert Orderdet1;
- System.Test.startTest();
+ Orderdet1.Sterilization_limit__c= Date.today().addDays(2);
+ insert Orderdet1;
+ System.Test.startTest();
LexSummonsCreatController.init('', 'edit', 10, 1, Order1.Id);
- System.Test.stopTest();
- }
+ System.Test.stopTest();
+ }
}
-}
+}
\ No newline at end of file
diff --git a/force-app/main/default/classes/LexSummonsCreatControllerTest.cls-meta.xml b/force-app/main/default/classes/LexSummonsCreatControllerTest.cls-meta.xml
index a9fd6e9..754ecb1 100644
--- a/force-app/main/default/classes/LexSummonsCreatControllerTest.cls-meta.xml
+++ b/force-app/main/default/classes/LexSummonsCreatControllerTest.cls-meta.xml
@@ -1,4 +1,4 @@
-<?xml version="1.0" encoding="UTF-8" ?>
+<?xml version="1.0" encoding="UTF-8"?>
<ApexClass xmlns="http://soap.sforce.com/2006/04/metadata">
<apiVersion>57.0</apiVersion>
<status>Active</status>
diff --git a/force-app/main/default/classes/LexTopPageControllerTest.cls b/force-app/main/default/classes/LexTopPageControllerTest.cls
index 4a5f5d0..d8dd9dc 100644
--- a/force-app/main/default/classes/LexTopPageControllerTest.cls
+++ b/force-app/main/default/classes/LexTopPageControllerTest.cls
@@ -1,12 +1,12 @@
@IsTest
private class LexTopPageControllerTest {
@IsTest
- static void testMethod1() {
+ static void testMethod1(){
User currentUser = [SELECT Id FROM User WHERE Id = :UserInfo.getUserId()];
- NoteStay__c n = new NoteStay__c(Name = 'NoteStay', IsStay__c = true);
+ NoteStay__c n = new NoteStay__c(Name = 'NoteStay',IsStay__c = true);
insert n;
Test.startTest();
- System.runAs(currentUser) {
+ System.runAs(currentUser){
LexTopPageController.initAgency();
LexTopPageController.initPage(20, 1);
}
@@ -14,199 +14,142 @@
}
@IsTest
- static void testMethod2() {
+ static void testMethod2(){
user MyUser_Test;
Account myAccount1;
- User thisUser = [SELECT Id FROM User WHERE Id = :UserInfo.getUserId()];
- NoteStay__c n = new NoteStay__c(Name = 'NoteStay', IsStay__c = true);
+ User thisUser = [ select Id from User where Id = :UserInfo.getUserId()];
+ NoteStay__c n = new NoteStay__c(Name = 'NoteStay',IsStay__c = true);
insert n;
- System.runAs(thisUser) {
- Profile prof1 = [
- SELECT Id
- FROM Profile
- WHERE Name = '901_缁忛攢鍟嗙ぞ鍖烘櫘閫氭潈闄恄2閲嶉獙璇�(ET)'
- ];
- List<RecordType> rectCo = [
- SELECT Id
- FROM RecordType
- WHERE IsActive = TRUE AND SobjectType = 'Account' AND Name = '璨╁2搴�'
- ];
- if (rectCo.size() == 0) {
- return;
- }
- StaticParameter.EscapeConsumableOrderDetail2Trigger = true;
+ System.runAs(thisUser){
+ Profile prof1 = [select Id from Profile where Name ='901_缁忛攢鍟嗙ぞ鍖烘櫘閫氭潈闄恄2閲嶉獙璇�(ET)'];
+ List<RecordType> rectCo = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '璨╁2搴�'];
+ if (rectCo.size() == 0) {
+ return;
+ }
+ StaticParameter.EscapeConsumableOrderDetail2Trigger = true;
+
+ RecordType rectCoO = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '鐥呴櫌'];
+ Account olympus = new Account(RecordTypeId = rectCoO.Id, AgentCode_Ext__c = '9999900', Name = 'olympus');
+ insert olympus;
+ myAccount1 = new Account(name='Testaccount001',Dealer_discount__c =10,RecordTypeId = rectCo[0].Id,AgentCode_Ext__c = '8888888',Product_Limit_Date__c = 'Test07|3|100,Test08|10|50');
+ insert myAccount1;
+ Contact core = new Contact(email='jplumber@salesforce.com', firstname='Joe',lastname='Plumber',accountid=myAccount1.id);
+ insert core;
+ MyUser_Test = New User(ContactId = core.id,Alias = 'newUser',Email='newuser@testorg.com',EmailEncodingKey='UTF-8', LastName='TestUser', LanguageLocaleKey='zh_CN',LocaleSidKey='zh_CN', ProfileId = prof1.Id,TimeZoneSidKey='Asia/Shanghai', UserName='testUser@testorg.com',Work_Location__c = '閲嶅簡');
+ insert MyUser_Test;
- RecordType rectCoO = [
- SELECT Id
- FROM RecordType
- WHERE IsActive = TRUE AND SobjectType = 'Account' AND Name = '鐥呴櫌'
- ];
- Account olympus = new Account(RecordTypeId = rectCoO.Id, AgentCode_Ext__c = '9999900', Name = 'olympus');
- insert olympus;
- myAccount1 = new Account(
- name = 'Testaccount001',
- Dealer_discount__c = 10,
- RecordTypeId = rectCo[0].Id,
- AgentCode_Ext__c = '8888888',
- Product_Limit_Date__c = 'Test07|3|100,Test08|10|50'
- );
- insert myAccount1;
- Contact core = new Contact(
- email = 'jplumber@salesforce.com',
- firstname = 'Joe',
- lastname = 'Plumber',
- accountid = myAccount1.id
- );
- insert core;
- MyUser_Test = new User(
- ContactId = core.id,
- Alias = 'newUser',
- Email = 'newuser@testorg.com',
- EmailEncodingKey = 'UTF-8',
- LastName = 'TestUser',
- LanguageLocaleKey = 'zh_CN',
- LocaleSidKey = 'zh_CN',
- ProfileId = prof1.Id,
- TimeZoneSidKey = 'Asia/Shanghai',
- UserName = 'testUser@testorg.com',
- Work_Location__c = '閲嶅簡'
- );
- insert MyUser_Test;
- }
+ }
+
+ system.runAs(MyUser_Test){
+ //浜у搧鏁版嵁
+ Product2 prod07 = new Product2(Name='Test07',ProductCode='Test07',Asset_Model_No__c = 'Test07',SFDA_Status__c = '鏈夊姽',Dealer_special_Object__c = true,Packing_list_manual__c = 1,Manual_Entry__c = false);
+ Product2 prod08 = new Product2(Name='Test08',ProductCode='Test08',Asset_Model_No__c = 'Test08',SFDA_Status__c = '鏈夊姽',Dealer_special_Object__c = true,Packing_list_manual__c = 1,Manual_Entry__c = false);
+ Product2 prod09 = new Product2(Name='Test09',ProductCode='Test09',Asset_Model_No__c = 'Test09',SFDA_Status__c = '鏈夊姽',Dealer_special_Object__c = true,Packing_list_manual__c = 1,Manual_Entry__c = false);
+ insert new Product2[] {prod07,prod08,prod09};
- System.runAs(MyUser_Test) {
- //浜у搧鏁版嵁
- Product2 prod07 = new Product2(
- Name = 'Test07',
- ProductCode = 'Test07',
- Asset_Model_No__c = 'Test07',
- SFDA_Status__c = '鏈夊姽',
- Dealer_special_Object__c = true,
- Packing_list_manual__c = 1,
- Manual_Entry__c = false
- );
- Product2 prod08 = new Product2(
- Name = 'Test08',
- ProductCode = 'Test08',
- Asset_Model_No__c = 'Test08',
- SFDA_Status__c = '鏈夊姽',
- Dealer_special_Object__c = true,
- Packing_list_manual__c = 1,
- Manual_Entry__c = false
- );
- Product2 prod09 = new Product2(
- Name = 'Test09',
- ProductCode = 'Test09',
- Asset_Model_No__c = 'Test09',
- SFDA_Status__c = '鏈夊姽',
- Dealer_special_Object__c = true,
- Packing_list_manual__c = 1,
- Manual_Entry__c = false
- );
- insert new List<Product2>{ prod07, prod08, prod09 };
+ //鍒朵綔浜у搧
+ Product2__c proG = new Product2__c(Name='MH-155:鐧藉钩琛″附',OT_CODE_Text__c='Test001',Product2__c = prod07.Id);
+ insert proG;
+ Product2__c proH = new Product2__c(Name='MB-677:BNC鐢电紗',OT_CODE_Text__c='Test002',Product2__c = prod08.Id);
+ insert proH;
+ Product2__c proF = new Product2__c(Name='TooMAJ-643R:姘村泭闉樼003',OT_CODE_Text__c='Test003',Product2__c = prod09.Id);
+ insert proF;
- //鍒朵綔浜у搧
- Product2__c proG = new Product2__c(Name = 'MH-155:鐧藉钩琛″附', OT_CODE_Text__c = 'Test001', Product2__c = prod07.Id);
- insert proG;
- Product2__c proH = new Product2__c(Name = 'MB-677:BNC鐢电紗', OT_CODE_Text__c = 'Test002', Product2__c = prod08.Id);
- insert proH;
- Product2__c proF = new Product2__c(Name = 'TooMAJ-643R:姘村泭闉樼003', OT_CODE_Text__c = 'Test003', Product2__c = prod09.Id);
- insert proF;
- //璁㈠崟
- Consumable_order__c order = new Consumable_order__c();
- order.Name = 'testMing';
- order.Order_status__c = '鎵瑰噯';
- order.RecordTypeid = System.Label.RT_ConOrder_Order;
- order.Dealer_Info__c = myAccount1.id;
- order.Inventory_date__c = Date.today();
- order.Order_type__c = '璁㈠崟';
- order.Order_ProType__c = 'ET';
- insert order;
- //鍒拌揣
- Consumable_order__c order2 = new Consumable_order__c();
- order2.Name = 'testMing1';
- order2.Order_status__c = '鎵瑰噯';
- order2.RecordTypeid = '01210000000c9dqAAA';
- order2.Dealer_Info__c = myAccount1.id;
- order2.Order_type__c = '鍒拌揣';
- order2.Order_ProType__c = 'ET';
- insert order2;
+ //璁㈠崟
+ Consumable_order__c order = new Consumable_order__c();
+ order.Name = 'testMing';
+ order.Order_status__c = '鎵瑰噯';
+ order.RecordTypeid = System.Label.RT_ConOrder_Order;
+ order.Dealer_Info__c = myAccount1.id;
+ order.Inventory_date__c = Date.today();
+ order.Order_type__c = '璁㈠崟';
+ order.Order_ProType__c = 'ET';
+ insert order;
+ //鍒拌揣
+ Consumable_order__c order2 = new Consumable_order__c();
+ order2.Name = 'testMing1';
+ order2.Order_status__c = '鎵瑰噯';
+ order2.RecordTypeid = '01210000000c9dqAAA';
+ order2.Dealer_Info__c = myAccount1.id;
+ order2.Order_type__c = '鍒拌揣';
+ order2.Order_ProType__c = 'ET';
+ insert order2;
- List<Consumable_order_details2__c> conList = new List<Consumable_order_details2__c>();
- //鍒朵綔Consumable_order_details__c-------ProductCount
- // 閿�鍞�
- Consumable_order_details2__c dataForProductCount7 = new Consumable_order_details2__c();
- dataForProductCount7.Bar_Code__c = '123456789298k250AAAAA';
- dataForProductCount7.Sterilization_limit__c = Date.today().addDays(2);
- dataForProductCount7.Arrive_date__c = Date.today();
- dataForProductCount7.RecordTypeid = System.Label.RT_ConOrderDetail2_Delivery;
- dataForProductCount7.Consumable_Product__c = proH.id;
- dataForProductCount7.Asset_Model_No__c = proH.Asset_Model_No__c;
- dataForProductCount7.Box_Piece__c = '鐩�';
+ List<Consumable_order_details2__c> conList = new List<Consumable_order_details2__c>();
+ //鍒朵綔Consumable_order_details__c-------ProductCount
+ // 閿�鍞�
+ Consumable_order_details2__c dataForProductCount7 = new Consumable_order_details2__c();
+ dataForProductCount7.Bar_Code__c = '123456789298k250AAAAA';
+ dataForProductCount7.Sterilization_limit__c = Date.today().addDays(2);
+ dataForProductCount7.Arrive_date__c = Date.today();
+ dataForProductCount7.RecordTypeid = System.Label.RT_ConOrderDetail2_Delivery;
+ dataForProductCount7.Consumable_Product__c = proH.id;
+ dataForProductCount7.Asset_Model_No__c = proH.Asset_Model_No__c;
+ dataForProductCount7.Box_Piece__c = '鐩�';
dataForProductCount7.Used_date__c = Date.today();
dataForProductCount7.Consumable_order_minor__c = order.id;
- conList.add(dataForProductCount7);
- // 鍦ㄥ簱 杩囨湡 鐩�
- Consumable_order_details2__c dataForProduct = new Consumable_order_details2__c();
- dataForProduct.Bar_Code__c = '123456789498k250BBBBB';
- dataForProduct.Sterilization_limit__c = Date.today().addDays(-2);
- dataForProduct.Arrive_date__c = Date.today();
- dataForProduct.RecordTypeid = System.Label.RT_ConOrderDetail2_Delivery;
- dataForProduct.Consumable_Product__c = proF.id;
- dataForProduct.Asset_Model_No__c = proF.Asset_Model_No__c;
- dataForProduct.Box_Piece__c = '鐩�';
- dataForProduct.Consumable_order_minor__c = order.id;
+ conList.add(dataForProductCount7);
+ // 鍦ㄥ簱 杩囨湡 鐩�
+ Consumable_order_details2__c dataForProduct = new Consumable_order_details2__c();
+ dataForProduct.Bar_Code__c = '123456789498k250BBBBB';
+ dataForProduct.Sterilization_limit__c = Date.today().addDays(-2);
+ dataForProduct.Arrive_date__c = Date.today();
+ dataForProduct.RecordTypeid = System.Label.RT_ConOrderDetail2_Delivery;
+ dataForProduct.Consumable_Product__c = proF.id;
+ dataForProduct.Asset_Model_No__c = proF.Asset_Model_No__c;
+ dataForProduct.Box_Piece__c = '鐩�';
+ dataForProduct.Consumable_order_minor__c = order.id;
- conList.add(dataForProduct);
- // 鍦ㄥ簱 杩囨湡 涓�
- Consumable_order_details2__c dataForProductCount3 = new Consumable_order_details2__c();
- dataForProductCount3.Bar_Code__c = '123456788398k250CCCCC';
- dataForProductCount3.Sterilization_limit__c = Date.today().addDays(-2);
- dataForProductCount3.Arrive_date__c = Date.today();
- dataForProductCount3.RecordTypeid = System.Label.RT_ConOrderDetail2_Delivery;
- dataForProductCount3.Consumable_Product__c = proG.id;
- dataForProductCount3.Asset_Model_No__c = proG.Asset_Model_No__c;
- dataForProductCount3.Box_Piece__c = '涓�';
+ conList.add(dataForProduct);
+ // 鍦ㄥ簱 杩囨湡 涓�
+ Consumable_order_details2__c dataForProductCount3 = new Consumable_order_details2__c();
+ dataForProductCount3.Bar_Code__c = '123456788398k250CCCCC';
+ dataForProductCount3.Sterilization_limit__c = Date.today().addDays(-2);
+ dataForProductCount3.Arrive_date__c = Date.today();
+ dataForProductCount3.RecordTypeid = System.Label.RT_ConOrderDetail2_Delivery;
+ dataForProductCount3.Consumable_Product__c = proG.id;
+ dataForProductCount3.Asset_Model_No__c = proG.Asset_Model_No__c;
+ dataForProductCount3.Box_Piece__c = '涓�';
dataForProductCount3.RemoveBox_No__c = 1;
dataForProductCount3.Consumable_order_minor__c = order.id;
- conList.add(dataForProductCount3);
- insert conList;
-
- //杩囨湡搴撳瓨姹囨�讳俊鎭� add by Wang Xueqin
- List<Consumable_order_details2__c> conList1 = new List<Consumable_order_details2__c>();
- Consumable_order_details2__c dataForProductCount4 = new Consumable_order_details2__c();
- dataForProductCount4.Bar_Code__c = '1001';
- dataForProductCount4.Arrive_date__c = Date.today();
- dataForProductCount4.Send_Date__c = null;
- dataForProductCount4.Used_date__c = null;
- dataForProductCount4.Return_date__c = null;
- dataForProductCount4.Lose_Flag__c = false;
- dataForProductCount4.Cancellation_Flag__c = false;
- dataForProductCount4.Consumable_Product__c = proG.Id;
- dataForProductCount4.Consumable_Arrived_order__c = order2.id;
- dataForProductCount4.Used_account__c = myAccount1.Id;
- dataForProductCount4.Sterilization_limit__c = Date.today().addDays(-2);
- dataForProductCount4.Box_Piece__c = '鐩�';
- conList1.add(dataForProductCount4);
- System.debug('conList1==>' + conList1);
- //鏌ヨ鎵�鏈夎繃鏈熷簱瀛�
- Consumable_order_details2__c dataForProductCount5 = new Consumable_order_details2__c();
- dataForProductCount5.Bar_Code__c = '1002';
- dataForProductCount5.Arrive_date__c = Date.today();
- dataForProductCount5.Send_Date__c = Date.today();
- dataForProductCount5.Used_date__c = Date.today();
- dataForProductCount5.Return_date__c = null;
- dataForProductCount5.Lose_Flag__c = false;
- dataForProductCount5.Cancellation_Flag__c = false;
- dataForProductCount5.Consumable_Product__c = proG.Id;
- dataForProductCount5.Consumable_Arrived_order__c = order2.id;
- dataForProductCount5.Used_account__c = myAccount1.Id;
- dataForProductCount5.Sterilization_limit__c = Date.today().addDays(-2);
- dataForProductCount5.Box_Piece__c = '鐩�';
- conList1.add(dataForProductCount5);
- insert conList1;
+ conList.add(dataForProductCount3);
+ insert conList;
+
+ //杩囨湡搴撳瓨姹囨�讳俊鎭� add by Wang Xueqin
+ List<Consumable_order_details2__c> conList1 = new List<Consumable_order_details2__c>();
+ Consumable_order_details2__c dataForProductCount4 = new Consumable_order_details2__c();
+ dataForProductCount4.Bar_Code__c = '1001';
+ dataForProductCount4.Arrive_date__c = Date.today();
+ dataForProductCount4.Send_Date__c = null;
+ dataForProductCount4.Used_date__c = null;
+ dataForProductCount4.Return_date__c = null;
+ dataForProductCount4.Lose_Flag__c = false;
+ dataForProductCount4.Cancellation_Flag__c = false;
+ dataForProductCount4.Consumable_Product__c = proG.Id;
+ dataForProductCount4.Consumable_Arrived_order__c = order2.id;
+ dataForProductCount4.Used_account__c = myAccount1.Id;
+ dataForProductCount4.Sterilization_limit__c = Date.today().addDays(-2);
+ dataForProductCount4.Box_Piece__c = '鐩�';
+ conList1.add(dataForProductCount4);
+ System.debug('conList1==>'+conList1);
+ //鏌ヨ鎵�鏈夎繃鏈熷簱瀛�
+ Consumable_order_details2__c dataForProductCount5 = new Consumable_order_details2__c();
+ dataForProductCount5.Bar_Code__c = '1002';
+ dataForProductCount5.Arrive_date__c = Date.today();
+ dataForProductCount5.Send_Date__c = Date.today();
+ dataForProductCount5.Used_date__c = Date.today();
+ dataForProductCount5.Return_date__c = null;
+ dataForProductCount5.Lose_Flag__c = false;
+ dataForProductCount5.Cancellation_Flag__c = false;
+ dataForProductCount5.Consumable_Product__c = proG.Id;
+ dataForProductCount5.Consumable_Arrived_order__c = order2.id;
+ dataForProductCount5.Used_account__c = myAccount1.Id;
+ dataForProductCount5.Sterilization_limit__c = Date.today().addDays(-2);
+ dataForProductCount5.Box_Piece__c = '鐩�';
+ conList1.add(dataForProductCount5);
+ insert conList1;
Test.startTest();
LexTopPageController.initAgency();
LexTopPageController.initPage(20, 1);
@@ -215,198 +158,142 @@
}
@IsTest
- static void testMethod3() {
+ static void testMethod3(){
user MyUser_Test;
Account myAccount1;
- User thisUser = [SELECT Id FROM User WHERE Id = :UserInfo.getUserId()];
- NoteStay__c n = new NoteStay__c(Name = 'NoteStay', IsStay__c = true);
+ User thisUser = [ select Id from User where Id = :UserInfo.getUserId()];
+ NoteStay__c n = new NoteStay__c(Name = 'NoteStay',IsStay__c = true);
insert n;
- System.runAs(thisUser) {
- Profile prof1 = [
- SELECT Id
- FROM Profile
- WHERE Name = '901_缁忛攢鍟嗙ぞ鍖烘櫘閫氭潈闄恄2閲嶉獙璇�(ET)'
- ];
- List<RecordType> rectCo = [
- SELECT Id
- FROM RecordType
- WHERE IsActive = TRUE AND SobjectType = 'Account' AND Name = '璨╁2搴�'
- ];
- if (rectCo.size() == 0) {
- return;
- }
- StaticParameter.EscapeConsumableOrderDetail2Trigger = true;
+ System.runAs(thisUser){
+ Profile prof1 = [select Id from Profile where Name ='901_缁忛攢鍟嗙ぞ鍖烘櫘閫氭潈闄恄2閲嶉獙璇�(ET)'];
+ List<RecordType> rectCo = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '璨╁2搴�'];
+ if (rectCo.size() == 0) {
+ return;
+ }
+ StaticParameter.EscapeConsumableOrderDetail2Trigger = true;
+
+ RecordType rectCoO = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '鐥呴櫌'];
+ Account olympus = new Account(RecordTypeId = rectCoO.Id, AgentCode_Ext__c = '9999900', Name = 'olympus');
+ insert olympus;
+ myAccount1 = new Account(name='Testaccount001',Dealer_discount__c =10,RecordTypeId = rectCo[0].Id,AgentCode_Ext__c = '8888888');
+ insert myAccount1;
+ Contact core = new Contact(email='jplumber@salesforce.com', firstname='Joe',lastname='Plumber',accountid=myAccount1.id);
+ insert core;
+ MyUser_Test = New User(ContactId = core.id,Alias = 'newUser',Email='newuser@testorg.com',EmailEncodingKey='UTF-8', LastName='TestUser', LanguageLocaleKey='zh_CN',LocaleSidKey='zh_CN', ProfileId = prof1.Id,TimeZoneSidKey='Asia/Shanghai', UserName='testUser@testorg.com',Work_Location__c = '閲嶅簡');
+ insert MyUser_Test;
- RecordType rectCoO = [
- SELECT Id
- FROM RecordType
- WHERE IsActive = TRUE AND SobjectType = 'Account' AND Name = '鐥呴櫌'
- ];
- Account olympus = new Account(RecordTypeId = rectCoO.Id, AgentCode_Ext__c = '9999900', Name = 'olympus');
- insert olympus;
- myAccount1 = new Account(
- name = 'Testaccount001',
- Dealer_discount__c = 10,
- RecordTypeId = rectCo[0].Id,
- AgentCode_Ext__c = '8888888'
- );
- insert myAccount1;
- Contact core = new Contact(
- email = 'jplumber@salesforce.com',
- firstname = 'Joe',
- lastname = 'Plumber',
- accountid = myAccount1.id
- );
- insert core;
- MyUser_Test = new User(
- ContactId = core.id,
- Alias = 'newUser',
- Email = 'newuser@testorg.com',
- EmailEncodingKey = 'UTF-8',
- LastName = 'TestUser',
- LanguageLocaleKey = 'zh_CN',
- LocaleSidKey = 'zh_CN',
- ProfileId = prof1.Id,
- TimeZoneSidKey = 'Asia/Shanghai',
- UserName = 'testUser@testorg.com',
- Work_Location__c = '閲嶅簡'
- );
- insert MyUser_Test;
- }
+ }
+
+ system.runAs(MyUser_Test){
+ //浜у搧鏁版嵁
+ Product2 prod07 = new Product2(Name='Test07',ProductCode='Test07',Asset_Model_No__c = 'Test07',SFDA_Status__c = '鏈夊姽',Dealer_special_Object__c = true,Packing_list_manual__c = 1,Manual_Entry__c = false);
+ Product2 prod08 = new Product2(Name='Test08',ProductCode='Test08',Asset_Model_No__c = 'Test08',SFDA_Status__c = '鏈夊姽',Dealer_special_Object__c = true,Packing_list_manual__c = 1,Manual_Entry__c = false);
+ Product2 prod09 = new Product2(Name='Test09',ProductCode='Test09',Asset_Model_No__c = 'Test09',SFDA_Status__c = '鏈夊姽',Dealer_special_Object__c = true,Packing_list_manual__c = 1,Manual_Entry__c = false);
+ insert new Product2[] {prod07,prod08,prod09};
- System.runAs(MyUser_Test) {
- //浜у搧鏁版嵁
- Product2 prod07 = new Product2(
- Name = 'Test07',
- ProductCode = 'Test07',
- Asset_Model_No__c = 'Test07',
- SFDA_Status__c = '鏈夊姽',
- Dealer_special_Object__c = true,
- Packing_list_manual__c = 1,
- Manual_Entry__c = false
- );
- Product2 prod08 = new Product2(
- Name = 'Test08',
- ProductCode = 'Test08',
- Asset_Model_No__c = 'Test08',
- SFDA_Status__c = '鏈夊姽',
- Dealer_special_Object__c = true,
- Packing_list_manual__c = 1,
- Manual_Entry__c = false
- );
- Product2 prod09 = new Product2(
- Name = 'Test09',
- ProductCode = 'Test09',
- Asset_Model_No__c = 'Test09',
- SFDA_Status__c = '鏈夊姽',
- Dealer_special_Object__c = true,
- Packing_list_manual__c = 1,
- Manual_Entry__c = false
- );
- insert new List<Product2>{ prod07, prod08, prod09 };
+ //鍒朵綔浜у搧
+ Product2__c proG = new Product2__c(Name='MH-155:鐧藉钩琛″附',OT_CODE_Text__c='Test001',Product2__c = prod07.Id);
+ insert proG;
+ Product2__c proH = new Product2__c(Name='MB-677:BNC鐢电紗',OT_CODE_Text__c='Test002',Product2__c = prod08.Id);
+ insert proH;
+ Product2__c proF = new Product2__c(Name='TooMAJ-643R:姘村泭闉樼003',OT_CODE_Text__c='Test003',Product2__c = prod09.Id);
+ insert proF;
- //鍒朵綔浜у搧
- Product2__c proG = new Product2__c(Name = 'MH-155:鐧藉钩琛″附', OT_CODE_Text__c = 'Test001', Product2__c = prod07.Id);
- insert proG;
- Product2__c proH = new Product2__c(Name = 'MB-677:BNC鐢电紗', OT_CODE_Text__c = 'Test002', Product2__c = prod08.Id);
- insert proH;
- Product2__c proF = new Product2__c(Name = 'TooMAJ-643R:姘村泭闉樼003', OT_CODE_Text__c = 'Test003', Product2__c = prod09.Id);
- insert proF;
- //璁㈠崟
- Consumable_order__c order = new Consumable_order__c();
- order.Name = 'testMing';
- order.Order_status__c = '鎵瑰噯';
- order.RecordTypeid = System.Label.RT_ConOrder_Order;
- order.Dealer_Info__c = myAccount1.id;
- order.Inventory_date__c = Date.today();
- order.Order_type__c = '璁㈠崟';
- order.Order_ProType__c = 'ET';
- insert order;
- //鍒拌揣
- Consumable_order__c order2 = new Consumable_order__c();
- order2.Name = 'testMing1';
- order2.Order_status__c = '鎵瑰噯';
- order2.RecordTypeid = '01210000000c9dqAAA';
- order2.Dealer_Info__c = myAccount1.id;
- order2.Order_type__c = '鍒拌揣';
- order2.Order_ProType__c = 'ET';
- insert order2;
+ //璁㈠崟
+ Consumable_order__c order = new Consumable_order__c();
+ order.Name = 'testMing';
+ order.Order_status__c = '鎵瑰噯';
+ order.RecordTypeid = System.Label.RT_ConOrder_Order;
+ order.Dealer_Info__c = myAccount1.id;
+ order.Inventory_date__c = Date.today();
+ order.Order_type__c = '璁㈠崟';
+ order.Order_ProType__c = 'ET';
+ insert order;
+ //鍒拌揣
+ Consumable_order__c order2 = new Consumable_order__c();
+ order2.Name = 'testMing1';
+ order2.Order_status__c = '鎵瑰噯';
+ order2.RecordTypeid = '01210000000c9dqAAA';
+ order2.Dealer_Info__c = myAccount1.id;
+ order2.Order_type__c = '鍒拌揣';
+ order2.Order_ProType__c = 'ET';
+ insert order2;
- List<Consumable_order_details2__c> conList = new List<Consumable_order_details2__c>();
- //鍒朵綔Consumable_order_details__c-------ProductCount
- // 閿�鍞�
- Consumable_order_details2__c dataForProductCount7 = new Consumable_order_details2__c();
- dataForProductCount7.Bar_Code__c = '123456789298k250AAAAA';
- dataForProductCount7.Sterilization_limit__c = Date.today().addDays(2);
- dataForProductCount7.Arrive_date__c = Date.today();
- dataForProductCount7.RecordTypeid = System.Label.RT_ConOrderDetail2_Delivery;
- dataForProductCount7.Consumable_Product__c = proH.id;
- dataForProductCount7.Asset_Model_No__c = proH.Asset_Model_No__c;
- dataForProductCount7.Box_Piece__c = '涓�';
+ List<Consumable_order_details2__c> conList = new List<Consumable_order_details2__c>();
+ //鍒朵綔Consumable_order_details__c-------ProductCount
+ // 閿�鍞�
+ Consumable_order_details2__c dataForProductCount7 = new Consumable_order_details2__c();
+ dataForProductCount7.Bar_Code__c = '123456789298k250AAAAA';
+ dataForProductCount7.Sterilization_limit__c = Date.today().addDays(2);
+ dataForProductCount7.Arrive_date__c = Date.today();
+ dataForProductCount7.RecordTypeid = System.Label.RT_ConOrderDetail2_Delivery;
+ dataForProductCount7.Consumable_Product__c = proH.id;
+ dataForProductCount7.Asset_Model_No__c = proH.Asset_Model_No__c;
+ dataForProductCount7.Box_Piece__c = '涓�';
dataForProductCount7.Used_date__c = Date.today();
dataForProductCount7.Consumable_order_minor__c = order.id;
- conList.add(dataForProductCount7);
- // 鍦ㄥ簱 杩囨湡 鐩�
- Consumable_order_details2__c dataForProduct = new Consumable_order_details2__c();
- dataForProduct.Bar_Code__c = '123456789498k250BBBBB';
- dataForProduct.Sterilization_limit__c = Date.today().addDays(-2);
- dataForProduct.Arrive_date__c = Date.today();
- dataForProduct.RecordTypeid = System.Label.RT_ConOrderDetail2_Delivery;
- dataForProduct.Consumable_Product__c = proF.id;
- dataForProduct.Asset_Model_No__c = proF.Asset_Model_No__c;
- dataForProduct.Box_Piece__c = '涓�';
- dataForProduct.Consumable_order_minor__c = order.id;
+ conList.add(dataForProductCount7);
+ // 鍦ㄥ簱 杩囨湡 鐩�
+ Consumable_order_details2__c dataForProduct = new Consumable_order_details2__c();
+ dataForProduct.Bar_Code__c = '123456789498k250BBBBB';
+ dataForProduct.Sterilization_limit__c = Date.today().addDays(-2);
+ dataForProduct.Arrive_date__c = Date.today();
+ dataForProduct.RecordTypeid = System.Label.RT_ConOrderDetail2_Delivery;
+ dataForProduct.Consumable_Product__c = proF.id;
+ dataForProduct.Asset_Model_No__c = proF.Asset_Model_No__c;
+ dataForProduct.Box_Piece__c = '涓�';
+ dataForProduct.Consumable_order_minor__c = order.id;
- conList.add(dataForProduct);
- // 鍦ㄥ簱 杩囨湡 涓�
- Consumable_order_details2__c dataForProductCount3 = new Consumable_order_details2__c();
- dataForProductCount3.Bar_Code__c = '123456788398k250CCCCC';
- dataForProductCount3.Sterilization_limit__c = Date.today().addDays(-2);
- dataForProductCount3.Arrive_date__c = Date.today();
- dataForProductCount3.RecordTypeid = System.Label.RT_ConOrderDetail2_Delivery;
- dataForProductCount3.Consumable_Product__c = proG.id;
- dataForProductCount3.Asset_Model_No__c = proG.Asset_Model_No__c;
- dataForProductCount3.Box_Piece__c = '涓�';
+ conList.add(dataForProduct);
+ // 鍦ㄥ簱 杩囨湡 涓�
+ Consumable_order_details2__c dataForProductCount3 = new Consumable_order_details2__c();
+ dataForProductCount3.Bar_Code__c = '123456788398k250CCCCC';
+ dataForProductCount3.Sterilization_limit__c = Date.today().addDays(-2);
+ dataForProductCount3.Arrive_date__c = Date.today();
+ dataForProductCount3.RecordTypeid = System.Label.RT_ConOrderDetail2_Delivery;
+ dataForProductCount3.Consumable_Product__c = proG.id;
+ dataForProductCount3.Asset_Model_No__c = proG.Asset_Model_No__c;
+ dataForProductCount3.Box_Piece__c = '涓�';
dataForProductCount3.RemoveBox_No__c = 1;
dataForProductCount3.Consumable_order_minor__c = order.id;
- conList.add(dataForProductCount3);
- insert conList;
-
- //杩囨湡搴撳瓨姹囨�讳俊鎭� add by Wang Xueqin
- List<Consumable_order_details2__c> conList1 = new List<Consumable_order_details2__c>();
- Consumable_order_details2__c dataForProductCount4 = new Consumable_order_details2__c();
- dataForProductCount4.Bar_Code__c = '1001';
- dataForProductCount4.Arrive_date__c = Date.today();
- dataForProductCount4.Send_Date__c = null;
- dataForProductCount4.Used_date__c = null;
- dataForProductCount4.Return_date__c = null;
- dataForProductCount4.Lose_Flag__c = false;
- dataForProductCount4.Cancellation_Flag__c = false;
- dataForProductCount4.Consumable_Product__c = proG.Id;
- dataForProductCount4.Consumable_Arrived_order__c = order2.id;
- dataForProductCount4.Used_account__c = myAccount1.Id;
- dataForProductCount4.Sterilization_limit__c = Date.today().addDays(-2);
- dataForProductCount4.Box_Piece__c = '涓�';
- conList1.add(dataForProductCount4);
- System.debug('conList1==>' + conList1);
- //鏌ヨ鎵�鏈夎繃鏈熷簱瀛�
- Consumable_order_details2__c dataForProductCount5 = new Consumable_order_details2__c();
- dataForProductCount5.Bar_Code__c = '1002';
- dataForProductCount5.Arrive_date__c = Date.today();
- dataForProductCount5.Send_Date__c = Date.today();
- dataForProductCount5.Used_date__c = Date.today();
- dataForProductCount5.Return_date__c = null;
- dataForProductCount5.Lose_Flag__c = false;
- dataForProductCount5.Cancellation_Flag__c = false;
- dataForProductCount5.Consumable_Product__c = proG.Id;
- dataForProductCount5.Consumable_Arrived_order__c = order2.id;
- dataForProductCount5.Used_account__c = myAccount1.Id;
- dataForProductCount5.Sterilization_limit__c = Date.today().addDays(-2);
- dataForProductCount5.Box_Piece__c = '涓�';
- conList1.add(dataForProductCount5);
- insert conList1;
+ conList.add(dataForProductCount3);
+ insert conList;
+
+ //杩囨湡搴撳瓨姹囨�讳俊鎭� add by Wang Xueqin
+ List<Consumable_order_details2__c> conList1 = new List<Consumable_order_details2__c>();
+ Consumable_order_details2__c dataForProductCount4 = new Consumable_order_details2__c();
+ dataForProductCount4.Bar_Code__c = '1001';
+ dataForProductCount4.Arrive_date__c = Date.today();
+ dataForProductCount4.Send_Date__c = null;
+ dataForProductCount4.Used_date__c = null;
+ dataForProductCount4.Return_date__c = null;
+ dataForProductCount4.Lose_Flag__c = false;
+ dataForProductCount4.Cancellation_Flag__c = false;
+ dataForProductCount4.Consumable_Product__c = proG.Id;
+ dataForProductCount4.Consumable_Arrived_order__c = order2.id;
+ dataForProductCount4.Used_account__c = myAccount1.Id;
+ dataForProductCount4.Sterilization_limit__c = Date.today().addDays(-2);
+ dataForProductCount4.Box_Piece__c = '涓�';
+ conList1.add(dataForProductCount4);
+ System.debug('conList1==>'+conList1);
+ //鏌ヨ鎵�鏈夎繃鏈熷簱瀛�
+ Consumable_order_details2__c dataForProductCount5 = new Consumable_order_details2__c();
+ dataForProductCount5.Bar_Code__c = '1002';
+ dataForProductCount5.Arrive_date__c = Date.today();
+ dataForProductCount5.Send_Date__c = Date.today();
+ dataForProductCount5.Used_date__c = Date.today();
+ dataForProductCount5.Return_date__c = null;
+ dataForProductCount5.Lose_Flag__c = false;
+ dataForProductCount5.Cancellation_Flag__c = false;
+ dataForProductCount5.Consumable_Product__c = proG.Id;
+ dataForProductCount5.Consumable_Arrived_order__c = order2.id;
+ dataForProductCount5.Used_account__c = myAccount1.Id;
+ dataForProductCount5.Sterilization_limit__c = Date.today().addDays(-2);
+ dataForProductCount5.Box_Piece__c = '涓�';
+ conList1.add(dataForProductCount5);
+ insert conList1;
Test.startTest();
LexTopPageController.initAgency();
LexTopPageController.initPage(20, 1);
@@ -421,4 +308,5 @@
Test.stopTest();
}
}
-}
+
+}
\ No newline at end of file
diff --git a/force-app/main/default/classes/LexTopPageControllerTest.cls-meta.xml b/force-app/main/default/classes/LexTopPageControllerTest.cls-meta.xml
index a9fd6e9..754ecb1 100644
--- a/force-app/main/default/classes/LexTopPageControllerTest.cls-meta.xml
+++ b/force-app/main/default/classes/LexTopPageControllerTest.cls-meta.xml
@@ -1,4 +1,4 @@
-<?xml version="1.0" encoding="UTF-8" ?>
+<?xml version="1.0" encoding="UTF-8"?>
<ApexClass xmlns="http://soap.sforce.com/2006/04/metadata">
<apiVersion>57.0</apiVersion>
<status>Active</status>
diff --git a/force-app/main/default/classes/LexUpAccountProLimit.cls b/force-app/main/default/classes/LexUpAccountProLimit.cls
index 37d85bc..68dfba6 100644
--- a/force-app/main/default/classes/LexUpAccountProLimit.cls
+++ b/force-app/main/default/classes/LexUpAccountProLimit.cls
@@ -1,56 +1,59 @@
public without sharing class LexUpAccountProLimit {
@AuraEnabled
- public static ResponseBodyLWC upAccount(String accountId, String productLimit, String userPro_Type) {
+ public static ResponseBodyLWC upAccount(String accountId,String productLimit,String userPro_Type){
ResponseBodyLWC res = new ResponseBodyLWC();
- Map<String, object> data = new Map<String, object>();
+ Map<String,object> data = new Map<String,object>();
res.entity = data;
//--------AddStart-----XHL--------------20180929-------------
Boolean EngFlag = false;
- Boolean ETFlag = false;
- String userPro_Typestr = null;
- if (String.isBlank(userPro_Type)) {
+ Boolean ETFlag = false;
+ String userPro_Typestr = null;
+ if(String.isBlank(userPro_Type)){
userPro_Type = 'ET';
}
- if (userPro_Type == 'ENG') {
+ if(userPro_Type == 'ENG'){
EngFlag = true;
- } else {
+ }else{
ETFlag = true;
}
//ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR,'userPro_Type:'+ userPro_Type));
//ApexPages.message(ApexPages.severity.ERROR,'userPro_Type:'+ userPro_Type));
userPro_Typestr = '%' + userPro_Type + '%';
- //--------AddEnd-----XHL--------------20180929-------------
+ //--------AddEnd-----XHL--------------20180929-------------
system.debug('userPro_Type' + userPro_Type);
- String checkResoultstr = checkResoult(productLimit);
- system.debug('checkResoultstr====>' + checkResoultstr);
- system.debug('accountId' + accountId);
- if (String.isNotBlank(checkResoultstr)) {
- return new ResponseBodyLWC('Error', 500, '' + checkResoultstr + '', '');
+ String checkResoultstr = checkResoult(productLimit);
+ system.debug('checkResoultstr====>'+checkResoultstr);
+ system.debug('accountId'+accountId);
+ if(String.isNotBlank(checkResoultstr)){
+ return new ResponseBodyLWC('Error',500,''+checkResoultstr+'', '');
// return checkResoultstr;
}
//String[] proidList =new String[]{};
- String[] proList = new List<String>{};
- String[] pro_List = new List<String>{};
+ String[] proList =new String[]{};
+ String[] pro_List =new String[]{};
List<Account> acc = [
- SELECT Id, Name, Product_Limit_Date__c
- FROM Account
- WHERE Id = :accountId
+ SELECT
+ Id,
+ Name,
+ Product_Limit_Date__c
+ FROM
+ Account
+ WHERE
+ Id = : accountId
FOR UPDATE
];
- if (null == acc || acc.size() == 0) {
+ if(null == acc || acc.size() == 0) {
// return '娌℃湁缁忛攢鍟嗭細' + accountId + '鐨勬暟鎹��';
- return new ResponseBodyLWC('Error', 500, '娌℃湁缁忛攢鍟嗭細' + accountId + '鐨勬暟鎹��', '');
+ return new ResponseBodyLWC('Error',500,'娌℃湁缁忛攢鍟嗭細' + accountId + '鐨勬暟鎹��', '');
}
//proidList = acc[0].view_product__c.split(',');
//--------UpdateStart-----XHL--------------20180929-------------
String sql = '';
-
- List<Product2__c> roduct2List = [
- SELECT Asset_Model_No__c, Estimation_Entry_Possibility__c
- FROM Product2__c
- WHERE Product_Type__c LIKE :userPro_Typestr AND Estimation_Entry_Possibility__c = '鈼�'
- ]; //Add by WangXueqin 20230605
+
+ List<Product2__c> roduct2List = [SELECT Asset_Model_No__c,Estimation_Entry_Possibility__c
+ FROM Product2__c
+ WHERE Product_Type__c like :userPro_Typestr and Estimation_Entry_Possibility__c = '鈼�'];//Add by WangXueqin 20230605
//ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR,'roduct2List:'+ roduct2List));
//sql = 'SELECT Asset_Model_No__c '
// + ' FROM Product2__c '
@@ -58,89 +61,90 @@
//if(EngFlag){
// sql += ' AND Pro2_Dealer_ENG__c =' + EngFlag ;
//}else if(ETFlag){
- // sql += ' AND Pro2_Dealer_Object__c = ' + ETFlag;
+ // sql += ' AND Pro2_Dealer_Object__c = ' + ETFlag;
//}
//system.debug('sqlZZZZZZ' + sql);
- //List<Product2__c> roduct2List = Database.query(sql);
+ //List<Product2__c> roduct2List = Database.query(sql);
//--------UpdateEnd-----XHL--------------20180929-------------
Map<String, String> productMap = new Map<String, String>();
proList = productLimit.split(',');
system.debug('productLimitDDDDD' + productLimit);
system.debug('proListFFFFF' + proList);
- if (proList.size() > 0 && String.isNotEmpty(proList[0])) {
- for (Integer i = 0; i < proList.size(); i++) {
- pro_List.add(proList[i].subString(0, proList[i].indexOf('|')));
+ if(proList.size() > 0 && String.isNotEmpty(proList[0])){
+ for(Integer i = 0; i < proList.size(); i++){
+ pro_List.add(proList[i].subString(0,proList[i].indexOf( '|')));
}
}
- if (roduct2List.size() > 0) {
- for (Product2__c pro2 : roduct2List) {
+ if(roduct2List.size() > 0){
+ for(Product2__c pro2 :roduct2List){
productMap.put(pro2.Asset_Model_No__c, pro2.Asset_Model_No__c);
}
}
- for (Integer i = 0; i < pro_List.size(); i++) {
- if (Test.isRunningTest()) {
- productMap.put('L13F101820AA', 'L13F101820AA');
- productMap.put('Test01', 'Test01');
+ for(Integer i = 0; i < pro_List.size(); i++){
+ if(Test.isRunningTest()){
+ productMap.put('L13F101820AA','L13F101820AA');
+ productMap.put('Test01','Test01');
break;
}
- if (!productMap.containsKey(pro_List[i])) {
+ if(!productMap.containsKey(pro_List[i])){
// return '缁忛攢鍟嗘病鏈� ' + pro_List[i] + ' 鐨勪骇鍝佷笂闄愯瀹氭潈闄愶紝鎴栦骇鍝佷笉瀛樺湪锛�';
- return new ResponseBodyLWC('Error', 500, '缁忛攢鍟嗘病鏈� ' + pro_List[i] + ' 鐨勪骇鍝佷笂闄愯瀹氭潈闄愶紝鎴栦骇鍝佷笉瀛樺湪锛�', '');
+ return new ResponseBodyLWC('Error',500,'缁忛攢鍟嗘病鏈� ' + pro_List[i] + ' 鐨勪骇鍝佷笂闄愯瀹氭潈闄愶紝鎴栦骇鍝佷笉瀛樺湪锛�', '');
}
}
- String productLimitDa = '';
- for (String str : productLimit.split(',')) {
- if (str != null && str != '') {
+ String productLimitDa = '';
+ for(String str : productLimit.split(',')){
+
+ if(str != null && str != ''){
productLimitDa += ',' + str;
}
- }
+ }
Savepoint sp = Database.setSavepoint();
- try {
+ try{
Account accinfo = new Account();
accinfo.Id = accountId;
- if (EngFlag) {
- accinfo.Product_Limit_DateENG__c = String.isBlank(productLimitDa) ? productLimitDa : productLimitDa.subString(1);
- } else if (ETFlag) {
- accinfo.Product_Limit_Date__c = String.isBlank(productLimitDa) ? productLimitDa : productLimitDa.subString(1);
+ if(EngFlag){
+ accinfo.Product_Limit_DateENG__c = String.isBlank(productLimitDa) ? productLimitDa : productLimitDa.subString(1);
+ }else if(ETFlag){
+ accinfo.Product_Limit_Date__c = String.isBlank(productLimitDa) ? productLimitDa : productLimitDa.subString(1);
}
-
- update accinfo;
+
+ UPDATE accinfo;
res.status = 'Success';
res.code = 200;
System.debug('res = ' + res);
return res;
// return '';
- } catch (DmlException de) {
+ }catch(DmlException de){
Database.rollback(sp);
throw de;
- }
+ }
}
- public static String checkResoult(String productLimit) {
+ public static String checkResoult (String productLimit){
String[] proLimit = productLimit.split(',');
String nowName = null, nowRightAsstModelNo = null;
List<String> asstModelNo = new List<String>();
- Map<String, String> asstModelNoMap = new Map<String, String>();
+ Map<String,String> asstModelNoMap = new Map<String,String>();
List<String> asstModelNoCount = new List<String>();
- for (Integer i = 0; i < proLimit.size(); i++) {
+ for(Integer i = 0; i < proLimit.size(); i++){
nowName = proLimit[i];
- if (nowName.indexOf('|') >= 0) {
- nowRightAsstModelNo = nowName.subString(0, nowName.indexOf('|'));
+ if( nowName.indexOf( '|') >= 0) {
+ nowRightAsstModelNo = nowName.subString( 0, nowName.indexOf( '|'));
}
asstModelNo.add(nowRightAsstModelNo);
}
- for (Integer i = 0; i < asstModelNo.size(); i++) {
- if (asstModelNoMap.containsKey(asstModelNo[i])) {
+ for(Integer i = 0; i < asstModelNo.size(); i++){
+ if(asstModelNoMap.containsKey(asstModelNo[i])){
asstModelNoCount.add(asstModelNo[i]);
- } else {
+ }else{
asstModelNoMap.put(asstModelNo[i], asstModelNo[i]);
}
}
- if (asstModelNoCount.size() > 0) {
+ if(asstModelNoCount.size() > 0){
return '浜у搧锛�' + asstModelNoCount + '鐨勬暟鎹噸澶嶃��';
// return new ResponseBodyLWC('Error',500,'浜у搧锛�' + asstModelNoCount + '鐨勬暟鎹噸澶嶃��', '');
- } else {
+ }else{
return '';
}
}
-}
+}
\ No newline at end of file
diff --git a/force-app/main/default/classes/LexUpAccountProLimitControllerTest.cls b/force-app/main/default/classes/LexUpAccountProLimitControllerTest.cls
index 3d1edd8..5ba11bd 100644
--- a/force-app/main/default/classes/LexUpAccountProLimitControllerTest.cls
+++ b/force-app/main/default/classes/LexUpAccountProLimitControllerTest.cls
@@ -1,130 +1,69 @@
@isTest
-private class LexUpAccountProLimitControllerTest {
- @isTest
- static void proLimitTest() {
- List<RecordType> rectCo = [
- SELECT Id
- FROM RecordType
- WHERE IsActive = TRUE AND SobjectType = 'Account' AND Name = '璨╁2搴�'
- ];
+private class LexUpAccountProLimitControllerTest
+{
+ @isTest
+ static void proLimitTest()
+ {
+ List<RecordType> rectCo = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '璨╁2搴�'];
if (rectCo.size() == 0) {
return;
}
- Profile prof = [
- SELECT Id
- FROM Profile
- WHERE Name = '901_缁忛攢鍟嗙ぞ鍖烘櫘閫氭潈闄恄2閲嶉獙璇�(ET)'
- ];
- Product2 prod01 = new Product2(
- Name = 'Test01',
- ProductCode = 'Test01',
- Asset_Model_No__c = 'Test01',
- SFDA_Status__c = '鏈夊姽',
- Dealer_special_Object__c = true
- );
- Product2 prod02 = new Product2(
- Name = 'Test02',
- ProductCode = 'Test02',
- Asset_Model_No__c = 'Test02',
- SFDA_Status__c = '鏈夊姽',
- Dealer_special_Object__c = true
- );
- insert new List<Product2>{ prod01, prod02 };
- Product2__c pro1 = new Product2__c(Name = 'Pro001', OT_CODE_Text__c = 'Test001', Product2__c = prod01.Id);
- Product2__c pro2 = new Product2__c(Name = 'Pro002', OT_CODE_Text__c = 'Test002', Product2__c = prod02.Id);
- insert new List<Product2__c>{ pro1, pro2 };
-
- Account myAccount2 = new Account(
- Name = 'Testaccount002',
- Dealer_discount__c = 20,
- RecordTypeId = rectCo[0].Id,
- Product_Limit_Date__c = 'Test01|2|4'
- );
+ Profile prof = [select Id from Profile where Name ='901_缁忛攢鍟嗙ぞ鍖烘櫘閫氭潈闄恄2閲嶉獙璇�(ET)'];
+ Product2 prod01 = new Product2(Name='Test01',ProductCode='Test01',Asset_Model_No__c = 'Test01',SFDA_Status__c = '鏈夊姽',Dealer_special_Object__c = true);
+ Product2 prod02 = new Product2(Name='Test02',ProductCode='Test02',Asset_Model_No__c = 'Test02',SFDA_Status__c = '鏈夊姽',Dealer_special_Object__c = true);
+ insert new Product2[]{prod01,prod02};
+ Product2__c pro1 = new Product2__c(Name='Pro001',OT_CODE_Text__c='Test001',Product2__c = prod01.Id);
+ Product2__c pro2 = new Product2__c(Name='Pro002',OT_CODE_Text__c='Test002',Product2__c = prod02.Id);
+ insert new Product2__c[] {pro1, pro2};
+
+ Account myAccount2 = new Account(Name='Testaccount002',Dealer_discount__c =20,RecordTypeId = rectCo[0].Id,Product_Limit_Date__c = 'Test01|2|4');
insert myAccount2;
String productLimit = 'Test01|2|4,Test02|3|5';
- String resultText = UpAccountProLimit.upAccount(myAccount2.Id, productLimit, 'ET');
- List<Account> accountre = [
- SELECT Id, Product_Limit_Date__c
- FROM Account
- WHERE Id = :myAccount2.Id
- ];
- LexUpAccountProLimit.upAccount(myAccount2.Id, productLimit, 'ENG');
- LexUpAccountProLimit.upAccount(myAccount2.Id, productLimit, '');
- LexUpAccountProLimit.upAccount('1000', productLimit, 'ENG');
+ String resultText = UpAccountProLimit.upAccount(myAccount2.Id,productLimit,'ET');
+ List<Account> accountre = [select Id,Product_Limit_Date__c from Account where Id = :myAccount2.Id ];
+ LexUpAccountProLimit.upAccount(myAccount2.Id,productLimit,'ENG');
+ LexUpAccountProLimit.upAccount(myAccount2.Id,productLimit,'');
+ LexUpAccountProLimit.upAccount('1000',productLimit,'ENG');
// System.assertEquals('Test01|2|4,Test02|3|5', accountre[0].Product_Limit_Date__c);
- }
+ }
@isTest
- static void proLimitTest1() {
- List<RecordType> rectCo = [
- SELECT Id
- FROM RecordType
- WHERE IsActive = TRUE AND SobjectType = 'Account' AND Name = '璨╁2搴�'
- ];
+ static void proLimitTest1()
+ {
+ List<RecordType> rectCo = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '璨╁2搴�'];
if (rectCo.size() == 0) {
return;
}
- Profile prof = [
- SELECT Id
- FROM Profile
- WHERE Name = '901_缁忛攢鍟嗙ぞ鍖烘櫘閫氭潈闄恄2閲嶉獙璇�(ET)'
- ];
- Product2 prod01 = new Product2(
- Name = 'Test01',
- ProductCode = 'Test01',
- Asset_Model_No__c = 'Test01',
- SFDA_Status__c = '涓嶈',
- Dealer_special_Object__c = true
- );
- Product2 prod02 = new Product2(
- Name = 'Test02',
- ProductCode = 'Test02',
- Asset_Model_No__c = 'Test02',
- SFDA_Status__c = '婧栧倷涓�',
- Dealer_special_Object__c = true
- );
- insert new List<Product2>{ prod01, prod02 };
- Product2__c pro1 = new Product2__c(Name = 'Pro001', OT_CODE_Text__c = 'Test001', Product2__c = prod01.Id);
- Product2__c pro2 = new Product2__c(Name = 'Pro002', OT_CODE_Text__c = 'Test002', Product2__c = prod02.Id);
- insert new List<Product2__c>{ pro1, pro2 };
- System.debug('pro1===>' + pro1);
- System.debug('pro2===>' + pro2);
+ Profile prof = [select Id from Profile where Name ='901_缁忛攢鍟嗙ぞ鍖烘櫘閫氭潈闄恄2閲嶉獙璇�(ET)'];
+ Product2 prod01 = new Product2(Name='Test01',ProductCode='Test01',Asset_Model_No__c = 'Test01',SFDA_Status__c = '涓嶈',Dealer_special_Object__c = true);
+ Product2 prod02 = new Product2(Name='Test02',ProductCode='Test02',Asset_Model_No__c = 'Test02',SFDA_Status__c = '婧栧倷涓�',Dealer_special_Object__c = true);
+ insert new Product2[]{prod01,prod02};
+ Product2__c pro1 = new Product2__c(Name='Pro001',OT_CODE_Text__c='Test001',Product2__c = prod01.Id);
+ Product2__c pro2 = new Product2__c(Name='Pro002',OT_CODE_Text__c='Test002',Product2__c = prod02.Id);
+ insert new Product2__c[] {pro1, pro2};
+ System.debug('pro1===>'+pro1);
+ System.debug('pro2===>'+pro2);
- List<Product2__c> roduct2List1 = [
- SELECT Id, Asset_Model_No__c, Estimation_Entry_Possibility__c, Product_Type__c
- FROM Product2__c
- WHERE id = :pro2.Id
+ List<Product2__c> roduct2List1 = [SELECT Id,Asset_Model_No__c,Estimation_Entry_Possibility__c,Product_Type__c
+ FROM Product2__c WHERE id = :pro2.Id
+ ];
+ List<Product2__c> roduct2List2 = [SELECT Id,Asset_Model_No__c,Estimation_Entry_Possibility__c,Product_Type__c
+ FROM Product2__c WHERE id = :pro1.Id
];
- List<Product2__c> roduct2List2 = [
- SELECT Id, Asset_Model_No__c, Estimation_Entry_Possibility__c, Product_Type__c
- FROM Product2__c
- WHERE id = :pro1.Id
- ];
- System.debug('roduct2List2===>' + roduct2List2);
+ System.debug('roduct2List2===>'+roduct2List2);
- List<Product2__c> roduct2List = [
- SELECT Asset_Model_No__c, Estimation_Entry_Possibility__c
- FROM Product2__c
- WHERE Product_Type__c LIKE '%ENG%' AND Estimation_Entry_Possibility__c = '鈼�'
- ];
- System.debug('roduct2List' + roduct2List);
-
- Account myAccount2 = new Account(
- Name = 'Testaccount002',
- Dealer_discount__c = 20,
- RecordTypeId = rectCo[0].Id,
- Product_Limit_Date__c = 'Test01|2|4'
- );
- insert myAccount2;
- String productLimit = 'Test01|2|4,Test02|3|5';
- String productLimit1 = 'Test01|2|4';
- String resultText = UpAccountProLimit.upAccount(myAccount2.Id, productLimit, 'ENG');
- List<Account> accountre = [
- SELECT Id, Product_Limit_Date__c
- FROM Account
- WHERE Id = :myAccount2.Id
- ];
- // LexUpAccountProLimit.upAccount(myAccount2.Id,productLimit,'');
- LexUpAccountProLimit.upAccount(myAccount2.Id, productLimit1, 'ET');
- // System.assertEquals('Test01|2|4,Test02|3|5', accountre[0].Product_Limit_Date__c);
- }
-}
+ List<Product2__c> roduct2List = [SELECT Asset_Model_No__c,Estimation_Entry_Possibility__c
+ FROM Product2__c
+ WHERE Product_Type__c like '%ENG%' and Estimation_Entry_Possibility__c = '鈼�'];
+ System.debug('roduct2List'+roduct2List);
+
+ Account myAccount2 = new Account(Name='Testaccount002',Dealer_discount__c =20,RecordTypeId = rectCo[0].Id,Product_Limit_Date__c = 'Test01|2|4');
+ insert myAccount2;
+ String productLimit = 'Test01|2|4,Test02|3|5';
+ String productLimit1 = 'Test01|2|4';
+ String resultText = UpAccountProLimit.upAccount(myAccount2.Id,productLimit,'ENG');
+ List<Account> accountre = [select Id,Product_Limit_Date__c from Account where Id = :myAccount2.Id ];
+ // LexUpAccountProLimit.upAccount(myAccount2.Id,productLimit,'');
+ LexUpAccountProLimit.upAccount(myAccount2.Id,productLimit1,'ET');
+ // System.assertEquals('Test01|2|4,Test02|3|5', accountre[0].Product_Limit_Date__c);
+ }
+}
\ No newline at end of file
diff --git a/force-app/main/default/classes/LexUpAccountProLimitControllerTest.cls-meta.xml b/force-app/main/default/classes/LexUpAccountProLimitControllerTest.cls-meta.xml
index a9fd6e9..754ecb1 100644
--- a/force-app/main/default/classes/LexUpAccountProLimitControllerTest.cls-meta.xml
+++ b/force-app/main/default/classes/LexUpAccountProLimitControllerTest.cls-meta.xml
@@ -1,4 +1,4 @@
-<?xml version="1.0" encoding="UTF-8" ?>
+<?xml version="1.0" encoding="UTF-8"?>
<ApexClass xmlns="http://soap.sforce.com/2006/04/metadata">
<apiVersion>57.0</apiVersion>
<status>Active</status>
diff --git a/force-app/main/default/classes/LexUtilityTest.cls b/force-app/main/default/classes/LexUtilityTest.cls
index 445376c..940b7aa 100644
--- a/force-app/main/default/classes/LexUtilityTest.cls
+++ b/force-app/main/default/classes/LexUtilityTest.cls
@@ -1,17 +1,17 @@
@IsTest
private class LexUtilityTest {
@IsTest
- static void testMethod1() {
+ static void testMethod1(){
User currentUser = [SELECT Id FROM User WHERE Id = :UserInfo.getUserId()];
- NoteStay__c n = new NoteStay__c(Name = 'NoteStay', IsStay__c = true);
+ NoteStay__c n = new NoteStay__c(Name = 'NoteStay',IsStay__c = true);
insert n;
LicenceReminderDate__c l = new LicenceReminderDate__c(Name = '180Days', ReminderDays__c = 180);
insert l;
Test.startTest();
- System.runAs(currentUser) {
+ System.runAs(currentUser){
LexUtility.getIsNoteStay();
LexUtility.getLicenceReminderDays();
}
Test.stopTest();
}
-}
+}
\ No newline at end of file
diff --git a/force-app/main/default/classes/LexUtilityTest.cls-meta.xml b/force-app/main/default/classes/LexUtilityTest.cls-meta.xml
index a9fd6e9..754ecb1 100644
--- a/force-app/main/default/classes/LexUtilityTest.cls-meta.xml
+++ b/force-app/main/default/classes/LexUtilityTest.cls-meta.xml
@@ -1,4 +1,4 @@
-<?xml version="1.0" encoding="UTF-8" ?>
+<?xml version="1.0" encoding="UTF-8"?>
<ApexClass xmlns="http://soap.sforce.com/2006/04/metadata">
<apiVersion>57.0</apiVersion>
<status>Active</status>
diff --git a/force-app/main/default/classes/LookupSearchResultTest.cls b/force-app/main/default/classes/LookupSearchResultTest.cls
index 7dad0a5..829c3dd 100644
--- a/force-app/main/default/classes/LookupSearchResultTest.cls
+++ b/force-app/main/default/classes/LookupSearchResultTest.cls
@@ -1,30 +1,21 @@
@isTest
private class LookupSearchResultTest {
- @testSetup
- static void testInfo() {
- List<RecordType> rectCo = [
- SELECT Id
- FROM RecordType
- WHERE IsActive = TRUE AND SobjectType = 'Account' AND Name = '璨╁2搴�'
- ];
+ @testSetup
+ static void testInfo(){
+ List<RecordType> rectCo = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '璨╁2搴�'];
if (rectCo.size() == 0) {
return;
}
- Account myAccount2 = new Account(name = 'Account001', Dealer_discount__c = 20, RecordTypeId = rectCo[0].Id, AgentCode_Ext__c = '2');
+ Account myAccount2 = new Account(name='Account001',Dealer_discount__c =20,RecordTypeId = rectCo[0].Id,AgentCode_Ext__c = '2');
insert myAccount2;
- }
-
+ }
+
@isTest
- static void testLookupSearchResult() {
+ static void testLookupSearchResult(){
String id = '';
String title = '';
- List<Account> account = [
- SELECT Id, Name
- FROM Account
- WHERE Name = 'Account001'
- LIMIT 1
- ];
- for (Account acc : account) {
+ List<Account> account = [SELECT Id,Name FROM Account WHERE Name = 'Account001' limit 1];
+ for(Account acc : account){
id = acc.Id;
}
object compareTo = account;
@@ -32,15 +23,15 @@
LookupSearchResult resultB = new LookupSearchResult('', '', '', title, '');
LookupSearchResult resultC = new LookupSearchResult(id, 'Account', 'standard:account', title, 'Account');
System.Test.startTest();
- resultA.getId();
- resultA.getSObjectType();
- resultA.getIcon();
- resultA.getTitle();
- resultA.getSubtitle();
+ resultA.getId();
+ resultA.getSObjectType();
+ resultA.getIcon();
+ resultA.getTitle();
+ resultA.getSubtitle();
resultB.compareTo(resultB);
System.assertEquals(1, account.size(), 'expecting to find 1 Account');
List<LookupSearchResult> con = new List<LookupSearchResult>();
con.sort();
System.Test.stopTest();
}
-}
+}
\ No newline at end of file
diff --git a/force-app/main/default/classes/LookupSearchResultTest.cls-meta.xml b/force-app/main/default/classes/LookupSearchResultTest.cls-meta.xml
index a9fd6e9..754ecb1 100644
--- a/force-app/main/default/classes/LookupSearchResultTest.cls-meta.xml
+++ b/force-app/main/default/classes/LookupSearchResultTest.cls-meta.xml
@@ -1,4 +1,4 @@
-<?xml version="1.0" encoding="UTF-8" ?>
+<?xml version="1.0" encoding="UTF-8"?>
<ApexClass xmlns="http://soap.sforce.com/2006/04/metadata">
<apiVersion>57.0</apiVersion>
<status>Active</status>
diff --git a/force-app/main/default/classes/ResponseBodyLWCTest.cls b/force-app/main/default/classes/ResponseBodyLWCTest.cls
index e4ba53d..4fcf69a 100644
--- a/force-app/main/default/classes/ResponseBodyLWCTest.cls
+++ b/force-app/main/default/classes/ResponseBodyLWCTest.cls
@@ -2,7 +2,7 @@
public class ResponseBodyLWCTest {
static testMethod void test1() {
ResponseBodyLWC l1 = new ResponseBodyLWC();
- ResponseBodyLWC l2 = new ResponseBodyLWC('status', 200, 'testmsg', new Map<String, String>());
- ResponseBodyLWC l3 = new ResponseBodyLWC('status', 200, 'testmsg', new List<Object>());
+ ResponseBodyLWC l2 = new ResponseBodyLWC('status',200,'testmsg',new Map<String,String>());
+ ResponseBodyLWC l3 = new ResponseBodyLWC('status',200,'testmsg',new List<Object>());
}
-}
+}
\ No newline at end of file
diff --git a/force-app/main/default/classes/ResponseBodyLWCTest.cls-meta.xml b/force-app/main/default/classes/ResponseBodyLWCTest.cls-meta.xml
index a9fd6e9..754ecb1 100644
--- a/force-app/main/default/classes/ResponseBodyLWCTest.cls-meta.xml
+++ b/force-app/main/default/classes/ResponseBodyLWCTest.cls-meta.xml
@@ -1,4 +1,4 @@
-<?xml version="1.0" encoding="UTF-8" ?>
+<?xml version="1.0" encoding="UTF-8"?>
<ApexClass xmlns="http://soap.sforce.com/2006/04/metadata">
<apiVersion>57.0</apiVersion>
<status>Active</status>
diff --git a/force-app/main/default/classes/lexSearchAgencyHospitalControllerTest.cls b/force-app/main/default/classes/lexSearchAgencyHospitalControllerTest.cls
index ef0db5f..3372052 100644
--- a/force-app/main/default/classes/lexSearchAgencyHospitalControllerTest.cls
+++ b/force-app/main/default/classes/lexSearchAgencyHospitalControllerTest.cls
@@ -1,93 +1,56 @@
@isTest
private class lexSearchAgencyHospitalControllerTest {
@isTest
- static void testInit() {
+ static void testInit(){
User myUser_test;
Account myAccount2;
Product2__c pro2;
- User thisUser = [SELECT Id FROM User WHERE Id = :UserInfo.getUserId()];
- System.runAs(thisUser) {
- List<RecordType> rectCo = [
- SELECT Id
- FROM RecordType
- WHERE IsActive = TRUE AND SobjectType = 'Account' AND Name = '璨╁2搴�'
- ];
+ User thisUser = [ SELECT Id FROM User WHERE Id = :UserInfo.getUserId()];
+ System.runAs(thisUser){
+ List<RecordType> rectCo = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '璨╁2搴�'];
if (rectCo.size() == 0) {
return;
}
- Profile prof = [
- SELECT Id
- FROM Profile
- WHERE Name = '901_缁忛攢鍟嗙ぞ鍖烘櫘閫氭潈闄恄2閲嶉獙璇�(ET Email)'
- ];
- Product2 prod02 = new Product2(
- Name = 'Test02181',
- ProductCode = 'Test0218',
- Asset_Model_No__c = 'Test0218',
- SFDA_Status__c = '鏈夊姽',
- Dealer_special_Object__c = true,
- SFDA_Approbation_No__c = 'Test002',
- Packing_list_manual__c = 12,
- SFDA_Expiration_Date__c = Date.today(),
- Category5__c = 'tset8',
- Manual_Entry__c = false
- );
- pro2 = new Product2__c(Name = 'Pro002181', OT_CODE_Text__c = 'Test002181', Product2__c = prod02.Id);
+ Profile prof = [select Id from Profile where Name ='901_缁忛攢鍟嗙ぞ鍖烘櫘閫氭潈闄恄2閲嶉獙璇�(ET Email)'];
+ Product2 prod02 = new Product2(Name='Test02181',ProductCode='Test0218',Asset_Model_No__c = 'Test0218',SFDA_Status__c = '鏈夊姽',Dealer_special_Object__c = true,SFDA_Approbation_No__c = 'Test002',Packing_list_manual__c = 12,SFDA_Expiration_Date__c= Date.today(),Category5__c = 'tset8',Manual_Entry__c = false);
+ pro2 = new Product2__c(Name='Pro002181',OT_CODE_Text__c='Test002181',Product2__c = prod02.Id);
insert pro2;
- myAccount2 = new Account(name = 'Testaccount003', Dealer_discount__c = 20, RecordTypeId = rectCo[0].Id, AgentCode_Ext__c = '2');
+ myAccount2 = new Account(name='Testaccount003',Dealer_discount__c =20,RecordTypeId = rectCo[0].Id,AgentCode_Ext__c = '2');
insert myAccount2;
-
- Contact core = new Contact(email = 'wan@salesforce.com', firstname = 'wan', lastname = 'Plumbers', accountid = myAccount2.id);
+
+ Contact core = new Contact(email='wan@salesforce.com', firstname='wan',lastname='Plumbers',accountid=myAccount2.id);
insert core;
- myUser_test = new User(
- ContactId = core.id,
- Alias = 'newUser',
- Email = 'newuser@testorg.com',
- EmailEncodingKey = 'UTF-8',
- LastName = 'TestUser',
- LanguageLocaleKey = 'zh_CN',
- LocaleSidKey = 'zh_CN',
- ProfileId = prof.Id,
- TimeZoneSidKey = 'Asia/Shanghai',
- UserName = 'testUser@testorg.com',
- UserPro_Type__c = 'ENG',
- Work_Location__c = '鍖椾含'
- );
+ myUser_test = New User(ContactId = core.id, Alias = 'newUser', Email='newuser@testorg.com', EmailEncodingKey='UTF-8', LastName='TestUser', LanguageLocaleKey='zh_CN', LocaleSidKey='zh_CN', ProfileId = prof.Id, TimeZoneSidKey='Asia/Shanghai', UserName='testUser@testorg.com', UserPro_Type__c='ENG', Work_Location__c='鍖椾含');
insert myUser_test;
myUser_test.UserPro_Type__c = '';
update myUser_test;
}
- System.runAs(MyUser_Test) {
+ System.runAs(MyUser_Test){
System.Test.startTest();
String accountId = myUser_test.accountid;
String agencyProType = myUser_test.UserPro_Type__c;
String searchName = '';
- List<Agency_Hospital_Link__c> ahlInfo = [
- SELECT Hospital__c, Hospital__r.Name
- FROM Agency_Hospital_Link__c
- WHERE Agency__c = :accountId AND Hosptial_Type__c != NULL
- LIMIT 1
- ];
+ List<Agency_Hospital_Link__c> ahlInfo = [SELECT Hospital__c,Hospital__r.Name
+ FROM Agency_Hospital_Link__c
+ WHERE Agency__c =:accountId
+ AND Hosptial_Type__c <> NULL
+ LIMIT 1];
Set<Id> whoIds = new Set<Id>();
- for (Agency_Hospital_Link__c ahl : ahlInfo) {
+ for(Agency_Hospital_Link__c ahl : ahlInfo){
whoIds.add(ahl.Hospital__c);
- if (String.isBlank(searchName)) {
+ if(String.isBlank(searchName)){
searchName = ahl.Hospital__r.Name;
}
}
- Map<ID, Account> accInfo = new Map<ID, Account>(
- [
- SELECT Id, Name, State_Master__c, State_Master__r.Name
- FROM Account
- WHERE Id IN :whoIds
- ]
- );
+ Map<ID, Account> accInfo = new Map<ID, Account>([SELECT Id,Name,State_Master__c,State_Master__r.Name
+ FROM Account
+ WHERE Id IN:whoIds]);
Map<String, object> data = new Map<String, object>();
- data.put('accInfo', accInfo);
+ data.put('accInfo',accInfo);
String ctype = 'ET';
lexSearchAgencyHospitalController.init(ctype);
- lexSearchAgencyHospitalController.serContact(searchName, ctype);
+ lexSearchAgencyHospitalController.serContact(searchName,ctype);
System.Test.stopTest();
}
}
-}
+}
\ No newline at end of file
diff --git a/force-app/main/default/classes/lexSearchAgencyHospitalControllerTest.cls-meta.xml b/force-app/main/default/classes/lexSearchAgencyHospitalControllerTest.cls-meta.xml
index a9fd6e9..754ecb1 100644
--- a/force-app/main/default/classes/lexSearchAgencyHospitalControllerTest.cls-meta.xml
+++ b/force-app/main/default/classes/lexSearchAgencyHospitalControllerTest.cls-meta.xml
@@ -1,4 +1,4 @@
-<?xml version="1.0" encoding="UTF-8" ?>
+<?xml version="1.0" encoding="UTF-8"?>
<ApexClass xmlns="http://soap.sforce.com/2006/04/metadata">
<apiVersion>57.0</apiVersion>
<status>Active</status>
diff --git a/force-app/main/default/contentassets/OlympusCommunityLoginBG.asset-meta.xml b/force-app/main/default/contentassets/OlympusCommunityLoginBG.asset-meta.xml
index e46f582..6d762cb 100644
--- a/force-app/main/default/contentassets/OlympusCommunityLoginBG.asset-meta.xml
+++ b/force-app/main/default/contentassets/OlympusCommunityLoginBG.asset-meta.xml
@@ -1,4 +1,4 @@
-<?xml version="1.0" encoding="UTF-8" ?>
+<?xml version="1.0" encoding="UTF-8"?>
<ContentAsset xmlns="http://soap.sforce.com/2006/04/metadata">
<isVisibleByExternalUsers>true</isVisibleByExternalUsers>
<language>zh_CN</language>
diff --git a/force-app/main/default/contentassets/OlympusCommunityLogo.asset-meta.xml b/force-app/main/default/contentassets/OlympusCommunityLogo.asset-meta.xml
index 2ec551c..0874b6a 100644
--- a/force-app/main/default/contentassets/OlympusCommunityLogo.asset-meta.xml
+++ b/force-app/main/default/contentassets/OlympusCommunityLogo.asset-meta.xml
@@ -1,4 +1,4 @@
-<?xml version="1.0" encoding="UTF-8" ?>
+<?xml version="1.0" encoding="UTF-8"?>
<ContentAsset xmlns="http://soap.sforce.com/2006/04/metadata">
<isVisibleByExternalUsers>true</isVisibleByExternalUsers>
<language>zh_CN</language>
diff --git a/force-app/main/default/lwc/customAccountUrlComp/customAccountUrlComp.html b/force-app/main/default/lwc/customAccountUrlComp/customAccountUrlComp.html
index c38ec0a..590c111 100644
--- a/force-app/main/default/lwc/customAccountUrlComp/customAccountUrlComp.html
+++ b/force-app/main/default/lwc/customAccountUrlComp/customAccountUrlComp.html
@@ -1,10 +1,8 @@
<template>
<template if:false={isDisable}>
- <lightning-formatted-url
- value={accountUrl}
- label={accountName}
- target="_blank"
- ></lightning-formatted-url>
+ <lightning-formatted-url value={accountUrl} label={accountName} target="_blank"></lightning-formatted-url>
</template>
- <template if:true={isDisable}> {accountName} </template>
-</template>
+ <template if:true={isDisable}>
+ {accountName}
+ </template>
+</template>
\ No newline at end of file
diff --git a/force-app/main/default/lwc/customAccountUrlComp/customAccountUrlComp.js b/force-app/main/default/lwc/customAccountUrlComp/customAccountUrlComp.js
index f7c9bad..7b8bb35 100644
--- a/force-app/main/default/lwc/customAccountUrlComp/customAccountUrlComp.js
+++ b/force-app/main/default/lwc/customAccountUrlComp/customAccountUrlComp.js
@@ -1,15 +1,15 @@
-import { LightningElement, api } from 'lwc';
+import { LightningElement,api } from 'lwc';
export default class CustomAccountUrlComp extends LightningElement {
@api accountName;
@api accountUrl;
@api isDisable;
- connectedCallback() {
- console.log('zhj');
- console.log('杩涘叆CustomAccountUrlComp');
+ connectedCallback(){
+ console.log('zhj')
+ console.log('杩涘叆CustomAccountUrlComp')
console.log('accountName = ' + this.accountName);
console.log('accountUrl = ' + this.accountUrl);
console.log('isDisable = ' + this.isDisable);
}
-}
+}
\ No newline at end of file
diff --git a/force-app/main/default/lwc/customAccountUrlComp/customAccountUrlComp.js-meta.xml b/force-app/main/default/lwc/customAccountUrlComp/customAccountUrlComp.js-meta.xml
index a1a42a8..3fe0e73 100644
--- a/force-app/main/default/lwc/customAccountUrlComp/customAccountUrlComp.js-meta.xml
+++ b/force-app/main/default/lwc/customAccountUrlComp/customAccountUrlComp.js-meta.xml
@@ -1,5 +1,5 @@
-<?xml version="1.0" encoding="UTF-8" ?>
+<?xml version="1.0" encoding="UTF-8"?>
<LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata">
<apiVersion>57.0</apiVersion>
<isExposed>false</isExposed>
-</LightningComponentBundle>
+</LightningComponentBundle>
\ No newline at end of file
diff --git a/force-app/main/default/lwc/customDeleteReasonComp/customDeleteReasonComp.html b/force-app/main/default/lwc/customDeleteReasonComp/customDeleteReasonComp.html
index ab51f15..b0e319f 100644
--- a/force-app/main/default/lwc/customDeleteReasonComp/customDeleteReasonComp.html
+++ b/force-app/main/default/lwc/customDeleteReasonComp/customDeleteReasonComp.html
@@ -1,7 +1,3 @@
<template>
- <lightning-textarea
- name="input1"
- label="Enter some text"
- variant="label-hidden"
- ></lightning-textarea>
-</template>
+ <lightning-textarea name="input1" label="Enter some text" variant="label-hidden"></lightning-textarea>
+</template>
\ No newline at end of file
diff --git a/force-app/main/default/lwc/customDeleteReasonComp/customDeleteReasonComp.js b/force-app/main/default/lwc/customDeleteReasonComp/customDeleteReasonComp.js
index aecadff..f5a923c 100644
--- a/force-app/main/default/lwc/customDeleteReasonComp/customDeleteReasonComp.js
+++ b/force-app/main/default/lwc/customDeleteReasonComp/customDeleteReasonComp.js
@@ -1,3 +1,3 @@
import { LightningElement } from 'lwc';
-export default class CustomDeleteReasonComp extends LightningElement {}
+export default class CustomDeleteReasonComp extends LightningElement {}
\ No newline at end of file
diff --git a/force-app/main/default/lwc/customDeleteReasonComp/customDeleteReasonComp.js-meta.xml b/force-app/main/default/lwc/customDeleteReasonComp/customDeleteReasonComp.js-meta.xml
index a1a42a8..3fe0e73 100644
--- a/force-app/main/default/lwc/customDeleteReasonComp/customDeleteReasonComp.js-meta.xml
+++ b/force-app/main/default/lwc/customDeleteReasonComp/customDeleteReasonComp.js-meta.xml
@@ -1,5 +1,5 @@
-<?xml version="1.0" encoding="UTF-8" ?>
+<?xml version="1.0" encoding="UTF-8"?>
<LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata">
<apiVersion>57.0</apiVersion>
<isExposed>false</isExposed>
-</LightningComponentBundle>
+</LightningComponentBundle>
\ No newline at end of file
diff --git a/force-app/main/default/lwc/customMydrComp/customMydrComp.html b/force-app/main/default/lwc/customMydrComp/customMydrComp.html
index e57cc8b..f01ac90 100644
--- a/force-app/main/default/lwc/customMydrComp/customMydrComp.html
+++ b/force-app/main/default/lwc/customMydrComp/customMydrComp.html
@@ -1,10 +1,4 @@
<template>
- <lightning-input
- type="checkbox"
- label="浠匨yDr"
- checked={isCheckedMyDr}
- onchange={dataChange}
- variant="label-hidden"
- data-field="MyDr"
- ></lightning-input>
-</template>
+ <lightning-input type="checkbox" label="浠匨yDr" checked={isCheckedMyDr} onchange={dataChange} variant="label-hidden"
+ data-field="MyDr"></lightning-input>
+</template>
\ No newline at end of file
diff --git a/force-app/main/default/lwc/customMydrComp/customMydrComp.js b/force-app/main/default/lwc/customMydrComp/customMydrComp.js
index 9e58427..cd1f38e 100644
--- a/force-app/main/default/lwc/customMydrComp/customMydrComp.js
+++ b/force-app/main/default/lwc/customMydrComp/customMydrComp.js
@@ -1,16 +1,16 @@
-import { LightningElement, track, api } from 'lwc';
+import { LightningElement,track,api } from 'lwc';
export default class CustomMydrComp extends LightningElement {
@api recordId;
@api isCheckedMyDr;
- connectedCallback() {
+ connectedCallback(){
console.log('this.recordId = ' + this.recordId);
console.log('this.isCheckedMyDr = ' + this.isCheckedMyDr);
}
- dataChange(event) {
+ dataChange(event){
this.isCheckedMyDr = event.target.checked;
console.log('this.isCheckedMyDr = ' + this.isCheckedMyDr);
}
-}
+}
\ No newline at end of file
diff --git a/force-app/main/default/lwc/customMydrComp/customMydrComp.js-meta.xml b/force-app/main/default/lwc/customMydrComp/customMydrComp.js-meta.xml
index a1a42a8..3fe0e73 100644
--- a/force-app/main/default/lwc/customMydrComp/customMydrComp.js-meta.xml
+++ b/force-app/main/default/lwc/customMydrComp/customMydrComp.js-meta.xml
@@ -1,5 +1,5 @@
-<?xml version="1.0" encoding="UTF-8" ?>
+<?xml version="1.0" encoding="UTF-8"?>
<LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata">
<apiVersion>57.0</apiVersion>
<isExposed>false</isExposed>
-</LightningComponentBundle>
+</LightningComponentBundle>
\ No newline at end of file
diff --git a/force-app/main/default/lwc/customOutputGood/customOutputGood.html b/force-app/main/default/lwc/customOutputGood/customOutputGood.html
index 0277ba5..d2c8ea1 100644
--- a/force-app/main/default/lwc/customOutputGood/customOutputGood.html
+++ b/force-app/main/default/lwc/customOutputGood/customOutputGood.html
@@ -6,7 +6,7 @@
<p style="height: 10px;"></p>
</template>
<template if:false={showLink}>
- <div style="margin-left: 10px;margin-top: 10px;margin-bottom: 10px;font-size:16px;color:#696969;">
+ <div style="margin-left: 10px;margin-top: 10px;margin-bottom: 10px;font-size:14px;color:#696969;">
<lightning-formatted-text value={outputValue}></lightning-formatted-text>
</div>
</template>
diff --git a/force-app/main/default/lwc/customShipmentNumberComp/customShipmentNumberComp.html b/force-app/main/default/lwc/customShipmentNumberComp/customShipmentNumberComp.html
index ebf2ab4..4638662 100644
--- a/force-app/main/default/lwc/customShipmentNumberComp/customShipmentNumberComp.html
+++ b/force-app/main/default/lwc/customShipmentNumberComp/customShipmentNumberComp.html
@@ -1,17 +1,6 @@
<template>
<c-common-toast></c-common-toast>
- <lightning-input
- style="border: 1px solid red; border-radius: 5px"
- step="any"
- type="number"
- name="shipmentNumber"
- label="鍑鸿揣鏁伴噺"
- variant="label-hidden"
- onchange={dataChange}
- data-field="shipmentNumber"
- value={shipmentNumber}
- onblur={shipmentNumberBlur}
- min="0"
- class="inputFont"
- ></lightning-input>
-</template>
+ <lightning-input style="border:1px solid red;border-radius:5px;" step="any" type="number" name="shipmentNumber" label="鍑鸿揣鏁伴噺"
+ variant="label-hidden" onchange={dataChange} data-field="shipmentNumber" value={shipmentNumber}
+ onblur={shipmentNumberBlur} min="0" class="inputFont"></lightning-input>
+</template>
\ No newline at end of file
diff --git a/force-app/main/default/lwc/customShipmentNumberComp/customShipmentNumberComp.js b/force-app/main/default/lwc/customShipmentNumberComp/customShipmentNumberComp.js
index b5cad1a..d16b48f 100644
--- a/force-app/main/default/lwc/customShipmentNumberComp/customShipmentNumberComp.js
+++ b/force-app/main/default/lwc/customShipmentNumberComp/customShipmentNumberComp.js
@@ -11,20 +11,16 @@
}
shipmentNumberBlur(event) {
- debugger;
- console.log('shipmentNumberBlur');
+ debugger
+ console.log('shipmentNumberBlur')
this.shipmentNumber = event.target.value;
if (this.isConinvoice) {
if (this.hasDecimals(this.shipmentNumber)) {
this.showMyToast('閿欒', '璇疯緭鍏ユ暣鏁�', 'Error');
this.shipmentNumber = 0;
- } else {
- if (this.esdInvoiceProNotCount < this.shipmentNumber) {
- this.showMyToast(
- '閿欒',
- '鍙戠エ鏁伴噺涓嶈兘瓒呰繃杩樻病鍙戠エ鏁伴噺锛�',
- 'Error'
- );
+ }else{
+ if(this.esdInvoiceProNotCount < this.shipmentNumber){
+ this.showMyToast('閿欒', '鍙戠エ鏁伴噺涓嶈兘瓒呰繃杩樻病鍙戠エ鏁伴噺锛�', 'Error');
this.shipmentNumber = 0;
}
}
@@ -32,23 +28,18 @@
//鍚戜笅鍙栨暣
if (this.hasDecimals(this.shipmentNumber)) {
this.showMyToast('閿欒', '璇疯緭鍏ユ暣鏁�', 'Error');
- this.shipmentNumber = Math.floor(this.shipmentNumber);
+ this.shipmentNumber = Math.floor(this.shipmentNumber)
}
}
event.target.value = this.shipmentNumber;
- this.dispatchEvent(
- new CustomEvent('shipmentnumber', {
- composed: true,
- bubbles: true,
- cancelable: true,
- detail: {
- data: {
- shipmentnumber: this.shipmentNumber,
- recordId: this.recordId
- }
- }
- })
- );
+ this.dispatchEvent(new CustomEvent('shipmentnumber', {
+ composed: true,
+ bubbles: true,
+ cancelable: true,
+ detail: {
+ data: { shipmentnumber: this.shipmentNumber, recordId: this.recordId }
+ }
+ }));
}
hasDecimals(num) {
@@ -70,17 +61,10 @@
iconName = 'utility:error';
}
if (message != '') {
- content =
- '<h2><strong>' +
- title +
- '<strong/></h2><h5>' +
- message +
- '</h5>';
+ content = '<h2><strong>' + title + '<strong/></h2><h5>' + message + '</h5>';
} else {
content = '<h2><strong>' + title + '<strong/></h2>';
}
- this.template
- .querySelector('c-common-toast')
- .showToast(variant, content, iconName, 10000);
+ this.template.querySelector('c-common-toast').showToast(variant, content, iconName, 10000);
}
-}
+}
\ No newline at end of file
diff --git a/force-app/main/default/lwc/customShippingUnitPriceComp/customShippingUnitPriceComp.html b/force-app/main/default/lwc/customShippingUnitPriceComp/customShippingUnitPriceComp.html
index c582400..b573650 100644
--- a/force-app/main/default/lwc/customShippingUnitPriceComp/customShippingUnitPriceComp.html
+++ b/force-app/main/default/lwc/customShippingUnitPriceComp/customShippingUnitPriceComp.html
@@ -1,16 +1,5 @@
<template>
- <lightning-input
- style="border: 1px solid red; border-radius: 5px"
- step="any"
- type="number"
- name="shipmentUnitPrice"
- label="deliveryOrderNo"
- variant="label-hidden"
- data-field="shipmentUnitPrice"
- value={shippingUnitPrice}
- onblur={shipmentUnitPriceBlur}
- min="0"
- class="inputFont"
- onchange={limitDecimals}
- ></lightning-input>
-</template>
+ <lightning-input style="border:1px solid red;border-radius:5px" step="any" type="number" name="shipmentUnitPrice"
+ label="deliveryOrderNo" variant="label-hidden" data-field="shipmentUnitPrice" value={shippingUnitPrice}
+ onblur={shipmentUnitPriceBlur} min="0" class="inputFont" onchange={limitDecimals}></lightning-input>
+</template>
\ No newline at end of file
diff --git a/force-app/main/default/lwc/customShippingUnitPriceComp/customShippingUnitPriceComp.js b/force-app/main/default/lwc/customShippingUnitPriceComp/customShippingUnitPriceComp.js
index 6e05114..fa196e7 100644
--- a/force-app/main/default/lwc/customShippingUnitPriceComp/customShippingUnitPriceComp.js
+++ b/force-app/main/default/lwc/customShippingUnitPriceComp/customShippingUnitPriceComp.js
@@ -1,41 +1,34 @@
-import { LightningElement, api, track } from 'lwc';
+import { LightningElement,api,track } from 'lwc';
export default class CustomShippingUnitPriceComp extends LightningElement {
@api recordId;
@api shippingUnitPrice;
- connectedCallback() {
+ connectedCallback(){
console.log('shippingUnitPrice = ' + this.shippingUnitPrice);
}
limitDecimals(event) {
const value = parseFloat(event.target.value); // 灏嗚緭鍏ュ�艰浆鎹负鏁板瓧绫诲瀷
const roundedValue = Math.round(value * 100) / 100; // 灏嗘暟瀛楀洓鑸嶄簲鍏ュ埌涓や綅灏忔暟
- if (isNaN(value) || isNaN(roundedValue)) {
- // 濡傛灉鏁板瓧鏃犳晥锛屽垯娓呯┖杈撳叆妗�
+ if (isNaN(value) || isNaN(roundedValue)) { // 濡傛灉鏁板瓧鏃犳晥锛屽垯娓呯┖杈撳叆妗�
event.target.value = '';
- } else if (roundedValue !== value) {
- // 濡傛灉杈撳叆妗嗙殑鍊艰秴鍑轰簡涓や綅灏忔暟锛屽垯淇敼涓轰袱浣嶅皬鏁�
+ } else if (roundedValue !== value) { // 濡傛灉杈撳叆妗嗙殑鍊艰秴鍑轰簡涓や綅灏忔暟锛屽垯淇敼涓轰袱浣嶅皬鏁�
event.target.value = roundedValue.toFixed(2);
}
}
- shipmentUnitPriceBlur(event) {
- console.log('shipmentUnitPriceBlur');
+ shipmentUnitPriceBlur(event){
+ console.log('shipmentUnitPriceBlur')
this.shippingUnitPrice = event.target.value;
- this.dispatchEvent(
- new CustomEvent('shipmentunitprice', {
- composed: true,
- bubbles: true,
- cancelable: true,
- detail: {
- data: {
- shipmentunitprice: this.shippingUnitPrice,
- recordId: this.recordId
- }
- }
- })
- );
+ this.dispatchEvent(new CustomEvent('shipmentunitprice', {
+ composed: true,
+ bubbles: true,
+ cancelable: true,
+ detail: {
+ data: { shipmentunitprice: this.shippingUnitPrice, recordId: this.recordId }
+ }
+ }));
}
-}
+}
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexAgencyInfo/lexAgencyInfo.css b/force-app/main/default/lwc/lexAgencyInfo/lexAgencyInfo.css
index 3145a0c..a9a466d 100644
--- a/force-app/main/default/lwc/lexAgencyInfo/lexAgencyInfo.css
+++ b/force-app/main/default/lwc/lexAgencyInfo/lexAgencyInfo.css
@@ -2,18 +2,18 @@
lightning-output-field {
pointer-events: none;
- --lwc-colorTextLabel: #696969;
+ --lwc-colorTextLabel:#696969;
--lwc-inputStaticFontSize: 16px;
--lwc-formLabelFontSize: 16px;
--lwc-brandTextLink: black;
- --lwc-spacingXxSmall: 0px;
+ --lwc-spacingXxSmall:0px;
}
/* lightning-output-field>a {
color: black;
} */
-body {
+body{
/* --lwc-fontFamily:sans-serif; */
font-family: sans-serif;
-}
+}
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexAgencyInfo/lexAgencyInfo.html b/force-app/main/default/lwc/lexAgencyInfo/lexAgencyInfo.html
index b5834bb..1f6f8c2 100644
--- a/force-app/main/default/lwc/lexAgencyInfo/lexAgencyInfo.html
+++ b/force-app/main/default/lwc/lexAgencyInfo/lexAgencyInfo.html
@@ -2,10 +2,7 @@
<template if:true={showSpinner}>
<!-- <lightning-spinner size="medium" variant="brand"></lightning-spinner> -->
<div class="slds-spinner_container">
- <div
- role="status"
- class="slds-spinner slds-spinner_medium slds-spinner_brand"
- >
+ <div role="status" class="slds-spinner slds-spinner_medium slds-spinner_brand">
<span class="slds-assistive-text">Loading</span>
<div class="slds-spinner__dot-a"></div>
<div class="slds-spinner__dot-b"></div>
@@ -14,14 +11,8 @@
</template>
<c-common-toast></c-common-toast>
<template if:true={showPage}>
- <div
- style="
- border: 1px solid #d4d4d4;
- border-top: 3px solid #51606e;
- border-radius: 5px;
- "
- >
- <div style="border-bottom: 1px solid #d4d4d4; padding: 3px">
+ <div style="border: 1px solid #D4D4D4;border-top: 3px solid #51606E;border-radius:5px;">
+ <div style="border-bottom: 1px solid #D4D4D4;padding:3px;">
<lightning-layout>
<lightning-layout-item padding="around-small">
<p style="font-size: 18px">
@@ -30,175 +21,91 @@
</lightning-layout-item>
</lightning-layout>
</div>
- <div style="padding: 10px">
- <lightning-accordion
- allow-multiple-sections-open
- active-section-name={activeSections}
- >
- <lightning-record-view-form
- record-id={accountId}
- object-api-name="Account"
- >
- <lightning-accordion-section
- label="缁忛攢鍟嗚缁嗕俊鎭�"
- name="A"
- >
+ <div style="padding:10px;">
+ <lightning-accordion allow-multiple-sections-open active-section-name={activeSections}>
+ <lightning-record-view-form record-id={accountId} object-api-name="Account">
+ <lightning-accordion-section label="缁忛攢鍟嗚缁嗕俊鎭�" name="A">
<lightning-layout multiple-rows="true">
<lightning-layout-item size="5">
- <lightning-output-field
- field-name="Management_Code__c"
- ></lightning-output-field>
+ <lightning-output-field field-name="Management_Code__c"></lightning-output-field>
</lightning-layout-item>
- <lightning-layout-item
- size="1"
- ></lightning-layout-item>
+ <lightning-layout-item size="1"></lightning-layout-item>
<lightning-layout-item size="5">
- <lightning-output-field
- field-name="Name"
- ></lightning-output-field>
+ <lightning-output-field field-name="Name"></lightning-output-field>
</lightning-layout-item>
- <lightning-layout-item
- size="1"
- ></lightning-layout-item>
+ <lightning-layout-item size="1"></lightning-layout-item>
<lightning-layout-item size="5">
- <lightning-output-field
- field-name="Ban_On_Use_Date__c"
- ></lightning-output-field>
+ <lightning-output-field field-name="Ban_On_Use_Date__c"></lightning-output-field>
</lightning-layout-item>
- <lightning-layout-item
- size="1"
- ></lightning-layout-item>
+ <lightning-layout-item size="1"></lightning-layout-item>
<lightning-layout-item size="5">
- <lightning-output-field
- field-name="Ban_On_Use_Reason__c"
- ></lightning-output-field>
+ <lightning-output-field field-name="Ban_On_Use_Reason__c"></lightning-output-field>
</lightning-layout-item>
- <lightning-layout-item
- size="1"
- ></lightning-layout-item>
+ <lightning-layout-item size="1"></lightning-layout-item>
<lightning-layout-item size="5">
- <lightning-output-field
- field-name="Dealer_discount__c"
- ></lightning-output-field>
+ <lightning-output-field field-name="Dealer_discount__c"></lightning-output-field>
</lightning-layout-item>
- <lightning-layout-item
- size="1"
- ></lightning-layout-item>
+ <lightning-layout-item size="1"></lightning-layout-item>
<lightning-layout-item size="5">
- <lightning-output-field
- field-name="Sales_Shop_Class__c"
- ></lightning-output-field>
+ <lightning-output-field field-name="Sales_Shop_Class__c"></lightning-output-field>
</lightning-layout-item>
- <lightning-layout-item
- size="1"
- ></lightning-layout-item>
+ <lightning-layout-item size="1"></lightning-layout-item>
<lightning-layout-item size="5">
- <lightning-output-field
- field-name="Deposit_Receipt_Finished__c"
- ></lightning-output-field>
+ <lightning-output-field field-name="Deposit_Receipt_Finished__c"></lightning-output-field>
</lightning-layout-item>
- <lightning-layout-item
- size="1"
- ></lightning-layout-item>
+ <lightning-layout-item size="1"></lightning-layout-item>
<lightning-layout-item size="5">
- <lightning-output-field
- field-name="Deposit_Receipt_Completion_Day__c"
- ></lightning-output-field>
+ <lightning-output-field field-name="Deposit_Receipt_Completion_Day__c"></lightning-output-field>
</lightning-layout-item>
- <lightning-layout-item
- size="1"
- ></lightning-layout-item>
+ <lightning-layout-item size="1"></lightning-layout-item>
</lightning-layout>
</lightning-accordion-section>
- <lightning-accordion-section
- label="钀ヤ笟璁稿彲璇佷功鐘跺喌"
- name="B"
- >
+ <lightning-accordion-section label="钀ヤ笟璁稿彲璇佷功鐘跺喌" name="B">
<lightning-layout multiple-rows="true">
<lightning-layout-item size="5">
- <lightning-output-field
- field-name="Business_Authorization_No__c"
- ></lightning-output-field>
+ <lightning-output-field field-name="Business_Authorization_No__c"></lightning-output-field>
</lightning-layout-item>
- <lightning-layout-item
- size="1"
- ></lightning-layout-item>
+ <lightning-layout-item size="1"></lightning-layout-item>
<lightning-layout-item size="5">
- <lightning-output-field
- field-name="Business_Paper_Expiration_Date__c"
- ></lightning-output-field>
+ <lightning-output-field field-name="Business_Paper_Expiration_Date__c"></lightning-output-field>
</lightning-layout-item>
- <lightning-layout-item
- size="1"
- ></lightning-layout-item>
+ <lightning-layout-item size="1"></lightning-layout-item>
<lightning-layout-item size="5">
- <lightning-output-field
- field-name="Tax_Practice_No__c"
- ></lightning-output-field>
+ <lightning-output-field field-name="Tax_Practice_No__c"></lightning-output-field>
</lightning-layout-item>
- <lightning-layout-item
- size="1"
- ></lightning-layout-item>
+ <lightning-layout-item size="1"></lightning-layout-item>
<lightning-layout-item size="5">
- <lightning-output-field
- field-name="Tax_Practice_Expiration_Date__c"
- ></lightning-output-field>
+ <lightning-output-field field-name="Tax_Practice_Expiration_Date__c"></lightning-output-field>
</lightning-layout-item>
- <lightning-layout-item
- size="1"
- ></lightning-layout-item>
+ <lightning-layout-item size="1"></lightning-layout-item>
<lightning-layout-item size="5">
- <lightning-output-field
- field-name="Medical_Equipment_Num__c"
- ></lightning-output-field>
+ <lightning-output-field field-name="Medical_Equipment_Num__c"></lightning-output-field>
</lightning-layout-item>
- <lightning-layout-item
- size="1"
- ></lightning-layout-item>
+ <lightning-layout-item size="1"></lightning-layout-item>
<lightning-layout-item size="5">
- <lightning-output-field
- field-name="Medical_Equipment_Expiration_Date__c"
- ></lightning-output-field>
+ <lightning-output-field field-name="Medical_Equipment_Expiration_Date__c"></lightning-output-field>
</lightning-layout-item>
- <lightning-layout-item
- size="1"
- ></lightning-layout-item>
+ <lightning-layout-item size="1"></lightning-layout-item>
</lightning-layout>
</lightning-accordion-section>
<lightning-accordion-section label="鍦板潃淇℃伅" name="C">
<lightning-layout multiple-rows="true">
<lightning-layout-item size="5">
- <lightning-output-field
- field-name="Postal_Code__c"
- ></lightning-output-field>
+ <lightning-output-field field-name="Postal_Code__c"></lightning-output-field>
</lightning-layout-item>
- <lightning-layout-item
- size="1"
- ></lightning-layout-item>
+ <lightning-layout-item size="1"></lightning-layout-item>
<lightning-layout-item size="5">
- <lightning-output-field
- field-name="Phone"
- ></lightning-output-field>
+ <lightning-output-field field-name="Phone"></lightning-output-field>
</lightning-layout-item>
- <lightning-layout-item
- size="1"
- ></lightning-layout-item>
+ <lightning-layout-item size="1"></lightning-layout-item>
<lightning-layout-item size="5">
- <lightning-output-field
- field-name="Address_Together__c"
- ></lightning-output-field>
+ <lightning-output-field field-name="Address_Together__c"></lightning-output-field>
</lightning-layout-item>
- <lightning-layout-item
- size="1"
- ></lightning-layout-item>
+ <lightning-layout-item size="1"></lightning-layout-item>
<lightning-layout-item size="5">
- <lightning-output-field
- field-name="Fax"
- ></lightning-output-field>
+ <lightning-output-field field-name="Fax"></lightning-output-field>
</lightning-layout-item>
- <lightning-layout-item
- size="1"
- ></lightning-layout-item>
+ <lightning-layout-item size="1"></lightning-layout-item>
</lightning-layout>
</lightning-accordion-section>
</lightning-record-view-form>
@@ -206,4 +113,4 @@
</div>
</div>
</template>
-</template>
+</template>
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexArriveGoods/lexArriveGoods.css b/force-app/main/default/lwc/lexArriveGoods/lexArriveGoods.css
index 7317b7e..49d6963 100644
--- a/force-app/main/default/lwc/lexArriveGoods/lexArriveGoods.css
+++ b/force-app/main/default/lwc/lexArriveGoods/lexArriveGoods.css
@@ -1 +1 @@
-@import 'c/lexCssUtility';
+@import 'c/lexCssUtility';
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexArriveGoods/lexArriveGoods.html b/force-app/main/default/lwc/lexArriveGoods/lexArriveGoods.html
index fbf59ea..bff6b32 100644
--- a/force-app/main/default/lwc/lexArriveGoods/lexArriveGoods.html
+++ b/force-app/main/default/lwc/lexArriveGoods/lexArriveGoods.html
@@ -98,8 +98,7 @@
</div>
</td>
<td style="width: 200px">
- <lightning-formatted-text
- style="font-size: 16px"
+ <lightning-formatted-text style="font-size: 16px;"
value={coc.Name}
></lightning-formatted-text>
</td>
@@ -115,8 +114,7 @@
</div>
</td>
<td style="width: 100px">
- <lightning-formatted-number
- style="font-size: 16px"
+ <lightning-formatted-number style="font-size: 16px;"
value={coc.Total_num__c}
></lightning-formatted-number>
</td>
@@ -132,8 +130,7 @@
</div>
</td>
<td style="width: 100px">
- <lightning-formatted-number
- style="font-size: 16px"
+ <lightning-formatted-number style="font-size: 16px;"
value={coc.OrderNumber_arrived__c}
></lightning-formatted-number>
</td>
@@ -149,8 +146,7 @@
</div>
</td>
<td style="width: 100px">
- <lightning-formatted-number
- style="font-size: 16px"
+ <lightning-formatted-number style="font-size: 16px;"
value={coc.OrderNumber_notarrive__c}
></lightning-formatted-number>
</td>
@@ -458,4 +454,4 @@
</div>
</div>
</template>
-</template>
+</template>
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexArriveGoods/lexArriveGoods.js b/force-app/main/default/lwc/lexArriveGoods/lexArriveGoods.js
index 73304b7..348f5ee 100644
--- a/force-app/main/default/lwc/lexArriveGoods/lexArriveGoods.js
+++ b/force-app/main/default/lwc/lexArriveGoods/lexArriveGoods.js
@@ -907,4 +907,4 @@
// });
// this.dispatchEvent(evt);
}
-}
+}
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexArriveGoods/lexArriveGoods.js-meta.xml b/force-app/main/default/lwc/lexArriveGoods/lexArriveGoods.js-meta.xml
index 0866cdc..d893635 100644
--- a/force-app/main/default/lwc/lexArriveGoods/lexArriveGoods.js-meta.xml
+++ b/force-app/main/default/lwc/lexArriveGoods/lexArriveGoods.js-meta.xml
@@ -1,4 +1,4 @@
-<?xml version="1.0" encoding="UTF-8" ?>
+<?xml version="1.0" encoding="UTF-8"?>
<LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata">
<apiVersion>56.0</apiVersion>
<isExposed>true</isExposed>
@@ -6,4 +6,4 @@
<target>lightningCommunity__Page</target>
<target>lightningCommunity__Default</target>
</targets>
-</LightningComponentBundle>
+</LightningComponentBundle>
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexArriveGoodsMain/lexArriveGoodsMain.html b/force-app/main/default/lwc/lexArriveGoodsMain/lexArriveGoodsMain.html
index d8c0cbc..d83b5ea 100644
--- a/force-app/main/default/lwc/lexArriveGoodsMain/lexArriveGoodsMain.html
+++ b/force-app/main/default/lwc/lexArriveGoodsMain/lexArriveGoodsMain.html
@@ -238,4 +238,4 @@
</section>
<div class="slds-backdrop slds-backdrop_open"></div>
</template>
-</template>
+</template>
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexArriveGoodsMain/lexArriveGoodsMain.js b/force-app/main/default/lwc/lexArriveGoodsMain/lexArriveGoodsMain.js
index f7572d2..85ae806 100644
--- a/force-app/main/default/lwc/lexArriveGoodsMain/lexArriveGoodsMain.js
+++ b/force-app/main/default/lwc/lexArriveGoodsMain/lexArriveGoodsMain.js
@@ -526,4 +526,4 @@
// });
// this.dispatchEvent(evt);
}
-}
+}
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexArriveGsDetails/lexArriveGsDetails.html b/force-app/main/default/lwc/lexArriveGsDetails/lexArriveGsDetails.html
index df18831..e83098a 100644
--- a/force-app/main/default/lwc/lexArriveGsDetails/lexArriveGsDetails.html
+++ b/force-app/main/default/lwc/lexArriveGsDetails/lexArriveGsDetails.html
@@ -2,10 +2,7 @@
<template if:true={showSpinner}>
<!-- <lightning-spinner size="medium" variant="brand"></lightning-spinner> -->
<div class="slds-spinner_container">
- <div
- role="status"
- class="slds-spinner slds-spinner_medium slds-spinner_brand"
- >
+ <div role="status" class="slds-spinner slds-spinner_medium slds-spinner_brand">
<span class="slds-assistive-text">Loading</span>
<div class="slds-spinner__dot-a"></div>
<div class="slds-spinner__dot-b"></div>
@@ -14,14 +11,8 @@
</template>
<c-common-toast></c-common-toast>
<template if:true={showPage}>
- <div
- style="
- border: 1px solid #d4d4d4;
- border-top: 3px solid #51606e;
- border-radius: 5px;
- "
- >
- <div style="border-bottom: 1px solid #d4d4d4; padding: 3px">
+ <div style="border: 1px solid #D4D4D4;border-top: 3px solid #51606E;border-radius:5px;">
+ <div style="border-bottom: 1px solid #D4D4D4;padding:3px;">
<lightning-layout>
<lightning-layout-item padding="around-small">
<p style="font-size: 18px">
@@ -31,29 +22,14 @@
</lightning-layout>
<!-- <p style="font-size: 16px;"><strong>鍒拌揣</strong></p> -->
</div>
- <div style="padding: 10px">
+ <div style="padding:10px;">
<!-- 鎸夐挳 -->
<!-- <lightning-button style="margin: 5px;" label="鍑哄簱" onclick={proSale} disabled={arrivetoorder}></lightning-button> -->
- <button
- class="slds-button slds-button_neutral slds-button_stretch lexBorder"
- style="margin: 5px"
- label="鍑哄簱"
- onclick={proSale}
- disabled={arrivetoorder}
- >
- 鍑哄簱
- </button>
- <p style="height: 10px"></p>
+ <button class="slds-button slds-button_neutral slds-button_stretch lexBorder" style="margin: 5px;" label="鍑哄簱" onclick={proSale} disabled={arrivetoorder}>鍑哄簱</button>
+ <p style="height: 10px;"></p>
<!-- 鍒拌揣璁㈠崟淇℃伅 -->
- <div
- style="
- border: 1px solid #d4d4d4;
- border-top: 3px solid #51606e;
- border-radius: 5px;
- margin-bottom: 7px;
- "
- >
- <div style="border-bottom: 1px solid #d4d4d4; padding: 3px">
+ <div style="border: 1px solid #D4D4D4;border-top: 3px solid #51606E;border-radius:5px;margin-bottom:7px;">
+ <div style="border-bottom: 1px solid #D4D4D4;padding:3px;">
<lightning-layout>
<lightning-layout-item padding="around-small">
<p style="font-size: 18px">
@@ -63,77 +39,34 @@
</lightning-layout>
<!-- <p style="font-size: 16px;"><strong>鍒拌揣璁㈠崟淇℃伅</strong></p> -->
</div>
- <div style="padding: 10px">
+ <div style="padding:10px;">
<table>
<tbody>
<tr>
- <td style="width: 10px"></td>
- <td style="width: 140px">
- <div
- style="
- color: #696969;
- font-size: 16px;
- "
- >
- 鍒拌揣璁㈠崟鍚嶇О
- </div>
+ <td style="width:10px;"></td>
+ <td style="width:140px;">
+ <div style="color:#696969;font-size:16px;">鍒拌揣璁㈠崟鍚嶇О</div>
</td>
- <td style="width: 200px">
- <lightning-formatted-text
- style="font-size: 16px"
- value={coc.Name}
- ></lightning-formatted-text>
+ <td style="width:200px;">
+ <lightning-formatted-text style="font-size: 16px;" value={coc.Name}></lightning-formatted-text>
</td>
- <td style="width: 30px"></td>
- <td style="width: 140px">
- <div
- style="
- color: #696969;
- font-size: 16px;
- "
- >
- 鏈鍏ュ簱浜у搧閲戦
- </div>
+ <td style="width:30px;"></td>
+ <td style="width:140px;">
+ <div style="color:#696969;font-size:16px;">鏈鍏ュ簱浜у搧閲戦</div>
</td>
- <td style="width: 100px">
- <lightning-formatted-number
- style="font-size: 16px"
- value={coc.Arrive_total_amount__c}
- minimum-fraction-digits="2"
- ></lightning-formatted-number>
+ <td style="width:100px;">
+ <lightning-formatted-number style="font-size: 16px;" value={coc.Arrive_total_amount__c} minimum-fraction-digits="2"></lightning-formatted-number>
</td>
<td></td>
</tr>
- <tr style="height: 20px"></tr>
+ <tr style="height: 20px;"></tr>
<tr>
- <td style="width: 10px"></td>
- <td style="width: 120px">
- <div
- style="
- color: #696969;
- font-size: 16px;
- "
- >
- 娑堣�楀搧璁㈠崟鍚嶇О<lightning-helptext
- style="
- --lwc-spacingXxSmall: 0px;
- "
- content={label.helpText}
- ></lightning-helptext>
- </div>
+ <td style="width:10px;"></td>
+ <td style="width:120px;">
+ <div style="color:#696969;font-size:16px;">娑堣�楀搧璁㈠崟鍚嶇О<lightning-helptext style="--lwc-spacingXxSmall:0px;" content={label.helpText}></lightning-helptext></div>
</td>
- <td style="width: 200px">
- <a
- style="
- text-decoration: underline;
- color: black;
- "
- onclick={clickOrder}
- ><lightning-formatted-text
- style="font-size: 16px"
- value={coc.arriveOrder}
- ></lightning-formatted-text
- ></a>
+ <td style="width:200px;">
+ <a style="text-decoration: underline;color:black;" onclick={clickOrder}><lightning-formatted-text style="font-size: 16px;" value={coc.arriveOrder}></lightning-formatted-text></a>
<!-- <lightning-formatted-text value={coc.Arrive_Order__r.Name}></lightning-formatted-text> -->
</td>
<td></td>
@@ -143,15 +76,8 @@
</div>
</div>
<!-- 鍦ㄥ簱鍟嗗搧搴撳瓨涓�瑙� -->
- <div
- style="
- border: 1px solid #d4d4d4;
- border-top: 3px solid #51606e;
- border-radius: 5px;
- margin-bottom: 7px;
- "
- >
- <div style="border-bottom: 1px solid #d4d4d4; padding: 3px">
+ <div style="border: 1px solid #D4D4D4;border-top: 3px solid #51606E;border-radius:5px;margin-bottom:7px;">
+ <div style="border-bottom: 1px solid #D4D4D4;padding:3px;">
<lightning-layout>
<lightning-layout-item padding="around-small">
<p style="font-size: 18px">
@@ -161,18 +87,11 @@
</lightning-layout>
<!-- <p style="font-size: 16px;"><strong>鍦ㄥ簱鍟嗗搧搴撳瓨涓�瑙�</strong></p> -->
</div>
- <div style="padding: 10px">
- <lightning-datatable
- class="wrapped-header-datatable"
- style="word-wrap: break-word; word-break: break-all"
- hide-checkbox-column
- key-field="recordId"
- columns={colms}
- data={consumableorderdetailsRecords}
- ></lightning-datatable>
+ <div style="padding:10px;">
+ <lightning-datatable class="wrapped-header-datatable" style="word-wrap:break-word; word-break:break-all;" hide-checkbox-column key-field="recordId" columns={colms} data={consumableorderdetailsRecords}></lightning-datatable>
</div>
</div>
</div>
</div>
</template>
-</template>
+</template>
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexArriveGsDetails/lexArriveGsDetails.js b/force-app/main/default/lwc/lexArriveGsDetails/lexArriveGsDetails.js
index a641949..30c135b 100644
--- a/force-app/main/default/lwc/lexArriveGsDetails/lexArriveGsDetails.js
+++ b/force-app/main/default/lwc/lexArriveGsDetails/lexArriveGsDetails.js
@@ -1,17 +1,16 @@
-import { LightningElement, wire, track } from 'lwc';
+import { LightningElement,wire,track } from 'lwc';
import { CurrentPageReference } from 'lightning/navigation';
import { ShowToastEvent } from 'lightning/platformShowToastEvent';
import { NavigationMixin } from 'lightning/navigation';
import init from '@salesforce/apex/LexArriveGsDetailsController.init';
import proSale from '@salesforce/apex/LexArriveGsDetailsController.proSale';
import helpText from '@salesforce/label/c.LexArrivegsDetailsPageHelpText';
-//table css
-import { loadStyle } from 'lightning/platformResourceLoader';
-import WrappedHeaderTable from '@salesforce/resourceUrl/lexdatatable';
+//table css
+import { loadStyle } from "lightning/platformResourceLoader";
+import WrappedHeaderTable from "@salesforce/resourceUrl/lexdatatable";
-export default class LexArriveGsDetails extends NavigationMixin(
- LightningElement
-) {
+export default class LexArriveGsDetails extends NavigationMixin(LightningElement) {
+
@track eSetId;
@track showSpinner = true;
@track showPage = false;
@@ -25,67 +24,16 @@
//鏄惁涓�鐩存樉绀烘彁绀�
@track isNoteStay = true;
@track colms = [
- {
- label: '娑堣�楀搧鍚嶇О',
- fieldName: 'prodName',
- hideDefaultActions: true,
- wrapText: true
- },
- {
- label: '瑙勬牸',
- fieldName: 'packing_list',
- hideDefaultActions: true,
- wrapText: true,
- initialWidth: 50,
- cellAttributes: { alignment: 'right' }
- },
- {
- label: 'CFDA鐘舵��',
- fieldName: 'statusCFDA',
- hideDefaultActions: true,
- wrapText: true,
- initialWidth: 100
- },
- {
- label: '娉ㄥ唽璇佺紪鐮佸彿',
- fieldName: 'approbation_No',
- hideDefaultActions: true,
- wrapText: true,
- initialWidth: 125
- },
- {
- label: '娉ㄥ唽璇佹晥鏈�',
- fieldName: 'expiration_DateStr',
- hideDefaultActions: true,
- wrapText: true,
- initialWidth: 115
- },
- {
- label: '浣跨敤鏈熼檺',
- fieldName: 'Sterilization_limitStr',
- hideDefaultActions: true,
- wrapText: true,
- initialWidth: 115
- },
- {
- label: 'BarCode',
- fieldName: 'barCode',
- hideDefaultActions: true,
- initialWidth: 250,
- wrapText: true
- },
- {
- label: '閲囪喘鍗曚环',
- type: 'number',
- fieldName: 'intraTradeList',
- hideDefaultActions: true,
- wrapText: true,
- initialWidth: 120,
- typeAttributes: { minimumFractionDigits: 2 },
- cellAttributes: { alignment: 'right' }
- }
+ {label:'娑堣�楀搧鍚嶇О' , fieldName:'prodName', hideDefaultActions: true,wrapText:true},
+ {label:'瑙勬牸' , fieldName:'packing_list', hideDefaultActions: true,wrapText:true,initialWidth:50,cellAttributes: { alignment: "right" }},
+ {label:'CFDA鐘舵��' , fieldName:'statusCFDA', hideDefaultActions: true,wrapText:true,initialWidth:100},
+ {label:'娉ㄥ唽璇佺紪鐮佸彿' , fieldName:'approbation_No', hideDefaultActions: true,wrapText:true,initialWidth:125},
+ {label:'娉ㄥ唽璇佹晥鏈�' , fieldName:'expiration_DateStr', hideDefaultActions: true,wrapText:true,initialWidth:115},
+ {label:'浣跨敤鏈熼檺' , fieldName:'Sterilization_limitStr', hideDefaultActions: true,wrapText:true,initialWidth:115},
+ {label:'BarCode' , fieldName:'barCode', hideDefaultActions: true,initialWidth:250,wrapText:true},
+ {label:'閲囪喘鍗曚环' ,type:'number',fieldName:'intraTradeList', hideDefaultActions: true,wrapText:true,initialWidth:120,typeAttributes:{minimumFractionDigits: 2},cellAttributes: { alignment: "right" }}
];
- label = { helpText };
+ label = {helpText};
// 鑾峰彇鍙傛暟
@wire(CurrentPageReference)
@@ -93,145 +41,107 @@
if (currentPageReference) {
this.eSetId = currentPageReference.state?.EsetId;
}
- console.log('CurrentPageReference:' + this.eSetId);
+ console.log('CurrentPageReference:'+this.eSetId);
}
- renderedCallback() {
+ renderedCallback(){
if (!this.stylesLoaded) {
Promise.all([loadStyle(this, WrappedHeaderTable)])
.then(() => {
- console.log('Custom styles loaded');
+ console.log("Custom styles loaded");
this.stylesLoaded = true;
})
.catch((error) => {
- console.error('Error loading custom styles');
+ console.error("Error loading custom styles");
});
}
}
//鍒濆鍖�
- connectedCallback() {
- init({ eSetIdStr: this.eSetId })
- .then((result) => {
- this.showPage = true;
- this.isNoteStay = result.isNoteStay;
- if (result.result == 'Success') {
- this.coc = result.coc;
- if (
- this.coc.Arrive_Order__c != null &&
- this.coc.Arrive_Order__c != ''
- ) {
- this.coc['arriveOrder'] = this.coc.Arrive_Order__r.Name;
- }
- console.log('this.coc:' + JSON.stringify(this.coc));
- this.accountid = result.accountid;
- this.orderallcount = result.orderallcount;
- this.arrivetoorder = result.arrivetoorder;
- this.consumableorderdetailsCount =
- result.consumableorderdetailsCount;
- this.consumableorderdetailsRecords =
- result.consumableorderdetailsRecords;
- for (var i in this.consumableorderdetailsRecords) {
- if (this.consumableorderdetailsRecords[i].esd != null) {
- this.consumableorderdetailsRecords[i]['recordId'] =
- this.consumableorderdetailsRecords[i].esd.Id;
- if (
- this.consumableorderdetailsRecords[i].esd
- .Consumable_Product__c != null &&
- this.consumableorderdetailsRecords[i].esd
- .Consumable_Product__c != ''
- ) {
- this.consumableorderdetailsRecords[i][
- 'prodName'
- ] =
- this.consumableorderdetailsRecords[
- i
- ].esd.Consumable_Product__r.Name__c;
- }
- // this.consumableorderdetailsRecords[i]['prodName'] = this.consumableorderdetailsRecords[i].prodName;
- this.consumableorderdetailsRecords[i]['barCode'] =
- this.consumableorderdetailsRecords[
- i
- ].esd.Bar_Code__c;
- this.consumableorderdetailsRecords[i][
- 'intraTradeList'
- ] =
- this.consumableorderdetailsRecords[
- i
- ].esd.Intra_Trade_List_RMB__c;
- console.log(
- 'Intra_Trade_List_RMB__c:' +
- this.consumableorderdetailsRecords[i].esd
- .Intra_Trade_List_RMB__c
- );
- }
- if (
- this.consumableorderdetailsRecords[i].Prod != null
- ) {
- this.consumableorderdetailsRecords[i][
- 'statusCFDA'
- ] =
- this.consumableorderdetailsRecords[
- i
- ].Prod.SFDA_Status__c;
- }
- }
- this.showSpinner = false;
- } else {
- this.showSpinner = false;
- console.log('error:' + result.errorMsg);
- this.showMyToast('鍒濆鍖栧け璐�', result.errorMsg, 'error');
+ connectedCallback(){
+ init({eSetIdStr : this.eSetId})
+ .then(result=>{
+ this.showPage = true;
+ this.isNoteStay = result.isNoteStay;
+ if(result.result == 'Success'){
+ this.coc = result.coc;
+ if(this.coc.Arrive_Order__c != null && this.coc.Arrive_Order__c != ''){
+ this.coc['arriveOrder'] = this.coc.Arrive_Order__r.Name;
}
- })
- .catch((error) => {
+ console.log('this.coc:'+JSON.stringify(this.coc));
+ this.accountid = result.accountid;
+ this.orderallcount = result.orderallcount;
+ this.arrivetoorder = result.arrivetoorder;
+ this.consumableorderdetailsCount = result.consumableorderdetailsCount;
+ this.consumableorderdetailsRecords = result.consumableorderdetailsRecords;
+ for(var i in this.consumableorderdetailsRecords){
+ if(this.consumableorderdetailsRecords[i].esd != null){
+ this.consumableorderdetailsRecords[i]['recordId'] = this.consumableorderdetailsRecords[i].esd.Id;
+ if(this.consumableorderdetailsRecords[i].esd.Consumable_Product__c != null && this.consumableorderdetailsRecords[i].esd.Consumable_Product__c != ''){
+ this.consumableorderdetailsRecords[i]['prodName'] = this.consumableorderdetailsRecords[i].esd.Consumable_Product__r.Name__c;
+ }
+ // this.consumableorderdetailsRecords[i]['prodName'] = this.consumableorderdetailsRecords[i].prodName;
+ this.consumableorderdetailsRecords[i]['barCode'] = this.consumableorderdetailsRecords[i].esd.Bar_Code__c;
+ this.consumableorderdetailsRecords[i]['intraTradeList'] = this.consumableorderdetailsRecords[i].esd.Intra_Trade_List_RMB__c;
+ console.log("Intra_Trade_List_RMB__c:"+this.consumableorderdetailsRecords[i].esd.Intra_Trade_List_RMB__c);
+ }
+ if(this.consumableorderdetailsRecords[i].Prod != null){
+ this.consumableorderdetailsRecords[i]['statusCFDA'] = this.consumableorderdetailsRecords[i].Prod.SFDA_Status__c;
+ }
+ }
this.showSpinner = false;
- this.showPage = true;
- console.log('error:' + error);
- this.showMyToast('鍒濆鍖栧け璐�', error, 'error');
- });
+ }else {
+ this.showSpinner = false;
+ console.log("error:"+result.errorMsg);
+ this.showMyToast('鍒濆鍖栧け璐�',result.errorMsg,'error');
+ }
+ })
+ .catch(error=>{
+ this.showSpinner = false;
+ this.showPage = true;
+ console.log("error:"+error);
+ this.showMyToast('鍒濆鍖栧け璐�',error,'error');
+ })
}
- proSale() {
+ proSale(){
this.showSpinner = true;
proSale({
- cocStr: JSON.stringify(this.coc),
- orderallcountParm: this.orderallcount,
- consumableorderdetailsCountParm: this.consumableorderdetailsCount,
- eSetIdStr: this.eSetId
+ cocStr : JSON.stringify(this.coc),
+ orderallcountParm : this.orderallcount,
+ consumableorderdetailsCountParm : this.consumableorderdetailsCount,
+ eSetIdStr : this.eSetId
})
- .then((result) => {
- if (result.result == 'Success') {
- var url = result.url;
- const config = {
- type: 'standard__webPage',
- attributes: {
- url: url
- }
- };
- this[NavigationMixin.Navigate](config);
- } else {
- this.showSpinner = false;
- console.log('error:' + result.errorMsg);
- this.showMyToast('鍑哄簱澶辫触', result.errorMsg, 'error');
- }
- })
- .catch((error) => {
- this.showPage = true;
+ .then(result=>{
+ if(result.result == 'Success'){
+ var url = result.url;
+ const config = {
+ type: 'standard__webPage',
+ attributes: {
+ url: url
+ }
+ };
+ this[NavigationMixin.Navigate](config);
+ }else {
this.showSpinner = false;
- console.log('error:' + error);
- this.showMyToast('鍑哄簱澶辫触', error, 'error');
- });
+ console.log("error:"+result.errorMsg);
+ this.showMyToast('鍑哄簱澶辫触',result.errorMsg,'error');
+ }
+ })
+ .catch(error=>{
+ this.showPage = true;
+ this.showSpinner = false;
+ console.log("error:"+error);
+ this.showMyToast('鍑哄簱澶辫触',error,'error');
+ })
}
- clickOrder() {
- if (
- this.coc.Arrive_Order__c != null &&
- this.coc.Arrive_Order__c != ''
- ) {
+ clickOrder(){
+ if(this.coc.Arrive_Order__c != null && this.coc.Arrive_Order__c != ''){
const config = {
type: 'standard__webPage',
attributes: {
- url: '/detail/' + this.coc.Arrive_Order__c
+ url: '/detail/'+this.coc.Arrive_Order__c
}
};
this[NavigationMixin.Navigate](config);
@@ -242,24 +152,18 @@
console.log('show custom message');
var iconName = '';
var content = '';
- if (variant == 'success') {
- iconName = 'utility:check';
- } else {
- iconName = 'utility:error';
+ if(variant == 'success'){
+ iconName = 'utility:check';
+ }else{
+ iconName = 'utility:error';
}
- if (message != '') {
- content =
- '<h2><strong>' +
- title +
- '<strong/></h2><h5>' +
- message +
- '</h5>';
- } else {
- content = '<h2><strong>' + title + '<strong/></h2>';
+ if(message != ''){
+ content = '<h2><strong>'+title+'<strong/></h2><h5>'+message+'</h5>';
+ }else{
+ content = '<h2><strong>'+title+'<strong/></h2>';
}
- this.template
- .querySelector('c-common-toast')
- .showToast(variant, content, iconName, 10000);
+ this.template.querySelector('c-common-toast').
+ showToast(variant,content,iconName,10000);
// var mode;
// if(this.isNoteStay){
// mode ='sticky';
@@ -273,5 +177,5 @@
// mode: mode
// });
// this.dispatchEvent(evt);
- }
-}
+ }
+}
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexCancelRemoveBox/lexCancelRemoveBox.html b/force-app/main/default/lwc/lexCancelRemoveBox/lexCancelRemoveBox.html
index c9db21e..60898fb 100644
--- a/force-app/main/default/lwc/lexCancelRemoveBox/lexCancelRemoveBox.html
+++ b/force-app/main/default/lwc/lexCancelRemoveBox/lexCancelRemoveBox.html
@@ -1,227 +1,138 @@
<template>
- <template if:true={showSpinner}>
- <!-- <lightning-spinner size="medium" variant="brand"></lightning-spinner> -->
- <div class="slds-spinner_container">
- <div
- role="status"
- class="slds-spinner slds-spinner_medium slds-spinner_brand"
- >
- <span class="slds-assistive-text">Loading</span>
- <div class="slds-spinner__dot-a"></div>
- <div class="slds-spinner__dot-b"></div>
- </div>
- </div>
- </template>
- <c-common-toast></c-common-toast>
- <div style="border: 1px solid #d4d4d4; border-radius: 5px">
- <div
- style="
- border-top: 3px solid #51606e;
- border-bottom: 1px solid #d4d4d4;
- padding: 3px;
- "
- >
- <div>
- <!-- <p style="font-size: 18px;"><strong>鍙栨秷鎷嗙洅</strong></p> -->
- <lightning-layout>
- <lightning-layout-item padding="around-small">
- <p style="font-size: 18px">
- <strong>鍙栨秷鎷嗙洅</strong>
- </p>
- </lightning-layout-item>
- </lightning-layout>
- </div>
- </div>
- <div style="padding: 10px">
- <div
- style="
- border: 1px solid #d4d4d4;
- border-radius: 5px;
- margin-bottom: 7px;
- "
- >
- <div
- style="
- border-top: 3px solid #51606e;
- border-bottom: 1px solid #d4d4d4;
- padding: 3px;
- "
- >
- <!-- <lightning-button variant="brand" class='lexstyle' style="margin-left:10px;" label="鍙栨秷鎷嗙洅纭" title="鍙栨秷鎷嗙洅纭" onclick={saveConfirm}></lightning-button></td> -->
- <button
- class="slds-button slds-button_neutral slds-button_stretch lexBorder"
- style="
- margin-left: 10px;
- margin-top: 12px;
- margin-bottom: 12px;
- "
- label="鍙栨秷鎷嗙洅纭"
- onclick={saveConfirm}
- >
- 鍙栨秷鎷嗙洅纭
- </button>
- </div>
- </div>
- <div
- style="
- border: 1px solid #d4d4d4;
- border-radius: 5px;
- margin-bottom: 7px;
- margin-top: 5px;
- "
- >
- <div
- style="
- border-top: 3px solid #51606e;
- border-bottom: 1px solid #d4d4d4;
- padding: 3px;
- "
- >
- <lightning-layout>
- <lightning-layout-item padding="around-small">
- <p style="font-size: 16px">
- <strong>BarCode褰曞叆</strong>
- </p>
- </lightning-layout-item>
- </lightning-layout>
- </div>
+ <template if:true={showSpinner}>
+ <!-- <lightning-spinner size="medium" variant="brand"></lightning-spinner> -->
+ <div class="slds-spinner_container">
+ <div role="status" class="slds-spinner slds-spinner_medium slds-spinner_brand">
+ <span class="slds-assistive-text">Loading</span>
+ <div class="slds-spinner__dot-a"></div>
+ <div class="slds-spinner__dot-b"></div>
+ </div>
+ </div>
+ </template>
+ <c-common-toast></c-common-toast>
+ <div style="border: 1px solid #D4D4D4;border-radius:5px;">
- <!-- <div style="border-top: 3px solid #51606E;border-bottom: 1px solid #D4D4D4;padding:3px;"> -->
- <table>
- <colgroup>
- <col width="160px" />
- <col width="100px" />
- <col width="10px" />
- <col width="70px" />
- <col width="100px" />
- <col width="10px" />
- <col width="90px" />
- <col width="100px" />
- <col width="10px" />
- <col width="85px" />
- <col width="100px" />
- <col width="10px" />
- <col width="70px" />
- <col width="100px" />
- </colgroup>
- <tbody>
- <tr>
- <td></td>
- <td align="right" class="searchName">BarCode</td>
- <td style="width: 600px">
- <lightning-textarea
- class="inputFont"
- name="BarCode"
- label=""
- onchange={handleChange}
- ></lightning-textarea>
- </td>
- <td align="right"></td>
- <td></td>
- <td style="width: 200px">
- <button
- style="margin-top: 14px"
- class="slds-button slds-button_neutral slds-button_stretch lexBorder"
- label="鑾峰彇鏄庣粏"
- onclick={getDetails}
- >
- 鑾峰彇鏄庣粏
- </button>
- <!-- <lightning-button variant="brand" class='lexstyle' label="鑾峰彇鏄庣粏" title="鑾峰彇鏄庣粏" onclick={getDetails}
+ <div style="border-top: 3px solid #51606E;;border-bottom: 1px solid #D4D4D4;padding:3px;">
+ <div>
+ <!-- <p style="font-size: 18px;"><strong>鍙栨秷鎷嗙洅</strong></p> -->
+ <lightning-layout>
+ <lightning-layout-item padding="around-small">
+ <p style="font-size: 18px">
+ <strong>鍙栨秷鎷嗙洅</strong>
+ </p>
+ </lightning-layout-item>
+ </lightning-layout>
+ </div>
+ </div>
+ <div style="padding:10px;">
+ <div style="border: 1px solid #D4D4D4;border-radius:5px;margin-bottom:7px;">
+ <div style="border-top: 3px solid #51606E;border-bottom: 1px solid #D4D4D4;padding:3px;">
+ <!-- <lightning-button variant="brand" class='lexstyle' style="margin-left:10px;" label="鍙栨秷鎷嗙洅纭" title="鍙栨秷鎷嗙洅纭" onclick={saveConfirm}></lightning-button></td> -->
+ <button class="slds-button slds-button_neutral slds-button_stretch lexBorder" style="margin-left:10px;margin-top:12px;margin-bottom:12px;" label="鍙栨秷鎷嗙洅纭" onclick={saveConfirm}>鍙栨秷鎷嗙洅纭</button>
+ </div>
+ </div>
+ <div style="border: 1px solid #D4D4D4;border-radius:5px;margin-bottom:7px;margin-top:5px;">
+ <div style="border-top: 3px solid #51606E;border-bottom: 1px solid #D4D4D4;padding:3px;">
+ <lightning-layout>
+ <lightning-layout-item padding="around-small">
+ <p style="font-size: 16px">
+ <strong>BarCode褰曞叆</strong>
+ </p>
+ </lightning-layout-item>
+ </lightning-layout>
+ </div>
+
+ <!-- <div style="border-top: 3px solid #51606E;border-bottom: 1px solid #D4D4D4;padding:3px;"> -->
+ <table>
+ <colgroup>
+ <col width="160px" />
+ <col width="100px" />
+ <col width="10px" />
+ <col width="70px" />
+ <col width="100px" />
+ <col width="10px" />
+ <col width="90px" />
+ <col width="100px" />
+ <col width="10px" />
+ <col width="85px" />
+ <col width="100px" />
+ <col width="10px" />
+ <col width="70px" />
+ <col width="100px" />
+ </colgroup>
+ <tbody>
+ <tr>
+ <td></td>
+ <td align="right" class="searchName">BarCode</td>
+ <td style="width:600px"><lightning-textarea class="inputFont" name="BarCode" label=""
+ onchange={handleChange}></lightning-textarea></td>
+ <td align="right"></td>
+ <td></td>
+ <td style="width: 200px;">
+ <button style="margin-top:14px;" class="slds-button slds-button_neutral slds-button_stretch lexBorder" label="鑾峰彇鏄庣粏" onclick={getDetails}>鑾峰彇鏄庣粏</button>
+ <!-- <lightning-button variant="brand" class='lexstyle' label="鑾峰彇鏄庣粏" title="鑾峰彇鏄庣粏" onclick={getDetails}
></lightning-button> -->
- </td>
- </tr>
- </tbody>
- </table>
- <!-- </div> -->
- </div>
+ </td>
+ </tr>
+ </tbody>
+ </table>
+ <!-- </div> -->
+ </div>
- <div
- style="
- border: 1px solid #d4d4d4;
- border-radius: 5px;
- margin-bottom: 7px;
- "
- >
- <div
- style="
- border-top: 3px solid #51606e;
- border-bottom: 1px solid #d4d4d4;
- padding: 3px;
- "
- >
- <lightning-layout>
- <lightning-layout-item padding="around-small">
- <p style="font-size: 18px">
- <strong>鍙栨秷鎷嗙洅鏄庣粏</strong>
- </p>
- </lightning-layout-item>
- </lightning-layout>
- </div>
- <div style="padding: 10px">
- <!-- <div style="height: 300px;"> -->
- <!-- <template if:true={showTable}> -->
- <c-lex-custom-lightning-datatable
- key-field="prodid"
- data={data}
- columns={columns}
- onrowselection={getSelectedRows}
- hide-checkbox-column="true"
- selected-rows={selectedRows}
- class="wrapped-header-datatable"
- style="word-wrap: break-word; word-break: break-all"
- >
- </c-lex-custom-lightning-datatable>
- <!-- </template> -->
- <!-- </div> -->
- </div>
- </div>
- <div
- style="
- border: 1px solid #d4d4d4;
- border-radius: 5px;
- margin-bottom: 7px;
- margin-top: 10px;
- "
- >
- <div
- style="
- border-top: 3px solid #51606e;
- border-bottom: 1px solid #d4d4d4;
- padding: 3px;
- "
- >
- <table>
- <tr>
- <td>
- <lightning-layout>
- <lightning-layout-item
- padding="around-small"
- >
- <p style="font-size: 18px">
- <strong>閿欒鏄庣粏</strong>
- </p>
- </lightning-layout-item>
- </lightning-layout>
- </td>
- </tr>
- </table>
- </div>
+ <div style="border: 1px solid #D4D4D4;border-radius:5px;margin-bottom:7px;">
+ <div style="border-top: 3px solid #51606E;border-bottom: 1px solid #D4D4D4;padding:3px;">
+ <lightning-layout>
+ <lightning-layout-item padding="around-small">
+ <p style="font-size: 18px">
+ <strong>鍙栨秷鎷嗙洅鏄庣粏</strong>
+ </p>
+ </lightning-layout-item>
+ </lightning-layout>
+ </div>
+ <div style="padding:10px;">
- <div style="padding: 10px">
- <lightning-datatable
- key-field="id"
- data={errorDetail}
- columns={column}
- onrowselection={getSelectedRows}
- hide-checkbox-column="true"
- selected-rows={selectedRows}
- class="wrapped-header-datatable"
- style="word-wrap: break-word; word-break: break-all"
- >
- </lightning-datatable>
- </div>
- </div>
- </div>
- </div>
-</template>
+ <!-- <div style="height: 300px;"> -->
+ <!-- <template if:true={showTable}> -->
+ <c-lex-custom-lightning-datatable key-field="prodid" data={data} columns={columns}
+ onrowselection={getSelectedRows} hide-checkbox-column="true"
+ selected-rows={selectedRows} class="wrapped-header-datatable" style="word-wrap:break-word; word-break:break-all; ">
+ </c-lex-custom-lightning-datatable>
+ <!-- </template> -->
+ <!-- </div> -->
+
+ </div>
+ </div>
+ <div style="border: 1px solid #D4D4D4;border-radius:5px;margin-bottom:7px;margin-top:10px">
+ <div style="border-top: 3px solid #51606E;border-bottom: 1px solid #D4D4D4;padding:3px;">
+ <table>
+ <tr>
+ <td>
+ <lightning-layout>
+ <lightning-layout-item padding="around-small">
+ <p style="font-size: 18px">
+ <strong>閿欒鏄庣粏</strong>
+ </p>
+ </lightning-layout-item>
+ </lightning-layout>
+ </td>
+ </tr>
+ </table>
+ </div>
+
+ <div style="padding:10px;">
+ <lightning-datatable
+ key-field="id" data={errorDetail} columns={column}
+ onrowselection={getSelectedRows} hide-checkbox-column="true"
+ selected-rows={selectedRows} class="wrapped-header-datatable" style="word-wrap:break-word; word-break:break-all; ">
+ </lightning-datatable>
+
+
+ </div>
+ </div>
+ </div>
+
+
+
+ </div>
+
+</template>
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexCancelRemoveBox/lexCancelRemoveBox.js b/force-app/main/default/lwc/lexCancelRemoveBox/lexCancelRemoveBox.js
index c39556a..41e3760 100644
--- a/force-app/main/default/lwc/lexCancelRemoveBox/lexCancelRemoveBox.js
+++ b/force-app/main/default/lwc/lexCancelRemoveBox/lexCancelRemoveBox.js
@@ -1,76 +1,84 @@
import { LightningElement, wire, api, track } from 'lwc';
import { ShowToastEvent } from 'lightning/platformShowToastEvent';
-import oninit from '@salesforce/apex/LexCancelRemoveBoxController.init';
-import searchDeatail from '@salesforce/apex/LexCancelRemoveBoxController.searchConsumableorderdetails';
+import oninit from "@salesforce/apex/LexCancelRemoveBoxController.init";
+import searchDeatail from "@salesforce/apex/LexCancelRemoveBoxController.searchConsumableorderdetails"
import saveConfirm from '@salesforce/apex/LexCancelRemoveBoxController.cancelRemoveBoxConfirm';
-//table css
-import { loadStyle } from 'lightning/platformResourceLoader';
-import WrappedHeaderTable from '@salesforce/resourceUrl/lexdatatable';
+//table css
+import { loadStyle } from "lightning/platformResourceLoader";
+import WrappedHeaderTable from "@salesforce/resourceUrl/lexdatatable";
const columns = [
{
- label: '娑堣�楀搧鍚嶇О',
- fieldName: 'Name__c',
- hideDefaultActions: true,
- wrapText: true
- // initialWidth: 350,
+ label: '娑堣�楀搧鍚嶇О',
+ fieldName: 'Name__c',
+ hideDefaultActions: true,
+ wrapText:true
+ // initialWidth: 350,
+
},
{
- label: '瑙勬牸',
- fieldName: 'ProductPacking_list_manual__c',
- hideDefaultActions: true,
- cellAttributes: { alignment: 'right' },
- initialWidth: 50
+ label: '瑙勬牸',
+ fieldName: 'ProductPacking_list_manual__c',
+ hideDefaultActions: true,
+ cellAttributes: { alignment: "right" },
+ initialWidth: 50,
+
},
{
- label: 'CFDA鐘舵��',
- fieldName: 'CFDA_Status__c',
- hideDefaultActions: true,
- initialWidth: 100,
- wrapText: true
+ label: 'CFDA鐘舵��',
+ fieldName: 'CFDA_Status__c',
+ hideDefaultActions: true,
+ initialWidth: 100,
+ wrapText:true
+
},
{
- label: '娉ㄥ唽璇佺紪鐮佸彿',
- fieldName: 'Report_Product_Approbation__c',
- hideDefaultActions: true,
- initialWidth: 200,
- wrapText: true
+ label: '娉ㄥ唽璇佺紪鐮佸彿',
+ fieldName: 'Report_Product_Approbation__c',
+ hideDefaultActions: true,
+ initialWidth: 200,
+ wrapText:true
},
{
- label: '娉ㄥ唽璇佹晥鏈�',
- fieldName: 'Report_Product_Expiration__c',
- hideDefaultActions: true,
- initialWidth: 110,
- wrapText: true
+ label: '娉ㄥ唽璇佹晥鏈�',
+ fieldName: 'Report_Product_Expiration__c',
+ hideDefaultActions: true,
+ initialWidth: 110,
+ wrapText:true
},
{
- label: 'BarCode',
- fieldName: 'Bar_Code__c',
- hideDefaultActions: true,
- wrapText: true
+ label: 'BarCode',
+ fieldName: 'Bar_Code__c',
+ hideDefaultActions: true,
+ wrapText:true
}
-];
+ ];
+
+ const column = [
+ {
+ label: '娑堣�楀搧鍚嶇О',
+ fieldName: 'Name__c',
+ hideDefaultActions: true,
+ wrapText:true
+
+ },
+ {
+ label: 'BarCode',
+ fieldName: 'Bar_Code__c',
+ wrapText:true,
+ hideDefaultActions: true,
+ // initialWidth:600
-const column = [
- {
- label: '娑堣�楀搧鍚嶇О',
- fieldName: 'Name__c',
- hideDefaultActions: true,
- wrapText: true
- },
- {
- label: 'BarCode',
- fieldName: 'Bar_Code__c',
- wrapText: true,
- hideDefaultActions: true
- // initialWidth:600
- },
- {
- label: '閿欒鍘熷洜',
- fieldName: 'ErrorReason',
- hideDefaultActions: true
+
}
-];
+ ,
+ {
+ label: '閿欒鍘熷洜',
+ fieldName: 'ErrorReason',
+ hideDefaultActions: true,
+ }
+ ];
+
export default class LexCancelRemoveBox extends LightningElement {
columns = columns;
@@ -78,175 +86,164 @@
@track selectedRows = [];
@track data = [];
@track errorDetail = [];
-
+
// 鏄剧ず
- @track showTable = false;
+ @track showTable = false
@track showSpinner = false;
//鏁版嵁鏋勬垚
- @track accountName;
- @track userWorkLocation;
- @track agencyProType;
- @track barcode = '';
- @track saveFLGbln = false;
+ @track accountName
+ @track userWorkLocation
+ @track agencyProType
+ @track barcode = ''
+ @track saveFLGbln = false
@track dataSize = 0;
renderedCallback() {
- if (!this.stylesLoaded) {
- Promise.all([loadStyle(this, WrappedHeaderTable)])
- .then(() => {
- console.log('Custom styles loaded');
- this.stylesLoaded = true;
- })
- .catch((error) => {
- console.error('Error loading custom styles');
- });
- }
- }
+ if (!this.stylesLoaded) {
+ Promise.all([loadStyle(this, WrappedHeaderTable)])
+ .then(() => {
+ console.log("Custom styles loaded");
+ this.stylesLoaded = true;
+ })
+ .catch((error) => {
+ console.error("Error loading custom styles");
+ });
+ }
+ }
+
+
+
connectedCallback() {
- console.log('鍒濆鍖�');
- // this.showTable = false;
- oninit()
- .then((result) => {
- result = JSON.parse(JSON.stringify(result));
- console.log('result =' + JSON.stringify(result));
- if ((result.status = 'Success')) {
- console.log('result');
- this.agencyProType = result.entity.agencyProType;
- this.userWorkLocation = result.entity.userWorkLocation;
- this.accountName = result.entity.accountName;
- // this.data = JSON.parse(result.entity.codPageRecords);
- // this.showTable = true;
- } else {
- this.showMyToast('鍒濆鍖栧け璐�', result.msg, 'error');
- }
- })
- .catch((error) => {
- console.log('error = ' + JSON.stringify(error));
- });
+ console.log('鍒濆鍖�');
+ // this.showTable = false;
+ oninit().then((result) => {
+ result = JSON.parse(JSON.stringify(result));
+ console.log('result =' + JSON.stringify(result));
+ if (result.status = 'Success') {
+ console.log('result');
+ this.agencyProType = result.entity.agencyProType;
+ this.userWorkLocation = result.entity.userWorkLocation;
+ this.accountName = result.entity.accountName;
+ // this.data = JSON.parse(result.entity.codPageRecords);
+ // this.showTable = true;
+ } else {
+ this.showMyToast('鍒濆鍖栧け璐�',result.msg,'error');
+ }
+ }).catch((error) => {
+ console.log('error = ' + JSON.stringify(error));
+ });
}
//褰曞叆
- getDetails() {
- this.showSpinner = true;
- searchDeatail({
- accountName: this.accountName,
- userWorkLocation: this.userWorkLocation,
- agencyProType: this.agencyProType,
- barcode: this.barcode
- })
- .then((result) => {
- result = JSON.parse(JSON.stringify(result));
- console.log('result =' + JSON.stringify(result));
- if (result.status == 'Success') {
- console.log('鎴愬姛');
- this.data = JSON.parse(
- result.entity.ConsumableorderdetailsRecordsdummy
- );
- this.errorDetail = JSON.parse(
- result.entity.ConsumableorderdetailsRecordserror
- );
- this.dataSize = result.entity.dataSize;
- for (let i in this.data) {
- this.data[i]['Name__c'] = this.data[i].Prod.Name__c;
- this.data[i]['ProductPacking_list_manual__c'] =
- this.data[i].esd.ProductPacking_list_manual__c;
- this.data[i]['CFDA_Status__c'] =
- this.data[i].esd.CFDA_Status__c;
- this.data[i]['Report_Product_Approbation__c'] =
- this.data[i].esd.Report_Product_Approbation__c;
- this.data[i]['Report_Product_Expiration__c'] =
- this.data[i].esd.Report_Product_Expiration__c;
- this.data[i]['Bar_Code__c'] =
- this.data[i].esd.Bar_Code__c;
- }
- // this.showTable = true;
- for (let i in this.errorDetail) {
- this.errorDetail[i]['Name__c'] =
- this.errorDetail[i].Prod.Name__c;
- this.errorDetail[i]['Bar_Code__c'] =
- this.errorDetail[i].esd.Bar_Code__c;
- this.errorDetail[i]['ErrorReason'] =
- this.errorDetail[i].ErrorReason;
- }
- // this.showTables = true;
- this.showSpinner = false;
- } else {
- this.showMyToast('鑾峰彇澶辫触', result.msg, 'error');
- this.showSpinner = false;
- }
- })
- .catch((error) => {
- console.log('error = ' + JSON.stringify(error));
- });
- }
- //鑾峰彇褰撳墠杈撳叆鍊�
- handleChange(event) {
- let value = event.detail.value;
- console.log('value' + value);
- this.barcode = value;
- console.log('this.barcode' + this.barcode);
- }
+ getDetails() {
+ this.showSpinner = true;
+ searchDeatail({
+ accountName: this.accountName,
+ userWorkLocation: this.userWorkLocation,
+ agencyProType: this.agencyProType,
+ barcode: this.barcode
+ }).then((result) => {
+ result = JSON.parse(JSON.stringify(result));
+ console.log('result =' + JSON.stringify(result));
+ if (result.status == 'Success') {
+ console.log('鎴愬姛');
+ this.data = JSON.parse(result.entity.ConsumableorderdetailsRecordsdummy);
+ this.errorDetail = JSON.parse(result.entity.ConsumableorderdetailsRecordserror);
+ this.dataSize = result.entity.dataSize;
+ for (let i in this.data) {
+ this.data[i]['Name__c'] = this.data[i].Prod.Name__c;
+ this.data[i]['ProductPacking_list_manual__c'] = this.data[i].esd.ProductPacking_list_manual__c;
+ this.data[i]['CFDA_Status__c'] = this.data[i].esd.CFDA_Status__c;
+ this.data[i]['Report_Product_Approbation__c'] = this.data[i].esd.Report_Product_Approbation__c;
+ this.data[i]['Report_Product_Expiration__c'] = this.data[i].esd.Report_Product_Expiration__c;
+ this.data[i]['Bar_Code__c'] = this.data[i].esd.Bar_Code__c;
+ }
+ // this.showTable = true;
+ for (let i in this.errorDetail) {
+ this.errorDetail[i]['Name__c'] = this.errorDetail[i].Prod.Name__c;
+ this.errorDetail[i]['Bar_Code__c'] = this.errorDetail[i].esd.Bar_Code__c;
+ this.errorDetail[i]['ErrorReason'] = this.errorDetail[i].ErrorReason;
+ }
+ // this.showTables = true;
+ this.showSpinner = false;
+ } else{
+ this.showMyToast('鑾峰彇澶辫触',result.msg,'error');
+ this.showSpinner = false;
+ }
+ }).catch((error) => {
+ console.log('error = ' + JSON.stringify(error));
+ });
- saveConfirm() {
- let msg = '纭鍙栨秷鎷嗙洅鍚�';
- if (this.dataSize > 0) {
- if (confirm(msg) == true) {
- this.CancelRemoveBox();
- }
- } else {
+ }
+ //鑾峰彇褰撳墠杈撳叆鍊�
+ handleChange(event) {
+ let value = event.detail.value;
+ console.log('value' + value);
+ this.barcode = value;
+ console.log('this.barcode' + this.barcode);
+ }
+
+
+ saveConfirm() {
+ let msg = "纭鍙栨秷鎷嗙洅鍚�";
+ if (this.dataSize>0) {
+ if (confirm(msg) == true) {
this.CancelRemoveBox();
}
+ } else {
+ this.CancelRemoveBox();
}
- CancelRemoveBox() {
- this.showSpinner = true;
- saveConfirm({
- saveConsumableorderdetailsRecordsdummy: JSON.stringify(this.data),
- accountName: this.accountName,
- userWorkLocation: this.userWorkLocation,
- agencyProType: this.agencyProType
- })
- .then((result) => {
- result = JSON.parse(JSON.stringify(result));
- console.log('result淇濆瓨 = ' + JSON.stringify(result));
- if (result.status == 'Success') {
- this.saveFLGbln = result.entity.saveFLGbln;
- // this.showSpinner = false;
- if (this.saveFLGbln) {
- this.showMyToast(result.msg, '', 'success');
- this.showSpinner = false;
- }
- } else {
- this.showMyToast('鍙栨秷鎷嗙洅澶辫触', result.msg, 'error');
- this.showSpinner = false;
- }
- })
- .catch((error) => {
- console.log('error = ' + JSON.stringify(error));
- });
+ }
+ CancelRemoveBox(){
+ this.showSpinner = true;
+ saveConfirm({
+ saveConsumableorderdetailsRecordsdummy: JSON.stringify(this.data),
+ accountName: this.accountName,
+ userWorkLocation: this.userWorkLocation,
+ agencyProType: this.agencyProType
+ }).then((result) => {
+ result = JSON.parse(JSON.stringify(result));
+ console.log('result淇濆瓨 = ' + JSON.stringify(result));
+ if (result.status == 'Success') {
+ this.saveFLGbln = result.entity.saveFLGbln;
+ // this.showSpinner = false;
+ if(this.saveFLGbln){
+ this.showMyToast(result.msg,'','success');
+ this.showSpinner = false;
+
+
+ }
+ } else {
+ this.showMyToast('鍙栨秷鎷嗙洅澶辫触',result.msg,'error');
+ this.showSpinner = false;
+ }
+ })
+ .catch((error) => {
+ console.log('error = ' + JSON.stringify(error));
+ });
+
+ }
+ showMyToast(title, message, variant) {
+ console.log('show custom message');
+ var iconName = '';
+ var content = '';
+ if(variant == 'success'){
+ iconName = 'utility:check';
+ }else{
+ iconName = 'utility:error';
}
- showMyToast(title, message, variant) {
- console.log('show custom message');
- var iconName = '';
- var content = '';
- if (variant == 'success') {
- iconName = 'utility:check';
- } else {
- iconName = 'utility:error';
- }
- if (message != '') {
- content =
- '<h2><strong>' +
- title +
- '<strong/></h2><h5>' +
- message +
- '</h5>';
- } else {
- content = '<h2><strong>' + title + '<strong/></h2>';
- }
- this.template
- .querySelector('c-common-toast')
- .showToast(variant, content, iconName, 10000);
+ if(message != ''){
+ content = '<h2><strong>'+title+'<strong/></h2><h5>'+message+'</h5>';
+ }else{
+ content = '<h2><strong>'+title+'<strong/></h2>';
}
-}
+ this.template.querySelector('c-common-toast').showToast(variant,content,iconName,10000);
+ }
+
+
+
+
+
+}
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexConInvoiceView/lexConInvoiceView.css b/force-app/main/default/lwc/lexConInvoiceView/lexConInvoiceView.css
index 117f53d..f6deee2 100644
--- a/force-app/main/default/lwc/lexConInvoiceView/lexConInvoiceView.css
+++ b/force-app/main/default/lwc/lexConInvoiceView/lexConInvoiceView.css
@@ -1,13 +1,13 @@
@import 'c/lexCssUtility';
.outerBorderCss {
- border: 1px solid #d4d4d4;
+ border: 1px solid #D4D4D4;
border-radius: 5px;
border-top: 3px solid #565959;
}
.borderCss {
- border: 1px solid #d4d4d4;
+ border: 1px solid #D4D4D4;
border-radius: 5px;
margin-bottom: 7px;
border-top: 3px solid #565959;
@@ -15,7 +15,7 @@
.headerDorderCss {
border-top: 1px solid #565959;
- border-bottom: 1px solid #d4d4d4;
+ border-bottom: 1px solid #D4D4D4;
padding: 3px;
}
@@ -40,11 +40,11 @@
--lwc-inputStaticFontSize: 16px;
--lwc-formLabelFontSize: 16px;
}
-.fontWeight {
- font-size: 16px;
+.fontWeight{
+ font-size:16px;
}
.fileUpload {
font-size: 16px;
- --lwc-formLabelFontSize: 16px;
-}
+ --lwc-formLabelFontSize:16px;
+}
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexConInvoiceView/lexConInvoiceView.html b/force-app/main/default/lwc/lexConInvoiceView/lexConInvoiceView.html
index 60c6cad..9430247 100644
--- a/force-app/main/default/lwc/lexConInvoiceView/lexConInvoiceView.html
+++ b/force-app/main/default/lwc/lexConInvoiceView/lexConInvoiceView.html
@@ -1377,4 +1377,4 @@
</div>
</div>
</template>
-</template>
+</template>
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexConInvoiceView/lexConInvoiceView.js b/force-app/main/default/lwc/lexConInvoiceView/lexConInvoiceView.js
index 7a4f259..2cbbf36 100644
--- a/force-app/main/default/lwc/lexConInvoiceView/lexConInvoiceView.js
+++ b/force-app/main/default/lwc/lexConInvoiceView/lexConInvoiceView.js
@@ -2174,4 +2174,4 @@
this.showMyToast('閿欒', error.message, 'Error');
});
}
-}
+}
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexConsumable/lexConsumable.html b/force-app/main/default/lwc/lexConsumable/lexConsumable.html
index f65c915..9ecb2d7 100644
--- a/force-app/main/default/lwc/lexConsumable/lexConsumable.html
+++ b/force-app/main/default/lwc/lexConsumable/lexConsumable.html
@@ -681,6 +681,7 @@
onfirst={goFirstPage}
onlast={goLastPage}
page-size-options={pageSizeOptions}
+ default-page-size={pageSize}
previous-button-disabled={previousButtonDisabled}
next-button-disabled={nextButtonDisabled}
record-start={recordStart}
@@ -707,6 +708,7 @@
onfirst={goFirstPage}
onlast={goLastPage}
page-size-options={pageSizeOptions}
+ default-page-size={pageSize}
previous-button-disabled={previousButtonDisabled}
next-button-disabled={nextButtonDisabled}
record-start={recordStart}
@@ -1097,4 +1099,4 @@
<div class="slds-backdrop slds-backdrop_open"></div>
</template>
</template>
-</template>
+</template>
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexConsumable/lexConsumable.js b/force-app/main/default/lwc/lexConsumable/lexConsumable.js
index dfde990..5a006be 100644
--- a/force-app/main/default/lwc/lexConsumable/lexConsumable.js
+++ b/force-app/main/default/lwc/lexConsumable/lexConsumable.js
@@ -85,9 +85,9 @@
@track sortedBy;
//鍒嗛〉
@track currentPage = 1;
- @track pageSize = 10;
+ @track pageSize = 200;
// @track totalPage = 0;
- @track pageSizeOptions = [10, 25, 50, 100];
+ @track pageSizeOptions = [100, 200,300];
@track recordStart = 0;
@track recordEnd = 0;
//鎶ラ敊鎻愰啋
@@ -1775,4 +1775,4 @@
get nextButtonDisabled() {
return this.currentPage == this.totalPage;
}
-}
+}
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexConsumableAccount/lexConsumableAccount.html b/force-app/main/default/lwc/lexConsumableAccount/lexConsumableAccount.html
index b1101b4..61fd499 100644
--- a/force-app/main/default/lwc/lexConsumableAccount/lexConsumableAccount.html
+++ b/force-app/main/default/lwc/lexConsumableAccount/lexConsumableAccount.html
@@ -155,6 +155,7 @@
onfirst={handleFirst}
onlast={handleLast}
page-size-options={pageSizeOptions}
+ default-page-size={pageSize}
previous-button-disabled={previousButtonDisabled}
next-button-disabled={nextButtonDisabled}
record-start={recordStart}
@@ -558,4 +559,4 @@
</div>
</div>
</template>
-</template>
+</template>
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexConsumableAccount/lexConsumableAccount.js b/force-app/main/default/lwc/lexConsumableAccount/lexConsumableAccount.js
index a81d360..270892f 100644
--- a/force-app/main/default/lwc/lexConsumableAccount/lexConsumableAccount.js
+++ b/force-app/main/default/lwc/lexConsumableAccount/lexConsumableAccount.js
@@ -228,7 +228,7 @@
//鍒嗛〉start
@track sortBy = '';
- @track pageSize = 10;
+ @track pageSize = 200;
error;
records;
currentPageToken = 0;
@@ -238,7 +238,7 @@
@track pageNumber = 1;
@track paginationVisibility = false;
@track totalPages = 1;
- pageSizeOptions = [10, 25, 50, 100];
+ pageSizeOptions = [100, 200, 300];
@track recordStart = 0;
@track recordEnd = 0;
//end
@@ -361,7 +361,7 @@
: r.entity.obj.Parent.Name;
console.log(
'this.accountDataInfo = ' +
- JSON.stringify(this.accountDataInfo)
+ JSON.stringify(this.accountDataInfo)
);
this.printUrl =
'/lexconsumableaccountinfoprint?AccId=' +
@@ -397,7 +397,7 @@
this.recordEnd = r.entity.paginatedAccounts.recordEnd;
this.totalPages = Math.ceil(
r.entity.paginatedAccounts.totalRecords /
- this.pageSize
+ this.pageSize
);
console.log('this.totalPages = ' + this.totalPages);
this.paginationVisibility =
@@ -432,12 +432,12 @@
}
console.log(
'this.listViewOptions = ' +
- JSON.stringify(this.listViewOptions)
+ JSON.stringify(this.listViewOptions)
);
console.log(
'r.entity.topInfo = ' +
- JSON.stringify(r.entity.topInfo)
+ JSON.stringify(r.entity.topInfo)
);
//top10瀹㈡埛
this.topInfo = r.entity.topInfo;
@@ -447,13 +447,13 @@
this.topAccountData = this.topInfo.acList;
console.log(
'this.topAccountData = ' +
- JSON.stringify(this.topAccountData)
+ JSON.stringify(this.topAccountData)
);
console.log(
'9/3 = ' +
- this.keepTwoDecimalStr(
- this.amend(9, 3, '/').toFixed(2)
- )
+ this.keepTwoDecimalStr(
+ this.amend(9, 3, '/').toFixed(2)
+ )
);
let total = 100;
try {
@@ -485,15 +485,7 @@
) * 100
).toFixed(2)
);
- console.log(
- 'this.amend = ' +
- this.amend(
- this.topInfo.deList[i],
- this.topInfo.saleAmount,
- '/'
- ) *
- 100
- );
+ console.log('this.amend = ' + this.amend(this.topInfo.deList[i],this.topInfo.saleAmount,'/') * 100);
total -= number;
this.topAccountData[i]['proportion'] =
number + '%';
@@ -501,25 +493,17 @@
console.log(
'this.topAccountData = ' +
- JSON.stringify(this.topAccountData)
+ JSON.stringify(this.topAccountData)
);
//鍏朵粬
- console.log(
- '(total.toFixed(2) > 0.00 ? total.toFixed(2) : 0.00) = ' +
- (total.toFixed(2) > 0.0
- ? total.toFixed(2)
- : '0.00')
- );
+ console.log('(total.toFixed(2) > 0.00 ? total.toFixed(2) : 0.00) = ' + (total.toFixed(2) > 0.00 ? total.toFixed(2) : '0.00'))
if (total != 100) {
this.topAccountData.push({
accountName: '...',
accountUrl: '/s/lexconsumableaccount',
isDisable: true,
- proportion:
- (total.toFixed(2) > 0.0
- ? total.toFixed(2)
- : '0.00') + '%',
+ proportion: (total.toFixed(2) > 0.00 ? total.toFixed(2) : '0.00') + '%',
CityMasterName: '...',
CityMasterNameUrl: '/lexconsumableaccount',
Town__c: '...',
@@ -645,7 +629,7 @@
this.topAccountData = this.topInfo.acList;
console.log(
'this.topAccountData = ' +
- JSON.stringify(this.topAccountData)
+ JSON.stringify(this.topAccountData)
);
let total = 100;
for (var i in this.topAccountData) {
@@ -686,10 +670,7 @@
accountName: '...',
accountUrl: '/s/lexconsumableaccount',
isDisable: true,
- proportion:
- (total.toFixed(2) > 0.0
- ? total.toFixed(2)
- : '0.00') + '%',
+ proportion: (total.toFixed(2) > 0.00 ? total.toFixed(2) : '0.00') + '%',
CityMasterName: '...',
CityMasterNameUrl: '/lexconsumableaccount',
Town__c: '...',
@@ -807,11 +788,11 @@
sortByMethod(field, reverse, primer) {
const key = primer
? function (x) {
- return primer(x[field]);
- }
+ return primer(x[field]);
+ }
: function (x) {
- return x[field];
- };
+ return x[field];
+ };
return function (a, b) {
a = key(a);
@@ -821,7 +802,7 @@
}
onHandleSort(event) {
- console.log('event.detail.fieldName = ' + event.detail.fieldName);
+ console.log('event.detail.fieldName = ' + event.detail.fieldName)
this.sortBy = event.detail.fieldName;
switch (this.sortBy) {
case 'NameUrl':
@@ -883,4 +864,4 @@
get nextButtonDisabled() {
return this.nextPageToken === undefined;
}
-}
+}
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexConsumableOrderManage/lexConsumableOrderManage.html b/force-app/main/default/lwc/lexConsumableOrderManage/lexConsumableOrderManage.html
index f04a522..03feeaa 100644
--- a/force-app/main/default/lwc/lexConsumableOrderManage/lexConsumableOrderManage.html
+++ b/force-app/main/default/lwc/lexConsumableOrderManage/lexConsumableOrderManage.html
@@ -2,10 +2,7 @@
<template if:true={showSpinner}>
<!-- <lightning-spinner size="medium" variant="brand"></lightning-spinner> -->
<div class="slds-spinner_container">
- <div
- role="status"
- class="slds-spinner slds-spinner_medium slds-spinner_brand"
- >
+ <div role="status" class="slds-spinner slds-spinner_medium slds-spinner_brand">
<span class="slds-assistive-text">Loading</span>
<div class="slds-spinner__dot-a"></div>
<div class="slds-spinner__dot-b"></div>
@@ -14,53 +11,23 @@
</template>
<c-common-toast></c-common-toast>
<template if:true={showPage}>
- <div
- style="
- border: 1px solid #d4d4d4;
- border-top: 3px solid #51606e;
- border-radius: 5px;
- "
- >
- <div style="padding: 10px">
+ <div style="border: 1px solid #D4D4D4;border-top: 3px solid #51606E;border-radius:5px;">
+ <div style="padding:10px;">
<!-- 鎸夐挳 -->
<!-- <lightning-button style="margin: 5px;" label="鍗忚璁㈣揣" onclick={agreementorder}></lightning-button> -->
- <button
- class="slds-button slds-button_neutral slds-button_stretch lexBorder"
- style="margin-right: 150px"
- onclick={agreementorder}
- >
- 鍗忚璁㈣揣
- </button>
+ <button class="slds-button slds-button_neutral slds-button_stretch lexBorder" style="margin-right: 150px;" onclick={agreementorder}>鍗忚璁㈣揣</button>
<template if:true={showHop}>
<!-- <lightning-button style="margin: 5px;" label="鍖婚櫌鐗逛环" onclick={hospitalorder}></lightning-button> -->
- <button
- class="slds-button slds-button_neutral slds-button_stretch lexBorder"
- style="margin-right: 150px"
- onclick={hospitalorder}
- >
- 鍖婚櫌鐗逛环
- </button>
+ <button class="slds-button slds-button_neutral slds-button_stretch lexBorder" style="margin-right: 150px;" onclick={hospitalorder}>鍖婚櫌鐗逛环</button>
</template>
<template if:true={hasSpecial}>
<!-- <lightning-button style="margin: 5px;" label="淇冮攢璁㈣揣" onclick={promotionorder}></lightning-button> -->
- <button
- class="slds-button slds-button_neutral slds-button_stretch lexBorder"
- onclick={promotionorder}
- >
- 淇冮攢璁㈣揣
- </button>
+ <button class="slds-button slds-button_neutral slds-button_stretch lexBorder" onclick={promotionorder}>淇冮攢璁㈣揣</button>
</template>
- <p style="height: 10px"></p>
+ <p style="height: 10px;"></p>
<!-- 鎼滅储 -->
- <div
- style="
- border: 1px solid #d4d4d4;
- border-top: 3px solid #51606e;
- border-radius: 5px;
- margin-bottom: 7px;
- "
- >
- <div style="border-bottom: 1px solid #d4d4d4; padding: 3px">
+ <div style="border: 1px solid #D4D4D4;border-top: 3px solid #51606E;border-radius:5px;margin-bottom:7px;">
+ <div style="border-bottom: 1px solid #D4D4D4;padding:3px;">
<lightning-layout>
<lightning-layout-item padding="around-small">
<p style="font-size: 18px">
@@ -70,103 +37,42 @@
</lightning-layout>
<!-- <p style="font-size: 16px;"><strong>妫�绱㈡潯浠�</strong></p> -->
</div>
- <div style="padding: 10px">
+ <div style="padding:10px;">
<table>
<tbody>
<tr>
- <td style="width: 10px"></td>
- <td style="width: 122px">
- <div
- style="
- color: #696969;
- font-size: 16px;
- "
- >
- 娑堣�楀搧璁㈠崟鍚嶇О
- </div>
+ <td style="width:10px;"></td>
+ <td style="width:122px;">
+ <div style="color:#696969;font-size:16px;">娑堣�楀搧璁㈠崟鍚嶇О</div>
</td>
- <td>
- <lightning-input
- class="inputFont"
- type="text"
- label="娑堣�楀搧璁㈠崟鍚嶇О"
- value={category1}
- variant="label-hidden"
- onchange={category1Change}
- ></lightning-input>
+ <td >
+ <lightning-input class="inputFont" type="text" label="娑堣�楀搧璁㈠崟鍚嶇О" value={category1} variant="label-hidden" onchange={category1Change}></lightning-input>
</td>
- <td style="width: 30px"></td>
- <td style="width: 74px">
- <div
- style="
- color: #696969;
- font-size: 16px;
- "
- >
- 璁㈠崟鏃ユ湡
- </div>
+ <td style="width:30px;"></td>
+ <td style="width: 74px;">
+ <div style="color:#696969;font-size:16px;">璁㈠崟鏃ユ湡</div>
</td>
- <td>
- <lightning-input
- class="inputFont"
- type="date"
- name="orderDate"
- value={orderDate}
- label="璁㈠崟鏃ユ湡"
- variant="label-hidden"
- onchange={orderDateChange}
- ></lightning-input>
+ <td >
+ <lightning-input class="inputFont" type="date" name="orderDate" value={orderDate} label="璁㈠崟鏃ユ湡" variant="label-hidden" onchange={orderDateChange}></lightning-input>
</td>
- <td style="width: 30px"></td>
- <td style="width: 74px">
- <div
- style="
- color: #696969;
- font-size: 16px;
- "
- >
- 璁㈠崟鐘舵��
- </div>
+ <td style="width:30px;"></td>
+ <td style="width: 74px;">
+ <div style="color:#696969;font-size:16px;">璁㈠崟鐘舵��</div>
</td>
- <td style="width: 250px">
- <lightning-combobox
- class="inputFont"
- name="orderStatus"
- label="璁㈠崟鐘舵��"
- value={orderStatus}
- placeholder="璇烽�夋嫨..."
- options={provinceOpts}
- variant="label-hidden"
- onchange={orderStatusChange}
- ></lightning-combobox>
+ <td style="width: 250px;">
+ <lightning-combobox class="inputFont" name="orderStatus" label="璁㈠崟鐘舵��" value={orderStatus} placeholder="璇烽�夋嫨..." options={provinceOpts} variant="label-hidden" onchange={orderStatusChange}></lightning-combobox>
</td>
</tr>
</tbody>
</table>
- <p style="height: 10px"></p>
+ <p style="height:10px;"></p>
<table>
<tbody>
<tr>
<td></td>
- <td style="width: 325px">
- <button
- class="slds-button slds-button_neutral slds-button_stretch lexsearchStyle"
- style="
- margin-right: 20px;
- height: 32px;
- width: 150px;
- "
- onclick={searchProduct}
- >
- 鎼滅储
- </button>
- <button
- class="slds-button slds-button_neutral slds-button_stretch lexclearStyle"
- style="height: 32px; width: 150px"
- onclick={clear}
- >
- 娓呯┖
- </button>
+ <td style="width:325px;">
+ <button class="slds-button slds-button_neutral slds-button_stretch lexsearchStyle" style="margin-right: 20px;height:32px;width: 150px;" onclick={searchProduct}>鎼滅储</button>
+ <button class="slds-button slds-button_neutral slds-button_stretch lexclearStyle" style="height:32px;width: 150px;" onclick={clear}>娓呯┖</button>
</td>
</tr>
</tbody>
@@ -174,15 +80,8 @@
</div>
</div>
<!-- 璁㈣揣鏄庣粏 -->
- <div
- style="
- border: 1px solid #d4d4d4;
- border-top: 3px solid #51606e;
- border-radius: 5px;
- margin-bottom: 7px;
- "
- >
- <div style="border-bottom: 1px solid #d4d4d4; padding: 3px">
+ <div style="border: 1px solid #D4D4D4;border-top: 3px solid #51606E;border-radius:5px;margin-bottom:7px;">
+ <div style="border-bottom: 1px solid #D4D4D4;padding:3px;">
<lightning-layout>
<lightning-layout-item padding="around-small">
<p style="font-size: 18px">
@@ -192,19 +91,13 @@
</lightning-layout>
<!-- <p style="font-size: 16px;"><strong>璁㈣揣鏄庣粏</strong></p> -->
</div>
- <div style="padding: 10px">
+ <div style="padding:10px;">
<div class="table-container">
- <lightning-datatable
- class="wrapped-header-datatable"
- key-field="id"
- hide-checkbox-column="true"
- data={raesList}
- columns={cols}
- ></lightning-datatable>
+ <lightning-datatable class="wrapped-header-datatable" key-field="id" hide-checkbox-column="true" data={raesList} columns={cols}></lightning-datatable>
</div>
</div>
</div>
</div>
</div>
</template>
-</template>
+</template>
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexCssUtility/lexCssUtility.css b/force-app/main/default/lwc/lexCssUtility/lexCssUtility.css
index cca1121..bf67af1 100644
--- a/force-app/main/default/lwc/lexCssUtility/lexCssUtility.css
+++ b/force-app/main/default/lwc/lexCssUtility/lexCssUtility.css
@@ -1,80 +1,84 @@
/* .lexstyle{ */
-/* font-size: 13px;
+ /* font-size: 13px;
width: 80% !important;
/* width:50px; */
-/* --sds-c-button-text-color:red; */
-/* 鑳屾櫙棰滆壊 */
-/* --slds-c-button-brand-color-background:rgb(8,16,132); */
-/* 瀛椾綋棰滆壊 */
-/* --slds-c-button-brand-text-color:#FFFFFF; */
-/* --slds-c-button-brand-text-color-hover:#ccc; */
+ /* --sds-c-button-text-color:red; */
+ /* 鑳屾櫙棰滆壊 */
+ /* --slds-c-button-brand-color-background:rgb(8,16,132); */
+ /* 瀛椾綋棰滆壊 */
+ /* --slds-c-button-brand-text-color:#FFFFFF; */
+ /* --slds-c-button-brand-text-color-hover:#ccc; */
/* } */
+
/* button杈规 */
-.lexBorder {
+.lexBorder{
font-size: 18px;
font-family: 'sans-serif';
- font-weight: 500;
- color: #0a81df;
+ font-weight:500;
+ color:#0A81DF;
/* border:2px solid rgb(8,16,132); */
/* border-color:rgb(8,16,132); */
width: 160px;
height: 36px;
border-radius: 4px;
opacity: 1;
- background: #ffffff;
+ background: #FFFFFF;
box-sizing: border-box;
- border: 1px solid #0a81df;
+ border:1px solid #0A81DF;
}
-.lexsearchStyle {
+.lexsearchStyle{
font-size: 18px;
font-family: 'sans-serif';
- font-weight: 500;
+ font-weight:500;
width: 160px;
height: 36px;
border-radius: 4px;
opacity: 1;
- background: #090f84;
- color: #ffffff;
+ background:#090F84;
+ color:#FFFFFF;
}
-.lexclearStyle {
+.lexclearStyle{
font-size: 18px;
font-family: 'sans-serif';
- font-weight: 500;
+ font-weight:500;
width: 160px;
height: 36px;
border-radius: 4px;
opacity: 1;
- background: #ffffff;
- border: 1px solid #4d4d4d;
- color: #333333;
+ background: #FFFFFF;
+ border:1px solid #4d4d4d;
+ color:#333333;
+
}
+
/* button杈规 */
-.lexBorderWidth {
+.lexBorderWidth{
font-size: 18px;
font-family: 'sans-serif';
- font-weight: 500;
- color: #0a81df;
+ font-weight:500;
+ color:#0A81DF;;
/* border:2px solid rgb(8,16,132); */
/* border-color:rgb(8,16,132); */
width: 200px;
height: 36px;
border-radius: 4px;
opacity: 1;
- background: #ffffff;
+ background: #FFFFFF;
box-sizing: border-box;
border-style: rgb(212, 212, 212);
}
+
/* button璺濈 */
-.buttonMarginLeft {
- margin-left: 150px;
+.buttonMarginLeft{
+ margin-left:150px;
}
/* button鐭窛绂� */
-.buttonminMarginLeft {
- margin-left: 50px;
+.buttonminMarginLeft{
+ margin-left:50px;
}
*:disabled {
@@ -83,34 +87,36 @@
}
/* 搴撳瓨鐩樼偣鍙樺寲鏄庣粏 */
-.changeDetail {
- width: 250px;
- height: 36px;
+.changeDetail{
+ width:250px;
+ height:36px;
font-size: 18px;
font-family: 'sans-serif';
- font-weight: 500;
- color: #0a81df;
+ font-weight:500;
+ color:#0A81DF;;
border-radius: 4px;
opacity: 1;
- background: #ffffff;
+ background: #FFFFFF;
box-sizing: border-box;
border-style: rgb(212, 212, 212);
}
/* 妫�绱㈡潯浠跺瓧浣� */
-.searchName {
+.searchName{
font-size: 16px;
font-family: 'sans-serif';
- font-weight: 500;
+ font-weight:500;
+
}
+
/* input 瀛椾綋澶у皬 by Link */
.inputFont {
font-size: 14px;
- --lwc-fontSize2: 14px;
+ --lwc-fontSize2:14px;
}
/* spinner_container By Link */
-.slds-spinner_container {
- position: fixed;
+.slds-spinner_container{
+ position:fixed;
top: 123px;
-}
+}
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexCustomDiffReasonComp/lexCustomDiffReasonComp.html b/force-app/main/default/lwc/lexCustomDiffReasonComp/lexCustomDiffReasonComp.html
index b40f598..bed3e16 100644
--- a/force-app/main/default/lwc/lexCustomDiffReasonComp/lexCustomDiffReasonComp.html
+++ b/force-app/main/default/lwc/lexCustomDiffReasonComp/lexCustomDiffReasonComp.html
@@ -1,10 +1,10 @@
<template>
<lightning-input
- style="width: 90%"
- variant="label-hidden"
- type="text"
- value={DiffReason}
- onblur={diffReasonBlur}
- >
+ style="width:90%;"
+ variant="label-hidden"
+ type='text'
+ value = {DiffReason}
+ onblur={diffReasonBlur}>
+
</lightning-input>
-</template>
+</template>
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexCustomInventoryColor/lexCustomInventoryColor.html b/force-app/main/default/lwc/lexCustomInventoryColor/lexCustomInventoryColor.html
index 0f067e2..4407559 100644
--- a/force-app/main/default/lwc/lexCustomInventoryColor/lexCustomInventoryColor.html
+++ b/force-app/main/default/lwc/lexCustomInventoryColor/lexCustomInventoryColor.html
@@ -1,55 +1,20 @@
<template>
<template if:true={showNormal}>
<div
- style="
- margin-left: 10px;
- margin-right: 10px;
- margin-top: 10px;
- margin-bottom: 10px;
- font-size: 14px;
- text-align: right;
- padding-right: 10px;
- "
- >
- <lightning-formatted-number
- value={value}
- ></lightning-formatted-number>
+ style="margin-left: 10px;margin-right: 10px;margin-top: 10px;margin-bottom: 10px;font-size:14px;text-align: right;padding-right:10px;">
+ <lightning-formatted-number value={value}></lightning-formatted-number>
</div>
</template>
<template if:true={showRed}>
<div
- style="
- margin-left: 10px;
- margin-right: 10px;
- margin-top: 10px;
- margin-bottom: 10px;
- font-size: 14px;
- background-color: red;
- text-align: right;
- padding-right: 10px;
- "
- >
- <lightning-formatted-number
- value={value}
- ></lightning-formatted-number>
+ style="margin-left: 10px;margin-right: 10px;margin-top: 10px;margin-bottom: 10px;font-size:14px;background-color:red;text-align: right;padding-right:10px;">
+ <lightning-formatted-number value={value}></lightning-formatted-number>
</div>
</template>
<template if:true={showYellow}>
<div
- style="
- margin-left: 10px;
- margin-right: 10px;
- margin-top: 10px;
- margin-bottom: 10px;
- font-size: 14px;
- background-color: yellow;
- text-align: right;
- padding-right: 10px;
- "
- >
- <lightning-formatted-number
- value={value}
- ></lightning-formatted-number>
+ style="margin-left: 10px;margin-right: 10px;margin-top: 10px;margin-bottom: 10px;font-size:14px;background-color:yellow;text-align: right;padding-right:10px;">
+ <lightning-formatted-number value={value}></lightning-formatted-number>
</div>
</template>
-</template>
+</template>
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexCustomLightningDatatable/customMyDrCheckBox.html b/force-app/main/default/lwc/lexCustomLightningDatatable/customMyDrCheckBox.html
index 7346a5a..3a93338 100644
--- a/force-app/main/default/lwc/lexCustomLightningDatatable/customMyDrCheckBox.html
+++ b/force-app/main/default/lwc/lexCustomLightningDatatable/customMyDrCheckBox.html
@@ -7,4 +7,4 @@
onunitchange={handleDataChange}
>
</c-custom-mydr-comp>
-</template>
+</template>
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexCustomLightningDatatable/customShipmentNumber.html b/force-app/main/default/lwc/lexCustomLightningDatatable/customShipmentNumber.html
index c5bd77d..af207b0 100644
--- a/force-app/main/default/lwc/lexCustomLightningDatatable/customShipmentNumber.html
+++ b/force-app/main/default/lwc/lexCustomLightningDatatable/customShipmentNumber.html
@@ -1,10 +1,11 @@
<template>
<c-custom-shipment-number-comp
- style="border-color: red"
- record-id={typeAttributes.recordId}
- shipment-number={typeAttributes.shipmentNumber}
- is-coninvoice={typeAttributes.isConinvoice}
- esd-invoice-pro-not-count={typeAttributes.esdInvoiceProNotCount}
+ style="border-color: red;"
+ record-id={typeAttributes.recordId}
+ shipment-number={typeAttributes.shipmentNumber}
+ is-coninvoice={typeAttributes.isConinvoice}
+ esd-invoice-pro-not-count={typeAttributes.esdInvoiceProNotCount}
>
+
</c-custom-shipment-number-comp>
-</template>
+</template>
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexCustomLightningDatatable/customaccountUrl.html b/force-app/main/default/lwc/lexCustomLightningDatatable/customaccountUrl.html
index a19561d..be4620f 100644
--- a/force-app/main/default/lwc/lexCustomLightningDatatable/customaccountUrl.html
+++ b/force-app/main/default/lwc/lexCustomLightningDatatable/customaccountUrl.html
@@ -7,4 +7,4 @@
is-disable={typeAttributes.isDisable}
>
</c-custom-account-url-comp>
-</template>
+</template>
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexCustomLightningDatatable/customdeleteReason.html b/force-app/main/default/lwc/lexCustomLightningDatatable/customdeleteReason.html
index c9b0bc3..667aeb4 100644
--- a/force-app/main/default/lwc/lexCustomLightningDatatable/customdeleteReason.html
+++ b/force-app/main/default/lwc/lexCustomLightningDatatable/customdeleteReason.html
@@ -1,6 +1,8 @@
<!-- sldsValidatorIgnore -->
<!-- sldsValidatorIgnore -->
<template>
- <c-custom-delete-reason-comp record-id={typeAttributes.recordId}>
+ <c-custom-delete-reason-comp
+ record-id={typeAttributes.recordId}
+ >
</c-custom-delete-reason-comp>
-</template>
+</template>
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexCustomLightningDatatable/lexCustomLightningDatatable.js b/force-app/main/default/lwc/lexCustomLightningDatatable/lexCustomLightningDatatable.js
index 405d6bf..1f46c88 100644
--- a/force-app/main/default/lwc/lexCustomLightningDatatable/lexCustomLightningDatatable.js
+++ b/force-app/main/default/lwc/lexCustomLightningDatatable/lexCustomLightningDatatable.js
@@ -16,104 +16,84 @@
import customMyDrCheckBoxTemplate from './customMyDrCheckBox.html';
import customdeleteReasonTemplate from './customdeleteReason.html';
import customAccountUrlTemplate from './customaccountUrl.html';
-import { loadStyle } from 'lightning/platformResourceLoader';
+import { loadStyle} from 'lightning/platformResourceLoader';
import LexCustomDataTable from '@salesforce/resourceUrl/LexCustomDataTable';
export default class LexCustomLightningDatatable extends LightningDatatable {
static customTypes = {
customUnit: {
template: customUnitTemplate,
- typeAttributes: [
- 'unitValue',
- 'unitOptions',
- 'recordId',
- 'isDisabled'
- ]
+ typeAttributes: ['unitValue','unitOptions','recordId','isDisabled'],
},
customShipment: {
template: customShipmentNumberTemplate,
- typeAttributes: [
- 'shipmentNumber',
- 'recordId',
- 'isConinvoice',
- 'esdInvoiceProNotCount'
- ]
+ typeAttributes: ['shipmentNumber','recordId','isConinvoice','esdInvoiceProNotCount'],
},
customShipmentUnitPrice: {
template: customShippingUnitPriceTemplate,
- typeAttributes: ['shippingUnitPrice', 'recordId']
+ typeAttributes: ['shippingUnitPrice','recordId'],
},
customShipmentAmount: {
template: customShipmentAmountTemplate,
- typeAttributes: ['shipmentAmount', 'recordId']
+ typeAttributes: ['shipmentAmount','recordId'],
},
- customDiffReason: {
+ customDiffReason : {
template: customDiffReasonTemplate,
- typeAttributes: ['ProdId', 'boxPiece']
+ typeAttributes: ['ProdId','boxPiece'],
},
customAttachmentType: {
template: attachmentTypeTemplate,
- typeAttributes: [
- 'typeValue',
- 'typeOptions',
- 'recordId',
- 'isDisabledAttachment'
- ]
+ typeAttributes: ['typeValue','typeOptions','recordId','isDisabledAttachment'],
},
customTableInput: {
template: customTableInputTemplate,
- typeAttributes: [
- 'inputValue',
- 'recordId',
- 'valueType',
- 'upperLimit',
- 'lowerLimit',
- 'allnumber'
- ]
+ typeAttributes:['inputValue','recordId','valueType','upperLimit','lowerLimit','allnumber'],
},
- customOutputGood: {
+ customOutputGood:{
template: customOutputGoodsTemplate,
- typeAttributes: ['outputValue', 'type', 'recordId']
+ typeAttributes:['outputValue','type','recordId'],
},
- customReturnGoodInput: {
+ customReturnGoodInput:{
template: customReturnGoodInputTemplate,
- typeAttributes: ['inputValue', 'boxPrice', 'recordId']
+ typeAttributes:['inputValue','boxPrice','recordId'],
},
- customInventoryColor: {
+ customInventoryColor:{
template: customInventoryColorTemplate,
- typeAttributes: ['value', 'upperlimit', 'lowerlimit', 'boxPrice']
+ typeAttributes:['value','upperlimit','lowerlimit','boxPrice'],
},
- tableCellIcon: {
+ tableCellIcon:{
template: customTableCellIconTemplate,
- typeAttributes: ['iconName', 'recordId']
+ typeAttributes:['iconName','recordId'],
},
- outboundCount: {
+ outboundCount:{
template: customOutboundCountTemplate,
- typeAttributes: ['isDisable', 'recordId', 'Count']
+ typeAttributes:['isDisable','recordId','Count'],
},
- weeklyReport: {
+ weeklyReport:{
template: customWeeklyReportTemplate,
- typeAttributes: ['recordId', 'hospitalName', 'isShowButton']
+ typeAttributes:['recordId','hospitalName','isShowButton'],
},
- agencyOppInput: {
+ agencyOppInput:{
template: customAgencyOppInputTemplate,
- typeAttributes: ['inputValue', 'recordId', 'fieldName', 'showType']
+ typeAttributes:['inputValue','recordId','fieldName','showType'],
},
- MyDrCheckBox: {
+ MyDrCheckBox:{
template: customMyDrCheckBoxTemplate,
- typeAttributes: ['recordId', 'isCheckedMyDr']
+ typeAttributes:['recordId','isCheckedMyDr'],
},
- deleteReason: {
+ deleteReason:{
template: customdeleteReasonTemplate,
- typeAttributes: ['recordId']
+ typeAttributes:['recordId'],
},
- customShowAccountUrl: {
+ customShowAccountUrl:{
template: customAccountUrlTemplate,
- typeAttributes: ['accountName', 'accountUrl', 'isDisable']
+ typeAttributes:['accountName','accountUrl','isDisable'],
}
};
constructor() {
super();
- Promise.all([loadStyle(this, LexCustomDataTable)]).then(() => {});
+ Promise.all([
+ loadStyle(this, LexCustomDataTable),
+ ]).then(() => {})
}
-}
+}
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexInventory/lexInventory.css b/force-app/main/default/lwc/lexInventory/lexInventory.css
index 8e1f462..64cc184 100644
--- a/force-app/main/default/lwc/lexInventory/lexInventory.css
+++ b/force-app/main/default/lwc/lexInventory/lexInventory.css
@@ -7,10 +7,10 @@
.accordionClass2 {
font-weight: normal;
}
-.count {
- --slds-c-button-brand-color-background: rgb(8, 16, 132);
- /* 瀛椾綋棰滆壊 */
- --slds-c-button-brand-text-color: #ffffff;
+.count{
+ --slds-c-button-brand-color-background:rgb(8,16,132);
+ /* 瀛椾綋棰滆壊 */
+ --slds-c-button-brand-text-color:#FFFFFF;
}
:host {
--lwc-inputStaticFontSize: 16px;
@@ -18,10 +18,10 @@
}
/* .spinner-container{
position: fixed; */
-/* width:100%;
+ /* width:100%;
height:90%; */
-/* top: 90%; */
-/* left: 100%;
- transform: translate(-50%, -50%); */
-/* z-index: 9999;
-} */
+ /* top: 90%; */
+ /* left: 100%;
+ transform: translate(-50%, -50%); */
+ /* z-index: 9999;
+} */
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexInventory/lexInventory.html b/force-app/main/default/lwc/lexInventory/lexInventory.html
index 77f620f..2ba1e4e 100644
--- a/force-app/main/default/lwc/lexInventory/lexInventory.html
+++ b/force-app/main/default/lwc/lexInventory/lexInventory.html
@@ -2,10 +2,7 @@
<template if:true={showSpinner}>
<!-- <lightning-spinner class="spinner-container" size="medium" variant="brand"></lightning-spinner> -->
<div class="slds-spinner_container">
- <div
- role="status"
- class="slds-spinner slds-spinner_medium slds-spinner_brand"
- >
+ <div role="status" class="slds-spinner slds-spinner_medium slds-spinner_brand">
<span class="slds-assistive-text">Loading</span>
<div class="slds-spinner__dot-a"></div>
<div class="slds-spinner__dot-b"></div>
@@ -14,46 +11,20 @@
</template>
<c-common-toast></c-common-toast>
<template if:true={showcount}>
- <div style="border: 1px solid #d4d4d4; border-radius: 5px">
- <div
- style="
- border-top: 3px solid #51606e;
- border-bottom: 1px solid #d4d4d4;
- padding: 3px;
- "
- >
- <div style="margin: 12px">
- <p style="font-size: 18px; float: left">
- <strong>搴撳瓨鐩樼偣</strong>
- </p>
+ <div style="border: 1px solid #D4D4D4;border-radius:5px;">
+ <div style="border-top: 3px solid #51606E;;border-bottom: 1px solid #D4D4D4;padding:3px;">
+ <div style="margin:12px;">
+ <p style="font-size: 18px;float:left"><strong>搴撳瓨鐩樼偣</strong></p>
</div>
- <div style="margin-left: 400px; margin-bottom: 12px">
+ <div style="margin-left:400px;margin-bottom:12px;">
<!-- <lightning-button class = 'lexstyle' label="鐩樼偣纭" title="鐩樼偣纭" onclick={saveConfirm}></lightning-button> -->
- <button
- class="slds-button slds-button_neutral slds-button_stretch lexBorder"
- label="鐩樼偣纭"
- onclick={saveConfirm}
- >
- 鐩樼偣纭
- </button>
+ <button class="slds-button slds-button_neutral slds-button_stretch lexBorder" label="鐩樼偣纭" onclick={saveConfirm}>鐩樼偣纭</button>
</div>
</div>
- <div style="padding: 10px">
- <div
- style="
- border: 1px solid #d4d4d4;
- border-radius: 5px;
- margin-bottom: 7px;
- "
- >
- <div
- style="
- border-top: 3px solid #51606e;
- border-bottom: 1px solid #d4d4d4;
- padding: 3px;
- "
- >
+ <div style="padding:10px;">
+ <div style="border: 1px solid #D4D4D4;border-radius:5px;margin-bottom:7px;">
+ <div style="border-top: 3px solid #51606E;border-bottom: 1px solid #D4D4D4;padding:3px;">
<table>
<colgroup>
<col width="160px" />
@@ -74,28 +45,13 @@
<tbody>
<tr>
<td></td>
- <td align="right" class="searchName">
- BarCode
- </td>
- <td style="width: 600px">
- <lightning-textarea
- class="inputFont"
- name="BarCode"
- label=""
- onchange={handleChange}
- ></lightning-textarea>
- </td>
+ <td align="right" class="searchName">BarCode</td>
+ <td style="width:600px"><lightning-textarea class="inputFont" name="BarCode" label=""
+ onchange={handleChange}></lightning-textarea></td>
<td align="right"></td>
<td></td>
- <td style="width: 200px">
- <button
- style="margin-top: 14px"
- class="slds-button slds-button_neutral slds-button_stretch lexBorder"
- label="鑾峰彇鏄庣粏"
- onclick={barcodeEntrys}
- >
- 鑾峰彇鏄庣粏
- </button>
+ <td style="width:200px">
+ <button style="margin-top:14px;" class="slds-button slds-button_neutral slds-button_stretch lexBorder" label="鑾峰彇鏄庣粏" onclick={barcodeEntrys}>鑾峰彇鏄庣粏</button>
<!-- <lightning-button class = 'lexstyle' label="BarCode褰曞叆" title="BarCode褰曞叆"
onclick={barcodeEntrys} style="width: 300px;"></lightning-button> -->
</td>
@@ -105,20 +61,8 @@
</div>
</div>
- <div
- style="
- border: 1px solid #d4d4d4;
- border-radius: 5px;
- margin-bottom: 7px;
- "
- >
- <div
- style="
- border-top: 3px solid #51606e;
- border-bottom: 1px solid #d4d4d4;
- padding: 3px;
- "
- >
+ <div style="border: 1px solid #D4D4D4;border-radius:5px;margin-bottom:7px;">
+ <div style="border-top: 3px solid #51606E;border-bottom: 1px solid #D4D4D4;padding:3px;">
<!-- <p style="font-size: 16px;"><strong>鍦ㄥ簱鍟嗗搧搴撳瓨涓�瑙�</strong></p> -->
<lightning-layout>
<lightning-layout-item padding="around-small">
@@ -128,222 +72,122 @@
</lightning-layout-item>
</lightning-layout>
</div>
- <div style="padding: 10px">
- <div style="height: 300px">
+ <div style="padding:10px;">
+
+ <div style="height: 300px;">
<template if:true={showTable}>
- <c-lex-custom-lightning-datatable
- key-field="key"
- data={data}
- columns={columns}
- ondiffreasons={diffreasons}
- onrowselection={getSelectedRows}
- selected-rows={selectedRows}
- class="wrapped-header-datatable"
- >
+ <c-lex-custom-lightning-datatable key-field="key" data={data} columns={columns}
+ ondiffreasons={diffreasons} onrowselection={getSelectedRows}
+ selected-rows={selectedRows} class="wrapped-header-datatable">
</c-lex-custom-lightning-datatable>
</template>
+
+
</div>
+
</div>
</div>
- <div
- style="
- border: 1px solid #d4d4d4;
- border-radius: 5px;
- margin-bottom: 7px;
- "
- >
- <div
- style="
- border-top: 3px solid #51606e;
- border-bottom: 1px solid #d4d4d4;
- padding: 3px;
- "
- >
+ <div style="border: 1px solid #D4D4D4;border-radius:5px;margin-bottom:7px;">
+ <div style="border-top: 3px solid #51606E;border-bottom: 1px solid #D4D4D4;padding:3px;">
<table>
<tr>
<td>
<!-- <p style="font-size: 16px;"><strong>璋冩暣鏄庣粏</strong></p> -->
<lightning-layout>
- <lightning-layout-item
- padding="around-small"
- >
+ <lightning-layout-item padding="around-small">
<p style="font-size: 18px">
<strong>璋冩暣鏄庣粏</strong>
</p>
</lightning-layout-item>
</lightning-layout>
+
</td>
<template if:true={showbutton}>
- <td align="center">
+ <td align="center">
<!-- <lightning-button variant="brand" class='count' label="涓嬭浇鏈鐩樼偣搴撳瓨鍙樺寲鏄庣粏" title="涓嬭浇鏈鐩樼偣搴撳瓨鍙樺寲鏄庣粏"
onclick={exportData} style="width: 150px;"></lightning-button> -->
- <button
- class="slds-button slds-button_neutral slds-button_stretch changeDetail"
- label="涓嬭浇鏈鐩樼偣搴撳瓨鍙樺寲鏄庣粏"
- onclick={exportData}
- >
- 涓嬭浇鏈鐩樼偣搴撳瓨鍙樺寲鏄庣粏
- </button>
- </td>
+ <button class="slds-button slds-button_neutral slds-button_stretch changeDetail" label="涓嬭浇鏈鐩樼偣搴撳瓨鍙樺寲鏄庣粏" onclick={exportData}>涓嬭浇鏈鐩樼偣搴撳瓨鍙樺寲鏄庣粏</button>
+ </td>
</template>
</tr>
</table>
</div>
<!-- <template if:true={showTable}> -->
- <div style="padding: 10px">
- <lightning-datatable
- key-field="id"
- data={pageCodeRecords}
- columns={column}
- hide-checkbox-column={hidecheckbox}
- class="wrapped-header-datatable"
- style="word-wrap: break-word; word-break: break-all"
- >
+ <div style="padding:10px;">
+ <lightning-datatable key-field="id" data={pageCodeRecords} columns={column}
+ hide-checkbox-column={hidecheckbox} class="wrapped-header-datatable" style="word-wrap:break-word; word-break:break-all; ">
</lightning-datatable>
- <c-paginator
- onprevious={handlePrevious}
- onnext={handleNext}
- onpageschange={handlePageschange}
- onfirst={handleFirst}
- onlast={handleLast}
- page-size-options={pageSizeOptions}
- previous-button-disabled={previousButtonDisabled}
- next-button-disabled={nextButtonDisabled}
- record-start={recordStart}
- record-end={recordEnd}
- total-records={totalRecords}
- ></c-paginator>
+ <c-paginator onprevious={handlePrevious} onnext={handleNext} onpageschange={handlePageschange}
+ onfirst={handleFirst} onlast={handleLast} page-size-options={pageSizeOptions} default-page-size={pageSize}
+ previous-button-disabled={previousButtonDisabled} next-button-disabled={nextButtonDisabled}
+ record-start={recordStart} record-end={recordEnd}
+ total-records={totalRecords}></c-paginator>
</div>
<!-- </template> -->
</div>
</div>
+
+
</div>
</template>
+
<template if:true={EditAble}>
- <div style="border: 1px solid #d4d4d4; border-radius: 5px">
- <div
- style="
- border-top: 3px solid #51606e;
- border-bottom: 1px solid #d4d4d4;
- padding: 3px;
- "
- >
- <div style="border: 1px solid #d4d4d4; border-radius: 5px">
- <div
- style="
- border-top: 3px solid #51606e;
- border-bottom: 1px solid #d4d4d4;
- padding: 6px;
- "
- >
- <p style="font-size: 19px">
- <strong>鐩樼偣鎯呭喌涓�瑙�</strong>
- </p>
+ <div style="border: 1px solid #D4D4D4;border-radius:5px;">
+ <div style="border-top: 3px solid #51606E;;border-bottom: 1px solid #D4D4D4;padding:3px;">
+ <div style="border: 1px solid #D4D4D4;border-radius:5px;">
+ <div style="border-top: 3px solid #51606E;;border-bottom: 1px solid #D4D4D4;padding:6px;">
+ <p style="font-size: 19px;"><strong>鐩樼偣鎯呭喌涓�瑙�</strong></p>
</div>
<div class="acc-container">
- <lightning-record-edit-form
- object-api-name="Consumable_order__c"
- record-id={conId}
- onload={handleLoad2}
- class="hideHelpText"
- >
- <div
- class="slds-modal__content slds-p-around_medium"
- id="modal-content-id-1"
- >
+ <lightning-record-edit-form object-api-name="Consumable_order__c" record-id={conId}
+ onload={handleLoad2} class="hideHelpText">
+ <div class="slds-modal__content slds-p-around_medium" id="modal-content-id-1">
<div class="slds-grid">
<div class="slds-col slds-size_1-of-2">
- <lightning-output-field
- field-name="Name"
- class="hehe-layoutItem"
- style="padding-left: 20px"
- ></lightning-output-field>
+ <lightning-output-field field-name="Name"
+ class="hehe-layoutItem" style="padding-left:20px;"></lightning-output-field>
</div>
<div class="slds-col slds-size_1-of-2">
- <lightning-output-field
- field-name="Inventory_date__c"
- class="hehe-layoutItem"
- ></lightning-output-field>
+ <lightning-output-field field-name="Inventory_date__c"
+ class="hehe-layoutItem"></lightning-output-field>
</div>
</div>
</div>
</lightning-record-edit-form>
</div>
</div>
- <div
- style="
- border: 1px solid #d4d4d4;
- border-radius: 5px;
- margin-top: 10px;
- "
- >
- <div
- style="
- border-top: 3px solid #51606e;
- border-bottom: 1px solid #d4d4d4;
- padding: 6px;
- "
- >
- <lightning-accordion
- allow-multiple-sections-open
- class="slds-m-around_medium"
- active-section-name={activeSections}
- >
- <lightning-accordion-section
- name="dataExpand"
- label="鐩樼偣鏄庣粏"
- class="accordionClass"
- >
- <lightning-datatable
- key-field="id"
- data={detailData}
- columns={dcolumns}
+ <div style="border: 1px solid #D4D4D4;border-radius:5px;margin-top:10px">
+ <div style="border-top: 3px solid #51606E;;border-bottom: 1px solid #D4D4D4;padding:6px;">
+ <lightning-accordion allow-multiple-sections-open class="slds-m-around_medium"
+ active-section-name={activeSections}>
+ <lightning-accordion-section name="dataExpand" label="鐩樼偣鏄庣粏" class="accordionClass">
+ <lightning-datatable key-field="id" data={detailData} columns={dcolumns}
hide-checkbox-column={hidecheckbox}
- class="wrapped-header-datatable accordionClass2"
- >
+ class="wrapped-header-datatable accordionClass2">
</lightning-datatable>
</lightning-accordion-section>
</lightning-accordion>
+
+
</div>
</div>
- <div
- style="
- border: 1px solid #d4d4d4;
- border-radius: 5px;
- margin-top: 10px;
- "
- >
- <div
- style="
- border-top: 3px solid #51606e;
- border-bottom: 1px solid #d4d4d4;
- padding: 6px;
- "
- >
- <lightning-accordion
- allow-multiple-sections-open
- class="slds-m-around_medium"
- active-section-name={activeSections}
- >
- <lightning-accordion-section
- name="dataExpand"
- label="鍦ㄥ簱璋冩暣鏄庣粏"
- class="accordionClass"
- >
- <lightning-datatable
- key-field="id"
- data={adjustdata}
- columns={stockadjustcolumns}
+ <div style="border: 1px solid #D4D4D4;border-radius:5px;margin-top:10px">
+ <div style="border-top: 3px solid #51606E;;border-bottom: 1px solid #D4D4D4;padding:6px;">
+ <lightning-accordion allow-multiple-sections-open class="slds-m-around_medium"
+ active-section-name={activeSections}>
+ <lightning-accordion-section name="dataExpand" label="鍦ㄥ簱璋冩暣鏄庣粏" class="accordionClass">
+ <lightning-datatable key-field="id" data={adjustdata} columns={stockadjustcolumns}
hide-checkbox-column={hidecheckbox}
- class="wrapped-header-datatable accordionClass2"
- >
+ class="wrapped-header-datatable accordionClass2">
</lightning-datatable>
</lightning-accordion-section>
</lightning-accordion>
+
</div>
</div>
</div>
</div>
+
</template>
-</template>
+</template>
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexInventory/lexInventory.js b/force-app/main/default/lwc/lexInventory/lexInventory.js
index ac48985..fc96ac2 100644
--- a/force-app/main/default/lwc/lexInventory/lexInventory.js
+++ b/force-app/main/default/lwc/lexInventory/lexInventory.js
@@ -1,853 +1,765 @@
-import { LightningElement, wire, api, track } from 'lwc';
-import oninit from '@salesforce/apex/LexInventoryController.init';
+import { LightningElement, wire, api, track } from "lwc";
+import oninit from "@salesforce/apex/LexInventoryController.init";
// import sheetjs from '@salesforce/resourceUrl/sheetjs';
-import barcodeEntry from '@salesforce/apex/LexInventoryController.searchConsumableorderdetails';
-import save from '@salesforce/apex/LexInventoryController.save';
-import datainit from '@salesforce/apex/LexInventoryListController.init';
-import { ShowToastEvent } from 'lightning/platformShowToastEvent';
-import { NavigationMixin } from 'lightning/navigation';
+import barcodeEntry from "@salesforce/apex/LexInventoryController.searchConsumableorderdetails";
+import save from "@salesforce/apex/LexInventoryController.save";
+import datainit from "@salesforce/apex/LexInventoryListController.init";
+import { ShowToastEvent } from "lightning/platformShowToastEvent";
+import { NavigationMixin } from "lightning/navigation";
-//table css
-import { loadStyle } from 'lightning/platformResourceLoader';
-import WrappedHeaderTable from '@salesforce/resourceUrl/lexdatatable';
+//table css
+import { loadStyle } from "lightning/platformResourceLoader";
+import WrappedHeaderTable from "@salesforce/resourceUrl/lexdatatable";
//搴撳瓨鐩樼偣涓婚〉闈㈡暟鎹�
const columns = [
- {
- label: '鏄惁鐩樼偣',
- fieldName: 'iscount',
- hideDefaultActions: true,
- initialWidth: 80
- },
- {
- label: '娑堣�楀搧鍚嶇О',
- fieldName: 'Name__c',
- hideDefaultActions: true,
- // initialWidth: 400,
- wrapText: true
- },
- {
- label: '瑙勬牸',
- initialWidth: 50,
- fieldName: 'Packing_list_manual__c',
- cellAttributes: { alignment: 'right' },
- hideDefaultActions: true
- },
- {
- label: '鍗曚綅',
- fieldName: 'boxPiece',
- initialWidth: 50,
- hideDefaultActions: true
- },
- {
- label: '鏈夋晥鏈熷唴搴撳瓨',
- fieldName: 'limitCount',
- initialWidth: 120,
- hideDefaultActions: true,
- cellAttributes: { alignment: 'right' }
- },
+ {
+ label: "鏄惁鐩樼偣",
+ fieldName: "iscount",
+ hideDefaultActions: true,
+ initialWidth: 80,
+
+ },
+ {
+ label: "娑堣�楀搧鍚嶇О",
+ fieldName: "Name__c",
+ hideDefaultActions: true,
+ // initialWidth: 400,
+ wrapText:true
+
+ },
+ {
+ label: "瑙勬牸",
+ initialWidth: 50,
+ fieldName: "Packing_list_manual__c",
+ cellAttributes: { alignment: "right" },
+ hideDefaultActions: true,
+
+
+ },
+ {
+ label: "鍗曚綅",
+ fieldName: "boxPiece",
+ initialWidth: 50,
+ hideDefaultActions: true,
+
+
+ },
+ {
+ label: "鏈夋晥鏈熷唴搴撳瓨",
+ fieldName: "limitCount",
+ initialWidth: 120,
+ hideDefaultActions: true,
+ cellAttributes: { alignment: "right" },
+ },
- {
- label: '杩囨湡搴撳瓨',
- initialWidth: 100,
- fieldName: 'overlimitCount',
- hideDefaultActions: true,
- cellAttributes: { alignment: 'right' }
- },
- {
- label: '鐩樼偣',
- initialWidth: 50,
- fieldName: 'Pandian',
- hideDefaultActions: true,
- cellAttributes: { alignment: 'right' }
- },
- {
- label: '涓㈠け',
- initialWidth: 50,
- fieldName: 'Diff',
- hideDefaultActions: true,
- cellAttributes: { alignment: 'right' }
- },
- {
- label: '瀵诲洖',
- initialWidth: 50,
- fieldName: 'refind',
- hideDefaultActions: true,
- cellAttributes: { alignment: 'right' }
- },
- {
- label: '宸紓鍘熷洜',
- // fieldName: "DiffReason",
- initialWidth: 200,
- hideDefaultActions: true,
- type: 'customDiffReason',
- typeAttributes: {
- DiffReason: { fieldName: 'DiffReason' },
- ProdId: { fieldName: 'ProdId' },
- boxPiece: { fieldName: 'boxPiece' }
- }
- }
+ {
+ label: "杩囨湡搴撳瓨",
+ initialWidth: 100,
+ fieldName: "overlimitCount",
+ hideDefaultActions: true,
+ cellAttributes: { alignment: "right" },
+
+
+ },
+ {
+ label: "鐩樼偣",
+ initialWidth: 50,
+ fieldName: "Pandian",
+ hideDefaultActions: true,
+ cellAttributes: { alignment: "right" },
+
+
+ },
+ {
+ label: "涓㈠け",
+ initialWidth: 50,
+ fieldName: "Diff",
+ hideDefaultActions: true,
+ cellAttributes: { alignment: "right" },
+
+
+ },
+ {
+ label: "瀵诲洖",
+ initialWidth: 50,
+ fieldName: "refind",
+ hideDefaultActions: true,
+ cellAttributes: { alignment: "right" },
+
+
+ },
+ {
+ label: "宸紓鍘熷洜",
+ // fieldName: "DiffReason",
+ initialWidth: 200,
+ hideDefaultActions: true,
+ type: "customDiffReason",
+ typeAttributes: {
+ DiffReason: { fieldName: "DiffReason" },
+ ProdId: { fieldName: "ProdId" },
+ boxPiece: { fieldName: "boxPiece" }
+
+ },
+
+ },
];
//璋冩暣鏄庣粏
const column = [
- {
- label: '娑堣�楀搧鍚嶇О',
- fieldName: 'Name__c',
- wrapText: true,
- hideDefaultActions: true
- // initialWidth: 550
- },
- {
- label: '鍗曚綅',
- fieldName: 'Box_Piece__c',
- hideDefaultActions: true,
- initialWidth: 50
- },
- {
- label: 'BarCode',
- fieldName: 'Bar_Code__c',
- hideDefaultActions: true,
- wrapText: true
- // initialWidth: 300,
- },
- {
- label: '璋冩暣鍘熷洜',
- fieldName: 'DiffReason',
- hideDefaultActions: true,
- wrapText: true
- // initialWidth:
- }
+ {
+ label: "娑堣�楀搧鍚嶇О",
+ fieldName: "Name__c",
+ wrapText: true,
+ hideDefaultActions: true,
+ // initialWidth: 550
+ },
+ {
+ label: "鍗曚綅",
+ fieldName: "Box_Piece__c",
+ hideDefaultActions: true,
+ initialWidth: 50,
+
+ },
+ {
+ label: "BarCode",
+ fieldName: "Bar_Code__c",
+ hideDefaultActions: true,
+ wrapText: true,
+ // initialWidth: 300,
+ },
+ {
+ label: "璋冩暣鍘熷洜",
+ fieldName: "DiffReason",
+ hideDefaultActions: true,
+ wrapText: true,
+ // initialWidth:
+
+ },
];
//鐩樼偣鏄庣粏
const dcolumns = [
- {
- label: '娑堣�楀搧鍚嶇О',
- fieldName: 'Name__c',
- hideDefaultActions: true,
- // initialWidth: 250,
- wrapText: true
- },
- {
- label: '搴撳瓨',
- fieldName: 'Count_Sum__c',
- hideDefaultActions: true,
- initialWidth: 100,
- cellAttributes: { alignment: 'right' }
- },
- {
- label: '鐩樼偣',
- fieldName: 'inventory_sum__c',
- hideDefaultActions: true,
- initialWidth: 100,
- cellAttributes: { alignment: 'right' }
- },
- {
- label: '涓㈠け',
- fieldName: 'Diff__c',
- hideDefaultActions: true,
- initialWidth: 100,
- cellAttributes: { alignment: 'right' }
- },
- {
- label: '瀵诲洖',
- fieldName: 'Product_Refind__c',
- hideDefaultActions: true,
- initialWidth: 100,
- cellAttributes: { alignment: 'right' }
- },
- {
- label: '宸紓鍘熷洜',
- fieldName: 'Lose_reason__c',
- hideDefaultActions: true
- }
+ {
+ label: "娑堣�楀搧鍚嶇О",
+ fieldName: "Name__c",
+ hideDefaultActions: true,
+ // initialWidth: 250,
+ wrapText: true,
+
+
+ },
+ {
+ label: "搴撳瓨",
+ fieldName: "Count_Sum__c",
+ hideDefaultActions: true,
+ initialWidth: 100,
+ cellAttributes: { alignment: "right" },
+
+ },
+ {
+ label: "鐩樼偣",
+ fieldName: "inventory_sum__c",
+ hideDefaultActions: true,
+ initialWidth: 100,
+ cellAttributes: { alignment: "right" },
+
+ },
+ {
+ label: "涓㈠け",
+ fieldName: "Diff__c",
+ hideDefaultActions: true,
+ initialWidth: 100,
+ cellAttributes: { alignment: "right" },
+
+ },
+ {
+ label: "瀵诲洖",
+ fieldName: "Product_Refind__c",
+ hideDefaultActions: true,
+ initialWidth: 100,
+ cellAttributes: { alignment: "right" },
+
+ },
+ {
+ label: "宸紓鍘熷洜",
+ fieldName: "Lose_reason__c",
+ hideDefaultActions: true,
+
+ },
];
//鍦ㄥ簱璋冩暣鏄庣粏
const stockadjustcolumns = [
- {
- label: '娑堣�楀搧鍚嶇О',
- fieldName: 'Name__c',
- wrapText: true,
- hideDefaultActions: true
- },
- {
- label: '浜у搧鍨嬪彿',
- fieldName: 'Asset_Model_No__c',
- hideDefaultActions: true
- },
- {
- label: '宸紓鍘熷洜',
- fieldName: 'Lose_reason__c',
- hideDefaultActions: true,
- initialWidth: 150
- },
- {
- label: '鏄惁涓㈠け',
- type: 'boolean',
- fieldName: 'Lose_Flag__c',
- hideDefaultActions: true
- }
+ {
+ label: "娑堣�楀搧鍚嶇О",
+ fieldName: "Name__c",
+ wrapText: true,
+ hideDefaultActions: true,
+
+ },
+ {
+ label: "浜у搧鍨嬪彿",
+ fieldName: "Asset_Model_No__c",
+ hideDefaultActions: true,
+
+ },
+ {
+ label: "宸紓鍘熷洜",
+ fieldName: "Lose_reason__c",
+ hideDefaultActions: true,
+ initialWidth: 150,
+
+ },
+ {
+ label: "鏄惁涓㈠け",
+ type: "boolean",
+ fieldName: "Lose_Flag__c",
+ hideDefaultActions: true,
+
+ },
];
export default class LexInventory extends NavigationMixin(LightningElement) {
- columns = columns;
- column = column;
- stockadjustcolumns = stockadjustcolumns;
- dcolumns = dcolumns;
- @track data = [];
- @track codPageRecords = [];
- @track pageCodeRecords = [];
- @track accountName;
- @track agencyProType;
- @track userWorkLocation;
- @track accountid;
- @track pandiandetailsMap;
- @track reSet;
- @track reSet1;
+ columns = columns;
+ column = column;
+ stockadjustcolumns = stockadjustcolumns;
+ dcolumns = dcolumns;
+ @track data = [];
+ @track codPageRecords = [];
+ @track pageCodeRecords = [];
+ @track accountName;
+ @track agencyProType;
+ @track userWorkLocation;
+ @track accountid
+ @track pandiandetailsMap
+ @track reSet
+ @track reSet1
- @track showTable = false;
- @track showbutton = false;
- @track barcode = '';
- @track ConsumableorderdetailsRecordsview = [];
- @track consumableorderdetailsRecords = [];
- @track showcount = true;
+ @track showTable = false;
+ @track showbutton = false;
+ @track barcode = "";
+ @track ConsumableorderdetailsRecordsview = [];
+ @track consumableorderdetailsRecords = [];
+ @track showcount = true;
- @track iSinventory = false;
- @track numberDetail;
- @track hidecheckbox = true;
- //鍒嗛〉start
- @track sortBy = '';
- @track sortDirection = 'asc';
- @track pageSize = 10;
- error;
- records;
- currentPageToken = 0;
- nextPageToken = this.pageSize;
- @track totalRecords = 0;
- @track loader = false;
- @track pageNumber = 1;
- @track paginationVisibility = false;
- @track totalPages = 1;
- pageSizeOptions = [10, 25, 50, 100];
- @track recordStart = 0;
- @track recordEnd = 0;
- //end
+ @track iSinventory = false
+ @track numberDetail;
+ @track hidecheckbox = true;
+ //鍒嗛〉start
+ @track sortBy = "";
+ @track sortDirection = "asc";
+ @track pageSize = 200;
+ error;
+ records;
+ currentPageToken = 0;
+ nextPageToken = this.pageSize;
+ @track totalRecords = 0;
+ @track loader = false;
+ @track pageNumber = 1;
+ @track paginationVisibility = false;
+ @track totalPages = 1;
+ pageSizeOptions = [100, 200, 300];
+ @track recordStart = 0;
+ @track recordEnd = 0;
+ //end
- //鍔犺浇妗�
- // @track casesSpinner = true;
- @track showSpinner = true;
- //row
- @track selectedRows = [];
- //inventoryList
- @track isSummonsFlag;
- //灞曞紑鏍�
- activeSections = ['dataExpand'];
- columnHeader = ['娑堣�楀搧鍚嶇О', '鍗曚綅', 'BarCode', '璋冩暣鍘熷洜'];
- //纭涓�瑙�
- @track eSetId = '';
- @track EditAble = false;
- @track selectedData;
- @track conId;
- @track detailData = [];
- @track adjustdata = [];
- @track detalipan = [];
+ //鍔犺浇妗�
+ // @track casesSpinner = true;
+ @track showSpinner = true;
- //瀵煎嚭csv
- xlsDataHeader = ['娑堣�楀搧鍚嶇О', '鍗曚綅', 'barCode', '璋冩暣鍘熷洜'];
+ //row
+ @track selectedRows = [];
+ //inventoryList
+ @track isSummonsFlag;
+ //灞曞紑鏍�
+ activeSections = ["dataExpand"];
+ columnHeader = ["娑堣�楀搧鍚嶇О", "鍗曚綅", "BarCode", "璋冩暣鍘熷洜"];
+ //纭涓�瑙�
+ @track eSetId = "";
+ @track EditAble = false;
+ @track selectedData;
+ @track conId;
+ @track detailData = [];
+ @track adjustdata = [];
+ @track detalipan = [];
- //鑾峰彇閾炬帴鍙傛暟
- getQueryString(name) {
- console.log('getQueryString name ' + name);
- let reg = new RegExp('(^|&)' + name + '=([^&]*)(&|$)', 'i');
- let r = window.location.search.substr(1).match(reg);
- if (r != null) {
- return decodeURIComponent(r[2]);
- }
- return null;
- }
- renderedCallback() {
+
+ //瀵煎嚭csv
+ xlsDataHeader = ['娑堣�楀搧鍚嶇О', '鍗曚綅', 'barCode', '璋冩暣鍘熷洜'];
+
+ //鑾峰彇閾炬帴鍙傛暟
+ getQueryString(name) {
+ console.log("getQueryString name " + name);
+ let reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");
+ let r = window.location.search.substr(1).match(reg);
+ if (r != null) {
+ return decodeURIComponent(r[2]);
+ }
+ return null;
+ }
+ renderedCallback() {
if (!this.stylesLoaded) {
Promise.all([loadStyle(this, WrappedHeaderTable)])
.then(() => {
- console.log('Custom styles loaded');
+ console.log("Custom styles loaded");
this.stylesLoaded = true;
})
.catch((error) => {
- console.error('Error loading custom styles');
+ console.error("Error loading custom styles");
});
}
}
- connectedCallback() {
- console.log('===>鍒濆鍖�');
- //鑾峰彇ESetid
- this.eSetId = this.getQueryString('eSetId');
- this.eSetId = this.eSetId == null ? '' : this.eSetId;
- console.log(' this.eSetId' + this.eSetId);
- if (this.eSetId == '') {
- this.EditAble = false;
- this.init();
- } else {
- this.inits();
- this.showcount = false;
- this.EditAble = true;
- }
- }
- init() {
- this.showSpinner = true;
- oninit()
- .then((result) => {
- console.log('1112' + JSON.stringify(result));
- result = JSON.parse(JSON.stringify(result));
- console.log('result.status = ' + result.status);
- console.log(
- 'ConsumableorderdetailsRecordsview= ' +
- result.entity.ConsumableorderdetailsRecordsview
- );
- this.ConsumableorderdetailsRecordsview = JSON.parse(
- result.entity.ConsumableorderdetailsRecordsview
- );
- this.consumableorderdetailsRecords =
- result.entity.consumableorderdetailsRecords;
- console.log(
- 'consumableorderdetailsRecords= ' +
- result.entity.consumableorderdetailsRecords
- );
- console.log(
- '浼犲弬绫诲瀷',
- typeof this.consumableorderdetailsRecords
- );
- if (result.status == 'Success') {
- this.data = [];
- this.data = this.ConsumableorderdetailsRecordsview[0];
- console.log('this.data ==>' + JSON.stringify(this.data));
- for (let i in this.data) {
- this.data[i]['key'] =
- this.data[i]['ProdId'] + this.data[i]['boxPiece'];
- this.data[i]['Name__c'] = this.data[i].Prod.Name__c;
- this.data[i]['Packing_list_manual__c'] =
- this.data[i].Prod.Packing_list_manual__c;
- }
- this.accountName = result.entity.accountName;
- this.agencyProType = result.entity.agencyProType;
- this.userWorkLocation = result.entity.userWorkLocation;
- this.showSpinner = false;
- this.accountid = result.entity.accountid;
- this.showTable = true;
- } else {
- this.showMyToast('鍒濆鍖栧け璐�', result.msg, 'error');
- this.showSpinner = false;
- }
- })
- .catch((error) => {
- console.log('error = ' + JSON.stringify(error));
- this.showSpinner = false;
- });
- //榛樿灞曞紑鏍�
- this.activeSections = ['dataExpand'];
- this.showTable = false;
- this.showbutton = false;
- }
+ connectedCallback() {
+ console.log("===>鍒濆鍖�");
- //褰曞叆barcode
- barcodeEntrys() {
- console.log('Test');
- this.showTable = false;
- this.showbutton = false;
- this.showSpinner = true;
+ //鑾峰彇ESetid
+ this.eSetId = this.getQueryString("eSetId");
+ this.eSetId = this.eSetId == null ? "" : this.eSetId;
+ console.log(" this.eSetId" + this.eSetId);
+ if (this.eSetId == "") {
+ this.EditAble = false;
+ this.init();
+ } else {
+ this.inits();
+ this.showcount = false;
+ this.EditAble = true;
+ }
- //鏌ヨ鏈夊摢浜涢�夋嫨浜嗙殑鐒跺悗check
- const selectedRows = this.template
- .querySelector('c-lex-custom-lightning-datatable')
- .getSelectedRows();
- console.log('selectedRows========> ' + JSON.stringify(selectedRows));
- for (var i in this.data) {
- this.data[i]['check'] = false;
- }
- for (var i in this.data) {
- for (var j in selectedRows) {
- if (
- this.data[i].ProdId + this.data[i]['boxPiece'] ==
- selectedRows[j].ProdId + selectedRows[j]['boxPiece']
- ) {
- this.data[i]['check'] = true;
- }
- // console.log('this.data[i].ProdId+this.data[i]["boxPiece"]'+this.data[i].ProdId+this.data[i]["boxPiece"]);
- console.log(
- 'selectedRows[j].ProdId+this.data[i]["boxPiece"]' +
- selectedRows[j].ProdId +
- selectedRows[j]['boxPiece']
- );
- }
- }
- // if(this.barcode == ''||this.barcode == null){
- // this.showMyToast('鑾峰彇澶辫触','璇疯緭鍏arCode鍙�','error');
+ }
+ init() {
- // }
- console.log('this.data--->' + JSON.stringify(this.data));
- console.log('this.currentPageToken' + this.currentPageToken);
- this.selectedRows = [];
- barcodeEntry({
- accountName: this.accountName,
- agencyProType: this.agencyProType,
- userWorkLocation: this.userWorkLocation,
- barcode: this.barcode,
- consumableorderdetailsRecordsLWC: JSON.stringify(this.data),
- pageSizeLWC: this.pageSize,
- pageTokenLWC: this.currentPageToken,
- sortFieldLWC: this.sortBy,
- sortOrderLWC: this.sortDirection
- })
- .then((result) => {
- result = JSON.parse(JSON.stringify(result));
- console.log('result ===>' + JSON.stringify(result));
- if (result.status == 'Success1') {
- //鍒嗛〉start
- this.nextPageToken =
- result.entity.paginatedAccounts.nextPageToken;
- this.totalRecords =
- result.entity.paginatedAccounts.totalRecords;
- this.recordStart =
- result.entity.paginatedAccounts.recordStart;
- this.recordEnd = result.entity.paginatedAccounts.recordEnd;
- this.totalPages = Math.ceil(
- result.entity.paginatedAccounts.totalRecords /
- this.pageSize
- );
- console.log('this.totalPages = ' + this.totalPages);
- this.paginationVisibility =
- this.totalPages > 1 ? true : false;
- console.log('this.sortDirection = ' + this.sortDirection);
- //鍒嗛〉end
- this.codPageRecords = JSON.parse(
- result.entity.codPageRecords
- );
- for (var i in this.codPageRecords) {
- this.codPageRecords[i]['Name__c'] =
- this.codPageRecords[i].Prod.Name__c;
- this.codPageRecords[i]['Box_Piece__c'] =
- this.codPageRecords[i].orderdetails2.Box_Piece__c;
- this.codPageRecords[i]['Bar_Code__c'] =
- this.codPageRecords[i].orderdetails2.Bar_Code__c;
- }
- this.pageCodeRecords = result.entity.pageCodeRecords;
- for (var i in this.pageCodeRecords) {
- this.pageCodeRecords[i]['Name__c'] =
- this.pageCodeRecords[i].Prod.Name__c;
- this.pageCodeRecords[i]['Box_Piece__c'] =
- this.pageCodeRecords[i].orderdetails2.Box_Piece__c;
- this.pageCodeRecords[i]['Bar_Code__c'] =
- this.pageCodeRecords[i].orderdetails2.Bar_Code__c;
- }
- this.data = JSON.parse(
- result.entity.consumableorderdetailsRecords
- );
- for (var i in this.data) {
- this.data[i]['key'] =
- this.data[i]['ProdId'] + this.data[i]['boxPiece'];
- this.data[i]['Name__c'] = this.data[i].Prod.Name__c;
- this.data[i]['Packing_list_manual__c'] =
- this.data[i].Prod.Packing_list_manual__c;
- if (this.data[i]['check']) {
- this.selectedRows.push(
- this.data[i].ProdId + this.data[i]['boxPiece']
- );
- console.log('selectedRows:' + this.selectedRows);
- }
- }
- this.iSinventory = result.entity.iSinventory;
- this.pandiandetailsMap = result.entity.pandiandetailsMap;
- this.reSet = result.entity.reSet1;
- console.log('iSinventory:' + this.iSinventory);
- this.showTable = true;
- this.showbutton = true;
- this.showSpinner = false;
- console.log('result褰曞叆= ' + JSON.stringify(result));
- } else {
- if (result.status == 'Sucess') {
- //鍒嗛〉start
- this.nextPageToken =
- result.entity.paginatedAccounts.nextPageToken;
- this.totalRecords =
- result.entity.paginatedAccounts.totalRecords;
- this.recordStart =
- result.entity.paginatedAccounts.recordStart;
- this.recordEnd =
- result.entity.paginatedAccounts.recordEnd;
- this.totalPages = Math.ceil(
- result.entity.paginatedAccounts.totalRecords /
- this.pageSize
- );
- console.log('this.totalPages = ' + this.totalPages);
- this.paginationVisibility =
- this.totalPages > 1 ? true : false;
- console.log(
- 'this.sortDirection = ' + this.sortDirection
- );
- //鍒嗛〉end
- this.codPageRecords = JSON.parse(
- result.entity.codPageRecords
- );
- for (var i in this.codPageRecords) {
- this.codPageRecords[i]['Name__c'] =
- this.codPageRecords[i].Prod.Name__c;
- this.codPageRecords[i]['Box_Piece__c'] =
- this.codPageRecords[
- i
- ].orderdetails2.Box_Piece__c;
- this.codPageRecords[i]['Bar_Code__c'] =
- this.codPageRecords[
- i
- ].orderdetails2.Bar_Code__c;
- }
- this.pageCodeRecords = result.entity.pageCodeRecords;
- for (var i in this.pageCodeRecords) {
- this.pageCodeRecords[i]['Name__c'] =
- this.pageCodeRecords[i].Prod.Name__c;
- this.pageCodeRecords[i]['Box_Piece__c'] =
- this.pageCodeRecords[
- i
- ].orderdetails2.Box_Piece__c;
- this.pageCodeRecords[i]['Bar_Code__c'] =
- this.pageCodeRecords[
- i
- ].orderdetails2.Bar_Code__c;
- }
- this.data = JSON.parse(
- result.entity.consumableorderdetailsRecords
- );
- for (var i in this.data) {
- this.data[i]['key'] =
- this.data[i]['ProdId'] +
- this.data[i]['boxPiece'];
- this.data[i]['Name__c'] = this.data[i].Prod.Name__c;
- this.data[i]['Packing_list_manual__c'] =
- this.data[i].Prod.Packing_list_manual__c;
- if (this.data[i]['check']) {
- this.selectedRows.push(
- this.data[i].ProdId +
- this.data[i]['boxPiece']
- );
- console.log(
- 'selectedRows:' + this.selectedRows
- );
- }
- }
- this.iSinventory = result.entity.iSinventory;
- this.pandiandetailsMap =
- result.entity.pandiandetailsMap;
- this.reSet = result.entity.reSet;
- console.log('iSinventory:' + this.iSinventory);
- this.showTable = true;
- this.showbutton = true;
- this.showSpinner = false;
- console.log('result褰曞叆= ' + JSON.stringify(result));
- } else {
- console.log('Error:' + result.msg);
- this.showMyToast(result.msg, '', 'error');
- this.showSpinner = false;
- this.showTable = true;
- }
- }
- })
- .catch((error) => {
- console.log('error = ' + JSON.stringify(error));
- });
- }
- //鑾峰彇褰撳墠杈撳叆鍊�
- handleChange(event) {
- let value = event.detail.value;
- console.log('value' + value);
- this.barcode = value;
- }
+ this.showSpinner = true;
+ oninit()
+ .then((result) => {
+ console.log("1112" + JSON.stringify(result));
+ result = JSON.parse(JSON.stringify(result));
+ console.log("result.status = " + result.status);
+ console.log("ConsumableorderdetailsRecordsview= " + result.entity.ConsumableorderdetailsRecordsview);
+ this.ConsumableorderdetailsRecordsview = JSON.parse(result.entity.ConsumableorderdetailsRecordsview);
+ this.consumableorderdetailsRecords = result.entity.consumableorderdetailsRecords;
+ console.log("consumableorderdetailsRecords= " + result.entity.consumableorderdetailsRecords);
+ console.log("浼犲弬绫诲瀷", typeof this.consumableorderdetailsRecords);
+ if (result.status == "Success") {
+ this.data = [];
+ this.data = this.ConsumableorderdetailsRecordsview[0];
+ console.log("this.data ==>" + JSON.stringify(this.data));
+ for (let i in this.data) {
+ this.data[i]["key"] = this.data[i]["ProdId"] + this.data[i]["boxPiece"];
+ this.data[i]["Name__c"] = this.data[i].Prod.Name__c;
+ this.data[i]["Packing_list_manual__c"] = this.data[i].Prod.Packing_list_manual__c;
+ }
+ this.accountName = result.entity.accountName;
+ this.agencyProType = result.entity.agencyProType;
+ this.userWorkLocation = result.entity.userWorkLocation;
+ this.showSpinner = false;
+ this.accountid = result.entity.accountid;
+ this.showTable = true;
+ } else {
+ this.showMyToast('鍒濆鍖栧け璐�',result.msg,'error');
+ this.showSpinner = false;
+ }
+ })
+ .catch((error) => {
+ console.log("error = " + JSON.stringify(error));
+ this.showSpinner = false;
+ });
+ //榛樿灞曞紑鏍�
+ this.activeSections = ["dataExpand"];
+ this.showTable = false;
+ this.showbutton = false;
+ }
- getSelectedRows(event) {
- let selectedRowsEvent = event.detail.selectedRows;
- this.selectedRows = [];
- for (var i in this.data) {
- for (var j in selectedRowsEvent) {
- if (
- this.data[i].ProdId + this.data[i]['boxPiece'] ==
- selectedRowsEvent[j].ProdId +
- selectedRowsEvent[j]['boxPiece']
- ) {
- this.selectedRows.push(
- selectedRowsEvent[j].ProdId + this.data[i]['boxPiece']
- );
- }
- }
- // for (var i in selectedRowsEvent) {
- // this.selectedRows.push(selectedRowsEvent[i].ProdId+this.data[i]["boxPiece"]);
- // }
- }
- }
- //瀵煎嚭涓篶sv
- exportData() {
- // Prepare a html table
- let doc = '<table>';
- // Add styles for the table
- doc += '<style>';
- doc += 'table,th,td{';
- doc += ' border: 1px solid;';
- doc += ' border-collapse: collapse;';
- doc += ' font-weight: normal;';
- doc += ' text-align: left;';
- doc += '}';
- doc += '</style>';
- // Add all the Table Headers
- doc += '<tr>';
- this.columnHeader.forEach((element) => {
- doc += '<th style="font-weight: bold";>' + element + '</th>';
- });
- doc += '</tr>';
- // Add the data rows
- this.codPageRecords.forEach((record) => {
- doc += '<tr>';
- doc += '<td>' + record.Name__c + '</td>';
- doc += '<td>' + record.Box_Piece__c + '</td>';
- doc += '<td>' + record.Bar_Code__c + '</td>';
- doc += '<td>' + record.DiffReason + '</td>';
- doc += '</tr>';
- });
- doc += '</table>';
- console.log('doc' + doc);
- var bom = '\uFEFF';
- var element =
- 'data:application/vnd.ms-excel,' + encodeURIComponent(bom + doc);
- let downloadElement = document.createElement('a');
- downloadElement.href = element;
- downloadElement.target = '_self';
- // use .csv as extension on below line if you want to export data as csv
- downloadElement.download = '鍦ㄥ簱璋冩暣涓�瑙�.xls';
- document.body.appendChild(downloadElement);
- downloadElement.click();
- }
+ //褰曞叆barcode
+ barcodeEntrys() {
+ console.log('Test');
+ this.showTable = false;
+ this.showbutton = false;
+ this.showSpinner = true;
+
+ //鏌ヨ鏈夊摢浜涢�夋嫨浜嗙殑鐒跺悗check
+ const selectedRows = this.template.querySelector('c-lex-custom-lightning-datatable').getSelectedRows();
+ console.log('selectedRows========> ' + JSON.stringify(selectedRows));
+ for (var i in this.data) {
+ this.data[i]["check"] = false;
+ }
+ for (var i in this.data) {
+ for (var j in selectedRows) {
+ if (this.data[i].ProdId+this.data[i]["boxPiece"] == selectedRows[j].ProdId+ selectedRows[j]["boxPiece"]) {
+ this.data[i]["check"] = true;
+ }
+ // console.log('this.data[i].ProdId+this.data[i]["boxPiece"]'+this.data[i].ProdId+this.data[i]["boxPiece"]);
+ console.log('selectedRows[j].ProdId+this.data[i]["boxPiece"]'+selectedRows[j].ProdId+selectedRows[j]["boxPiece"]);
- //鑷畾涔塪ataType
+ }
+ }
+ // if(this.barcode == ''||this.barcode == null){
+ // this.showMyToast('鑾峰彇澶辫触','璇疯緭鍏arCode鍙�','error');
- diffreasons(event) {
- const numberDetail = event.detail;
- // this.numberDetail = numberDetail;
- console.log('numberDetail' + JSON.stringify(numberDetail));
- for (var i in this.data) {
- console.log('this.data[i]["key"]' + this.data[i]['key']);
- console.log(
- 'numberDetail.data.ProdId+numberDetail.data.boxPiece' +
- numberDetail.data.ProdId +
- numberDetail.data.boxPiece
- );
+ // }
+ console.log('this.data--->'+JSON.stringify(this.data));
+ console.log('this.currentPageToken'+this.currentPageToken);
+ this.selectedRows = [];
+ barcodeEntry({
+ accountName: this.accountName,
+ agencyProType: this.agencyProType,
+ userWorkLocation: this.userWorkLocation,
+ barcode: this.barcode,
+ consumableorderdetailsRecordsLWC: JSON.stringify(this.data),
+ pageSizeLWC: this.pageSize,
+ pageTokenLWC: this.currentPageToken,
+ sortFieldLWC: this.sortBy,
+ sortOrderLWC: this.sortDirection
- if (
- this.data[i]['key'] ==
- numberDetail.data.ProdId + numberDetail.data.boxPiece
- ) {
- this.data[i]['DiffReason'] = numberDetail.data.DiffReason;
- }
- }
- console.log(' this.data==>' + JSON.stringify(this.data));
- }
+ })
+ .then((result) => {
+ result = JSON.parse(JSON.stringify(result));
+ console.log("result ===>" + JSON.stringify(result));
+ if (result.status == "Success1") {
+ //鍒嗛〉start
+ this.nextPageToken = result.entity.paginatedAccounts.nextPageToken;
+ this.totalRecords = result.entity.paginatedAccounts.totalRecords;
+ this.recordStart = result.entity.paginatedAccounts.recordStart;
+ this.recordEnd = result.entity.paginatedAccounts.recordEnd;
+ this.totalPages = Math.ceil(result.entity.paginatedAccounts.totalRecords / this.pageSize);
+ console.log('this.totalPages = ' + this.totalPages);
+ this.paginationVisibility = this.totalPages > 1 ? true : false;
+ console.log('this.sortDirection = ' + this.sortDirection);
+ //鍒嗛〉end
+ this.codPageRecords = JSON.parse(result.entity.codPageRecords);
+ for (var i in this.codPageRecords) {
+ this.codPageRecords[i]["Name__c"] = this.codPageRecords[i].Prod.Name__c;
+ this.codPageRecords[i]["Box_Piece__c"] = this.codPageRecords[i].orderdetails2.Box_Piece__c;
+ this.codPageRecords[i]["Bar_Code__c"] = this.codPageRecords[i].orderdetails2.Bar_Code__c;
+ }
+ this.pageCodeRecords = result.entity.pageCodeRecords;
+ for (var i in this.pageCodeRecords) {
+ this.pageCodeRecords[i]["Name__c"] = this.pageCodeRecords[i].Prod.Name__c;
+ this.pageCodeRecords[i]["Box_Piece__c"] = this.pageCodeRecords[i].orderdetails2.Box_Piece__c;
+ this.pageCodeRecords[i]["Bar_Code__c"] = this.pageCodeRecords[i].orderdetails2.Bar_Code__c;
+ }
+ this.data = JSON.parse(result.entity.consumableorderdetailsRecords);
+ for (var i in this.data) {
+ this.data[i]["key"] = this.data[i]["ProdId"] + this.data[i]["boxPiece"];
+ this.data[i]["Name__c"] = this.data[i].Prod.Name__c;
+ this.data[i]["Packing_list_manual__c"] = this.data[i].Prod.Packing_list_manual__c;
+ if (this.data[i]["check"]) {
+ this.selectedRows.push(this.data[i].ProdId + this.data[i]["boxPiece"]);
+ console.log("selectedRows:" + this.selectedRows);
+ }
+ }
+ this.iSinventory = result.entity.iSinventory;
+ this.pandiandetailsMap = result.entity.pandiandetailsMap;
+ this.reSet = result.entity.reSet1;
+ console.log("iSinventory:" + this.iSinventory);
+ this.showTable = true;
+ this.showbutton = true;
+ this.showSpinner = false;
+ console.log("result褰曞叆= " + JSON.stringify(result));
+ }
+ else {
+ if (result.status == "Sucess") {
+ //鍒嗛〉start
+ this.nextPageToken = result.entity.paginatedAccounts.nextPageToken;
+ this.totalRecords = result.entity.paginatedAccounts.totalRecords;
+ this.recordStart = result.entity.paginatedAccounts.recordStart;
+ this.recordEnd = result.entity.paginatedAccounts.recordEnd;
+ this.totalPages = Math.ceil(result.entity.paginatedAccounts.totalRecords / this.pageSize);
+ console.log('this.totalPages = ' + this.totalPages);
+ this.paginationVisibility = this.totalPages > 1 ? true : false;
+ console.log('this.sortDirection = ' + this.sortDirection);
+ //鍒嗛〉end
+ this.codPageRecords = JSON.parse(result.entity.codPageRecords);
+ for (var i in this.codPageRecords) {
+ this.codPageRecords[i]["Name__c"] = this.codPageRecords[i].Prod.Name__c;
+ this.codPageRecords[i]["Box_Piece__c"] = this.codPageRecords[i].orderdetails2.Box_Piece__c;
+ this.codPageRecords[i]["Bar_Code__c"] = this.codPageRecords[i].orderdetails2.Bar_Code__c;
+ }
+ this.pageCodeRecords = result.entity.pageCodeRecords;
+ for (var i in this.pageCodeRecords) {
+ this.pageCodeRecords[i]["Name__c"] = this.pageCodeRecords[i].Prod.Name__c;
+ this.pageCodeRecords[i]["Box_Piece__c"] = this.pageCodeRecords[i].orderdetails2.Box_Piece__c;
+ this.pageCodeRecords[i]["Bar_Code__c"] = this.pageCodeRecords[i].orderdetails2.Bar_Code__c;
+ }
+ this.data = JSON.parse(result.entity.consumableorderdetailsRecords);
+ for (var i in this.data) {
+ this.data[i]["key"] = this.data[i]["ProdId"] + this.data[i]["boxPiece"];
+ this.data[i]["Name__c"] = this.data[i].Prod.Name__c;
+ this.data[i]["Packing_list_manual__c"] = this.data[i].Prod.Packing_list_manual__c;
+ if (this.data[i]["check"]) {
+ this.selectedRows.push(this.data[i].ProdId + this.data[i]["boxPiece"]);
+ console.log("selectedRows:" + this.selectedRows);
+ }
+ }
+ this.iSinventory = result.entity.iSinventory;
+ this.pandiandetailsMap = result.entity.pandiandetailsMap;
+ this.reSet = result.entity.reSet;
+ console.log("iSinventory:" + this.iSinventory);
+ this.showTable = true;
+ this.showbutton = true;
+ this.showSpinner = false;
+ console.log("result褰曞叆= " + JSON.stringify(result));
+ } else {
+ console.log('Error:' + result.msg);
+ this.showMyToast(result.msg,'','error');
+ this.showSpinner = false;
+ this.showTable = true;
+ }
+ }
+ })
+ .catch((error) => {
+ console.log("error = " + JSON.stringify(error));
+ });
+ }
+ //鑾峰彇褰撳墠杈撳叆鍊�
+ handleChange(event) {
+ let value = event.detail.value;
+ console.log("value" + value);
+ this.barcode = value;
+ }
- saveConfirm() {
- console.log('杩涘叆鐩樼偣纭');
- console.log('reSet' + this.reSet);
- this.showSpinner = true;
- console.log('pandiandetailsMap' + this.pandiandetailsMap);
- //鏌ヨ鏈夊摢浜涢�夋嫨浜嗙殑鐒跺悗check
- const selectedRows = this.template
- .querySelector('c-lex-custom-lightning-datatable')
- .getSelectedRows();
- console.log('selectedRows========> ' + JSON.stringify(selectedRows));
- for (var i in this.data) {
- this.data[i]['check'] = false;
- }
- for (var i in this.data) {
- for (var j in selectedRows) {
- if (
- this.data[i].ProdId + this.data[i]['boxPiece'] ==
- selectedRows[j].ProdId + selectedRows[j]['boxPiece']
- ) {
- this.data[i]['check'] = true;
- }
- // console.log('this.data[i].ProdId+this.data[i]["boxPiece"]'+this.data[i].ProdId+this.data[i]["boxPiece"]);
- console.log(
- 'selectedRows[j].ProdId+this.data[i]["boxPiece"]' +
- selectedRows[j].ProdId +
- selectedRows[j]['boxPiece']
- );
- }
- }
+ getSelectedRows(event) {
+ let selectedRowsEvent = event.detail.selectedRows;
+ this.selectedRows = [];
+ for (var i in this.data) {
+ for (var j in selectedRowsEvent) {
+ if (this.data[i].ProdId+this.data[i]["boxPiece"] == selectedRowsEvent[j].ProdId+ selectedRowsEvent[j]["boxPiece"]) {
+ this.selectedRows.push(selectedRowsEvent[j].ProdId+this.data[i]["boxPiece"])
+ }
+ }
+ // for (var i in selectedRowsEvent) {
+ // this.selectedRows.push(selectedRowsEvent[i].ProdId+this.data[i]["boxPiece"]);
+ // }
+ }
+ }
+ //瀵煎嚭涓篶sv
+ exportData() {
+ // Prepare a html table
+ let doc = '<table>';
+ // Add styles for the table
+ doc += '<style>';
+ doc += 'table,th,td{';
+ doc += ' border: 1px solid;';
+ doc += ' border-collapse: collapse;';
+ doc += ' font-weight: normal;';
+ doc += ' text-align: left;';
+ doc += '}';
+ doc += '</style>';
+ // Add all the Table Headers
+ doc += '<tr>';
+ this.columnHeader.forEach(element => {
+ doc += '<th style="font-weight: bold";>' + element + '</th>'
+ });
+ doc += '</tr>';
+ // Add the data rows
+ this.codPageRecords.forEach(record => {
+ doc += '<tr>';
+ doc += '<td>' + record.Name__c + '</td>';
+ doc += '<td>' + record.Box_Piece__c + '</td>';
+ doc += '<td>' + record.Bar_Code__c + '</td>';
+ doc += '<td>' + record.DiffReason + '</td>';
+ doc += '</tr>';
+ });
+ doc += '</table>';
+ console.log('doc' + doc);
+ var bom = "\uFEFF";
+ var element = 'data:application/vnd.ms-excel,' + encodeURIComponent(bom + doc);
+ let downloadElement = document.createElement('a');
+ downloadElement.href = element;
+ downloadElement.target = '_self';
+ // use .csv as extension on below line if you want to export data as csv
+ downloadElement.download = '鍦ㄥ簱璋冩暣涓�瑙�.xls';
+ document.body.appendChild(downloadElement);
+ downloadElement.click();
+ }
- // var el = this.template.querySelector("c-lex-custom-lightning-datatable");
- // var selected = el.getSelectedRows();
- // this.selectedData = selected;
- // console.log("閫変腑鏁版嵁" + JSON.stringify(this.selectedData));
- // console.log("reset" + JSON.stringify(this.reSet));
- // console.log("reset1" + JSON.stringify(this.reSet1));
- // console.log("r" + JSON.stringify(this.reSet1));
- save({
- iSinventory: this.iSinventory,
- consumableorderdetailsRecordsLWC: JSON.stringify(this.data),
- accountid: this.accountid,
- agencyProType: this.agencyProType,
- reSet: this.reSet,
- pandiandetailsMap: this.pandiandetailsMap
- })
- .then((result) => {
- result = JSON.parse(JSON.stringify(result));
- console.log('result = ' + JSON.stringify(result));
- console.log('111111');
+ //鑷畾涔塪ataType
- if (result.status == 'Success') {
- let url = '/lexinventory?ESetid=' + result.entity.eSetId;
- this[NavigationMixin.Navigate]({
- type: 'standard__webPage',
- attributes: {
- url: url
- }
- });
- this.showSpinner = false;
- console.log('Id' + this.eSetId);
- // this.EditAble = true;
- // this.showcount = false;
- } else {
- this.showMyToast('鐩樼偣澶辫触', result.msg, 'error');
- this.showSpinner = false;
- }
- })
- .catch((error) => {
- console.log('error = ' + JSON.stringify(error));
- this.showSpinner = false;
- });
- }
+ diffreasons(event) {
+ const numberDetail = event.detail;
+ // this.numberDetail = numberDetail;
+ console.log("numberDetail" + JSON.stringify(numberDetail));
+ for (var i in this.data) {
+ console.log('this.data[i]["key"]' + this.data[i]["key"]);
+ console.log('numberDetail.data.ProdId+numberDetail.data.boxPiece' + numberDetail.data.ProdId + numberDetail.data.boxPiece);
- inits() {
- this.showSpinner = true;
- datainit({
- eSetId: this.eSetId
- })
- .then((result) => {
- result = JSON.parse(JSON.stringify(result));
- console.log('鐩樼偣涓�瑙�===>' + JSON.stringify(result));
+ if (this.data[i]["key"] == numberDetail.data.ProdId + numberDetail.data.boxPiece) {
+ this.data[i]["DiffReason"] = numberDetail.data.DiffReason;
+ }
+ }
+ console.log(" this.data==>" + JSON.stringify(this.data));
+ }
- for (var i in result.entity.qs) {
- this.conId = result.entity.qs[i].Id;
- }
- console.log('this.conId' + typeof this.conId);
- this.detailData = JSON.parse(
- result.entity.consumableorderdetailsRecords
- );
- if (result.entity.ConsumableorderdetailsRecordsError != null) {
- this.adjustdata = JSON.parse(
- result.entity.ConsumableorderdetailsRecordsError
- );
- for (let i in this.detailData) {
- this.detailData[i].Name__c =
- this.detailData[i].Prod.Name__c;
- this.detailData[i].Count_Sum__c =
- this.detailData[i].orderdetails1.Count_Sum__c;
- this.detailData[i].inventory_sum__c =
- this.detailData[i].orderdetails1.inventory_sum__c;
- this.detailData[i].Diff__c =
- this.detailData[i].orderdetails1.Diff__c;
- this.detailData[i].Product_Refind__c =
- this.detailData[i].orderdetails1.Product_Refind__c;
- this.detailData[i].Lose_reason__c =
- this.detailData[i].orderdetails1.Lose_reason__c;
- }
- for (let i in this.adjustdata) {
- this.adjustdata[i].Name__c =
- this.adjustdata[i].Prod.Name__c;
- this.adjustdata[i].Asset_Model_No__c =
- this.adjustdata[i].Prod.Asset_Model_No__c;
- this.adjustdata[i].Lose_reason__c =
- this.adjustdata[i].orderdetails2.Lose_reason__c;
- this.adjustdata[i].Lose_Flag__c =
- this.adjustdata[i].orderdetails2.Lose_Flag__c;
- }
- }
- this.showSpinner = false;
- console.log('result鐩樼偣Id' + JSON.stringify(this.conId));
- console.log('璋冩暣鏄庣粏' + JSON.stringify(this.adjustdata));
- })
- .catch((error) => {
- console.log('error = ' + JSON.stringify(error));
- this.showSpinner = false;
- });
- }
- //鍒嗛〉
- handlePrevious() {
- this.currentPageToken =
- Number(this.currentPageToken) - Number(this.pageSize);
- this.barcodeEntrys();
- }
+ saveConfirm() {
+ console.log("杩涘叆鐩樼偣纭");
+ console.log('reSet' + this.reSet);
+ this.showSpinner = true;
+ console.log('pandiandetailsMap' + this.pandiandetailsMap);
+ //鏌ヨ鏈夊摢浜涢�夋嫨浜嗙殑鐒跺悗check
+ const selectedRows = this.template.querySelector('c-lex-custom-lightning-datatable').getSelectedRows();
+ console.log('selectedRows========> ' + JSON.stringify(selectedRows));
+ for (var i in this.data) {
+ this.data[i]["check"] = false;
+ }
+ for (var i in this.data) {
+ for (var j in selectedRows) {
+ if (this.data[i].ProdId+this.data[i]["boxPiece"] == selectedRows[j].ProdId+ selectedRows[j]["boxPiece"]) {
+ this.data[i]["check"] = true;
+ }
+ // console.log('this.data[i].ProdId+this.data[i]["boxPiece"]'+this.data[i].ProdId+this.data[i]["boxPiece"]);
+ console.log('selectedRows[j].ProdId+this.data[i]["boxPiece"]'+selectedRows[j].ProdId+selectedRows[j]["boxPiece"]);
- handleNext() {
- console.log('111');
- this.currentPageToken =
- Number(this.currentPageToken) + Number(this.pageSize);
- this.barcodeEntrys();
- }
- handleFirst() {
- this.currentPageToken = 0;
- this.barcodeEntrys();
- }
+ }
+ }
- handleLast() {
- this.currentPageToken =
- this.totalPages > 1 ? (this.totalPages - 1) * this.pageSize : 0;
- this.barcodeEntrys();
- }
+ // var el = this.template.querySelector("c-lex-custom-lightning-datatable");
+ // var selected = el.getSelectedRows();
+ // this.selectedData = selected;
+ // console.log("閫変腑鏁版嵁" + JSON.stringify(this.selectedData));
+ // console.log("reset" + JSON.stringify(this.reSet));
+ // console.log("reset1" + JSON.stringify(this.reSet1));
+ // console.log("r" + JSON.stringify(this.reSet1));
- handlePageschange(event) {
- console.log(event.detail);
- this.pageSize = event.detail;
- this.currentPageToken = 0;
- this.barcodeEntrys();
- }
- get previousButtonDisabled() {
- return this.currentPageToken === 0;
- }
+ save({
+ iSinventory: this.iSinventory,
+ consumableorderdetailsRecordsLWC:JSON.stringify(this.data),
+ accountid: this.accountid,
+ agencyProType: this.agencyProType,
+ reSet: this.reSet,
+ pandiandetailsMap: this.pandiandetailsMap
+ })
+ .then((result) => {
+ result = JSON.parse(JSON.stringify(result));
+ console.log("result = " + JSON.stringify(result));
+ console.log("111111");
- get nextButtonDisabled() {
- return this.nextPageToken === undefined;
- }
+ if (result.status == "Success") {
+ let url = "/lexinventory?ESetid=" + result.entity.eSetId;
+ this[NavigationMixin.Navigate]({
+ type: "standard__webPage",
+ attributes: {
+ url: url,
+ },
+ });
+ this.showSpinner = false;
+ console.log("Id" + this.eSetId);
+ // this.EditAble = true;
+ // this.showcount = false;
+ } else {
+ this.showMyToast('鐩樼偣澶辫触',result.msg,'error');
+ this.showSpinner = false;
+ }
+ })
+ .catch((error) => {
+ console.log("error = " + JSON.stringify(error));
+ this.showSpinner = false;
+ });
+ }
- handleLoad2() {
- console.log('handleLoad2');
+ inits() {
+ this.showSpinner = true
+ datainit({
+ eSetId: this.eSetId,
+ })
+ .then((result) => {
+ result = JSON.parse(JSON.stringify(result));
+ console.log('鐩樼偣涓�瑙�===>' + JSON.stringify(result));
+
+ for (var i in result.entity.qs) {
+ this.conId = result.entity.qs[i].Id;
+ }
+ console.log("this.conId" + typeof this.conId);
+ this.detailData = JSON.parse(result.entity.consumableorderdetailsRecords);
+ if (result.entity.ConsumableorderdetailsRecordsError != null) {
+ this.adjustdata = JSON.parse(
+ result.entity.ConsumableorderdetailsRecordsError
+ );
+ for (let i in this.detailData) {
+ this.detailData[i].Name__c = this.detailData[i].Prod.Name__c;
+ this.detailData[i].Count_Sum__c = this.detailData[i].orderdetails1.Count_Sum__c;
+ this.detailData[i].inventory_sum__c = this.detailData[i].orderdetails1.inventory_sum__c;
+ this.detailData[i].Diff__c = this.detailData[i].orderdetails1.Diff__c;
+ this.detailData[i].Product_Refind__c = this.detailData[i].orderdetails1.Product_Refind__c;
+ this.detailData[i].Lose_reason__c = this.detailData[i].orderdetails1.Lose_reason__c;
+ }
+ for (let i in this.adjustdata) {
+ this.adjustdata[i].Name__c = this.adjustdata[i].Prod.Name__c;
+ this.adjustdata[i].Asset_Model_No__c = this.adjustdata[i].Prod.Asset_Model_No__c;
+ this.adjustdata[i].Lose_reason__c = this.adjustdata[i].orderdetails2.Lose_reason__c;
+ this.adjustdata[i].Lose_Flag__c = this.adjustdata[i].orderdetails2.Lose_Flag__c;
+ }
+ }
+ this.showSpinner = false;
+ console.log("result鐩樼偣Id" + JSON.stringify(this.conId));
+ console.log("璋冩暣鏄庣粏" + JSON.stringify(this.adjustdata));
+ })
+ .catch((error) => {
+ console.log("error = " + JSON.stringify(error));
+ this.showSpinner = false;
+ });
+ }
+ //鍒嗛〉
+ handlePrevious() {
+ this.currentPageToken = Number(this.currentPageToken) - Number(this.pageSize);
+ this.barcodeEntrys();
+ }
+
+ handleNext() {
+ console.log('111');
+ this.currentPageToken = Number(this.currentPageToken) + Number(this.pageSize);
+ this.barcodeEntrys();
+ }
+ handleFirst() {
+ this.currentPageToken = 0;
+ this.barcodeEntrys();
+ }
+
+ handleLast() {
+ this.currentPageToken = this.totalPages > 1 ? (this.totalPages - 1) * this.pageSize : 0;
+ this.barcodeEntrys();
+ }
+
+ handlePageschange(event) {
+ console.log(event.detail);
+ this.pageSize = event.detail;
+ this.currentPageToken = 0;
+ this.barcodeEntrys();
+ }
+ get previousButtonDisabled() {
+ return this.currentPageToken === 0;
+ }
+
+ get nextButtonDisabled() {
+ return this.nextPageToken === undefined;
+ }
+
+ handleLoad2() {
+ console.log('handleLoad2')
try {
const style2 = document.createElement('style');
- style2.innerText =
- '.hehe-layoutItem .slds-form-element__label {padding : 0px}';
+ style2.innerText = '.hehe-layoutItem .slds-form-element__label {padding : 0px}';
this.template.querySelector('.hideHelpText').appendChild(style2);
} catch (error) {
console.log(error);
}
}
- showMyToast(title, message, variant) {
+ showMyToast(title, message, variant) {
console.log('show custom message');
var iconName = '';
var content = '';
- if (variant == 'success') {
- iconName = 'utility:check';
- } else {
- iconName = 'utility:error';
+ if(variant == 'success'){
+ iconName = 'utility:check';
+ }else{
+ iconName = 'utility:error';
}
- if (message != '') {
- content =
- '<h2><strong>' +
- title +
- '<strong/></h2><h5>' +
- message +
- '</h5>';
- } else {
- content = '<h2><strong>' + title + '<strong/></h2>';
+ if(message != ''){
+ content = '<h2><strong>'+title+'<strong/></h2><h5>'+message+'</h5>';
+ }else{
+ content = '<h2><strong>'+title+'<strong/></h2>';
}
- this.template
- .querySelector('c-common-toast')
- .showToast(variant, content, iconName, 10000);
- }
-}
+ this.template.querySelector('c-common-toast').showToast(variant,content,iconName,10000);
+ }
+}
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexLookup/lexLookup.html b/force-app/main/default/lwc/lexLookup/lexLookup.html
index a251f05..0a059dd 100644
--- a/force-app/main/default/lwc/lexLookup/lexLookup.html
+++ b/force-app/main/default/lwc/lexLookup/lexLookup.html
@@ -1,139 +1,67 @@
<template>
<div class={getFormElementClass}>
<label lwc:if={label} class={getLabelClass} for="combobox">
- <abbr lwc:if={required} title="required" class="slds-required"
- >*</abbr
- >
+ <abbr lwc:if={required} title="required" class="slds-required">*</abbr>
{label}
</label>
<div class="slds-form-element__control">
<div class={getContainerClass}>
- <div
- class={getDropdownClass}
- aria-expanded={isListboxOpen}
- aria-haspopup="listbox"
- aria-owns="listbox"
- role="combobox"
- >
+ <div class={getDropdownClass} aria-expanded={isListboxOpen} aria-haspopup="listbox" aria-owns="listbox"
+ role="combobox">
<!-- Search input start -->
<div class={getComboboxClass} role="none">
<template lwc:if={isSingleEntry}>
- <lightning-icon
- icon-name={getSelectIconName}
- size="small"
- alternative-text="Selected item icon"
- class={getSelectIconClass}
- >
+ <lightning-icon icon-name={getSelectIconName} size="small"
+ alternative-text="Selected item icon" class={getSelectIconClass}>
</lightning-icon>
</template>
<!-- Text input -->
- <input
- type="text"
- class={getInputClass}
- aria-autocomplete="list"
- aria-controls="listbox"
- aria-activedescendant={_focusedResultIndex}
- autocomplete="off"
- role="textbox"
- id="combobox"
- placeholder={placeholder}
- value={getInputValue}
- title={getInputTitle}
- readonly={isInputReadonly}
- disabled={disabled}
- onfocus={handleFocus}
- onblur={handleBlur}
- oninput={handleInput}
- onkeydown={handleKeyDown}
- />
+ <input type="text" class={getInputClass} aria-autocomplete="list" aria-controls="listbox"
+ aria-activedescendant={_focusedResultIndex} autocomplete="off" role="textbox" id="combobox"
+ placeholder={placeholder} value={getInputValue} title={getInputTitle}
+ readonly={isInputReadonly} disabled={disabled} onfocus={handleFocus} onblur={handleBlur}
+ oninput={handleInput} onkeydown={handleKeyDown} />
<!-- Search icon -->
- <lightning-icon
- icon-name="utility:search"
- size="x-small"
- alternative-text="Search icon"
- class={getSearchIconClass}
- ></lightning-icon>
+ <lightning-icon icon-name="utility:search" size="x-small" alternative-text="Search icon"
+ class={getSearchIconClass}></lightning-icon>
<!-- Clear selection button icon for single entry lookups -->
<template lwc:if={isSingleEntry}>
- <button
- title="Remove selected option"
- type="button"
- onclick={handleClearSelection}
- class={getClearSelectionButtonClass}
- disabled={disabled}
- >
- <lightning-icon
- icon-name="utility:close"
- size="x-small"
+ <button title="Remove selected option" type="button" onclick={handleClearSelection}
+ class={getClearSelectionButtonClass} disabled={disabled}>
+ <lightning-icon icon-name="utility:close" size="x-small"
alternative-text="Remove selected option"
- class="slds-button__icon"
- ></lightning-icon>
+ class="slds-button__icon"></lightning-icon>
</button>
</template>
</div>
<!-- Search input end -->
<!-- Result list box start -->
- <div
- id="listbox"
- role="listbox"
- aria-label={label}
- onmousedown={handleComboboxMouseDown}
- onmouseup={handleComboboxMouseUp}
- class={getListboxClass}
- >
- <ul
- class="slds-listbox slds-listbox_vertical"
- role="presentation"
- >
+ <div id="listbox" role="listbox" aria-label={label} onmousedown={handleComboboxMouseDown}
+ onmouseup={handleComboboxMouseUp} class={getListboxClass}>
+ <ul class="slds-listbox slds-listbox_vertical" role="presentation">
<!-- Spinner to display when waiting for results of search -->
<div lwc:if={loading}>
- <lightning-spinner
- alternative-text="Loading"
- size="small"
- ></lightning-spinner>
+ <lightning-spinner alternative-text="Loading" size="small"></lightning-spinner>
</div>
<!-- Result list start -->
- <template
- for:each={searchResultsLocalState}
- for:item="item"
- for:index="index"
- lwc:if={hasResults}
- >
- <li
- key={item.result.id}
- role="presentation"
- class="slds-listbox__item"
- >
- <div
- class={item.classes}
- role="option"
- id={index}
- aria-label={item.result.title}
- onclick={handleResultClick}
- data-recordid={item.result.id}
- >
- <span
- class="slds-media__figure slds-listbox__option-icon"
- >
- <lightning-icon
- icon-name={item.result.icon}
- size="small"
- alternative-text="Result item icon"
- ></lightning-icon>
+ <template for:each={searchResultsLocalState} for:item="item" for:index="index"
+ lwc:if={hasResults}>
+ <li key={item.result.id} role="presentation" class="slds-listbox__item">
+ <div class={item.classes} role="option" id={index} aria-label={item.result.title}
+ onclick={handleResultClick} data-recordid={item.result.id}>
+ <span class="slds-media__figure slds-listbox__option-icon">
+ <lightning-icon icon-name={item.result.icon} size="small"
+ alternative-text="Result item icon"></lightning-icon>
</span>
<span class="slds-media__body">
- <span
- class="slds-listbox__option-text slds-listbox__option-text_entity"
- >
- <lightning-formatted-rich-text
- value={item.result.titleFormatted}
- disable-linkify
- >
+ <span class="slds-listbox__option-text slds-listbox__option-text_entity">
+ <lightning-formatted-rich-text value={item.result.titleFormatted}
+ disable-linkify>
</lightning-formatted-rich-text>
</span>
<!-- <span lwc:if={item.result.subtitleFormatted}
@@ -151,53 +79,25 @@
<!-- No results start -->
<template lwc:else>
<li role="presentation">
- <span
- class="slds-media slds-listbox__option_entity"
- role="option"
- >
- <span
- lwc:if={loading}
- class="slds-media__body"
- >Loading...</span
- >
- <span lwc:else class="slds-media__body"
- >No results.</span
- >
+ <span class="slds-media slds-listbox__option_entity" role="option">
+ <span lwc:if={loading} class="slds-media__body">Loading...</span>
+ <span lwc:else class="slds-media__body">No results.</span>
</span>
</li>
</template>
<!-- No results end -->
<!-- Create new records -->
- <template
- for:each={newRecordOptions}
- for:item="newRecord"
- >
- <li
- key={newRecord.value}
- role="presentation"
- class="slds-listbox__item"
- >
- <div
- class="slds-media slds-media_center slds-listbox__option slds-listbox__option_entity"
- onclick={handleNewRecordClick}
- data-sobject={newRecord.value}
- role="option"
- >
- <span
- class="slds-media__figure slds-listbox__option-icon"
- >
- <lightning-icon
- icon-name="utility:add"
- size="small"
- alternative-text={newRecord.label}
- ></lightning-icon>
+ <template for:each={newRecordOptions} for:item="newRecord">
+ <li key={newRecord.value} role="presentation" class="slds-listbox__item">
+ <div class="slds-media slds-media_center slds-listbox__option slds-listbox__option_entity"
+ onclick={handleNewRecordClick} data-sobject={newRecord.value} role="option">
+ <span class="slds-media__figure slds-listbox__option-icon">
+ <lightning-icon icon-name="utility:add" size="small"
+ alternative-text={newRecord.label}></lightning-icon>
</span>
<span class="slds-media__body">
- <span
- class="slds-listbox__option-text"
- >{newRecord.label}</span
- >
+ <span class="slds-listbox__option-text">{newRecord.label}</span>
</span>
</div>
</li>
@@ -211,28 +111,14 @@
<!-- Multi-selection start -->
<template lwc:if={isMultiEntry}>
- <div
- id="selection"
- role="listbox"
- aria-label={label}
- aria-orientation="horizontal"
- >
- <ul
- class="slds-listbox slds-listbox_inline slds-var-p-top_xxx-small"
- role="group"
- aria-label="Selected options"
- >
+ <div id="selection" role="listbox" aria-label={label} aria-orientation="horizontal">
+ <ul class="slds-listbox slds-listbox_inline slds-var-p-top_xxx-small" role="group"
+ aria-label="Selected options">
<template for:each={selection} for:item="item">
<li key={item.id} role="presentation">
- <lightning-pill
- label={item.title}
- title={item.title}
- onremove={handleRemoveSelectedItem}
- name={item.id}
- >
- <lightning-icon
- icon-name={item.icon}
- ></lightning-icon>
+ <lightning-pill label={item.title} title={item.title}
+ onremove={handleRemoveSelectedItem} name={item.id}>
+ <lightning-icon icon-name={item.icon}></lightning-icon>
</lightning-pill>
</li>
</template>
@@ -243,15 +129,11 @@
<!-- Errors start -->
<template for:each={_errors} for:item="error">
- <div
- key={error.id}
- role="alert"
- class="slds-form-element__label slds-var-m-top_xx-small form-error"
- >
+ <div key={error.id} role="alert" class="slds-form-element__label slds-var-m-top_xx-small form-error">
{error.message}
</div>
</template>
<!-- Errors end -->
</div>
</div>
-</template>
+</template>
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexOutboundorderImport/lexOutboundorderImport.html b/force-app/main/default/lwc/lexOutboundorderImport/lexOutboundorderImport.html
index fe5196e..76b9b05 100644
--- a/force-app/main/default/lwc/lexOutboundorderImport/lexOutboundorderImport.html
+++ b/force-app/main/default/lwc/lexOutboundorderImport/lexOutboundorderImport.html
@@ -3,17 +3,11 @@
<template>
<c-common-toast></c-common-toast>
<template if:true={isShowSpinner}>
- <div
- role="status"
- class="slds-spinner slds-spinner_medium slds-spinner_brand"
- >
- 聽 聽 聽 聽 聽 聽 聽 聽 <span class="slds-assistive-text">Loading</span> 聽 聽
- 聽 聽 聽 聽 聽 聽
- <div class="slds-spinner__dot-a"></div>
- 聽 聽 聽 聽 聽 聽 聽 聽
- <div class="slds-spinner__dot-b"></div>
- 聽 聽 聽 聽
- </div>
+ <div role="status" class="slds-spinner slds-spinner_medium slds-spinner_brand">
+聽 聽 聽 聽 聽 聽 聽 聽 <span class="slds-assistive-text">Loading</span>
+聽 聽 聽 聽 聽 聽 聽 聽 <div class="slds-spinner__dot-a"></div>
+聽 聽 聽 聽 聽 聽 聽 聽 <div class="slds-spinner__dot-b"></div>
+聽 聽 聽 聽 </div>
</template>
<div class="outerBorderCss">
<div style="padding: 5px">
@@ -22,22 +16,11 @@
<div lwc:dom="manual" class="resultDiv"></div>
<div draggable="false" class="centerCss searchName">
<lightning-layout multiple-rows="true">
- <lightning-layout-item
- size="4"
- style="display: flex; align-items: center"
- >
- <lightning-input
- class="floatLeft"
- label=""
- name="file uploader"
- onchange={handleFilesChange}
- type="file"
- accept={acceptedType}
- variant="label-hidden"
- ></lightning-input>
- <div
- class="slds-text-body_small floatLeft fontWeight"
- >
+ <lightning-layout-item size="4" style="display: flex;align-items: center;">
+ <lightning-input class="floatLeft" label="" name="file uploader"
+ onchange={handleFilesChange} type="file" accept={acceptedType}
+ variant="label-hidden"></lightning-input>
+ <div class="slds-text-body_small floatLeft fontWeight">
{fileName}
</div>
</lightning-layout-item>
@@ -46,12 +29,8 @@
label="璇诲彇csv鏂囦欢"
onclick={getCsvFile}
></lightning-button> -->
- <button
- class="slds-button slds-button_neutral slds-button_stretch lexBorder"
- onclick={getCsvFile}
- >
- 璇诲彇csv鏂囦欢
- </button>
+ <button class="slds-button slds-button_neutral slds-button_stretch lexBorder"
+ onclick={getCsvFile}>璇诲彇csv鏂囦欢</button>
</lightning-layout-item>
<lightning-layout-item size="4">
<!-- <lightning-button
@@ -59,18 +38,13 @@
onclick={dataImport}
disabled={saveFLGbln}
></lightning-button> -->
- <button
- class="slds-button slds-button_neutral slds-button_stretch lexBorder"
- onclick={dataImport}
- disabled={saveFLGbln}
- >
- 瀵煎叆鏁版嵁
- </button>
+ <button class="slds-button slds-button_neutral slds-button_stretch lexBorder"
+ onclick={dataImport} disabled={saveFLGbln}>瀵煎叆鏁版嵁</button>
</lightning-layout-item>
</lightning-layout>
</div>
- <div class="borderCss" style="margin-top: 10px">
+ <div class="borderCss" style="margin-top: 10px;">
<div class="headerDorderCss">
<lightning-layout>
<lightning-layout-item padding="around-small">
@@ -83,17 +57,9 @@
<div style="padding: 7px">
<div lwc:dom="manual" class="resultDiv"></div>
<div draggable="false">
- <lightning-datatable
- key-field="id"
- data={data}
- columns={columns}
- hide-checkbox-column
- default-sort-direction={defaultSortDirection}
- sorted-direction={sortDirection}
- sorted-by={sortedBy}
- onsort={onHandleSort}
- class="wrapped-header-datatable"
- >
+ <lightning-datatable key-field="id" data={data} columns={columns} hide-checkbox-column
+ default-sort-direction={defaultSortDirection} sorted-direction={sortDirection}
+ sorted-by={sortedBy} onsort={onHandleSort} class="wrapped-header-datatable">
</lightning-datatable>
</div>
</div>
@@ -102,4 +68,4 @@
</div>
</div>
</div>
-</template>
+</template>
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexOutboundorderImport/lexOutboundorderImport.js b/force-app/main/default/lwc/lexOutboundorderImport/lexOutboundorderImport.js
index 669ce79..0200238 100644
--- a/force-app/main/default/lwc/lexOutboundorderImport/lexOutboundorderImport.js
+++ b/force-app/main/default/lwc/lexOutboundorderImport/lexOutboundorderImport.js
@@ -1,78 +1,78 @@
-import { LightningElement, api, track, wire } from 'lwc';
-import { ShowToastEvent } from 'lightning/platformShowToastEvent';
-import init from '@salesforce/apex/LexOutboundorderImportController.init';
-import importCSVFile from '@salesforce/apex/LexOutboundorderImportController.importCSVFile';
-import dataImport from '@salesforce/apex/LexOutboundorderImportController.dataImport';
-//table css
-import { loadStyle } from 'lightning/platformResourceLoader';
-import WrappedHeaderTable from '@salesforce/resourceUrl/lexdatatable';
+import { LightningElement, api, track, wire } from "lwc";
+import { ShowToastEvent } from "lightning/platformShowToastEvent";
+import init from "@salesforce/apex/LexOutboundorderImportController.init";
+import importCSVFile from "@salesforce/apex/LexOutboundorderImportController.importCSVFile";
+import dataImport from "@salesforce/apex/LexOutboundorderImportController.dataImport";
+//table css
+import { loadStyle } from "lightning/platformResourceLoader";
+import WrappedHeaderTable from "@salesforce/resourceUrl/lexdatatable";
const columns = [
{
- label: '鍑哄簱鍗曞悕绉�',
- fieldName: 'orderName',
+ label: "鍑哄簱鍗曞悕绉�",
+ fieldName: "orderName",
hideDefaultActions: true,
initialWidth: 200,
- wrapText: true
+ wrapText: true,
},
{
- label: '鐩殑',
- fieldName: 'orderSummonsForDirction',
+ label: "鐩殑",
+ fieldName: "orderSummonsForDirction",
hideDefaultActions: true,
- wrapText: true
+ wrapText: true,
},
{
- label: '鍖婚櫌缂栫爜',
- fieldName: 'hospitalCode',
+ label: "鍖婚櫌缂栫爜",
+ fieldName: "hospitalCode",
hideDefaultActions: true,
- wrapText: true
+ wrapText: true,
},
{
- label: '鍖婚櫌鍚嶇О',
- fieldName: 'hospitalName',
+ label: "鍖婚櫌鍚嶇О",
+ fieldName: "hospitalName",
hideDefaultActions: true,
wrapText: true,
initialWidth: 300
},
{
- label: '绉戝',
- fieldName: 'orderOrderForCustomerText',
+ label: "绉戝",
+ fieldName: "orderOrderForCustomerText",
hideDefaultActions: true,
- wrapText: true
+ wrapText: true,
},
{
- label: '浜岀骇缁忛攢鍟�',
- fieldName: 'agencyName',
+ label: "浜岀骇缁忛攢鍟�",
+ fieldName: "agencyName",
hideDefaultActions: true,
- wrapText: true
+ wrapText: true,
},
{
- label: '鍑哄簱/閿�鍞棩鏈�',
- fieldName: 'orderOutboundDate',
+ label: "鍑哄簱/閿�鍞棩鏈�",
+ fieldName: "orderOutboundDate",
hideDefaultActions: true,
- wrapText: true
- }
+ wrapText: true,
+ },
];
export default class LexOutboundorderImport extends LightningElement {
@track isShowSpinner = true;
//鏂囦欢涓婁紶
@track showLoadingSpinner = false;
- @track UploadFile = 'Upload File';
- @track fileName = '';
+ @track UploadFile = "Upload File";
+ @track fileName = "";
@track fileData = [];
@track fileColumns = [
{
- label: '鏍囬',
- fieldName: 'url',
- type: 'url',
- typeAttributes: { label: { fieldName: 'Title' }, target: '_blank' },
- hideDefaultActions: true
+ label: "鏍囬",
+ fieldName: "url",
+ type: "url",
+ typeAttributes: { label: { fieldName: "Title" }, target: "_blank" },
+ hideDefaultActions: true,
},
{
- label: '鍒涘缓浜�',
- fieldName: 'CreatedByName',
- hideDefaultActions: true
- }
+ label: "鍒涘缓浜�",
+ fieldName: "CreatedByName",
+ hideDefaultActions: true,
+ },
];
filesUploaded = [];
fileContents;
@@ -80,7 +80,7 @@
content;
MAX_FILE_SIZE = 1500000;
get acceptedType() {
- return ['.csv'];
+ return [".csv"];
}
//鍒楄〃
@@ -88,11 +88,11 @@
@track data = [];
//鏁版嵁
- @track accountid = '';
- @track userWorkLocation = '';
- @track agencyProType = '';
- @track accountName = '';
- @track sqlagencyProType = '';
+ @track accountid = "";
+ @track userWorkLocation = "";
+ @track agencyProType = "";
+ @track accountName = "";
+ @track sqlagencyProType = "";
@track csvRecordStr = [];
@track saveFLGbln = false;
@track secondAgencyMap = {};
@@ -103,37 +103,35 @@
if (!this.stylesLoaded) {
Promise.all([loadStyle(this, WrappedHeaderTable)])
.then(() => {
- console.log('Custom styles loaded');
+ console.log("Custom styles loaded");
this.stylesLoaded = true;
})
.catch((error) => {
- console.error('Error loading custom styles');
+ console.error("Error loading custom styles");
});
}
}
connectedCallback() {
- init()
- .then((r) => {
- r = JSON.parse(JSON.stringify(r));
- console.log('r = ' + JSON.stringify(r));
- if (r.status == 'Success') {
- this.accountid = r.entity.accountid;
- this.userWorkLocation = r.entity.userWorkLocation;
- this.agencyProType = r.entity.agencyProType;
- console.log('this.agencyProType = ' + this.agencyProType);
- this.accountName = r.entity.accountName;
- this.sqlagencyProType = r.entity.sqlagencyProType;
- this.isShowSpinner = false;
- } else {
- console.log('r = ' + JSON.stringify(r));
- this.showMyToast('鍒濆鍖栧け璐�', r.msg, 'Error');
- }
- })
- .catch((error) => {
- console.log('error = ' + JSON.stringify(error));
- this.showMyToast('閿欒', '鍒濆鍖栧け璐�', 'Error');
- });
+ init().then((r) => {
+ r = JSON.parse(JSON.stringify(r));
+ console.log("r = " + JSON.stringify(r));
+ if (r.status == "Success") {
+ this.accountid = r.entity.accountid;
+ this.userWorkLocation = r.entity.userWorkLocation;
+ this.agencyProType = r.entity.agencyProType;
+ console.log('this.agencyProType = ' + this.agencyProType);
+ this.accountName = r.entity.accountName;
+ this.sqlagencyProType = r.entity.sqlagencyProType;
+ this.isShowSpinner = false;
+ } else {
+ console.log("r = " + JSON.stringify(r));
+ this.showMyToast('鍒濆鍖栧け璐�', r.msg, 'Error')
+ }
+ }).catch((error) => {
+ console.log("error = " + JSON.stringify(error));
+ this.showMyToast('閿欒', '鍒濆鍖栧け璐�', 'Error')
+ });
}
getCsvFile() {
@@ -142,7 +140,7 @@
if (this.filesUploaded.length > 0) {
this.file = this.filesUploaded[0];
if (this.file.size > this.MAX_FILE_SIZE) {
- window.console.log('鏂囦欢杩囧ぇ');
+ window.console.log("鏂囦欢杩囧ぇ");
this.isShowSpinner = false;
return;
}
@@ -150,78 +148,66 @@
this.fileReader.onloadend = () => {
this.fileContents = this.fileReader.result;
- let base64 = 'base64,';
- this.content =
- this.fileContents.indexOf(base64) + base64.length;
+ let base64 = "base64,";
+ this.content = this.fileContents.indexOf(base64) + base64.length;
this.fileContents = this.fileContents.substring(this.content);
- console.log('getCsvFile');
+ console.log('getCsvFile')
this.importCSVFile();
};
this.fileReader.readAsDataURL(this.file);
} else {
- this.fileName = '閫夋嫨涓�涓猚sv鏂囦欢涓婁紶';
- this.showMyToast('涓婁紶澶辫触', '閫夋嫨涓�涓猚sv鏂囦欢涓婁紶', 'Error');
+ this.fileName = "閫夋嫨涓�涓猚sv鏂囦欢涓婁紶";
+ this.showMyToast('涓婁紶澶辫触', '閫夋嫨涓�涓猚sv鏂囦欢涓婁紶', 'Error')
}
}
importCSVFile() {
- console.log('importCSVFile');
+ console.log('importCSVFile')
console.log('this.sqlagencyProType = ' + this.sqlagencyProType);
console.log('this.userWorkLocation = ' + this.userWorkLocation);
console.log('this.accountName = ' + this.accountName);
- console.log(
- 'encodeURIComponent(this.fileContents) = ' +
- encodeURIComponent(this.fileContents)
- );
+ console.log('encodeURIComponent(this.fileContents) = ' + encodeURIComponent(this.fileContents));
importCSVFile({
base64DataLwc: encodeURIComponent(this.fileContents),
sqlagencyProTypeLwc: this.sqlagencyProType,
userWorkLocationLwc: this.userWorkLocation,
- accountNameLwc: this.accountName
- })
- .then((r) => {
- r = JSON.parse(JSON.stringify(r));
- console.log('r = ' + JSON.stringify(r));
- if (r.status == 'Success' && r.msg == '') {
- console.log('importCSVFile success');
- this.saveFLGbln = r.entity.saveFLGbln;
- this.csvRecordStr = r.entity.csvRecordStr;
- this.secondAgencyMap = r.entity.secondAgencyMap;
- this.hospitalSysMap = r.entity.hospitalSysMap;
- this.data = r.entity.orderRecords;
- for (var i in this.data) {
- this.data[i]['orderName'] = this.data[i].order.Name;
- this.data[i]['orderSummonsForDirction'] =
- this.data[i].order.SummonsForDirction__c;
- this.data[i]['orderOrderForCustomerText'] =
- this.data[i].order.Order_ForCustomerText__c;
- this.data[i]['orderOutboundDate'] =
- this.data[i].order.Outbound_Date__c;
- }
- this.isShowSpinner = false;
- } else if (r.msg != '') {
- console.log('r.msg = ' + JSON.stringify(r.msg));
- this.saveFLGbln = r.entity.saveFLGbln;
- this.data = r.entity.orderRecords;
- for (var i in this.data) {
- this.data[i]['orderName'] = this.data[i].order.Name;
- this.data[i]['orderSummonsForDirction'] =
- this.data[i].order.SummonsForDirction__c;
- this.data[i]['orderOrderForCustomerText'] =
- this.data[i].order.Order_ForCustomerText__c;
- this.data[i]['orderOutboundDate'] =
- this.data[i].order.Outbound_Date__c;
- }
- this.showMyToast('瀵煎叆澶辫触', r.msg, 'Error');
- } else {
- console.log('r.msg = ' + JSON.stringify(r.msg));
- this.showMyToast('瀵煎叆澶辫触', r.msg, 'Error');
+ accountNameLwc: this.accountName,
+ }).then((r) => {
+ r = JSON.parse(JSON.stringify(r));
+ console.log("r = " + JSON.stringify(r));
+ if (r.status == "Success" && r.msg == "") {
+ console.log("importCSVFile success");
+ this.saveFLGbln = r.entity.saveFLGbln;
+ this.csvRecordStr = r.entity.csvRecordStr;
+ this.secondAgencyMap = r.entity.secondAgencyMap;
+ this.hospitalSysMap = r.entity.hospitalSysMap;
+ this.data = r.entity.orderRecords;
+ for (var i in this.data) {
+ this.data[i]['orderName'] = this.data[i].order.Name;
+ this.data[i]['orderSummonsForDirction'] = this.data[i].order.SummonsForDirction__c;
+ this.data[i]['orderOrderForCustomerText'] = this.data[i].order.Order_ForCustomerText__c;
+ this.data[i]['orderOutboundDate'] = this.data[i].order.Outbound_Date__c;
}
- })
- .catch((error) => {
- console.log('error = ' + JSON.stringify(error.message));
- this.showMyToast('瀵煎叆閿欒', '瀵煎叆澶辫触', 'Error');
- });
+ this.isShowSpinner = false;
+ } else if (r.msg != "") {
+ console.log("r.msg = " + JSON.stringify(r.msg));
+ this.saveFLGbln = r.entity.saveFLGbln;
+ this.data = r.entity.orderRecords;
+ for (var i in this.data) {
+ this.data[i]['orderName'] = this.data[i].order.Name;
+ this.data[i]['orderSummonsForDirction'] = this.data[i].order.SummonsForDirction__c;
+ this.data[i]['orderOrderForCustomerText'] = this.data[i].order.Order_ForCustomerText__c;
+ this.data[i]['orderOutboundDate'] = this.data[i].order.Outbound_Date__c;
+ }
+ this.showMyToast('瀵煎叆澶辫触', r.msg, 'Error')
+ } else {
+ console.log("r.msg = " + JSON.stringify(r.msg));
+ this.showMyToast('瀵煎叆澶辫触', r.msg, 'Error')
+ }
+ }).catch((error) => {
+ console.log("error = " + JSON.stringify(error.message));
+ this.showMyToast('瀵煎叆閿欒', '瀵煎叆澶辫触', 'Error')
+ });
}
dataImport() {
@@ -243,31 +229,29 @@
accountidLwc: this.accountid,
agencyProTypeLwc: this.agencyProType,
secondAgencyMapLwc: this.secondAgencyMap,
- hospitalSysMapLwc: this.hospitalSysMap
- })
- .then((r) => {
- r = JSON.parse(JSON.stringify(r));
- console.log('r = ' + JSON.stringify(r));
- if (r.status == 'Success' && r.msg == '') {
- this.saveFLGbln = true;
- console.log('dataImport success');
- this.showMyToast('鎴愬姛', '淇濆瓨鎴愬姛', 'Success');
- } else if (r.msg != '') {
- console.log('r.msg = ' + JSON.stringify(r.msg));
- this.showMyToast('淇濆瓨澶辫触', r.msg, 'Error');
- } else {
- console.log('r.msg = ' + JSON.stringify(r.msg));
- this.showMyToast('淇濆瓨澶辫触', r.msg, 'Error');
- }
- })
- .catch((error) => {
- console.log('error = ' + JSON.stringify(error.message));
- this.showMyToast('閿欒', '淇濆瓨澶辫触', 'Error');
- });
+ hospitalSysMapLwc: this.hospitalSysMap,
+ }).then((r) => {
+ r = JSON.parse(JSON.stringify(r));
+ console.log("r = " + JSON.stringify(r));
+ if (r.status == "Success" && r.msg == "") {
+ this.saveFLGbln = true;
+ console.log("dataImport success");
+ this.showMyToast('鎴愬姛', '淇濆瓨鎴愬姛', 'Success')
+ } else if (r.msg != "") {
+ console.log("r.msg = " + JSON.stringify(r.msg));
+ this.showMyToast('淇濆瓨澶辫触', r.msg, 'Error')
+ } else {
+ console.log("r.msg = " + JSON.stringify(r.msg));
+ this.showMyToast('淇濆瓨澶辫触', r.msg, 'Error')
+ }
+ }).catch((error) => {
+ console.log("error = " + JSON.stringify(error.message));
+ this.showMyToast('閿欒', '淇濆瓨澶辫触', 'Error')
+ });
}
handleFilesChange(event) {
- console.log('handleFilesChange');
+ console.log("handleFilesChange");
if (event.target.files.length > 0) {
this.filesUploaded = event.target.files;
this.fileName = event.target.files[0].name;
@@ -285,17 +269,10 @@
iconName = 'utility:error';
}
if (message != '') {
- content =
- '<h2><strong>' +
- title +
- '<strong/></h2><h5>' +
- message +
- '</h5>';
+ content = '<h2><strong>' + title + '<strong/></h2><h5>' + message + '</h5>';
} else {
content = '<h2><strong>' + title + '<strong/></h2>';
}
- this.template
- .querySelector('c-common-toast')
- .showToast(variant, content, iconName, 10000);
+ this.template.querySelector('c-common-toast').showToast(variant, content, iconName, 10000);
}
-}
+}
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexOverdueStock/lexOverdueStock.html b/force-app/main/default/lwc/lexOverdueStock/lexOverdueStock.html
index bc0e117..75c65de 100644
--- a/force-app/main/default/lwc/lexOverdueStock/lexOverdueStock.html
+++ b/force-app/main/default/lwc/lexOverdueStock/lexOverdueStock.html
@@ -1,212 +1,131 @@
<template>
<template if:true={showSpinner}>
- <!-- <lightning-spinner size="medium" variant="brand"></lightning-spinner> -->
- <div class="slds-spinner_container">
- <div
- role="status"
- class="slds-spinner slds-spinner_medium slds-spinner_brand"
- >
- <span class="slds-assistive-text">Loading</span>
- <div class="slds-spinner__dot-a"></div>
- <div class="slds-spinner__dot-b"></div>
- </div>
+ <!-- <lightning-spinner size="medium" variant="brand"></lightning-spinner> -->
+ <div class="slds-spinner_container">
+ <div role="status" class="slds-spinner slds-spinner_medium slds-spinner_brand">
+ <span class="slds-assistive-text">Loading</span>
+ <div class="slds-spinner__dot-a"></div>
+ <div class="slds-spinner__dot-b"></div>
</div>
- </template>
- <c-common-toast></c-common-toast>
- <div style="border: 1px solid #d4d4d4; border-radius: 5px">
- <div
- style="
- border-top: 3px solid #51606e;
- border-bottom: 1px solid #d4d4d4;
- padding: 3px;
- "
- >
- <div style="margin: 12px">
- <p style="font-size: 18px; float: left">
- <strong>杩囨湡搴撳瓨閿�瀛�</strong>
- </p>
- </div>
- <div style="margin-left: 400px; margin-bottom: 12px">
- <!-- <lightning-button variant="brand" class = 'lexstyle' label="閿�瀛樼‘璁�" title="閿�瀛樼‘璁�" onclick={saveConfirm}></lightning-button> -->
- <button
- class="slds-button slds-button_neutral slds-button_stretch lexBorder"
- label="閿�瀛樼‘璁�"
- onclick={saveConfirm}
- >
- 閿�瀛樼‘璁�
- </button>
- </div>
- </div>
+ </div>
+</template>
+<c-common-toast></c-common-toast>
+<div style="border: 1px solid #D4D4D4;border-radius:5px;">
+<div style="border-top: 3px solid #51606E;;border-bottom: 1px solid #D4D4D4;padding:3px;">
+ <div style="margin: 12px;">
+ <p style="font-size: 18px;float:left"><strong>杩囨湡搴撳瓨閿�瀛�</strong></p>
+ </div>
+ <div style="margin-left:400px;margin-bottom:12px;">
+ <!-- <lightning-button variant="brand" class = 'lexstyle' label="閿�瀛樼‘璁�" title="閿�瀛樼‘璁�" onclick={saveConfirm}></lightning-button> -->
+ <button class="slds-button slds-button_neutral slds-button_stretch lexBorder" label="閿�瀛樼‘璁�" onclick={saveConfirm}>閿�瀛樼‘璁�</button>
+ </div>
+</div>
- <div style="padding: 10px">
- <div
- style="
- border: 1px solid #d4d4d4;
- border-radius: 5px;
- margin-bottom: 7px;
- "
- >
- <div
- style="
- border-top: 3px solid #51606e;
- border-bottom: 1px solid #d4d4d4;
- padding: 3px;
- "
- >
- <table>
- <colgroup>
- <col width="160px" />
- <col width="100px" />
- <col width="10px" />
- <col width="70px" />
- <col width="100px" />
- <col width="10px" />
- <col width="90px" />
- <col width="100px" />
- <col width="10px" />
- <col width="85px" />
- <col width="100px" />
- <col width="10px" />
- <col width="70px" />
- <col width="100px" />
- </colgroup>
- <tbody>
- <tr>
- <td></td>
- <td align="right" class="searchName">
- BarCode
- </td>
- <td style="width: 600px">
- <lightning-textarea
- class="inputFont"
- name="BarCode"
- label=""
- onchange={handleChange}
- ></lightning-textarea>
- </td>
- <td align="right"></td>
- <td></td>
- <td style="width: 200px">
- <button
- style="margin-top: 14px"
- class="slds-button slds-button_neutral slds-button_stretch lexBorder"
- label="鑾峰彇鏄庣粏"
- onclick={barcodeEntrys}
- >
- 鑾峰彇鏄庣粏
- </button>
- <!-- <lightning-button class='lexstyle' label="BarCode褰曞叆" title="BarCode褰曞叆" onclick={barcodeEntrys}
+<div style="padding:10px;">
+ <div style="border: 1px solid #D4D4D4;border-radius:5px;margin-bottom:7px;">
+ <div style="border-top: 3px solid #51606E;border-bottom: 1px solid #D4D4D4;padding:3px;">
+ <table>
+ <colgroup>
+ <col width="160px" />
+ <col width="100px" />
+ <col width="10px" />
+ <col width="70px" />
+ <col width="100px" />
+ <col width="10px" />
+ <col width="90px" />
+ <col width="100px" />
+ <col width="10px" />
+ <col width="85px" />
+ <col width="100px" />
+ <col width="10px" />
+ <col width="70px" />
+ <col width="100px" />
+ </colgroup>
+ <tbody>
+ <tr>
+ <td></td>
+ <td align="right" class="searchName">BarCode</td>
+ <td style="width:600px"><lightning-textarea class="inputFont" name="BarCode" label=""
+ onchange={handleChange}></lightning-textarea></td>
+ <td align="right"></td>
+ <td></td>
+ <td style="width:200px">
+ <button style="margin-top:14px;" class="slds-button slds-button_neutral slds-button_stretch lexBorder" label="鑾峰彇鏄庣粏" onclick={barcodeEntrys}>鑾峰彇鏄庣粏</button>
+ <!-- <lightning-button class='lexstyle' label="BarCode褰曞叆" title="BarCode褰曞叆" onclick={barcodeEntrys}
style="width: 150px;"></lightning-button> -->
- </td>
- </tr>
- </tbody>
- </table>
- </div>
- </div>
+ </td>
+ </tr>
+ </tbody>
+ </table>
+ </div>
+ </div>
- <div
- style="
- border: 1px solid #d4d4d4;
- border-radius: 5px;
- margin-bottom: 5px;
- "
- >
- <div
- style="
- border-top: 3px solid #51606e;
- border-bottom: 1px solid #d4d4d4;
- padding: 3px;
- "
- >
- <!-- <p style="font-size: 16px;"><strong>杩囨湡搴撳瓨涓�瑙�</strong></p> -->
- <table>
- <tr>
- <td>
- <!-- <p style="font-size: 16px;"><strong>閿�瀛樻槑缁�</strong></p> -->
- <lightning-layout>
- <lightning-layout-item
- padding="around-small"
- >
- <p style="font-size: 18px">
- <strong>杩囨湡搴撳瓨涓�瑙�</strong>
- </p>
- </lightning-layout-item>
- </lightning-layout>
- </td>
- </tr>
- </table>
- </div>
- <div style="padding: 10px">
- <!-- <div style="height: 300px;"> -->
- <template if:true={showTable}>
- <c-lex-custom-lightning-datatable
- key-field="key"
- data={data}
- columns={columns}
- onrowselection={getSelectedRows}
- selected-rows={selectedRows}
- class="wrapped-header-datatable"
- >
+ <div style="border: 1px solid #D4D4D4;border-radius:5px;margin-bottom:5px;">
+ <div style="border-top: 3px solid #51606E;border-bottom: 1px solid #D4D4D4;padding:3px;">
+ <!-- <p style="font-size: 16px;"><strong>杩囨湡搴撳瓨涓�瑙�</strong></p> -->
+ <table>
+ <tr>
+ <td>
+ <!-- <p style="font-size: 16px;"><strong>閿�瀛樻槑缁�</strong></p> -->
+ <lightning-layout>
+ <lightning-layout-item padding="around-small">
+ <p style="font-size: 18px">
+ <strong>杩囨湡搴撳瓨涓�瑙�</strong>
+ </p>
+ </lightning-layout-item>
+ </lightning-layout>
+ </td>
+ </tr>
+ </table>
+ </div>
+ <div style="padding:10px;">
+
+ <!-- <div style="height: 300px;"> -->
+ <template if:true={showTable}>
+ <c-lex-custom-lightning-datatable key-field="key" data={data} columns={columns}
+ onrowselection={getSelectedRows}
+ selected-rows={selectedRows} class="wrapped-header-datatable">
</c-lex-custom-lightning-datatable>
- </template>
- <!-- 鍔犺浇妗� -->
+ </template>
+ <!-- 鍔犺浇妗� -->
- <!-- <div if:true={casesSpinner} class="slds-spinner_inline spinner-padding"
+ <!-- <div if:true={casesSpinner} class="slds-spinner_inline spinner-padding"
style="margin-top:10px;">
<lightning-spinner variant="brand" alternative-text="Loading Cases" size="medium">
</lightning-spinner>
</div> -->
- <!-- </div> -->
- </div>
- </div>
+ <!-- </div> -->
- <div
- style="
- border: 1px solid #d4d4d4;
- border-radius: 5px;
- margin-bottom: 5px;
- "
- >
- <div
- style="
- border-top: 3px solid #51606e;
- border-bottom: 1px solid #d4d4d4;
- padding: 3px;
- "
- >
- <table>
- <tr>
- <td>
- <!-- <p style="font-size: 16px;"><strong>閿�瀛樻槑缁�</strong></p> -->
- <lightning-layout>
- <lightning-layout-item
- padding="around-small"
- >
- <p style="font-size: 18px">
- <strong>閿�瀛樻槑缁�</strong>
- </p>
- </lightning-layout-item>
- </lightning-layout>
- </td>
- </tr>
- </table>
- </div>
-
- <div style="padding: 10px">
- <lightning-datatable
- key-field="id"
- data={overduePageRecords}
- columns={column}
- onrowselection={getSelectedRows}
- hide-checkbox-column="true"
- selected-rows={selectedRows}
- class="wrapped-header-datatable"
- style="word-wrap: break-word; word-break: break-all"
- >
- </lightning-datatable>
- </div>
- </div>
</div>
</div>
-</template>
+
+ <div style="border: 1px solid #D4D4D4;border-radius:5px;margin-bottom:5px;">
+ <div style="border-top: 3px solid #51606E;border-bottom: 1px solid #D4D4D4;padding:3px;">
+ <table>
+ <tr>
+ <td>
+ <!-- <p style="font-size: 16px;"><strong>閿�瀛樻槑缁�</strong></p> -->
+ <lightning-layout>
+ <lightning-layout-item padding="around-small">
+ <p style="font-size: 18px">
+ <strong>閿�瀛樻槑缁�</strong>
+ </p>
+ </lightning-layout-item>
+ </lightning-layout>
+ </td>
+ </tr>
+ </table>
+ </div>
+
+ <div style="padding:10px;">
+ <lightning-datatable
+ key-field="id" data={overduePageRecords} columns={column}
+ onrowselection={getSelectedRows} hide-checkbox-column="true"
+ selected-rows={selectedRows} class="wrapped-header-datatable " style="word-wrap:break-word; word-break:break-all; ">
+ </lightning-datatable>
+</div>
+ </div>
+</div>
+</div>
+</template>
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexOverdueStock/lexOverdueStock.js b/force-app/main/default/lwc/lexOverdueStock/lexOverdueStock.js
index 24ac990..88325a0 100644
--- a/force-app/main/default/lwc/lexOverdueStock/lexOverdueStock.js
+++ b/force-app/main/default/lwc/lexOverdueStock/lexOverdueStock.js
@@ -4,397 +4,350 @@
import save from '@salesforce/apex/LexOverdueStockController.save';
import { ShowToastEvent } from 'lightning/platformShowToastEvent';
import { NavigationMixin } from 'lightning/navigation';
-//table css
-import { loadStyle } from 'lightning/platformResourceLoader';
-import WrappedHeaderTable from '@salesforce/resourceUrl/lexdatatable';
+//table css
+import { loadStyle } from "lightning/platformResourceLoader";
+import WrappedHeaderTable from "@salesforce/resourceUrl/lexdatatable";
+
//杩囨湡搴撳瓨涓�瑙�
const columns = [
- {
- label: '鏄惁閿�瀛�',
- fieldName: 'iscount',
- type: 'checkbox',
- hideDefaultActions: true,
- initialWidth: 80
- },
- {
- label: '娑堣�楀搧鍚嶇О',
- fieldName: 'prodname',
- type: 'prodname',
- wrapText: true,
- initialWidth: 350,
+ {
+ label: '鏄惁閿�瀛�',
+ fieldName: 'iscount',
+ type: 'checkbox',
+ hideDefaultActions: true,
+ initialWidth: 80,
+ },
+ {
+ label: '娑堣�楀搧鍚嶇О',
+ fieldName: 'prodname',
+ type: 'prodname',
+ wrapText: true,
+ initialWidth: 350,
- hideDefaultActions: true
- },
- {
- label: '鍗曚綅',
- fieldName: 'boxPiece',
- hideDefaultActions: true
- // initialWidth: 250,
- },
- {
- label: '杩囨湡鏁伴噺',
- fieldName: 'overlimitCount',
- hideDefaultActions: true,
- cellAttributes: { alignment: 'right' }
+ hideDefaultActions: true
- // initialWidth: 250,
- },
- {
- label: '閿�瀛樻暟閲�',
- fieldName: 'pandian',
- hideDefaultActions: true,
- cellAttributes: { alignment: 'right' }
- // initialWidth: 250,
- // cellAttributes: { alignment: 'center' }
- }
+ },
+ {
+ label: '鍗曚綅',
+ fieldName: 'boxPiece',
+ hideDefaultActions: true,
+ // initialWidth: 250,
+
+ },
+ {
+ label: '杩囨湡鏁伴噺',
+ fieldName: 'overlimitCount',
+ hideDefaultActions: true,
+ cellAttributes: { alignment: 'right' }
+
+ // initialWidth: 250,
+
+ },
+ {
+ label: '閿�瀛樻暟閲�',
+ fieldName: 'pandian',
+ hideDefaultActions: true,
+ cellAttributes: { alignment: 'right' }
+ // initialWidth: 250,
+ // cellAttributes: { alignment: 'center' }
+ }
];
//閿�瀛樻槑缁�
const column = [
- {
- label: '娑堣�楀搧鍚嶇О',
- fieldName: 'Name__c',
- type: 'Name',
- wrapText: true,
- // initialWidth : 300,
- hideDefaultActions: true,
- cellAttributes: { alignment: 'left' }
- },
- {
- label: '鍗曚綅',
- fieldName: 'Box_Piece__c',
- initialWidth: 80,
- hideDefaultActions: true
- },
- {
- label: 'BarCode',
- fieldName: 'Bar_Code__c',
- wrapText: true,
- hideDefaultActions: true
- // initialWidth: 500,
- },
- {
- label: '浣跨敤鏈熼檺',
- fieldName: 'Sterilization_limit__c',
- hideDefaultActions: true
- // initialWidth : 250
- },
- {
- label: '閿�瀛樺師鍥�',
- fieldName: 'diffReason',
- hideDefaultActions: true,
- wrapText: true,
- initialWidth: 160
- }
+
+ {
+ label: '娑堣�楀搧鍚嶇О',
+ fieldName: 'Name__c',
+ type: 'Name',
+ wrapText: true,
+ // initialWidth : 300,
+ hideDefaultActions: true,
+ cellAttributes: { alignment: 'left' }
+ },
+ {
+ label: '鍗曚綅',
+ fieldName: 'Box_Piece__c',
+ initialWidth: 80,
+ hideDefaultActions: true
+ },
+ {
+ label: 'BarCode',
+ fieldName: 'Bar_Code__c',
+ wrapText: true,
+ hideDefaultActions: true,
+ // initialWidth: 500,
+ },
+ {
+ label: '浣跨敤鏈熼檺',
+ fieldName: 'Sterilization_limit__c',
+ hideDefaultActions: true,
+ // initialWidth : 250
+ }
+ ,
+ {
+ label: '閿�瀛樺師鍥�',
+ fieldName: 'diffReason',
+ hideDefaultActions: true,
+ wrapText: true,
+ initialWidth: 160
+ }
];
+
export default class LexOverdueStock extends NavigationMixin(LightningElement) {
- columns = columns;
- column = column;
- @track data = [];
- @track overduePageRecords = [];
- @track iSinventory = false;
+ columns = columns
+ column = column
+ @track data = [];
+ @track overduePageRecords = [];
+ @track iSinventory = false
- //鍔犺浇妗�
- // @track casesSpinner = true;
- @track showSpinner = true;
- //鏄剧ず鍙�
- @track showbutton = false;
- @track showTable = false;
- @track showTables = false;
- //閿�瀛樹竴瑙堟暟鎹�
- @track accountName;
- @track agencyProType;
- @track userWorkLocation;
- @track barcode = '';
- @track orderDetZaiku;
- @track selectedRows = [];
- @track codPageRecordsLWC;
- @track Id;
- @track overdueList = [];
- renderedCallback() {
- if (!this.stylesLoaded) {
- Promise.all([loadStyle(this, WrappedHeaderTable)])
- .then(() => {
- console.log('Custom styles loaded');
- this.stylesLoaded = true;
- })
- .catch((error) => {
- console.error('Error loading custom styles');
- });
- }
- }
+ //鍔犺浇妗�
+ // @track casesSpinner = true;
+ @track showSpinner = true;
+ //鏄剧ず鍙�
+ @track showbutton = false
+ @track showTable = false;
+ @track showTables = false;
+ //閿�瀛樹竴瑙堟暟鎹�
+ @track accountName;
+ @track agencyProType;
+ @track userWorkLocation;
+ @track barcode = ''
+ @track orderDetZaiku
+ @track selectedRows = [];
+ @track codPageRecordsLWC;
+ @track Id;
+ @track overdueList = [];
- //鍒濆鍖�
- connectedCallback() {
- console.log('鍒濆鍖�');
- this.showSpinner = true;
- init()
- .then((result) => {
- result = JSON.parse(JSON.stringify(result));
- console.log('result =' + JSON.stringify(result));
- console.log('result 1=' + result.entity.codPageRecords);
- if ((result.status = 'Success')) {
- this.data = JSON.parse(result.entity.codPageRecords);
- this.codPageRecordsLWC = result.entity.codPageRecords;
- console.log('this.data' + this.data);
- this.accountName = result.entity.accountName;
- this.agencyProType = result.entity.agencyProType;
- this.userWorkLocation = result.entity.userWorkLocation;
- for (var i in this.data) {
- this.data[i]['key'] =
- this.data[i]['prodid'] + this.data[i]['boxPiece'];
- }
- this.showTable = true;
- // this.casesSpinner = false;
- this.showSpinner = false;
- } else {
- this.showMyToast('鍒濆鍖栧け璐�', result.msg, 'error');
- this.showSpinner = false;
- }
- })
- .catch((error) => {
- console.log('error = ' + JSON.stringify(error));
- this.showSpinner = false;
- });
- }
- //barcode褰曞叆
- barcodeEntrys() {
- this.showSpinner = true;
- this.showTable = false;
- console.log('code' + this.barcode);
- console.log(' this.accountName' + this.accountName);
- console.log(' this.barcode' + this.barcode);
- const selectedRows = this.template
- .querySelector('c-lex-custom-lightning-datatable')
- .getSelectedRows();
- console.log('selectedRows========> ' + JSON.stringify(selectedRows));
- for (var i in this.data) {
- this.data[i]['check'] = false;
- }
- for (var i in this.data) {
- for (var j in selectedRows) {
- if (
- this.data[i].prodid + this.data[i]['boxPiece'] ==
- selectedRows[j].prodid + selectedRows[j]['boxPiece']
- ) {
- this.data[i]['check'] = true;
- }
- }
- }
- barcodeEntry({
- accountNameLWC: this.accountName,
- agencyProTypeLWC: this.agencyProType,
- userWorkLocationLWC: this.userWorkLocation,
- barcodeLWC: this.barcode,
- codPageRecordsLWC: JSON.stringify(this.data)
+ renderedCallback() {
+ if (!this.stylesLoaded) {
+ Promise.all([loadStyle(this, WrappedHeaderTable)])
+ .then(() => {
+ console.log("Custom styles loaded");
+ this.stylesLoaded = true;
})
- .then((result) => {
- result = JSON.parse(JSON.stringify(result));
- if (result.status == 'Success') {
- this.overduePageRecords = JSON.parse(
- result.entity.overduePageRecords
- );
- this.overdueList = result.entity.overdueList;
- this.iSinventory = result.entity.iSinventory;
- console.log('result褰曞叆' + JSON.stringify(result));
- console.log(
- 'overdueList==>' + JSON.stringify(this.overdueList)
- );
- for (let i in this.overduePageRecords) {
- if (this.overduePageRecords[i].Prod != null) {
- this.overduePageRecords[i]['Name__c'] =
- this.overduePageRecords[i].Prod.Name__c;
- }
- this.overduePageRecords[i]['Bar_Code__c'] =
- this.overduePageRecords[
- i
- ].orderdetails2.Bar_Code__c;
- this.overduePageRecords[i]['Box_Piece__c'] =
- this.overduePageRecords[
- i
- ].orderdetails2.Box_Piece__c;
- this.overduePageRecords[i]['Sterilization_limit__c'] =
- this.overduePageRecords[
- i
- ].orderdetails2.Sterilization_limit__c;
- }
- this.data = JSON.parse(result.entity.codPageRecords);
- console.log(' this.data' + JSON.stringify(this.data));
- for (var i in this.data) {
- this.data[i]['key'] =
- this.data[i]['prodid'] + this.data[i]['boxPiece'];
- }
- for (var i in this.data) {
- if (this.data[i]['check']) {
- this.selectedRows.push(
- this.data[i].prodid + this.data[i]['boxPiece']
- );
- console.log('selectedRows:' + this.selectedRows);
- }
- }
- this.showSpinner = false;
- this.showTable = true;
- } else {
- if (result.status == 'Success1') {
- this.overduePageRecords = JSON.parse(
- result.entity.overduePageRecords
- );
- this.overdueList = result.entity.overdueList;
- this.iSinventory = result.entity.iSinventory;
- console.log('result褰曞叆' + JSON.stringify(result));
- console.log(
- 'overdueList==>' + JSON.stringify(this.overdueList)
- );
- for (let i in this.overduePageRecords) {
- if (this.overduePageRecords[i].Prod != null) {
- this.overduePageRecords[i]['Name__c'] =
- this.overduePageRecords[i].Prod.Name__c;
- }
- this.overduePageRecords[i]['Bar_Code__c'] =
- this.overduePageRecords[
- i
- ].orderdetails2.Bar_Code__c;
- this.overduePageRecords[i]['Box_Piece__c'] =
- this.overduePageRecords[
- i
- ].orderdetails2.Box_Piece__c;
- this.overduePageRecords[i][
- 'Sterilization_limit__c'
- ] =
- this.overduePageRecords[
- i
- ].orderdetails2.Sterilization_limit__c;
- }
- this.data = JSON.parse(result.entity.codPageRecords);
- console.log(' this.data' + JSON.stringify(this.data));
- for (var i in this.data) {
- this.data[i]['key'] =
- this.data[i]['prodid'] +
- this.data[i]['boxPiece'];
- }
- for (var i in this.data) {
- if (this.data[i]['check']) {
- this.selectedRows.push(
- this.data[i].prodid +
- this.data[i]['boxPiece']
- );
- console.log(
- 'selectedRows:' + this.selectedRows
- );
- }
- }
- this.showSpinner = false;
- // this.showTables = true;
- this.showTable = true;
- } else {
- console.log('Error:' + result.msg);
- this.showMyToast(result.msg, '', 'error');
- this.showSpinner = false;
- this.showTable = true;
- }
+ .catch((error) => {
+ console.error("Error loading custom styles");
+ });
+ }
+ }
- // this.showMyToast('鑾峰彇澶辫触', result.msg, 'error');
- // this.showSpinner = false;
- }
- })
- .catch((error) => {
- this.showSpinner = false;
- console.log('error = ' + JSON.stringify(error));
- });
- }
- //鑾峰彇褰撳墠杈撳叆鍊�
- handleChange(event) {
- let value = event.detail.value;
- console.log('value' + value);
- this.barcode = value;
- console.log('this.barcode' + this.barcode);
- }
- getSelectedRows(event) {
- let selectedRowsEvent = event.detail.selectedRows;
- this.selectedRows = [];
- for (var i in selectedRowsEvent) {
- this.selectedRows.push(
- selectedRowsEvent[i].prodid + this.data[i]['boxPiece']
- );
- }
- console.log('this.selectedRows==>' + this.selectedRows);
- }
- //淇濆瓨
- saveConfirm() {
- console.log('杩涘叆閿�瀛樼‘璁�');
- this.showSpinner = true;
- //鏌ヨ鏈夊摢浜涢�夋嫨浜嗙殑鐒跺悗check
- const selectedRows = this.template
- .querySelector('c-lex-custom-lightning-datatable')
- .getSelectedRows();
- console.log('selectedRows========> ' + JSON.stringify(selectedRows));
+
+ //鍒濆鍖�
+ connectedCallback() {
+ console.log('鍒濆鍖�');
+ this.showSpinner = true;
+
+ init().then((result) => {
+ result = JSON.parse(JSON.stringify(result));
+ console.log('result =' + JSON.stringify(result));
+ console.log('result 1=' + result.entity.codPageRecords);
+ if (result.status = 'Success') {
+ this.data = JSON.parse(result.entity.codPageRecords);
+ this.codPageRecordsLWC = result.entity.codPageRecords;
+ console.log('this.data' + this.data);
+ this.accountName = result.entity.accountName;
+ this.agencyProType = result.entity.agencyProType;
+ this.userWorkLocation = result.entity.userWorkLocation;
for (var i in this.data) {
- this.data[i]['check'] = false;
+ this.data[i]["key"] = this.data[i]["prodid"] + this.data[i]["boxPiece"];
+ }
+ this.showTable = true;
+ // this.casesSpinner = false;
+ this.showSpinner = false;
+ } else {
+ this.showMyToast('鍒濆鍖栧け璐�', result.msg, 'error');
+ this.showSpinner = false;
+ }
+ }).catch((error) => {
+ console.log('error = ' + JSON.stringify(error));
+ this.showSpinner = false;
+ });
+ }
+ //barcode褰曞叆
+ barcodeEntrys() {
+ this.showSpinner = true;
+ this.showTable = false;
+ console.log('code' + this.barcode);
+ console.log(' this.accountName' + this.accountName);
+ console.log(' this.barcode' + this.barcode);
+ const selectedRows = this.template.querySelector('c-lex-custom-lightning-datatable').getSelectedRows();
+ console.log('selectedRows========> ' + JSON.stringify(selectedRows));
+ for (var i in this.data) {
+ this.data[i]["check"] = false;
+ }
+ for (var i in this.data) {
+ for (var j in selectedRows) {
+ if (this.data[i].prodid + this.data[i]["boxPiece"] == selectedRows[j].prodid + selectedRows[j]["boxPiece"]) {
+ this.data[i]["check"] = true;
+ }
+ }
+ }
+ barcodeEntry({
+ accountNameLWC: this.accountName,
+ agencyProTypeLWC: this.agencyProType,
+ userWorkLocationLWC: this.userWorkLocation,
+ barcodeLWC: this.barcode,
+ codPageRecordsLWC: JSON.stringify(this.data)
+ }).then((result) => {
+ result = JSON.parse(JSON.stringify(result));
+ if (result.status == 'Success') {
+ this.overduePageRecords = JSON.parse(result.entity.overduePageRecords);
+ this.overdueList = result.entity.overdueList;
+ this.iSinventory = result.entity.iSinventory;
+ console.log('result褰曞叆' + JSON.stringify(result));
+ console.log('overdueList==>' + JSON.stringify(this.overdueList));
+ for (let i in this.overduePageRecords) {
+ if (this.overduePageRecords[i].Prod != null) {
+ this.overduePageRecords[i]['Name__c'] = this.overduePageRecords[i].Prod.Name__c;
+
+ }
+ this.overduePageRecords[i]['Bar_Code__c'] = this.overduePageRecords[i].orderdetails2.Bar_Code__c;
+ this.overduePageRecords[i]['Box_Piece__c'] = this.overduePageRecords[i].orderdetails2.Box_Piece__c;
+ this.overduePageRecords[i]['Sterilization_limit__c'] = this.overduePageRecords[i].orderdetails2.Sterilization_limit__c;
+ }
+ this.data = JSON.parse(result.entity.codPageRecords);
+ console.log(' this.data' + JSON.stringify(this.data));
+ for (var i in this.data) {
+ this.data[i]["key"] = this.data[i]["prodid"] + this.data[i]["boxPiece"];
}
for (var i in this.data) {
- for (var j in selectedRows) {
- if (
- this.data[i].prodid + this.data[i]['boxPiece'] ==
- selectedRows[j].prodid + selectedRows[j]['boxPiece']
- ) {
- this.data[i]['check'] = true;
- }
+ if (this.data[i]['check']) {
+ this.selectedRows.push(this.data[i].prodid + this.data[i]["boxPiece"]);
+ console.log("selectedRows:" + this.selectedRows);
+ }
+ }
+ this.showSpinner = false;
+ this.showTable = true;
+ } else {
+ if (result.status == 'Success1') {
+ this.overduePageRecords = JSON.parse(result.entity.overduePageRecords);
+ this.overdueList = result.entity.overdueList;
+ this.iSinventory = result.entity.iSinventory;
+ console.log('result褰曞叆' + JSON.stringify(result));
+ console.log('overdueList==>' + JSON.stringify(this.overdueList));
+ for (let i in this.overduePageRecords) {
+ if (this.overduePageRecords[i].Prod != null) {
+ this.overduePageRecords[i]['Name__c'] = this.overduePageRecords[i].Prod.Name__c;
+
}
+ this.overduePageRecords[i]['Bar_Code__c'] = this.overduePageRecords[i].orderdetails2.Bar_Code__c;
+ this.overduePageRecords[i]['Box_Piece__c'] = this.overduePageRecords[i].orderdetails2.Box_Piece__c;
+ this.overduePageRecords[i]['Sterilization_limit__c'] = this.overduePageRecords[i].orderdetails2.Sterilization_limit__c;
+ }
+ this.data = JSON.parse(result.entity.codPageRecords);
+ console.log(' this.data' + JSON.stringify(this.data));
+ for (var i in this.data) {
+ this.data[i]["key"] = this.data[i]["prodid"] + this.data[i]["boxPiece"];
+ }
+ for (var i in this.data) {
+ if (this.data[i]['check']) {
+ this.selectedRows.push(this.data[i].prodid + this.data[i]["boxPiece"]);
+ console.log("selectedRows:" + this.selectedRows);
+ }
+ }
+ this.showSpinner = false;
+ // this.showTables = true;
+ this.showTable = true;
+ }else {
+ console.log('Error:' + result.msg);
+ this.showMyToast(result.msg,'','error');
+ this.showSpinner = false;
+ this.showTable = true;
+
}
- save({
- iSinventory: this.iSinventory,
- saveCodPageRecords: JSON.stringify(this.data),
- // saveoverdueList:JSON.stringify(this.overdueList)
- saveoverdueList: this.overdueList
- })
- .then((result) => {
- result = JSON.parse(JSON.stringify(result));
- console.log('result淇濆瓨 = ' + JSON.stringify(result));
- if (result.status == 'Success') {
- this[NavigationMixin.Navigate]({
- type: 'standard__recordPage',
- attributes: {
- recordId: result.entity.Id,
- objectApiName: 'Consumable_order__c',
- actionName: 'view'
- }
- });
- this.showSpinner = false;
- } else {
- this.showMyToast('閿�瀛樺け璐�', result.msg, 'error');
- this.showSpinner = false;
- }
- })
- .catch((error) => {
- console.log('error = ' + JSON.stringify(error));
- this.showSpinner = false;
- });
- }
- showMyToast(title, message, variant) {
- console.log('show custom message');
- var iconName = '';
- var content = '';
- if (variant == 'success') {
- iconName = 'utility:check';
- } else {
- iconName = 'utility:error';
- }
- if (message != '') {
- content =
- '<h2><strong>' +
- title +
- '<strong/></h2><h5>' +
- message +
- '</h5>';
- } else {
- content = '<h2><strong>' + title + '<strong/></h2>';
- }
- this.template
- .querySelector('c-common-toast')
- .showToast(variant, content, iconName, 10000);
+ // this.showMyToast('鑾峰彇澶辫触', result.msg, 'error');
+ // this.showSpinner = false;
+ }
+
+ }).catch((error) => {
+ this.showSpinner = false;
+ console.log('error = ' + JSON.stringify(error));
+ });
+
+ }
+ //鑾峰彇褰撳墠杈撳叆鍊�
+ handleChange(event) {
+ let value = event.detail.value;
+ console.log('value' + value);
+ this.barcode = value;
+ console.log('this.barcode' + this.barcode);
+ }
+ getSelectedRows(event) {
+ let selectedRowsEvent = event.detail.selectedRows;
+ this.selectedRows = [];
+ for (var i in selectedRowsEvent) {
+ this.selectedRows.push(selectedRowsEvent[i].prodid+this.data[i]["boxPiece"]);
+ }
+ console.log('this.selectedRows==>'+this.selectedRows);
+
+ }
+ //淇濆瓨
+ saveConfirm() {
+ console.log('杩涘叆閿�瀛樼‘璁�');
+ this.showSpinner = true;
+ //鏌ヨ鏈夊摢浜涢�夋嫨浜嗙殑鐒跺悗check
+ const selectedRows = this.template.querySelector('c-lex-custom-lightning-datatable').getSelectedRows();
+ console.log('selectedRows========> ' + JSON.stringify(selectedRows));
+ for (var i in this.data) {
+ this.data[i]["check"] = false;
+ }
+ for (var i in this.data) {
+ for (var j in selectedRows) {
+ if (this.data[i].prodid+this.data[i]["boxPiece"] == selectedRows[j].prodid+ selectedRows[j]["boxPiece"]) {
+ this.data[i]["check"] = true;
+ }
+ }
+ }
+ save({
+ iSinventory: this.iSinventory,
+ saveCodPageRecords: JSON.stringify(this.data),
+ // saveoverdueList:JSON.stringify(this.overdueList)
+ saveoverdueList: this.overdueList
+ }).then((result) => {
+ result = JSON.parse(JSON.stringify(result));
+ console.log('result淇濆瓨 = ' + JSON.stringify(result));
+ if (result.status == 'Success') {
+ this[NavigationMixin.Navigate]({
+ type: 'standard__recordPage',
+ attributes: {
+ recordId: result.entity.Id,
+ objectApiName: 'Consumable_order__c',
+ actionName: 'view'
+ }
+ });
+ this.showSpinner = false;
+ } else {
+ this.showMyToast('閿�瀛樺け璐�', result.msg, 'error');
+ this.showSpinner = false;
+
+ }
+ })
+ .catch((error) => {
+ console.log('error = ' + JSON.stringify(error));
+ this.showSpinner = false;
+ });
+ }
+
+ showMyToast(title, message, variant) {
+ console.log('show custom message');
+ var iconName = '';
+ var content = '';
+ if (variant == 'success') {
+ iconName = 'utility:check';
+ } else {
+ iconName = 'utility:error';
}
-}
+ if (message != '') {
+ content = '<h2><strong>' + title + '<strong/></h2><h5>' + message + '</h5>';
+ } else {
+ content = '<h2><strong>' + title + '<strong/></h2>';
+ }
+ this.template.querySelector('c-common-toast').showToast(variant, content, iconName, 10000);
+ }
+
+}
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexProductLimitEdit/lexProductLimitEdit.html b/force-app/main/default/lwc/lexProductLimitEdit/lexProductLimitEdit.html
index 42d89f8..b6a3c31 100644
--- a/force-app/main/default/lwc/lexProductLimitEdit/lexProductLimitEdit.html
+++ b/force-app/main/default/lwc/lexProductLimitEdit/lexProductLimitEdit.html
@@ -2,21 +2,9 @@
<template if:true={showSpinner}>
<lightning-spinner size="medium" variant="brand"></lightning-spinner>
</template>
- <c-common-toast></c-common-toast>
- <div
- style="
- border: 1px solid #d4d4d4;
- border-radius: 5px;
- margin-bottom: 7px;
- "
- >
- <div
- style="
- border-top: 3px solid #51606e;
- border-bottom: 1px solid #d4d4d4;
- padding: 3px;
- "
- >
+ <c-common-toast></c-common-toast>
+ <div style="border: 1px solid #D4D4D4;border-radius:5px;margin-bottom:7px;">
+ <div style="border-top: 3px solid #51606E;border-bottom: 1px solid #D4D4D4;padding:3px;">
<!-- <p style="font-size: 18px;"><strong>缁忛攢鍟嗗簱瀛樹笂涓嬮檺缂栬緫</strong></p> -->
<lightning-layout>
<lightning-layout-item padding="around-small">
@@ -26,142 +14,69 @@
</lightning-layout-item>
</lightning-layout>
- <table
- class="slds-table slds-table_cell-buffer slds-table_bordered"
- >
+ <table class="slds-table slds-table_cell-buffer slds-table_bordered">
<thead>
<tr class="">
<!-- <th class="slds-size_3-of-10" scope="col">
<div class="slds-truncate" title="Name">S.No</div>
</th> -->
<th scope="col" align="center">
- <div
- class="slds-truncate"
- style="font-size: 16px"
- title="Name"
- >
- 浜у搧鍨嬪彿
+ <div class="slds-truncate" style="font-size:16px;" title="Name">浜у搧鍨嬪彿</div>
+ </th>
+ <th scope="col">
+ <div class="slds-truncate" style="font-size:16px;" title="First Name">
+ 搴撳瓨涓嬮檺
</div>
</th>
<th scope="col">
- <div
- class="slds-truncate"
- style="font-size: 16px"
- title="First Name"
- >
- 搴撳瓨涓嬮檺
- </div>
+ <div class="slds-truncate" style="font-size:16px;" title="Last Name">搴撳瓨涓婇檺</div>
</th>
<th scope="col">
- <div
- class="slds-truncate"
- style="font-size: 16px"
- title="Last Name"
- >
- 搴撳瓨涓婇檺
- </div>
- </th>
- <th scope="col">
- <div
- class="slds-truncate"
- style="font-size: 16px"
- title="Last Name"
- >
- 鎿嶄綔
- </div>
+ <div class="slds-truncate" style="font-size:16px;" title="Last Name">鎿嶄綔</div>
</th>
</tr>
</thead>
<tbody>
- <template
- for:each={invRecords}
- for:item="inv"
- for:index="indexVar"
- >
+ <template for:each = {invRecords} for:item = "inv" for:index="indexVar">
<tr key={inv.key} class="slds-hint-parent">
<td>
<div>
- <lightning-input
- key={inv.key}
- data-id={inv.key}
- data-index={indexVar}
- name="productNumber"
- label="productNumber"
- value={inv.productNumber}
- variant="label-hidden"
- onchange={handleProductChange}
- ></lightning-input>
+ <lightning-input key={inv.key} data-id={inv.key} data-index={indexVar} name="productNumber" label="productNumber" value={inv.productNumber} variant="label-hidden" onchange={handleProductChange}></lightning-input>
</div>
</td>
<td>
<div>
- <lightning-input
- key={inv.key}
- data-id={inv.key}
- data-index={indexVar}
- name="inventory1"
- label="inventory1"
- value={inv.inventory1}
- variant="label-hidden"
- onchange={handleProductChange}
- ></lightning-input>
+ <lightning-input key={inv.key} data-id={inv.key} data-index={indexVar} name="inventory1" label="inventory1" value={inv.inventory1} variant="label-hidden" onchange={handleProductChange}></lightning-input>
</div>
</td>
<td>
<div>
- <lightning-input
- key={inv.key}
- data-id={inv.key}
- data-index={indexVar}
- name="inventory2"
- label="inventory2"
- value={inv.inventory2}
- variant="label-hidden"
- onchange={handleProductChange}
- ></lightning-input>
+ <lightning-input key={inv.key} data-id={inv.key} data-index={indexVar} name="inventory2" label="inventory2" value={inv.inventory2} variant="label-hidden" onchange={handleProductChange}></lightning-input>
</div>
</td>
<td>
- <a
- name={indexVar}
- data-id={inv.key}
- onclick={removeRow}
- >
- <lightning-icon
- icon-name="utility:delete"
- alternative-text="delete"
- size="small"
- ></lightning-icon>
+ <a name={indexVar} data-id={inv.key} onclick={removeRow}>
+ <lightning-icon icon-name="utility:delete" alternative-text="delete" size="small"></lightning-icon>
</a>
</td>
</tr>
</template>
- <tr>
+ <tr>
<td></td>
<td>
<!-- <lightning-button label="琛屽鍔�" onclick={addRow} class="slds-m-left_x-small lexBorder"></lightning-button> -->
- <button
- class="slds-m-left_x-small slds-button slds-button_neutral slds-button_stretch lexBorder"
- label="琛屽鍔�"
- onclick={addRow}
- >
- 琛屽鍔�
- </button>
+ <button class="slds-m-left_x-small slds-button slds-button_neutral slds-button_stretch lexBorder" label="琛屽鍔�" onclick={addRow}>琛屽鍔�</button>
</td>
- <td>
+ <td>
<!-- <lightning-button label="淇濆瓨" onclick={handleClick} class="slds-m-left_x-small lexBorder"></lightning-button> -->
- <button
- class="slds-m-left_x-small slds-button slds-button_neutral slds-button_stretch lexBorder"
- label="淇濆瓨"
- onclick={handleClick}
- >
- 淇濆瓨
- </button>
+ <button class="slds-m-left_x-small slds-button slds-button_neutral slds-button_stretch lexBorder" label="淇濆瓨" onclick={handleClick}>淇濆瓨</button>
</td>
<td></td>
+
</tr>
</tbody>
- </table>
+ </table>
+
</div>
- </div>
-</template>
+ </div>
+</template>
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexProductLimitEdit/lexProductLimitEdit.js b/force-app/main/default/lwc/lexProductLimitEdit/lexProductLimitEdit.js
index 6c15970..025f40b 100644
--- a/force-app/main/default/lwc/lexProductLimitEdit/lexProductLimitEdit.js
+++ b/force-app/main/default/lwc/lexProductLimitEdit/lexProductLimitEdit.js
@@ -1,11 +1,9 @@
import { LightningElement, wire, api, track } from 'lwc';
-import oninit from '@salesforce/apex/LexProductLimitEditController.init';
-import save from '@salesforce/apex/LexUpAccountProLimit.upAccount';
+import oninit from "@salesforce/apex/LexProductLimitEditController.init";
+import save from "@salesforce/apex/LexUpAccountProLimit.upAccount";
import { ShowToastEvent } from 'lightning/platformShowToastEvent';
-import { NavigationMixin } from 'lightning/navigation';
-export default class LexProductLimitEdit extends NavigationMixin(
- LightningElement
-) {
+import { NavigationMixin } from "lightning/navigation";
+export default class LexProductLimitEdit extends NavigationMixin(LightningElement) {
@track invRecords = [];
@track accountid;
@track upstring = '';
@@ -13,8 +11,8 @@
@track showSpinner = true;
//鑾峰彇閾炬帴鍙傛暟
getQueryString(name) {
- console.log('getQueryString name ' + name);
- let reg = new RegExp('(^|&)' + name + '=([^&]*)(&|$)', 'i');
+ console.log("getQueryString name " + name);
+ let reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");
let r = window.location.search.substr(1).match(reg);
if (r != null) {
return decodeURIComponent(r[2]);
@@ -26,48 +24,47 @@
this.showSpinner = true;
console.log(' === connectedCallback === ');
//鑾峰彇accountid userPro_Type
- this.accountid = this.getQueryString('accountid');
- this.accountid = this.accountid == null ? '' : this.accountid;
- this.userPro_Type = this.getQueryString('userPro_Type');
- this.userPro_Type = this.userPro_Type == null ? '' : this.userPro_Type;
+ this.accountid = this.getQueryString("accountid");
+ this.accountid = this.accountid == null ? "" : this.accountid;
+ this.userPro_Type = this.getQueryString("userPro_Type");
+ this.userPro_Type = this.userPro_Type == null ? "" : this.userPro_Type;
//鑾峰彇鏁版嵁
oninit({
accountid: this.accountid,
userPro_Type: this.userPro_Type
- })
- .then((result) => {
- result = JSON.parse(JSON.stringify(result));
- console.log('result' + JSON.stringify(result));
- if (result.status == 'Success') {
- console.log('11===>' + result.entity.product_Limit);
- console.log('11===>' + typeof result.entity.product_Limit);
- let str = result.entity.product_Limit;
- var arr = str.split(',');
- console.log('arr==>' + arr);
- console.log('arr==>' + arr.length);
- console.log('arr==>' + typeof arr);
- for (var i in arr) {
- var arry = arr[i].split('|');
- this.invRecords.push({
- productNumber: arry[0],
- inventory1: arry[1],
- inventory2: arry[2]
- });
- }
- this.showSpinner = false;
- console.log(
- 'this.invRecords' + JSON.stringify(this.invRecords)
- );
- } else {
- this.showSpinner = false;
- console.log('error = ' + JSON.stringify(error));
+
+ }).then((result) => {
+ result = JSON.parse(JSON.stringify(result));
+ console.log('result' + JSON.stringify(result));
+ if (result.status == 'Success') {
+ console.log('11===>' + result.entity.product_Limit);
+ console.log('11===>' + typeof (result.entity.product_Limit));
+ let str = result.entity.product_Limit;
+ var arr = str.split(',');
+ console.log('arr==>' + arr);
+ console.log('arr==>' + arr.length);
+ console.log('arr==>' + typeof (arr));
+ for (var i in arr) {
+ var arry = arr[i].split('|');
+ this.invRecords.push({
+ productNumber: arry[0],
+ inventory1: arry[1],
+ inventory2: arry[2]
+ });
}
- })
- .catch((error) => {
this.showSpinner = false;
- console.log('error = ' + JSON.stringify(error));
- });
+ console.log('this.invRecords' + JSON.stringify(this.invRecords));
+ } else {
+ this.showSpinner = false;
+ console.log("error = " + JSON.stringify(error));
+
+ }
+ }).catch((error) => {
+ this.showSpinner = false;
+ console.log("error = " + JSON.stringify(error));
+ });
// this.inventoryTempRecords();
+
}
addRow() {
@@ -76,7 +73,7 @@
inventory1: '',
inventory2: '',
id: ++this.keyIndex
- };
+ }
this.invRecords = [...this.invRecords, Object.create(objRow)];
}
removeRow(event) {
@@ -92,59 +89,30 @@
console.log('淇濆瓨');
console.log('this.invRecords' + JSON.stringify(this.invRecords));
for (var i in this.invRecords) {
- console.log('inven1' + this.invRecords[i]['inventory1']);
- console.log('鏁板瓧1' + this.isNum(this.invRecords[i]['inventory1']));
- console.log('inven2' + this.invRecords[i]['inventory2']);
- console.log('鏁板瓧2' + this.isNum(this.invRecords[i]['inventory2']));
- if (
- this.invRecords[i]['inventory1'] == '' ||
- this.invRecords[i]['inventory1'] == null ||
- this.invRecords[i]['inventory2'] == null ||
- this.invRecords[i]['inventory2'] == ''
- ) {
- this.showMyToast(
- '淇濆瓨澶辫触',
- '杈撳叆鏍煎紡涓嶆纭�,璇疯緭鍏ユ暟瀛�',
- 'error'
- );
+ console.log('inven1' + this.invRecords[i]["inventory1"]);
+ console.log('鏁板瓧1' + this.isNum(this.invRecords[i]["inventory1"]));
+ console.log('inven2' + this.invRecords[i]["inventory2"]);
+ console.log('鏁板瓧2' + this.isNum(this.invRecords[i]["inventory2"]));
+ if (this.invRecords[i]["inventory1"] == '' || this.invRecords[i]["inventory1"] == null || this.invRecords[i]["inventory2"] == null || this.invRecords[i]["inventory2"] == '') {
+ this.showMyToast('淇濆瓨澶辫触', '杈撳叆鏍煎紡涓嶆纭�,璇疯緭鍏ユ暟瀛�', 'error');
this.showSpinner = false;
return;
}
- if (
- this.isNum(this.invRecords[i]['inventory1']) == false ||
- this.isNum(this.invRecords[i]['inventory2']) == false
- ) {
- this.showMyToast(
- '淇濆瓨澶辫触',
- '杈撳叆鏍煎紡涓嶆纭�,璇疯緭鍏ユ暟瀛�',
- 'error'
- );
+ if( this.isNum(this.invRecords[i]["inventory1"]) == false || this.isNum(this.invRecords[i]["inventory2"]) == false){
+ this.showMyToast('淇濆瓨澶辫触', '杈撳叆鏍煎紡涓嶆纭�,璇疯緭鍏ユ暟瀛�', 'error');
this.showSpinner = false;
return;
+
}
- if (
- Number(this.invRecords[i]['inventory1']) >
- Number(this.invRecords[i]['inventory2'])
- ) {
- this.showMyToast(
- '淇濆瓨澶辫触',
- this.invRecords[i]['productNumber'] + '搴撳瓨涓嬮檺澶т簬涓婇檺',
- 'error'
- );
+ if (Number(this.invRecords[i]["inventory1"]) > Number(this.invRecords[i]["inventory2"])) {
+ this.showMyToast('淇濆瓨澶辫触', this.invRecords[i]["productNumber"] + '搴撳瓨涓嬮檺澶т簬涓婇檺', 'error');
this.showSpinner = false;
return;
}
}
- let dataStr = '';
+ let dataStr = ''
for (var i in this.invRecords) {
- dataStr =
- dataStr +
- this.invRecords[i]['productNumber'] +
- '|' +
- this.invRecords[i]['inventory1'] +
- '|' +
- this.invRecords[i]['inventory2'] +
- ',';
+ dataStr = dataStr + this.invRecords[i]["productNumber"] + '|' + this.invRecords[i]["inventory1"] + '|' + this.invRecords[i]["inventory2"] + ',';
}
console.log('dataStr==>' + dataStr);
this.upstring = dataStr.substring(0, dataStr.lastIndexOf(','));
@@ -153,26 +121,26 @@
accountId: this.accountid,
productLimit: this.upstring,
userPro_Type: this.userPro_Type
- })
- .then((result) => {
- result = JSON.parse(JSON.stringify(result));
- console.log('result===>' + JSON.stringify(result));
- if (result.status == 'Success') {
- this.showMyToast('淇濆瓨鎴愬姛', '', 'success');
- this.showSpinner = false;
- // setTimeout(this.toLexToppage(),5000 );
- setTimeout(() => {
- this.toLexToppage();
- }, 500);
- } else {
- this.showMyToast('淇濆瓨澶辫触', result.msg, 'error');
- this.showSpinner = false;
- }
- })
- .catch((error) => {
- console.log('error = ' + JSON.stringify(error));
+ }).then((result) => {
+ result = JSON.parse(JSON.stringify(result));
+ console.log('result===>' + JSON.stringify(result));
+ if (result.status == 'Success') {
+ this.showMyToast('淇濆瓨鎴愬姛', '', 'success');
this.showSpinner = false;
- });
+ // setTimeout(this.toLexToppage(),5000 );
+ setTimeout(() => {
+ this.toLexToppage();
+ }, 500);
+
+ } else {
+ this.showMyToast('淇濆瓨澶辫触', result.msg, 'error');
+ this.showSpinner = false;
+
+ }
+ }).catch((error) => {
+ console.log("error = " + JSON.stringify(error));
+ this.showSpinner = false;
+ });
this.inventoryTempRecords();
console.log('Save ==> ' + JSON.stringify(toSaveList));
@@ -180,16 +148,15 @@
handleProductChange(event) {
if (event.target.name == 'productNumber') {
- this.invRecords[event.currentTarget.dataset.index].productNumber =
- event.target.value;
+ this.invRecords[event.currentTarget.dataset.index].productNumber = event.target.value;
console.log('===>invrecords' + JSON.stringify(this.invRecords));
- } else if (event.target.name == 'inventory1') {
- this.invRecords[event.currentTarget.dataset.index].inventory1 =
- event.target.value;
+ }
+ else if (event.target.name == 'inventory1') {
+ this.invRecords[event.currentTarget.dataset.index].inventory1 = event.target.value;
console.log('===>invrecords' + JSON.stringify(this.invRecords));
- } else if (event.target.name == 'inventory2') {
- this.invRecords[event.currentTarget.dataset.index].inventory2 =
- event.target.value;
+ }
+ else if (event.target.name == 'inventory2') {
+ this.invRecords[event.currentTarget.dataset.index].inventory2 = event.target.value;
console.log('===>invrecords' + JSON.stringify(this.invRecords));
}
}
@@ -197,7 +164,7 @@
//鏁板瓧楠岃瘉
isNum(num) {
var reNum = /^[0-9]+$/;
- return reNum.test(num);
+ return (reNum.test(num));
}
showMyToast(title, message, variant) {
console.log('show custom message');
@@ -209,18 +176,11 @@
iconName = 'utility:error';
}
if (message != '') {
- content =
- '<h2><strong>' +
- title +
- '<strong/></h2><h5>' +
- message +
- '</h5>';
+ content = '<h2><strong>' + title + '<strong/></h2><h5>' + message + '</h5>';
} else {
content = '<h2><strong>' + title + '<strong/></h2>';
}
- this.template
- .querySelector('c-common-toast')
- .showToast(variant, content, iconName, 10000);
+ this.template.querySelector('c-common-toast').showToast(variant, content, iconName, 10000);
}
toLexToppage() {
this[NavigationMixin.Navigate]({
@@ -230,4 +190,4 @@
}
});
}
-}
+}
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexRemoveBox/lexRemoveBox.html b/force-app/main/default/lwc/lexRemoveBox/lexRemoveBox.html
index a11966b..b8546a2 100644
--- a/force-app/main/default/lwc/lexRemoveBox/lexRemoveBox.html
+++ b/force-app/main/default/lwc/lexRemoveBox/lexRemoveBox.html
@@ -1,231 +1,141 @@
<template>
- <template if:true={showSpinner}>
- <!-- <lightning-spinner size="medium" variant="brand"></lightning-spinner> -->
- <div class="slds-spinner_container">
- <div
- role="status"
- class="slds-spinner slds-spinner_medium slds-spinner_brand"
- >
- <span class="slds-assistive-text">Loading</span>
- <div class="slds-spinner__dot-a"></div>
- <div class="slds-spinner__dot-b"></div>
- </div>
- </div>
- </template>
- <c-common-toast></c-common-toast>
- <div style="border: 1px solid #d4d4d4; border-radius: 5px">
- <div
- style="
- border-top: 3px solid #51606e;
- border-bottom: 1px solid #d4d4d4;
- padding: 3px;
- "
- >
- <div>
- <!-- <p style="font-size: 18px;"><strong>鎷嗙洅</strong></p> -->
- <lightning-layout>
- <lightning-layout-item padding="around-small">
- <p style="font-size: 18px">
- <strong>鎷嗙洅</strong>
- </p>
- </lightning-layout-item>
- </lightning-layout>
- </div>
- </div>
- <div style="padding: 10px">
- <div
- style="
- border: 1px solid #d4d4d4;
- border-radius: 5px;
- margin-bottom: 7px;
- "
- >
- <div
- style="
- border-top: 3px solid #51606e;
- border-bottom: 1px solid #d4d4d4;
- padding: 3px;
- "
- >
- <!-- <lightning-button variant="brand" class='lexstyle' style="margin-left:10px;" label="鎷嗙洅纭" title="鎷嗙洅纭" onclick={saveConfirm}></lightning-button>-->
- <button
- class="slds-button slds-button_neutral slds-button_stretch lexBorder"
- style="
- margin-left: 10px;
- margin-top: 12px;
- margin-bottom: 12px;
- "
- label="鎷嗙洅纭"
- onclick={saveConfirm}
- >
- 鎷嗙洅纭
- </button>
- </div>
- </div>
- <div
- style="
- border: 1px solid #d4d4d4;
- border-radius: 5px;
- margin-bottom: 7px;
- margin-top: 5px;
- "
- >
- <div
- style="
- border-top: 3px solid #51606e;
- border-bottom: 1px solid #d4d4d4;
- padding: 3px;
- "
- >
- <lightning-layout>
- <lightning-layout-item padding="around-small">
- <p style="font-size: 16px">
- <strong>BarCode褰曞叆</strong>
- </p>
- </lightning-layout-item>
- </lightning-layout>
- </div>
+ <template if:true={showSpinner}>
+ <!-- <lightning-spinner size="medium" variant="brand"></lightning-spinner> -->
+ <div class="slds-spinner_container">
+ <div role="status" class="slds-spinner slds-spinner_medium slds-spinner_brand">
+ <span class="slds-assistive-text">Loading</span>
+ <div class="slds-spinner__dot-a"></div>
+ <div class="slds-spinner__dot-b"></div>
+ </div>
+ </div>
+ </template>
+ <c-common-toast></c-common-toast>
+ <div style="border: 1px solid #D4D4D4;border-radius:5px;">
- <!-- <div style="border-top: 3px solid #51606E;border-bottom: 1px solid #D4D4D4;padding:3px;"> -->
- <table>
- <colgroup>
- <col width="160px" />
- <col width="100px" />
- <col width="10px" />
- <col width="70px" />
- <col width="100px" />
- <col width="10px" />
- <col width="90px" />
- <col width="100px" />
- <col width="10px" />
- <col width="85px" />
- <col width="100px" />
- <col width="10px" />
- <col width="70px" />
- <col width="100px" />
- </colgroup>
- <tbody>
- <tr>
- <td></td>
- <td align="right" class="searchName">BarCode</td>
- <td style="width: 600px">
- <lightning-textarea
- class="inputFont"
- name="BarCode"
- label=""
- onchange={handleChange}
- ></lightning-textarea>
- </td>
- <td align="right"></td>
- <td></td>
- <td style="width: 200px">
- <button
- style="margin-top: 14px"
- class="slds-button slds-button_neutral slds-button_stretch lexBorder"
- label="鑾峰彇鏄庣粏"
- onclick={getDetails}
- >
- 鑾峰彇鏄庣粏
- </button>
- <!-- <lightning-button variant="brand" class='lexstyle' label="鑾峰彇鏄庣粏" title="鑾峰彇鏄庣粏" onclick={getDetails}
+ <div style="border-top: 3px solid #51606E;;border-bottom: 1px solid #D4D4D4;padding:3px;">
+ <div>
+ <!-- <p style="font-size: 18px;"><strong>鎷嗙洅</strong></p> -->
+ <lightning-layout>
+ <lightning-layout-item padding="around-small">
+ <p style="font-size: 18px">
+ <strong>鎷嗙洅</strong>
+ </p>
+ </lightning-layout-item>
+ </lightning-layout>
+ </div>
+ </div>
+ <div style="padding:10px;">
+ <div style="border: 1px solid #D4D4D4;border-radius:5px;margin-bottom:7px;">
+ <div style="border-top: 3px solid #51606E;border-bottom: 1px solid #D4D4D4;padding:3px;">
+ <!-- <lightning-button variant="brand" class='lexstyle' style="margin-left:10px;" label="鎷嗙洅纭" title="鎷嗙洅纭" onclick={saveConfirm}></lightning-button>-->
+ <button class="slds-button slds-button_neutral slds-button_stretch lexBorder" style="margin-left:10px;margin-top:12px;margin-bottom:12px;" label="鎷嗙洅纭" onclick={saveConfirm}>鎷嗙洅纭</button>
+ </div>
+ </div>
+ <div style="border: 1px solid #D4D4D4;border-radius:5px;margin-bottom:7px;margin-top:5px;">
+ <div style="border-top: 3px solid #51606E;border-bottom: 1px solid #D4D4D4;padding:3px;">
+ <lightning-layout>
+ <lightning-layout-item padding="around-small">
+ <p style="font-size: 16px">
+ <strong>BarCode褰曞叆</strong>
+ </p>
+ </lightning-layout-item>
+ </lightning-layout>
+ </div>
+
+ <!-- <div style="border-top: 3px solid #51606E;border-bottom: 1px solid #D4D4D4;padding:3px;"> -->
+ <table>
+ <colgroup>
+ <col width="160px" />
+ <col width="100px" />
+ <col width="10px" />
+ <col width="70px" />
+ <col width="100px" />
+ <col width="10px" />
+ <col width="90px" />
+ <col width="100px" />
+ <col width="10px" />
+ <col width="85px" />
+ <col width="100px" />
+ <col width="10px" />
+ <col width="70px" />
+ <col width="100px" />
+ </colgroup>
+ <tbody>
+ <tr>
+ <td></td>
+ <td align="right" class="searchName">BarCode</td>
+ <td style="width:600px"><lightning-textarea class="inputFont" name="BarCode" label=""
+ onchange={handleChange}></lightning-textarea></td>
+ <td align="right"></td>
+ <td></td>
+ <td style="width: 200px;">
+ <button style="margin-top:14px;" class="slds-button slds-button_neutral slds-button_stretch lexBorder" label="鑾峰彇鏄庣粏" onclick={getDetails}>鑾峰彇鏄庣粏</button>
+ <!-- <lightning-button variant="brand" class='lexstyle' label="鑾峰彇鏄庣粏" title="鑾峰彇鏄庣粏" onclick={getDetails}
></lightning-button> -->
- </td>
- </tr>
- </tbody>
- </table>
- <!-- </div> -->
- </div>
+ </td>
+ </tr>
+ </tbody>
+ </table>
+ <!-- </div> -->
+ </div>
- <div
- style="
- border: 1px solid #d4d4d4;
- border-radius: 5px;
- margin-bottom: 7px;
- margin-top: 10px;
- "
- >
- <div
- style="
- border-top: 3px solid #51606e;
- border-bottom: 1px solid #d4d4d4;
- padding: 3px;
- "
- >
- <lightning-layout>
- <lightning-layout-item padding="around-small">
- <p style="font-size: 18px">
- <strong>鎷嗙洅鏄庣粏</strong>
- </p>
- </lightning-layout-item>
- </lightning-layout>
- </div>
- <div style="padding: 10px">
- <lightning-datatable
- key-field="prodid"
- data={data}
- columns={columns}
- onrowselection={getSelectedRows}
- hide-checkbox-column="true"
- selected-rows={selectedRows}
- class="wrapped-header-datatable"
- style="word-wrap: break-word; word-break: break-all"
- >
- </lightning-datatable>
- </div>
- </div>
- <div
- style="
- border: 1px solid #d4d4d4;
- border-radius: 5px;
- margin-bottom: 7px;
- margin-top: 10px;
- "
- >
- <div
- style="
- border-top: 3px solid #51606e;
- border-bottom: 1px solid #d4d4d4;
- padding: 3px;
- "
- >
- <table>
- <tr>
- <td>
- <lightning-layout>
- <lightning-layout-item
- padding="around-small"
- >
- <p style="font-size: 18px">
- <strong>閿欒鏄庣粏</strong>
- </p>
- </lightning-layout-item>
- </lightning-layout>
- </td>
- </tr>
- </table>
- </div>
+ <div style="border: 1px solid #D4D4D4;border-radius:5px;margin-bottom:7px;margin-top:10px">
+ <div style="border-top: 3px solid #51606E;border-bottom: 1px solid #D4D4D4;padding:3px;">
+ <lightning-layout>
+ <lightning-layout-item padding="around-small">
+ <p style="font-size: 18px">
+ <strong>鎷嗙洅鏄庣粏</strong>
+ </p>
+ </lightning-layout-item>
+ </lightning-layout>
+ </div>
+ <div style="padding:10px;">
- <div style="padding: 10px">
- <!-- <template if:true={showTables}> -->
+ <lightning-datatable
+ key-field="prodid" data={data} columns={columns}
+ onrowselection={getSelectedRows} hide-checkbox-column="true"
+ selected-rows={selectedRows} class="wrapped-header-datatable" style="word-wrap:break-word; word-break:break-all; ">
+ </lightning-datatable>
+ </div>
+ </div>
+ <div style="border: 1px solid #D4D4D4;border-radius:5px;margin-bottom:7px;margin-top:10px">
+ <div style="border-top: 3px solid #51606E;border-bottom: 1px solid #D4D4D4;padding:3px;">
+ <table>
+ <tr>
+ <td>
+ <lightning-layout>
+ <lightning-layout-item padding="around-small">
+ <p style="font-size: 18px">
+ <strong>閿欒鏄庣粏</strong>
+ </p>
+ </lightning-layout-item>
+ </lightning-layout>
+ </td>
+ </tr>
+ </table>
+ </div>
- <!-- <c-lex-custom-lightning-datatable key-field="id" data={errorDetail} columns={column}
+ <div style="padding:10px;">
+ <!-- <template if:true={showTables}> -->
+
+ <!-- <c-lex-custom-lightning-datatable key-field="id" data={errorDetail} columns={column}
onrowselection={getSelectedRows} hide-checkbox-column="true"
selected-rows={selectedRows}>
</c-lex-custom-lightning-datatable> -->
- <lightning-datatable
- key-field="id"
- data={errorDetail}
- columns={column}
- onrowselection={getSelectedRows}
- hide-checkbox-column="true"
- selected-rows={selectedRows}
- class="wrapped-header-datatable"
- style="word-wrap: break-word; word-break: break-all"
- >
- </lightning-datatable>
- <!-- </template> -->
- </div>
- </div>
- </div>
- </div>
-</template>
+ <lightning-datatable
+ key-field="id" data={errorDetail} columns={column}
+ onrowselection={getSelectedRows} hide-checkbox-column="true"
+ selected-rows={selectedRows} class="wrapped-header-datatable" style="word-wrap:break-word; word-break:break-all; ">
+ </lightning-datatable>
+ <!-- </template> -->
+
+
+ </div>
+ </div>
+ </div>
+
+
+
+ </div>
+
+</template>
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexRemoveBox/lexRemoveBox.js b/force-app/main/default/lwc/lexRemoveBox/lexRemoveBox.js
index 156b5bf..440d3e2 100644
--- a/force-app/main/default/lwc/lexRemoveBox/lexRemoveBox.js
+++ b/force-app/main/default/lwc/lexRemoveBox/lexRemoveBox.js
@@ -4,253 +4,248 @@
import saveconfirm from '@salesforce/apex/LexRemoveBoxController.removeBoxConfirm';
import { ShowToastEvent } from 'lightning/platformShowToastEvent';
// import { NavigationMixin } from 'lightning/navigation';
-//table css
-import { loadStyle } from 'lightning/platformResourceLoader';
-import WrappedHeaderTable from '@salesforce/resourceUrl/lexdatatable';
+//table css
+import { loadStyle } from "lightning/platformResourceLoader";
+import WrappedHeaderTable from "@salesforce/resourceUrl/lexdatatable";
const columns = [
- {
- label: '娑堣�楀搧鍚嶇О',
- fieldName: 'Name__c',
- wrapText: true,
- hideDefaultActions: true
- // initialWidth: 400,
- },
- {
- label: '瑙勬牸',
- fieldName: 'ProductPacking_list_manual__c',
- hideDefaultActions: true,
- initialWidth: 50,
- cellAttributes: { alignment: 'right' }
- },
- {
- label: 'CFDA鐘舵��',
- fieldName: 'CFDA_Status__c',
- hideDefaultActions: true,
- initialWidth: 100,
- wrapText: true
- },
- {
- label: '娉ㄥ唽璇佺紪鐮佸彿',
- fieldName: 'Report_Product_Approbation__c',
- hideDefaultActions: true,
- initialWidth: 200,
- wrapText: true
- },
- {
- label: '娉ㄥ唽璇佹晥鏈�',
- fieldName: 'Report_Product_Expiration__c',
- hideDefaultActions: true,
- initialWidth: 110,
- wrapText: true
- },
- {
- label: 'BarCode',
- fieldName: 'Bar_Code__c',
- hideDefaultActions: true,
- wrapText: true
- // initialWidth:600,
- }
+ {
+ label: '娑堣�楀搧鍚嶇О',
+ fieldName: 'Name__c',
+ wrapText:true,
+ hideDefaultActions: true,
+ // initialWidth: 400,
+
+ },
+ {
+ label: '瑙勬牸',
+ fieldName: 'ProductPacking_list_manual__c',
+ hideDefaultActions: true,
+ initialWidth: 50,
+ cellAttributes: { alignment: "right" },
+
+
+ },
+ {
+ label: 'CFDA鐘舵��',
+ fieldName: 'CFDA_Status__c',
+ hideDefaultActions: true,
+ initialWidth: 100,
+ wrapText:true,
+
+ },
+ {
+ label: '娉ㄥ唽璇佺紪鐮佸彿',
+ fieldName: 'Report_Product_Approbation__c',
+ hideDefaultActions: true,
+ initialWidth: 200,
+ wrapText:true,
+ },
+ {
+ label: '娉ㄥ唽璇佹晥鏈�',
+ fieldName: 'Report_Product_Expiration__c',
+ hideDefaultActions: true,
+ initialWidth: 110,
+ wrapText:true,
+ },
+ {
+ label: 'BarCode',
+ fieldName: 'Bar_Code__c',
+ hideDefaultActions: true,
+ wrapText:true,
+ // initialWidth:600,
+ }
];
const column = [
- {
- label: '娑堣�楀搧鍚嶇О',
- fieldName: 'Name__c',
- hideDefaultActions: true,
- wrapText: true
- },
- {
- label: 'BarCode',
- fieldName: 'Bar_Code__c',
- hideDefaultActions: true,
- wrapText: true
- // initialWidth:600,
- },
- {
- label: '閿欒鍘熷洜',
- fieldName: 'ErrorReason',
- hideDefaultActions: true,
- wrapText: true
- }
+ {
+ label: '娑堣�楀搧鍚嶇О',
+ fieldName: 'Name__c',
+ hideDefaultActions: true,
+ wrapText:true,
+
+ },
+ {
+ label: 'BarCode',
+ fieldName: 'Bar_Code__c',
+ hideDefaultActions: true,
+ wrapText:true,
+ // initialWidth:600,
+
+
+ }
+ ,
+ {
+ label: '閿欒鍘熷洜',
+ fieldName: 'ErrorReason',
+ hideDefaultActions: true,
+ wrapText:true,
+ }
];
+
+
+
export default class LexRemoveBox extends LightningElement {
- columns = columns;
- column = column;
- @track selectedRows = [];
- @track data = [];
- @track errorDetail = [];
+ columns = columns;
+ column = column;
+ @track selectedRows = [];
+ @track data = [];
+ @track errorDetail = [];
- // 鏄剧ず
- @track showTable = false;
- @track accountName;
- @track userWorkLocation;
- @track agencyProType;
- @track barcode = '';
- @track saveFLGbln = false;
- @track dataSize = 0;
+ // 鏄剧ず
+ @track showTable = false
+ @track accountName
+ @track userWorkLocation
+ @track agencyProType
+ @track barcode = ''
+ @track saveFLGbln = false
+ @track dataSize = 0;
- //鍔犺浇妗�
- @track showSpinner = false;
+ //鍔犺浇妗�
+ @track showSpinner = false
- renderedCallback() {
- if (!this.stylesLoaded) {
- Promise.all([loadStyle(this, WrappedHeaderTable)])
- .then(() => {
- console.log('Custom styles loaded');
- this.stylesLoaded = true;
- })
- .catch((error) => {
- console.error('Error loading custom styles');
- });
- }
- }
-
- //鍒濆鍖�
- connectedCallback() {
- console.log('鍒濆鍖�');
- this.showTable = false;
-
- init()
- .then((result) => {
- result = JSON.parse(JSON.stringify(result));
- console.log('result =' + JSON.stringify(result));
- if ((result.status = 'Success')) {
- console.log('result');
- this.agencyProType = result.entity.agencyProType;
- this.userWorkLocation = result.entity.userWorkLocation;
- this.accountName = result.entity.accountName;
- // this.data = JSON.parse(result.entity.codPageRecords);
- // this.showTable = true;
- } else {
- this.showMyToast('鍒濆鍖栧け璐�', result.msg, 'error');
- }
+ renderedCallback() {
+ if (!this.stylesLoaded) {
+ Promise.all([loadStyle(this, WrappedHeaderTable)])
+ .then(() => {
+ console.log("Custom styles loaded");
+ this.stylesLoaded = true;
})
.catch((error) => {
- console.log('error = ' + JSON.stringify(error));
+ console.error("Error loading custom styles");
});
- }
- //褰曞叆
- getDetails() {
- searchDeatail({
- accountName: this.accountName,
- userWorkLocation: this.userWorkLocation,
- agencyProType: this.agencyProType,
- barcode: this.barcode
- })
- .then((result) => {
- result = JSON.parse(JSON.stringify(result));
- console.log('result =' + JSON.stringify(result));
- if (result.status == 'Success') {
- console.log('鎴愬姛');
- this.data = JSON.parse(
- result.entity.ConsumableorderdetailsRecordsdummy
- );
- this.errorDetail = JSON.parse(
- result.entity.ConsumableorderdetailsRecordserror
- );
- this.dataSize = result.entity.dataSize;
- console.log('this.dataSize' + this.dataSize);
- for (let i in this.data) {
- this.data[i]['Name__c'] = this.data[i].Prod.Name__c;
- this.data[i]['ProductPacking_list_manual__c'] =
- this.data[i].esd.ProductPacking_list_manual__c;
- this.data[i]['CFDA_Status__c'] =
- this.data[i].esd.CFDA_Status__c;
- this.data[i]['Report_Product_Approbation__c'] =
- this.data[i].esd.Report_Product_Approbation__c;
- this.data[i]['Report_Product_Expiration__c'] =
- this.data[i].esd.Report_Product_Expiration__c;
- this.data[i]['Bar_Code__c'] =
- this.data[i].esd.Bar_Code__c;
- }
- for (let i in this.errorDetail) {
- this.errorDetail[i]['Name__c'] =
- this.errorDetail[i].Prod.Name__c;
- this.errorDetail[i]['Bar_Code__c'] =
- this.errorDetail[i].esd.Bar_Code__c;
- this.errorDetail[i]['ErrorReason'] =
- this.errorDetail[i].ErrorReason;
- }
- this.showTables = true;
- this.showTable = true;
- } else {
- console.log('result.msg = ' + result.msg);
- this.showMyToast('鑾峰彇澶辫触', result.msg, 'error');
- }
- })
- .catch((error) => {
- console.log('error = ' + JSON.stringify(error));
- });
- }
- //鑾峰彇褰撳墠杈撳叆鍊�
- handleChange(event) {
- let value = event.detail.value;
- console.log('value' + value);
- this.barcode = value;
- console.log('this.barcode' + this.barcode);
- }
- saveConfirm() {
- console.log('杩涘叆纭');
- let msg = '纭鎷嗙洅鍚�';
- if (this.dataSize > 0) {
- if (confirm(msg) == true) {
- this.removeBox();
- }
- } else {
- this.removeBox();
- }
- }
- removeBox() {
- this.showSpinner = true;
- saveconfirm({
- saveConsumableorderdetailsRecordsdummy: JSON.stringify(this.data),
- accountName: this.accountName,
- userWorkLocation: this.userWorkLocation,
- agencyProType: this.agencyProType
- })
- .then((result) => {
- result = JSON.parse(JSON.stringify(result));
- console.log('result淇濆瓨 = ' + JSON.stringify(result));
- if (result.status == 'Success') {
- this.saveFLGbln = result.entity.saveFLGbln;
- // this.showSpinner = false;
- if (this.saveFLGbln) {
- this.showMyToast(result.msg, '', 'success');
- this.showSpinner = false;
- }
- } else {
- console.log('result.msg = ' + result.msg);
- this.showMyToast('鎷嗙洅澶辫触', result.msg, 'error');
- this.showSpinner = false;
- }
- })
- .catch((error) => {
- console.log('error = ' + JSON.stringify(error));
- });
- }
- showMyToast(title, message, variant) {
- console.log('show custom message');
- var iconName = '';
- var content = '';
- if (variant == 'success') {
- iconName = 'utility:check';
- } else {
- iconName = 'utility:error';
- }
- if (message != '') {
- content =
- '<h2><strong>' +
- title +
- '<strong/></h2><h5>' +
- message +
- '</h5>';
- } else {
- content = '<h2><strong>' + title + '<strong/></h2>';
- }
- this.template
- .querySelector('c-common-toast')
- .showToast(variant, content, iconName, 10000);
}
}
+
+ //鍒濆鍖�
+ connectedCallback() {
+ console.log('鍒濆鍖�');
+ this.showTable = false;
+
+ init().then((result) => {
+ result = JSON.parse(JSON.stringify(result));
+ console.log('result =' + JSON.stringify(result));
+ if (result.status = 'Success') {
+ console.log('result');
+ this.agencyProType = result.entity.agencyProType;
+ this.userWorkLocation = result.entity.userWorkLocation;
+ this.accountName = result.entity.accountName;
+ // this.data = JSON.parse(result.entity.codPageRecords);
+ // this.showTable = true;
+ } else {
+ this.showMyToast('鍒濆鍖栧け璐�',result.msg,'error');
+ }
+ }).catch((error) => {
+ console.log('error = ' + JSON.stringify(error));
+ });
+ }
+ //褰曞叆
+ getDetails() {
+ searchDeatail({
+ accountName: this.accountName,
+ userWorkLocation: this.userWorkLocation,
+ agencyProType: this.agencyProType,
+ barcode: this.barcode
+ }).then((result) => {
+ result = JSON.parse(JSON.stringify(result));
+ console.log('result =' + JSON.stringify(result));
+ if (result.status == 'Success') {
+ console.log('鎴愬姛');
+ this.data = JSON.parse(result.entity.ConsumableorderdetailsRecordsdummy);
+ this.errorDetail = JSON.parse(result.entity.ConsumableorderdetailsRecordserror);
+ this.dataSize = result.entity.dataSize;
+ console.log('this.dataSize'+this.dataSize);
+ for (let i in this.data) {
+ this.data[i]['Name__c'] = this.data[i].Prod.Name__c;
+ this.data[i]['ProductPacking_list_manual__c'] = this.data[i].esd.ProductPacking_list_manual__c;
+ this.data[i]['CFDA_Status__c'] = this.data[i].esd.CFDA_Status__c;
+ this.data[i]['Report_Product_Approbation__c'] = this.data[i].esd.Report_Product_Approbation__c;
+ this.data[i]['Report_Product_Expiration__c'] = this.data[i].esd.Report_Product_Expiration__c;
+ this.data[i]['Bar_Code__c'] = this.data[i].esd.Bar_Code__c;
+ }
+ for (let i in this.errorDetail) {
+ this.errorDetail[i]['Name__c'] = this.errorDetail[i].Prod.Name__c;
+ this.errorDetail[i]['Bar_Code__c'] = this.errorDetail[i].esd.Bar_Code__c;
+ this.errorDetail[i]['ErrorReason'] = this.errorDetail[i].ErrorReason;
+ }
+ this.showTables = true;
+ this.showTable = true;
+ } else{
+ console.log('result.msg = ' + result.msg);
+ this.showMyToast('鑾峰彇澶辫触',result.msg,'error');
+ }
+ }).catch((error) => {
+ console.log('error = ' + JSON.stringify(error));
+ });
+
+ }
+ //鑾峰彇褰撳墠杈撳叆鍊�
+ handleChange(event) {
+ let value = event.detail.value;
+ console.log('value' + value);
+ this.barcode = value;
+ console.log('this.barcode' + this.barcode);
+ }
+ saveConfirm() {
+ console.log('杩涘叆纭');
+ let msg = "纭鎷嗙洅鍚�";
+ if (this.dataSize>0) {
+ if (confirm(msg) == true) {
+ this.removeBox();
+ }
+ } else {
+ this.removeBox();
+ }
+
+ }
+ removeBox(){
+ this.showSpinner = true;
+ saveconfirm({
+ saveConsumableorderdetailsRecordsdummy: JSON.stringify(this.data),
+ accountName: this.accountName,
+ userWorkLocation: this.userWorkLocation,
+ agencyProType: this.agencyProType
+ }).then((result) => {
+ result = JSON.parse(JSON.stringify(result));
+ console.log('result淇濆瓨 = ' + JSON.stringify(result));
+ if (result.status == 'Success') {
+ this.saveFLGbln = result.entity.saveFLGbln;
+ // this.showSpinner = false;
+ if(this.saveFLGbln){
+ this.showMyToast(result.msg,'','success');
+ this.showSpinner = false;
+ }
+ } else {
+ console.log('result.msg = ' + result.msg);
+ this.showMyToast('鎷嗙洅澶辫触',result.msg,'error');
+ this.showSpinner = false;
+ }
+ })
+ .catch((error) => {
+ console.log('error = ' + JSON.stringify(error));
+ });
+
+
+ }
+ showMyToast(title, message, variant) {
+ console.log('show custom message');
+ var iconName = '';
+ var content = '';
+ if(variant == 'success'){
+ iconName = 'utility:check';
+ }else{
+ iconName = 'utility:error';
+ }
+ if(message != ''){
+ content = '<h2><strong>'+title+'<strong/></h2><h5>'+message+'</h5>';
+ }else{
+ content = '<h2><strong>'+title+'<strong/></h2>';
+ }
+ this.template.querySelector('c-common-toast').showToast(variant,content,iconName,10000);
+ }
+
+
+
+
+}
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexSaleAndDelivery/lexSaleAndDelivery.html b/force-app/main/default/lwc/lexSaleAndDelivery/lexSaleAndDelivery.html
index fd35ca3..5f770e0 100644
--- a/force-app/main/default/lwc/lexSaleAndDelivery/lexSaleAndDelivery.html
+++ b/force-app/main/default/lwc/lexSaleAndDelivery/lexSaleAndDelivery.html
@@ -8,6 +8,7 @@
<div style="padding: 15px">
<div lwc:dom="manual" class="resultDiv"></div>
<div draggable="false">
+
<!-- <div class="slds-m-top_small slds-m-bottom_medium"> -->
<!-- <lightning-button label="鏂板缓鍑哄簱鍗�" onclick={neworderhead}
class="slds-m-left_x-small" disabled></lightning-button>
@@ -276,4 +277,4 @@
</div>
</div>
</div>
-</template>
+</template>
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexSaleAndDelivery/lexSaleAndDelivery.js b/force-app/main/default/lwc/lexSaleAndDelivery/lexSaleAndDelivery.js
index 80abe62..d630908 100644
--- a/force-app/main/default/lwc/lexSaleAndDelivery/lexSaleAndDelivery.js
+++ b/force-app/main/default/lwc/lexSaleAndDelivery/lexSaleAndDelivery.js
@@ -438,4 +438,4 @@
openModal() {
this.isModalOpen = true;
}
-}
+}
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexSummonsCreat/lexSummonsCreat.css b/force-app/main/default/lwc/lexSummonsCreat/lexSummonsCreat.css
index c28189d..0315bed 100644
--- a/force-app/main/default/lwc/lexSummonsCreat/lexSummonsCreat.css
+++ b/force-app/main/default/lwc/lexSummonsCreat/lexSummonsCreat.css
@@ -1,24 +1,24 @@
@import 'c/lexCssUtility';
-.outerBorderCss {
- border: 1px solid #d4d4d4;
- border-radius: 5px;
- border-top: 3px solid #565959;
+.outerBorderCss{
+ border: 1px solid #D4D4D4;
+ border-radius : 5px;
+ border-top : 3px solid #565959;
}
-.borderCss {
- border: 1px solid #d4d4d4;
- border-radius: 5px;
- margin-bottom: 7px;
- border-top: 3px solid #565959;
+.borderCss{
+ border: 1px solid #D4D4D4;
+ border-radius : 5px;
+ margin-bottom : 7px;
+ border-top : 3px solid #565959;
}
-.headerDorderCss {
+.headerDorderCss{
border-top: 1px solid #565959;
- border-bottom: 1px solid #d4d4d4;
- padding: 3px;
+ border-bottom: 1px solid #D4D4D4;
+ padding:3px;
}
-.centerCss {
+.centerCss{
text-align: center;
}
-.centerCss .left {
+.centerCss .left{
margin-left: 100px;
}
.datatable {
@@ -35,9 +35,9 @@
.fileUpload {
font-size: 16px;
- --lwc-formLabelFontSize: 16px;
+ --lwc-formLabelFontSize:16px;
}
.disable-row-selection .slds-is-selected {
outline: none !important;
-}
+ }
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexSummonsCreat/lexSummonsCreat.html b/force-app/main/default/lwc/lexSummonsCreat/lexSummonsCreat.html
index 75d6814..833ce90 100644
--- a/force-app/main/default/lwc/lexSummonsCreat/lexSummonsCreat.html
+++ b/force-app/main/default/lwc/lexSummonsCreat/lexSummonsCreat.html
@@ -4,118 +4,50 @@
<c-common-toast></c-common-toast>
<template if:true={isShowSpinner}>
<div class="slds-spinner_container">
- 聽 聽 聽 聽 聽 聽
- <div
- role="status"
- class="slds-spinner slds-spinner_medium slds-spinner_brand"
- >
- 聽 聽 聽 聽 聽 聽 聽 聽
- <span class="slds-assistive-text">Loading</span> 聽 聽 聽 聽 聽 聽 聽 聽
- <div class="slds-spinner__dot-a"></div>
- 聽 聽 聽 聽 聽 聽 聽 聽
- <div class="slds-spinner__dot-b"></div>
- 聽 聽 聽 聽
- </div>
- 聽 聽 聽 聽
- </div>
+聽 聽 聽 聽 聽 聽 <div role="status" class="slds-spinner slds-spinner_medium slds-spinner_brand">
+聽 聽 聽 聽 聽 聽 聽 聽 <span class="slds-assistive-text">Loading</span>
+聽 聽 聽 聽 聽 聽 聽 聽 <div class="slds-spinner__dot-a"></div>
+聽 聽 聽 聽 聽 聽 聽 聽 <div class="slds-spinner__dot-b"></div>
+ 聽 聽 聽 聽 </div>
+聽 聽 聽 聽 </div>
</template>
<!-- 鎼滅储瀹㈡埛鍚� -->
<template if:true={isModalOpen}>
- <section
- role="dialog"
- tabindex="-1"
- aria-labelledby="modal-heading-01"
- aria-modal="true"
- aria-describedby="modal-content-id-1"
- class="slds-modal slds-fade-in-open slds-modal_medium"
- style="border: 1px solid #d4d4d4"
- >
+ <section role="dialog" tabindex="-1" aria-labelledby="modal-heading-01" aria-modal="true"
+ aria-describedby="modal-content-id-1" class="slds-modal slds-fade-in-open slds-modal_medium"
+ style="border: 1px solid #D4D4D4;">
<div class="slds-modal__container">
- <header
- class="slds-modal__header"
- style="background-color: #f3f3f3"
- >
- <button
- style=""
- class="slds-button slds-button_icon slds-modal__close slds-button_icon-inverse"
- title="Close"
- onclick={closeModal}
- >
- <lightning-icon
- icon-name="utility:close"
- alternative-text="close"
- variant="inverse"
- size="small"
- ></lightning-icon>
+ <header class="slds-modal__header" style="background-color: #F3F3F3;">
+ <button style="" class="slds-button slds-button_icon slds-modal__close slds-button_icon-inverse"
+ title="Close" onclick={closeModal}>
+ <lightning-icon icon-name="utility:close" alternative-text="close" variant="inverse"
+ size="small"></lightning-icon>
<span class="slds-assistive-text">Close</span>
</button>
- <h2
- id="modal-heading-01"
- class="slds-text-heading_medium slds-hyphenate"
- >
- 缁忛攢鍟嗗尰闄㈡绱�
- </h2>
+ <h2 id="modal-heading-01" class="slds-text-heading_medium slds-hyphenate">缁忛攢鍟嗗尰闄㈡绱�</h2>
</header>
- <div
- class="slds-modal__content slds-p-around_medium"
- id="modal-content-id-1"
- style="border: 1px solid #f3f3f3"
- >
- <table style="width: 100%">
+ <div class="slds-modal__content slds-p-around_medium" id="modal-content-id-1"
+ style="border: 1px solid #F3F3F3;">
+ <table style="width: 100%;">
<tbody>
<tr>
- <td style="width: 74px">
- <div
- style="
- color: #696969;
- font-size: 16px;
- text-align: left;
- "
- >
- 鍖婚櫌鍚嶇О
- </div>
+ <td style="width: 74px;">
+ <div style="color:#696969;font-size:16px;text-align: left;">鍖婚櫌鍚嶇О</div>
</td>
- <td style="width: 60%">
- <lightning-input
- class="inputFont"
- label="鍖婚櫌鍚嶇О"
- variant="label-hidden"
- placeholder="璇疯緭鍏ュ尰闄㈠悕绉�"
- value={searchHospitalName}
- data-field="searchHospitalName"
- onchange={dataChange}
- ></lightning-input>
- </td>
- <td style="width: 10px"></td>
- <td>
- <button
- class="slds-button slds-button_neutral slds-button_stretch lexsearchStyle"
- style="height: 32px"
- label="鎼滅储"
- onclick={searchHospital}
- >
- 鎼滅储
- </button>
- </td>
+ <td style="width: 60%;"><lightning-input class="inputFont" label="鍖婚櫌鍚嶇О"
+ variant="label-hidden" placeholder="璇疯緭鍏ュ尰闄㈠悕绉�" value={searchHospitalName}
+ data-field="searchHospitalName" onchange={dataChange}></lightning-input></td>
+ <td style="width: 10px;"></td>
+ <td><button class="slds-button slds-button_neutral slds-button_stretch lexsearchStyle"
+ style="height: 32px;" label="鎼滅储" onclick={searchHospital}>鎼滅储</button></td>
</tr>
</tbody>
</table>
- <p style="height: 20px"></p>
+ <p style="height: 20px;"></p>
<!-- <p>宸查�夋嫨鍖婚櫌锛歿chooseHospital}</p> -->
<div
- style="
- border: 1px solid #d4d4d4;
- border-top: 3px solid #51606e;
- border-radius: 5px;
- margin-bottom: 7px;
- "
- >
- <div
- style="
- border-bottom: 1px solid #d4d4d4;
- padding: 3px;
- "
- >
+ style="border: 1px solid #D4D4D4;border-top: 3px solid #51606E;border-radius:5px;margin-bottom:7px;">
+ <div style="border-bottom: 1px solid #D4D4D4;padding:3px;">
<lightning-layout>
<lightning-layout-item padding="around-small">
<p style="font-size: 18px">
@@ -125,30 +57,20 @@
</lightning-layout>
<!-- <p style="font-size: 16px;"><strong>鎼滅储缁撴灉</strong></p> -->
</div>
- <div class="myTable" style="padding: 10px">
+ <div class="myTable" style="padding:10px;">
<!-- <lightning-datatable class="wrapped-header-datatable" key-field="id"
hide-checkbox-column="true" data={hospitalList} columns={hosCols}
onrowaction={chooseHos}></lightning-datatable> -->
- <lightning-datatable
- class="datatabel slds-border_top wrapped-header-datatable"
- key-field="id"
- data={hospitalList}
- columns={hospitalColumns}
- hide-checkbox-column="true"
- onrowaction={searchHandleRowAction}
- >
+ <lightning-datatable class="datatabel slds-border_top wrapped-header-datatable"
+ key-field="id" data={hospitalList} columns={hospitalColumns} hide-checkbox-column="true"
+ onrowaction={searchHandleRowAction}>
</lightning-datatable>
</div>
</div>
</div>
<footer class="slds-modal__footer">
- <button
- class="slds-button slds-button_neutral slds-button_stretch lexclearStyle"
- label="鍙栨秷"
- onclick={closeModal}
- >
- 鍙栨秷
- </button>
+ <button class="slds-button slds-button_neutral slds-button_stretch lexclearStyle" label="鍙栨秷"
+ onclick={closeModal}>鍙栨秷</button>
</footer>
</div>
</section>
@@ -157,65 +79,31 @@
<!-- 涓婁紶闄勪欢寮圭獥 -->
<template if:true={showAttPop}>
- <section
- role="dialog"
- tabindex="-1"
- aria-labelledby="modal-heading-01"
- aria-modal="true"
- aria-describedby="modal-content-id-1"
- class="slds-modal slds-fade-in-open slds-modal_small"
- style="border: 1px solid #d4d4d4"
- >
+ <section role="dialog" tabindex="-1" aria-labelledby="modal-heading-01" aria-modal="true"
+ aria-describedby="modal-content-id-1" class="slds-modal slds-fade-in-open slds-modal_small"
+ style="border: 1px solid #D4D4D4;">
<template if:true={showPopSpinner}>
- <lightning-spinner
- size="medium"
- variant="brand"
- ></lightning-spinner>
+ <lightning-spinner size="medium" variant="brand"></lightning-spinner>
</template>
<div class="slds-modal__container">
- <header
- class="slds-modal__header"
- style="background-color: #f3f3f3"
- >
- <button
- style=""
- class="slds-button slds-button_icon slds-modal__close slds-button_icon-inverse"
- title="Close"
- onclick={closePop}
- >
- <lightning-icon
- icon-name="utility:close"
- alternative-text="close"
- variant="inverse"
- size="small"
- ></lightning-icon>
+ <header class="slds-modal__header" style="background-color: #F3F3F3;">
+ <button style="" class="slds-button slds-button_icon slds-modal__close slds-button_icon-inverse"
+ title="Close" onclick={closePop}>
+ <lightning-icon icon-name="utility:close" alternative-text="close" variant="inverse"
+ size="small"></lightning-icon>
<span class="slds-assistive-text">Close</span>
</button>
- <h2
- id="modal-heading-02"
- class="slds-text-heading_medium slds-hyphenate"
- >
- 涓婁紶闄勪欢
- </h2>
+ <h2 id="modal-heading-02" class="slds-text-heading_medium slds-hyphenate">涓婁紶闄勪欢</h2>
</header>
- <div
- class="slds-modal__content slds-p-around_medium"
- id="modal-content-id-2"
- style="border: 1px solid #f3f3f3"
- >
+ <div class="slds-modal__content slds-p-around_medium" id="modal-content-id-2"
+ style="border: 1px solid #F3F3F3;">
<div class="slds-m-top_medium slds-m-bottom_x-large">
<div class="slds-p-around_medium lgc-bg">
- <lightning-input
- class="fileUpload"
- type="file"
- label="闄勪欢涓婁紶"
+ <lightning-input class="fileUpload" type="file" label="闄勪欢涓婁紶"
accept=".xlsx, .xls, .csv, .png, .doc, .docx, .pdf"
- onchange={attChange}
- ></lightning-input>
+ onchange={attChange}></lightning-input>
</div>
- <p style="font-size: 16px">
- 宸查�夋嫨鏂囦欢锛歿fileName}
-
+ <p style="font-size: 16px;">宸查�夋嫨鏂囦欢锛歿fileName}
<template if:true={attDelBtn}>
<a onclick={removeAtt}>绉婚櫎</a>
</template>
@@ -227,22 +115,10 @@
onclick={closePop}></lightning-button>
<lightning-button style="margin-left: 10px;" variant="neutral" label="涓婁紶"
onclick={handleSave}></lightning-button> -->
- <button
- class="slds-button slds-button_neutral slds-button_stretch lexclearStyle"
- style="margin-left: 10px"
- label="鍙栨秷"
- onclick={closePop}
- >
- 鍙栨秷
- </button>
- <button
- class="slds-button slds-button_neutral slds-button_stretch lexsearchStyle"
- style="margin-left: 10px"
- label="涓婁紶"
- onclick={handleSave}
- >
- 涓婁紶
- </button>
+ <button class="slds-button slds-button_neutral slds-button_stretch lexclearStyle" style="margin-left: 10px;" label="鍙栨秷"
+ onclick={closePop}>鍙栨秷</button>
+ <button class="slds-button slds-button_neutral slds-button_stretch lexsearchStyle" style="margin-left: 10px;" label="涓婁紶"
+ onclick={handleSave}>涓婁紶</button>
</footer>
</div>
</section>
@@ -281,10 +157,7 @@
style="width: 150px"></lightning-button> -->
<button
class="slds-button slds-button_neutral slds-button_stretch lexBorder"
- onclick={saveConfirmJs}
- >
- 淇濆瓨
- </button>
+ onclick={saveConfirmJs}>淇濆瓨</button>
</template>
</td>
<td colspan="4">
@@ -302,11 +175,7 @@
style="width: 150px" disabled={isEditDisabled}></lightning-button> -->
<button
class="slds-button slds-button_neutral slds-button_stretch lexBorder"
- onclick={EditConsumable}
- disabled={isEditDisabled}
- >
- 缂栬緫鍑哄簱鍗�
- </button>
+ onclick={EditConsumable} disabled={isEditDisabled}>缂栬緫鍑哄簱鍗�</button>
</template>
</td>
@@ -316,11 +185,7 @@
style="width: 150px;" disabled={isDeliveryDisabled}></lightning-button> -->
<button
class="slds-button slds-button_neutral slds-button_stretch lexBorder"
- onclick={GoodsDeliveryJs}
- disabled={isDeliveryDisabled}
- >
- 鍑鸿揣/閿�鍞�
- </button>
+ onclick={GoodsDeliveryJs} disabled={isDeliveryDisabled}>鍑鸿揣/閿�鍞�</button>
</template>
</td>
@@ -330,11 +195,7 @@
disabled={isOpenToInvoiceDisabled}></lightning-button> -->
<button
class="slds-button slds-button_neutral slds-button_stretch lexBorder"
- onclick={openToInvoiceJs}
- disabled={isOpenToInvoiceDisabled}
- >
- 寮�绁�
- </button>
+ onclick={openToInvoiceJs} disabled={isOpenToInvoiceDisabled}>寮�绁�</button>
</template>
</td>
@@ -342,14 +203,11 @@
<template if:false={EditAble}>
<button
class="slds-button slds-button_neutral slds-button_stretch lexBorder"
- onclick={uploadOrder}
- >
- 涓婁紶闄勪欢
- </button>
+ onclick={uploadOrder}>涓婁紶闄勪欢</button>
</template>
</td>
</tr>
- <tr style="height: 5px"></tr>
+ <tr style="height: 5px;"></tr>
<tr>
<td></td>
<td>
@@ -358,38 +216,28 @@
disabled={isPraseToPDFDisabled}></lightning-button> -->
<button
class="slds-button slds-button_neutral slds-button_stretch lexBorder"
- onclick={PraseToPDFJs}
- disabled={isPraseToPDFDisabled}
- >
- 鎵撳嵃鎸囩ず鍗�
- </button>
+ onclick={PraseToPDFJs} disabled={isPraseToPDFDisabled}>鎵撳嵃鎸囩ず鍗�</button>
</template>
</td>
<td>
+
<template if:true={isOpenReportShow}>
<!-- <lightning-button label="鏄剧ず鏄庣粏 " onclick={openReportJs}
style="width: 150px" disabled={isOpenReportDisabled}></lightning-button> -->
<button
class="slds-button slds-button_neutral slds-button_stretch lexBorder"
- onclick={openReportJs}
- disabled={isOpenReportDisabled}
- >
- 鏄剧ず鏄庣粏
- </button>
+ onclick={openReportJs} disabled={isOpenReportDisabled}>鏄剧ず鏄庣粏</button>
</template>
</td>
<td>
+
<template if:true={isDeleteShow}>
<!-- <lightning-button label="鍒犻櫎" onclick={DeleteConsumable} style="width: 150px"
disabled={isDeleteDisabled}></lightning-button> -->
<button
class="slds-button slds-button_neutral slds-button_stretch lexBorder"
- onclick={DeleteConsumable}
- disabled={isDeleteDisabled}
- >
- 鍒犻櫎
- </button>
+ onclick={DeleteConsumable} disabled={isDeleteDisabled}>鍒犻櫎</button>
</template>
</td>
<td></td>
@@ -415,403 +263,253 @@
<div lwc:dom="manual" class="resultDiv"></div>
<div draggable="false">
<!-- SummonsStatus_c__c == '浠锋牸鏈畾' -->
- <template
- if:true={summonsStatusPriceNotDetermined}
- >
- <lightning-record-edit-form
- object-api-name="Consumable_order__c"
- record-id={cocId}
- onload={handleLoad}
- >
+ <template if:true={summonsStatusPriceNotDetermined}>
+ <lightning-record-edit-form object-api-name="Consumable_order__c" record-id={cocId}
+ onload={handleLoad}>
<!-- 鍑哄簱鍗曞彿 鍑哄簱鍗曠姸鎬� -->
<lightning-layout multiple-rows="true">
<template if:true={isSummonsFlag}>
- <lightning-layout-item
- size="1"
- ></lightning-layout-item>
+ <lightning-layout-item size="1"></lightning-layout-item>
<lightning-layout-item size="5">
- <lightning-output-field
- field-name="Name"
- class="hehe-layoutItem"
- ></lightning-output-field>
+ <lightning-output-field field-name="Name"
+ class="hehe-layoutItem"></lightning-output-field>
</lightning-layout-item>
- <lightning-layout-item
- class="hehe-layoutItem"
- size="5"
- style="padding-left: 100px"
- >
+ <lightning-layout-item class="hehe-layoutItem" size="5"
+ style="padding-left: 100px;">
<lightning-output-field
- field-name="SummonsStatus_c__c"
- ></lightning-output-field>
+ field-name="SummonsStatus_c__c"></lightning-output-field>
</lightning-layout-item>
- <lightning-layout-item
- size="1"
- ></lightning-layout-item>
+ <lightning-layout-item size="1"></lightning-layout-item>
+
+
</template>
</lightning-layout>
<!-- 鐩殑 寮�绁ㄧ姸鎬� -->
<lightning-layout multiple-rows="true">
- <lightning-layout-item
- size="1"
- ></lightning-layout-item>
+ <lightning-layout-item size="1"></lightning-layout-item>
- <lightning-layout-item
- class="hehe-layoutItem"
- size="5"
- >
- <lightning-output-field
- field-name="SummonsForDirction__c"
- class="searchName"
- ></lightning-output-field>
+ <lightning-layout-item class="hehe-layoutItem" size="5">
+ <lightning-output-field field-name="SummonsForDirction__c"
+ class="searchName"></lightning-output-field>
</lightning-layout-item>
- <lightning-layout-item
- class="hehe-layoutItem"
- size="5"
- style="padding-left: 100px"
- >
- <lightning-output-field
- field-name="Billed_Status__c"
- class="searchName"
- ></lightning-output-field>
+ <lightning-layout-item class="hehe-layoutItem" size="5"
+ style="padding-left: 100px;">
+ <lightning-output-field field-name="Billed_Status__c"
+ class="searchName"></lightning-output-field>
</lightning-layout-item>
- <lightning-layout-item
- size="1"
- ></lightning-layout-item>
+ <lightning-layout-item size="1"></lightning-layout-item>
+
+
</lightning-layout>
<!-- 浜岀骇缁忛攢鍟� -->
- <template
- if:true={isSummonsForDirctionTwoShow}
- >
- <lightning-layout
- multiple-rows="true"
- >
- <lightning-layout-item
- size="1"
- ></lightning-layout-item>
+ <template if:true={isSummonsForDirctionTwoShow}>
+ <lightning-layout multiple-rows="true">
- <lightning-layout-item
- class="hehe-layoutItem"
- size="5"
- >
+ <lightning-layout-item size="1"></lightning-layout-item>
+
+ <lightning-layout-item class="hehe-layoutItem" size="5">
<lightning-output-field
- field-name="Order_Dealer_Info__c"
- ></lightning-output-field>
+ field-name="Order_Dealer_Info__c"></lightning-output-field>
</lightning-layout-item>
+
+
</lightning-layout>
</template>
<!-- 瀹㈡埛鍚� 鍙戠エ-->
<lightning-layout multiple-rows="true">
- <lightning-layout-item
- size="1"
- ></lightning-layout-item>
+ <lightning-layout-item size="1"></lightning-layout-item>
- <lightning-layout-item
- class="hehe-layoutItem"
- size="5"
- >
- <lightning-output-field
- class="hideHelpText"
- field-name="ShipmentAccount__c"
- ></lightning-output-field>
+ <lightning-layout-item class="hehe-layoutItem" size="5">
+ <lightning-output-field class="hideHelpText"
+ field-name="ShipmentAccount__c"></lightning-output-field>
</lightning-layout-item>
- <lightning-layout-item
- class="hehe-layoutItem"
- size="5"
- style="padding-left: 100px"
- >
- <lightning-input-field
- data-field={ConInvoice_Code__c}
- onchange={invoiceChange}
- field-name="ConInvoice_Code__c"
- class="inputFont"
- ></lightning-input-field>
+ <lightning-layout-item class="hehe-layoutItem" size="5"
+ style="padding-left: 100px;">
+ <lightning-input-field data-field={ConInvoice_Code__c}
+ onchange={invoiceChange} field-name="ConInvoice_Code__c"
+ class="inputFont"></lightning-input-field>
</lightning-layout-item>
- <lightning-layout-item
- size="1"
- ></lightning-layout-item>
+ <lightning-layout-item size="1"></lightning-layout-item>
+
+
</lightning-layout>
<!-- 绉戝 鍑哄簱閲戦 -->
<lightning-layout multiple-rows="true">
- <lightning-layout-item
- size="1"
- ></lightning-layout-item>
+ <lightning-layout-item size="1"></lightning-layout-item>
- <lightning-layout-item
- class="hehe-layoutItem"
- size="5"
- >
+ <lightning-layout-item class="hehe-layoutItem" size="5">
<lightning-output-field
- field-name="Order_ForCustomerText__c"
- ></lightning-output-field>
+ field-name="Order_ForCustomerText__c"></lightning-output-field>
</lightning-layout-item>
- <lightning-layout-item
- class="hehe-layoutItem"
- size="5"
- style="padding-left: 100px"
- >
+ <lightning-layout-item class="hehe-layoutItem" size="5"
+ style="padding-left: 100px;">
<lightning-output-field
- field-name="Shipment_total_amount__c"
- ></lightning-output-field>
+ field-name="Shipment_total_amount__c"></lightning-output-field>
</lightning-layout-item>
- <lightning-layout-item
- size="1"
- ></lightning-layout-item>
+ <lightning-layout-item size="1"></lightning-layout-item>
+
+
</lightning-layout>
<!-- 娌℃湁纭畾浠锋牸 -->
<lightning-layout multiple-rows="true">
- <lightning-layout-item
- size="1"
- ></lightning-layout-item>
- <lightning-layout-item
- class="hehe-layoutItem"
- size="5"
- >
+
+ <lightning-layout-item size="1"></lightning-layout-item>
+
+ <lightning-layout-item class="hehe-layoutItem" size="5">
<lightning-output-field
- field-name="NoConfirmedPrice__c"
- ></lightning-output-field>
+ field-name="NoConfirmedPrice__c"></lightning-output-field>
</lightning-layout-item>
+
+
</lightning-layout>
</lightning-record-edit-form>
</template>
<!-- SummonsStatus_c__c != '浠锋牸鏈畾' -->
- <template
- if:false={summonsStatusPriceNotDetermined}
- >
- <lightning-record-edit-form
- object-api-name="Consumable_order__c"
- record-id={cocId}
- onsubmit={handleSubmit}
- onload={handleLoad}
- >
+ <template if:false={summonsStatusPriceNotDetermined}>
+ <lightning-record-edit-form object-api-name="Consumable_order__c" record-id={cocId}
+ onsubmit={handleSubmit} onload={handleLoad}>
<!-- 鍑哄簱鍗曞彿 鍑哄簱鍗曠姸鎬� -->
<lightning-layout multiple-rows="true">
<template if:true={isSummonsFlag}>
- <lightning-layout-item
- size="1"
- ></lightning-layout-item>
+ <lightning-layout-item size="1"></lightning-layout-item>
- <lightning-layout-item
- class="hehe-layoutItem"
- size="5"
- >
- <lightning-output-field
- field-name="Name"
- ></lightning-output-field>
+ <lightning-layout-item class="hehe-layoutItem" size="5">
+ <lightning-output-field field-name="Name"></lightning-output-field>
</lightning-layout-item>
- <lightning-layout-item
- class="hehe-layoutItem"
- size="5"
- style="padding-left: 100px"
- >
+ <lightning-layout-item class="hehe-layoutItem" size="5"
+ style="padding-left: 100px;">
<lightning-output-field
- field-name="SummonsStatus_c__c"
- ></lightning-output-field>
+ field-name="SummonsStatus_c__c"></lightning-output-field>
</lightning-layout-item>
- <lightning-layout-item
- size="1"
- ></lightning-layout-item>
+ <lightning-layout-item size="1"></lightning-layout-item>
</template>
</lightning-layout>
<!-- 鐩殑 浜岀骇缁忛攢鍟� -->
<lightning-layout multiple-rows="true">
- <lightning-layout-item
- size="1"
- ></lightning-layout-item>
+ <lightning-layout-item size="1"></lightning-layout-item>
- <lightning-layout-item
- class="hehe-layoutItem"
- size="5"
- >
- <lightning-input-field
- data-field="summonsForDirction"
- value={summonsForDirction}
- field-name="SummonsForDirction__c"
- required="true"
- onchange={ChangeDirction}
- class="inputFont"
- ></lightning-input-field>
+ <lightning-layout-item class="hehe-layoutItem" size="5">
+ <lightning-input-field data-field="summonsForDirction"
+ value={summonsForDirction} field-name="SummonsForDirction__c"
+ required="true" onchange={ChangeDirction}
+ class="inputFont"></lightning-input-field>
</lightning-layout-item>
- <lightning-layout-item
- class="hehe-layoutItem"
- size="5"
- style="padding-left: 100px"
- >
- <lightning-combobox
- data-field="secondaryDistributor"
- name="secondaryDistributor"
- label="浜岀骇缁忛攢鍟�"
- value={secondaryDistributor}
- placeholder="璇烽�夋嫨..."
- options={secondaryDistributorOptions}
- variant="label-inline"
- onchange={dataChange}
- disabled={isDisabledSecondaryDistributor}
- class="inputFont"
- ></lightning-combobox>
+ <lightning-layout-item class="hehe-layoutItem" size="5"
+ style="padding-left: 100px;">
+ <lightning-combobox data-field="secondaryDistributor"
+ name="secondaryDistributor" label="浜岀骇缁忛攢鍟�"
+ value={secondaryDistributor} placeholder="璇烽�夋嫨..."
+ options={secondaryDistributorOptions} variant="label-inline"
+ onchange={dataChange} disabled={isDisabledSecondaryDistributor}
+ class="inputFont"></lightning-combobox>
</lightning-layout-item>
- <lightning-layout-item
- size="1"
- ></lightning-layout-item>
+ <lightning-layout-item size="1"></lightning-layout-item>
+
+
</lightning-layout>
<!-- 瀹㈡埛鍚� 缁忛攢鍟嗗綍鍏� -->
<lightning-layout multiple-rows="true">
- <lightning-layout-item
- size="1"
- ></lightning-layout-item>
+ <lightning-layout-item size="1"></lightning-layout-item>
- <lightning-layout-item
- class="hehe-layoutItem"
- size="5"
- >
+ <lightning-layout-item class="hehe-layoutItem" size="5">
<div
- class="slds-form-element__control slds-input-has-icon slds-input-has-icon_right"
- >
- <lightning-icon
- size="x-small"
+ class="slds-form-element__control slds-input-has-icon slds-input-has-icon_right">
+ <lightning-icon size="x-small"
class="iconMargin slds-icon slds-input__icon slds-input__icon_right slds-icon-text-default"
- icon-name="utility:search"
- ></lightning-icon>
- <lightning-input
- type="text"
- name="HospitalName"
- label="瀹㈡埛鍚�"
- value={HospitalName}
- variant="label-inline"
- onclick={searchHospitalNameModal}
- data-field="HospitalName"
- disabled={isDisabledHospitalName}
- onchange={clearAgencyI}
- class="inputFont"
- ></lightning-input>
+ icon-name="utility:search"></lightning-icon>
+ <lightning-input type="text" name="HospitalName" label="瀹㈡埛鍚�"
+ value={HospitalName} variant="label-inline"
+ onclick={searchHospitalNameModal} data-field="HospitalName"
+ disabled={isDisabledHospitalName} onchange={clearAgencyI}
+ class="inputFont"></lightning-input>
</div>
</lightning-layout-item>
- <lightning-layout-item
- class="hehe-layoutItem"
- size="5"
- style="padding-left: 100px"
- >
- <template
- if:true={isMutualTransferGoods}
- >
- <c-lex-lookup
- onsearch={handleSearch}
- onselectionchange={handleSelectionChange}
- label="缁忛攢鍟�(褰曞叆)"
- variant="label-inline"
- placeholder="鎼滅储缁忛攢鍟�"
+ <lightning-layout-item class="hehe-layoutItem" size="5"
+ style="padding-left: 100px;">
+ <template if:true={isMutualTransferGoods}>
+ <c-lex-lookup onsearch={handleSearch}
+ onselectionchange={handleSelectionChange} label="缁忛攢鍟�(褰曞叆)"
+ variant="label-inline" placeholder="鎼滅储缁忛攢鍟�"
onisdisabledfordealertext={isDisabledForDealerText}
- account-value={accountValue}
- onblur={vpClear2Delay}
- disabled={isDisabledForDealerText}
- class="inputFont"
- >
+ account-value={accountValue} onblur={vpClear2Delay}
+ disabled={isDisabledForDealerText} class="inputFont">
</c-lex-lookup>
</template>
- <template
- if:false={isMutualTransferGoods}
- >
- <lightning-input
- type="text"
- name="Order_ForDealerText__c"
- label="缁忛攢鍟�(褰曞叆)"
- value={ForDealerText}
- onchange={dataChange}
+ <template if:false={isMutualTransferGoods}>
+ <lightning-input type="text" name="Order_ForDealerText__c"
+ label="缁忛攢鍟�(褰曞叆)" value={ForDealerText} onchange={dataChange}
data-field="Order_ForDealerText__c"
- disabled={isDisabledForDealerText}
- variant="label-inline"
- class="inputFont"
- >
+ disabled={isDisabledForDealerText} variant="label-inline"
+ class="inputFont">
</lightning-input>
</template>
</lightning-layout-item>
- <lightning-layout-item
- size="1"
- ></lightning-layout-item>
+ <lightning-layout-item size="1"></lightning-layout-item>
+
+
</lightning-layout>
<!-- 绉戝 鎬婚噾棰� -->
<lightning-layout multiple-rows="true">
- <lightning-layout-item
- size="1"
- ></lightning-layout-item>
+ <lightning-layout-item size="1"></lightning-layout-item>
- <lightning-layout-item
- class="hehe-layoutItem"
- size="5"
- >
- <lightning-input-field
- onchange={dataChange}
- data-field="ForCustomerText"
- value={ForCustomerText}
+ <lightning-layout-item class="hehe-layoutItem" size="5">
+ <lightning-input-field onchange={dataChange}
+ data-field="ForCustomerText" value={ForCustomerText}
field-name="Order_ForCustomerText__c"
disabled={isDisabledForCustomerText}
- class="inputFont"
- ></lightning-input-field>
+ class="inputFont"></lightning-input-field>
</lightning-layout-item>
- <lightning-layout-item
- class="hehe-layoutItem"
- size="5"
- style="padding-left: 100px"
- >
- <lightning-input
- type="text"
- name="sumPrice"
- label="鎬婚噾棰�"
- value={sumPrice}
- variant="label-inline"
- onchange={dataChange}
- data-field="sumPrice"
- readonly
- ></lightning-input>
+
+
+ <lightning-layout-item class="hehe-layoutItem" size="5"
+ style="padding-left: 100px;">
+ <lightning-input type="text" name="sumPrice" label="鎬婚噾棰�"
+ value={sumPrice} variant="label-inline" onchange={dataChange}
+ data-field="sumPrice" readonly></lightning-input>
</lightning-layout-item>
- <lightning-layout-item
- size="1"
- ></lightning-layout-item>
+ <lightning-layout-item size="1"></lightning-layout-item>
</lightning-layout>
<!-- 娌℃湁纭畾浠锋牸 -->
<lightning-layout multiple-rows="true">
- <lightning-layout-item
- size="1"
- ></lightning-layout-item>
- <lightning-layout-item
- class="hehe-layoutItem"
- size="5"
- >
- <lightning-input-field
- value={NoConfirmedPrice}
- field-name="NoConfirmedPrice__c"
- data-field="NoConfirmedPrice"
- onchange={dataChange}
- ></lightning-input-field>
+ <lightning-layout-item size="1"></lightning-layout-item>
+
+ <lightning-layout-item class="hehe-layoutItem" size="5">
+ <lightning-input-field value={NoConfirmedPrice}
+ field-name="NoConfirmedPrice__c" data-field="NoConfirmedPrice"
+ onchange={dataChange}></lightning-input-field>
</lightning-layout-item>
+
+
+
</lightning-layout>
</lightning-record-edit-form>
</template>
@@ -835,161 +533,109 @@
<div style="padding: 7px">
<div lwc:dom="manual" class="resultDiv"></div>
<div draggable="false">
- <lightning-record-edit-form
- object-api-name="Consumable_order__c"
- record-id={cocId}
- onload={handleLoad2}
- >
+ <lightning-record-edit-form object-api-name="Consumable_order__c" record-id={cocId}
+ onload={handleLoad2}>
<!-- 鍑哄簱鍗曞彿 鍑哄簱鍗曠姸鎬� -->
<lightning-layout multiple-rows="true">
<template if:true={isSummonsFlag}>
- <lightning-layout-item
- size="1"
- ></lightning-layout-item>
+ <lightning-layout-item size="1"></lightning-layout-item>
<lightning-layout-item size="5">
- <lightning-output-field
- field-name="Name"
- class="hehe-layoutItem"
- ></lightning-output-field>
+ <lightning-output-field field-name="Name"
+ class="hehe-layoutItem"></lightning-output-field>
</lightning-layout-item>
- <lightning-layout-item
- size="5"
- style="padding-left: 100px"
- >
- <lightning-output-field
- field-name="SummonsStatus_c__c"
- class="hehe-layoutItem"
- ></lightning-output-field>
+
+
+ <lightning-layout-item size="5" style="padding-left: 100px;">
+ <lightning-output-field field-name="SummonsStatus_c__c"
+ class="hehe-layoutItem"></lightning-output-field>
</lightning-layout-item>
- <lightning-layout-item
- size="1"
- ></lightning-layout-item>
+ <lightning-layout-item size="1"></lightning-layout-item>
</template>
</lightning-layout>
<!-- 鐩殑 寮�绁ㄧ姸鎬� -->
<lightning-layout multiple-rows="true">
- <lightning-layout-item
- size="1"
- ></lightning-layout-item>
+ <lightning-layout-item size="1"></lightning-layout-item>
<lightning-layout-item size="5">
- <lightning-output-field
- field-name="SummonsForDirction__c"
- class="hehe-layoutItem"
- ></lightning-output-field>
+ <lightning-output-field field-name="SummonsForDirction__c"
+ class="hehe-layoutItem"></lightning-output-field>
</lightning-layout-item>
- <lightning-layout-item
- size="5"
- style="padding-left: 100px"
- >
- <lightning-output-field
- field-name="Billed_Status__c"
- class="hehe-layoutItem"
- ></lightning-output-field>
+ <lightning-layout-item size="5" style="padding-left: 100px;">
+ <lightning-output-field field-name="Billed_Status__c"
+ class="hehe-layoutItem"></lightning-output-field>
</lightning-layout-item>
- <lightning-layout-item
- size="1"
- ></lightning-layout-item>
+ <lightning-layout-item size="1"></lightning-layout-item>
+
+
</lightning-layout>
<!-- 浜岀骇缁忛攢鍟� -->
- <template
- if:true={isSummonsForDirctionTwoShow}
- >
+ <template if:true={isSummonsForDirctionTwoShow}>
<lightning-layout multiple-rows="true">
- <lightning-layout-item
- size="1"
- ></lightning-layout-item>
+ <lightning-layout-item size="1"></lightning-layout-item>
<lightning-layout-item size="5">
- <lightning-output-field
- field-name="Order_Dealer_Info__c"
- class="hehe-layoutItem"
- ></lightning-output-field>
+ <lightning-output-field field-name="Order_Dealer_Info__c"
+ class="hehe-layoutItem"></lightning-output-field>
</lightning-layout-item>
</lightning-layout>
</template>
<!-- 瀹㈡埛鍚� 鍙戠エ-->
<lightning-layout multiple-rows="true">
- <lightning-layout-item
- size="1"
- ></lightning-layout-item>
+ <lightning-layout-item size="1"></lightning-layout-item>
- <lightning-layout-item
- size="5"
- class="hehe-layoutItem"
- >
- <lightning-output-field
- class="hideHelpText"
- field-name="ShipmentAccount__c"
- ></lightning-output-field>
+ <lightning-layout-item size="5" class="hehe-layoutItem">
+ <lightning-output-field class="hideHelpText"
+ field-name="ShipmentAccount__c"></lightning-output-field>
</lightning-layout-item>
<template if:true={isConInvoiceShow}>
- <lightning-layout-item
- size="5"
- style="padding-left: 100px"
- >
- <lightning-input-field
- data-field={ConInvoice_Code__c}
- onchange={invoiceChange}
- field-name="ConInvoice_Code__c"
- class="hehe-layoutItem inputFont"
- ></lightning-input-field>
+ <lightning-layout-item size="5" style="padding-left: 100px;">
+ <lightning-input-field data-field={ConInvoice_Code__c}
+ onchange={invoiceChange} field-name="ConInvoice_Code__c"
+ class="hehe-layoutItem inputFont"></lightning-input-field>
</lightning-layout-item>
</template>
- <lightning-layout-item
- size="1"
- ></lightning-layout-item>
+ <lightning-layout-item size="1"></lightning-layout-item>
+
+
</lightning-layout>
<!-- 绉戝 鍑哄簱閲戦 -->
<lightning-layout multiple-rows="true">
- <lightning-layout-item
- size="1"
- ></lightning-layout-item>
+ <lightning-layout-item size="1"></lightning-layout-item>
<lightning-layout-item size="5">
- <lightning-output-field
- field-name="Order_ForCustomerText__c"
- class="hehe-layoutItem"
- ></lightning-output-field>
+ <lightning-output-field field-name="Order_ForCustomerText__c"
+ class="hehe-layoutItem"></lightning-output-field>
</lightning-layout-item>
- <lightning-layout-item
- size="5"
- style="padding-left: 100px"
- >
- <lightning-output-field
- field-name="Shipment_total_amount__c"
- class="hehe-layoutItem"
- ></lightning-output-field>
+ <lightning-layout-item size="5" style="padding-left: 100px;">
+ <lightning-output-field field-name="Shipment_total_amount__c"
+ class="hehe-layoutItem"></lightning-output-field>
</lightning-layout-item>
- <lightning-layout-item
- size="1"
- ></lightning-layout-item>
+ <lightning-layout-item size="1"></lightning-layout-item>
+
+
</lightning-layout>
<!-- 娌℃湁纭畾浠锋牸 -->
<lightning-layout multiple-rows="true">
- <lightning-layout-item
- size="1"
- ></lightning-layout-item>
+
+ <lightning-layout-item size="1"></lightning-layout-item>
<lightning-layout-item size="5">
- <lightning-output-field
- field-name="NoConfirmedPrice__c"
- class="hehe-layoutItem"
- ></lightning-output-field>
+ <lightning-output-field field-name="NoConfirmedPrice__c"
+ class="hehe-layoutItem"></lightning-output-field>
</lightning-layout-item>
</lightning-layout>
@@ -999,70 +645,30 @@
<lightning-layout-item size="1">
</lightning-layout-item>
<lightning-layout-item size="10">
- <lightning-card
- class="attListTitle"
- variant="Narrow"
- title="闄勪欢鍒楄〃"
- icon-name="utility:attach"
- >
- <lightning-layout
- slot="footer"
- multiple-rows="true"
- >
- <template
- for:each={fileData}
- for:item="item"
- for:index="index"
- >
- <lightning-layout-item
- padding="around-none"
- size="2"
+ <lightning-card class="attListTitle" variant="Narrow" title="闄勪欢鍒楄〃"
+ icon-name="utility:attach">
+
+ <lightning-layout slot="footer" multiple-rows="true">
+ <template for:each={fileData} for:item="item" for:index="index">
+ <lightning-layout-item padding="around-none" size="2"
key={item.recordId}
- style="
- text-align: left;
- padding: 5px;
- word-wrap: break-word;
- word-break: break-all;
- "
- >
- <lightning-icon
- title={item.Title}
- style="
- margin-left: 20px;
- "
- icon-name="doctype:gform"
+ style="text-align: left;padding:5px;word-wrap:break-word; word-break:break-all;">
+ <lightning-icon title={item.Title}
+ style="margin-left: 20px;" icon-name="doctype:gform"
alternative-text={item.Title}
- size="large"
- ></lightning-icon
- ><br />
- <div
- title={item.Title}
- style="
- width: 100px;
- text-overflow: ellipsis;
- overflow: hidden;
- white-space: nowrap;
- "
- >
+ size="large"></lightning-icon><br />
+ <div title={item.Title} style="width: 100px;text-overflow: ellipsis;overflow: hidden;white-space: nowrap;">
{item.Title}
</div>
<p>
<!-- <a data-fileid ={item.documentId} onclick={previweAtt}> -->
- <a
- href={item.attUrl}
- target="_blank"
- >
- 棰勮 </a
- > 路
- <a
- href={item.downloadUrl}
- >
- 涓嬭浇 </a
- > 路
- <a
- data-fileid={item.Id}
- onclick={deleteAtt}
- >
+ <a href={item.attUrl} target="_blank">
+ 棰勮
+ </a> 路
+ <a href={item.downloadUrl}>
+ 涓嬭浇
+ </a> 路
+ <a data-fileid={item.Id} onclick={deleteAtt}>
鍒犻櫎
</a>
</p>
@@ -1074,6 +680,7 @@
</lightning-layout-item>
</lightning-layout>
</template>
+
</lightning-record-edit-form>
</div>
</div>
@@ -1083,304 +690,123 @@
<!-- 妫�绱� -->
<template if:true={isSearchShow}>
<div class="borderCss">
- <div style="padding: 3px">
+ <div style="padding: 3px;">
<div lwc:dom="manual" class="resultDiv"></div>
<div draggable="false">
- <lightning-layout
- multiple-rows
- style="margin-top: 10px"
- >
- <lightning-layout-item
- style="padding-left: 10px"
- flexibility="auto"
- >
- <div
- class="slds-grid slds-grid_vertical-align-center"
- >
- <div
- class="slds-form-element__label"
- >
- 娑堣�楀搧鍚嶇О
- </div>
- <lightning-input
- type="text"
- name="consumableName"
- label="娑堣�楀搧鍚嶇О"
- value={consumableName}
- variant="label-hidden"
- onchange={dataChange}
- data-field="consumableName"
- class="inputFont"
- style="width: 150px"
- ></lightning-input>
+ <lightning-layout multiple-rows style="margin-top: 10px;">
+ <lightning-layout-item style="padding-left: 10px;" flexibility="auto">
+ <div class="slds-grid slds-grid_vertical-align-center">
+ <div class="slds-form-element__label">娑堣�楀搧鍚嶇О</div>
+ <lightning-input type="text" name="consumableName" label="娑堣�楀搧鍚嶇О"
+ value={consumableName} variant="label-hidden" onchange={dataChange}
+ data-field="consumableName" class="inputFont"
+ style="width:150px"></lightning-input>
</div>
</lightning-layout-item>
<lightning-layout-item flexibility="auto">
- <div
- class="slds-grid slds-grid_vertical-align-center"
- >
- <div
- class="slds-form-element__label"
- style="width: 80px"
- >
- 绗�3鍒嗙被
- </div>
- <lightning-combobox
- name="progress"
- label="绗�3鍒嗙被"
- value={Category3}
- variant="label-hidden"
- options={category3Options}
- onchange={dataChange}
- data-field="Category3"
- style="min-width: 120px"
- class="inputFont"
- ></lightning-combobox>
+ <div class="slds-grid slds-grid_vertical-align-center">
+ <div class="slds-form-element__label" style="width:80px">绗�3鍒嗙被</div>
+ <lightning-combobox name="progress" label="绗�3鍒嗙被" value={Category3}
+ variant="label-hidden" options={category3Options} onchange={dataChange}
+ data-field="Category3" style="min-width: 120px;"
+ class="inputFont"></lightning-combobox>
</div>
</lightning-layout-item>
<lightning-layout-item flexibility="auto">
- <div
- class="slds-grid slds-grid_vertical-align-center"
- >
- <div
- class="slds-form-element__label"
- style="width: 80px"
- >
- 绗�4鍒嗙被
- </div>
- <lightning-combobox
- name="progress"
- label="绗�4鍒嗙被"
- value={Category4}
- variant="label-hidden"
- options={category4Options}
- onchange={dataChange}
- data-field="Category4"
- style="min-width: 120px"
- class="inputFont"
- ></lightning-combobox>
+ <div class="slds-grid slds-grid_vertical-align-center">
+ <div class="slds-form-element__label" style="width:80px">绗�4鍒嗙被</div>
+ <lightning-combobox name="progress" label="绗�4鍒嗙被" value={Category4}
+ variant="label-hidden" options={category4Options} onchange={dataChange}
+ data-field="Category4" style="min-width: 120px;"
+ class="inputFont"></lightning-combobox>
</div>
+
</lightning-layout-item>
<lightning-layout-item flexibility="auto">
- <div
- class="slds-grid slds-grid_vertical-align-center"
- >
- <div
- class="slds-form-element__label"
- style="width: 80px"
- >
- 绗�5鍒嗙被
- </div>
- <lightning-combobox
- name="progress"
- label="绗�5鍒嗙被"
- value={Category5}
- variant="label-hidden"
- onchange={dataChange}
- data-field="Category5"
- options={category5Options}
- style="min-width: 120px"
- class="inputFont"
- ></lightning-combobox>
+ <div class="slds-grid slds-grid_vertical-align-center">
+ <div class="slds-form-element__label" style="width:80px">绗�5鍒嗙被</div>
+ <lightning-combobox name="progress" label="绗�5鍒嗙被" value={Category5}
+ variant="label-hidden" onchange={dataChange} data-field="Category5"
+ options={category5Options} style="min-width: 120px;"
+ class="inputFont"></lightning-combobox>
</div>
+
</lightning-layout-item>
<template if:true={hasHosPro}>
- <lightning-layout-item
- flexibility="auto"
- >
- <div
- class="slds-grid slds-grid_vertical-align-center"
- >
- <div
- class="slds-form-element__label"
- >
- 鍖婚櫌鐗逛环
- </div>
- <lightning-combobox
- name="progress"
- label="鍖婚櫌鐗逛环"
- value={outOutPattern}
- variant="label-hidden"
- options={outOutPatternOptionList}
- onchange={dataChange}
- data-field="outOutPattern"
- style="min-width: 120px"
- class="inputFont"
- ></lightning-combobox>
+ <lightning-layout-item flexibility="auto">
+ <div class="slds-grid slds-grid_vertical-align-center">
+ <div class="slds-form-element__label">鍖婚櫌鐗逛环</div>
+ <lightning-combobox name="progress" label="鍖婚櫌鐗逛环" value={outOutPattern}
+ variant="label-hidden" options={outOutPatternOptionList}
+ onchange={dataChange} data-field="outOutPattern"
+ style="min-width: 120px;" class="inputFont"></lightning-combobox>
</div>
</lightning-layout-item>
</template>
</lightning-layout>
- <lightning-layout
- multiple-rows
- style="margin-top: 10px"
- >
- <lightning-layout-item
- style="
- padding-left: 10px;
- visibility: hidden;
- "
- flexibility="auto"
- >
- <div
- class="slds-grid slds-grid_vertical-align-center"
- >
- <div
- class="slds-form-element__label"
- >
- 娑堣�楀搧鍚嶇О
- </div>
- <lightning-input
- type="text"
- name="consumableName"
- label="娑堣�楀搧鍚嶇О"
- value={consumableName}
- variant="label-hidden"
- onchange={dataChange}
- data-field="consumableName"
- class="inputFont"
- style="width: 150px"
- ></lightning-input>
+ <lightning-layout multiple-rows style="margin-top: 10px;">
+ <lightning-layout-item style="padding-left: 10px;visibility:hidden;"
+ flexibility="auto">
+ <div class="slds-grid slds-grid_vertical-align-center">
+ <div class="slds-form-element__label">娑堣�楀搧鍚嶇О</div>
+ <lightning-input type="text" name="consumableName" label="娑堣�楀搧鍚嶇О"
+ value={consumableName} variant="label-hidden" onchange={dataChange}
+ data-field="consumableName" class="inputFont"
+ style="width:150px"></lightning-input>
</div>
</lightning-layout-item>
- <lightning-layout-item
- flexibility="auto"
- style="visibility: hidden"
- >
- <div
- class="slds-grid slds-grid_vertical-align-center"
- >
- <div
- class="slds-form-element__label"
- style="width: 80px"
- >
- 绗�3鍒嗙被
- </div>
- <lightning-combobox
- name="progress"
- label="绗�3鍒嗙被"
- value={Category3}
- variant="label-hidden"
- options={category3Options}
- onchange={dataChange}
- data-field="Category3"
- style="min-width: 120px"
- class="inputFont"
- ></lightning-combobox>
+ <lightning-layout-item flexibility="auto" style="visibility:hidden;">
+ <div class="slds-grid slds-grid_vertical-align-center">
+ <div class="slds-form-element__label" style="width:80px">绗�3鍒嗙被</div>
+ <lightning-combobox name="progress" label="绗�3鍒嗙被" value={Category3}
+ variant="label-hidden" options={category3Options} onchange={dataChange}
+ data-field="Category3" style="min-width: 120px;"
+ class="inputFont"></lightning-combobox>
</div>
</lightning-layout-item>
- <lightning-layout-item
- flexibility="auto"
- style="visibility: hidden"
- >
- <div
- class="slds-grid slds-grid_vertical-align-center"
- >
- <div
- class="slds-form-element__label"
- style="width: 80px"
- >
- 绗�4鍒嗙被
- </div>
- <lightning-combobox
- name="progress"
- label="绗�4鍒嗙被"
- value={Category4}
- variant="label-hidden"
- options={category4Options}
- onchange={dataChange}
- data-field="Category4"
- style="min-width: 120px"
- class="inputFont"
- ></lightning-combobox>
+ <lightning-layout-item flexibility="auto" style="visibility:hidden;">
+ <div class="slds-grid slds-grid_vertical-align-center">
+ <div class="slds-form-element__label" style="width:80px">绗�4鍒嗙被</div>
+ <lightning-combobox name="progress" label="绗�4鍒嗙被" value={Category4}
+ variant="label-hidden" options={category4Options} onchange={dataChange}
+ data-field="Category4" style="min-width: 120px;"
+ class="inputFont"></lightning-combobox>
</div>
+
</lightning-layout-item>
<template if:false={hasHosPro}>
- <lightning-layout-item
- flexibility="auto"
- >
- <div
- class="slds-grid slds-grid_vertical-align-center"
- >
+ <lightning-layout-item flexibility="auto">
+ <div class="slds-grid slds-grid_vertical-align-center">
<button
class="slds-button slds-button_neutral slds-button_stretch lexBorder lexsearchStyle"
onclick={searchProductJs}
- style="
- min-width: 80px;
- max-width: 100px;
- "
- >
- 妫�绱�
- </button>
- <button
- style="
- margin-left: 10px;
- min-width: 80px;
- max-width: 100px;
- "
+ style="min-width: 80px;max-width: 100px;">妫�绱�</button>
+ <button style="margin-left:10px;min-width: 80px;max-width: 100px;"
class="slds-button slds-button_neutral slds-button_stretch lexBorder lexclearStyle"
- onclick={ClearJs}
- >
- 娓呯┖
- </button>
+ onclick={ClearJs}>娓呯┖</button>
</div>
</lightning-layout-item>
</template>
<template if:true={hasHosPro}>
- <lightning-layout-item
- flexibility="auto"
- style="visibility: hidden"
- >
- <div
- class="slds-grid slds-grid_vertical-align-center"
- >
- <div
- class="slds-form-element__label"
- style="width: 80px"
- >
- 绗�5鍒嗙被
- </div>
- <lightning-combobox
- name="progress"
- label="绗�5鍒嗙被"
- value={Category5}
- variant="label-hidden"
- onchange={dataChange}
- data-field="Category5"
- options={category5Options}
- style="min-width: 120px"
- class="inputFont"
- ></lightning-combobox>
+ <lightning-layout-item flexibility="auto" style="visibility:hidden;">
+ <div class="slds-grid slds-grid_vertical-align-center">
+ <div class="slds-form-element__label" style="width:80px">绗�5鍒嗙被</div>
+ <lightning-combobox name="progress" label="绗�5鍒嗙被" value={Category5}
+ variant="label-hidden" onchange={dataChange} data-field="Category5"
+ options={category5Options} style="min-width: 120px;"
+ class="inputFont"></lightning-combobox>
</div>
</lightning-layout-item>
- <lightning-layout-item
- flexibility="auto"
- >
- <div
- class="slds-grid slds-grid_vertical-align-center"
- >
+ <lightning-layout-item flexibility="auto">
+ <div class="slds-grid slds-grid_vertical-align-center">
<button
class="slds-button slds-button_neutral slds-button_stretch lexBorder lexsearchStyle"
onclick={searchProductJs}
- style="
- min-width: 80px;
- max-width: 110px;
- "
- >
- 妫�绱�
- </button>
- <button
- style="
- margin-left: 10px;
- min-width: 80px;
- max-width: 110px;
- "
+ style="min-width: 80px;max-width: 110px;">妫�绱�</button>
+ <button style="margin-left:10px;min-width: 80px;max-width: 110px;"
class="slds-button slds-button_neutral slds-button_stretch lexBorder lexclearStyle"
- onclick={ClearJs}
- >
- 娓呯┖
- </button>
+ onclick={ClearJs}>娓呯┖</button>
</div>
</lightning-layout-item>
</template>
@@ -1404,86 +830,45 @@
<div style="padding: 7px">
<template if:true={EditAble}>
<template if:true={showTable}>
- <c-lex-custom-lightning-datatable
- key-field="Id"
- data={data}
- columns={columns}
- hide-checkbox-column={hideCheckboxColumn}
- onunitchange={handleUnitChange}
+ <c-lex-custom-lightning-datatable key-field="Id" data={data} columns={columns}
+ hide-checkbox-column={hideCheckboxColumn} onunitchange={handleUnitChange}
onshipmentnumber={handleShipmentNumber}
- onshipmentunitprice={handleShipmentUnitPrice}
- onrowselection={getSelectedRows}
- selected-rows={selectedRows}
- default-sort-direction={defaultSortDirection}
- sorted-direction={sortDirection}
- sorted-by={sortedBy}
- onsort={onHandleSort}
- style="
- word-wrap: break-word;
- word-break: break-all;
- "
- class="wrapped-header-datatable slds-is-selected"
- >
+ onshipmentunitprice={handleShipmentUnitPrice} onrowselection={getSelectedRows}
+ selected-rows={selectedRows} default-sort-direction={defaultSortDirection}
+ sorted-direction={sortDirection} sorted-by={sortedBy} onsort={onHandleSort}
+ style="word-wrap:break-word; word-break:break-all; "
+ class="wrapped-header-datatable slds-is-selected">
</c-lex-custom-lightning-datatable>
</template>
- <c-paginator
- onprevious={handlePrevious}
- onnext={handleNext}
- onpageschange={handlePageschange}
- onfirst={handleFirst}
- onlast={handleLast}
- page-size-options={pageSizeOptions}
- previous-button-disabled={previousButtonDisabled}
- next-button-disabled={nextButtonDisabled}
- record-start={recordStart}
- record-end={recordEnd}
- total-records={totalRecords}
- ></c-paginator>
+ <c-paginator onprevious={handlePrevious} onnext={handleNext}
+ onpageschange={handlePageschange} onfirst={handleFirst} onlast={handleLast}
+ page-size-options={pageSizeOptions} default-page-size={pageSize} previous-button-disabled={previousButtonDisabled}
+ next-button-disabled={nextButtonDisabled} record-start={recordStart}
+ record-end={recordEnd} total-records={totalRecords}></c-paginator>
</template>
<template if:false={EditAble}>
<template if:true={showTable}>
- <c-lex-custom-lightning-datatable
- hide-checkbox-column
- key-field="Id"
- data={editData}
- columns={editColumns}
- onunitchange={handleUnitChange}
+ <c-lex-custom-lightning-datatable hide-checkbox-column key-field="Id" data={editData}
+ columns={editColumns} onunitchange={handleUnitChange}
onshipmentnumber={handleShipmentNumber}
- onshipmentunitprice={handleShipmentUnitPrice}
- onrowselection={getSelectedRows}
- selected-rows={selectedRows}
- default-sort-direction={defaultSortDirection}
- sorted-direction={sortDirection}
- sorted-by={sortedBy}
- onsort={onHandleSort}
- style="
- word-wrap: break-word;
- word-break: break-all;
- "
- class="wrapped-header-datatable slds-is-selected"
- >
+ onshipmentunitprice={handleShipmentUnitPrice} onrowselection={getSelectedRows}
+ selected-rows={selectedRows} default-sort-direction={defaultSortDirection}
+ sorted-direction={sortDirection} sorted-by={sortedBy} onsort={onHandleSort}
+ style="word-wrap:break-word; word-break:break-all; "
+ class="wrapped-header-datatable slds-is-selected">
</c-lex-custom-lightning-datatable>
- <c-paginator
- onprevious={editHandlePrevious}
- onnext={editHandleNext}
- onpageschange={editHandlePageschange}
- onfirst={editHandleFirst}
- onlast={editHandleLast}
- page-size-options={pageSizeOptions}
+ <c-paginator onprevious={editHandlePrevious} onnext={editHandleNext}
+ onpageschange={editHandlePageschange} onfirst={editHandleFirst}
+ onlast={editHandleLast} page-size-options={pageSizeOptions} default-page-size={pageSize}
previous-button-disabled={previousButtonDisabled}
- next-button-disabled={nextButtonDisabled}
- record-start={recordStart}
- record-end={recordEnd}
- total-records={totalRecords}
- ></c-paginator>
+ next-button-disabled={nextButtonDisabled} record-start={recordStart}
+ record-end={recordEnd} total-records={totalRecords}></c-paginator>
</template>
</template>
<template if:true={isEditShowSpinner}>
- <lightning-spinner
- alternative-text="Uploading now"
- ></lightning-spinner>
+ <lightning-spinner alternative-text="Uploading now"></lightning-spinner>
</template>
</div>
</div>
@@ -1501,13 +886,9 @@
</lightning-layout>
</div>
<div style="padding: 7px">
- <lightning-datatable
- key-field="id"
- data={consumableorderdetails2Records}
- columns={consumableorderdetails2RecordsColumns}
- hide-checkbox-column
- class="wrapped-header-datatable"
- >
+ <lightning-datatable key-field="id" data={consumableorderdetails2Records}
+ columns={consumableorderdetails2RecordsColumns} hide-checkbox-column
+ class="wrapped-header-datatable">
</lightning-datatable>
</div>
</div>
@@ -1564,61 +945,36 @@
</lightning-layout-item>
</lightning-layout>
</div>
- <div style="padding: 7px">
+ <div style="padding: 7px;">
<div lwc:dom="manual" class="resultDiv"></div>
<div draggable="false">
- <lightning-layout
- multiple-rows="true"
- style="height: 50px"
- >
- <lightning-layout-item
- class="hehe-layoutItem"
- size="4"
- >
+ <lightning-layout multiple-rows="true" style="height:50px">
+ <lightning-layout-item class="hehe-layoutItem" size="4">
</lightning-layout-item>
<template if:true={isSales}>
- <lightning-layout-item
- class="hehe-layoutItem"
- size="4"
- >
+ <lightning-layout-item class="hehe-layoutItem" size="4">
<!-- <lightning-button label="閿�鍞�" onclick={SaveP}
style="margin-top:-10px"></lightning-button> -->
- <button
- class="slds-button slds-button_neutral slds-button_stretch lexBorder"
- onclick={SaveP}
- >
- 閿�鍞�
- </button>
+ <button class="slds-button slds-button_neutral slds-button_stretch lexBorder"
+ onclick={SaveP}>閿�鍞�</button>
</lightning-layout-item>
</template>
<template if:false={isSales}>
- <lightning-layout-item
- class="hehe-layoutItem"
- size="4"
- >
+ <lightning-layout-item class="hehe-layoutItem" size="4">
<!-- <lightning-button label="鍑鸿揣" onclick={SaveE}></lightning-button> -->
- <button
- class="slds-button slds-button_neutral slds-button_stretch lexBorder"
- onclick={SaveE}
- >
- 鍑鸿揣
- </button>
+ <button class="slds-button slds-button_neutral slds-button_stretch lexBorder"
+ onclick={SaveE}>鍑鸿揣</button>
</lightning-layout-item>
</template>
- <lightning-layout-item
- class="hehe-layoutItem"
- size="4"
- >
+ <lightning-layout-item class="hehe-layoutItem" size="4">
</lightning-layout-item>
</lightning-layout>
<template if:true={isShowInformation}>
- <div class="borderCss" style="margin-top: 5px">
+ <div class="borderCss" style="margin-top: 5px;">
<div class="headerDorderCss">
<lightning-layout>
- <lightning-layout-item
- padding="around-small"
- >
+ <lightning-layout-item padding="around-small">
<p style="font-size: 18px">
<strong>鍑哄簱鍗曚俊鎭�</strong>
</p>
@@ -1626,108 +982,50 @@
</lightning-layout>
</div>
<div style="padding: 7px">
- <div
- lwc:dom="manual"
- class="resultDiv"
- ></div>
+ <div lwc:dom="manual" class="resultDiv"></div>
<div draggable="false">
- <lightning-record-edit-form
- object-api-name="Consumable_order__c"
- record-id={cocId}
- onload={handleLoad2}
- >
- <lightning-layout
- multiple-rows="true"
- >
- <lightning-layout-item
- size="3"
- padding="around-small"
- >
+ <lightning-record-edit-form object-api-name="Consumable_order__c"
+ record-id={cocId} onload={handleLoad2}>
+ <lightning-layout multiple-rows="true">
+ <lightning-layout-item size="3" padding="around-small">
<!-- <lightning-output-field field-name="Name"></lightning-output-field> -->
- <div
- class="slds-grid slds-grid_vertical-align-center"
- >
- <div
- class="slds-form-element__label"
- style="
- padding: 0px;
- "
- >
- 鍑哄簱鍗曞彿锛�
- </div>
- <lightning-output-field
- field-name="Name"
- variant="label-hidden"
- ></lightning-output-field>
+ <div class="slds-grid slds-grid_vertical-align-center">
+ <div class="slds-form-element__label" style="padding: 0px;">
+ 鍑哄簱鍗曞彿锛�</div>
+ <lightning-output-field field-name="Name"
+ variant="label-hidden"></lightning-output-field>
</div>
</lightning-layout-item>
- <lightning-layout-item
- size="4"
- padding="around-small"
- >
+ <lightning-layout-item size="4" padding="around-small">
<!-- <lightning-output-field
field-name="ShipmentAccount__c" class="hideHelpText"></lightning-output-field> -->
<div
- class="slds-grid slds-grid_vertical-align-center hehe-layoutItem"
- >
- <div
- class="slds-form-element__label"
- style="
- padding: 0px;
- "
- >
- 瀹㈡埛鍚嶏細
- </div>
- <lightning-output-field
- field-name="ShipmentAccount__c"
- variant="label-hidden"
- ></lightning-output-field>
+ class="slds-grid slds-grid_vertical-align-center hehe-layoutItem">
+ <div class="slds-form-element__label" style="padding: 0px;">
+ 瀹㈡埛鍚嶏細</div>
+ <lightning-output-field field-name="ShipmentAccount__c"
+ variant="label-hidden"></lightning-output-field>
</div>
</lightning-layout-item>
- <lightning-layout-item
- size="2"
- padding="around-small"
- >
+ <lightning-layout-item size="2" padding="around-small">
<!-- <lightning-output-field
field-name="Order_ForCustomerText__c"></lightning-output-field> -->
- <div
- class="slds-grid slds-grid_vertical-align-center"
- >
- <div
- class="slds-form-element__label"
- style="
- padding: 0px;
- "
- >
- 绉戝锛�
- </div>
+ <div class="slds-grid slds-grid_vertical-align-center">
+ <div class="slds-form-element__label" style="padding: 0px;">
+ 绉戝锛�</div>
<lightning-output-field
field-name="Order_ForCustomerText__c"
- variant="label-hidden"
- ></lightning-output-field>
+ variant="label-hidden"></lightning-output-field>
</div>
</lightning-layout-item>
- <lightning-layout-item
- size="2"
- padding="around-small"
- >
+ <lightning-layout-item size="2" padding="around-small">
<!-- <lightning-output-field
field-name="SummonsForDirction__c"></lightning-output-field> -->
- <div
- class="slds-grid slds-grid_vertical-align-center"
- >
- <div
- class="slds-form-element__label"
- style="
- padding: 0px;
- "
- >
- 鐩殑锛�
- </div>
- <lightning-output-field
- field-name="SummonsForDirction__c"
- variant="label-hidden"
- ></lightning-output-field>
+ <div class="slds-grid slds-grid_vertical-align-center">
+ <div class="slds-form-element__label" style="padding: 0px;">
+ 鐩殑锛�</div>
+ <lightning-output-field field-name="SummonsForDirction__c"
+ variant="label-hidden"></lightning-output-field>
</div>
</lightning-layout-item>
</lightning-layout>
@@ -1740,79 +1038,42 @@
<div class="borderCss">
<div class="headerDorderCss">
<lightning-layout>
- <lightning-layout-item
- padding="around-small"
- >
+ <lightning-layout-item padding="around-small">
<p style="font-size: 18px">
- <strong
- >BarCode褰曞叆</strong
- >
+ <strong>BarCode褰曞叆</strong>
</p>
</lightning-layout-item>
</lightning-layout>
</div>
<div style="padding: 7px">
- <div
- lwc:dom="manual"
- class="resultDiv"
- ></div>
+ <div lwc:dom="manual" class="resultDiv"></div>
<div draggable="false">
- <lightning-record-edit-form
- object-api-name="Consumable_order__c"
- record-id={cocId}
- >
- <lightning-layout
- multiple-rows="true"
- >
- <lightning-layout-item
- size="1"
- ></lightning-layout-item>
- <lightning-layout-item
- padding="around-small"
- >
+ <lightning-record-edit-form object-api-name="Consumable_order__c"
+ record-id={cocId}>
+ <lightning-layout multiple-rows="true">
+ <lightning-layout-item size="1"></lightning-layout-item>
+ <lightning-layout-item padding="around-small">
<!-- <lightning-textarea name="Barcode" label="BarCode鍙�"
onchange={dataChange} variant="label-inline"
data-field="Barcode"
value={Barcode}></lightning-textarea> -->
- <div
- class="slds-grid"
- >
- <div
- class="slds-form-element__label"
- >
- BarCode鍙�
- </div>
- <lightning-textarea
- name="Barcode"
- label="BarCode鍙�"
- onchange={dataChange}
- variant="label-hidden"
- data-field="Barcode"
- value={Barcode}
- style="
- min-width: 400px;
- "
- ></lightning-textarea>
+ <div class="slds-grid">
+ <div class="slds-form-element__label">BarCode鍙�</div>
+ <lightning-textarea name="Barcode" label="BarCode鍙�"
+ onchange={dataChange} variant="label-hidden"
+ data-field="Barcode" value={Barcode}
+ style="min-width: 400px;"></lightning-textarea>
</div>
</lightning-layout-item>
- <lightning-layout-item
- padding="around-small"
- >
- <div
- class="slds-grid slds-grid_vertical-align-center"
- >
- <div
- class="slds-form-element__label"
- >
+ <lightning-layout-item padding="around-small">
+ <div class="slds-grid slds-grid_vertical-align-center">
+ <div class="slds-form-element__label">
<!-- <lightning-button label="纭"
onclick={SalesearchProductJs}></lightning-button> -->
<button
class="slds-button slds-button_neutral slds-button_stretch lexBorder"
- onclick={SalesearchProductJs}
- >
- 鑾峰彇鏄庣粏
- </button>
+ onclick={SalesearchProductJs}>鑾峰彇鏄庣粏</button>
</div>
</div>
</lightning-layout-item>
@@ -1826,9 +1087,7 @@
<div class="borderCss">
<div class="headerDorderCss">
<lightning-layout>
- <lightning-layout-item
- padding="around-small"
- >
+ <lightning-layout-item padding="around-small">
<p style="font-size: 18px">
<strong>鍑鸿揣鏄庣粏</strong>
</p>
@@ -1836,28 +1095,18 @@
</lightning-layout>
</div>
<div style="padding: 7px">
- <div
- lwc:dom="manual"
- class="resultDiv"
- ></div>
+ <div lwc:dom="manual" class="resultDiv"></div>
<div draggable="false">
<!-- <lightning-datatable key-field="id" data={salesData} columns={salesColumns}
hide-checkbox-column
style="word-wrap:break-word; word-break:break-all; "
class="wrapped-header-datatable">
</lightning-datatable> -->
- <c-lex-custom-lightning-datatable
- key-field="Id"
- data={salesData}
- columns={salesColumns}
- onoutboundcount={handleOutboundCount}
+ <c-lex-custom-lightning-datatable key-field="Id" data={salesData}
+ columns={salesColumns} onoutboundcount={handleOutboundCount}
hide-checkbox-column
- style="
- word-wrap: break-word;
- word-break: break-all;
- "
- class="wrapped-header-datatable"
- >
+ style="word-wrap:break-word; word-break:break-all; "
+ class="wrapped-header-datatable">
</c-lex-custom-lightning-datatable>
</div>
</div>
@@ -1866,77 +1115,45 @@
<div class="borderCss">
<div class="headerDorderCss">
<lightning-layout>
- <lightning-layout-item
- padding="around-small"
- >
+ <lightning-layout-item padding="around-small">
<p style="font-size: 18px">
- <strong
- >鍑鸿揣閿欒鏄庣粏</strong
- >
+ <strong>鍑鸿揣閿欒鏄庣粏</strong>
</p>
</lightning-layout-item>
</lightning-layout>
</div>
<div style="padding: 7px">
- <div
- lwc:dom="manual"
- class="resultDiv"
- ></div>
+ <div lwc:dom="manual" class="resultDiv"></div>
<div draggable="false">
- <lightning-datatable
- key-field="id"
- data={salesErrorData}
- columns={salesErrorColumns}
- hide-checkbox-column
- style="
- word-wrap: break-word;
- word-break: break-all;
- "
- class="wrapped-header-datatable"
- >
+ <lightning-datatable key-field="id" data={salesErrorData}
+ columns={salesErrorColumns} hide-checkbox-column
+ style="word-wrap:break-word; word-break:break-all; "
+ class="wrapped-header-datatable">
</lightning-datatable>
</div>
</div>
</div>
<lightning-layout multiple-rows="true">
- <lightning-layout-item
- class="hehe-layoutItem"
- size="4"
- >
+ <lightning-layout-item class="hehe-layoutItem" size="4">
</lightning-layout-item>
<template if:true={isSales}>
- <lightning-layout-item
- class="hehe-layoutItem"
- size="4"
- >
+ <lightning-layout-item class="hehe-layoutItem" size="4">
<!-- <lightning-button label="閿�鍞�" onclick={SaveP}></lightning-button> -->
<button
class="slds-button slds-button_neutral slds-button_stretch lexBorder"
- onclick={SaveP}
- >
- 閿�鍞�
- </button>
+ onclick={SaveP}>閿�鍞�</button>
</lightning-layout-item>
</template>
<template if:false={isSales}>
- <lightning-layout-item
- class="hehe-layoutItem"
- size="4"
- >
+ <lightning-layout-item class="hehe-layoutItem" size="4">
<!-- <lightning-button label="鍑鸿揣" onclick={SaveE}></lightning-button> -->
<button
class="slds-button slds-button_neutral slds-button_stretch lexBorder"
- onclick={SaveE}
- >
- 鍑鸿揣
- </button>
+ onclick={SaveE}>鍑鸿揣</button>
</lightning-layout-item>
</template>
- <lightning-layout-item
- class="hehe-layoutItem"
- size="4"
- >
+ <lightning-layout-item class="hehe-layoutItem" size="4">
</lightning-layout-item>
</lightning-layout>
</template>
@@ -1946,4 +1163,4 @@
</template>
</div>
</div>
-</template>
+</template>
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexSummonsCreat/lexSummonsCreat.js b/force-app/main/default/lwc/lexSummonsCreat/lexSummonsCreat.js
index 464a3f1..1936433 100644
--- a/force-app/main/default/lwc/lexSummonsCreat/lexSummonsCreat.js
+++ b/force-app/main/default/lwc/lexSummonsCreat/lexSummonsCreat.js
@@ -1,34 +1,34 @@
-import { LightningElement, wire, api, track } from 'lwc';
-import init from '@salesforce/apex/LexSummonsCreatController.init';
-import { ShowToastEvent } from 'lightning/platformShowToastEvent';
-import searchConsumableorderdetails from '@salesforce/apex/LexSummonsCreatController.searchConsumableorderdetails';
-import PraseToPDF from '@salesforce/apex/LexSummonsCreatController.PraseToPDF';
-import apexSearch from '@salesforce/apex/LexSummonsCreatController.search';
-import saveFile from '@salesforce/apex/LexSummonsCreatController.saveFile';
-import getFiles from '@salesforce/apex/LexSummonsCreatController.getFiles';
-import GoodsDelivery from '@salesforce/apex/LexSummonsCreatController.GoodsDelivery';
-import DelConsumable from '@salesforce/apex/LexSummonsCreatController.DelConsumable';
-import categoryAllload from '@salesforce/apex/LexSummonsCreatController.categoryAllload';
-import categoryload from '@salesforce/apex/LexSummonsCreatController.categoryload';
-import GoodsDeliveryInit from '@salesforce/apex/LexSaleOrderController.GoodsDeliveryInit';
-import SearchPro from '@salesforce/apex/LexSaleOrderController.SearchPro';
-import ProdElivery from '@salesforce/apex/LexSaleOrderController.ProdElivery';
-import ProSale from '@salesforce/apex/LexSaleOrderController.ProSale';
-import save from '@salesforce/apex/LexSummonsCreatController.save';
-import OPPORTUNITY_OBJECT from '@salesforce/schema/Consumable_Orderdetails__c';
-import { getObjectInfo } from 'lightning/uiObjectInfoApi';
-import hospitalInit from '@salesforce/apex/lexSearchAgencyHospitalController.init';
-import serContact from '@salesforce/apex/lexSearchAgencyHospitalController.serContact';
+import { LightningElement, wire, api, track } from "lwc";
+import init from "@salesforce/apex/LexSummonsCreatController.init";
+import { ShowToastEvent } from "lightning/platformShowToastEvent";
+import searchConsumableorderdetails from "@salesforce/apex/LexSummonsCreatController.searchConsumableorderdetails";
+import PraseToPDF from "@salesforce/apex/LexSummonsCreatController.PraseToPDF";
+import apexSearch from "@salesforce/apex/LexSummonsCreatController.search";
+import saveFile from "@salesforce/apex/LexSummonsCreatController.saveFile";
+import getFiles from "@salesforce/apex/LexSummonsCreatController.getFiles";
+import GoodsDelivery from "@salesforce/apex/LexSummonsCreatController.GoodsDelivery";
+import DelConsumable from "@salesforce/apex/LexSummonsCreatController.DelConsumable";
+import categoryAllload from "@salesforce/apex/LexSummonsCreatController.categoryAllload";
+import categoryload from "@salesforce/apex/LexSummonsCreatController.categoryload";
+import GoodsDeliveryInit from "@salesforce/apex/LexSaleOrderController.GoodsDeliveryInit";
+import SearchPro from "@salesforce/apex/LexSaleOrderController.SearchPro";
+import ProdElivery from "@salesforce/apex/LexSaleOrderController.ProdElivery";
+import ProSale from "@salesforce/apex/LexSaleOrderController.ProSale";
+import save from "@salesforce/apex/LexSummonsCreatController.save";
+import OPPORTUNITY_OBJECT from "@salesforce/schema/Consumable_Orderdetails__c";
+import { getObjectInfo } from "lightning/uiObjectInfoApi";
+import hospitalInit from "@salesforce/apex/lexSearchAgencyHospitalController.init";
+import serContact from "@salesforce/apex/lexSearchAgencyHospitalController.serContact";
import deleteAtt from '@salesforce/apex/LexSummonsCreatController.deleteAtt';
-import { NavigationMixin } from 'lightning/navigation';
-//table css
-import { loadStyle } from 'lightning/platformResourceLoader';
-import WrappedHeaderTable from '@salesforce/resourceUrl/lexdatatable';
+import { NavigationMixin } from "lightning/navigation";
+//table css
+import { loadStyle } from "lightning/platformResourceLoader";
+import WrappedHeaderTable from "@salesforce/resourceUrl/lexdatatable";
import ConsumableOutboundReportId from '@salesforce/label/c.ConsumableOutboundReportId';
const customLabel = {
ConsumableOutboundReportId
-};
+}
export default class LexSummonsCreat extends NavigationMixin(LightningElement) {
@track label = customLabel;
@@ -37,424 +37,424 @@
@track showResults = true;
@track results = [
{
- Id: '1',
- Name: 'z'
+ Id: "1",
+ Name: "z",
},
{
- Id: '2',
- Name: 'h'
+ Id: "2",
+ Name: "h",
},
{
- Id: '3',
- Name: 'j'
- }
+ Id: "3",
+ Name: "j",
+ },
];
@track COLS = [
{
- label: 'Account Name',
- type: 'customName',
+ label: "Account Name",
+ type: "customName",
typeAttributes: {
- accountName: { fieldName: 'Name' }
- }
- }
+ accountName: { fieldName: "Name" },
+ },
+ },
];
@track columns = [
{
- label: '娑堣�楀搧鍚嶇О',
- fieldName: 'Name__c',
+ label: "娑堣�楀搧鍚嶇О",
+ fieldName: "Name__c",
hideDefaultActions: true,
wrapText: true,
initialWidth: 175,
sortable: true
},
{
- label: '瑙勬牸',
- fieldName: 'packinglist',
- cellAttributes: { alignment: 'right' },
+ label: "瑙勬牸",
+ fieldName: "packinglist",
+ cellAttributes: { alignment: "right" },
wrapText: true,
initialWidth: 50,
- hideDefaultActions: true
+ hideDefaultActions: true,
},
{
- label: 'CFDA鐘舵��',
- fieldName: 'SFDA_Status__c',
+ label: "CFDA鐘舵��",
+ fieldName: "SFDA_Status__c",
initialWidth: 105,
wrapText: true,
- hideDefaultActions: true
+ hideDefaultActions: true,
},
{
- label: '娉ㄥ唽璇佺紪鐮佸彿',
- fieldName: 'approbation_No',
+ label: "娉ㄥ唽璇佺紪鐮佸彿",
+ fieldName: "approbation_No",
wrapText: true,
initialWidth: 105,
- hideDefaultActions: true
+ hideDefaultActions: true,
},
{
- label: '娉ㄥ唽璇佹晥鏈�',
+ label: "娉ㄥ唽璇佹晥鏈�",
wrapText: true,
initialWidth: 115,
- fieldName: 'expiration_Date',
- hideDefaultActions: true
+ fieldName: "expiration_Date",
+ hideDefaultActions: true,
},
{
- label: '绗�3鍒嗙被',
- fieldName: 'Category3__c',
+ label: "绗�3鍒嗙被",
+ fieldName: "Category3__c",
wrapText: true,
initialWidth: 115,
hideDefaultActions: true,
- sortable: true
+ sortable: true,
},
{
- label: '绗�4鍒嗙被',
- fieldName: 'Category4__c',
+ label: "绗�4鍒嗙被",
+ fieldName: "Category4__c",
wrapText: true,
initialWidth: 115,
hideDefaultActions: true,
- sortable: true
+ sortable: true,
},
{
- label: '绗�5鍒嗙被',
- fieldName: 'Category5__c',
+ label: "绗�5鍒嗙被",
+ fieldName: "Category5__c",
wrapText: true,
initialWidth: 115,
hideDefaultActions: true,
- sortable: true
+ sortable: true,
},
{
- label: '鍗曚綅',
- type: 'customUnit',
+ label: "鍗曚綅",
+ type: "customUnit",
initialWidth: 100,
hideDefaultActions: true,
typeAttributes: {
- unitValue: { fieldName: 'unitValue' },
- unitOptions: { fieldName: 'unitOptions' },
- recordId: { fieldName: 'Id' }
+ unitValue: { fieldName: "unitValue" },
+ unitOptions: { fieldName: "unitOptions" },
+ recordId: { fieldName: "Id" },
}
},
{
- label: '鍑鸿揣鏁伴噺',
- type: 'customShipment',
+ label: "鍑鸿揣鏁伴噺",
+ type: "customShipment",
initialWidth: 100,
hideDefaultActions: true,
- cellAttributes: { alignment: 'right' },
+ cellAttributes: { alignment: "right" },
typeAttributes: {
- recordId: { fieldName: 'Id' },
- shipmentNumber: { fieldName: 'shipmentNumber' }
- }
+ recordId: { fieldName: "Id" },
+ shipmentNumber: { fieldName: "shipmentNumber" },
+ },
},
{
- label: '鍑鸿揣鍗曚环(鍏�)',
- type: 'customShipmentUnitPrice',
+ label: "鍑鸿揣鍗曚环(鍏�)",
+ type: "customShipmentUnitPrice",
hideDefaultActions: true,
initialWidth: 120,
typeAttributes: {
- recordId: { fieldName: 'Id' },
- shippingUnitPrice: { fieldName: 'shippingUnitPrice' }
- }
+ recordId: { fieldName: "Id" },
+ shippingUnitPrice: { fieldName: "shippingUnitPrice" },
+ },
},
{
- label: '鍑鸿揣閲戦(鍏�)',
- type: 'customShipmentAmount',
+ label: "鍑鸿揣閲戦(鍏�)",
+ type: "customShipmentAmount",
initialWidth: 120,
- cellAttributes: { alignment: 'right' },
+ cellAttributes: { alignment: "right" },
hideDefaultActions: true,
typeAttributes: {
- shipmentAmount: { fieldName: 'shipmentAmount' }
- }
+ shipmentAmount: { fieldName: "shipmentAmount" },
+ },
},
{
- label: '鏈夋晥鏈熷唴搴撳瓨(鐩�)',
- fieldName: 'Boxnumber',
- cellAttributes: { alignment: 'right' },
+ label: "鏈夋晥鏈熷唴搴撳瓨(鐩�)",
+ fieldName: "Boxnumber",
+ cellAttributes: { alignment: "right" },
wrapText: true,
initialWidth: 160,
- hideDefaultActions: true
+ hideDefaultActions: true,
},
{
- label: '鏈夋晥鏈熷唴搴撳瓨(涓�)',
- fieldName: 'Piecenumber',
- cellAttributes: { alignment: 'right' },
+ label: "鏈夋晥鏈熷唴搴撳瓨(涓�)",
+ fieldName: "Piecenumber",
+ cellAttributes: { alignment: "right" },
wrapText: true,
initialWidth: 160,
- hideDefaultActions: true
- }
+ hideDefaultActions: true,
+ },
];
@track editColumns = [
{
- label: '娑堣�楀搧鍚嶇О',
- fieldName: 'Name__c',
+ label: "娑堣�楀搧鍚嶇О",
+ fieldName: "Name__c",
hideDefaultActions: true,
wrapText: true,
- sortable: true
+ sortable: true,
},
{
- label: '瑙勬牸',
- fieldName: 'packinglist',
+ label: "瑙勬牸",
+ fieldName: "packinglist",
initialWidth: 50,
- cellAttributes: { alignment: 'right' },
+ cellAttributes: { alignment: "right" },
hideDefaultActions: true,
- wrapText: true
+ wrapText: true,
},
{
- label: 'CFDA鐘舵��',
- fieldName: 'SFDA_Status__c',
+ label: "CFDA鐘舵��",
+ fieldName: "SFDA_Status__c",
hideDefaultActions: true,
initialWidth: 100,
- wrapText: true
+ wrapText: true,
},
{
- label: '娉ㄥ唽璇佺紪鐮佸彿',
- fieldName: 'approbation_No',
+ label: "娉ㄥ唽璇佺紪鐮佸彿",
+ fieldName: "approbation_No",
hideDefaultActions: true,
initialWidth: 170,
- wrapText: true
+ wrapText: true,
},
{
- label: '娉ㄥ唽璇佹晥鏈�',
- fieldName: 'expiration_Date',
+ label: "娉ㄥ唽璇佹晥鏈�",
+ fieldName: "expiration_Date",
hideDefaultActions: true,
initialWidth: 100,
- wrapText: true
+ wrapText: true,
},
{
- label: '绗�3鍒嗙被',
- fieldName: 'Category3__c',
+ label: "绗�3鍒嗙被",
+ fieldName: "Category3__c",
hideDefaultActions: true,
sortable: true,
- wrapText: true
+ wrapText: true,
},
{
- label: '绗�4鍒嗙被',
- fieldName: 'Category4__c',
+ label: "绗�4鍒嗙被",
+ fieldName: "Category4__c",
hideDefaultActions: true,
sortable: true,
- wrapText: true
+ wrapText: true,
},
{
- label: '绗�5鍒嗙被',
- fieldName: 'Category5__c',
+ label: "绗�5鍒嗙被",
+ fieldName: "Category5__c",
hideDefaultActions: true,
sortable: true,
- wrapText: true
+ wrapText: true,
},
{
- label: '鍗曚綅',
- fieldName: 'Box_Piece__c',
+ label: "鍗曚綅",
+ fieldName: "Box_Piece__c",
initialWidth: 50,
hideDefaultActions: true,
- wrapText: true
+ wrapText: true,
},
{
- label: '鍑鸿揣鏁伴噺',
- fieldName: 'Shipment_Count__c',
+ label: "鍑鸿揣鏁伴噺",
+ fieldName: "Shipment_Count__c",
initialWidth: 90,
- cellAttributes: { alignment: 'right' },
+ cellAttributes: { alignment: "right" },
hideDefaultActions: true,
- wrapText: true
+ wrapText: true,
},
{
- label: '鍑鸿揣鍗曚环(鍏�)',
- fieldName: 'shippingUnitPrice',
- type: 'number',
+ label: "鍑鸿揣鍗曚环(鍏�)",
+ fieldName: "shippingUnitPrice",
+ type: "number",
initialWidth: 100,
typeAttributes: {
- minimumFractionDigits: 2
+ minimumFractionDigits: 2,
},
hideDefaultActions: true,
- wrapText: true
- }
+ wrapText: true,
+ },
];
@track editData = [];
@track hospitalList = [];
@track hospitalColumns = [
{
- label: '',
- fieldName: 'Id1',
- type: 'button',
+ label: "",
+ fieldName: "Id1",
+ type: "button",
hideDefaultActions: true,
initialWidth: 90,
typeAttributes: {
- label: '閫夋嫨',
- name: 'Id2',
- size: 1
- }
+ label: "閫夋嫨",
+ name: "Id2",
+ size: 1,
+ },
},
{
- label: '鍖婚櫌鍚嶇О',
- fieldName: 'Name',
+ label: "鍖婚櫌鍚嶇О",
+ fieldName: "Name",
hideDefaultActions: true,
- wrapText: true
+ wrapText: true,
},
{
- label: '鐪佷唤',
- fieldName: 'stateMasterName',
- hideDefaultActions: true
+ label: "鐪佷唤",
+ fieldName: "stateMasterName",
+ hideDefaultActions: true,
}
];
- @track accountid = '';
+ @track accountid = "";
@track consumableproductdetailsRecords = [];
- @track SummonsStatus = '';
- @track ESetid = '';
- @track statusEdit = '';
+ @track SummonsStatus = "";
+ @track ESetid = "";
+ @track statusEdit = "";
@track cocLwc = {};
@track selectedRows = [];
- @track ConsumableOut_report = '';
+ @track ConsumableOut_report = "";
@track isMutualTransferGoods = false;
- @track Barcode = '';
+ @track Barcode = "";
@track summonsForDirction = '';
@track accountValue = '';
@track consumableorderdetails2RecordsColumns = [
{
- label: '娑堣�楀搧鍚嶇О',
- fieldName: 'ProdName',
+ label: "娑堣�楀搧鍚嶇О",
+ fieldName: "ProdName",
hideDefaultActions: true,
- wrapText: true
+ wrapText: true,
},
{
- label: '鎵规鍙�',
- fieldName: 'orderdetails2SerialLotNo__c',
- hideDefaultActions: true
+ label: "鎵规鍙�",
+ fieldName: "orderdetails2SerialLotNo__c",
+ hideDefaultActions: true,
},
{
- label: '绠$悊缂栫爜',
- fieldName: 'orderdetails2TracingCode__c',
- hideDefaultActions: true
+ label: "绠$悊缂栫爜",
+ fieldName: "orderdetails2TracingCode__c",
+ hideDefaultActions: true,
},
{
- label: '浣跨敤鏈熼檺',
- fieldName: 'orderdetails2Sterilization_limit__c',
- hideDefaultActions: true
- }
+ label: "浣跨敤鏈熼檺",
+ fieldName: "orderdetails2Sterilization_limit__c",
+ hideDefaultActions: true,
+ },
];
@track consumableorderdetails2Records = [];
//鍑鸿揣/閿�鍞�
@track salesColumns = [
{
- label: '娑堣�楀搧璁㈠崟',
- fieldName: 'ConsumableorderminorUrl',
+ label: "娑堣�楀搧璁㈠崟",
+ fieldName: "ConsumableorderminorUrl",
hideDefaultActions: true,
- type: 'url',
+ type: "url",
typeAttributes: {
- label: { fieldName: 'Consumable_order_minor__c' },
- target: '_blank'
+ label: { fieldName: "Consumable_order_minor__c" },
+ target: "_blank",
},
- wrapText: true
+ wrapText: true,
},
{
- label: '娑堣�楀搧鏄庣粏2鍚嶇О',
- fieldName: 'orderdetails2NameUrl',
- type: 'url',
+ label: "娑堣�楀搧鏄庣粏2鍚嶇О",
+ fieldName: "orderdetails2NameUrl",
+ type: "url",
initialWidth: 150,
typeAttributes: {
- label: { fieldName: 'orderdetails2Name' },
- target: '_blank'
+ label: { fieldName: "orderdetails2Name" },
+ target: "_blank",
},
hideDefaultActions: true,
- wrapText: true
+ wrapText: true,
},
{
- label: '鍗曚綅',
- fieldName: 'Box_Piece__c',
+ label: "鍗曚綅",
+ fieldName: "Box_Piece__c",
hideDefaultActions: true,
wrapText: true,
initialWidth: 50
},
{
- label: '娑堣�楀搧鍚嶇О',
- fieldName: 'ProdName',
+ label: "娑堣�楀搧鍚嶇О",
+ fieldName: "ProdName",
initialWidth: 100,
hideDefaultActions: true,
- wrapText: true
+ wrapText: true,
},
{
- label: '鍙戣揣鏃ユ湡',
- fieldName: 'Deliver_date__c',
+ label: "鍙戣揣鏃ユ湡",
+ fieldName: "Deliver_date__c",
hideDefaultActions: true,
- wrapText: true
+ wrapText: true,
},
{
- label: 'BarCode',
- fieldName: 'Bar_Code__c',
+ label: "BarCode",
+ fieldName: "Bar_Code__c",
hideDefaultActions: true,
wrapText: true,
initialWidth: 380
},
{
- label: '浣跨敤鏈熼檺',
- fieldName: 'Sterilization_limit__c',
+ label: "浣跨敤鏈熼檺",
+ fieldName: "Sterilization_limit__c",
hideDefaultActions: true,
- wrapText: true
+ wrapText: true,
},
{
- label: '鍑鸿揣鏁伴噺',
+ label: "鍑鸿揣鏁伴噺",
fieldName: 'outboundCount',
hideDefaultActions: true,
- cellAttributes: { alignment: 'right' }
+ cellAttributes: { alignment: "right" },
}
];
@track salesData = [];
@track salesErrorColumns = [
{
- label: '娑堣�楀搧璁㈠崟',
- fieldName: 'ConsumableorderminorUrl',
+ label: "娑堣�楀搧璁㈠崟",
+ fieldName: "ConsumableorderminorUrl",
hideDefaultActions: true,
- type: 'url',
+ type: "url",
typeAttributes: {
- label: { fieldName: 'Consumable_order_minor__c' },
- target: '_blank'
+ label: { fieldName: "Consumable_order_minor__c" },
+ target: "_blank",
},
- wrapText: true
+ wrapText: true,
},
{
- label: '娑堣�楀搧鏄庣粏2鍚嶇О',
- fieldName: 'orderdetails2Name',
+ label: "娑堣�楀搧鏄庣粏2鍚嶇О",
+ fieldName: "orderdetails2Name",
hideDefaultActions: true,
initialWidth: 150,
- wrapText: true
+ wrapText: true,
},
{
- label: '娑堣�楀搧鍚嶇О',
- fieldName: 'ProdName',
+ label: "娑堣�楀搧鍚嶇О",
+ fieldName: "ProdName",
hideDefaultActions: true,
- wrapText: true
+ wrapText: true,
},
{
- label: '鍗曚綅',
- fieldName: 'Box_Piece__c',
+ label: "鍗曚綅",
+ fieldName: "Box_Piece__c",
hideDefaultActions: true,
wrapText: true,
initialWidth: 50
},
{
- label: 'BarCode',
- fieldName: 'Bar_Code__c',
+ label: "BarCode",
+ fieldName: "Bar_Code__c",
hideDefaultActions: true,
wrapText: true,
initialWidth: 380
},
{
- label: '浣跨敤鏈熼檺',
- fieldName: 'Sterilization_limit__c',
+ label: "浣跨敤鏈熼檺",
+ fieldName: "Sterilization_limit__c",
hideDefaultActions: true,
- wrapText: true
+ wrapText: true,
},
{
- label: '閿欒鍘熷洜',
- fieldName: 'ErrorReason',
+ label: "閿欒鍘熷洜",
+ fieldName: "ErrorReason",
hideDefaultActions: true,
- wrapText: true
- }
+ wrapText: true,
+ },
];
@track salesErrorData = [];
- @track salesAccountName = '';
- @track salesUserWorkLocation = '';
- @track salesAccountid = '';
+ @track salesAccountName = "";
+ @track salesUserWorkLocation = "";
+ @track salesAccountid = "";
@track salesOrderdetails = [];
@track salesCoc = {};
@track salesOrderpieceorboxMap;
@@ -487,55 +487,55 @@
@track isDeleteDisabled = false;
//鍑哄簱鍗曚俊鎭�
- @track cocId = '';
+ @track cocId = "";
@track EditAble = false;
@track summonsStatusPriceNotDetermined = false;
@track isSummonsForDirctionTwoShow = false;
@track isSummonsFlag = false;
@track isConInvoiceShow = false;
- @track sumPrice = '';
+ @track sumPrice = "";
@track isSearchShow = false;
@track Existarrive = false;
- @track Category3 = '';
+ @track Category3 = "";
@track category3Options = [];
- @track Category4 = '';
+ @track Category4 = "";
@track category4Options = [];
- @track Category5 = '';
+ @track Category5 = "";
@track category5Options = [];
//鍙戠エid
@track invoiceId = '';
//浜岀骇缁忛攢鍟�
- @track secondaryDistributor = '';
+ @track secondaryDistributor = "";
@track secondaryDistributorOptions = [];
@track isDisabledSecondaryDistributor = false;
//缁忛攢鍟嗗綍鍏�
- @track ForDealerText = '';
+ @track ForDealerText = "";
@track isDisabledForDealerText = false;
//瀹㈡埛鍚�
@track isModalOpen = false;
- @track HospitalName = '';
- @track searchHospitalName = '';
- @track OECId = '';
+ @track HospitalName = "";
+ @track searchHospitalName = "";
+ @track OECId = "";
@track isDisabledHospitalName = false;
//绉戝
- @track ForCustomerText = '';
+ @track ForCustomerText = "";
@track isDisabledForCustomerText = false;
//娌℃湁纭畾浠锋牸
@track NoConfirmedPrice = false;
//娑堣�楀搧鍚嶇О
- @track consumableName = '';
+ @track consumableName = "";
- @track agencyProType = '';
- @track accountName = '';
- @track userWorkLocation = '';
+ @track agencyProType = "";
+ @track accountName = "";
+ @track userWorkLocation = "";
@track OutPattern__c = false;
- @track outOutPattern = '';
+ @track outOutPattern = "";
//鍑哄簱鍗曟槑缁�
@track showTable = false;
@@ -543,30 +543,30 @@
@track isSelectShow = false;
@track hidecheckboxcolumn = false;
@track is345Show = false;
- @track arriveorder = '';
+ @track arriveorder = "";
@track hasHosPro = false;
- @track InvoiceProNotLabel = '';
- @track RrturnProLabel = '';
- @track InvoicedLabel = '';
+ @track InvoiceProNotLabel = "";
+ @track RrturnProLabel = "";
+ @track InvoicedLabel = "";
@track outOutPatternOptionList = [];
//鏂囦欢涓婁紶
@track showLoadingSpinner = false;
- @track UploadFile = 'Upload File';
- @track fileName = '';
+ @track UploadFile = "Upload File";
+ @track fileName = "";
@track fileData = [];
@track fileColumns = [
{
- label: '鏍囬',
- fieldName: 'url',
- type: 'url',
- typeAttributes: { label: { fieldName: 'Title' }, target: '_blank' },
- hideDefaultActions: true
+ label: "鏍囬",
+ fieldName: "url",
+ type: "url",
+ typeAttributes: { label: { fieldName: "Title" }, target: "_blank" },
+ hideDefaultActions: true,
},
{
- label: '鍒涘缓浜�',
- fieldName: 'CreatedByName',
- hideDefaultActions: true
+ label: "鍒涘缓浜�",
+ fieldName: "CreatedByName",
+ hideDefaultActions: true,
},
{
label: '',
@@ -579,7 +579,7 @@
},
initialWidth: 50,
hideDefaultActions: true
- }
+ },
];
filesUploaded = [];
fileContents;
@@ -593,7 +593,7 @@
defaultSortDirection = 'asc';
sortDirection = 'asc';
sortedBy;
- @track pageSize = 10;
+ @track pageSize = 200;
error;
records;
currentPageToken = 0;
@@ -603,7 +603,7 @@
@track pageNumber = 1;
@track paginationVisibility = false;
@track totalPages = 1;
- pageSizeOptions = [10, 25, 50, 100];
+ pageSizeOptions = [100, 200, 300];
@track recordStart = 0;
@track recordEnd = 0;
//end
@@ -615,14 +615,15 @@
if (!this.stylesLoaded) {
Promise.all([loadStyle(this, WrappedHeaderTable)])
.then(() => {
- console.log('Custom styles loaded');
+ console.log("Custom styles loaded");
this.stylesLoaded = true;
})
.catch((error) => {
- console.error('Error loading custom styles');
+ console.error("Error loading custom styles");
});
}
}
+
//InvoiceProNotLabel RrturnProLabel InvoicedLabel
@wire(getObjectInfo, { objectApiName: OPPORTUNITY_OBJECT })
@@ -631,16 +632,16 @@
this.InvoiceProNotLabel = data.fields.InvoiceProNot_count__c.label;
this.RrturnProLabel = data.fields.RrturnPro_count__c.label;
this.InvoicedLabel = data.fields.Invoiced_Procount__c.label;
- console.log('this.InvoiceProNotLabel = ' + this.InvoiceProNotLabel);
- console.log('this.RrturnProLabel = ' + this.RrturnProLabel);
- console.log('this.InvoicedLabel = ' + this.InvoicedLabel);
+ console.log("this.InvoiceProNotLabel = " + this.InvoiceProNotLabel);
+ console.log("this.RrturnProLabel = " + this.RrturnProLabel);
+ console.log("this.InvoicedLabel = " + this.InvoicedLabel);
}
}
//鑾峰彇閾炬帴鍙傛暟
getQueryString(name) {
- console.log('getQueryString name ' + name);
- let reg = new RegExp('(^|&)' + name + '=([^&]*)(&|$)', 'i');
+ console.log("getQueryString name " + name);
+ let reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");
let r = window.location.search.substr(1).match(reg);
if (r != null) {
return decodeURIComponent(r[2]);
@@ -648,686 +649,500 @@
return null;
}
connectedCallback() {
- console.log('connectedCallback LexSummonsCreat');
- this.ESetid = this.getQueryString('ESetid');
- this.ESetid = this.ESetid == null ? '' : this.ESetid;
+ console.log("connectedCallback LexSummonsCreat");
+ this.ESetid = this.getQueryString("ESetid");
+ this.ESetid = this.ESetid == null ? "" : this.ESetid;
//statusEdit
- this.statusEdit = this.getQueryString('KeyWords');
- this.statusEdit = this.statusEdit == null ? '' : this.statusEdit;
+ this.statusEdit = this.getQueryString("KeyWords");
+ this.statusEdit = this.statusEdit == null ? "" : this.statusEdit;
//arriveorder
- this.arriveorder = this.getQueryString('arriveorder');
- this.arriveorder = this.arriveorder == null ? '' : this.arriveorder;
- console.log('this.ESetid = ' + this.ESetid);
- console.log('this.statusEdit = ' + this.statusEdit);
- console.log('this.arriveorder = ' + this.arriveorder);
- if (this.ESetid == '') {
+ this.arriveorder = this.getQueryString("arriveorder");
+ this.arriveorder = this.arriveorder == null ? "" : this.arriveorder;
+ console.log("this.ESetid = " + this.ESetid);
+ console.log("this.statusEdit = " + this.statusEdit);
+ console.log("this.arriveorder = " + this.arriveorder);
+ if (this.ESetid == "") {
this.isShowInformation = false;
}
- console.log('init LexSummonsCreat');
+ console.log("init LexSummonsCreat");
init({
ESetidJs: this.ESetid,
statusEdit: this.statusEdit,
pageSizeLWC: this.pageSize,
pageTokenLWC: this.currentPageToken,
arriveorderLWC: this.arriveorder
- })
- .then((r) => {
- r = JSON.parse(JSON.stringify(r));
- console.log('r = ' + JSON.stringify(r));
+ }).then((r) => {
+ r = JSON.parse(JSON.stringify(r));
+ console.log("r = " + JSON.stringify(r));
- if (r.status == 'Success') {
- //鍒嗛〉
- console.log(
- 'r.entity.paginatedAccounts = ' +
- JSON.stringify(r.entity.paginatedAccounts)
- );
- this.nextPageToken =
- r.entity.paginatedAccounts.nextPageToken;
- this.totalRecords = r.entity.paginatedAccounts.totalRecords;
- this.recordStart = r.entity.paginatedAccounts.recordStart;
- this.recordEnd = r.entity.paginatedAccounts.recordEnd;
- this.totalPages = Math.ceil(
- r.entity.paginatedAccounts.totalRecords / this.pageSize
- );
- console.log('this.totalPages = ' + this.totalPages);
+ if (r.status == "Success") {
- this.OECId =
- r.entity.HospitalInfo == null
- ? ''
- : r.entity.HospitalInfo;
- console.log('this.OECId = ' + this.OECId);
- this.ConsumableOut_report = r.entity.ConsumableOut_report;
- console.log(
- 'this.ConsumableOut_report = ' +
- this.ConsumableOut_report
- );
- this.accountid = r.entity.accountid;
- this.consumableproductdetailsRecords =
- r.entity.consumableproductdetailsRecords;
- this.accountName = r.entity.accountName;
- this.agencyProType = r.entity.agencyProType;
- this.accountName = r.entity.accountName;
- this.userWorkLocation = r.entity.userWorkLocation;
- this.EditAble = r.entity.EditAble;
- this.consumableorderdetails2Records =
- r.entity.consumableorderdetails2Records;
- for (var i in this.consumableorderdetails2Records) {
- this.consumableorderdetails2Records[i]['ProdName'] =
- this.consumableorderdetails2Records[i].Prod.Name;
- this.consumableorderdetails2Records[i][
- 'orderdetails2SerialLotNo__c'
- ] =
- this.consumableorderdetails2Records[
- i
- ].orderdetails2.SerialLotNo__c;
- this.consumableorderdetails2Records[i][
- 'orderdetails2TracingCode__c'
- ] =
- this.consumableorderdetails2Records[
- i
- ].orderdetails2.TracingCode__c;
- this.consumableorderdetails2Records[i][
- 'orderdetails2Sterilization_limit__c'
- ] =
- this.consumableorderdetails2Records[
- i
- ].orderdetails2.Sterilization_limit__c;
- }
- this.isShowOutboundProductDetails =
- r.entity.consumableorderdetails2Count > 0
- ? true
- : false;
- console.log('this.agencyProType = ' + this.agencyProType);
- console.log('this.EditAble = ' + this.EditAble);
- //鏌ヨ闄勪欢
- if (!this.EditAble) this.getFiles();
- //绗�3鍒嗙被
- for (var key in r.entity.categoryOptionMap) {
- let object = {};
- object['label'] = r.entity.categoryOptionMap[key];
- object['value'] = key;
- this.category3Options.push(object);
- }
- console.log(
- 'this.category3Options = ' +
- JSON.stringify(this.category3Options)
- );
- //绗�4鍒嗙被
- for (var key in r.entity.category4OptionMap) {
- let object = {};
- object['label'] = r.entity.category4OptionMap[key];
- object['value'] = key;
- this.category4Options.push(object);
- }
- console.log(
- 'this.category4Options = ' + this.category4Options
- );
- //绗�5鍒嗙被
- for (var key in r.entity.category5OptionMap) {
- let object = {};
- object['label'] = r.entity.category5OptionMap[key];
- object['value'] = key;
- this.category5Options.push(object);
- }
- console.log(
- 'this.category5Options = ' + this.category5Options
- );
+ //鍒嗛〉
+ console.log('r.entity.paginatedAccounts = ' + JSON.stringify(r.entity.paginatedAccounts));
+ this.nextPageToken = r.entity.paginatedAccounts.nextPageToken;
+ this.totalRecords = r.entity.paginatedAccounts.totalRecords;
+ this.recordStart = r.entity.paginatedAccounts.recordStart;
+ this.recordEnd = r.entity.paginatedAccounts.recordEnd;
+ this.totalPages = Math.ceil(r.entity.paginatedAccounts.totalRecords / this.pageSize);
+ console.log('this.totalPages = ' + this.totalPages);
- this.data = r.entity.pageRecords;
- this.editData = r.entity.pageRecords;
- console.log(
- 'this.data start = ' + JSON.stringify(this.data)
- );
- this.hasHosPro = r.entity.hasHosPro;
- console.log('this.hasHosPro = ' + this.hasHosPro);
- if (this.EditAble) {
- for (var i in this.data) {
- let unitOptions = [];
- for (var key in this.data[i].boxorpieceMap) {
- let unitOption = {};
- unitOption['label'] =
- this.data[i].boxorpieceMap[key];
- unitOption['value'] = key;
- unitOptions.push(unitOption);
- }
- this.data[i]['unitOptions'] = unitOptions;
- this.data[i]['unitValue'] =
- this.data[i]['unitValue'] == null
- ? unitOptions[0].value
- : this.data[i]['unitValue'];
- if (this.EditAble) {
- this.data[i].orderdetails1['Box_Piece__c'] =
- this.data[i].orderdetails1[
- 'Box_Piece__c'
- ] == null
- ? unitOptions[0].value
- : this.data[i].orderdetails1[
- 'Box_Piece__c'
- ];
- this.data[i]['unitValue'] =
- this.data[i].orderdetails1[
- 'Box_Piece__c'
- ] == null
- ? unitOptions[0].value
- : this.data[i].orderdetails1[
- 'Box_Piece__c'
- ];
- console.log(
- 'this.data[i].orderdetails1["Box_Piece__c"] = ' +
- this.data[i].orderdetails1[
- 'Box_Piece__c'
- ]
- );
- this.data[i].orderdetails1[
- 'Shipment_Count__c'
- ] =
- this.data[i].orderdetails1[
- 'Shipment_Count__c'
- ] == null
- ? 0
- : this.data[i].orderdetails1[
- 'Shipment_Count__c'
- ];
- this.data[i].orderdetails1[
- 'Delivery_List_RMB__c'
- ] =
- this.data[i].orderdetails1[
- 'Delivery_List_RMB__c'
- ] == null
- ? 0.0
- : this.data[i].orderdetails1[
- 'Delivery_List_RMB__c'
- ];
- } else {
- this.data[i]['InvoiceProNot_count__c'] =
- this.data[
- i
- ].orderdetails1.InvoiceProNot_count__c;
- this.data[i]['RrturnPro_count__c'] =
- this.data[
- i
- ].orderdetails1.RrturnPro_count__c;
- this.data[i]['Invoiced_Procount__c'] =
- this.data[
- i
- ].orderdetails1.Invoiced_Procount__c;
- }
- // this.data[i]["shipmentNumber"] = 0;
- // this.data[i]["shippingUnitPrice"] = 0.0;
- //this.data[i]["shipmentNumber"] = this.data[i].orderdetails1["Shipment_Count__c"] == 0 ? '' : this.data[i].orderdetails1["Shipment_Count__c"];
- //this.data[i]["shippingUnitPrice"] = this.data[i].orderdetails1["Delivery_List_RMB__c"] == 0 ? '' : this.data[i].orderdetails1["Delivery_List_RMB__c"];
- this.data[i]['shipmentNumber'] =
- this.data[i].orderdetails1['Shipment_Count__c'];
- this.data[i]['shippingUnitPrice'] =
- this.data[i].orderdetails1[
- 'Delivery_List_RMB__c'
- ];
- this.data[i]['Id'] = this.data[i].Prod.Id;
-
- if (this.hasHosPro) {
- if (this.data[i]['hospitalSpecialOffer']) {
- this.data[i]['Id'] =
- this.data[i].Prod.Id + 'ishos';
- } else {
- this.data[i]['Id'] =
- this.data[i].Prod.Id + 'nothos';
- }
- }
- this.data[i]['recordId'] = this.data[i].Prod.Id;
- this.data[i]['Name__c'] = this.data[i].Prod.Name__c;
- this.data[i]['SFDA_Status__c'] =
- this.data[i].Prod.SFDA_Status__c;
- this.data[i]['Category3__c'] =
- this.data[i].Prod.Category3__c;
- this.data[i]['Category4__c'] =
- this.data[i].Prod.Category4__c;
- this.data[i]['Category5__c'] =
- this.data[i].Prod.Category5__c;
- this.data[i]['Box_Piece__c'] =
- this.data[i].orderdetails1.Box_Piece__c;
- this.data[i]['shipmentAmount'] =
- this.data[i].orderdetails1.Shipment_amount__c;
- this.data[i]['Shipment_amount__c'] =
- this.data[i].orderdetails1.Shipment_amount__c;
- this.data[i]['Shipment_Count__c'] =
- this.data[i].orderdetails1.Shipment_Count__c;
-
- if (this.data[i]['check']) {
- this.selectedRows.push(this.data[i].Id);
- }
- }
- console.log(
- 'EditAble this.data = ' + JSON.stringify(this.data)
- );
- } else {
- for (var i in this.editData) {
- this.editData[i]['unitValue'] =
- this.editData[i]['unitValue'];
- this.editData[i]['InvoiceProNot_count__c'] =
- this.editData[
- i
- ].orderdetails1.InvoiceProNot_count__c;
- this.editData[i]['RrturnPro_count__c'] =
- this.editData[
- i
- ].orderdetails1.RrturnPro_count__c;
- this.editData[i]['Invoiced_Procount__c'] =
- this.editData[
- i
- ].orderdetails1.Invoiced_Procount__c;
- this.editData[i]['shipmentNumber'] =
- this.editData[i].orderdetails1[
- 'Shipment_Count__c'
- ];
- this.editData[i]['shippingUnitPrice'] =
- this.editData[i].orderdetails1[
- 'Delivery_List_RMB__c'
- ];
-
- this.editData[i]['recordId'] =
- this.editData[i].Prod.Id;
- this.editData[i]['Id'] = this.editData[i].Prod.Id;
- this.editData[i]['Name__c'] =
- this.editData[i].Prod.Name__c;
- this.editData[i]['SFDA_Status__c'] =
- this.editData[i].Prod.SFDA_Status__c;
- this.editData[i]['Category3__c'] =
- this.editData[i].Prod.Category3__c;
- this.editData[i]['Category4__c'] =
- this.editData[i].Prod.Category4__c;
- this.editData[i]['Category5__c'] =
- this.editData[i].Prod.Category5__c;
- this.editData[i]['Box_Piece__c'] =
- this.editData[i].orderdetails1.Box_Piece__c;
- this.editData[i]['shipmentAmount'] =
- this.editData[
- i
- ].orderdetails1.Shipment_amount__c;
- //this.editData[i]["Shipment_amount__c"] = this.editData[i].orderdetails1.Shipment_amount__c;
- this.editData[i]['Delivery_List_RMB__c'] =
- this.editData[
- i
- ].orderdetails1.Delivery_List_RMB__c;
- this.editData[i]['Shipment_Count__c'] =
- this.editData[
- i
- ].orderdetails1.Shipment_Count__c;
- }
- console.log(
- 'end this.editData = ' +
- JSON.stringify(this.editData)
- );
- }
-
- console.log('this.data = ' + JSON.stringify(this.data));
- //show
- if (
- r.entity.EditDelCommitBtnDisabled ||
- r.entity.EditAble
- ) {
- this.isSaveShow = true;
- } else {
- this.isEditShow = true;
- this.isDeliveryShow = true;
- this.isOpenToInvoiceShow = true;
- this.isPraseToPDFShow = true;
- this.isOpenReportShow = true;
- this.isDeleteShow = true;
- }
-
- this.Existarrive = r.entity.Existarrive;
-
- console.log('this.EditAble = ' + this.EditAble);
-
- //disable
-
- debugger;
- if (Object.values(r.entity.coc).length > 0) {
- this.cocLwc = r.entity.coc;
- console.log(
- 'this.cocLwc = ' + JSON.stringify(this.cocLwc)
- );
- var coc = r.entity.coc;
- this.accountValue =
- coc.Order_ForDealerText__c == null
- ? ''
- : coc.Order_ForDealerText__c;
- this.ForDealerText =
- coc.Order_ForDealerText__c == null
- ? ''
- : coc.Order_ForDealerText__c;
- console.log('this.accountValue = ' + this.accountValue);
- this.cocId = coc.Id;
- console.log('cocId = ' + this.cocId);
- coc.SummonsStatus = coc.SummonsStatus_c__c;
- console.log(
- 'this.cocLwc.Arrive_Order__c = ' +
- this.cocLwc.Arrive_Order__c
- );
- if (this.cocLwc.Arrive_Order__c == null) {
- this.isBarcode = true;
- } else {
- this.isBarcode = false;
- }
- if (coc.SummonsStatus_c__c == '宸插畬鎴�') {
- this.isEditDisabled = true;
- }
- if (
- coc.SummonsStatus_c__c == '鎵瑰噯' ||
- coc.SummonsStatus_c__c == '宸查攢鍞緟涓婁紶绾冲搧涔�' ||
- coc.SummonsStatus_c__c == '鍑哄簱鍗曞凡鎵撳嵃' ||
- coc.SummonsStatus_c__c == '宸插畬鎴�'
- ) {
- this.isDeliveryDisabled = true;
- }
- if (
- ((coc.Billed_Status__c != '鍏ㄩ儴寮�绁�' &&
- coc.SummonsStatus_c__c == '宸插畬鎴�') ||
- coc.Onchange_order__c == true) &&
- coc.SummonsForDirction__c != '浜掔浉璋冭揣'
- ) {
- this.isOpenToInvoiceDisabled = false;
- }
- if (
- coc.SummonsStatus_c__c == '宸查攢鍞緟涓婁紶绾冲搧涔�' ||
- coc.SummonsStatus_c__c == '鎵瑰噯' ||
- coc.SummonsStatus_c__c == '鍑哄簱鍗曞凡鎵撳嵃' ||
- coc.SummonsStatus_c__c == '鑽夋涓�'
- ) {
- this.isPraseToPDFDisabled = false;
- }
- if (
- coc.Billed_Status__c != '杩樻病寮�绁�' ||
- coc.SummonsStatus_c__c == '宸插畬鎴�'
- ) {
- this.isOpenReportDisabled = false;
- }
- if (
- coc.SummonsStatus_c__c == '宸查攢鍞緟涓婁紶绾冲搧涔�' ||
- coc.SummonsStatus_c__c == '浠锋牸鏈畾' ||
- coc.SummonsStatus_c__c == '鎵瑰噯' ||
- coc.SummonsStatus_c__c == '鍑哄簱鍗曞凡鎵撳嵃' ||
- coc.SummonsStatus_c__c == '宸插畬鎴�'
- ) {
- this.isDeleteDisabled = true;
- }
- this.isConInvoiceShow =
- coc.SummonsStatus_c__c == '宸插畬鎴�' &&
- coc.SummonsForDirction__c != '浜掔浉璋冭揣'
- ? true
- : false;
- this.summonsStatusPriceNotDetermined =
- coc.SummonsStatus_c__c == '浠锋牸鏈畾' ? true : false;
- this.isSummonsForDirctionTwoShow =
- coc.SummonsForDirction__c == '閿�鍞粰浜岀骇缁忛攢鍟�'
- ? true
- : false;
- }
- this.isSearchShow =
- !this.Existarrive &&
- r.entity.coc.SummonsStatus_c__c != '浠锋牸鏈畾' &&
- r.entity.EditAble
- ? true
- : false;
- this.hidecheckboxcolumn = !this.isSearchShow;
- this.arriveorder = r.entity.arriveorder;
- this.is345Show =
- this.arriveorder == '' &&
- this.Existarrive == false &&
- this.EditAble
- ? true
- : false;
- //濡傛灉涓嶆樉绀�345鍒嗙被锛宑olumns閲岄潰鍒犻櫎3锛�4锛�5鍒嗙被
- if (!this.is345Show) {
- for (var i = 0; i < this.columns.length; i++) {
- if (this.columns[i].label == '绗�3鍒嗙被') {
- this.columns.splice(i, 1);
- }
- }
- for (var i = 0; i < this.columns.length; i++) {
- if (this.columns[i].label == '绗�4鍒嗙被') {
- this.columns.splice(i, 1);
- }
- }
- for (var i = 0; i < this.columns.length; i++) {
- if (this.columns[i].label == '绗�5鍒嗙被') {
- this.columns.splice(i, 1);
- }
- }
- for (var i = 0; i < this.editColumns.length; i++) {
- if (this.editColumns[i].label == '绗�3鍒嗙被') {
- this.editColumns.splice(i, 1);
- }
- }
- for (var i = 0; i < this.editColumns.length; i++) {
- if (this.editColumns[i].label == '绗�4鍒嗙被') {
- this.editColumns.splice(i, 1);
- }
- }
- for (var i = 0; i < this.editColumns.length; i++) {
- if (this.editColumns[i].label == '绗�5鍒嗙被') {
- this.editColumns.splice(i, 1);
- }
- }
- }
- //濡傛灉EditAble==false锛屽垹闄� 鍑鸿揣閲戦(鍏�) 鏈夋晥鏈熷唴搴撳瓨(鐩�) 鏈夋晥鏈熷唴搴撳瓨(涓�) 3鍒� 灞曠ず 杩樻病鍙戠エ鏁伴噺 杩斿搧鏁伴噺 宸插彂绁ㄦ暟閲�
- //type : "number",
- // typeAttributes:{
- // minimumFractionDigits:2,
- // },
- if (!this.EditAble) {
- let object1 = {
- label: this.InvoiceProNotLabel,
- fieldName: 'InvoiceProNot_count__c',
- type: 'number',
- initialWidth: 105,
- typeAttributes: {
- minimumFractionDigits: 2
- },
- hideDefaultActions: true
- };
- let object2 = {
- label: this.RrturnProLabel,
- fieldName: 'RrturnPro_count__c',
- cellAttributes: { alignment: 'right' },
- initialWidth: 100,
- hideDefaultActions: true
- };
- let object3 = {
- label: this.InvoicedLabel,
- fieldName: 'Invoiced_Procount__c',
- type: 'number',
- initialWidth: 100,
- typeAttributes: {
- minimumFractionDigits: 2
- },
- hideDefaultActions: true
- };
- this.editColumns.push(object1);
- this.editColumns.push(object2);
- this.editColumns.push(object3);
- } else {
- this.ForCustomerText =
- this.cocLwc.Order_ForCustomerText__c;
- console.log(
- 'EditAble = true this.ForCustomerText = ' +
- this.ForCustomerText
- );
- this.summonsForDirction =
- this.cocLwc.SummonsForDirction__c;
- console.log(
- 'EditAble = true this.summonsForDirction = ' +
- this.summonsForDirction
- );
- let value = this.summonsForDirction;
- switch (value) {
- case '鐩存帴閿�鍞粰鍖婚櫌':
- this.isDisabledHospitalName = false;
- this.isDisabledForCustomerText = false;
- this.secondaryDistributor = '';
- this.ForDealerText = '';
- this.accountValue = '';
- this.cocLwc['Order_ForDealerText__c'] = '';
- this.isDisabledForDealerText = true;
- this.isDisabledSecondaryDistributor = true;
- break;
- case '鍖婚櫌璇曠敤':
- this.isDisabledHospitalName = false;
- this.isDisabledForCustomerText = false;
- this.isDisabledForDealerText = false;
- this.isDisabledSecondaryDistributor = false;
- this.isMutualTransferGoods = false;
- break;
- case '閿�鍞粰浜岀骇缁忛攢鍟�':
- this.isDisabledHospitalName = false;
- this.isDisabledForCustomerText = false;
- this.isDisabledForDealerText = false;
- this.isDisabledSecondaryDistributor = false;
- this.isMutualTransferGoods = false;
- break;
- case '浜掔浉璋冭揣':
- this.isDisabledHospitalName = true;
- this.HospitalName = '';
- this.OECId = '';
- this.isDisabledForCustomerText = true;
- this.ForCustomerText = '';
- this.cocLwc['Order_ForCustomerText__c'] = '';
- this.isDisabledForDealerText = false;
- this.isDisabledSecondaryDistributor = false;
- this.isMutualTransferGoods = true;
- break;
- default:
- this.isDisabledHospitalName = false;
- this.isDisabledForCustomerText = false;
- this.isDisabledForDealerText = false;
- this.isDisabledSecondaryDistributor = false;
- }
- }
-
- //濡傛灉hasHosPro = true 鍖婚櫌鐗逛环
- if (this.hasHosPro) {
- let object1 = {
- label: '鍖婚櫌鐗逛环',
- initialWidth: 80,
- fieldName: 'hospitalSpecialOffer',
- type: 'boolean',
- hideDefaultActions: true
- };
- this.columns.push(object1);
- this.editColumns.push(object1);
- }
- //鍑哄簱鍗曚俊鎭�
- this.isSummonsFlag =
- r.entity.SummonsFlag == 'visible' ? true : false;
- console.log(
- 'r.entity.provinceOptsMap = ' + r.entity.provinceOptsMap
- );
- for (var key in r.entity.provinceOptsMap) {
- let object = {};
- object['label'] = r.entity.provinceOptsMap[key];
- object['value'] = key;
- this.secondaryDistributorOptions.push(object);
- }
- for (var key in r.entity.outOutPatternOptionMap) {
- let object = {};
- object['label'] = r.entity.outOutPatternOptionMap[key];
- object['value'] = key;
- this.outOutPatternOptionList.push(object);
- }
- console.log(
- 'this.secondaryDistributorOptions = ' +
- JSON.stringify(this.secondaryDistributorOptions)
- );
- this.HospitalName = r.entity.HospitalName;
- this.sumPrice = r.entity.sumPrice.toFixed(2) + '鍏�';
- debugger;
- console.log('this.Existarrive = ' + this.Existarrive);
- console.log('this.EditAble = ' + this.EditAble);
- console.log(
- 'r.entity.coc.SummonsStatus_c__c = ' +
- r.entity.coc.SummonsStatus_c__c
- );
- if (
- !this.Existarrive &&
- this.EditAble &&
- r.entity.coc.SummonsStatus_c__c != '浠锋牸鏈畾'
- ) {
- this.hideCheckboxColumn = false;
- } else {
- this.hideCheckboxColumn = true;
- }
- if (
- !(
- this.arriveorder == '' &&
- this.Existarrive == false &&
- this.EditAble &&
- this.cocLwc.SummonsStatus_c__c != '浠锋牸鏈畾'
- )
- ) {
- //璁╁崟浣嶏紝鍑鸿揣鏁伴噺 鍙樹负涓嶅彲閫夌殑text绫诲瀷
- for (var i in this.columns) {
- if (this.columns[i].label == '鍗曚綅') {
- this.columns[i].type = 'text';
- this.columns[i].fieldName = 'unitValue';
- }
- if (this.columns[i].label == '鍑鸿揣鏁伴噺') {
- this.columns[i].type = 'text';
- this.columns[i].fieldName = 'shipmentNumber';
- }
- }
- }
- this.isShowSpinner = false;
- this.showTable = true;
- console.log('ESetid = ' + this.ESetid);
- } else {
- console.log('r = ' + JSON.stringify(r));
- this.showMyToast('鍒濆鍖栧け璐�', r.msg, 'Error');
+ this.OECId = r.entity.HospitalInfo == null ? '' : r.entity.HospitalInfo;
+ console.log("this.OECId = " + this.OECId);
+ this.ConsumableOut_report = r.entity.ConsumableOut_report;
+ console.log("this.ConsumableOut_report = " + this.ConsumableOut_report);
+ this.accountid = r.entity.accountid;
+ this.consumableproductdetailsRecords =
+ r.entity.consumableproductdetailsRecords;
+ this.accountName = r.entity.accountName;
+ this.agencyProType = r.entity.agencyProType;
+ this.accountName = r.entity.accountName;
+ this.userWorkLocation = r.entity.userWorkLocation;
+ this.EditAble = r.entity.EditAble;
+ this.consumableorderdetails2Records = r.entity.consumableorderdetails2Records;
+ for (var i in this.consumableorderdetails2Records) {
+ this.consumableorderdetails2Records[i]["ProdName"] = this.consumableorderdetails2Records[i].Prod.Name;
+ this.consumableorderdetails2Records[i]["orderdetails2SerialLotNo__c"] = this.consumableorderdetails2Records[i].orderdetails2.SerialLotNo__c;
+ this.consumableorderdetails2Records[i]["orderdetails2TracingCode__c"] = this.consumableorderdetails2Records[i].orderdetails2.TracingCode__c;
+ this.consumableorderdetails2Records[i]["orderdetails2Sterilization_limit__c"] = this.consumableorderdetails2Records[i].orderdetails2.Sterilization_limit__c;
}
- })
- .catch((error) => {
- console.log('error = ' + JSON.stringify(error));
- this.showMyToast('閿欒', '鍒濆鍖栧け璐�', 'Error');
- });
+ this.isShowOutboundProductDetails = r.entity.consumableorderdetails2Count > 0 ? true : false;
+ console.log("this.agencyProType = " + this.agencyProType);
+ console.log("this.EditAble = " + this.EditAble);
+ //鏌ヨ闄勪欢
+ if (!this.EditAble) this.getFiles();
+ //绗�3鍒嗙被
+ for (var key in r.entity.categoryOptionMap) {
+ let object = {};
+ object["label"] = r.entity.categoryOptionMap[key];
+ object["value"] = key;
+ this.category3Options.push(object);
+ }
+ console.log("this.category3Options = " + JSON.stringify(this.category3Options));
+ //绗�4鍒嗙被
+ for (var key in r.entity.category4OptionMap) {
+ let object = {};
+ object["label"] = r.entity.category4OptionMap[key];
+ object["value"] = key;
+ this.category4Options.push(object);
+ }
+ console.log("this.category4Options = " + this.category4Options);
+ //绗�5鍒嗙被
+ for (var key in r.entity.category5OptionMap) {
+ let object = {};
+ object["label"] = r.entity.category5OptionMap[key];
+ object["value"] = key;
+ this.category5Options.push(object);
+ }
+ console.log("this.category5Options = " + this.category5Options);
+
+ this.data = r.entity.pageRecords;
+ this.editData = r.entity.pageRecords;
+ console.log("this.data start = " + JSON.stringify(this.data));
+ this.hasHosPro = r.entity.hasHosPro;
+ console.log("this.hasHosPro = " + this.hasHosPro);
+ if (this.EditAble) {
+ for (var i in this.data) {
+ let unitOptions = [];
+ for (var key in this.data[i].boxorpieceMap) {
+ let unitOption = {};
+ unitOption["label"] = this.data[i].boxorpieceMap[key];
+ unitOption["value"] = key;
+ unitOptions.push(unitOption);
+ }
+ this.data[i]["unitOptions"] = unitOptions;
+ this.data[i]["unitValue"] = this.data[i]["unitValue"] == null ? unitOptions[0].value : this.data[i]["unitValue"];
+ if (this.EditAble) {
+ this.data[i].orderdetails1["Box_Piece__c"] = this.data[i].orderdetails1["Box_Piece__c"] == null ? unitOptions[0].value : this.data[i].orderdetails1["Box_Piece__c"];
+ this.data[i]["unitValue"] = this.data[i].orderdetails1["Box_Piece__c"] == null ? unitOptions[0].value : this.data[i].orderdetails1["Box_Piece__c"];
+ console.log('this.data[i].orderdetails1["Box_Piece__c"] = ' + this.data[i].orderdetails1["Box_Piece__c"]);
+ this.data[i].orderdetails1["Shipment_Count__c"] = this.data[i].orderdetails1["Shipment_Count__c"] == null ? 0 : this.data[i].orderdetails1["Shipment_Count__c"];
+ this.data[i].orderdetails1["Delivery_List_RMB__c"] = this.data[i].orderdetails1["Delivery_List_RMB__c"] == null ? 0.0 : this.data[i].orderdetails1["Delivery_List_RMB__c"];
+ } else {
+ this.data[i]["InvoiceProNot_count__c"] = this.data[i].orderdetails1.InvoiceProNot_count__c;
+ this.data[i]["RrturnPro_count__c"] = this.data[i].orderdetails1.RrturnPro_count__c;
+ this.data[i]["Invoiced_Procount__c"] = this.data[i].orderdetails1.Invoiced_Procount__c;
+ }
+ // this.data[i]["shipmentNumber"] = 0;
+ // this.data[i]["shippingUnitPrice"] = 0.0;
+ //this.data[i]["shipmentNumber"] = this.data[i].orderdetails1["Shipment_Count__c"] == 0 ? '' : this.data[i].orderdetails1["Shipment_Count__c"];
+ //this.data[i]["shippingUnitPrice"] = this.data[i].orderdetails1["Delivery_List_RMB__c"] == 0 ? '' : this.data[i].orderdetails1["Delivery_List_RMB__c"];
+ this.data[i]["shipmentNumber"] = this.data[i].orderdetails1["Shipment_Count__c"];
+ this.data[i]["shippingUnitPrice"] = this.data[i].orderdetails1["Delivery_List_RMB__c"];
+
+
+
+ this.data[i]["Id"] = this.data[i].Prod.Id;
+
+ if (this.hasHosPro) {
+ if (this.data[i]["hospitalSpecialOffer"]) {
+ this.data[i]["Id"] = this.data[i].Prod.Id + 'ishos';
+ } else {
+ this.data[i]["Id"] = this.data[i].Prod.Id + 'nothos';
+ }
+ }
+ this.data[i]["recordId"] = this.data[i].Prod.Id;
+ this.data[i]["Name__c"] = this.data[i].Prod.Name__c;
+ this.data[i]["SFDA_Status__c"] = this.data[i].Prod.SFDA_Status__c;
+ this.data[i]["Category3__c"] = this.data[i].Prod.Category3__c;
+ this.data[i]["Category4__c"] = this.data[i].Prod.Category4__c;
+ this.data[i]["Category5__c"] = this.data[i].Prod.Category5__c;
+ this.data[i]["Box_Piece__c"] = this.data[i].orderdetails1.Box_Piece__c;
+ this.data[i]["shipmentAmount"] = this.data[i].orderdetails1.Shipment_amount__c;
+ this.data[i]["Shipment_amount__c"] = this.data[i].orderdetails1.Shipment_amount__c;
+ this.data[i]["Shipment_Count__c"] = this.data[i].orderdetails1.Shipment_Count__c;
+
+ if (this.data[i]['check']) {
+ this.selectedRows.push(this.data[i].Id);
+ }
+ }
+ console.log('EditAble this.data = ' + JSON.stringify(this.data))
+ } else {
+ for (var i in this.editData) {
+ this.editData[i]["unitValue"] = this.editData[i]["unitValue"];
+ this.editData[i]["InvoiceProNot_count__c"] = this.editData[i].orderdetails1.InvoiceProNot_count__c;
+ this.editData[i]["RrturnPro_count__c"] = this.editData[i].orderdetails1.RrturnPro_count__c;
+ this.editData[i]["Invoiced_Procount__c"] = this.editData[i].orderdetails1.Invoiced_Procount__c;
+ this.editData[i]["shipmentNumber"] = this.editData[i].orderdetails1["Shipment_Count__c"];
+ this.editData[i]["shippingUnitPrice"] = this.editData[i].orderdetails1["Delivery_List_RMB__c"];
+
+ this.editData[i]["recordId"] = this.editData[i].Prod.Id;
+ this.editData[i]["Id"] = this.editData[i].Prod.Id;
+ this.editData[i]["Name__c"] = this.editData[i].Prod.Name__c;
+ this.editData[i]["SFDA_Status__c"] = this.editData[i].Prod.SFDA_Status__c;
+ this.editData[i]["Category3__c"] = this.editData[i].Prod.Category3__c;
+ this.editData[i]["Category4__c"] = this.editData[i].Prod.Category4__c;
+ this.editData[i]["Category5__c"] = this.editData[i].Prod.Category5__c;
+ this.editData[i]["Box_Piece__c"] = this.editData[i].orderdetails1.Box_Piece__c;
+ this.editData[i]["shipmentAmount"] = this.editData[i].orderdetails1.Shipment_amount__c;
+ //this.editData[i]["Shipment_amount__c"] = this.editData[i].orderdetails1.Shipment_amount__c;
+ this.editData[i]["Delivery_List_RMB__c"] = this.editData[i].orderdetails1.Delivery_List_RMB__c;
+ this.editData[i]["Shipment_Count__c"] = this.editData[i].orderdetails1.Shipment_Count__c;
+ }
+ console.log('end this.editData = ' + JSON.stringify(this.editData));
+ }
+
+ console.log("this.data = " + JSON.stringify(this.data));
+ //show
+ if (r.entity.EditDelCommitBtnDisabled || r.entity.EditAble) {
+ this.isSaveShow = true;
+ } else {
+ this.isEditShow = true;
+ this.isDeliveryShow = true;
+ this.isOpenToInvoiceShow = true;
+ this.isPraseToPDFShow = true;
+ this.isOpenReportShow = true;
+ this.isDeleteShow = true;
+ }
+
+ this.Existarrive = r.entity.Existarrive;
+
+ console.log("this.EditAble = " + this.EditAble);
+
+ //disable
+
+ debugger
+ if (Object.values(r.entity.coc).length > 0) {
+ this.cocLwc = r.entity.coc;
+ console.log("this.cocLwc = " + JSON.stringify(this.cocLwc));
+ var coc = r.entity.coc;
+ this.accountValue = coc.Order_ForDealerText__c == null ? '' : coc.Order_ForDealerText__c;
+ this.ForDealerText = coc.Order_ForDealerText__c == null ? '' : coc.Order_ForDealerText__c;
+ console.log('this.accountValue = ' + this.accountValue);
+ this.cocId = coc.Id;
+ console.log('cocId = ' + this.cocId);
+ coc.SummonsStatus = coc.SummonsStatus_c__c;
+ console.log('this.cocLwc.Arrive_Order__c = ' + this.cocLwc.Arrive_Order__c)
+ if(this.cocLwc.Arrive_Order__c == null){
+ this.isBarcode = true;
+ }else{
+ this.isBarcode = false;
+ }
+ if (coc.SummonsStatus_c__c == "宸插畬鎴�") {
+ this.isEditDisabled = true;
+ }
+ if (
+ coc.SummonsStatus_c__c == "鎵瑰噯" ||
+ coc.SummonsStatus_c__c == "宸查攢鍞緟涓婁紶绾冲搧涔�" ||
+ coc.SummonsStatus_c__c == "鍑哄簱鍗曞凡鎵撳嵃" ||
+ coc.SummonsStatus_c__c == "宸插畬鎴�"
+ ) {
+ this.isDeliveryDisabled = true;
+ }
+ if (
+ ((coc.Billed_Status__c != "鍏ㄩ儴寮�绁�" &&
+ coc.SummonsStatus_c__c == "宸插畬鎴�") ||
+ coc.Onchange_order__c == true) &&
+ coc.SummonsForDirction__c != "浜掔浉璋冭揣"
+ ) {
+ this.isOpenToInvoiceDisabled = false;
+ }
+ if (
+ coc.SummonsStatus_c__c == "宸查攢鍞緟涓婁紶绾冲搧涔�" ||
+ coc.SummonsStatus_c__c == "鎵瑰噯" ||
+ coc.SummonsStatus_c__c == "鍑哄簱鍗曞凡鎵撳嵃" ||
+ coc.SummonsStatus_c__c == "鑽夋涓�"
+ ) {
+ this.isPraseToPDFDisabled = false;
+ }
+ if ((coc.Billed_Status__c != "杩樻病寮�绁�" || coc.SummonsStatus_c__c == "宸插畬鎴�")) {
+ this.isOpenReportDisabled = false;
+ }
+ if (
+ coc.SummonsStatus_c__c == "宸查攢鍞緟涓婁紶绾冲搧涔�" ||
+ coc.SummonsStatus_c__c == "浠锋牸鏈畾" ||
+ coc.SummonsStatus_c__c == "鎵瑰噯" ||
+ coc.SummonsStatus_c__c == "鍑哄簱鍗曞凡鎵撳嵃" ||
+ coc.SummonsStatus_c__c == "宸插畬鎴�"
+ ) {
+ this.isDeleteDisabled = true;
+ }
+ this.isConInvoiceShow =
+ coc.SummonsStatus_c__c == "宸插畬鎴�" &&
+ coc.SummonsForDirction__c != "浜掔浉璋冭揣"
+ ? true
+ : false;
+ this.summonsStatusPriceNotDetermined =
+ coc.SummonsStatus_c__c == "浠锋牸鏈畾" ? true : false;
+ this.isSummonsForDirctionTwoShow =
+ coc.SummonsForDirction__c == "閿�鍞粰浜岀骇缁忛攢鍟�" ? true : false;
+ }
+ this.isSearchShow =
+ !this.Existarrive &&
+ r.entity.coc.SummonsStatus_c__c != "浠锋牸鏈畾" &&
+ r.entity.EditAble
+ ? true
+ : false;
+ this.hidecheckboxcolumn = !this.isSearchShow;
+ this.arriveorder = r.entity.arriveorder;
+ this.is345Show =
+ this.arriveorder == "" && this.Existarrive == false && this.EditAble
+ ? true
+ : false;
+ //濡傛灉涓嶆樉绀�345鍒嗙被锛宑olumns閲岄潰鍒犻櫎3锛�4锛�5鍒嗙被
+ if (!this.is345Show) {
+ for (var i = 0; i < this.columns.length; i++) {
+ if (this.columns[i].label == "绗�3鍒嗙被") {
+ this.columns.splice(i, 1);
+ }
+ }
+ for (var i = 0; i < this.columns.length; i++) {
+ if (this.columns[i].label == "绗�4鍒嗙被") {
+ this.columns.splice(i, 1);
+ }
+ }
+ for (var i = 0; i < this.columns.length; i++) {
+ if (this.columns[i].label == "绗�5鍒嗙被") {
+ this.columns.splice(i, 1);
+ }
+ }
+ for (var i = 0; i < this.editColumns.length; i++) {
+ if (this.editColumns[i].label == "绗�3鍒嗙被") {
+ this.editColumns.splice(i, 1);
+ }
+ }
+ for (var i = 0; i < this.editColumns.length; i++) {
+ if (this.editColumns[i].label == "绗�4鍒嗙被") {
+ this.editColumns.splice(i, 1);
+ }
+ }
+ for (var i = 0; i < this.editColumns.length; i++) {
+ if (this.editColumns[i].label == "绗�5鍒嗙被") {
+ this.editColumns.splice(i, 1);
+ }
+ }
+ }
+ //濡傛灉EditAble==false锛屽垹闄� 鍑鸿揣閲戦(鍏�) 鏈夋晥鏈熷唴搴撳瓨(鐩�) 鏈夋晥鏈熷唴搴撳瓨(涓�) 3鍒� 灞曠ず 杩樻病鍙戠エ鏁伴噺 杩斿搧鏁伴噺 宸插彂绁ㄦ暟閲�
+ //type : "number",
+ // typeAttributes:{
+ // minimumFractionDigits:2,
+ // },
+ if (!this.EditAble) {
+ let object1 = {
+ label: this.InvoiceProNotLabel,
+ fieldName: "InvoiceProNot_count__c",
+ type: "number",
+ initialWidth: 105,
+ typeAttributes: {
+ minimumFractionDigits: 2,
+ },
+ hideDefaultActions: true,
+ };
+ let object2 = {
+ label: this.RrturnProLabel,
+ fieldName: "RrturnPro_count__c",
+ cellAttributes: { alignment: "right" },
+ initialWidth: 100,
+ hideDefaultActions: true,
+ };
+ let object3 = {
+ label: this.InvoicedLabel,
+ fieldName: "Invoiced_Procount__c",
+ type: "number",
+ initialWidth: 100,
+ typeAttributes: {
+ minimumFractionDigits: 2,
+ },
+ hideDefaultActions: true,
+ };
+ this.editColumns.push(object1);
+ this.editColumns.push(object2);
+ this.editColumns.push(object3);
+ } else {
+ this.ForCustomerText = this.cocLwc.Order_ForCustomerText__c;
+ console.log('EditAble = true this.ForCustomerText = ' + this.ForCustomerText);
+ this.summonsForDirction = this.cocLwc.SummonsForDirction__c;
+ console.log('EditAble = true this.summonsForDirction = ' + this.summonsForDirction);
+ let value = this.summonsForDirction;
+ switch (value) {
+ case "鐩存帴閿�鍞粰鍖婚櫌":
+ this.isDisabledHospitalName = false;
+ this.isDisabledForCustomerText = false;
+ this.secondaryDistributor = "";
+ this.ForDealerText = "";
+ this.accountValue = "";
+ this.cocLwc['Order_ForDealerText__c'] = '';
+ this.isDisabledForDealerText = true;
+ this.isDisabledSecondaryDistributor = true;
+ break;
+ case "鍖婚櫌璇曠敤":
+ this.isDisabledHospitalName = false;
+ this.isDisabledForCustomerText = false;
+ this.isDisabledForDealerText = false;
+ this.isDisabledSecondaryDistributor = false;
+ this.isMutualTransferGoods = false;
+ break;
+ case "閿�鍞粰浜岀骇缁忛攢鍟�":
+ this.isDisabledHospitalName = false;
+ this.isDisabledForCustomerText = false;
+ this.isDisabledForDealerText = false;
+ this.isDisabledSecondaryDistributor = false;
+ this.isMutualTransferGoods = false;
+ break;
+ case "浜掔浉璋冭揣":
+ this.isDisabledHospitalName = true;
+ this.HospitalName = "";
+ this.OECId = "";
+ this.isDisabledForCustomerText = true;
+ this.ForCustomerText = "";
+ this.cocLwc["Order_ForCustomerText__c"] = "";
+ this.isDisabledForDealerText = false;
+ this.isDisabledSecondaryDistributor = false;
+ this.isMutualTransferGoods = true;
+ break;
+ default:
+ this.isDisabledHospitalName = false;
+ this.isDisabledForCustomerText = false;
+ this.isDisabledForDealerText = false;
+ this.isDisabledSecondaryDistributor = false;
+ }
+ }
+
+ //濡傛灉hasHosPro = true 鍖婚櫌鐗逛环
+ if (this.hasHosPro) {
+ let object1 = {
+ label: "鍖婚櫌鐗逛环",
+ initialWidth: 80,
+ fieldName: "hospitalSpecialOffer",
+ type: 'boolean',
+ hideDefaultActions: true,
+ };
+ this.columns.push(object1);
+ this.editColumns.push(object1);
+ }
+ //鍑哄簱鍗曚俊鎭�
+ this.isSummonsFlag = r.entity.SummonsFlag == "visible" ? true : false;
+ console.log("r.entity.provinceOptsMap = " + r.entity.provinceOptsMap);
+ for (var key in r.entity.provinceOptsMap) {
+ let object = {};
+ object["label"] = r.entity.provinceOptsMap[key];
+ object["value"] = key;
+ this.secondaryDistributorOptions.push(object);
+ }
+ for (var key in r.entity.outOutPatternOptionMap) {
+ let object = {};
+ object["label"] = r.entity.outOutPatternOptionMap[key];
+ object["value"] = key;
+ this.outOutPatternOptionList.push(object);
+ }
+ console.log(
+ "this.secondaryDistributorOptions = " +
+ JSON.stringify(this.secondaryDistributorOptions)
+ );
+ this.HospitalName = r.entity.HospitalName;
+ this.sumPrice = r.entity.sumPrice.toFixed(2) + "鍏�";
+ debugger
+ console.log('this.Existarrive = ' + this.Existarrive);
+ console.log('this.EditAble = ' + this.EditAble);
+ console.log('r.entity.coc.SummonsStatus_c__c = ' + r.entity.coc.SummonsStatus_c__c);
+ if (!this.Existarrive && this.EditAble && r.entity.coc.SummonsStatus_c__c != '浠锋牸鏈畾') {
+ this.hideCheckboxColumn = false;
+ } else {
+ this.hideCheckboxColumn = true;
+ }
+ if (!(this.arriveorder == '' && this.Existarrive == false && this.EditAble && this.cocLwc.SummonsStatus_c__c != '浠锋牸鏈畾')) {
+ //璁╁崟浣嶏紝鍑鸿揣鏁伴噺 鍙樹负涓嶅彲閫夌殑text绫诲瀷
+ for (var i in this.columns) {
+ if (this.columns[i].label == '鍗曚綅') {
+ this.columns[i].type = 'text';
+ this.columns[i].fieldName = 'unitValue';
+ }
+ if (this.columns[i].label == '鍑鸿揣鏁伴噺') {
+ this.columns[i].type = 'text';
+ this.columns[i].fieldName = 'shipmentNumber';
+ }
+ }
+ }
+ this.isShowSpinner = false;
+ this.showTable = true;
+ console.log("ESetid = " + this.ESetid);
+ } else {
+ console.log("r = " + JSON.stringify(r));
+ this.showMyToast('鍒濆鍖栧け璐�', r.msg, 'Error');
+ }
+ }).catch((error) => {
+ console.log("error = " + JSON.stringify(error));
+ this.showMyToast('閿欒', '鍒濆鍖栧け璐�', 'Error');
+ });
}
ChangeDirction(event) {
let value = event.target.value;
this.summonsForDirction = value;
- this.cocLwc['SummonsForDirction__c'] = value;
- console.log('閫夋嫨浜� = ' + value);
+ this.cocLwc["SummonsForDirction__c"] = value;
+ console.log("閫夋嫨浜� = " + value);
switch (value) {
- case '鐩存帴閿�鍞粰鍖婚櫌':
+ case "鐩存帴閿�鍞粰鍖婚櫌":
this.isDisabledHospitalName = false;
this.isDisabledForCustomerText = false;
- this.secondaryDistributor = '';
- this.ForDealerText = '';
+ this.secondaryDistributor = "";
+ this.ForDealerText = "";
this.cocLwc['Order_ForDealerText__c'] = '';
this.isDisabledForDealerText = true;
this.isDisabledSecondaryDistributor = true;
this.isMutualTransferGoods = false;
break;
- case '鍖婚櫌璇曠敤':
+ case "鍖婚櫌璇曠敤":
this.isDisabledHospitalName = false;
this.isDisabledForCustomerText = false;
this.isDisabledForDealerText = false;
this.isDisabledSecondaryDistributor = false;
this.isMutualTransferGoods = false;
break;
- case '閿�鍞粰浜岀骇缁忛攢鍟�':
+ case "閿�鍞粰浜岀骇缁忛攢鍟�":
this.isDisabledHospitalName = false;
this.isDisabledForCustomerText = false;
this.isDisabledForDealerText = false;
this.isDisabledSecondaryDistributor = false;
this.isMutualTransferGoods = false;
break;
- case '浜掔浉璋冭揣':
+ case "浜掔浉璋冭揣":
this.isDisabledHospitalName = true;
- this.HospitalName = '';
- this.OECId = '';
+ this.HospitalName = "";
+ this.OECId = "";
this.isDisabledForCustomerText = true;
- this.ForCustomerText = '';
- this.cocLwc['Order_ForCustomerText__c'] = '';
+ this.ForCustomerText = "";
+ this.cocLwc["Order_ForCustomerText__c"] = "";
this.isDisabledForDealerText = false;
this.isDisabledSecondaryDistributor = false;
this.isMutualTransferGoods = true;
@@ -1342,42 +1157,42 @@
}
dataChange(event) {
- let fieldName = event.target.getAttribute('data-field');
+ let fieldName = event.target.getAttribute("data-field");
let value = event.detail.value;
- console.log('fieldName = ' + fieldName + ' value = ' + value);
+ console.log("fieldName = " + fieldName + " value = " + value);
switch (fieldName) {
- case 'summonsForDirction':
+ case "summonsForDirction":
this.summonsForDirction = value;
break;
- case 'secondaryDistributor':
+ case "secondaryDistributor":
this.secondaryDistributor = value;
break;
- case 'HospitalName':
+ case "HospitalName":
this.HospitalName = value;
break;
- case 'outOutPattern':
+ case "outOutPattern":
this.outOutPattern = value;
break;
- case 'ForDealerText':
+ case "ForDealerText":
this.ForDealerText = value;
- this.cocLwc['Order_ForDealerText__c'] = value;
+ this.cocLwc["Order_ForDealerText__c"] = value;
break;
- case 'ForCustomerText':
- this.cocLwc['Order_ForCustomerText__c'] = value;
+ case "ForCustomerText":
+ this.cocLwc["Order_ForCustomerText__c"] = value;
this.ForCustomerText = value;
break;
- case 'sumPrice':
+ case "sumPrice":
this.sumPrice = value.toFixed(2);
break;
- case 'NoConfirmedPrice':
+ case "NoConfirmedPrice":
this.NoConfirmedPrice = !this.NoConfirmedPrice;
- this.cocLwc['NoConfirmedPrice__c'] = this.NoConfirmedPrice;
- console.log('this.NoConfirmedPrice = ' + this.NoConfirmedPrice);
+ this.cocLwc["NoConfirmedPrice__c"] = this.NoConfirmedPrice;
+ console.log("this.NoConfirmedPrice = " + this.NoConfirmedPrice);
break;
- case 'consumableName':
+ case "consumableName":
this.consumableName = value;
break;
- case 'Category3':
+ case "Category3":
this.Category3 = value;
//璋冪敤鍚庡彴鏄剧ず绗洓浜斿垎绫�
this.showAllCate();
@@ -1386,7 +1201,7 @@
this.Category5 = '';
}
break;
- case 'Category4':
+ case "Category4":
this.Category4 = value;
//璋冪敤鍚庡彴鏄剧ず绗簲鍒嗙被
this.showCate();
@@ -1394,96 +1209,88 @@
this.Category5 = '';
}
break;
- case 'Category5':
+ case "Category5":
this.Category5 = value;
break;
- case 'searchHospitalName':
+ case "searchHospitalName":
this.searchHospitalName = value;
break;
- case 'Barcode':
+ case "Barcode":
this.Barcode = value;
break;
- case 'Order_ForDealerText__c':
- this.cocLwc['Order_ForDealerText__c'] = value;
+ case "Order_ForDealerText__c":
+ this.cocLwc["Order_ForDealerText__c"] = value;
break;
}
}
showAllCate() {
- console.log('showAllCate');
+ console.log('showAllCate')
categoryAllload({
category3Lwc: this.Category3
- })
- .then((r) => {
- r = JSON.parse(JSON.stringify(r));
- console.log('r = ' + JSON.stringify(r));
- if (r.status == 'Success') {
- this.category4Options = [];
- this.category5Options = [];
- //绗�4鍒嗙被
- for (var key in r.entity.category4OptionMap) {
- let object = {};
- object['label'] = r.entity.category4OptionMap[key];
- object['value'] = key;
- this.category4Options.push(object);
- }
- console.log(
- 'this.category4Options = ' + this.category4Options
- );
- //绗�5鍒嗙被
- for (var key in r.entity.category5OptionMap) {
- let object = {};
- object['label'] = r.entity.category5OptionMap[key];
- object['value'] = key;
- this.category5Options.push(object);
- }
- } else {
- console.log('r = ' + JSON.stringify(r));
- this.showMyToast('4/5鍒嗙被鏌ヨ澶辫触', r.msg, 'Error');
+ }).then((r) => {
+ r = JSON.parse(JSON.stringify(r));
+ console.log("r = " + JSON.stringify(r));
+ if (r.status == "Success") {
+ this.category4Options = [];
+ this.category5Options = [];
+ //绗�4鍒嗙被
+ for (var key in r.entity.category4OptionMap) {
+ let object = {};
+ object["label"] = r.entity.category4OptionMap[key];
+ object["value"] = key;
+ this.category4Options.push(object);
}
- })
- .catch((error) => {
- console.log('error' + JSON.stringify(error));
- });
+ console.log("this.category4Options = " + this.category4Options);
+ //绗�5鍒嗙被
+ for (var key in r.entity.category5OptionMap) {
+ let object = {};
+ object["label"] = r.entity.category5OptionMap[key];
+ object["value"] = key;
+ this.category5Options.push(object);
+ }
+ } else {
+ console.log("r = " + JSON.stringify(r));
+ this.showMyToast('4/5鍒嗙被鏌ヨ澶辫触', r.msg, 'Error');
+ }
+ }).catch((error) => {
+ console.log("error" + JSON.stringify(error));
+ });
}
showCate() {
- console.log('showAllCate');
+ console.log('showAllCate')
categoryload({
category3Lwc: this.Category3,
category4Lwc: this.Category4
- })
- .then((r) => {
- r = JSON.parse(JSON.stringify(r));
- console.log('r = ' + JSON.stringify(r));
- if (r.status == 'Success') {
- this.category4Options = [];
- this.category5Options = [];
- //绗�4鍒嗙被
- for (var key in r.entity.category4OptionMap) {
- let object = {};
- object['label'] = r.entity.category4OptionMap[key];
- object['value'] = key;
- this.category4Options.push(object);
- }
- console.log(
- 'this.category4Options = ' + this.category4Options
- );
- //绗�5鍒嗙被
- for (var key in r.entity.category5OptionMap) {
- let object = {};
- object['label'] = r.entity.category5OptionMap[key];
- object['value'] = key;
- this.category5Options.push(object);
- }
- } else {
- console.log('r = ' + JSON.stringify(r));
- this.showMyToast('Error', r.msg, 'Error');
+ }).then((r) => {
+ r = JSON.parse(JSON.stringify(r));
+ console.log("r = " + JSON.stringify(r));
+ if (r.status == "Success") {
+ this.category4Options = [];
+ this.category5Options = [];
+ //绗�4鍒嗙被
+ for (var key in r.entity.category4OptionMap) {
+ let object = {};
+ object["label"] = r.entity.category4OptionMap[key];
+ object["value"] = key;
+ this.category4Options.push(object);
}
- })
- .catch((error) => {
- console.log('error' + JSON.stringify(error));
- });
+ console.log("this.category4Options = " + this.category4Options);
+ //绗�5鍒嗙被
+ for (var key in r.entity.category5OptionMap) {
+ let object = {};
+ object["label"] = r.entity.category5OptionMap[key];
+ object["value"] = key;
+ this.category5Options.push(object);
+ }
+ } else {
+ console.log("r = " + JSON.stringify(r));
+ this.showMyToast('Error', r.msg, 'Error');
+ }
+ }).catch((error) => {
+ console.log("error" + JSON.stringify(error));
+ });
}
invoiceChange(event) {
@@ -1504,46 +1311,37 @@
iconName = 'utility:error';
}
if (message != '') {
- content =
- '<h2><strong>' +
- title +
- '<strong/></h2><h5>' +
- message +
- '</h5>';
+ content = '<h2><strong>' + title + '<strong/></h2><h5>' + message + '</h5>';
} else {
content = '<h2><strong>' + title + '<strong/></h2>';
}
- this.template
- .querySelector('c-common-toast')
- .showToast(variant, content, iconName, 10000);
+ this.template.querySelector('c-common-toast').showToast(variant, content, iconName, 10000);
}
searchProductJs() {
this.isEditShowSpinner = true;
//this.showTable = false;
//鏌ヨ鏈夊摢浜涢�夋嫨浜嗙殑鐒跺悗check
- const selectedRows = this.template
- .querySelector('c-lex-custom-lightning-datatable')
- .getSelectedRows();
+ const selectedRows = this.template.querySelector('c-lex-custom-lightning-datatable').getSelectedRows();
console.log('selectedRows = ' + selectedRows);
for (var i in this.data) {
- this.data[i]['check'] = false;
+ this.data[i]["check"] = false;
}
for (var i in this.data) {
for (var j in selectedRows) {
if (this.data[i].Id == selectedRows[j].Id) {
- this.data[i]['check'] = true;
+ this.data[i]["check"] = true;
}
}
}
let cloneData = this.deepClone(this.data);
for (var i in cloneData) {
- cloneData[i]['Name'] = cloneData[i].Name__c;
- cloneData[i]['Category3'] = cloneData[i].Category3__c;
- cloneData[i]['Category4'] = cloneData[i].Category4__c;
- cloneData[i]['Category5'] = cloneData[i].Category5__c;
- cloneData[i]['BoxPiece'] = cloneData[i].Box_Piece__c;
+ cloneData[i]["Name"] = cloneData[i].Name__c;
+ cloneData[i]["Category3"] = cloneData[i].Category3__c;
+ cloneData[i]["Category4"] = cloneData[i].Category4__c;
+ cloneData[i]["Category5"] = cloneData[i].Category5__c;
+ cloneData[i]["BoxPiece"] = cloneData[i].Box_Piece__c;
delete cloneData[i].Name__c;
delete cloneData[i].Category3__c;
delete cloneData[i].Category4__c;
@@ -1551,7 +1349,7 @@
delete cloneData[i].Box_Piece__c;
}
- console.log('cloneData = ' + JSON.stringify(cloneData));
+ console.log("cloneData = " + JSON.stringify(cloneData));
searchConsumableorderdetails({
agencyProTypeLwc: this.agencyProType,
accountNameLwc: this.accountName,
@@ -1563,31 +1361,26 @@
category5: this.Category5,
editAbleLwc: this.EditAble,
pageRecordsLwcLwc: cloneData,
- consumableproductdetailsRecordsLwc:
- this.consumableproductdetailsRecords,
+ consumableproductdetailsRecordsLwc: this.consumableproductdetailsRecords,
arriveorderLwc: this.arriveorder,
pageSizeLWC: this.pageSize,
pageTokenLWC: this.currentPageToken
}).then((r) => {
r = JSON.parse(JSON.stringify(r));
- console.log('r = ' + JSON.stringify(r));
- if (r.status == 'Success') {
+ console.log("r = " + JSON.stringify(r));
+ if (r.status == "Success") {
+
//鍒嗛〉
- console.log(
- 'r.entity.paginatedAccounts = ' +
- JSON.stringify(r.entity.paginatedAccounts)
- );
+ console.log('r.entity.paginatedAccounts = ' + JSON.stringify(r.entity.paginatedAccounts));
this.nextPageToken = r.entity.paginatedAccounts.nextPageToken;
this.totalRecords = r.entity.paginatedAccounts.totalRecords;
this.recordStart = r.entity.paginatedAccounts.recordStart;
this.recordEnd = r.entity.paginatedAccounts.recordEnd;
- this.totalPages = Math.ceil(
- r.entity.paginatedAccounts.totalRecords / this.pageSize
- );
+ this.totalPages = Math.ceil(r.entity.paginatedAccounts.totalRecords / this.pageSize);
console.log('this.totalPages = ' + this.totalPages);
this.hasHosPro = r.entity.hasHosPro;
- console.log('this.hasHosPro = ' + this.hasHosPro);
+ console.log("this.hasHosPro = " + this.hasHosPro);
this.SearchDone = r.entity.SearchDone;
let tempData = [];
@@ -1597,94 +1390,61 @@
let unitOptions = [];
for (var key in tempData[i].boxorpieceMap) {
let unitOption = {};
- unitOption['label'] = tempData[i].boxorpieceMap[key];
- unitOption['value'] = key;
+ unitOption["label"] = tempData[i].boxorpieceMap[key];
+ unitOption["value"] = key;
unitOptions.push(unitOption);
}
- tempData[i]['unitOptions'] = unitOptions;
- tempData[i]['unitValue'] =
- tempData[i]['unitValue'] == null
- ? unitOptions[0].value
- : tempData[i]['unitValue'];
+ tempData[i]["unitOptions"] = unitOptions;
+ tempData[i]["unitValue"] = tempData[i]["unitValue"] == null ? unitOptions[0].value : tempData[i]["unitValue"];
if (this.EditAble) {
- tempData[i].orderdetails1['Box_Piece__c'] =
- tempData[i].orderdetails1['Box_Piece__c'] == null
- ? unitOptions[0].value
- : tempData[i].orderdetails1['Box_Piece__c'];
- tempData[i]['unitValue'] =
- tempData[i].orderdetails1['Box_Piece__c'] == null
- ? unitOptions[0].value
- : tempData[i].orderdetails1['Box_Piece__c'];
- tempData[i].orderdetails1['Shipment_Count__c'] =
- tempData[i].orderdetails1['Shipment_Count__c'] ==
- null
- ? 0
- : tempData[i].orderdetails1[
- 'Shipment_Count__c'
- ];
- tempData[i].orderdetails1['Delivery_List_RMB__c'] =
- tempData[i].orderdetails1['Delivery_List_RMB__c'] ==
- null
- ? 0.0
- : tempData[i].orderdetails1[
- 'Delivery_List_RMB__c'
- ];
+ tempData[i].orderdetails1["Box_Piece__c"] = tempData[i].orderdetails1["Box_Piece__c"] == null ? unitOptions[0].value : tempData[i].orderdetails1["Box_Piece__c"];
+ tempData[i]["unitValue"] = tempData[i].orderdetails1["Box_Piece__c"] == null ? unitOptions[0].value : tempData[i].orderdetails1["Box_Piece__c"];
+ tempData[i].orderdetails1["Shipment_Count__c"] = tempData[i].orderdetails1["Shipment_Count__c"] == null ? 0 : tempData[i].orderdetails1["Shipment_Count__c"];
+ tempData[i].orderdetails1["Delivery_List_RMB__c"] = tempData[i].orderdetails1["Delivery_List_RMB__c"] == null ? 0.0 : tempData[i].orderdetails1["Delivery_List_RMB__c"];
} else {
- tempData[i]['InvoiceProNot_count__c'] =
+ tempData[i]["InvoiceProNot_count__c"] =
tempData[i].orderdetails1.InvoiceProNot_count__c;
- tempData[i]['RrturnPro_count__c'] =
+ tempData[i]["RrturnPro_count__c"] =
tempData[i].orderdetails1.RrturnPro_count__c;
- tempData[i]['Invoiced_Procount__c'] =
+ tempData[i]["Invoiced_Procount__c"] =
tempData[i].orderdetails1.Invoiced_Procount__c;
}
- tempData[i]['shipmentNumber'] =
- tempData[i].orderdetails1['Shipment_Count__c'];
- tempData[i]['shippingUnitPrice'] =
- tempData[i].orderdetails1['Delivery_List_RMB__c'];
+ tempData[i]["shipmentNumber"] = tempData[i].orderdetails1["Shipment_Count__c"];
+ tempData[i]["shippingUnitPrice"] = tempData[i].orderdetails1["Delivery_List_RMB__c"];
- tempData[i]['Id'] = tempData[i].Prod.Id;
+ tempData[i]["Id"] = tempData[i].Prod.Id;
- console.log(
- 'tempData[i]["hospitalSpecialOffer"] = ' +
- tempData[i]['hospitalSpecialOffer']
- );
+ console.log('tempData[i]["hospitalSpecialOffer"] = ' + tempData[i]["hospitalSpecialOffer"])
if (this.hasHosPro) {
- if (tempData[i]['hospitalSpecialOffer']) {
- tempData[i]['Id'] = tempData[i].Prod.Id + 'ishos';
+ if (tempData[i]["hospitalSpecialOffer"]) {
+ tempData[i]["Id"] = tempData[i].Prod.Id + 'ishos';
} else {
- tempData[i]['Id'] = tempData[i].Prod.Id + 'nothos';
+ tempData[i]["Id"] = tempData[i].Prod.Id + 'nothos';
}
}
- tempData[i]['recordId'] = tempData[i]['Id'];
- tempData[i]['Name__c'] = tempData[i].Prod.Name__c;
- tempData[i]['SFDA_Status__c'] =
- tempData[i].Prod.SFDA_Status__c;
- tempData[i]['Category3__c'] = tempData[i].Prod.Category3__c;
- tempData[i]['Category4__c'] = tempData[i].Prod.Category4__c;
- tempData[i]['Category5__c'] = tempData[i].Prod.Category5__c;
- tempData[i]['Box_Piece__c'] =
- tempData[i].orderdetails1.Box_Piece__c;
- tempData[i]['shipmentAmount'] =
- tempData[i].orderdetails1.Shipment_amount__c;
- tempData[i]['Shipment_amount__c'] =
- tempData[i].orderdetails1.Shipment_amount__c;
- tempData[i]['Shipment_Count__c'] =
- tempData[i].orderdetails1.Shipment_Count__c;
+ tempData[i]["recordId"] = tempData[i]["Id"];
+ tempData[i]["Name__c"] = tempData[i].Prod.Name__c;
+ tempData[i]["SFDA_Status__c"] = tempData[i].Prod.SFDA_Status__c;
+ tempData[i]["Category3__c"] = tempData[i].Prod.Category3__c;
+ tempData[i]["Category4__c"] = tempData[i].Prod.Category4__c;
+ tempData[i]["Category5__c"] = tempData[i].Prod.Category5__c;
+ tempData[i]["Box_Piece__c"] = tempData[i].orderdetails1.Box_Piece__c;
+ tempData[i]["shipmentAmount"] = tempData[i].orderdetails1.Shipment_amount__c;
+ tempData[i]["Shipment_amount__c"] = tempData[i].orderdetails1.Shipment_amount__c;
+ tempData[i]["Shipment_Count__c"] = tempData[i].orderdetails1.Shipment_Count__c;
- if (
- tempData[i]['shippingUnitPrice'] &&
- tempData[i]['shipmentNumber']
- )
- tempData[i]['shipmentAmount'] = this.amend(
- tempData[i]['shipmentNumber'],
- tempData[i]['shippingUnitPrice'],
- '*'
+ if (tempData[i]["shippingUnitPrice"] && tempData[i]["shipmentNumber"])
+ tempData[i]["shipmentAmount"] = this.amend(
+ tempData[i]["shipmentNumber"],
+ tempData[i]["shippingUnitPrice"],
+ "*"
);
if (tempData[i]['check']) {
this.selectedRows.push(tempData[i].Id);
}
+
}
this.data = tempData;
@@ -1692,94 +1452,85 @@
console.log('this.hasHosPro = ' + this.hasHosPro);
if (this.hasHosPro) {
let object1 = {
- label: '鍖婚櫌鐗逛环',
- fieldName: 'hospitalSpecialOffer',
+ label: "鍖婚櫌鐗逛环",
+ fieldName: "hospitalSpecialOffer",
type: 'boolean',
initialWidth: 80,
- hideDefaultActions: true
+ hideDefaultActions: true,
};
this.columns.push(object1);
this.editColumns.push(object1);
}
this.columns = [...this.columns];
this.editColumns = [...this.editColumns];
- console.log('this.columns = ' + JSON.stringify(this.columns));
- console.log('this.data = ' + JSON.stringify(this.data));
- console.log(
- ' this.selectedRows = ' + JSON.stringify(this.selectedRows)
- );
+ console.log("this.columns = " + JSON.stringify(this.columns));
+ console.log("this.data = " + JSON.stringify(this.data));
+ console.log(" this.selectedRows = " + JSON.stringify(this.selectedRows));
//this.showTable = true;
this.isEditShowSpinner = false;
} else {
- console.log('r = ' + JSON.stringify(r));
+ console.log("r = " + JSON.stringify(r));
this.showMyToast('鏌ヨ澶辫触', r.msg, 'Error');
}
});
}
searchHospitalNameModal() {
- console.log('searchHospitalNameModal');
+ console.log("searchHospitalNameModal");
hospitalInit({
- ctype: this.agencyProType
+ ctype: this.agencyProType,
}).then((r) => {
r = JSON.parse(JSON.stringify(r));
- if (r.status == 'Success') {
+ if (r.status == "Success") {
this.hospitalList = r.entity.at;
for (var i in this.hospitalList) {
- this.hospitalList[i]['stateMasterName'] =
+ this.hospitalList[i]["stateMasterName"] =
this.hospitalList[i].State_Master__r.Name;
}
- console.log(
- 'hospitalInit r = ' + JSON.stringify(this.hospitalList)
- );
+ console.log("hospitalInit r = " + JSON.stringify(this.hospitalList));
this.isModalOpen = true;
}
});
}
searchHospital() {
- console.log('this.searchHospitalName = ' + this.searchHospitalName);
+ console.log("this.searchHospitalName = " + this.searchHospitalName);
serContact({
searchName: this.searchHospitalName,
- ctype: this.agencyProType
+ ctype: this.agencyProType,
}).then((r) => {
r = JSON.parse(JSON.stringify(r));
- if (r.status == 'Success') {
+ if (r.status == "Success") {
this.hospitalList = r.entity.at;
for (var i in this.hospitalList) {
- this.hospitalList[i]['stateMasterName'] =
+ this.hospitalList[i]["stateMasterName"] =
this.hospitalList[i].State_Master__r.Name;
}
- console.log(
- 'hospitalInit r = ' + JSON.stringify(this.hospitalList)
- );
+ console.log("hospitalInit r = " + JSON.stringify(this.hospitalList));
}
});
}
searchHandleRowAction(event) {
- console.log('searchHandleRowAction');
+ console.log("searchHandleRowAction");
let row = event.detail.row;
this.OECId = row.Id;
this.HospitalName = row.Name;
console.log(
- 'this.OECId = ' +
- this.OECId +
- ' this.HospitalName = ' +
- this.HospitalName
+ "this.OECId = " + this.OECId + " this.HospitalName = " + this.HospitalName
);
this.isModalOpen = false;
- console.log('this.isModalOpen = ' + this.isModalOpen);
+ console.log("this.isModalOpen = " + this.isModalOpen);
}
clearAgencyI(event) {
this.HospitalName = event.target.value;
- if (this.HospitalName == '' || this.HospitalName == null) {
- this.OECId = '';
+ if (this.HospitalName == "" || this.HospitalName == null) {
+ this.OECId = "";
}
- console.log('this.HospitalName = ' + this.HospitalName);
- console.log('this.OECId = ' + this.OECId);
- if (this.OECId != null && this.OECId != '') {
+ console.log("this.HospitalName = " + this.HospitalName);
+ console.log("this.OECId = " + this.OECId);
+ if (this.OECId != null && this.OECId != "") {
this.checkOutPattern();
}
}
@@ -1796,9 +1547,9 @@
}
}
if (ishos > 0) {
- this.cocLwc['OutPattern__c'] = true;
+ this.cocLwc["OutPattern__c"] = true;
} else {
- this.cocLwc['OutPattern__c'] = false;
+ this.cocLwc["OutPattern__c"] = false;
}
}
@@ -1807,59 +1558,43 @@
}
handleUnitChange(event) {
- console.log('handleUnitChange');
+ console.log("handleUnitChange");
const unitDetail = event.detail;
- console.log('unitDetail = ' + JSON.stringify(unitDetail));
+ console.log("unitDetail = " + JSON.stringify(unitDetail));
for (var i in this.data) {
if (this.data[i].Id == unitDetail.data.recordId) {
this.data[i].unitValue = unitDetail.data.unitValue;
- this.data[i].orderdetails1['Box_Piece__c'] =
- unitDetail.data.unitValue;
+ this.data[i].orderdetails1["Box_Piece__c"] = unitDetail.data.unitValue;
}
}
- console.log('this.data = ' + JSON.stringify(this.data));
+ console.log("this.data = " + JSON.stringify(this.data));
}
handleShipmentNumber(event) {
- console.log('handleShipmentNumber');
+ console.log("handleShipmentNumber");
const numberDetail = event.detail;
- console.log('numberDetail = ' + JSON.stringify(numberDetail));
+ console.log("numberDetail = " + JSON.stringify(numberDetail));
let index = 0;
for (var i in this.data) {
if (this.data[i].Id == numberDetail.data.recordId) {
index = i;
- this.data[i].shipmentNumber = Number(
- numberDetail.data.shipmentnumber
- );
- this.data[i].orderdetails1['Shipment_Count__c'] = Number(
- numberDetail.data.shipmentnumber
- );
- console.log(
- 'this.data[i].orderdetails1["Shipment_Count__c"] = ' +
- this.data[i].orderdetails1['Shipment_Count__c']
- );
- console.log(
- 'this.selectedRows.indexOf(this.data[i].Id) = ' +
- this.selectedRows.indexOf(this.data[i].Id)
- );
- if (this.data[i].orderdetails1['Shipment_Count__c'] != '') {
+ this.data[i].shipmentNumber = Number(numberDetail.data.shipmentnumber);
+ this.data[i].orderdetails1["Shipment_Count__c"] = Number(numberDetail.data.shipmentnumber);
+ console.log('this.data[i].orderdetails1["Shipment_Count__c"] = ' + this.data[i].orderdetails1["Shipment_Count__c"]);
+ console.log('this.selectedRows.indexOf(this.data[i].Id) = ' + this.selectedRows.indexOf(this.data[i].Id));
+ if (this.data[i].orderdetails1["Shipment_Count__c"] != '') {
if (this.selectedRows.indexOf(this.data[i].Id) == -1) {
this.selectedRows.push(this.data[i].Id);
}
this.data[i].check = true;
} else {
if (this.selectedRows.indexOf(this.data[i].Id) != -1) {
- this.selectedRows.splice(
- this.selectedRows.indexOf(this.data[i].Id),
- 1
- );
+ this.selectedRows.splice(this.selectedRows.indexOf(this.data[i].Id), 1);
}
this.data[i].check = false;
}
this.selectedRows = [...this.selectedRows];
- console.log(
- 'this.selectedRows = ' + JSON.stringify(this.selectedRows)
- );
+ console.log('this.selectedRows = ' + JSON.stringify(this.selectedRows));
}
}
this.data = [...this.data];
@@ -1871,7 +1606,7 @@
}
handleShipmentUnitPrice(event) {
- console.log('handleShipmentUnitPrice');
+ console.log("handleShipmentUnitPrice");
const priceDetail = event.detail;
let index = 0;
for (var i in this.data) {
@@ -1880,7 +1615,7 @@
this.data[i].shippingUnitPrice = Number(
priceDetail.data.shipmentunitprice
);
- this.data[i].orderdetails1['Delivery_List_RMB__c'] = Number(
+ this.data[i].orderdetails1["Delivery_List_RMB__c"] = Number(
priceDetail.data.shipmentunitprice
);
}
@@ -1893,18 +1628,17 @@
}
ComputePrice(index, number, price) {
- console.log('index = ' + index);
- console.log('number = ' + number);
- console.log('price = ' + price);
- let shipmentAmount = this.amend(number, price, '*');
- console.log('shipmentAmount = ' + shipmentAmount);
+ console.log("index = " + index);
+ console.log("number = " + number);
+ console.log("price = " + price);
+ let shipmentAmount = this.amend(number, price, "*");
+ console.log("shipmentAmount = " + shipmentAmount);
let sumPrice = 0.0;
this.data[index].shipmentAmount = shipmentAmount;
for (var i in this.data) {
- if (this.data[i].shipmentAmount)
- sumPrice += this.data[i].shipmentAmount;
+ if (this.data[i].shipmentAmount) sumPrice += this.data[i].shipmentAmount;
}
- this.sumPrice = sumPrice.toFixed(2) + '鍏�';
+ this.sumPrice = sumPrice.toFixed(2) + "鍏�";
//瀛樹笅閫夋嫨琛岋紝涓嶄細琚竻绌�
// if (this.selectedRows.indexOf(this.data[index].Id) == -1)
// this.selectedRows.push(this.data[index].Id);
@@ -1917,7 +1651,7 @@
this.data = [...this.data];
// this.selectedRows = [...this.selectedRows]
// console.log("this.selectedRows = " + JSON.stringify(this.selectedRows));
- console.log('this.data = ' + JSON.stringify(this.data));
+ console.log("this.data = " + JSON.stringify(this.data));
}
//num1 num2浼犲叆涓や釜鍊� symbol +-*/绗﹀彿
@@ -1929,12 +1663,12 @@
str2Length;
//瑙e喅鏁存暟娌℃湁灏忔暟鐐规柟娉�
try {
- str1Length = str1.split('.')[1].length;
+ str1Length = str1.split(".")[1].length;
} catch (error) {
str1Length = 0;
}
try {
- str2Length = str2.split('.')[1].length;
+ str2Length = str2.split(".")[1].length;
} catch (error) {
str2Length = 0;
}
@@ -1942,16 +1676,16 @@
//
console.log(step);
switch (symbol) {
- case '+':
+ case "+":
result = (num1 * step + num2 * step) / step;
break;
- case '-':
+ case "-":
result = (num1 * step - num2 * step) / step;
break;
- case '*':
+ case "*":
result = (num1 * step * (num2 * step)) / step / step;
break;
- case '/':
+ case "/":
result = (num1 * step) / (num2 * step);
break;
default:
@@ -1962,10 +1696,10 @@
getSelectedRows(event) {
let selectedRowsEvent = event.detail.selectedRows;
- console.log('selectedRowsEvent = ' + JSON.stringify(selectedRowsEvent));
+ console.log('selectedRowsEvent = ' + JSON.stringify(selectedRowsEvent))
this.selectedRows = [];
for (var i in selectedRowsEvent) {
- this.selectedRows.push(selectedRowsEvent[i].Id);
+ this.selectedRows.push(selectedRowsEvent[i].Id)
}
// for (var i in this.data) {
// for (var j in selectedRowsEvent) {
@@ -1998,8 +1732,8 @@
}
saveConfirmJs() {
- let msg = '鍑哄簱浠锋牸浠呭彲鎿嶄綔涓�娆″彉鏇达紝淇濆瓨鍚庡皢鏃犳硶淇敼銆俓n\n璇风‘璁わ紒';
- if (this.SummonsStatus == '浠锋牸鏈畾') {
+ let msg = "鍑哄簱浠锋牸浠呭彲鎿嶄綔涓�娆″彉鏇达紝淇濆瓨鍚庡皢鏃犳硶淇敼銆俓n\n璇风‘璁わ紒";
+ if (this.SummonsStatus == "浠锋牸鏈畾") {
if (confirm(msg) == true) {
this.saveConfirm();
}
@@ -2016,28 +1750,26 @@
this.isShowSpinner = true;
//鏌ヨ鏈夊摢浜涢�夋嫨浜嗙殑鐒跺悗check
- const selectedRows = this.template
- .querySelector('c-lex-custom-lightning-datatable')
- .getSelectedRows();
+ const selectedRows = this.template.querySelector('c-lex-custom-lightning-datatable').getSelectedRows();
console.log('selectedRows = ' + selectedRows);
for (var i in this.data) {
- this.data[i]['check'] = false;
+ this.data[i]["check"] = false;
}
for (var i in this.data) {
for (var j in selectedRows) {
if (this.data[i].Id == selectedRows[j].Id) {
- this.data[i]['check'] = true;
+ this.data[i]["check"] = true;
}
}
}
let cloneData = this.deepClone(this.data);
for (var i in cloneData) {
- cloneData[i]['Name'] = cloneData[i].Name__c;
- cloneData[i]['Category3'] = cloneData[i].Category3__c;
- cloneData[i]['Category4'] = cloneData[i].Category4__c;
- cloneData[i]['Category5'] = cloneData[i].Category5__c;
- cloneData[i]['BoxPiece'] = cloneData[i].Box_Piece__c;
+ cloneData[i]["Name"] = cloneData[i].Name__c;
+ cloneData[i]["Category3"] = cloneData[i].Category3__c;
+ cloneData[i]["Category4"] = cloneData[i].Category4__c;
+ cloneData[i]["Category5"] = cloneData[i].Category5__c;
+ cloneData[i]["BoxPiece"] = cloneData[i].Box_Piece__c;
//cloneData[i]["shippingUnitPrice"] = cloneData[i]["shippingUnitPrice"] == '' ? 0 : cloneData[i]["shippingUnitPrice"];
delete cloneData[i].Name__c;
delete cloneData[i].Category3__c;
@@ -2045,16 +1777,16 @@
delete cloneData[i].Category5__c;
delete cloneData[i].Box_Piece__c;
}
- console.log('this.cocLwc = ' + JSON.stringify(this.cocLwc));
- console.log('this.OECId = ' + this.OECId);
- console.log('this.HospitalName = ' + this.HospitalName);
- console.log('this.secondaryDistributor = ' + this.secondaryDistributor);
- console.log('this.pageRecordsLwc = ' + JSON.stringify(cloneData));
- console.log('this.accountid = ' + this.accountid);
- console.log('this.ESetid = ' + this.ESetid);
+ console.log("this.cocLwc = " + JSON.stringify(this.cocLwc));
+ console.log("this.OECId = " + this.OECId);
+ console.log("this.HospitalName = " + this.HospitalName);
+ console.log("this.secondaryDistributor = " + this.secondaryDistributor);
+ console.log("this.pageRecordsLwc = " + JSON.stringify(cloneData));
+ console.log("this.accountid = " + this.accountid);
+ console.log("this.ESetid = " + this.ESetid);
console.log(
- 'this.consumableproductdetailsRecords = ' +
- JSON.stringify(this.consumableproductdetailsRecords)
+ "this.consumableproductdetailsRecords = " +
+ JSON.stringify(this.consumableproductdetailsRecords)
);
save({
cocLwc: this.cocLwc,
@@ -2064,49 +1796,45 @@
pageRecordsLwc: cloneData,
accountidLwc: this.accountid,
ESetIdLwc: this.ESetid,
- consumableproductdetailsRecordsLwc:
- this.consumableproductdetailsRecords,
+ consumableproductdetailsRecordsLwc: this.consumableproductdetailsRecords,
agencyProTypeLwc: this.agencyProType,
userWorkLocationLwc: this.userWorkLocation
- })
- .then((r) => {
- r = JSON.parse(JSON.stringify(r));
- console.log('r = ' + JSON.stringify(r));
- debugger;
- if (r.status == 'Success') {
- // let url = "/lexsummonscreat?ESetid=" + r.entity.ESetId;
- // this[NavigationMixin.Navigate]({
- // type: "standard__webPage",
- // attributes: {
- // url: url,
- // },
- // });
- window.location.href =
- '/s/lexsummonscreat?ESetid=' + r.entity.ESetId;
- } else {
- console.log('r.msg = ' + r.msg);
- this.showMyToast('淇濆瓨澶辫触', r.msg, 'Error');
- }
- })
- .catch((error) => {
- console.log('error = ' + JSON.stringify(error));
- });
+ }).then((r) => {
+ r = JSON.parse(JSON.stringify(r));
+ console.log("r = " + JSON.stringify(r));
+ debugger
+ if (r.status == "Success") {
+ // let url = "/lexsummonscreat?ESetid=" + r.entity.ESetId;
+ // this[NavigationMixin.Navigate]({
+ // type: "standard__webPage",
+ // attributes: {
+ // url: url,
+ // },
+ // });
+ window.location.href = "/s/lexsummonscreat?ESetid=" + r.entity.ESetId;
+ } else {
+ console.log("r.msg = " + r.msg);
+ this.showMyToast('淇濆瓨澶辫触', r.msg, 'Error');
+ }
+ }).catch((error) => {
+ console.log("error = " + JSON.stringify(error));
+ });
}
//鎵撳嵃鎸囩ず鍗�
PraseToPDFJs() {
- console.log('this.cocLwc = ' + JSON.stringify(this.cocLwc));
- console.log('this.ESetId = ' + this.ESetid);
+ console.log("this.cocLwc = " + JSON.stringify(this.cocLwc));
+ console.log("this.ESetId = " + this.ESetid);
PraseToPDF({
cocLwc: this.cocLwc,
- ESetId: this.ESetid
+ ESetId: this.ESetid,
}).then((r) => {
r = JSON.parse(JSON.stringify(r));
- console.log('r = ' + JSON.stringify(r));
- if (r.status == 'Success') {
- window.open('/customer/summonsPDF?ESetid=' + r.entity.ESetId);
+ console.log("r = " + JSON.stringify(r));
+ if (r.status == "Success") {
+ window.open("/customer/summonsPDF?ESetid=" + r.entity.ESetId);
} else {
- console.log('r.msg = ' + r.msg);
+ console.log("r.msg = " + r.msg);
this.showMyToast('鎵撳嵃澶辫触', r.msg, 'Error');
}
});
@@ -2114,22 +1842,15 @@
//鏄剧ず鏄庣粏
openReportJs() {
- console.log('openReportJs');
+ console.log("openReportJs");
var reportId = this.ESetid;
reportId = reportId.substring(0, 15);
- console.log('reportId = ' + reportId);
- let reportFilters =
- '[{"operator":"equals","value":"' +
- reportId +
- '","column":"FK_CUSTENT_ID"}]';
+ console.log("reportId = " + reportId);
+ let reportFilters = '[{"operator":"equals","value":"' + reportId + '","column":"FK_CUSTENT_ID"}]';
let reportUrl = this.label.ConsumableOutboundReportId;
- console.log('reportUrl = ' + reportUrl);
- let url =
- '/s/report/' +
- reportUrl +
- '?reportFilters=' +
- encodeURIComponent(reportFilters);
- console.log('url = ' + url);
+ console.log("reportUrl = " + reportUrl);
+ let url = "/s/report/" + reportUrl + "?reportFilters=" + encodeURIComponent(reportFilters);
+ console.log("url = " + url);
window.open(url);
// this[NavigationMixin.Navigate]({
// type: "standard__webPage",
@@ -2141,19 +1862,19 @@
}
vpClear2Delay(event) {
- console.log('vpClear2Delay');
- if (this.summonsForDirction != '浜掔浉璋冭揣') {
- this.cocLwc['Order_ForDealerText__c'] = event.target.value;
- console.log('this.cocLwc = ' + JSON.stringify(this.cocLwc));
+ console.log("vpClear2Delay");
+ if (this.summonsForDirction != "浜掔浉璋冭揣") {
+ this.cocLwc["Order_ForDealerText__c"] = event.target.value;
+ console.log("this.cocLwc = " + JSON.stringify(this.cocLwc));
} else {
//console.log('Order_ForDealerTextID__c = ' + this.cocLwc['Order_ForDealerTextID__c'])
- this.cocLwc['Order_ForDealerText__c'] =
- this.cocLwc['Order_ForDealerTextID__c'] == '' ||
- this.cocLwc['Order_ForDealerTextID__c'] == null ||
- this.cocLwc['Order_ForDealerTextID__c'] == undefined
- ? ''
- : this.cocLwc['Order_ForDealerText__c'];
- console.log('this.cocLwc = ' + JSON.stringify(this.cocLwc));
+ this.cocLwc["Order_ForDealerText__c"] =
+ this.cocLwc["Order_ForDealerTextID__c"] == "" ||
+ this.cocLwc["Order_ForDealerTextID__c"] == null ||
+ this.cocLwc["Order_ForDealerTextID__c"] == undefined
+ ? ""
+ : this.cocLwc["Order_ForDealerText__c"];
+ console.log("this.cocLwc = " + JSON.stringify(this.cocLwc));
// console.log('this.cocLwc = ' + JSON.stringify(this.cocLwc));
// this.ForDealerText = this.cocLwc['Order_ForDealerText__c'];
// event.target.value = this.cocLwc['Order_ForDealerText__c'];
@@ -2162,28 +1883,26 @@
}
handleSearch(event) {
const lookupElement = event.target;
- console.log('event.detail = ' + JSON.stringify(event.detail));
+ console.log("event.detail = " + JSON.stringify(event.detail));
apexSearch({
- searchTerm: event.detail.searchTerm
- })
- .then((results) => {
- lookupElement.setSearchResults(results);
- })
- .catch((error) => {
- console.log('error' + JSON.stringify(error));
- });
+ searchTerm: event.detail.searchTerm,
+ }).then((results) => {
+ lookupElement.setSearchResults(results);
+ }).catch((error) => {
+ console.log("error" + JSON.stringify(error));
+ });
}
handleSelectionChange(event) {
const selection = event.target.getSelection();
- console.log('selection = ' + JSON.stringify(selection));
- this.cocLwc['Order_ForDealerTextID__c'] = selection[0].id;
- this.cocLwc['Order_ForDealerText__c'] = selection[0].title;
- console.log('this.cocLwc = ' + JSON.stringify(this.cocLwc));
+ console.log("selection = " + JSON.stringify(selection));
+ this.cocLwc["Order_ForDealerTextID__c"] = selection[0].id;
+ this.cocLwc["Order_ForDealerText__c"] = selection[0].title;
+ console.log("this.cocLwc = " + JSON.stringify(this.cocLwc));
}
handleFilesChange(event) {
- console.log('handleFilesChange');
+ console.log("handleFilesChange");
if (event.target.files.length > 0) {
this.filesUploaded = event.target.files;
this.fileName = event.target.files[0].name;
@@ -2191,7 +1910,7 @@
}
handleSave() {
- console.log('saveFile');
+ console.log("saveFile");
if (this.filesUploaded.length > 0) {
this.file = this.filesUploaded[0];
if (this.file.size > this.MAX_FILE_SIZE) {
@@ -2203,271 +1922,186 @@
this.fileReader.onloadend = () => {
this.fileContents = this.fileReader.result;
- let base64 = 'base64,';
- this.content =
- this.fileContents.indexOf(base64) + base64.length;
+ let base64 = "base64,";
+ this.content = this.fileContents.indexOf(base64) + base64.length;
this.fileContents = this.fileContents.substring(this.content);
this.saveToFile();
};
this.fileReader.readAsDataURL(this.file);
} else {
- this.fileName = '閫夋嫨涓�涓枃浠朵笂浼�';
+ this.fileName = "閫夋嫨涓�涓枃浠朵笂浼�";
}
}
saveToFile() {
- console.log('saveToFile');
- console.log('base64Data = ' + encodeURIComponent(this.fileContents));
+ console.log("saveToFile");
+ console.log("base64Data = " + encodeURIComponent(this.fileContents));
saveFile({
recordId: this.ESetid,
fileName: this.fileName,
- base64Data: encodeURIComponent(this.fileContents)
- })
- .then((r) => {
- this.showPopSpinner = false;
- r = JSON.parse(JSON.stringify(r));
- console.log('r = ' + JSON.stringify(r));
- this.closePop();
- this.showMyToast('涓婁紶鎴愬姛', '', 'Success');
- this.getFiles();
- })
- .catch((error) => {
- this.showPopSpinner = false;
- console.log('error = ' + error.message);
- this.showMyToast('澶辫触', '涓婁紶澶辫触', 'Error');
- });
+ base64Data: encodeURIComponent(this.fileContents),
+ }).then((r) => {
+ this.showPopSpinner = false;
+ r = JSON.parse(JSON.stringify(r));
+ console.log("r = " + JSON.stringify(r));
+ this.closePop();
+ this.showMyToast('涓婁紶鎴愬姛', '', 'Success');
+ this.getFiles();
+ }).catch((error) => {
+ this.showPopSpinner = false;
+ console.log("error = " + error.message);
+ this.showMyToast('澶辫触', '涓婁紶澶辫触', 'Error');
+ });
}
getFiles() {
- console.log('getFiles');
+ console.log("getFiles");
this.showLoadingSpinner = true;
getFiles({
- recordId: this.ESetid
- })
- .then((r) => {
- r = JSON.parse(JSON.stringify(r));
- console.log('r = ' + JSON.stringify(r));
- this.fileData = r.entity.cvList;
- console.log('this.fileData = ' + JSON.stringify(this.fileData));
- for (var i in this.fileData) {
- this.fileData[i]['Id'] = this.fileData[i].Id;
- this.fileData[i]['recordId'] = this.fileData[i].Id;
- this.fileData[i]['url'] = '/' + this.fileData[i].Id;
- this.fileData[i]['Title'] = this.fileData[i].Title;
- this.fileData[i]['attUrl'] = '/' + this.fileData[i].Id;
- this.fileData[i]['downloadUrl'] =
- '/sfc/servlet.shepherd/document/download/' +
- this.fileData[i].ContentDocumentId +
- '?operationContext=S1';
- }
- console.log('this.fileData = ' + this.fileData);
- this.showLoadingSpinner = false;
- })
- .catch((error) => {
- console.log('error = ' + error.message);
- this.showMyToast('澶辫触', '鑾峰彇闄勪欢澶辫触', 'Error');
- });
+ recordId: this.ESetid,
+ }).then((r) => {
+ r = JSON.parse(JSON.stringify(r));
+ console.log("r = " + JSON.stringify(r));
+ this.fileData = r.entity.cvList;
+ console.log("this.fileData = " + JSON.stringify(this.fileData));
+ for (var i in this.fileData) {
+ this.fileData[i]["Id"] = this.fileData[i].Id;
+ this.fileData[i]["recordId"] = this.fileData[i].Id;
+ this.fileData[i]["url"] = "/" + this.fileData[i].Id;
+ this.fileData[i]["Title"] = this.fileData[i].Title;
+ this.fileData[i]["attUrl"] = '/' + this.fileData[i].Id;
+ this.fileData[i]['downloadUrl'] = '/sfc/servlet.shepherd/document/download/' + this.fileData[i].ContentDocumentId + '?operationContext=S1';
+ }
+ console.log("this.fileData = " + this.fileData);
+ this.showLoadingSpinner = false;
+ }).catch((error) => {
+ console.log("error = " + error.message);
+ this.showMyToast('澶辫触', '鑾峰彇闄勪欢澶辫触', 'Error');
+ });
}
GoodsDeliveryJs() {
this.isShowSpinner = true;
//鏌ヨ鏈夊摢浜涢�夋嫨浜嗙殑鐒跺悗check
- const selectedRows = this.template
- .querySelector('c-lex-custom-lightning-datatable')
- .getSelectedRows();
+ const selectedRows = this.template.querySelector('c-lex-custom-lightning-datatable').getSelectedRows();
console.log('selectedRows = ' + selectedRows);
for (var i in this.data) {
- this.data[i]['check'] = false;
+ this.data[i]["check"] = false;
}
for (var i in this.data) {
for (var j in selectedRows) {
if (this.data[i].Id == selectedRows[j].Id) {
- this.data[i]['check'] = true;
+ this.data[i]["check"] = true;
}
}
}
let cloneData = this.deepClone(this.data);
for (var i in cloneData) {
- cloneData[i]['Name'] = cloneData[i].Name__c;
- cloneData[i]['Category3'] = cloneData[i].Category3__c;
- cloneData[i]['Category4'] = cloneData[i].Category4__c;
- cloneData[i]['Category5'] = cloneData[i].Category5__c;
- cloneData[i]['BoxPiece'] = cloneData[i].Box_Piece__c;
+ cloneData[i]["Name"] = cloneData[i].Name__c;
+ cloneData[i]["Category3"] = cloneData[i].Category3__c;
+ cloneData[i]["Category4"] = cloneData[i].Category4__c;
+ cloneData[i]["Category5"] = cloneData[i].Category5__c;
+ cloneData[i]["BoxPiece"] = cloneData[i].Box_Piece__c;
delete cloneData[i].Name__c;
delete cloneData[i].Category3__c;
delete cloneData[i].Category4__c;
delete cloneData[i].Category5__c;
delete cloneData[i].Box_Piece__c;
}
- console.log('cloneData = ' + JSON.stringify(cloneData));
+ console.log("cloneData = " + JSON.stringify(cloneData));
GoodsDelivery({
cocLwc: this.cocLwc,
ESetId: this.ESetid,
- pageRecordsLwcLwc: cloneData
- })
- .then((r) => {
- r = JSON.parse(JSON.stringify(r));
- console.log('r = ' + JSON.stringify(r));
- if (r.status == 'Success') {
- console.log(
- 'Summons_Order_type__c = ' +
- this.cocLwc['Summons_Order_type__c']
- );
- this.isSales =
- this.cocLwc['Summons_Order_type__c'] == '閿�鍞�'
- ? true
- : false;
- this.GoodsDeliveryInit();
- } else {
- console.log('r.msg = ' + r.msg);
- this.showMyToast('閿欒', r.msg, 'Error');
- }
- this.isShippingSales = true;
- })
- .catch((error) => {
- console.log('error = ' + error.message);
- this.showMyToast('澶辫触', '璺宠浆澶辫触', 'Error');
- });
+ pageRecordsLwcLwc: cloneData,
+ }).then((r) => {
+ r = JSON.parse(JSON.stringify(r));
+ console.log("r = " + JSON.stringify(r));
+ if (r.status == "Success") {
+ console.log(
+ "Summons_Order_type__c = " + this.cocLwc["Summons_Order_type__c"]
+ );
+ this.isSales = this.cocLwc["Summons_Order_type__c"] == "閿�鍞�" ? true : false;
+ this.GoodsDeliveryInit();
+ } else {
+ console.log("r.msg = " + r.msg);
+ this.showMyToast('閿欒', r.msg, 'Error');
+ }
+ this.isShippingSales = true;
+ }).catch((error) => {
+ console.log("error = " + error.message);
+ this.showMyToast('澶辫触', '璺宠浆澶辫触', 'Error');
+ });
}
GoodsDeliveryInit() {
- console.log('GoodsDeliveryInit');
+ console.log("GoodsDeliveryInit");
GoodsDeliveryInit({
- ESetId: this.ESetid
- })
- .then((r) => {
- r = JSON.parse(JSON.stringify(r));
- console.log('r = ' + JSON.stringify(r));
- if (r.status == 'Success') {
- this.salesCoc = r.entity.coc;
- this.salesAccountName = r.entity.accountName;
- this.salesUserWorkLocation = r.entity.userWorkLocation;
- this.salesAccountid = r.entity.accountid;
- this.salesOrderdetails = r.entity.orderdetails;
- console.log(
- 'this.salesOrderdetails = ' +
- JSON.stringify(this.salesOrderdetails)
- );
- this.salesData = r.entity.consumableorderdetailsRecords;
- console.log(
- 'this.salesData = ' + JSON.stringify(this.salesData)
- );
- this.salesErrorData =
- r.entity.consumableorderdetailsRecordserror;
- this.salesOrderpieceorboxMap = r.entity.orderpieceorboxMap;
- this.salesOrderpriceMap = r.entity.orderpriceMap;
- this.salesOrderagencypriceMap =
- r.entity.orderagencypriceMap;
- for (var i in this.salesData) {
- this.salesData[i]['Id'] =
- this.salesData[i].orderdetails2.Id;
- this.salesData[i]['Consumable_order_minor__c'] =
- this.salesData[i].orderdetails2
- .Consumable_order_minor__r != null
- ? this.salesData[i].orderdetails2
- .Consumable_order_minor__r.Name
- : '';
- this.salesData[i]['ConsumableorderminorUrl'] =
- this.salesData[i].orderdetails2
- .Consumable_order_minor__c != null
- ? '/' +
- this.salesData[i].orderdetails2
- .Consumable_order_minor__c
- : '';
- this.salesData[i]['orderdetails2Name'] =
- this.salesData[i].orderdetails2.Name;
- this.salesData[i]['orderdetails2NameUrl'] =
- '/' + this.salesData[i].orderdetails2.Id;
- this.salesData[i]['Box_Piece__c'] =
- this.salesData[i].orderdetails2.Box_Piece__c;
- this.salesData[i]['ProdName'] =
- this.salesData[i].Prod.Name;
- this.salesData[i]['Deliver_date__c'] =
- this.salesData[i].orderdetails2.Deliver_date__c;
- this.salesData[i]['Bar_Code__c'] =
- this.salesData[i].orderdetails2.Bar_Code__c;
- this.salesData[i]['Sterilization_limit__c'] =
- this.salesData[
- i
- ].orderdetails2.Sterilization_limit__c;
- if (this.salesData[i]['Box_Piece__c'] == '鐩�') {
- console.log(
- 'this.salesData[i] = ' +
- JSON.stringify(this.salesData[i])
- );
- this.salesData[i]['outboundCount'] =
- this.salesData[i].outboundCount;
- } else {
- for (var j in this.salesOrderdetails) {
- console.log(
- 'this.salesOrderdetails[j].Consumable_product__c = ' +
- this.salesOrderdetails[j]
- .Consumable_product__c
- );
- console.log(
- 'this.salesData[i].orderdetails2.Consumable_product__c = ' +
- this.salesData[i].orderdetails2
- .Consumable_product__c
- );
- if (
- this.salesOrderdetails[j]
- .Consumable_product__c ==
- this.salesData[i].orderdetails2
- .Consumable_product__c
- ) {
- this.salesData[i]['outboundCount'] =
- this.salesOrderdetails[
- j
- ].Shipment_Count__c;
- }
+ ESetId: this.ESetid,
+ }).then((r) => {
+ r = JSON.parse(JSON.stringify(r));
+ console.log("r = " + JSON.stringify(r));
+ if (r.status == "Success") {
+ this.salesCoc = r.entity.coc;
+ this.salesAccountName = r.entity.accountName;
+ this.salesUserWorkLocation = r.entity.userWorkLocation;
+ this.salesAccountid = r.entity.accountid;
+ this.salesOrderdetails = r.entity.orderdetails;
+ console.log('this.salesOrderdetails = ' + JSON.stringify(this.salesOrderdetails))
+ this.salesData = r.entity.consumableorderdetailsRecords;
+ console.log('this.salesData = ' + JSON.stringify(this.salesData))
+ this.salesErrorData = r.entity.consumableorderdetailsRecordserror;
+ this.salesOrderpieceorboxMap = r.entity.orderpieceorboxMap;
+ this.salesOrderpriceMap = r.entity.orderpriceMap;
+ this.salesOrderagencypriceMap = r.entity.orderagencypriceMap;
+ for (var i in this.salesData) {
+ this.salesData[i]["Id"] = this.salesData[i].orderdetails2.Id;
+ this.salesData[i]["Consumable_order_minor__c"] = this.salesData[i].orderdetails2.Consumable_order_minor__r != null ? this.salesData[i].orderdetails2.Consumable_order_minor__r.Name : '';
+ this.salesData[i]["ConsumableorderminorUrl"] = this.salesData[i].orderdetails2.Consumable_order_minor__c != null ? "/" + this.salesData[i].orderdetails2.Consumable_order_minor__c : '';
+ this.salesData[i]["orderdetails2Name"] = this.salesData[i].orderdetails2.Name;
+ this.salesData[i]["orderdetails2NameUrl"] = "/" + this.salesData[i].orderdetails2.Id;
+ this.salesData[i]["Box_Piece__c"] = this.salesData[i].orderdetails2.Box_Piece__c;
+ this.salesData[i]["ProdName"] = this.salesData[i].Prod.Name;
+ this.salesData[i]["Deliver_date__c"] = this.salesData[i].orderdetails2.Deliver_date__c;
+ this.salesData[i]["Bar_Code__c"] = this.salesData[i].orderdetails2.Bar_Code__c;
+ this.salesData[i]["Sterilization_limit__c"] = this.salesData[i].orderdetails2.Sterilization_limit__c;
+ if (this.salesData[i]["Box_Piece__c"] == '鐩�') {
+ console.log('this.salesData[i] = ' + JSON.stringify(this.salesData[i]))
+ this.salesData[i]["outboundCount"] = this.salesData[i].outboundCount;
+ } else {
+ for (var j in this.salesOrderdetails) {
+ console.log('this.salesOrderdetails[j].Consumable_product__c = ' + this.salesOrderdetails[j].Consumable_product__c);
+ console.log('this.salesData[i].orderdetails2.Consumable_product__c = ' + this.salesData[i].orderdetails2.Consumable_product__c);
+ if (this.salesOrderdetails[j].Consumable_product__c == this.salesData[i].orderdetails2.Consumable_product__c) {
+ this.salesData[i]["outboundCount"] = this.salesOrderdetails[j].Shipment_Count__c;
}
}
}
- for (var i in this.salesErrorData) {
- this.salesErrorData[i]['Id'] =
- this.salesErrorData[i].orderdetails2.Id;
- this.salesErrorData[i]['Consumable_order_minor__c'] =
- this.salesErrorData[i].orderdetails2
- .Consumable_order_minor__r != null
- ? this.salesErrorData[i].orderdetails2
- .Consumable_order_minor__r.Name
- : '';
- this.salesErrorData[i]['ConsumableorderminorUrl'] =
- this.salesErrorData[i].orderdetails2
- .Consumable_order_minor__c != null
- ? '/' +
- this.salesErrorData[i].orderdetails2
- .Consumable_order_minor__c
- : '';
- this.salesErrorData[i]['orderdetails2Name'] =
- this.salesErrorData[i].orderdetails2.Name;
- this.salesErrorData[i]['ProdName'] =
- this.salesErrorData[i].Prod.Name;
- this.salesErrorData[i]['Box_Piece__c'] =
- this.salesErrorData[i].orderdetails2.Box_Piece__c;
- this.salesErrorData[i]['Bar_Code__c'] =
- this.salesErrorData[i].orderdetails2.Bar_Code__c;
- this.salesErrorData[i]['Sterilization_limit__c'] =
- this.salesErrorData[
- i
- ].orderdetails2.Sterilization_limit__c;
- }
- this.isShowSpinner = false;
- } else {
- console.log('r.msg = ' + r.msg);
- this.showMyToast('鍒濆鍖栧け璐�', r.msg, 'Error');
}
- })
- .catch((error) => {
- console.log('error = ' + error.message);
- this.showMyToast('閿欒', '鍒濆鍖栧け璐�', 'Error');
- });
+ for (var i in this.salesErrorData) {
+ this.salesErrorData[i]["Id"] = this.salesErrorData[i].orderdetails2.Id;
+ this.salesErrorData[i]["Consumable_order_minor__c"] = this.salesErrorData[i].orderdetails2.Consumable_order_minor__r != null ? this.salesErrorData[i].orderdetails2.Consumable_order_minor__r.Name : '';
+ this.salesErrorData[i]["ConsumableorderminorUrl"] = this.salesErrorData[i].orderdetails2.Consumable_order_minor__c != null ? "/" + this.salesErrorData[i].orderdetails2.Consumable_order_minor__c : '';
+ this.salesErrorData[i]["orderdetails2Name"] = this.salesErrorData[i].orderdetails2.Name;
+ this.salesErrorData[i]["ProdName"] = this.salesErrorData[i].Prod.Name;
+ this.salesErrorData[i]["Box_Piece__c"] = this.salesErrorData[i].orderdetails2.Box_Piece__c;
+ this.salesErrorData[i]["Bar_Code__c"] = this.salesErrorData[i].orderdetails2.Bar_Code__c;
+ this.salesErrorData[i]["Sterilization_limit__c"] = this.salesErrorData[i].orderdetails2.Sterilization_limit__c;
+ }
+ this.isShowSpinner = false;
+ } else {
+ console.log("r.msg = " + r.msg);
+ this.showMyToast('鍒濆鍖栧け璐�', r.msg, 'Error');
+ }
+ }).catch((error) => {
+ console.log("error = " + error.message);
+ this.showMyToast('閿欒', '鍒濆鍖栧け璐�', 'Error');
+ });
}
SalesearchProductJs() {
- console.log('this.Barcode = ' + this.Barcode);
+ console.log("this.Barcode = " + this.Barcode);
this.isShowSpinner = true;
SearchPro({
cocLwc: this.salesCoc,
@@ -2476,143 +2110,78 @@
userWorkLocation: this.salesUserWorkLocation,
accountid: this.salesAccountid,
orderdetails: this.salesOrderdetails,
- orderpieceorboxMap: this.salesOrderpieceorboxMap
- })
- .then((r) => {
- r = JSON.parse(JSON.stringify(r));
- console.log('r = ' + JSON.stringify(r));
- if (r.status == 'Success') {
- console.log('SearchPro success');
- this.salesErrorData =
- r.entity.consumableorderdetailsRecordserror;
- this.salesData = r.entity.consumableorderdetailsRecords;
- for (var i in this.salesErrorData) {
- this.salesErrorData[i]['Id'] =
- this.salesErrorData[i].orderdetails2.Id;
- this.salesErrorData[i]['Consumable_order_minor__c'] =
- this.salesErrorData[i].orderdetails2
- .Consumable_order_minor__r != null
- ? this.salesErrorData[i].orderdetails2
- .Consumable_order_minor__r.Name
- : '';
- this.salesErrorData[i]['ConsumableorderminorUrl'] =
- this.salesErrorData[i].orderdetails2
- .Consumable_order_minor__c != null
- ? '/' +
- this.salesErrorData[i].orderdetails2
- .Consumable_order_minor__c
- : '';
- this.salesErrorData[i]['orderdetails2Name'] =
- this.salesErrorData[i].orderdetails2.Name;
- this.salesErrorData[i]['ProdName'] =
- this.salesErrorData[i].Prod.Name;
- this.salesErrorData[i]['Box_Piece__c'] =
- this.salesErrorData[i].orderdetails2.Box_Piece__c;
- this.salesErrorData[i]['Bar_Code__c'] =
- this.salesErrorData[i].orderdetails2.Bar_Code__c;
- this.salesErrorData[i]['Sterilization_limit__c'] =
- this.salesErrorData[
- i
- ].orderdetails2.Sterilization_limit__c;
- }
- console.log(
- 'this.salesData = ' + JSON.stringify(this.salesData)
- );
- for (var i in this.salesData) {
- this.salesData[i]['Id'] =
- this.salesData[i].orderdetails2.Id;
- this.salesData[i]['Consumable_order_minor__c'] =
- this.salesData[i].orderdetails2
- .Consumable_order_minor__r != null
- ? this.salesData[i].orderdetails2
- .Consumable_order_minor__r.Name
- : '';
- this.salesData[i]['ConsumableorderminorUrl'] =
- this.salesData[i].orderdetails2
- .Consumable_order_minor__c != null
- ? '/' +
- this.salesData[i].orderdetails2
- .Consumable_order_minor__c
- : '';
- this.salesData[i]['orderdetails2Name'] =
- this.salesData[i].orderdetails2.Name;
- this.salesData[i]['orderdetails2NameUrl'] =
- '/' + this.salesData[i].orderdetails2.Id;
- this.salesData[i]['Box_Piece__c'] =
- this.salesData[i].orderdetails2.Box_Piece__c;
- this.salesData[i]['ProdName'] =
- this.salesData[i].Prod.Name;
- this.salesData[i]['Deliver_date__c'] =
- this.salesData[i].orderdetails2.Deliver_date__c;
- this.salesData[i]['Bar_Code__c'] =
- this.salesData[i].orderdetails2.Bar_Code__c;
- this.salesData[i]['Sterilization_limit__c'] =
- this.salesData[
- i
- ].orderdetails2.Sterilization_limit__c;
- if (this.salesData[i]['Box_Piece__c'] == '鐩�') {
- console.log(
- 'this.salesData[i] = ' +
- JSON.stringify(this.salesData[i])
- );
- this.salesData[i]['outboundCount'] =
- this.salesData[i].outboundCount;
- } else {
- for (var j in this.salesOrderdetails) {
- console.log(
- 'this.salesOrderdetails[j].Consumable_product__c = ' +
- this.salesOrderdetails[j]
- .Consumable_product__c
- );
- console.log(
- 'this.salesData[i].orderdetails2.Consumable_product__c = ' +
- this.salesData[i].orderdetails2
- .Consumable_product__c
- );
- if (
- this.salesOrderdetails[j]
- .Consumable_product__c ==
- this.salesData[i].orderdetails2
- .Consumable_product__c
- ) {
- this.salesData[i]['outboundCount'] =
- this.salesOrderdetails[
- j
- ].Shipment_Count__c;
- }
+ orderpieceorboxMap: this.salesOrderpieceorboxMap,
+ }).then((r) => {
+ r = JSON.parse(JSON.stringify(r));
+ console.log("r = " + JSON.stringify(r));
+ if (r.status == "Success") {
+ console.log("SearchPro success");
+ this.salesErrorData = r.entity.consumableorderdetailsRecordserror;
+ this.salesData = r.entity.consumableorderdetailsRecords;
+ for (var i in this.salesErrorData) {
+ this.salesErrorData[i]["Id"] = this.salesErrorData[i].orderdetails2.Id;
+ this.salesErrorData[i]["Consumable_order_minor__c"] = this.salesErrorData[i].orderdetails2.Consumable_order_minor__r != null ? this.salesErrorData[i].orderdetails2.Consumable_order_minor__r.Name : '';
+ this.salesErrorData[i]["ConsumableorderminorUrl"] = this.salesErrorData[i].orderdetails2.Consumable_order_minor__c != null ? "/" + this.salesErrorData[i].orderdetails2.Consumable_order_minor__c : '';
+ this.salesErrorData[i]["orderdetails2Name"] = this.salesErrorData[i].orderdetails2.Name;
+ this.salesErrorData[i]["ProdName"] = this.salesErrorData[i].Prod.Name;
+ this.salesErrorData[i]["Box_Piece__c"] = this.salesErrorData[i].orderdetails2.Box_Piece__c;
+ this.salesErrorData[i]["Bar_Code__c"] = this.salesErrorData[i].orderdetails2.Bar_Code__c;
+ this.salesErrorData[i]["Sterilization_limit__c"] = this.salesErrorData[i].orderdetails2.Sterilization_limit__c;
+ }
+ console.log('this.salesData = ' + JSON.stringify(this.salesData));
+ for (var i in this.salesData) {
+ this.salesData[i]["Id"] = this.salesData[i].orderdetails2.Id;
+ this.salesData[i]["Consumable_order_minor__c"] = this.salesData[i].orderdetails2.Consumable_order_minor__r != null ? this.salesData[i].orderdetails2.Consumable_order_minor__r.Name : '';
+ this.salesData[i]["ConsumableorderminorUrl"] = this.salesData[i].orderdetails2.Consumable_order_minor__c != null ? "/" + this.salesData[i].orderdetails2.Consumable_order_minor__c : '';
+ this.salesData[i]["orderdetails2Name"] = this.salesData[i].orderdetails2.Name;
+ this.salesData[i]["orderdetails2NameUrl"] = "/" + this.salesData[i].orderdetails2.Id;
+ this.salesData[i]["Box_Piece__c"] = this.salesData[i].orderdetails2.Box_Piece__c;
+ this.salesData[i]["ProdName"] = this.salesData[i].Prod.Name;
+ this.salesData[i]["Deliver_date__c"] = this.salesData[i].orderdetails2.Deliver_date__c;
+ this.salesData[i]["Bar_Code__c"] = this.salesData[i].orderdetails2.Bar_Code__c;
+ this.salesData[i]["Sterilization_limit__c"] = this.salesData[i].orderdetails2.Sterilization_limit__c;
+ if (this.salesData[i]["Box_Piece__c"] == '鐩�') {
+ console.log('this.salesData[i] = ' + JSON.stringify(this.salesData[i]))
+ this.salesData[i]["outboundCount"] = this.salesData[i].outboundCount;
+ } else {
+ for (var j in this.salesOrderdetails) {
+ console.log('this.salesOrderdetails[j].Consumable_product__c = ' + this.salesOrderdetails[j].Consumable_product__c);
+ console.log('this.salesData[i].orderdetails2.Consumable_product__c = ' + this.salesData[i].orderdetails2.Consumable_product__c);
+ if (this.salesOrderdetails[j].Consumable_product__c == this.salesData[i].orderdetails2.Consumable_product__c) {
+ this.salesData[i]["outboundCount"] = this.salesOrderdetails[j].Shipment_Count__c;
}
}
-
- //salescolomus
- // console.log('this.salesData[i]["Box_Piece__c"] = ' + this.salesData[i]["Box_Piece__c"])
- // if (this.salesData[i]["Box_Piece__c"] == '鐩�') {
- // this.salesData[i]["isDisable"] = true;
- // this.salesData[i]["count"] = this.salesData[i].outboundCount;
- // }
- // if (this.salesData[i]["Box_Piece__c"] == '涓�') {
- // this.salesData[i]["isDisable"] = false;
- // }
}
- this.salesColumns = [...this.salesColumns];
- this.isShowSpinner = false;
- } else {
- console.log('r.msg = ' + r.msg);
- this.showMyToast('鑾峰彇澶辫触', r.msg, 'Error');
+
+ //salescolomus
+ // console.log('this.salesData[i]["Box_Piece__c"] = ' + this.salesData[i]["Box_Piece__c"])
+ // if (this.salesData[i]["Box_Piece__c"] == '鐩�') {
+ // this.salesData[i]["isDisable"] = true;
+ // this.salesData[i]["count"] = this.salesData[i].outboundCount;
+ // }
+ // if (this.salesData[i]["Box_Piece__c"] == '涓�') {
+ // this.salesData[i]["isDisable"] = false;
+ // }
}
- })
- .catch((error) => {
- console.log('error = ' + JSON.stringify(error.message));
- });
+ this.salesColumns = [...this.salesColumns];
+ this.isShowSpinner = false;
+ } else {
+ console.log("r.msg = " + r.msg);
+ this.showMyToast('鑾峰彇澶辫触', r.msg, 'Error');
+ }
+ }).catch((error) => {
+ console.log("error = " + JSON.stringify(error.message));
+ });
}
handleOutboundCount(event) {
let outboundDetail = event.detail;
for (var i in this.salesData) {
if (this.salesData[i].Id == outboundDetail.data.recordId) {
- this.salesData[i]['outboundCount'] = outboundDetail.data.count;
+ this.salesData[i]['outboundCount'] = outboundDetail.data.count
}
}
- console.log('this.salesData = ' + JSON.stringify(this.salesData));
+ console.log('this.salesData = ' + JSON.stringify(this.salesData))
}
SaveP() {
@@ -2627,7 +2196,7 @@
delete cloneSalesData[i].Deliver_date__c;
delete cloneSalesData[i].Bar_Code__c;
delete cloneSalesData[i].Sterilization_limit__c;
- cloneSalesData[i]['ErrorReason'] = '';
+ cloneSalesData[i]["ErrorReason"] = "";
}
this.isShowSpinner = true;
ProSale({
@@ -2639,29 +2208,27 @@
consumableorderdetailsRecordsLwc: JSON.stringify(cloneSalesData),
orderdetailsLwc: this.salesOrderdetails,
orderpriceMapLwc: this.salesOrderpriceMap,
- orderagencypriceMapLwc: this.salesOrderagencypriceMap
- })
- .then((r) => {
- r = JSON.parse(JSON.stringify(r));
- console.log('r = ' + JSON.stringify(r));
- if (r.status == 'Success') {
- console.log('ProdElivery success');
- this.isShowSpinner = false;
- this[NavigationMixin.Navigate]({
- type: 'standard__webPage',
- attributes: {
- url: '/lexsaleanddelivery'
- }
- });
- } else {
- console.log('r.msg = ' + r.msg);
- this.showMyToast('閿�鍞け璐�', r.msg, 'Error');
- }
- })
- .catch((error) => {
- console.log('error = ' + JSON.stringify(error.message));
- this.showMyToast('閿欒', '閿�鍞け璐�', 'Error');
- });
+ orderagencypriceMapLwc: this.salesOrderagencypriceMap,
+ }).then((r) => {
+ r = JSON.parse(JSON.stringify(r));
+ console.log("r = " + JSON.stringify(r));
+ if (r.status == "Success") {
+ console.log("ProdElivery success");
+ this.isShowSpinner = false;
+ this[NavigationMixin.Navigate]({
+ type: "standard__webPage",
+ attributes: {
+ url: "/lexsaleanddelivery",
+ },
+ });
+ } else {
+ console.log("r.msg = " + r.msg);
+ this.showMyToast('閿�鍞け璐�', r.msg, 'Error');
+ }
+ }).catch((error) => {
+ console.log("error = " + JSON.stringify(error.message));
+ this.showMyToast('閿欒', '閿�鍞け璐�', 'Error');
+ });
}
SaveE() {
@@ -2675,7 +2242,7 @@
delete cloneSalesData[i].Deliver_date__c;
delete cloneSalesData[i].Bar_Code__c;
delete cloneSalesData[i].Sterilization_limit__c;
- cloneSalesData[i]['ErrorReason'] = '';
+ cloneSalesData[i]["ErrorReason"] = "";
}
this.isShowSpinner = true;
ProdElivery({
@@ -2687,29 +2254,27 @@
consumableorderdetailsRecordsLwc: JSON.stringify(cloneSalesData),
orderdetailsLwc: this.salesOrderdetails,
orderpriceMapLwc: this.salesOrderpriceMap,
- orderagencypriceMapLwc: this.salesOrderagencypriceMap
- })
- .then((r) => {
- r = JSON.parse(JSON.stringify(r));
- console.log('r = ' + JSON.stringify(r));
- if (r.status == 'Success') {
- console.log('ProdElivery success');
- this.isShowSpinner = false;
- this[NavigationMixin.Navigate]({
- type: 'standard__webPage',
- attributes: {
- url: '/lexsaleanddelivery'
- }
- });
- } else {
- console.log('r.msg = ' + r.msg);
- this.showMyToast('鍑鸿揣澶辫触', r.msg, 'Error');
- }
- })
- .catch((error) => {
- console.log('error = ' + JSON.stringify(error.message));
- this.showMyToast('閿欒', '鍑鸿揣澶辫触', 'Error');
- });
+ orderagencypriceMapLwc: this.salesOrderagencypriceMap,
+ }).then((r) => {
+ r = JSON.parse(JSON.stringify(r));
+ console.log("r = " + JSON.stringify(r));
+ if (r.status == "Success") {
+ console.log("ProdElivery success");
+ this.isShowSpinner = false;
+ this[NavigationMixin.Navigate]({
+ type: "standard__webPage",
+ attributes: {
+ url: "/lexsaleanddelivery",
+ },
+ });
+ } else {
+ console.log("r.msg = " + r.msg);
+ this.showMyToast('鍑鸿揣澶辫触', r.msg, 'Error');
+ }
+ }).catch((error) => {
+ console.log("error = " + JSON.stringify(error.message));
+ this.showMyToast('閿欒', '鍑鸿揣澶辫触', 'Error');
+ });
}
//鍙戠エ
@@ -2717,17 +2282,9 @@
let url = '';
console.log('this.invoiceId = ' + this.invoiceId);
if (this.invoiceId.length > 0 && this.invoiceId != '000000000000000') {
- url =
- '/s/lexconinvoiceview?deliveryId=' +
- this.ESetid +
- '&invoiceId=' +
- this.invoiceId +
- '&KeyWords=Redirect';
+ url = "/s/lexconinvoiceview?deliveryId=" + this.ESetid + "&invoiceId=" + this.invoiceId + "&KeyWords=Redirect";
} else {
- url =
- '/s/lexconinvoiceview?deliveryId=' +
- this.ESetid +
- '&KeyWords=Redirect';
+ url = "/s/lexconinvoiceview?deliveryId=" + this.ESetid + "&KeyWords=Redirect";
}
window.open(url);
// this[NavigationMixin.Navigate]({
@@ -2743,36 +2300,33 @@
DeleteConsumable() {
this.isShowSpinner = true;
DelConsumable({
- ESetId: this.ESetid
- })
- .then((r) => {
- r = JSON.parse(JSON.stringify(r));
- console.log('r = ' + JSON.stringify(r));
- if (r.status == 'Success') {
- let url = '/lexsaleanddelivery';
- this[NavigationMixin.Navigate]({
- type: 'standard__webPage',
- attributes: {
- url: url
- }
- });
- } else {
- console.log('r.msg = ' + r.msg);
- this.showMyToast('鍒犻櫎澶辫触', r.msg, 'Error');
- }
- })
- .catch((error) => {
- console.log('error = ' + error.message);
- this.showMyToast('閿欒', '鍒犻櫎澶辫触', 'Error');
- });
+ ESetId: this.ESetid,
+ }).then((r) => {
+ r = JSON.parse(JSON.stringify(r));
+ console.log("r = " + JSON.stringify(r));
+ if (r.status == "Success") {
+ let url = "/lexsaleanddelivery";
+ this[NavigationMixin.Navigate]({
+ type: "standard__webPage",
+ attributes: {
+ url: url,
+ },
+ });
+ } else {
+ console.log("r.msg = " + r.msg);
+ this.showMyToast('鍒犻櫎澶辫触', r.msg, 'Error');
+ }
+ }).catch((error) => {
+ console.log("error = " + error.message);
+ this.showMyToast('閿欒', '鍒犻櫎澶辫触', 'Error');
+ });
}
handleLoad() {
- console.log('handleLoad');
+ console.log('handleLoad')
try {
const style = document.createElement('style');
- style.innerText =
- '.hehe-layoutItem .slds-button__icon {display: none;}';
+ style.innerText = '.hehe-layoutItem .slds-button__icon {display: none;}';
this.template.querySelector('.hideHelpText').appendChild(style);
} catch (error) {
console.log(error);
@@ -2780,16 +2334,14 @@
}
handleLoad2() {
- console.log('handleLoad2');
+ console.log('handleLoad2')
try {
const style = document.createElement('style');
- style.innerText =
- '.hehe-layoutItem .slds-button__icon {display: none;}';
+ style.innerText = '.hehe-layoutItem .slds-button__icon {display: none;}';
this.template.querySelector('.hideHelpText').appendChild(style);
const style2 = document.createElement('style');
- style2.innerText =
- '.hehe-layoutItem .slds-form-element__label {padding : 0px}';
+ style2.innerText = '.hehe-layoutItem .slds-form-element__label {padding : 0px}';
this.template.querySelector('.hideHelpText').appendChild(style2);
} catch (error) {
console.log(error);
@@ -2797,13 +2349,12 @@
}
//缂栬緫鍑哄簱鍗�
EditConsumable() {
- let url =
- '/lexsummonscreat?ESetid=' + this.ESetid + '&KeyWords=Redirect';
+ let url = "/lexsummonscreat?ESetid=" + this.ESetid + "&KeyWords=Redirect";
this[NavigationMixin.Navigate]({
- type: 'standard__webPage',
+ type: "standard__webPage",
attributes: {
- url: url
- }
+ url: url,
+ },
});
}
@@ -2823,11 +2374,7 @@
//鏄惁鏄剧ず闄勪欢绉婚櫎
get attDelBtn() {
- if (
- this.fileName != '' &&
- this.fileName != null &&
- this.fileName != '璇烽�夋嫨涓�涓枃浠朵笂浼�'
- ) {
+ if (this.fileName != '' && this.fileName != null && this.fileName != '璇烽�夋嫨涓�涓枃浠朵笂浼�') {
return true;
} else {
return false;
@@ -2858,11 +2405,11 @@
sortBy(field, reverse, primer) {
const key = primer
? function (x) {
- return primer(x[field]);
- }
+ return primer(x[field]);
+ }
: function (x) {
- return x[field];
- };
+ return x[field];
+ };
return function (a, b) {
a = key(a);
@@ -2872,17 +2419,14 @@
}
onHandleSort(event) {
+
//灏嗗凡缁忛�夊ソ浜嗙殑鏀惧埌鍓嶉潰锛屼笉杩涜鎺掑簭
if (this.EditAble) {
const { fieldName: sortedBy, sortDirection } = event.detail;
const cloneData = [...this.data];
- cloneData.sort(
- this.sortBy(sortedBy, sortDirection === 'asc' ? 1 : -1)
- );
+ cloneData.sort(this.sortBy(sortedBy, sortDirection === 'asc' ? 1 : -1));
let index = 0;
- let selectedRows = this.template
- .querySelector('c-lex-custom-lightning-datatable')
- .getSelectedRows();
+ let selectedRows = this.template.querySelector('c-lex-custom-lightning-datatable').getSelectedRows();
let selectedRowsIds = [];
for (var i in selectedRows) {
selectedRowsIds.push(selectedRows[i].Id);
@@ -2904,9 +2448,7 @@
} else {
const { fieldName: sortedBy, sortDirection } = event.detail;
const cloneData = [...this.editData];
- cloneData.sort(
- this.sortBy(sortedBy, sortDirection === 'asc' ? 1 : -1)
- );
+ cloneData.sort(this.sortBy(sortedBy, sortDirection === 'asc' ? 1 : -1));
this.editData = cloneData;
this.sortDirection = sortDirection;
this.sortedBy = sortedBy;
@@ -2914,14 +2456,12 @@
}
handlePrevious() {
- this.currentPageToken =
- Number(this.currentPageToken) - Number(this.pageSize);
+ this.currentPageToken = Number(this.currentPageToken) - Number(this.pageSize);
this.searchProductJs();
}
handleNext() {
- this.currentPageToken =
- Number(this.currentPageToken) + Number(this.pageSize);
+ this.currentPageToken = Number(this.currentPageToken) + Number(this.pageSize);
this.searchProductJs();
}
handleFirst() {
@@ -2930,8 +2470,7 @@
}
handleLast() {
- this.currentPageToken =
- this.totalPages > 1 ? (this.totalPages - 1) * this.pageSize : 0;
+ this.currentPageToken = this.totalPages > 1 ? (this.totalPages - 1) * this.pageSize : 0;
this.searchProductJs();
}
@@ -2942,15 +2481,15 @@
this.searchProductJs();
}
+
+
editHandlePrevious() {
- this.currentPageToken =
- Number(this.currentPageToken) - Number(this.pageSize);
+ this.currentPageToken = Number(this.currentPageToken) - Number(this.pageSize);
this.searchEditProductJs();
}
editHandleNext() {
- this.currentPageToken =
- Number(this.currentPageToken) + Number(this.pageSize);
+ this.currentPageToken = Number(this.currentPageToken) + Number(this.pageSize);
this.searchEditProductJs();
}
editHandleFirst() {
@@ -2959,8 +2498,7 @@
}
editHandleLast() {
- this.currentPageToken =
- this.totalPages > 1 ? (this.totalPages - 1) * this.pageSize : 0;
+ this.currentPageToken = this.totalPages > 1 ? (this.totalPages - 1) * this.pageSize : 0;
this.searchEditProductJs();
}
@@ -2979,80 +2517,51 @@
statusEdit: this.statusEdit,
pageSizeLWC: this.pageSize,
pageTokenLWC: this.currentPageToken
- })
- .then((r) => {
- r = JSON.parse(JSON.stringify(r));
- console.log('r = ' + JSON.stringify(r));
- if (r.status == 'Success') {
- //鍒嗛〉
- console.log(
- 'r.entity.paginatedAccounts = ' +
- JSON.stringify(r.entity.paginatedAccounts)
- );
- this.nextPageToken =
- r.entity.paginatedAccounts.nextPageToken;
- this.totalRecords = r.entity.paginatedAccounts.totalRecords;
- this.recordStart = r.entity.paginatedAccounts.recordStart;
- this.recordEnd = r.entity.paginatedAccounts.recordEnd;
- this.totalPages = Math.ceil(
- r.entity.paginatedAccounts.totalRecords / this.pageSize
- );
- console.log('this.totalPages = ' + this.totalPages);
+ }).then((r) => {
+ r = JSON.parse(JSON.stringify(r));
+ console.log("r = " + JSON.stringify(r));
+ if (r.status == "Success") {
+ //鍒嗛〉
+ console.log('r.entity.paginatedAccounts = ' + JSON.stringify(r.entity.paginatedAccounts));
+ this.nextPageToken = r.entity.paginatedAccounts.nextPageToken;
+ this.totalRecords = r.entity.paginatedAccounts.totalRecords;
+ this.recordStart = r.entity.paginatedAccounts.recordStart;
+ this.recordEnd = r.entity.paginatedAccounts.recordEnd;
+ this.totalPages = Math.ceil(r.entity.paginatedAccounts.totalRecords / this.pageSize);
+ console.log('this.totalPages = ' + this.totalPages);
- this.editData = r.entity.pageRecords;
- console.log(
- 'this.data start = ' + JSON.stringify(this.data)
- );
- for (var i in this.editData) {
- this.editData[i]['unitValue'] =
- this.editData[i]['unitValue'];
- this.editData[i]['InvoiceProNot_count__c'] =
- this.editData[
- i
- ].orderdetails1.InvoiceProNot_count__c;
- this.editData[i]['RrturnPro_count__c'] =
- this.editData[i].orderdetails1.RrturnPro_count__c;
- this.editData[i]['Invoiced_Procount__c'] =
- this.editData[i].orderdetails1.Invoiced_Procount__c;
- this.editData[i]['shipmentNumber'] =
- this.editData[i].orderdetails1['Shipment_Count__c'];
- this.editData[i]['shippingUnitPrice'] =
- this.editData[i].orderdetails1[
- 'Delivery_List_RMB__c'
- ];
+ this.editData = r.entity.pageRecords;
+ console.log("this.data start = " + JSON.stringify(this.data));
+ for (var i in this.editData) {
+ this.editData[i]["unitValue"] = this.editData[i]["unitValue"];
+ this.editData[i]["InvoiceProNot_count__c"] = this.editData[i].orderdetails1.InvoiceProNot_count__c;
+ this.editData[i]["RrturnPro_count__c"] = this.editData[i].orderdetails1.RrturnPro_count__c;
+ this.editData[i]["Invoiced_Procount__c"] = this.editData[i].orderdetails1.Invoiced_Procount__c;
+ this.editData[i]["shipmentNumber"] = this.editData[i].orderdetails1["Shipment_Count__c"];
+ this.editData[i]["shippingUnitPrice"] = this.editData[i].orderdetails1["Delivery_List_RMB__c"];
- this.editData[i]['recordId'] = this.editData[i].Prod.Id;
- this.editData[i]['Id'] = this.editData[i].Prod.Id;
- this.editData[i]['Name__c'] =
- this.editData[i].Prod.Name__c;
- this.editData[i]['SFDA_Status__c'] =
- this.editData[i].Prod.SFDA_Status__c;
- this.editData[i]['Category3__c'] =
- this.editData[i].Prod.Category3__c;
- this.editData[i]['Category4__c'] =
- this.editData[i].Prod.Category4__c;
- this.editData[i]['Category5__c'] =
- this.editData[i].Prod.Category5__c;
- this.editData[i]['Box_Piece__c'] =
- this.editData[i].orderdetails1.Box_Piece__c;
- this.editData[i]['shipmentAmount'] =
- this.editData[i].orderdetails1.Shipment_amount__c;
- //this.editData[i]["Shipment_amount__c"] = this.editData[i].orderdetails1.Shipment_amount__c;
- this.editData[i]['Delivery_List_RMB__c'] =
- this.editData[i].orderdetails1.Delivery_List_RMB__c;
- this.editData[i]['Shipment_Count__c'] =
- this.editData[i].orderdetails1.Shipment_Count__c;
- }
- this.showTable = true;
- this.isEditShowSpinner = false;
- } else {
- console.log('r = ' + JSON.stringify(r));
- this.showMyToast('鎼滅储澶辫触', r.msg, 'Error');
+ this.editData[i]["recordId"] = this.editData[i].Prod.Id;
+ this.editData[i]["Id"] = this.editData[i].Prod.Id;
+ this.editData[i]["Name__c"] = this.editData[i].Prod.Name__c;
+ this.editData[i]["SFDA_Status__c"] = this.editData[i].Prod.SFDA_Status__c;
+ this.editData[i]["Category3__c"] = this.editData[i].Prod.Category3__c;
+ this.editData[i]["Category4__c"] = this.editData[i].Prod.Category4__c;
+ this.editData[i]["Category5__c"] = this.editData[i].Prod.Category5__c;
+ this.editData[i]["Box_Piece__c"] = this.editData[i].orderdetails1.Box_Piece__c;
+ this.editData[i]["shipmentAmount"] = this.editData[i].orderdetails1.Shipment_amount__c;
+ //this.editData[i]["Shipment_amount__c"] = this.editData[i].orderdetails1.Shipment_amount__c;
+ this.editData[i]["Delivery_List_RMB__c"] = this.editData[i].orderdetails1.Delivery_List_RMB__c;
+ this.editData[i]["Shipment_Count__c"] = this.editData[i].orderdetails1.Shipment_Count__c;
}
- })
- .catch((error) => {
- this.showMyToast('閿欒', '鎼滅储澶辫触', 'Error');
- });
+ this.showTable = true;
+ this.isEditShowSpinner = false;
+ } else {
+ console.log("r = " + JSON.stringify(r));
+ this.showMyToast('鎼滅储澶辫触', r.msg, 'Error');
+ }
+ }).catch((error) => {
+ this.showMyToast('閿欒', '鎼滅储澶辫触', 'Error');
+ });
}
get previousButtonDisabled() {
@@ -3067,22 +2576,20 @@
deleteAtt(event) {
this.isShowSpinner = true;
//var recordId = event.detail.data.recordId;
- var recordId = event.target.getAttribute('data-fileid');
+ var recordId = event.target.getAttribute("data-fileid");
console.log('attid:' + recordId);
deleteAtt({
contentVersionId: recordId
+ }).then(r => {
+ r = JSON.parse(JSON.stringify(r));
+ if (r.status == "Success") {
+ this.showMyToast('鍒犻櫎鎴愬姛', '', 'Success');
+ this.getFiles();
+ } else {
+ this.showMyToast('鍒犻櫎澶辫触', r.msg, 'Error');
+ }
+ }).catch(error => {
+ this.showMyToast('閿欒', error.message, 'Error');
})
- .then((r) => {
- r = JSON.parse(JSON.stringify(r));
- if (r.status == 'Success') {
- this.showMyToast('鍒犻櫎鎴愬姛', '', 'Success');
- this.getFiles();
- } else {
- this.showMyToast('鍒犻櫎澶辫触', r.msg, 'Error');
- }
- })
- .catch((error) => {
- this.showMyToast('閿欒', error.message, 'Error');
- });
}
-}
+}
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexTopPage/lexTopPage.html b/force-app/main/default/lwc/lexTopPage/lexTopPage.html
index fbd71f0..2f6a06d 100644
--- a/force-app/main/default/lwc/lexTopPage/lexTopPage.html
+++ b/force-app/main/default/lwc/lexTopPage/lexTopPage.html
@@ -308,4 +308,4 @@
<div class="slds-backdrop slds-backdrop_open"></div>
</template>
</template>
-</template>
+</template>
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexTopPage/lexTopPage.js b/force-app/main/default/lwc/lexTopPage/lexTopPage.js
index 88ffbbb..7ecdcc9 100644
--- a/force-app/main/default/lwc/lexTopPage/lexTopPage.js
+++ b/force-app/main/default/lwc/lexTopPage/lexTopPage.js
@@ -650,15 +650,11 @@
editProductLimit(event) {
//add by Wang Xueqin 2023/05/05
//let url =
- // '/LexProductLimitEdit?accountid=' +
- // this.accountId +
- // '&userPro_Type=' +
- // this.userPro_Type;
- let url =
- '/lexproductlimitedit?accountid=' +
- this.accountId +
- '&userPro_Type=' +
- this.userPro_Type;
+ // '/LexProductLimitEdit?accountid=' +
+ // this.accountId +
+ // '&userPro_Type=' +
+ // this.userPro_Type;
+ let url = "/lexproductlimitedit?accountid=" + this.accountId + "&userPro_Type=" + this.userPro_Type;
const config = {
type: 'standard__webPage',
attributes: {
@@ -797,4 +793,4 @@
get nextButtonDisabled() {
return this.nextPageToken === undefined;
}
-}
+}
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexinventoryViewLWC/lexinventoryViewLWC.css b/force-app/main/default/lwc/lexinventoryViewLWC/lexinventoryViewLWC.css
index 4547f7c..285f443 100644
--- a/force-app/main/default/lwc/lexinventoryViewLWC/lexinventoryViewLWC.css
+++ b/force-app/main/default/lwc/lexinventoryViewLWC/lexinventoryViewLWC.css
@@ -1,16 +1,16 @@
@import 'c/lexCssUtility';
-.lexButtoun {
+.lexButtoun{
font-size: 18px;
font-family: 'sans-serif';
- font-weight: 500;
- color: #0a81df;
+ font-weight:500;
+ color:#0A81DF;
/* border:2px solid rgb(8,16,132); */
/* border-color:rgb(8,16,132); */
width: 160px;
height: 36px;
border-radius: 4px;
opacity: 1;
- background: #ffffff;
+ background: #FFFFFF;
box-sizing: border-box;
- border: 1px solid #0a81df;
-}
+ border:1px solid #0A81DF;
+}
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexinventoryViewLWC/lexinventoryViewLWC.html b/force-app/main/default/lwc/lexinventoryViewLWC/lexinventoryViewLWC.html
index 90057ad..f226a76 100644
--- a/force-app/main/default/lwc/lexinventoryViewLWC/lexinventoryViewLWC.html
+++ b/force-app/main/default/lwc/lexinventoryViewLWC/lexinventoryViewLWC.html
@@ -267,7 +267,7 @@
sorted-by={sortedBy}
onsort={onHandleSort}
hide-checkbox-column={hidecheckboxcolumn}
- style="word-wrap: break-word; word-break: break-all"
+ style="word-wrap:break-word; word-break:break-all;"
class="wrapped-header-datatable"
>
</c-lex-custom-lightning-datatable>
@@ -279,6 +279,7 @@
onfirst={handleFirst}
onlast={handleLast}
page-size-options={pageSizeOptions}
+ default-page-size={pageSize}
previous-button-disabled={previousButtonDisabled}
next-button-disabled={nextButtonDisabled}
record-start={recordStart}
@@ -289,4 +290,4 @@
</div>
</div>
</div>
-</template>
+</template>
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexinventoryViewLWC/lexinventoryViewLWC.js b/force-app/main/default/lwc/lexinventoryViewLWC/lexinventoryViewLWC.js
index 484c5da..0b082e5 100644
--- a/force-app/main/default/lwc/lexinventoryViewLWC/lexinventoryViewLWC.js
+++ b/force-app/main/default/lwc/lexinventoryViewLWC/lexinventoryViewLWC.js
@@ -15,7 +15,7 @@
//鍒嗛〉start
@track sortBy = '';
//@track sortDirection = "asc";
- @track pageSize = 10;
+ @track pageSize = 200;
error;
records;
currentPageToken = 0;
@@ -25,7 +25,7 @@
@track pageNumber = 1;
@track paginationVisibility = false;
@track totalPages = 1;
- pageSizeOptions = [10, 25, 50, 100];
+ pageSizeOptions = [100, 200, 300];
@track recordStart = 0;
@track recordEnd = 0;
//end
@@ -723,4 +723,4 @@
.querySelector('c-common-toast')
.showToast(variant, content, iconName, 10000);
}
-}
+}
\ No newline at end of file
diff --git a/force-app/main/default/lwc/paginator/paginator.html b/force-app/main/default/lwc/paginator/paginator.html
index 3add3b3..d5faa66 100644
--- a/force-app/main/default/lwc/paginator/paginator.html
+++ b/force-app/main/default/lwc/paginator/paginator.html
@@ -6,8 +6,8 @@
<label class="slds-text-color_weak slds-p-horizontal_x-small" for="recordsPerPage">Page Size:</label>
<div class="slds-select_container">
<select class="slds-select" id="recordsPerPage" onchange={handleRecordsPerPage}>
- <template for:each={pageSizeOptions} for:item="option">
- <option key={option} value={option}>{option}</option>
+ <template for:each={pageOptionsList} for:item="option">
+ <option key={option.value} value={option.value} selected={option.select}>{option.value}</option>
</template>
</select>
</div>
diff --git a/force-app/main/default/lwc/paginator/paginator.js b/force-app/main/default/lwc/paginator/paginator.js
index 290042f..ec41f0b 100644
--- a/force-app/main/default/lwc/paginator/paginator.js
+++ b/force-app/main/default/lwc/paginator/paginator.js
@@ -1,4 +1,4 @@
-import { LightningElement, api } from 'lwc';
+import { LightningElement, api ,track} from 'lwc';
export default class Paginator extends LightningElement {
@api previousButtonDisabled;
@@ -7,6 +7,19 @@
@api recordEnd;
@api totalRecords;
@api pageSizeOptions;
+ @track pageOptionsList = [];
+ @api defaultPageSize;
+
+ connectedCallback(){
+ // this.defaultPageSize = 200;
+ for(var i = 0; i < this.pageSizeOptions.length; i++){
+ var iselect = false;
+ if(this.defaultPageSize != null && this.pageSizeOptions[i] == this.defaultPageSize){
+ iselect = true;
+ }
+ this.pageOptionsList.push({value : this.pageSizeOptions[i], select : iselect});
+ }
+ }
handlePrevious() {
this.dispatchEvent(new CustomEvent('previous'));
diff --git a/force-app/main/default/objects/LicenceReminderDate__c/LicenceReminderDate__c.object-meta.xml b/force-app/main/default/objects/LicenceReminderDate__c/LicenceReminderDate__c.object-meta.xml
index ceabf9e..e948f19 100644
--- a/force-app/main/default/objects/LicenceReminderDate__c/LicenceReminderDate__c.object-meta.xml
+++ b/force-app/main/default/objects/LicenceReminderDate__c/LicenceReminderDate__c.object-meta.xml
@@ -1,4 +1,4 @@
-<?xml version="1.0" encoding="UTF-8" ?>
+<?xml version="1.0" encoding="UTF-8"?>
<CustomObject xmlns="http://soap.sforce.com/2006/04/metadata">
<customSettingsType>List</customSettingsType>
<description>LEX Upgrade</description>
diff --git a/force-app/main/default/objects/LicenceReminderDate__c/fields/ReminderDays__c.field-meta.xml b/force-app/main/default/objects/LicenceReminderDate__c/fields/ReminderDays__c.field-meta.xml
index 7bb7f48..98ff6d1 100644
--- a/force-app/main/default/objects/LicenceReminderDate__c/fields/ReminderDays__c.field-meta.xml
+++ b/force-app/main/default/objects/LicenceReminderDate__c/fields/ReminderDays__c.field-meta.xml
@@ -1,4 +1,4 @@
-<?xml version="1.0" encoding="UTF-8" ?>
+<?xml version="1.0" encoding="UTF-8"?>
<CustomField xmlns="http://soap.sforce.com/2006/04/metadata">
<fullName>ReminderDays__c</fullName>
<externalId>false</externalId>
diff --git a/force-app/main/default/objects/NoteStay__c/NoteStay__c.object-meta.xml b/force-app/main/default/objects/NoteStay__c/NoteStay__c.object-meta.xml
index 5cd4961..d568636 100644
--- a/force-app/main/default/objects/NoteStay__c/NoteStay__c.object-meta.xml
+++ b/force-app/main/default/objects/NoteStay__c/NoteStay__c.object-meta.xml
@@ -1,4 +1,4 @@
-<?xml version="1.0" encoding="UTF-8" ?>
+<?xml version="1.0" encoding="UTF-8"?>
<CustomObject xmlns="http://soap.sforce.com/2006/04/metadata">
<customSettingsType>List</customSettingsType>
<enableFeeds>false</enableFeeds>
diff --git a/force-app/main/default/objects/NoteStay__c/fields/IsStay__c.field-meta.xml b/force-app/main/default/objects/NoteStay__c/fields/IsStay__c.field-meta.xml
index 38d9d12..b9acfb8 100644
--- a/force-app/main/default/objects/NoteStay__c/fields/IsStay__c.field-meta.xml
+++ b/force-app/main/default/objects/NoteStay__c/fields/IsStay__c.field-meta.xml
@@ -1,4 +1,4 @@
-<?xml version="1.0" encoding="UTF-8" ?>
+<?xml version="1.0" encoding="UTF-8"?>
<CustomField xmlns="http://soap.sforce.com/2006/04/metadata">
<fullName>IsStay__c</fullName>
<defaultValue>false</defaultValue>
diff --git a/force-app/main/default/pages/DealerInquiryModifyState.page b/force-app/main/default/pages/DealerInquiryModifyState.page
index 4fc33f6..a8a3245 100644
--- a/force-app/main/default/pages/DealerInquiryModifyState.page
+++ b/force-app/main/default/pages/DealerInquiryModifyState.page
@@ -1,338 +1,169 @@
-<apex:page
- controller="DealerInquiryModifyStateController"
- docType="html-5.0"
- showHeader="false"
- sidebar="false"
- id="allPage"
- action="{!init}"
- lightningStyleSheets="true"
->
- <head>
- <title>缁忛攢鍟嗘壒閲忎慨鏀硅浠风姸鎬�</title>
+<apex:page controller="DealerInquiryModifyStateController" docType="html-5.0" showHeader="false" sidebar="false" id="allPage" action="{!init}" lightningStyleSheets="true">
+<head>
+<title>缁忛攢鍟嗘壒閲忎慨鏀硅浠风姸鎬�</title>
- <apex:stylesheet value="{!URLFOR($Resource.blockUIcssOpp)}" />
- <apex:includeScript value="{!URLFOR($Resource.jquery183minjs)}" />
- <apex:includeScript value="{!URLFOR($Resource.PleaseWaitDialog)}" />
- <!-- TODO 鐩墠闄や簡markOpp()鏂规硶锛屽叾浠栨柟娉曢�氱敤锛宩s鏀瑰悕涓哄懆浼氬叡閫歫s锛屽悇涓敾闈釜鍒玧s鍐嶈嚜宸卞垱寤簀s -->
- <apex:includeScript value="{!URLFOR($Resource.Dealer_enquiryJs1)}" />
+<apex:stylesheet value="{!URLFOR($Resource.blockUIcssOpp)}"/>
+<apex:includeScript value="{!URLFOR($Resource.jquery183minjs)}"/>
+<apex:includeScript value="{!URLFOR($Resource.PleaseWaitDialog)}"/>
+<!-- TODO 鐩墠闄や簡markOpp()鏂规硶锛屽叾浠栨柟娉曢�氱敤锛宩s鏀瑰悕涓哄懆浼氬叡閫歫s锛屽悇涓敾闈釜鍒玧s鍐嶈嚜宸卞垱寤簀s -->
+<apex:includeScript value="{!URLFOR($Resource.Dealer_enquiryJs1)}"/>
- <style>
- td .dateFormat {
- display: none;
- }
+<style>
+ td .dateFormat {
+ display: none;
+ }
+
+ div.inline { float:left; }
- div.inline {
- float: left;
- }
+ .clearBoth { clear:both; }
- .clearBoth {
- clear: both;
- }
+ div.reportBlock table.list {
+ width:auto;
+ }
- div.reportBlock table.list {
- width: auto;
- }
+ div#out_Div { /* 銇撱亾銇儤銉冦儉銈掓牸绱� */
+ position:relative;
+ overflow: hidden;
+ float:left;
+ width:50% !important;
+ }
- div#out_Div {
- /* 銇撱亾銇儤銉冦儉銈掓牸绱� */
- position: relative;
- overflow: hidden;
- float: left;
- width: 50% !important;
- }
+ div#out_Div_L {
+ position:relative;
+ overflow:hidden;
+ float:left;
+ width:50% !important;
+ border-right:2px solid #808383
+ }
- div#out_Div_L {
- position: relative;
- overflow: hidden;
- float: left;
- width: 50% !important;
- border-right: 2px solid #808383;
- }
+ div#in_Div {/* tbody銇屽叆銇c仸銇勩倠銆傘亾銇撱亴銈广偗銉兗銉璞�*/
+ position:relative;
+ overflow: auto; /*銈广偗銉兗銉儛銉�*/
+ float:left;
+ width:50% !important;
+ height: 600px;
+ }
- div#in_Div {
- /* tbody銇屽叆銇c仸銇勩倠銆傘亾銇撱亴銈广偗銉兗銉璞�*/
- position: relative;
- overflow: auto; /*銈广偗銉兗銉儛銉�*/
- float: left;
- width: 50% !important;
- height: 600px;
- }
+ div#in_Div_L {
+ position:relative;
+ overflow-x:auto;
+ overflow-y: hidden;
+ float:left;
+ width:50% !important;
+ height: 600px;
+ border-right:2px solid #808383
+ }
- div#in_Div_L {
- position: relative;
- overflow-x: auto;
- overflow-y: hidden;
- float: left;
- width: 50% !important;
- height: 600px;
- border-right: 2px solid #808383;
- }
+ body .pbBody table.list tr.headerRow td {
+ box-sizing: border-box;
+ text-align:center;font-weight:normal;
+ padding:0px 0px 0px 1px;
+ }
- body .pbBody table.list tr.headerRow td {
- box-sizing: border-box;
- text-align: center;
- font-weight: normal;
- padding: 0px 0px 0px 1px;
- }
+ body .pbBody table.list tr.headerRow td.header1 {
+ text-align:center;font-weight:normal;
+ padding:0px 0px 0px 0px;
+ }
- body .pbBody table.list tr.headerRow td.header1 {
- text-align: center;
- font-weight: normal;
- padding: 0px 0px 0px 0px;
- }
+ body .pbBody table.list tr.dataRow td {
+ box-sizing: border-box;
+ padding:0px 0px 0px 1px; border-width: 0px 0px 1px 0px; vertical-align: middle; word-break:break-all;
+ }
- body .pbBody table.list tr.dataRow td {
- box-sizing: border-box;
- padding: 0px 0px 0px 1px;
- border-width: 0px 0px 1px 0px;
- vertical-align: middle;
- word-break: break-all;
- }
+ body .pbBody table.list tr.dataRow td.dataCellBorder {
+ /* 銇勩倝銇亜銆佷娇銇c仸銇勩仾銇� */
+ padding:0px 0px 0px 1px; border-width: 0px 0px 1px 0px; vertical-align: middle; word-break:break-all;
+ }
- body .pbBody table.list tr.dataRow td.dataCellBorder {
- /* 銇勩倝銇亜銆佷娇銇c仸銇勩仾銇� */
- padding: 0px 0px 0px 1px;
- border-width: 0px 0px 1px 0px;
- vertical-align: middle;
- word-break: break-all;
- }
+ body .pbBody table.list tr.dataRow td.dataCellBorder1 {
+ padding:0px 0px 0px 1px;
+ border-width: 0px 0px 1px 1px; vertical-align: middle; word-break:break-all;
+ }
- body .pbBody table.list tr.dataRow td.dataCellBorder1 {
- padding: 0px 0px 0px 1px;
- border-width: 0px 0px 1px 1px;
- vertical-align: middle;
- word-break: break-all;
- }
+ @-moz-document url-prefix() {
+ body .pbBody table.list tr.dataRow td.dataCellBorder1 {padding:0px 0px 0px 0px; border-width: 0px 0px 1px 1px; vertical-align: middle; word-break:break-all;}
+ }
- @-moz-document url-prefix() {
- body .pbBody table.list tr.dataRow td.dataCellBorder1 {
- padding: 0px 0px 0px 0px;
- border-width: 0px 0px 1px 1px;
- vertical-align: middle;
- word-break: break-all;
- }
- }
+ table.list td {width:100px; }
- table.list td {
- width: 100px;
- }
+ table.list td select {width:95%;}
- table.list td select {
- width: 95%;
- }
+ table.list td input {width:95%;}
- table.list td input {
- width: 95%;
- }
+ table.list td textarea {
+ height:50px;
+ width:90%;
+ }
- table.list td textarea {
- height: 50px;
- width: 90%;
- }
-
- table.list .col_OCSM_Opportunity_No__c {
- width: 120px;
- }
- table.list .col_Strategic_department_Class_Name__c {
- width: 80px;
- }
- table.list .col_Change_To_Opportunity_T__c {
- width: 155px;
- }
- table.list .col_Department_Cateogy__c {
- width: 90px;
- }
- table.list .col_Department_Name_Text__c {
- width: 80px;
- }
- table.list .col_Hospital_City_Master__c {
- width: 70px;
- }
- table.list .col_Agency_Hospital__c {
- width: 146px;
- }
- /*table.list .col_Oly_Forecasted_Date__c {width: 125px;}*/
- table.list .col_Oly_Forecast_this_month__c {
- width: 135px;
- }
- table.list .col_Oly_NM_Forecast__c {
- width: 135px;
- }
- table.list .col_Oly_Forecast_last_month__c {
- width: 135px;
- }
- table.list .col_Oly_Inquiry_Stage__c {
- width: 95px;
- }
- table.list .col_Oly_Authorized_DB_No__c {
- width: 95px;
- }
- table.list .col_Oly_Inquiry_Status2__c {
- width: 95px;
- }
- table.list .col_Oly_Inquiry_Status1__c {
- width: 50px;
- }
- table.list .col_Name {
- width: 139px;
- } /*瀹㈡埛鍚�*/
- table.list .col_Salesdepartment_HP__c {
- width: 95px;
- } /*閿�鍞湰閮�(鍖婚櫌)*/
- table.list .col_State_Master__c {
- width: 80px;
- } /*鐪�*/
- table.list .col_HP_146POCM_Category_From_Dept__c {
- width: 100px;
- } /*OCM鍒嗙被(鍏紡)*/
- table.list .col_Salesdepartment_DeptClass__c {
- width: 120px;
- } /*閿�鍞湰閮�(绉戝鍒嗙被)*/
- table.list .col_OCM_man_province_HP__c {
- width: 90px;
- } /*OCM绠$悊鐪�*/
- table.list .col_City_Master__c {
- width: 80px;
- } /*甯�*/
- table.list .col_Grade__c {
- width: 70px;
- } /*鏀垮簻绛夌骇*/
- table.list .col_Attribute_Type__c {
- width: 90px;
- } /*鍖婚櫌鎵�灞炴�ц川*/
- table.list .col_Speciality_Type__c {
- width: 90px;
- } /*鍖婚櫌涓撲笟鍖哄垎*/
- table.list .col_Service_customer__c {
- width: 120px;
- } /*鍙绾︽湇鍔″悎鍚屽鎴�*/
- table.list .col_BF_owner__c {
- width: 100px;
- } /*鍛煎惛绉戜富鎷呭綋*/
- table.list .col_ENT_owner_ID__c {
- width: 100px;
- } /*鑰抽蓟鍠夌涓绘媴褰�*/
- table.list .col_GI_Main__c {
- width: 100px;
- } /*娑堝寲绉戜富鎷呭綋*/
- table.list .col_URO_owner_ID__c {
- width: 100px;
- } /*娉屽翱绉戜富鎷呭綋*/
- table.list .col_SP_Main__c {
- width: 100px;
- } /*鏅绉戜富鎷呭綋*/
- table.list .col_GYN_owner__c {
- width: 100px;
- } /*濡囩涓绘媴褰�*/
- table.list .col_Hospital_name_link__c {
- width: 100px;
- } /*鍖婚櫌鍚�(閾炬帴)*/
- table.list .col_Segment__c {
- width: 90px;
- } /*OCM绉戝绛夌骇*/
- table.list .col_Department_Budget_Sum_Price__c {
- width: 128px;
- } /*绉戝棰勭畻鎬婚噾棰�(鍏�)*/
- table.list .col_Target_amount_CV290__c {
- width: 118px;
- } /*鐩爣鏁帮細CV-290*/
- table.list .col_OPD_CV290__c {
- width: 118px;
- } /*OPD瀵硅薄锛欳V-290*/
- table.list .col_Target_amount_EUME2__c {
- width: 118px;
- } /*鐩爣鏁帮細EU-ME2*/
- table.list .col_OPD_EUME2__c {
- width: 118px;
- } /*OPD瀵硅薄锛欵U-ME2*/
- table.list .col_Target_amount_CV170__c {
- width: 118px;
- } /*鐩爣鏁帮細CV-170*/
- table.list .col_OPD_CV170__c {
- width: 118px;
- } /*OPD瀵硅薄锛欳V-170*/
- table.list .col_Target_amount_OERAW__c {
- width: 118px;
- } /*鐩爣鏁帮細OER-AW*/
- table.list .col_OPD_OERAW__c {
- width: 118px;
- } /*OPD瀵硅薄锛歄ER-AW*/
- table.list .col_Target_amount_GW__c {
- width: 118px;
- } /*鐩爣鏁帮細瀵间笣(GW)*/
- table.list .col_OPD_GW__c {
- width: 118px;
- } /*OPD瀵硅薄锛氬涓�(GW)*/
- table.list .col_Target_amount_OTVS400__c {
- width: 118px;
- } /*鐩爣鏁帮細OTV-S400*/
- table.list .col_OPD_OTVS400__c {
- width: 118px;
- } /*OPD瀵硅薄锛歄TV-S400*/
- table.list .col_Target_amount_CHS400XZ__c {
- width: 118px;
- } /*鐩爣鏁帮細CH-S400-XZ*/
- table.list .col_OPD_CHS400XZ__c {
- width: 118px;
- } /*OPD瀵硅薄锛欳H-S400-XZ*/
- table.list .col_Target_amount_3D__c {
- width: 118px;
- } /*鐩爣鏁帮細3D*/
- table.list .col_OPD_3D__c {
- width: 118px;
- } /*OPD瀵硅薄锛�3D*/
- table.list .col_Target_amount_OTVS190__c {
- width: 118px;
- } /*鐩爣鏁帮細OTV-S190*/
- table.list .col_OPD_OTVS190__c {
- width: 118px;
- } /*OPD瀵硅薄锛歄TV-S190*/
- table.list .col_Target_amount_CV190__c {
- width: 118px;
- } /*鐩爣鏁帮細CV-190*/
- table.list .col_OPD_CV190__c {
- width: 118px;
- } /*OPD瀵硅薄锛欳V-190*/
- table.list .col_Target_amount_UCES3__c {
- width: 118px;
- } /*鐩爣鏁帮細UCES-3*/
- table.list .col_OPD_UCES3__c {
- width: 118px;
- } /*OPD瀵硅薄锛歎CES-3*/
- table.list .col_Target_amount_USG400__c {
- width: 118px;
- } /*鐩爣鏁帮細USG-400*/
- table.list .col_OPD_USG400__c {
- width: 118px;
- } /*OPD瀵硅薄锛歎SG-400*/
- table.list .col_Hospital_Name__c {
- width: 139px;
- } /*鍖婚櫌鍚�*/
- table.list .col_Department_Name__c {
- width: 60px;
- } /*绉戝鍚嶇О*/
- table.list .col_Province_formula__c {
- width: 78px;
- } /*鐪�(鍏紡)*/
- table.list .col_X2_Largescale_Project__c {
- width: 78px;
- } /****鏈夋棤涓ゅ勾浠ュ唴澶ч」鐩噰璐�*/
- table.list .col_Ideal_Image_Sales__c {
- width: 148px;
- } /****鎷撳睍銉诲紑鎷撹鍒�/钀ラ攢鏂规(閿�鍞�)*/
- table.list .col_Review_Sales__c {
- width: 148px;
- } /****杩涘睍鎯呭喌(閿�鍞�)*/
- table.list .col_Submit_proposal_document__c {
- width: 58px;
- } /*鏄惁鎻愪氦鎻愭涔�*/
- table.list .col_OPP_Flag__c {
- width: 58px;
- }
- table.list .col_Sales_activity_plan__c {
- width: 178px;
- } /*娲诲姩璁″垝(閿�鍞�)*/
- /*table.list .col_Link1 {width:58px;}
+ table.list .col_OCSM_Opportunity_No__c {width:120px;}
+ table.list .col_Strategic_department_Class_Name__c{width:80px;}
+ table.list .col_Change_To_Opportunity_T__c {width:155px;}
+ table.list .col_Department_Cateogy__c {width: 90px;}
+ table.list .col_Department_Name_Text__c {width: 80px;}
+ table.list .col_Hospital_City_Master__c {width: 70px;}
+ table.list .col_Agency_Hospital__c {width: 146px;}
+ /*table.list .col_Oly_Forecasted_Date__c {width: 125px;}*/
+ table.list .col_Oly_Forecast_this_month__c {width: 135px;}
+ table.list .col_Oly_NM_Forecast__c {width: 135px;}
+ table.list .col_Oly_Forecast_last_month__c {width: 135px;}
+ table.list .col_Oly_Inquiry_Stage__c {width: 95px;}
+ table.list .col_Oly_Authorized_DB_No__c {width: 95px;}
+ table.list .col_Oly_Inquiry_Status2__c {width: 95px;}
+ table.list .col_Oly_Inquiry_Status1__c {width: 50px;}
+ table.list .col_Name {width:139px;} /*瀹㈡埛鍚�*/
+ table.list .col_Salesdepartment_HP__c {width:95px;} /*閿�鍞湰閮�(鍖婚櫌)*/
+ table.list .col_State_Master__c{width:80px;} /*鐪�*/
+ table.list .col_HP_146POCM_Category_From_Dept__c {width:100px;} /*OCM鍒嗙被(鍏紡)*/
+ table.list .col_Salesdepartment_DeptClass__c{width:120px;} /*閿�鍞湰閮�(绉戝鍒嗙被)*/
+ table.list .col_OCM_man_province_HP__c{width:90px;} /*OCM绠$悊鐪�*/
+ table.list .col_City_Master__c{width:80px;} /*甯�*/
+ table.list .col_Grade__c {width:70px;} /*鏀垮簻绛夌骇*/
+ table.list .col_Attribute_Type__c{width:90px;} /*鍖婚櫌鎵�灞炴�ц川*/
+ table.list .col_Speciality_Type__c{width:90px;} /*鍖婚櫌涓撲笟鍖哄垎*/
+ table.list .col_Service_customer__c{width:120px;} /*鍙绾︽湇鍔″悎鍚屽鎴�*/
+ table.list .col_BF_owner__c{width:100px;} /*鍛煎惛绉戜富鎷呭綋*/
+ table.list .col_ENT_owner_ID__c{width:100px;} /*鑰抽蓟鍠夌涓绘媴褰�*/
+ table.list .col_GI_Main__c{width:100px;} /*娑堝寲绉戜富鎷呭綋*/
+ table.list .col_URO_owner_ID__c{width:100px;} /*娉屽翱绉戜富鎷呭綋*/
+ table.list .col_SP_Main__c{width:100px;} /*鏅绉戜富鎷呭綋*/
+ table.list .col_GYN_owner__c{width:100px;} /*濡囩涓绘媴褰�*/
+ table.list .col_Hospital_name_link__c{width:100px;} /*鍖婚櫌鍚�(閾炬帴)*/
+ table.list .col_Segment__c{width:90px;} /*OCM绉戝绛夌骇*/
+ table.list .col_Department_Budget_Sum_Price__c {width:128px;} /*绉戝棰勭畻鎬婚噾棰�(鍏�)*/
+ table.list .col_Target_amount_CV290__c {width:118px;} /*鐩爣鏁帮細CV-290*/
+ table.list .col_OPD_CV290__c {width:118px;} /*OPD瀵硅薄锛欳V-290*/
+ table.list .col_Target_amount_EUME2__c {width:118px;} /*鐩爣鏁帮細EU-ME2*/
+ table.list .col_OPD_EUME2__c {width:118px;} /*OPD瀵硅薄锛欵U-ME2*/
+ table.list .col_Target_amount_CV170__c {width:118px;} /*鐩爣鏁帮細CV-170*/
+ table.list .col_OPD_CV170__c {width:118px;} /*OPD瀵硅薄锛欳V-170*/
+ table.list .col_Target_amount_OERAW__c {width:118px;} /*鐩爣鏁帮細OER-AW*/
+ table.list .col_OPD_OERAW__c {width:118px;} /*OPD瀵硅薄锛歄ER-AW*/
+ table.list .col_Target_amount_GW__c {width:118px;} /*鐩爣鏁帮細瀵间笣(GW)*/
+ table.list .col_OPD_GW__c {width:118px;} /*OPD瀵硅薄锛氬涓�(GW)*/
+ table.list .col_Target_amount_OTVS400__c {width:118px;} /*鐩爣鏁帮細OTV-S400*/
+ table.list .col_OPD_OTVS400__c {width:118px;} /*OPD瀵硅薄锛歄TV-S400*/
+ table.list .col_Target_amount_CHS400XZ__c {width:118px;} /*鐩爣鏁帮細CH-S400-XZ*/
+ table.list .col_OPD_CHS400XZ__c {width:118px;} /*OPD瀵硅薄锛欳H-S400-XZ*/
+ table.list .col_Target_amount_3D__c {width:118px;} /*鐩爣鏁帮細3D*/
+ table.list .col_OPD_3D__c {width:118px;} /*OPD瀵硅薄锛�3D*/
+ table.list .col_Target_amount_OTVS190__c {width:118px;} /*鐩爣鏁帮細OTV-S190*/
+ table.list .col_OPD_OTVS190__c {width:118px;} /*OPD瀵硅薄锛歄TV-S190*/
+ table.list .col_Target_amount_CV190__c {width:118px;} /*鐩爣鏁帮細CV-190*/
+ table.list .col_OPD_CV190__c {width:118px;} /*OPD瀵硅薄锛欳V-190*/
+ table.list .col_Target_amount_UCES3__c {width:118px;} /*鐩爣鏁帮細UCES-3*/
+ table.list .col_OPD_UCES3__c {width:118px;} /*OPD瀵硅薄锛歎CES-3*/
+ table.list .col_Target_amount_USG400__c {width:118px;} /*鐩爣鏁帮細USG-400*/
+ table.list .col_OPD_USG400__c {width:118px;} /*OPD瀵硅薄锛歎SG-400*/
+ table.list .col_Hospital_Name__c {width:139px;} /*鍖婚櫌鍚�*/
+ table.list .col_Department_Name__c {width:60px;} /*绉戝鍚嶇О*/
+ table.list .col_Province_formula__c {width:78px;} /*鐪�(鍏紡)*/
+ table.list .col_X2_Largescale_Project__c {width:78px;} /****鏈夋棤涓ゅ勾浠ュ唴澶ч」鐩噰璐�*/
+ table.list .col_Ideal_Image_Sales__c {width:148px;} /****鎷撳睍銉诲紑鎷撹鍒�/钀ラ攢鏂规(閿�鍞�)*/
+ table.list .col_Review_Sales__c {width:148px;} /****杩涘睍鎯呭喌(閿�鍞�)*/
+ table.list .col_Submit_proposal_document__c {width:58px;} /*鏄惁鎻愪氦鎻愭涔�*/
+ table.list .col_OPP_Flag__c {width:58px;}
+ table.list .col_Sales_activity_plan__c {width:178px;} /*娲诲姩璁″垝(閿�鍞�)*/
+ /*table.list .col_Link1 {width:58px;}
table.list .col_Link2 {width:58px;}
table.list .col_Link3 {width:58px;}
table.list .col_Link4 {width:58px;}
@@ -340,660 +171,365 @@
table.list .col_Link6 {width:58px;}
table.list .col_Link7 {width:58px;}
table.list .col_Link8 {width:58px;}*/
- body .pbBody table.list tr.headerRow td.colViewing {
- /* 銉囥儠銈┿儷銉堝�ゃ�佹渶灏忓寲銈€偆銈炽兂銈掕〃绀� */
- background-image: url('{!URLFOR($Resource.IconResizeMinus_5)}');
- background-repeat: no-repeat;
- }
- body .pbBody table.list tr.headerRow td.colUnHideIcon {
- /* 鏈�澶у寲銈€偆銈炽兂銈掕〃绀� */
- background-image: url('{!URLFOR($Resource.IconResizePlus_5)}');
- background-repeat: no-repeat;
- }
- body .pbBody table.list tr.headerRow td.col_Scroll {
- width: 0px;
- padding: 0px;
- border-width: 0px;
- }
- body .pbBody table.list tr.dataRow td.col_Scroll {
- width: 0px;
- padding: 0px;
- border-width: 0px;
- }
- /*.zxk{
+ body .pbBody table.list tr.headerRow td.colViewing {
+ /* 銉囥儠銈┿儷銉堝�ゃ�佹渶灏忓寲銈€偆銈炽兂銈掕〃绀� */
+ background-image:url('{!URLFOR($Resource.IconResizeMinus_5)}') ;
+ background-repeat:no-repeat;
+ }
+ body .pbBody table.list tr.headerRow td.colUnHideIcon {
+ /* 鏈�澶у寲銈€偆銈炽兂銈掕〃绀� */
+ background-image:url('{!URLFOR($Resource.IconResizePlus_5)}');
+ background-repeat:no-repeat;
+ }
+ body .pbBody table.list tr.headerRow td.col_Scroll {width:0px; padding:0px; border-width:0px;}
+ body .pbBody table.list tr.dataRow td.col_Scroll {width:0px; padding:0px; border-width:0px;}
+ /*.zxk{
margin-bottom: 3px;
}*/
- .buttonStyle {
- font-size: 14px !important;
- font-family: 'sans-serif' !important;
- font-weight: 500 !important;
- width: 70px !important;
- height: 32px !important;
- border-radius: 4px !important;
- opacity: 1 !important;
- background: #090f84 !important;
- color: #ffffff !important;
- }
- </style>
- <script type="text/javascript">
- var heightAjustment = 120;
- var widthAjustment = 30;
- function setChangeFlgRight(cnt) {
- document.getElementById(
- 'allPage:allForm:oppBlock:oppTable:' + cnt + ':changeFlgRt'
- ).value = 1;
- }
- </script>
- </head>
+ .buttonStyle{
+ font-size: 14px !important;
+ font-family: 'sans-serif' !important;
+ font-weight:500 !important;
+ width: 70px !important;
+ height: 32px !important;
+ border-radius: 4px !important;
+ opacity: 1 !important;
+ background:#090F84 !important;
+ color:#FFFFFF !important;
+
+ }
+
+
+</style>
+<script type="text/javascript">
+var heightAjustment = 120;
+var widthAjustment = 30;
+function setChangeFlgRight(cnt) {
+ document.getElementById('allPage:allForm:oppBlock:oppTable:' + cnt + ':changeFlgRt').value = 1;
+
+}
+
+</script>
+</head>
<apex:slds />
- <div id="spinner" class="slds-spinner_container" style="display: none">
- <div
- role="status"
- class="slds-spinner slds-spinner_medium slds-spinner_brand"
- >
+ <div id="spinner" class="slds-spinner_container" style="display:none;">
+ <div role="status" class="slds-spinner slds-spinner_medium slds-spinner_brand">
<span class="slds-assistive-text">Loading</span>
<div class="slds-spinner__dot-a"></div>
<div class="slds-spinner__dot-b"></div>
</div>
</div>
<apex:form id="allForm">
- <apex:actionFunction
- name="saveAndSearch"
- action="{!save}"
- rerender="allPanel"
- oncomplete="closeSpinner();expandAll();"
- >
- <apex:param name="firstParam" assignTo="{!saveType}" value="" />
+ <apex:actionFunction name="saveAndSearch" action="{!save}" rerender="allPanel" oncomplete="closeSpinner();expandAll();">
+ <apex:param name="firstParam" assignTo="{!saveType}" value="" />
</apex:actionFunction>
- <apex:actionFunction
- name="saveAndSort"
- action="{!save}"
- rerender="allPanel"
- oncomplete="closeSpinner();expandAll();"
- >
+ <apex:actionFunction name="saveAndSort" action="{!save}" rerender="allPanel" oncomplete="closeSpinner();expandAll();">
<apex:param name="firstParam" assignTo="{!saveType}" value="" />
<apex:param name="secondParam" assignTo="{!sortKey}" value="" />
</apex:actionFunction>
- <apex:actionFunction
- name="searchOpp"
- action="{!chick}"
- rerender="allPanel"
- oncomplete="closeSpinner();expandAll();"
- />
- <apex:actionFunction
- name="sortTable"
- action="{!sortTable}"
- rerender="allPanel"
- oncomplete="closeSpinner();expandAll();"
- >
+ <apex:actionFunction name="searchOpp" action="{!chick}" rerender="allPanel" oncomplete="closeSpinner();expandAll();"/>
+ <apex:actionFunction name="sortTable" action="{!sortTable}" rerender="allPanel" oncomplete="closeSpinner();expandAll();">
<apex:param name="firstParam" assignTo="{!sortKey}" value="" />
</apex:actionFunction>
<apex:outputPanel id="allPanel">
- <div id="zxk" style="margin-bottom: -15px">
- <apex:pageBlock id="searchBlock" mode="maindetail">
- <table
- style="
- border-bottom-width: 0px;
- font-size: 14px;
- color: #696969;
- "
- >
- <tr>
- <td width="283px">
- <div style="color: #696969">
- 缁忛攢鍟嗗尰闄�
- <apex:inputText
- styleClass="slds-input"
- value="{!accSearch}"
- style="width: 170px"
- />
- </div>
- </td>
- <td width="250px">
- <div style="color: #696969">
- 閿�鍞媴褰�
- <apex:inputText
- styleClass="slds-input"
- value="{!aooSearch}"
- style="width: 150px"
- />
- </div>
- </td>
- <td width="230px">
- <div style="color: #696969">
- 鏄剧ず
- <apex:selectList
- styleClass="slds-input slds-combobox__input"
- style="width: 100px"
- value="{!limits}"
- size="1"
- onchange="searchOppJs_Account();return false;"
- >
- <apex:selectOptions
- value="{!limitOpts}"
- />
- </apex:selectList>
- 鏉℃暟鎹�
- </div>
- </td>
- <td>
- <a
- href="#"
- onclick="expandAll();return false;"
- style="
- text-decoration: underline;
- color: #696969;
- "
- >鍏ㄩ儴灞曞紑</a
- >
- </td>
- </tr>
- </table>
- <p style="height: 10px"></p>
- <table
- style="
- border-bottom-width: 0px;
- font-size: 12px;
- font-size: 14px;
- color: #696969;
- "
- >
- <tr>
- <td width="220px">
- <div style="color: #696969">
- <font>鏁� 鎹� 瀛� 娈�</font
- >
- <apex:selectList
- styleClass="slds-input slds-combobox__input"
- value="{!numtext1}"
- size="1"
- style="width: 110px"
- >
- <apex:selectOptions
- value="{!textOpts}"
- />
- </apex:selectList>
- </div>
- </td>
- <td width="130px">
- <apex:selectList
- styleClass="slds-input slds-combobox__input"
- value="{!numtext2}"
- size="1"
- style="width: 110px"
- >
- <apex:selectOptions value="{!equalOpts}" />
+ <div id="zxk" style="margin-bottom: -15px;">
+ <apex:pageBlock id="searchBlock" mode="maindetail">
+ <table style="border-bottom-width: 0px; font-size:14px;color:#696969;">
+ <tr>
+ <td width="283px">
+ <div style="color:#696969;">
+ 缁忛攢鍟嗗尰闄�
+ <apex:inputText styleClass="slds-input" value="{!accSearch}" style="width:170px"/>
+ </div>
+ </td>
+ <td width="250px">
+ <div style="color:#696969;">
+ 閿�鍞媴褰�
+ <apex:inputText styleClass="slds-input" value="{!aooSearch}" style="width:150px"/>
+ </div>
+ </td>
+ <td width="230px">
+ <div style="color:#696969;">
+ 鏄剧ず
+ <apex:selectList styleClass="slds-input slds-combobox__input" style="width:100px;" value="{!limits}" size="1" onchange="searchOppJs_Account();return false;">
+ <apex:selectOptions value="{!limitOpts}"/>
</apex:selectList>
- </td>
- <td width="183px">
- <apex:inputText
- styleClass="slds-input"
- style="width: 150px"
- value="{!numtext}"
- />
- </td>
- <td width="188px">
- <!-- slds-button slds-button_brand -->
- <apex:commandButton
- styleClass="buttonStyle"
- value="妫�绱�"
- onclick="searchOppJs_Account();return false;"
- style="height: 30px; width: 70px"
- />
- <apex:commandButton
- styleClass="buttonStyle"
- action="{!save}"
- value="淇濆瓨"
- rerender="allPanel"
- onclick="showSpinner();"
- oncomplete="closeSpinner();expandAll();"
- style="height: 30px; width: 70px"
- />
- </td>
- <td>
- <!-- <apex:pageMessages /> -->
- <!-- add by Link 2023-6-2 -->
- <apex:outputPanel
- rendered="{! remindMsg != '' && remindMsg != null}"
- >
- <div
- style="
- border: 1px solid #d4d4d4;
- height: 32px;
- border-radius: 5px;
- color: #ff6a00;
- font-size: 18px;
- "
- >
- <span
- class="slds-icon_container slds-icon-custom-custom53 slds-icon-text-default"
- >
- <svg
- aria-hidden="true"
- class="slds-icon"
- >
- <use
- xmlns:xlink="http://www.w3.org/1999/xlink"
- xlink:href="/apexpages/slds/latest/assets/icons/custom-sprite/svg/symbols.svg#custom53"
- ></use>
+ 鏉℃暟鎹�
+ </div>
+ </td>
+ <td><a href="#" onclick="expandAll();return false;" style="text-decoration: underline;color:#696969;">鍏ㄩ儴灞曞紑</a></td>
+ </tr>
+ </table>
+ <p style="height:10px;"></p>
+ <table style="border-bottom-width: 0px; font-size:12px;font-size:14px;color:#696969;">
+ <tr>
+ <td width="220px">
+ <div style="color:#696969;">
+ <font>鏁� 鎹� 瀛� 娈�</font>
+ <apex:selectList styleClass="slds-input slds-combobox__input" value="{!numtext1}" size="1" style="width:110px">
+ <apex:selectOptions value="{!textOpts}"/>
+ </apex:selectList>
+ </div>
+ </td>
+ <td width="130px">
+ <apex:selectList styleClass="slds-input slds-combobox__input" value="{!numtext2}" size="1" style="width:110px">
+ <apex:selectOptions value="{!equalOpts}"/>
+ </apex:selectList>
+ </td>
+ <td width="183px">
+ <apex:inputText styleClass="slds-input" style="width:150px" value="{!numtext}"/>
+ </td>
+ <td width="188px">
+ <!-- slds-button slds-button_brand -->
+ <apex:commandButton styleClass="buttonStyle" value="妫�绱�" onclick="searchOppJs_Account();return false;" style="height:30px;width:70px;"/>
+ <apex:commandButton styleClass="buttonStyle" action="{!save}" value="淇濆瓨" rerender="allPanel" onclick="showSpinner();" oncomplete="closeSpinner();expandAll();" style="height:30px;width:70px;"/>
+ </td>
+ <td>
+ <!-- <apex:pageMessages /> -->
+ <!-- add by Link 2023-6-2 -->
+ <apex:outputPanel rendered="{! remindMsg != '' && remindMsg != null}">
+ <div style="border: 1px solid #D4D4D4;height:32px;border-radius:5px;color:#ff6a00;font-size:18px;">
+ <span class="slds-icon_container slds-icon-custom-custom53 slds-icon-text-default" >
+ <svg aria-hidden="true" class="slds-icon">
+ <use xmlns:xlink="http://www.w3.org/1999/xlink"
+ xlink:href="/apexpages/slds/latest/assets/icons/custom-sprite/svg/symbols.svg#custom53">
+ </use>
</svg>
- <span class="slds-assistive-text"
- >Custom 53</span
- >
+ <span class="slds-assistive-text">Custom 53</span>
</span>
- <strong style="padding-top: 2px"
- > {!remindMsg}</strong
- >
- </div>
- </apex:outputPanel>
- </td>
- </tr>
- </table>
- </apex:pageBlock>
+ <strong style="padding-top: 2px;"> {!remindMsg}</strong>
+ </div>
+ </apex:outputPanel>
+ </td>
+ </tr>
+ </table>
+ </apex:pageBlock>
</div>
<!-- <div style="border: 1px solid #D4D4D4;border-top: 3px solid #51606E;border-radius:5px;margin-bottom:7px;"> -->
- <apex:pageBlock id="oppBlock" mode="maindetail">
- <!-- <apex:pageblocksection columns="1" id="oppSection"> -->
- <apex:outputPanel>
- <apex:inputHidden id="oppCount" value="{!oppCount}" />
-
- <div id="out_Div_L">
- <table
- class="list"
- style="
- border-bottom-width: 0px;
- width: 1100px;
- font-size: 14px !important;
- border-spacing: 0;
- "
- border=""
- id="tableHeader"
- >
- <tr class="dataRow" height="1px">
- <apex:variable value="{!0}" var="cnt" />
- <apex:repeat value="{!titleRight}" var="t">
- <td class="col_{!columnRightCss[cnt]}"></td>
- <apex:variable
- value="{!cnt + 1}"
- var="cnt"
- />
- </apex:repeat>
- <td id="cell_Scroll" class="col_Scroll"></td>
- </tr>
- <tr class="headerRow" height="30px">
- <apex:variable value="{!0}" var="cnt" />
- <apex:repeat value="{!titleRight}" var="t">
- <td class="col_{!columnRightCss[cnt]}">
- <a
- href="#"
- onclick="sortTableJs_Account1('{!cnt + titleLeft.size}');return false;"
- style="
- text-decoration: underline;
- color: black;
- font-size: 14px !important;
- font-weight: bold;
- "
- ><apex:outputText value="{!t}" /></a
- >{!sortOrder[cnt + titleLeft.size]}
- </td>
- <apex:variable
- value="{!cnt + 1}"
- var="cnt"
- />
- </apex:repeat>
- <!-- <td id="cell_Scroll" class="col_Scroll"></td> -->
- </tr>
- </table>
- </div>
- <div id="out_Div">
- <table
- class="list"
- style="
- border-bottom-width: 0px;
- width: 2000px;
- font-size: 14px !important;
- border-spacing: 0;
- "
- border=""
- id="tableHeader_L"
- >
- <tr class="dataRow" height="1px">
- <apex:variable value="{!0}" var="cnt" />
- <apex:repeat value="{!titleLeft}" var="t">
- <td class="col_{!columnLeftCss[cnt]}"></td>
- <apex:variable
- value="{!cnt + 1}"
- var="cnt"
- />
- </apex:repeat>
- </tr>
+ <apex:pageBlock id="oppBlock" mode="maindetail">
+ <!-- <apex:pageblocksection columns="1" id="oppSection"> -->
+ <apex:outputPanel >
+ <apex:inputHidden id="oppCount" value="{!oppCount}"/>
+
+ <div id="out_Div_L">
+ <table class="list" style="border-bottom-width: 0px; width:1100px; font-size:14px !important; border-spacing:0;" border="" id="tableHeader">
+ <tr class="dataRow" height="1px">
+ <apex:variable value="{!0}" var="cnt" />
+ <apex:repeat value="{!titleRight}" var="t">
+ <td class="col_{!columnRightCss[cnt]}"></td>
+ <apex:variable value="{!cnt + 1}" var="cnt" />
+ </apex:repeat>
+ <td id="cell_Scroll" class="col_Scroll"></td>
+ </tr>
+ <tr class="headerRow" height="30px">
+ <apex:variable value="{!0}" var="cnt" />
+ <apex:repeat value="{!titleRight}" var="t">
+ <td class="col_{!columnRightCss[cnt]}">
+ <a href="#" onclick="sortTableJs_Account1('{!cnt + titleLeft.size}');return false;" style="text-decoration: underline;color:black;font-size:14px !important;font-weight: bold;"><apex:outputText value="{!t}"/></a>{!sortOrder[cnt + titleLeft.size]}
+ </td>
+ <apex:variable value="{!cnt + 1}" var="cnt" />
+ </apex:repeat>
+ <!-- <td id="cell_Scroll" class="col_Scroll"></td> -->
+ </tr>
+ </table>
+ </div>
+ <div id="out_Div">
+ <table class="list" style="border-bottom-width: 0px; width:2000px; font-size:14px !important; border-spacing:0;" border="" id="tableHeader_L">
+ <tr class="dataRow" height="1px">
+ <apex:variable value="{!0}" var="cnt" />
+ <apex:repeat value="{!titleLeft}" var="t">
+ <td class="col_{!columnLeftCss[cnt]}"></td>
+ <apex:variable value="{!cnt + 1}" var="cnt" />
+ </apex:repeat>
+ </tr>
<tr class="headerRow" height="30px">
<apex:variable value="{!0}" var="cnt" />
<apex:repeat value="{!titleLeft}" var="t">
<td class="col_{!columnLeftCss[cnt]}">
- <a
- href="#"
- onclick="sortTableJs_Account1('{!cnt}');return false;"
- style="
- text-decoration: underline;
- color: black;
- font-size: 14px !important;
- font-weight: bold;
- "
- ><apex:outputText value="{!t}" /></a
- >{!sortOrder[cnt]}
+ <a href="#" onclick="sortTableJs_Account1('{!cnt}');return false;" style="text-decoration: underline;color:black;font-size:14px !important;font-weight: bold;"><apex:outputText value="{!t}"/></a>{!sortOrder[cnt]}
</td>
- <apex:variable
- value="{!cnt + 1}"
- var="cnt"
- />
+ <apex:variable value="{!cnt + 1}" var="cnt" />
</apex:repeat>
<!-- <td id="cell_Scroll" class="col_Scroll"></td> -->
</tr>
</table>
- </div>
- <!-- out_Div -->
- <div style="clear: both; height: 0px"></div>
+
+ </div> <!-- out_Div -->
+ <div style="clear:both;height:0px;"></div>
<div id="in_Div_L">
- <table
- class="list"
- style="
- border-bottom-width: 0px;
- width: 1100px;
- font-size: 13px;
- border-spacing: 0;
- "
- border=""
- id="tableData"
- >
+ <table class="list" style="border-bottom-width: 0px;width:1100px; font-size:13px; border-spacing:0;" border="" id="tableData">
<apex:variable value="{!1}" var="cnt" />
- <apex:repeat
- value="{!oppRecords}"
- var="or"
- id="oppTable"
- >
- <tr
- class="dataRow {!IF(MOD(cnt, 2)==0, 'odd', 'even')} {!IF(cnt==1, 'first', '')}"
- style="height: 35px"
- onmouseover="if (window.hiOn){hiOn(this);} "
- onmouseout="if (window.hiOff){hiOff(this);} "
- onblur="if (window.hiOff){hiOff(this);}"
- onfocus="if (window.hiOn){hiOn(this);}"
- >
+ <apex:repeat value="{!oppRecords}" var="or" id="oppTable">
+ <tr class="dataRow {!IF(MOD(cnt, 2)==0, 'odd', 'even')} {!IF(cnt==1, 'first', '')}" style="height:35px;" onmouseover="if (window.hiOn){hiOn(this);} " onmouseout="if (window.hiOff){hiOff(this);} " onblur="if (window.hiOff){hiOff(this);}" onfocus="if (window.hiOn){hiOn(this);}">
<apex:variable value="{!0}" var="cnt_3" />
- <apex:repeat
- value="{!columnsRightApi}"
- var="c"
- >
- <td
- class="dataCellBorder1 col_{!columnRightCss[cnt_3]} {!cnt}_col_{!columnRightCss[cnt_3]}"
- >
+ <apex:repeat value="{!columnsRightApi}" var="c">
+ <td class="dataCellBorder1 col_{!columnRightCss[cnt_3]} {!cnt}_col_{!columnRightCss[cnt_3]}">
+
<!-- vivek start -->
<!-- <apex:outputLink rendered="{!c[0]=='Name'}" value="/{!or.opp.Id}" target="LINK_{!or.opp.Id}"><apex:outputField rendered="{!c[0]=='Name'}" value="{!or.opp[c[0]]}" /></apex:outputLink> -->
<!-- vivek end -->
<!-- <apex:outputField id="q1111111111" rendered="{!(c.size==1 && columnRightRW[c[0]]=='r' && or.opp.Id <> null && c[0] <> 'Name' && (c[0] <> 'Opp_Changed_Field__c' ||(c[0] == 'Opp_Changed_Field__c' &&
or.opp.Opp_Changed_Field__c != '璇环闃舵鍙戠敓浜嗗彉鍖�' &&or.opp.Opp_Changed_Field__c != '棰勬祴绛剧害鏃ュ彂鐢熶簡鍙樺寲' &&or.opp.Opp_Changed_Field__c != '鍖婚櫌鍚堝悓閲戦鍙戠敓浜嗗彉鍖�' && or.opp.Opp_Changed_Field__c != '璁㈣揣閲戦鍙戠敓浜嗗彉鍖�')))}" value="{!or.opp[c[0]]}" /> && or.opp.Oly_Inquiry_Status1__c <> null AgcOpp -->
- <apex:outputField
- rendered="{!c[0] == 'Change_To_Opportunity_T__c' }"
- value="{!or.opp[c[0]]}"
- />
-
- <apex:outputField
- rendered="{!columnRightRW[c[0]]=='r' && c[0] <> 'Change_To_Opportunity_T__c' && c[0] <> 'Strategic_department_Class_Name__c' }"
- value="{!or.opp[c[0]]}"
- />
- <!-- <apex:outputField id="q1111111111" rendered="{!( columnRightRW[c[0]]=='r' && c[0] <> 'Name' && (c[0] <> 'StageName__c' ||(c[0] == 'StageName__c' &&
+ <apex:outputField rendered="{!c[0] == 'Change_To_Opportunity_T__c' }" value="{!or.opp[c[0]]}" />
+
+ <apex:outputField rendered="{!columnRightRW[c[0]]=='r' && c[0] <> 'Change_To_Opportunity_T__c' && c[0] <> 'Strategic_department_Class_Name__c' }" value="{!or.opp[c[0]]}" />
+ <!-- <apex:outputField id="q1111111111" rendered="{!( columnRightRW[c[0]]=='r' && c[0] <> 'Name' && (c[0] <> 'StageName__c' ||(c[0] == 'StageName__c' &&
or.opp.Oly_Inquiry_Stage__c != '璇环闃舵鍙戠敓浜嗗彉鍖�' &&or.opp.Oly_Inquiry_Stage__c != '棰勬祴绛剧害鏃ュ彂鐢熶簡鍙樺寲' &&or.opp.Oly_Inquiry_Stage__c != '鍖婚櫌鍚堝悓閲戦鍙戠敓浜嗗彉鍖�' && or.opp.Oly_Inquiry_Stage__c != '璁㈣揣閲戦鍙戠敓浜嗗彉鍖�')))}" value="{!or.opp[c[0]]}" /> -->
- <!-- <div style ="color:red"> -->
- <!-- <apex:outputField id="q2222222" rendered="{!(c.size==1 && columnRightRW[c[0]]=='r' && or.opp.Id <> null && c[0] <> 'Name' && c[0] == 'Opp_Changed_Field__c' && (
+ <!-- <div style ="color:red"> -->
+ <!-- <apex:outputField id="q2222222" rendered="{!(c.size==1 && columnRightRW[c[0]]=='r' && or.opp.Id <> null && c[0] <> 'Name' && c[0] == 'Opp_Changed_Field__c' && (
or.opp.Opp_Changed_Field__c == '璇环闃舵鍙戠敓浜嗗彉鍖�' || or.opp.Opp_Changed_Field__c == '棰勬祴绛剧害鏃ュ彂鐢熶簡鍙樺寲' || or.opp.Opp_Changed_Field__c == '鍖婚櫌鍚堝悓閲戦鍙戠敓浜嗗彉鍖�' || or.opp.Opp_Changed_Field__c == '璁㈣揣閲戦鍙戠敓浜嗗彉鍖�'))}" value="{!or.opp[c[0]]}" /> -->
- <!-- <apex:outputField id="q2222222" rendered="{!(c.size==1 && columnRightRW[c[0]]=='r' && c[0] <> 'Name' && c[0] == 'StageName__c' && (
+ <!-- <apex:outputField id="q2222222" rendered="{!(c.size==1 && columnRightRW[c[0]]=='r' && c[0] <> 'Name' && c[0] == 'StageName__c' && (
or.opp.Oly_Inquiry_Stage__c == '璇环闃舵鍙戠敓浜嗗彉鍖�' || or.opp.Oly_Inquiry_Stage__c == '棰勬祴绛剧害鏃ュ彂鐢熶簡鍙樺寲' || or.opp.Oly_Inquiry_Stage__c == '鍖婚櫌鍚堝悓閲戦鍙戠敓浜嗗彉鍖�' || or.opp.Oly_Inquiry_Stage__c == '璁㈣揣閲戦鍙戠敓浜嗗彉鍖�'))}" value="{!or.opp[c[0]]}" />
</div> -->
- <!-- <apex:inputField rendered="{!(c.size==1 && columnRightRW[c[0]]=='w' && or.opp.Id <> null && c[0] <> 'Name')}" value="{!or.opp[c[0]]}" onchange="setChangeFlgRight('{!or.lineNo}')"/>
+ <!-- <apex:inputField rendered="{!(c.size==1 && columnRightRW[c[0]]=='w' && or.opp.Id <> null && c[0] <> 'Name')}" value="{!or.opp[c[0]]}" onchange="setChangeFlgRight('{!or.lineNo}')"/>
<apex:outputPanel rendered="{!(c.size==1 && columnRightRW[c[0]]=='wm' && c[0] <> 'Name' && or.opp.Id <> null)}" layout="none">
<div class="requiredInput_r">
<div class="requiredBlock_r"></div>
<apex:inputField value="{!or.Opp[c[0]]}" onchange="setChangeFlg('{!or.lineNo}')"/>
</div>
</apex:outputPanel> -->
- <apex:outputField
- rendered="{!c[0] == 'Strategic_department_Class_Name__c'}"
- value="{!or.opp[c[0]]}"
- />
-
- <apex:inputField
- styleClass="slds-form-element"
- rendered="{!( columnRightRW[c[0]]=='w' && c[0] <> 'Strategic_department_Class_Name__c' && c[0] <> 'Change_To_Opportunity_T__c' && c[0] <> 'Name')}"
- value="{!or.opp[c[0]]}"
- onchange="setChangeFlgRight('{!or.lineNo}')"
- />
- <apex:outputPanel
- rendered="{!( columnRightRW[c[0]]=='wm' && c[0] <> 'Change_To_Opportunity_T__c' && c[0] <> 'Name' )}"
- layout="none"
- >
- <div class="requiredInput_r">
- <div
- class="requiredBlock_r"
- ></div>
- <apex:inputField
- styleClass="slds-form-element"
- value="{!or.Opp[c[0]]}"
- onchange="setChangeFlg('{!or.lineNo}')"
- />
- </div>
- </apex:outputPanel>
- <apex:variable
- value="{!cnt_3 + 1}"
- var="cnt_3"
- />
- </td>
- </apex:repeat>
- <td id="cell_Scroll" class="col_Scroll">
- <apex:inputHidden
- value="{!or.changeFlg}"
- id="changeFlg"
- />
- <apex:inputHidden
- value="{!or.changeFlgRt}"
- id="changeFlgRt"
- />
- <script type="text/javascript">
- if ("{!or.canEdit}" == "false") {
- var right = j$("#tableData").find("tr").eq({!cnt-1});
- var rightline = j$(right).find("td");
- for (var i=0; i<rightline.length; i++) {
- j$(rightline[i]).find("input").each(function(){
- j$(this).attr("disabled",true);
- });
- j$(rightline[i]).find("a").each(function(){
- j$(this).attr("href","#");
- });
- }
+ <apex:outputField rendered="{!c[0] == 'Strategic_department_Class_Name__c'}" value="{!or.opp[c[0]]}" />
+
+ <apex:inputField styleClass="slds-form-element" rendered="{!( columnRightRW[c[0]]=='w' && c[0] <> 'Strategic_department_Class_Name__c' && c[0] <> 'Change_To_Opportunity_T__c' && c[0] <> 'Name')}" value="{!or.opp[c[0]]}" onchange="setChangeFlgRight('{!or.lineNo}')"/>
+ <apex:outputPanel rendered="{!( columnRightRW[c[0]]=='wm' && c[0] <> 'Change_To_Opportunity_T__c' && c[0] <> 'Name' )}" layout="none">
+ <div class="requiredInput_r">
+ <div class="requiredBlock_r"></div>
+ <apex:inputField styleClass="slds-form-element" value="{!or.Opp[c[0]]}" onchange="setChangeFlg('{!or.lineNo}')"/>
+ </div>
+ </apex:outputPanel>
+ <apex:variable value="{!cnt_3 + 1}" var="cnt_3" />
+ </td>
+ </apex:repeat>
+ <td id="cell_Scroll" class="col_Scroll">
+ <apex:inputHidden value="{!or.changeFlg}" id="changeFlg"/>
+ <apex:inputHidden value="{!or.changeFlgRt}" id="changeFlgRt"/>
+ <script type="text/javascript">
+ if ("{!or.canEdit}" == "false") {
+ var right = j$("#tableData").find("tr").eq({!cnt-1});
+ var rightline = j$(right).find("td");
+ for (var i=0; i<rightline.length; i++) {
+ j$(rightline[i]).find("input").each(function(){
+ j$(this).attr("disabled",true);
+ });
+ j$(rightline[i]).find("a").each(function(){
+ j$(this).attr("href","#");
+ });
}
- if ("{!or.hasError}" == "true") {
- var left = j$("#tableData_L").find("tr").eq({!cnt-1});
- var leftFirst = j$(left).find("td").eq(1);
- j$(leftFirst).css("background-color", "gray");
- }
- if ("{!or.hasFieldError}" == "true") {
- var left = j$("#tableData_L").find("tr").eq({!cnt-1});
- var leftFirst = j$(left).find("td").eq(1);
- j$(leftFirst).css("background-color", "red");
- }
+ }
+ if ("{!or.hasError}" == "true") {
+ var left = j$("#tableData_L").find("tr").eq({!cnt-1});
+ var leftFirst = j$(left).find("td").eq(1);
+ j$(leftFirst).css("background-color", "gray");
+ }
+ if ("{!or.hasFieldError}" == "true") {
+ var left = j$("#tableData_L").find("tr").eq({!cnt-1});
+ var leftFirst = j$(left).find("td").eq(1);
+ j$(leftFirst).css("background-color", "red");
+ }
</script>
- </td>
- </tr>
- <apex:variable value="{!cnt + 1}" var="cnt" />
- </apex:repeat>
- </table>
- </div>
- <div id="in_Div">
- <table
- class="list"
- style="
- border-bottom-width: 0px;
- width: 2000px;
- font-size: 13px;
- border-spacing: 0;
- "
- border=""
- id="tableData_L"
- >
- <apex:variable value="{!1}" var="cnt_2" />
- <apex:repeat
- value="{!oppRecords}"
- var="or"
- id="oppTable_L"
- >
- <tr
- class="dataRow {!IF(MOD(cnt, 2)==0, 'odd', 'even')} {!IF(cnt==1, 'first', '')}"
- style="height: 35px"
- onmouseover="if (window.hiOn){hiOn(this);} "
- onmouseout="if (window.hiOff){hiOff(this);} "
- onblur="if (window.hiOff){hiOff(this);}"
- onfocus="if (window.hiOn){hiOn(this);}"
- >
- <apex:variable value="{!0}" var="cnt_2" />
- <apex:repeat
- value="{!columnsLeftApi}"
- var="c"
- >
- <td
- class="dataCellBorder1 col_{!columnLeftCss[cnt_2]}"
- >
- <!-- vivek start -->
-
- <apex:outputLink
- target="_blank"
- rendered="{!c[0]=='Name'}"
- value="/{!or.AgcOpp.Id}"
- >
- <apex:outputField
- rendered="{!c[0]=='Name'}"
- value="{!or.AgcOpp[c[0]]}"
- />
- </apex:outputLink>
-
- <apex:outputPanel
- rendered="{!or.ifLock}"
- >
- <apex:outputField
- rendered="{!c[0]!='Name'}"
- value="{!or.AgcOpp[c[0]]}"
- >
- </apex:outputField>
- </apex:outputPanel>
- <!-- 閿�鍞媴褰� -->
- <apex:outputPanel
- rendered="{!or.ifLock == false}"
- >
- <!-- <apex:outputLink target="_blank" rendered="{!c[0]=='Agency_Person__c'}" value="/{!or.AgcOpp[c[0]]}" > -->
- <!-- <apex:outputText value="{!or.AgcOpp.Agency_Person__r.Name }" /> -->
- <!-- <apex:outputText rendered="{!c[0]=='Agency_PersonName__c'}" value="{!or.AgcOpp.Agency_PersonName__c }" /> -->
- <!-- </apex:outputLink> -->
- <!-- 缁忛攢鍟� -->
- <apex:outputLink
- target="_blank"
- rendered="{!c[0]=='Agency__c'}"
- value="/{!or.AgcOpp[c[0]]}"
- >
- <apex:outputText
- value="{!or.AgcOpp.Agency__r.Name }"
- />
- </apex:outputLink>
- <!-- OCSM璇环 -->
- <!-- <apex:outputLink target="_blank" rendered="{!c[0]=='Change_To_Opportunity__c'}" value="/{!or.AgcOpp[c[0]]}" >
+ </td>
+ </tr>
+ <apex:variable value="{!cnt + 1}" var="cnt" />
+ </apex:repeat>
+ </table>
+ </div>
+ <div id="in_Div">
+ <table class="list" style="border-bottom-width: 0px;width:2000px; font-size:13px; border-spacing:0;" border="" id="tableData_L">
+ <apex:variable value="{!1}" var="cnt_2" />
+ <apex:repeat value="{!oppRecords}" var="or" id="oppTable_L">
+ <tr class="dataRow {!IF(MOD(cnt, 2)==0, 'odd', 'even')} {!IF(cnt==1, 'first', '')}" style="height:35px;" onmouseover="if (window.hiOn){hiOn(this);} " onmouseout="if (window.hiOff){hiOff(this);} " onblur="if (window.hiOff){hiOff(this);}" onfocus="if (window.hiOn){hiOn(this);}">
+ <apex:variable value="{!0}" var="cnt_2" />
+ <apex:repeat value="{!columnsLeftApi}" var="c">
+ <td class="dataCellBorder1 col_{!columnLeftCss[cnt_2]}">
+ <!-- vivek start -->
+
+ <apex:outputLink target="_blank" rendered="{!c[0]=='Name'}" value="/{!or.AgcOpp.Id}" >
+ <apex:outputField rendered="{!c[0]=='Name'}" value="{!or.AgcOpp[c[0]]}" />
+ </apex:outputLink>
+
+ <apex:outputPanel rendered="{!or.ifLock}">
+ <apex:outputField rendered="{!c[0]!='Name'}" value="{!or.AgcOpp[c[0]]}">
+ </apex:outputField>
+ </apex:outputPanel>
+ <!-- 閿�鍞媴褰� -->
+ <apex:outputPanel rendered="{!or.ifLock == false}">
+ <!-- <apex:outputLink target="_blank" rendered="{!c[0]=='Agency_Person__c'}" value="/{!or.AgcOpp[c[0]]}" > -->
+ <!-- <apex:outputText value="{!or.AgcOpp.Agency_Person__r.Name }" /> -->
+ <!-- <apex:outputText rendered="{!c[0]=='Agency_PersonName__c'}" value="{!or.AgcOpp.Agency_PersonName__c }" /> -->
+ <!-- </apex:outputLink> -->
+ <!-- 缁忛攢鍟� -->
+ <apex:outputLink target="_blank" rendered="{!c[0]=='Agency__c'}" value="/{!or.AgcOpp[c[0]]}" >
+ <apex:outputText value="{!or.AgcOpp.Agency__r.Name }" />
+ </apex:outputLink>
+ <!-- OCSM璇环 -->
+ <!-- <apex:outputLink target="_blank" rendered="{!c[0]=='Change_To_Opportunity__c'}" value="/{!or.AgcOpp[c[0]]}" >
<apex:outputText value="{!or.AgcOpp.Agency__r.Name }" />
</apex:outputLink> -->
- <!-- 蹇呭~瀛楁 -->
- <!-- <apex:outputField rendered="{!(c[0]<>'Name' && c[0]<>'Agency_Hospital__c' && c[0]<>'Product_Category1__c' && c[0]<>'Product_Category2__c' && c[0]<>'Product_Category3__c' && c[0]<>'Agency_Person__c' && c[0]<>'Agency__c' && c[0]<>'Change_To_Opportunity__c' && columnLeftRW[c[0]]=='wm')}" value="{!or.AgcOpp[c[0]] }"/> -->
- <apex:inputField
- styleClass="slds-form-element"
- rendered="{!(c[0]<>'Name' && c[0]<>'Product_Category1__c' && c[0]<>'Product_Category2__c' && c[0]<>'Product_Category3__c' && c[0]<>'Agency_Person__c' && c[0]<>'Agency__c' && c[0]<>'Change_To_Opportunity__c' && columnLeftRW[c[0]]=='wm')}"
- value="{!or.AgcOpp[c[0]] }"
- onchange="setChangeFlg('{!or.lineNo}')"
- />
- <!-- vivek end -->
-
- <apex:outputField
- rendered="{!(c[0]<>'Name' && c[0]<>'Product_Category1__c' && c[0]<>'Product_Category2__c' && c[0]<>'Product_Category3__c' && c[0]<>'Agency_Person__c' && c[0]<>'Agency__c' && c[0]<>'Change_To_Opportunity__c' && columnLeftRW[c[0]]=='r')}"
- value="{!or.AgcOpp[c[0]] }"
- />
- <!-- <apex:outputField rendered="{!(c[0]<>'Name' && columnLeftRW[c[0]]<>'w')}" value="{!or.AgcOpp[c[0]] }"/> -->
- <!-- 鍙紪杈戠殑瀛楁 -->
- <apex:inputField
- styleClass="slds-form-element"
- value="{!or.AgcOpp[c[0]]}"
- rendered="{!columnLeftRW[c[0]]=='w'}"
- onchange="setChangeFlg('{!or.lineNo}')"
- />
- </apex:outputPanel>
- </td>
- <apex:variable
- value="{!cnt_2 + 1}"
- var="cnt_2"
- />
- </apex:repeat>
- </tr>
+ <!-- 蹇呭~瀛楁 -->
+ <!-- <apex:outputField rendered="{!(c[0]<>'Name' && c[0]<>'Agency_Hospital__c' && c[0]<>'Product_Category1__c' && c[0]<>'Product_Category2__c' && c[0]<>'Product_Category3__c' && c[0]<>'Agency_Person__c' && c[0]<>'Agency__c' && c[0]<>'Change_To_Opportunity__c' && columnLeftRW[c[0]]=='wm')}" value="{!or.AgcOpp[c[0]] }"/> -->
+ <apex:inputField styleClass="slds-form-element" rendered="{!(c[0]<>'Name' && c[0]<>'Product_Category1__c' && c[0]<>'Product_Category2__c' && c[0]<>'Product_Category3__c' && c[0]<>'Agency_Person__c' && c[0]<>'Agency__c' && c[0]<>'Change_To_Opportunity__c' && columnLeftRW[c[0]]=='wm')}" value="{!or.AgcOpp[c[0]] }" onchange="setChangeFlg('{!or.lineNo}')"/>
+ <!-- vivek end -->
+
+
+ <apex:outputField rendered="{!(c[0]<>'Name' && c[0]<>'Product_Category1__c' && c[0]<>'Product_Category2__c' && c[0]<>'Product_Category3__c' && c[0]<>'Agency_Person__c' && c[0]<>'Agency__c' && c[0]<>'Change_To_Opportunity__c' && columnLeftRW[c[0]]=='r')}" value="{!or.AgcOpp[c[0]] }"/>
+ <!-- <apex:outputField rendered="{!(c[0]<>'Name' && columnLeftRW[c[0]]<>'w')}" value="{!or.AgcOpp[c[0]] }"/> -->
+ <!-- 鍙紪杈戠殑瀛楁 -->
+ <apex:inputField styleClass="slds-form-element" value="{!or.AgcOpp[c[0]]}" rendered="{!columnLeftRW[c[0]]=='w'}" onchange="setChangeFlg('{!or.lineNo}')"/>
+ </apex:outputPanel>
+ </td>
+ <apex:variable value="{!cnt_2 + 1}" var="cnt_2" />
+ </apex:repeat>
+ </tr>
<apex:variable value="{!cnt + 1}" var="cnt" />
</apex:repeat>
</table>
- </div>
- <!-- /in_Div -->
+
+ </div><!-- /in_Div -->
</apex:outputPanel>
- </apex:pageBlock>
+ </apex:pageBlock>
<!-- </div> -->
- <script type="text/javascript">
- j$(function () {
- var tableWidth = 0;
- j$('body .pbBody table#tableHeader tr.headerRow td').each(
- function () {
- var colClass = getColClassName(this);
- if (colClass != 'col_Scroll') {
- var headerCol = j$(
- 'body .pbBody table.list tr.headerRow td.' +
- colClass
- );
- tableWidth += headerCol.width();
- }
- }
- );
- // j$('table#tableData').css('width', (tableWidth + 2) + 'px');
- // j$('table#tableHeader').css('width', (tableWidth + 2) + 'px');
-
- // list 銇� headerRow 銇� td銇� toggleWidth() 銈掕拷鍔�
- bindTdToggleWidth();
- // j$("input").attr("styleClass","slds-input");
- });
- var elements = document.getElementsByTagName('select');
- for (i = 0; i < elements.length; i++) {
- var id = elements[i].id;
- if (
- id.length > 5 &&
- id.substring(id.length - 5, id.length) == 'mlktp'
- ) {
- elements[i].style.display = 'none';
- }
- }
- var tbl_l = document.getElementById('tableData_L');
- var input_l = tbl_l.getElementsByTagName('input');
- for (i = 0; i < input_l.length; i++) {
- var id = input_l[i].id + '_lkid';
- if (document.getElementById(id) != null) {
- input_l[i].style.width = '75%';
- }
- }
- var tbl = document.getElementById('tableData');
- var input = tbl.getElementsByTagName('input');
- for (i = 0; i < input.length; i++) {
- var id = input[i].id + '_lkid';
- if (document.getElementById(id) != null) {
- input[i].style.width = '75%';
- }
- }
- </script>
+ <script type="text/javascript">
+j$(function() {
+ var tableWidth = 0;
+ j$('body .pbBody table#tableHeader tr.headerRow td').each(function() {
+ var colClass = getColClassName(this);
+ if (colClass != 'col_Scroll') {
+ var headerCol = j$('body .pbBody table.list tr.headerRow td.' + colClass);
+ tableWidth += headerCol.width();
+ }
+ });
+ // j$('table#tableData').css('width', (tableWidth + 2) + 'px');
+ // j$('table#tableHeader').css('width', (tableWidth + 2) + 'px');
+
+ // list 銇� headerRow 銇� td銇� toggleWidth() 銈掕拷鍔�
+ bindTdToggleWidth();
+ // j$("input").attr("styleClass","slds-input");
+});
+var elements = document.getElementsByTagName("select");
+for (i = 0; i < elements.length; i++) {
+ var id = elements[i].id;
+ if (id.length > 5 && id.substring(id.length - 5, id.length) == 'mlktp') {
+ elements[i].style.display = "none";
+ }
+}
+var tbl_l = document.getElementById("tableData_L");
+var input_l = tbl_l.getElementsByTagName("input");
+for (i = 0; i < input_l.length; i++) {
+ var id = input_l[i].id + '_lkid';
+ if (document.getElementById(id) != null) {
+ input_l[i].style.width = "75%";
+ }
+}
+var tbl = document.getElementById("tableData");
+var input = tbl.getElementsByTagName("input");
+for (i = 0; i < input.length; i++) {
+ var id = input[i].id + '_lkid';
+ if (document.getElementById(id) != null) {
+ input[i].style.width = "75%";
+ }
+}
+</script>
</apex:outputPanel>
</apex:form>
-</apex:page>
+</apex:page>
\ No newline at end of file
diff --git a/force-app/main/default/pages/DealerInquiryModifyState.page-meta.xml b/force-app/main/default/pages/DealerInquiryModifyState.page-meta.xml
index 1ff0fd6..ba744e5 100644
--- a/force-app/main/default/pages/DealerInquiryModifyState.page-meta.xml
+++ b/force-app/main/default/pages/DealerInquiryModifyState.page-meta.xml
@@ -1,4 +1,4 @@
-<?xml version="1.0" encoding="UTF-8" ?>
+<?xml version="1.0" encoding="UTF-8"?>
<ApexPage xmlns="http://soap.sforce.com/2006/04/metadata">
<apiVersion>39.0</apiVersion>
<availableInTouch>true</availableInTouch>
diff --git a/force-app/main/default/permissionsets/Community_Consumable_LEX_PS.permissionset-meta.xml b/force-app/main/default/permissionsets/Community_Consumable_LEX_PS.permissionset-meta.xml
index d26d5e1..328cd0d 100644
--- a/force-app/main/default/permissionsets/Community_Consumable_LEX_PS.permissionset-meta.xml
+++ b/force-app/main/default/permissionsets/Community_Consumable_LEX_PS.permissionset-meta.xml
@@ -1,4 +1,4 @@
-<?xml version="1.0" encoding="UTF-8" ?>
+<?xml version="1.0" encoding="UTF-8"?>
<PermissionSet xmlns="http://soap.sforce.com/2006/04/metadata">
<classAccesses>
<apexClass>LexArriveGoodsController</apexClass>
@@ -126,9 +126,7 @@
</classAccesses>
<flowAccesses>
<enabled>true</enabled>
- <flow>
-CommunityWeeklyReport;
- </flow>
+ <flow>CommunityWeeklyReport</flow>
</flowAccesses>
<hasActivationRequired>false</hasActivationRequired>
<label>Community Consumable LEX PS</label>
diff --git a/force-app/main/default/reports/Store_Custom_ReportLink/X2_Lky.report-meta.xml b/force-app/main/default/reports/Store_Custom_ReportLink/X2_Lky.report-meta.xml
new file mode 100644
index 0000000..38c894e
--- /dev/null
+++ b/force-app/main/default/reports/Store_Custom_ReportLink/X2_Lky.report-meta.xml
@@ -0,0 +1,133 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<Report xmlns="http://soap.sforce.com/2006/04/metadata">
+ <columns>
+ <field>Consumable_order_details2__c.Consumable_order_minor__c</field>
+ </columns>
+ <columns>
+ <field>Consumable_order_details2__c.Opportunity_No__c</field>
+ </columns>
+ <columns>
+ <field>Consumable_order_details2__c.SalesDepartment_Dealer__c</field>
+ </columns>
+ <columns>
+ <field>Consumable_order_details2__c.Dealer_Info_text__c</field>
+ </columns>
+ <columns>
+ <field>Consumable_order_details2__c.Order_Dealer_Info__c</field>
+ </columns>
+ <columns>
+ <field>Consumable_order_details2__c.OT_Code__c</field>
+ </columns>
+ <columns>
+ <field>Consumable_order_details2__c.Asset_Model_No__c</field>
+ </columns>
+ <columns>
+ <field>Consumable_order_details2__c.Product_name__c</field>
+ </columns>
+ <columns>
+ <field>Consumable_order_details2__c.Category3__c</field>
+ </columns>
+ <columns>
+ <field>Consumable_order_details2__c.Product_OutDate__c</field>
+ </columns>
+ <columns>
+ <field>Consumable_order_details2__c.SerialLotNo__c</field>
+ </columns>
+ <columns>
+ <field>Consumable_order_details2__c.Detail_Count__c</field>
+ </columns>
+ <columns>
+ <aggregateTypes>Sum</aggregateTypes>
+ <field>Consumable_order_details2__c.Sale_unitPrice__c</field>
+ </columns>
+ <columns>
+ <field>Consumable_order_details2__c.Box_Piece__c</field>
+ </columns>
+ <columns>
+ <field>Consumable_order_details2__c.TracingCode__c</field>
+ </columns>
+ <columns>
+ <field>Consumable_order_details2__c.DICode__c</field>
+ </columns>
+ <columns>
+ <field>Consumable_order_details2__c.Recall_shipment__c</field>
+ </columns>
+ <columns>
+ <field>Consumable_order_details2__c.HospItal_Code__c</field>
+ </columns>
+ <columns>
+ <field>Consumable_order_details2__c.HospItal_Name__c</field>
+ </columns>
+ <columns>
+ <field>Consumable_order_details2__c.Order_ForCustomerText__c</field>
+ </columns>
+ <columns>
+ <field>Consumable_order_details2__c.HospItal_Classification__c</field>
+ </columns>
+ <columns>
+ <field>Consumable_order_details2__c.Consumable_ZS_order__c</field>
+ </columns>
+ <currency>CNY</currency>
+ <filter>
+ <booleanFilter>((((1 OR 2) AND 3) AND 4) AND 5) AND 6</booleanFilter>
+ <criteriaItems>
+ <column>Consumable_order_details2__c.Dealer_Shipment__c</column>
+ <columnToColumn>false</columnToColumn>
+ <isUnlocked>true</isUnlocked>
+ <operator>equals</operator>
+ <value>1</value>
+ </criteriaItems>
+ <criteriaItems>
+ <column>Consumable_order_details2__c.Dealer_Saled__c</column>
+ <columnToColumn>false</columnToColumn>
+ <isUnlocked>true</isUnlocked>
+ <operator>equals</operator>
+ <value>1</value>
+ </criteriaItems>
+ <criteriaItems>
+ <column>Consumable_order_details2__c.Dealer_Returned__c</column>
+ <columnToColumn>false</columnToColumn>
+ <isUnlocked>true</isUnlocked>
+ <operator>equals</operator>
+ <value>0</value>
+ </criteriaItems>
+ <criteriaItems>
+ <column>Consumable_order_details2__c.Dealer_Info_text__c</column>
+ <columnToColumn>false</columnToColumn>
+ <isUnlocked>true</isUnlocked>
+ <operator>notContain</operator>
+ <value>TEST,濂ユ灄宸存柉</value>
+ </criteriaItems>
+ <criteriaItems>
+ <column>Consumable_order_details2__c.NotShow_data__c</column>
+ <columnToColumn>false</columnToColumn>
+ <isUnlocked>true</isUnlocked>
+ <operator>equals</operator>
+ <value>0</value>
+ </criteriaItems>
+ <criteriaItems>
+ <column
+ >Consumable_order_details2__c.Is_DangerousChemicals__c</column>
+ <columnToColumn>false</columnToColumn>
+ <isUnlocked>true</isUnlocked>
+ <operator>equals</operator>
+ <value>0</value>
+ </criteriaItems>
+ <language>zh_CN</language>
+ </filter>
+ <format>Tabular</format>
+ <name>缁忛攢鍟嗗嚭璐�/閿�鍞姤琛�(2)鎸夌鐞嗙紪鐮� 鐨勫壇鏈�</name>
+ <params>
+ <name>co</name>
+ <value>1</value>
+ </params>
+ <reportType>CustomEntity$Consumable_order_details2__c</reportType>
+ <scope>organization</scope>
+ <showDetails>true</showDetails>
+ <showGrandTotal>true</showGrandTotal>
+ <showSubTotals>true</showSubTotals>
+ <timeFrameFilter>
+ <dateColumn>Consumable_order_details2__c.Product_OutDate__c</dateColumn>
+ <interval>INTERVAL_PREVCURFY</interval>
+ </timeFrameFilter>
+</Report>
diff --git a/force-app/main/default/reports/Store_Custom_ReportLink/new_report_0iF.report-meta.xml b/force-app/main/default/reports/Store_Custom_ReportLink/new_report_0iF.report-meta.xml
new file mode 100644
index 0000000..eac0975
--- /dev/null
+++ b/force-app/main/default/reports/Store_Custom_ReportLink/new_report_0iF.report-meta.xml
@@ -0,0 +1,142 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<Report xmlns="http://soap.sforce.com/2006/04/metadata">
+ <columns>
+ <field>CUST_NAME</field>
+ </columns>
+ <columns>
+ <field>Consumable_order_details2__c.Opportunity_No__c</field>
+ </columns>
+ <columns>
+ <field>Consumable_order_details2__c.ContractNo_text__c</field>
+ </columns>
+ <columns>
+ <field>Consumable_order_details2__c.Dealer_Info_text__c</field>
+ </columns>
+ <columns>
+ <field>Consumable_order_details2__c.Category3__c</field>
+ </columns>
+ <columns>
+ <field>Consumable_order_details2__c.Order_date__c</field>
+ </columns>
+ <columns>
+ <field>Consumable_order_details2__c.Consumable_product__c</field>
+ </columns>
+ <columns>
+ <field>Consumable_order_details2__c.Product_name__c</field>
+ </columns>
+ <columns>
+ <field>Consumable_order_details2__c.SerialLotNo__c</field>
+ </columns>
+ <columns>
+ <field>Consumable_order_details2__c.OT_Code__c</field>
+ </columns>
+ <columns>
+ <field>Consumable_order_details2__c.CFDA_Status__c</field>
+ </columns>
+ <columns>
+ <field
+ >Consumable_order_details2__c.Report_Product_Approbation__c</field>
+ </columns>
+ <columns>
+ <field>Consumable_order_details2__c.Report_Product_Expiration__c</field>
+ </columns>
+ <columns>
+ <field>Consumable_order_details2__c.Product_Date__c</field>
+ </columns>
+ <columns>
+ <field>Consumable_order_details2__c.Sterilization_limit__c</field>
+ </columns>
+ <columns>
+ <field>Consumable_order_details2__c.Bar_Code__c</field>
+ </columns>
+ <columns>
+ <field>Consumable_order_details2__c.DICode__c</field>
+ </columns>
+ <columns>
+ <aggregateTypes>Sum</aggregateTypes>
+ <field>Consumable_order_details2__c.Intra_Trade_List_RMB__c</field>
+ </columns>
+ <columns>
+ <field>Consumable_order_details2__c.Deliver_date__c</field>
+ </columns>
+ <columns>
+ <field>Consumable_order_details2__c.Arrive_date__c</field>
+ </columns>
+ <currency>CNY</currency>
+ <filter>
+ <criteriaItems>
+ <column>CUST_RECORDTYPE</column>
+ <columnToColumn>false</columnToColumn>
+ <isUnlocked>true</isUnlocked>
+ <operator>equals</operator>
+ <value>Consumable_order_details2__c.Detail2_Delivery</value>
+ </criteriaItems>
+ <criteriaItems>
+ <column>Consumable_order_details2__c.Dealer_Arrive__c</column>
+ <columnToColumn>false</columnToColumn>
+ <isUnlocked>true</isUnlocked>
+ <operator>equals</operator>
+ <value>1</value>
+ </criteriaItems>
+ <criteriaItems>
+ <column>Consumable_order_details2__c.Dealer_Shipment__c</column>
+ <columnToColumn>false</columnToColumn>
+ <isUnlocked>true</isUnlocked>
+ <operator>equals</operator>
+ <value>0</value>
+ </criteriaItems>
+ <criteriaItems>
+ <column>Consumable_order_details2__c.Dealer_Saled__c</column>
+ <columnToColumn>false</columnToColumn>
+ <isUnlocked>true</isUnlocked>
+ <operator>equals</operator>
+ <value>0</value>
+ </criteriaItems>
+ <criteriaItems>
+ <column>Consumable_order_details2__c.Lose_Flag__c</column>
+ <columnToColumn>false</columnToColumn>
+ <isUnlocked>true</isUnlocked>
+ <operator>equals</operator>
+ <value>0</value>
+ </criteriaItems>
+ <criteriaItems>
+ <column>Consumable_order_details2__c.Bar_Code__c</column>
+ <columnToColumn>false</columnToColumn>
+ <isUnlocked>true</isUnlocked>
+ <operator>notEqual</operator>
+ <value />
+ </criteriaItems>
+ <criteriaItems>
+ <column>Consumable_order_details2__c.Dealer_Info_text__c</column>
+ <columnToColumn>false</columnToColumn>
+ <isUnlocked>true</isUnlocked>
+ <operator>notContain</operator>
+ <value>TEST,濂ユ灄宸存柉</value>
+ </criteriaItems>
+ <criteriaItems>
+ <column
+ >Consumable_order_details2__c.Is_DangerousChemicals__c</column>
+ <columnToColumn>false</columnToColumn>
+ <isUnlocked>true</isUnlocked>
+ <operator>equals</operator>
+ <value>0</value>
+ </criteriaItems>
+ <language>zh_CN</language>
+ </filter>
+ <format>Tabular</format>
+ <name>缁忛攢鍟嗗簱瀛�</name>
+ <params>
+ <name>co</name>
+ <value>1</value>
+ </params>
+ <reportType>CustomEntity$Consumable_order_details2__c</reportType>
+ <scope>organization</scope>
+ <showDetails>true</showDetails>
+ <showGrandTotal>true</showGrandTotal>
+ <showSubTotals>true</showSubTotals>
+ <timeFrameFilter>
+ <dateColumn
+ >Consumable_order_details2__c.Guarantee_period_for_products__c</dateColumn>
+ <interval>INTERVAL_CUSTOM</interval>
+ </timeFrameFilter>
+</Report>
diff --git a/force-app/main/default/triggers/ConsumableOrderDetail2Trigger.trigger b/force-app/main/default/triggers/ConsumableOrderDetail2Trigger.trigger
index 0fedc68..8529340 100644
--- a/force-app/main/default/triggers/ConsumableOrderDetail2Trigger.trigger
+++ b/force-app/main/default/triggers/ConsumableOrderDetail2Trigger.trigger
@@ -1,66 +1,63 @@
-trigger ConsumableOrderDetail2Trigger on Consumable_order_details2__c(after insert, after update, after delete) {
+trigger ConsumableOrderDetail2Trigger on Consumable_order_details2__c (after insert, after update, after delete) {
Set<String> orderSet = new Set<String>();
-
+
if (StaticParameter.EscapeOrderDetail2Trigger) {
- return;
+ return ;
}
- if (Trigger.isInsert) {
- for (Consumable_order_details2__c local : Trigger.New) {
- if (local.Consumable_order_minor__c != null && local.Dealer_Returned__c == false)
- orderSet.add(local.Consumable_order_minor__c);
+ if (trigger.isInsert){
+ for (Consumable_order_details2__c local : Trigger.New) {
+ if (local.Consumable_order_minor__c!=null &&
+ local.Dealer_Returned__c == false)
+ orderSet.add(local.Consumable_order_minor__c);
}
}
- if (Trigger.isUpdate) {
- for (Consumable_order_details2__c local : Trigger.New) {
+ if (trigger.isUpdate){
+ for (Consumable_order_details2__c local : Trigger.New) {
//if (local.Consumable_order_minor__c!=null &&
// local.Dealer_Arrive__c != Trigger.oldMap.get(local.Id).get('Dealer_Arrive__c'))
- if (local.Consumable_order_minor__c != null)
- orderSet.add(local.Consumable_order_minor__c);
+ if (local.Consumable_order_minor__c!=null) orderSet.add(local.Consumable_order_minor__c);
}
}
- if (Trigger.isDelete) {
+ if (trigger.isDelete){
for (Consumable_order_details2__c local : Trigger.old) {
- if (local.Consumable_order_minor__c != null)
- orderSet.add(local.Consumable_order_minor__c);
+ if (local.Consumable_order_minor__c!=null) orderSet.add(local.Consumable_order_minor__c);
}
}
- if (orderSet.size() > 0) {
+
+ if (orderSet.size()>0){
// 2018骞�8鏈�9鏃� HWAG-B3D9UV 鏇挎崲 SQL start by 寮犵帀灞�
- list<Consumable_order_details2__c> allresults = [
- SELECT Consumable_order_minor__c, Deliver_date__c, Dealer_Returned__c, Dealer_Arrive__c, RemoveBox_No__c, Cancellation_Date__c
+ list<Consumable_order_details2__c> allresults =
+ [SELECT Consumable_order_minor__c, Deliver_date__c,
+ Dealer_Returned__c, Dealer_Arrive__c, RemoveBox_No__c,Cancellation_Date__c
FROM Consumable_order_details2__c
- WHERE Consumable_order_minor__c IN :orderSet
- ];
+ WHERE Consumable_order_minor__c in :orderSet ];
// 2018骞�8鏈�9鏃� HWAG-B3D9UV end by 寮犵帀灞�
-
+
// 2018骞�8鏈�9鏃� HWAG-B3D9UV 鏇挎崲涓嬮潰鍘熸湁SQL 浣跨敤 map 瀹屾垚璧嬪�� start by 寮犵帀灞�
- map<string, Integer> orderSetResults = new Map<string, Integer>();
- for (Consumable_order_details2__c results1 : allresults) {
- if (
- results1.Dealer_Arrive__c == false ||
- results1.Dealer_Returned__c == true ||
- (results1.RemoveBox_No__c != null &&
- results1.RemoveBox_No__c != 1)
- ) {
+ map<string,Integer> orderSetResults = new map<string,Integer>();
+ for(Consumable_order_details2__c results1 : allresults){
+ if(results1.Dealer_Arrive__c == false || results1.Dealer_Returned__c== true
+ || (results1.RemoveBox_No__c !=null && results1.RemoveBox_No__c !=1)){
continue;
}
string Consumable_order_minor_str = String.valueOf(results1.Consumable_order_minor__c);
- if (orderSetResults.containsKey(Consumable_order_minor_str)) {
- orderSetResults.put(Consumable_order_minor_str, orderSetResults.get(Consumable_order_minor_str) + 1);
- } else {
- orderSetResults.put(Consumable_order_minor_str, 1);
+ if(orderSetResults.containsKey(Consumable_order_minor_str)){
+ orderSetResults.put(Consumable_order_minor_str,
+ orderSetResults.get(Consumable_order_minor_str)+1);
+ }else{
+ orderSetResults.put(Consumable_order_minor_str,1);
}
}
List<Consumable_Order__c> consumableOrderlist = new List<Consumable_Order__c>();
- for (String strOrder : orderSet) {
- Integer cnt = 0;
+ for (String strOrder:orderSet){
+ Integer cnt =0;
for (string key : orderSetResults.keySet()) {
- if (key.equals(strOrder)) {
+ if(key.equals(strOrder)){
cnt = orderSetResults.get(key);
break;
}
@@ -72,7 +69,7 @@
consumableOrderlist.add(consumableOrder);
}
// 2018骞�8鏈�9鏃� HWAG-B3D9UV 鏇挎崲涓嬮潰鍘熸湁SQL 浣跨敤 map 瀹屾垚璧嬪�� end end by 寮犵帀灞�
-
+
/* 2018骞�8鏈�9鏃� HWAG-B3D9UV 鍘熸湁SQL 涓庤祴鍊� start by 寮犵帀灞�
AggregateResult[] results = [SELECT Consumable_order_minor__c,count(Id) cnt
FROM Consumable_order_details2__c
@@ -98,57 +95,61 @@
}
2018骞�8鏈�9鏃� HWAG-B3D9UV 鍘熸湁SQL 涓庤祴鍊� end by 寮犵帀灞�
*/
- if (consumableOrderlist.size() > 0) {
- update consumableOrderlist;
+ if (consumableOrderlist.size() > 0){
+ update consumableOrderlist;
}
//鏇存柊娑堣�楀搧璁㈠崟鐨勫彂璐ф棩鏈�
// 2018骞�8鏈�9鏃� HWAG-B3D9UV 鏇挎崲涓嬮潰鍘熸湁SQL 浣跨敤 map 瀹屾垚璧嬪�� start by 寮犵帀灞�
- 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) {
+ 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);
- 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);
+ 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);
+ }else{
+ DeliverdateResults.put(Consumable_order_minor_str,results1.Deliver_date__c);
resultsKeySet.add(Consumable_order_minor_str);
}
//鑾峰彇鏈�鏃╁彂璐ф椂闂� 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);
+ 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);
resultsKeySet.add(Consumable_order_minor_str);
}
- } else {
- DeliverdateminResults.put(Consumable_order_minor_str, results1.Deliver_date__c);
+ }else{
+ DeliverdateminResults.put(Consumable_order_minor_str,results1.Deliver_date__c);
resultsKeySet.add(Consumable_order_minor_str);
}
//鑾峰彇鏈�鏃╁彂璐ф椂闂� pk part1 end
}
-
+
//涓や釜DeliverdateResults.keySet()锛孌eliverdateminResults.keySet() 鍚堝苟浣滀负涓�涓狶ist 锛岄亶鍘哃ist
//鑾峰彇鏈�鏃╁彂璐ф椂闂� pk part2 start
consumableOrderlist = new List<Consumable_Order__c>();
- for (string temp : resultsKeySet) {
+ for(string temp : resultsKeySet){
Consumable_Order__c consumableOrder1 = new Consumable_Order__c();
consumableOrder1.Id = temp;
- if (DeliverdateResults.get(temp) != null) {
+ if(DeliverdateResults.get(temp)!=null){
consumableOrder1.Shipment_Date__c = DeliverdateResults.get(temp);
}
- if (DeliverdateminResults.get(temp) != null) {
+ 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()) {
@@ -159,9 +160,9 @@
// consumableOrderminlist.add(consumableOrder1);
// }
// }
-
+
// 2018骞�8鏈�9鏃� HWAG-B3D9UV 鏇挎崲涓嬮潰鍘熸湁SQL 浣跨敤 map 瀹屾垚璧嬪�� end by 寮犵帀灞�
-
+
//鑾峰彇鏃╁彂璐ф棩鏈� start
// system.debug('DeliverdateResults==============' + DeliverdateResults);
// system.debug('璧板埌鏈�鏃╁彂璐ф棩鏈�');
@@ -193,7 +194,7 @@
// }
// if(consumableOrderminlist.size() > 0){
- // update consumableOrderminlist;
+ // update consumableOrderminlist;
// }
// system.debug('DeliverdateResults==============' + DeliverdateResults);
// //鑾峰彇鏈�鏃╁彂璐ф棩鏈� end
@@ -216,29 +217,31 @@
}
}
2018骞�8鏈�9鏃� HWAG-B3D9UV 鍘熸湁SQL 涓庤祴鍊� end by 寮犵帀灞� */
- if (consumableOrderlist.size() > 0) {
- update consumableOrderlist;
+ if (consumableOrderlist.size() > 0){
+ update consumableOrderlist;
}
-
+
//鏇存柊寰呯‘璁ゆ敹璐ф暟閲�
// 2018骞�8鏈�9鏃� HWAG-B3D9UV 鏇挎崲涓嬮潰鍘熸湁SQL 浣跨敤 map 瀹屾垚璧嬪�� start by 寮犵帀灞�
- map<string, Integer> resultsMap2 = new Map<string, Integer>();
- for (Consumable_order_details2__c results1 : allresults) {
- if (results1.Dealer_Arrive__c == true || results1.Dealer_Returned__c == true || results1.Cancellation_Date__c != null) {
+ map<string,Integer> resultsMap2 = new map<string,Integer>();
+ for(Consumable_order_details2__c results1 : allresults){
+ if(results1.Dealer_Arrive__c == true || results1.Dealer_Returned__c== true ||
+ results1.Cancellation_Date__c!=null){
continue;
}
string Consumable_order_minor_str = String.valueOf(results1.Consumable_order_minor__c);
- if (resultsMap2.containsKey(Consumable_order_minor_str)) {
- resultsMap2.put(Consumable_order_minor_str, resultsMap2.get(Consumable_order_minor_str) + 1);
- } else {
- resultsMap2.put(Consumable_order_minor_str, 1);
+ if(resultsMap2.containsKey(Consumable_order_minor_str)){
+ resultsMap2.put(Consumable_order_minor_str,
+ resultsMap2.get(Consumable_order_minor_str)+1);
+ }else{
+ resultsMap2.put(Consumable_order_minor_str,1);
}
}
consumableOrderlist = new List<Consumable_Order__c>();
- for (String strOrder : orderSet) {
- Integer cnt = 0;
+ for (String strOrder:orderSet){
+ Integer cnt =0;
for (string key : resultsMap2.keySet()) {
- if (key.equals(strOrder)) {
+ if(key.equals(strOrder)){
cnt = resultsMap2.get(key);
break;
}
@@ -247,14 +250,12 @@
Consumable_Order__c consumableOrder2 = new Consumable_Order__c();
consumableOrder2.Id = strOrder;
consumableOrder2.Delivery_detail_count__c = cnt;
- if (consumableOrder2.Delivery_detail_count__c == 0) {
- consumableOrder2.More_than_seven_days__c = 0;
- }
+ if(consumableOrder2.Delivery_detail_count__c == 0){consumableOrder2.More_than_seven_days__c = 0;}
consumableOrderlist.add(consumableOrder2);
}
// 2018骞�8鏈�9鏃� HWAG-B3D9UV 鏇挎崲涓嬮潰鍘熸湁SQL 浣跨敤 map 瀹屾垚璧嬪�� end by 寮犵帀灞�
-
+
/* 2018骞�8鏈�9鏃� HWAG-B3D9UV 鍘熸湁SQL 涓庤祴鍊� start by 寮犵帀灞�
AggregateResult[] results2 = [SELECT Consumable_order_minor__c,count(Id) cnt
FROM Consumable_order_details2__c
@@ -279,8 +280,8 @@
consumableOrderlist.add(consumableOrder2);
}
2018骞�8鏈�9鏃� HWAG-B3D9UV 鍘熸湁SQL 涓庤祴鍊� end by 寮犵帀灞� */
- if (consumableOrderlist.size() > 0) {
- update consumableOrderlist;
+ if (consumableOrderlist.size() > 0){
+ update consumableOrderlist;
}
}
//Back up by DTT - Li Jun 2023-06-14 Start for reduce soql times
@@ -291,12 +292,11 @@
//鍒拌揣鍜岃繑鍝佹椂,鐢熸垚鎴栦慨鏀规秷璐瑰搧璁㈣揣鏄庣粏
Set<String> arrivedSet = new Set<String>();
Set<String> returnSet = new Set<String>();
- if (Trigger.isUpdate || Trigger.isInsert || Trigger.isDelete) {
- if (Trigger.isUpdate || Trigger.isInsert) {
+ if (trigger.isUpdate || trigger.isInsert || trigger.isDelete){
+ if (trigger.isUpdate || trigger.isInsert){
for (Consumable_order_details2__c detail2 : Trigger.New) {
Consumable_order_details2__c oldDetail2 = null;
- if (Trigger.isUpdate)
- oldDetail2 = Trigger.oldMap.get(detail2.Id);
+ if (Trigger.isUpdate) oldDetail2 = Trigger.oldMap.get(detail2.Id);
if (detail2.Consumable_Arrived_order__c != null) {
arrivedSet.add(detail2.Consumable_Arrived_order__c);
}
@@ -306,8 +306,8 @@
}
}
}
- if (Trigger.isDelete) {
- for (Consumable_order_details2__c det2 : Trigger.old) {
+ if (trigger.isDelete){
+ for (Consumable_order_details2__c det2 : Trigger.old) {
if (det2.Consumable_Arrived_order__c != null) {
arrivedSet.add(det2.Consumable_Arrived_order__c);
}
@@ -318,25 +318,15 @@
}
}
System.debug('arrivedSet +++++' + arrivedSet);
- // 2018骞�8鏈�14鏃� HWAG-B3D9UV 鍦ㄨ繘琛孨FM110澶勭悊鏃� 璺宠繃arrivedset start by 寮犵帀灞�
+ // 2018骞�8鏈�14鏃� HWAG-B3D9UV 鍦ㄨ繘琛孨FM110澶勭悊鏃� 璺宠繃arrivedset start by 寮犵帀灞�
if (StaticParameter.EscapeConsumableOrderDetail2Trigger) {
- return;
+ return ;
}
- // 2018骞�8鏈�14鏃� HWAG-B3D9UV 鍦ㄨ繘琛孨FM110澶勭悊鏃� 璺宠繃arrivedset start by 寮犵帀灞�
+ // 2018骞�8鏈�14鏃� HWAG-B3D9UV 鍦ㄨ繘琛孨FM110澶勭悊鏃� 璺宠繃arrivedset start by 寮犵帀灞�
if (arrivedSet.size() > 0) {
- 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>();
+ 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>();
for (Consumable_orderdetails__c detail1 : detail1List) {
String key = '' + detail1.Consumable_order__c + detail1.Asset_Model_No__c;
detail1Map.put(key, detail1);
@@ -349,25 +339,21 @@
}
}
- AggregateResult[] results = [
- SELECT Consumable_Arrived_order__c, Asset_Model_No__c, count(bar_code__c) recordCount
- FROM Consumable_order_details2__c
- WHERE
- Consumable_Arrived_order__c IN :arrivedSet
- AND Dealer_Arrive__c = TRUE
- //and Dealer_Returned__c <> true
- AND (RemoveBox_No__c = NULL
- OR RemoveBox_No__c = 1)
- GROUP BY Consumable_Arrived_order__c, Asset_Model_No__c
- ];
+ AggregateResult[] results = [select Consumable_Arrived_order__c, Asset_Model_No__c, count(bar_code__c) recordCount
+ from Consumable_order_details2__c
+ where Consumable_Arrived_order__c in :arrivedSet
+ and Dealer_Arrive__c = true
+ //and Dealer_Returned__c <> true
+ AND (RemoveBox_No__c=null or RemoveBox_No__c=1)
+ group by Consumable_Arrived_order__c, Asset_Model_No__c];
Map<String, Integer> keyCount = new Map<String, Integer>();
-
- for (AggregateResult ar : results) {
+
+ for(AggregateResult ar: results){
String key = '' + ar.get('Consumable_Arrived_order__c') + ar.get('Asset_Model_No__c');
keyCount.put(key, Integer.valueOf(ar.get('recordCount')));
}
//Back up by DTT - Li Jun 2023-06-14 Start
- // 2018骞�8鏈�9鏃� HWAG-B3D9UV 鏇夸唬涓嬮潰SQL select start by 寮犵帀灞�
+ // 2018骞�8鏈�9鏃� HWAG-B3D9UV 鏇夸唬涓嬮潰SQL select start by 寮犵帀灞�
// List<RecordType> rtList = new List<RecordType>();
// for(RecordType rtl : allrtList){
// if('Detail1_Arrival'.equals(rtl.DeveloperName)){
@@ -375,7 +361,7 @@
// }
// }
// 2018骞�8鏈�9鏃� HWAG-B3D9UV 鏇夸唬涓嬮潰SQL select end by 寮犵帀灞�
- //Back up by DTT - Li Jun 2023-06-14 End
+ //Back up by DTT - Li Jun 2023-06-14 End
/* 2018骞�8鏈�9鏃� HWAG-B3D9UV 鍘熻幏鍙� recordtype start by 寮犵帀灞�
List<RecordType> rtList = [select Id from RecordType where DeveloperName = 'Detail1_Arrival' and SobjectType = 'Consumable_orderdetails__c'];
@@ -383,52 +369,45 @@
//Back up by DTT - Li Jun 2023-06-14 Start
// Id recordTypeId = null;
// if (rtList.size() > 0) recordTypeId = rtList[0].Id;
- //Back up by DTT - Li Jun 2023-06-14 End
- Id recordtypeId = Schema.SObjectType.Consumable_Orderdetails__c.getRecordTypeInfosByDeveloperName()
- .get('Detail1_Arrival')
- .getRecordTypeId();
- results = [
- SELECT Consumable_order__c, count(Id) noCount
- FROM Consumable_orderdetails__c
- WHERE Consumable_order__c IN :arrivedSet
- GROUP BY Consumable_order__c
- ];
+ //Back up by DTT - Li Jun 2023-06-14 End
+ Id recordtypeId = Schema.SObjectType.Consumable_Orderdetails__c.getRecordTypeInfosByDeveloperName().get('Detail1_Arrival').getRecordTypeId();
+ results = [select Consumable_order__c, count(Id) noCount
+ from Consumable_orderdetails__c
+ where Consumable_order__c in :arrivedSet
+ group by Consumable_order__c];
System.debug('results +++++' + results);
Map<Id, Integer> noCount = new Map<Id, Integer>();
- for (AggregateResult ar : results) {
- noCount.put((Id) ar.get('Consumable_order__c'), Integer.valueOf(ar.get('noCount')));
+ for(AggregateResult ar: results){
+ noCount.put((Id)ar.get('Consumable_order__c'), Integer.valueOf(ar.get('noCount')));
}
System.debug('noCount +++++' + noCount);
Map<String, Consumable_orderdetails__c> upsertMap = new Map<String, Consumable_orderdetails__c>();
Map<String, Consumable_orderdetails__c> deletetMap = new Map<String, Consumable_orderdetails__c>();
Map<String, String> assetModelNoMap = new Map<String, String>();
- if (Trigger.isUpdate || Trigger.isInsert) {
- for (Consumable_order_details2__c detail2 : Trigger.New) {
+ if (trigger.isUpdate || trigger.isInsert){
+ for (Consumable_order_details2__c detail2 : Trigger.New) {
//Dataloader銇у垵鏈熷湪搴櫥閷层倰銇椼仧銇傘仺銆併儑銉笺偪淇銇屽叆銇c仧銇ㄣ亶銇槑绱�1銇屾洿鏂般仌銈屻仾銇勩��
- //if (trigger.isUpdate && detail2.ManualRegisteredStock__c == true) continue;
- if (detail2.Consumable_Arrived_order__c == null)
- continue;
+ //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;
//if (upsertMap.get(key) != null) continue;
Integer count = keyCount.get(key);
Consumable_orderdetails__c detail1 = detail1Map.get(key);
- if (detail1 == null)
- detail1 = new Consumable_orderdetails__c();
+ if (detail1 == null) detail1 = new Consumable_orderdetails__c();
detail1.Consumable_Arrivecount__c = count;
if (detail1.Id == null) {
Consumable_order__c co = arrivedMap.get(detail2.Consumable_Arrived_order__c);
Integer index = noCount.get(co.Id);
- if (index == null)
- index = 0;
- if (assetModelNoMap.containsKey(detail2.Asset_Model_No__c)) {
+ if (index == null) index = 0;
+ if(assetModelNoMap.containsKey(detail2.Asset_Model_No__c)){
continue;
- } else {
+ }else{
assetModelNoMap.put(detail2.Asset_Model_No__c, detail2.Asset_Model_No__c);
noCount.put(co.Id, index + 1);
}
noCount.put(co.Id, index + 1);
- String newName = co.Name + '-';
+ String newName = co.Name+'-';
System.debug('index +++++' + index);
if (index < 99) {
newName += '0';
@@ -445,83 +424,80 @@
detail1.RecordTypeId = recordTypeId;
//detail1.Consumable_principal__c = co.Id;
detail1.Intra_Trade_List_RMB__c = detail2.Intra_Trade_List_RMB__c;
+
}
upsertMap.put(key, detail1);
}
}
- if (Trigger.isUpdate) {
- for (Consumable_order_details2__c detail2 : Trigger.old) {
- //Dataloader銇у垵鏈熷湪搴櫥閷层倰銇椼仧銇傘仺銆併儑銉笺偪淇銇屽叆銇c仧銇ㄣ亶銇槑绱�1銇屾洿鏂般仌銈屻仾銇勩��
- //if (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;
+ if (trigger.isUpdate){
+ for (Consumable_order_details2__c detail2 : Trigger.old) {
+ //Dataloader銇у垵鏈熷湪搴櫥閷层倰銇椼仧銇傘仺銆併儑銉笺偪淇銇屽叆銇c仧銇ㄣ亶銇槑绱�1銇屾洿鏂般仌銈屻仾銇勩��
+ //if (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;
//if (upsertMap.get(key) != null) continue;
- Integer count = keyCount.get(key);
+ Integer count = keyCount.get(key);
Consumable_orderdetails__c detail1 = detail1Map.get(key);
- if ((count == null || count == 0) && detail1 != null) {
+ if ((count == null || count ==0) && detail1 !=null){
//delete detail1;
- deletetMap.put(key, detail1);
+ deletetMap.put(key,detail1);
continue;
}
- if (detail1 == null)
- continue;
+ if (detail1 == null) continue;
detail1.Consumable_Arrivecount__c = count;
if (detail1.Id == null) {
- Consumable_order__c co = arrivedMap.get(detail2.Consumable_Arrived_order__c);
- Integer index = noCount.get(co.Id);
- if (index == null)
- index = 0;
- System.debug('indexUp +++++' + index);
- noCount.put(co.Id, index + 1);
- System.debug('noCountUp +++++' + noCount);
- String newName = co.Name + '-';
- if (index < 99) {
- newName += '0';
- }
- if (index < 9) {
- newName += '0';
- }
- newName += String.valueOf(index + 1);
- System.debug('newNameUp +++++' + newName);
- detail1.Name = newName;
- //detail1.Asset_Model_No__c = detail2.Asset_Model_No__c;
- detail1.Consumable_product__c = detail2.Consumable_product__c;
- detail1.Consumable_order__c = co.Id;
- detail1.RecordTypeId = recordTypeId;
- //detail1.Consumable_principal__c = co.Id;
- detail1.Intra_Trade_List_RMB__c = detail2.Intra_Trade_List_RMB__c;
+ Consumable_order__c co = arrivedMap.get(detail2.Consumable_Arrived_order__c);
+ Integer index = noCount.get(co.Id);
+ if (index == null) index = 0;
+ System.debug('indexUp +++++' + index);
+ noCount.put(co.Id, index + 1);
+ System.debug('noCountUp +++++' + noCount);
+ String newName = co.Name+'-';
+ if (index < 99) {
+ newName += '0';
+ }
+ if (index < 9) {
+ newName += '0';
+ }
+ newName += String.valueOf(index + 1);
+ System.debug('newNameUp +++++' + newName);
+ detail1.Name = newName;
+ //detail1.Asset_Model_No__c = detail2.Asset_Model_No__c;
+ detail1.Consumable_product__c = detail2.Consumable_product__c;
+ detail1.Consumable_order__c = co.Id;
+ detail1.RecordTypeId = recordTypeId;
+ //detail1.Consumable_principal__c = co.Id;
+ detail1.Intra_Trade_List_RMB__c = detail2.Intra_Trade_List_RMB__c;
+
+
}
upsertMap.put(key, detail1);
}
}
- if (Trigger.isDelete) {
+ if (trigger.isDelete){
for (Consumable_order_details2__c detail2 : Trigger.old) {
- if (detail2.Consumable_Arrived_order__c == null)
- continue;
+ if (detail2.Consumable_Arrived_order__c == null) continue;
String key = '' + detail2.Consumable_Arrived_order__c + detail2.Asset_Model_No__c;
//if (upsertMap.get(key) != null) continue;
Integer count = keyCount.get(key);
Consumable_orderdetails__c detail1 = detail1Map.get(key);
- if ((count == null || count == 0) && detail1 != null) {
+ if ((count == null || count ==0) && detail1 !=null){
//delete detail1;
- deletetMap.put(key, detail1);
+ deletetMap.put(key,detail1);
continue;
}
- if (detail1 == null)
- detail1 = new Consumable_orderdetails__c();
+ if (detail1 == null) detail1 = new Consumable_orderdetails__c();
detail1.Consumable_Arrivecount__c = count;
if (detail1.Id == null) {
Consumable_order__c co = arrivedMap.get(detail2.Consumable_Arrived_order__c);
Integer index = noCount.get(co.Id);
- if (index == null)
- index = 0;
+ if (index == null) index = 0;
noCount.put(co.Id, index + 1);
- String newName = co.Name + '-';
+ String newName = co.Name+'-';
if (index < 99) {
newName += '0';
}
@@ -536,39 +512,31 @@
detail1.RecordTypeId = recordTypeId;
//detail1.Consumable_principal__c = co.Id;
detail1.Intra_Trade_List_RMB__c = detail2.Intra_Trade_List_RMB__c;
+
}
upsertMap.put(key, detail1);
}
}
Database.upsert(upsertMap.values(), true);
- if (deletetMap.size() > 0) {
- Database.delete(deletetMap.values(), true);
+ if(deletetMap.size()>0){
+ Database.delete(deletetMap.values(),true);
}
+
}
}
- // 2018骞�8鏈�14鏃� HWAG-B3D9UV 鍦ㄨ繘琛孨FM110澶勭悊鏃� 璺宠繃returnSet start by 寮犵帀灞�
-
- if (Trigger.isUpdate || Trigger.isInsert) {
- if (StaticParameter.EscapeConsumableOrderDetail2Trigger) {
- return;
- }
// 2018骞�8鏈�14鏃� HWAG-B3D9UV 鍦ㄨ繘琛孨FM110澶勭悊鏃� 璺宠繃returnSet start by 寮犵帀灞�
- if (returnSet.size() > 0) {
- Map<Id, Consumable_order__c> returnMap = new Map<Id, Consumable_order__c>(
- [
- SELECT Id, RecordType.DeveloperName, Name
- FROM Consumable_order__c
- WHERE Id IN :returnSet
- ]
- );
- 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 :returnSet
- ];
- Map<String, Consumable_orderdetails__c> detail1Map = new Map<String, Consumable_orderdetails__c>();
+ if (trigger.isUpdate || trigger.isInsert){
+ if (StaticParameter.EscapeConsumableOrderDetail2Trigger) {
+ return ;
+ }
+ // 2018骞�8鏈�14鏃� HWAG-B3D9UV 鍦ㄨ繘琛孨FM110澶勭悊鏃� 璺宠繃returnSet start by 寮犵帀灞�
+ if (returnSet.size() > 0) {
+ Map<Id, Consumable_order__c> returnMap = new Map<Id, Consumable_order__c>([select Id, RecordType.DeveloperName, Name from Consumable_order__c where Id in :returnSet]);
+ 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 :returnSet];
+ Map<String,Consumable_orderdetails__c> detail1Map = new Map<String,Consumable_orderdetails__c>();
+
for (Consumable_orderdetails__c detail1 : detail1List) {
String key = '' + detail1.Consumable_order__c + detail1.Asset_Model_No__c;
detail1Map.put(key, detail1);
@@ -581,18 +549,17 @@
}
}
- AggregateResult[] results = [
- SELECT Consumable_Return_order__c, Asset_Model_No__c, count(Id) recordCount
- FROM Consumable_order_details2__c
- WHERE Consumable_Return_order__c IN :returnSet AND Dealer_Returned__c = TRUE
- GROUP BY Consumable_Return_order__c, Asset_Model_No__c
- ];
+ AggregateResult[] results = [select Consumable_Return_order__c, Asset_Model_No__c, count(Id) recordCount
+ from Consumable_order_details2__c
+ where Consumable_Return_order__c in :returnSet
+ and Dealer_Returned__c = true
+ group by Consumable_Return_order__c, Asset_Model_No__c];
Map<String, Integer> keyCount = new Map<String, Integer>();
- for (AggregateResult ar : results) {
+ for(AggregateResult ar: results){
String key = '' + ar.get('Consumable_Return_order__c') + ar.get('Asset_Model_No__c');
keyCount.put(key, Integer.valueOf(ar.get('recordCount')));
}
- //Back up by DTT - Li Jun 2023-06-14 Start for reduce soql times
+ //Back up by DTT - Li Jun 2023-06-14 Start for reduce soql times
// 2018骞�8鏈�9鏃� HWAG-B3D9UV 鏇夸唬涓嬮潰SQL select start by 寮犵帀灞�
// List<RecordType> rtList = new List<RecordType>();
// for(RecordType rtl : allrtList){
@@ -601,25 +568,21 @@
// }
// }
// 2018骞�8鏈�9鏃� HWAG-B3D9UV 鏇夸唬涓嬮潰SQL select end by 寮犵帀灞�
- //Back up by DTT - Li Jun 2023-06-14 End
+ //Back up by DTT - Li Jun 2023-06-14 End
/* 2018骞�8鏈�9鏃� HWAG-B3D9UV 鍘熻幏鍙� recordtype start by 寮犵帀灞�
List<RecordType> rtList = [select Id from RecordType where DeveloperName = 'Detail1_ReturnGoods' and SobjectType = 'Consumable_orderdetails__c'];
2018骞�8鏈�9鏃� HWAG-B3D9UV 鍘熻幏鍙� recordtype end by 寮犵帀灞� */
- Id recordTypeId = Schema.SObjectType.Consumable_Orderdetails__c.getRecordTypeInfosByDeveloperName()
- .get('Detail1_ReturnGoods')
- .getRecordTypeId();
+ Id recordTypeId = Schema.SObjectType.Consumable_Orderdetails__c.getRecordTypeInfosByDeveloperName().get('Detail1_ReturnGoods').getRecordTypeId();
//if (rtList.size() > 0) recordTypeId = rtList[0].Id;
- results = [
- SELECT Consumable_order__c, count(Id) noCount
- FROM Consumable_orderdetails__c
- WHERE Consumable_order__c IN :returnSet
- GROUP BY Consumable_order__c
- ];
+ results = [select Consumable_order__c, count(Id) noCount
+ from Consumable_orderdetails__c
+ where Consumable_order__c in :returnSet
+ group by Consumable_order__c];
Map<Id, Integer> noCount = new Map<Id, Integer>();
- for (AggregateResult ar : results) {
- noCount.put((Id) ar.get('Consumable_order__c'), Integer.valueOf(ar.get('noCount')));
+ for(AggregateResult ar: results){
+ noCount.put((Id)ar.get('Consumable_order__c'), Integer.valueOf(ar.get('noCount')));
}
Map<String, Consumable_orderdetails__c> upsertMap = new Map<String, Consumable_orderdetails__c>();
@@ -634,35 +597,25 @@
for (Consumable_order_details2__c detail2 : Trigger.New) {
Consumable_order_details2__c oldDetail2 = null;
- if (detail2.Consumable_Return_order__c == null)
- continue;
+ if (detail2.Consumable_Return_order__c == null) continue;
String key = '' + detail2.Consumable_Return_order__c + detail2.Asset_Model_No__c;
- if (Trigger.isUpdate)
- oldDetail2 = Trigger.oldMap.get(detail2.Id);
+ if(Trigger.isUpdate) oldDetail2 = Trigger.oldMap.get(detail2.Id);
if (oldDetail2 != null) {
if (keyCount.containsKey(key)) {
returnCount += 1;
if (oldDetail2.Consumable_Sale_order__c != null) {
- Integer sCount = updatedSaleCount.containsKey(
- '' + oldDetail2.Consumable_Sale_order__c + detail2.Asset_Model_No__c
- )
- ? updatedSaleCount.get('' + oldDetail2.Consumable_Sale_order__c + detail2.Asset_Model_No__c)
- : 0;
+ Integer sCount = updatedSaleCount.containsKey(''+oldDetail2.Consumable_Sale_order__c+detail2.Asset_Model_No__c) ? updatedSaleCount.get(''+oldDetail2.Consumable_Sale_order__c+detail2.Asset_Model_No__c) : 0;
sCount += 1;
- updatedSaleCount.put('' + oldDetail2.Consumable_Sale_order__c + detail2.Asset_Model_No__c, sCount);
+ updatedSaleCount.put(''+oldDetail2.Consumable_Sale_order__c+detail2.Asset_Model_No__c, sCount);
updatedSaleId.add(oldDetail2.Consumable_Sale_order__c);
}
if (oldDetail2.Consumable_Shipment_order__c != null) {
- Integer sCount = updatedShipmentCount.containsKey(
- '' + oldDetail2.Consumable_Shipment_order__c + detail2.Asset_Model_No__c
- )
- ? updatedShipmentCount.get('' + oldDetail2.Consumable_Shipment_order__c + detail2.Asset_Model_No__c)
- : 0;
+ Integer sCount = updatedShipmentCount.containsKey(''+oldDetail2.Consumable_Shipment_order__c+detail2.Asset_Model_No__c) ? updatedShipmentCount.get(''+oldDetail2.Consumable_Shipment_order__c+detail2.Asset_Model_No__c) : 0;
sCount += 1;
-
- updatedShipmentCount.put('' + oldDetail2.Consumable_Shipment_order__c + detail2.Asset_Model_No__c, sCount);
+
+ updatedShipmentCount.put(''+oldDetail2.Consumable_Shipment_order__c+detail2.Asset_Model_No__c, sCount);
updatedShipmentId.add(oldDetail2.Consumable_Shipment_order__c);
}
/*if (oldDetail2.Invoice_No__c != null) {
@@ -680,23 +633,20 @@
}*/
}
}
- if (upsertMap.get(key) != null)
- continue;
+ if (upsertMap.get(key) != null) continue;
Integer count = keyCount.get(key);
Consumable_orderdetails__c detail1 = detail1Map.get(key);
- if (detail1 == null)
- detail1 = new Consumable_orderdetails__c();
+ if (detail1 == null) detail1 = new Consumable_orderdetails__c();
detail1.RrturnPro_count__c = count;
if (detail1.Id == null) {
Consumable_order__c co = returnMap.get(detail2.Consumable_Return_order__c);
Integer index = noCount.get(co.Id);
- if (index == null)
- index = 0;
+ if (index == null) index = 0;
noCount.put(co.Id, index + 1);
- String newName = co.Name + '-';
+ String newName = co.Name+'-';
if (index < 99) {
newName += '0';
}
@@ -711,47 +661,47 @@
detail1.RecordTypeId = recordTypeId;
//detail1.Consumable_principal__c = co.Id;
detail1.Intra_Trade_List_RMB__c = detail2.Intra_Trade_List_RMB__c;
+
}
upsertMap.put(key, detail1);
}
Database.upsert(upsertMap.values(), true);
// 2018骞�8鏈�8鏃� HWAG-B3D9UV 鍑忓皯 select 鏁伴噺 start by 寮犵帀灞�
- List<Consumable_orderdetails__c> Consumable_orderdetailsList = [
- SELECT Id, Name, Asset_Model_No__c, RrturnPro_count__c, Consumable_order__c, Invoicedet1_OD_link__c
- FROM Consumable_orderdetails__c
- WHERE
- Consumable_order__c IN :updatedSaleId
- OR Consumable_order__c IN :updatedShipmentId
- OR Consumable_order__c IN :updatedConInvoiceId
- ];
-
- List<Consumable_orderdetails__c> detail1SaleList = new List<Consumable_orderdetails__c>();
-
- for (Consumable_orderdetails__c orderdetails : Consumable_orderdetailsList) {
- if (updatedSaleId.contains(orderdetails.id) && 'Sale'.equals(orderdetails.Consumable_order__r.RecordType.DeveloperName)) {
+ List<Consumable_orderdetails__c> Consumable_orderdetailsList =
+ [select Id, Name, Asset_Model_No__c, RrturnPro_count__c,
+ Consumable_order__c,Invoicedet1_OD_link__c
+ from Consumable_orderdetails__c
+ where Consumable_order__c in :updatedSaleId
+ or Consumable_order__c in :updatedShipmentId
+ or Consumable_order__c in :updatedConInvoiceId];
+
+ List<Consumable_orderdetails__c> detail1SaleList
+ = new List<Consumable_orderdetails__c>();
+
+ for (Consumable_orderdetails__c orderdetails : Consumable_orderdetailsList){
+ if(updatedSaleId.contains(orderdetails.id)
+ && 'Sale'.equals(orderdetails.Consumable_order__r.RecordType.DeveloperName)){
detail1SaleList.add(orderdetails);
}
}
- List<Consumable_orderdetails__c> detail1ShipmentList = new List<Consumable_orderdetails__c>();
+ List<Consumable_orderdetails__c> detail1ShipmentList
+ = new List<Consumable_orderdetails__c>();
- for (Consumable_orderdetails__c orderdetails : Consumable_orderdetailsList) {
- if (
- updatedShipmentId.contains(orderdetails.id) &&
- 'Shipment'.equals(orderdetails.Consumable_order__r.RecordType.DeveloperName)
- ) {
+ for (Consumable_orderdetails__c orderdetails : Consumable_orderdetailsList){
+ if(updatedShipmentId.contains(orderdetails.id)
+ && 'Shipment'.equals(orderdetails.Consumable_order__r.RecordType.DeveloperName)){
detail1ShipmentList.add(orderdetails);
}
}
- List<Consumable_orderdetails__c> detail1ConInvoiceList = new List<Consumable_orderdetails__c>();
+ List<Consumable_orderdetails__c> detail1ConInvoiceList
+ = new List<Consumable_orderdetails__c>();
- for (Consumable_orderdetails__c orderdetails : Consumable_orderdetailsList) {
- if (
- updatedConInvoiceId.contains(orderdetails.id) &&
- 'Order_Invoice'.equals(orderdetails.Consumable_order__r.RecordType.DeveloperName)
- ) {
+ for (Consumable_orderdetails__c orderdetails : Consumable_orderdetailsList){
+ if(updatedConInvoiceId.contains(orderdetails.id)
+ && 'Order_Invoice'.equals(orderdetails.Consumable_order__r.RecordType.DeveloperName)){
detail1ConInvoiceList.add(orderdetails);
}
}
@@ -779,31 +729,23 @@
List<Consumable_orderdetails__c> updateData = new List<Consumable_orderdetails__c>();
for (Consumable_orderdetails__c detail1Sale : detail1SaleList) {
- Integer count = updatedSaleCount.get('' + detail1Sale.Consumable_order__c + detail1Sale.Asset_Model_No__c);
+ Integer count = updatedSaleCount.get(''+detail1Sale.Consumable_order__c+detail1Sale.Asset_Model_No__c);
if (count != null) {
detail1Sale.RrturnPro_count__c += count;
updateData.add(detail1Sale);
}
+
}
for (Consumable_orderdetails__c detail1Shipment : detail1ShipmentList) {
- Integer count = updatedShipmentCount.get('' + detail1Shipment.Consumable_order__c + detail1Shipment.Asset_Model_No__c);
+ Integer count = updatedShipmentCount.get(''+detail1Shipment.Consumable_order__c+detail1Shipment.Asset_Model_No__c);
if (count != null) {
detail1Shipment.RrturnPro_count__c += count;
updateData.add(detail1Shipment);
}
}
for (Consumable_orderdetails__c detail1ConInvoice : detail1ConInvoiceList) {
- Integer count = updatedConInvoiceCount.get(
- '' +
- detail1ConInvoice.Consumable_order__c +
- detail1ConInvoice.Invoicedet1_OD_link__c +
- detail1ConInvoice.Asset_Model_No__c
- );
- if (
- count != null &&
- (detail1ConInvoice.Invoicedet1_OD_link__c ==
- shipmentIdMap.get('' + detail1ConInvoice.Invoicedet1_OD_link__c + detail1ConInvoice.Asset_Model_No__c))
- ) {
+ Integer count = updatedConInvoiceCount.get(''+detail1ConInvoice.Consumable_order__c+detail1ConInvoice.Invoicedet1_OD_link__c+detail1ConInvoice.Asset_Model_No__c);
+ if (count != null && (detail1ConInvoice.Invoicedet1_OD_link__c == shipmentIdMap.get(''+detail1ConInvoice.Invoicedet1_OD_link__c+detail1ConInvoice.Asset_Model_No__c)) ) {
detail1ConInvoice.RrturnPro_count__c += count;
//updateData.add(detail1ConInvoice);
}
@@ -811,5 +753,6 @@
Database.upsert(updateData, true);
}
+
}
-}
+}
\ No newline at end of file
diff --git a/force-app/main/default/triggers/ConsumableOrderDetail2Trigger.trigger-meta.xml b/force-app/main/default/triggers/ConsumableOrderDetail2Trigger.trigger-meta.xml
index b571e13..7acf013 100644
--- a/force-app/main/default/triggers/ConsumableOrderDetail2Trigger.trigger-meta.xml
+++ b/force-app/main/default/triggers/ConsumableOrderDetail2Trigger.trigger-meta.xml
@@ -1,4 +1,4 @@
-<?xml version="1.0" encoding="UTF-8" ?>
+<?xml version="1.0" encoding="UTF-8"?>
<ApexTrigger xmlns="http://soap.sforce.com/2006/04/metadata">
<apiVersion>50.0</apiVersion>
<status>Active</status>
diff --git a/force-app/main/default/triggers/ContentDocumentLink.trigger b/force-app/main/default/triggers/ContentDocumentLink.trigger
index 12b8b8f..81c69ce 100644
--- a/force-app/main/default/triggers/ContentDocumentLink.trigger
+++ b/force-app/main/default/triggers/ContentDocumentLink.trigger
@@ -1,5 +1,9 @@
-trigger ContentDocumentLink on ContentDocumentLink(before delete, after insert) {
- if ((!Test.isRunningTest()) && UserInfo.getUserId() == System.Label.ByPassTrigger) {
+trigger ContentDocumentLink on ContentDocumentLink (before delete, after insert) {
+
+ System.debug('UserInfo.getUserId() = ' + UserInfo.getUserId());
+ System.debug('System.Label.ByPassTrigger = ' + System.Label.ByPassTrigger);
+ if((!Test.isRunningTest())&&UserInfo.getUserId()==System.Label.ByPassTrigger){
+ System.debug('enter ContentDocumentLink but UserInfo.getUserId()==System.Label.ByPassTrigger');
return;
}
system.debug('enter ContentDocumentLink');
@@ -43,6 +47,7 @@
// }
// }
+
if (rentalIds.size() > 0) {
List<Consumable_order__c> rentalList = new List<Consumable_order__c>();
for (Consumable_order__c ra : [SELECT Id FROM Consumable_order__c WHERE Id IN :rentalIds]) {
@@ -66,5 +71,4 @@
// System.debug('rentaldelList = ' + rentaldelList);
// ControllerUtil.delConsumableAccessoriesInvoiceSet(rentaldelList);
// }
-
-}
+}
\ No newline at end of file
diff --git a/force-app/main/default/triggers/ContentDocumentTrigger.trigger b/force-app/main/default/triggers/ContentDocumentTrigger.trigger
index f78e2b7..44da932 100644
--- a/force-app/main/default/triggers/ContentDocumentTrigger.trigger
+++ b/force-app/main/default/triggers/ContentDocumentTrigger.trigger
@@ -1,5 +1,8 @@
trigger ContentDocumentTrigger on ContentDocument(before delete) {
- if ((!Test.isRunningTest()) && UserInfo.getUserId() == System.Label.ByPassTrigger) {
+ System.debug('UserInfo.getUserId() = ' + UserInfo.getUserId());
+ System.debug('System.Label.ByPassTrigger = ' + System.Label.ByPassTrigger);
+ if((!Test.isRunningTest())&&UserInfo.getUserId()==System.Label.ByPassTrigger){
+ System.debug('enter ContentDocumentTrigger but UserInfo.getUserId()==System.Label.ByPassTrigger');
return;
}
System.debug('enter ContentDocumentTrigger');
@@ -64,4 +67,4 @@
System.debug('rentaldelList = ' + rentaldelList);
ControllerUtil.delConsumableAccessoriesInvoiceSet(rentaldelList);
}
-}
+}
\ No newline at end of file
diff --git a/manifest/LEXC02packagelexcommunityupdate.xml b/manifest/LEXC02packagelexcommunityupdate.xml
index 9481c04..7a2b7d9 100644
--- a/manifest/LEXC02packagelexcommunityupdate.xml
+++ b/manifest/LEXC02packagelexcommunityupdate.xml
@@ -24,6 +24,10 @@
<members>CreateTarget</members>
<members>RetrospectiveWeeklyReport</members>
<members>WeeklyReport</members>
+ <members>AgencyAccount</members>
+ <members>DealerPersonnelInformationImport</members>
+ <members>NewAgencyContact2</members>
+ <members>NewAgencyOpportunity</members>
<name>AuraDefinitionBundle</name>
</types>
<types>
diff --git a/manifest/LEXC03report2.xml b/manifest/LEXC03report2.xml
new file mode 100644
index 0000000..02812cb
--- /dev/null
+++ b/manifest/LEXC03report2.xml
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<Package xmlns="http://soap.sforce.com/2006/04/metadata">
+ <types>
+ <members>鐗圭害缁忛攢鍟哶鑷畾涔夐摼鎺ユ姤琛�/new_report_0iF</members>
+ <members>鐗圭害缁忛攢鍟哶鑷畾涔夐摼鎺ユ姤琛�/X2_Lky</members>
+ <name>Report</name>
+ </types>
+ <version>50.0</version>
+</Package>
diff --git a/manifest/packageForLex copy.xml b/manifest/packageForLex copy.xml
index fc2e0dd..a1b1641 100644
--- a/manifest/packageForLex copy.xml
+++ b/manifest/packageForLex copy.xml
@@ -1,14 +1,16 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<Package xmlns="http://soap.sforce.com/2006/04/metadata">
<types>
- <members>LexSaleOrderController</members>
- <members>LexConInvoiceViewController</members>
- <members>LexConInvoicedetailsController</members>
- <members>LexInventoryController</members>
- <members>LexOutboundorderImportController</members>
- <members>LexOverdueStockController</members>
- <members>LexInventoryViewControllerTest</members>
- <name>ApexClass</name>
+<<<<<<< HEAD:manifest/packageForLex copy.xml
+ <members>*</members>
+=======
+ <members>lexConsumableAccount</members>
+ <members>lexSummonsCreat</members>
+ <members>lexInventory</members>
+ <members>lexinventoryViewLWC</members>
+ <members>lexConsumable</members>
+>>>>>>> LEXCommunityLiJun:manifest/package.xml
+ <name>LightningComponentBundle</name>
</types>
<version>52.0</version>
</Package>
--
Gitblit v1.9.1