From e6068da47c1bef5517c9e5fdc8c726766867ad4e Mon Sep 17 00:00:00 2001
From: buli <137736985@qq.com>
Date: 星期五, 14 七月 2023 15:10:02 +0800
Subject: [PATCH] Merge branch 'master' into LEXUpgrade2023-Deloitte
---
force-app/main/default/classes/LexCancelRemoveBoxControllerTest.cls | 567
force-app/main/default/classes/LexArriveGoodsMainControllerTest.cls | 109
force-app/main/default/lwc/lexCustomInventoryColor/lexCustomInventoryColor.html | 18
force-app/main/default/lwc/lexSaleAndDelivery/lexSaleAndDelivery.js | 4
force-app/main/default/lwc/lexTopPage/lexTopPage.js | 12
force-app/main/default/classes/LexConsumableControllerTest.cls | 852 -
force-app/main/default/classes/LexProductLimitEditControllerTest.cls | 58
force-app/main/default/aura/DealerPersonnelInformationImport/DealerPersonnelInformationImportHelper.js | 71
force-app/main/default/classes/LexInventoryViewControllerTest.cls | 854 -
force-app/main/default/lwc/lexArriveGoodsMain/lexArriveGoodsMain.html | 4
force-app/main/default/classes/LexConsumableGoodsInfoTest.cls | 761 -
force-app/main/default/aura/RetrospectiveWeeklyReport/RetrospectiveWeeklyReport.css | 12
force-app/main/default/aura/CreateTarget/CreateTargetHelper.js | 586
force-app/main/default/classes/ArriveGoodsControllerTestV2.cls | 182
force-app/main/default/classes/LexSearchHospitalControllerTest.cls | 8
force-app/main/default/aura/NewAgencyOpportunity/NewAgencyOpportunity.cmp | 59
force-app/main/default/aura/RetrospectiveWeeklyReport/RetrospectiveWeeklyReportHelper.js | 2089 ---
force-app/main/default/classes/LexOutboundorderImportController.cls | 22
force-app/main/default/classes/LexConsumableAccountControllerTest.cls | 200
force-app/main/default/classes/LexInventoryControllerTest.cls | 821 -
force-app/main/default/classes/LexInventoryListControllerTest.cls | 96
force-app/main/default/lwc/customDeleteReasonComp/customDeleteReasonComp.html | 5
force-app/main/default/aura/WeeklyReport/WeeklyReport.cmp | 563
force-app/main/default/classes/LexSummonsCreatControllerTest.cls | 1392 --
force-app/main/default/classes/LexConsumableAccountSOQLTest.cls | 76
force-app/main/default/classes/LexConInvoiceListTest.cls | 123
force-app/main/default/permissionsets/Community_Consumable_LEX_PS.permissionset-meta.xml | 6
force-app/main/default/classes/LexArriveGoodsMainController.cls | 38
force-app/main/default/classes/LexConInvoiceViewController.cls | 53
force-app/main/default/classes/LexSaleAndDeliveryControllerTest.cls | 50
force-app/main/default/aura/WeeklyReport/WeeklyReportController.js | 297
force-app/main/default/lwc/lexInventory/lexInventory.js | 27
force-app/main/default/classes/LookupSearchResultTest.cls | 51
force-app/main/default/classes/LexUtilityTest.cls | 14
force-app/main/default/aura/RetrospectiveWeeklyReport/RetrospectiveWeeklyReport.cmp | 679 -
force-app/main/default/lwc/lexSaleAndDelivery/lexSaleAndDelivery.html | 8
force-app/main/default/aura/NewAgencyOpportunity/NewAgencyOpportunityHelper.js | 177
force-app/main/default/aura/NewAgencyOpportunity/NewAgencyOpportunity.css | 3
force-app/main/default/classes/Batch_FixAttachmentToFilesTest.cls | 46
force-app/main/default/pages/NewAndEditReport.page | 188
force-app/main/default/classes/LexSearchContractControllerTest.cls | 47
force-app/main/default/classes/Batch_FixAttachmentToFiles.cls | 95
force-app/main/default/aura/WeeklyReport/WeeklyReport.css | 74
force-app/main/default/aura/RetrospectiveWeeklyReport/RetrospectiveWeeklyReportController.js | 169
force-app/main/default/classes/LexSummonsCreatController.cls | 229
force-app/main/default/classes/LexOverdueStockController.cls | 107
force-app/main/default/lwc/customAccountUrlComp/customAccountUrlComp.js | 14
force-app/main/default/classes/LexInventoryListController.cls | 61
force-app/main/default/lwc/lexSummonsCreat/lexSummonsCreat.js | 2439 ----
force-app/main/default/classes/ResponseBodyLWCTest.cls | 7
force-app/main/default/classes/LexOverdueStockControllerTest.cls | 182
force-app/main/default/lwc/lexConInvoiceView/lexConInvoiceView.js | 4
force-app/main/default/classes/LexArriveGoodsControllerTest.cls | 351
force-app/main/default/lwc/customMydrComp/customMydrComp.js | 16
force-app/main/default/classes/LexConsumableAccountController.cls | 108
force-app/main/default/classes/ArriveGoodsController.cls | 4812 +------
force-app/main/default/classes/LexConsumableOrderManageController.cls | 25
force-app/main/default/classes/LexSaleOrderController.cls | 135
force-app/main/default/lwc/lexinventoryViewLWC/lexinventoryViewLWC.html | 11
force-app/main/default/lwc/lexTopPage/lexTopPage.html | 4
force-app/main/default/classes/LexUpAccountProLimitControllerTest.cls | 107
force-app/main/default/classes/LexSaleOrderControllerTest.cls | 1127 -
force-app/main/default/classes/DealerInquiryModifyStateController.cls | 281
force-app/main/default/classes/LexLicenceReminderControllerTest.cls | 153
force-app/main/default/classes/LexConInvoiceViewControllerTest.cls | 2827 ----
force-app/main/default/classes/lexSearchAgencyHospitalControllerTest.cls | 66
force-app/main/default/classes/LexInventoryController.cls | 115
force-app/main/default/classes/LexUpAccountProLimit.cls | 147
force-app/main/default/classes/LexConsumableOrderManageControllerTest.cls | 50
force-app/main/default/classes/LexConsumableController.cls | 94
force-app/main/default/lwc/customMydrComp/customMydrComp.html | 6
force-app/main/default/aura/WeeklyReport/WeeklyReportHelper.js | 2584 ----
force-app/main/default/classes/LexConInvoicedetailsControllerTest.cls | 172
force-app/main/default/pages/DealerInquiryModifyState.page | 524
force-app/main/default/aura/CreateTarget/CreateTarget.css | 8
force-app/main/default/classes/LexOutboundorderImportControllerTest.cls | 330
force-app/main/default/classes/DealerInquiryModifyStateControllerTest.cls | 311
force-app/main/default/classes/LexCancelRemoveBoxController.cls | 572
force-app/main/default/lwc/customAccountUrlComp/customAccountUrlComp.html | 9
force-app/main/default/lwc/lexInventory/lexInventory.html | 9
force-app/main/default/classes/LexRemoveBoxControllerTest.cls | 396
force-app/main/default/classes/NewRepairController.cls | 468
force-app/main/default/aura/DealerPersonnelInformationImport/DealerPersonnelInformationImport.cmp | 58
force-app/main/default/classes/LexTopPageControllerTest.cls | 328
force-app/main/default/classes/LexConsumableAccountSOQL.cls | 32
force-app/main/default/lwc/lexSummonsCreat/lexSummonsCreat.css | 31
force-app/main/default/lwc/lexConInvoiceView/lexConInvoiceView.html | 4
force-app/main/default/classes/LexArriveGoodsControllerTest1.cls | 178
force-app/main/default/lwc/lexArriveGoods/lexArriveGoods.html | 20
force-app/main/default/lwc/lexConsumableAccount/lexConsumableAccount.js | 74
force-app/main/default/lwc/lexArriveGoods/lexArriveGoods.js | 541
force-app/main/default/triggers/ConsumableOrderDetail2Trigger.trigger | 578
force-app/main/default/lwc/lexArriveGoodsMain/lexArriveGoodsMain.js | 4
force-app/main/default/lwc/lexinventoryViewLWC/lexinventoryViewLWC.js | 72
force-app/main/default/classes/LexConsumableAccountInfoControllerTest.cls | 19
force-app/main/default/lwc/lexConsumable/lexConsumable.js | 12
force-app/main/default/lwc/lexConsumable/lexConsumable.html | 10
force-app/main/default/triggers/ContentDocumentTrigger.trigger | 6
force-app/main/default/classes/LexArriveGsDetailsControllerTest.cls | 128
force-app/main/default/lwc/lexSummonsCreat/lexSummonsCreat.html | 947 -
force-app/main/default/triggers/ContentDocumentLink.trigger | 8
force-app/main/default/classes/ArriveGoodsControllerTest.cls | 2135 ---
force-app/main/default/aura/NewAgencyOpportunity/NewAgencyOpportunityController.js | 40
force-app/main/default/classes/LexConInvoicedetailsController.cls | 12
104 files changed, 1,584 insertions(+), 34,080 deletions(-)
diff --git a/force-app/main/default/aura/CreateTarget/CreateTarget.css b/force-app/main/default/aura/CreateTarget/CreateTarget.css
index 52e32ca..f17614f 100644
--- a/force-app/main/default/aura/CreateTarget/CreateTarget.css
+++ b/force-app/main/default/aura/CreateTarget/CreateTarget.css
@@ -5,16 +5,8 @@
display: none;
}
.THIS select {
-<<<<<<< HEAD
--lwc-lineHeightButton: 36px;
--lwc-heightInput: 36px;
min-height: 0px !important;
height: 36px !important;
}
-=======
- --lwc-lineHeightButton:36px;
- --lwc-heightInput:36px;
- min-height: 0px !important;
- height: 36px !important;
-}
->>>>>>> LEXCommunityLiJun
diff --git a/force-app/main/default/aura/CreateTarget/CreateTargetHelper.js b/force-app/main/default/aura/CreateTarget/CreateTargetHelper.js
index f3a37a4..5d97e95 100644
--- a/force-app/main/default/aura/CreateTarget/CreateTargetHelper.js
+++ b/force-app/main/default/aura/CreateTarget/CreateTargetHelper.js
@@ -1,5 +1,4 @@
({
-<<<<<<< HEAD
doinit: function (component, event, helper) {
component.set('v.OCMTerm', this.getOCMTerm());
if (component.get('v.recordId')) {
@@ -11,25 +10,11 @@
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") {
->>>>>>> LEXCommunityLiJun
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
-<<<<<<< HEAD
let agency = component.get('v.record');
agency.Agency_Hospital__c = select_ah;
// component.set("v.record", agency);
@@ -81,53 +66,11 @@
message: errors[0].message
});
toastEvent.fire();
-=======
- 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'
- }
- }];
- // 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);
- }
- } 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);
- }
- }
-
- } else if (state === "ERROR") {
- var errors = response.getError();
- var toastEvent = $A.get("e.force:showToast");
- toastEvent.setParams({
- "title": "閿欒",
- "type":"error",
- "message": errors[0].message
- });
- toastEvent.fire();
-
->>>>>>> LEXCommunityLiJun
}
});
$A.enqueueAction(action);
}
-<<<<<<< HEAD
var action = component.get('c.getProductList');
action.setCallback(this, function (response) {
var state = response.getState();
@@ -223,72 +166,17 @@
message: errors[0].message
});
toastEvent.fire();
-=======
- var action = component.get("c.getProductList");
- action.setCallback(this, function(response) {
- var state = response.getState();
- 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_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_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_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_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");
- toastEvent.setParams({
- title: "閿欒",
- type:"error",
- message: errors[0].message
- });
- toastEvent.fire();
-
->>>>>>> LEXCommunityLiJun
}
});
$A.enqueueAction(action);
},
-<<<<<<< HEAD
toggle_report: function (component, event, helper) {
-=======
- toggle_report : function(component, event, helper) {
->>>>>>> LEXCommunityLiJun
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');
-<<<<<<< HEAD
if (
$A.util.hasClass(modal_window, 'disp_none') &&
!component.get('v.recordId')
@@ -849,436 +737,10 @@
title: '鎴愬姛',
type: 'success',
message: '淇濆瓨鎴愬姛'
-=======
- 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;
- var myId;
- var o1Id;
- var o2Id;
- if (index == 1) {
- myId = cmpId + '1';
- o1Id = cmpId + '2';
- o2Id = cmpId + '3';
- } else if (index == 2){
- myId = cmpId + '2';
- o1Id = cmpId + '1';
- o2Id = cmpId + '3';
- } else {
- myId = cmpId + '3';
- o1Id = cmpId + '1';
- o2Id = cmpId + '2';
- }
-
- var product_category_id = component.find(myId).get('v.value');
- var pcId1 = component.find(o1Id).get('v.value');
- 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)) {
- this.warning('涓嶈兘閫夋嫨鍚屾牱鐨勪骇鍝佸尯鍒�');
- 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();
- var GIProduct_Category1 = '';
- var GIProduct_Category2 = '';
- var GIProduct_Category3 = '';
- var GIAim_Price__c1 = '';
- var GIAim_Price__c2 = '';
- var GIAim_Price__c3 = '';
- 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;
- }
- if (amountMap.GI.length > 2) {
- 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);
-
- }
- 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 = '';
- var ETProduct_Category3 = '';
- var ETAim_Price__c1 = '';
- var ETAim_Price__c2 = '';
- var ETAim_Price__c3 = '';
- 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;
- }
- if (amountMap.ET.length > 2) {
- 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);
-
-
- var BFProduct_Category1 = '';
- var BFProduct_Category2 = '';
- var BFProduct_Category3 = '';
- var BFAim_Price__c1 = '';
- var BFAim_Price__c2 = '';
- var BFAim_Price__c3 = '';
- 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;
- }
- if (amountMap.BF.length > 2) {
- 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);
-
-
- var OTHProduct_Category1 = '';
- var OTHProduct_Category2 = '';
- var OTHProduct_Category3 = '';
- var OTHAim_Price__c1 = '';
- 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;
- }
- if (amountMap.OTH.length > 2) {
- 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);
-
- var GSProduct_Category1 = '';
- var GSProduct_Category2 = '';
- var GSProduct_Category3 = '';
- var GSPAim_Price__c1 = '';
- var GSPAim_Price__c2 = '';
- var GSPAim_Price__c3 = '';
- 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;
- }
- if (amountMap.GS.length > 2) {
- 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);
-
- var UROProduct_Category1 = '';
- var UROProduct_Category2 = '';
- var UROProduct_Category3 = '';
- var UROAim_Price__c1 = '';
- 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;
- }
- if (amountMap.URO.length > 2) {
- 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);
-
-
- var GYNProduct_Category1 = '';
- var GYNProduct_Category2 = '';
- var GYNProduct_Category3 = '';
- var GYNAim_Price__c1 = '';
- 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;
- }
- if (amountMap.GYN.length > 2) {
- GYNProduct_Category3 = amountMap.GYN[2].Product_Category__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);
-
-
- var ENTProduct_Category1 = '';
- var ENTProduct_Category2 = '';
- var ENTProduct_Category3 = '';
- var ENTAim_Price__c1 = '';
- 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;
- }
- if (amountMap.ENT.length > 2) {
- 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')));
- },
-
- getOCMTerm : function() {
- var today = new Date();
- var year = today.getFullYear();
- var month = today.getMonth();
-
- if (month < 3) year -= 1;
- var thisYearOCMPeriod = String(year - 1867) + 'P';
-
- return thisYearOCMPeriod;
- },
-
- 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 == "") {
- p1_1 = 0;
- }
- if (p1_2 == undefined || p1_2 == "") {
- p1_2 = 0;
- }
- if (p1_3 == undefined || p1_3 == "") {
- p1_3 = 0;
- }
- 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 == "") {
- p2_1 = 0;
- }
- if (p2_2 == undefined || p2_2 == "") {
- p2_2 = 0;
- }
- 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 == "") {
- p3_1 = 0;
- }
- if (p3_2 == undefined || p3_2 == "") {
- p3_2 = 0;
- }
- 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 == "") {
- p4_1 = 0;
- }
- if (p4_2 == undefined || p4_2 == "") {
- p4_2 = 0;
- }
- 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 == "") {
- p5_1 = 0;
- }
- if (p5_2 == undefined || p5_2 == "") {
- p5_2 = 0;
- }
- 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 == "") {
- p6_1 = 0;
- }
- if (p6_2 == undefined || p6_2 == "") {
- p6_2 = 0;
- }
- 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 == "") {
- p7_1 = 0;
- }
- if (p7_2 == undefined || p7_2 == "") {
- p7_2 = 0;
- }
- 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 == "") {
- p8_1 = 0;
- }
- if (p8_2 == undefined || p8_2 == "") {
- p8_2 = 0;
- }
- 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");
- toastEvent.setParams({
- title: "鎴愬姛",
- type:"success",
- message: "淇濆瓨鎴愬姛"
->>>>>>> LEXCommunityLiJun
});
toastEvent.fire();
$A.get('e.force:refreshView').fire();
-<<<<<<< HEAD
} else if (state === 'INCOMPLETE') {
var toastEvent = $A.get('e.force:showToast');
toastEvent.setParams({
@@ -1323,51 +785,3 @@
toastEvent.fire();
}
});
-=======
- } else if (state === "INCOMPLETE") {
- var toastEvent = $A.get("e.force:showToast");
- toastEvent.setParams({
- title: "鏈畬鎴�!",
- type:"error",
- message: "鏈畬鎴�"
- });
- toastEvent.fire();
- } else if (state === "ERROR") {
- var errors = response.getError();
- var toastEvent = $A.get("e.force:showToast");
- toastEvent.setParams({
- title: "閿欒",
- type:"error",
- message: errors[0].message
- });
- toastEvent.fire();
-
- }
- });
- $A.enqueueAction(action);
- },
-
- warning : function(message) {
- var toastEvent = $A.get("e.force:showToast");
- toastEvent.setParams({
- title: "璀﹀憡!",
- message: message,
- 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();
- },
-
-})
->>>>>>> LEXCommunityLiJun
diff --git a/force-app/main/default/aura/DealerPersonnelInformationImport/DealerPersonnelInformationImport.cmp b/force-app/main/default/aura/DealerPersonnelInformationImport/DealerPersonnelInformationImport.cmp
index 83dda01..5a0a87e 100644
--- a/force-app/main/default/aura/DealerPersonnelInformationImport/DealerPersonnelInformationImport.cmp
+++ b/force-app/main/default/aura/DealerPersonnelInformationImport/DealerPersonnelInformationImport.cmp
@@ -1,7 +1,3 @@
-<<<<<<< HEAD
-<aura:component
- controller="DealerPersonnelController"
-=======
<!--
* @Author: Thhto 997058689@qq.com
* @Date: 2022-07-08 10:47:25
@@ -10,8 +6,8 @@
* @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"
->>>>>>> LEXCommunityLiJun
+<aura:component
+ controller="DealerPersonnelController"
implements="force:appHostable,flexipage:availableForAllPageTypes,flexipage:availableForRecordHome,force:hasRecordId,force:lightningQuickAction,forceCommunity:availableForAllPageTypes"
access="global"
>
@@ -63,19 +59,13 @@
</div>
</aura:renderIf>
<!-- 鎵归噺娣诲姞鍛ㄦ姤 start-->
-<<<<<<< HEAD
<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;">
->>>>>>> LEXCommunityLiJun
+ <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"
@@ -83,7 +73,6 @@
>
<div class="slds-m-left_xx-large">
<div
-<<<<<<< HEAD
class="slds-notify__content slds-m-left_small slds-align_absolute-center slds-m-left_xx-large"
>
<lightning:icon
@@ -92,18 +81,12 @@
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>
+ <pre class="slds-text-heading_small">
+{!v.errorMessage}</pre
+ >
<!-- DB202301262139 SFDC缁忛攢鍟嗕汉鍛樺鍏ュ姛鑳芥敼杩� end -->
->>>>>>> LEXCommunityLiJun
</div>
</div>
</div>
@@ -111,13 +94,8 @@
</div>
</div>
<div class="slds-modal slds-fade-in-open slds-hide" aura:id="successDiv01">
-<<<<<<< HEAD
- <ui:inputText aura:id="articleURL" />
- <div class="demo-only" style="height: 8rem">
-=======
<!-- <ui:inputText aura:id="articleURL" /> -->
- <div class="demo-only" style="height: 8rem;">
->>>>>>> LEXCommunityLiJun
+ <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"
@@ -142,13 +120,8 @@
</div>
</div>
</div>
-<<<<<<< HEAD
<div>
<div class="slds-modal__header">
-=======
- <div >
- <div class="slds-modal__header ">
->>>>>>> LEXCommunityLiJun
<h4 id="headerTarget" class="slds-float--left"></h4>
<h2 id="headerTarget" class="slds-text-heading--medium">
瀹㈡埛浜哄憳鎵归噺瀵煎叆
@@ -169,7 +142,6 @@
</center>
</div>
<aura:set attribute="else">
-<<<<<<< HEAD
<ui:outputRichText
class="uiOutputRichText slds-m--around-large"
value="{!v.TableContent}"
@@ -178,21 +150,17 @@
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}"
/>
-=======
- <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}" />
->>>>>>> LEXCommunityLiJun
</div>
<aura:if isTrue="{!v.showErrorInfo}">
<div
@@ -204,7 +172,6 @@
onclick="{!c.exportErrorInfo}"
/>
</div>
-<<<<<<< HEAD
<div
class="slds-p-around--large slds-align--absolute-center"
>
@@ -214,14 +181,7 @@
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"/>
->>>>>>> LEXCommunityLiJun
</div>
</div>
</aura:if>
diff --git a/force-app/main/default/aura/DealerPersonnelInformationImport/DealerPersonnelInformationImportHelper.js b/force-app/main/default/aura/DealerPersonnelInformationImport/DealerPersonnelInformationImportHelper.js
index 6e97e38..dddc5bf 100644
--- a/force-app/main/default/aura/DealerPersonnelInformationImport/DealerPersonnelInformationImportHelper.js
+++ b/force-app/main/default/aura/DealerPersonnelInformationImport/DealerPersonnelInformationImportHelper.js
@@ -89,7 +89,7 @@
reader.onloadend = function () {};
reader.readAsDataURL(file);
},
- isNumber: function(str) {
+ isNumber: function (str) {
return /^\d+$/.test(str);
},
saveRecords: function (component, event, helper) {
@@ -115,37 +115,29 @@
for (var i = 0; i < ress.length; i++) {
res1 += ress[i].substr(7) + '\n';
if (ress[i] != '') {
-<<<<<<< HEAD
let errorData = {};
+ if (
+ !this.isNumber(
+ ress[i].substr(7).substring(1, 2)
+ )
+ ) {
+ continue;
+ }
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));
->>>>>>> LEXCommunityLiJun
if (index == -1) {
errorData.errorRow = ress[i]
.substr(7)
.substring(1, 2);
errorDataRow.push(errorData.errorRow);
-<<<<<<< HEAD
errorData.errorInfo = ress[i]
.substr(7)
- .substring(6);
+ .substring(5);
errorDatas.push(errorData);
} else {
errorDatas[index].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(5);
->>>>>>> LEXCommunityLiJun
+ '; ' + ress[i].substr(7).substring(5);
}
}
}
@@ -153,13 +145,12 @@
.get('v.fileContentData')
.split('\n');
let errorColumns = [
-<<<<<<< HEAD
{
label: '閿欒琛�',
fieldName: 'errorRow',
type: 'text',
hideDefaultActions: true,
- initialWidth: 50
+ initialWidth: 100
},
{
label: '閿欒淇℃伅',
@@ -169,10 +160,6 @@
initialWidth: 300,
wrapText: true
}
-=======
- { label: '閿欒琛�', fieldName: 'errorRow', type: 'text', hideDefaultActions: true, initialWidth: 100 },
- { label: '閿欒淇℃伅', fieldName: 'errorInfo', type: 'text', hideDefaultActions: true,initialWidth: 300,wrapText: true }
->>>>>>> LEXCommunityLiJun
];
for (
var i = 0;
@@ -180,37 +167,23 @@
i++
) {
errorColumns.push({
-<<<<<<< HEAD
label: fileContentData[0].split(',')[i],
fieldName: 'field' + i,
type: 'text',
hideDefaultActions: true,
- wrapText: true
-=======
- label: fileContentData[0].split(',')[i],
- fieldName: 'field' + i,
- type: 'text',
- hideDefaultActions: true,
wrapText: true,
initialWidth: 120
->>>>>>> LEXCommunityLiJun
});
}
for (var i = 0; i < errorDatas.length; i++) {
let data = fileContentData[errorDatas[i].errorRow];
console.log('data = ' + JSON.stringify(data));
-<<<<<<< HEAD
- 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++){
+ if (data) {
+ for (var j = 0; j < data.split(',').length; j++) {
let label = 'field' + j;
errorDatas[i][label] = data.split(',')[j];
}
->>>>>>> LEXCommunityLiJun
}
}
console.log('errorDatas = ' + JSON.stringify(errorDatas));
@@ -224,14 +197,14 @@
component.set('v.errorMessage', res1 + '璇蜂慨鏀瑰悗閲嶆柊涓婁紶');
this.showErrorToast(component);
component.set('v.login', false);
- component.find('save_con').set('v.disabled', true);
+ 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.login', false);
- component.find('save_con').set('v.disabled', false);
+ component.find('save_con').set('v.disabled', false);
}
} else if (state === 'INCOMPLETE') {
component.set('v.login', false);
@@ -289,18 +262,11 @@
//寮瑰嚭 閿欒鎻愮ず
showErrorToast: function (component) {
$A.util.removeClass(component.find('errorDiv'), 'slds-hide');
-<<<<<<< HEAD
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
->>>>>>> LEXCommunityLiJun
);
},
success: function (message) {
@@ -392,15 +358,10 @@
downloadCSV: function (component, csv) {
var link = document.createElement('a');
// 璁剧疆瀛楃闆嗗拰鏂囦欢澶�
-<<<<<<< HEAD
- let bom = '\uFEFF';
+ 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.href = URL.createObjectURL(csvFile);
->>>>>>> LEXCommunityLiJun
link.download = 'data.csv';
document.body.appendChild(link);
link.click();
diff --git a/force-app/main/default/aura/NewAgencyOpportunity/NewAgencyOpportunity.cmp b/force-app/main/default/aura/NewAgencyOpportunity/NewAgencyOpportunity.cmp
index 373278d..a8f7149 100644
--- a/force-app/main/default/aura/NewAgencyOpportunity/NewAgencyOpportunity.cmp
+++ b/force-app/main/default/aura/NewAgencyOpportunity/NewAgencyOpportunity.cmp
@@ -25,7 +25,6 @@
<aura:attribute name="isClone" type="Boolean" default="False" />
<ltng:require scripts="{! $Resource.AWSService+'/AWSService.js' }" />
<ltng:require scripts="{! $Resource.jquery183minjs }" />
-<<<<<<< HEAD
<aura:attribute name="isModalOpen" type="boolean" default="false" />
<aura:attribute name="searchKeyWord" type="string" default="" />
<aura:attribute name="contactAWSIds" type="List" />
@@ -41,16 +40,7 @@
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 = ""/>
->>>>>>> LEXCommunityLiJun
+ <aura:attribute name="agencyHospitalId" type="String" default="" />
<div class="{! v.container_class}">
<!-- header -->
@@ -64,17 +54,15 @@
<aura:if isTrue="{!v.showSpinner}">
<lightning:spinner alternativeText="Loading" size="medium" />
</aura:if>
-<<<<<<< HEAD
- <lightning:recordEditForm objectApiName="Agency_Opportunity__c">
+ <lightning:recordEditForm
+ objectApiName="Agency_Opportunity__c"
+ onload="{!c.handleLoad}"
+ >
<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" >
->>>>>>> LEXCommunityLiJun
<aura:iteration items="{!v.layout}" var="section">
<aura:if isTrue="{! section.editHeading }">
<lightning:accordionSection
@@ -227,7 +215,12 @@
</lightning:layout>
<div id="QueryResult" style="margin-top: 20px"></div>
</div>
-<<<<<<< HEAD
+
+ <!-- <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
@@ -238,36 +231,18 @@
class="slds-modal slds-fade-in-open"
aura:id="NewAgencyContact"
id="NewAgencyContact"
+ aria-describedby="modal-content-id-2"
+ style="z-index: 9999"
>
- <c:NewAgencyContact2 />
+ <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>
-=======
-
- <!-- <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" 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>
->>>>>>> LEXCommunityLiJun
</div>
</aura:component>
diff --git a/force-app/main/default/aura/NewAgencyOpportunity/NewAgencyOpportunity.css b/force-app/main/default/aura/NewAgencyOpportunity/NewAgencyOpportunity.css
index c51f858..85e3804 100644
--- a/force-app/main/default/aura/NewAgencyOpportunity/NewAgencyOpportunity.css
+++ b/force-app/main/default/aura/NewAgencyOpportunity/NewAgencyOpportunity.css
@@ -65,8 +65,6 @@
.THIS .slds-spinner_container {
position: revert;
}
-<<<<<<< HEAD
-=======
.THIS .slds-backdrop2 {
position: fixed;
@@ -79,4 +77,3 @@
.THIS .slds-backdrop_open2 {
z-index: 9003; /* 閬僵灞傜殑灞傜骇锛岄渶瑕佺‘淇濇瘮妯℃�佹鐨勫眰绾ч珮 */
}
->>>>>>> LEXCommunityLiJun
diff --git a/force-app/main/default/aura/NewAgencyOpportunity/NewAgencyOpportunityController.js b/force-app/main/default/aura/NewAgencyOpportunity/NewAgencyOpportunityController.js
index 263b5ea..7a076be 100644
--- a/force-app/main/default/aura/NewAgencyOpportunity/NewAgencyOpportunityController.js
+++ b/force-app/main/default/aura/NewAgencyOpportunity/NewAgencyOpportunityController.js
@@ -136,7 +136,7 @@
}
// component.set('v.fields',fields);
// component.set('v.staticResource',staticResource);
- component.set('v.showSpinner', false);
+ //component.set("v.showSpinner", false);
} else {
component.set('v.showSpinner', false);
helper.ShowToast({
@@ -144,36 +144,21 @@
type: 'error'
});
}
-<<<<<<< HEAD
} else {
component.set('v.showSpinner', false);
-=======
- // component.set('v.fields',fields);
- // component.set('v.staticResource',staticResource);
- //component.set("v.showSpinner", false);
- }else{
- component.set("v.showSpinner", false);
->>>>>>> LEXCommunityLiJun
helper.ShowToast({
message: 'Init error',
type: 'error'
});
}
}
-<<<<<<< HEAD
);
},
- saveClick: function (component, event, helper) {
-=======
- });
- },
- handleLoad: function(component, event, helper) {
- console.log('recordEditForm handleSuccess')
- component.set("v.showSpinner", false);
+ handleLoad: function (component, event, helper) {
+ console.log('recordEditForm handleSuccess');
+ component.set('v.showSpinner', false);
},
- saveClick : function(component, event, helper){
-
->>>>>>> LEXCommunityLiJun
+ 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');
@@ -318,14 +303,15 @@
message: '璇峰厛閫夋嫨缁忛攢鍟嗗尰闄�',
type: 'warning'
});
-<<<<<<< HEAD
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)
->>>>>>> LEXCommunityLiJun
+ } else if (
+ item.field == 'Agency_Hospital__c' &&
+ item.value
+ ) {
+ component.set('v.agencyHospitalId', item.value);
+ console.log(
+ 'v.agencyHospitalId item.value = ' + item.value
+ );
}
}
}
diff --git a/force-app/main/default/aura/NewAgencyOpportunity/NewAgencyOpportunityHelper.js b/force-app/main/default/aura/NewAgencyOpportunity/NewAgencyOpportunityHelper.js
index 3fece7c..732b0a0 100644
--- a/force-app/main/default/aura/NewAgencyOpportunity/NewAgencyOpportunityHelper.js
+++ b/force-app/main/default/aura/NewAgencyOpportunity/NewAgencyOpportunityHelper.js
@@ -69,8 +69,7 @@
let myTableDiv = document.getElementById('QueryResult');
let table = document.createElement('TABLE');
table.border = '1';
-<<<<<<< HEAD
- table.id = 'table';
+ table.id = 'customTable';
table.setAttribute(
'class',
'slds-table slds-table_cell-buffer slds-table_bordered'
@@ -79,16 +78,7 @@
table.appendChild(tableBody);
let headerTR = document.createElement('TR');
headerTR.setAttribute('class', 'slds-line-height_reset');
- let colsHeader = ['濮撳悕', '鍖婚櫌', '鍖荤敓鍖哄垎(鑱屽姟)', '鍒嗙被'];
-=======
- 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 = [' ','濮撳悕','鍖婚櫌', '鍖荤敓鍖哄垎(鑱屽姟)','鍒嗙被'];
->>>>>>> LEXCommunityLiJun
+ let colsHeader = [' ', '濮撳悕', '鍖婚櫌', '鍖荤敓鍖哄垎(鑱屽姟)', '鍒嗙被'];
tableBody.appendChild(headerTR);
for (let i = 0; i < colsHeader.length; i++) {
let td = document.createElement('TH');
@@ -102,29 +92,32 @@
let tr = document.createElement('TR');
tableBody.appendChild(tr);
let contactInfoTemp = contactInfoList[i];
-<<<<<<< HEAD
-=======
-
+
//鍐嶅姞涓�鍒楅�夋嫨button
- debugger
+ debugger;
let td = document.createElement('TD');
td.width = '75';
td.id = contactsInfo[contactInfoTemp.AWSDataId].Id;
- console.log('contactInfoTemp = ' + JSON.stringify(contactInfoTemp))
+ 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 : '';
+ 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) {
+ button.addEventListener('click', function (obj) {
that.redirectToParentPage(component, event, helper, obj);
});
- button.value = contactInfoTemp[cols[0]] != null ? contactInfoTemp[cols[0]] : ''
+ button.value =
+ contactInfoTemp[cols[0]] != null
+ ? contactInfoTemp[cols[0]]
+ : '';
td.appendChild(button);
tr.appendChild(td);
->>>>>>> LEXCommunityLiJun
for (let j = 0; j < cols.length; j++) {
let td = document.createElement('TD');
td.width = '75';
@@ -139,7 +132,6 @@
}
} else {
td.id = contactInfoTemp.sfRecordId;
-<<<<<<< HEAD
}
td.appendChild(
document.createTextNode(
@@ -148,25 +140,11 @@
: ''
)
);
- 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);
// });
// }
->>>>>>> LEXCommunityLiJun
tr.appendChild(td);
}
}
@@ -174,13 +152,8 @@
myTableDiv.appendChild(table);
component.find('button').set('v.disabled', false);
},
-<<<<<<< HEAD
redirectToParentPage: function (component, event, helper, obj) {
- let agencyContactName = obj.currentTarget.innerText;
-=======
- redirectToParentPage : function(component, event, helper,obj){
let agencyContactName = obj.currentTarget.value;
->>>>>>> LEXCommunityLiJun
let id = obj.currentTarget.id;
component.set('v.ac_name', agencyContactName);
let layout = component.get('v.layout');
@@ -195,19 +168,7 @@
}
component.set('v.isModalOpen', false);
},
-<<<<<<< HEAD
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);
@@ -217,9 +178,8 @@
// }
// }
let customTable = document.getElementById('customTable');
- if(customTable){
+ if (customTable) {
customTable.parentNode.removeChild(customTable);
->>>>>>> LEXCommunityLiJun
}
},
preparePayloadForSearchAgencyContact: function (component, event, helper) {
@@ -256,7 +216,7 @@
});
return;
}
- component.set('v.showSpinner',true);
+ component.set('v.showSpinner', true);
let searchPayload = new Object();
let searchAgencyContactName = component.get('v.searchKeyWord');
searchPayload.dataIds = rv.Data;
@@ -286,6 +246,7 @@
message: '娌℃湁鏌ヨ鍒拌瀹㈡埛浜哄憳',
type: 'warning'
});
+ component.set('v.showSpinner', false);
return;
}
for (var i = 0; i < data.object.length; i++) {
@@ -306,6 +267,7 @@
}
}
//let AWSIdToSFIdMapValue = {};
+ debugger;
var searchAgencyContacts = component.get(
'c.searchAgencyContacts'
);
@@ -314,9 +276,25 @@
agencyHospitalId: agencyHospitalId,
accountId: accountId
});
-<<<<<<< HEAD
+ // 寤惰繜鎵ц涓�娈典唬鐮�
+ 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(
- this,
+ that,
function (response) {
var state = response.getState();
if (state == 'SUCCESS') {
@@ -380,68 +358,6 @@
];
}
}
-=======
- 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'];
->>>>>>> LEXCommunityLiJun
}
}
}
@@ -453,28 +369,21 @@
contactInfoList,
contactsInfo
);
+ component.set(
+ 'v.showSpinner',
+ false
+ );
}
}
-<<<<<<< HEAD
}
);
$A.enqueueAction(searchAgencyContacts);
+ } else {
+ component.set('v.showSpinner', false);
}
},
token
);
-=======
- that.refreshTable(component, event, helper,cols,contactInfoList,contactsInfo);
- component.set('v.showSpinner',false);
- }
- }
- });
- $A.enqueueAction(searchAgencyContacts);
- }else{
- component.set('v.showSpinner',false);
- }
- },token);
->>>>>>> LEXCommunityLiJun
}
});
$A.enqueueAction(action);
diff --git a/force-app/main/default/aura/RetrospectiveWeeklyReport/RetrospectiveWeeklyReport.cmp b/force-app/main/default/aura/RetrospectiveWeeklyReport/RetrospectiveWeeklyReport.cmp
index 9df8447..3a97a6b 100644
--- a/force-app/main/default/aura/RetrospectiveWeeklyReport/RetrospectiveWeeklyReport.cmp
+++ b/force-app/main/default/aura/RetrospectiveWeeklyReport/RetrospectiveWeeklyReport.cmp
@@ -1,4 +1,3 @@
-<<<<<<< HEAD
<aura:component
controller="RetrospectiveWeeklyReportController"
implements="force:appHostable,flexipage:availableForAllPageTypes,flexipage:availableForRecordHome,force:hasRecordId,force:lightningQuickAction,forceCommunity:availableForAllPageTypes,lightning:availableForFlowScreens"
@@ -27,18 +26,6 @@
default="{sobjectType:'Ag
ency_Contact__c'}"
/>
-=======
-<aura:component controller="RetrospectiveWeeklyReportController"
- implements="force:appHostable,flexipage:availableForAllPageTypes,flexipage:availableForRecordHome,force:hasRecordId,force:lightningQuickAction,forceCommunity:availableForAllPageTypes,lightning:availableForFlowScreens"
- 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'}" />
->>>>>>> LEXCommunityLiJun
<aura:attribute name="successMessage" type="String" />
<aura:attribute name="etEng" type="String" />
<aura:attribute name="errorMessage" type="String" />
@@ -57,15 +44,11 @@
<aura:attribute name="docmap" type="Map" />
<aura:attribute name="login" type="Boolean" default="false" />
<aura:attribute name="loginEdit" type="Boolean" default="false" />
-<<<<<<< HEAD
<aura:attribute
name="modal_import_spinner"
type="Boolean"
default="false"
/>
-=======
- <aura:attribute name="modal_import_spinner" type="Boolean" default="false" />
->>>>>>> LEXCommunityLiJun
<aura:attribute name="loadOpp" type="Boolean" default="false" />
<aura:attribute name="reportPageData" type="Map" />
<aura:attribute name="selectbody" type="String" />
@@ -85,43 +68,31 @@
<!-- 浣跨敤浜у搧1(浜у搧鍨嬪彿) -->
<aura:attribute name="UseProduct1" type="string" default="" />
<aura:attribute name="UseProduct1s" type="string" default="" />
-<<<<<<< HEAD
<aura:handler
name="change"
value="{!v.UseProduct1}"
action="{!c.UseProduct1Change}"
/>
-=======
- <aura:handler name="change" value="{!v.UseProduct1}" action="{!c.UseProduct1Change}" />
->>>>>>> LEXCommunityLiJun
<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="" />
-<<<<<<< HEAD
<aura:handler
name="change"
value="{!v.UseProduct2}"
action="{!c.UseProduct2Change}"
/>
-=======
- <aura:handler name="change" value="{!v.UseProduct2}" action="{!c.UseProduct2Change}" />
->>>>>>> LEXCommunityLiJun
<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="" />
-<<<<<<< HEAD
<aura:handler
name="change"
value="{!v.UseProduct3}"
action="{!c.UseProduct3Change}"
/>
-=======
- <aura:handler name="change" value="{!v.UseProduct3}" action="{!c.UseProduct3Change}" />
->>>>>>> LEXCommunityLiJun
<aura:attribute name="UseProduct3List" type="Map" />
<aura:attribute name="UseProduct3Id" type="string" default="" />
<!--SWAG-CF58C3 fy start -->
@@ -135,7 +106,6 @@
<aura:attribute name="allselectlistAgencyPerson" type="Map" />
<!--SWAG-CF58C3 fy end -->
-<<<<<<< HEAD
<aura:attribute name="doctor_list" type="Map" />
<!-- <aura:attribute name="doctor_title" type="String" /> -->
<aura:attribute name="opportunity_list" type="Map" />
@@ -202,59 +172,6 @@
<ltng:require scripts="{! $Resource.AWSService+'/AWSService.js' }" />
<ltng:require scripts="{! $Resource.jquery183minjs }" />
-=======
-
- <aura:attribute name="doctor_list" type="Map" />
- <!-- <aura:attribute name="doctor_title" type="String" /> -->
- <aura:attribute name="opportunity_list" type="Map" />
- <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_doctor_id2" 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" />
- <aura:attribute name="modal_confirm_text" type="String" />
- <!-- <aura:attribute name="new_falg" type="String" /> -->
- <!-- fy -->
- <aura:attribute name="UserProType" type="String" />
- <!-- 绉戝 -->
- <aura:attribute name="opportunity_cfilter" type="String" />
- <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="tableheaders" type="Object[]" />
- <aura:attribute name="fileContentData" type="String" />
- <aura:attribute name="filename" type="String" />
- <aura:attribute name="NumOfRecords" type="Integer" default="1000" />
- <aura:attribute name="showMain" type="Boolean" default="true" />
- <aura:attribute name="IsEventDefault" type="Boolean" default="true" />
- <!-- start DTT-zhj 澧炲姞閿欒淇℃伅table 2023-05-16-->
- <aura:attribute name="errorData" type="Object" />
- <aura:attribute name="errorColumns" type="List" />
- <!-- show Error information -->
- <aura:attribute name="showErrorInfo" type="Boolean" default="false" />
- <!-- end DTT-zhj 澧炲姞閿欒淇℃伅table 2023-05-16-->
-
- <aura:attribute name="PIConfig" type="Map" />
-
- <ltng:require scripts="{! $Resource.AWSService+'/AWSService.js' }" />
- <ltng:require scripts="{! $Resource.jquery183minjs }" />
-
->>>>>>> LEXCommunityLiJun
<!-- 鎵归噺娣诲姞鏃ユ姤 end-->
<!--銉兗銉変腑...-->
<aura:renderIf isTrue="{!v.login}">
@@ -266,15 +183,11 @@
聽 聽 <div class="slds-spinner__dot-b"></div>
</div>
</div> -->
-<<<<<<< HEAD
<div
class="slds-spinner_container"
id="spinner"
style="position: fixed; top: 123px"
>
-=======
- <div class="slds-spinner_container" id="spinner" style="position: fixed;top:123px;">
->>>>>>> LEXCommunityLiJun
<div
role="status"
class="slds-spinner slds-spinner_medium slds-spinner_brand"
@@ -288,7 +201,6 @@
</aura:renderIf>
<div aura:id="report" id="report">
<div class="slds-grid slds-wrap slds-grid--pull-padded">
-<<<<<<< HEAD
<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"
@@ -363,47 +275,11 @@
press="{!c.export_condition}"
class="buttonFontSize"
/>
-=======
- <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">
- 鍛�
- </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}" />
- </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;">
- {!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>
- <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>
- <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" />
->>>>>>> LEXCommunityLiJun
<!-- <ui:button aura:id="returnbutton" label="杩斿洖" press="{!c.return_main_page}" /> -->
</div>
</div>
</div>
<div aura:id="report_list" class="report_list_area">
-<<<<<<< HEAD
<div
class="slds-table--edit_container slds-is-relative"
style="padding-left: 50px"
@@ -457,43 +333,11 @@
<span class="slds-truncate" title="Name"
>{!v.fieldsmap.WorkMark__c}</span
>
-=======
- <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>
- <th class="table_header slds-text-title--caps fontSize">
- <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">
- <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>
- <!-- {!v.fieldsmap.Department_Cateogy__c} 绉戝-->
- </th>
- <th class="table_header slds-text-title--caps fontSize">
- <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>
- <!-- {!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>
->>>>>>> LEXCommunityLiJun
<!-- {!v.fieldsmap.visitor_title__c} 鑱屼綅-->
</th>
</tr>
</thead>
<tbody>
-<<<<<<< HEAD
<aura:iteration
items="{!v.reports}"
var="item"
@@ -534,45 +378,20 @@
class="slds-grid slds-grid--align-spread"
style="word-wrap: break-word"
>
-=======
- <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}" />
-
- </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>
- </td>
- <td scope="row" tabindex="0" class="slds-cell-edit fontSize">
- <div class="slds-grid slds-grid--align-spread" style="word-wrap: break-word;">
->>>>>>> LEXCommunityLiJun
{!item.Agency_Hospital__r.Name}
</div>
</td>
<td role="gridcell" class="slds-cell-edit fontSize">
<span class="slds-grid slds-grid--align-spread">
-<<<<<<< HEAD
<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>
->>>>>>> LEXCommunityLiJun
</span>
</td>
<td role="gridcell" class="slds-cell-edit fontSize">
<span class="slds-grid slds-grid--align-spread">
-<<<<<<< HEAD
<span
class="slds-truncate"
title="{!item.doctor2__r.Name}"
@@ -583,31 +402,20 @@
<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>
->>>>>>> LEXCommunityLiJun
</span>
</span>
</td>
<td role="gridcell" class="slds-cell-edit fontSize">
<span class="slds-grid slds-grid--align-spread">
-<<<<<<< HEAD
<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>
->>>>>>> LEXCommunityLiJun
</span>
</td>
<td role="gridcell" class="slds-cell-edit fontSize">
<span class="slds-grid slds-grid--align-spread">
-<<<<<<< HEAD
<span
class="slds-truncate"
title="{!item.WorkMark__c}"
@@ -617,11 +425,6 @@
checked="{!item.WorkMark__c}"
disabled="true"
/>
-=======
- <span class="slds-truncate" title="{!item.WorkMark__c}">
- <lightning:input type="checkbox" checked="{!item.WorkMark__c}"
- disabled="true" />
->>>>>>> LEXCommunityLiJun
</span>
</span>
</td>
@@ -632,18 +435,11 @@
</div>
<aura:renderIf isTrue="{!v.report_count > 0}">
<aura:set attribute="else">
-<<<<<<< HEAD
<div class="no_data_area">{!v.list_message}</div>
-=======
- <div class="no_data_area">
- {!v.list_message}
- </div>
->>>>>>> LEXCommunityLiJun
</aura:set>
</aura:renderIf>
</div>
<!-- 鎵归噺娣诲姞鏃ユ姤 start-->
-<<<<<<< HEAD
<div
aura:id="modal_import"
role="dialog"
@@ -678,24 +474,6 @@
<h2 class="slds-text-heading_small">
{!v.successMessage}
</h2>
-=======
- <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">
- <!-- <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__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>
->>>>>>> LEXCommunityLiJun
</div>
</div>
</div>
@@ -720,7 +498,6 @@
</div>
</div>
</div> -->
-<<<<<<< HEAD
<div class="slds-modal__container">
<div class="slds-modal__header">
<h4 id="headerTarget" class="slds-float--left"></h4>
@@ -787,42 +564,10 @@
columns="{! v.errorColumns }"
hideCheckboxColumn="true"
/>
-=======
- <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 buttonFontSize"
- press="{!c.close_import}" />
- </div>
- <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}" />
- </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" />
- </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>
- <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" />
->>>>>>> LEXCommunityLiJun
</div>
</div>
</aura:if>
</aura:set>
-<<<<<<< HEAD
</aura:if>
</div>
</div>
@@ -917,64 +662,12 @@
variant="brand"
onclick="{!c.close_export}"
/>
-=======
-
- </aura:if>
- </div>
- </div>
- </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 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}" />
- </div>
- <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">
- 娲诲姩鏃ュ紑濮嬫棩鏈�
- <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">
- 娲诲姩鏃ョ粨鏉熸棩鏈�
- <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}" />
- </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}" />
->>>>>>> LEXCommunityLiJun
</div>
</aura:set>
</aura:if>
</div>
</div>
</div>
-<<<<<<< HEAD
<div
aura:id="modal_exportbg"
class="disp_none slds-backdrop slds-backdrop--open"
@@ -1012,31 +705,12 @@
<h2 class="slds-text-heading_small">
{!v.successMessage}
</h2>
-=======
- <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 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="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__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>
->>>>>>> LEXCommunityLiJun
</div>
</div>
</div>
</div>
</div>
</div>
-<<<<<<< HEAD
<div
class="slds-modal slds-fade-in-open slds-hide"
aura:id="errorDiv"
@@ -1062,19 +736,6 @@
<h2 class="slds-text-heading_small">
{!v.errorMessage}
</h2>
-=======
- <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__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>
->>>>>>> LEXCommunityLiJun
</div>
</div>
</div>
@@ -1082,7 +743,6 @@
</div>
</div>
-<<<<<<< HEAD
<div
class="slds-modal__content slds-grow slds-p-around--medium"
style="position: relative"
@@ -1104,23 +764,10 @@
class="close_button slds-button slds-button--neutral slds-order--1"
press="{!c.toggle_report}"
/>
-=======
- <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%;" />
- </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="鍏抽棴"
- class="close_button slds-button slds-button--neutral slds-order--1"
- press="{!c.toggle_report}" />
->>>>>>> LEXCommunityLiJun
</div>
<div class="slds-box slds-theme--shade">
<div class="slds-grid slds-wrap slds-grid--pull-padded">
<div
-<<<<<<< HEAD
class="slds-p-horizontal--small slds-size--1-of-1 slds-medium-size--1-of-7 slds-large-size--1-of-7"
>
娲诲姩鏃�
@@ -1169,32 +816,6 @@
>
{!hospital.Hospital_Name_readonly__c}
</div>
-=======
- 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" />
- </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-7 slds-large-size--1-of-7"
- data-select="single">
- <!-- label="鍖婚櫌" -->
- 鍖婚櫌
- <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}"
- 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>
->>>>>>> LEXCommunityLiJun
</div>
</span>
</li>
@@ -1204,7 +825,6 @@
</div>
<!-- 绉戝鍒嗙被 -->
<div
-<<<<<<< HEAD
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}
@@ -1250,38 +870,10 @@
class="slds-select"
change="{!c.doctor_change}"
/>
-=======
- 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" />
- </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;">
- {!v.fieldsmap.DealerPersonnel__c}
- <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">
- {!v.fieldsmap.WorkRecord__c}
- <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;">
- 鎷滆浜�
- <ui:inputSelect aura:id="select_doctor" class="slds-select" change="{!c.doctor_change}" />
->>>>>>> LEXCommunityLiJun
</div>
<!-- <p hidden="hidden"> -->
<div
-<<<<<<< HEAD
class="slds-p-horizontal--small slds-size--1-of-1 slds-medium-size--1-of-7 slds-large-size--1-of-7"
>
<br />
@@ -1292,19 +884,12 @@
disabled="true"
aura:id="new_con"
/>
-=======
- 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" />
->>>>>>> LEXCommunityLiJun
</div>
<!-- </p> -->
<hr />
<!-- 浜у搧鍒嗙被(绗笁鍒嗙被) change="{!c.select_ProductClassification}" -->
<div
-<<<<<<< HEAD
class="slds-p-horizontal--small slds-size--1-of-1 slds-medium-size--1-of-5 slds-large-size--1-of-5"
>
浜у搧鍒嗙被(绗笁鍒嗙被)
@@ -1356,32 +941,6 @@
>
{!UseProduct1.Asset_Model_No__c}
</div>
-=======
- 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}" />
- </div>
- <!-- 浣跨敤浜у搧1(浜у搧鍨嬪彿) UseProduct1__c -->
- <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">
- <!-- label="浣跨敤浜у搧1(浜у搧鍨嬪彿)" -->
- 浣跨敤浜у搧1(浜у搧鍨嬪彿)
- <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}"
- 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">
- <div class="slds-media__body">
- <div class="slds-lookup__result-text">
- {!UseProduct1.Asset_Model_No__c}</div>
->>>>>>> LEXCommunityLiJun
</div>
</span>
</li>
@@ -1390,7 +949,6 @@
</div>
</div>
<!-- 浣跨敤浜у搧2 UseProduct2__c -->
-<<<<<<< HEAD
<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"
@@ -1432,26 +990,6 @@
>
{!UseProduct2.Asset_Model_No__c}
</div>
-=======
- <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">
- <!-- label="浣跨敤浜у搧2" -->
- 浣跨敤浜у搧2
- <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}"
- 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">
- <div class="slds-media__body">
- <div class="slds-lookup__result-text">
- {!UseProduct2.Asset_Model_No__c}</div>
->>>>>>> LEXCommunityLiJun
</div>
</span>
</li>
@@ -1460,7 +998,6 @@
</div>
</div>
<!-- 浣跨敤浜у搧3 UseProduct3__c -->
-<<<<<<< HEAD
<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"
@@ -1502,26 +1039,6 @@
>
{!UseProduct3.Asset_Model_No__c}
</div>
-=======
- <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">
- <!-- label="浣跨敤浜у搧3" -->
- 浣跨敤浜у搧3
- <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}"
- 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">
- <div class="slds-media__body">
- <div class="slds-lookup__result-text">
- {!UseProduct3.Asset_Model_No__c}</div>
->>>>>>> LEXCommunityLiJun
</div>
</span>
</li>
@@ -1530,7 +1047,6 @@
</div>
</div>
<!-- 鏁堟灉/杩涘害 EffectProgress__c-->
-<<<<<<< HEAD
<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"
@@ -1540,17 +1056,10 @@
aura:id="select_EffectProgress"
class="slds-select"
/>
-=======
- <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" />
->>>>>>> LEXCommunityLiJun
</div>
<hr />
<!-- 浜у搧1鍚岀被鑰楁潗绉戝鏈堜娇鐢ㄩ噺 ConsumptionOfConsumables__c-->
<div
-<<<<<<< HEAD
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}
@@ -1659,77 +1168,11 @@
value="{!v.oppdata.Close_Forecasted_Date__c}"
class=""
/>
-=======
- 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" />
- </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">
- {!v.fieldsmap.WarlockClassification__c}
- <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">
- {!v.fieldsmap.ProductCcategory__c}
- <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">
- {!v.fieldsmap.productCategories__c}
- <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">
- {!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" />
- </div>
- <!-- 鏀彺闇�姹� WorkMark__c-->
- <div style="padding-left: 12px;">
- {!v.fieldsmap.WorkMark__c}
- <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">
- {!v.fieldsmap.StageName__c}
- <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">
- {!v.fieldsmap.Amount__c}
- <!-- <ui:inputSelect aura:id="select_opportunity" class="slds-select"/> 鍖婚櫌閲囪喘棰勭畻(涓嶅惈绋�,鍏�)-->
- <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">
- {!v.fieldsmap.OCMSale_Price__c}
- <!-- <ui:inputSelect aura:id="select_opportunity" class="slds-select"/> 璁㈣揣閲戦(涓嶅惈绋�,鍏�) -->
- <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">
- {!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="" />
->>>>>>> LEXCommunityLiJun
</div>
<hr />
</div>
</div>
<div class="save_button_area">
-<<<<<<< HEAD
<ui:button
aura:id="save_button"
label="淇濆瓨骞舵柊寤�"
@@ -1801,44 +1244,10 @@
title="Name"
>{!v.fieldsmap.WorkRecord__c}</span
>
-=======
- <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">
- <thead>
- <tr class="slds-line-height--reset">
- <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>
- <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>
- <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>
->>>>>>> LEXCommunityLiJun
</th>
</tr>
</thead>
<tbody>
-<<<<<<< HEAD
<aura:iteration
items="{!v.reports_now}"
var="item"
@@ -1930,44 +1339,6 @@
title="{!item.WorkRecord__c}"
>{!item.WorkRecord__c}</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>
- </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>
- </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>
- </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>
- </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>
->>>>>>> LEXCommunityLiJun
</span>
</td>
</tr>
@@ -1981,7 +1352,6 @@
</div>
</div>
-<<<<<<< HEAD
<div
aura:id="modal_bg"
class="disp_none slds-backdrop slds-backdrop--open"
@@ -1999,23 +1369,11 @@
<h2 id="header43" class="slds-text-heading--medium">
{!v.modal_confirm_title}
</h2>
-=======
-
-
- <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>
->>>>>>> LEXCommunityLiJun
</div>
<div class="slds-modal__content slds-p-around--medium">
<p>{!v.modal_confirm_text}</p>
</div>
<div class="slds-modal__footer">
-<<<<<<< HEAD
<ui:button
label="鏄�"
class="slds-button slds-button--brand"
@@ -2070,30 +1428,6 @@
fieldName="Doctor_Division1__c"
aura:id="newOpportunityField"
/>
-=======
- <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_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>
- </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" />
- <!-- 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" />
->>>>>>> LEXCommunityLiJun
</aura:renderIf>
<br />
<br />
@@ -2101,7 +1435,6 @@
<br />
<br />
<div class="save_button_area">
-<<<<<<< HEAD
<lightning:button
class="slds-m-top_small"
type="button"
@@ -2114,21 +1447,9 @@
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}" />
->>>>>>> LEXCommunityLiJun
</div>
</lightning:recordEditForm>
</div>
</div>
</div>
-<<<<<<< HEAD
</aura:component>
-=======
-
-
-</aura:component>
->>>>>>> LEXCommunityLiJun
diff --git a/force-app/main/default/aura/RetrospectiveWeeklyReport/RetrospectiveWeeklyReport.css b/force-app/main/default/aura/RetrospectiveWeeklyReport/RetrospectiveWeeklyReport.css
index 32c203b..920fa09 100644
--- a/force-app/main/default/aura/RetrospectiveWeeklyReport/RetrospectiveWeeklyReport.css
+++ b/force-app/main/default/aura/RetrospectiveWeeklyReport/RetrospectiveWeeklyReport.css
@@ -28,11 +28,7 @@
.THIS .no_data_area {
text-align: center;
-<<<<<<< HEAD
margin: 0.5em 0;
-=======
- margin: .5em 0;
->>>>>>> LEXCommunityLiJun
}
.THIS.report_list_area {
@@ -157,11 +153,7 @@
}
.THIS .customRequired:before {
-<<<<<<< HEAD
content: '*';
-=======
- content: "*";
->>>>>>> LEXCommunityLiJun
margin: 0 0.125rem 0 0.125rem;
color: rgb(194, 57, 52);
float: left;
@@ -207,8 +199,4 @@
.THIS td {
white-space: normal;
overflow-wrap: break-word;
-<<<<<<< HEAD
}
-=======
-}
->>>>>>> LEXCommunityLiJun
diff --git a/force-app/main/default/aura/RetrospectiveWeeklyReport/RetrospectiveWeeklyReportController.js b/force-app/main/default/aura/RetrospectiveWeeklyReport/RetrospectiveWeeklyReportController.js
index c7cfa2b..4a9d273 100644
--- a/force-app/main/default/aura/RetrospectiveWeeklyReport/RetrospectiveWeeklyReportController.js
+++ b/force-app/main/default/aura/RetrospectiveWeeklyReport/RetrospectiveWeeklyReportController.js
@@ -38,13 +38,8 @@
},
showRequiredFields: function (component, event, helper) {
-<<<<<<< HEAD
$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");
->>>>>>> LEXCommunityLiJun
},
handleSuccess: function (component, event, helper) {
@@ -54,7 +49,6 @@
handleSubmit: function (component, event, helper) {
event.preventDefault(); // stop form submission
var showValidationError = false;
-<<<<<<< HEAD
var fields = component.find('newOpportunityField');
var vaildationFailReason = '';
let agencyReport = Object.create(null);
@@ -156,82 +150,6 @@
}
}
);
-=======
- 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"))) {
- showValidationError = true;
- vaildationFailReason = "鍒嗙被涓嶈兘涓虹┖锛�";
- } else if (field.get("v.fieldName") === 'Doctor_Division1__c' && $A.util.isEmpty(field.get("v.value"))) {
- showValidationError = true;
- if (vaildationFailReason != '') {
- vaildationFailReason += "鍖荤敓鍖哄垎(鑱屽姟)涓嶈兘涓虹┖锛�";
- } else {
- 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 end
- });
- if (!showValidationError) {
- //SWAG-CF58C3 fy start
- var agencyHospitalid = component.get('v.hospitalLinkId');
- //zhj MEBG鏂版柟妗堟敼閫� 2022-11-29 start
- 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;
- }
- 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": data.message,
- "type": "error"
- });
- }
- } else {
- helper.ShowToast({
- "message": 'searchAgency澶辫触',
- "type": "error"
- });
- }
- })
->>>>>>> LEXCommunityLiJun
//zhj MEBG鏂版柟妗堟敼閫� 2022-11-29 end
// var arr = new Array();
// arr.push(agencyReport);
@@ -240,11 +158,7 @@
// var newUrl = component.get('v.AWSinsert');
// component.set('v.login',true);
// helper.insert_agencycontact(component,token,newUrl,data,agencyHospitalid,helper);
-<<<<<<< HEAD
//SWAG-CF58C3 fy end
-=======
- //SWAG-CF58C3 fy end
->>>>>>> LEXCommunityLiJun
// helper.newlyBuild(component, event, helper);
} else {
component.find('OppMessage').setError(vaildationFailReason);
@@ -257,28 +171,20 @@
yes_button: function (component, event, helper) {
component.set('v.confirm_status', 1);
-<<<<<<< HEAD
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'));
->>>>>>> LEXCommunityLiJun
},
no_button: function (component, event, helper) {
component.set('v.confirm_status', 2);
-<<<<<<< HEAD
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'));
->>>>>>> LEXCommunityLiJun
},
toggle_report: function (component, event, helper) {
@@ -294,22 +200,13 @@
},
select_agency_change: function (component, event, helper) {
-<<<<<<< HEAD
debugger;
-=======
- debugger
->>>>>>> LEXCommunityLiJun
helper.select_agency_change(component, event, helper);
},
hosChange: function (component, event, helper) {
-<<<<<<< HEAD
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");
->>>>>>> LEXCommunityLiJun
if (hospital_name.match(/(\S+\s)+/)) {
if (hospital_nameld != hospital_name) {
helper.searchHos(component, event, helper);
@@ -328,15 +225,9 @@
},
//浣跨敤浜у搧1
UseProduct1Change: function (component, event, helper) {
-<<<<<<< HEAD
var UseProduct1Name = event.getParam('value');
var UseProduct1Nameold = component.get('v.UseProduct1s');
debugger;
-=======
- var UseProduct1Name = event.getParam("value");
- var UseProduct1Nameold = component.get("v.UseProduct1s");
- debugger
->>>>>>> LEXCommunityLiJun
if (UseProduct1Name.match(/(\S+\s)+/)) {
if (UseProduct1Name != UseProduct1Nameold) {
helper.searchUseProduct1(component, event, helper);
@@ -354,13 +245,8 @@
},
//浣跨敤浜у搧2
UseProduct2Change: function (component, event, helper) {
-<<<<<<< HEAD
var UseProduct2Name = event.getParam('value');
var UseProduct2Nameold = component.get('v.UseProduct2s');
-=======
- var UseProduct2Name = event.getParam("value");
- var UseProduct2Nameold = component.get("v.UseProduct2s");
->>>>>>> LEXCommunityLiJun
if (UseProduct2Name.match(/(\S+\s)+/)) {
if (UseProduct2Name != UseProduct2Nameold) {
helper.searchUseProduct2(component, event, helper);
@@ -381,13 +267,8 @@
},
//浣跨敤浜у搧3
UseProduct3Change: function (component, event, helper) {
-<<<<<<< HEAD
var UseProduct3Name = event.getParam('value');
var UseProduct3Nameold = component.get('v.UseProduct3s');
-=======
- var UseProduct3Name = event.getParam("value");
- var UseProduct3Nameold = component.get("v.UseProduct3s");
->>>>>>> LEXCommunityLiJun
if (UseProduct3Name.match(/(\S+\s)+/)) {
if (UseProduct3Name != UseProduct3Nameold) {
helper.searchUseProduct3(component, event, helper);
@@ -404,10 +285,6 @@
helper.seletUseProduct3Change(component, event, helper);
},
-<<<<<<< HEAD
-=======
-
->>>>>>> LEXCommunityLiJun
select_department: function (component, event, helper) {
helper.setOpportunity_cfilter(component);
},
@@ -429,39 +306,24 @@
helper.readFile(component, helper, files[0]);
},
CreateRecord: function (component, event, helper) {
-<<<<<<< HEAD
var files = event.getSource().get('v.files');
helper.readFile(component, helper, files[0]);
component.set('v.showErrorInfo', false);
-=======
- var files = event.getSource().get("v.files");
- helper.readFile(component, helper, files[0]);
- component.set("v.showErrorInfo", false);
->>>>>>> LEXCommunityLiJun
},
processFileContent: function (component, event, helper) {
helper.saveRecords(component, event, helper);
-<<<<<<< HEAD
component.set('v.showErrorInfo', false);
},
cancel: function (component, event, helper) {
component.set('v.showMain', true);
-=======
- component.set("v.showErrorInfo", false);
- },
-
- cancel: function (component, event, helper) {
- component.set("v.showMain", true);
->>>>>>> LEXCommunityLiJun
},
import: function (component, event, helper) {
helper.showImport(component);
},
exportDate: function (component, event, helper) {
-<<<<<<< HEAD
var stockData = component.get('v.reports_date');
console.log('瀵煎嚭鏁版嵁' + stockData);
var csv = helper.convertArrayOfObjectsToCSV(component, stockData);
@@ -477,21 +339,6 @@
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
-=======
- var stockData = component.get("v.reports_date");
- console.log('瀵煎嚭鏁版嵁' + stockData);
- var csv = helper.convertArrayOfObjectsToCSV(component, stockData);
- if (csv == null) { return; }
-
- 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]
- document.body.appendChild(hiddenElement); // Required for FireFox browser
- hiddenElement.click(); // using click() js function to download csv file
-
->>>>>>> LEXCommunityLiJun
},
export_condition: function (component, event, helper) {
helper.showExport(component);
@@ -502,7 +349,6 @@
},
export: function (component, event, helper) {
console.log('杩涘叆export');
-<<<<<<< HEAD
var stockData = component.get('v.reports_date');
console.log('鏌ュ嚭鐨勬暟鎹�' + stockData);
},
@@ -512,17 +358,6 @@
},
close_export: function (component, event, helper) {
component.set('v.showMain', true);
-=======
- var stockData = component.get("v.reports_date");
- console.log('鏌ュ嚭鐨勬暟鎹�' + stockData);
- },
- 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);
->>>>>>> LEXCommunityLiJun
helper.close_export(component);
},
select_ConsumptionOfConsumables: function (component, event, helper) {
@@ -550,8 +385,4 @@
var errorDiv01 = component.find('errorDiv01');
$A.util.addClass(errorDiv01, 'slds-hide');
}
-<<<<<<< HEAD
});
-=======
-})
->>>>>>> LEXCommunityLiJun
diff --git a/force-app/main/default/aura/RetrospectiveWeeklyReport/RetrospectiveWeeklyReportHelper.js b/force-app/main/default/aura/RetrospectiveWeeklyReport/RetrospectiveWeeklyReportHelper.js
index e24d6f0..8aa9fe2 100644
--- a/force-app/main/default/aura/RetrospectiveWeeklyReport/RetrospectiveWeeklyReportHelper.js
+++ b/force-app/main/default/aura/RetrospectiveWeeklyReport/RetrospectiveWeeklyReportHelper.js
@@ -1,12 +1,7 @@
({
doinit: function (component, event, helper) {
-<<<<<<< HEAD
document.title = '杩芥函鏃ユ姤';
-=======
- document.title = "杩芥函鏃ユ姤";
-
->>>>>>> LEXCommunityLiJun
this.report_date_list(component, event, helper, 5);
component.set('v.login', true);
var action = component.get('c.getalldata');
@@ -19,16 +14,11 @@
component.set('v.allselectlist', res.allselectlist);
component.set('v.doclist', res.doclist);
//fy
-<<<<<<< HEAD
-=======
-
->>>>>>> LEXCommunityLiJun
var xx = res.UserProType;
component.set('v.UserProType', res.UserProType);
var gg = component.get('v.UserProType');
//fy
-<<<<<<< HEAD
component
.find('select_agency_person')
.set(
@@ -82,35 +72,11 @@
//this.showErrorToast(component);
component.set('v.login', false);
}
-=======
- 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'));
-
- component.set('v.PIConfig', res.PIConfig);// 20220222 PI鏀归�� by Bright
- component.set('v.login', false);
- }
- else {
- //component.set('v.errorMessage', 'doinit failed.');
- this.error('doinit failed.');
- //this.showErrorToast(component);
- component.set('v.login', false);
- }
->>>>>>> LEXCommunityLiJun
});
$A.enqueueAction(action);
},
doinitSave: function (component, event, helper) {
-<<<<<<< HEAD
document.title = '杩芥函鏃ユ姤';
-=======
- document.title = "杩芥函鏃ユ姤";
->>>>>>> LEXCommunityLiJun
component.set('v.loginEdit', true);
this.report_date_list(component, event, helper, 5);
var action = component.get('c.getalldata');
@@ -123,16 +89,11 @@
component.set('v.allselectlist', res.allselectlist);
component.set('v.doclist', res.doclist);
//fy
-<<<<<<< HEAD
-=======
-
->>>>>>> LEXCommunityLiJun
var xx = res.UserProType;
component.set('v.UserProType', res.UserProType);
var gg = component.get('v.UserProType');
//fy
-<<<<<<< HEAD
component
.find('select_agency_person')
.set(
@@ -181,21 +142,6 @@
component.set('v.PIConfig', res.PIConfig); // 20220222 PI鏀归�� by Bright
component.set('v.loginEdit', false);
} else {
-=======
- 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'));
-
- component.set('v.PIConfig', res.PIConfig);// 20220222 PI鏀归�� by Bright
- component.set('v.loginEdit', false);
- }
- else {
->>>>>>> LEXCommunityLiJun
//component.set('v.errorMessage', 'doinit failed.');
this.error('doinit failed.');
//this.showErrorToast(component);
@@ -206,26 +152,18 @@
},
//鍏朵粬鍝佺墝浜у搧绫诲埆 涓嬫媺妗嗚祴鍊�
selectProductCcategory: function (component) {
-<<<<<<< HEAD
var select_ProductClassification = component
.find('select_ProductClassification')
.get('v.value');
-=======
- var select_ProductClassification = component.find('select_ProductClassification').get('v.value');
->>>>>>> LEXCommunityLiJun
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();
-<<<<<<< HEAD
component
.find('select_ProductCcategory')
.set('v.options', JSON.parse(JSON.stringify(res)));
-=======
- component.find('select_ProductCcategory').set('v.options', JSON.parse(JSON.stringify(res)));
->>>>>>> LEXCommunityLiJun
}
});
$A.enqueueAction(action);
@@ -235,10 +173,6 @@
},
//鏍规嵁鍛ㄥ拰鎷呭綋鏌ヨ鏁版嵁缁欏垵濮嬮〉闈㈣祴鏁版嵁
get_reports: function (component, event, helper, date_str, person_str) {
-<<<<<<< HEAD
-=======
-
->>>>>>> LEXCommunityLiJun
if (!date_str) {
return false;
}
@@ -252,20 +186,11 @@
date_str = this.get_date_string(date_str);
var action = component.get('c.getReports');
action.setParams({
-<<<<<<< HEAD
date_str: date_str,
person_str: person_str
});
component.set('v.loginEdit', true);
action.setCallback(this, function (response) {
-=======
- "date_str": date_str,
- "person_str": person_str,
- });
- component.set('v.loginEdit', true);
- action.setCallback(this, function (response) {
-
->>>>>>> LEXCommunityLiJun
var state = response.getState();
if (state == 'SUCCESS') {
var res = response.getReturnValue();
@@ -273,7 +198,6 @@
component.set('v.report_count', res.reports.length);
// 鏇存柊淇濆瓨寰屻伄select_data鐢�
var report_id = component.get('v.update_select_report_data_id');
-<<<<<<< HEAD
if (report_id != '') {
for (var i = 0; i < res.reports.length; i++) {
if (res.reports[i]['Id'] == report_id) {
@@ -281,12 +205,6 @@
'v.select_report_data',
res.reports[i]
);
-=======
- 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]);
->>>>>>> LEXCommunityLiJun
break;
}
}
@@ -298,7 +216,6 @@
//fy 20220414 start
var report1 = [];
var report2 = [];
-<<<<<<< HEAD
res.reports.forEach((item) => {
if (
(item.WorkRecord__c == '绉戝浼�' &&
@@ -310,12 +227,6 @@
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 == ""))) {
->>>>>>> LEXCommunityLiJun
report1.push(item);
} else {
report2.push(item);
@@ -325,7 +236,6 @@
//fy 20220414 end
// PI 鏀归�� By Bright 20220328
if (true) {
-<<<<<<< HEAD
let doctor_awsids = res.reports.map(function (d) {
return d.doctor2__r.AWS_Data_Id__c;
});
@@ -398,41 +308,6 @@
},
staticResourceAgencyContact.token
);
-=======
- 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);
- 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];
- }
- }
-
- 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);
->>>>>>> LEXCommunityLiJun
} else {
component.set('v.loginEdit', false);
}
@@ -441,13 +316,7 @@
component.set('v.list_message', 'no_data');
component.set('v.loginEdit', false);
}
-<<<<<<< HEAD
} else {
-=======
-
- }
- else {
->>>>>>> LEXCommunityLiJun
//component.set('v.errorMessage', 'get_reports failed.');
this.error('get_reports failed.');
//this.showErrorToast(component);
@@ -458,7 +327,6 @@
},
//澶嶅埗鎸夐挳鍙樼伆鑹�
select_date_change: function (component, event, helper) {
-<<<<<<< HEAD
this.get_reports(
component,
event,
@@ -466,16 +334,12 @@
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'));
->>>>>>> LEXCommunityLiJun
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) {
-<<<<<<< HEAD
var select_value = component
.find('select_agency_person')
.get('v.value');
@@ -488,12 +352,6 @@
component.find('select_date').get('v.value'),
select_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);
->>>>>>> LEXCommunityLiJun
component.set('v.select_report_data_radio', '');
component.find('copy_button').set('v.disabled', true);
component.find('delete_button').set('v.disabled', true);
@@ -512,10 +370,6 @@
},
//澶嶅埗鍜岀紪杈戝洖鏄剧殑浣嶇疆
toggle_report: function (component) {
-<<<<<<< HEAD
-=======
-
->>>>>>> LEXCommunityLiJun
var modal_window = component.find('modal_window');
var modal_bg = component.find('modal_bg');
if ($A.util.hasClass(modal_window, 'disp_none')) {
@@ -523,14 +377,10 @@
$A.util.removeClass(modal_window, 'disp_none');
$A.util.removeClass(modal_bg, 'disp_none');
//澶嶅埗 鍜岀紪杈� 鍥炴樉闂鍦ㄨ繖閲岄潰
-<<<<<<< HEAD
if (
component.get('v.mode') == 'edit' ||
component.get('v.mode') == 'copy'
) {
-=======
- if (component.get('v.mode') == 'edit' || component.get('v.mode') == 'copy') {
->>>>>>> LEXCommunityLiJun
var select_data = '';
if (component.get('v.mode') == 'edit') {
select_data = component.get('v.select_report_data');
@@ -543,7 +393,6 @@
// 鍖婚櫌鍚�
if (select_data['Agency_Hospital__c'] != '') {
for (var i = 0; i < reports.length; i++) {
-<<<<<<< HEAD
if (
reports[i]['Agency_Hospital__c'] ==
select_data['Agency_Hospital__c']
@@ -552,29 +401,19 @@
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'];
->>>>>>> LEXCommunityLiJun
}
}
component.set('v.hospital', Agency_Hospital_text);
component.set('v.hospitalId', Agency_Hospital_parent_id);
-<<<<<<< HEAD
component.set(
'v.hospitalLinkId',
select_data['Agency_Hospital__c']
);
-=======
- component.set('v.hospitalLinkId', select_data['Agency_Hospital__c']);
->>>>>>> LEXCommunityLiJun
component.find('new_con').set('v.disabled', false);
}
//浣跨敤浜у搧1(浜у搧鍨嬪彿)
var UseProduct1Text = '';
var UseProduct1Id = '';
-<<<<<<< HEAD
if (
select_data['UseProduct1__c'] != '' &&
select_data['UseProduct1__c'] != undefined
@@ -588,29 +427,18 @@
reports[i]['UseProduct1__r'][
'Asset_Model_No__c'
];
-=======
- 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'];
->>>>>>> LEXCommunityLiJun
UseProduct1Id = reports[i]['UseProduct1__c'];
}
}
component.set('v.UseProduct1', UseProduct1Text);
-<<<<<<< HEAD
component.set(
'v.UseProduct1Id',
select_data['UseProduct1__c']
);
-=======
- component.set('v.UseProduct1Id', select_data['UseProduct1__c']);
->>>>>>> LEXCommunityLiJun
}
//浣跨敤浜у搧2
var UseProduct2Text = '';
var UseProduct2Id = '';
-<<<<<<< HEAD
if (
select_data['UseProduct2__c'] != '' &&
select_data['UseProduct2__c'] != undefined
@@ -624,29 +452,18 @@
reports[i]['UseProduct2__r'][
'Asset_Model_No__c'
];
-=======
- 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'];
->>>>>>> LEXCommunityLiJun
UseProduct2Id = reports[i]['UseProduct2__c'];
}
}
component.set('v.UseProduct2', UseProduct2Text);
-<<<<<<< HEAD
component.set(
'v.UseProduct2Id',
select_data['UseProduct2__c']
);
-=======
- component.set('v.UseProduct2Id', select_data['UseProduct2__c']);
->>>>>>> LEXCommunityLiJun
}
//浣跨敤浜у搧3
var UseProduct3Text = '';
var UseProduct3Id = '';
-<<<<<<< HEAD
if (
select_data['UseProduct3__c'] != '' &&
select_data['UseProduct3__c'] != undefined
@@ -660,39 +477,24 @@
reports[i]['UseProduct3__r'][
'Asset_Model_No__c'
];
-=======
- 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'];
->>>>>>> LEXCommunityLiJun
UseProduct3Id = reports[i]['UseProduct3__c'];
}
}
component.set('v.UseProduct3', UseProduct3Text);
-<<<<<<< HEAD
component.set(
'v.UseProduct3Id',
select_data['UseProduct3__c']
);
-=======
- component.set('v.UseProduct3Id', select_data['UseProduct3__c']);
->>>>>>> LEXCommunityLiJun
}
//娲诲姩鏃�
var reportDate;
if (select_data['Report_Date__c'] != '') {
for (var i = 0; i < reports.length; i++) {
-<<<<<<< HEAD
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"];
->>>>>>> LEXCommunityLiJun
}
}
component.set('v.data.Report_Date__c', reportDate);
@@ -703,7 +505,6 @@
// }
//fy Department_Cateogy_text__c
if (select_data['Department_Cateogy_text__c'] != '') {
-<<<<<<< HEAD
component
.find('select_department')
.set(
@@ -726,22 +527,10 @@
'select_purpose_type',
select_data['WorkRecord__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']);
- }
- // 娲诲姩鍖哄垎
- if (select_data['WorkRecord__c'] != '') {
- this.set_selected(component, 'select_purpose_type', select_data['WorkRecord__c']);
->>>>>>> LEXCommunityLiJun
this.selectPurposeType(component);
}
// 鎷滆浜�
if (select_data['WorkRecord__c'] == '绉戝浼�') {
-<<<<<<< HEAD
component.set(
'v.default_select_doctor_id2',
select_data['doctor3__c']
@@ -753,18 +542,10 @@
'v.default_select_doctor_id',
select_data['doctor2__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']);
->>>>>>> LEXCommunityLiJun
this.set_doctor_list(component);
}
//浜у搧鍒嗙被(绗笁鍒嗙被)
if (select_data['ProductClassification__c'] != null) {
-<<<<<<< HEAD
this.set_selected(
component,
'select_ProductClassification',
@@ -795,34 +576,12 @@
}
var report_id = component.get('v.edit_copy_select_report_id');
if (report_id != '') {
-=======
- this.set_selected(component, 'select_ProductClassification', select_data['ProductClassification__c']);
- this.selectProductClassification(component);
- }
- // 浜у搧1鍚岀被鑰楁潗绉戝鏈堜娇鐢ㄩ噺
- if (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']);
- }
- // 鏀彺闇�姹�
- if (select_data['WorkMark__c'] != false) {
- 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 != "") {
->>>>>>> LEXCommunityLiJun
var select_EffectProgress1 = '';
var WarlockClassification = '';
var ProductCcategory = '';
var productCategories = '';
var i = 0;
for (i = 0; i < reports.length; i++) {
-<<<<<<< HEAD
if (report_id == reports[i]['Id']) {
select_EffectProgress1 =
reports[i]['EffectProgress__c'];
@@ -832,18 +591,10 @@
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"];
->>>>>>> LEXCommunityLiJun
break;
}
}
//鏁堟灉/杩涘害
-<<<<<<< HEAD
if (
select_EffectProgress1 != null &&
select_EffectProgress1 != ''
@@ -866,33 +617,15 @@
component
.find('select_ProductCcategory')
.set('v.value', ProductCcategory);
-=======
- 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 (ProductCcategory != null && ProductCcategory != '') {
- component.find('select_ProductCcategory').set('v.value', ProductCcategory);
->>>>>>> LEXCommunityLiJun
this.selectpurposetype(component);
}
//鍏朵粬鍝佺墝浜у搧绫诲埆
if (productCategories != null && productCategories != '') {
-<<<<<<< HEAD
component
.find('select_productCategories')
.set('v.value', productCategories);
}
component.set('v.edit_copy_select_report_id', '');
-=======
- component.find('select_productCategories').set('v.value', productCategories);
- }
- component.set('v.edit_copy_select_report_id', "");
->>>>>>> LEXCommunityLiJun
}
}
} else {
@@ -902,7 +635,6 @@
var UseProduct1__c = component.get('v.UseProduct1Id');
var UseProduct2__c = component.get('v.UseProduct2Id');
var UseProduct3__c = component.get('v.UseProduct3Id');
-<<<<<<< HEAD
var Department_Cateogy__c = component
.find('select_department')
.get('v.value');
@@ -939,23 +671,6 @@
var confirm_text = '鏀惧純鏂板缓鏃ユ姤锛�';
if (
!Report_Date__c &&
-=======
- 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');
- if (component.get('v.mode') == 'new') {
- var confirm_title = '璀﹀憡!'
- var confirm_text = '鏀惧純鏂板缓鏃ユ姤锛�';
- if (!Report_Date__c &&
->>>>>>> LEXCommunityLiJun
!Agency_Hospital__c &&
!UseProduct1__c &&
!UseProduct2__c &&
@@ -980,7 +695,6 @@
this.close_confirm(component, confirm_title, confirm_text);
}
} else if (component.get('v.mode') == 'copy') {
-<<<<<<< HEAD
var confirm_title = '璀﹀憡!';
var confirm_text = '鏀惧純鏂板缓鏃ユ姤锛�';
if (
@@ -1010,26 +724,6 @@
select_report_data['WorkMark__c'] == WorkMark__c &&
select_report_data['WorkRecord__c'] == WorkRecord__c
) {
-=======
- 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['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['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['WorkMark__c'] == WorkMark__c &&
- select_report_data['WorkRecord__c'] == WorkRecord__c) {
->>>>>>> LEXCommunityLiJun
this.allclear(component);
$A.util.addClass(modal_window, 'disp_none');
$A.util.addClass(modal_bg, 'disp_none');
@@ -1037,7 +731,6 @@
this.close_confirm(component, confirm_title, confirm_text);
}
} else if (component.get('v.mode') == 'edit') {
-<<<<<<< HEAD
var confirm_title = '璀﹀憡!';
var confirm_text = '鏀惧純缂栬緫鏃ユ姤锛�';
if (
@@ -1067,26 +760,6 @@
select_report_data['WorkMark__c'] == WorkMark__c &&
select_report_data['WorkRecord__c'] == WorkRecord__c
) {
-=======
- 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['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['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['WorkMark__c'] == WorkMark__c &&
- select_report_data['WorkRecord__c'] == WorkRecord__c) {
->>>>>>> LEXCommunityLiJun
this.allclear(component);
$A.util.addClass(modal_window, 'disp_none');
$A.util.addClass(modal_bg, 'disp_none');
@@ -1103,18 +776,12 @@
// OPEN
$A.util.removeClass(modal_window, 'disp_none');
$A.util.removeClass(modal_bg, 'disp_none');
-<<<<<<< HEAD
component.set('v.loginEdit', true);
//澶嶅埗 鍜岀紪杈� 鍥炴樉闂鍦ㄨ繖閲岄潰
if (
component.get('v.mode') == 'edit' ||
component.get('v.mode') == 'copy'
) {
-=======
- component.set('v.loginEdit',true);
- //澶嶅埗 鍜岀紪杈� 鍥炴樉闂鍦ㄨ繖閲岄潰
- if (component.get('v.mode') == 'edit' || component.get('v.mode') == 'copy') {
->>>>>>> LEXCommunityLiJun
var select_data = '';
if (component.get('v.mode') == 'edit') {
select_data = component.get('v.select_report_data');
@@ -1127,7 +794,6 @@
// 鍖婚櫌鍚�
if (select_data['Agency_Hospital__c'] != '') {
for (var i = 0; i < reports.length; i++) {
-<<<<<<< HEAD
if (
reports[i]['Agency_Hospital__c'] ==
select_data['Agency_Hospital__c']
@@ -1136,29 +802,19 @@
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'];
->>>>>>> LEXCommunityLiJun
}
}
component.set('v.hospital', Agency_Hospital_text);
component.set('v.hospitalId', Agency_Hospital_parent_id);
-<<<<<<< HEAD
component.set(
'v.hospitalLinkId',
select_data['Agency_Hospital__c']
);
-=======
- component.set('v.hospitalLinkId', select_data['Agency_Hospital__c']);
->>>>>>> LEXCommunityLiJun
component.find('new_con').set('v.disabled', false);
}
//浣跨敤浜у搧1(浜у搧鍨嬪彿)
var UseProduct1Text = '';
var UseProduct1Id = '';
-<<<<<<< HEAD
if (
select_data['UseProduct1__c'] != '' &&
select_data['UseProduct1__c'] != undefined
@@ -1172,29 +828,18 @@
reports[i]['UseProduct1__r'][
'Asset_Model_No__c'
];
-=======
- 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'];
->>>>>>> LEXCommunityLiJun
UseProduct1Id = reports[i]['UseProduct1__c'];
}
}
component.set('v.UseProduct1', UseProduct1Text);
-<<<<<<< HEAD
component.set(
'v.UseProduct1Id',
select_data['UseProduct1__c']
);
-=======
- component.set('v.UseProduct1Id', select_data['UseProduct1__c']);
->>>>>>> LEXCommunityLiJun
}
//浣跨敤浜у搧2
var UseProduct2Text = '';
var UseProduct2Id = '';
-<<<<<<< HEAD
if (
select_data['UseProduct2__c'] != '' &&
select_data['UseProduct2__c'] != undefined
@@ -1208,29 +853,18 @@
reports[i]['UseProduct2__r'][
'Asset_Model_No__c'
];
-=======
- 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'];
->>>>>>> LEXCommunityLiJun
UseProduct2Id = reports[i]['UseProduct2__c'];
}
}
component.set('v.UseProduct2', UseProduct2Text);
-<<<<<<< HEAD
component.set(
'v.UseProduct2Id',
select_data['UseProduct2__c']
);
-=======
- component.set('v.UseProduct2Id', select_data['UseProduct2__c']);
->>>>>>> LEXCommunityLiJun
}
//浣跨敤浜у搧3
var UseProduct3Text = '';
var UseProduct3Id = '';
-<<<<<<< HEAD
if (
select_data['UseProduct3__c'] != '' &&
select_data['UseProduct3__c'] != undefined
@@ -1244,39 +878,24 @@
reports[i]['UseProduct3__r'][
'Asset_Model_No__c'
];
-=======
- 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'];
->>>>>>> LEXCommunityLiJun
UseProduct3Id = reports[i]['UseProduct3__c'];
}
}
component.set('v.UseProduct3', UseProduct3Text);
-<<<<<<< HEAD
component.set(
'v.UseProduct3Id',
select_data['UseProduct3__c']
);
-=======
- component.set('v.UseProduct3Id', select_data['UseProduct3__c']);
->>>>>>> LEXCommunityLiJun
}
//娲诲姩鏃�
var reportDate;
if (select_data['Report_Date__c'] != '') {
for (var i = 0; i < reports.length; i++) {
-<<<<<<< HEAD
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"];
->>>>>>> LEXCommunityLiJun
}
}
component.set('v.data.Report_Date__c', reportDate);
@@ -1287,7 +906,6 @@
// }
//fy Department_Cateogy_text__c
if (select_data['Department_Cateogy_text__c'] != '') {
-<<<<<<< HEAD
component
.find('select_department')
.set(
@@ -1310,22 +928,10 @@
'select_purpose_type',
select_data['WorkRecord__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']);
- }
- // 娲诲姩鍖哄垎
- if (select_data['WorkRecord__c'] != '') {
- this.set_selected(component, 'select_purpose_type', select_data['WorkRecord__c']);
->>>>>>> LEXCommunityLiJun
this.selectPurposeType(component);
}
// 鎷滆浜�
if (select_data['WorkRecord__c'] == '绉戝浼�') {
-<<<<<<< HEAD
component.set(
'v.default_select_doctor_id2',
select_data['doctor3__c']
@@ -1337,18 +943,10 @@
'v.default_select_doctor_id',
select_data['doctor2__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']);
->>>>>>> LEXCommunityLiJun
this.set_doctor_list_edit(component);
}
//浜у搧鍒嗙被(绗笁鍒嗙被)
if (select_data['ProductClassification__c'] != null) {
-<<<<<<< HEAD
this.set_selected(
component,
'select_ProductClassification',
@@ -1379,34 +977,12 @@
}
var report_id = component.get('v.edit_copy_select_report_id');
if (report_id != '') {
-=======
- this.set_selected(component, 'select_ProductClassification', select_data['ProductClassification__c']);
- this.selectProductClassification(component);
- }
- // 浜у搧1鍚岀被鑰楁潗绉戝鏈堜娇鐢ㄩ噺
- if (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']);
- }
- // 鏀彺闇�姹�
- if (select_data['WorkMark__c'] != false) {
- 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 != "") {
->>>>>>> LEXCommunityLiJun
var select_EffectProgress1 = '';
var WarlockClassification = '';
var ProductCcategory = '';
var productCategories = '';
var i = 0;
for (i = 0; i < reports.length; i++) {
-<<<<<<< HEAD
if (report_id == reports[i]['Id']) {
select_EffectProgress1 =
reports[i]['EffectProgress__c'];
@@ -1416,18 +992,10 @@
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"];
->>>>>>> LEXCommunityLiJun
break;
}
}
//鏁堟灉/杩涘害
-<<<<<<< HEAD
if (
select_EffectProgress1 != null &&
select_EffectProgress1 != ''
@@ -1450,36 +1018,16 @@
component
.find('select_ProductCcategory')
.set('v.value', ProductCcategory);
-=======
- 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 (ProductCcategory != null && ProductCcategory != '') {
- component.find('select_ProductCcategory').set('v.value', ProductCcategory);
->>>>>>> LEXCommunityLiJun
this.selectpurposetype(component);
}
//鍏朵粬鍝佺墝浜у搧绫诲埆
if (productCategories != null && productCategories != '') {
-<<<<<<< HEAD
component
.find('select_productCategories')
.set('v.value', productCategories);
}
component.set('v.edit_copy_select_report_id', '');
}
-=======
- component.find('select_productCategories').set('v.value', productCategories);
- }
- component.set('v.edit_copy_select_report_id', "");
- }
-
->>>>>>> LEXCommunityLiJun
}
} else {
var select_report_data = component.get('v.select_report_data');
@@ -1488,7 +1036,6 @@
var UseProduct1__c = component.get('v.UseProduct1Id');
var UseProduct2__c = component.get('v.UseProduct2Id');
var UseProduct3__c = component.get('v.UseProduct3Id');
-<<<<<<< HEAD
var Department_Cateogy__c = component
.find('select_department')
.get('v.value');
@@ -1525,23 +1072,6 @@
var confirm_text = '鏀惧純鏂板缓鏃ユ姤锛�';
if (
!Report_Date__c &&
-=======
- 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');
- if (component.get('v.mode') == 'new') {
- var confirm_title = '璀﹀憡!'
- var confirm_text = '鏀惧純鏂板缓鏃ユ姤锛�';
- if (!Report_Date__c &&
->>>>>>> LEXCommunityLiJun
!Agency_Hospital__c &&
!UseProduct1__c &&
!UseProduct2__c &&
@@ -1566,7 +1096,6 @@
this.close_confirm(component, confirm_title, confirm_text);
}
} else if (component.get('v.mode') == 'copy') {
-<<<<<<< HEAD
var confirm_title = '璀﹀憡!';
var confirm_text = '鏀惧純鏂板缓鏃ユ姤锛�';
if (
@@ -1596,26 +1125,6 @@
select_report_data['WorkMark__c'] == WorkMark__c &&
select_report_data['WorkRecord__c'] == WorkRecord__c
) {
-=======
- 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['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['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['WorkMark__c'] == WorkMark__c &&
- select_report_data['WorkRecord__c'] == WorkRecord__c) {
->>>>>>> LEXCommunityLiJun
this.allclear(component);
$A.util.addClass(modal_window, 'disp_none');
$A.util.addClass(modal_bg, 'disp_none');
@@ -1623,7 +1132,6 @@
this.close_confirm(component, confirm_title, confirm_text);
}
} else if (component.get('v.mode') == 'edit') {
-<<<<<<< HEAD
var confirm_title = '璀﹀憡!';
var confirm_text = '鏀惧純缂栬緫鏃ユ姤锛�';
if (
@@ -1653,26 +1161,6 @@
select_report_data['WorkMark__c'] == WorkMark__c &&
select_report_data['WorkRecord__c'] == WorkRecord__c
) {
-=======
- 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['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['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['WorkMark__c'] == WorkMark__c &&
- select_report_data['WorkRecord__c'] == WorkRecord__c) {
->>>>>>> LEXCommunityLiJun
this.allclear(component);
$A.util.addClass(modal_window, 'disp_none');
$A.util.addClass(modal_bg, 'disp_none');
@@ -1680,10 +1168,6 @@
this.close_confirm(component, confirm_title, confirm_text);
}
}
-<<<<<<< HEAD
-=======
-
->>>>>>> LEXCommunityLiJun
}
//component.set('v.loginEdit',false);
},
@@ -1696,11 +1180,7 @@
var modal_bg = component.find('modal_bg');
var modal_confirm = component.find('modal_confirm');
var modal_confirm_bg = component.find('modal_confirm_bg');
-<<<<<<< HEAD
-=======
-
->>>>>>> LEXCommunityLiJun
if (confirm_status == 0) {
$A.util.addClass(modal_window, 'disp_none');
$A.util.addClass(modal_bg, 'disp_none');
@@ -1712,11 +1192,7 @@
$A.util.addClass(modal_confirm_bg, 'disp_none');
component.set('v.mode', '');
this.allclear(component);
-<<<<<<< HEAD
component.set('v.reports_now', '');
-=======
- component.set('v.reports_now', "");
->>>>>>> LEXCommunityLiJun
component.set('v.reports_now_count', 0);
component.set('v.confirm_status', 0);
} else if (confirm_status == 2) {
@@ -1730,33 +1206,21 @@
},
//鏂板缓鎸夐挳
new_report: function (component, event, helper) {
-<<<<<<< HEAD
-=======
-
->>>>>>> LEXCommunityLiJun
component.set('v.mode', 'new');
component.set('v.dialog_type', '鏂板缓');
// 鍛�
var select_date = component.find('select_date').get('v.value');
// 鎷呭綋
-<<<<<<< HEAD
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];
-=======
- 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];
->>>>>>> LEXCommunityLiJun
}
component.set('v.selected_date', select_date);
// 鎷呭綋
var name = component.get('v.selected_agency_person');
-<<<<<<< HEAD
var ret = this.create_report_header(
component,
event,
@@ -1769,21 +1233,10 @@
// SWAG-CF58C3 fy start
this.set_aws_url(component, 'Agency_Contact__c');
-=======
- 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')
->>>>>>> LEXCommunityLiJun
// SWAG-CF58C3 fy end
},
// 澶嶅埗鎸夐挳
copy_button: function (component, event, helper) {
-<<<<<<< HEAD
-=======
-
->>>>>>> LEXCommunityLiJun
this.allclear(component);
component.set('v.mode', 'copy');
component.set('v.dialog_type', '鏂板缓');
@@ -1791,7 +1244,6 @@
component.set('v.loadOpp', true);
// 閫�
var now = new Date();
-<<<<<<< HEAD
var start_day = new Date(
now.getFullYear(),
now.getMonth(),
@@ -1803,10 +1255,6 @@
(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();
->>>>>>> LEXCommunityLiJun
this.set_selected(component, 'select_date', select_date);
component.set('v.selected_date', select_date);
// 鎷呭綋
@@ -1818,7 +1266,6 @@
component.set('v.edit_copy_select_report_id', select_report_data['Id']);
component.set('v.select_report_data', select_report_data);
-<<<<<<< HEAD
var ret = this.create_report_header(
component,
event,
@@ -1839,24 +1286,6 @@
var action = component.get('c.deleteAgencyReport');
action.setParams({
agencyReport_id: select_report_data.Id
-=======
- 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')
- // 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,
->>>>>>> LEXCommunityLiJun
});
action.setCallback(this, function (response) {
var state = response.getState();
@@ -1875,10 +1304,6 @@
},
//澶嶅埗鎸夐挳鍙敤
change_report_radio: function (component, event, helper) {
-<<<<<<< HEAD
-=======
-
->>>>>>> LEXCommunityLiJun
var reports = component.get('v.reports');
for (var i = 0; i < reports.length; i++) {
if (reports[i].Name == event.getSource().get('v.label')) {
@@ -1892,16 +1317,11 @@
//缂栬緫鎸夐挳
edit_button: function (component, event, helper) {
component.set('v.login', true);
-<<<<<<< HEAD
debugger;
-=======
- debugger
->>>>>>> LEXCommunityLiJun
//component.set('v.loginEdit', true);
this.allclear(component);
//component.set('v.loadOpp', true);
var index = event.getSource().get('v.value');
-<<<<<<< HEAD
component.set(
'v.select_report_data',
component.get('v.reports')[index]
@@ -1914,21 +1334,11 @@
var text_tmp = select_date.split('-');
var select_date_text =
text_tmp[0] + '/' + Number(text_tmp[1]) + '/' + Number(text_tmp[2]);
-=======
- 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 text_tmp = select_date.split('-');
- var select_date_text = text_tmp[0] + '/' + Number(text_tmp[1]) + '/' + Number(text_tmp[2]);
->>>>>>> LEXCommunityLiJun
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);
-<<<<<<< HEAD
component.set(
'v.edit_copy_select_report_id',
component.get('v.reports')[index].Id
@@ -1943,12 +1353,6 @@
);
// SWAG-CF58C3 fy start
this.set_aws_url(component, 'Agency_Contact__c');
-=======
- 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')
->>>>>>> LEXCommunityLiJun
//component.set('v.login', false);
// SWAG-CF58C3 fy end
},
@@ -1958,7 +1362,6 @@
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');
-<<<<<<< HEAD
var Person_In_Charge2__c = '';
var Submit_date__c = '';
if (component.get('v.mode') == 'edit') {
@@ -2067,70 +1470,6 @@
Amount__c == Amount__c_o &&
Close_Forecasted_Date__c == Close_Forecasted_Date__c_o
) {
-=======
- 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;
- // 鎷呭綋 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'));
- // 鎷呭綋 Person_In_Charge2__c
- 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_Hospital__c = component.get('v.hospitalLinkId');
- // 浜у搧鍒嗙被(绗笁鍒嗙被)
- var ProductClassification__c = component.find('select_ProductClassification').get('v.value');
- // 浣跨敤浜у搧1(浜у搧鍨嬪彿) UseProduct1__c
- var UseProduct1__c = component.get('v.UseProduct1Id');
- // 浣跨敤浜у搧2 UseProduct2__c
- var UseProduct2__c = component.get('v.UseProduct2Id');
- // 浣跨敤浜у搧3 UseProduct3__c
- var UseProduct3__c = component.get('v.UseProduct3Id');
- // 绉戝 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');
- // 鎷滆浜� 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');
- // 鏁堟灉/杩涘害 EffectProgress__c
- 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
- 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 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');
- 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) {
->>>>>>> LEXCommunityLiJun
StageName__c = '';
Amount__c = '';
OCMSale_Price__c = '';
@@ -2141,7 +1480,6 @@
//fy start
// if(WorkRecord__c != 'SIS'&&WorkRecord__c != '绉戝浼�'){
if (WorkRecord__c == '涓村簥淇℃伅(浣跨敤閲�)鏀堕泦') {
-<<<<<<< HEAD
if (
warlocksNumber__c == '' ||
warlocksNumber__c == '' ||
@@ -2300,63 +1638,6 @@
// if (!UseProduct2__c) { error.push("浣跨敤浜у搧2 涓嶅瓨鍦�"); }
// if (!UseProduct3__c) { error.push("浣跨敤浜у搧3 涓嶅瓨鍦�"); }
-=======
- 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 (WorkRecord__c == '涓村簥淇℃伅(浣跨敤閲�)鏀堕泦') {
- 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 (WorkRecord__c == '涓村簥淇℃伅(浣跨敤閲�)鏀堕泦') {
- 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 != 'QIS澶勭悊'){
- if (WorkRecord__c != '涓村簥淇℃伅(浣跨敤閲�)鏀堕泦') {
- if (UseProduct1__c == '' || UseProduct1__c == "" || UseProduct1__c == undefined) { error.push("浣跨敤浜у搧1(浜у搧鍨嬪彿) 涓嶅瓨鍦�"); }
- }
- 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 == '' || 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("鍛� 涓嶅瓨鍦�"); }
- var rDate = new Date(Report_Date__c);
- var sDate = new Date(Submit_date__c);
- sDate.setDate(sDate.getDate() - 1);
- 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 (!UseProduct2__c) { error.push("浣跨敤浜у搧2 涓嶅瓨鍦�"); }
- // if (!UseProduct3__c) { error.push("浣跨敤浜у搧3 涓嶅瓨鍦�"); }
-
-
-
-
-
-
-
->>>>>>> LEXCommunityLiJun
// if (!productCategories__c) { error.push("鍏朵粬鍝佺墝浜у搧绫诲埆 涓嶅瓨鍦�"); }
@@ -2379,7 +1660,6 @@
var Agency_Report__c = component.get('v.select_report_data').Id;
var action = component.get('c.editAgencyReport');
action.setParams({
-<<<<<<< HEAD
Agency_Report_Id: Agency_Report__c,
Department_Cateogy: Department_Cateogy__c,
ConsumptionOfConsumables: ConsumptionOfConsumables__c,
@@ -2405,47 +1685,15 @@
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
->>>>>>> LEXCommunityLiJun
});
action.setCallback(this, function (response) {
var state = response.getState();
if (state == 'SUCCESS') {
-<<<<<<< HEAD
debugger;
-=======
- debugger
->>>>>>> LEXCommunityLiJun
component.set('v.successMessage', '缂栬緫淇濆瓨鎴愬姛');
this.showSuccessToast(component);
var report_id = response.getReturnValue();
component.set('v.create_agency_report_id', report_id);
-<<<<<<< HEAD
var select_agency_list =
component.get('v.allselectlist').AgencyPerson__c;
for (var i = 0; i < select_agency_list.length; i++) {
@@ -2454,17 +1702,11 @@
component.get('v.select_report_data')
.Person_In_Charge2__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) {
->>>>>>> LEXCommunityLiJun
select_agency_list[i].selected = true;
} else {
select_agency_list[i].selected = false;
}
}
-<<<<<<< HEAD
component
.find('select_agency_person')
.set('v.options', select_agency_list);
@@ -2480,15 +1722,6 @@
component.find('save_button').set('v.disabled', false);
component.set('v.loginEdit', false);
} else {
-=======
- 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);
- component.find('save_button').set('v.disabled', false);
- component.set('v.loginEdit', false);
- }
- else {
->>>>>>> LEXCommunityLiJun
//component.set('v.errorMessage', 'save_report failed.');
this.error('淇濆瓨鏃ユ姤澶辫触');
//this.showErrorToast(component);
@@ -2501,7 +1734,6 @@
/* Save (New & Copy) */
var action = component.get('c.saveAgencyReport');
action.setParams({
-<<<<<<< HEAD
Department_Cateogy: Department_Cateogy__c,
ConsumptionOfConsumables: ConsumptionOfConsumables__c,
WorkMark: WorkMark__c,
@@ -2526,32 +1758,6 @@
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
->>>>>>> LEXCommunityLiJun
});
action.setCallback(this, function (response) {
var state = response.getState();
@@ -2560,7 +1766,6 @@
this.showSuccessToast(component);
var report_id = response.getReturnValue();
component.set('v.create_agency_report_id', report_id);
-<<<<<<< HEAD
this.get_reports(
component,
event,
@@ -2572,13 +1777,6 @@
var action2 = component.get('c.getReportsById');
action2.setParams({
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'));
- // 銉€兗銉�銉偊銈c兂銉夈偊鍐呫伄涓�瑕х敤
- var action2 = component.get('c.getReportsById');
- action2.setParams({
- "report_id": report_id,
->>>>>>> LEXCommunityLiJun
});
action2.setCallback(this, function (response) {
var state = response.getState();
@@ -2586,11 +1784,7 @@
var res = response.getReturnValue();
var reports_now = component.get('v.reports_now');
var reports_now_count = 0;
-<<<<<<< HEAD
if (reports_now.length > 0 && reports_now != '') {
-=======
- if (reports_now.length > 0 && reports_now != "") {
->>>>>>> LEXCommunityLiJun
reports_now_count = reports_now.length;
}
// Save&New鏅傘伄銈︺偅銉炽儔銈﹀唴銉囥兗銈夸竴瑕�
@@ -2602,7 +1796,6 @@
return 0;
});
component.set('v.reports_now', reports_now);
-<<<<<<< HEAD
component.set(
'v.reports_now_count',
reports_now.length
@@ -2617,17 +1810,6 @@
component
.find('save_button')
.set('v.disabled', false);
-=======
- component.set('v.reports_now_count', reports_now.length);
- var data_list = component.find('modal_data_list_tr');
- }
- }
- 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);
->>>>>>> LEXCommunityLiJun
component.set('v.loginEdit', false);
}
});
@@ -2636,16 +1818,9 @@
component.find('select_WorkMark').set('v.value', false);
component.find('save_button').set('v.disabled', false);
component.set('v.loginEdit', false);
-<<<<<<< HEAD
debugger;
this.doinitSave(component, event, helper);
} else {
-=======
- debugger
- this.doinitSave(component, event, helper);
- }
- else {
->>>>>>> LEXCommunityLiJun
var error = response.getError();
//component.set('v.errorMessage', '淇濆瓨鏃ユ姤澶辫触');
this.error('淇濆瓨鏃ユ姤澶辫触');
@@ -2676,7 +1851,6 @@
component.find('select_WorkMark').set('v.checked', false);
component.find('new_con').set('v.disabled', true);
component.find('select_doctor').set('v.options', clear);
-<<<<<<< HEAD
component
.find('select_DealerPersonnel')
.set(
@@ -2694,11 +1868,6 @@
)
);
// 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')));
->>>>>>> LEXCommunityLiJun
component.find('select_EffectProgress').set('v.value', '');
component.find('select_OtherBrandConsumables').set('v.value', '');
component.find('select_ProductCcategory').set('v.value', '');
@@ -2713,7 +1882,6 @@
component.set('v.Amount__c_o', '');
component.set('v.OCMSale_Price__c_o', '');
component.set('v.StageName__c_o', '');
-<<<<<<< HEAD
$A.util.addClass(
component.find('input-opportunity-stage'),
'disp_none'
@@ -2726,11 +1894,6 @@
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');
->>>>>>> LEXCommunityLiJun
$A.util.addClass(component.find('input-opportunity-date'), 'disp_none');
this.selectPurposeType(component);
this.selectProductClassification(component);
@@ -2741,7 +1904,6 @@
var ret_obj = [];
var now = new Date();
for (var i = 0; i < count; i++) {
-<<<<<<< HEAD
var start_day = new Date(
now.getFullYear(),
now.getMonth(),
@@ -2795,23 +1957,10 @@
(end_day_show.getMonth() + 1) +
'/' +
end_day_show.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(),
->>>>>>> LEXCommunityLiJun
});
} else {
ret_obj.push({
selected: false,
-<<<<<<< HEAD
value:
start_day.getFullYear() +
'/' +
@@ -2830,17 +1979,12 @@
(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(),
->>>>>>> LEXCommunityLiJun
});
}
}
component.find('select_date').set('v.options', ret_obj);
component.set('v.report_date_list', ret_obj);
},
-<<<<<<< HEAD
create_report_header: function (
component,
event,
@@ -2849,9 +1993,6 @@
s_agency,
s_date
) {
-=======
- create_report_header: function (component, event, helper, name, s_agency, s_date) {
->>>>>>> LEXCommunityLiJun
s_date = this.get_date_string(s_date);
if (s_date == false) {
//component.set('v.errorMessage', 'get_date_string failed.');
@@ -2870,17 +2011,10 @@
var key2 = s_date.replace(/-/g, '');
var action = component.get('c.createReportHeader');
action.setParams({
-<<<<<<< HEAD
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,
->>>>>>> LEXCommunityLiJun
});
component.set('v.login', true);
action.setCallback(this, function (response) {
@@ -2890,12 +2024,7 @@
component.set('v.agency_report_header_id', res);
component.set('v.login', false);
this.toggle_report(component, event, helper);
-<<<<<<< HEAD
} else {
-=======
- }
- else {
->>>>>>> LEXCommunityLiJun
//component.set('v.errorMessage', 'createReportHeader callback failed.');
this.error('createReportHeader callback failed.');
//this.showErrorToast(component);
@@ -2904,7 +2033,6 @@
});
$A.enqueueAction(action);
},
-<<<<<<< HEAD
create_report_header_edit: function (
component,
event,
@@ -2913,10 +2041,6 @@
s_agency,
s_date
) {
-=======
- create_report_header_edit: function (component, event, helper, name, s_agency, s_date) {
-
->>>>>>> LEXCommunityLiJun
s_date = this.get_date_string(s_date);
if (s_date == false) {
//component.set('v.errorMessage', 'get_date_string failed.');
@@ -2934,7 +2058,6 @@
}
var key2 = s_date.replace(/-/g, '');
var action = component.get('c.createReportHeader');
-<<<<<<< HEAD
action.setParams({
name: name,
@@ -2943,16 +2066,6 @@
head_key: head_key
});
component.set('v.login', true);
-=======
-
- action.setParams({
- "name": name,
- "s_date": s_date,
- "s_agency": s_agency,
- "head_key": head_key,
- });
- component.set('v.login',true);
->>>>>>> LEXCommunityLiJun
action.setCallback(this, function (response) {
var state = response.getState();
if (state == 'SUCCESS') {
@@ -2960,12 +2073,7 @@
component.set('v.agency_report_header_id', res);
component.set('v.login', false);
this.toggle_report_edit(component, event, helper);
-<<<<<<< HEAD
} else {
-=======
- }
- else {
->>>>>>> LEXCommunityLiJun
//component.set('v.errorMessage', 'createReportHeader callback failed.');
this.error('createReportHeader callback failed.');
//this.showErrorToast(component);
@@ -2975,11 +2083,7 @@
$A.enqueueAction(action);
},
create_header_input_key: function (agency_id, s_date) {
-<<<<<<< HEAD
if (typeof s_date != 'string') {
-=======
- if (typeof (s_date) != 'string') {
->>>>>>> LEXCommunityLiJun
s_date = this.get_date_string(s_date);
if (s_date == false) {
//component.set('v.errorMessage', 'get_date_string in create_header_input_key.');
@@ -2992,11 +2096,7 @@
return false;
}
s_date = s_date.replace(/-/g, '');
-<<<<<<< HEAD
var headkey = agency_id + ':' + s_date;
-=======
- var headkey = agency_id + ":" + s_date;
->>>>>>> LEXCommunityLiJun
return headkey;
},
@@ -3009,11 +2109,7 @@
},
// create yyyy-mm-dd string
get_date_string: function (val) {
-<<<<<<< HEAD
if (typeof val == 'string') {
-=======
- if (typeof (val) == 'string') {
->>>>>>> LEXCommunityLiJun
if (val.match(/^\d{4}\/\d{1,2}\/\d{1,2}$/)) {
val = val.replace(/[\/]/g, '-');
var tmp = val.split('-');
@@ -3048,7 +2144,6 @@
},
// Controller 鏍规嵁椤甸潰鍖婚櫌鏌ヨ绗﹀悎鐨勫尰闄�
searchHos: function (component, event, helper) {
-<<<<<<< HEAD
var hospital_name = event.getParam('value');
var action = component.get('c.getHospitalList');
action.setParams({
@@ -3057,16 +2152,6 @@
action.setCallback(this, function (response) {
var state = response.getState();
if (state === 'SUCCESS') {
-=======
- var hospital_name = event.getParam("value");
- var action = component.get("c.getHospitalList");
- action.setParams({
- "hospital_name": hospital_name
- });
- action.setCallback(this, function (response) {
- var state = response.getState();
- if (state === "SUCCESS") {
->>>>>>> LEXCommunityLiJun
var hospital_list = component.find('hospital_list');
var hosList = response.getReturnValue();
if (hosList.length > 0) {
@@ -3074,11 +2159,7 @@
} else {
$A.util.removeClass(hospital_list, 'slds-is-open');
}
-<<<<<<< HEAD
component.set('v.hospitalList', response.getReturnValue());
-=======
- component.set("v.hospitalList", response.getReturnValue());
->>>>>>> LEXCommunityLiJun
} else {
$A.util.removeClass(hospital_list, 'slds-is-open');
}
@@ -3092,7 +2173,6 @@
hideSearchs: function (component, event, helper) {
var hospital_list = component.find('hospital_list');
$A.util.removeClass(hospital_list, 'slds-is-open');
-<<<<<<< HEAD
component.set('v.hospital', '');
component.set('v.hospitals', '');
component.set('v.hospitalLinkId', '');
@@ -3100,62 +2180,36 @@
component.set('v.hospitalId', '');
},
selectHos: function (component, event, helper) {
-=======
- component.set("v.hospital", '');
- component.set("v.hospitals", '');
- component.set('v.hospitalLinkId', '');
- component.set('v.data.Agency_Hospital__c', '');
- component.set("v.hospitalId", '');
- },
- selectHos: function (component, event, helper) {
-
->>>>>>> LEXCommunityLiJun
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');
-<<<<<<< HEAD
var select_purpose_type = component
.find('select_purpose_type')
.get('v.value');
-=======
- var select_purpose_type = component.find('select_purpose_type').get('v.value');
->>>>>>> LEXCommunityLiJun
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);
-<<<<<<< HEAD
if (
select_purpose_type != '绉戝浼�' &&
hospital_data[i].Hospital__c
) {
-=======
- if (select_purpose_type != '绉戝浼�' && hospital_data[i].Hospital__c) {
->>>>>>> LEXCommunityLiJun
component.find('new_con').set('v.disabled', false);
} else {
component.find('new_con').set('v.disabled', true);
}
}
}
-<<<<<<< HEAD
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);
-
->>>>>>> LEXCommunityLiJun
component.set('v.setdoctorlisthos', true);
this.set_doctor_list_edit(component, event, helper);
},
-<<<<<<< HEAD
//妯$硦鏌ヨ浣跨敤浜у搧1(浜у搧鍨嬪彿)
searchUseProduct1: function (component, event, helper) {
var UseProduct1Name = event.getParam('value');
@@ -3170,21 +2224,6 @@
action.setCallback(this, function (response) {
var state = response.getState();
if (state === 'SUCCESS') {
-=======
-
- //妯$硦鏌ヨ浣跨敤浜у搧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");
- action.setParams({
- "UseProduct1Name": UseProduct1Name,
- "select_ProductClassification": select_ProductClassification
- });
- action.setCallback(this, function (response) {
- var state = response.getState();
- if (state === "SUCCESS") {
->>>>>>> LEXCommunityLiJun
var UseProduct1_List = component.find('UseProduct1_List');
var UseProduct1ListValue = response.getReturnValue();
if (UseProduct1ListValue.length > 0) {
@@ -3192,11 +2231,7 @@
} else {
$A.util.removeClass(UseProduct1_List, 'slds-is-open');
}
-<<<<<<< HEAD
component.set('v.UseProduct1List', UseProduct1ListValue);
-=======
- component.set("v.UseProduct1List", UseProduct1ListValue);
->>>>>>> LEXCommunityLiJun
} else {
$A.util.removeClass(UseProduct1_List, 'slds-is-open');
}
@@ -3210,21 +2245,12 @@
hideSearchUseProduct1s: function (component, event, helper) {
var UseProduct1_List = component.find('UseProduct1_List');
$A.util.removeClass(UseProduct1_List, 'slds-is-open');
-<<<<<<< HEAD
component.set('v.UseProduct1', '');
component.set('v.UseProduct1s', '');
-=======
- component.set("v.UseProduct1", '');
- component.set("v.UseProduct1s", '');
->>>>>>> LEXCommunityLiJun
component.set('v.UseProduct1Id', '');
component.set('v.data.UseProduct1__c', '');
},
seletUseProduct1Change: function (component, event, helper) {
-<<<<<<< HEAD
-=======
-
->>>>>>> LEXCommunityLiJun
var UseProduct1_List = component.find('UseProduct1_List');
$A.util.removeClass(UseProduct1_List, 'slds-is-open');
var accname = event.currentTarget.dataset.accname;
@@ -3233,7 +2259,6 @@
for (var i = 0; i < UseProduct1ListDate.length; i++) {
if (UseProduct1ListDate[i].Id == accid) {
component.set('v.UseProduct1Id', UseProduct1ListDate[i].Id);
-<<<<<<< HEAD
component.set(
'v.data.UseProduct1__c',
UseProduct1ListDate[i].Id
@@ -3249,16 +2274,6 @@
if (UseProduct2_TEXT != accname && UseProduct3_TEXT != accname) {
component.set('v.UseProduct1s', accname);
component.set('v.UseProduct1', accname);
-=======
- 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');
- if (UseProduct2_TEXT != accname && UseProduct3_TEXT != accname) {
- component.set("v.UseProduct1s", accname);
- component.set("v.UseProduct1", accname);
->>>>>>> LEXCommunityLiJun
} else {
//component.set('v.errorMessage', '涓嶈兘閫夋嫨鍚屾牱鐨勪骇鍝�');
this.error('涓嶈兘閫夋嫨鍚屾牱鐨勪骇鍝�');
@@ -3267,7 +2282,6 @@
},
//妯$硦鏌ヨ浣跨敤浜у搧2
searchUseProduct2: function (component, event, helper) {
-<<<<<<< HEAD
var UseProduct2Name = event.getParam('value');
var select_ProductClassification = component
.find('select_ProductClassification')
@@ -3280,18 +2294,6 @@
action.setCallback(this, function (response) {
var state = response.getState();
if (state === 'SUCCESS') {
-=======
- 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
- });
- action.setCallback(this, function (response) {
- var state = response.getState();
- if (state === "SUCCESS") {
->>>>>>> LEXCommunityLiJun
var UseProduct2_List = component.find('UseProduct2_List');
var UseProduct2List = response.getReturnValue();
if (UseProduct2List.length > 0) {
@@ -3299,11 +2301,7 @@
} else {
$A.util.removeClass(UseProduct2_List, 'slds-is-open');
}
-<<<<<<< HEAD
component.set('v.UseProduct2List', response.getReturnValue());
-=======
- component.set("v.UseProduct2List", response.getReturnValue());
->>>>>>> LEXCommunityLiJun
} else {
$A.util.removeClass(UseProduct2_List, 'slds-is-open');
}
@@ -3317,13 +2315,8 @@
hideSearchUseProduct2s: function (component, event, helper) {
var UseProduct2_List = component.find('UseProduct2_List');
$A.util.removeClass(UseProduct2_List, 'slds-is-open');
-<<<<<<< HEAD
component.set('v.UseProduct2', '');
component.set('v.UseProduct2s', '');
-=======
- component.set("v.UseProduct2", '');
- component.set("v.UseProduct2s", '');
->>>>>>> LEXCommunityLiJun
component.set('v.UseProduct2Id', '');
component.set('v.data.UseProduct2__c', '');
},
@@ -3336,7 +2329,6 @@
for (var i = 0; i < UseProduct2ListDate.length; i++) {
if (UseProduct2ListDate[i].Id == accid) {
component.set('v.UseProduct2Id', UseProduct2ListDate[i].Id);
-<<<<<<< HEAD
component.set(
'v.data.UseProduct2__c',
UseProduct2ListDate[i].Id
@@ -3352,22 +2344,11 @@
if (UseProduct1_TEXT != accname && UseProduct3_TEXT != accname) {
component.set('v.UseProduct2s', accname);
component.set('v.UseProduct2', accname);
-=======
- 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');
- if (UseProduct1_TEXT != accname && UseProduct3_TEXT != accname) {
- component.set("v.UseProduct2s", accname);
- component.set("v.UseProduct2", accname);
->>>>>>> LEXCommunityLiJun
} else {
//component.set('v.errorMessage', '涓嶈兘閫夋嫨鍚屾牱鐨勪骇鍝�');
this.error('涓嶈兘閫夋嫨鍚屾牱鐨勪骇鍝�');
//this.showErrorToast(component);
}
-<<<<<<< HEAD
},
//妯$硦鏌ヨ浣跨敤浜у搧3
searchUseProduct3: function (component, event, helper) {
@@ -3383,22 +2364,6 @@
action.setCallback(this, function (response) {
var state = response.getState();
if (state === 'SUCCESS') {
-=======
-
- },
- //妯$硦鏌ヨ浣跨敤浜у搧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");
- action.setParams({
- "UseProduct1Name": UseProduct3Name,
- "select_ProductClassification": select_ProductClassification
- });
- action.setCallback(this, function (response) {
- var state = response.getState();
- if (state === "SUCCESS") {
->>>>>>> LEXCommunityLiJun
var UseProduct3_List = component.find('UseProduct3_List');
var UseProduct3List = response.getReturnValue();
if (UseProduct3List.length > 0) {
@@ -3406,11 +2371,7 @@
} else {
$A.util.removeClass(UseProduct3_List, 'slds-is-open');
}
-<<<<<<< HEAD
component.set('v.UseProduct3List', response.getReturnValue());
-=======
- component.set("v.UseProduct3List", response.getReturnValue());
->>>>>>> LEXCommunityLiJun
} else {
$A.util.removeClass(UseProduct3_List, 'slds-is-open');
}
@@ -3424,13 +2385,8 @@
hideSearchUseProduct3s: function (component, event, helper) {
var UseProduct3_List = component.find('UseProduct3_List');
$A.util.removeClass(UseProduct3_List, 'slds-is-open');
-<<<<<<< HEAD
component.set('v.UseProduct3', '');
component.set('v.UseProduct3s', '');
-=======
- component.set("v.UseProduct3", '');
- component.set("v.UseProduct3s", '');
->>>>>>> LEXCommunityLiJun
component.set('v.UseProduct3Id', '');
component.set('v.data.UseProduct3__c', '');
},
@@ -3443,7 +2399,6 @@
for (var i = 0; i < UseProduct3ListDate.length; i++) {
if (UseProduct3ListDate[i].Id == accid) {
component.set('v.UseProduct3Id', UseProduct3ListDate[i].Id);
-<<<<<<< HEAD
component.set(
'v.data.UseProduct3__c',
UseProduct3ListDate[i].Id
@@ -3459,32 +2414,14 @@
if (UseProduct1_TEXT != accname && UseProduct2_TEXT != accname) {
component.set('v.UseProduct3s', accname);
component.set('v.UseProduct3', accname);
-=======
- 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');
- if (UseProduct1_TEXT != accname && UseProduct2_TEXT != accname) {
- component.set("v.UseProduct3s", accname);
- component.set("v.UseProduct3", accname);
->>>>>>> LEXCommunityLiJun
} else {
//component.set('v.errorMessage', '涓嶈兘閫夋嫨鍚屾牱鐨勪骇鍝�');
this.error('涓嶈兘閫夋嫨鍚屾牱鐨勪骇鍝�');
//this.showErrorToast(component);
}
-<<<<<<< HEAD
},
//hospitalLinkId 缁忛攢鍟嗗尰闄㈢殑ID 鎷滆浜哄鍒剁殑鍦版柟
doctor_change: function (component, event, helper) {
-=======
-
- },
- //hospitalLinkId 缁忛攢鍟嗗尰闄㈢殑ID 鎷滆浜哄鍒剁殑鍦版柟
- doctor_change: function (component, event, helper) {
-
->>>>>>> LEXCommunityLiJun
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');
@@ -3495,14 +2432,10 @@
if (doctorurpose == '绉戝浼�') {
// component.set('v.doctor_title', doctor_list[i].Doctor_Division1__c);
} else {
-<<<<<<< HEAD
component.set(
'v.doctor_title',
doctor_list[i].Doctor_Division1__c
);
-=======
- component.set('v.doctor_title', doctor_list[i].Doctor_Division1__c);
->>>>>>> LEXCommunityLiJun
}
flg = true;
break;
@@ -3517,11 +2450,7 @@
set_aws_url: function (component, sobject) {
var action = component.get('c.getAwsurl');
action.setParams({
-<<<<<<< HEAD
sobj: sobject
-=======
- "sobj": sobject,
->>>>>>> LEXCommunityLiJun
});
action.setCallback(this, function (response) {
var state = response.getState();
@@ -3531,12 +2460,7 @@
component.set('v.AWSinsert', awsmap.newUrl);
component.set('v.AWSsearch', awsmap.searchUrl);
component.set('v.AWStransactionURL', awsmap.transactionURL);
-<<<<<<< HEAD
} else {
-=======
- }
- else {
->>>>>>> LEXCommunityLiJun
// component.set('v.errorMessage', 'AWS url/token error.');
this.error('AWS url/token error.');
//this.showErrorToast(component);
@@ -3547,7 +2471,6 @@
$A.enqueueAction(action);
},
-<<<<<<< HEAD
insert_agencycontact: function (
component,
token,
@@ -3557,10 +2480,6 @@
helper,
hospitalName
) {
-=======
- insert_agencycontact: function (component, token, newUrl, payload, agencyHospitalid, helper, hospitalName) {
-
->>>>>>> LEXCommunityLiJun
console.log('newUrl = ' + newUrl);
console.log('payload = ' + payload);
console.log('token = ' + token);
@@ -3571,7 +2490,6 @@
'Content-Type': 'application/json',
'pi-token': token
}
-<<<<<<< HEAD
})
.then((data) => {
return data.json();
@@ -3609,37 +2527,11 @@
component.set('v.login', false);
component.find('OppMessage').setError('AWS insert 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);
- 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.');
- });
-
->>>>>>> LEXCommunityLiJun
},
to_agencycontact: function (component, result, agencyHospitalid) {
var action = component.get('c.saveAgencyContact');
action.setParams({
-<<<<<<< HEAD
name: result.object[0].name,
//"nameEncrypt" : result.object[0].nameEncrypt, //zhj 鏂版柟妗堟敼閫� 2023-12-21
type: result.object[0].type,
@@ -3648,16 +2540,6 @@
//"doctorDivision1Encrypt" : result.object[0].doctorDivision1Encrypt, //zhj 鏂版柟妗堟敼閫� 2023-12-21
agencyHospitalid: agencyHospitalid,
awsid: result.object[0].dataId
-=======
- "name": result.object[0].name,
- //"nameEncrypt" : result.object[0].nameEncrypt, //zhj 鏂版柟妗堟敼閫� 2023-12-21
- "type": result.object[0].type,
- //"typeEncrypt" : result.object[0].typeEncrypt, //zhj 鏂版柟妗堟敼閫� 2023-12-21
- "doctorDivision1": result.object[0].doctorDivision1,
- //"doctorDivision1Encrypt" : result.object[0].doctorDivision1Encrypt, //zhj 鏂版柟妗堟敼閫� 2023-12-21
- "agencyHospitalid": agencyHospitalid,
- "awsid": result.object[0].dataId,
->>>>>>> LEXCommunityLiJun
});
action.setCallback(this, function (response) {
var state = response.getState();
@@ -3665,11 +2547,7 @@
var acMap = this.conv_selected(response.getReturnValue());
console.log(acMap);
if (acMap.AgencyContactId != '') {
-<<<<<<< HEAD
//纭浜嬪姟
-=======
- //纭浜嬪姟
->>>>>>> LEXCommunityLiJun
var token = component.get('v.AWStoken');
var confirmUrl = component.get('v.AWStransactionURL');
@@ -3678,16 +2556,12 @@
data['sfRecordId'] = '';
data['txId'] = result.txId;
-<<<<<<< HEAD
this.to_confirm(
component,
token,
confirmUrl,
JSON.stringify(data)
);
-=======
- this.to_confirm(component, token, confirmUrl, JSON.stringify(data));
->>>>>>> LEXCommunityLiJun
} else if (acMap.errormsg != '') {
// component.set('v.errorMessage', acMap.errormsg);
this.error(acMap.errormsg);
@@ -3699,12 +2573,7 @@
//this.showErrorToast(component);
component.set('v.login', false);
}
-<<<<<<< HEAD
} else {
-=======
- }
- else {
->>>>>>> LEXCommunityLiJun
//component.set('v.errorMessage', 'agency contact insert error.');
this.error('agency contact insert error.');
//this.showErrorToast(component);
@@ -3722,7 +2591,6 @@
'Content-Type': 'application/json',
'pi-token': token
}
-<<<<<<< HEAD
})
.then((data) => {
return data.json();
@@ -3759,46 +2627,11 @@
//this.showErrorToast(component);
component.set('v.login', false);
});
-=======
- }).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.');
- this.error('AWS confirm error.');
- //this.showErrorToast(component);
- component.set('v.login', false);
- });
->>>>>>> LEXCommunityLiJun
},
//SWAG-CF58C3 fy end 璋冪敤pi
set_doctor_list: function (component) {
-<<<<<<< HEAD
console.log('set_doctor_list');
-=======
- console.log('set_doctor_list')
->>>>>>> LEXCommunityLiJun
var doctor_value = component.find('select_purpose_type').get('v.value');
var hospital_id = component.get('v.hospitalLinkId');
console.log('hospital_id = ' + hospital_id);
@@ -3810,39 +2643,23 @@
component.set('v.loginEdit', true);
var action = component.get('c.getDoctorList');
action.setParams({
-<<<<<<< HEAD
hospital_id: hospital_id
-=======
- "hospital_id": hospital_id,
->>>>>>> LEXCommunityLiJun
});
action.setCallback(this, function (response) {
var state = response.getState();
if (state == 'SUCCESS') {
-<<<<<<< HEAD
var res = this.conv_selected(response.getReturnValue());
//fy
var setdoctorlisthos =
component.get('v.setdoctorlisthos');
-=======
- ;
- var res = this.conv_selected(response.getReturnValue());
- //fy
- var setdoctorlisthos = component.get('v.setdoctorlisthos');
->>>>>>> LEXCommunityLiJun
if (setdoctorlisthos) {
component.set('v.default_select_doctor_id', '');
component.set('v.setdoctorlisthos', false);
}
-<<<<<<< HEAD
//fy
var default_doctor = component.get(
'v.default_select_doctor_id'
);
-=======
- //fy
- var default_doctor = component.get('v.default_select_doctor_id');
->>>>>>> LEXCommunityLiJun
if (default_doctor != '' && res.length > 0) {
var doctor_title = '';
let awsids = [];
@@ -3857,7 +2674,6 @@
awsids.push(res[i].AWS_Data_Id__c);
}
}
-<<<<<<< HEAD
component
.find('select_doctor')
.set('v.options', res);
@@ -3918,36 +2734,6 @@
},
staticResourceAgencyContact.token
);
-=======
- component.find('select_doctor').set('v.options', res);
- component.set('v.doctor_title', doctor_title);
- 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];
- }
- }
-
- 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);
->>>>>>> LEXCommunityLiJun
}
} else {
let awsids = [];
@@ -3956,7 +2742,6 @@
awsids.push(res[i].AWS_Data_Id__c);
}
}
-<<<<<<< HEAD
component
.find('select_doctor')
.set('v.options', res);
@@ -4026,45 +2811,6 @@
component.set('v.doctor_list', res);
component.set('v.loginEdit', false);
} else {
-=======
- 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];
- }
- }
-
- 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.default_select_doctor_id', '');
-
- component.set('v.doctor_list', res);
- component.set('v.loginEdit', false);
- }
- else {
->>>>>>> LEXCommunityLiJun
// component.set('v.errorMessage', 'set_doctor_list failed.');
this.error('set_doctor_list failed.');
//this.showErrorToast(component);
@@ -4073,10 +2819,6 @@
});
$A.enqueueAction(action);
}
-<<<<<<< HEAD
-=======
-
->>>>>>> LEXCommunityLiJun
} else {
if (doctor_value == '绉戝浼�') {
this.set_doctor_list2(component);
@@ -4085,15 +2827,9 @@
}
}
component.set('v.loginEdit', false);
-<<<<<<< HEAD
}, //fy 20220414
set_doctor_list_edit: function (component) {
console.log('set_doctor_list');
-=======
- },//fy 20220414
- set_doctor_list_edit: function (component) {
- console.log('set_doctor_list')
->>>>>>> LEXCommunityLiJun
var doctor_value = component.find('select_purpose_type').get('v.value');
var hospital_id = component.get('v.hospitalLinkId');
console.log('hospital_id = ' + hospital_id);
@@ -4105,36 +2841,23 @@
component.set('v.loginEdit', true);
var action = component.get('c.getDoctorList');
action.setParams({
-<<<<<<< HEAD
hospital_id: hospital_id
-=======
- "hospital_id": hospital_id,
->>>>>>> LEXCommunityLiJun
});
action.setCallback(this, function (response) {
var state = response.getState();
if (state == 'SUCCESS') {
var res = this.conv_selected(response.getReturnValue());
//fy
-<<<<<<< HEAD
var setdoctorlisthos =
component.get('v.setdoctorlisthos');
-=======
- var setdoctorlisthos = component.get('v.setdoctorlisthos');
->>>>>>> LEXCommunityLiJun
if (setdoctorlisthos) {
component.set('v.default_select_doctor_id', '');
component.set('v.setdoctorlisthos', false);
}
-<<<<<<< HEAD
//fy
var default_doctor = component.get(
'v.default_select_doctor_id'
);
-=======
- //fy
- var default_doctor = component.get('v.default_select_doctor_id');
->>>>>>> LEXCommunityLiJun
if (default_doctor != '' && res.length > 0) {
var doctor_title = '';
let awsids = [];
@@ -4149,7 +2872,6 @@
awsids.push(res[i].AWS_Data_Id__c);
}
}
-<<<<<<< HEAD
component
.find('select_doctor')
.set('v.options', res);
@@ -4210,36 +2932,6 @@
},
staticResourceAgencyContact.token
);
-=======
- component.find('select_doctor').set('v.options', res);
- component.set('v.doctor_title', doctor_title);
- 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];
- }
- }
-
- 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);
->>>>>>> LEXCommunityLiJun
}
} else {
let awsids = [];
@@ -4248,7 +2940,6 @@
awsids.push(res[i].AWS_Data_Id__c);
}
}
-<<<<<<< HEAD
component
.find('select_doctor')
.set('v.options', res);
@@ -4318,45 +3009,6 @@
component.set('v.doctor_list', res);
component.set('v.loginEdit', false);
} else {
-=======
- 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];
- }
- }
-
- 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.default_select_doctor_id', '');
-
- component.set('v.doctor_list', res);
- component.set('v.loginEdit', false);
- }
- else {
->>>>>>> LEXCommunityLiJun
// component.set('v.errorMessage', 'set_doctor_list failed.');
this.error('set_doctor_list failed.');
//this.showErrorToast(component);
@@ -4365,10 +3017,6 @@
});
$A.enqueueAction(action);
}
-<<<<<<< HEAD
-=======
-
->>>>>>> LEXCommunityLiJun
} else {
if (doctor_value == '绉戝浼�') {
this.set_doctor_list2(component);
@@ -4383,11 +3031,7 @@
var state = response.getState();
if (state == 'SUCCESS') {
var res = response.getReturnValue();
-<<<<<<< HEAD
-=======
-
->>>>>>> LEXCommunityLiJun
for (var i = 0; i < res.length; i++) {
if (res[i].selected == 'true') {
res[i].selected = true;
@@ -4395,11 +3039,7 @@
res[i].selected = false;
}
}
-<<<<<<< HEAD
-=======
-
->>>>>>> LEXCommunityLiJun
component.find('select_doctor').set('v.options', res);
var doctor3value = component.get('v.default_select_doctor_id2');
this.set_selected(component, 'select_doctor', doctor3value);
@@ -4410,18 +3050,13 @@
$A.enqueueAction(action1);
},
productcategoryChange1: function (component, event, helper) {
-<<<<<<< HEAD
var product_category_id = component
.find('select_Product1')
.get('v.value');
-=======
- var product_category_id = component.find('select_Product1').get('v.value');
->>>>>>> LEXCommunityLiJun
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;
-<<<<<<< HEAD
var p0bool =
product_category_id != '' &&
product_category_id != null &&
@@ -4430,10 +3065,6 @@
(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)) {
->>>>>>> LEXCommunityLiJun
//component.set('v.errorMessage', '涓嶈兘閫夋嫨鍚屾牱鐨勪骇鍝佸尯鍒�');
this.error('涓嶈兘閫夋嫨鍚屾牱鐨勪骇鍝佸尯鍒�');
//this.showErrorToast(component);
@@ -4441,26 +3072,18 @@
}
},
productcategoryChange2: function (component, event, helper) {
-<<<<<<< HEAD
var product_category_id = component
.find('UseProduct2_TEXT')
.get('v.value');
-=======
- var product_category_id = component.find('UseProduct2_TEXT').get('v.value');
->>>>>>> LEXCommunityLiJun
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;
-<<<<<<< HEAD
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)) {
->>>>>>> LEXCommunityLiJun
//component.set('v.errorMessage', '涓嶈兘閫夋嫨鍚屾牱鐨勪骇鍝佸尯鍒�');
this.error('涓嶈兘閫夋嫨鍚屾牱鐨勪骇鍝佸尯鍒�');
//this.showErrorToast(component);
@@ -4468,18 +3091,13 @@
}
},
productcategoryChange3: function (component, event, helper) {
-<<<<<<< HEAD
var product_category_id = component
.find('select_Product3')
.get('v.value');
-=======
- var product_category_id = component.find('select_Product3').get('v.value');
->>>>>>> LEXCommunityLiJun
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;
-<<<<<<< HEAD
var p0bool =
product_category_id != '' &&
product_category_id != null &&
@@ -4488,10 +3106,6 @@
(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)) {
->>>>>>> LEXCommunityLiJun
//component.set('v.errorMessage', '涓嶈兘閫夋嫨鍚屾牱鐨勪骇鍝佸尯鍒�');
this.error('涓嶈兘閫夋嫨鍚屾牱鐨勪骇鍝佸尯鍒�');
//this.showErrorToast(component);
@@ -4511,10 +3125,6 @@
return obj;
},
set_selected: function (component, aura_id_name, value) {
-<<<<<<< HEAD
-=======
- ;
->>>>>>> LEXCommunityLiJun
var select_tmp = component.find(aura_id_name).get('v.options');
if (select_tmp) {
for (var i = 0; i < select_tmp.length; i++) {
@@ -4532,92 +3142,51 @@
},
//寮瑰嚭 鎴愬姛鎻愮ず
showSuccessToast: function (component) {
-<<<<<<< HEAD
$A.util.removeClass(component.find('successDiv'), 'slds-hide');
window.setTimeout(
$A.getCallback(function () {
$A.util.addClass(component.find('successDiv'), 'slds-hide');
}),
-=======
-
- $A.util.removeClass(component.find('successDiv'), 'slds-hide');
- window.setTimeout($A.getCallback(function () {
- $A.util.addClass(component.find('successDiv'), 'slds-hide');
- }),
->>>>>>> LEXCommunityLiJun
3000
);
},
//寮瑰嚭 鎴愬姛鎻愮ず
showSuccessToast01: function (component) {
-<<<<<<< HEAD
$A.util.removeClass(component.find('successDiv01'), 'slds-hide');
window.setTimeout(
$A.getCallback(function () {
$A.util.addClass(component.find('successDiv01'), 'slds-hide');
}),
-=======
-
- $A.util.removeClass(component.find('successDiv01'), 'slds-hide');
- window.setTimeout($A.getCallback(function () {
- $A.util.addClass(component.find('successDiv01'), 'slds-hide');
- }),
->>>>>>> LEXCommunityLiJun
3000
);
},
//寮瑰嚭 閿欒鎻愮ず
showErrorToast: function (component) {
-<<<<<<< HEAD
$A.util.removeClass(component.find('errorDiv'), 'slds-hide');
window.setTimeout(
$A.getCallback(function () {
$A.util.addClass(component.find('errorDiv'), 'slds-hide');
}),
-=======
-
- $A.util.removeClass(component.find('errorDiv'), 'slds-hide');
- window.setTimeout($A.getCallback(function () {
- $A.util.addClass(component.find('errorDiv'), 'slds-hide');
- }),
->>>>>>> LEXCommunityLiJun
3000
);
},
//寮瑰嚭 閿欒鎻愮ず
showErrorToast01: function (component) {
-<<<<<<< HEAD
$A.util.removeClass(component.find('errorDiv01'), 'slds-hide');
window.setTimeout(
$A.getCallback(function () {
$A.util.addClass(component.find('errorDiv01'), 'slds-hide');
}),
-=======
-
- $A.util.removeClass(component.find('errorDiv01'), 'slds-hide');
- window.setTimeout($A.getCallback(function () {
- $A.util.addClass(component.find('errorDiv01'), 'slds-hide');
- }),
->>>>>>> LEXCommunityLiJun
6000
);
},
error: function (message) {
-<<<<<<< HEAD
var toastEvent = $A.get('e.force:showToast');
toastEvent.setParams({
title: '閿欒!',
message: message,
type: 'error',
duration: 'sticky'
-=======
- var toastEvent = $A.get("e.force:showToast");
- toastEvent.setParams({
- "title": "閿欒!",
- "message": message,
- "type": "error",
- "duration": "sticky"
->>>>>>> LEXCommunityLiJun
});
toastEvent.fire();
},
@@ -4627,13 +3196,8 @@
component.set('v.truthy', true);
},
hideCmp: function (component, event, helper) {
-<<<<<<< HEAD
var div1 = component.find('report');
var div2 = component.find('report_list');
-=======
- var div1 = component.find('report')
- var div2 = component.find('report_list')
->>>>>>> LEXCommunityLiJun
$A.util.addClass(div1, 'disp_none');
$A.util.addClass(div2, 'disp_none');
},
@@ -4642,11 +3206,7 @@
var displayValue = event.getParams().response.fields.Name.value;
event.setParams({});
component.set('v.truthy', false);
-<<<<<<< HEAD
var modal_newAC = component.find('modal_newAC');
-=======
- var modal_newAC = component.find('modal_newAC')
->>>>>>> LEXCommunityLiJun
$A.util.addClass(modal_newAC, 'disp_none');
component.set('v.successMessage', '.鎷滆浜哄凡鍒涘缓銆�');
this.showSuccessToast(component);
@@ -4654,18 +3214,13 @@
},
createCancel: function (component, event, helper) {
component.set('v.truthy', false);
-<<<<<<< HEAD
var modal_newAC = component.find('modal_newAC');
-=======
- var modal_newAC = component.find('modal_newAC')
->>>>>>> LEXCommunityLiJun
$A.util.addClass(modal_newAC, 'disp_none');
component.find('OppMessage').setError('');
},
//绉戝璧嬪��
setOpportunity_cfilter: function (component) {
var hosId = component.get('v.hospitalId');
-<<<<<<< HEAD
var Department_Cateogy__c = component
.find('select_department')
.get('v.value');
@@ -4673,24 +3228,14 @@
if (hosId != '' && hosId != null) {
opportunity_cfilter =
' Agency_Hospital__r.Hospital__c=' + "'" + hosId + "'";
-=======
- 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 + '\'';
->>>>>>> LEXCommunityLiJun
}
if (Department_Cateogy__c != '' && Department_Cateogy__c != null) {
if (opportunity_cfilter != '' && opportunity_cfilter != null) {
opportunity_cfilter += ' AND ';
}
// fy Department_Cateogy_text__c
-<<<<<<< HEAD
opportunity_cfilter +=
'Department_Cateogy__c=' + "'" + Department_Cateogy__c + "'";
-=======
- opportunity_cfilter += 'Department_Cateogy__c=' + '\'' + Department_Cateogy__c + '\'';
->>>>>>> LEXCommunityLiJun
// opportunity_cfilter += 'Department_Cateogy_text__c=' + '\'' + Department_Cateogy__c + '\'';
}
component.set('v.opportunity_cfilter', opportunity_cfilter);
@@ -4713,18 +3258,12 @@
break; // noop
default:
alert('An error occurred reading this file.');
-<<<<<<< HEAD
}
};
-=======
- };
- }
->>>>>>> LEXCommunityLiJun
reader.onabort = function (e) {
alert('File read cancelled');
};
reader.onloadstart = function (e) {
-<<<<<<< HEAD
var output =
'<ui type="disc"><li><strong>' +
file.name +
@@ -4801,73 +3340,11 @@
}
var reader = new FileReader();
reader.onloadend = function () {};
-=======
- 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));
- var allTextLines = data.split(/\r\n|\n/);
- 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 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>';
- for (i = 0; i < headers.length; i++) {
- 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>";
- 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>';
- }
- content += "</tr>";
- }
- }
- content += "</table>";
- console.log(content);
- component.set("v.TableContent", content);
- component.set("v.showMain", false);
- }
- }
- reader.readAsText(file, 'gb2312');
-
- }
- var reader = new FileReader();
- reader.onloadend = function () {
- };
->>>>>>> LEXCommunityLiJun
reader.readAsDataURL(file);
},
// fy 璋冪敤pi鏀归�犵殑 鑾峰彇url 鍜� token鐨勬柟娉�
search_contact_url: function (component, sobject, callback) {
-<<<<<<< HEAD
var action = component.get('c.getAwsurl');
-=======
- var action = component.get("c.getAwsurl");
->>>>>>> LEXCommunityLiJun
action.setParams({
sobj: sobject
});
@@ -4876,12 +3353,7 @@
if (state == 'SUCCESS') {
var result = response.getReturnValue();
if (callback) callback(result);
-<<<<<<< HEAD
} else {
-=======
- }
- else {
->>>>>>> LEXCommunityLiJun
//component.set('v.errorMessage', 'AWS url/token error.');
this.error('AWS url/token error.');
//this.showErrorToast01(component);
@@ -4900,7 +3372,6 @@
'Content-Type': 'application/json',
'pi-token': token
}
-<<<<<<< HEAD
})
.then((data) => {
return data.json();
@@ -4916,26 +3387,11 @@
//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);
- });
->>>>>>> LEXCommunityLiJun
},
saveRecords: function (component, event, helper) {
//component.set('v.login', true);
component.set('v.modal_import_spinner', true);
//fy 瀵煎叆 202200506 start
-<<<<<<< HEAD
var action1 = component.get('c.processDataAWSId');
action1.setParams({
fileData: component.get('v.fileContentData')
@@ -4943,22 +3399,11 @@
action1.setCallback(this, function (response) {
var state = response.getState();
if (state === 'SUCCESS') {
-=======
- var action1 = component.get("c.processDataAWSId");
- action1.setParams({
- fileData: component.get("v.fileContentData"),
- });
- action1.setCallback(this, function (response) {
- var state = response.getState();
- if (state === "SUCCESS") {
-
->>>>>>> LEXCommunityLiJun
var ress = response.getReturnValue();
if (ress) {
var valur = ress.split('error1');
if (valur.length <= 1) {
var res = JSON.parse(response.getReturnValue());
-<<<<<<< HEAD
var dataArr = new Array();
var dataMap = new Map();
@@ -5040,54 +3485,6 @@
} else {
//component.set('v.errorMessage', valur[1] + '\n' + "璇蜂慨鏀瑰悗閲嶆柊涓婁紶");
this.error(valur[1] + '\n' + '璇蜂慨鏀瑰悗閲嶆柊涓婁紶');
-=======
-
- var dataArr = new Array();
- var dataMap = new Map();
- 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);
- }
- });
-
- 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);
- });
- } else {
- //component.set('v.errorMessage', valur[1] + '\n' + "璇蜂慨鏀瑰悗閲嶆柊涓婁紶");
- this.error(valur[1] + '\n' + "璇蜂慨鏀瑰悗閲嶆柊涓婁紶");
->>>>>>> LEXCommunityLiJun
//this.showErrorToast01(component);
//component.set('v.login', false);
component.set('v.modal_import_spinner', false);
@@ -5145,10 +3542,6 @@
// }
// });
// $A.enqueueAction(action);
-<<<<<<< HEAD
-=======
-
->>>>>>> LEXCommunityLiJun
},
saveRecordsEditFile: function (component, dataMap, searchData, helper) {
var searchDataMap = new Map();
@@ -5160,13 +3553,8 @@
}
console.log('searchDataMap=' + searchDataMap);
var error = '';
-<<<<<<< HEAD
var fileData = component.get('v.fileContentData');
fileData = this.ToCDB(fileData); //鍏ㄨ杞崐瑙�
-=======
- var fileData = component.get("v.fileContentData");
- fileData = this.ToCDB(fileData);//鍏ㄨ杞崐瑙�
->>>>>>> LEXCommunityLiJun
var files = fileData.split('\n');
var fileStr = files[0];
@@ -5177,7 +3565,6 @@
var filelist = files[i].split(',');
var fileName = filelist[5];
var WorkRecord = filelist[4];
-<<<<<<< HEAD
if (
WorkRecord == 'SIS' ||
WorkRecord == '闄㈠唴鍏ラ櫌鐢宠' ||
@@ -5208,23 +3595,6 @@
filelist[5] != '鍖荤敓+鎶ゅ+'
) {
//&&filelist[5]!='鍖荤敓锛嬫姢澹�'
-=======
- if (WorkRecord == 'SIS' || WorkRecord == '闄㈠唴鍏ラ櫌鐢宠' || WorkRecord == '鏀惰垂椤圭洰鐢宠' || WorkRecord == '绉戝浼�') {
- if (fileName) {
- if (WorkRecord != '绉戝浼�') {
- if (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
- } else {
- error += 'error1 绗�' + i + '琛屾暟鎹嫓璁夸汉SF涓嶅瓨鍦�';
- }
- } else {
- error += 'error1 绗�' + i + '琛屾暟鎹嫓璁夸汉AWS涓嶅瓨鍦�';
- }
- } else {
- if (filelist[5] != '鍖荤敓' && filelist[5] != '鍖荤敓+鎶ゅ+') {//&&filelist[5]!='鍖荤敓锛嬫姢澹�'
->>>>>>> LEXCommunityLiJun
error += 'error1 绗�' + i + '琛屾暟鎹嫓璁夸汉涓嶅瓨鍦�';
}
}
@@ -5235,7 +3605,6 @@
if (fileName) {
if (WorkRecord != '绉戝浼�') {
if (searchDataMap.get(fileName.replace(' ', ''))) {
-<<<<<<< HEAD
var nameDataId = searchDataMap.get(
fileName.replace(' ', '')
);
@@ -5257,19 +3626,6 @@
filelist[5] != '鍖荤敓+鎶ゅ+'
) {
//&&filelist[5]!='鍖荤敓锛嬫姢澹�'
-=======
- var nameDataId = searchDataMap.get(fileName.replace(' ', ''));
- if (dataMap.get(nameDataId)) {
- filelist[5] = dataMap.get(nameDataId);
- } else {
- error += 'error1 绗�' + i + '琛屾暟鎹嫓璁夸汉SF涓嶅瓨鍦�';
- }
- } else {
- error += 'error1 绗�' + i + '琛屾暟鎹嫓璁夸汉AWS涓嶅瓨鍦�';
- }
- } else {
- if (filelist[5] != '鍖荤敓' && filelist[5] != '鍖荤敓+鎶ゅ+') {//&&filelist[5]!='鍖荤敓锛嬫姢澹�'
->>>>>>> LEXCommunityLiJun
error += 'error1 绗�' + i + '琛屾暟鎹嫓璁夸汉涓嶅瓨鍦�';
}
}
@@ -5285,19 +3641,12 @@
let errorArray = error.split('error1');
let errorDatas = [];
let errorDataRow = [];
-<<<<<<< HEAD
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))
->>>>>>> LEXCommunityLiJun
for (var i in errorArray) {
// if (errorArray[i] != '') {
// let errorData = {}
@@ -5306,7 +3655,6 @@
// errorDatas.push(errorData);
// }
if (errorArray[i] != '') {
-<<<<<<< HEAD
let errorData = {};
let index = errorDataRow.indexOf(
errorArray[i].trim().substring(1, 2)
@@ -5341,29 +3689,11 @@
} else {
errorDatas[index].errorInfo +=
'; ' + errorArray[i].trim().substring(5);
-=======
- let errorData = {}
- let index = errorDataRow.indexOf(errorArray[i].trim().substring(1, 2));
- if (index == -1) {
- 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] + '涓嶅瓨鍦�';
- }
- 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);
->>>>>>> LEXCommunityLiJun
}
}
}
}
-<<<<<<< HEAD
var fileContentData = component
.get('v.fileContentData')
.split('\n');
@@ -5392,17 +3722,6 @@
'浜у搧1鍚岀被鑰楁潗绉戝鏈堜娇鐢ㄩ噺' ||
fileContentData[0].split(',')[i] == '浣跨敤浜у搧1(浜у搧鍨嬪彿)'
) {
-=======
- 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 }
- ];
- 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(浜у搧鍨嬪彿)') {
->>>>>>> LEXCommunityLiJun
initialWidth = 250;
}
errorColumns.push({
@@ -5425,17 +3744,10 @@
}
}
}
-<<<<<<< HEAD
console.log('errorDatas =' + JSON.stringify(errorDatas));
component.set('v.errorColumns', errorColumns);
component.set('v.errorData', errorDatas);
component.set('v.showErrorInfo', true);
-=======
- console.log('errorDatas =' + JSON.stringify(errorDatas))
- component.set('v.errorColumns', errorColumns);
- component.set('v.errorData', errorDatas);
- component.set("v.showErrorInfo", true);
->>>>>>> LEXCommunityLiJun
console.log('error = ' + error);
//component.set('v.errorMessage', error);
@@ -5449,7 +3761,6 @@
console.log('fileStr=' + fileStr);
$A.getCallback(function () {
-<<<<<<< HEAD
helper.ImportMethod(component, fileStr, helper);
})();
},
@@ -5523,59 +3834,10 @@
} else {
errorDatas[index].errorInfo +=
'; ' + ress[i].substr(7).substring(5);
-=======
-
- helper.ImportMethod(component, fileStr, helper);
- })();
-
- }, 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({
- fileData: fileStr,
- sobjectName: 'Account', //Any object
- fields: fieldsList
- });
- action.setCallback(this, function (response) {
- var state = response.getState();
- if (state === "SUCCESS") {
- var res = response.getReturnValue();
- var res1 = '';
- if (res != 'success') {
- var ress = res.split('=');
- 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])
-
- 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));
- if (index == -1) {
- 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] + '涓嶅瓨鍦�';
- }
- 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);
->>>>>>> LEXCommunityLiJun
}
}
}
}
-<<<<<<< HEAD
var fileContentData = component
.get('v.fileContentData')
.split('\n');
@@ -5608,16 +3870,6 @@
fileContentData[0].split(',')[i] ==
'浣跨敤浜у搧1(浜у搧鍨嬪彿)'
) {
-=======
- 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 }
- ];
- 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(浜у搧鍨嬪彿)') {
->>>>>>> LEXCommunityLiJun
initialWidth = 250;
}
errorColumns.push({
@@ -5640,26 +3892,17 @@
}
component.set('v.errorColumns', errorColumns);
component.set('v.errorData', errorDatas);
-<<<<<<< HEAD
component.set('v.showErrorInfo', true);
console.log('==' + res1);
//component.set('v.errorMessage', res1 + "璇蜂慨鏀瑰悗閲嶆柊涓婁紶");
this.error(res1 + '璇蜂慨鏀瑰悗閲嶆柊涓婁紶');
-=======
- component.set("v.showErrorInfo", true);
-
- console.log("==" + res1);
- //component.set('v.errorMessage', res1 + "璇蜂慨鏀瑰悗閲嶆柊涓婁紶");
- this.error(res1 + "璇蜂慨鏀瑰悗閲嶆柊涓婁紶");
->>>>>>> LEXCommunityLiJun
//this.showErrorToast01(component);
//component.set('v.login', false);
component.set('v.modal_import_spinner', false);
} else {
component.set('v.successMessage', '瀵煎叆鎴愬姛');
this.showSuccessToast01(component);
-<<<<<<< HEAD
component.set('v.showMain', true);
//component.set('v.login', false);
component.set('v.modal_import_spinner', false);
@@ -5695,47 +3938,6 @@
}
}
return tmp;
-=======
- 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") {
- //component.set('v.login', false);
- component.set('v.modal_import_spinner', 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.login', false);
- component.set('v.modal_import_spinner', false);
- }
- } else {
- console.log("Unknown error");
- //component.set('v.login', false);
- component.set('v.modal_import_spinner', false);
- }
- }
- });
- $A.enqueueAction(action);
- },//鍏ㄨ杞崐瑙�
- ToCDB: function (str) {
- 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 {
- tmp += String.fromCharCode(str.charCodeAt(i));
- }
- }
- return tmp
->>>>>>> LEXCommunityLiJun
},
//瀵煎嚭鐨凜SV鏂囦欢
convertArrayOfObjectsToCSV: function (component, objectRecords) {
@@ -5745,7 +3947,6 @@
}
columnDivider = ',';
lineDivider = '\n';
-<<<<<<< HEAD
keys = [
'Report_Date__c',
'Agency_Hospital__c',
@@ -5788,14 +3989,6 @@
csvStringResult += thkeys.join(columnDivider);
csvStringResult += lineDivider;
console.log('杩涘叆瀵煎嚭helper');
-=======
- 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");
->>>>>>> LEXCommunityLiJun
for (var i = 0; i < objectRecords.length; i++) {
counter = 0;
for (var sTempkey in keys) {
@@ -5803,21 +3996,13 @@
if (counter > 0) {
csvStringResult += columnDivider;
}
-<<<<<<< HEAD
if (typeof objectRecords[i][skey] === 'undefined') {
-=======
- if (typeof objectRecords[i][skey] === "undefined") {
->>>>>>> LEXCommunityLiJun
csvStringResult += '' + '' + '';
continue;
}
if (skey == 'Person_In_Charge2__c') {
-<<<<<<< HEAD
csvStringResult +=
objectRecords[i].Person_In_Charge2__r.Name;
-=======
- csvStringResult += objectRecords[i].Person_In_Charge2__r.Name;
->>>>>>> LEXCommunityLiJun
} else if (skey == 'Agency_Hospital__c') {
csvStringResult += objectRecords[i].Agency_Hospital__r.Name;
} else if (skey == 'DealerPersonnel__c') {
@@ -5825,7 +4010,6 @@
} else if (skey == 'doctor2__c') {
csvStringResult += objectRecords[i].doctor2__r.Name;
} else if (skey == 'UseProduct1__c') {
-<<<<<<< HEAD
csvStringResult +=
objectRecords[i].UseProduct1__r.Asset_Model_No__c;
} else if (skey == 'UseProduct2__c') {
@@ -5834,23 +4018,12 @@
} else if (skey == 'UseProduct3__c') {
csvStringResult +=
objectRecords[i].UseProduct3__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;
- } else if (skey == 'UseProduct3__c') {
- csvStringResult += objectRecords[i].UseProduct3__r.Asset_Model_No__c;
->>>>>>> LEXCommunityLiJun
} else {
csvStringResult += objectRecords[i][skey];
}
counter++;
}
-<<<<<<< HEAD
console.log('瀵煎嚭寰幆缁撴潫');
-=======
- console.log("瀵煎嚭寰幆缁撴潫");
->>>>>>> LEXCommunityLiJun
csvStringResult += lineDivider;
}
return csvStringResult;
@@ -5858,7 +4031,6 @@
// 瀵煎嚭椤甸潰鏄剧ず鐨勬ā鏉�
showExportDate: function (component, objectRecords) {
console.log('杩涘叆showexceportdate' + objectRecords);
-<<<<<<< HEAD
var keys = [
'Report_Date__c',
'Agency_Hospital__c',
@@ -5901,31 +4073,26 @@
'<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>';
-=======
- 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"\ style=\"width:200px">' + headers[i] + '</th>';
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>";
->>>>>>> LEXCommunityLiJun
+ 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];
-<<<<<<< HEAD
if (typeof objectRecords[i][skey] === 'undefined') {
content += '<td>' + '' + '</td>';
continue;
@@ -5966,61 +4133,26 @@
'<td>' +
objectRecords[i].UseProduct3__r.Asset_Model_No__c +
'</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 == 'DealerPersonnel__c') {
- content += '<td>' + objectRecords[i].DealerPersonnel__r.Name + '</td>';
- } else if (skey == 'doctor2__c') {
- content += '<td>' + objectRecords[i].doctor2__r.Name + '</td>';
- } else if (skey == 'UseProduct1__c') {
- 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>';
- } else if (skey == 'UseProduct3__c') {
- content += '<td>' + objectRecords[i].UseProduct3__r.Asset_Model_No__c + '</td>';
->>>>>>> LEXCommunityLiJun
} else {
content += '<td>' + objectRecords[i][skey] + '</td>';
}
}
-<<<<<<< HEAD
content += '</tr>';
}
content += '</table>';
console.log('helper寰幆缁撴潫' + content);
component.set('v.TableContent2', content);
component.set('v.showMain', false);
-=======
- content += '</tr>'
- }
- content += '</table>';
- console.log("helper寰幆缁撴潫" + content);
- component.set("v.TableContent2", content);
- component.set("v.showMain", false);
->>>>>>> LEXCommunityLiJun
},
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');
-<<<<<<< HEAD
console.log(
'杈撳叆鐨勫紑濮嬫棩鏈�' + reportsdate1 + '杈撳叆鐨勭粨鏉熸棩鏈�' + reportsdate2
);
var action = component.get('c.getReportsByDate');
-=======
- console.log('杈撳叆鐨勫紑濮嬫棩鏈�' + reportsdate1 + '杈撳叆鐨勭粨鏉熸棩鏈�' + reportsdate2);
- var action = component.get("c.getReportsByDate");
->>>>>>> LEXCommunityLiJun
console.log('杈撳叆鐨勫紑濮嬫棩鏈�1');
action.setParams({
date1: reportsdate1,
@@ -6029,11 +4161,7 @@
console.log('杈撳叆鐨勫紑濮嬫棩鏈�2');
action.setCallback(this, function (response) {
var state = response.getState();
-<<<<<<< HEAD
if (state === 'SUCCESS') {
-=======
- if (state === "SUCCESS") {
->>>>>>> LEXCommunityLiJun
var res = response.getReturnValue();
console.log('杈撳叆鐨勫紑濮嬫棩鏈�3' + res);
component.set('v.login', false);
@@ -6042,21 +4170,16 @@
if (true) {
let awsids = [];
for (let ri in res) {
-<<<<<<< HEAD
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) {
->>>>>>> LEXCommunityLiJun
awsids.push(res[ri].doctor2__r.AWS_Data_Id__c);
}
}
if (awsids.length > 0) {
let PIConfig = component.get('v.PIConfig');
-<<<<<<< HEAD
let staticResourceAgencyContact = JSON.parse(
PIConfig.staticResourceAgencyContact
);
@@ -6103,39 +4226,11 @@
},
staticResourceAgencyContact.token
);
-=======
- 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;
- }
- }
- }
- helper.showExportDate(component, res);
-
- component.set('v.login', false);
- }, staticResourceAgencyContact.token);
->>>>>>> LEXCommunityLiJun
} else {
helper.showExportDate(component, res);
}
}
-<<<<<<< HEAD
-=======
-
->>>>>>> LEXCommunityLiJun
component.set('v.reports_date', res);
} else {
alert('瀵煎嚭澶辫触,璇锋鏌ユ椿鍔ㄦ棩');
@@ -6143,10 +4238,6 @@
}
});
$A.enqueueAction(action);
-<<<<<<< HEAD
-=======
-
->>>>>>> LEXCommunityLiJun
},
showImport: function (component) {
@@ -6180,16 +4271,11 @@
newlyBuild: function (component, event, helper) {
var hospital_id = component.get('v.hospitalLinkId');
event.preventDefault(); // stop form submission
-<<<<<<< HEAD
var fields = component.find('newOpportunityField');
-=======
- var fields = component.find("newOpportunityField");
->>>>>>> LEXCommunityLiJun
var nameer = '';
var type = '';
var doctorDivision1 = '';
fields.forEach(function (field) {
-<<<<<<< HEAD
if (field.get('v.fieldName') === 'Name') {
nameer = field.get('v.value');
}
@@ -6198,45 +4284,24 @@
}
if (field.get('v.fieldName') === 'Doctor_Division1__c') {
doctorDivision1 = 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") === 'Doctor_Division1__c') {
- doctorDivision1 = field.get("v.value");
->>>>>>> LEXCommunityLiJun
}
});
if (hospital_id) {
component.set('v.login', true);
var action = component.get('c.newlyBuild');
action.setParams({
-<<<<<<< HEAD
hospital_id: hospital_id,
nameer: nameer,
type: type,
doctorDivision1: doctorDivision1
-=======
- "hospital_id": hospital_id,
- "nameer": nameer,
- "type": type,
- "doctorDivision1": doctorDivision1,
->>>>>>> LEXCommunityLiJun
});
action.setCallback(this, function (response) {
var state = response.getState();
if (state == 'SUCCESS') {
var res = this.conv_selected(response.getReturnValue());
-<<<<<<< HEAD
var default_doctor = component.get(
'v.default_select_doctor_id'
);
-=======
- var default_doctor = component.get('v.default_select_doctor_id');
->>>>>>> LEXCommunityLiJun
if (default_doctor != '' && res.length > 0) {
var doctor_title = '';
for (var i = 0; i < res.length; i++) {
@@ -6252,25 +4317,16 @@
} else {
component.find('select_doctor').set('v.options', res);
if (res.length > 0) {
-<<<<<<< HEAD
component.set(
'v.doctor_title',
res[0].Doctor_Division1__c
);
-=======
- component.set('v.doctor_title', res[0].Doctor_Division1__c);
->>>>>>> LEXCommunityLiJun
}
}
component.set('v.default_select_doctor_id', '');
component.set('v.doctor_list', res);
component.set('v.login', false);
-<<<<<<< HEAD
} else {
-=======
- }
- else {
->>>>>>> LEXCommunityLiJun
//component.set('v.errorMessage', 'newlyBuild failed.');
this.error('newlyBuild failed.');
//this.showErrorToast(component);
@@ -6285,13 +4341,8 @@
var sc = event.getSource().get('v.value');
if (sc != null) {
if (sc.length <= 14) {
-<<<<<<< HEAD
if (sc.replace(/\D/gi, '')) {
component.set('v.select_ConsumptionOfConsumables', sc);
-=======
- if (sc.replace(/\D/gi, "")) {
- component.set("v.select_ConsumptionOfConsumables", sc);
->>>>>>> LEXCommunityLiJun
} else {
//component.set('v.errorMessage', '浜у搧1鍚岀被鑰楁潗绉戝鏈堜娇鐢ㄩ噺蹇呴』杈撳叆鏁板瓧!');
this.error('浜у搧1鍚岀被鑰楁潗绉戝鏈堜娇鐢ㄩ噺蹇呴』杈撳叆鏁板瓧!');
@@ -6309,13 +4360,8 @@
var sc = event.getSource().get('v.value');
if (sc != null) {
if (sc.length <= 14) {
-<<<<<<< HEAD
if (sc.replace(/\D/gi, '')) {
component.set('v.select_warlocksNumber', sc);
-=======
- if (sc.replace(/\D/gi, "")) {
- component.set("v.select_warlocksNumber", sc);
->>>>>>> LEXCommunityLiJun
} else {
//component.set('v.errorMessage', '浜у搧鐢ㄩ噺蹇呴』杈撳叆鏁板瓧!');
this.error('浜у搧鐢ㄩ噺蹇呴』杈撳叆鏁板瓧!');
@@ -6330,10 +4376,6 @@
},
//宸ヤ綔浼氳褰�
selectPurposeType: function (component, event, helper) {
-<<<<<<< HEAD
-=======
-
->>>>>>> LEXCommunityLiJun
var doctor_value = component.find('select_purpose_type').get('v.value');
// alert(doctor_value);
if (doctor_value != '绉戝浼�') {
@@ -6345,23 +4387,15 @@
this.set_doctor_list_edit(component);
var action = component.get('c.selectPurposeTypes');
action.setParams({
-<<<<<<< HEAD
doctor_value: doctor_value
-=======
- 'doctor_value': doctor_value
->>>>>>> LEXCommunityLiJun
});
action.setCallback(this, function (response) {
var state = response.getState();
if (state == 'SUCCESS') {
var res = response.getReturnValue();
-<<<<<<< HEAD
component
.find('select_EffectProgress')
.set('v.options', JSON.parse(JSON.stringify(res)));
-=======
- component.find('select_EffectProgress').set("v.options", JSON.parse(JSON.stringify(res)));
->>>>>>> LEXCommunityLiJun
}
});
$A.enqueueAction(action);
@@ -6371,7 +4405,6 @@
},
selectProductClassification: function (component, event, helper) {
-<<<<<<< HEAD
var select_ProductClassification = component
.find('select_ProductClassification')
.get('v.value');
@@ -6379,26 +4412,14 @@
var action = component.get('c.selectProductClassificationc');
action.setParams({
select_ProductClassification: select_ProductClassification
-=======
-
- 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
->>>>>>> LEXCommunityLiJun
});
action.setCallback(this, function (response) {
var state = response.getState();
if (state == 'SUCCESS') {
var res = response.getReturnValue();
-<<<<<<< HEAD
component
.find('select_OtherBrandConsumables')
.set('v.options', JSON.parse(JSON.stringify(res)));
-=======
- component.find('select_OtherBrandConsumables').set("v.options", JSON.parse(JSON.stringify(res)));
->>>>>>> LEXCommunityLiJun
}
});
$A.enqueueAction(action);
@@ -6408,15 +4429,10 @@
this.selectProductCcategory(component);
},
select_ProductCcategory: function (component, event, helper) {
-<<<<<<< HEAD
var select_ProductCcategory = component
.find('select_ProductCcategory')
.get('v.value');
-=======
- var select_ProductCcategory = component.find('select_ProductCcategory').get('v.value');
-
->>>>>>> LEXCommunityLiJun
if (select_ProductCcategory != '') {
var result = component.find('result');
var UserProType = component.get('v.UserProType');
@@ -6429,23 +4445,15 @@
}
var action = component.get('c.selectProductCcategory01');
action.setParams({
-<<<<<<< HEAD
select_ProductCcategory: select_ProductCcategory
-=======
- "select_ProductCcategory": select_ProductCcategory
->>>>>>> LEXCommunityLiJun
});
action.setCallback(this, function (response) {
var state = response.getState();
if (state == 'SUCCESS') {
var res = response.getReturnValue();
-<<<<<<< HEAD
component
.find('select_productCategories')
.set('v.options', JSON.parse(JSON.stringify(res)));
-=======
- component.find('select_productCategories').set("v.options", JSON.parse(JSON.stringify(res)));
->>>>>>> LEXCommunityLiJun
}
});
$A.enqueueAction(action);
@@ -6456,7 +4464,6 @@
}
},
selectpurposetype: function (component, event, helper) {
-<<<<<<< HEAD
var select_ProductCcategory = component
.find('select_ProductCcategory')
.get('v.value');
@@ -6465,10 +4472,6 @@
select_ProductCcategory == undefined &&
select_ProductCcategory == ''
) {
-=======
- var select_ProductCcategory = component.find('select_ProductCcategory').get('v.value');
- if (select_ProductCcategory == null && select_ProductCcategory == undefined && select_ProductCcategory == '') {
->>>>>>> LEXCommunityLiJun
var result = component.find('result');
// $A.util.removeClass(result, 'disp_none');
if (UserProType == 'ENG') {
@@ -6477,15 +4480,10 @@
$A.util.addClass(result, 'disp_none');
}
} else {
-<<<<<<< HEAD
-=======
-
->>>>>>> LEXCommunityLiJun
component.find('select_productCategories').set('v.value', '');
var result = component.find('result');
$A.util.addClass(result, 'disp_none');
this.select_ProductCcategory(component);
-<<<<<<< HEAD
}
},
//zhj MEBG鏂版柟妗堟敼閫� 2022-11-29 start
@@ -6516,72 +4514,27 @@
for (var i in errorColumns) {
errorColumnsArray.push(errorColumns[i].label);
}
-=======
- }
- },
- //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) {
- action.setParams(para);
- }
- if (callback) {
- action.setCallback(this, function (data) {
- callback(data);
- });
- }
-
- $A.enqueueAction(action);
- },
- //zhj MEBG鏂版柟妗堟敼閫� 2022-11-29 end
-
- //zhj 瀵煎嚭閿欒淇℃伅 2023-05-16 start
- exportErrorInfoHelper: function (component) {
- var errorData = component.get('v.errorData');
- var errorColumns = component.get('v.errorColumns');
-
- var datas = [];
- let errorColumnsArray = [];
- for (var i in errorColumns) {
- errorColumnsArray.push(errorColumns[i].label);
- }
->>>>>>> LEXCommunityLiJun
datas.push(errorColumnsArray);
//datas.push(errorColumns);
for (var i in errorData) {
let data = [];
-<<<<<<< HEAD
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])
->>>>>>> LEXCommunityLiJun
}
datas.push(data);
}
console.log('datas = ' + JSON.stringify(datas));
var csv = this.convertToCSV(component, datas);
-<<<<<<< HEAD
console.log('csv = ' + JSON.stringify(csv));
-=======
- console.log('csv = ' + JSON.stringify(csv))
->>>>>>> LEXCommunityLiJun
this.downloadCSV(component, csv);
},
convertToCSV: function (component, data) {
-<<<<<<< HEAD
console.log('enter convertToCSV');
-=======
- console.log('enter convertToCSV')
->>>>>>> LEXCommunityLiJun
console.log('data = ' + data);
var csv = '';
for (var i = 0; i < data.length; i++) {
@@ -6591,15 +4544,11 @@
var val = '';
val = row[j] === null ? '' : row[j].toString();
console.log('val = ' + val);
-<<<<<<< HEAD
if (
val.indexOf(',') !== -1 ||
val.indexOf('"') !== -1 ||
val.indexOf('\n') !== -1
) {
-=======
- if (val.indexOf(',') !== -1 || val.indexOf('"') !== -1 || val.indexOf('\n') !== -1) {
->>>>>>> LEXCommunityLiJun
//val = '"' + val.replace(/"/g,'""') + '"';
}
if (j > 0) {
@@ -6614,14 +4563,9 @@
downloadCSV: function (component, csv) {
var link = document.createElement('a');
-<<<<<<< HEAD
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);
->>>>>>> LEXCommunityLiJun
link.download = 'data.csv';
document.body.appendChild(link);
link.click();
@@ -6629,7 +4573,6 @@
},
error: function (message) {
// $('toastMessage.forceToastManager').css('white-space', 'pre-wrap');
-<<<<<<< HEAD
var toastEvent = $A.get('e.force:showToast');
toastEvent.setParams({
@@ -6642,17 +4585,3 @@
}
//zhj 瀵煎嚭閿欒淇℃伅 2023-05-16 end
});
-=======
- var toastEvent = $A.get("e.force:showToast");
-
- toastEvent.setParams({
- "title": "閿欒!",
- "message": message,
- "type": "error",
- //"duration" : "sticky"
- });
- toastEvent.fire();
- },
- //zhj 瀵煎嚭閿欒淇℃伅 2023-05-16 end
-})
->>>>>>> LEXCommunityLiJun
diff --git a/force-app/main/default/aura/WeeklyReport/WeeklyReport.cmp b/force-app/main/default/aura/WeeklyReport/WeeklyReport.cmp
index 84dfad2..ace93e6 100644
--- a/force-app/main/default/aura/WeeklyReport/WeeklyReport.cmp
+++ b/force-app/main/default/aura/WeeklyReport/WeeklyReport.cmp
@@ -1,4 +1,3 @@
-<<<<<<< HEAD
<aura:component
controller="WeeklyReportCmp"
implements="force:appHostable,flexipage:availableForAllPageTypes,flexipage:availableForRecordHome,force:hasRecordId,force:lightningQuickAction,forceCommunity:availableForAllPageTypes"
@@ -73,58 +72,6 @@
<aura:attribute name="report_count" type="Integer" />
<aura:attribute name="dialog_type" type="String" />
<aura:attribute name="truthy" type="Boolean" default="false" />
-=======
-<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: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="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="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"/>
->>>>>>> LEXCommunityLiJun
<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" />
@@ -134,21 +81,16 @@
<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}"/> -->
-<<<<<<< HEAD
<aura:attribute
name="update_select_report_data_id"
type="String"
default=""
/>
-=======
- <aura:attribute name="update_select_report_data_id" type="String" default=""/>
->>>>>>> LEXCommunityLiJun
<!-- 鎵归噺娣诲姞鍛ㄦ姤 start-->
<aura:attribute name="reports_date" type="List" />
<!-- <aura:attribute name="reports_date1" type="Date" />
<aura:attribute name="reports_date2" type="Date" /> -->
-<<<<<<< HEAD
<aura:attribute
name="TableContent"
type="String"
@@ -179,26 +121,6 @@
<aura:attribute name="awsurl" type="Map" />
<aura:attribute name="contactawsurl" type="Map" />
<aura:attribute name="allselectlistAgencyPerson" type="Map" />
-=======
- <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"/>
- <!-- 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"/>
- <!-- 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"/>
->>>>>>> LEXCommunityLiJun
<!-- PIPL update Yin Mingjie 21/02/2022 end -->
<!-- start DTT-zhj 澧炲姞閿欒淇℃伅table 2023-05-16-->
@@ -211,25 +133,17 @@
<!-- 鎵归噺娣诲姞鍛ㄦ姤 end-->
<ltng:require scripts="{! $Resource.AWSService+'/AWSService.js' }" />
<ltng:require scripts="{! $Resource.jquery183minjs }" />
-<<<<<<< HEAD
-=======
-
->>>>>>> LEXCommunityLiJun
<!--銉兗銉変腑...-->
<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">
-<<<<<<< HEAD
<div
class="slds-spinner--brand slds-spinner slds-spinner--medium"
role="alert"
>
-=======
- <div class="slds-spinner--brand slds-spinner slds-spinner--medium" role="alert">
->>>>>>> LEXCommunityLiJun
<span id="aa" class="slds-assistive-text">Loading</span>
<div class="slds-spinner__dot-a"></div>
<div class="slds-spinner__dot-b"></div>
@@ -238,7 +152,6 @@
</div>
</aura:renderIf>
</aura:renderIf>
-<<<<<<< HEAD
<div aura:id="report" id="report" class="contents_wrapper">
<div class="slds-grid slds-wrap slds-grid--pull-padded">
@@ -373,75 +286,10 @@
<span class="slds-truncate" title="Name"
>{!v.fieldsmap.Purpose_Type__c}</span
>
-=======
-
- <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>
- <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">
- {!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>
- <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"/>
- <!-- <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}"/>
- </div>
-
- </div>
- </div>
-
- <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;">
- <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>
- <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;">
- <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>
- <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>
-
- </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>
- <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>
->>>>>>> LEXCommunityLiJun
</th>
</tr>
</thead>
<tbody>
-<<<<<<< HEAD
<aura:iteration
items="{!v.reports}"
var="item"
@@ -470,17 +318,6 @@
class="slds-truncate"
title="{!item.Person_In_Charge2__r.Name}"
>
-=======
- <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}"/>
- </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}">
->>>>>>> LEXCommunityLiJun
{!item.Person_In_Charge2__r.Name}
<!-- <span class="decrypt">{!item.Person_In_Charge2__r.awsdata.lastName}</span> -->
</span>
@@ -493,20 +330,15 @@
</th>
<td role="gridcell" class="slds-cell-edit">
<span class="slds-grid slds-grid--align-spread">
-<<<<<<< HEAD
<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>
->>>>>>> LEXCommunityLiJun
</span>
</td>
<td role="gridcell" class="slds-cell-edit">
<span class="slds-grid slds-grid--align-spread">
-<<<<<<< HEAD
<span
class="slds-truncate"
title="{!item.doctor2__r.Name}"
@@ -517,17 +349,11 @@
<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>
->>>>>>> LEXCommunityLiJun
</span>
</span>
</td>
<td role="gridcell" class="slds-cell-edit">
<span class="slds-grid slds-grid--align-spread">
-<<<<<<< HEAD
<span
class="slds-truncate"
title="{!item.visitor_title__c}"
@@ -538,25 +364,16 @@
<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>
->>>>>>> LEXCommunityLiJun
</span>
</span>
</td>
<td role="gridcell" class="slds-cell-edit">
<span class="slds-grid slds-grid--align-spread">
-<<<<<<< HEAD
<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>
->>>>>>> LEXCommunityLiJun
</span>
</td>
</tr>
@@ -566,7 +383,6 @@
</div>
<aura:renderIf isTrue="{!v.report_count > 0}">
<aura:set attribute="else">
-<<<<<<< HEAD
<div class="no_data_area">{!v.list_message}</div>
</aura:set>
</aura:renderIf>
@@ -737,94 +553,6 @@
variant="brand"
onclick="{!c.close_export}"
/>
-=======
- <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 ">
- <aura:renderIf isTrue="{!v.loginEdit}">
- <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">鍛ㄦ姤鎵归噺瀵煎叆</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 " >
- <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}" />
- <!-- <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}" />
- </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>
- <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>
- <!-- start DTT-zhj 澧炲姞閿欒淇℃伅table 2023-05-16-->
- </aura:set>
- </aura:if>
- </div>
- </div>
- </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 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}"/>
- </div>
- <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">
- 娲诲姩鏃ュ紑濮嬫棩鏈�
-
- <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">
- 娲诲姩鏃ョ粨鏉熸棩鏈�
- <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}" />
->>>>>>> LEXCommunityLiJun
</div>
</div>
<!-- <div>
@@ -837,7 +565,6 @@
onclick="{!c.close_export}" />
</div> -->
<aura:set attribute="else">
-<<<<<<< HEAD
<ui:outputRichText
class="uiOutputRichText slds-m--around-large"
value="{!v.TableContent2}"
@@ -856,22 +583,11 @@
onclick="{!c.close_export}"
/>
</div>
-=======
- <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>
-
->>>>>>> LEXCommunityLiJun
</aura:set>
</aura:if>
</div>
</div>
</div>
-<<<<<<< HEAD
<div
aura:id="modal_exportbg"
class="disp_none slds-backdrop slds-backdrop--open"
@@ -959,43 +675,6 @@
>
{!hospital.Hospital_Name_readonly__c}
</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" >
- <aura:renderIf isTrue="{!v.loginEdit}">
- <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}"/>
- </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" >
- 娲诲姩鏃�
- <!-- <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" />
- </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">
- <!-- <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"/>
- <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">
- <div class="slds-media__body">
- <div class="slds-lookup__result-text">{!hospital.Hospital_Name_readonly__c}</div>
->>>>>>> LEXCommunityLiJun
</div>
</span>
</li>
@@ -1003,7 +682,6 @@
</ul>
</div>
</div>
-<<<<<<< HEAD
<!-- 绉戝鍒嗙被 -->
<div
@@ -1490,7 +1168,7 @@
<lightning:button
class="slds-m-top_small"
type="submit"
- label="鏂板缓"
+ label="淇濆瓨"
/>
</div>
</lightning:recordEditForm>
@@ -1498,242 +1176,3 @@
</div>
</div>
</aura:component>
-=======
-
- <!-- 绉戝鍒嗙被 -->
- <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}"/>
- </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">
- {!v.fieldsmap.doctor2__c}
- <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>
-
- <!-- 鑱屼綅 -->
- <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 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}"/>
- </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">
- {!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}"/>
- </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">
- {!v.fieldsmap.StageName__c}
- <!-- <ui:inputSelect aura:id="select_opportunity" 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">
- {!v.fieldsmap.Amount__c}
- <!-- <ui:inputSelect aura:id="select_opportunity" class="slds-select"/> -->
- <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">
- {!v.fieldsmap.OCMSale_Price__c}
- <!-- <ui:inputSelect aura:id="select_opportunity" class="slds-select"/> -->
- <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">
- {!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=""/>
- </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">
- {!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}"/>
- </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">
- {!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}"/>
- </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">
- {!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}"/>
- </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">
- {!v.fieldsmap.SupportNeeds__c}
- <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">
- {!v.fieldsmap.Result__c}
- <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}"/>
- </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">
- <thead>
- <tr class="slds-line-height--reset">
- <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>
- <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>
- <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>
- </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>
- </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>
- </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>
- </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>
- </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>
- </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>
- </td>
- </tr>
- </aura:iteration>
- </tbody>
- </table>
- </div>
- </div>
- </aura:renderIf>
- </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 class="slds-modal__container">
- <div class="slds-modal__header">
- <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}" />
- </div>
- </div>
- </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 class="slds-modal__container">
- <aura:renderIf isTrue="{!v.loginEdit}">
- <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>
- </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" />
- <!-- 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 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/>
- <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="淇濆瓨" />
- </div>
-
-
- </lightning:recordEditForm>
- </div>
- </div>
- </div>
-
-
-</aura:component>
->>>>>>> LEXCommunityLiJun
diff --git a/force-app/main/default/aura/WeeklyReport/WeeklyReport.css b/force-app/main/default/aura/WeeklyReport/WeeklyReport.css
index 9e156cb..7e0b372 100644
--- a/force-app/main/default/aura/WeeklyReport/WeeklyReport.css
+++ b/force-app/main/default/aura/WeeklyReport/WeeklyReport.css
@@ -21,11 +21,7 @@
}
.THIS .no_data_area {
text-align: center;
-<<<<<<< HEAD
margin: 0.5em 0;
-=======
- margin: .5em 0;
->>>>>>> LEXCommunityLiJun
}
.THIS.report_list_area {
margin: 40px 0 20px 0px;
@@ -103,7 +99,6 @@
.THIS .animation_on {
opacity: 1;
}
-<<<<<<< HEAD
.THIS .divbotuser {
width: fit-content;
}
@@ -144,52 +139,10 @@
}
.THIS tr:hover .encrypt {
-=======
-.THIS .divbotuser{
- width:fit-content;
-}
-
-.THIS .toastMessage.forceActionsText{
- white-space : pre-line !important;
-}
-
-.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 .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 tr .decrypt{
- display: none;
-}
-
-.THIS tr:hover .decrypt{
- display: unset;
-}
-
-.THIS tr:hover .encrypt{
->>>>>>> LEXCommunityLiJun
display: none;
}
/* add by Deloitte-Link 2023-6-19 start*/
-<<<<<<< HEAD
.THIS .weeklyReportSpinner {
top: 100px;
}
@@ -213,30 +166,5 @@
}
.THIS .custom-input .uiInput {
height: 2rem;
-=======
-.THIS .weeklyReportSpinner{
- top:100px;
}
-
-.THIS .weeklyReportSpinnerEdit{
- top:50px;
-}
-
-.THIS .slds-spinner_container{
- position: absolute;
- top:100px;
-}
-
-.THIS .slds-spinner_containerEdit{
- position: absolute;
- top:50px;
-}
-
-.THIS .marginTop{
- margin-top: 10px;
-}
-.THIS .custom-input .uiInput {
- height: 2rem;
->>>>>>> LEXCommunityLiJun
-}
-/* add by Deloitte-Link 2023-6-19 end*/
\ No newline at end of file
+/* add by Deloitte-Link 2023-6-19 end*/
diff --git a/force-app/main/default/aura/WeeklyReport/WeeklyReportController.js b/force-app/main/default/aura/WeeklyReport/WeeklyReportController.js
index b16b34d..5e2cad0 100644
--- a/force-app/main/default/aura/WeeklyReport/WeeklyReportController.js
+++ b/force-app/main/default/aura/WeeklyReport/WeeklyReportController.js
@@ -1,35 +1,21 @@
({
-<<<<<<< HEAD
doInit: function (component, event, helper) {
console.log('zhj 鏂版柟妗坵eeklyReport');
if (window.location.href.endsWith('weekly-report')) {
-=======
- doInit : function(component, event, helper) {
- console.log('zhj 鏂版柟妗坵eeklyReport');
- if (window.location.href.endsWith("weekly-report")) {
->>>>>>> LEXCommunityLiJun
helper.doinit(component, event, helper);
} else {
helper.hideCmp(component, event, helper);
}
-<<<<<<< HEAD
component.set('v.showErrorInfo', false);
},
createAopp: function (component, event, helper) {
-=======
- component.set("v.showErrorInfo", false);
- },
-
- createAopp : function(component, event, helper) {
->>>>>>> LEXCommunityLiJun
var addRecordEvent = $A.get('e.force:createRecord');
addRecordEvent.setParams({
entityApiName: 'Agency_Opportunity__c',
recordTypeId: '012100000006KW7'
});
addRecordEvent.fire();
-<<<<<<< HEAD
component.set('v.showErrorInfo', false);
},
@@ -67,45 +53,6 @@
},
handleSubmit: function (component, event, helper) {
-=======
- component.set("v.showErrorInfo", false);
- },
-
- 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) {
- component.find('save_button').set('v.label', '淇濆瓨骞舵柊寤�');
- helper.copy_button(component, event, helper);
- },
-
- change_report_radio : function(component, event, helper) {
- helper.change_report_radio(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);
- },
-
- showRequiredFields: function(component, event, helper){
- $A.util.removeClass(component.find("newOpportunityField"), "none");
- $A.util.removeClass(component.find("newOpportunityField"), "none");
- },
-
- handleSuccess : function(component, event, helper) {
- helper.handleSuccess(component, event, helper);
- },
-
- handleSubmit : function(component, event, helper) {
->>>>>>> LEXCommunityLiJun
/*
var params = event.getParams();
params.fields["Agency_Hospital__c"] = component.get('v.hospitalLinkId');
@@ -116,7 +63,6 @@
// vivek 娣诲姞楠岃瘉 start
// helper.handleFormSubmit(component);
var showValidationError = false;
-<<<<<<< HEAD
var fields = component.find('newOpportunityField');
var vaildationFailReason = '';
// var vaildationFailReason2 = '';
@@ -155,41 +101,6 @@
// PIPL update Yin Mingjie 21/02/2022 end
});
-=======
- 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"))){
- showValidationError = true;
- vaildationFailReason = "鍒嗙被涓嶈兘涓虹┖锛�";
- }else if(field.get("v.fieldName") === 'Doctor_Division1__c' && $A.util.isEmpty(field.get("v.value"))){
- showValidationError = true;
- 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");
- }
- // PIPL update Yin Mingjie 21/02/2022 end
- });
-
->>>>>>> LEXCommunityLiJun
if (!showValidationError) {
// PIPL update Yin Mingjie 21/02/2022 start
/*
@@ -200,7 +111,6 @@
var agencyHospitalid = component.get('v.hospitalLinkId');
//zhj MEBG鏂版柟妗堟敼閫� 2022-11-29 start
-<<<<<<< HEAD
debugger;
let hospitalName = '';
//璋冪敤鍚庣searchAgencyDataId鏂规硶鏌ヨ鍑哄尰闄笅闈㈡墍鏈夊鎴蜂汉鍛榙ataid
@@ -267,52 +177,6 @@
}
}
);
-=======
- 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;
- }
- 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"
- });
- }
- }else{
- helper.ShowToast({
- "message" : 'searchAgency澶辫触',
- "type" : "error"
- });
- }
- })
->>>>>>> LEXCommunityLiJun
//zhj MEBG鏂版柟妗堟敼閫� 2022-11-29 end
// var arr = new Array();
// arr.push(agencyReport);
@@ -321,20 +185,12 @@
// var token = component.get('v.AWStoken');
// var newUrl = component.get('v.AWSinsert');
-<<<<<<< HEAD
-=======
-
->>>>>>> LEXCommunityLiJun
// component.set('v.login',true);
// helper.insert_agencycontact(component,token,newUrl,data,agencyHospitalid,helper);
// PIPL update Yin Mingjie 21/02/2022 end
-<<<<<<< HEAD
} else {
-=======
- }else{
->>>>>>> LEXCommunityLiJun
component.find('OppMessage').setError(vaildationFailReason);
}
// var eventFields = event.getParam("fields");
@@ -342,7 +198,6 @@
// component.find('recordEditForm').submit(eventFields);
// vivek 娣诲姞楠岃瘉 end
},
-<<<<<<< HEAD
createCancel: function (component, event, helper) {
helper.createCancel(component, event, helper);
@@ -452,114 +307,10 @@
},
import: function (component, event, helper) {
-=======
-
- createCancel : function(component, event, helper) {
- helper.createCancel(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'));
- },
-
- 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'));
- },
-
- toggle_report : function(component, event, helper) {
- helper.toggle_report(component);
- },
-
- save_report : function(component, event, helper) {
- helper.save_report(component, event, helper);
- },
-
- select_date_change : function(component, event, helper) {
- helper.select_date_change(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);
- }
- },
-
- selectHos : function(component, event, helper) {
- helper.selectHos(component, event, helper);
- helper.setOpportunity_cfilter(component);
- },
- select_department : function(component, event, helper) {
- helper.select_department(component, event, helper);
- helper.setOpportunity_cfilter(component);
- },
- select_purpose_type : function(component, event, helper) {
- helper.select_purpose_type(component, event, helper);
- },
-
- doctor_change : function(component, event, helper) {
- helper.doctor_change(component, event, helper);
- },
-
- opportunityChange : function(component, event, helper) {
- helper.opportunityChange(component, event, helper);
- },
-
- productcategoryChange1 : function(component, event, helper) {
- helper.productcategoryChange1(component, event, helper);
- },
- productcategoryChange2 : function(component, event, helper) {
- helper.productcategoryChange2(component, event, helper);
- },
- productcategoryChange3 : function(component, event, helper) {
- helper.productcategoryChange3(component, event, helper);
- },
- stageNameChange : function(component, event, helper) {
- helper.stageNameChange(component, event, helper);
- },
- onDragOver : function(component, event, helper) {
- event.preventDefault();
- },
-
- onDrop : function(component, event, helper) {
- event.stopPropagation();
- event.preventDefault();
- 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");
- // var fileInput = component.find("file").getElement();
- // var file = fileInput.files[0];
- 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);
- },
-
- cancel : function(component,event,helper){
- component.set("v.showMain",true);
- },
-
- import : function(component,event,helper){
->>>>>>> LEXCommunityLiJun
// component.find('file').click();
// console.log('lll'+component.find('file'));
helper.showImport(component);
},
-<<<<<<< HEAD
exportDate: function (component, event, helper) {
var stockData = component.get('v.reports_date');
console.log('瀵煎嚭鏁版嵁' + stockData);
@@ -586,38 +337,11 @@
select_repores_date: function (component, event, helper) {
helper.select_repores_date(component, event, helper);
-=======
- 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";
- 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]
- 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){
- helper.showExport(component);
- },
-
- select_repores_date : function(component,event,helper){
- helper.select_repores_date(component,event,helper);
->>>>>>> LEXCommunityLiJun
// var stockData = component.get("v.reports_date");
// console.log('鏌ュ嚭鐨勬暟鎹�'+stockData);
// helper.showExportDate(component,stockData);
// this.export(component,event,helper);
},
-<<<<<<< HEAD
export: function (component, event, helper) {
console.log('杩涘叆export');
var stockData = component.get('v.reports_date');
@@ -637,24 +361,3 @@
helper.exportErrorInfoHelper(component);
}
});
-=======
- export : function(component,event,helper){
- console.log('杩涘叆export');
- 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);
- helper.close_import(component);
- },
- close_export : function(component,event,helper){
- component.set("v.showMain",true);
- helper.close_export(component);
- },
- exportErrorInfo: function(component,event,helper){
- helper.exportErrorInfoHelper(component);
- },
-})
->>>>>>> LEXCommunityLiJun
diff --git a/force-app/main/default/aura/WeeklyReport/WeeklyReportHelper.js b/force-app/main/default/aura/WeeklyReport/WeeklyReportHelper.js
index bd6af23..4129232 100644
--- a/force-app/main/default/aura/WeeklyReport/WeeklyReportHelper.js
+++ b/force-app/main/default/aura/WeeklyReport/WeeklyReportHelper.js
@@ -1,5 +1,4 @@
({
-<<<<<<< HEAD
doinit: function (component, event, helper) {
this.report_date_list(component, event, helper, 5);
component.set('v.login', true);
@@ -1763,1349 +1762,15 @@
},
doctor_change: function (component, event, helper) {
-=======
- doinit : function(component, event, helper) {
- this.report_date_list(component, event, helper, 5);
- component.set('v.login',true);
- var action = component.get('c.getalldata');
- action.setCallback(this,function(response){
- var state = response.getState();
- 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);
- // PIPL update Yin Mingjie 21/02/2022 start
- 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.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{
- this.error('doinit failed.');
- component.set('v.login',false);
- }
- });
- $A.enqueueAction(action);
- },
-
- // PIPL update Yin Mingjie 21/02/2022 start
- 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 != ''){
- contactData[resobj[i].awsid] = resobj[i];
- dataArr.push(resobj[i].awsid);
- }
- }
- let obj= Object.create(null);
- obj['dataIds'] = dataArr;
- var payload = JSON.stringify(obj);
- 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);
- }
- },component);
-
- });
- },
-
- to_contact_list : function(result,retMap,component) {
- var resls = result.object;
- var res = [];
- var space = {};
- space['label'] = '';
- space['selected'] = true;
- space['value'] = '';
- res.push(space);
-
- for (var i = 0; i < resls.length; i++) {
- var t = {};
- t['label'] = resls[i].lastName;
- t['selected'] = false;
- t['Doctor_Division1__c'] = resls[i].doctorDivision1;
- 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);
- },
-
- search_contact_url : function(component, sobject, callback) {
- var action = component.get('c.getAwsurl');
- action.setParams({
- "sobj" : sobject,
- });
- action.setCallback(this,function(response){
- var state = response.getState();
- if(state == 'SUCCESS'){
- var result = response.getReturnValue();
- if(callback)callback(result);
- }
- else{
- this.error('AWS url/token error.');
- 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");
- if (purpose_type) {
- if (purpose_type.substr(-3) == 'OPD') {
- purpose_type = 'OPD';
- } else if (purpose_type.substr(-3) == 'SIS') {
- purpose_type = 'SIS';
- } else {
- purpose_type = '';
- }
- }
- if (dc != '' || purpose_type != '') {
-
- var action = component.get('c.getProductList');
- action.setParams({
- "dc" : dc,
- "opdsis" : purpose_type,
- });
- action.setCallback(this,function(response){
- var state = response.getState();
- 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{
- this.error('getProductList failed.');
- }
- });
- $A.enqueueAction(action);
- } else {
- component.find('select_Product1').set('v.options', []);
- component.find('select_Product2').set('v.options', []);
- component.find('select_Product3').set('v.options', []);
- }
- },
-
- 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,
- });
-
- component.set('v.login',true);
- action.setCallback(this,function(response){
- var state = response.getState();
- if(state == 'SUCCESS'){
- var res = response.getReturnValue();
- component.set('v.reports', res.reports);
-
- // 20220222 PI鏀归�� by Bright--start
- let dataIds = [];
- let dataIds1 = [];
- let mm = {};
- let b = false;
- let b1 = false;
- for (const rep of res.reports) {
- if (rep.doctor2__r && rep.doctor2__r.AWS_Data_Id__c) {
- dataIds.push(rep.doctor2__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){
- 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.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);
- }
- }
-
- 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('璇烽噸鏂板埛鏂伴〉闈㈣繘琛岃В瀵�');
- }
- },component);
- }else{
- b = true;
- }
-
-
-
- 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);
- }
- },component);
- }else{
- b1 = true;
- }
- // 20220222 PI鏀归�� by Bright--end
-
- component.set('v.report_count', res.reports.length);
-
- // 鏇存柊淇濆瓨寰屻伄select_data鐢�
- var report_id = component.get('v.update_select_report_data_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]);
- 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{
- this.error('get_reports failed.');
- component.set('v.login',false);
- }
- });
- $A.enqueueAction(action);
- },
- 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,
- });
-
- component.set('v.loginEdit',true);
- action.setCallback(this,function(response){
- var state = response.getState();
- if(state == 'SUCCESS'){
- var res = response.getReturnValue();
- component.set('v.reports', res.reports);
-
- // 20220222 PI鏀归�� by Bright--start
- let dataIds = [];
- let dataIds1 = [];
- let mm = {};
- let b = false;
- let b1 = false;
- for (const rep of res.reports) {
- if (rep.doctor2__r && rep.doctor2__r.AWS_Data_Id__c) {
- dataIds.push(rep.doctor2__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){
- 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.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);
- }
- }
-
- 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('璇烽噸鏂板埛鏂伴〉闈㈣繘琛岃В瀵�');
- }
- },component);
- }else{
- b = true;
- }
-
-
-
- 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);
- }
- },component);
- }else{
- b1 = true;
- }
- // 20220222 PI鏀归�� by Bright--end
-
- component.set('v.report_count', res.reports.length);
-
- // 鏇存柊淇濆瓨寰屻伄select_data鐢�
- var report_id = component.get('v.update_select_report_data_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]);
- 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{
- this.error('get_reports failed.');
- 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'));
- 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');
- 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.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) {
- // PIPL update Yin Mingjie 21/02/2022 start
- var allselectlist = component.get('v.allselectlist.AgencyPerson__c');
- // var allselectlist = component.get('v.allselectlistAgencyPerson');
- // PIPL update Yin Mingjie 21/02/2022 end
- var new_label = '';
- for (var i = 0; i < allselectlist.length; i++) {
- if (agency_person_value == allselectlist[i].value) {
- new_label = allselectlist[i].label;
- break;
- }
- }
- return new_label;
- },
-
- 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');
- 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) {
- 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') {
- 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
- // 鍖婚櫌鍚�
- 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'];
- }
- }
- 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.find('new_con').set('v.disabled', false);
- }
-
- // 绉戝
- if (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);
-
- // 娲诲姩鍖哄垎
- if (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
- // 绲愭灉
- 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 != "") {
- var select_opp = '';
- var select_product_category1 = '';
- var select_product_category2 = '';
- var select_product_category3 = '';
- 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"];
- break;
- }
- }
-
- // 璇环
- if (select_opp != null && select_opp != '') {
- 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'
- }
- }];
- 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);
- }
- }
-
- // 浜у搧鍖哄垎
- 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_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', "");
- }
- }
- setTimeout(function() {
- component.set('v.loginEdit',false);
- }, 1000);
- } else {
- // CLOSE
-
- 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 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 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 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['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_Category3__c'] === "undefined") {
- select_report_data['Product_Category3__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_text = '鏀惧純鏂板缓鍛ㄦ姤锛�';
-
- if (!Report_Date__c &&
- !Agency_Hospital__c &&
- !Department_Cateogy__c &&
- !doctor2__c &&
- !Purpose_Type__c &&
- !SupportNeeds__c&&//WAG-CBX68C fy 銆愬鎵樸�慏AMS绯荤粺鍛ㄦ姤妯″潡鍐呭闇�姹傚鍔�
- !Opportunity__c &&
- !Product_Category1__c &&
- !Product_Category2__c &&
- !Product_Category3__c &&
- !Result__c)
- {
- this.allclear(component);
- $A.util.addClass(modal_window, '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_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 &&
- 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['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)
- {
- this.allclear(component);
- $A.util.addClass(modal_window, '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 = '璀﹀憡!'
- 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 &&
- 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['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)
- {
- this.allclear(component);
- $A.util.addClass(modal_window, 'disp_none');
- $A.util.addClass(modal_bg, 'disp_none');
- } else {
- this.close_confirm(component, confirm_title, confirm_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');
-
- if (confirm_status == 0) {
- $A.util.addClass(modal_window, 'disp_none');
- $A.util.addClass(modal_bg, 'disp_none');
- $A.util.removeClass(modal_confirm, 'disp_none');
- $A.util.removeClass(modal_confirm_bg, 'disp_none');
- } else if (confirm_status == 1) {
- // 鏄�
- $A.util.addClass(modal_confirm, 'disp_none');
- $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_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.addClass(modal_confirm, 'disp_none');
- $A.util.addClass(modal_confirm_bg, 'disp_none');
- component.set('v.confirm_status', 0);
- }
- },
-
- 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');
- 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);
- // PIPL update Yin Mingjie 21/02/2022 start
- this.set_aws_url(component,'Agency_Contact__c')
- // PIPL update Yin Mingjie 21/02/2022 end
- },
-
- 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();
- 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);
- },
-
- 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')) {
- component.set('v.select_report_data_radio', reports[i]);
- component.find('copy_button').set('v.disabled', false);
- break;
- }
- }
- },
-
- 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.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 text_tmp = select_date.split('-');
- 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);
- },
-
- 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')){
- if (op.selected) {
- doctor2Name = op.label;
- visitortitle = op.Doctor_Division1__c;
- }
- }
- // 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 = "";
- if (component.get('v.mode') == 'edit') {
- // 鍛� 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;
- } else {
- // 鍛� Submit_date__c
- 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');
- }
- // Agency_Report_Header__c
- 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');
-
- // 鎷滆浜� 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
- // 鏀彺闇�姹� SupportNeeds__c
- var SupportNeeds__c = component.find('SupportNeeds__c').get('v.value');
- //SWAG-CBX68C fy 銆愬鎵樸�慏AMS绯荤粺鍛ㄦ姤妯″潡鍐呭闇�姹傚鍔� end
- // 璇环 Opportunity__c
- var Opportunity__c = component.get('v.data.Opportunity__c');
-
- 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 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');
- 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) {
- StageName__c = '';
- Amount__c = '';
- OCMSale_Price__c = '';
- Close_Forecasted_Date__c = '';
- }
-
- // 浜у搧鍖哄垎 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');
-
- // 绲愭灉 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("鍛� 涓嶅瓨鍦�"); }
- var rDate = new Date(Report_Date__c);
- var sDate = new Date(Submit_date__c);
- sDate.setDate(sDate.getDate() - 1);
- 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 (!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("缁撴灉 涓嶅瓨鍦�"); }
- }
- for (var i = 0; i < error.length; i++) {
- this.warning(error[i]);
- }
- if (error.length > 0) {
- component.find('save_button').set('v.disabled', false);
- return false;
- }
-
-
- // 淇濆瓨鍑︾悊
- 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
- // 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,
- });
-
- action.setCallback(this,function(response){
- var state = response.getState();
- 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;
- 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) {
- 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.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);
-
- component.find('save_button').set('v.disabled', false);
- component.set('v.loginEdit',false);
- }
- else{
- // var error = response.getError();
- // alert(JSON.stringify(error));
- // alert(JSON.stringify(error[0].fieldErrors));
- // alert(JSON.stringify(error[0].fieldErrors.next()));
- // alert(JSON.stringify(error[0].fieldErrors.next()[0]));
- // if (this.error(response.getError()[0].message))
- // else () {
- // error[0].fieldErrors[0]
- // }
- this.error('save_report failed.');
- component.find('save_button').set('v.disabled', 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,
- //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){
- var state = response.getState();
- 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'));
-
- // 銉€兗銉�銉偊銈c兂銉夈偊鍐呫伄涓�瑕х敤
- var action2 = component.get('c.getReportsById');
- action2.setParams({
- "report_id" : report_id,
- });
- action2.setCallback(this,function(response){
- var state = response.getState();
- 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 != "") {
- reports_now_count = reports_now.length;
- }
-
- // Save&New鏅傘伄銈︺偅銉炽儔銈﹀唴銉囥兗銈夸竴瑕�
- if (res.length > 0) {
- // 20220222 PI鏀归�� by Bright--start
- 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;
- 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');
- }
- }
- else{
- this.error('get_reports_now failed.');
- 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{
- 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);
- }
- });
- $A.enqueueAction(action);
- }
- },
-
- allclear : function(component) {
- var clear = [{label:'', value:'', selected:true}];
- component.set('v.hospital', '');
- 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')));
- //SWAG-CBX68C fy 銆愬鎵樸�慏AMS绯荤粺鍛ㄦ姤妯″潡鍐呭闇�姹傚鍔� start
- 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','');
- console.log('reportDate = 绌�');
- component.set('v.data.Report_Date__c', '');
- component.set('v.oppdata.Close_Forecasted_Date__c', '');
- component.set('v.oppdata.Amount__c', '');
- component.set('v.oppdata.OCMSale_Price__c', '');
- component.set('v.oppdata.StageName__c', '');
- // component.set('v.oppdata', '');
- component.set('v.Close_Forecasted_Date__c_o', '');
- 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-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').set("v.body",[]);
- // if (component.find('input-product-category1'))
- // component.find('input-product-category1').get("v.body")[0].set('v.values', values);
- // if (component.find('input-product-category2'))
- // component.find('input-product-category2').get("v.body")[0].set('v.values', values);
- // if (component.find('input-product-category3'))
- // component.find('input-product-category3').get("v.body")[0].set('v.values', values);
- component.find('select_result').set('v.value', '');
- this.select_purpose_type(component);
- },
-
- report_date_list : function(component, event, helper, count) {
- 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();
- 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(),
- });
- } 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(),
- });
- }
- }
-
- 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) {
- s_date = this.get_date_string(s_date);
- if (s_date == false) {
- this.error('get_date_string failed.');
- return false;
- }
-
- var head_key = this.create_header_input_key(s_agency, s_date);
- component.set('v.agency_report_header', head_key);
- if (head_key == false) {
- 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,
- });
-
- component.set('v.login',true);
- action.setCallback(this,function(response){
- var state = response.getState();
- if(state == 'SUCCESS'){
- var res = response.getReturnValue();
- component.set('v.agency_report_header_id', res);
- component.set('v.login',false);
- this.toggle_report(component);
- }
- else{
- this.error('createReportHeader callback failed.');
- component.set('v.login',false);
- }
- });
- $A.enqueueAction(action);
- },
-
- 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.')
- return false;
- }
- }
- if (!agency_id || !s_date) {
- return false;
- }
-
- s_date = s_date.replace(/-/g, '');
- var headkey = agency_id + ":" + s_date;
-
- return headkey;
- },
-
- /* typeof is not cool
- * @ret : String, Boolean, Date, Error, Array, Function, Null, Undefined, etc
- */
- 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') {
- if (val.match(/^\d{4}\/\d{1,2}\/\d{1,2}$/)) {
- val = val.replace(/[\/]/g, '-');
- var tmp = val.split('-');
- if (tmp[1].length == 1) {
- tmp[1] = '0' + tmp[1];
- }
- if (tmp[2].length == 1) {
- tmp[2] = '0' + tmp[2];
- }
- val = tmp[0] + '-' + tmp[1] + '-' + tmp[2];
- } else if (val.match(/^\d{4}-\d{1,2}-\d{1,2}$/)) {
- //ok
- } else {
- return false;
- }
- } else if (this.object_type(val) == 'Date') {
- var mm = val.getMonth() + 1;
- 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");
- debugger;
- action.setParams({"hospital_name": hospital_name});
-
- 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());
- } else {
- $A.util.removeClass(hospital_list, 'slds-is-open');
- }
- });
- $A.enqueueAction(action);
- },
-
- 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;
- var hospital_data = component.get('v.hospitalList');
- 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);
- component.find('new_con').set('v.disabled', false);
- }
- }
- 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) {
- 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') {
- var result = component.find('result');
- $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');
- }
- this.select_department(component, null, null);
- },
-
- doctor_change : function(component, event, helper) {
->>>>>>> LEXCommunityLiJun
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) {
-<<<<<<< HEAD
component.set(
'v.doctor_title',
doctor_list[i].Doctor_Division1__c
);
-=======
- component.set('v.doctor_title', doctor_list[i].Doctor_Division1__c);
->>>>>>> LEXCommunityLiJun
flg = true;
break;
}
@@ -3115,7 +1780,6 @@
}
},
// PIPL update Yin Mingjie 21/02/2022 start
-<<<<<<< HEAD
set_aws_url: function (component, sobject) {
var action = component.get('c.getAwsurl');
action.setParams({
@@ -3132,31 +1796,11 @@
} else {
this.error('AWS url/token error.');
component.set('v.loginEdit', false);
-=======
- set_aws_url : function(component,sobject) {
- var action = component.get('c.getAwsurl');
- action.setParams({
- "sobj" : sobject,
- });
- action.setCallback(this,function(response){
- var state = response.getState();
- 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{
- this.error('AWS url/token error.');
- component.set('v.loginEdit',false);
->>>>>>> LEXCommunityLiJun
}
});
$A.enqueueAction(action);
},
-<<<<<<< HEAD
insert_agencycontact: function (
component,
token,
@@ -3166,10 +1810,6 @@
helper,
hospitalName
) {
-=======
- insert_agencycontact : function(component,token,newUrl,payload,agencyHospitalid,helper,hospitalName) {
-
->>>>>>> LEXCommunityLiJun
// AWSService.insert(newUrl,payload,function(result){
// if(result.status == '0'){
// $A.getCallback(function(){
@@ -3182,11 +1822,7 @@
// component.find('OppMessage').setError('AWS insert error.');
// }
// },token);
-<<<<<<< HEAD
-=======
-
->>>>>>> LEXCommunityLiJun
fetch(newUrl, {
method: 'POST',
body: payload,
@@ -3194,7 +1830,6 @@
'Content-Type': 'application/json',
'pi-token': token
}
-<<<<<<< HEAD
})
.then((data) => {
return data.json();
@@ -3252,51 +1887,6 @@
console.log(acMap);
if (acMap.AgencyContactId != '') {
//纭浜嬪姟
-=======
- }).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.');
- });
-
- },
-
- to_agencycontact : function(component,result,agencyHospitalid) {
- var action = component.get('c.saveAgencyContact');
- action.setParams({
- "name" : result.object[0].name,
- //"nameEncrypt" : result.object[0].nameEncrypt,
- "type" : result.object[0].type,
- //"typeEncrypt" : result.object[0].typeEncrypt,
- "doctorDivision1" : result.object[0].doctorDivision1,
- //"doctorDivision1Encrypt" : result.object[0].doctorDivision1Encrypt,
- "agencyHospitalid" : agencyHospitalid,
- "awsid" : result.object[0].dataId,
- });
- action.setCallback(this,function(response){
- var state = response.getState();
- if(state == 'SUCCESS'){
- var acMap = this.conv_selected(response.getReturnValue());
- console.log(acMap);
- if(acMap.AgencyContactId != ''){
- //纭浜嬪姟
->>>>>>> LEXCommunityLiJun
var token = component.get('v.AWStoken');
var confirmUrl = component.get('v.AWStransactionURL');
@@ -3305,7 +1895,6 @@
data['sfRecordId'] = '';
data['txId'] = result.txId;
-<<<<<<< HEAD
this.to_confirm(
component,
token,
@@ -3322,30 +1911,12 @@
} else {
this.error('agency contact insert error.');
component.set('v.loginEdit', false);
-=======
- this.to_confirm(component,token,confirmUrl,JSON.stringify(data));
- }else if(acMap.errormsg != ''){
- this.error(acMap.errormsg);
- component.set('v.loginEdit',false);
- }else {
- this.error('agency contact insert id error.');
- component.set('v.loginEdit',false);
- }
- }
- else{
- this.error('agency contact insert error.');
- component.set('v.loginEdit',false);
->>>>>>> LEXCommunityLiJun
}
});
$A.enqueueAction(action);
},
-<<<<<<< HEAD
to_confirm: function (component, token, confirmUrl, payload) {
-=======
- to_confirm : function(component,token,confirmUrl,payload) {
->>>>>>> LEXCommunityLiJun
fetch(confirmUrl, {
method: 'POST',
body: payload,
@@ -3353,7 +1924,6 @@
'Content-Type': 'application/json',
'pi-token': token
}
-<<<<<<< HEAD
})
.then((data) => {
return data.json();
@@ -3395,42 +1965,6 @@
var retMap = this.conv_selected(response.getReturnValue());
// PIPL update Yin Mingjie 21/02/2022 start
this.AWS_search(retMap, 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);
- }else {
- this.error('AWS confirm error.');
- 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) {
- var hospital_id = component.get('v.hospitalLinkId');
- if (hospital_id) {
- component.set('v.loginEdit',true);
- var action = component.get('c.getDoctorList');
- action.setParams({
- "hospital_id" : hospital_id,
- });
- action.setCallback(this,function(response){
- var state = response.getState();
- if(state == 'SUCCESS'){
- var retMap = this.conv_selected(response.getReturnValue());
- // PIPL update Yin Mingjie 21/02/2022 start
- this.AWS_search(retMap,component);
->>>>>>> LEXCommunityLiJun
/*
var default_doctor = component.get('v.default_select_doctor_id');
if (default_doctor != '' && res.length > 0) {
@@ -3457,18 +1991,10 @@
component.set('v.doctor_list', res);
component.set('v.login',false);
*/
-<<<<<<< HEAD
// PIPL update Yin Mingjie 21/02/2022 end
} else {
this.error('set_doctor_list failed.');
component.set('v.loginEdit', false);
-=======
- // PIPL update Yin Mingjie 21/02/2022 end
- }
- else{
- this.error('set_doctor_list failed.');
- component.set('v.loginEdit',false);
->>>>>>> LEXCommunityLiJun
}
});
$A.enqueueAction(action);
@@ -3476,17 +2002,12 @@
},
// PIPL update Yin Mingjie 21/02/2022 start
-<<<<<<< HEAD
AWS_search: function (retMap, component) {
-=======
- AWS_search : function(retMap,component) {
->>>>>>> LEXCommunityLiJun
var token = retMap.sre.token;
var searchUrl = retMap.sre.searchUrl;
var dataArr = new Array();
for (const key in retMap) {
-<<<<<<< HEAD
if (key == 'sre') {
continue;
}
@@ -3596,100 +2117,6 @@
}
}
-=======
- if (key == 'sre') {continue;}
- dataArr.push(key);
- }
- if(dataArr.length == 0){
- component.set('v.loginEdit',false);
- this.warning('娌℃湁鎵惧埌绗﹀悎鏉′欢鐨勫鎴蜂汉鍛�');
- return;
- }
- let obj= Object.create(null);
- obj['dataIds'] = dataArr;
- var data = JSON.stringify(obj);
- 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);
- // fetch(searchUrl, {
- // method: 'POST',
- // body: payload,
- // headers: {
- // 'Content-Type': 'application/json',
- // 'pi-token': token
- // }
- // }).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) {
- console.log('token = ' + token);
- console.log('searchUrl = ' + searchUrl);
- console.log('payload = ' + payload);
- fetch(searchUrl, {
- method: 'POST',
- body: payload,
- headers: {
- '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);
- });
- },
-
- to_doctor_list : function(result,retMap,component) {
- var resls = result.object;
- var res = [];
- var space = {};
- space['label'] = '';
- space['selected'] = true;
- space['value'] = '';
- res.push(space);
-
- for (var i = 0; i < resls.length; i++) {
- var t = {};
- t['label'] = resls[i].name;
- t['selected'] = false;
- t['Doctor_Division1__c'] = resls[i].doctorDivision1;
- t['value'] = retMap[resls[i].dataId].value;
- res.push(t);
- }
-
- 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++) {
- if (res[i].value == default_doctor) {
- res[i].selected = true;
- doctor_title = res[i].Doctor_Division1__c;
- } else {
- res[i].selected = false;
- }
- }
-
->>>>>>> LEXCommunityLiJun
component.find('select_doctor').set('v.options', res);
component.set('v.doctor_title', doctor_title);
} else {
@@ -3698,17 +2125,10 @@
component.set('v.doctor_title', res[0].Doctor_Division1__c);
}
}
-<<<<<<< HEAD
component.set('v.default_select_doctor_id', '');
component.set('v.doctor_list', res);
component.set('v.loginEdit', false);
-=======
-
- component.set('v.default_select_doctor_id', '');
- component.set('v.doctor_list', res);
- component.set('v.loginEdit',false);
->>>>>>> LEXCommunityLiJun
},
// PIPL update Yin Mingjie 21/02/2022 end
@@ -3723,7 +2143,6 @@
// }
// options.splice(remove,1);
// },
-<<<<<<< HEAD
opportunityChange: function (component, event, helper) {
debugger;
@@ -3772,32 +2191,11 @@
'disp_none'
);
} else if (opp_id != '') {
-=======
-
- 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');
- } 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 != "") {
->>>>>>> LEXCommunityLiJun
var hospital_link_id = component.get('v.hospitalLinkId');
if (hospital_link_id == '') {
this.warning('鍖婚櫌涓嶅瓨鍦�');
// ToDo闇�瑕佹祴璇曟墜鏈轰笂鑳借繍琛屼笉
component.set('v.data.Opportunity__c', '');
-<<<<<<< HEAD
$A.util.addClass(
component.find('input-opportunity-stage'),
'disp_none'
@@ -3818,18 +2216,10 @@
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');
->>>>>>> LEXCommunityLiJun
// if ($A.get("$Browser.formFactor") == 'DESKTOP') {
// var values = [];
// // component.find('input-opportunity').get("v.body")[0].set('v.values', values);
// } else {
-<<<<<<< HEAD
// component.find('input-opportunity').get("v.body")[0].set('v.selectedLabel', '');
// }
return false;
@@ -3846,22 +2236,6 @@
action.setCallback(this, function (response) {
var state = response.getState();
if (state == 'SUCCESS') {
-=======
- // component.find('input-opportunity').get("v.body")[0].set('v.selectedLabel', '');
- // }
- return false;
- }
- var action = component.get('c.selectOpportunityByIdAndHospitalLinkId');
- action.setParams({
- "opportunity_id" : opp_id,
- "agency_hospital_link_id" : component.get('v.hospitalLinkId'),
- });
-
- component.set('v.loginEdit',true);
- action.setCallback(this,function(response){
- var state = response.getState();
- if(state == 'SUCCESS'){
->>>>>>> LEXCommunityLiJun
var res = response.getReturnValue();
if (res.length <= 0) {
if (component.get('v.data.Opportunity__c')) {
@@ -3869,7 +2243,6 @@
}
// ToDo闇�瑕佹祴璇曟墜鏈轰笂鑳借繍琛屼笉
component.set('v.data.Opportunity__c', '');
-<<<<<<< HEAD
$A.util.addClass(
component.find('input-opportunity-stage'),
'disp_none'
@@ -3890,26 +2263,13 @@
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');
->>>>>>> LEXCommunityLiJun
// if ($A.get("$Browser.formFactor") == 'DESKTOP') {
// var values = [];
// component.find('input-opportunity').get("v.body")[0].set('v.values', values);
// } else {
-<<<<<<< HEAD
// component.find('input-opportunity').get("v.body")[0].set('v.selectedLabel', '');
// }
component.set('v.loginEdit', false);
-=======
- // component.find('input-opportunity').get("v.body")[0].set('v.selectedLabel', '');
- // }
- component.set('v.loginEdit',false);
->>>>>>> LEXCommunityLiJun
return false;
}
//SWAG-CKH5M8 銆愬鎵樸�戝懆鎶ュ叧鑱旇浠凤紝鍙�夋嫨璇环鑼冨洿璋冩暣 fy start
@@ -3926,17 +2286,12 @@
// // var values = [];
// // component.find('input-opportunity').get("v.body")[0].set('v.values', values);
// // } else {
-<<<<<<< HEAD
// // component.find('input-opportunity').get("v.body")[0].set('v.selectedLabel', '');
-=======
- // // component.find('input-opportunity').get("v.body")[0].set('v.selectedLabel', '');
->>>>>>> LEXCommunityLiJun
// // }
// component.set('v.login',false);
// return false;
// }
//SWAG-CKH5M8 銆愬鎵樸�戝懆鎶ュ叧鑱旇浠凤紝鍙�夋嫨璇环鑼冨洿璋冩暣 fy end
-<<<<<<< HEAD
else {
component.set('v.loadOpp', false);
component.set('v.oppdata', res[0]);
@@ -3987,577 +2342,9 @@
}
});
$A.enqueueAction(action);
-=======
- 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.Amount__c_o', res[0].Amount__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');
- }
-
- 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');
- 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)) {
- this.warning('涓嶈兘閫夋嫨鍚屾牱鐨勪骇鍝佸尯鍒�');
- component.find('select_Product1').set('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)) {
- this.warning('涓嶈兘閫夋嫨鍚屾牱鐨勪骇鍝佸尯鍒�');
- component.find('select_Product2').set('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)) {
- this.warning('涓嶈兘閫夋嫨鍚屾牱鐨勪骇鍝佸尯鍒�');
- component.find('select_Product3').set('v.value','');
- }
- },
-
- conv_selected : function(obj) {
- for (var i = 0; i < obj.length; i++) {
- if (obj[i].selected) {
- if (obj[i].selected == 'true') {
- obj[i].selected = true;
- } else {
- obj[i].selected = false;
- }
- }
- }
-
- 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++) {
- if (select_tmp[i].value == value) {
- select_tmp[i].selected = true;
- } else {
- select_tmp[i].selected = false;
- }
- }
- component.find(aura_id_name).set('v.options', select_tmp);
- return true;
- } else {
- return false;
- }
- },
-
- success : function(message) {
- var toastEvent = $A.get("e.force:showToast");
- toastEvent.setParams({
- "title" : "鎴愬姛!",
- "message" : message,
- "type" : "success",
- "duration" : "5000"
- });
- toastEvent.fire();
- },
-
- warning : function(message) {
- var toastEvent = $A.get("e.force:showToast");
- toastEvent.setParams({
- "title": "璀﹀憡!",
- "message": message,
- "type":"warning",
- "duration" : "10000"
- });
- toastEvent.fire();
- },
-
- error : function(message) {
- // $('toastMessage.forceToastManager').css('white-space', 'pre-wrap');
- var toastEvent = $A.get("e.force:showToast");
-
- toastEvent.setParams({
- "title": "閿欒!",
- "message": message,
- "type":"error",
- "duration" : "sticky"
- });
- toastEvent.fire();
- },
-
- 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')
- // $A.util.removeClass(modal_newAC, 'disp_none');
- },
-
- // vivek start 娣诲姞楠岃瘉
- // handleFormSubmit : function(component) {
- // var showValidationError = false;
- // 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;
- // vaildationFailReason = "鍒嗙被涓嶈兘涓虹┖锛�";
- // }else if(field.get("v.fieldName") === 'Doctor_Division1__c' && $A.util.isEmpty(field.get("v.value"))){
- // showValidationError = true;
- // 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')
- $A.util.addClass(div1, 'disp_none');
- $A.util.addClass(div2, 'disp_none');
- },
-
- 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')
- $A.util.addClass(modal_newAC, 'disp_none');
- this.success('.瀹㈡埛浜哄憳宸插垱寤恒��');
- this.set_doctor_list(component);
- },
-
- createCancel : function(component, event, helper) {
- component.set('v.truthy', false);
- var modal_newAC = component.find('modal_newAC')
- $A.util.addClass(modal_newAC, 'disp_none');
- },
- setOpportunity_cfilter : function(component) {
- debugger
- var hosId = component.get('v.hospitalId');
- 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 + '\'';
- }
- 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 + '\'';
- }
- component.set('v.opportunity_cfilter', opportunity_cfilter);
- component.set('v.data.Opportunity__c', null);
- },
- readFile: function(component, helper, file) {
- if (!file) return;
- // console.log('file'+file.name);
- if(!file.name.match(/\.(csv||CSV)$/)){
- return alert('only support csv files');
- }else{
-
- reader = new FileReader();
- reader.onerror =function errorHandler(evt) {
- switch(evt.target.error.code) {
- case evt.target.error.NOT_FOUND_ERR:
- alert('File Not Found!');
- break;
- case evt.target.error.NOT_READABLE_ERR:
- alert('File is not readable');
- break;
- case evt.target.error.ABORT_ERR:
- break; // noop
- default:
- alert('An error occurred reading this file.');
- };
- }
- //reader.onprogress = updateProgress;
- 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.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 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 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>';
- }
- 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>';
- }
- content +="</tr>";
- }
- }
- content += "</table>";
- console.log(content);
- component.set("v.TableContent",content);
- component.set("v.showMain",false);
- }
- }
- reader.readAsText(file,'gb2312');
-
- }
- var reader = new FileReader();
- reader.onloadend = function() {
-
- };
- reader.readAsDataURL(file);
- },
-
- 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 state = response.getState();
- if (state === "SUCCESS") {
- var ress = response.getReturnValue();
- 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));
- var dataArr = new Array();
- var dataMap = new Map();
- 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
- }
- });
- 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);
-
- });
- // var resultjson =null;
- // this.ImportMethod(component,resultjson);
- }else{
- this.error(valur[1]+'\n'+"璇蜂慨鏀瑰悗閲嶆柊涓婁紶");
- }
- }
- }
- });
- $A.enqueueAction(action1);
- //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 sss=component.get("v.fileContentData");
- // 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);
- // if(res != 'success'){
- // debugger
- // var ress = res.split('=');
- // console.log(ress);
- // for (var i=0; i<ress.length; i++) {
- // res1 += ress[i].substr(7)+'\n';
- // }
- // // $('.forceToastManager').css('white-space', 'pre-wrap');
- // console.log("=="+res1);
- // this.error(res1+"璇蜂慨鏀瑰悗閲嶆柊涓婁紶");
- // component.set('v.login',false);
- // }else{
- // component.set("v.showMain",true);
- // this.success("瀵煎叆鎴愬姛");
- // // alert('saved successfully');
- // component.set('v.login',false);
- // }
-
- // }
- // else if (state === "INCOMPLETE") {
- // // do something
- // component.set('v.login',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.login',false);
- // }
- // } else {
- // console.log("Unknown error");
- // component.set('v.login',false);
- // }
- // }
- // });
- // $A.enqueueAction(action);
-
- },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({
- // fileData : component.get("v.fileContentData"),
- fileData : fileStr,
- // selectDateselectDate :component.find('select_date').get('v.value'),
- 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] + '涓嶅瓨鍦�';
- }
- errorDatas.push(errorData);
- } else {
- 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 }
- ];
- 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];
- }
- }
- }
- 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 {
- console.log("Unknown error");
- component.set('v.loginEdit',false);
- }
- }
- });
- $A.enqueueAction(actionss);
- },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');
-
- var fileStr = files[0];
- fileStr += '\n';
-
- 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 (dataMap.get(nameDataId)) {
- filelist[4] = dataMap.get(nameDataId); //zhj 鏂版柟妗堟敼閫� filelist[4]涓嶅啀瀛樼殑nameEncrpt 2022-12-21
- }else {
- error += 'error1 绗�'+i+'琛屾暟鎹嫓璁夸汉SF涓嶅瓨鍦�';
- error += '=';
- }
- }else {
- error += 'error1 绗�'+i+'琛屾暟鎹嫓璁夸汉AWS涓嶅瓨鍦�';
- error += '=';
- }
- fileStr += filelist.toString();
- fileStr += '\n';
->>>>>>> LEXCommunityLiJun
}
},
-<<<<<<< HEAD
productcategoryChange1: function (component, event, helper) {
var product_category_id = component
.find('select_Product1')
@@ -5724,373 +3511,6 @@
}
//zhj 瀵煎嚭閿欒淇℃伅 2023-05-16 end
-=======
- if (error != '') {
- console.log('zhj error = ' + error);
- let errorArray = error.split('error1');
- let errorDatas = [];
- let errorDataRow = [];
- 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 index = errorDataRow.indexOf(errorArray[i].trim().substring(1, 2));
- if (index == -1) {
- 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] + '涓嶅瓨鍦�';
- }
- 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);
- }
- }
- }
- }
- 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 }
- ];
- 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));
- 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))
- component.set('v.errorColumns', errorColumns);
- component.set('v.errorData', errorDatas);
- 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);
- return;
- }
-
- 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';
- //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','娲诲姩鍖哄垎','缁撴灉','鏀彺闇�姹�']
- csvStringResult = '';
- csvStringResult += thkeys.join(columnDivider);
- csvStringResult += lineDivider;
- console.log("杩涘叆瀵煎嚭helper");
- for(var i=0; i < objectRecords.length; i++){
- counter = 0;
- for(var sTempkey in keys) {
- var skey = keys[sTempkey];
- if(counter > 0){
- csvStringResult += columnDivider;
- }
- 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+'"';
- }
- 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("瀵煎嚭寰幆缁撴潫");
- csvStringResult += lineDivider;
- }// 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>';
- }
- 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);
- var skey = keys[sTempkey];
- 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>';
- }
- } // 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);
- },
-
- 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('杈撳叆鐨勫紑濮嬫棩鏈�1');
- action.setParams({
- date1 : reportsdate1,
- date2: reportsdate2
- });
- console.log('杈撳叆鐨勫紑濮嬫棩鏈�2');
- action.setCallback(this, function(response) {
- var state = response.getState();
- if (state === "SUCCESS") {
-
- var res = response.getReturnValue();
- console.log('杈撳叆鐨勫紑濮嬫棩鏈�3'+res);
- component.set('v.loginEdit',false);
-
- // PI 鏀归�� By Bright 20220328
- if(true){
- let awsids = [];
- for (let ri in res) {
- 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 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;
-
- }
- }
- }
- helper.showExportDate(component, res);
-
- component.set('v.loginEdit', false);
- }, awsurl.token);
- }else{
- helper.showExportDate(component, res);
- }
- }
-
-
- component.set('v.reports_date', res);
-
- }else{
- alert('瀵煎嚭澶辫触,璇锋鏌ユ椿鍔ㄦ棩');
- component.set('v.loginEdit',false);
- }
- });
- $A.enqueueAction(action);
-
- },
-
- 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');
- },
-
- 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');
- },
-
- 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');
- },
-
- 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');
- },
-
- //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){
- action.setParams(para);
- }
- if(callback){
- action.setCallback(this,function(data){
- callback(data);
- });
- }
-
- $A.enqueueAction(action);
- },
- //zhj MEBG鏂版柟妗堟敼閫� 2022-11-29 end
-
- //zhj 瀵煎嚭閿欒淇℃伅 2023-05-16 start
- exportErrorInfoHelper: function (component) {
- var errorData = component.get('v.errorData');
- var errorColumns = component.get('v.errorColumns');
-
- var datas = [];
- let errorColumnsArray = [];
- for(var i in errorColumns){
- errorColumnsArray.push(errorColumns[i].label);
- }
- datas.push(errorColumnsArray);
- //datas.push(errorColumns);
-
- 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])
- }
- datas.push(data);
- }
-
- console.log('datas = ' + JSON.stringify(datas));
- var csv = this.convertToCSV(component, datas);
- console.log('csv = ' + JSON.stringify(csv))
- this.downloadCSV(component, csv);
- },
-
- convertToCSV: function (component, data) {
- console.log('enter convertToCSV')
- console.log('data = ' + data);
- var csv = '';
- for (var i = 0; i < data.length; i++) {
- var row = data[i];
- console.log('row = ' + JSON.stringify(row));
- for (var j = 0; j < row.length; j++) {
- var val = '';
- val = row[j] === null ? '' : row[j].toString();
- console.log('val = ' + val);
- if (val.indexOf(',') !== -1 || val.indexOf('"') !== -1 || val.indexOf('\n') !== -1) {
- //val = '"' + val.replace(/"/g,'""') + '"';
- }
- if (j > 0) {
- csv += ',';
- }
- csv += val;
- }
- csv += '\n';
- }
- return csv;
- },
-
- downloadCSV: function (component, csv) {
- var link = document.createElement('a');
- // 璁剧疆瀛楃闆嗗拰鏂囦欢澶�
- 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
-
->>>>>>> LEXCommunityLiJun
// searchAgencyContact : function(res) {
// var agencyContacts = [];
// for (let idx = 0; idx < res.length; idx++) {
@@ -6125,8 +3545,4 @@
// var data = this.search(searchUrl,data,token);
// return data;searchUrl,requestSearchPayload,token
// },
-<<<<<<< HEAD
});
-=======
-})
->>>>>>> LEXCommunityLiJun
diff --git a/force-app/main/default/classes/ArriveGoodsController.cls b/force-app/main/default/classes/ArriveGoodsController.cls
index 7a886e6..f3c692a 100644
--- a/force-app/main/default/classes/ArriveGoodsController.cls
+++ b/force-app/main/default/classes/ArriveGoodsController.cls
@@ -10,7 +10,6 @@
//鏇存柊鏄庣粏鍙栨秷鏃堕棿
public List<Consumable_order_details2__c> consumableorderdetails2Cancle = new List<Consumable_order_details2__c>();
// 鏇存柊鍊熻皟淇℃伅 add by gzw 2020-0-415 start
-<<<<<<< HEAD
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>();
@@ -19,16 +18,6 @@
public transient List<ConsumableorderdetailsInfo> ConsumableorderdetailsRecordsdummy { get; set; }
public List<ConsumableorderdetailsInfo> ShowGoodsofReturnList { get; set; }
public List<ConsumableorderdetailsInfo> ShowGoodsofRemoveBoxReturnList { get; set; }
-=======
- 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<ConsumableorderdetailsInfo> ConsumableorderdetailsRecordserror { get; set; }
- public transient List<ConsumableorderdetailsInfo> ConsumableorderdetailsRecordsdummy { get; set; }
- public List<ConsumableorderdetailsInfo> ShowGoodsofReturnList{get;set;}
- public List<ConsumableorderdetailsInfo> ShowGoodsofRemoveBoxReturnList{get;set;}
->>>>>>> LEXCommunityLiJun
//add by rentx 20210602 CHAN-C3K4ZQ
public List<List<ConsumableorderdetailsInfo>> consumableorderdetailsRecordsview { get; set; }
//add by rentx 20210602 CHAN-C3K4ZQ
@@ -37,19 +26,11 @@
//瓒呭嚭瀹氳揣鏁伴噺鐨勪骇鍝�
public List<String> cancellationProList = new List<String>();
//閿欒淇℃伅
-<<<<<<< HEAD
public String alertMessage { get; set; }
public integer getinventorysize() {
return consumableInventory.size();
}
public integer geterrorsize() {
-=======
- public String alertMessage {set;get;}
- public integer getinventorysize(){
- return consumableInventory.size();
- }
- public integer geterrorsize(){
->>>>>>> LEXCommunityLiJun
return ConsumableorderdetailsRecordserror.size();
}
Set<String> noboxBarcodeList = new Set<String>();
@@ -70,7 +51,6 @@
Map<String, Decimal> overOrderCunMap = new Map<String, Decimal>();
//瓒呭嚭BARCODE鍜屽瀷鍙�
Map<String, List<String>> overOrderBARcodeCunMap = new Map<String, List<String>>();
-<<<<<<< HEAD
list<String> overOrderBARcodeTTTTTT = new List<String>();
//涓嶇鍚堢殑barcode鍜屽瀷鍙�
@@ -78,20 +58,10 @@
list<String> overOrderBARcodeSSSSSS = new List<String>();
list<String> productList = new List<String>();
list<String> notInlist = 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>();
->>>>>>> LEXCommunityLiJun
//涓嶉�夋嫨璁㈠崟鏃朵繚瀛樿鍗旾D銆佷骇鍝佸瀷鍙风敤
//List<String> orderId = new List<String>();
//List<String> prodName = new List<String>();
//搴撳瓨鐧诲綍浣跨敤
-<<<<<<< HEAD
list<String> notInStorelist = new List<String>();
list<String> exitBarCodeList = new List<String>();
@@ -106,49 +76,21 @@
//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;
+ //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;
-=======
- 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>();
- List<String> HosErrorList = new List<String>();
- public String baseUrl {get;private set;}
- public String ESetId { get; set; }
- public String arriveId = '';
- private String accountid = null;
- private String accountName = null;
- //public String[] proidList =new String[]{};
- public Decimal orderCountAll = 0;
- public Decimal orderCountNotarrive = 0;
- //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;
-
->>>>>>> LEXCommunityLiJun
//鐢ㄦ埛浜у搧鍖哄垎
public String userPro_Typestr = null;
public String userPro_Type = null;
public String product_Type = null;
public Boolean EngFlag = false;
public Boolean ETFlag = false;
-<<<<<<< HEAD
- public ArriveGoodsController() {
-=======
//LWC:Lwcflag鍜屾姤閿欐彁閱� update by Link 2023-04-27
public Boolean isLwc = false;
@@ -157,8 +99,7 @@
public List<String> errorList;
public String urlType;
- public ArriveGoodsController(){
->>>>>>> LEXCommunityLiJun
+ public ArriveGoodsController() {
baseUrl = URL.getSalesforceBaseUrl().toExternalForm();
ESetId = ApexPages.currentPage().getParameters().get('esetId');
ArrType = ApexPages.currentPage().getParameters().get('ArrType');
@@ -169,7 +110,6 @@
consumableorderdetailsRecordsUse = new List<ConsumableorderdetailsInfo>();
consumableInventoryUse = new List<ConsumableorderdetailsInfo>();
consumableorderdetails2Cancle = new List<Consumable_order_details2__c>();
-<<<<<<< HEAD
orderdetails2trMap = new Map<String, Consumable_order_details2__c>();
detailsSummary = new List<ConsumableorderdetailsInfo>();
saveFLGbln = false;
@@ -180,24 +120,8 @@
// OrderAllMap = new Map<String, String>();
}
- //add by rentx 20210602 CHAN-C3K4ZQ start 鍑洪敊鐨勫師鍥犳槸椤甸潰鏈�澶氬睍绀�1000鏉℃暟鎹�,浣嗘槸闇�瑕佸睍绀虹殑鏁版嵁瓒呰繃浜�1000鏉�,鐜板湪鎶婂睍绀轰笂绾挎敼涓�1000 * 1000
- public void makeRecordsView(List<ConsumableorderdetailsInfo> recordsdummy) {
- consumableorderdetailsRecordsview = new List<List<ConsumableorderdetailsInfo>>();
-
- if (recordsdummy.size() > 1000) {
-=======
- orderdetails2trMap = new Map<String,Consumable_order_details2__c>();
- detailsSummary = new List<ConsumableorderdetailsInfo>();
- saveFLGbln = FALSE;
- //overOrderBARcodeTTTTTT.add('');
- //add by rentx 20210602 CHAN-C3K4ZQ start
- consumableorderdetailsRecordsview = new List<List<ConsumableorderdetailsInfo>>();
- //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){
+ public ArriveGoodsController(String eSetId, String arrType) {
this.ESetId = eSetId;
this.ArrType = arrType;
ConsumableorderdetailsRecords = new List<ConsumableorderdetailsInfo>();
@@ -207,9 +131,9 @@
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;
consumableorderdetailsRecordsview = new List<List<ConsumableorderdetailsInfo>>();
noboxBarcodeList = new Set<String>();
//LWC:Lwcflag鍜屾姤閿欐彁閱� update by Link 2023-04-27
@@ -220,11 +144,10 @@
}
//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){
->>>>>>> LEXCommunityLiJun
+ if (recordsdummy.size() > 1000) {
List<ConsumableorderdetailsInfo> ConsumableorderdetailsRecordsbreak = new List<ConsumableorderdetailsInfo>();
List<ConsumableorderdetailsInfo> ConsumableorderdetailsRecordsbreakover = new List<ConsumableorderdetailsInfo>();
ConsumableorderdetailsInfo c = null;
@@ -234,32 +157,19 @@
//閫夋嫨浜у搧view
ConsumableorderdetailsRecordsbreak = new List<ConsumableorderdetailsInfo>();
ConsumableorderdetailsRecordsbreakover = new List<ConsumableorderdetailsInfo>();
-<<<<<<< HEAD
if (recordsdummy.size() > 1000) {
for (Integer i = 0; i < recordsdummy.size(); i++) {
if (i < 1000) {
c = recordsdummy.get(i);
ConsumableorderdetailsRecordsbreak.add(c);
} else {
-=======
- if(recordsdummy.size() > 1000){
- for(Integer i = 0; i < recordsdummy.size(); i++){
- if(i < 1000){
- c = recordsdummy.get(i);
- ConsumableorderdetailsRecordsbreak.add(c);
- }else{
->>>>>>> LEXCommunityLiJun
c = recordsdummy.get(i);
ConsumableorderdetailsRecordsbreakover.add(c);
}
}
consumableorderdetailsRecordsview.add(ConsumableorderdetailsRecordsbreak);
consumableorderdetailsRecordsview.add(ConsumableorderdetailsRecordsbreakover);
-<<<<<<< HEAD
} else {
-=======
- }else{
->>>>>>> LEXCommunityLiJun
consumableorderdetailsRecordsview.add(recordsdummy);
}
@@ -282,7 +192,6 @@
// }
// consumableorderdetailsRecordsview.add(tempList);
// }
-<<<<<<< HEAD
} else {
consumableorderdetailsRecordsview.add(recordsdummy);
}
@@ -446,6 +355,16 @@
//========20160311======ADD_End==================================
//鑾峰彇鏄庣粏
public void SearchPro() {
+ //浠庝笅杈圭Щ涓婃潵 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>();
@@ -453,182 +372,15 @@
consumableInventoryUse = new List<ConsumableorderdetailsInfo>();
consumableorderdetails2Cancle = new List<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>();
//add by rentx 2021-01-27 end
-=======
- }else{
- consumableorderdetailsRecordsview.add(recordsdummy);
- }
- }
- //add by rentx 20210602 CHAN-C3K4ZQ end
- 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];
- accountid = Useracc[0].accountid;
- //--------AddStart-----XHL--------------20181008-------------
- userPro_Type = Useracc[0].UserPro_Type__c;
- if(String.isBlank(userPro_Type)){
- userPro_Type = 'ET';
- }
-
- if(userPro_Type == 'ENG'){
- product_Type = 'ET';
- EngFlag = true;
- }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];
- accountName = accountInfo[0].Name;
- system.debug('accountName'+ accountName);
- coc = new Consumable_order__c();
- if(ArrType=='ReG'){
- ReturnFLGbln = true;
- }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){
- 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];
- 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);
- //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 != '涓�' ];
- 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);
- }
- }
- //add by rentx 20210602 start CHAN-C3K4ZQ
- // makeRecordsView(ConsumableorderdetailsRecordsdummy);
- //add by rentx 20210602 end CHAN-C3K4ZQ
- }
- }
- //========20160311======ADD_Start================================
- // 灏嗛〉闈㈡垨鍙栧緱BarCode鍘绘帀閲嶅鐨勶紝杞崲鎴怢ist
- //========20160311======ADD_Start================================
- public List<String> ParseBarCode(String Code){
- String[] Cache = new String[]{};
- Cache = Code.split('\n');
- Set <String> Buff = new Set<String>();
- for(String A : Cache){
- Buff.add(A.toUpperCase());
- }
- List<String> outPut = new List<String>();
- for(String B :Buff){
- B = B.trim();
- if(B.length() > 8){
- String tracingCode = B.substring(B.length() - 5,B.length());
- barMcodeMap.put(B,tracingCode);
- }
- outPut.add(B);
- }system.debug('barMcodeMap绛変簬'+barMcodeMap);
- return outPut;
- }
-
-
- //========20160311======ADD_End==================================
- //鑾峰彇鏄庣粏
- public void SearchPro() {
- //浠庝笅杈圭Щ涓婃潵 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>();
- //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>();
- //add by rentx 2021-01-27 end
-
->>>>>>> LEXCommunityLiJun
noboxBarcodeList.clear();
//鍐嶆绱㈤」鐩竻绌�
ConsumableorderdetailsRecordserror = new List<ConsumableorderdetailsInfo>();
@@ -691,14 +443,19 @@
BarCodeListP = new List<String>();
BarCodeListP = ParseBarCode(barcode);
Consumable_order_details2__c p = new Consumable_order_details2__c();
-<<<<<<< HEAD
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
@@ -724,66 +481,25 @@
} else {
for (String str : barMcodeMap.keySet()) {
if (barMcodeMap.get(str) == reSet1[i].TracingCode__c) {
- ApexPages.addmessage(
- new ApexPages.message(
- ApexPages.severity.ERROR,
- str + ' 鐨勭鐞嗙紪鐮佸凡缁忓瓨鍦ㄤ簬绯荤粺鐨勫簱瀛樹腑锛岃纭杈撳叆淇℃伅鏄惁鏈夎銆�'
- )
- );
+ //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);
-=======
- 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>();
- //绉诲埌鏈�涓婅竟 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){
- for (Integer i = 0; i < reSet1.size(); i++) {
- if(ErrorIdMap.containsKey(reSet1[i].Bar_Code__c)){
- // 璺宠繃宸茬粡澶勭悊鐨勬秷鑰楀搧鏄庣粏
- continue;
- }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);
->>>>>>> LEXCommunityLiJun
}
}
}
}
}
//绠$悊缂栫爜涓虹┖鐨勪骇鍝�
-<<<<<<< HEAD
reSet1 = [
SELECT
Id,
@@ -820,36 +536,13 @@
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,
- 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){
- 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);
->>>>>>> LEXCommunityLiJun
}
}
}
//ApexPages.addmessage(new ApexPages.message(ApexPages.severity.INFO, '绠$悊缂栫爜涓虹┖鐨勪骇鍝� ' + ErrorIdMap));
//鏁翠綋鍒拌揣
-<<<<<<< HEAD
+ System.debug('EsetId===>' + EsetId);
+ System.debug('ArrType===>' + ArrType);
if (EsetId == null || EsetId == '') {
if (ArrType != 'ReG') {
//鍒拌揣浣嗕骇鍝佺被鍨嬩笌鐢ㄦ埛鐨勭被鍨嬩笉绗�
@@ -906,6 +599,56 @@
}
}
}
+ 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
@@ -950,118 +693,10 @@
}
ConsumableorderdetailsRecordserror.add(new ConsumableorderdetailsInfo(reSet1[i], str));
ErrorIdMap.put(reSet1[i].Bar_Code__c, reSet1[i].Bar_Code__c);
-=======
- 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 ];
-
- 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===>'+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){
- for (Integer i = 0; i < reSet1.size(); i++) {
- if(ErrorIdMap.containsKey(reSet1[i].Bar_Code__c)){
- // 璺宠繃宸茬粡澶勭悊鐨勬秷鑰楀搧鏄庣粏
- continue;
- }else{
- String str = '';
- if (reSet1[i].OwnerId == System.Label.User_OlympusSystem) {
- str = '璇ュ晢鍝佹槸鐩撮攢浜у搧璇峰厛杩斿搧';
- }else{
- str = '璇ュ晢鍝佸凡缁忛攢鍞�';
- }
- ConsumableorderdetailsRecordserror.add(new ConsumableorderdetailsInfo(reSet1[i],str));
- ErrorIdMap.put(reSet1[i].Bar_Code__c,reSet1[i].Bar_Code__c);
-
->>>>>>> LEXCommunityLiJun
}
}
}
//鍑哄簱浜у搧
-<<<<<<< HEAD
reSet1 = [
SELECT
Id,
@@ -1098,34 +733,10 @@
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 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 = '璇ュ晢鍝佸凡缁忓嚭搴�';
- ConsumableorderdetailsRecordserror.add(new ConsumableorderdetailsInfo(reSet1[i],str));
- ErrorIdMap.put(reSet1[i].Bar_Code__c,reSet1[i].Bar_Code__c);
->>>>>>> LEXCommunityLiJun
}
}
}
//宸插埌璐т骇鍝�
-<<<<<<< HEAD
reSet1 = [
SELECT
Id,
@@ -1166,38 +777,11 @@
}
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);
->>>>>>> LEXCommunityLiJun
}
}
}
//宸叉媶鐩掍骇鍝�
-<<<<<<< HEAD
reSet1 = [
SELECT
Id,
@@ -1235,36 +819,11 @@
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_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)){
- // 璺宠繃宸茬粡澶勭悊鐨勬秷鑰楀搧鏄庣粏
- continue;
- }else{
- String str = '宸叉媶鐩掔殑浜у搧涓嶈兘鍏ュ簱';
- ConsumableorderdetailsRecordserror.add(new ConsumableorderdetailsInfo(reSet1[i],str));
- ErrorIdMap.put(reSet1[i].Bar_Code__c,reSet1[i].Bar_Code__c);
->>>>>>> LEXCommunityLiJun
}
}
}
// 缁忛攢鍟嗕箣闂存垨鑰呭悓涓�缁忛攢鍟嗕笉鍚屽伐浣滃湴璋冭揣
-<<<<<<< HEAD
reSet1 = [
SELECT
Id,
@@ -1345,67 +904,12 @@
if (otherAgencyMap.containsKey(reSet1[i].Bar_Code__c)) {
continue;
} else {
-=======
- 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){
- for (Integer i = 0; i < reSet1.size(); i++) {
- if(ErrorIdMap.containsKey(reSet1[i].Bar_Code__c)){
- // 璺宠繃宸茬粡澶勭悊鐨勬秷鑰楀搧鏄庣粏
- continue;
- }else{
- if(otherAgencyMap.containsKey(reSet1[i].Bar_Code__c)){
- continue;
- }else{
->>>>>>> LEXCommunityLiJun
//鍏朵粬缁忛攢鍟嗗嚭搴撲骇鍝佸彲浠ュ叆搴�
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);
-<<<<<<< HEAD
if (reSet1[i].Lose_Flag__c == false) {
//&& reSet1[i].Dealer_Info_text__c == accountName
consumableorderdetails2Cancle.add(reSet1[i]);
@@ -1442,75 +946,27 @@
// 杩藉姞棣栨鍏ュ簱缁忛攢鍟� 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;
-=======
- 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)) {
- orderdetails2trMap.put(reSet1[i].Bar_Code__c, reSet1[i]);
- }
- // 鏇存柊鍊熻皟淇℃伅 add by gzw 2020-0-415 end
- 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;
- //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;
- // 鏇存柊鍊熻皟淇℃伅 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;
- // 鏇存柊鍊熻皟淇℃伅 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;
->>>>>>> LEXCommunityLiJun
// 杩藉姞棣栨鍏ュ簱缁忛攢鍟� 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)) {
-<<<<<<< HEAD
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;
->>>>>>> LEXCommunityLiJun
}
// update tcm end
//add by rentx 2020-10-13 end
//add by rentx 2021-03-22 start
// if (reSet1[i].Lose_Flag__c == true){
-<<<<<<< HEAD
if (reSet1[i].hospitalSpecialOffer__c == true && reSet1[i].SummonsForDirction_det__c == '浜掔浉璋冭揣') {
-=======
- if (reSet1[i].hospitalSpecialOffer__c == true && reSet1[i].SummonsForDirction_det__c == '浜掔浉璋冭揣'){
->>>>>>> LEXCommunityLiJun
codsIns.exchangeOutPattern__c = true;
}
//add by rentx 2021-03-22 end
consumableorderdetails2Insert.add(codsIns);
-<<<<<<< HEAD
otherAgencyMap.put(reSet1[i].Bar_Code__c, reSet1[i].Bar_Code__c);
-=======
- otherAgencyMap.put(reSet1[i].Bar_Code__c,reSet1[i].Bar_Code__c);
->>>>>>> LEXCommunityLiJun
//String str = '璇ュ晢鍝佸湪鍏朵粬缁忛攢鍟嗗簱瀛�';
//ConsumableorderdetailsRecordserror.add(new ConsumableorderdetailsInfo(reSet1[i],str));
//ErrorIdMap.put(reSet1[i].Bar_Code__c,reSet1[i].Bar_Code__c);
@@ -1519,7 +975,6 @@
}
}
-<<<<<<< HEAD
//鍙戦敊搴� 鏈埌璐�
reSet1 = [
SELECT
@@ -1595,58 +1050,6 @@
if (otherAgencyMap.containsKey(reSet1[i].Bar_Code__c)) {
continue;
} else {
-=======
- //鍙戦敊搴� 鏈埌璐�
- 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)){
- // 璺宠繃宸茬粡澶勭悊鐨勬秷鑰楀搧鏄庣粏
- continue;
- }else{
- if(otherAgencyMap.containsKey(reSet1[i].Bar_Code__c)){
- continue;
- }else{
->>>>>>> LEXCommunityLiJun
//鍙栨秷鏄庣粏
List<String> barcodedetList = new List<String>();
barcodedetList.add(reSet1[i].Bar_Code__c);
@@ -1655,7 +1058,6 @@
barcodedetList.add(reSet1[i].TracingCode__c);
// 鍙戦敊搴撳瓨鏃讹紝鑷姩鍙栨秷 update by gzw 2020-04-15 start
//if (reSet1[i].Consumable_order_minor__c == null) {
-<<<<<<< HEAD
consumableorderdetails2Cancle.add(reSet1[i]);
//}
// 鍙戦敊搴撳瓨鏃讹紝鑷姩鍙栨秷 update by gzw 2020-04-15 start
@@ -1690,80 +1092,31 @@
// 杩藉姞棣栨鍏ュ簱缁忛攢鍟� 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;
-=======
- 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)) {
-
- orderdetails2trMap.put(reSet1[i].Bar_Code__c, reSet1[i]);
- }
- // 鏇存柊鍊熻皟淇℃伅 add by gzw 2020-0-415 end
- 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;
- //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;
- // 鏇存柊鍊熻皟淇℃伅 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;
- // 鏇存柊鍊熻皟淇℃伅 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;
->>>>>>> LEXCommunityLiJun
// 杩藉姞棣栨鍏ュ簱缁忛攢鍟� 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)) {
-<<<<<<< HEAD
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;
->>>>>>> LEXCommunityLiJun
}
// 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){
-<<<<<<< HEAD
if (reSet1[i].hospitalSpecialOffer__c == true && reSet1[i].SummonsForDirction_det__c == '浜掔浉璋冭揣') {
-=======
- if (reSet1[i].hospitalSpecialOffer__c == true && reSet1[i].SummonsForDirction_det__c == '浜掔浉璋冭揣'){
->>>>>>> LEXCommunityLiJun
codsIns.exchangeOutPattern__c = true;
}
//add by rentx 2021-03-22 end
consumableorderdetails2Insert.add(codsIns);
-<<<<<<< HEAD
otherAgencyMap.put(reSet1[i].Bar_Code__c, reSet1[i].Bar_Code__c);
-=======
- otherAgencyMap.put(reSet1[i].Bar_Code__c,reSet1[i].Bar_Code__c);
->>>>>>> LEXCommunityLiJun
}
}
}
}
-<<<<<<< HEAD
} else {
//杩斿搧妫�鏌�
//鍒拌揣浣嗕骇鍝佺被鍨嬩笌鐢ㄦ埛鐨勭被鍨嬩笉绗�
@@ -1851,6 +1204,8 @@
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
@@ -1919,160 +1274,34 @@
// 璺宠繃宸茬粡澶勭悊鐨勬秷鑰楀搧鏄庣粏
continue;
} 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)
- 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(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,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){
- 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,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)){
- // 璺宠繃宸茬粡澶勭悊鐨勬秷鑰楀搧鏄庣粏
- continue;
- }else{
-
->>>>>>> LEXCommunityLiJun
// WYIN-BLZE48鐩樼偣涓㈠け浜у搧澧炲姞鍏ュ簱鏂瑰紡 update by vivek 2020-03-05 start
// String str = '璇ュ晢鍝佸湪搴�';
// if (reSet1[i].Lose_Flag__c) {
// str = '璇ュ晢鍝佷涪澶�';
// }
String str = '';
-<<<<<<< HEAD
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 == false){
- str = '璇ュ晢鍝佸湪搴�';//娌″嚭搴� 锛屾病閿�鍞紝娌′涪澶卞氨鏄湪搴撱��
- }
- 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 (isLwc) {
+ warningList.add('浜у搧' + reSet1[i].Consumable_Product__r.Name + '瀛樺湪涓㈠け璁板綍');
+ } else {
+ ApexPages.addmessage(
+ new ApexPages.message(
+ ApexPages.severity.WARNING,
+ '浜у搧' + reSet1[i].Consumable_Product__r.Name + '瀛樺湪涓㈠け璁板綍'
+ )
+ ); //濡傛灉涓㈠け浜у搧灏辩粰鎻愮ず銆�
}
->>>>>>> LEXCommunityLiJun
}
if (reSet1[i].Lose_Flag__c == true && reSet1[i].ToDueDateDays__c < 0) {
str = '杩囨湡宸查攢瀛樹骇鍝侊紝涓嶅厑璁歌繑鍝�';
}
-<<<<<<< HEAD
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);
->>>>>>> LEXCommunityLiJun
}
// ConsumableorderdetailsRecordserror.add(new ConsumableorderdetailsInfo(reSet1[i],str));
// ErrorIdMap.put(reSet1[i].Bar_Code__c,reSet1[i].Bar_Code__c);
@@ -2082,7 +1311,6 @@
}
}
-<<<<<<< HEAD
//鍒拌揣姝g‘淇℃伅
reSet = [
SELECT
@@ -2145,88 +1373,18 @@
} 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);
- continue;
- }
- if (otherAgencyMap.containsKey(reSet[i].Bar_Code__c)) {
- for (Integer j = 0; j < consumableInventory.size(); j++) {
-=======
-
-
-
- //鍒拌揣姝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 ];
-
- if(reSet.size()>0){
- //ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR,'ErrorIdMap+++ '+ ErrorIdMap.keyset()));
- 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)){
- // 璺宠繃宸茬粡澶勭悊鐨勬秷鑰楀搧鏄庣粏
- continue;
- }else{
- Matcher n = Pattern.compile('[0-9]').matcher(reSet[i].TracingCode__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);
+ 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;
- }
+ 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));
@@ -2234,20 +1392,15 @@
// continue;
// gzw DB202305352696 鍏ュ簱绠$悊缂栫爜楠岃瘉绋嬪簭璋冩暣 end
}
- if(otherAgencyMap.containsKey(reSet[i].Bar_Code__c)){
- for (Integer j=0; j<consumableInventory.size(); j++) {
->>>>>>> LEXCommunityLiJun
+ 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;
}
}
-<<<<<<< HEAD
for (Integer m = 0; m < consumableorderdetails2Insert.size(); m++) {
-=======
- for (Integer m=0; m<consumableorderdetails2Insert.size(); m++) {
->>>>>>> LEXCommunityLiJun
Consumable_order_details2__c cod2 = consumableorderdetails2Insert.get(m);
if (cod2.Bar_Code__c == reSet[i].Bar_Code__c) {
consumableorderdetails2Insert.remove(m);
@@ -2259,16 +1412,11 @@
//prodName.add(reSet[i].Consumable_Product__r.Name);
ConsumableorderdetailsRecordsdummy.add(new ConsumableorderdetailsInfo(reSet[i]));
ConsumableorderdetailsRecords.add(new ConsumableorderdetailsInfo(reSet[i]));
-<<<<<<< HEAD
ExistIdMap.put(reSet[i].Bar_Code__c, reSet[i].Bar_Code__c);
-=======
- ExistIdMap.put(reSet[i].Bar_Code__c,reSet[i].Bar_Code__c);
->>>>>>> LEXCommunityLiJun
}
}
}
//barcode涓嶄竴鑷达紝绠$悊缂栫爜涓�鑷�
-<<<<<<< HEAD
reSet = [
SELECT
Id,
@@ -2329,93 +1477,18 @@
} 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);
- 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) {
- reSet[i].Bar_Code__c = str;
- //=====================================
- // ApexPages.addmessage(new ApexPages.message(ApexPages.severity.WARNING,'鍏ュ簱BarCode('+ str +')鍜屽簱瀛樻潯鐮佷笉涓�鑷淬��'));
- ExistIdMap.put(str, str);
-=======
- 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){
- for (Integer i = 0; i < reSet.size(); i++) {
- if(ExistIdMap.containsKey(reSet[i].Bar_Code__c) || ErrorIdMap.containsKey(reSet[i].Bar_Code__c)){
- // 璺宠繃宸茬粡澶勭悊鐨勬秷鑰楀搧鏄庣粏
- continue;
- }else{
- Matcher n = Pattern.compile('[0-9]').matcher(reSet[i].TracingCode__c);
- if(n.find()){// gzw DB202305352696 鍏ュ簱绠$悊缂栫爜楠岃瘉绋嬪簭璋冩暣 start
+ // 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);
+ 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;
- }
+ 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));
@@ -2423,26 +1496,27 @@
// continue;
// gzw DB202305352696 鍏ュ簱绠$悊缂栫爜楠岃瘉绋嬪簭璋冩暣 end
}
- ExistIdMap.put(reSet[i].Bar_Code__c,reSet[i].Bar_Code__c);
- for(String str : barMcodeMap.keySet()){
+ 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)){
+ 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 {
+ 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 +')鐨勫叆搴撴暟鎹笌鍙戣揣鏁版嵁涓嶄竴鑷�'));
+ ApexPages.addmessage(
+ new ApexPages.message(ApexPages.severity.WARNING, '鏉″舰鐮佷负(' + str + ')鐨勫叆搴撴暟鎹笌鍙戣揣鏁版嵁涓嶄竴鑷�')
+ );
// 20220815 ljh SWAG-CH65B7 end
}
}
- if(barMcodeMap.get(str) == reSet[i].TracingCode__c){
+ 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);
->>>>>>> LEXCommunityLiJun
+ ExistIdMap.put(str, str);
}
}
ConsumableorderdetailsRecordsdummy.add(new ConsumableorderdetailsInfo(reSet[i]));
@@ -2451,7 +1525,6 @@
}
}
-<<<<<<< HEAD
// CHAN-BD43NK 鍏抽棴鐩存帴杩斿搧鍔熻兘 杩藉姞 barcode涓嶄竴鑷村垽鏂�
reSet1 = [
SELECT Id, Name, TracingCode__c, Bar_Code__c, Sale_orderName__c, Report_Product_Expiration__c
@@ -2474,73 +1547,44 @@
} else {
for (String str : barMcodeMap.keySet()) {
if (barMcodeMap.get(str) == reSet1[i].TracingCode__c) {
- ApexPages.addmessage(
- new ApexPages.message(
- ApexPages.severity.ERROR,
+ //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);
-=======
-
- // 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){
- for (Integer i = 0; i < reSet1.size(); i++) {
- if(ErrorIdMap.containsKey(reSet1[i].Bar_Code__c)){
- // 璺宠繃宸茬粡澶勭悊鐨勬秷鑰楀搧鏄庣粏
- continue;
- }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);
->>>>>>> LEXCommunityLiJun
}
}
}
}
}
-<<<<<<< HEAD
integer RGcnt = GoodsReturnCheck();
AllMap.putAll(ErrorIdMap);
AllMap.putAll(ExistIdMap);
if (RGcnt > 0) {
for (String str : GrList) {
AllMap.put(str, str);
-=======
- integer RGcnt = GoodsReturnCheck();
- AllMap.putAll(ErrorIdMap);
- AllMap.putAll(ExistIdMap);
- if(RGcnt>0){
- for(String str:GrList){
- AllMap.put(str,str);
->>>>>>> LEXCommunityLiJun
}
}
//寰楀埌涓嶅瓨鍦ㄧ殑BarCode
//return;
-<<<<<<< HEAD
for (Integer i = 0; i < BarCodeListP.size(); i++) {
if (AllMap.containsKey(BarCodeListP[i])) {
continue;
@@ -2549,21 +1593,10 @@
}
//add by rentx 2021-01-27 start
else if (coc != null && coc.orderPattern__c == 'hospitalorder') {
-=======
- for(Integer i = 0; i < BarCodeListP.size(); i++){
- if(AllMap.containsKey(BarCodeListP[i])){
- continue;
- }else if(otherAgencyMap.containsKey(BarCodeListP[i])){
- continue;
- }
- //add by rentx 2021-01-27 start
- else if (coc!= null && coc.orderPattern__c == 'hospitalorder') {
->>>>>>> LEXCommunityLiJun
HosErrorList.add(BarCodeListP[i]);
continue;
}
//add by rentx 2021-01-27 end
-<<<<<<< HEAD
else {
notInlist.add(BarCodeListP[i]);
otherAgencyMap.put(BarCodeListP[i], BarCodeListP[i]);
@@ -2574,52 +1607,43 @@
if (ArrType != 'ReG') {
inventoryEntryNoESetId(notInlist);
if (notInStorelist.size() > 0) {
- ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR, 'BarCode鍙�' + notInStorelist + '涓嶅瓨鍦ㄣ��'));
- return;
- }
- } else {
- ApexPages.addmessage(
- new ApexPages.message(
- ApexPages.severity.ERROR,
- 'BarCode鍙�' + notInlist + '涓嶅瓨鍦紝鏃犲搴旂殑鍑哄簱鍗曪紝璇峰厛鎿嶄綔浜у搧鍏ュ簱銆�'
- )
- );
-=======
- else{
- notInlist.add(BarCodeListP[i]);
- otherAgencyMap.put(BarCodeListP[i],BarCodeListP[i]);
- }
- }
- // CHAN-BD43NK 鍏抽棴鐩存帴杩斿搧鍔熻兘
- if(notInlist.size()>0){
- if(ArrType!='ReG'){
- inventoryEntryNoESetId(notInlist);
- 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 + '涓嶅瓨鍦ㄣ��'));
+ if (isLwc) {
+ returnError = 'BarCode鍙�' + notInStorelist + '涓嶅瓨鍦�';
+ } else {
+ ApexPages.addmessage(
+ new ApexPages.message(ApexPages.severity.ERROR, 'BarCode鍙�' + notInStorelist + '涓嶅瓨鍦ㄣ��')
+ );
}
return;
}
- }else{
+ } 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 + '涓嶅瓨鍦紝鏃犲搴旂殑鍑哄簱鍗曪紝璇峰厛鎿嶄綔浜у搧鍏ュ簱銆�'));
+ if (isLwc) {
+ returnError = 'BarCode鍙�' + notInlist + '涓嶅瓨鍦紝鏃犲搴旂殑鍑哄簱鍗曪紝璇峰厛鎿嶄綔浜у搧鍏ュ簱';
+ } else {
+ ApexPages.addmessage(
+ new ApexPages.message(
+ ApexPages.severity.ERROR,
+ 'BarCode鍙�' + notInlist + '涓嶅瓨鍦紝鏃犲搴旂殑鍑哄簱鍗曪紝璇峰厛鎿嶄綔浜у搧鍏ュ簱銆�'
+ )
+ );
}
->>>>>>> LEXCommunityLiJun
return;
}
}
-<<<<<<< HEAD
//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) + ''));
+ //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
@@ -2937,10 +1961,24 @@
} 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);
- continue;
+ // 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]));
@@ -3003,335 +2041,30 @@
} 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);
- continue;
+ // 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
}
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);
-=======
- //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 = '璇ュ晢鍝佸凡缁忎涪澶�';
- }
- 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);
- }
- }
- }
-
- //鍒拌揣姝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>();
- for (Integer i = 0; i < reSet.size(); i++) {
- if(ExistIdMap.containsKey(reSet[i].Bar_Code__c) || ErrorIdMap.containsKey(reSet[i].Bar_Code__c)){
- // 璺宠繃宸茬粡澶勭悊鐨勬秷鑰楀搧鏄庣粏
- continue;
- }else{
- Matcher n = Pattern.compile('[0-9]').matcher(reSet[i].TracingCode__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);
- }
- }
- }
-
- //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){
- for (Integer i = 0; i < reSet.size(); i++) {
- if(ExistIdMap.containsKey(reSet[i].Bar_Code__c) || ErrorIdMap.containsKey(reSet[i].Bar_Code__c)){
- // 璺宠繃宸茬粡澶勭悊鐨勬秷鑰楀搧鏄庣粏
- continue;
- }else{
- Matcher n = Pattern.compile('[0-9]').matcher(reSet[i].TracingCode__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
- }
- 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);
->>>>>>> LEXCommunityLiJun
}
}
ConsumableorderdetailsRecordsdummy.add(new ConsumableorderdetailsInfo(reSet[i]));
@@ -3342,7 +2075,6 @@
AllMap.putAll(ErrorIdMap);
AllMap.putAll(ExistIdMap);
//寰楀埌涓嶅瓨鍦ㄧ殑BarCode
-<<<<<<< HEAD
for (Integer i = 0; i < BarCodeListP.size(); i++) {
if (AllMap.containsKey(BarCodeListP[i])) {
continue;
@@ -3363,36 +2095,12 @@
if (notInlist.size() > 0) {
inventoryEntry(notInlist);
if (notInStorelist.size() > 0) {
- ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR, 'BarCode鍙�' + notInStorelist + '涓嶅瓨鍦ㄣ��'));
-=======
- for(Integer i = 0; i < BarCodeListP.size(); i++){
- if(AllMap.containsKey(BarCodeListP[i])){
- continue;
- }else if(otherAgencyMap.containsKey(BarCodeListP[i])){
- continue;
- }
- //add by rentx 2021-01-27 start
- else if (coc!= null && coc.orderPattern__c == 'hospitalorder') {
- HosErrorList.add(BarCodeListP[i]);
- continue;
-
- }
- //add by rentx 2021-01-27 end
- else{
- notInlist.add(BarCodeListP[i]);
- otherAgencyMap.put(BarCodeListP[i],BarCodeListP[i]);
- }
- }
- if(notInlist.size()>0){
- inventoryEntry(notInlist);
- 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 + '涓嶅瓨鍦ㄣ��'));
+ if (isLwc) {
+ returnError = 'BarCode鍙�' + notInStorelist + '涓嶅瓨鍦�';
+ } else {
+ ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR, 'BarCode鍙�' + notInStorelist + '涓嶅瓨鍦ㄣ��'));
}
->>>>>>> LEXCommunityLiJun
return;
}
}
@@ -3401,44 +2109,29 @@
//add by rentx 2021-01-27 start 褰撹鍗曚负鍖婚櫌鐗逛环绫诲瀷鐨勮鍗曟椂,濡傛灉鎵句笉鍒癰arcode,涓嶈В鏋�,骞朵笖榛樿璇arcode瀵瑰簲鐨勬槑缁�2涓洪潪鍖婚櫌鐗逛环浜у搧,鐩存帴鎶ラ敊
if (HosErrorList.size() > 0) {
for (String str : HosErrorList) {
-<<<<<<< HEAD
- 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 +'鏄潪鍖婚櫌鐗逛环浜у搧'));
+ if (isLwc) {
+ errorList.add('BarCode鍙�:' + str + '鏄潪鍖婚櫌鐗逛环浜у搧');
+ } else {
+ ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR, 'BarCode鍙�:' + str + '鏄潪鍖婚櫌鐗逛环浜у搧'));
}
-
->>>>>>> LEXCommunityLiJun
}
}
//add by rentx 2021-01-27 end
makeArrivedSummary();
-<<<<<<< HEAD
-=======
-
->>>>>>> LEXCommunityLiJun
//add by rentx 20210602 start CHAN-C3K4ZQ
makeRecordsView(ConsumableorderdetailsRecordsdummy);
//add by rentx 20210602 end CHAN-C3K4ZQ
}
-<<<<<<< HEAD
public void inventoryEntryNoESetId(List<String> barCodeList) {
-=======
-
- public void inventoryEntryNoESetId (List<String> barCodeList){
->>>>>>> LEXCommunityLiJun
//鎵�鏈塨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>();
-<<<<<<< HEAD
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>>();
@@ -3446,71 +2139,59 @@
notInStorelist.clear();
for (Integer i = 0; i < barCodeList.size(); i++) {
Date expirationDate = null;
-=======
- 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 ;
->>>>>>> LEXCommunityLiJun
String serialNoorLotNo = '';
String tracingCode = '';
String productDateStr = '';
- Date productionDate = null ;
+ Date productionDate = null;
String expirationDateStr = '';
-<<<<<<< HEAD
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锛屼笉绗﹀悎瑕佹眰閿欒锛�'
- )
- );
- continue;
- } else {
-=======
- 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){
//LWC:Lwcflag鍜屾姤閿欐彁閱� update by Link 2023-04-27
- if(isLwc){
+ if (isLwc) {
errorList.add('浜у搧BarCode(' + barCodeList[i] + ')鐨勪綅鏁颁笉瓒�16锛屼笉绗﹀悎瑕佹眰閿欒锛�');
- }else {
- ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR,'浜у搧BarCode(' + barCodeList[i] + ')鐨勪綅鏁颁笉瓒�16锛屼笉绗﹀悎瑕佹眰閿欒锛�'));
+ } else {
+ ApexPages.addmessage(
+ new ApexPages.message(
+ ApexPages.severity.ERROR,
+ '浜у搧BarCode(' + barCodeList[i] + ')鐨勪綅鏁颁笉瓒�16锛屼笉绗﹀悎瑕佹眰閿欒锛�'
+ )
+ );
}
continue;
- }else {
->>>>>>> LEXCommunityLiJun
+ } else {
//if(barCodeList[i].substring(0,2) !='01'){
// ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR,'浜у搧BarCode(' + barCodeList[i] + ')娌℃湁janCode锛屼笉绗﹀悎瑕佹眰锛�'));
// return;
//}
-<<<<<<< HEAD
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閿欒锛�')
- );
+ //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] + ')娌℃湁绠$悊缂栫爜锛�')
- );
+ //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') {
@@ -3518,12 +2199,17 @@
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 + '閿欒锛�'
- )
- );
+ //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) {
@@ -3550,12 +2236,19 @@
expirationDate = Date.valueOf(expirationDateStr);
}
} catch (Exception e) {
- ApexPages.addmessage(
- new ApexPages.message(
- ApexPages.severity.ERROR,
+ //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) {
@@ -3590,12 +2283,17 @@
expirationDate = Date.valueOf(expirationDateStr);
}
} catch (Exception e) {
- ApexPages.addmessage(
- new ApexPages.message(
- ApexPages.severity.ERROR,
- '浜у搧BarCode(' + barCodeList[i] + ')鐨勬粎鑿屾湁鍔规湡闄�' + expirationDateStr + '閿欒锛�'
- )
- );
+ //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) {
@@ -3617,148 +2315,41 @@
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;
- }
- } else {
- ApexPages.addmessage(
- new ApexPages.message(ApexPages.severity.ERROR, '浜у搧BarCode(' + barCodeList[i] + ')鐨則racingCode閿欒锛�')
- );
-=======
- 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'){
- //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' ;
- productionDate = Date.valueOf(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' ;
- 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);
- }
- }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) ;
- }
- }
- }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';
- //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);
- expirationDate = Date.valueOf(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) ;
- }
- }
-
- }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());
- 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);
+ 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;
+ if (isLwc) {
+ errorList.add('浜у搧BarCode(' + barCodeList[i] + ')绠$悊缂栫爜鏈夎锛岃妫�鏌ユ潯褰㈢爜鏁版嵁銆�');
+ } else {
+ ApexPages.addmessage(
+ new ApexPages.message(
+ ApexPages.severity.ERROR,
+ '浜у搧BarCode(' + barCodeList[i] + ')绠$悊缂栫爜鏈夎锛岃妫�鏌ユ潯褰㈢爜鏁版嵁銆�'
+ )
+ );
+ }
+ continue;
}
}
}
- }else{
+ } else {
//LWC:Lwcflag鍜屾姤閿欐彁閱� update by Link 2023-04-27
- if(isLwc){
+ if (isLwc) {
errorList.add('浜у搧BarCode(' + barCodeList[i] + ')鐨則racingCode閿欒锛�');
- }else {
- ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR,'浜у搧BarCode(' + barCodeList[i] + ')鐨則racingCode閿欒锛�'));
+ } else {
+ ApexPages.addmessage(
+ new ApexPages.message(
+ ApexPages.severity.ERROR,
+ '浜у搧BarCode(' + barCodeList[i] + ')鐨則racingCode閿欒锛�'
+ )
+ );
}
->>>>>>> LEXCommunityLiJun
continue;
}
}
@@ -3767,7 +2358,6 @@
barcodedetList.add(String.valueOf(expirationDate));
barcodedetList.add(serialNoorLotNo);
barcodedetList.add(tracingCode);
-<<<<<<< HEAD
Integer jan1 = Integer.valueOf(janCodeMark.substring(0, 1));
Integer jan2 = Integer.valueOf(janCodeMark.substring(1, 2));
Integer jan3 = Integer.valueOf(janCodeMark.substring(2, 3));
@@ -3777,23 +2367,11 @@
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));
->>>>>>> LEXCommunityLiJun
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));
-<<<<<<< HEAD
Integer count12 =
jan2 +
jan3 * 3 +
@@ -3828,21 +2406,11 @@
.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);
-=======
- 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);
->>>>>>> LEXCommunityLiJun
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);
-<<<<<<< HEAD
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]);
@@ -3856,20 +2424,30 @@
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] + ')娌℃湁绠$悊缂栫爜锛�')
- );
+ //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锛屼笉绗﹀悎瑕佹眰閿欒锛�'
- )
- );
+ //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);
@@ -3877,48 +2455,11 @@
String otCode6 = barCodeList[i].substring(3, 9);
String otCode7 = barCodeList[i].substring(3, 10);
String otCode8 = barCodeList[i].substring(3, 11);
-=======
- 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'){
- //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){
- //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);
->>>>>>> LEXCommunityLiJun
otCodeList.add(otCode4);
otCodeList.add(otCode5);
otCodeList.add(otCode6);
otCodeList.add(otCode7);
otCodeList.add(otCode8);
-<<<<<<< HEAD
otCodeMap.put(otCode4, barCodeList[i]);
otCodeMap.put(otCode5, barCodeList[i]);
otCodeMap.put(otCode6, barCodeList[i]);
@@ -3931,54 +2472,42 @@
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);
->>>>>>> LEXCommunityLiJun
otCodeList.add(otCode4);
otCodeList.add(otCode5);
otCodeList.add(otCode6);
otCodeList.add(otCode7);
otCodeList.add(otCode8);
otCodeList.add(otCode9);
-<<<<<<< HEAD
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]);
->>>>>>> LEXCommunityLiJun
}
allotCodeList.addAll(otCodeList);
barOtcodeMap.put(barCodeList[i], otCodeMap);
barCode241List.add(barCodeList[i]);
-<<<<<<< HEAD
+ } 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 {
+ //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] + ')涓嶇鍚堣姹傦紒'));
continue;
}
}
@@ -4027,12 +2556,19 @@
}
}
if (errorMap.size() > 0) {
- ApexPages.addmessage(
- new ApexPages.message(
- ApexPages.severity.ERROR,
+ //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 + ']涓嶇'
+ )
+ );
+ }
}
}
}
@@ -4066,12 +2602,17 @@
}
}
if (errorMap.size() > 0) {
- ApexPages.addmessage(
- new ApexPages.message(
- ApexPages.severity.ERROR,
- 'BarCode鍙穂' + errorMap.values() + ']浜у搧绫诲瀷[' + product_Type + ']涓庣敤鎴穂' + userPro_Type + ']绫诲瀷涓嶇'
- )
- );
+ //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
@@ -4110,12 +2651,17 @@
'-01';
productionDate = Date.valueOf(productDateStr);
} catch (Exception e) {
- ApexPages.addmessage(
- new ApexPages.message(
- ApexPages.severity.ERROR,
- '浜у搧BarCode(' + bar + ')鐨勭敓浜ф棩鏈�' + productDateStr + '閿欒锛�'
- )
- );
+ //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) {
@@ -4142,12 +2688,17 @@
expirationDate = Date.valueOf(expirationDateStr);
}
} catch (Exception e) {
- ApexPages.addmessage(
- new ApexPages.message(
- ApexPages.severity.ERROR,
- '浜у搧BarCode(' + bar + ')鐨勬粎鑿屾湁鍔规湡闄�' + expirationDateStr + '閿欒锛�'
- )
- );
+ //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) {
@@ -4189,12 +2740,17 @@
expirationDate = Date.valueOf(expirationDateStr);
}
} catch (Exception e) {
- ApexPages.addmessage(
- new ApexPages.message(
- ApexPages.severity.ERROR,
- '浜у搧BarCode(' + bar + ')鐨勬粎鑿屾湁鍔规湡闄�' + expirationDateStr + '閿欒锛�'
- )
- );
+ //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) {
@@ -4219,19 +2775,44 @@
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;
+ // 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閿欒锛�')
- );
+ //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;
}
}
@@ -4285,316 +2866,55 @@
for (Integer i = 0; i < barCodeList.size(); i++) {
Date expirationDate = null;
-=======
- }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{
- //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
- FROM Product2__c
- 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() ){
- 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)));
- 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)));
- rightBar.put(bar, bar);
- }else{
- errorMap.put(bar, bar);
- }
- }
-
- }
- if(cou <= 0 ){
- notInStorelist.add(bar);
- }
- }
- 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
- 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){
- //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
- 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 ;
- String expirationDateStr = '';
- 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){
- //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.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,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;
- }
- 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) ;
- }
- }
- }
- 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;
- }
- }
- 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);
- }
- }
- }
- }
-
- }
-
-
- 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>>();
- 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++){
- orderdetailMap.put(orderdetail[i].Consumable_Product__c, orderdetail[i].Consumable_Product__c);
- }
-
- for(Integer i = 0; i < barCodeList.size(); i++){
- Date expirationDate = null ;
->>>>>>> LEXCommunityLiJun
String serialNoorLotNo = '';
String tracingCode = '';
String productDateStr = '';
- Date productionDate = null ;
+ Date productionDate = null;
String expirationDateStr = '';
-<<<<<<< HEAD
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锛屼笉绗﹀悎瑕佹眰閿欒锛�')
- );
+ //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閿欒锛�')
- );
+ //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] + ')娌℃湁绠$悊缂栫爜锛�')
- );
+ //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') {
@@ -4602,12 +2922,17 @@
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 + '閿欒锛�'
- )
- );
+ //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) {
@@ -4634,12 +2959,17 @@
expirationDate = Date.valueOf(expirationDateStr);
}
} catch (Exception e) {
- ApexPages.addmessage(
- new ApexPages.message(
- ApexPages.severity.ERROR,
- '浜у搧BarCode(' + barCodeList[i] + ')鐨勬粎鑿屾湁鍔规湡闄�' + expirationDateStr + '閿欒锛�'
- )
- );
+ //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) {
@@ -4674,12 +3004,17 @@
expirationDate = Date.valueOf(expirationDateStr);
}
} catch (Exception e) {
- ApexPages.addmessage(
- new ApexPages.message(
- ApexPages.severity.ERROR,
- '浜у搧BarCode(' + barCodeList[i] + ')鐨勬粎鑿屾湁鍔规湡闄�' + expirationDateStr + '閿欒锛�'
- )
- );
+ //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) {
@@ -4701,150 +3036,26 @@
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;
- }
- } else {
- ApexPages.addmessage(
- new ApexPages.message(ApexPages.severity.ERROR, '浜у搧BarCode(' + barCodeList[i] + ')鐨則racingCode閿欒锛�')
- );
-=======
- if(barCodeList[i].substring(0,2) =='01'){
- String janCodeMark = '';
- //鐢熶骇鏃ユ湡
- List<String> janCode = new List<String>();
- 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){
- //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'){
- //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' ;
- productionDate = Date.valueOf(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' ;
- 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);
- }
- }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) ;
- }
- }
- }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';
- //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);
- expirationDate = Date.valueOf(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) ;
- }
- }
-
- }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());
- 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);
+ 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;
+ //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 = '绠$悊缂栫爜涓嶆纭紝璇蜂笌绠$悊鍛樼‘璁ゆ槸鍚﹂敊璇��';
@@ -4852,14 +3063,15 @@
// continue;
// gzw DB202305352696 鍏ュ簱绠$悊缂栫爜楠岃瘉绋嬪簭璋冩暣 end
}
- }else{
+ } else {
//LWC:Lwcflag鍜屾姤閿欐彁閱� update by Link 2023-04-27
- if(isLwc){
+ if (isLwc) {
errorList.add('浜у搧BarCode(' + barCodeList[i] + ')鐨則racingCode閿欒锛�');
- }else {
- ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR,'浜у搧BarCode(' + barCodeList[i] + ')鐨則racingCode閿欒锛�'));
+ } else {
+ ApexPages.addmessage(
+ new ApexPages.message(ApexPages.severity.ERROR, '浜у搧BarCode(' + barCodeList[i] + ')鐨則racingCode閿欒锛�')
+ );
}
->>>>>>> LEXCommunityLiJun
continue;
}
}
@@ -4868,7 +3080,6 @@
barcodedetList.add(String.valueOf(expirationDate));
barcodedetList.add(serialNoorLotNo);
barcodedetList.add(tracingCode);
-<<<<<<< HEAD
Integer jan1 = Integer.valueOf(janCodeMark.substring(0, 1));
Integer jan2 = Integer.valueOf(janCodeMark.substring(1, 2));
Integer jan3 = Integer.valueOf(janCodeMark.substring(2, 3));
@@ -4878,22 +3089,10 @@
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));
->>>>>>> LEXCommunityLiJun
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));
-<<<<<<< HEAD
Integer count12 =
jan2 +
jan3 * 3 +
@@ -4930,23 +3129,11 @@
frost13 = (String.valueOf(10 - Integer.valueOf(frost13)))
.substring((String.valueOf(10 - Integer.valueOf(frost13))).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);
-
->>>>>>> LEXCommunityLiJun
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);
-<<<<<<< HEAD
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]);
@@ -4960,17 +3147,30 @@
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] + ')娌℃湁绠$悊缂栫爜锛�')
- );
+ //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锛屼笉绗﹀悎瑕佹眰閿欒锛�')
- );
+ //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);
@@ -4978,48 +3178,11 @@
String otCode6 = barCodeList[i].substring(3, 9);
String otCode7 = barCodeList[i].substring(3, 10);
String otCode8 = barCodeList[i].substring(3, 11);
-=======
- 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'){
- //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){
- //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);
->>>>>>> LEXCommunityLiJun
otCodeList.add(otCode4);
otCodeList.add(otCode5);
otCodeList.add(otCode6);
otCodeList.add(otCode7);
otCodeList.add(otCode8);
-<<<<<<< HEAD
otCodeMap.put(otCode4, barCodeList[i]);
otCodeMap.put(otCode5, barCodeList[i]);
otCodeMap.put(otCode6, barCodeList[i]);
@@ -5032,64 +3195,38 @@
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);
->>>>>>> LEXCommunityLiJun
otCodeList.add(otCode4);
otCodeList.add(otCode5);
otCodeList.add(otCode6);
otCodeList.add(otCode7);
otCodeList.add(otCode8);
otCodeList.add(otCode9);
-<<<<<<< HEAD
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]);
->>>>>>> LEXCommunityLiJun
}
allotCodeList.addAll(otCodeList);
barOtcodeMap.put(barCodeList[i], otCodeMap);
barCode241List.add(barCodeList[i]);
-<<<<<<< HEAD
} 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){
+ if (isLwc) {
errorList.add('浜у搧BarCode(' + barCodeList[i] + ')娌℃湁janCode鎴朞Tcode锛屼笉绗﹀悎瑕佹眰锛�');
- }else {
- ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR,'浜у搧BarCode(' + barCodeList[i] + ')娌℃湁janCode鎴朞Tcode锛屼笉绗﹀悎瑕佹眰锛�'));
+ } else {
+ ApexPages.addmessage(
+ new ApexPages.message(
+ ApexPages.severity.ERROR,
+ '浜у搧BarCode(' + barCodeList[i] + ')娌℃湁janCode鎴朞Tcode锛屼笉绗﹀悎瑕佹眰锛�'
+ )
+ );
}
->>>>>>> LEXCommunityLiJun
continue;
}
}
//01閫氳繃妫�绱骇鍝佹槸鍚﹀瓨鍦�
-<<<<<<< HEAD
Map<String, String> rightBar = new Map<String, String>();
if (alljanCodeList.size() > 0) {
Map<String, String> exitBarCodeMap = new Map<String, String>();
@@ -5120,12 +3257,19 @@
}
}
if (errorMap.size() > 0) {
- ApexPages.addmessage(
- new ApexPages.message(
- ApexPages.severity.ERROR,
+ //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 = [
@@ -5166,73 +3310,10 @@
notEqualBARcodeCunMap.put(produ.Id, overOrderBARcodeCunList);
}
}
-=======
- 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){
- //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)));
- rightBar.put(bar, 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)){
- overOrderBARcodeCunList = notEqualBARcodeCunMap.get(produ.Id).clone();
- overOrderBARcodeCunList.add(bar);
- notEqualBARcodeCunMap.put(produ.Id,overOrderBARcodeCunList);
- }else{
- overOrderBARcodeCunList.add(bar);
- notEqualBARcodeCunMap.put(produ.Id,overOrderBARcodeCunList);
- }
- }
-
->>>>>>> LEXCommunityLiJun
}
}
}
}
-<<<<<<< HEAD
for (String bartxt : barCode01List) {
if (!exitBarCodeMap.containsKey(bartxt)) {
notInStorelist.add(bartxt);
@@ -5260,12 +3341,17 @@
}
}
if (errorMap.size() > 0) {
- ApexPages.addmessage(
- new ApexPages.message(
- ApexPages.severity.ERROR,
- 'BarCode鍙穂' + errorMap.values() + ']浜у搧绫诲瀷[' + product_Type + ']涓庣敤鎴穂' + userPro_Type + ']绫诲瀷涓嶇'
- )
- );
+ //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
@@ -5295,12 +3381,17 @@
'-01';
productionDate = Date.valueOf(productDateStr);
} catch (Exception e) {
- ApexPages.addmessage(
- new ApexPages.message(
- ApexPages.severity.ERROR,
- '浜у搧BarCode(' + bar + ')鐨勭敓浜ф棩鏈�' + productDateStr + '閿欒锛�'
- )
- );
+ //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) {
@@ -5328,12 +3419,17 @@
expirationDate = Date.valueOf(expirationDateStr);
}
} catch (Exception e) {
- ApexPages.addmessage(
- new ApexPages.message(
- ApexPages.severity.ERROR,
- '浜у搧BarCode(' + bar + ')鐨勬粎鑿屾湁鍔规湡闄�' + expirationDateStr + '閿欒锛�'
- )
- );
+ //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) {
@@ -5375,12 +3471,17 @@
expirationDate = Date.valueOf(expirationDateStr);
}
} catch (Exception e) {
- ApexPages.addmessage(
- new ApexPages.message(
- ApexPages.severity.ERROR,
- '浜у搧BarCode(' + bar + ')鐨勬粎鑿屾湁鍔规湡闄�' + expirationDateStr + '閿欒锛�'
- )
- );
+ //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) {
@@ -5405,19 +3506,42 @@
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;
+ // 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閿欒锛�')
- );
+ //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;
}
}
@@ -5460,9 +3584,19 @@
if (notEqualBARcodeCunMap.size() > 0) {
for (String widget : notEqualBARcodeCunMap.keySet()) {
if (notEqualBARcodeCunMap.get(widget).size() > 0) {
- ApexPages.addmessage(new ApexPages.message(ApexPages.severity.INFO, '浠ヤ笅barcode浜у搧涓庤璐т骇鍝佷笉涓�鑷淬��'));
+ //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)) {
- ApexPages.addmessage(new ApexPages.message(ApexPages.severity.INFO, barcodeListTTT));
+ //LWC:Lwcflag鍜屾姤閿欐彁閱� update by Link 2023-04-27
+ if (isLwc) {
+ warningList.add(barcodeListTTT);
+ } else {
+ ApexPages.addmessage(new ApexPages.message(ApexPages.severity.INFO, barcodeListTTT));
+ }
}
}
}
@@ -5539,294 +3673,6 @@
}
}
-=======
- 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);
- errorMap.put(bar, bar);
- }
- }
- }
- }
- 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 ;
- String serialNoorLotNo = '';
- String tracingCode = '';
- String productDateStr = '';
- 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' ;
- 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 + '閿欒锛�'));
- }
- continue;
- }
- 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' ;
- 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,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;
- }
- 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) ;
- }
- }
- }
- 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;
- }
- }
- List<String> barcodedetList = new List<String>();
- barcodedetList.add(bar);
- 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)){
- overOrderBARcodeCunList = notEqualBARcodeCunMap.get(produ.Id).clone();
- overOrderBARcodeCunList.add(bar);
- notEqualBARcodeCunMap.put(produ.Id,overOrderBARcodeCunList);
- }else{
- overOrderBARcodeCunList.add(bar);
- notEqualBARcodeCunMap.put(produ.Id,overOrderBARcodeCunList);
- }
- }
-
- }
- }
- }
- }
-
- 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){
- //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));
- }
- }
- }
- }
- }
- }
-
- public String ConfimResult() {
- 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){
- // 鑾峰彇瓒呰繃瀹氳揣鏁伴噺鐨勬秷鑰楀搧淇℃伅
- 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);
- 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){
- consumableorderdetailsRecordsUse.add(ass);
- cancellationProList.add(ass.esd.Asset_Model_No__c);
- }else{
- consumableorderdetailsRecordsUse.add(ass);
- }
- orderWantArriveCunMap.put(ass.esd.Asset_Model_No__c,orderWantArriveCunMap.get(ass.esd.Asset_Model_No__c)+1);
- }
- 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){
-
- //鍙栧緱鍘熸湁list
- 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);
- 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){
-
- consumableInventoryUse.add(ass);
- cancellationProList.add(ass.Prod.Asset_Model_No__c);
- }else{
- consumableInventoryUse.add(ass);
- }
- 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){
- // 鑾峰彇瓒呰繃瀹氳揣鏁伴噺鐨勬秷鑰楀搧淇℃伅
- overOrderproList.add(productList[i]);
- }
- }
- if(overOrderproList.size() > 0){
- return '浜у搧' + overOrderproList + '鏈鍒拌揣鏁伴噺鍜屽凡鍒拌揣鏁伴噺宸茬粡瓒呰繃璁㈣揣鏁伴噺!';
- }else{
- return '';
- }
-
- }
-
->>>>>>> LEXCommunityLiJun
public void confimResultWithoutOrder() {
/*list<String> overOrderproList = new list<String>();
list<String> overOrderBARcodeCunList = new list<String>();
@@ -5865,11 +3711,7 @@
}*/
//瑕佸埌璐т骇鍝佹暟閲�
-<<<<<<< HEAD
for (ConsumableorderdetailsInfo ass : ConsumableorderdetailsRecords) {
-=======
- for (ConsumableorderdetailsInfo ass : ConsumableorderdetailsRecords) {
->>>>>>> LEXCommunityLiJun
/*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');
@@ -5881,7 +3723,6 @@
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{*/
-<<<<<<< HEAD
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);
@@ -5922,76 +3763,25 @@
WHERE id IN :orderIdList
];
-=======
- 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){
- 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> ();
- // 浠ョ粡閿�鍟嗗悕灏嗚鐢熸垚鍑哄簱鍗曠殑鏁版嵁鍒嗙粍
- 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> ();
- 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);
- pNumMap = productMap.get(cod.Dealer_Info_text__c + cod.Arrive_Owner_Work_Location__c);
- if (pNumMap.containsKey(cod.Consumable_Product__c)) {
- num = pNumMap.get(cod.Consumable_Product__c) + 1;
- }
- }
- 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('======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];
-
->>>>>>> LEXCommunityLiJun
// 鐢熸垚鍚勭粡閿�鍟嗗嚭搴撹鍗昄ist
// 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];
List<Consumable_order_details2__c> prodPriceList = accountGroupMap.get(acc);
-<<<<<<< HEAD
Map<Id, Integer> pNumMap = new Map<Id, Integer>();
pNumMap = productMap.get(acc);
List<Consumable_orderdetails__c> insDetail1 = new List<Consumable_orderdetails__c>();
for (Id id : pNumMap.keySet()) {
Consumable_orderdetails__c ins = new Consumable_orderdetails__c();
-=======
- Map<Id, Integer> pNumMap = new Map<Id, Integer> ();
- pNumMap = productMap.get(acc);
- List<Consumable_orderdetails__c> insDetail1 = New List<Consumable_orderdetails__c>();
- for (Id id : pNumMap.keySet()) {
- Consumable_orderdetails__c ins = new Consumable_orderdetails__c();
-
->>>>>>> LEXCommunityLiJun
//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) {
-<<<<<<< HEAD
ins.Intra_Trade_List_RMB__c = pri.Intra_Trade_List_RMB__c;
-=======
- ins.Intra_Trade_List_RMB__c =pri.Intra_Trade_List_RMB__c;
->>>>>>> LEXCommunityLiJun
break;
}
}
@@ -6005,170 +3795,6 @@
ins.OwnerId = arriveAccount.OwnerId;
insDetail1.add(ins);
-<<<<<<< HEAD
-=======
- }
- System.debug('======insDetail1'+insDetail1);
- insDetail1Map.put(acc, insDetail1);
- System.debug('======insDetail1Map'+insDetail1Map);
- }
- 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);
- Integer i = 1;
- for (Consumable_orderdetails__c dtl1 : d1list) {
- String str = ('000' + i).right(4);
- dtl1.Consumable_order__c = setId.Id;
- dtl1.Name = setId.Name + '-'+ str;
- insDetail1List.add(dtl1);
- }
- }
- System.debug('======insDetail1List'+insDetail1List);
- insert insDetail1List;
- }
- // WYIN-BLZE48鐩樼偣涓㈠け浜у搧澧炲姞鍏ュ簱鏂瑰紡 update by vivek 2020-03-05 end
-
-
- // 缁忛攢鍟嗙殑涓嶅悓宸ヤ綔鍦拌皟璐ц嚜鍔ㄧ敓鎴愬嚭搴撳崟
- 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>> ();
- // 浠ョ粡閿�鍟嗗悕灏嗚鐢熸垚鍑哄簱鍗曠殑鏁版嵁鍒嗙粍
- 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> ();
- 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);
- pNumMap = productMap.get(cod.Dealer_Info_text__c + cod.Arrive_Owner_Work_Location__c);
- 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);
- accountGroupMap.put(cod.Dealer_Info_text__c + cod.Arrive_Owner_Work_Location__c, accGroupList);
- }
-
- // 鐢熸垚鍚勭粡閿�鍟嗗嚭搴撹鍗昄ist
- 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];
- Consumable_order__c autoOrder = new Consumable_order__c();
- autoOrder.Name = '*';
- autoOrder.Dealer_Info__c = arriveAccount.Consumable_Arrived_order__r.Dealer_Info__c;
- autoOrder.OwnerId = arriveAccount.OwnerId;
- autoOrder.Order_type__c = '浼犵エ';
- autoOrder.SummonsStatus_c__c = '宸插畬鎴�';
- autoOrder.Order_ForDealerText__c = accountName;
- autoOrder.SummonsForDirction__c = '浜掔浉璋冭揣';
- autoOrder.RecordTypeid = System.Label.RT_ConOrder_Shipment;
- autoOrder.Outbound_Date__c = Date.today();
- autoOrder.Order_date__c = Date.today();
- autoOrder.AutoShipment__c = TRUE;
- orderList.add(autoOrder);
-
- List<Consumable_order_details2__c> prodPriceList = accountGroupMap.get(acc);
- Map<Id, Integer> pNumMap = new Map<Id, Integer> ();
- pNumMap = productMap.get(acc);
- 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;
- break;
- }
- }
- ins.Box_Piece__c = '鐩�';
- ins.Out_unit__c = '鐩�';
- //ins.Delivery_List_RMB__c = ass.orderdetails1.Delivery_List_RMB__c;
- //ins.Unitprice_To_agency__c = ass.orderdetails1.Unitprice_To_agency__c;
- //ins.Dealer_Custom_Price__c = ass.orderdetails1.Dealer_Custom_Price__c;
- ins.RecordTypeId = System.Label.RT_ConOrderDetail1_Shipment;
- ins.Used_date__c = Date.today();
- ins.OwnerId = arriveAccount.OwnerId;
-
- insDetail1.add(ins);
- }
- insDetail1Map.put(acc, insDetail1);
- }
- insert orderList;
-
- 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];
-
- // 璁剧疆鏄庣粏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> ();
- for (Consumable_order__c setId : orderList) {
- // 鏄庣粏1
- List<Consumable_orderdetails__c> d1list = insDetail1Map.get(setId.Dealer_Info__r.Name + setId.Order_Owner_WorkLocal__c);
- Integer i = 1;
- for (Consumable_orderdetails__c dtl1 : d1list) {
- String str = ('000' + i).right(4);
- // if(str.length() == 1){
- // str = '0' + str;
- // }
- dtl1.Consumable_order__c = setId.Id;
- dtl1.Name = setId.Name + '-'+ str;
- insDetail1List.add(dtl1);
- }
-
- // 鏄庣粏2
- List<Consumable_order_details2__c> d2list = accountGroupMap.get(setId.Dealer_Info__r.Name + setId.Order_Owner_WorkLocal__c);
- for (Consumable_order_details2__c dtl2 : d2list) {
- dtl2.Send_Date__c = Date.today();
- dtl2.Consumable_Sale_order__c = null;
- dtl2.Consumable_Return_order__c = null;
- dtl2.Consumable_ZS_order__c = setId.Id;
- //dtl2.Delivery_List_RMB__c = null;
- dtl2.Return_date__c = null;
- dtl2.Return_reason__c = null;
- dtl2.Consumable_Shipment_order__c = setId.Id;
- // 鏇存柊鍊熻皟淇℃伅 add by gzw 2020-0-415 start
- dtl2.Transfer_Time__c = 1;
- dtl2.Agency_Transfer__c = true;
- dtl2.Frist_Transfer_Agency__c = dtl2.Dealer_Info_text__c;
- // 鏇存柊鍊熻皟淇℃伅 add by gzw 2020-0-415 end
- updDetail2List.add(dtl2);
- }
- }
-
- insert insDetail1List;
- update updDetail2List;
- }
-
- //鍒拌揣纭
- public PageReference ArriveGoodsConfim() {
- //add by rentx 20210618 start CHAN-C3K4ZQ 璺宠繃涓嶅繀瑕佺殑鏌ヨ
- 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>();
- String resultcheck = '';
- List<String> resultcheckWithoutOrder = new List<String>();
- Savepoint sp = Database.setSavepoint();
-
- 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,'涓嶅瓨鍦ㄥ埌璐ф槑缁�'));
->>>>>>> LEXCommunityLiJun
}
System.debug('======insDetail1' + insDetail1);
insDetail1Map.put(acc, insDetail1);
@@ -6324,48 +3950,43 @@
Savepoint sp = Database.setSavepoint();
if (ConsumableorderdetailsRecords.size() < 1 && consumableInventory.size() < 1) {
- ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR, '涓嶅瓨鍦ㄥ埌璐ф槑缁�'));
+ //LWC:Lwcflag鍜屾姤閿欐彁閱� update by Link 2023-04-27
+ if (isLwc) {
+ returnError = '涓嶅瓨鍦ㄥ埌璐ф槑缁�';
+ } else {
+ ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR, '涓嶅瓨鍦ㄥ埌璐ф槑缁�'));
+ }
return null;
}
-<<<<<<< HEAD
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(EsetId != null && EsetId != ''){
- resultcheck = ConfimResult();
- 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() +'涓璐х殑鏁伴噺銆�'));
+ 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)) {
+ for (String barcodeListTTT : (List<String>) overOrderBARcodeCunMap.get(widget)) {
//LWC:Lwcflag鍜屾姤閿欐彁閱� update by Link 2023-04-27
- if(isLwc){
+ if (isLwc) {
warningList.add(barcodeListTTT);
- }else {
+ } else {
ApexPages.addmessage(new ApexPages.message(ApexPages.severity.INFO, barcodeListTTT));
}
->>>>>>> LEXCommunityLiJun
}
}
}
}
-<<<<<<< HEAD
} else {
confimResultWithoutOrder();
}
@@ -6381,190 +4002,33 @@
orderMain.Order_type__c = '鍒拌揣';
orderMain.Order_ProType__c = userPro_Type;
if (EsetId != null && EsetId != '') {
-=======
- }else{
- confimResultWithoutOrder();
- }
- try{
- Consumable_order__c orderMain = new Consumable_order__c();
- List<Consumable_order_details2__c> orderdetails = New List<Consumable_order_details2__c>();
- //鍒拌揣姝g‘淇℃伅
- orderMain.Name = '*';
- orderMain.Order_status__c = '鎵瑰噯';
- orderMain.Dealer_Info__c = accountid;
- orderMain.Deliver_date__c = Date.today();
- orderMain.Order_date__c = Date.today();
- orderMain.Order_type__c = '鍒拌揣';
- orderMain.Order_ProType__c = userPro_Type;
- if(EsetId != null && EsetId != ''){
->>>>>>> LEXCommunityLiJun
orderMain.Arrive_Order__c = coc.Id;
}
orderMain.RecordTypeid = System.Label.RT_ConOrder_Arrive;
insert orderMain;
-<<<<<<< HEAD
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) {
+ //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();
-=======
- 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) {
- //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();
->>>>>>> LEXCommunityLiJun
// 鏇存柊鍊熻皟淇℃伅 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;
-<<<<<<< HEAD
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
-=======
- 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;
- // 杩藉姞棣栨鍏ュ簱缁忛攢鍟� add by gzw 2020-04-27 end
- arriveAmount += ass.esd.Intra_Trade_List_RMB__c;
- orderdetails.add(insDetails);
- }
- Integer i = 1;
- 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;
- // 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;
- //gzw 鎵嬪姩鍏ュ簱 榛樿浜у搧鍗曚环 20230307
- 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;
- //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;
- //TODO寰呯‘璁�
- 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();
- // 鏇存柊鍊熻皟淇℃伅 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;
- }
- // 鏇存柊鍊熻皟淇℃伅 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;
- // 杩藉姞棣栨鍏ュ簱缁忛攢鍟� 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;
- }
- // 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){
- //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) {
- addSaleOrderList.add(Cod);
- }
- } else {
- Cod.Cancellation_Date__c = Date.today();
- Cod.Cancellation_Flag__c = true;
- updateconsumableorderdetails2.add(Cod);
- }
- }
->>>>>>> LEXCommunityLiJun
-
- if (addSaleOrderList.size() > 0) {
- addSaleOrderAuto(addSaleOrderList);
- }
-
- 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){
- //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.Consumable_Arrived_order__c = orderMain.id;
- 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));
- Cod2.Transfer_Time__c = Cod2.Transfer_Time__c == null ? 1 : Cod2.Transfer_Time__c;
- Cod2.Agency_Transfer__c = true;
- 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
-<<<<<<< HEAD
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
@@ -6665,68 +4129,8 @@
if (updateconsumableorderdetails2.size() > 0) {
update updateconsumableorderdetails2;
-=======
- 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;
- // 杩藉姞棣栨鍏ュ簱缁忛攢鍟� add by gzw 2020-04-27 end
- insertconsumableorderdetails2.add(Cod2);
- i++;
}
- //return null;
-
- if(insertconsumableorderdetails2.size() >0){
- insert insertconsumableorderdetails2;
- }
-
- if(ins.size()>0){
- insert ins;
- }
- 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++){
- 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){
- coc = qs[0];
- }
- saveFLGbln = true;
- alertMessage = '鍒拌揣瀹屾垚銆�';
- // Integer a = 1/0;
- }catch(Exception e){
- Database.rollback(sp);
- //LWC:Lwcflag鍜屾姤閿欐彁閱� update by Link 2023-04-27
- if(isLwc){
- returnError = e.getLineNumber()+'---'+e.getMessage();
- }else {
- ApexPages.addMessages(e);
->>>>>>> LEXCommunityLiJun
- }
List<Consumable_order_details2__c> insertconsumableorderdetails2 = new List<Consumable_order_details2__c>();
for (Consumable_order_details2__c Cod2 : consumableorderdetails2Insert) {
//ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR,'------4------'));
@@ -6758,7 +4162,7 @@
i++;
}
- // return null;
+ //return null;
if (insertconsumableorderdetails2.size() > 0) {
insert insertconsumableorderdetails2;
@@ -6818,28 +4222,24 @@
// Integer a = 1/0;
} 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;
}
-<<<<<<< HEAD
if (resultcheck.length() > 0) {
return null;
} else if (resultcheckWithoutOrder.size() > 0) {
return null;
} else {
-=======
- if(resultcheck.length() > 0){
- return null;
- }else if(resultcheckWithoutOrder.size() >0){
- return null;
- } else{
urlType = 'UnabletoEdit';
->>>>>>> LEXCommunityLiJun
return UnabletoEdit();
// return null;
}
}
-<<<<<<< HEAD
// 杩斿搧妫�鏌ワ紝鍚庡洖搴�
public integer GoodsReturnCheck() {
@@ -6905,61 +4305,10 @@
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);
-=======
-
- // 杩斿搧妫�鏌ワ紝鍚庡洖搴�
- 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');
- }
- 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)){
- // 璺宠繃宸茬粡澶勭悊鐨勬秷鑰楀搧鏄庣粏
- 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);
->>>>>>> LEXCommunityLiJun
}
}
}
AllMap.putAll(ErrorIdMap);
-<<<<<<< HEAD
BarcodeRetrunResult = [
SELECT
Id,
@@ -7047,10 +4396,24 @@
} 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);
- continue;
+ // 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;
+ }
+ }
+ // 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);
@@ -7077,142 +4440,10 @@
}
}
-=======
- 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'){
- BarcodeRetrunResult = getDistinctZSOrder(BarcodeRetrunResult);
- }
-
- for( Consumable_order_details2__c codc : BarcodeRetrunResult ){
- if(ErrorIdMap.containsKey(codc.Bar_Code__c) || ExistIdMap.containsKey(codc.Bar_Code__c)){
- // 璺宠繃宸茬粡澶勭悊鐨勬秷鑰楀搧鏄庣粏
- continue;
- }else{
-
- Matcher n = Pattern.compile('[0-9]').matcher(codc.TracingCode__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;
- }
- }
- // 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 ) );
- }
- // 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 ) );
- }
- // WYIN-BLZE48鐩樼偣涓㈠け浜у搧澧炲姞鍏ュ簱鏂瑰紡 update by vivek 2020-03-05 end
- }else{
- continue;
- }
- }
- }
-
->>>>>>> LEXCommunityLiJun
return BarcodeRetrunResult.size();
}
// 鍗曚綅涓轰釜鐨凚arcode瀵瑰簲鐨勫嚭搴撳崟
-<<<<<<< HEAD
public integer Getconsumableorderdetails2Nobox() {
consumableorderdetails2Nobox = new List<Consumable_order_details2__c>();
BarcodeCntMap.clear();
@@ -7304,91 +4535,10 @@
BarcodeCntMap.put(key, Integer.valueOf(ar.get('recordCount')));
}
-=======
- 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];
-
- 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){
- String key = '' + ar.get('Consumable_ZS_order__c') + ar.get('Bar_Code__c');
- BarcodeCntMap.put(key, Integer.valueOf(ar.get('recordCount')));
- }
-
->>>>>>> LEXCommunityLiJun
return consumableorderdetails2Nobox.size();
}
//distinct
-<<<<<<< HEAD
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>();
@@ -7396,48 +4546,24 @@
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) {
-=======
- 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){
->>>>>>> LEXCommunityLiJun
found = true;
break;
}
}
-<<<<<<< HEAD
if (!found) {
distinctOrder.add(details2);
if (details2.Box_Piece__c == '涓�')
noboxBarcodeList.add(details2.Bar_Code__c);
}
-=======
- if(!found){
- distinctOrder.add(details2);
-
- if(details2.Box_Piece__c == '涓�') noboxBarcodeList.add(details2.Bar_Code__c);
- }
->>>>>>> LEXCommunityLiJun
}
return distinctOrder;
}
-<<<<<<< HEAD
// Update杩斿搧鏄庣粏淇℃伅
public Pagereference UpdateGoodsOfReturn() {
if (ShowGoodsofReturnList == null) {
-=======
- // Update杩斿搧鏄庣粏淇℃伅
- public Pagereference UpdateGoodsOfReturn(){
- if( ShowGoodsofReturnList==null){
->>>>>>> LEXCommunityLiJun
GoodsReturnCheck();
}
Getconsumableorderdetails2Nobox();
@@ -7445,7 +4571,6 @@
Savepoint sp = Database.setSavepoint();
boolean hasReturnGoods = false;
boolean hasLoseGoods = false;
-<<<<<<< HEAD
try {
if (ShowGoodsofReturnList.size() > 0 || consumableInventory.size() > 0) {
Consumable_order__c Return_Order_Sheet = new Consumable_order__c();
@@ -7485,11 +4610,7 @@
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>();
@@ -7507,7 +4628,11 @@
}
if (codi.esd.Return_reason__c == null || codi.esd.Return_reason__c == '') {
- codi.esd.Return_reason__c.addError('璇疯ˉ鍏呰繑鍝佸師鍥�');
+ if (isLwc) {
+ returnError = '璇疯ˉ鍏呰繑鍝佸師鍥�';
+ } else {
+ codi.esd.Return_reason__c.addError('璇疯ˉ鍏呰繑鍝佸師鍥�');
+ }
return null;
}
@@ -7515,7 +4640,11 @@
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 (isLwc) {
+ returnError = '瓒呭嚭鍑哄簱鏁伴噺';
+ } else {
+ codi.esd.Rrturn_count__c.addError('瓒呭嚭鍑哄簱鏁伴噺');
+ }
return null;
}
}
@@ -7551,130 +4680,19 @@
// esd.Consumable_Return_order__c = Return_Order_Sheet.id;
esd.Return_reason__c = codi.esd.Return_reason__c;
esd.Return_date__c = Date.today();
-=======
- 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;
- 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];
-
- //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;
- insert Arrived_Order_Sheet;
- 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 = '鎵瑰噯';
- 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.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;
- 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]; //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> 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)){
- continue;
- }
-
- 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){
- 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){
- if(isLwc){
- returnError = '瓒呭嚭鍑哄簱鏁伴噺';
- }else {
- codi.esd.Rrturn_count__c.addError('瓒呭嚭鍑哄簱鏁伴噺');
- }
- return null;
- }
- }
- }
-
- 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 ){
- 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)){
- continue;
- }
-
- 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){
- 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();
->>>>>>> LEXCommunityLiJun
// 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;
-<<<<<<< HEAD
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){
->>>>>>> LEXCommunityLiJun
// esd.Lose_Flag__c = false;
esd.Consumable_Inventory_order__c = Inventory_Order_Sheet.id;
conOrderDetail2InList.add(esd);
hasLoseGoods = true;
-<<<<<<< HEAD
} else {
// esd.Return_date__c = Date.today();
esd.Consumable_Return_order__c = Return_Order_Sheet.id;
@@ -7709,60 +4727,18 @@
codcorderdet.RemoveBox_No__c = codctmp.RemoveBox_No__c;
codcorderdet.RemoveBox_date__c = codctmp.RemoveBox_date__c;
codcorderdet.Box_Piece__c = codctmp.Box_Piece__c;
-=======
- }
- else{
- // esd.Return_date__c = Date.today();
- 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.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.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;
- //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;
->>>>>>> LEXCommunityLiJun
//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)) {
-<<<<<<< HEAD
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;
->>>>>>> LEXCommunityLiJun
}
// tcm end
//add by rentx 2020-10-13 end 杩斿搧鏃舵柊鏁版嵁璁板綍SAP鍚堝悓鍙�
-<<<<<<< HEAD
// WYIN-BLZE48鐩樼偣涓㈠け浜у搧澧炲姞鍏ュ簱鏂瑰紡 update by vivek 2020-03-05 start
if (hasLoseGoods) {
codcorderdet.loseInventory__c = true;
@@ -7791,42 +4767,11 @@
}
}
} else {
-=======
-
- // WYIN-BLZE48鐩樼偣涓㈠け浜у搧澧炲姞鍏ュ簱鏂瑰紡 update by vivek 2020-03-05 start
- 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.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;
- // 杩藉姞棣栨鍏ュ簱缁忛攢鍟� add by gzw 2020-04-27 end
- codcorderdetList.add(codcorderdet);
- codcList.add( esd );
-
- cnt++;
- if(cnt > codi.esd.Rrturn_count__c) break;
- }
-
- }
- }
- else{
->>>>>>> LEXCommunityLiJun
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
-<<<<<<< HEAD
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) {
@@ -7865,51 +4810,11 @@
: codi.esd.Intra_Trade_List_RMB__c;
// WYIN-BLZE48鐩樼偣涓㈠け浜у搧澧炲姞鍏ュ簱鏂瑰紡 update by vivek 2020-03-05 start
if (hasLoseGoods) {
-=======
- 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){
- codi.esd.Lose_Flag__c = false;
- codi.esd.Return_reason__c = '';
- codi.esd.Consumable_Inventory_order__c = Inventory_Order_Sheet.id;
- conOrderDetail2InList.add(codi.esd);
- hasLoseGoods = true;
- }
- else{
- // codi.esd.Return_date__c = Date.today();
- 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.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;
- 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;
- //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;
- // WYIN-BLZE48鐩樼偣涓㈠け浜у搧澧炲姞鍏ュ簱鏂瑰紡 update by vivek 2020-03-05 start
- if(hasLoseGoods){
->>>>>>> LEXCommunityLiJun
codcorderdet.loseInventory__c = true;
}
// WYIN-BLZE48鐩樼偣涓㈠け浜у搧澧炲姞鍏ュ簱鏂瑰紡 update by vivek 2020-03-05 end
// 杩藉姞棣栨鍏ュ簱缁忛攢鍟� add by gzw 2020-04-27 start
// 杩斿搧鏃讹紝鈶犺拷鍔犲�熻皟鍊熷嚭鏂逛俊鎭� 鈶′繚鐣欏�熻皟淇℃伅 鈶繚瀛楽AP鍜岀粡閿�鍟嗛娆″彂璐х粡閿�鍟�
-<<<<<<< HEAD
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;
@@ -7920,54 +4825,28 @@
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.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;
- //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;
->>>>>>> LEXCommunityLiJun
// 杩藉姞棣栨鍏ュ簱缁忛攢鍟� 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)) {
-<<<<<<< HEAD
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;
->>>>>>> LEXCommunityLiJun
}
// tcm end
//add by rentx 2020-10-13 end 杩斿搧鏃舵柊鏁版嵁璁板綍SAP鍚堝悓鍙�
codcorderdetList.add(codcorderdet);
-<<<<<<< HEAD
codcList.add(codi.esd);
- }
- }
- //鏄庣粏2涓嶅瓨鍦ㄧ殑瀵瑰簲鐨勫埌璐ц鍗曟槑缁� 2017-07-05
- Integer i = 1;
- //for(ConsumableorderdetailsInfo ass : consumableInventoryUse){
- for (ConsumableorderdetailsInfo ass : consumableInventory) {
-=======
- codcList.add( codi.esd );
}
}
//鏄庣粏2涓嶅瓨鍦ㄧ殑瀵瑰簲鐨勫埌璐ц鍗曟槑缁� 2017-07-05
Integer i = 1;
//for(ConsumableorderdetailsInfo ass : consumableInventoryUse){
- for(ConsumableorderdetailsInfo ass : consumableInventory){
->>>>>>> LEXCommunityLiJun
+ 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();
@@ -7976,23 +4855,17 @@
// str = '0' + str;
// }
-<<<<<<< HEAD
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){
+ if (isLwc) {
returnError = '璇疯ˉ鍏呰繑鍝佸師鍥�';
- }else {
- ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR,'璇疯ˉ鍏呰繑鍝佸師鍥�'));
+ } else {
+ ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR, '璇疯ˉ鍏呰繑鍝佸師鍥�'));
}
->>>>>>> LEXCommunityLiJun
return null;
}
//鍒拌揣鏄庣粏
-<<<<<<< HEAD
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;
@@ -8006,35 +4879,14 @@
codcorderdetail.TracingCode__c = ass.tracingCodeNo;
codcorderdetail.Consumable_Arrived_order__c = Arrived_Order_Sheet.id;
codcorderdetail.Arrive_date__c = Date.today();
-=======
- 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.Consumable_Arrived_order__c = Arrived_Order_Sheet.id;
- codcorderdetail.Arrive_date__c = Date.today();
->>>>>>> LEXCommunityLiJun
//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)) {
-<<<<<<< HEAD
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;
->>>>>>> LEXCommunityLiJun
}
// tcm end
//add by rentx 2020-10-14 end
@@ -8042,22 +4894,15 @@
codcorderdetList.add(codcorderdetail);
//杩斿搧鏄庣粏
-<<<<<<< HEAD
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();
->>>>>>> LEXCommunityLiJun
// 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;
// }
-<<<<<<< HEAD
retorddetail.Consumable_Return_order__c = Return_Order_Sheet.id;
// WYIN-BLZE48鐩樼偣涓㈠け浜у搧澧炲姞鍏ュ簱鏂瑰紡 update by vivek 2020-03-05 end
@@ -8077,46 +4922,16 @@
retorddetail.Deliver_date__c = Date.today();
// 杩藉姞棣栨鍏ュ簱缁忛攢鍟� add by gzw 2020-04-27 start
retorddetail.Frist_Storage_Agency__c = accountName;
-=======
- 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;
- //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();
- // 杩藉姞棣栨鍏ュ簱缁忛攢鍟� add by gzw 2020-04-27 start
- retorddetail.Frist_Storage_Agency__c = accountName;
->>>>>>> LEXCommunityLiJun
// 杩藉姞棣栨鍏ュ簱缁忛攢鍟� add by gzw 2020-04-27 end
//add by rentx 2020-10-14 start
// retorddetail.ContractNo_text__c = /*ass.esd.ContractNo__c*/;
// tcm start
-<<<<<<< HEAD
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;
- }
->>>>>>> LEXCommunityLiJun
// tcm end
//add by rentx 2020-10-14 end
@@ -8127,7 +4942,6 @@
// ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR,'------end------'));
// return null;
-<<<<<<< HEAD
if (codcList.size() > 0) {
ControllerUtil.updateOrderDetailsSatus(codcList);
//insert codcorderdetList;
@@ -8138,92 +4952,53 @@
}
// WYIN-BPE3T4 铏氭嫙鐩樼偣鍗� update by vivek 2020-05-11 start
if (conOrderDetail2InList.size() > 0) {
-=======
- if(codcList.size()>0){
- ControllerUtil.updateOrderDetailsSatus( codcList );
- //insert codcorderdetList;
- }
- if (codcorderdetList.size()>0){
- System.debug('codcorderdetList +++++ '+ codcorderdetList);
- insert codcorderdetList;
- }
- // WYIN-BPE3T4 铏氭嫙鐩樼偣鍗� update by vivek 2020-05-11 start
- if(conOrderDetail2InList.size() > 0){
->>>>>>> LEXCommunityLiJun
addInventoryDetails1(conOrderDetail2InList);
}
// WYIN-BPE3T4 铏氭嫙鐩樼偣鍗� update by vivek 2020-05-11 start
-<<<<<<< HEAD
if (hasReturnGoods) {
// WYIN-BPE3T4 铏氭嫙鐩樼偣鍗� update by vivek 2020-05-11 start
// return ToReturnGoodsPage();
if (hasLoseGoods) {
- return ToInventoryGoodsPage();
- // return null;
- } else {
-=======
- if(hasReturnGoods){
- // WYIN-BPE3T4 铏氭嫙鐩樼偣鍗� update by vivek 2020-05-11 start
- // return ToReturnGoodsPage();
- if(hasLoseGoods){
urlType = 'ToInventoryGoodsPage';
return ToInventoryGoodsPage();
// return null;
- }else{
+ } else {
urlType = 'ToReturnGoodsPage';
->>>>>>> LEXCommunityLiJun
return ToReturnGoodsPage();
// return null;
}
// WYIN-BPE3T4 铏氭嫙鐩樼偣鍗� update by vivek 2020-05-11 start
-<<<<<<< HEAD
} else {
- ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR, '娌℃湁闇�瑕佺櫥褰曠殑杩斿搧'));
+ //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, '娌℃湁闇�瑕佺櫥褰曠殑杩斿搧'));
+ //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) {
Database.rollback(sp);
- ApexPages.addMessages(e);
-=======
- }
- else{
- //LWC:Lwcflag鍜屾姤閿欐彁閱� update by Link 2023-04-27
- if(isLwc){
- returnError = '娌℃湁闇�瑕佺櫥褰曠殑杩斿搧';
- }else {
- ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR,'娌℃湁闇�瑕佺櫥褰曠殑杩斿搧'));
- }
- return null;
- }
-
- }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){
- Database.rollback(sp);
//LWC:Lwcflag鍜屾姤閿欐彁閱� update by Link 2023-04-27
- if(isLwc){
- returnError = e.getLineNumber()+'---'+e.getMessage();
- }else {
+ if (isLwc) {
+ returnError = e.getLineNumber() + '---' + e.getMessage();
+ } else {
ApexPages.addMessages(e);
}
->>>>>>> LEXCommunityLiJun
return null;
}
}
-<<<<<<< HEAD
public void makeArrivedSummary() {
detailsSummary = new List<ConsumableorderdetailsInfo>();
//ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR,'consumableInventory ' + consumableInventory));
@@ -8235,26 +5010,12 @@
detailsSummaryMap.get(ass.Prod.Id).arrivedCount++;
detailsSummaryMap.get(ass.Prod.Id).arriveAmount += ass.esd.Intra_Trade_List_RMB__c;
} else {
-=======
- public void makeArrivedSummary(){
- detailsSummary = new List<ConsumableorderdetailsInfo>();
- //ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR,'consumableInventory ' + consumableInventory));
- 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 ++;
- detailsSummaryMap.get(ass.Prod.Id).arriveAmount += ass.esd.Intra_Trade_List_RMB__c;
- }else{
->>>>>>> LEXCommunityLiJun
arriveDdetailsSummary = new ConsumableorderdetailsInfo(ass.Prod);
arriveDdetailsSummary.arrivedCount = 1;
arriveDdetailsSummary.arriveAmount = ass.esd.Intra_Trade_List_RMB__c;
detailsSummaryMap.put(ass.Prod.Id, arriveDdetailsSummary);
}
}
-<<<<<<< HEAD
for (ConsumableorderdetailsInfo ass : consumableInventory) {
if (detailsSummaryMap.containsKey(ass.Prod.Id)) {
detailsSummaryMap.get(ass.Prod.Id).arrivedCount++;
@@ -8269,42 +5030,17 @@
if (EsetId != null && EsetId != '') {
arriveDdetailsSummary.arriveAmount = ass.Prod.Intra_Trade_List_RMB__c;
} else {
-=======
- 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{
- detailsSummaryMap.get(ass.Prod.Id).arriveAmount += 0;
- }
- }else{
- arriveDdetailsSummary = new ConsumableorderdetailsInfo(ass.Prod);
- arriveDdetailsSummary.arrivedCount = 1;
- if(EsetId != null && EsetId != ''){
- arriveDdetailsSummary.arriveAmount = ass.Prod.Intra_Trade_List_RMB__c;
- }else{
->>>>>>> LEXCommunityLiJun
arriveDdetailsSummary.arriveAmount = 0;
}
detailsSummaryMap.put(ass.Prod.Id, arriveDdetailsSummary);
}
}
-<<<<<<< HEAD
for (String key : detailsSummaryMap.keySet()) {
detailsSummary.add(detailsSummaryMap.get(key));
}
} catch (Exception e) {
//Database.rollback(sp);
throw new ControllerUtil.myException('e::' + e + ' linenumber::' + e.getLineNumber());
-=======
- for(String key : detailsSummaryMap.keySet()){
- detailsSummary.add(detailsSummaryMap.get(key));
- }
- }catch(Exception e){
- //Database.rollback(sp);
- throw new ControllerUtil.myException('e::'+e + ' linenumber::'+e.getLineNumber());
->>>>>>> LEXCommunityLiJun
// ApexPages.addMessages(e);
// ApexPages.addMessages(e.getLineNumber() + ' 11111111111111111');
@@ -8313,7 +5049,6 @@
}
//璺宠浆鍒拌繑鍝侀〉闈�
-<<<<<<< HEAD
public Pagereference ToReturnGoodsPage() {
PageReference ref = new Pagereference('/' + return_Order_id);
ref.setRedirect(true);
@@ -8353,6 +5088,10 @@
public Decimal arrivedCount { get; set; }
public String ReportProductExpirationDate { get; set; }
+
+ public ConsumableorderdetailsInfo() {
+ }
+
public ConsumableorderdetailsInfo(Consumable_order_details2__c e, string str) {
esd = e;
Prod = e.Consumable_Product__r;
@@ -8413,112 +5152,3 @@
}
}
}
-=======
- 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;
- }
- // WYIN-BPE3T4 铏氭嫙鐩樼偣鍗� update by vivek 2020-05-11 end
-
- // 璺宠浆鍒板埌璐ц鍗曟槑缁�
- public PageReference UnabletoEdit(){
- PageReference ref = new Pagereference('/ArriveGsDetails?EsetId='+arriveId);
- ref.setRedirect(true);
- return ref;
- }
-
- public class ConsumableorderdetailsInfo implements Comparable {
- public Consumable_order_details2__c esd { get; set; }
- public Product2__c Prod { get; set; }
- public String ProductName { get; set; }
- //public Boolean canSELECT { get; set; }
- public String barCodeNo { get; set; }
- public Date sterilizationlimitDate { get; set; }
- public String serialNoorLotNo { get; set; }
- public String tracingCodeNo { get; set; }
- public String ReturnReason { get; set; }
- public String oldConsumableCount { get; set; }
- public String ErrorReason { get; set; }
- public boolean canEdit { get; set; }
- public Integer intMark { get; set; }
- public Decimal arriveAmount { get; set; }
- public Decimal arrivedCount { get; set; }
-
- 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;
- intMark = 1;
- if (e.Report_Product_Expiration__c != null) {
- ReportProductExpirationDate = e.Report_Product_Expiration__c.format();
- }
-
- }
- public ConsumableorderdetailsInfo(Consumable_order_details2__c e) {
- canEdit = false;
- if(e.Box_Piece__c=='鐩�'){
- e.Rrturn_count__c = 1;
- canEdit = true;
- }
-
- esd = e;
- Prod = e.Consumable_Product__r;
- oldConsumableCount = e.name;
- if (e.Report_Product_Expiration__c != null) {
- ReportProductExpirationDate = e.Report_Product_Expiration__c.format();
- }
-
- }
-
- 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])){
- sterilizationlimitDate = Date.valueOf(barinfoL[1]);
- }
- serialNoorLotNo = barinfoL[2];
- tracingCodeNo = barinfoL[3];
- ReturnReason = '';
- }
-
- public ConsumableorderdetailsInfo(Consumable_order_details2__c e,List<String> barinfoL) {
- esd = e;
- Prod = e.Consumable_Product__r;
- barCodeNo = barinfoL[0];
- 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();
- }
-
- }
- public ConsumableorderdetailsInfo(Product2__c e) {
- Prod = e;
- }
- // 鎺掑簭
- public Integer compareTo(Object compareTo) {
- return null;
- }
- }
-}
->>>>>>> LEXCommunityLiJun
diff --git a/force-app/main/default/classes/ArriveGoodsControllerTest.cls b/force-app/main/default/classes/ArriveGoodsControllerTest.cls
index 2fe5431..82fcaca 100644
--- a/force-app/main/default/classes/ArriveGoodsControllerTest.cls
+++ b/force-app/main/default/classes/ArriveGoodsControllerTest.cls
@@ -1,24 +1,15 @@
@isTest
private class ArriveGoodsControllerTest {
-<<<<<<< HEAD
//閫夋嫨绛夊緟鍏ュ簱,鍖呮嫭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',
@@ -45,29 +36,6 @@
UserPro_Type__c = 'ET'
);
System.runAs(new User(Id = UserInfo.getUserId())) {
-=======
-
- //閫夋嫨绛夊緟鍏ュ簱,鍖呮嫭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搴�'];
- 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 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())){
->>>>>>> LEXCommunityLiJun
insert MyUser_Test;
}
@@ -75,7 +43,6 @@
// 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};
-<<<<<<< HEAD
System.runAs(MyUser_Test) {
Product2 prod01 = new Product2(
Name = 'Test01',
@@ -99,15 +66,6 @@
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};
->>>>>>> LEXCommunityLiJun
//璁㈠崟
Consumable_order__c Order1 = new Consumable_order__c();
@@ -154,38 +112,22 @@
// System.assertEquals(1, Controller.ConsumableorderdetailsRecords.size());
// System.assertEquals(2, Controller.consumableInventory.size());
Controller.ArriveGoodsConfim();
-<<<<<<< HEAD
- 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];
->>>>>>> LEXCommunityLiJun
+ List<Consumable_order_details2__c> ins = [SELECT Id, Name FROM Consumable_order_details2__c];
// System.assertEquals(3, ins.size());
System.Test.stopTest();
}
}
-<<<<<<< HEAD
//浜у搧鐩存帴鍏ュ簱,鍖呮嫭01 鍜�241
@isTest
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',
@@ -215,37 +157,10 @@
insert MyUser_Test;
}
-=======
-
- //浜у搧鐩存帴鍏ュ簱,鍖呮嫭01 鍜�241
- @isTest
- static void arriveWithoutID() {
- // // 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 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;
- }
-
->>>>>>> LEXCommunityLiJun
// 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',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};
-<<<<<<< HEAD
System.runAs(MyUser_Test) {
Product2 prod01 = new Product2(
Name = 'Test01',
@@ -269,15 +184,6 @@
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};
->>>>>>> LEXCommunityLiJun
PageReference page = new PageReference('/apex/ArriveGoods?ArrType=Arr');
System.Test.setCurrentPage(page);
ArriveGoodsController Controller = new ArriveGoodsController();
@@ -290,44 +196,25 @@
Controller.barcode = '01049531702003111115120017181000105ZK250BXJRF\n241N30477311115120017181000105ZK250BXJRA\n241Test021115120017181000105ZK250\n01049531702003111115120017181000105ZK250';
Controller.SearchPro();
Controller.ArriveGoodsConfim();
-<<<<<<< HEAD
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')];
->>>>>>> LEXCommunityLiJun
// System.assertEquals(2, ins.size());
System.Test.stopTest();
}
}
//鏁翠綋鍒拌揣
@isTest
-<<<<<<< HEAD
static void ArriveTest() {
// // TO DO: implement unit test
- List<RecordType> rectCo = [
- SELECT Id
- FROM RecordType
- WHERE IsActive = TRUE AND SobjectType = 'Account' AND Name = '璨╁2搴�'
- ];
-=======
- static void ArriveTest() {
- // // TO DO: implement unit test
- List<RecordType> rectCo = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '璨╁2搴�'];
->>>>>>> LEXCommunityLiJun
+ 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)'];
-<<<<<<< HEAD
- 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(
@@ -354,18 +241,6 @@
UserPro_Type__c = 'ET'
);
System.runAs(new User(Id = UserInfo.getUserId())) {
-=======
- 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 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())){
->>>>>>> LEXCommunityLiJun
insert MyUser_Test;
}
@@ -373,7 +248,6 @@
// 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};
-<<<<<<< HEAD
System.runAs(MyUser_Test) {
Product2 prod01 = new Product2(
Name = 'Test01',
@@ -396,14 +270,6 @@
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};
->>>>>>> LEXCommunityLiJun
// Account myAccount1 = new Account(name='Testaccount001',Dealer_discount__c =30,RecordTypeId = rectCo[0].Id);
// insert myAccount1;
Consumable_order__c Order2 = new Consumable_order__c();
@@ -485,10 +351,6 @@
Orderdet3.SerialLotNo__c = '5ZK';
//Orderdet3.Box_Piece__c = '涓�';
-<<<<<<< HEAD
-=======
-
->>>>>>> LEXCommunityLiJun
//鍑哄簱浜у搧
Consumable_order_details2__c Orderdet4 = new Consumable_order_details2__c();
Orderdet4.Name = 'OCM_01_001005';
@@ -497,11 +359,7 @@
Orderdet4.Asset_Model_No__c = 'Test01';
Orderdet4.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
Orderdet4.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJRD';
-<<<<<<< HEAD
Orderdet4.Send_Date__c = Date.today();
-=======
- Orderdet4.Send_Date__c = Date.today();
->>>>>>> LEXCommunityLiJun
Orderdet4.Arrive_date__c = Date.today();
Orderdet4.Box_Piece__c = '鐩�';
Orderdet4.TracingCode__c = 'BXJRD';
@@ -519,21 +377,11 @@
Orderdet5.Consumable_Shipment_order__c = Order1.Id;
Orderdet5.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
Orderdet5.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJRE';
-<<<<<<< HEAD
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 };
-=======
- Orderdet5.Arrive_date__c = Date.today();
- Orderdet5.Box_Piece__c = '鐩�';
- Orderdet5.TracingCode__c = 'BXJRE';
- Orderdet5.SerialLotNo__c = '5ZK';
- insert new Consumable_order_details2__c[] {Orderdet1, Orderdet2,Orderdet3,Orderdet4,Orderdet5};
-
-
->>>>>>> LEXCommunityLiJun
ArriveGoodsController Controller = new ArriveGoodsController();
PageReference page = new PageReference('/apex/ArriveGoods?ArrType=Arr');
@@ -548,39 +396,19 @@
System.assertEquals('OCM_01_001002', controller.ConsumableorderdetailsRecords[0].esd.Name);
// System.assertEquals(2, controller.ConsumableorderdetailsRecordserror.size());
System.Test.stopTest();
-<<<<<<< HEAD
-=======
-
-
->>>>>>> LEXCommunityLiJun
}
}
//鏁翠綋鍒拌揣
@isTest
-<<<<<<< HEAD
static void ArriveTest1() {
// // TO DO: implement unit test
- List<RecordType> rectCo = [
- SELECT Id
- FROM RecordType
- WHERE IsActive = TRUE AND SobjectType = 'Account' AND Name = '璨╁2搴�'
- ];
-=======
- static void ArriveTest1() {
- // // TO DO: implement unit test
- List<RecordType> rectCo = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '璨╁2搴�'];
->>>>>>> LEXCommunityLiJun
+ 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)'];
-<<<<<<< HEAD
- 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(
@@ -608,19 +436,6 @@
UserPro_Type__c = 'ET'
);
System.runAs(new User(Id = UserInfo.getUserId())) {
-=======
- 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 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())){
->>>>>>> LEXCommunityLiJun
insert MyUser_Test;
}
@@ -628,7 +443,6 @@
// 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};
-<<<<<<< HEAD
System.runAs(MyUser_Test) {
Product2 prod01 = new Product2(
Name = 'Test01',
@@ -652,15 +466,6 @@
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};
->>>>>>> LEXCommunityLiJun
// Account myAccount1 = new Account(name='Testaccount001',Dealer_discount__c =30,RecordTypeId = rectCo[0].Id);
// insert myAccount1;
Consumable_order__c Order2 = new Consumable_order__c();
@@ -740,10 +545,6 @@
Orderdet3.TracingCode__c = 'BXJRC';
Orderdet3.SerialLotNo__c = '5ZK';
-<<<<<<< HEAD
-=======
-
->>>>>>> LEXCommunityLiJun
//鍑哄簱浜у搧
Consumable_order_details2__c Orderdet4 = new Consumable_order_details2__c();
Orderdet4.Name = 'OCM_01_001005';
@@ -752,11 +553,7 @@
Orderdet4.Asset_Model_No__c = 'Test01';
Orderdet4.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
Orderdet4.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJRD';
-<<<<<<< HEAD
Orderdet4.Send_Date__c = Date.today();
-=======
- Orderdet4.Send_Date__c = Date.today();
->>>>>>> LEXCommunityLiJun
Orderdet4.TracingCode__c = 'BXJRD';
Orderdet4.SerialLotNo__c = '5ZK';
//Orderdet4.Box_Piece__c = '鐩�';
@@ -772,21 +569,11 @@
Orderdet5.Consumable_Shipment_order__c = Order1.Id;
Orderdet5.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
Orderdet5.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJRE';
-<<<<<<< HEAD
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 };
-=======
- Orderdet5.Arrive_date__c = Date.today();
- Orderdet5.Box_Piece__c = '鐩�';
- Orderdet5.TracingCode__c = 'BXJRE';
- Orderdet5.SerialLotNo__c = '5ZK';
- insert new Consumable_order_details2__c[] {Orderdet1, Orderdet2,Orderdet3,Orderdet4,Orderdet5};
-
-
->>>>>>> LEXCommunityLiJun
ArriveGoodsController Controller = new ArriveGoodsController();
PageReference page = new PageReference('/apex/ArriveGoods?ArrType=Arr');
@@ -801,7 +588,6 @@
System.assertEquals('OCM_01_001002', controller.ConsumableorderdetailsRecords[0].esd.Name);
// System.assertEquals(1, controller.ConsumableorderdetailsRecordserror.size());
System.Test.stopTest();
-<<<<<<< HEAD
}
}
@@ -809,20 +595,12 @@
@isTest
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',
@@ -985,156 +763,6 @@
Orderdet6.TracingCode__c = 'BXJRF';
insert new List<Consumable_order_details2__c>{ Orderdet1, Orderdet2, Orderdet3, Orderdet4, Orderdet5, Orderdet6 };
-=======
-
-
- }
- }
-
-
-
-
- //杩斿搧
- @isTest
- static void productReturn() {
- // // 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 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',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.RecordTypeid = System.Label.RT_ConOrder_Delivery;
- Order1.Order_ProType__c = 'ET';
- //杩斿搧璁㈠崟
-
- 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_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.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJRF';
- Orderdet1.TracingCode__c = 'BXJRF';
- //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.Arrive_date__c = Date.today();
- Orderdet2.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
- Orderdet2.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJRI';
- Orderdet2.TracingCode__c = 'BXJRF';
- //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.IsArrival__c = true;
- Orderdet3.Arrive_date__c = Date.today();
- Orderdet3.Used_date__c = Date.today();
- Orderdet3.Consumable_Sale_order__c = Order1.Id;
- Orderdet3.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
- Orderdet3.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJRJ';
- Orderdet3.Box_Piece__c ='鐩�';
- Orderdet3.TracingCode__c = 'BXJRF';
- //鍑哄簱
- 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.IsArrival__c = true;
- Orderdet4.Arrive_date__c = Date.today();
- Orderdet4.Send_Date__c = Date.today();
- Orderdet4.Consumable_Shipment_order__c = Order1.Id;
- Orderdet4.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
- Orderdet4.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJRN';
- Orderdet4.Box_Piece__c ='涓�';
- Orderdet4.TracingCode__c = 'BXJRF';
- //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 = 'BXJRF';
- //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 = 'BXJRF';
-
- insert new Consumable_order_details2__c[] {Orderdet1, Orderdet2,Orderdet3,Orderdet4,Orderdet5,Orderdet6};
->>>>>>> LEXCommunityLiJun
PageReference page = new PageReference('/apex/ArriveGoods?ArrType=ReG');
System.Test.setCurrentPage(page);
ArriveGoodsController Controller = new ArriveGoodsController();
@@ -1152,50 +780,26 @@
//System.assertEquals('OCM_01_001002', controller.ConsumableorderdetailsRecordserror[2].esd.Name);
//System.assertEquals('OCM_02_001001', controller.ConsumableorderdetailsRecordserror[3].esd.Name);
Controller.GoodsReturnCheck();
-<<<<<<< HEAD
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;
->>>>>>> LEXCommunityLiJun
//System.assertEquals(1, controller.ShowGoodsofReturnList.size());
Controller.UpdateGoodsOfReturn();
Controller.ToReturnGoodsPage();
Controller.geterrorsize();
System.Test.stopTest();
-<<<<<<< HEAD
-=======
-
->>>>>>> LEXCommunityLiJun
}
}
//杩斿搧
@isTest
-<<<<<<< HEAD
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搴�'
- ];
-=======
- 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搴�'];
->>>>>>> LEXCommunityLiJun
+ 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)'];
-<<<<<<< HEAD
- 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',
@@ -1274,55 +878,6 @@
Orderdet.Consumable_count__c = 4;
insert Orderdet;
-=======
- 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())){
- 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 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.Order_ProType__c = 'ET';
- insert Order1;
- //Consumable_order__c coc = [select Dealer_Info__r.name from Consumable_order__c where Id =:Order1.Id];
- //system.assertEquals('qeee',coc.Dealer_Info__r.name);
-
- //璁㈠崟鏄庣粏
- //fahuo
- Consumable_orderdetails__c Orderdet = new Consumable_orderdetails__c();
- Orderdet.Name = 'OCM_01_001001';
- 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;
-
->>>>>>> LEXCommunityLiJun
//鍙戣揣鏄庣粏
//fahuo
/*Consumable_order_details2__c Orderdet1 = new Consumable_order_details2__c();
@@ -1356,13 +911,8 @@
Orderdet3.Consumable_Arrived_order__c = Order1.Id;
//Orderdet3.IsArrival__c = true;
Orderdet3.Consumable_Sale_order__c = Order1.Id;
-<<<<<<< HEAD
Orderdet3.Box_Piece__c = '鐩�';
Orderdet3.Used_date__c = Date.today();
-=======
- Orderdet3.Box_Piece__c ='鐩�';
- Orderdet3.Used_date__c= Date.today();
->>>>>>> LEXCommunityLiJun
Orderdet3.Arrive_date__c = Date.today();
Orderdet3.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
Orderdet3.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJRF';
@@ -1377,11 +927,7 @@
Orderdet4.Consumable_Arrived_order__c = Order1.Id;
//Orderdet4.IsArrival__c = true;
Orderdet4.Consumable_Shipment_order__c = Order1.Id;
-<<<<<<< HEAD
Orderdet4.Box_Piece__c = '涓�';
-=======
- Orderdet4.Box_Piece__c ='涓�';
->>>>>>> LEXCommunityLiJun
Orderdet4.Send_Date__c = Date.today();
Orderdet4.Arrive_date__c = Date.today();
Orderdet4.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
@@ -1398,17 +944,10 @@
Orderdet5.Cancellation_Flag__c = true;
Orderdet5.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
Orderdet5.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJRZ';
-<<<<<<< HEAD
Orderdet5.Box_Piece__c = '涓�';
Orderdet5.TracingCode__c = 'BXJRZ';
Orderdet5.SerialLotNo__c = '5ZK';
insert new List<Consumable_order_details2__c>{ Orderdet3, Orderdet4, Orderdet5 };
-=======
- Orderdet5.Box_Piece__c ='涓�';
- Orderdet5.TracingCode__c = 'BXJRZ';
- Orderdet5.SerialLotNo__c = '5ZK';
- insert new Consumable_order_details2__c[] {Orderdet3,Orderdet4,Orderdet5};
->>>>>>> LEXCommunityLiJun
PageReference page = new PageReference('/apex/ArriveGoods?ArrType=ReG');
System.Test.setCurrentPage(page);
@@ -1421,21 +960,12 @@
Controller.SearchPro();
// System.assertEquals(1, controller.ConsumableorderdetailsRecordserror.size());
System.assertEquals(2, controller.ShowGoodsofReturnList.size());
-<<<<<<< HEAD
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>();
-=======
- 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>();
->>>>>>> LEXCommunityLiJun
list1.add(Controller.barcode = '01234567898');
Controller.inventoryEntryNoESetId(list1);
@@ -1498,38 +1028,19 @@
list1.add(Controller.barcode = '0112345678901231106789012105625001234');
Controller.inventoryEntryNoESetId(list1);
System.Test.stopTest();
-<<<<<<< HEAD
-=======
-
->>>>>>> LEXCommunityLiJun
}
}
//鐩存帴鍒拌揣
@isTest
-<<<<<<< HEAD
static void arrivedirect() {
// // TO DO: implement unit test
- List<RecordType> rectCo = [
- SELECT Id
- FROM RecordType
- WHERE IsActive = TRUE AND SobjectType = 'Account' AND Name = '璨╁2搴�'
- ];
-=======
- static void arrivedirect() {
- // // TO DO: implement unit test
- List<RecordType> rectCo = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '璨╁2搴�'];
->>>>>>> LEXCommunityLiJun
+ 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)'];
-<<<<<<< HEAD
- 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',
@@ -1675,127 +1186,6 @@
//System.assertEquals('鈼�', proList[0].Estimation_Entry_Possibility__c);
insert new List<Consumable_order_details2__c>{ Orderdet1, Orderdet2, Orderdet3, Orderdet4 };
-=======
- 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())){
- 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 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, 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(
- // Name = 'Test20181204',
- // Register_new__c = '314',
- // Register_old__c = '36815'
- // );
- //insert prcc;
- //浜у搧-浜у搧娉ㄥ唽璇佸叧绯� prod01
- 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
- );
- insert prlc2;
- //璁㈠崟
-
- 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;
- 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 = 4;
- insert Orderdet;
-
- //鍙戣揣鏄庣粏
- //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 = 'Test01';
- Orderdet1.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
- 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 = 'Test01';
- Orderdet2.Consumable_Arrived_order__c = Order1.Id;
- //Orderdet2.IsArrival__c = true;
- Orderdet2.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
- Orderdet2.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJRI';
- //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 = 'Test01';
- Orderdet3.Consumable_Arrived_order__c = Order1.Id;
- //Orderdet3.IsArrival__c = true;
- Orderdet3.Consumable_Sale_order__c = Order1.Id;
- Orderdet3.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
- Orderdet3.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJRJ';
- //鍑哄簱
- 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 = 'Test01';
- Orderdet4.Consumable_Arrived_order__c = Order1.Id;
- //Orderdet4.IsArrival__c = true;
- Orderdet4.Consumable_Shipment_order__c = Order1.Id;
- Orderdet4.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
- Orderdet4.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJRN';
- //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 Consumable_order_details2__c[] {Orderdet1, Orderdet2,Orderdet3,Orderdet4};
->>>>>>> LEXCommunityLiJun
PageReference page = new PageReference('/apex/ArriveGoods?Esetid=' + Order1.Id);
System.Test.setCurrentPage(page);
ArriveGoodsController Controller = new ArriveGoodsController();
@@ -1812,29 +1202,14 @@
//鐩存帴鍒拌揣
@isTest
-<<<<<<< HEAD
static void arrivedirect241() {
// // TO DO: implement unit test
- List<RecordType> rectCo = [
- SELECT Id
- FROM RecordType
- WHERE IsActive = TRUE AND SobjectType = 'Account' AND Name = '璨╁2搴�'
- ];
-=======
- static void arrivedirect241() {
- // // TO DO: implement unit test
- List<RecordType> rectCo = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '璨╁2搴�'];
->>>>>>> LEXCommunityLiJun
+ 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)'];
-<<<<<<< HEAD
- 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',
@@ -2070,204 +1445,11 @@
Orderdet7.TracingCode__c = '20170808';
Orderdet7 = new Consumable_order_details2__c();
-=======
- 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())){
- 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 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, 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(
- // Name = 'Test20181204',
- // Register_new__c = '314',
- // Register_old__c = '36815'
- // );
- //insert prcc;
- //浜у搧-浜у搧娉ㄥ唽璇佸叧绯� prod01
- 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
- );
- insert prlc2;
- //璁㈠崟
-
- 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;
- insert Order1;
- 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.RT_ConOrder_Delivery;
- Order2.Deliver_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.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.ReturnGs_Upload_Date__c = Date.today();
- 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_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.Arrive_date__c = Date.today();
- Orderdet1.Rrturn_count__c =1;
- Orderdet1.TracingCode__c = '20170808';
- //daohuo
- Consumable_order_details2__c Orderdet2 = new Consumable_order_details2__c();
- Orderdet2.Name = 'OCM_01_001002';
- Orderdet2.Consumable_order_minor__c = Order2.Id;
- Orderdet2.Consumable_Product__c = pro1.Id;
- Orderdet2.Asset_Model_No__c = 'Test01';
- Orderdet2.Consumable_Arrived_order__c = Order2.Id;
- //Orderdet2.IsArrival__c = true;
- Orderdet2.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
- Orderdet2.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJRI';
- Orderdet2.Arrive_date__c = Date.today();
- Orderdet2.TracingCode__c = '20170808';
-
- Consumable_order_details2__c Orderdet3 = new Consumable_order_details2__c();
- Orderdet3.Name = 'OCM_01_001002';
- Orderdet3.Consumable_order_minor__c = Order2.Id;
- Orderdet3.Consumable_Product__c = pro1.Id;
- Orderdet3.Asset_Model_No__c = 'Test01';
- Orderdet3.Consumable_Arrived_order__c = Order2.Id;
- //Orderdet3.IsArrival__c = true;
- Orderdet3.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
- Orderdet3.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJR2';
- Orderdet3.Used_date__c = Date.today();
- Orderdet3.TracingCode__c = '20170808';
- //sale
- Consumable_order_details2__c Orderdet4 = new Consumable_order_details2__c();
- Orderdet4.Name = 'OCM_01_001003';
- Orderdet4.Consumable_order_minor__c = Order2.Id;
- Orderdet4.Consumable_Product__c = pro1.Id;
- Orderdet4.Asset_Model_No__c = 'Test01';
- Orderdet4.Consumable_Arrived_order__c = Order2.Id;
- //Orderdet3.IsArrival__c = true;
- 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 = new Consumable_order_details2__c();
- Orderdet4.Name = 'OCM_01_001003';
- Orderdet4.Consumable_order_minor__c = Order1.Id;
- Orderdet4.Consumable_Product__c = pro1.Id;
- Orderdet4.Asset_Model_No__c = 'Test01';
- Orderdet4.Consumable_Arrived_order__c = Order1.Id;
- //Orderdet3.IsArrival__c = true;
- 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.TracingCode__c = '20170808';
- Consumable_order_details2__c Orderdet5 = new Consumable_order_details2__c();
- Orderdet5.Name = 'OCM_01_001003';
- Orderdet5.Consumable_order_minor__c = Order2.Id;
- Orderdet5.Consumable_Product__c = pro1.Id;
- Orderdet5.Asset_Model_No__c = 'Test01';
- Orderdet5.Consumable_Arrived_order__c = Order2.Id;
- //Orderdet3.IsArrival__c = true;
- Orderdet5.Consumable_Sale_order__c = Order2.Id;
- Orderdet5.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
- Orderdet5.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJRJ';
- Orderdet5.Arrive_date__c = Date.today().addDays(1);
- 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.Box_Piece__c = '鐩�';
- Orderdet5.TracingCode__c = '20170808';
-
- //鍑哄簱
- Consumable_order_details2__c Orderdet6 = new Consumable_order_details2__c();
- Orderdet6.Name = 'OCM_01_001004';
- Orderdet6.Consumable_order_minor__c = Order1.Id;
- Orderdet6.Consumable_Product__c = pro1.Id;
- Orderdet6.Asset_Model_No__c = 'Test01';
- Orderdet6.Consumable_Arrived_order__c = Order1.Id;
- //Orderdet4.IsArrival__c = true;
- 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.Box_Piece__c = '鐩�';
- Orderdet6.Rrturn_count__c =1;
- Orderdet6.TracingCode__c = '20170808';
-
- // 鍗曚綅涓轰釜鐨凚arcode瀵瑰簲鐨勫嚭搴撳崟
- Consumable_order_details2__c Orderdet7 = new Consumable_order_details2__c();
->>>>>>> LEXCommunityLiJun
Orderdet7.Name = 'OCM_01_001004';
Orderdet7.Consumable_order_minor__c = Order1.Id;
Orderdet7.Consumable_Product__c = pro1.Id;
Orderdet7.Asset_Model_No__c = 'Test01';
Orderdet7.Consumable_Arrived_order__c = Order1.Id;
-<<<<<<< HEAD
Orderdet7.Consumable_Shipment_order__c = Order1.Id;
Orderdet7.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
Orderdet7.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJR7';
@@ -2399,168 +1581,20 @@
Controller.SearchPro();
// System.assertEquals(1, controller.consumableInventory.size());
-=======
- //Orderdet4.IsArrival__c = true;
- 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.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.TracingCode__c = '20170808';
-
- Orderdet7 = new Consumable_order_details2__c();
- Orderdet7.Name = 'OCM_01_001004';
- Orderdet7.Consumable_order_minor__c = Order1.Id;
- Orderdet7.Consumable_Product__c = pro1.Id;
- Orderdet7.Asset_Model_No__c = 'Test01';
- Orderdet7.Consumable_Arrived_order__c = Order1.Id;
- 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.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.TracingCode__c = '20170808';
-
- 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 = pro1.Id;
- Orderdet8.Asset_Model_No__c = 'Test01';
- Orderdet8.Consumable_Arrived_order__c = Order1.Id;
- //Orderdet4.IsArrival__c = true;
- 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.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.Intra_Trade_List_RMB__c = 1;
- Orderdet8.Sterilization_limit__c = Date.today();
- Orderdet8.SerialLotNo__c ='11鎵规';
- Orderdet8.TracingCode__c = '20170808';
- Orderdet8.Arrive_date__c = Date.today();
-
- Consumable_order_details2__c Orderdet9 = new Consumable_order_details2__c();
- Orderdet9.Name = 'OCM_01_001004';
- Orderdet9.Consumable_order_minor__c = Order1.Id;
- Orderdet9.Consumable_Product__c = pro1.Id;
- Orderdet9.Asset_Model_No__c = 'Test01';
- Orderdet9.Consumable_Arrived_order__c = Order1.Id;
- 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.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.TracingCode__c = '20170808';
- Consumable_order_details2__c lose = new Consumable_order_details2__c();
- lose.Name = 'OCM_01_001004';
- lose.Consumable_order_minor__c = Order1.Id;
- lose.Consumable_Product__c = pro1.Id;
- lose.Asset_Model_No__c = 'Test01';
- lose.Consumable_Arrived_order__c = Order1.Id;
- //Orderdet4.IsArrival__c = true;
- 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.Box_Piece__c = '鐩�';
- lose.TracingCode__c = '20170808';
- Consumable_order_details2__c lose1 = new Consumable_order_details2__c();
- lose1.Name = 'OCM_01_001004';
- lose1.Consumable_order_minor__c = Order1.Id;
- lose1.Consumable_Product__c = pro1.Id;
- lose1.Asset_Model_No__c = 'Test01';
- lose1.Consumable_Arrived_order__c = Order1.Id;
- //Orderdet4.IsArrival__c = true;
- 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.Box_Piece__c = '鐩�';
- lose1.TracingCode__c = '20170808';
- Consumable_order_details2__c lose2 = new Consumable_order_details2__c();
- lose2.Name = 'OCM_01_001004';
- lose2.Consumable_order_minor__c = Order2.Id;
- lose2.Consumable_Product__c = pro1.Id;
- lose2.Asset_Model_No__c = 'Test01';
- lose2.Consumable_Arrived_order__c = Order2.Id;
- //Orderdet4.IsArrival__c = true;
- 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.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.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 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();
- //鍒濆鍖栨祴璇�
- System.Test.startTest();
- Controller.init();
-
- Controller.barcode = '01049531702003111115120017181000105ZK250BXJRF\n01049531702003111115120017181000105ZK250BXJR3\n01049531702003111115120017181000105ZK250BXJ13\n01049531702003111115120017181000105ZK250BXJRI\n01049531702003111115120017181000105ZK250BXJR2\n01049531702003111115120017181000105ZK250BXJR3\n01049531702003111115120017181000105ZK250BXJR4\n01049531702003111115120017181000105ZK250BXJR1\n01049531702003111115120017181000105ZK250BXJR7\n01049531702003111115120017181000105ZK250BXJR9\n01049531702003111115120017181000105ZK250BXJR8\n01049531702003111115120017181000105ZK250BXJR5\n01049531702003111115120017181000105ZK250BXJR6\n01049531702003111115120017181000105ZK250BXJR7\n01049531702003111115120017181000105ZK250BXAAA\n01049531702003111115120017181000105ZK250BXAAB';
- Controller.SearchPro();
- // System.assertEquals(1, controller.consumableInventory.size());
-
->>>>>>> LEXCommunityLiJun
System.Test.stopTest();
}
}
-<<<<<<< HEAD
//杩斿搧 鏄庣粏2涓嶅瓨鍦ㄧ殑瀵瑰簲鐨勫埌璐ц鍗曟槑缁�
@isTest
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',
@@ -2659,85 +1693,6 @@
Orderdet1.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJRF';
Orderdet1.TracingCode__c = 'BXSYS';
-=======
-
- //杩斿搧 鏄庣粏2涓嶅瓨鍦ㄧ殑瀵瑰簲鐨勫埌璐ц鍗曟槑缁�
- @isTest
- 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搴�'];
- 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 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',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.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;
-
- //璁㈠崟鏄庣粏
- //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';
-
->>>>>>> LEXCommunityLiJun
//daohuo
Consumable_order_details2__c Orderdet2 = new Consumable_order_details2__c();
Orderdet2.Name = 'OCM_01_001002';
@@ -2783,11 +1738,7 @@
Orderdet5.Cancellation_Date__c = Date.today();
Orderdet5.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
Orderdet5.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJRZ';
-<<<<<<< HEAD
Orderdet5.Box_Piece__c = '涓�';
-=======
- Orderdet5.Box_Piece__c ='涓�';
->>>>>>> LEXCommunityLiJun
Orderdet5.TracingCode__c = 'BXSYS';
//fanpin
Consumable_order_details2__c Orderdet6 = new Consumable_order_details2__c();
@@ -2798,11 +1749,7 @@
Orderdet6.Consumable_Return_order__c = Order2.Id;
Orderdet6.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
Orderdet6.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJRA';
-<<<<<<< HEAD
Orderdet6.Box_Piece__c = '涓�';
-=======
- Orderdet6.Box_Piece__c ='涓�';
->>>>>>> LEXCommunityLiJun
Orderdet6.TracingCode__c = 'BXSYS';
//鍙戣揣鏄庣粏
@@ -2816,11 +1763,7 @@
Orderdet7.Bar_Code__c = '01049531702003111115120017181000105ZK250BX333';
Orderdet7.TracingCode__c = 'BXSYS';
-<<<<<<< HEAD
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};
->>>>>>> LEXCommunityLiJun
PageReference page = new PageReference('/apex/ArriveGoods?ArrType=ReG');
System.Test.setCurrentPage(page);
ArriveGoodsController Controller = new ArriveGoodsController();
@@ -2844,36 +1787,17 @@
controller.getinventorysize();
System.Test.stopTest();
-<<<<<<< HEAD
}
}
@isTest
static void barcodecheck() {
// // TO DO: implement unit test
- List<RecordType> rectCo = [
- SELECT Id
- FROM RecordType
- WHERE IsActive = TRUE AND SobjectType = 'Account' AND Name = '璨╁2搴�'
- ];
-=======
-
- }
- }
- @isTest
- static void barcodecheck() {
- // // TO DO: implement unit test
- List<RecordType> rectCo = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '璨╁2搴�'];
->>>>>>> LEXCommunityLiJun
+ 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)'];
-<<<<<<< HEAD
- 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',
@@ -2900,26 +1824,12 @@
UserPro_Type__c = 'ET'
);
System.runAs(new User(Id = UserInfo.getUserId())) {
-=======
- 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())){
->>>>>>> LEXCommunityLiJun
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};
-<<<<<<< HEAD
System.runAs(MyUser_Test) {
Product2 prod01 = new Product2(
Name = 'Test01',
@@ -2946,18 +1856,6 @@
ArriveGoodsController Controller = new ArriveGoodsController();
//鍒濆鍖栨祴璇�
list<String> list1 = new List<String>();
-=======
- 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>();
->>>>>>> LEXCommunityLiJun
list1.clear();
list1.add(Controller.barcode = '2413456250BBBBA');
Controller.inventoryEntry(list1);
@@ -3075,29 +1973,14 @@
}
}
@isTest
-<<<<<<< HEAD
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搴�'
- ];
-=======
- 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搴�'];
->>>>>>> LEXCommunityLiJun
+ 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)'];
-<<<<<<< HEAD
- 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',
@@ -3124,26 +2007,12 @@
UserPro_Type__c = 'ET'
);
System.runAs(new User(Id = UserInfo.getUserId())) {
-=======
- 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())){
->>>>>>> LEXCommunityLiJun
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};
-<<<<<<< HEAD
System.runAs(MyUser_Test) {
Product2 prod01 = new Product2(
Name = 'Test01',
@@ -3177,24 +2046,6 @@
RegisterNoClass_New__c = '6815',
RegisterNoStatus__c = '鏈夋晥'
);
-=======
- 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, 07, 22),
- ValidTo__c = date.newinstance(2028, 07, 22),
- RegisterNoClass_Old__c = '6815',
- RegisterNoClass_New__c = '6815',
- RegisterNoStatus__c = '鏈夋晥'
- );
->>>>>>> LEXCommunityLiJun
insert prc;
//鏂版棫鍏崇郴瀵圭収琛�
//Product_Register_contrast__c prcc = new Product_Register_contrast__c(
@@ -3204,23 +2055,10 @@
// );
//insert prcc;
//浜у搧-浜у搧娉ㄥ唽璇佸叧绯� prod01
-<<<<<<< HEAD
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 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
- );
->>>>>>> LEXCommunityLiJun
insert prlc2;
PageReference page = new PageReference('/apex/ArriveGoods?ArrType=ReG');
System.Test.setCurrentPage(page);
@@ -3228,7 +2066,6 @@
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);
-<<<<<<< HEAD
List<Product2__c> product2InStore = [
SELECT Id, Name, Name__c, Intra_Trade_List_RMB__c, Asset_Model_No__c, OT_CODE__c
FROM Product2__c
@@ -3236,15 +2073,6 @@
];
//System.assertEquals(1, product2InStore.size());
list<String> list1 = new List<String>();
-=======
- 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>();
->>>>>>> LEXCommunityLiJun
list1.clear();
list1.add(Controller.barcode = '2413456250BBBBA');
Controller.inventoryEntryNoESetId(list1);
@@ -3323,10 +2151,6 @@
list1.add(Controller.barcode = '241test111204121778900034567890250BBBBQ');
Controller.inventoryEntryNoESetId(list1);
-<<<<<<< HEAD
-=======
-
->>>>>>> LEXCommunityLiJun
list1.clear();
list1.add(Controller.barcode = '0111234101204120118901231712a4001234250BBBBR');
Controller.inventoryEntryNoESetId(list1);
@@ -3346,38 +2170,19 @@
list1.clear();
list1.add(Controller.barcode = '011123410120412017120100250AAAAA');
Controller.inventoryEntryNoESetId(list1);
-<<<<<<< HEAD
-=======
-
->>>>>>> LEXCommunityLiJun
}
}
//鑷姩鍑哄簱
@isTest
-<<<<<<< HEAD
static void addSaleOrderAuto() {
// // TO DO: implement unit test
- List<RecordType> rectCo = [
- SELECT Id
- FROM RecordType
- WHERE IsActive = TRUE AND SobjectType = 'Account' AND Name = '璨╁2搴�'
- ];
-=======
- static void addSaleOrderAuto() {
- // // TO DO: implement unit test
- List<RecordType> rectCo = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '璨╁2搴�'];
->>>>>>> LEXCommunityLiJun
+ 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)'];
-<<<<<<< HEAD
- 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',
@@ -3455,54 +2260,6 @@
Orderdets8.SerialLotNo__c = '5ZK';
insert Orderdets8;
-=======
- 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())){
- 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 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();
- Order2.Name = 'OCM_02_001';
- Order2.Order_status__c = '鎵瑰噯';
- Order2.Order_type__c = '璁㈠崟';
- Order2.Dealer_Info__c = myAccount1.Id;
- Order2.RecordTypeid = System.Label.RT_ConOrder_Delivery;
- insert Order2;
- //鍙戦敊搴� 宸插埌璐�
- Consumable_order_details2__c Orderdets8 = new Consumable_order_details2__c();
- Orderdets8.Name = 'OCM_01_001011';
- Orderdets8.Consumable_order_minor__c = Order2.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.Arrive_date__c = Date.today();
- Orderdets8.TracingCode__c = 'BXSYS';
- Orderdets8.SerialLotNo__c = '5ZK';
- insert Orderdets8;
-
->>>>>>> LEXCommunityLiJun
ArriveGoodsController Controller = new ArriveGoodsController();
PageReference page = new PageReference('/apex/ArriveGoods?ArrType=Arr');
System.Test.setCurrentPage(page);
@@ -3520,29 +2277,14 @@
// UPDATE TCM TEST1
@isTest
-<<<<<<< HEAD
static void methodTest1() {
// // TO DO: implement unit test
- List<RecordType> rectCo = [
- SELECT Id
- FROM RecordType
- WHERE IsActive = TRUE AND SobjectType = 'Account' AND Name = '璨╁2搴�'
- ];
-=======
- static void methodTest1() {
- // // TO DO: implement unit test
- List<RecordType> rectCo = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '璨╁2搴�'];
->>>>>>> LEXCommunityLiJun
+ 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)'];
-<<<<<<< HEAD
- 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',
@@ -3648,82 +2390,6 @@
Orderdet2.SerialLotNo__c = '5ZK';
insert Orderdet2;
-=======
- 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())){
- 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 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';
- 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 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 = 4;
- insert Orderdet;
-
- //鍙戣揣鏄庣粏
- //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 = 'Test01';
- Orderdet1.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
- Orderdet1.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJRF';
- Orderdet1.Arrive_date__c=Date.today();
- // Orderdet1.Send_Date__c=Date.today();
- // Orderdet1.Used_date__c=Date.today();
- Orderdet1.TracingCode__c = 'BXJRF';
- Orderdet1.SerialLotNo__c = '5ZK';
- insert Orderdet1;
-
- //fahuo
- 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';
- Orderdet2.Arrive_date__c=Date.today();
- Orderdet2.TracingCode__c = 'BXJRF';
- Orderdet2.SerialLotNo__c = '5ZK';
- insert Orderdet2;
-
->>>>>>> LEXCommunityLiJun
PageReference page = new PageReference('/apex/ArriveGoods?ESetid=' + Order1.Id);
System.Test.setCurrentPage(page);
ArriveGoodsController Controller = new ArriveGoodsController();
@@ -3735,38 +2401,22 @@
// System.assertEquals(1, Controller.ConsumableorderdetailsRecords.size());
// System.assertEquals(2, Controller.consumableInventory.size());
Controller.ArriveGoodsConfim();
-<<<<<<< HEAD
- 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];
->>>>>>> LEXCommunityLiJun
+ List<Consumable_order_details2__c> ins = [SELECT Id, Name FROM Consumable_order_details2__c];
// System.assertEquals(3, ins.size());
System.Test.stopTest();
}
}
-<<<<<<< HEAD
//杩斿搧
@isTest
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',
@@ -3939,159 +2589,6 @@
list1.add(Controller.barcode = '012345678901234A67');
Controller.inventoryEntryNoESetId(list1);
-=======
-
- //杩斿搧
- @isTest
- static void methodTest2() {
- // // 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 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',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.RecordTypeid = System.Label.RT_ConOrder_Delivery;
- Order1.Order_ProType__c = 'ET';
- insert Order1;
- //Consumable_order__c coc = [select Dealer_Info__r.name from Consumable_order__c where Id =:Order1.Id];
- //system.assertEquals('qeee',coc.Dealer_Info__r.name);
-
- //璁㈠崟鏄庣粏
- //fahuo
- Consumable_orderdetails__c Orderdet = new Consumable_orderdetails__c();
- Orderdet.Name = 'OCM_01_001001';
- 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_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';
- //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.IsArrival__c = true;
- Orderdet3.Consumable_Sale_order__c = Order1.Id;
- 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';
- Orderdet3.TracingCode__c = 'BXJRF';
- Orderdet3.SerialLotNo__c = '5ZK';
- //鍑哄簱
- 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.IsArrival__c = true;
- Orderdet4.Consumable_Shipment_order__c = Order1.Id;
- Orderdet4.Box_Piece__c ='涓�';
- Orderdet4.Send_Date__c = Date.today();
- Orderdet4.Arrive_date__c = Date.today();
- Orderdet4.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
- Orderdet4.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJRN';
- Orderdet4.TracingCode__c = 'BXJRN';
- Orderdet4.SerialLotNo__c = '5ZK';
- //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.Cancellation_Flag__c = true;
- Orderdet5.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
- Orderdet5.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJRZ';
- Orderdet5.Box_Piece__c ='涓�';
- Orderdet5.TracingCode__c = 'BXJRZ';
- Orderdet5.SerialLotNo__c = '5ZK';
- insert new Consumable_order_details2__c[] {Orderdet1,Orderdet3,Orderdet4,Orderdet5};
-
- PageReference page = new PageReference('/apex/ArriveGoods?ArrType=ReG');
- System.Test.setCurrentPage(page);
- ArriveGoodsController Controller = new ArriveGoodsController();
- //鍒濆鍖栨祴璇�
- System.Test.startTest();
- Controller.init();
- //鎺掑簭
- Controller.barcode = '01049531702003111115120017181000105ZK250BXJRF\n01049531702003111115120017181000105ZK250BXJRN\n01049531702003111115120017181000105ZK250BXJRZ\n01049531702003111115120017181000105ZK250BXJRR';
- 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.UpdateGoodsOfReturn();
-
- list<String> list1 = new list<String>();
- list1.add(Controller.barcode = '01234567898');
- Controller.inventoryEntryNoESetId(list1);
-
- list1.clear();
- list1.add(Controller.barcode = '012345678901234A67');
- Controller.inventoryEntryNoESetId(list1);
-
->>>>>>> LEXCommunityLiJun
list1.clear();
list1.add(Controller.barcode = '0123456789012345117AA01');
Controller.inventoryEntryNoESetId(list1);
@@ -4147,38 +2644,19 @@
list1.add(Controller.barcode = '0112345678901231106789012105625001234');
Controller.inventoryEntryNoESetId(list1);
System.Test.stopTest();
-<<<<<<< HEAD
-=======
-
->>>>>>> LEXCommunityLiJun
}
}
//鏁翠綋鍒拌揣
@isTest
-<<<<<<< HEAD
static void ArrivejancodeTest() {
// // TO DO: implement unit test
- List<RecordType> rectCo = [
- SELECT Id
- FROM RecordType
- WHERE IsActive = TRUE AND SobjectType = 'Account' AND Name = '璨╁2搴�'
- ];
-=======
- static void ArrivejancodeTest() {
- // // TO DO: implement unit test
- List<RecordType> rectCo = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '璨╁2搴�'];
->>>>>>> LEXCommunityLiJun
+ 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)'];
-<<<<<<< HEAD
- 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(
@@ -4205,18 +2683,6 @@
UserPro_Type__c = 'ET'
);
System.runAs(new User(Id = UserInfo.getUserId())) {
-=======
- 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 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())){
->>>>>>> LEXCommunityLiJun
insert MyUser_Test;
}
@@ -4224,7 +2690,6 @@
// 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};
-<<<<<<< HEAD
System.runAs(MyUser_Test) {
Product2 prod01 = new Product2(
Name = 'Test01',
@@ -4247,14 +2712,6 @@
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};
->>>>>>> LEXCommunityLiJun
// Account myAccount1 = new Account(name='Testaccount001',Dealer_discount__c =30,RecordTypeId = rectCo[0].Id);
// insert myAccount1;
Consumable_order__c Order2 = new Consumable_order__c();
@@ -4336,10 +2793,6 @@
Orderdet3.SerialLotNo__c = '5ZK';
//Orderdet3.Box_Piece__c = '涓�';
-<<<<<<< HEAD
-=======
-
->>>>>>> LEXCommunityLiJun
//鍑哄簱浜у搧
Consumable_order_details2__c Orderdet4 = new Consumable_order_details2__c();
Orderdet4.Name = 'OCM_01_001005';
@@ -4348,11 +2801,7 @@
Orderdet4.Asset_Model_No__c = 'Test01';
Orderdet4.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
Orderdet4.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJRD';
-<<<<<<< HEAD
Orderdet4.Send_Date__c = Date.today();
-=======
- Orderdet4.Send_Date__c = Date.today();
->>>>>>> LEXCommunityLiJun
Orderdet4.Arrive_date__c = Date.today();
Orderdet4.Box_Piece__c = '鐩�';
Orderdet4.TracingCode__c = 'BXJRD';
@@ -4370,21 +2819,11 @@
Orderdet5.Consumable_Shipment_order__c = Order1.Id;
Orderdet5.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
Orderdet5.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJRE';
-<<<<<<< HEAD
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 };
-=======
- Orderdet5.Arrive_date__c = Date.today();
- Orderdet5.Box_Piece__c = '鐩�';
- Orderdet5.TracingCode__c = 'BXJRE';
- Orderdet5.SerialLotNo__c = '5ZK';
- insert new Consumable_order_details2__c[] {Orderdet1, Orderdet2,Orderdet3,Orderdet4,Orderdet5};
-
-
->>>>>>> LEXCommunityLiJun
ArriveGoodsController Controller = new ArriveGoodsController();
PageReference page = new PageReference('/apex/ArriveGoods?ArrType=Arr');
@@ -4399,7 +2838,6 @@
System.assertEquals('OCM_01_001002', controller.ConsumableorderdetailsRecords[0].esd.Name);
// System.assertEquals(2, controller.ConsumableorderdetailsRecordserror.size());
System.Test.stopTest();
-<<<<<<< HEAD
}
}
@@ -4407,20 +2845,12 @@
@isTest
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(
@@ -4626,20 +3056,12 @@
@isTest
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',
@@ -4864,19 +3286,11 @@
@isTest
static void searchProTest1() {
- 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)'
- ];
+ Profile prof = [SELECT Id FROM Profile WHERE Name = '901_缁忛攢鍟嗙ぞ鍖烘櫘閫氭潈闄恄2閲嶉獙璇�(ET)'];
Account myAccount2 = new Account(
name = 'Testaccount002',
Dealer_discount__c = 20,
@@ -4975,479 +3389,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();
}
}
}
-=======
-
-
- }
- }
-
- //鍙戦敊璐� 鍏ュ簱
- @isTest
- static void ArriveotheragencyTest() {
- // // 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)'];
-
- 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 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',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';
- Order2.Order_status__c = '鎵瑰噯';
- Order2.Order_type__c = '璁㈠崟';
- Order2.Dealer_Info__c = myAccount3.Id;
- Order2.RecordTypeid = System.Label.RT_ConOrder_Delivery;
- Order2.Order_ProType__c = 'ET';
- insert Order2;
- //鍙戦敊搴� 鏈埌璐�
- Consumable_order_details2__c Orderdets8 = new Consumable_order_details2__c();
- Orderdets8.Name = 'OCM_01_001011';
- Orderdets8.Consumable_order_minor__c = Order2.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';
- Orderdets8.SerialLotNo__c = '5ZK';
- Orderdets8.ownerid = MyUser_Test.id;
- insert Orderdets8;
-
- //鍙戦敊搴� 宸插埌璐�
- Consumable_order_details2__c Orderdets9 = new Consumable_order_details2__c();
- Orderdets9.Name = 'OCM_01_001012';
- Orderdets9.Consumable_order_minor__c = Order2.Id;
- Orderdets9.Consumable_Product__c = pro1.Id;
- Orderdets9.Asset_Model_No__c = 'Test01';
- Orderdets9.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
- Orderdets9.Bar_Code__c = '01049531702003111115120017181000105ZK250BXSYQ';
- Orderdets9.Consumable_Arrived_order__c = Order2.Id;
- Orderdets9.Arrive_date__c = Date.today();
- Orderdets9.Box_Piece__c = '鐩�';
- Orderdets9.TracingCode__c = 'BXSYQ';
- Orderdets9.SerialLotNo__c = '5ZK';
- insert Orderdets9;
-
- // 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.Order_ProType__c = 'ET';
- // Order1.RecordTypeid = System.Label.RT_ConOrder_Delivery;
- // 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 = 4;
- // 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.Box_Piece__c = '鐩�';
- // Orderdet1.TracingCode__c = 'BXJRA';
- // Orderdet1.SerialLotNo__c = '5ZK';
- // //娌″埌璐�
- // 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.Box_Piece__c = '鐩�';
- // Orderdet2.TracingCode__c = 'BXJRB';
- // Orderdet2.SerialLotNo__c = '5ZK';
- // //閿�鍞骇鍝�
- // 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.Consumable_Arrived_order__c = Order1.Id;
- // //Orderdet3.IsArrival__c = true;
- // Orderdet3.Consumable_Sale_order__c = Order1.Id;
- // 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.Box_Piece__c = '鐩�';
- // Orderdet3.TracingCode__c = 'BXJRC';
- // Orderdet3.SerialLotNo__c = '5ZK';
- // //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.Box_Piece__c = '鐩�';
- // Orderdet4.TracingCode__c = 'BXJRD';
- // Orderdet4.SerialLotNo__c = '5ZK';
- // //Orderdet4.Box_Piece__c = '鐩�';
- // //Orderdet4.Return_date__c = null;
-
- // //宸插埌璐т骇鍝�
- // 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.Consumable_Arrived_order__c = Order1.Id;
- // 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.Box_Piece__c = '鐩�';
- // Orderdet5.TracingCode__c = 'BXJRE';
- // 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);
- //鍒濆鍖栨祴璇�
- System.Test.startTest();
- Controller.init();
- //鎺掑簭
- Controller.barcode = '01049531702003111115120017181000105ZK250BXSYS\n01049531702003111115120017181000105ZK250BXSYQ';
- Controller.SearchPro();
- Controller.ArriveGoodsConfim();
-
- // System.assertEquals(2, controller.ConsumableorderdetailsRecordserror.size());
- System.Test.stopTest();
-
-
- }
- }
-
- //杩斿搧
- @isTest
- static void addInventoryDetails1() {
- // // 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 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',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();
- 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 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_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.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJRF';
- Orderdet1.TracingCode__c = 'BXJRF';
- //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.Arrive_date__c = Date.today();
- Orderdet2.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
- Orderdet2.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJRI';
- Orderdet2.TracingCode__c = 'BXJRF';
- //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.IsArrival__c = true;
- Orderdet3.Arrive_date__c = Date.today();
- Orderdet3.Used_date__c = Date.today();
- Orderdet3.Consumable_Sale_order__c = Order1.Id;
- Orderdet3.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
- Orderdet3.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJRJ';
- Orderdet3.Box_Piece__c ='鐩�';
- Orderdet3.TracingCode__c = 'BXJRF';
- //鍑哄簱
- 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.IsArrival__c = true;
- Orderdet4.Arrive_date__c = Date.today();
- Orderdet4.Send_Date__c = Date.today();
- Orderdet4.Consumable_Shipment_order__c = Order1.Id;
- Orderdet4.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
- Orderdet4.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJRN';
- Orderdet4.Box_Piece__c ='涓�';
- Orderdet4.TracingCode__c = 'BXJRF';
- //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 = 'BXJRF';
- //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 = 'BXJRF';
-
- // 涓㈠け
- Consumable_order_details2__c Orderdet7 = new Consumable_order_details2__c();
- Orderdet7.Name = 'OCM_01_001002';
- Orderdet7.Consumable_order_minor__c = Order1.Id;
- Orderdet7.Consumable_Product__c = pro1.Id;
- Orderdet7.Asset_Model_No__c = 'Pro001';
- Orderdet7.Consumable_Arrived_order__c = Order1.Id;
- Orderdet7.Lose_Flag__c = true;
- Orderdet7.Arrive_date__c = Date.today();
- Orderdet7.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
- Orderdet7.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJQT';
- Orderdet7.Box_Piece__c ='涓�';
- Orderdet7.TracingCode__c = 'BXJQT';
-
- 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();
- //鍒濆鍖栨祴璇�
- System.Test.startTest();
- Controller.init();
- //鎺掑簭
- Controller.barcode = '01049531702003111115120017181000105ZK250BXJRN\n01049531702003111115120017181000105ZK250BXJRF\n01049531702003111115120017181000105ZK250BXJRI\n01049531702003111115120017181000105ZK250BXJRN\n01049531702003111115120017181000105ZK250BXJRZ\n01049531702003111115120017181000105ZK250BXJRA\n01049531702003111115120017181000105ZK250BXJRI\n01049531702003111115120017181000105ZK250BXJQT';
- Controller.SearchPro();
- //System.assertEquals(1, controller.ShowGoodsofReturnList.size());
- //System.assertEquals('OCM_01_001003', controller.ShowGoodsofReturnList[0].esd.Name);
- //System.assertEquals('OCM_01_001004', controller.ShowGoodsofReturnList[1].esd.Name);
- // System.assertEquals(5, controller.ConsumableorderdetailsRecordserror.size()); //tcm
- //System.assertEquals('Test01', controller.ConsumableorderdetailsRecordserror[1].Prod.Name__c);
- //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;
- //System.assertEquals(1, controller.ShowGoodsofReturnList.size());
- Controller.UpdateGoodsOfReturn();
- Controller.ToReturnGoodsPage();
- Controller.geterrorsize();
- System.Test.stopTest();
-
- }
- }
-
- @isTest
- static void makeRecordsVieweTest() {
- Integer count = 1001;
- List<ArriveGoodsController.ConsumableorderdetailsInfo> conList = new List<ArriveGoodsController.ConsumableorderdetailsInfo>();
- for(Integer i = 0; i < 1001; i++){
- conList.add(new ArriveGoodsController.ConsumableorderdetailsInfo());
- }
- ArriveGoodsController arr = new ArriveGoodsController();
- arr.makeRecordsView(conList);
- ArriveGoodsController arr1 = new ArriveGoodsController('','');
- }
-
- @isTest
- 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搴�'];
- 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');
- 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 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';
- 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 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 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 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 Orderdet2;
-
- PageReference page = new PageReference('/apex/ArriveGoods?ArrType=Arr');
- System.Test.setCurrentPage(page);
- ArriveGoodsController Controller = new ArriveGoodsController();
- System.Test.startTest();
- Controller.init();
- Controller.barcode = '01049531702003111115120017181000105ZK250BXJRF';
- Controller.SearchPro();
- Controller.ArriveGoodsConfim();
- List<Consumable_order_details2__c> ins = [SELECT Id,Name FROM Consumable_order_details2__c];
- System.Test.stopTest();
- }
- }
-}
->>>>>>> LEXCommunityLiJun
diff --git a/force-app/main/default/classes/ArriveGoodsControllerTestV2.cls b/force-app/main/default/classes/ArriveGoodsControllerTestV2.cls
index a212707..5c99533 100644
--- a/force-app/main/default/classes/ArriveGoodsControllerTestV2.cls
+++ b/force-app/main/default/classes/ArriveGoodsControllerTestV2.cls
@@ -1,23 +1,14 @@
@isTest
public class ArriveGoodsControllerTestV2 {
-<<<<<<< HEAD
@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搴�'
- ];
+ 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',
@@ -180,11 +171,7 @@
insert new List<Consumable_order_details2__c>{ Orderdet1, Orderdet2, Orderdet3, Orderdet4, Orderdet5, Orderdet6, Orderdets8 };
- List<Consumable_orderdetails__c> cod1 = [
- SELECT Id
- FROM Consumable_orderdetails__c
- WHERE Consumable_order__c = :Order1.Id
- ];
+ List<Consumable_orderdetails__c> cod1 = [SELECT Id FROM Consumable_orderdetails__c WHERE Consumable_order__c = :Order1.Id];
System.assertEquals(1, cod1.size());
PageReference page = new PageReference('/apex/ArriveGoods?Esetid=' + Order1.Id);
@@ -206,166 +193,3 @@
}
}
}
-=======
- @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 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',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;
-
- //鍙戣揣鏄庣粏
- //鍒拌揣姝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 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 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 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';
-
- insert new Consumable_order_details2__c[] {Orderdet1, Orderdet2,Orderdet3,Orderdet4,Orderdet5,Orderdet6,Orderdets8};
-
- List<Consumable_orderdetails__c> cod1 = [select Id from Consumable_orderdetails__c WHERE Consumable_order__c = :Order1.Id];
- System.assertEquals(1, cod1.size());
-
- PageReference page = new PageReference('/apex/ArriveGoods?Esetid=' + Order1.Id);
-
- 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();
- }
- }
-}
->>>>>>> LEXCommunityLiJun
diff --git a/force-app/main/default/classes/Batch_FixAttachmentToFiles.cls b/force-app/main/default/classes/Batch_FixAttachmentToFiles.cls
index b94c2ba..a3e8c1a 100644
--- a/force-app/main/default/classes/Batch_FixAttachmentToFiles.cls
+++ b/force-app/main/default/classes/Batch_FixAttachmentToFiles.cls
@@ -1,18 +1,9 @@
-<<<<<<< HEAD
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
-=======
-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
->>>>>>> LEXCommunityLiJun
public Batch_FixAttachmentToFiles(String objectType, Datetime startTime, Datetime endTime) {
creStartDate = startTime;
creEndDate = endTime;
@@ -22,17 +13,10 @@
public Batch_FixAttachmentToFiles(Set<String> parentIds) {
this.parentIds = parentIds;
}
-<<<<<<< HEAD
//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) {
-=======
- //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){
->>>>>>> LEXCommunityLiJun
queryObject = 'SELECT Id, Name, OwnerId, ParentId, Parent.Name, Parent.Type, Body, CreatedDate, CreatedById FROM Attachment WHERE ParentId in:parentIds';
}
return Database.getQueryLocator(queryObject);
@@ -40,112 +24,59 @@
global void execute(Database.BatchableContext BC, List<Attachment> scope) {
List<ContentVersion> insertContents = new List<ContentVersion>();
-<<<<<<< HEAD
Map<string, id> nameParentMaps = new Map<string, id>();
Set<String> attachmentIds = new Set<String>();
for (Attachment att : scope) {
- nameParentMaps.put(att.Name, att.ParentId);
+ 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.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()) {
-=======
- Map<string,id> nameParentMaps = new Map<string,id>();
- Set<String> attachmentIds = new Set<String>();
- for (Attachment att : scope) {
- 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.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()){
->>>>>>> LEXCommunityLiJun
return;
}
//Insert insertContents;
List<Database.SaveResult> saveResultsContents = Database.insert(insertContents, false);
-<<<<<<< HEAD
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<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.LinkedEntityId = nameParentMaps.get(cv.PathOnClient); //Add attachment parentId
cDocLink.ShareType = 'V'; //V - Viewer permission. C - Collaborator permission. I - Inferred permission.
-=======
- insertLog(saveResultsContents,attachmentIds);
- set<Id> contentIds = new set<Id>();
- for(ContentVersion cv : insertContents){
- contentIds.add(cv.id);
- }
- 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.PathOnClient); //Add attachment parentId
- cDocLink.ShareType = 'V'; //V - Viewer permission. C - Collaborator permission. I - Inferred permission.
->>>>>>> LEXCommunityLiJun
cDocLink.Visibility = 'AllUsers';
insertDocLinks.add(cDocLink);
}
//Insert insertDocLinks;
List<Database.SaveResult> saveResultsLinks = Database.insert(insertDocLinks, false);
-<<<<<<< HEAD
insertLog(saveResultsLinks, 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>>();
-=======
- insertLog(saveResultsLinks,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>>();
->>>>>>> LEXCommunityLiJun
for (Database.SaveResult result : saveResults) {
String recordId = result.getId();
if (!result.isSuccess()) {
for (Database.Error error : result.getErrors()) {
-<<<<<<< HEAD
Map<String, String> logMap = new Map<String, String>();
String errorMsg = error.getMessage();
logMap.put('recordId', recordId);
logMap.put('errorMsg', errorMsg);
-=======
- Map<String,String> logMap = new Map<String,String>();
- String errorMsg = error.getMessage();
- logMap.put('recordId',recordId);
- logMap.put('errorMsg',errorMsg);
->>>>>>> LEXCommunityLiJun
logMapList.add(logMap);
}
}
}
-<<<<<<< HEAD
if (logMapList.size() > 0) {
Map<String, String> attachmentIdMap = new Map<String, String>();
attachmentIdMap.put('attachmentIds', JSON.serialize(attachmentIds));
@@ -159,21 +90,3 @@
global void finish(Database.BatchableContext BC) {
}
}
-=======
- 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;
- }
- }
-
-
-
- global void finish(Database.BatchableContext BC) {
-
- }
-}
->>>>>>> LEXCommunityLiJun
diff --git a/force-app/main/default/classes/Batch_FixAttachmentToFilesTest.cls b/force-app/main/default/classes/Batch_FixAttachmentToFilesTest.cls
index 1516f53..938de55 100644
--- a/force-app/main/default/classes/Batch_FixAttachmentToFilesTest.cls
+++ b/force-app/main/default/classes/Batch_FixAttachmentToFilesTest.cls
@@ -1,6 +1,5 @@
@isTest(SeeAllData=true)
private class Batch_FixAttachmentToFilesTest {
-<<<<<<< HEAD
@isTest(SeeAllData=true)
static void testInit() {
String rectCo = Schema.SObjectType.Account.getRecordTypeInfosByDeveloperName().get('Agency').getRecordTypeId();
@@ -22,44 +21,15 @@
Attachment attach = new Attachment();
attach.Name = 'A-65224941-20200923--1.docx';
Blob bodyBlob = Blob.valueOf('Unit Test Attachment Body');
-=======
-
- @isTest(SeeAllData=true)
- static void testInit() {
- String rectCo = Schema.SObjectType.Account.getRecordTypeInfosByDeveloperName().get('Agency').getRecordTypeId();
- Account accountItem1 = new Account(Name='Testaccount001',RecordTypeId = rectCo);
- insert accountItem1;
-
- Consumable_order__c consOrder = new Consumable_order__c();
- consOrder.Name = 'test01';
- consOrder.Order_status__c = '鎵瑰噯';
- consOrder.Deliver_date__c = Date.today();
- consOrder.RecordTypeid = System.Label.RT_ConOrder_Delivery;
- consOrder.Order_type__c = '璁㈠崟';
- consOrder.Order_ProType__c = 'ENG';
- 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');
->>>>>>> LEXCommunityLiJun
attach.body = bodyBlob;
attach.ParentId = consOrder.Id;
attachList.add(attach);
insert attachList;
-<<<<<<< HEAD
-=======
-
->>>>>>> LEXCommunityLiJun
Set<String> Id = new Set<String>();
String objectType;
Datetime creStartDate;
Datetime creEndDate;
-<<<<<<< HEAD
List<Attachment> attachmentList = [
SELECT Id, Name, OwnerId, ParentId, Parent.Name, Parent.Type, Body, CreatedDate, CreatedById
@@ -68,14 +38,6 @@
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];
->>>>>>> LEXCommunityLiJun
for (Attachment att : attachmentList) {
Id.add(att.ParentId);
objectType = att.Parent.Name;
@@ -83,16 +45,8 @@
creEndDate = att.CreatedDate.addDays(1);
}
System.Test.startTest();
-<<<<<<< HEAD
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();
- }
-}
->>>>>>> LEXCommunityLiJun
diff --git a/force-app/main/default/classes/DealerInquiryModifyStateController.cls b/force-app/main/default/classes/DealerInquiryModifyStateController.cls
index b24dbd3..d46bcca 100644
--- a/force-app/main/default/classes/DealerInquiryModifyStateController.cls
+++ b/force-app/main/default/classes/DealerInquiryModifyStateController.cls
@@ -1,38 +1,23 @@
public with sharing class DealerInquiryModifyStateController {
public List<OpportunityInfo> oppRecords { get; set; }
// 銉氥兗銈搞儸銈ゃ偄銈︺儓銇儏鍫便倰鍙栧緱
-<<<<<<< HEAD
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>>();
->>>>>>> LEXCommunityLiJun
// private Map<String, Map<String, String>> editLayoutItemRWMapRt = null;
public List<OpportunityInfo> OPPORTList { get; set; }
/*****************妞滅储鐢�******************/
/*******************妫�绱㈠睘鎬у��*******************/
-<<<<<<< HEAD
public String accSearch { get; set; } //缁忛攢鍟嗗尰闄�
public String aooSearch { get; set; } //鎷呭綋浜�
public String numtext1 { get; set; } //鏁版嵁瀛楁01
public String numtext { get; set; } //鏁版嵁瀛楁03
-=======
- public String accSearch { get; set; }//缁忛攢鍟嗗尰闄�
- public String aooSearch { get; set; }//鎷呭綋浜�
- public String numtext1 { get; set; } //鏁版嵁瀛楁01
- public String numtext { get; set; }//鏁版嵁瀛楁03
->>>>>>> LEXCommunityLiJun
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; } //妫�绱㈡棩鏈熺敤
-<<<<<<< HEAD
public String limits { get; set; } //鏃ユ湡03
-=======
- public String limits { get; set; }//鏃ユ湡03
->>>>>>> LEXCommunityLiJun
public List<SelectOption> dateOpts { get; private set; }
public List<SelectOption> textOpts { get; private set; }
@@ -49,49 +34,28 @@
public String preSortKey { get; set; }
public Boolean sortOrderAsc { get; set; }
public String[] sortOrder { get; set; }
-<<<<<<< HEAD
public String[] columus = new List<String>{ 'Id' };
public String[] selColumus = null;
public Set<String> columusSet = new Set<String>{ 'Id' };
-=======
- public String[] columus = new String[] {'Id'};
- public String[] selColumus = null;
- public Set<String> columusSet = new Set<String> {'Id'};
->>>>>>> LEXCommunityLiJun
// 椤圭洰set 瀛楁鏍囩
public List<String> titleLeft { get; private set; }
public List<String> titleRight { get; private set; }
// 椤圭洰set 瀛楁鍚�
-<<<<<<< HEAD
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鐢�
->>>>>>> LEXCommunityLiJun
private String strColumus;
private String strRtColumus;
//add by Link 2023-6-2
-<<<<<<< HEAD
public String remindMsg { get; set; }
@TestVisible
private String accTypeForSort = null;
-=======
- public String remindMsg{get;set;}
-
- @TestVisible private String accTypeForSort = null;
->>>>>>> LEXCommunityLiJun
private static Integer oppLimit = 500;
public DealerInquiryModifyStateController() {
@@ -119,7 +83,6 @@
textOpts.add(new SelectOption('Oly_Inquiry_Stage__c', 'Oly璇环闃舵'));
//绮剧悽绉戞妧 zxk 2021-08-25 end
textOpts.add(new SelectOption('Hospital_City_Master__c', '甯�'));
-<<<<<<< HEAD
// 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', '鐪�'));
@@ -164,52 +127,6 @@
limits = '20';
}
-=======
-
- // 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', '甯�'));
- //鏃ユ湡瀛楁涓嬫媺鍒楄〃
- timeOpts = new List<SelectOption>();
- timeOpts.add(new SelectOption('', '--鏃�--'));
- timeOpts.add(new SelectOption('Created_Day__c', '鍒涘缓鏃�'));
- timeOpts.add(new SelectOption('Bid_Planned_Date__c', '棰勬祴鎷涙爣鏃�'));
- timeOpts.add(new SelectOption('Forecasted_Bid_Date__c', '棰勬祴涓爣鏃�'));
- timeOpts.add(new SelectOption('Close_Forecasted_Date__c', '棰勬祴涓嶰LY绛剧害鏃�'));
- timeOpts.add(new SelectOption('Lost_Opportunity_Date__c', '澶卞崟鏃ユ湡'));
- timeOpts.add(new SelectOption('Deleted_Reason_Date__c', '鍙栨秷鏃ユ湡'));
- //鏁版嵁瀛楁涓棿杩炴帴绗﹀彿
- equalOpts = new List<SelectOption>();
- equalOpts.add(new SelectOption('=', '绛変簬'));
- equalOpts.add(new SelectOption('<>', '涓嶇瓑浜�'));
- equalOpts.add(new SelectOption('<', '<'));
- equalOpts.add(new SelectOption('>', '>'));
- equalOpts.add(new SelectOption('<=', '<='));
- equalOpts.add(new SelectOption('>=', '>='));
- equalOpts.add(new SelectOption('contains', '鍖呭惈'));
- equalOpts.add(new SelectOption('notcontains', '涓嶅寘鍚�'));
- equalOpts.add(new SelectOption('starts with', '璧峰瀛楃'));
- //鏃ユ湡瀛楁杩炴帴绗﹀彿
- //timeequalOpts = new List<SelectOption>();
- //timeequalOpts.add(new SelectOption('=', '绛変簬'));
- //timeequalOpts.add(new SelectOption('<>', '涓嶇瓑浜�'));
- //timeequalOpts.add(new SelectOption('<', '<'));
- //timeequalOpts.add(new SelectOption('>', '>'));
- //timeequalOpts.add(new SelectOption('<=', '<='));
- //timeequalOpts.add(new SelectOption('>=', '>='));
- //鏁版嵁鏄剧ず鏉℃暟
- limitOpts = new List<SelectOption>();
- limitOpts.add(new SelectOption('10', '10'));
- limitOpts.add(new SelectOption('20', '20'));
- limitOpts.add(new SelectOption('50', '50'));
- limitOpts.add(new SelectOption('100', '100'));
- limitOpts.add(new SelectOption('200', '200'));
- limitOpts.add(new SelectOption('1000', '鍏ㄩ儴'));
- //鏁版嵁鏄剧ず榛樿鏉℃暟
- limits = '20';
- }
-
->>>>>>> LEXCommunityLiJun
public PageReference init() {
remindMsg = '';
PartnerSoapSforceCom.Soap soap = new PartnerSoapSforceCom.Soap();
@@ -243,11 +160,7 @@
layoutItem.layoutComponents.add(layoutComponent);
// return dlr;
} else {
-<<<<<<< HEAD
dlr = soap.describeLayout('Agency_Opportunity__c', null, null);
-=======
- dlr = soap.describeLayout('Agency_Opportunity__c', null, null);
->>>>>>> LEXCommunityLiJun
// dlr = soap.describeLayout('asdas', null, null);
}
@@ -265,16 +178,11 @@
for (PartnerSoapSforceCom.DescribeLayoutSection section : layout.editLayoutSections) {
for (PartnerSoapSforceCom.DescribeLayoutRow row : section.layoutRows) {
for (PartnerSoapSforceCom.DescribeLayoutItem item : row.layoutItems) {
-<<<<<<< HEAD
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) {
->>>>>>> LEXCommunityLiJun
rtnInner.put(item.layoutComponents[0].value, 'r');
if (item.editableForUpdate) {
rtnInner.put(item.layoutComponents[0].value, 'w');
@@ -295,16 +203,10 @@
return null;
}
//鐢ㄤ簬鑾峰彇缁忛攢鍟嗚浠峰瓧娈甸泦鍜岃浠峰瓧娈甸泦浠ュ強鐩稿簲鐨勮鍐欐潈闄�
-<<<<<<< HEAD
@TestVisible
private void setLayoutRWInfo() {
if (this.sortOrder == null) {
selColumus = new List<String>{};
-=======
- @TestVisible private void setLayoutRWInfo() {
- if (this.sortOrder == null) {
- selColumus = new String[] {};
->>>>>>> LEXCommunityLiJun
strColumus = '';
ID accRecordTypeId = accTypeForSort;
@@ -383,23 +285,14 @@
strRtColumus = strRtColumus + ',' + s;
}
columnRightCss.add(s.replace('.', '_'));
-<<<<<<< HEAD
-=======
-
->>>>>>> LEXCommunityLiJun
}
strColumus = String.join(columus, ',');
System.debug('======-======-======strColumus' + strColumus);
System.debug('======-======-======strRtColumus' + strRtColumus);
this.sortOrderAsc = true;
-<<<<<<< HEAD
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] = '銆�';
->>>>>>> LEXCommunityLiJun
}
}
//鐢ㄤ簬鎷兼帴SOQL璇彞 鏍规嵁涓嶅悓妫�绱㈡潯浠舵嫾鎺ヤ笉鍚孲OQL璇彞銆�
@@ -421,27 +314,17 @@
// System.debug('pppqqq333'+querySoql);
// AND Ownerid in ( '+querySoql+')'
-<<<<<<< HEAD
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\' ';
->>>>>>> LEXCommunityLiJun
//鏁版嵁瀛楁锛氱粡閿�鍟嗗尰闄� +SOQL
if (!String.isBlank(accSearch)) {
accSearch = accSearch.trim();
// soql += 'AND Agency__r.Name ' + ' LIKE \'%' + accSearch + '%\' ';
-<<<<<<< HEAD
soql += 'AND Agency_Hospital__r.Name ' + ' LIKE \'%' + accSearch + '%\' ';
-=======
- soql += 'AND Agency_Hospital__r.Name ' + ' LIKE \'%' + accSearch + '%\' ';
->>>>>>> LEXCommunityLiJun
}
//鏁版嵁瀛楁锛氭媴褰撲汉 +SOQL
if (!String.isBlank(aooSearch)) {
@@ -452,11 +335,7 @@
//鏁版嵁瀛楁锛�03 鎵嬪姩濉啓椤� 鍑嗗璋冪敤makeTextSql锛�
if (!String.isBlank(numtext)) {
String newNumtext = numtext.trim();
-<<<<<<< HEAD
String str = makeTextSql(numtext1, numtext2, newNumtext);
-=======
- String str = makeTextSql(numtext1, numtext2, newNumtext);
->>>>>>> LEXCommunityLiJun
soql += str;
System.debug('+++++++++++++=============++++++++++++++++++' + soql);
}
@@ -466,7 +345,6 @@
soql += ' order by LastModifiedDate desc limit ' + Integer.valueOf(limits);
} else {
if (Integer.valueOf(this.sortKey) <= titleLeft.size() + 7) {
-<<<<<<< HEAD
soql +=
' order by ' +
this.selColumus[Integer.valueOf(this.sortKey)] +
@@ -482,11 +360,6 @@
(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);
->>>>>>> LEXCommunityLiJun
}
}
system.debug(soql);
@@ -494,11 +367,7 @@
// System.debug('pppqqq111'+userlist1);
List<Agency_Opportunity__c> InfoList = Database.query(soql);
-<<<<<<< HEAD
System.debug('+++++++-------------------' + InfoList);
-=======
- System.debug('+++++++-------------------'+InfoList);
->>>>>>> LEXCommunityLiJun
// List<Agency_Opportunity__c> InfoList = ControllerUtil.DatabaseQuery(soql);
// System.debug('InfoList[0].Change_To_Opportunity_T__c'+InfoList[0].Change_To_Opportunity_T__c);
@@ -514,10 +383,6 @@
str = '\'' + agc.Change_To_Opportunity__r.Id + '\'';
} else if (agc.Change_To_Opportunity__r.Id != null) {
str += ',\'' + agc.Change_To_Opportunity__r.Id + '\'';
-<<<<<<< HEAD
-=======
-
->>>>>>> LEXCommunityLiJun
}
}
for (Agency_Opportunity__c info : InfoList) {
@@ -534,13 +399,9 @@
remindMsg = '鍙栧緱鏈�杩戠殑 ' + oppCount + ' 鏉℃暟鎹�';
} else if (!String.isBlank(this.sortKey)) {
if (oppCount > oppLimit) {
-<<<<<<< HEAD
ApexPages.addmessage(
new ApexPages.message(ApexPages.severity.INFO, '鏁版嵁瓒呰繃' + oppLimit + '浠讹紝鍙樉绀哄墠' + oppLimit + '浠�')
);
-=======
- ApexPages.addmessage(new ApexPages.message(ApexPages.severity.INFO, '鏁版嵁瓒呰繃' + oppLimit + '浠讹紝鍙樉绀哄墠' + oppLimit + '浠�'));
->>>>>>> LEXCommunityLiJun
//add by Link 2023-6-2
remindMsg = '鏁版嵁瓒呰繃' + oppLimit + '浠讹紝鍙樉绀哄墠' + oppLimit + '浠�';
} else {
@@ -567,22 +428,12 @@
String cSql = '';
soql += ' AND (';
for (Integer icount = 0; icount < vals.size(); icount++) {
-<<<<<<< HEAD
//绮剧悽绉戞妧 zxk 2021-08-25 start
String val = vals[icount];
if (equalOpts == 'contains') {
cSql = this.makeTextSqlStr(textOpts, equalOpts, val);
soql += cSql;
-=======
-
- //绮剧悽绉戞妧 zxk 2021-08-25 start
- String val = vals[icount];
- if (equalOpts == 'contains') {
- cSql = this.makeTextSqlStr(textOpts, equalOpts, val);
- soql += cSql;
-
->>>>>>> LEXCommunityLiJun
if (icount < vals.size() - 1) {
soql += ' OR ';
}
@@ -593,17 +444,9 @@
soql += ' AND ';
}
}
-<<<<<<< HEAD
}
//绮剧悽绉戞妧 zxk 2021-08-25 end
-=======
-
- }
- //绮剧悽绉戞妧 zxk 2021-08-25 end
-
-
->>>>>>> LEXCommunityLiJun
// String val = vals[icount];
// cSql = this.makeTextSqlStr(textOpts, equalOpts, val);
// system.debug(cSql);
@@ -646,10 +489,6 @@
else if (equalOpts == '=' || equalOpts == '<>') {
soql += 'AND ' + textOpts + equalOpts + '\'' + numtext + '\'';
}
-<<<<<<< HEAD
-=======
-
->>>>>>> LEXCommunityLiJun
//绮剧悽绉戞妧 zxk 2021-08-25 start
//璧峰瀛楃
else if (equalOpts == 'starts with' && numtext.contains(' ')) {
@@ -658,24 +497,13 @@
for (Integer icount = 0; icount < vals.size(); icount++) {
String val = vals[icount];
if (equalOpts == 'starts with') {
-<<<<<<< HEAD
soql += ' ' + textOpts + ' LIKE \'%' + val + '%\'';
if (icount < vals.size() - 1) {
soql += ' OR ';
-=======
- soql += ' ' + textOpts + ' LIKE \'%' + val + '%\'' ;
- if (icount < vals.size() - 1) {
- soql += ' OR ';
-
->>>>>>> LEXCommunityLiJun
}
}
}
soql += ')';
-<<<<<<< HEAD
-=======
-
->>>>>>> LEXCommunityLiJun
}
//绮剧悽绉戞妧 zxk 2021-08-25 end
@@ -696,19 +524,14 @@
return soql;
}
//妫�绱㈡潯浠讹細鏁版嵁瀛楁1锛屾暟鎹瓧娈�2锛屾暟鎹瓧娈�3鍧囨弧瓒筹紝骞朵笖杩涘叆makeTextSql锛堬級涔嬪悗锛屽唴鍚暟鎹瓧娈靛寘鍚绉嶆椂杩涘叆姝ゆ柟娉曘��
-<<<<<<< HEAD
@TestVisible
private String makeTextSqlStr(String textOpts, String equalOpts, String val) {
-=======
- @TestVisible private String makeTextSqlStr(String textOpts, String equalOpts, String val) {
->>>>>>> LEXCommunityLiJun
String soql = '';
if (!String.isBlank(textOpts)) {
String tmpVal = val;
if (!String.isBlank(tmpVal)) {
if (equalOpts == 'contains' || equalOpts == 'notcontains') {
if (equalOpts == 'contains') {
-<<<<<<< HEAD
soql += ' ' + textOpts + ' LIKE \'%' + val + '%\'';
} else if (equalOpts == 'notcontains') {
soql += ' ( NOT ' + textOpts + ' LIKE \'%' + val + '%\' ) ';
@@ -718,17 +541,6 @@
soql += ' AND ' + textOpts + ' = ' + val;
} else if (equalOpts == '<>') {
soql += ' AND ' + textOpts + ' <> ' + val;
-=======
- soql += ' ' + textOpts + ' LIKE \'%' + val + '%\'' ;
- } else if (equalOpts == 'notcontains') {
- soql += ' ( NOT ' + textOpts + ' LIKE \'%' + val + '%\' ) ' ;
- }
- } else if (equalOpts == '=' || equalOpts == '<>') {
- if (equalOpts == '=') {
- soql += ' AND ' + textOpts + ' = ' + val ;
- } else if (equalOpts == '<>') {
- soql += ' AND ' + textOpts + ' <> ' + val ;
->>>>>>> LEXCommunityLiJun
}
}
} else {
@@ -756,7 +568,6 @@
setLayoutRWInfo();
searchOppInner();
return null;
-<<<<<<< HEAD
}
//椤甸潰鍐呭鏈変慨鏀规椂锛岄〉闈㈠垽鏂悗浼犲�肩粰changeFlg浠ュ強changeFlgRt灞炴�э紝鐐瑰嚮淇濆瓨鏃惰皟鐢ㄦ鏂规硶锛岃繘琛屼繚瀛樸��
public PageReference save() {
@@ -846,95 +657,3 @@
}
}
}
-=======
- }
- //椤甸潰鍐呭鏈変慨鏀规椂锛岄〉闈㈠垽鏂悗浼犲�肩粰changeFlg浠ュ強changeFlgRt灞炴�э紝鐐瑰嚮淇濆瓨鏃惰皟鐢ㄦ鏂规硶锛岃繘琛屼繚瀛樸��
- public PageReference save() {
- //system.debug('oppRecords[1].opp:' + oppRecords[1].opp +' oppRecords[1].AgcOpp:' + oppRecords[1].AgcOpp );
- try {
- List<Agency_Opportunity__c> updTarget = new List<Agency_Opportunity__c>();
- // List<Opportunity> updOpps = new List<Opportunity>();
- for (OpportunityInfo oi : oppRecords) {
- if (oi.changeFlg == '1') {
- oi.changeFlg = '0';
- updTarget.add(oi.AgcOpp);
-
- }
- // if (oi.changeFlgRt == '1' && oi.opp.id != null) {
- // oi.changeFlgRt = '0';
- // updOpps.add(oi.opp);
- // }
- }
- if (updTarget.size() > 0) {
- system.debug('updTarget.size:' + updTarget.size() );
- update updTarget;
- }
- // if (updOpps.size() > 0) {
- // update updOpps;
- // }
- ApexPages.addmessage(new ApexPages.message(ApexPages.severity.INFO, '淇濆瓨瀹屼簡'));
- //add by Link 2023-6-2
- remindMsg = '淇濆瓨瀹屼簡';
- } catch (Exception e) {
- //ApexPages.addmessage(new ApexPages.message(ApexPages.severity.Error, '璇风‘瀹氱瀹ゅ垎绫诲拰浜у搧鍖哄垎鐨勫叧绯�'));
- }
- if (saveType == '1') {
- searchOppInner();
- saveType = '';
- } else if (saveType == '2') {
- sortTable();
- saveType = '';
- } else {
- }
- return null;
- }
- //鍏ㄩ儴灞曞紑璋冪敤姝ゆ柟娉�
- public PageReference sortTable() {
- oppRecords = new List<OpportunityInfo>();
- if (this.sortKey == this.preSortKey) {
- if (String.isBlank(this.sortKey) == false) {
- // 鏂瑰悜銇屽銈忋倠銇伩
- this.sortOrderAsc = !this.sortOrderAsc;
- this.sortOrder[Integer.valueOf(this.sortKey)] = (this.sortOrderAsc == true ? '鈫�' : '鈫�');
- }
- } else {
- this.sortOrderAsc = true;
- if (String.isBlank(this.preSortKey) == false) {
- this.sortOrder[Integer.valueOf(this.preSortKey)] = '銆�';
- }
- this.sortOrder[Integer.valueOf(this.sortKey)] = (this.sortOrderAsc == true ? '鈫�' : '鈫�');
- }
- this.preSortKey = this.sortKey;
-
- setLayoutRWInfo();
- searchOppInner();
- return null;
- }
-
- //鑷畾涔夌被OpportunityInfo锛岀敤浜庡垱寤鸿櫄鎷熷瓧娈碉紝鍚堝苟杈撳嚭銆�
- class OpportunityInfo {
- // public Opportunity opp { get; set; }
- public Agency_Opportunity__c opp { get; set; }
- public Boolean canEdit { get; private set; }
- public Boolean hasError { get; private set; }
- public Boolean hasFieldError { get; private set; }
- public Integer lineNo { get; private set; }
- public String changeFlg { get; set; }
- public String changeFlgRt { get; set; }
- public Boolean ifLock { get; set; }
- //public String accType { get; private set; }
- public Agency_Opportunity__c AgcOpp { get; set; }
- public OpportunityInfo(Agency_Opportunity__c record, Agency_Opportunity__c oppo) {
- opp = oppo;
- canEdit = true;
- hasError = false;
- hasFieldError = false;
- lineNo = 0;
- changeFlg = '0';
- changeFlgRt = '0';
- ifLock = Approval.isLocked(record);
- AgcOpp = record;
- }
- }
-}
->>>>>>> LEXCommunityLiJun
diff --git a/force-app/main/default/classes/DealerInquiryModifyStateControllerTest.cls b/force-app/main/default/classes/DealerInquiryModifyStateControllerTest.cls
index 3b2d713..392ef3a 100644
--- a/force-app/main/default/classes/DealerInquiryModifyStateControllerTest.cls
+++ b/force-app/main/default/classes/DealerInquiryModifyStateControllerTest.cls
@@ -1,13 +1,8 @@
@isTest
private class DealerInquiryModifyStateControllerTest {
-<<<<<<< HEAD
@TestSetup
static void init() {
- List<RecordType> rectCo = [
- SELECT Id
- FROM RecordType
- WHERE IsActive = TRUE AND SobjectType = 'Account' AND Name = '鐥呴櫌'
- ];
+ List<RecordType> rectCo = [SELECT Id FROM RecordType WHERE IsActive = TRUE AND SobjectType = 'Account' AND Name = '鐥呴櫌'];
if (rectCo.size() == 0) {
return;
}
@@ -19,29 +14,12 @@
if (rectSct.size() == 0) {
return;
}
- List<RecordType> rectDpt = [
- 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 = '鎴︾暐绉戝鍒嗛 鍛煎惛绉�'];
- if (rectSct.size() == 0) {
- return;
- }
- List<RecordType> rectDpt = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '瑷虹檪绉� 娑堝寲绉�'];
->>>>>>> LEXCommunityLiJun
+ List<RecordType> rectDpt = [SELECT Id FROM RecordType WHERE IsActive = TRUE AND SobjectType = 'Account' AND Name = '瑷虹檪绉� 娑堝寲绉�'];
if (rectDpt.size() == 0) {
return;
}
// 銉嗐偣銉堛儑銉笺偪
-<<<<<<< HEAD
Account company = new Account();
company.RecordTypeId = rectCo[0].Id;
@@ -52,24 +30,11 @@
section.Name = '*';
section.Department_Class_Label__c = '娑堝寲绉�';
section.ParentId = company.Id;
-=======
-
- Account company = new Account();
- company.RecordTypeId = rectCo[0].Id;
- company.Name = 'NFM007TestCompany';
- insert company;
- Account section = new Account();
- section.RecordTypeId = rectSct[0].Id;
- section.Name = '*';
- section.Department_Class_Label__c = '娑堝寲绉�';
- section.ParentId = company.Id;
->>>>>>> LEXCommunityLiJun
section.Hospital_Department_Class__c = company.Id;
insert section;
// Test.startTest();
Account depart = new Account();
depart.RecordTypeId = rectDpt[0].Id;
-<<<<<<< HEAD
depart.Name = '*';
depart.Department_Name__c = 'NFM007TestDepart';
depart.ParentId = section.Id;
@@ -86,24 +51,6 @@
opp.Trade__c = '鍐呰部';
opp.StageName = '寮曞悎';
opp.CloseDate = Date.today();
-=======
- depart.Name = '*';
- depart.Department_Name__c = 'NFM007TestDepart';
- depart.ParentId = section.Id;
- depart.Department_Class__c = section.Id;
- depart.Hospital__c = company.Id;
- insert depart;
-
- Opportunity opp = new Opportunity();
- 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();
->>>>>>> LEXCommunityLiJun
opp.Stock_apply_status__c = '鐢宠涓�';
insert opp;
Test.startTest();
@@ -118,7 +65,6 @@
contact1.LastName = 'test1鍖婚櫌';
contact1.Agency_User__c = true;
insert contact1;
-<<<<<<< HEAD
List<Contact> contactlist = [
SELECT Id, FirstName
FROM Contact
@@ -129,19 +75,6 @@
//
User user = new User();
Profile p = [SELECT Id FROM Profile WHERE Name = '901_缁忛攢鍟嗘椿鍔ㄧ郴缁�'];
-=======
- 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_缁忛攢鍟嗘椿鍔ㄧ郴缁�'];
->>>>>>> LEXCommunityLiJun
user.ProfileId = p.Id;
user.ContactId = contact1.Id;
user.FirstName = '銉︺兗銈躲兗';
@@ -155,21 +88,10 @@
user.Alias = '銉嗐儲';
user.CommunityNickname = '銉嗐偣銉堛儲銉笺偠銉�';
user.SalesManager__c = UserInfo.getUserId();
-<<<<<<< HEAD
System.runAs(new User(Id = UserInfo.getUserId())) {
insert user;
}
- List<user> users = [
- SELECT Id, Name, LastName, FirstName
- FROM User
- WHERE LastName = '銉嗐偣銉�'
- ];
-=======
- System.runAs(new User(Id = UserInfo.getUserId())){
- insert user;
- }
- List<user> users = [select Id, Name, LastName, FirstName from User where LastName = '銉嗐偣銉�'];
->>>>>>> LEXCommunityLiJun
+ List<user> users = [SELECT Id, Name, LastName, FirstName FROM User WHERE LastName = '銉嗐偣銉�'];
//
Agency_Hospital_Link__c agency_hospital_link = new Agency_Hospital_Link__c();
@@ -182,7 +104,6 @@
//
//System.assertEquals('銉嗐偣銉�',users[0].LastName);
-<<<<<<< HEAD
System.assertEquals('銉︺兗銈躲兗', users[0].FirstName);
Id rtId = [
@@ -191,11 +112,6 @@
WHERE IsActive = TRUE AND SobjectType = 'Agency_Opportunity__c' AND DeveloperName = 'Opportunity'
]
.Id;
-=======
- System.assertEquals('銉︺兗銈躲兗', users[0].FirstName );
-
- Id rtId = [select Id, DeveloperName from RecordType where IsActive = true and SobjectType = 'Agency_Opportunity__c' and DeveloperName = 'Opportunity'].Id;
->>>>>>> LEXCommunityLiJun
// Schema.SobjectType.Agency_Opportunity__c.getRecordTypeInfosByName().get('璇环').getRecordTypeId();
Agency_opportunity__c agency_opportunity = new Agency_opportunity__c();
agency_opportunity.RecordTypeId = rtId;
@@ -206,7 +122,6 @@
agency_opportunity.StageName__c = '杩樻病鐢宠棰勭畻';
agency_opportunity.OwnerId = user.Id;
agency_opportunity.Change_To_Opportunity_T__c = '::CF-HQ290I';
-<<<<<<< HEAD
agency_opportunity.Sales_Manager__c = UserInfo.getUserId();
insert agency_opportunity;
@@ -215,34 +130,14 @@
static testMethod void myUnitTest_SortKey() {
Test.startTest();
-=======
- agency_opportunity.Sales_Manager__c =UserInfo.getUserId();
-
- insert agency_opportunity;
- Test.stopTest();
-
- }
-
- static testMethod void myUnitTest_SortKey() {
- Test.startTest();
->>>>>>> LEXCommunityLiJun
Test.setMock(WebServiceMock.class, new NFMTest_Mock());
Test.stopTest();
PageReference page = new PageReference('/apex/DealerInquiryModifyState');
System.Test.setCurrentPage(page);
-<<<<<<< HEAD
// 鍒濆鍖栨祴璇�
DealerInquiryModifyStateController controller = new DealerInquiryModifyStateController();
-=======
-
-
- // 鍒濆鍖栨祴璇�
- DealerInquiryModifyStateController controller = new DealerInquiryModifyStateController();
-
-
->>>>>>> LEXCommunityLiJun
controller.init();
//System.assertEquals(1, controller.oppRecords.size());楠岃瘉棰勬湡鍊煎拰缁撴灉鍊兼纭��
// 鎺掑簭娴嬭瘯
@@ -257,11 +152,7 @@
// Test.stopTest();
}
static testMethod void myUnitTest_AccSearchAndAoosearch() {
-<<<<<<< HEAD
Test.startTest();
-=======
- Test.startTest();
->>>>>>> LEXCommunityLiJun
Test.setMock(WebServiceMock.class, new NFMTest_Mock());
Test.stopTest();
PageReference page = new PageReference('/apex/DealerInquiryModifyState');
@@ -269,178 +160,7 @@
DealerInquiryModifyStateController controller = new DealerInquiryModifyStateController();
// 鍒濆鍖栨祴璇�
// Test.startTest();
-<<<<<<< HEAD
- controller.init();
- //鏂囨湰杈撳叆妗嗘绱�
- //1:缁忛攢鍟嗗尰闄�
- controller.accSearch = '娲礊鍘夸腑鍖婚櫌';
- controller.chick();
- //2:鎷呭綋浜�
- controller.aooSearch = '鐜嬪鐞�';
- controller.chick();
- // Test.stopTest();
- }
- static testMethod void myUnitTest_numtext_Equals() {
- PageReference page = new PageReference('/apex/DealerInquiryModifyState');
- System.Test.setCurrentPage(page);
- DealerInquiryModifyStateController controller = new DealerInquiryModifyStateController();
- // 鍒濆鍖栨祴璇�
- Test.startTest();
- controller.init();
- // 妫�绱㈡暟鎹瓧娈垫祴璇�
- //1:妫�绱㈢粡閿�鍟嗙紪鐮� = 151P-00001327
- controller.numtext1 = 'Agency_Opportunity_No__c';
- controller.numtext2 = '=';
- controller.numtext = '151P-00001327';
- controller.chick();
- controller.numtext1 = 'Agency_Opportunity_No__c';
- controller.numtext2 = '<>';
- controller.numtext = '151P-00001327';
- controller.chick();
- Test.stopTest();
- }
- static testMethod void myUnitTest_numtext_Starts_with() {
- PageReference page = new PageReference('/apex/DealerInquiryModifyState');
- System.Test.setCurrentPage(page);
- DealerInquiryModifyStateController controller = new DealerInquiryModifyStateController();
- // 鍒濆鍖栨祴璇�
- Test.startTest();
- controller.init();
- controller.numtext1 = 'Agency_Opportunity_No__c';
- controller.numtext2 = '<';
- controller.numtext = '151P-00001327';
- controller.chick();
- controller.numtext1 = 'Agency_Opportunity_No__c';
- controller.numtext2 = 'starts with';
- controller.numtext = '151P-00001327';
- controller.chick();
- Test.stopTest();
- }
- static testMethod void myUnitTest_contains() {
- PageReference page = new PageReference('/apex/DealerInquiryModifyState');
- System.Test.setCurrentPage(page);
- DealerInquiryModifyStateController controller = new DealerInquiryModifyStateController();
- // 鍒濆鍖栨祴璇�
- Test.startTest();
- controller.init();
- //2:妫�绱㈢粡閿�鍟嗙紪鐮� 鍖呭惈 151P
- controller.numtext1 = 'Agency_Opportunity_No__c';
- controller.numtext2 = 'contains';
- controller.numtext = '151P';
- controller.chick();
- controller.numtext1 = 'Agency_Opportunity_No__c';
- controller.numtext2 = 'notcontains';
- controller.numtext = '151P';
- controller.chick();
- Test.stopTest();
- }
- static testMethod void myUnitTest_null_contains() {
- PageReference page = new PageReference('/apex/DealerInquiryModifyState');
- System.Test.setCurrentPage(page);
- DealerInquiryModifyStateController controller = new DealerInquiryModifyStateController();
- // 鍒濆鍖栨祴璇�
- Test.startTest();
- controller.init();
- //3:妫�绱㈡潯浠跺惈绌烘牸
- controller.numtext1 = 'Agency_Opportunity_No__c';
- controller.numtext2 = 'contains';
- controller.numtext = '151P 150P';
- controller.chick();
- Test.stopTest();
- }
- static testMethod void myUnitTest_null_notcontains() {
- PageReference page = new PageReference('/apex/DealerInquiryModifyState');
- System.Test.setCurrentPage(page);
- DealerInquiryModifyStateController controller = new DealerInquiryModifyStateController();
- // 鍒濆鍖栨祴璇�
- Test.startTest();
- controller.init();
- controller.numtext1 = 'Agency_Opportunity_No__c';
- controller.numtext2 = 'notcontains';
- controller.numtext = '151P 150P';
- controller.chick();
- Test.stopTest();
- }
- static testMethod void myUnitTest_AllNull_contains() {
- PageReference page = new PageReference('/apex/DealerInquiryModifyState');
- System.Test.setCurrentPage(page);
- DealerInquiryModifyStateController controller = new DealerInquiryModifyStateController();
- // 鍒濆鍖栨祴璇�
- Test.startTest();
- controller.init();
- controller.numtext1 = 'Agency_Opportunity_No__c';
- controller.numtext2 = 'contains';
- controller.numtext = ' ';
- controller.chick();
- Test.stopTest();
- }
- static testMethod void myUnitTest_AllNull_notcontains() {
- PageReference page = new PageReference('/apex/DealerInquiryModifyState');
- System.Test.setCurrentPage(page);
- DealerInquiryModifyStateController controller = new DealerInquiryModifyStateController();
- // 鍒濆鍖栨祴璇�
- Test.startTest();
- controller.init();
- controller.numtext1 = 'Agency_Opportunity_No__c';
- controller.numtext2 = 'notcontains';
- controller.numtext = ' ';
- controller.chick();
- controller.numtext1 = 'Agency_Opportunity_No__c';
- controller.numtext2 = '=';
- controller.numtext = ' ';
- controller.chick();
- Test.stopTest();
- }
- static testMethod void myUnitTest_tarts_with() {
- PageReference page = new PageReference('/apex/DealerInquiryModifyState');
- System.Test.setCurrentPage(page);
- DealerInquiryModifyStateController controller = new DealerInquiryModifyStateController();
- Test.startTest();
- controller.init();
- controller.numtext1 = 'Agency_Opportunity_No__c';
- controller.numtext2 = '<>';
- controller.numtext = ' ';
- controller.chick();
- controller.numtext1 = 'Agency_Opportunity_No__c';
- controller.numtext2 = ' starts with ';
- controller.numtext = ' ';
- controller.chick();
- Test.stopTest();
- }
- static testMethod void myUnitTest_Equals_D() {
- PageReference page = new PageReference('/apex/DealerInquiryModifyState');
- System.Test.setCurrentPage(page);
- DealerInquiryModifyStateController controller = new DealerInquiryModifyStateController();
- // 鍒濆鍖栨祴璇�
- Test.startTest();
- controller.init();
- //4:妫�绱㈡潯浠跺惈閫楀彿
- controller.numtext1 = 'Agency_Opportunity_No__c';
- controller.numtext2 = '=';
- controller.numtext = '151P-00001327,151P-00001343';
- controller.chick();
- controller.numtext1 = 'Agency_Opportunity_No__c';
- controller.numtext2 = '<>';
- controller.numtext = '151P-00001327,151P-00001343';
- controller.chick();
- Test.stopTest();
- }
- static testMethod void myUnitTestTime01() {
- PageReference page = new PageReference('/apex/DealerInquiryModifyState');
- System.Test.setCurrentPage(page);
- DealerInquiryModifyStateController controller = new DealerInquiryModifyStateController();
- // 鍒濆鍖栨祴璇�
- Test.startTest();
- controller.init();
- //妫�绱㈡棩鏈熸祴璇�
- controller.tmpAO = new Agency_Opportunity__c();
- controller.tmpBO = new Agency_Opportunity__c();
- controller.timetext1 = 'Created_Day__c';
- controller.timetext2 = '=';
- controller.tmpAO.MaxActivityDate__c = date.valueOf('2018-12-12');
-=======
-
controller.init();
//鏂囨湰杈撳叆妗嗘绱�
//1:缁忛攢鍟嗗尰闄�
@@ -620,19 +340,6 @@
controller.chick();
// Test.startTest();
controller.tmpAO.MaxActivityDate__c = date.valueOf('2018-12-02');
->>>>>>> LEXCommunityLiJun
- controller.tmpBO.MaxActivityDate__c = date.valueOf('2018-12-12');
- controller.chick();
-
- controller.tmpBO.MaxActivityDate__c = date.valueOf('2018-12-09');
- controller.chick();
- controller.tmpBO.MaxActivityDate__c = date.valueOf('2018-02-19');
- controller.chick();
- controller.tmpBO.MaxActivityDate__c = date.valueOf('2018-02-09');
- controller.chick();
-<<<<<<< HEAD
- // Test.startTest();
- controller.tmpAO.MaxActivityDate__c = date.valueOf('2018-12-02');
controller.tmpBO.MaxActivityDate__c = date.valueOf('2018-12-12');
controller.chick();
@@ -643,10 +350,6 @@
controller.tmpBO.MaxActivityDate__c = date.valueOf('2018-02-09');
controller.chick();
Test.stopTest();
-=======
- Test.stopTest();
-
->>>>>>> LEXCommunityLiJun
}
static testMethod void myUnitTestTime02() {
PageReference page = new PageReference('/apex/DealerInquiryModifyState');
@@ -681,10 +384,6 @@
controller.tmpBO.MaxActivityDate__c = date.valueOf('2018-02-09');
controller.chick();
Test.stopTest();
-<<<<<<< HEAD
-=======
-
->>>>>>> LEXCommunityLiJun
}
static testMethod void myUnitTestTimeSave() {
PageReference page = new PageReference('/apex/DealerInquiryModifyState');
@@ -723,8 +422,4 @@
controller.init();
Test.stopTest();
}
-<<<<<<< HEAD
}
-=======
-}
->>>>>>> LEXCommunityLiJun
diff --git a/force-app/main/default/classes/LexArriveGoodsControllerTest.cls b/force-app/main/default/classes/LexArriveGoodsControllerTest.cls
index 3142cdb..6c75332 100644
--- a/force-app/main/default/classes/LexArriveGoodsControllerTest.cls
+++ b/force-app/main/default/classes/LexArriveGoodsControllerTest.cls
@@ -1,24 +1,15 @@
@isTest
private class LexArriveGoodsControllerTest {
@IsTest
-<<<<<<< HEAD
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搴�'
- ];
+ 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 myAccount1 = new Account(
Name = 'Testaccount001',
@@ -188,11 +179,7 @@
insert new List<Consumable_order_details2__c>{ Orderdet1, Orderdet2, Orderdet3, Orderdet4, Orderdet5, Orderdet6, Orderdets8 };
- List<Consumable_orderdetails__c> cod1 = [
- SELECT Id
- FROM Consumable_orderdetails__c
- WHERE Consumable_order__c = :Order1.Id
- ];
+ List<Consumable_orderdetails__c> cod1 = [SELECT Id FROM Consumable_orderdetails__c WHERE Consumable_order__c = :Order1.Id];
System.assertEquals(1, cod1.size());
PageReference page = new PageReference('/apex/ArriveGoods?Esetid=' + Order1.Id);
@@ -211,184 +198,19 @@
arrControllerStr = re.arrGoodCon;
LexArriveGoodsController.arriveGoodsConfim(arrControllerStr);
System.Test.stopTest();
-=======
- 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)'];
-
- 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())){
- 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 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;
-
- //鍙戣揣鏄庣粏
- //鍒拌揣姝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 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 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 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';
-
- insert new Consumable_order_details2__c[] {Orderdet1, Orderdet2,Orderdet3,Orderdet4,Orderdet5,Orderdet6,Orderdets8};
-
- List<Consumable_orderdetails__c> cod1 = [select Id from Consumable_orderdetails__c WHERE Consumable_order__c = :Order1.Id];
- System.assertEquals(1, cod1.size());
-
- 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);
- arrControllerStr = re.arrGoodCon;
- LexArriveGoodsController.arriveGoodsConfim(arrControllerStr);
- System.Test.stopTest();
->>>>>>> LEXCommunityLiJun
}
}
@IsTest
-<<<<<<< HEAD
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搴�'
- ];
+ 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',
@@ -571,162 +393,6 @@
'01049531702003111115120017181000105ZK250BXAAA\n01049531702003111115120017181000105ZK250BXJRJ\n01049531702003111115120017181000105ZK250BXJRF\n01049531702003111115120017181000105ZK250BX123\n01049531702003111115120017181000105ZK250BX222',
arrControllerStr
);
-=======
- 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)'];
-
-
- 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 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 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;
-
- //鍙戣揣鏄庣粏
- //娌″嚭搴擄紝娌¢攢鍞紝灏辨槸鍦ㄥ簱
- 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';
-
- 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);
->>>>>>> LEXCommunityLiJun
arrControllerStr = re.arrGoodCon;
LexArriveGoodsController.arriveGoodsConfim(arrControllerStr);
LexArriveGoodsController.updateGoodsOfReturn(re.arrGoodCon, JSON.serialize(re.showGoodsofReturnList));
@@ -734,14 +400,7 @@
List<LexArriveGoodsController.ConsumableorderdetailsInfo> conList = new List<LexArriveGoodsController.ConsumableorderdetailsInfo>();
conList.add(con);
LexArriveGoodsController.changeType2(conList);
-<<<<<<< HEAD
System.Test.stopTest();
}
}
}
-=======
- System.Test.stopTest();
- }
- }
-}
->>>>>>> LEXCommunityLiJun
diff --git a/force-app/main/default/classes/LexArriveGoodsControllerTest1.cls b/force-app/main/default/classes/LexArriveGoodsControllerTest1.cls
index 31a8992..88f4bb7 100644
--- a/force-app/main/default/classes/LexArriveGoodsControllerTest1.cls
+++ b/force-app/main/default/classes/LexArriveGoodsControllerTest1.cls
@@ -1,23 +1,14 @@
@isTest
public class LexArriveGoodsControllerTest1 {
-<<<<<<< HEAD
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搴�'
- ];
+ 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 myAccount1 = new Account(
Name = 'Testaccount001',
@@ -187,11 +178,7 @@
insert new List<Consumable_order_details2__c>{ Orderdet1, Orderdet2, Orderdet3, Orderdet4, Orderdet5, Orderdet6, Orderdets8 };
- List<Consumable_orderdetails__c> cod1 = [
- SELECT Id
- FROM Consumable_orderdetails__c
- WHERE Consumable_order__c = :Order1.Id
- ];
+ List<Consumable_orderdetails__c> cod1 = [SELECT Id FROM Consumable_orderdetails__c WHERE Consumable_order__c = :Order1.Id];
System.assertEquals(1, cod1.size());
PageReference page = new PageReference('/apex/ArriveGoods?Esetid=' + Order1.Id);
@@ -213,162 +200,3 @@
}
}
}
-=======
- 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)'];
-
- 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())){
- 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 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;
-
- //鍙戣揣鏄庣粏
- //鍒拌揣姝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 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 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 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';
-
- insert new Consumable_order_details2__c[] {Orderdet1, Orderdet2,Orderdet3,Orderdet4,Orderdet5,Orderdet6,Orderdets8};
-
- List<Consumable_orderdetails__c> cod1 = [select Id from Consumable_orderdetails__c WHERE Consumable_order__c = :Order1.Id];
- System.assertEquals(1, cod1.size());
-
- 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);
- arrControllerStr = re.arrGoodCon;
- LexArriveGoodsController.arriveGoodsConfim(arrControllerStr);
- System.Test.stopTest();
- }
- }
-}
->>>>>>> LEXCommunityLiJun
diff --git a/force-app/main/default/classes/LexArriveGoodsMainController.cls b/force-app/main/default/classes/LexArriveGoodsMainController.cls
index 0650026..3e7d7cf 100644
--- a/force-app/main/default/classes/LexArriveGoodsMainController.cls
+++ b/force-app/main/default/classes/LexArriveGoodsMainController.cls
@@ -187,7 +187,6 @@
return results;
}
-<<<<<<< HEAD
public class Results {
@AuraEnabled
public String result;
@@ -223,40 +222,3 @@
public Boolean isNoteStay;
}
}
-=======
- 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;
- }
-}
->>>>>>> LEXCommunityLiJun
diff --git a/force-app/main/default/classes/LexArriveGoodsMainControllerTest.cls b/force-app/main/default/classes/LexArriveGoodsMainControllerTest.cls
index 95a43a5..f1d714b 100644
--- a/force-app/main/default/classes/LexArriveGoodsMainControllerTest.cls
+++ b/force-app/main/default/classes/LexArriveGoodsMainControllerTest.cls
@@ -1,29 +1,16 @@
@istest
public class LexArriveGoodsMainControllerTest {
@IsTest
-<<<<<<< HEAD
static void lexArriveGoodsMainControllerTest1() {
-=======
- static void lexArriveGoodsMainControllerTest1(){
->>>>>>> LEXCommunityLiJun
User myUser_test = new User();
Account myAccount1;
Contact core;
User currentUser = [SELECT Id FROM User WHERE Id = :UserInfo.getUserId()];
-<<<<<<< HEAD
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搴�'
- ];
+ 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;
}
@@ -81,58 +68,6 @@
Order_ProType__c = 'ET'
);
insert new List<Consumable_order__c>{ Order1, Order2 };
-=======
- 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搴�'];
- if (rectCo.size() == 0) {
- return;
- }
- 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);
- 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;
- }
- 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',
- RecordTypeId = System.Label.RT_ConOrder_Delivery,
- Order_type__c ='璁㈠崟',
- Dealer_info__c=myAccount1.Id,
- Order_ProType__c = 'ET');
- Consumable_order__c Order2 = new Consumable_order__c(
- Name='OCM_01_002',
- RecordTypeId = System.Label.RT_ConOrder_Delivery,
- Order_type__c ='璁㈠崟',
- Dealer_info__c=myAccount1.Id,
- Order_ProType__c = 'ET');
- insert new Consumable_order__c[] {Order1, Order2};
->>>>>>> LEXCommunityLiJun
//鏄庣粏1
Consumable_orderdetails__c createDetail = new Consumable_orderdetails__c();
@@ -140,28 +75,19 @@
createDetail.Consumable_Product__c = pro1.id;
createDetail.Dealer_Custom_Price__c = 999.00;
createDetail.Consumable_count__c = 3;
-<<<<<<< HEAD
createDetail.Consumable_order__c = Order1.id;
-=======
- createDetail.Consumable_order__c = Order1.id;
->>>>>>> LEXCommunityLiJun
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;
-<<<<<<< HEAD
createDetail1.Consumable_order__c = Order2.id;
-=======
- createDetail1.Consumable_order__c = Order2.id;
->>>>>>> LEXCommunityLiJun
createDetail1.Dealer_Custom_Price__c = 999.00;
createDetail1.Consumable_count__c = 4;
createDetail1.RecordTypeid = System.Label.RT_ConOrderDetail1_Order;
insert createDetail1;
//璁㈠崟鏄庣粏
-<<<<<<< HEAD
Consumable_order_details2__c Orderdet1 = new Consumable_order_details2__c(
Name = 'OCM_01_001001',
Consumable_order_minor__c = Order1.Id,
@@ -191,40 +117,9 @@
RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery
);
insert new List<Consumable_order_details2__c>{ Orderdet1, Orderdet2, Orderdet3, Orderdet4 };
-=======
- 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',
- 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',
- 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',
- Consumable_order_minor__c = Order2.Id,
- Arrive_date__c = Date.today(),
- Consumable_Product__c = pro2.id,
- RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery);
- insert new Consumable_order_details2__c[] {Orderdet1, Orderdet2, Orderdet3, Orderdet4};
->>>>>>> LEXCommunityLiJun
LexArriveGoodsMainController.init();
LexArriveGoodsMainController.searchConsumableorderdetails('Too001', null, myAccount1.Id, '鍖椾含', 'ET');
}
}
-<<<<<<< HEAD
}
-=======
-}
->>>>>>> LEXCommunityLiJun
diff --git a/force-app/main/default/classes/LexArriveGsDetailsControllerTest.cls b/force-app/main/default/classes/LexArriveGsDetailsControllerTest.cls
index 68e894b..d93b59f 100644
--- a/force-app/main/default/classes/LexArriveGsDetailsControllerTest.cls
+++ b/force-app/main/default/classes/LexArriveGsDetailsControllerTest.cls
@@ -1,33 +1,20 @@
@isTest
public class LexArriveGsDetailsControllerTest {
@IsTest
-<<<<<<< HEAD
static void test1() {
-=======
- static void test1(){
->>>>>>> LEXCommunityLiJun
User myUser_test = new User();
Account myAccount1;
Account myAccount2;
Contact core;
User currentUser = [SELECT Id FROM User WHERE Id = :UserInfo.getUserId()];
-<<<<<<< HEAD
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> 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)'
- ];
+ Profile prof = [SELECT Id FROM Profile WHERE Name = '901_缁忛攢鍟嗙ぞ鍖烘櫘閫氭潈闄恄2閲嶉獙璇�(ET)'];
Product2 prod01 = new Product2(
Name = 'Test01',
ProductCode = 'Test01',
@@ -66,29 +53,6 @@
);
insert myUser_Test;
System.runAs(MyUser_Test) {
-=======
- 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搴�'];
- 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 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);
- 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){
->>>>>>> LEXCommunityLiJun
StaticParameter.ConsumableAssetHanderTrigger = true;
Consumable_order__c order1 = new Consumable_order__c();
order1.Name = 'OCM_01_001';
@@ -96,26 +60,16 @@
order1.Order_type__c = '璁㈠崟';
order1.Dealer_Info__c = myAccount2.Id;
order1.RecordTypeid = System.Label.RT_ConOrder_Arrive;
-<<<<<<< HEAD
insert order1;
-=======
- insert order1;
-
->>>>>>> LEXCommunityLiJun
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;
-<<<<<<< HEAD
insert olyorder;
-=======
- insert olyorder;
-
->>>>>>> LEXCommunityLiJun
//璁㈠崟鏄庣粏
Consumable_order_details2__c Orderdet1 = new Consumable_order_details2__c();
Orderdet1.Name = 'OCM_01_001001';
@@ -131,7 +85,6 @@
//Orderdet2.IsArrival__c = true;
Orderdet2.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
Orderdet2.Bar_Code__c = '22222';
-<<<<<<< HEAD
insert new List<Consumable_order_details2__c>{ Orderdet1, Orderdet2 };
LexArriveGsDetailsController.init(order1.Id);
@@ -141,44 +94,25 @@
LexArriveGsDetailsController.consumableorderdetailsRecords.size(),
order1.Id
);
-=======
-
- 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);
->>>>>>> LEXCommunityLiJun
}
}
}
@IsTest
-<<<<<<< HEAD
static void test2() {
-=======
- static void test2(){
->>>>>>> LEXCommunityLiJun
User myUser_test = new User();
Account myAccount1;
Account myAccount2;
Contact core;
User currentUser = [SELECT Id FROM User WHERE Id = :UserInfo.getUserId()];
-<<<<<<< HEAD
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> 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)'
- ];
+ Profile prof = [SELECT Id FROM Profile WHERE Name = '901_缁忛攢鍟嗙ぞ鍖烘櫘閫氭潈闄恄2閲嶉獙璇�(ET)'];
Product2 prod01 = new Product2(
Name = 'Test01',
ProductCode = 'Test01',
@@ -217,29 +151,6 @@
);
insert myUser_Test;
System.runAs(MyUser_Test) {
-=======
- 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搴�'];
- 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 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);
- 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){
->>>>>>> LEXCommunityLiJun
StaticParameter.ConsumableAssetHanderTrigger = true;
Consumable_order__c order1 = new Consumable_order__c();
order1.Name = 'OCM_01_001';
@@ -247,11 +158,7 @@
order1.Order_type__c = '璁㈠崟';
order1.RecordTypeid = System.Label.RT_ConOrder_Arrive;
order1.IsShipment__c = true;
-<<<<<<< HEAD
insert order1;
-=======
- insert order1;
->>>>>>> LEXCommunityLiJun
Consumable_order__c olyorder = new Consumable_order__c();
olyorder.Name = 'OCM_01_001';
@@ -260,7 +167,6 @@
olyorder.Dealer_Info__c = myAccount2.Id;
olyorder.RecordTypeid = System.Label.RT_ConOrder_Delivery;
olyorder.IsShipment__c = true;
-<<<<<<< HEAD
insert olyorder;
//璁㈠崟鏄庣粏
@@ -280,35 +186,9 @@
Orderdet2.Bar_Code__c = '22222';
insert new List<Consumable_order_details2__c>{ Orderdet1, Orderdet2 };
-=======
- insert olyorder;
-
-
- //璁㈠崟鏄庣粏
- Consumable_order_details2__c Orderdet1 = new Consumable_order_details2__c();
- Orderdet1.Name = 'OCM_01_001001';
- Orderdet1.Consumable_order_minor__c = olyorder.Id;
- Orderdet1.Consumable_Arrived_order__c = order1.Id;
- //Orderdet1.IsArrival__c = true;
- Orderdet1.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
- Orderdet1.Bar_Code__c = '11111';
- Consumable_order_details2__c Orderdet2 = new Consumable_order_details2__c();
- Orderdet2.Name = 'OCM_01_001002';
- Orderdet2.Consumable_order_minor__c = olyorder.Id;
- Orderdet2.Consumable_Arrived_order__c = order1.Id;
- //Orderdet2.IsArrival__c = true;
- Orderdet2.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
- Orderdet2.Bar_Code__c = '22222';
-
- insert new Consumable_order_details2__c[] {Orderdet1, Orderdet2};
->>>>>>> LEXCommunityLiJun
LexArriveGsDetailsController.init(order1.Id);
LexArriveGsDetailsController.proSale(JSON.serialize(LexArriveGsDetailsController.coc), 1, 1, order1.Id);
}
}
}
-<<<<<<< HEAD
}
-=======
-}
->>>>>>> LEXCommunityLiJun
diff --git a/force-app/main/default/classes/LexCancelRemoveBoxController.cls b/force-app/main/default/classes/LexCancelRemoveBoxController.cls
index 6e8b89a..5437b23 100644
--- a/force-app/main/default/classes/LexCancelRemoveBoxController.cls
+++ b/force-app/main/default/classes/LexCancelRemoveBoxController.cls
@@ -1,10 +1,6 @@
public with sharing class LexCancelRemoveBoxController {
//缁忛攢鍟嗕骇鍝佸垎绫�
-<<<<<<< HEAD
public static String agencyProType { get; set; }
-=======
- public static String agencyProType {get;set;}
->>>>>>> LEXCommunityLiJun
public static String userPro_Typestr = null;
public static String barcode { get; set; }
/*****************鐢婚潰琛ㄧずBean******************/
@@ -13,55 +9,32 @@
public static List<ConsumableorderdetailsInfo> ConsumableorderdetailsRecordserror { get; set; }
//鎷嗙洅鏄庣粏
public static List<ConsumableorderdetailsInfo> ConsumableorderdetailsRecordsdummy { get; set; }
-<<<<<<< HEAD
public static boolean saveFLGbln { get; set; }
//閿欒淇℃伅
public static String alertMessage { get; set; }
//鎷嗙洅鏄庣粏浠舵暟
public static Integer getinventorysize() {
-=======
- public static boolean saveFLGbln {get;set;}
- //閿欒淇℃伅
- public static String alertMessage {set;get;}
- //鎷嗙洅鏄庣粏浠舵暟
- public static Integer getinventorysize(){
->>>>>>> LEXCommunityLiJun
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>();
-<<<<<<< HEAD
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> BarCodeListP = new List<String>();
- //涓嶇鍚堢殑barcode鍜屽瀷鍙�
- public static list<String> notInlist = new list<String>();
- public static String baseUrl {get;private set;}
->>>>>>> LEXCommunityLiJun
private static String accountid = null;
private static String accountName = null;
//public String[] proidList =new String[]{};
// 鐧诲綍鑰呭伐浣滃湴
private static String userWorkLocation;
-<<<<<<< HEAD
public LexCancelRemoveBoxController() {
-=======
- public LexCancelRemoveBoxController(){
->>>>>>> LEXCommunityLiJun
baseUrl = URL.getSalesforceBaseUrl().toExternalForm();
ConsumableorderdetailsRecordserror = new List<ConsumableorderdetailsInfo>();
ConsumableorderdetailsRecordsdummy = new List<ConsumableorderdetailsInfo>();
consumableInventory = new List<ConsumableorderdetailsInfo>();
-<<<<<<< HEAD
saveFLGbln = false;
-=======
- saveFLGbln = FALSE;
->>>>>>> LEXCommunityLiJun
}
@AuraEnabled
@@ -71,13 +44,8 @@
res.entity = data;
String userId = UserInfo.getUserId();
-<<<<<<< HEAD
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;
@@ -85,40 +53,17 @@
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);
-=======
- 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';
- }
- userPro_Typestr = '%' + agencyProType + '%';
- 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);
->>>>>>> LEXCommunityLiJun
res.status = 'Success';
res.code = 200;
System.debug('res = ' + res);
return res;
-<<<<<<< HEAD
}
// 灏嗛〉闈㈡垨鍙栧緱BarCode鍘绘帀閲嶅鐨勶紝杞崲鎴怢ist
@@ -131,21 +76,6 @@
}
List<String> outPut = new List<String>();
for (String B : Buff) {
-=======
-
- }
-
- // 灏嗛〉闈㈡垨鍙栧緱BarCode鍘绘帀閲嶅鐨勶紝杞崲鎴怢ist
- 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){
- Buff.add(A);
- }
- List<String> outPut = new List<String>();
- for(String B :Buff){
->>>>>>> LEXCommunityLiJun
B = B.trim();
outPut.add(B);
}
@@ -154,7 +84,6 @@
//鑾峰彇鏄庣粏
@AuraEnabled
-<<<<<<< HEAD
public static ResponseBodyLWC searchConsumableorderdetails(
String barcode,
String accountName,
@@ -163,11 +92,6 @@
) {
ResponseBodyLWC res = new ResponseBodyLWC();
Map<String, object> data = new Map<String, object>();
-=======
- public static ResponseBodyLWC searchConsumableorderdetails(String barcode,String accountName,String userWorkLocation,String agencyProType) {
- ResponseBodyLWC res = new ResponseBodyLWC();
- Map<String,object> data = new Map<String,object>();
->>>>>>> LEXCommunityLiJun
res.entity = data;
userPro_Typestr = '%' + agencyProType + '%';
barcode = barcode;
@@ -177,7 +101,6 @@
ConsumableorderdetailsRecordserror = new List<ConsumableorderdetailsInfo>();
ConsumableorderdetailsRecordsdummy = new List<ConsumableorderdetailsInfo>();
-<<<<<<< HEAD
notInlist = new List<String>();
BarCodeListP = ParseBarCode(barcode);
Consumable_order_details2__c p = new Consumable_order_details2__c();
@@ -190,22 +113,6 @@
//鍒ゆ柇barcode鏄惁涓虹┖
if (barcode == null || barcode == '') {
return new ResponseBodyLWC('Error', 500, '璇疯緭鍏arCode鍙�', '');
-=======
-
-
- 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> reSet = new List<Consumable_order_details2__c>();
- List<Consumable_order_details2__c> reSet1 = new List<Consumable_order_details2__c>();
- saveFLGbln = FALSE;
- alertMessage='';
-
- //鍒ゆ柇barcode鏄惁涓虹┖
- if(barcode == null || barcode ==''){
- return new ResponseBodyLWC('Error',500, '璇疯緭鍏arCode鍙�', '');
->>>>>>> LEXCommunityLiJun
// ApexPages.addmessage(new ApexPages.message(ApexPages.severity.INFO,'璇疯緭鍏arCode鍙枫��'));
// return;
}
@@ -217,7 +124,6 @@
// ConsumableorderdetailsRecordsdummy.clear();
// 浜у搧绫诲瀷涓嶅悓
-<<<<<<< HEAD
reSet1 = [
SELECT
Id,
@@ -258,39 +164,11 @@
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,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)){
- // 璺宠繃宸茬粡澶勭悊鐨勬秷鑰楀搧鏄庣粏
- 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);
->>>>>>> LEXCommunityLiJun
}
}
}
//娌℃湁鎷嗙洅
-<<<<<<< HEAD
reSet1 = [
SELECT
Id,
@@ -333,43 +211,11 @@
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,
- 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)){
- // 璺宠繃宸茬粡澶勭悊鐨勬秷鑰楀搧鏄庣粏
- continue;
- }else{
- String str = '璇ュ晢鍝佹病鏈夋媶鐩�';
- ConsumableorderdetailsRecordserror.add(new ConsumableorderdetailsInfo(reSet1[i],str));
- ErrorIdMap.put(reSet1[i].Bar_Code__c,reSet1[i].Bar_Code__c);
->>>>>>> LEXCommunityLiJun
}
}
}
//宸插嚭璐э紝鏈埌璐�
-<<<<<<< HEAD
reSet1 = [
SELECT
Id,
@@ -411,42 +257,11 @@
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,
- 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)){
- // 璺宠繃宸茬粡澶勭悊鐨勬秷鑰楀搧鏄庣粏
- continue;
- }else{
- String str = '璇ュ晢鍝佽繕鏈埌璐�';
- ConsumableorderdetailsRecordserror.add(new ConsumableorderdetailsInfo(reSet1[i],str));
- ErrorIdMap.put(reSet1[i].Bar_Code__c,reSet1[i].Bar_Code__c);
->>>>>>> LEXCommunityLiJun
}
}
}
//鎷嗙洅宸插嚭璐�
-<<<<<<< HEAD
reSet1 = [
SELECT
Id,
@@ -488,42 +303,11 @@
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,
- 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)){
- // 璺宠繃宸茬粡澶勭悊鐨勬秷鑰楀搧鏄庣粏
- continue;
- }else{
- String str = '璇ュ晢鍝佸瓨鍦ㄥ嚭璐у饱鍘�';
- ConsumableorderdetailsRecordserror.add(new ConsumableorderdetailsInfo(reSet1[i],str));
- ErrorIdMap.put(reSet1[i].Bar_Code__c,reSet1[i].Bar_Code__c);
->>>>>>> LEXCommunityLiJun
}
}
}
//鎷嗙洅宸查攢鍞�
-<<<<<<< HEAD
reSet1 = [
SELECT
Id,
@@ -565,42 +349,11 @@
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,
- 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)){
- // 璺宠繃宸茬粡澶勭悊鐨勬秷鑰楀搧鏄庣粏
- continue;
- }else{
- String str = '璇ュ晢鍝佸瓨鍦ㄩ攢鍞饱鍘�';
- ConsumableorderdetailsRecordserror.add(new ConsumableorderdetailsInfo(reSet1[i],str));
- ErrorIdMap.put(reSet1[i].Bar_Code__c,reSet1[i].Bar_Code__c);
->>>>>>> LEXCommunityLiJun
}
}
}
//鎷嗙洅杩斿搧
-<<<<<<< HEAD
reSet1 = [
SELECT
Id,
@@ -640,39 +393,10 @@
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,
- 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)){
- // 璺宠繃宸茬粡澶勭悊鐨勬秷鑰楀搧鏄庣粏
- continue;
- }else{
- String str = '璇ュ晢鍝佸瓨鍦ㄨ繑鍝佸饱鍘�';
- ConsumableorderdetailsRecordserror.add(new ConsumableorderdetailsInfo(reSet1[i],str));
- ErrorIdMap.put(reSet1[i].Bar_Code__c,reSet1[i].Bar_Code__c);
->>>>>>> LEXCommunityLiJun
}
}
}
-<<<<<<< HEAD
//鎷嗙洅鍚庣洏鐐硅繃(鐩樼偣鏃ユ湡涓嶄负绌�)
reSet1 = [
SELECT
@@ -712,41 +436,11 @@
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,
- 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)){
- // 璺宠繃宸茬粡澶勭悊鐨勬秷鑰楀搧鏄庣粏
- continue;
- }else{
- String str = '璇ュ晢鍝佸瓨鍦ㄧ洏鐐瑰饱鍘�';
- ConsumableorderdetailsRecordserror.add(new ConsumableorderdetailsInfo(reSet1[i],str));
- ErrorIdMap.put(reSet1[i].Bar_Code__c,reSet1[i].Bar_Code__c);
->>>>>>> LEXCommunityLiJun
}
}
}
//涓嶅悓宸ヤ綔鍦�
-<<<<<<< HEAD
reSet1 = [
SELECT
Id,
@@ -785,37 +479,10 @@
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);
-=======
- 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)){
- // 璺宠繃宸茬粡澶勭悊鐨勬秷鑰楀搧鏄庣粏
- continue;
- }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);
->>>>>>> LEXCommunityLiJun
}
}
}
-<<<<<<< HEAD
reSet = [
SELECT
Id,
@@ -867,58 +534,6 @@
} else {
ConsumableorderdetailsRecordsdummy.add(new ConsumableorderdetailsInfo(reSet[i]));
ExistIdMap.put(reSet[i].Bar_Code__c, reSet[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){
- for (Integer i = 0; i < reSet.size(); i++) {
- if(ErrorIdMap.containsKey(reSet[i].Bar_Code__c) ){
- // 璺宠繃閿欒鐨勬秷鑰楀搧鏄庣粏
- continue;
- }
- else if(ExistIdMap.containsKey(reSet[i].Bar_Code__c) ){
- // 璺宠繃宸茬粡澶勭悊鐨勬秷鑰楀搧鏄庣粏
- continue;
- }
- else{
- ConsumableorderdetailsRecordsdummy.add(new ConsumableorderdetailsInfo(reSet[i]));
- ExistIdMap.put(reSet[i].Bar_Code__c,reSet[i].Bar_Code__c);
->>>>>>> LEXCommunityLiJun
}
}
}
@@ -926,7 +541,6 @@
AllMap.putAll(ExistIdMap);
//寰楀埌涓嶅瓨鍦ㄧ殑BarCode
-<<<<<<< HEAD
for (Integer i = 0; i < BarCodeListP.size(); i++) {
if (ExistIdMap.containsKey(BarCodeListP[i])) {
continue;
@@ -943,29 +557,10 @@
data.put('ConsumableorderdetailsRecordsdummy', JSON.serialize(ConsumableorderdetailsRecordsdummy));
data.put('ConsumableorderdetailsRecordserror', JSON.serialize(ConsumableorderdetailsRecordserror));
data.put('dataSize', ConsumableorderdetailsRecordsdummy.size());
-=======
- for(Integer i = 0; i < BarCodeListP.size(); i++){
- if(ExistIdMap.containsKey(BarCodeListP[i])){
- continue;
- }else if(ErrorIdMap.containsKey(BarCodeListP[i])){
- continue;
- }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 + '涓嶅瓨鍦ㄣ��', '');
- }
- data.put('ConsumableorderdetailsRecordsdummy',JSON.serialize(ConsumableorderdetailsRecordsdummy));
- data.put('ConsumableorderdetailsRecordserror',JSON.serialize(ConsumableorderdetailsRecordserror));
- data.put('dataSize',ConsumableorderdetailsRecordsdummy.size());
->>>>>>> LEXCommunityLiJun
res.status = 'Success';
res.code = 200;
System.debug('res = ' + res);
return res;
-<<<<<<< HEAD
}
//鍙栨秷鎷嗙洅纭
@@ -1117,150 +712,6 @@
return null;
}
}
-=======
-
- }
-
- //鍙栨秷鎷嗙洅纭
- @AuraEnabled
- public static ResponseBodyLWC cancelRemoveBoxConfirm(String saveConsumableorderdetailsRecordsdummy,String accountName,String userWorkLocation,String agencyProType) {
- ResponseBodyLWC res = new ResponseBodyLWC();
- 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);
-
-
- List<Consumable_order_details2__c> ins = New List<Consumable_order_details2__c>();
-
- Savepoint sp = Database.setSavepoint();
- if(ConsumableorderdetailsRecordsdummy.size()<1){
- // ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR,'涓嶅瓨鍦ㄥ彇娑堟媶鐩掓槑缁�'));
- return new ResponseBodyLWC('Error',500, '涓嶅瓨鍦ㄥ彇娑堟媶鐩掓槑缁�', '');
- // return null;
- }
-
- List<String> BarCodeList = new List<String>();
- for (ConsumableorderdetailsInfo tmp : ConsumableorderdetailsRecordsdummy) {
- BarCodeList.add(tmp.esd.Bar_Code__c);
- }
-
- 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
- AND Box_Piece__c = '涓�'
- 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
- ];
-
- List<Consumable_order_details2__c> orderlistdel = 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;
-
- //鍒犻櫎閫氱暘澶т簬001鐨勬槑缁�2
- //delete delDetails2;
- orderlistdel.add(delDetails2);
- }
-
- //鍙栧緱閫氱暘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
- // 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
- AND Box_Piece__c = '涓�'
- 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
- ];
-
- 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;
-
- // 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__c;
- // tcm end
-
- //閫氱暘001銇儑銉笺偪銇鐞嗗崢浣嶃倰鐩掋伀鎴汇仐銆侀�氱暘銈掋偗銉偄
- //update updDetails2;
- orderlistupd.add(updDetails2);
- }
-
- if(orderlistdel.size()>0){
- delete orderlistdel;
- }
-
- if(orderlistupd.size()>0){
- update orderlistupd;
- }
- saveFLGbln = true;
- alertMessage = '鍙栨秷鎷嗙洅瀹屾垚';
- data.put('saveFLGbln',saveFLGbln);
- res.status = 'Success';
- res.code = 200;
- res.msg = alertMessage;
- System.debug('res = ' + res);
- return res;
- // return null;
- }catch(Exception e){
- Database.rollback(sp);
- ApexPages.addMessages(e);
- return null;
- }
- }
-
->>>>>>> LEXCommunityLiJun
@TestVisible
class ConsumableorderdetailsInfo implements Comparable {
@@ -1274,7 +725,6 @@
//public String tracingCodeNo { get; set; }
public String oldConsumableCount { get; set; }
public String ErrorReason { get; set; }
-<<<<<<< HEAD
public ConsumableorderdetailsInfo(Consumable_order_details2__c e, string str) {
esd = e;
Prod = e.Consumable_Product__r;
@@ -1287,20 +737,6 @@
oldConsumableCount = e.name;
}
/*
-=======
- public ConsumableorderdetailsInfo(Consumable_order_details2__c e,string str) {
- esd = e;
- Prod = e.Consumable_Product__r;
- oldConsumableCount = e.name;
- ErrorReason = str;
- }
- public ConsumableorderdetailsInfo(Consumable_order_details2__c e) {
- esd = e;
- Prod = e.Consumable_Product__r;
- oldConsumableCount = e.name;
- }
-/*
->>>>>>> LEXCommunityLiJun
public ConsumableorderdetailsInfo(Product2__c e,String barCode,Date sterilizationlimit,String serialNoorLot,String tracingCode) {
esd = new Consumable_order_details2__c();
ProductName = e.Name__c;
@@ -1326,8 +762,4 @@
return null;
}
}
-<<<<<<< HEAD
}
-=======
-}
->>>>>>> LEXCommunityLiJun
diff --git a/force-app/main/default/classes/LexCancelRemoveBoxControllerTest.cls b/force-app/main/default/classes/LexCancelRemoveBoxControllerTest.cls
index 498c24f..670ea0c 100644
--- a/force-app/main/default/classes/LexCancelRemoveBoxControllerTest.cls
+++ b/force-app/main/default/classes/LexCancelRemoveBoxControllerTest.cls
@@ -1,30 +1,17 @@
@IsTest
private class LexCancelRemoveBoxControllerTest {
-<<<<<<< HEAD
static testMethod void testMethod1() {
-=======
- static testMethod void testMethod1(){
->>>>>>> LEXCommunityLiJun
Oly_TriggerHandler.bypass('ConsumableAssetHander');
Oly_TriggerHandler.bypass('Oly_TriggerHandler');
user myUser_test;
Account myAccount2;
-<<<<<<< HEAD
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搴�'
- ];
+ 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 Email)'];
myAccount2 = new Account(
name = 'Testaccount002',
@@ -102,45 +89,6 @@
insert Order1;
List<Consumable_order_details2__c> conList = new List<Consumable_order_details2__c>();
-=======
- 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');
- 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');
- 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 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.Dealer_Info__c = myAccount2.Id;
- Order1.RecordTypeid = System.Label.RT_ConOrder_Delivery;
- Order1.Order_ProType__c = 'ET';
- insert Order1;
- List<Consumable_order_details2__c> conList = new List<Consumable_order_details2__c>();
-
-
->>>>>>> LEXCommunityLiJun
//daoku
Consumable_order_details2__c Orderdet2 = new Consumable_order_details2__c();
Orderdet2.Name = 'OCM_01_001001';
@@ -151,13 +99,8 @@
Orderdet2.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJRF';
Orderdet2.Used_date__c = null;
Orderdet2.Lose_Flag__c = false;
-<<<<<<< HEAD
Orderdet2.Return_date__c = null;
Orderdet2.Send_Date__c = null;
-=======
- Orderdet2.Return_date__c= null;
- Orderdet2.Send_Date__c= null;
->>>>>>> LEXCommunityLiJun
Orderdet2.Box_Piece__c = '鐩�';
conList.add(Orderdet2);
// insert Orderdet2;
@@ -171,7 +114,6 @@
Orderdet3.Arrive_date__c = Date.today();
Orderdet3.Send_Date__c = Date.today();
Orderdet3.Box_Piece__c = '涓�';
-<<<<<<< HEAD
Orderdet3.RemoveBox_date__c = Date.today();
Orderdet3.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJRA';
Orderdet3.Used_date__c = null;
@@ -179,17 +121,6 @@
Orderdet3.Return_date__c = null;
conList.add(Orderdet3);
// insert Orderdet3;
-=======
- 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;
- conList.add(Orderdet3);
- // insert Orderdet3;
-
-
->>>>>>> LEXCommunityLiJun
//sale
Consumable_order_details2__c Orderdet4 = new Consumable_order_details2__c();
@@ -199,7 +130,6 @@
Orderdet4.Asset_Model_No__c = 'Test02';
Orderdet4.Arrive_date__c = Date.today();
Orderdet4.Box_Piece__c = '涓�';
-<<<<<<< HEAD
Orderdet4.RemoveBox_date__c = Date.today();
Orderdet4.Bar_Code__c = '011495317020843711170400172003311074K250CXSDS';
Orderdet4.Lose_Flag__c = false;
@@ -208,17 +138,6 @@
// insert Orderdet4;
conList.add(Orderdet4);
-=======
- 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();
- // insert Orderdet4;
- conList.add(Orderdet4);
-
-
->>>>>>> LEXCommunityLiJun
//ProductPacking_list_manual__c=1
Consumable_order_details2__c Orderdet5 = new Consumable_order_details2__c();
Orderdet5.Name = 'OCM_01_001004';
@@ -228,29 +147,17 @@
Orderdet5.Arrive_date__c = Date.today();
//Orderdet5.Used_date__c = Date.today();
Orderdet5.Box_Piece__c = '鐩�';
-<<<<<<< HEAD
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.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;
->>>>>>> LEXCommunityLiJun
Orderdet5.Bar_Code__c = '010495317014059411170400172203311074K250DCWQW';
// insert Orderdet5;
conList.add(Orderdet5);
//pandian
-<<<<<<< HEAD
Consumable_order_details2__c Orderdet7 = new Consumable_order_details2__c();
-=======
- Consumable_order_details2__c Orderdet7 = new Consumable_order_details2__c();
->>>>>>> LEXCommunityLiJun
Orderdet7.Name = 'OCM_01_001004';
Orderdet7.Consumable_order_minor__c = Order1.Id;
Orderdet7.Consumable_Product__c = pro2.Id;
@@ -258,21 +165,12 @@
Orderdet7.Box_Piece__c = '鐩�';
Orderdet7.Lose_Flag__c = false;
Orderdet7.Bar_Code__c = '010495317014059411170400172203311074K250DBVUD';
-<<<<<<< HEAD
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();
-=======
- 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();
->>>>>>> LEXCommunityLiJun
Orderdet8.Name = 'OCM_01_001004';
Orderdet8.Consumable_order_minor__c = Order1.Id;
Orderdet8.Consumable_Product__c = pro2.Id;
@@ -283,22 +181,14 @@
Orderdet8.Bar_Code__c = '1683272847250250WZIOF';
Orderdet8.Used_date__c = null;
Orderdet8.Lose_Flag__c = false;
-<<<<<<< HEAD
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;
->>>>>>> LEXCommunityLiJun
conList.add(Orderdet8);
insert conList;
// insert Orderdet8;
-<<<<<<< HEAD
System.Test.startTest();
LexCancelRemoveBoxController.init();
// LexCancelRemoveBoxController.getinventorysize();
@@ -311,42 +201,17 @@
}
static testMethod void testMethod2() {
-=======
-
- System.Test.startTest();
- LexCancelRemoveBoxController.init();
- // LexCancelRemoveBoxController.getinventorysize();
- LexCancelRemoveBoxController.searchConsumableorderdetails('1683272847250250WZIOF','鎹峰皵鍖荤枟(娴峰崡锛夋湁闄愬叕鍙�','娣卞湷','ENG');
- LexCancelRemoveBoxController.searchConsumableorderdetails('','鎹峰皵鍖荤枟(娴峰崡锛夋湁闄愬叕鍙�','娣卞湷','ENG');
- LexCancelRemoveBoxController.cancelRemoveBoxConfirm(JSON.serialize(conList),'鎹峰皵鍖荤枟(娴峰崡锛夋湁闄愬叕鍙�','娣卞湷','ENG');
-
- System.Test.stopTest();
-
- }
-
- }
- static testMethod void testMethod2(){
->>>>>>> LEXCommunityLiJun
Oly_TriggerHandler.bypass('ConsumableAssetHander');
Oly_TriggerHandler.bypass('Oly_TriggerHandler');
user myUser_test;
Account myAccount2;
-<<<<<<< HEAD
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搴�'
- ];
+ 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 Email)'];
myAccount2 = new Account(
name = 'Testaccount002',
@@ -404,50 +269,6 @@
con.Bar_Code__c = '1682414917514250XSCYW';
conList.add(con);
-=======
- 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');
- 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',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>();
- Consumable_order_details2__c con = new Consumable_order_details2__c();
- con.Consumable_Arrived_order__c = Order1.Id;
- con.Send_Date__c = null;
- con.Used_date__c = null;
- con.Return_date__c = null;
- con.Lose_Flag__c = false;
- con.Box_Piece__c = '涓�';
- con.RemoveBox_date__c = Date.today();
- con.Arrive_date__c = Date.today();
- con.RemoveBox_No__c = 2;
- con.Bar_Code__c = '1682414917514250XSCYW';
- conList.add(con);
-
->>>>>>> LEXCommunityLiJun
Consumable_order_details2__c con1 = new Consumable_order_details2__c();
con1.Consumable_Arrived_order__c = Order1.Id;
con1.Send_Date__c = null;
@@ -460,7 +281,6 @@
con.RemoveBox_No__c = 1;
con1.Bar_Code__c = '1682414917514250XSCYW';
conList.add(con1);
-<<<<<<< HEAD
insert (conList);
System.debug('conList' + conList);
System.Test.startTest();
@@ -476,19 +296,11 @@
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搴�'
- ];
+ 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 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);
@@ -705,19 +517,11 @@
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搴�'
- ];
+ 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 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);
@@ -993,359 +797,4 @@
System.Test.stopTest();
}
}
-=======
- insert(conList);
- System.debug('conList'+conList);
- System.Test.startTest();
- LexCancelRemoveBoxController.cancelRemoveBoxConfirm(JSON.serialize(conList),'Testaccount002','閲嶅簡','ET');
- LexCancelRemoveBoxController.cancelRemoveBoxConfirm(JSON.serialize(conList1),'Testaccount002','閲嶅簡','ET');
- System.Test.stopTest();
- }
->>>>>>> LEXCommunityLiJun
}
- 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搴�'];
- 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');
- insert myAccount2;
- 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='鍖椾含');
- insert myUser_test;
- System.debug('MyUser_Test'+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 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';
- 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';
- Order2.Order_status__c = '鎵瑰噯';
- Order2.Order_type__c = '璁㈠崟';
- Order2.Dealer_Info__c = myAccount2.Id;
- Order2.RecordTypeid = '012100000006Jx9AAE';
- Order2.Order_ProType__c = 'ENG';
- 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> ();
- //浜у搧绫诲瀷涓嶅悓
- Consumable_order_details2__c con = new Consumable_order_details2__c();
- con.Name = 'OCM_01_001001';
- con.Consumable_order_minor__c = Order1.Id;
- con.Consumable_Product__c = pro2.Id;
- con.Asset_Model_No__c = 'Test01';
- con.Arrive_date__c = Date.today();
- 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.Box_Piece__c = '鐩�';
- conList.add(con);
- insert conList;
-
- //浜у搧绫诲瀷涓嶅悓
- Consumable_order_details2__c con1 = new Consumable_order_details2__c();
- con1.Consumable_Product__c = pro2.Id;
- con1.Consumable_order_minor__c = Order1.Id;
- con1.Bar_Code__c = '10011';
- con1.Arrive_date__c = Date.today();
- conList1.add(con1);
- //娌℃湁鎷嗙洅
- Consumable_order_details2__c con2 = new Consumable_order_details2__c();
- con2.Send_Date__c =null;
- con2.Used_date__c = null;
- con2.Lose_Flag__c = false;
- con2.Box_Piece__c = '鐩�';
- con2.Consumable_Product__c = pro2.Id;
- con2.Consumable_order_minor__c = Order1.Id;
- con2.Bar_Code__c = '10021';
- con2.Arrive_date__c = Date.today();
- con2.RemoveBox_date__c = null;
- conList1.add(con2);
- insert conList1;
-
- //宸插嚭璐� 鏈埌璐�
- Consumable_order_details2__c con3 = new Consumable_order_details2__c();
- con3.Arrive_date__c = null;
- con3.Send_Date__c =null;
- con3.Used_date__c = null;
- con3.Return_date__c = null;
- con3.Lose_Flag__c = false;
- con3.Box_Piece__c = '鐩�';
- con3.Consumable_Arrived_order__c = Order2.Id;
- con3.Consumable_Product__c = pro2.Id;
- con3.Bar_Code__c = '10031';
- conList2.add(con3);
- //鎷嗙洅宸插嚭璐�
- Consumable_order_details2__c con4 = new Consumable_order_details2__c();
- con4.Arrive_date__c = Date.today();
- con4.Send_Date__c = Date.today();
- con4.Return_date__c = null;
- con4.Used_date__c = null;
- con4.Lose_Flag__c = false;
- con4.Box_Piece__c = '涓�';
- con4.RemoveBox_date__c = Date.today();
- con4.Consumable_Arrived_order__c = Order2.Id;
- con4.Consumable_Product__c = pro2.Id;
- con4.Bar_Code__c = '10041';
- conList2.add(con4);
- insert conList2;
-
- System.Test.startTest();
- LexCancelRemoveBoxController.barcode = '1004\n1003\n1002\n1001';
- LexCancelRemoveBoxController.searchConsumableorderdetails('10061\n10051\n10041\n10031\n10021\n10011','Testaccount003','閲嶅簡','ET');
- String str = '璇ュ晢鍝佸瓨鍦ㄧ洏鐐瑰饱鍘�';
- String errorReason = '';
- LexCancelRemoveBoxController.ConsumableorderdetailsInfo c2 = new LexCancelRemoveBoxController.ConsumableorderdetailsInfo(con,str);
- c2.esd = con;
- c2.Prod = con.Consumable_product__r;
- c2.oldConsumableCount = con.name;
- c2.ErrorReason = str;
- LexCancelRemoveBoxController.ConsumableorderdetailsInfo c1 = new LexCancelRemoveBoxController.ConsumableorderdetailsInfo(con2);
- c1.esd = con;
- c1.Prod = con.Consumable_product__r;
- c1.oldConsumableCount = con.name;
- c1.compareTo(c2);
- System.Test.stopTest();
- }
- }
- 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搴�'];
- 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');
- insert myAccount2;
- 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 ='閲嶅簡');
- insert MyUser_Test;
- System.debug('MyUser_Test'+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 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';
- Order1.Order_status__c = '鎵瑰噯';
- Order1.Order_type__c = '閿�鍞�';
- Order1.Dealer_Info__c = myAccount2.Id;
- 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 = '鎵瑰噯';
- Order2.Order_type__c = '杩斿搧';
- Order2.Dealer_Info__c = myAccount2.Id;
- Order2.RecordTypeid = '012100000006Jx4AAE';
- Order2.Order_ProType__c = 'ENG';
- orderList.add(Order2);
- //鐩樼偣
- Consumable_order__c Order3 = new Consumable_order__c();
- Order3.Name = 'OCM_01';
- Order3.Order_status__c = '鎵瑰噯';
- Order3.Order_type__c = '鐩樼偣';
- Order3.Dealer_Info__c = myAccount2.Id;
- Order3.RecordTypeid = '01210000000c9dsAAA';
- Order3.Order_ProType__c = 'ENG';
- orderList.add(Order3);
- //鍙戣揣
- Consumable_order__c Order4 = new Consumable_order__c();
- Order4.Name = 'OCM_0122';
- Order4.Order_status__c = '鎵瑰噯';
- Order4.Order_type__c = '璁㈠崟';
- Order4.Dealer_Info__c = myAccount2.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> ();
- 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();
- con4.Deliver_date__c = Date.today();
- con4.Sterilization_limit__c = Date.today();
- con4.Send_Date__c = null;
- con4.Return_date__c = null;
- con4.Used_date__c = Date.today();
- con4.Lose_Flag__c = false;
- con4.Box_Piece__c = '涓�';
- con4.RemoveBox_date__c = Date.today();
- con4.RecordTypeId = '01210000000kUDKAA2';
- con4.Consumable_Product__c = pro2.Id;
- con4.Bar_Code__c = '100611';
- conList.add(con4);
- insert conList;
-
- //鎷嗙洅杩斿搧
- Consumable_order_details2__c con5 = new Consumable_order_details2__c();
- con5.Arrive_date__c = Date.today();
- con5.Return_date__c = Date.today();
- con5.Deliver_date__c = Date.today();
- con5.Send_Date__c = null;
- con5.Sterilization_limit__c = Date.today();
- con5.Used_date__c = Date.today();
- con5.Box_Piece__c = '涓�';
- con5.RemoveBox_date__c = Date.today();
- con5.RecordTypeId = '01210000000kUDPAA2';
- con5.Consumable_Product__c = pro2.Id;
- con5.Consumable_order_minor__c = Order4.Id;
- con5.Bar_Code__c = '10061';
- conList1.add(con5);
- insert conList1;
-
- //鎷嗙洅鍚庣洏鐐硅繃
- Consumable_order_details2__c con6 = new Consumable_order_details2__c();
- con6.Inventory_date__c = Date.today();
- con6.Box_Piece__c = '涓�';
- con6.RemoveBox_date__c = Date.today();
- con6.Send_Date__c = null;
- con6.Deliver_date__c = Date.today();
- con6.Sterilization_limit__c = Date.today();
- con6.RecordTypeId = '01210000000kUDKAA2';
- con6.Consumable_Arrived_order__c = Order3.Id;
- con6.Consumable_Product__c = pro2.Id;
- con6.Bar_Code__c = '10078';
- conList2.add(con6);
- insert conList2;
-
- 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();
- con3.Send_Date__c = Date.today();
- con3.Return_date__c = null;
- con3.Used_date__c = null;
- con3.Lose_Flag__c = false;
- con3.Box_Piece__c = '涓�';
- con3.Deliver_date__c = Date.today();
- con3.RemoveBox_date__c = Date.today();
- con3.RecordTypeId = '01210000000kUDKAA2';
- con3.Consumable_Product__c = pro2.Id;
- con3.Consumable_order_minor__c = Order4.Id;
- con3.Bar_Code__c = '100999';
- con3.Sterilization_limit__c = Date.today();
- conList3.add(con3);
- insert conList3;
-
-
- //reset
- // Consumable_order_details2__c con1 = new Consumable_order_details2__c();
- // con1.Intra_Trade_List_RMB__c = 1000;
- // con1.Asset_Model_No__c = 'test';
- // con1.Sterilization_limit__c = Date.today();
- // con1.Deliver_date__c = Date.today();
- // 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.Box_Piece__c = '涓�';
-
- // con1.Consumable_order_minor__c = Order4.Id;
- // con1.Guarantee_period_for_products__c = Date.today();
- // con1.Consumable_Product__c = pro2.Id;
- // con1.Bar_Code__c = '1009999';
- // conList2.add(con1);
- // insert conList2;
-
- // List<Consumable_order_details2__c> conList3 = new List<Consumable_order_details2__c> ();
- // Consumable_order_details2__c con9 = new Consumable_order_details2__c();
- // con9.RemoveBox_date__c = Date.today();
- // con9.Bar_Code__c = '100112';
- // con9.Arrive_date__c = Date.today();
- // con9.Send_Date__c = null;
- // con9.Used_date__c = null;
- // con9.Return_date__c = null;
- // con9.Lose_Flag__c = false;
- // con9.Box_Piece__c = '涓�';
- // con9.RemoveBox_No__c = 9;
- // conList3.add(con9);
- // LexCancelRemoveBoxController.searchConsumableorderdetails('100112','Testaccount003','閲嶅簡','ET');
-
-
-
- //orderDetails2
- // Consumable_order_details2__c con00 = new Consumable_order_details2__c();
- // con00.Box_Piece__c = '涓�';
- // con00.RemoveBox_date__c = Date.today();
- // con00.RemoveBox_No__c = 1;
- // con00.ContractNo_text__c = '';
- // con00.Consumable_order_minor__c = Order4.Id;
- // con00.Bar_Code__c = '10099999989';
- // conList3.add(con00);
-
- // 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');
- System.Test.stopTest();
-
-
- }
- }
-}
\ No newline at end of file
diff --git a/force-app/main/default/classes/LexConInvoiceListTest.cls b/force-app/main/default/classes/LexConInvoiceListTest.cls
index fb24ad3..f5f383c 100644
--- a/force-app/main/default/classes/LexConInvoiceListTest.cls
+++ b/force-app/main/default/classes/LexConInvoiceListTest.cls
@@ -1,5 +1,4 @@
@isTest
-<<<<<<< HEAD
private class LexConInvoiceListTest {
static testMethod void conInvoiceListTestinit() {
user myUser_test;
@@ -7,24 +6,12 @@
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搴�'
- ];
+ 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;
}
@@ -96,24 +83,12 @@
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搴�'
- ];
+ 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;
}
@@ -183,89 +158,3 @@
}
}
}
-=======
-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搴�'];
- 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;
- }
- 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);
- 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;
-
- }
- 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();
- // System.assertEquals('Test1', CDC.raesList[0].name);
- // System.assertEquals('Test2', CDC.raesList[1].name);
- // CDC.SortLimited();
- // System.assertEquals('Test1', CDC.raesList[0].name);
- // System.assertEquals('Test2', CDC.raesList[1].name);
- }
- }
- //妫�绱�
- 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搴�'];
- 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;
- }
- 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);
- 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;
-
- }
-
- 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');
- // CDC.init();
- // System.assertEquals('Test1', CDC.raesList[0].name);
- // System.assertEquals('Test2', CDC.raesList[1].name);
- // CDC.coc.Invoice_status__c = '鎻愪氦';
- // CDC.invoiceCodeSearch();
- // System.assertEquals(1, CDC.raesList.size());
- // CDC.clearUp();
- // System.assertEquals(2, CDC.raesList.size());
- }
- }
-}
->>>>>>> LEXCommunityLiJun
diff --git a/force-app/main/default/classes/LexConInvoiceViewController.cls b/force-app/main/default/classes/LexConInvoiceViewController.cls
index b67d39d..42fc3cb 100644
--- a/force-app/main/default/classes/LexConInvoiceViewController.cls
+++ b/force-app/main/default/classes/LexConInvoiceViewController.cls
@@ -102,32 +102,6 @@
}
userId = UserInfo.getUserId();
List<user> Useracc = new List<user>();
-<<<<<<< HEAD
- 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';
- }
- coc = new Consumable_order__c();
-
- Dealerelationship = [
- SELECT Dealer_subordinate__c, Dealer_subordinate__r.Name
- FROM Dealer_elationship__c
- WHERE Dealer_principal__c = :accountid
- ];
- List<Agency_Hospital_Link__c> AgencyHospitalLink = new List<Agency_Hospital_Link__c>();
- AgencyHospitalLink = [
- SELECT Id, Name, Hospital__c, Hospital__r.Id, Hospital__r.Name, Agency__c
- FROM Agency_Hospital_Link__c
- WHERE Agency__c = :accountId
- ];
-=======
Useracc = [SELECT accountid, Work_Location__c, UserPro_Type__c FROM user WHERE id = :userId];
accountid = Useracc[0].accountid;
userWorkLocation = Useracc[0].Work_Location__c;
@@ -148,7 +122,6 @@
FROM Agency_Hospital_Link__c
WHERE Agency__c = :accountId
];
->>>>>>> LEXCommunityLiJun
// 鏂拌
if (invoiceId == null || invoiceId == '') {
if (deliveryId == null || deliveryId == '') {
@@ -415,15 +388,7 @@
// attachmentRecoeds.add(new InvoiceOrderInfo(attachmentinfo[i]));
// }
// }
-<<<<<<< HEAD
- List<ContentDocumentLink> links = [
- SELECT Id, ContentDocumentId
- FROM ContentDocumentLink
- WHERE LinkedEntityId = :invoiceId
- ];
-=======
List<ContentDocumentLink> links = [SELECT Id, ContentDocumentId FROM ContentDocumentLink WHERE LinkedEntityId = :invoiceId];
->>>>>>> LEXCommunityLiJun
if (links != null && links.size() > 0) {
List<String> documentIds = new List<String>();
for (ContentDocumentLink link : links) {
@@ -434,11 +399,7 @@
FROM ContentVersion
WHERE ContentDocumentId IN :documentIds
];
-<<<<<<< HEAD
-=======
-
->>>>>>> LEXCommunityLiJun
if (cvInfo.size() > 0) {
for (Integer i = 0; i < cvInfo.size(); i++) {
attachmentRecoeds.add(new InvoiceOrderInfo(cvInfo[i]));
@@ -668,13 +629,8 @@
invoiceHead.Order_ForDealer__c = SecondDealer;
}
invoiceHead.Order_ForDealerText__c = coc.Order_ForDealerText__c;
-<<<<<<< HEAD
if (Test.isRunningTest()) {
invoiceHead.Order_ForHospital__c = null;
-=======
- if(Test.isRunningTest()){
- invoiceHead.Order_ForHospital__c = null;
->>>>>>> LEXCommunityLiJun
}
insert invoiceHead;
invoiceId = invoiceHead.Id;
@@ -773,13 +729,8 @@
invoiceHead.Order_ForDealer__c = SecondDealer;
}
invoiceHead.Order_ForDealerText__c = coc.Order_ForDealerText__c;
-<<<<<<< HEAD
if (Test.isRunningTest()) {
invoiceHead.Order_ForHospital__c = null;
-=======
- if(Test.isRunningTest()){
- invoiceHead.Order_ForHospital__c = null;
->>>>>>> LEXCommunityLiJun
}
insert invoiceHead;
System.debug('invoiceHead = ' + invoiceHead);
@@ -1729,8 +1680,4 @@
return null;
}
}
-<<<<<<< HEAD
}
-=======
-}
->>>>>>> LEXCommunityLiJun
diff --git a/force-app/main/default/classes/LexConInvoiceViewControllerTest.cls b/force-app/main/default/classes/LexConInvoiceViewControllerTest.cls
index 869060a..ad6a913 100644
--- a/force-app/main/default/classes/LexConInvoiceViewControllerTest.cls
+++ b/force-app/main/default/classes/LexConInvoiceViewControllerTest.cls
@@ -1,10 +1,5 @@
@isTest
-<<<<<<< HEAD
private class LexConInvoiceViewControllerTest { //鏂板缓鍙戠エ 浠ュ強缂栬緫鍙戠エ invoiceId<>null
-=======
-private class LexConInvoiceViewControllerTest
-{ //鏂板缓鍙戠エ 浠ュ強缂栬緫鍙戠エ invoiceId<>null
->>>>>>> LEXCommunityLiJun
public static user myUser_test;
public static Account myAccount1;
public static Account hosp1;
@@ -13,28 +8,15 @@
public static Account agency2;
@testSetup
static void setupTestData() {
-<<<<<<< HEAD
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搴�'
- ];
+ 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;
}
@@ -91,25 +73,10 @@
}
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 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 agency1 = [SELECT Id FROM Account WHERE name = 'Testhosp001' LIMIT 1];
+ Account agency2 = [SELECT Id FROM Account WHERE name = 'Testhosp002' LIMIT 1];
System.runAs(curUser) {
//浜у搧淇℃伅
@@ -147,11 +114,7 @@
//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(
@@ -289,25 +252,10 @@
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 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 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();
@@ -322,11 +270,7 @@
//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',
@@ -408,25 +352,10 @@
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 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 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(
@@ -446,954 +375,15 @@
invoiceorder.Name = 'invoice01';
invoiceorder.Order_type__c = '鍙戠エ';
invoiceorder.Invoice_status__c = '鑽夋涓�';
-=======
- 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(){
- 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='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 =hosp1.Id;
- // invoiceorder.Order_ForDealer__c = agency1.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];
- //鍑哄簱鍗�
-
- 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();
- TestList2.Deliver_date__c = Date.today();
- 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);
- insert order_LinkTable1;
-
- //鍑哄簱鍗�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;
-
- //鍑哄簱鍗�1鏄庣粏2
- Consumable_orderdetails__c orderdet2 = new Consumable_orderdetails__c();
- orderdet2.Name = 'Test1_001002';
- //orderdet2.Consumable_principal__c = testList2.Id;
- orderdet2.Consumable_order__c = testList1.Id;
- orderdet2.RecordTypeId = System.Label.RT_ConOrderDetail1_Invoice;
- orderdet2.Consumable_count__c = 1;
- orderdet2.Consumable_product__c = pro1.Id;
-
- Consumable_orderdetails__c orderdet3 = new Consumable_orderdetails__c();
- orderdet3.Name = 'Test1_001002';
- //orderdet2.Consumable_principal__c = testList2.Id;
- orderdet3.Consumable_order__c = invoiceorder.Id;
- orderdet3.RecordTypeId = System.Label.RT_ConOrderDetail1_Invoice;
- orderdet3.Consumable_count__c = 1;
- orderdet3.Consumable_product__c = pro1.Id;
- 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);
-
- 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.saveFile(invoiceorder.Id,'Test','TmFtZSxTdW1tb25zRm9yRGlyY3Rpb25fX2MsSG9zcGl0YWxDb2RlLE9yZGVyX0Zvckhvc3BpdGFsX19jLE9yZGVyX0ZvckN1c3RvbWVyVGV4dF9fYyxPcmRlcl9Gb3JEZWFsZXJfX2MsQmFyX0NvZGVfX2MsU2hpcG1lbnRfQ291bnRfX2MsRGVsaXZlcnlfTGlzdF9STUJfX2MsQm94X1BpZWNlX19jLFVuaXRwcmljZV9Ub19hZ2VuY3lfX2MsT3V0Ym91bmRfRGF0ZV9fYyxMb3NlX3JlYXNvbl9fYw0KREItRlkyMDI0LTA2LVozMTAwMDIs55u05o6l6ZSA5ZSu57uZ5Yy76ZmiLDgxMDU2NDAs5a6955S45Lic5qGl5bq35aSN5Yy76ZmiLOa2iOWMluenkSwsMTY4NjIwMzI1NDQ2ODI1MFZWR0lVLDEsMjAwMCznm5IsMjAsMjAyMy82Lzgs5Lii5aSx5Y6f5ZugDQpEQi1GWTIwMjQtMDYtWjMxMDAwMyznm7TmjqXplIDllK7nu5nljLvpmaIsODEwNTY0MCzlrr3nlLjkuJzmoaXlurflpI3ljLvpmaIs5raI5YyW56eRLCwxNjg2MjAzMjU2MDk4MjUwUkVKT1EsMSwzMDAwLOebkiwyMCwyMDIzLzYvOCzkuKLlpLHljp%2Flm6ANCkRCLUZZMjAyNC0wNi1aMzEwMDA0LOebtOaOpemUgOWUrue7meWMu%2BmZoiw4MTA1NjQwLOWuveeUuOS4nOahpeW6t%2BWkjeWMu%2BmZoizmtojljJbnp5EsLDE2ODYyMDMyNTc2NTcyNTBHU0ZTQiwxLDQwMDAs55uSLDIwLDIwMjMvNi84LOS4ouWkseWOn%2BWboA0K');
- try{
- LexConInvoiceViewController.saveFile(invoiceorder.Id,'Test','');
- }catch(Exception e){
- system.debug('Test');
-
- }
- LexConInvoiceViewController.outbound = testList2;
- LexConInvoiceViewController.getInvoiceName();
- // LexConInvoiceViewController.shipmentAccount = '222';
- Map<String, Decimal> ordermx1defaultMap = new Map<String, Decimal>();
- LexConInvoiceViewController.ordermx1defaultMap = ordermx1defaultMap;
- Map<String, String> deleteMap = new Map<String, String>();
- LexConInvoiceViewController.deleteOutboundorder(deleteMap,'');
- // LexConInvoiceViewController.invoiceOrderRecoedsCount
- LexConInvoiceViewController.orderby = new List<String>{ 'Outbound_Date__c', 'Name', 'ShipmentAccount__c' };
- LexConInvoiceViewController.sortKey = 'test';
- LexConInvoiceViewController.preSortKey = 'test';
- LexConInvoiceViewController.sortOrderAsc = false;
- LexConInvoiceViewController.sortOrder = new List<String>{ 'Outbound_Date__c', 'Name', 'ShipmentAccount__c' };
- List<LexConInvoiceViewController.InvoiceOrderInfo> test1 = new List<LexConInvoiceViewController.InvoiceOrderInfo>();
- List<String> chukudanID = new List<String>();
- chukudanID.add(testList2.Id);
- chukudanID.add(testList1.Id);
- LexConInvoiceViewController.newinvoicedetails1(chukudanID);
- Map<String, String> insertDetMap = new Map<String, String>();
- insertDetMap.put('Outboundorder_Code_link__c',testList1.Id);
- // LexConInvoiceViewController.outOrderchange(insertDetMap);
- LexConInvoiceViewController.getdefaultMapinfo(chukudanID);
-
-
-
-
- System.Test.stopTest();
-
- }
- }
-
-
- //鏂板缓鍙戠エ invoiceId=null
-
- 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){
- //鍙戠エ淇℃伅
- 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 =hosp1.Id;
- // invoiceorder.Order_ForDealer__c = agency1.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];
-
- 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();
- TestList2.Deliver_date__c = Date.today();
- 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);
- insert order_LinkTable1;
-
- System.Test.startTest();
- 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);
-
- 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.HospitalInfo = hosp1.id;
- System.Test.stopTest();
-
- }
- }
- //鏂板缓鍙戠エ invoiceId=null error check
-
- 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){
- //浜у搧淇℃伅
- 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 Product2__c[] {pro1};
- //鍙戠エ淇℃伅
- 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 =hosp1.Id;
//invoiceorder.Order_ForDealer__c = agency1.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];
-
- 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();
- TestList2.Deliver_date__c = Date.today();
- 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);
- insert order_LinkTable1;
-
- 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);
-
- 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.init();
-
- LexConInvoiceViewController.invoiceId =invoiceorder.Id;
- // LexConInvoiceViewController.coc.SummonsForDirction__c = '鐩存帴閿�鍞粰鍖婚櫌';
- LexConInvoiceViewController.HospitalInfo = hosp1.id;
- System.debug('===>hosp1.id'+hosp1.id);
- LexConInvoiceViewController.invoiceId =null;
- System.Test.stopTest();
-
-
- }
- }
-
- //鏂板缓鍙戠エ 浠ュ強缂栬緫鍙戠エinvoiceId== NULL and deliveryId== NULL
- 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){
- //浜у搧淇℃伅
- 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.Order_type__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.Order_ProType__c = 'ET';
- insert invoiceorder;
-
- 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);
- 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();
- 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);
- 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);
- insert order_LinkTable2;
- //鍑哄簱鍗�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;
-
- //鍑哄簱鍗�1鏄庣粏2
- Consumable_orderdetails__c orderdet2 = new Consumable_orderdetails__c();
- orderdet2.Name = 'Test1_001002';
- //orderdet2.Consumable_principal__c = testList2.Id;
- orderdet2.Consumable_order__c = testList1.Id;
- orderdet2.RecordTypeId = System.Label.RT_ConOrderDetail1_Invoice;
- orderdet2.Consumable_count__c = 1;
- orderdet2.Consumable_product__c = pro1.Id;
- //鍑哄簱鍗�2鏄庣粏1
- Consumable_orderdetails__c orderdet3 = new Consumable_orderdetails__c();
- orderdet3.Name = 'Test1_002001';
- //orderdet2.Consumable_principal__c = testList2.Id;
- orderdet3.Consumable_order__c = testList2.id;
- orderdet3.RecordTypeId = System.Label.RT_ConOrderDetail1_Invoice;
- orderdet3.Consumable_count__c = 1;
- orderdet3.Shipment_Count__c = 1;
- orderdet3.Consumable_product__c = pro2.Id;
-
- //鍑哄簱鍗�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;
- orderdet4.RecordTypeId = System.Label.RT_ConOrderDetail1_Invoice;
- orderdet4.Consumable_count__c = 1;
- orderdet4.Shipment_Count__c = 1;
- orderdet4.Consumable_product__c = pro2.Id;
- 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?KeyWords=Redirect');
- page.setRedirect(true);
- System.Test.setCurrentPage(page);
-
- //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);
-
- 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);
- System.Test.stopTest();
- }
- }
-
- //鏂板缓鍙戠エ 浠ュ強缂栬緫鍙戠エinvoiceId== NULL and deliveryId<> NULL
- 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){
- //浜у搧淇℃伅
- 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.Order_type__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;
- insert invoiceorder;
-
- 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);
- 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();
- 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);
- 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);
- insert order_LinkTable2;
- //鍑哄簱鍗�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;
-
- //鍑哄簱鍗�1鏄庣粏2
- Consumable_orderdetails__c orderdet2 = new Consumable_orderdetails__c();
- orderdet2.Name = 'Test1_001002';
- //orderdet2.Consumable_principal__c = testList2.Id;
- orderdet2.Consumable_order__c = testList1.Id;
- orderdet2.RecordTypeId = System.Label.RT_ConOrderDetail1_Invoice;
- orderdet2.Consumable_count__c = 1;
- orderdet2.Consumable_product__c = pro1.Id;
- //鍑哄簱鍗�2鏄庣粏1
- Consumable_orderdetails__c orderdet3 = new Consumable_orderdetails__c();
- orderdet3.Name = 'Test1_002001';
- //orderdet2.Consumable_principal__c = testList2.Id;
- orderdet3.Consumable_order__c = testList2.id;
- orderdet3.RecordTypeId = System.Label.RT_ConOrderDetail1_Invoice;
- orderdet3.Consumable_count__c = 1;
- orderdet3.Shipment_Count__c = 1;
- orderdet3.Consumable_product__c = pro2.Id;
-
- //鍑哄簱鍗�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;
- orderdet4.RecordTypeId = System.Label.RT_ConOrderDetail1_Invoice;
- orderdet4.Consumable_count__c = 1;
- orderdet4.Shipment_Count__c = 1;
- orderdet4.Consumable_product__c = pro2.Id;
- 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);
- page.setRedirect(true);
- System.Test.setCurrentPage(page);
-
-
- // contest.deliveryId=testList1.id;
- System.Test.startTest();
- 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);
-
- 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);
- System.Test.stopTest();
-
- }
- }
-
- //鏂板缓鍙戠エ 浠ュ強缂栬緫鍙戠エinvoiceId<> NULL
- 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){
- //浜у搧淇℃伅
- 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.Order_type__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;
- insert invoiceorder;
-
- 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);
- 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();
- 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);
- 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);
- insert order_LinkTable2;
- //鍑哄簱鍗�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;
-
- //鍑哄簱鍗�1鏄庣粏2
- Consumable_orderdetails__c orderdet2 = new Consumable_orderdetails__c();
- orderdet2.Name = 'Test1_001002';
- //orderdet2.Consumable_principal__c = testList2.Id;
- orderdet2.Consumable_order__c = testList1.Id;
- orderdet2.RecordTypeId = System.Label.RT_ConOrderDetail1_Invoice;
- orderdet2.Consumable_count__c = 1;
- orderdet2.Consumable_product__c = pro1.Id;
- //鍑哄簱鍗�2鏄庣粏1
- Consumable_orderdetails__c orderdet3 = new Consumable_orderdetails__c();
- orderdet3.Name = 'Test1_002001';
- //orderdet2.Consumable_principal__c = testList2.Id;
- orderdet3.Consumable_order__c = testList2.id;
- orderdet3.RecordTypeId = System.Label.RT_ConOrderDetail1_Invoice;
- orderdet3.Consumable_count__c = 1;
- orderdet3.Shipment_Count__c = 1;
- orderdet3.Consumable_product__c = pro2.Id;
-
- //鍑哄簱鍗�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;
- orderdet4.RecordTypeId = System.Label.RT_ConOrderDetail1_Invoice;
- orderdet4.Consumable_count__c = 1;
- orderdet4.Shipment_Count__c = 1;
- orderdet4.Consumable_product__c = pro2.Id;
- 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?KeyWords=Redirect');
- // page.setRedirect(true);
- // System.Test.setCurrentPage(page);
-
- // ConInvoiceViewController conTest = new ConInvoiceViewController();
- // contest.deliveryId=testList1.id;
- // conTest.invoiceId =invoiceorder.Id;
- System.Test.startTest();
- 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);
-
- 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);
-
-
-
-
- // conTest.init();
-
- //System.assertEquals(false, conTest.getdone());
- //System.assertEquals(false, conTest.getExistOutbound());
- //System.assertEquals('invoice01', conTest.getInvoiceName());
- //System.assertEquals(2, conTest.invoiceOrderRecoedsCount);
- // conTest.InvoiceorderSearch();
-
- // conTest.SortLimited();
- System.Test.stopTest();
-
- }
- }
- 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){
- //浜у搧淇℃伅
- 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.Order_type__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;
- insert invoiceorder;
-
- 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);
-
- 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();
- TestList2.Deliver_date__c = Date.today();
- System.Test.startTest();
- 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);
- insert order_LinkTable1;
-
- //鍑哄簱鍗�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;
-
- //鍑哄簱鍗�1鏄庣粏2
- Consumable_orderdetails__c orderdet2 = new Consumable_orderdetails__c();
- orderdet2.Name = 'Test1_001002';
- //orderdet2.Consumable_principal__c = testList2.Id;
- orderdet2.Consumable_order__c = testList1.Id;
- orderdet2.RecordTypeId = System.Label.RT_ConOrderDetail1_Invoice;
- orderdet2.Consumable_count__c = 1;
- orderdet2.Consumable_product__c = pro1.Id;
- insert new Consumable_orderdetails__c[]{orderdet1,orderdet2};
-
- 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);
-
- 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);
- System.Test.stopTest();
-
- }
- }
-
- 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){
- //浜у搧淇℃伅
- 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.Order_type__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;
- insert invoiceorder;
-
- 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);
-
- 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();
- TestList2.Deliver_date__c = Date.today();
- System.Test.startTest();
- 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);
- insert order_LinkTable1;
-
- //鍑哄簱鍗�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;
-
- //鍑哄簱鍗�1鏄庣粏2
- Consumable_orderdetails__c orderdet2 = new Consumable_orderdetails__c();
- orderdet2.Name = 'Test1_001002';
- //orderdet2.Consumable_principal__c = testList2.Id;
- orderdet2.Consumable_order__c = testList1.Id;
- orderdet2.RecordTypeId = System.Label.RT_ConOrderDetail1_Invoice;
- orderdet2.Consumable_count__c = 1;
- orderdet2.Consumable_product__c = pro1.Id;
- insert new Consumable_orderdetails__c[]{orderdet1,orderdet2};
-
- 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 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);
-
- 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);
- 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){
- //浜у搧淇℃伅
- 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.Order_type__c = '鍙戠エ';
- invoiceorder.Invoice_status__c='鑽夋涓�';
->>>>>>> LEXCommunityLiJun
- 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;
-<<<<<<< HEAD
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',
@@ -1476,129 +466,17 @@
LexConInvoiceViewController.HospitalInfo = hosp1.id;
System.debug('===>hosp1.id' + hosp1.id);
LexConInvoiceViewController.invoiceId = null;
-=======
- invoiceorder.Dealer_Info__c=acc.Id;
- insert invoiceorder;
-
- 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);
- 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();
- 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);
- 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);
- insert order_LinkTable2;
- //鍑哄簱鍗�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;
-
- //鍑哄簱鍗�1鏄庣粏2
- Consumable_orderdetails__c orderdet2 = new Consumable_orderdetails__c();
- orderdet2.Name = 'Test1_001002';
- //orderdet2.Consumable_principal__c = testList2.Id;
- orderdet2.Consumable_order__c = testList1.Id;
- orderdet2.RecordTypeId = System.Label.RT_ConOrderDetail1_Invoice;
- orderdet2.Consumable_count__c = 1;
- orderdet2.Consumable_product__c = pro1.Id;
- //鍑哄簱鍗�2鏄庣粏1
- Consumable_orderdetails__c orderdet3 = new Consumable_orderdetails__c();
- orderdet3.Name = 'Test1_002001';
- //orderdet2.Consumable_principal__c = testList2.Id;
- orderdet3.Consumable_order__c = testList2.id;
- orderdet3.RecordTypeId = System.Label.RT_ConOrderDetail1_Invoice;
- orderdet3.Consumable_count__c = 1;
- orderdet3.Shipment_Count__c = 1;
- orderdet3.Consumable_product__c = pro2.Id;
-
- //鍑哄簱鍗�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;
- orderdet4.RecordTypeId = System.Label.RT_ConOrderDetail1_Invoice;
- orderdet4.Consumable_count__c = 1;
- orderdet4.Shipment_Count__c = 1;
- orderdet4.Consumable_product__c = pro2.Id;
- 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');
- page.setRedirect(true);
- System.Test.setCurrentPage(page);
-
-
- System.Test.startTest();
- 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);
-
- 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.saveAttachment(JSON.serialize(caic),invoiceorder.Id);
->>>>>>> LEXCommunityLiJun
System.Test.stopTest();
}
}
-<<<<<<< HEAD
//鏂板缓鍙戠エ 浠ュ強缂栬緫鍙戠エinvoiceId== NULL and deliveryId== NULL
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 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 agency1 = [SELECT Id FROM Account WHERE name = 'Testhosp001' LIMIT 1];
+ Account agency2 = [SELECT Id FROM Account WHERE name = 'Testhosp002' LIMIT 1];
System.runAs(curUser) {
//浜у搧淇℃伅
@@ -1636,11 +514,7 @@
//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);
@@ -1697,130 +571,21 @@
orderdet2.Name = 'Test1_001002';
//orderdet2.Consumable_principal__c = testList2.Id;
orderdet2.Consumable_order__c = testList1.Id;
-=======
-
- //鎻愪氦
- 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){
- //浜у搧淇℃伅
- 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 Product2__c[] {pro1, pro2};
- //鍙戠エ淇℃伅
- 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 =hosp1.Id;
- //invoiceorder.Order_ForDealer__c = agency1.Id;
- invoiceorder.Dealer_Info__c=acc.Id;
- insert invoiceorder;
-
- 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='浼犵エ',
- RecordTypeId = System.Label.RT_ConOrder_Sale,
- 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='浼犵エ',
- RecordTypeId = System.Label.RT_ConOrder_Sale,
- 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();
- testList2.Deliver_date__c = Date.today();
- 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);
- 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);
- insert order_LinkTable2;
- //鍑哄簱鍗�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;
- orderdet1.Invoiced_Count__c = 10;
- orderdet1.Delivery_List_RMB__c = 200;
- orderdet1.Box_Piece__c = '鐩�';
- orderdet1.Invoice_Unit__c = '涓�';
- // 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';
- //orderdet1.Consumable_principal__c = testList1.Id;
- orderdet12.Consumable_order__c = testList1.Id;
- orderdet12.RecordTypeId = System.Label.RT_ConOrderDetail1_Invoice;
- orderdet12.Consumable_count__c = 1;
- orderdet12.Consumable_product__c = pro1.Id;
- orderdet12.Invoiced_Count__c = 30;
- orderdet12.Delivery_List_RMB__c = 200;
- //鍑哄簱鍗�1鏄庣粏2
- Consumable_Orderdetails__c orderdet2 = new Consumable_Orderdetails__c();
- orderdet2.Name = 'Test1_001002';
- //orderdet2.Consumable_principal__c = testList2.Id;
- orderdet2.Consumable_order__c = invoiceorder.Id;
->>>>>>> LEXCommunityLiJun
orderdet2.RecordTypeId = System.Label.RT_ConOrderDetail1_Invoice;
orderdet2.Consumable_count__c = 1;
orderdet2.Consumable_product__c = pro1.Id;
//鍑哄簱鍗�2鏄庣粏1
-<<<<<<< HEAD
Consumable_orderdetails__c orderdet3 = new Consumable_orderdetails__c();
orderdet3.Name = 'Test1_002001';
//orderdet2.Consumable_principal__c = testList2.Id;
orderdet3.Consumable_order__c = testList2.id;
-=======
- Consumable_Orderdetails__c orderdet3 = new Consumable_Orderdetails__c();
- orderdet3.Name = 'Test1_002001';
- //orderdet2.Consumable_principal__c = testList2.Id;
- orderdet3.Consumable_order__c = invoiceorder.Id;
->>>>>>> LEXCommunityLiJun
orderdet3.RecordTypeId = System.Label.RT_ConOrderDetail1_Invoice;
orderdet3.Consumable_count__c = 1;
orderdet3.Shipment_Count__c = 1;
orderdet3.Consumable_product__c = pro2.Id;
-<<<<<<< HEAD
//鍑哄簱鍗�2鏄庣粏2
Consumable_orderdetails__c orderdet4 = new Consumable_orderdetails__c();
-=======
- //鍑哄簱鍗�2鏄庣粏2
- Consumable_Orderdetails__c orderdet4 = new Consumable_Orderdetails__c();
->>>>>>> LEXCommunityLiJun
orderdet4.Name = 'Test1_002002';
//orderdet2.Consumable_principal__c = testList2.Id;
orderdet4.Consumable_order__c = testList2.id;
@@ -1828,92 +593,13 @@
orderdet4.Consumable_count__c = 1;
orderdet4.Shipment_Count__c = 1;
orderdet4.Consumable_product__c = pro2.Id;
-<<<<<<< HEAD
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,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,
- Name,
- Consumable_order__c,
- Consumable_order__r.Name,
- Asset_Model_No__c,
- Consumable_Product__r.Asset_Model_No__c,
- Shipment_Count__c,
- RrturnPro_count__c,
- Delivery_List_RMB__c,
- InvoicedProCost_RMB__c,
- Invoiced_Procount__c,
- Invoiced_Count__c,
- Invoice_Unitprice__c,
- InvoiceProNot_count__c,
- Invoice_Cost_RMB__c,
- Invoice_No__c,
- Box_Piece__c,
- Invoice_Unit__c,
- ProductPacking_list_manual__c
- FROM Consumable_Orderdetails__c
- WHERE Id = :orderdet1.Id
- ];
-
- System.debug('outOrderdet1List'+outOrderdet1List);
- List<Consumable_Orderdetails__c> outOrderdet1List1 = [
- SELECT
- Id,
- Name,
- Consumable_order__c,
- Consumable_order__r.Name,
- Asset_Model_No__c,
- Consumable_Product__r.Asset_Model_No__c,
- Shipment_Count__c,
- RrturnPro_count__c,
- Delivery_List_RMB__c,
- InvoicedProCost_RMB__c,
- Invoiced_Procount__c,
- Invoiced_Count__c,
- Invoice_Unitprice__c,
- InvoiceProNot_count__c,
- Invoice_Cost_RMB__c,
- Invoice_No__c,
- Box_Piece__c,
- Invoice_Unit__c,
- ProductPacking_list_manual__c
- FROM Consumable_Orderdetails__c
- WHERE Id = :orderdet12.Id
- ];
-
- 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){
- 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){
- 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();
->>>>>>> LEXCommunityLiJun
caic.Attachment_ID__c = acc.Id;
caic.Accessories_type__c = '鍙戠エ鍜屾槑缁�';
caic.Invoice_code__c = invoiceorder.id;
insert caic;
-<<<<<<< HEAD
PageReference page = new PageReference('/apex/ConInvoiceView?KeyWords=Redirect');
page.setRedirect(true);
System.Test.setCurrentPage(page);
@@ -1955,55 +641,17 @@
agency1.id,
invoiceOrderRecoeds
);
-=======
-
-
- System.Test.startTest();
- 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);
-
- 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);
->>>>>>> LEXCommunityLiJun
System.Test.stopTest();
}
}
-<<<<<<< HEAD
//鏂板缓鍙戠エ 浠ュ強缂栬緫鍙戠エinvoiceId== NULL and deliveryId<> NULL
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 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 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(
@@ -2039,11 +687,7 @@
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);
@@ -2178,25 +822,10 @@
//鏂板缓鍙戠エ 浠ュ強缂栬緫鍙戠エinvoiceId<> NULL
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 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 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(
@@ -2225,193 +854,14 @@
invoiceorder.Name = 'invoice01';
invoiceorder.Order_type__c = '鍙戠エ';
invoiceorder.Invoice_status__c = '鑽夋涓�';
-=======
- //鎻愪氦鍙戠エ
- 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];
- Oly_TriggerHandler.bypass('ConsumableAssetHander');
- Oly_TriggerHandler.bypass('Oly_TriggerHandler');
- 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};
-
-
- //鍑哄簱鍗�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);
- TestList1.Order_date__c = Date.today().addDays(2);
- TestList1.Deliver_date__c = Date.today();
- insert testList1;
-
- //鍑哄簱鍗�1鏄庣粏1
- Consumable_orderdetails__c orderdet1 = new Consumable_orderdetails__c();
- orderdet1.Name = 'Test1_001';
- orderdet1.Consumable_order__c = testList1.Id;
- orderdet1.RecordTypeId = System.Label.RT_ConOrderDetail1_Sale;
- orderdet1.Shipment_Count__c = 1;
- orderdet1.Delivery_List_RMB__c = 1;
- orderdet1.Consumable_product__c = pro1.Id;
- orderdet1.Shipment_Count__c = 50;
- orderdet1.Invoiced_Procount__c = 5;
- orderdet1.RrturnPro_count__c = 5;
- insert orderdet1;
- List<String> conorList = new List<String>();
- conorList.add(testList1.Id);
- //鍑哄簱鍗�1鏄庣粏2
- Consumable_order_details2__c orderdet2 = new Consumable_order_details2__c();
- orderdet2.Name = 'Test1_001001';
- orderdet2.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
- orderdet2.Consumable_Sale_order__c = testList1.Id;
- orderdet2.Deliver_date__c = Date.today();
- orderdet2.Arrive_date__c = Date.today();
- orderdet2.Used_date__c = Date.today();
- orderdet2.Consumable_product__c = pro1.Id;
- insert orderdet2;
-
- //鍙戠エ淇℃伅
- 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 =hosp1.Id;
- invoiceorder.Dealer_Info__c=acc.Id;
- insert invoiceorder;
-
- //鍙戠エ鏄庣粏1
- Consumable_orderdetails__c invoicedet1 = new Consumable_orderdetails__c();
- invoicedet1.Name = 'invoice01_01';
- invoicedet1.Consumable_order__c = invoiceorder.Id;
- invoicedet1.RecordTypeId = System.Label.RT_ConOrderDetail1_Invoice;
- invoicedet1.Invoiced_Count__c = 1;
- invoicedet1.Invoice_Unitprice__c = 1;
- invoicedet1.Consumable_product__c = pro1.Id;
- 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);
- insert order_LinkTable1;
- List<Consumable_Orderdetails__c> outOrderdet1List = [
- SELECT
- Id,
- Name,
- Consumable_order__c,
- Consumable_order__r.Name,
- Asset_Model_No__c,
- Consumable_Product__r.Asset_Model_No__c,
- Shipment_Count__c,
- RrturnPro_count__c,
- Delivery_List_RMB__c,
- InvoicedProCost_RMB__c,
- Invoiced_Procount__c,
- Invoiced_Count__c,
- Invoice_Unitprice__c,
- InvoiceProNot_count__c,
- Invoice_Cost_RMB__c,
- Invoice_No__c,
- Box_Piece__c,
- Invoice_Unit__c,
- ProductPacking_list_manual__c
- FROM Consumable_Orderdetails__c
- WHERE Id = :orderdet1.Id
- ];
- 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){
- tempCocMap1.put(cocTemp.Consumable_order__c + cocTemp.Asset_Model_No__c, cocTemp);
- }
- }
-
-
- System.Test.startTest();
-
-
- 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);
-
- 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');
-
-
-
-
-
- // 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(){
- 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='invoice01';
- invoiceorder.Order_type__c = '鍙戠エ';
- invoiceorder.Invoice_status__c='鎻愪氦';
->>>>>>> LEXCommunityLiJun
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;
-<<<<<<< HEAD
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);
@@ -2454,50 +904,6 @@
Invoice_Code_link__c = invoiceorder.Id
);
insert order_LinkTable2;
-=======
- 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];
- //鍑哄簱鍗�
-
- 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 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);
- TestList1.Deliver_date__c = Date.today();
- TestList2.Deliver_date__c = Date.today();
- TestList3.Deliver_date__c = Date.today();
- insert testList1;
- 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);
- insert order_LinkTable1;
- insert order_LinkTable2;
- insert order_LinkTable3;
-
->>>>>>> LEXCommunityLiJun
//鍑哄簱鍗�1鏄庣粏1
Consumable_orderdetails__c orderdet1 = new Consumable_orderdetails__c();
orderdet1.Name = 'Test1_001001';
@@ -2515,7 +921,6 @@
orderdet2.RecordTypeId = System.Label.RT_ConOrderDetail1_Invoice;
orderdet2.Consumable_count__c = 1;
orderdet2.Consumable_product__c = pro1.Id;
-<<<<<<< HEAD
//鍑哄簱鍗�2鏄庣粏1
Consumable_orderdetails__c orderdet3 = new Consumable_orderdetails__c();
orderdet3.Name = 'Test1_002001';
@@ -2601,25 +1006,10 @@
}
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 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 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(
@@ -2655,11 +1045,7 @@
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(
@@ -2695,169 +1081,6 @@
Invoice_Code_link__c = invoiceorder.Id
);
insert order_LinkTable1;
-=======
- insert new Consumable_orderdetails__c[]{orderdet1,orderdet2};
-
- //鍑哄簱鍗�2鏄庣粏1
- Consumable_orderdetails__c orderdet3 = new Consumable_orderdetails__c();
- orderdet3.Name = 'Test3_001002';
- //orderdet3.Consumable_principal__c = testList2.Id;
- orderdet3.Consumable_order__c = testList2.Id;
- orderdet3.RecordTypeId = System.Label.RT_ConOrderDetail1_Invoice;
- orderdet3.Consumable_count__c = 1;
- orderdet3.Consumable_product__c = pro1.Id;
- insert orderdet3;
-
- //鍑哄簱鍗�3鏄庣粏1
- Consumable_orderdetails__c orderdet4 = new Consumable_orderdetails__c();
- orderdet4.Name = 'Test3_001002';
- //orderdet4.Consumable_principal__c = testList2.Id;
- orderdet4.Consumable_order__c = testList3.Id;
- orderdet4.RecordTypeId = System.Label.RT_ConOrderDetail1_Invoice;
- orderdet4.Consumable_count__c = 1;
- orderdet4.Consumable_product__c = pro1.Id;
- insert orderdet4;
-
- 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 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);
-
- 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);
-
-
-
-
- // ConInvoiceViewController conTest = new ConInvoiceViewController();
-
- // conTest.init();
-
- // conTest.invoiceId =invoiceorder.Id;
- // conTest.coc.SummonsForDirction__c = '鐩存帴閿�鍞粰鍖婚櫌';
- // conTest.HospitalInfo = hosp1.id;
- // //conTest.SecondDealer = agency1.id;
- // //conTest.coc.Order_ForDealer__c = agency1.id;
- // conTest.coc.Name = 'invoice002';
- // conTest.coc.Order_ForCustomerText__c = 'AA';
- // conTest.coc.Order_ForHospital__c = hosp1.id;
- // conTest.coc.Invoice_Date__c = Date.today();
-
-
- // //conTest.SortLimited();
- // //conTest.InvoiceorderSearch();
- // System.assertEquals(3, conTest.invoiceOrderRecoeds.size());
- // conTest.invoiceOrderRecoeds[0].esd.Order_ForCustomerText__c = 'AA';
- // conTest.invoiceOrderRecoeds[0].esd.Order_ForHospital__c =hosp1.Id;
- // conTest.invoiceOrderRecoeds[0].esd.Order_ForDealer__c = agency1.id;
-
- // conTest.invoiceOrderRecoeds[1].esd.Order_ForCustomerText__c = 'AA';
- // 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;
-
- // conTest.save();
- // //System.assertEquals('123',conTest.testTmp);
- // conTest.nvoiceorderremind();
- // conTest.saveAttachment();
-
- // conTest.getdone();
- // 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
- //鏂板缓鍙戠エ 浠ュ強缂栬緫鍙戠エ invoiceId<>null
- 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){
- //浜у搧淇℃伅
- 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.Order_type__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.Order_ProType__c = 'ET';
- insert invoiceorder;
-
- 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);
-
- 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);
- TestList1.Order_date__c = Date.today().addDays(2);
- TestList2.Order_date__c = Date.today().addDays(2);
- TestList3.Order_date__c = Date.today().addDays(2);
- TestList1.Deliver_date__c = Date.today();
- TestList2.Deliver_date__c = Date.today();
- TestList3.Deliver_date__c = Date.today();
- insert testList1;
- 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);
- insert order_LinkTable1;
- insert order_LinkTable2;
- insert order_LinkTable3;
->>>>>>> LEXCommunityLiJun
//鍑哄簱鍗�1鏄庣粏1
Consumable_orderdetails__c orderdet1 = new Consumable_orderdetails__c();
@@ -2876,7 +1099,6 @@
orderdet2.RecordTypeId = System.Label.RT_ConOrderDetail1_Invoice;
orderdet2.Consumable_count__c = 1;
orderdet2.Consumable_product__c = pro1.Id;
-<<<<<<< HEAD
insert new List<Consumable_orderdetails__c>{ orderdet1, orderdet2 };
LexConInvoiceViewController.init(invoiceorder.id, 'Redirect', testList2.Id);
@@ -2921,25 +1143,10 @@
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 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 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(
@@ -2975,11 +1182,7 @@
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(
@@ -3082,25 +1285,10 @@
//浠庡嚭搴撳崟鐩存帴寮�绁�
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 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 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(
@@ -3136,11 +1324,7 @@
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);
@@ -3276,25 +1460,10 @@
//鎻愪氦
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 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 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(
@@ -3331,11 +1500,7 @@
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);
@@ -3558,24 +1723,9 @@
//鎻愪氦鍙戠エ
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 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');
@@ -3756,25 +1906,10 @@
//鏂板缓鍙戠エ 浠ュ強缂栬緫鍙戠エ invoiceId<>null
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 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 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(
@@ -3811,11 +1946,7 @@
//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(
@@ -4008,25 +2139,10 @@
//鏂板缓鍙戠エ 浠ュ強缂栬緫鍙戠エ invoiceId<>null
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 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 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(
@@ -4063,11 +2179,7 @@
//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(
@@ -4215,25 +2327,10 @@
//鏂板缓鍙戠エ 浠ュ強缂栬緫鍙戠エ invoiceId<>null
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 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 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 //鍑哄簱鍗�
@@ -4274,11 +2371,7 @@
//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(
@@ -4313,129 +2406,17 @@
testList3.Order_status__c = '鑽夋涓�';
testList3.Order_type__c = '浼犵エ';
testList3.Dealer_info__c = acc.Id;
-=======
- insert new Consumable_orderdetails__c[]{orderdet1,orderdet2};
-
- //鍑哄簱鍗�2鏄庣粏1
- Consumable_orderdetails__c orderdet3 = new Consumable_orderdetails__c();
- orderdet3.Name = 'Test3_001002';
- //orderdet3.Consumable_principal__c = testList2.Id;
- orderdet3.Consumable_order__c = testList2.Id;
- orderdet3.RecordTypeId = System.Label.RT_ConOrderDetail1_Invoice;
- orderdet3.Consumable_count__c = 1;
- orderdet3.Consumable_product__c = pro1.Id;
- insert orderdet3;
-
- //鍑哄簱鍗�3鏄庣粏1
- Consumable_orderdetails__c orderdet4 = new Consumable_orderdetails__c();
- orderdet4.Name = 'Test3_001002';
- //orderdet4.Consumable_principal__c = testList2.Id;
- orderdet4.Consumable_order__c = testList3.Id;
- orderdet4.RecordTypeId = System.Label.RT_ConOrderDetail1_Invoice;
- orderdet4.Consumable_count__c = 1;
- orderdet4.Consumable_product__c = pro1.Id;
- insert orderdet4;
-
- 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 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);
-
- 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);
- System.Test.stopTest();
-
- }
- }
- //鏂板缓鍙戠エ 浠ュ強缂栬緫鍙戠エ invoiceId<>null
- 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){
- //鍑嗗鏁版嵁
- // 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 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.Order_type__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.Order_ProType__c = 'ET';
- insert invoiceorder;
-
- 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);
-
- 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;
->>>>>>> LEXCommunityLiJun
testList3.Order_ForCustomerText__c = '娑堝寲绉�';
insert testList1;
insert testList2;
insert testList3;
-<<<<<<< HEAD
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);
->>>>>>> LEXCommunityLiJun
insert order_LinkTable1;
//鍑哄簱鍗�1鏄庣粏1
@@ -4463,11 +2444,7 @@
orderdet3.RecordTypeId = System.Label.RT_ConOrderDetail1_Invoice;
orderdet3.Consumable_count__c = 1;
orderdet3.Consumable_product__c = pro1.Id;
-<<<<<<< HEAD
insert new List<Consumable_orderdetails__c>{ orderdet1, orderdet2, orderdet3 };
-=======
- insert new Consumable_orderdetails__c[]{orderdet1,orderdet2,orderdet3};
->>>>>>> LEXCommunityLiJun
//鍙戠エ闄勪欢
Consumable_accessories_invoice__c cai = new Consumable_accessories_invoice__c();
@@ -4476,7 +2453,6 @@
System.Test.startTest();
-<<<<<<< HEAD
LexConInvoiceViewController.init(invoiceorder.Id, '', testList1.Id);
LexConInvoiceViewController.init('', '', testList1.Id);
LexConInvoiceViewController.init(invoiceorder.Id, '', '');
@@ -4540,52 +2516,18 @@
'',
invoiceOrderRecoedschangeLwc
);
-=======
- 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);
->>>>>>> LEXCommunityLiJun
//淇濆瓨
// LexConInvoiceViewController.save(testList1,'娴嬭瘯鍖婚櫌',hosp1.Id,agency1.Id,'',testList1.Id,invoiceorder.Id,myAccount1.Id,'ET');
System.Test.stopTest();
}
-<<<<<<< HEAD
}
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 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 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();
@@ -4644,25 +2586,10 @@
}
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 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 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();
@@ -4782,25 +2709,10 @@
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 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 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();
@@ -4858,25 +2770,10 @@
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 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 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',
@@ -4991,25 +2888,10 @@
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 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 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();
@@ -5070,12 +2952,7 @@
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
- ];
+ Account acc = [SELECT Id FROM Account WHERE name = 'Testaccount002' LIMIT 1];
System.runAs(curUser) {
//浜у搧淇℃伅
Product2 prod01 = new Product2(
@@ -5194,12 +3071,7 @@
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
- ];
+ Account acc = [SELECT Id FROM Account WHERE name = 'Testaccount002' LIMIT 1];
System.runAs(curUser) {
//浜у搧淇℃伅
Product2 prod01 = new Product2(
@@ -5342,12 +3214,7 @@
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
- ];
+ Account acc = [SELECT Id FROM Account WHERE name = 'Testaccount002' LIMIT 1];
System.runAs(curUser) {
//浜у搧淇℃伅
Product2 prod01 = new Product2(
@@ -5462,546 +3329,4 @@
// 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"}]');
}
}
-=======
- }
- 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;
-
-
- 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);
- }
->>>>>>> LEXCommunityLiJun
}
-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 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/LexConInvoicedetailsController.cls b/force-app/main/default/classes/LexConInvoicedetailsController.cls
index 4f220f5..9c3889a 100644
--- a/force-app/main/default/classes/LexConInvoicedetailsController.cls
+++ b/force-app/main/default/classes/LexConInvoicedetailsController.cls
@@ -34,15 +34,7 @@
sumPrice = 0;
coc = new Consumable_order__c();
//鍑哄簱鍗曚俊鎭�
-<<<<<<< HEAD
- 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];
->>>>>>> LEXCommunityLiJun
//鍙戠エ淇℃伅
invoicecode = [
SELECT Id, Name, ShipmentAccount__c, Order_ForCustomerText__c, Order_ForDealerText__c, Dealer_Info__c
@@ -403,8 +395,4 @@
Invoice_UnitOptsMap.put('涓�', '涓�');
}
}
-<<<<<<< HEAD
}
-=======
-}
->>>>>>> LEXCommunityLiJun
diff --git a/force-app/main/default/classes/LexConInvoicedetailsControllerTest.cls b/force-app/main/default/classes/LexConInvoicedetailsControllerTest.cls
index 57e5f15..1a6f32c 100644
--- a/force-app/main/default/classes/LexConInvoicedetailsControllerTest.cls
+++ b/force-app/main/default/classes/LexConInvoicedetailsControllerTest.cls
@@ -1,31 +1,18 @@
@isTest
private class LexConInvoicedetailsControllerTest {
@isTest
-<<<<<<< HEAD
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搴�'
- ];
+ 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;
}
@@ -160,70 +147,6 @@
TestList1.Order_date__c = Date.today();
TestList2.Deliver_date__c = Date.today();
insert new List<Consumable_order__c>{ testList1, testList2 };
-=======
- 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搴�'];
- 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;
- }
- 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 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){
- //浜у搧淇℃伅
- 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.Order_type__c = '鍙戠エ';
- invoiceorder.Invoice_status__c='宸插畬鎴�';
- invoiceorder.Invoice_Date__c = Date.today();
- invoiceorder.RecordTypeid = System.Label.RT_ConOrder_Invoice;
- invoiceorder.Dealer_info__c= myAccount1.Id;
- // createId.Order_ForHospital__c = myAccount2.Id;
- 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);
- 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 Consumable_order__c[]{testList1,testList2};
->>>>>>> LEXCommunityLiJun
List<Consumable_Orderdetails__c> invoiceList = new List<Consumable_Orderdetails__c>();
//鍙戠エ鏄庣粏1
@@ -238,17 +161,10 @@
invoicedet1.Shipment_Count__c = 1;
invoicedet1.Invoice_Unitprice__c = 1;
invoicedet1.Delivery_List_RMB__c = 1;
-<<<<<<< HEAD
invoicedet1.InvoicedProCost_RMB__c = 1;
invoicedet1.Invoice_Unit__c = '涓�';
invoicedet1.Invoiced_Procount__c = 3;
invoicedet1.RrturnPro_count__c = 3;
-=======
- invoicedet1.InvoicedProCost_RMB__c =1;
- invoicedet1.Invoice_Unit__c = '涓�';
- invoicedet1.Invoiced_Procount__c = 3;
- invoicedet1.RrturnPro_count__c =3;
->>>>>>> LEXCommunityLiJun
invoiceList.add(invoicedet1);
Consumable_orderdetails__c invoicedet2 = new Consumable_orderdetails__c();
@@ -262,17 +178,10 @@
invoicedet2.Shipment_Count__c = 1;
invoicedet2.Invoice_Unitprice__c = 1;
invoicedet2.Delivery_List_RMB__c = 1;
-<<<<<<< HEAD
invoicedet2.InvoicedProCost_RMB__c = 1;
invoicedet2.Invoice_Unit__c = '涓�';
invoicedet2.Invoiced_Procount__c = 3;
invoicedet2.RrturnPro_count__c = 3;
-=======
- invoicedet2.InvoicedProCost_RMB__c =1;
- invoicedet2.Invoice_Unit__c = '涓�';
- invoicedet2.Invoiced_Procount__c = 3;
- invoicedet2.RrturnPro_count__c =3;
->>>>>>> LEXCommunityLiJun
invoiceList.add(invoicedet2);
Consumable_orderdetails__c invoicedet3 = new Consumable_orderdetails__c();
@@ -288,13 +197,8 @@
invoicedet3.Delivery_List_RMB__c = 2.0;
invoicedet3.Invoice_Unitprice__c = 1;
invoicedet3.InvoicedProCost_RMB__c = 1;
-<<<<<<< HEAD
invoicedet3.Invoiced_Procount__c = 3;
invoicedet3.RrturnPro_count__c = 3;
-=======
- invoicedet3.Invoiced_Procount__c = 3;
- invoicedet3.RrturnPro_count__c =3;
->>>>>>> LEXCommunityLiJun
invoiceList.add(invoicedet3);
insert invoiceList;
@@ -312,13 +216,8 @@
orderdet1.Delivery_List_RMB__c = 2.0;
orderdet1.Invoice_Unitprice__c = 1;
orderdet1.InvoicedProCost_RMB__c = 1;
-<<<<<<< HEAD
orderdet1.Invoiced_Procount__c = 3;
orderdet1.RrturnPro_count__c = 3;
-=======
- orderdet1.Invoiced_Procount__c = 3;
- orderdet1.RrturnPro_count__c =3;
->>>>>>> LEXCommunityLiJun
orderdet1.Invoice_Unit__c = '涓�';
codList.add(orderdet1);
@@ -333,13 +232,8 @@
orderdet2.Delivery_List_RMB__c = 2.0;
orderdet2.Invoice_Unitprice__c = 1;
orderdet2.InvoicedProCost_RMB__c = 1;
-<<<<<<< HEAD
orderdet2.Invoiced_Procount__c = 3;
orderdet2.RrturnPro_count__c = 3;
-=======
- orderdet2.Invoiced_Procount__c = 3;
- orderdet2.RrturnPro_count__c =3;
->>>>>>> LEXCommunityLiJun
orderdet2.Invoice_Unit__c = '鐩�';
codList.add(orderdet2);
@@ -354,22 +248,12 @@
orderdet3.Delivery_List_RMB__c = 2.0;
orderdet3.Invoice_Unitprice__c = 1;
orderdet3.InvoicedProCost_RMB__c = 1;
-<<<<<<< HEAD
orderdet3.Invoiced_Procount__c = 3;
orderdet3.RrturnPro_count__c = 3;
orderdet3.Invoice_Unit__c = '涓�';
orderdet3.Invoiced_Count__c = 3;
codList.add(orderdet3);
-=======
- orderdet3.Invoiced_Procount__c = 3;
- orderdet3.RrturnPro_count__c =3;
- orderdet3.Invoice_Unit__c = '涓�';
- orderdet3.Invoiced_Count__c= 3;
- codList.add(orderdet3);
-
-
->>>>>>> LEXCommunityLiJun
Consumable_orderdetails__c orderdet4 = new Consumable_orderdetails__c();
orderdet4.Name = 'Test1_0010031';
orderdet4.Consumable_order__c = testList1.Id;
@@ -381,17 +265,10 @@
orderdet4.Delivery_List_RMB__c = 2.0;
orderdet4.Invoice_Unitprice__c = 1;
orderdet4.InvoicedProCost_RMB__c = 1;
-<<<<<<< HEAD
orderdet4.Invoiced_Procount__c = 3;
orderdet4.RrturnPro_count__c = 3;
orderdet4.Invoice_Unit__c = '鐩�';
orderdet4.Invoiced_Count__c = 3;
-=======
- orderdet4.Invoiced_Procount__c = 3;
- orderdet4.RrturnPro_count__c =3;
- orderdet4.Invoice_Unit__c = '鐩�';
- orderdet4.Invoiced_Count__c= 3;
->>>>>>> LEXCommunityLiJun
codList.add(orderdet4);
Consumable_orderdetails__c orderdet5 = new Consumable_orderdetails__c();
@@ -404,15 +281,9 @@
orderdet5.Invoice_Unit__c = '涓�';
orderdet5.Shipment_Count__c = 11;
orderdet5.Delivery_List_RMB__c = 2.0;
-<<<<<<< HEAD
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;
->>>>>>> LEXCommunityLiJun
codList.add(orderdet5);
Consumable_orderdetails__c orderdet6 = new Consumable_orderdetails__c();
@@ -425,15 +296,9 @@
orderdet6.Invoice_Unit__c = '鐩�';
orderdet6.Shipment_Count__c = 11;
orderdet6.Delivery_List_RMB__c = 2.0;
-<<<<<<< HEAD
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;
->>>>>>> LEXCommunityLiJun
codList.add(orderdet6);
Consumable_orderdetails__c orderdet7 = new Consumable_orderdetails__c();
@@ -447,7 +312,6 @@
orderdet7.Invoice_Unit__c = '涓�';
orderdet7.Shipment_Count__c = 11;
orderdet7.Delivery_List_RMB__c = 2.0;
-<<<<<<< HEAD
orderdet7.Invoiced_Procount__c = 3;
orderdet7.Invoiced_Count__c = 3;
orderdet7.RrturnPro_count__c = 3;
@@ -478,33 +342,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);
- //搴忓垪鍖朖son
-
-
- System.Test.startTest();
- System.debug('===>鏁版嵁'+LexConInvoicedetailsController.consumableorderdetails1Records);
- List<LexConInvoicedetailsController.ConsumableorderdetailsInfo> inList = LexConInvoicedetailsController.consumableorderdetails1Records;
- 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;
- ass.esd.Invoice_Unit__c = '涓�';
- inList1.add(ass);
- }
- LexConInvoicedetailsController.save(JSON.serialize(inList1),invoiceorder.Id,testList1.Id);
- System.Test.stopTest();
-
- }
- }
-}
->>>>>>> LEXCommunityLiJun
diff --git a/force-app/main/default/classes/LexConsumableAccountController.cls b/force-app/main/default/classes/LexConsumableAccountController.cls
index 9d0ef2a..6752183 100644
--- a/force-app/main/default/classes/LexConsumableAccountController.cls
+++ b/force-app/main/default/classes/LexConsumableAccountController.cls
@@ -43,15 +43,7 @@
pageSize = pageSizeLWC;
pageToken = pageTokenLWC > 2000 ? 2000 : pageTokenLWC;
-<<<<<<< HEAD
- 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()];
->>>>>>> LEXCommunityLiJun
accountId = [SELECT id, Name FROM account WHERE id = :Useracc.accountid].id;
agencyProType = Useracc.UserPro_Type__c;
if (String.isBlank(Useracc.UserPro_Type__c)) {
@@ -152,63 +144,6 @@
Date thisDatetime2 = Date.newInstance(thisYear, 4, 1);
Date nextDatetime = Date.newInstance(nextYear, 4, 1);
-<<<<<<< HEAD
- AggregateResult[] arList = null;
-
- System.debug('fiscalYear = ' + fiscalYear);
- if (fiscalYear == 'thisYear') {
- AggregateResult[] saleAmountList = LexConsumableAccountSOQL.getAccountTotalSales(thisDatetime, nextDatetime);
- 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')));
- 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')));
- System.debug('topInfo.saleAmount = ' + topInfo.saleAmount);
- arList = LexConsumableAccountSOQL.getAccountBySales(lastDatetime, nextDatetime);
- }
-
- // Map<String,Decimal> mapTemp = new Map<String,Decimal>();
- // for (AggregateResult ar : arList) {
- // if(!mapTemp.get(String.valueOf(ar.get('hospitalName')))){
- // mapTemp.put(String.valueOf(ar.get('hospitalName'),Decimal.valueOf(String.valueOf(ar.get('thisAmount')))));
- // }else {
- // Decimal decimal = mapTemp.get(String.valueOf(ar.get('hospitalName')));
- // decimal += Decimal.valueOf(String.valueOf(ar.get('thisAmount')));
- // mapTemp.put(String.valueOf(ar.get('hospitalName'),decimal));
- // }
- // }
- // System.debug('mapTemp = ' + mapTemp);
- // //鎺掑簭Decimal浠庡ぇ鍒板皬
- // List<Decimal> decimalList = new List<Decimal>(mapTemp.values());
- // decimalList.sort((a, b) => b.compareTo(a));
- // Map<String, Decimal> sortedMap = new Map<String, Decimal>();
- // for (String key : mapTemp.keySet()) {
- // sortedMap.put(key, mapTemp.get(key));
- // }
-
- // System.debug('Sorted Map: ' + sortedMap);
-
- //鏌ヨ瀹㈡埛淇℃伅锛堝悕绉帮紝鐪侊紝鍘匡級
- System.debug('arList = ' + arList);
- 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') {
- accountList.add(String.valueOf(ar.get('Order_ForHospital__c')));
- topInfo.deList.add(Decimal.valueOf(String.valueOf(ar.get('thisAmount'))));
- }
- }
-
- System.debug('accountList = ' + accountList);
- System.debug('topInfo = ' + topInfo);
-
-=======
//AggregateResult[] arList = null;
AggregateResult[] arList = new List<AggregateResult>();
System.debug('fiscalYear = ' + fiscalYear);
@@ -253,7 +188,7 @@
// for (String key : mapTemp.keySet()) {
// sortedMap.put(key, mapTemp.get(key));
// }
-
+
// System.debug('Sorted Map: ' + sortedMap);
//鏌ヨ瀹㈡埛淇℃伅锛堝悕绉帮紝鐪侊紝鍘匡級
@@ -261,16 +196,15 @@
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'))));
}
}
System.debug('accountList = ' + accountList);
System.debug('topInfo = ' + topInfo);
->>>>>>> LEXCommunityLiJun
List<Account> acList = [
SELECT
id,
@@ -335,12 +269,8 @@
Date thisDatetime2 = Date.newInstance(thisYear, 4, 1);
Date nextDatetime = Date.newInstance(nextYear, 4, 1);
-<<<<<<< HEAD
- AggregateResult[] arList = null;
-=======
//AggregateResult[] arList = null;
AggregateResult[] arList = new List<AggregateResult>();
->>>>>>> LEXCommunityLiJun
System.debug('fiscalYear = ' + fiscalYear);
System.debug('thisYear = ' + thisYear);
@@ -349,39 +279,33 @@
if (fiscalYear == 'thisYear') {
AggregateResult[] saleAmountList = LexConsumableAccountSOQL.getAccountTotalSales(thisDatetime, nextDatetime);
if (saleAmountList[0].get('saleAmount') != null) {
-<<<<<<< HEAD
- 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');
->>>>>>> LEXCommunityLiJun
+ 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) {
-<<<<<<< HEAD
- 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');
->>>>>>> LEXCommunityLiJun
+ 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) {
-<<<<<<< HEAD
- 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');
->>>>>>> LEXCommunityLiJun
+ topInfo.saleAmount = saleAmountObject != null
+ ? Decimal.valueOf(String.valueOf(saleAmountObject))
+ : Decimal.valueOf('0');
System.debug('topInfo.saleAmount = ' + topInfo.saleAmount);
}
arList = LexConsumableAccountSOQL.getAccountBySales(lastDatetime, nextDatetime);
@@ -463,11 +387,7 @@
List<Account> allSelectAccount = Database.query(soql);
totalCount = allSelectAccount.size();
-<<<<<<< HEAD
String nullFL = sortOrder.toLowerCase() == 'asc' ? 'NULLS FIRST' : 'NULLS LAST';
-=======
- String nullFL = sortOrder.toLowerCase() == 'asc' ? 'NULLS FIRST': 'NULLS LAST';
->>>>>>> LEXCommunityLiJun
if (String.isNotBlank(sortField)) {
soql += ' order by ' + sortField + ' ' + sortOrder + ' ' + nullFL;
}
@@ -549,8 +469,4 @@
deList = new List<Decimal>();
}
}
-<<<<<<< HEAD
}
-=======
-}
->>>>>>> LEXCommunityLiJun
diff --git a/force-app/main/default/classes/LexConsumableAccountControllerTest.cls b/force-app/main/default/classes/LexConsumableAccountControllerTest.cls
index 766aacf..b204bad 100644
--- a/force-app/main/default/classes/LexConsumableAccountControllerTest.cls
+++ b/force-app/main/default/classes/LexConsumableAccountControllerTest.cls
@@ -3,7 +3,6 @@
public static Account account1 = new Account();
public static Account account2 = new Account();
public static Account account3 = new Account();
-<<<<<<< HEAD
public static Account consumable = new Account();
public static Contact contact1 = new Contact();
public static User user = new User();
@@ -12,21 +11,23 @@
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 = '鑽夋涓�';
- insert account1;
+ accList.add(account1);
account2.Name = 'test2鍖婚櫌';
account2.RecordTypeId = '01210000000QemG';
// account2.Is_Active__c = '鏈夊姽';
- insert account2;
+ accList.add(account2);
account3.Name = 'test3鍖婚櫌';
account3.RecordTypeId = '01210000000QemG';
// account3.Is_Active__c = '鐢宠涓�';
- insert account3;
+ accList.add(account3);
+ insert accList;
consumable.Name = 'test1缁忛攢鍟�';
consumable.RecordTypeId = '01210000000Qem1';
@@ -38,11 +39,7 @@
insert contact1;
// 銉︺兗銈躲兗
- 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 = '銉︺兗銈躲兗';
@@ -119,11 +116,7 @@
insert contact1;
// 銉︺兗銈躲兗
- 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 = '銉︺兗銈躲兗';
@@ -187,183 +180,4 @@
);
}
}
-=======
- 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){
- 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 = '鏈夊姽';
- 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;
-
-
-
- }
- 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');
-
-
- }
-
-
-
}
-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');
-
-
- }
->>>>>>> LEXCommunityLiJun
-}
-
-
-
-
-}
\ No newline at end of file
diff --git a/force-app/main/default/classes/LexConsumableAccountInfoControllerTest.cls b/force-app/main/default/classes/LexConsumableAccountInfoControllerTest.cls
index 3b43a92..4f063ca 100644
--- a/force-app/main/default/classes/LexConsumableAccountInfoControllerTest.cls
+++ b/force-app/main/default/classes/LexConsumableAccountInfoControllerTest.cls
@@ -1,35 +1,16 @@
@isTest
private class LexConsumableAccountInfoControllerTest {
-<<<<<<< HEAD
@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鍖婚櫌';
->>>>>>> LEXCommunityLiJun
account1.RecordTypeId = '01210000000QemG';
//account1.Is_Active__c = '鑽夋涓�';
insert account1;
-<<<<<<< HEAD
LexConsumableAccountInfoController cai = new LexConsumableAccountInfoController();
LexConsumableAccountInfoController.init(account1.Id);
LexConsumableAccountInfoController.init('');
}
}
-=======
-
- LexConsumableAccountInfoController cai = new LexConsumableAccountInfoController();
- LexConsumableAccountInfoController.init(account1.Id);
- LexConsumableAccountInfoController.init('');
- }
-
-}
->>>>>>> LEXCommunityLiJun
diff --git a/force-app/main/default/classes/LexConsumableAccountSOQL.cls b/force-app/main/default/classes/LexConsumableAccountSOQL.cls
index f459795..3249366 100644
--- a/force-app/main/default/classes/LexConsumableAccountSOQL.cls
+++ b/force-app/main/default/classes/LexConsumableAccountSOQL.cls
@@ -1,5 +1,4 @@
public with sharing class LexConsumableAccountSOQL {
-<<<<<<< HEAD
public static AggregateResult[] getAccountBySales(Datetime thisDatetime, Datetime nextDatetime) {
AggregateResult[] arList = new List<AggregateResult>(
[
@@ -26,34 +25,3 @@
return saleAmountList;
}
}
-=======
- 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){
- 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 != ''
- ];
- return saleAmountList;
- }
-
-
-}
->>>>>>> LEXCommunityLiJun
diff --git a/force-app/main/default/classes/LexConsumableAccountSOQLTest.cls b/force-app/main/default/classes/LexConsumableAccountSOQLTest.cls
index 407ff0f..71d354c 100644
--- a/force-app/main/default/classes/LexConsumableAccountSOQLTest.cls
+++ b/force-app/main/default/classes/LexConsumableAccountSOQLTest.cls
@@ -1,25 +1,16 @@
@isTest
private class LexConsumableAccountSOQLTest {
-<<<<<<< HEAD
@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搴�'
- ];
+ 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)'
- ];
+ Profile prof = [SELECT Id FROM Profile WHERE Name = '901_缁忛攢鍟嗙ぞ鍖烘櫘閫氭潈闄恄2閲嶉獙璇�(ET)'];
accountItem = new Account(
Name = 'Testaccount002',
Dealer_discount__c = 20,
@@ -79,34 +70,6 @@
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 };
-=======
- @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搴�'];
- 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');
- insert accountItem;
- 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='鍖椾含');
- 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 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};
->>>>>>> LEXCommunityLiJun
Consumable_order__c createId = new Consumable_order__c();
createId.Name = 'testMing1';
@@ -119,20 +82,12 @@
createId.Delivery_detail_count__c = 5;
createId.orderPattern__c = 'hospitalorder';
insert createId;
-<<<<<<< HEAD
-=======
-
->>>>>>> LEXCommunityLiJun
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;
-<<<<<<< HEAD
conOrderDetail1.Unitprice_To_agency__c = 0;
-=======
- conOrderDetail1.Unitprice_To_agency__c = 0;
->>>>>>> LEXCommunityLiJun
conOrderDetail1.Delivery_List_RMB__c = 99;
conOrderDetail1.Shipment_Count__c = 100;
conOrderDetail1.Consumable_product__c = pro1.id;
@@ -141,11 +96,7 @@
Consumable_Orderdetails__c conOrderDetail2 = new Consumable_Orderdetails__c();
conOrderDetail2.Name = 'testConOrderDetail2';
-<<<<<<< HEAD
conOrderDetail1.Unitprice_To_agency__c = 0;
-=======
- conOrderDetail1.Unitprice_To_agency__c = 0;
->>>>>>> LEXCommunityLiJun
conOrderDetail1.Delivery_List_RMB__c = 99;
conOrderDetail2.Shipment_Count__c = 99;
conOrderDetail2.Consumable_product__c = pro2.id;
@@ -153,7 +104,6 @@
coListTest.add(conOrderDetail2);
insert coListTest;
}
-<<<<<<< HEAD
}
@isTest
static void testGetAccountBySales() {
@@ -174,25 +124,3 @@
System.Test.stopTest();
}
}
-=======
- }
- @isTest
- static void testGetAccountBySales(){
- System.Test.startTest();
- 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);
- System.Test.stopTest();
- }
- @isTest
- static void testGetAccountTotalSales(){
- System.Test.startTest();
- 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);
- System.Test.stopTest();
- }
-}
->>>>>>> LEXCommunityLiJun
diff --git a/force-app/main/default/classes/LexConsumableController.cls b/force-app/main/default/classes/LexConsumableController.cls
index 6d5fee4..fedbe0a 100644
--- a/force-app/main/default/classes/LexConsumableController.cls
+++ b/force-app/main/default/classes/LexConsumableController.cls
@@ -207,15 +207,7 @@
ESetId = esetId;
methodType = type;
if (String.isBlank(methodType) && String.isNotBlank(ESetId)) {
-<<<<<<< HEAD
- 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];
->>>>>>> LEXCommunityLiJun
methodType = oclist.get(0).orderPattern__c;
}
statusEdit = keywordStr;
@@ -240,15 +232,7 @@
userId = UserInfo.getUserId();
List<user> Useracc = new List<user>();
//lt 20230517 瀹夊窘涓ょエ鍒� add ,OSHFLG__c
-<<<<<<< HEAD
- 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];
->>>>>>> LEXCommunityLiJun
accountid = Useracc[0].accountid;
userWorkLocation = Useracc[0].Work_Location__c;
agencyProType = Useracc[0].UserPro_Type__c;
@@ -567,15 +551,7 @@
// attachmentRecoeds.add(new ConsumableorderdetailsInfo(attachmentinfo[i]));
// }
// }
-<<<<<<< HEAD
- List<ContentDocumentLink> links = [
- SELECT Id, ContentDocumentId
- FROM ContentDocumentLink
- WHERE LinkedEntityId = :ESetId
- ];
-=======
List<ContentDocumentLink> links = [SELECT Id, ContentDocumentId FROM ContentDocumentLink WHERE LinkedEntityId = :ESetId];
->>>>>>> LEXCommunityLiJun
if (links != null && links.size() > 0) {
List<String> documentIds = new List<String>();
for (ContentDocumentLink link : links) {
@@ -1503,15 +1479,7 @@
ESetId = eSetidStr;
try {
statusEdit = 'Redirect';
-<<<<<<< HEAD
- 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];
->>>>>>> LEXCommunityLiJun
String url = '/lexconsumable?ESetid=' + ESetid + '&KeyWords=' + statusEdit + '&type=' + oclist.get(0).orderPattern__c;
results.result = 'Success';
results.url = url;
@@ -1531,15 +1499,7 @@
returnOrder = true;
try {
statusEdit = 'Redirect';
-<<<<<<< HEAD
- 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];
->>>>>>> LEXCommunityLiJun
String url = '/lexconsumable?ESetid=' + ESetid + '&KeyWords=' + statusEdit + '&type=' + oclist.get(0).orderPattern__c;
results.result = 'Success';
results.url = url;
@@ -1563,15 +1523,7 @@
cv.VersionData = EncodingUtil.base64Decode(base64Data);
cv.IsMajorVersion = true;
insert cv;
-<<<<<<< HEAD
- 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];
->>>>>>> LEXCommunityLiJun
c.Consumable_pdf_insert_day__c = Date.today();
update c;
results.result = 'Success';
@@ -1936,15 +1888,7 @@
p.orderPattern__c = methodType;
}
insert p;
-<<<<<<< HEAD
- 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];
->>>>>>> LEXCommunityLiJun
for (ConsumableorderdetailsInfo ass : consumableorderdetailsRecordsview) {
Roll = Roll + 1;
if (ass.check == true) {
@@ -2037,15 +1981,7 @@
p.Offers_Price__c = bargainPrice;
}
update p;
-<<<<<<< HEAD
- 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];
->>>>>>> LEXCommunityLiJun
List<Consumable_Orderdetails__c> qs = new List<Consumable_Orderdetails__c>();
qs = [
SELECT Id
@@ -2131,31 +2067,6 @@
public static Results deleteAtt(String contentVersionId, String cocId) {
Results results = new Results();
try {
-<<<<<<< HEAD
- 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
- ];
- delete conDocument;
- if (cvInfo.size() <= 1) {
- Consumable_order__c c = [
- SELECT Id
- FROM Consumable_order__c
- WHERE Id = :cocId
- ];
-=======
List<ContentVersion> cvInfo = [SELECT Id FROM ContentVersion WHERE FirstPublishLocationId = :cocId];
ContentVersion conVersion = [SELECT ContentDocumentId FROM ContentVersion WHERE Id = :contentVersionId];
String contentDocumentId = conVersion.ContentDocumentId;
@@ -2163,7 +2074,6 @@
delete conDocument;
if (cvInfo.size() <= 1) {
Consumable_order__c c = [SELECT Id FROM Consumable_order__c WHERE Id = :cocId];
->>>>>>> LEXCommunityLiJun
c.Consumable_pdf_insert_day__c = null;
update c;
}
@@ -2402,8 +2312,4 @@
@AuraEnabled
public String value;
}
-<<<<<<< HEAD
}
-=======
-}
->>>>>>> LEXCommunityLiJun
diff --git a/force-app/main/default/classes/LexConsumableControllerTest.cls b/force-app/main/default/classes/LexConsumableControllerTest.cls
index c273e00..9ba11db 100644
--- a/force-app/main/default/classes/LexConsumableControllerTest.cls
+++ b/force-app/main/default/classes/LexConsumableControllerTest.cls
@@ -1,7 +1,6 @@
@istest
public class LexConsumableControllerTest {
@IsTest
-<<<<<<< HEAD
static void ConsumableOrdertest1() {
user MyUser_Test;
Account myAccount1;
@@ -10,16 +9,8 @@
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搴�'
- ];
+ 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
@@ -216,153 +207,10 @@
re.editAble
);
LexConsumableController.sorder(order.Id, myAccount1.Id);
-=======
- 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);
- 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;
- 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);
-
- 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.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);
->>>>>>> LEXCommunityLiJun
Test.stopTest();
}
}
-<<<<<<< HEAD
@IsTest
static void ConsumableOrdertest2() {
user MyUser_Test;
@@ -372,16 +220,8 @@
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搴�'
- ];
+ 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
@@ -511,11 +351,7 @@
//鍒涘缓鍖婚櫌
Account hospital = new Account();
- hospital.recordtypeId = [
- SELECT Id
- FROM RecordType
- WHERE IsActive = TRUE AND SobjectType = 'Account' AND DeveloperName = 'HP'
- ]
+ hospital.recordtypeId = [SELECT Id FROM RecordType WHERE IsActive = TRUE AND SobjectType = 'Account' AND DeveloperName = 'HP']
.id;
hospital.Name = 'test hospital';
hospital.Is_Active__c = '鏈夊姽';
@@ -629,172 +465,10 @@
re.proLimitAndDate,
re.editAble
);
-=======
- @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);
- 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;
- 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);
-
- 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;
-
- //鍒涘缓鍖婚櫌
- 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;
-
- //鍖婚櫌
- 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();
-
- 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);
->>>>>>> LEXCommunityLiJun
Test.stopTest();
}
}
-<<<<<<< HEAD
@IsTest
static void ConsumableOrdertest3() {
user MyUser_Test;
@@ -805,16 +479,8 @@
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搴�'
- ];
+ 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
@@ -1053,169 +719,10 @@
re.proLimitAndDate,
re.editAble
);
-=======
- @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);
- 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;
- 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 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);
->>>>>>> LEXCommunityLiJun
Test.stopTest();
}
}
-<<<<<<< HEAD
@IsTest
static void ConsumableOrdertest4() {
user MyUser_Test;
@@ -1225,16 +732,8 @@
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搴�'
- ];
+ 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
@@ -1245,11 +744,7 @@
}
StaticParameter.EscapeConsumableOrderDetail2Trigger = true;
- RecordType rectCoO = [
- SELECT Id
- FROM RecordType
- WHERE IsActive = TRUE AND SobjectType = 'Account' AND Name = '鐥呴櫌'
- ];
+ 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(
@@ -1520,25 +1015,13 @@
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搴�'
- ];
+ 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 = '鐥呴櫌'
- ];
+ 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(
@@ -1583,206 +1066,12 @@
insert order;
cv = new ContentVersion();
-=======
- @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 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();
->>>>>>> LEXCommunityLiJun
cv.Title = 'test.txt';
cv.PathOnClient = '/' + 'test.txt';
cv.FirstPublishLocationId = order.Id;
cv.VersionData = EncodingUtil.base64Decode('VGVzdA==');
cv.IsMajorVersion = true;
insert cv;
-<<<<<<< HEAD
}
System.runAs(MyUser_Test) {
Product2 prod01 = new Product2(
@@ -1902,118 +1191,3 @@
}
}
}
-=======
-
- }
- 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
- );
-
- 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 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();
- }
- }
-}
->>>>>>> LEXCommunityLiJun
diff --git a/force-app/main/default/classes/LexConsumableGoodsInfoTest.cls b/force-app/main/default/classes/LexConsumableGoodsInfoTest.cls
index ff56446..ce02f53 100644
--- a/force-app/main/default/classes/LexConsumableGoodsInfoTest.cls
+++ b/force-app/main/default/classes/LexConsumableGoodsInfoTest.cls
@@ -1,7 +1,6 @@
@istest
public class LexConsumableGoodsInfoTest {
@IsTest
-<<<<<<< HEAD
static void lexConsumableGoodsInfoTest1() {
user MyUser_Test;
Account myAccount1;
@@ -9,26 +8,14 @@
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搴�'
- ];
+ 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 = '鐥呴櫌'
- ];
+ 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(
@@ -195,144 +182,6 @@
dataForProductCount5.Box_Piece__c = '鐩�';
conList1.add(dataForProductCount5);
insert conList1;
-=======
- 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);
- 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(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 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 = '鐩�';
- 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(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;
->>>>>>> LEXCommunityLiJun
Test.startTest();
LexConsumableGoodsInfo.initMoreThan7(dataForProductCount7.Id);
LexConsumableGoodsInfo.initMoreThan7All('all');
@@ -349,29 +198,16 @@
}
@IsTest
-<<<<<<< HEAD
static void lexConsumableGoodsInfoTest2() {
-=======
- static void lexConsumableGoodsInfoTest2(){
->>>>>>> LEXCommunityLiJun
User myUser_test = new User();
Account myAccount1;
Contact core;
User currentUser = [SELECT Id FROM User WHERE Id = :UserInfo.getUserId()];
-<<<<<<< HEAD
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搴�'
- ];
+ 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;
}
@@ -429,58 +265,6 @@
Order_ProType__c = 'ET'
);
insert new List<Consumable_order__c>{ Order1, Order2 };
-=======
- 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搴�'];
- if (rectCo.size() == 0) {
- return;
- }
- 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);
- 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;
- }
- 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',
- RecordTypeId = System.Label.RT_ConOrder_Delivery,
- Order_type__c ='璁㈠崟',
- Dealer_info__c=myAccount1.Id,
- Order_ProType__c = 'ET');
- Consumable_order__c Order2 = new Consumable_order__c(
- Name='OCM_01_002',
- RecordTypeId = System.Label.RT_ConOrder_Delivery,
- Order_type__c ='璁㈠崟',
- Dealer_info__c=myAccount1.Id,
- Order_ProType__c = 'ET');
- insert new Consumable_order__c[] {Order1, Order2};
->>>>>>> LEXCommunityLiJun
//鏄庣粏1
Consumable_orderdetails__c createDetail = new Consumable_orderdetails__c();
@@ -488,28 +272,19 @@
createDetail.Consumable_Product__c = pro1.id;
createDetail.Dealer_Custom_Price__c = 999.00;
createDetail.Consumable_count__c = 3;
-<<<<<<< HEAD
createDetail.Consumable_order__c = Order1.id;
-=======
- createDetail.Consumable_order__c = Order1.id;
->>>>>>> LEXCommunityLiJun
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;
-<<<<<<< HEAD
createDetail1.Consumable_order__c = Order2.id;
-=======
- createDetail1.Consumable_order__c = Order2.id;
->>>>>>> LEXCommunityLiJun
createDetail1.Dealer_Custom_Price__c = 999.00;
createDetail1.Consumable_count__c = 4;
createDetail1.RecordTypeid = System.Label.RT_ConOrderDetail1_Order;
insert createDetail1;
//璁㈠崟鏄庣粏
-<<<<<<< HEAD
Consumable_order_details2__c Orderdet1 = new Consumable_order_details2__c(
Name = 'OCM_01_001001',
Consumable_order_minor__c = Order1.Id,
@@ -539,33 +314,6 @@
RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery
);
insert new List<Consumable_order_details2__c>{ Orderdet1, Orderdet2, Orderdet3, Orderdet4 };
-=======
- 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',
- 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',
- 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',
- Consumable_order_minor__c = Order2.Id,
- Arrive_date__c = Date.today(),
- Consumable_Product__c = pro2.id,
- RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery);
- insert new Consumable_order_details2__c[] {Orderdet1, Orderdet2, Orderdet3, Orderdet4};
->>>>>>> LEXCommunityLiJun
LexConsumableGoodsInfo.initMoreThan7(Orderdet1.Id);
LexConsumableGoodsInfo.initMoreThan7All('all');
@@ -577,37 +325,20 @@
LexConsumableGoodsInfo.initDeliveryDetAll('all');
LexConsumableGoodsInfo.initTotalNum('1', 'all');
LexConsumableGoodsInfo.initTotalNum(Orderdet1.Id, 'all');
-<<<<<<< HEAD
-=======
-
->>>>>>> LEXCommunityLiJun
}
}
@IsTest
-<<<<<<< HEAD
static void lexConsumableGoodsInfoTest3() {
-=======
- static void lexConsumableGoodsInfoTest3(){
->>>>>>> LEXCommunityLiJun
User myUser_test = new User();
Account myAccount1;
Contact core;
User currentUser = [SELECT Id FROM User WHERE Id = :UserInfo.getUserId()];
-<<<<<<< HEAD
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搴�'
- ];
+ 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;
}
@@ -665,58 +396,6 @@
Order_ProType__c = 'ET'
);
insert new List<Consumable_order__c>{ Order1, Order2 };
-=======
- 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搴�'];
- if (rectCo.size() == 0) {
- return;
- }
- 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);
- 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;
- }
- 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',
- RecordTypeId = System.Label.RT_ConOrder_Delivery,
- Order_type__c ='璁㈠崟',
- Dealer_info__c=myAccount1.Id,
- Order_ProType__c = 'ET');
- Consumable_order__c Order2 = new Consumable_order__c(
- Name='OCM_01_002',
- RecordTypeId = System.Label.RT_ConOrder_Delivery,
- Order_type__c ='璁㈠崟',
- Dealer_info__c=myAccount1.Id,
- Order_ProType__c = 'ET');
- insert new Consumable_order__c[] {Order1, Order2};
->>>>>>> LEXCommunityLiJun
//鏄庣粏1
Consumable_orderdetails__c createDetail = new Consumable_orderdetails__c();
@@ -724,28 +403,19 @@
createDetail.Consumable_Product__c = pro1.id;
createDetail.Dealer_Custom_Price__c = 999.00;
createDetail.Consumable_count__c = 3;
-<<<<<<< HEAD
createDetail.Consumable_order__c = Order1.id;
-=======
- createDetail.Consumable_order__c = Order1.id;
->>>>>>> LEXCommunityLiJun
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;
-<<<<<<< HEAD
createDetail1.Consumable_order__c = Order2.id;
-=======
- createDetail1.Consumable_order__c = Order2.id;
->>>>>>> LEXCommunityLiJun
createDetail1.Dealer_Custom_Price__c = 999.00;
createDetail1.Consumable_count__c = 4;
createDetail1.RecordTypeid = System.Label.RT_ConOrderDetail1_Order;
insert createDetail1;
//璁㈠崟鏄庣粏
-<<<<<<< HEAD
Consumable_order_details2__c Orderdet1 = new Consumable_order_details2__c(
Name = 'OCM_01_001001',
Consumable_order_minor__c = Order1.Id,
@@ -775,33 +445,6 @@
RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery
);
insert new List<Consumable_order_details2__c>{ Orderdet1, Orderdet2, Orderdet3, Orderdet4 };
-=======
- 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',
- 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',
- 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',
- Consumable_order_minor__c = Order2.Id,
- Arrive_date__c = Date.today(),
- Consumable_Product__c = pro2.id,
- RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery);
- insert new Consumable_order_details2__c[] {Orderdet1, Orderdet2, Orderdet3, Orderdet4};
->>>>>>> LEXCommunityLiJun
LexConsumableGoodsInfo.initMoreThan7(Orderdet2.Id);
LexConsumableGoodsInfo.initMoreThan7All('');
@@ -816,29 +459,16 @@
}
@IsTest
-<<<<<<< HEAD
static void lexConsumableGoodsInfoTest4() {
-=======
- static void lexConsumableGoodsInfoTest4(){
->>>>>>> LEXCommunityLiJun
User myUser_test = new User();
Account myAccount1;
Contact core;
User currentUser = [SELECT Id FROM User WHERE Id = :UserInfo.getUserId()];
-<<<<<<< HEAD
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搴�'
- ];
+ 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;
}
@@ -896,58 +526,6 @@
Order_ProType__c = 'ET'
);
insert new List<Consumable_order__c>{ Order1, Order2 };
-=======
- 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搴�'];
- if (rectCo.size() == 0) {
- return;
- }
- 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);
- 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;
- }
- 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',
- RecordTypeId = System.Label.RT_ConOrder_Delivery,
- Order_type__c ='璁㈠崟',
- Dealer_info__c=myAccount1.Id,
- Order_ProType__c = 'ET');
- Consumable_order__c Order2 = new Consumable_order__c(
- Name='OCM_01_002',
- RecordTypeId = System.Label.RT_ConOrder_Delivery,
- Order_type__c ='璁㈠崟',
- Dealer_info__c=myAccount1.Id,
- Order_ProType__c = 'ET');
- insert new Consumable_order__c[] {Order1, Order2};
->>>>>>> LEXCommunityLiJun
//鏄庣粏1
Consumable_orderdetails__c createDetail = new Consumable_orderdetails__c();
@@ -955,28 +533,19 @@
createDetail.Consumable_Product__c = pro1.id;
createDetail.Dealer_Custom_Price__c = 999.00;
createDetail.Consumable_count__c = 3;
-<<<<<<< HEAD
createDetail.Consumable_order__c = Order1.id;
-=======
- createDetail.Consumable_order__c = Order1.id;
->>>>>>> LEXCommunityLiJun
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;
-<<<<<<< HEAD
createDetail1.Consumable_order__c = Order2.id;
-=======
- createDetail1.Consumable_order__c = Order2.id;
->>>>>>> LEXCommunityLiJun
createDetail1.Dealer_Custom_Price__c = 999.00;
createDetail1.Consumable_count__c = 4;
createDetail1.RecordTypeid = System.Label.RT_ConOrderDetail1_Order;
insert createDetail1;
//璁㈠崟鏄庣粏
-<<<<<<< HEAD
Consumable_order_details2__c Orderdet1 = new Consumable_order_details2__c(
Name = 'OCM_01_001001',
Consumable_order_minor__c = Order1.Id,
@@ -1006,33 +575,6 @@
RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery
);
insert new List<Consumable_order_details2__c>{ Orderdet1, Orderdet2, Orderdet3, Orderdet4 };
-=======
- 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',
- 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',
- 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',
- Consumable_order_minor__c = Order2.Id,
- Arrive_date__c = Date.today(),
- Consumable_Product__c = pro2.id,
- RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery);
- insert new Consumable_order_details2__c[] {Orderdet1, Orderdet2, Orderdet3, Orderdet4};
->>>>>>> LEXCommunityLiJun
LexConsumableGoodsInfo.initMoreThan7(Orderdet3.Id);
LexConsumableGoodsInfo.initNotArrDet(Orderdet3.Id);
@@ -1043,29 +585,16 @@
}
@IsTest
-<<<<<<< HEAD
static void lexConsumableGoodsInfoTest5() {
-=======
- static void lexConsumableGoodsInfoTest5(){
->>>>>>> LEXCommunityLiJun
User myUser_test = new User();
Account myAccount1;
Contact core;
User currentUser = [SELECT Id FROM User WHERE Id = :UserInfo.getUserId()];
-<<<<<<< HEAD
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搴�'
- ];
+ 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;
}
@@ -1123,58 +652,6 @@
Order_ProType__c = 'ET'
);
insert new List<Consumable_order__c>{ Order1, Order2 };
-=======
- 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搴�'];
- if (rectCo.size() == 0) {
- return;
- }
- 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);
- 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;
- }
- 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',
- RecordTypeId = System.Label.RT_ConOrder_Delivery,
- Order_type__c ='璁㈠崟',
- Dealer_info__c=myAccount1.Id,
- Order_ProType__c = 'ET');
- Consumable_order__c Order2 = new Consumable_order__c(
- Name='OCM_01_002',
- RecordTypeId = System.Label.RT_ConOrder_Delivery,
- Order_type__c ='璁㈠崟',
- Dealer_info__c=myAccount1.Id,
- Order_ProType__c = 'ET');
- insert new Consumable_order__c[] {Order1, Order2};
->>>>>>> LEXCommunityLiJun
//鏄庣粏1
Consumable_orderdetails__c createDetail = new Consumable_orderdetails__c();
@@ -1182,28 +659,19 @@
createDetail.Consumable_Product__c = pro1.id;
createDetail.Dealer_Custom_Price__c = 999.00;
createDetail.Consumable_count__c = 3;
-<<<<<<< HEAD
createDetail.Consumable_order__c = Order1.id;
-=======
- createDetail.Consumable_order__c = Order1.id;
->>>>>>> LEXCommunityLiJun
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;
-<<<<<<< HEAD
createDetail1.Consumable_order__c = Order2.id;
-=======
- createDetail1.Consumable_order__c = Order2.id;
->>>>>>> LEXCommunityLiJun
createDetail1.Dealer_Custom_Price__c = 999.00;
createDetail1.Consumable_count__c = 4;
createDetail1.RecordTypeid = System.Label.RT_ConOrderDetail1_Order;
insert createDetail1;
//璁㈠崟鏄庣粏
-<<<<<<< HEAD
Consumable_order_details2__c Orderdet1 = new Consumable_order_details2__c(
Name = 'OCM_01_001001',
Consumable_order_minor__c = Order1.Id,
@@ -1233,33 +701,6 @@
RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery
);
insert new List<Consumable_order_details2__c>{ Orderdet1, Orderdet2, Orderdet3, Orderdet4 };
-=======
- 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',
- 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',
- 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',
- Consumable_order_minor__c = Order2.Id,
- Arrive_date__c = Date.today(),
- Consumable_Product__c = pro2.id,
- RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery);
- insert new Consumable_order_details2__c[] {Orderdet1, Orderdet2, Orderdet3, Orderdet4};
->>>>>>> LEXCommunityLiJun
LexConsumableGoodsInfo.initMoreThan7(Orderdet4.Id);
LexConsumableGoodsInfo.initNotArrDet(Orderdet4.Id);
@@ -1270,11 +711,7 @@
}
@IsTest
-<<<<<<< HEAD
static void lexConsumableGoodsInfoTest6() {
-=======
- static void lexConsumableGoodsInfoTest6(){
->>>>>>> LEXCommunityLiJun
LexConsumableGoodsInfo.ShowRecords sr = new LexConsumableGoodsInfo.ShowRecords();
sr.prodModel = 'test';
sr.recordCount = 1;
@@ -1282,29 +719,16 @@
}
@IsTest
-<<<<<<< HEAD
static void lexConsumableGoodsInfoTest7() {
-=======
- static void lexConsumableGoodsInfoTest7(){
->>>>>>> LEXCommunityLiJun
User myUser_test = new User();
Account myAccount1;
Contact core;
User currentUser = [SELECT Id FROM User WHERE Id = :UserInfo.getUserId()];
-<<<<<<< HEAD
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搴�'
- ];
+ 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;
}
@@ -1358,55 +782,6 @@
showFalseNotshowTrue__c = false
);
insert new List<Consumable_order__c>{ Order1 };
-=======
- 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搴�'];
- if (rectCo.size() == 0) {
- return;
- }
- 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);
- 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='鍖椾含',
- 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 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',
- RecordTypeId = System.Label.RT_ConOrder_Delivery,
- Order_type__c ='璁㈠崟',
- Dealer_info__c = myAccount1.Id,
- Delivery_detail_count__c = 1,
- Order_ProType__c = 'ET',
- showFalseNotshowTrue__c = false);
- insert new Consumable_order__c[] {Order1};
->>>>>>> LEXCommunityLiJun
//鏄庣粏1
Consumable_orderdetails__c createDetail = new Consumable_orderdetails__c();
@@ -1414,78 +789,45 @@
createDetail.Consumable_Product__c = pro1.id;
createDetail.Dealer_Custom_Price__c = 999.00;
createDetail.Consumable_count__c = 3;
-<<<<<<< HEAD
createDetail.Consumable_order__c = Order1.id;
-=======
- createDetail.Consumable_order__c = Order1.id;
->>>>>>> LEXCommunityLiJun
createDetail.RecordTypeid = System.Label.RT_ConOrderDetail1_Order;
insert createDetail;
//璁㈠崟鏄庣粏
-<<<<<<< HEAD
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',
->>>>>>> LEXCommunityLiJun
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,
-<<<<<<< HEAD
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',
->>>>>>> LEXCommunityLiJun
Asset_Model_No__c = 'Test01',
Consumable_order_minor__c = Order1.Id,
Consumable_Product__c = pro1.id,
RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery,
-<<<<<<< HEAD
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};
->>>>>>> LEXCommunityLiJun
LexConsumableGoodsInfo.initNotArrDet(Order1.Id);
LexConsumableGoodsInfo.initNotArrDetAll('all');
}
}
@IsTest
-<<<<<<< HEAD
static void lexConsumableGoodsInfoTest8() {
-=======
- static void lexConsumableGoodsInfoTest8(){
->>>>>>> LEXCommunityLiJun
User myUser_test = new User();
Account myAccount1;
Contact core;
User currentUser = [SELECT Id FROM User WHERE Id = :UserInfo.getUserId()];
-<<<<<<< HEAD
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搴�'
- ];
+ 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;
}
@@ -1539,55 +881,6 @@
showFalseNotshowTrue__c = false
);
insert new List<Consumable_order__c>{ Order1 };
-=======
- 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搴�'];
- if (rectCo.size() == 0) {
- return;
- }
- 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);
- 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='鍖椾含',
- 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 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',
- RecordTypeId = System.Label.RT_ConOrder_Delivery,
- Order_type__c ='璁㈠崟',
- Dealer_info__c = myAccount1.Id,
- Delivery_detail_count__c = 1,
- Order_ProType__c = 'ET',
- showFalseNotshowTrue__c = false);
- insert new Consumable_order__c[] {Order1};
->>>>>>> LEXCommunityLiJun
//鏄庣粏1
Consumable_orderdetails__c createDetail = new Consumable_orderdetails__c();
@@ -1595,27 +888,17 @@
createDetail.Consumable_Product__c = pro1.id;
createDetail.Dealer_Custom_Price__c = 999.00;
createDetail.Consumable_count__c = 3;
-<<<<<<< HEAD
createDetail.Consumable_order__c = Order1.id;
-=======
- createDetail.Consumable_order__c = Order1.id;
->>>>>>> LEXCommunityLiJun
createDetail.RecordTypeid = System.Label.RT_ConOrderDetail1_Order;
insert createDetail;
//璁㈠崟鏄庣粏
-<<<<<<< HEAD
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',
->>>>>>> LEXCommunityLiJun
Consumable_order_minor__c = Order1.Id,
Arrive_date__c = Date.today(),
Consumable_Product__c = pro1.id,
RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery,
-<<<<<<< HEAD
Cancellation_Flag__c = false
);
Consumable_order_details2__c Orderdet3 = new Consumable_order_details2__c(
@@ -1630,17 +913,3 @@
}
}
}
-=======
- 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 Consumable_order_details2__c[] {Orderdet1, Orderdet3};
- LexConsumableGoodsInfo.initNotArrDetAll('all');
- }
- }
-}
->>>>>>> LEXCommunityLiJun
diff --git a/force-app/main/default/classes/LexConsumableOrderManageController.cls b/force-app/main/default/classes/LexConsumableOrderManageController.cls
index 1b280f4..81e1a82 100644
--- a/force-app/main/default/classes/LexConsumableOrderManageController.cls
+++ b/force-app/main/default/classes/LexConsumableOrderManageController.cls
@@ -56,13 +56,8 @@
List<CusCol> cols = new List<CusCol>();
for (FieldSetMember fsm : fsmList) {
//add by Link
-<<<<<<< HEAD
if (fsm.getFieldPath() == 'Order_ForHospital__c' && agencyProType == 'ET') {
} else {
-=======
- if(fsm.getFieldPath() == 'Order_ForHospital__c' && agencyProType == 'ET'){
- }else {
->>>>>>> LEXCommunityLiJun
CusCol col = new CusCol();
col.label = fsm.getLabel();
col.fieldName = fsm.getFieldPath();
@@ -130,15 +125,7 @@
raesList = Database.query(soql);
//add by rentx 2021-3-10 start
//涓� hasHop 璧嬪�� 鍒ゆ柇褰撳墠缁忛攢鍟嗕笅鏄惁鏈夌壒浠峰尰闄�
-<<<<<<< HEAD
- 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];
->>>>>>> LEXCommunityLiJun
if (hopList == null || hopList.size() == 0) {
hasHop = false;
} else {
@@ -156,15 +143,7 @@
for (Account acc : contractList) {
dealIds.add(acc.Id);
}
-<<<<<<< HEAD
- 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];
->>>>>>> LEXCommunityLiJun
if (deList == null || deList.size() == 0) {
hasSpecial = false;
} else {
@@ -353,8 +332,4 @@
@AuraEnabled
public String fieldName;
}
-<<<<<<< HEAD
}
-=======
-}
->>>>>>> LEXCommunityLiJun
diff --git a/force-app/main/default/classes/LexConsumableOrderManageControllerTest.cls b/force-app/main/default/classes/LexConsumableOrderManageControllerTest.cls
index 50915c1..a3f667f 100644
--- a/force-app/main/default/classes/LexConsumableOrderManageControllerTest.cls
+++ b/force-app/main/default/classes/LexConsumableOrderManageControllerTest.cls
@@ -1,29 +1,16 @@
@istest
public class LexConsumableOrderManageControllerTest {
@IsTest
-<<<<<<< HEAD
static void ConsumableOrdertest() {
-=======
- static void ConsumableOrdertest(){
->>>>>>> LEXCommunityLiJun
User myUser_test = new User();
Account myAccount1;
Contact core;
User currentUser = [SELECT Id FROM User WHERE Id = :UserInfo.getUserId()];
-<<<<<<< HEAD
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搴�'
- ];
+ 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;
}
@@ -112,36 +99,3 @@
}
}
}
-=======
- 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搴�'];
- if (rectCo.size() == 0) {
- return;
- }
- 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);
- 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;
- }
-
- 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', '鍖椾含');
- }
- }
-}
->>>>>>> LEXCommunityLiJun
diff --git a/force-app/main/default/classes/LexInventoryController.cls b/force-app/main/default/classes/LexInventoryController.cls
index f309ff0..c9de568 100644
--- a/force-app/main/default/classes/LexInventoryController.cls
+++ b/force-app/main/default/classes/LexInventoryController.cls
@@ -157,15 +157,7 @@
String userId = UserInfo.getUserId();
//String userId = '00510000006k82X';
//String userId = '00510000005QO75';
-<<<<<<< HEAD
- 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];
->>>>>>> LEXCommunityLiJun
accountid = Useracc.Accountid;
userWorkLocation = Useracc.Work_Location__c;
agencyProType = Useracc.UserPro_Type__c;
@@ -173,15 +165,7 @@
agencyProType = 'ET';
}
sqlagencyProType = '%' + agencyProType + '%';
-<<<<<<< HEAD
- Account accountInfo = [
- SELECT Name, Dealer_discount__c
- FROM account
- WHERE id = :accountid
- ];
-=======
Account accountInfo = [SELECT Name, Dealer_discount__c FROM account WHERE id = :accountid];
->>>>>>> LEXCommunityLiJun
accountName = accountInfo.Name;
consumableorderdetailsRecords = new List<ConsumableorderdetailsInfo>();
Map<String, Product2__c> midMap = new Map<String, Product2__c>();
@@ -1296,15 +1280,7 @@
try {
insert Po;
eSetId = Po.id;
-<<<<<<< HEAD
- 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];
->>>>>>> LEXCommunityLiJun
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>();
@@ -1407,7 +1383,6 @@
public PageReference doClick() {
Pagereference pr = page.InventoryCSV;
return pr;
-<<<<<<< HEAD
}
//鍒嗛〉Bean
public class PaginatedAccounts {
@@ -1496,93 +1471,3 @@
}
}
}
-=======
- }
- //鍒嗛〉Bean
- public class PaginatedAccounts {
- @AuraEnabled
- public Integer nextPageToken;
- @AuraEnabled
- public Integer pageNumber { get; set; }
- @AuraEnabled
- public Integer totalRecords { get; set; }
- @AuraEnabled
- public Integer recordStart { get; set; }
- @AuraEnabled
- public Integer recordEnd { get; set; }
- }
-
- // Data Bean
- @TestVisible
- class ConsumableorderdetailsInfo implements Comparable {
- @AuraEnabled
- public Boolean check { get; set; }
- @AuraEnabled
- public Consumable_orderdetails__c orderdetails1 { get; set; }
- @AuraEnabled
- public Consumable_order_details2__c orderdetails2 { get; set; }
- @AuraEnabled
- public Product2__c Prod { get; set; }
- @AuraEnabled
- public Decimal countid { get; set; }
- @AuraEnabled
- public String ProdId { get; set; }
- @AuraEnabled
- public Decimal Pandian { get; set; }
- @AuraEnabled
- public Decimal Diff { get; set; }
- @AuraEnabled
- public Decimal refind { get; set; }
- @AuraEnabled
- public String DiffReason { get; set; }
- @AuraEnabled
- public Boolean canSelect { get; set; }
- @AuraEnabled
- public Boolean sortBy { get; set; }
- @AuraEnabled
- public Decimal limitCount { get; set; }
- @AuraEnabled
- public Decimal overlimitCount { get; set; }
- @AuraEnabled
- public String boxPiece { get; set; }
- public ConsumableorderdetailsInfo(Consumable_order_details2__c e, string str) {
- orderdetails2 = e;
- Prod = e.Consumable_Product__r;
- //e.Lose_reason__c = str;
- DiffReason = str;
- }
-
- // 宸插瓨鍦ㄦ秷鑰楀搧鏄庣粏鐢�
- public ConsumableorderdetailsInfo(Consumable_order_details2__c e) {
- check = false;
- orderdetails2 = e;
- Prod = e.Consumable_Product__r;
- canSelect = true;
- }
- public ConsumableorderdetailsInfo(Product2__c e) {
- check = false;
- //orderdetails1 = new Consumable_orderdetails__c();
- Prod = e;
- canSelect = true;
- ProdId = string.valueOf(e.id);
- countid = 0;
- Pandian = 0;
- refind = 0;
- Diff = 0;
- limitCount = 0;
- overlimitCount = 0;
- }
- // 鎺掑簭
- public Integer compareTo(Object compareTo) {
- ConsumableorderdetailsInfo compareToesd = (ConsumableorderdetailsInfo) compareTo;
- Integer returnValue = 0;
- if (countid > compareToesd.countid) {
- returnValue = -1;
- } else if (countid < compareToesd.countid) {
- returnValue = 1;
- }
- return returnValue;
- }
- }
-}
->>>>>>> LEXCommunityLiJun
diff --git a/force-app/main/default/classes/LexInventoryControllerTest.cls b/force-app/main/default/classes/LexInventoryControllerTest.cls
index 58306b9..036f01e 100644
--- a/force-app/main/default/classes/LexInventoryControllerTest.cls
+++ b/force-app/main/default/classes/LexInventoryControllerTest.cls
@@ -1,31 +1,18 @@
@isTest
public class LexInventoryControllerTest {
-<<<<<<< HEAD
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搴�'
- ];
+ 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 = '鐥呴櫌'
- ];
+ 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;
@@ -269,24 +256,12 @@
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搴�'
- ];
+ 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 = '鐥呴櫌'
- ];
+ 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;
@@ -362,26 +337,14 @@
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搴�'
- ];
+ 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 = '鐥呴櫌'
- ];
+ 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(
@@ -563,26 +526,14 @@
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搴�'
- ];
+ 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 = '鐥呴櫌'
- ];
+ 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(
@@ -914,26 +865,14 @@
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搴�'
- ];
+ 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 = '鐥呴櫌'
- ];
+ 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(
@@ -1086,733 +1025,3 @@
}
}
}
-=======
- 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;
-
- }
- 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);
-
- 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;
- dataForProductCount.Send_Date__c = null;
- dataForProductCount.Used_date__c = null;
- 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;
- //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;
- dataForProductCount5.Lose_Flag__c = true;
- dataForProductCount5.RemoveBox_No__c = 1;
- 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> 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);
- 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;
- 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 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;
- }
- 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 = '涓�';
- dataForProductCount9.RemoveBox_No__c = 1;
- 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 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;
- 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;
- dataForProductCount3.Lose_Flag__c = true;
- //dataForProductCount3.RemoveBox_No__c = 1;
- 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);
-
- 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;
- }
- 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>();
- //鍒拌揣
- 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 = 'ENG';
- 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 = 'ENG';
- 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;
- dataForProductCount9.Used_date__c = null;
- dataForProductCount9.Lose_Flag__c = false;
- dataForProductCount9.RemoveBox_No__c = 1;
- 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;
- dataForProductCount8.Used_date__c = null;
- dataForProductCount8.Lose_Flag__c = false;
- dataForProductCount8.RemoveBox_No__c = 1;
- 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;
- dataForProductCount7.Used_date__c = null;
- dataForProductCount7.Lose_Flag__c = false;
- dataForProductCount7.RemoveBox_No__c = 1;
- 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;
- dataForProductCount6.Used_date__c = null;
- dataForProductCount6.Lose_Flag__c = false;
- dataForProductCount6.RemoveBox_No__c = 1;
- 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;
- dataForProductCount5.Used_date__c = null;
- dataForProductCount5.Lose_Flag__c = false;
- dataForProductCount5.RemoveBox_No__c = 1;
- 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);
-
- //鏌ヨ搴撳瓨 杩藉姞杩斿搧搴撳瓨
- 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);
-
-
- //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;
-
- 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');
-
-
-
- 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;
- }
- 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;
-
- //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');
- }
- }
-}
->>>>>>> LEXCommunityLiJun
diff --git a/force-app/main/default/classes/LexInventoryListController.cls b/force-app/main/default/classes/LexInventoryListController.cls
index 87742b1..9606702 100644
--- a/force-app/main/default/classes/LexInventoryListController.cls
+++ b/force-app/main/default/classes/LexInventoryListController.cls
@@ -1,11 +1,7 @@
public without sharing class LexInventoryListController {
/*****************妞滅储鐢�******************/
public static Consumable_order__c coc { get; set; }
-<<<<<<< HEAD
public static String baseUrl { get; private set; }
-=======
- public static String baseUrl {get;private set;}
->>>>>>> LEXCommunityLiJun
/*****************鐢婚潰琛ㄧずBean******************/
public static List<ConsumableorderdetailsInfo> consumableorderdetailsRecords { get; set; }
public static List<ConsumableorderdetailsInfo> consumableorderdetailsRecordsError { get; set; }
@@ -26,11 +22,7 @@
// 鐢婚潰鍒濆鍖�
@AuraEnabled
public static ResponseBodyLWC init(String eSetId) {
-<<<<<<< HEAD
system.debug('eSetId====>' + eSetId);
-=======
- system.debug('eSetId====>'+eSetId);
->>>>>>> LEXCommunityLiJun
ESetId = eSetId;
ResponseBodyLWC res = new ResponseBodyLWC();
Map<String, object> data = new Map<String, object>();
@@ -39,26 +31,14 @@
coc = new Consumable_order__c();
consumableorderdetailsRecords = new List<ConsumableorderdetailsInfo>();
-<<<<<<< HEAD
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
- ];
+ 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){
->>>>>>> LEXCommunityLiJun
coc = qs[0];
}
// 閬告姙娓堛伩銇槑缁嗐倰鍙栧緱
consumableorderdetailsSelected = [
-<<<<<<< HEAD
SELECT
Id,
Name,
@@ -78,24 +58,11 @@
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);
->>>>>>> LEXCommunityLiJun
for (Integer i = 0; i < consumableorderdetailsSelected.size(); i++) {
consumableorderdetailsRecordsError.add(new ConsumableorderdetailsInfo(consumableorderdetailsSelected[i]));
}
consumableorderdetails1 = [
-<<<<<<< HEAD
SELECT
Id,
Name,
@@ -128,28 +95,6 @@
// data.put('ConsumableorderdetailsRecordsError',JSON.serialize(ConsumableorderdetailsRecordsError));
// }
System.debug('ConsumableorderdetailsRecordsError====>' + ConsumableorderdetailsRecordsError);
-=======
- 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 ];
- 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));
- // if(ConsumableorderdetailsRecordsError.size()!=null){
- // data.put('ConsumableorderdetailsRecordsError',JSON.serialize(ConsumableorderdetailsRecordsError));
- // }
- System.debug('ConsumableorderdetailsRecordsError====>'+ConsumableorderdetailsRecordsError);
->>>>>>> LEXCommunityLiJun
res.status = 'Success';
res.code = 200;
System.debug('res = ' + res);
@@ -177,8 +122,4 @@
return null;
}
}
-<<<<<<< HEAD
}
-=======
-}
->>>>>>> LEXCommunityLiJun
diff --git a/force-app/main/default/classes/LexInventoryListControllerTest.cls b/force-app/main/default/classes/LexInventoryListControllerTest.cls
index a2d7bf2..f9bd988 100644
--- a/force-app/main/default/classes/LexInventoryListControllerTest.cls
+++ b/force-app/main/default/classes/LexInventoryListControllerTest.cls
@@ -1,30 +1,17 @@
@isTest
private class LexInventoryListControllerTest {
-<<<<<<< HEAD
-=======
-
->>>>>>> LEXCommunityLiJun
static testMethod void myUnitTest() {
Oly_TriggerHandler.bypass('ConsumableAssetHander');
Oly_TriggerHandler.bypass('Oly_TriggerHandler');
User myUser_test;
Account myAccount2;
-<<<<<<< HEAD
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搴�'
- ];
+ 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)'
- ];
+ 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(
@@ -119,66 +106,6 @@
insert new List<Consumable_orderdetails__c>{ Orderdet1, Orderdet2 };
List<Consumable_order_details2__c> conList1 = new List<Consumable_order_details2__c>();
-=======
- 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);
- 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');
- 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 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 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;
-
- 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};
-
- List<Consumable_order_details2__c> conList1 = new List<Consumable_order_details2__c> ();
->>>>>>> LEXCommunityLiJun
//浜у搧绫诲瀷涓嶅悓
Consumable_order_details2__c con = new Consumable_order_details2__c();
con.Name = 'OCM_01_001001';
@@ -189,32 +116,19 @@
con.Bar_Code__c = '10011';
con.Used_date__c = null;
con.Lose_Flag__c = false;
-<<<<<<< HEAD
con.Return_date__c = null;
con.Send_Date__c = null;
-=======
- con.Return_date__c= null;
- con.Send_Date__c= null;
->>>>>>> LEXCommunityLiJun
con.Box_Piece__c = '鐩�';
conList1.add(con);
insert conList1;
String eSetId = Order1.id;
System.Test.startTest();
LexInventoryListController.init(eSetId);
-<<<<<<< HEAD
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> inList = LexInventoryListController.consumableorderdetailsRecords;
- List<LexInventoryListController.ConsumableorderdetailsInfo> inList1 = new List<LexInventoryListController.ConsumableorderdetailsInfo>();
- for(LexInventoryListController.ConsumableorderdetailsInfo ass: inList){
- ass.orderdetails1= Orderdet1;
->>>>>>> LEXCommunityLiJun
inList1.add(ass);
}
LexInventoryListController.ConsumableorderdetailsInfo c2 = new LexInventoryListController.ConsumableorderdetailsInfo(Orderdet1);
@@ -225,12 +139,6 @@
c1.Prod = con.Consumable_product__r;
c1.compareTo(c2);
System.Test.stopTest();
-<<<<<<< HEAD
}
}
}
-=======
- }
- }
-}
->>>>>>> LEXCommunityLiJun
diff --git a/force-app/main/default/classes/LexInventoryViewControllerTest.cls b/force-app/main/default/classes/LexInventoryViewControllerTest.cls
index 2782344..f7c730a 100644
--- a/force-app/main/default/classes/LexInventoryViewControllerTest.cls
+++ b/force-app/main/default/classes/LexInventoryViewControllerTest.cls
@@ -1,5 +1,4 @@
@isTest
-<<<<<<< HEAD
public class LexInventoryViewControllerTest {
static testMethod void testInnerClass() {
List<LexInventoryViewController.ConsumableorderdetailsInfo> cro = new List<LexInventoryViewController.ConsumableorderdetailsInfo>();
@@ -10,24 +9,12 @@
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搴�'
- ];
+ 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;
}
@@ -266,16 +253,8 @@
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搴�'
- ];
+ 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;
}
@@ -435,20 +414,12 @@
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搴�'
- ];
+ 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
+ Profile prof = [SELECT Id FROM Profile WHERE Name = '901_缁忛攢鍟嗙ぞ鍖烘櫘閫氭潈闄恄2閲嶉獙璇�(ET)']; //20200916 ljh update
myAccount2 = new Account(
name = 'Testaccount002',
@@ -631,21 +602,13 @@
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搴�'
- ];
+ 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
+ Profile prof = [SELECT Id FROM Profile WHERE Name = '901_缁忛攢鍟嗙ぞ鍖烘櫘閫氭潈闄恄2閲嶉獙璇�(ET Email)']; //20210329 RTX update
myAccount2 = new Account(
name = 'Testaccount002',
@@ -837,19 +800,11 @@
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搴�'
- ];
+ 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
+ Profile prof = [SELECT Id FROM Profile WHERE Name = '901_缁忛攢鍟嗙ぞ鍖烘櫘閫氭潈闄恄2閲嶉獙璇�(ET Email)']; //20210329 RTX update
myAccount2 = new Account(
name = 'Testaccount002',
@@ -1015,24 +970,12 @@
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搴�'
- ];
+ 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;
}
@@ -1177,772 +1120,3 @@
}
}
}
-=======
-public class LexInventoryViewControllerTest {
- static testMethod void testInnerClass(){
- List<LexInventoryViewController.ConsumableorderdetailsInfo> cro = new List<LexInventoryViewController.ConsumableorderdetailsInfo>();
- cro.sort();
- }
- 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搴�'];
- 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;
- }
-
- 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',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 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 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};
-
- //鍒朵綔鐩樼偣灞ュ巻
- 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);
- }
- 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(){
- 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;
- }
-
- 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};
-
- 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);
- 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.Send_Date__c = null;
- Orderdet2.Used_date__c = null;
- Orderdet2.Lose_Flag__c = false;
- insert new Consumable_order_details2__c[] {Orderdet1,Orderdet2};
- Integer pageSizeLWC = 1;
- Integer pageTokenLWC = 0;
- String sortFieldLWC = '';
- String sortOrderLWC ='';
- String category3LWC = 'CDS';
- String agencyProTypeLWC = 'ENG';
- 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>();
-
-
- 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(){
- 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閲嶉獙璇�(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='鍖椾含');
- 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 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';
- createId.Order_status__c = '鎵瑰噯';
- createId.Deliver_date__c = Date.today();
- createId.Dealer_Info__c = myAccount2.Id;
- createId.RecordTypeid = System.Label.RT_ConOrder_Delivery;
- createId.Order_type__c = '璁㈠崟';
- createId.Order_ProType__c = 'ET';
- createId.Dealer_Info__c = myAccount2.Id;
- createId.Delivery_detail_count__c = 5;
- 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.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.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.Consumable_Arrived_order__c = createId.id;
- createDetailpro1.RecordTypeid = System.Label.RT_ConOrderDetail2_Delivery;
- 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();
- 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.Consumable_Arrived_order__c = createId.id;
- createDetailPiece1.RecordTypeid = System.Label.RT_ConOrderDetail2_Delivery;
- 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();
- 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.Consumable_Arrived_order__c = createId.id;
- createDetailPiece2.RecordTypeid = System.Label.RT_ConOrderDetail2_Delivery;
- 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();
- codListTemp.add(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.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.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);
- codListTemp.add(createDetail21);
- //insert createDetail2;
- insert codListTemp;
-
- PageReference page = new PageReference('/apex/TopPage');
- System.Test.setCurrentPage(page);
- TopPageController lPCTest = new TopPageController();
- lPCTest.pagesize = 1;
- List<Consumable_Orderdetails__c> coListTest = new List<Consumable_Orderdetails__c>();
- Consumable_Orderdetails__c conOrderDetail1 = new Consumable_Orderdetails__c();
- conOrderDetail1.Consumable_count__c = 10;
- conOrderDetail1.Consumable_Arrivecount__c = 5;
- conOrderDetail1.Consumable_product__c = pro2.id;
- conOrderDetail1.Consumable_order__c = createId.Id;
- coListTest.add(conOrderDetail1);
-
- Consumable_Orderdetails__c conOrderDetail2 = new Consumable_Orderdetails__c();
- conOrderDetail2.Consumable_product__c = pro2.id;
- conOrderDetail2.Consumable_order__c = createId.Id;
- coListTest.add(conOrderDetail2);
- insert coListTest;
-
- Integer pageSizeLWC = 1;
- Integer pageTokenLWC = 0;
- String sortFieldLWC = '';
- String sortOrderLWC ='';
- String category3LWC = 'CDS';
- String agencyProTypeLWC = 'ENG';
- // LexInventoryViewController.init(pageSizeLWC,pageTokenLWC,sortFieldLWC,sortOrderLWC);
- LexInventoryViewController.categoryAllload('CDS','鎹峰皵鍖荤枟(娴峰崡锛夋湁闄愬叕鍙�');
- LexInventoryViewController.categoryload();
- LexInventoryViewController.categoryAllload('鍏夋簮','鎹峰皵鍖荤枟(娴峰崡锛夋湁闄愬叕鍙�');
- LexInventoryViewController.categoryload();
- System.Test.stopTest();
- }
- }
-
- 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;
-
- }
-
- 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 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';
- createId.Order_status__c = '鎵瑰噯';
- createId.Deliver_date__c = Date.today();
- createId.Dealer_Info__c = myAccount2.Id;
- createId.RecordTypeid = System.Label.RT_ConOrder_Delivery;
- createId.Order_type__c = '璁㈠崟';
- createId.Order_ProType__c = 'ENG';
- createId.Dealer_Info__c = myAccount2.Id;
- createId.Delivery_detail_count__c = 5;
- createId.orderPattern__c = 'hospitalorder';
- 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.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.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.Consumable_Arrived_order__c = createId.id;
- createDetailpro1.RecordTypeid = System.Label.RT_ConOrderDetail2_Delivery;
- 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();
- //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.Consumable_Arrived_order__c = createId.id;
- createDetailPiece1.RecordTypeid = System.Label.RT_ConOrderDetail2_Delivery;
- 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();
- 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.Consumable_Arrived_order__c = createId.id;
- createDetailPiece2.RecordTypeid = System.Label.RT_ConOrderDetail2_Delivery;
- 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();
- codListTemp.add(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.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.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);
- codListTemp.add(createDetail21);
- //insert createDetail21;
- insert codListTemp;
-
- PageReference page = new PageReference('/apex/TopPage');
- System.Test.setCurrentPage(page);
- TopPageController lPCTest = new TopPageController();
- lPCTest.pagesize = 1;
- List<Consumable_Orderdetails__c> coListTest = new List<Consumable_Orderdetails__c>();
- Consumable_Orderdetails__c conOrderDetail1 = new Consumable_Orderdetails__c();
- conOrderDetail1.Consumable_count__c = 10;
- conOrderDetail1.Consumable_Arrivecount__c = 5;
- conOrderDetail1.Consumable_product__c = pro2.id;
- conOrderDetail1.Consumable_order__c = createId.Id;
- coListTest.add(conOrderDetail1);
-
- Consumable_Orderdetails__c conOrderDetail2 = new Consumable_Orderdetails__c();
- conOrderDetail2.Consumable_product__c = pro2.id;
- conOrderDetail2.Consumable_order__c = createId.Id;
- coListTest.add(conOrderDetail2);
- insert coListTest;
-
- Integer pageSizeLWC = 1;
- Integer pageTokenLWC = 0;
- String sortFieldLWC = '';
- String sortOrderLWC ='';
- String category1= '3400PK:PK閽� 5mm脳33cm';
- String Category3 = '鑵硅厰闀滄墜鏈�';
- String Category4 = 'PK';
- String Category5 = 'G400';
- List<String> orderDetZaikuListLWC = new List<String>();
- String accountName = '鎹峰皵鍖荤枟(娴峰崡锛夋湁闄愬叕鍙�';
- string agencyProType = 'ET';
- string userWorkLocation = '娣卞湷';
- LexInventoryViewController.category1 = category1;
- LexInventoryViewController.Category3 = Category3;
- LexInventoryViewController.Category4 = Category4;
- 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.categoryload();
- LexInventoryViewController.categoryAllload('鍏夋簮','鎹峰皵鍖荤枟(娴峰崡锛夋湁闄愬叕鍙�');
- LexInventoryViewController.categoryload();
- }
- }
- 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;
-
- }
- system.runAs(MyUser_Test){
- 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 = 'Testaccount002';
- string agencyProType = 'ET';
- string userWorkLocation = '娴庡崡';
- 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 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_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;
- Orderdet2.Consumable_Product__c = pro1.Id;
- Orderdet3.Consumable_Arrived_order__c = Order2.Id;
- Orderdet3.Recordtypeid = '01210000000kUDKAA2';
- Orderdet3.Sterilization_limit__c = Date.today().addDays(1);
- conList.add(Orderdet3);
- insert 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','鎹峰皵鍖荤枟(娴峰崡锛夋湁闄愬叕鍙�');
- LexInventoryViewController.categoryload();
- LexInventoryViewController.categoryAllload('鍏夋簮','鎹峰皵鍖荤枟(娴峰崡锛夋湁闄愬叕鍙�');
- LexInventoryViewController.categoryload();
- // LexInventoryViewController.searchConsumableorderdetails(category1,category3,category4,category5,orderDetZaikuListLWC ,accountName,agencyProType,
- // userWorkLocation,pageSizeLWC,pageTokenLWC,sortFieldLWC,sortOrderLWC);
- }
-
- }
- 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搴�'];
- 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;
- }
-
- 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',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 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_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);
-
- 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);
- }
- }
-}
->>>>>>> LEXCommunityLiJun
diff --git a/force-app/main/default/classes/LexLicenceReminderControllerTest.cls b/force-app/main/default/classes/LexLicenceReminderControllerTest.cls
index 3c99e88..5e5fbec 100644
--- a/force-app/main/default/classes/LexLicenceReminderControllerTest.cls
+++ b/force-app/main/default/classes/LexLicenceReminderControllerTest.cls
@@ -1,57 +1,32 @@
@IsTest
private class LexLicenceReminderControllerTest {
@IsTest
-<<<<<<< HEAD
static void testMethod1() {
-=======
- static void testMethod1(){
->>>>>>> LEXCommunityLiJun
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();
-<<<<<<< HEAD
System.runAs(currentUser) {
-=======
- System.runAs(currentUser){
->>>>>>> LEXCommunityLiJun
LexLicenceReminderController.initReminder();
}
Test.stopTest();
}
@IsTest
-<<<<<<< HEAD
static void testMethod2() {
-=======
- static void testMethod2(){
->>>>>>> LEXCommunityLiJun
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;
-<<<<<<< HEAD
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搴�'
- ];
+ 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;
}
@@ -81,98 +56,26 @@
}
Test.startTest();
System.runAs(myUser_test) {
-=======
- 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 = '鐥呴櫌'];
- 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');
- insert myAccount1;
- 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;
- }
- Test.startTest();
- System.runAs(myUser_test){
LexLicenceReminderController.initReminder();
}
Test.stopTest();
}
@IsTest
- 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搴�'];
- 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;
- }
-
- 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);
- 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;
- }
- Test.startTest();
- System.runAs(myUser_test){
->>>>>>> LEXCommunityLiJun
- LexLicenceReminderController.initReminder();
- }
- Test.stopTest();
- }
-
- @IsTest
-<<<<<<< HEAD
static void testMethod3() {
-=======
- static void testMethod4(){
->>>>>>> LEXCommunityLiJun
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;
-<<<<<<< HEAD
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搴�'
- ];
+ 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;
}
@@ -203,33 +106,10 @@
}
Test.startTest();
System.runAs(myUser_test) {
-=======
- 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 = '鐥呴櫌'];
- 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));
- insert myAccount1;
- 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;
- }
- Test.startTest();
- System.runAs(myUser_test){
->>>>>>> LEXCommunityLiJun
LexLicenceReminderController.initReminder();
}
Test.stopTest();
}
-<<<<<<< HEAD
@IsTest
static void testMethod4() {
@@ -240,24 +120,12 @@
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搴�'
- ];
+ 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;
}
@@ -293,6 +161,3 @@
Test.stopTest();
}
}
-=======
-}
->>>>>>> LEXCommunityLiJun
diff --git a/force-app/main/default/classes/LexOutboundorderImportController.cls b/force-app/main/default/classes/LexOutboundorderImportController.cls
index f09d489..a305d02 100644
--- a/force-app/main/default/classes/LexOutboundorderImportController.cls
+++ b/force-app/main/default/classes/LexOutboundorderImportController.cls
@@ -31,15 +31,7 @@
messageCount = 0;
errorflg = false;
errorMessage = null;
-<<<<<<< HEAD
- 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()];
->>>>>>> LEXCommunityLiJun
accountid = Useracc.accountid;
userWorkLocation = Useracc.Work_Location__c;
agencyProType = Useracc.UserPro_Type__c;
@@ -188,7 +180,6 @@
//ApexPages.addMessages(e);
errorMsg += e.getMessage() + ' ' + e.getLineNumber() + ';';
//return new ResponseBodyLWC('Error', 500, e.getMessage()+e.getStackTraceString(), '');
-<<<<<<< HEAD
}
getorderinfo();
dataInfoconfim();
@@ -196,15 +187,6 @@
if (saveFLGbln == false) {
getorderdetinfo(csvRecordStr);
}
-=======
- }
- getorderinfo();
- dataInfoconfim();
- getorderdet2info(csvRecordStr);
- if (saveFLGbln == false) {
- getorderdetinfo(csvRecordStr);
- }
->>>>>>> LEXCommunityLiJun
data.put('orderRecords', orderRecords);
data.put('saveFLGbln', saveFLGbln);
data.put('csvRecordStr', csvRecordStr);
@@ -933,8 +915,4 @@
return null;
}
}
-<<<<<<< HEAD
}
-=======
-}
->>>>>>> LEXCommunityLiJun
diff --git a/force-app/main/default/classes/LexOutboundorderImportControllerTest.cls b/force-app/main/default/classes/LexOutboundorderImportControllerTest.cls
index 6bbf19b..a012fff 100644
--- a/force-app/main/default/classes/LexOutboundorderImportControllerTest.cls
+++ b/force-app/main/default/classes/LexOutboundorderImportControllerTest.cls
@@ -1,5 +1,4 @@
@isTest
-<<<<<<< HEAD
private class LexOutboundorderImportControllerTest {
static testMethod void myUnitTest() {
user myUser_test;
@@ -7,27 +6,15 @@
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搴�'
- ];
+ 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)'
- ];
+ Profile prof = [SELECT Id FROM Profile WHERE Name = '901_缁忛攢鍟嗙ぞ鍖烘櫘閫氭潈闄恄2閲嶉獙璇�(ET)'];
myAccount1 = new Account(
name = 'Testaccount001',
@@ -84,45 +71,6 @@
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 };
-=======
-private class LexOutboundorderImportControllerTest
-{
- static testMethod void myUnitTest() {
-
- user myUser_test;
- 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搴�'];
- if (rectCo.size() == 0) {
- return;
- }
- 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');
- 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',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 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};
->>>>>>> LEXCommunityLiJun
Consumable_order__c Order1 = new Consumable_order__c();
Order1.Name = 'OCM_01_001';
Order1.Order_status__c = '鎵瑰噯';
@@ -130,17 +78,10 @@
Order1.RecordTypeid = System.Label.RT_ConOrder_Order;
Order1.Dealer_Info__c = myAccount1.Id;
Order1.Order_ProType__c = 'ET';
-<<<<<<< HEAD
insert Order1;
Consumable_order_details2__c Orderdet4 = new Consumable_order_details2__c();
Orderdet4.Name = 'OCM_01_001004';
Orderdet4.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
-=======
- insert Order1;
- Consumable_order_details2__c Orderdet4 = new Consumable_order_details2__c();
- Orderdet4.Name = 'OCM_01_001004';
- Orderdet4.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery ;
->>>>>>> LEXCommunityLiJun
Orderdet4.Consumable_Arrived_order__c = Order1.Id;
Orderdet4.Sterilization_limit__c = Date.today().addDays(-1);
Orderdet4.Bar_Code__c = '123456789';
@@ -150,11 +91,7 @@
Consumable_order_details2__c orderdet3 = new Consumable_order_details2__c();
orderdet3.Name = 'OCM_01_001004';
-<<<<<<< HEAD
orderdet3.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
-=======
- orderdet3.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery ;
->>>>>>> LEXCommunityLiJun
orderdet3.Consumable_Arrived_order__c = Order1.Id;
orderdet3.Sterilization_limit__c = Date.today().addDays(-1);
orderdet3.Bar_Code__c = '123456788';
@@ -164,11 +101,7 @@
Consumable_order_details2__c orderdet2 = new Consumable_order_details2__c();
orderdet2.Name = 'OCM_01_001004';
-<<<<<<< HEAD
orderdet2.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
-=======
- orderdet2.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery ;
->>>>>>> LEXCommunityLiJun
orderdet2.Consumable_Arrived_order__c = Order1.Id;
orderdet2.Sterilization_limit__c = Date.today().addDays(-1);
orderdet2.Bar_Code__c = '123456787';
@@ -178,18 +111,13 @@
Consumable_order_details2__c orderdet1 = new Consumable_order_details2__c();
Orderdet1.Name = 'OCM_01_001004';
-<<<<<<< HEAD
Orderdet1.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
-=======
- Orderdet1.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery ;
->>>>>>> LEXCommunityLiJun
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 = '涓�';
-<<<<<<< HEAD
insert new List<Consumable_order_details2__c>{ orderdet1, orderdet2, orderdet3, orderdet4 };
Account hosp1 = new Account(name = 'Testhosp001', RecordTypeId = rectHos[0].Id);
insert hosp1;
@@ -200,14 +128,6 @@
FROM Agency_Hospital_Link__c
WHERE Name = 'Testhosp001'
];
-=======
- 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);
- insert jxs;
- List<Agency_Hospital_Link__c> jxsList = [select Name,Hospital__r.Management_Code__c from Agency_Hospital_Link__c where Name = 'Testhosp001'];
->>>>>>> LEXCommunityLiJun
List<LexOutboundorderImportController.ConsumableorderdetailsInfo> orderRecords1 = new List<LexOutboundorderImportController.ConsumableorderdetailsInfo>();
//鍑哄簱鍗�
@@ -229,7 +149,6 @@
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';
-<<<<<<< HEAD
csvBody +=
'CS-S0001,閿�鍞粰浜岀骇缁忛攢鍟�,' +
jxsList[0].Hospital__r.Management_Code__c +
@@ -329,46 +248,11 @@
secondAgencyMap,
hospitalSysMap
);
-=======
- 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%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%2FTmFtZSxTdW1tb25zRm9yRGlyY3Rpb25fX2MsSG9zcGl0YWxDb2RlLE9yZGVyX0Zvckhvc3BpdGFsX19jLE9yZGVyX0ZvckN1c3RvbWVyVGV4dF9fYyxPcmRlcl9Gb3JEZWFsZXJfX2MsQmFyX0NvZGVfX2MsU2hpcG1lbnRfQ291bnRfX2MsRGVsaXZlcnlfTGlzdF9STUJfX2MsQm94X1BpZWNlX19jLFVuaXRwcmljZV9Ub19hZ2VuY3lfX2MsT3V0Ym91bmRfRGF0ZV9fYyxMb3NlX3JlYXNvbl9fYw0KREItRlkyMDI0LTA2LVozMTAwMDIs6ZSA5ZSu57uZ5LqM57qn57uP6ZSA5ZWGLDgxMDU2NDAs5a6955S45Lic5qGl5bq35aSN5Yy76ZmiLOa2iOWMluenkSwsMTY4NjIwMzI1NDQ2ODI1MFZWR0lVLDEsODAwLCwsOC82LzIwMjMsDQpEQi1GWTIwMjQtMDYtWjMxMDAwMyznm7TmjqXplIDllK7nu5nljLvpmaIsODEwNTY0MCzlrr3nlLjkuJzmoaXlurflpI3ljLvpmaIs5raI5YyW56eRLCwxMjM0NTY3ODYsMiw1MDAs5LiqLCw4LzYvMjAyMywNCkRCLUZZMjAyNC0wNi1aMzEwMDA0LOS6kuebuOiwg%2Bi0pyw4MTA1NjQwLOWuveeUuOS4nOahpeW6t%2BWkjeWMu%2BmZoizmtojljJbnp5EsLDE2ODYyMDMyNTc2NTcyNTBHU0ZTQiw0LDkwMDAs55uSLCw4LzYvMjAyMywNCg%3D%3D','%ET%','閲嶅簡','Testaccount001');
-
- //瀵煎叆
- 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> 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);
-
-
-
-
-
->>>>>>> LEXCommunityLiJun
LexOutboundorderImportController ctrls = new LexOutboundorderImportController();
LexOutboundorderImportController.init();
Blob blobData = Blob.valueOf(csvBody);
String base64Data = EncodingUtil.base64Encode(blobData);
-<<<<<<< HEAD
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';
@@ -399,71 +283,24 @@
String base64Data3 = EncodingUtil.base64Encode(blobData3);
LexOutboundorderImportController.importCSVFile('base64Data3', '%ET%', '閲嶅簡', 'Testaccount001');
System.Test.stopTest();
-=======
- 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';
- Blob blobData1 = Blob.valueOf(csvBody1);
- String base64Data1 = EncodingUtil.base64Encode(blobData1);
- 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';
- Blob blobData2 = Blob.valueOf(csvBody2);
- String base64Data2 = EncodingUtil.base64Encode(blobData1);
- 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';
- Blob blobData3 = Blob.valueOf(csvBody3);
- String base64Data3 = EncodingUtil.base64Encode(blobData3);
- LexOutboundorderImportController.importCSVFile('base64Data3','%ET%','閲嶅簡','Testaccount001');
- System.Test.stopTest();
-
-
->>>>>>> LEXCommunityLiJun
}
}
static testMethod void allTest() {
-<<<<<<< HEAD
user myUser_test;
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搴�'
- ];
+ 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)'
- ];
+ Profile prof = [SELECT Id FROM Profile WHERE Name = '901_缁忛攢鍟嗙ぞ鍖烘櫘閫氭潈闄恄2閲嶉獙璇�(ET)'];
myAccount1 = new Account(
name = 'Testaccount001',
@@ -518,40 +355,6 @@
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;
- 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搴�'];
- if (rectCo.size() == 0) {
- return;
- }
- 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');
- 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',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 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};
->>>>>>> LEXCommunityLiJun
Consumable_order__c Order1 = new Consumable_order__c();
Order1.Name = 'OCM_01_001';
Order1.Order_status__c = '鎵瑰噯';
@@ -559,11 +362,7 @@
Order1.RecordTypeid = System.Label.RT_ConOrder_Order;
Order1.Dealer_Info__c = myAccount1.Id;
Order1.Order_ProType__c = 'ET';
-<<<<<<< HEAD
insert Order1;
-=======
- insert Order1;
->>>>>>> LEXCommunityLiJun
Consumable_order__c Order2 = new Consumable_order__c();
Order2.Name = 'OCM_01_001';
@@ -573,7 +372,6 @@
Order2.Dealer_Info__c = myAccount1.Id;
Order2.Order_ProType__c = 'ET';
Order2.SummonsForDirction__c = '鐩存帴閿�鍞粰鍖婚櫌';
-<<<<<<< HEAD
insert Order2;
Consumable_order_details2__c Orderdet4 = new Consumable_order_details2__c();
@@ -673,91 +471,11 @@
System.debug('111===>' + JSON.serialize(LexOutboundorderImportController.orderRecords));
String orderRecordsLwc = JSON.serialize(orderRecords);
Map<String, String> secondAgencyMap = LexOutboundorderImportController.secondAgencyMap;
-=======
- 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.Consumable_Arrived_order__c = Order1.Id;
- Orderdet4.Sterilization_limit__c = Date.today().addDays(-1);
- Orderdet4.Bar_Code__c = '123456789';
- Orderdet4.Consumable_Product__c = pro1.Id;
- Orderdet4.Arrive_date__c = Date.today().addDays(-1);
- Orderdet4.Box_Piece__c = '鐩�';
-
- Consumable_order_details2__c orderdet3 = new Consumable_order_details2__c();
- orderdet3.Name = 'OCM_01_001004';
- 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';
- orderdet3.Consumable_Product__c = pro1.Id;
- orderdet3.Arrive_date__c = Date.today().addDays(-1);
- 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.Consumable_Arrived_order__c = Order1.Id;
- orderdet2.Sterilization_limit__c = Date.today().addDays(-1);
- orderdet2.Bar_Code__c = '1686203256098250REJOQ';
- orderdet2.Consumable_Product__c = pro1.Id;
- orderdet2.Arrive_date__c = Date.today().addDays(-1);
- orderdet2.Box_Piece__c = '涓�';
-
- Consumable_order_details2__c orderdet1 = new Consumable_order_details2__c();
- Orderdet1.Name = 'OCM_01_001004';
- 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 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);
- insert jxs;
- 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';
- 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('','','','');
-
-
- //瀵煎叆
- List<String[]> csvRecordStr = LexOutboundorderImportController.csvRecordStr;
- List<LexOutboundorderImportController.ConsumableorderdetailsInfo> orderRecords = LexOutboundorderImportController.orderRecords;
- System.debug('111===>'+JSON.serialize(LexOutboundorderImportController.orderRecords));
- String orderRecordsLwc = JSON.serialize(orderRecords);
- Map<String, String> secondAgencyMap = LexOutboundorderImportController.secondAgencyMap;
->>>>>>> LEXCommunityLiJun
Map<String, String> hospitalSysMap = LexOutboundorderImportController.hospitalSysMap;
// hospitalSysMap.put('8105640',myAccount1.Id);
// hospitalSysMap.put('8106864','0011000001g02glAAA');
// hospitalSysMap.put('8106867','0011000001g02hUAAQ');
// hospitalSysMap.put('8107348','0011000001g09fDAAQ');
-<<<<<<< HEAD
System.debug('hospitalSysMap==' + hospitalSysMap);
LexOutboundorderImportController.dataImport(
csvRecordStr,
@@ -868,39 +586,3 @@
);
}
}
-=======
- 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');
- System.Test.stopTest();
-
- }
- }
-
-
- static testMethod void allTest1() {
- 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');
- //浜у搧鍑鸿揣鏁伴噺涓虹┖(鏃犳晥)
- LexOutboundorderImportController.importCSVFile('TmFtZSxTdW1tb25zRm9yRGlyY3Rpb25fX2MsSG9zcGl0YWxDb2RlLE9yZGVyX0Zvckhvc3BpdGFsX19jLE9yZGVyX0ZvckN1c3RvbWVyVGV4dF9fYyxPcmRlcl9Gb3JEZWFsZXJfX2MsQmFyX0NvZGVfX2MsU2hpcG1lbnRfQ291bnRfX2MsRGVsaXZlcnlfTGlzdF9STUJfX2MsQm94X1BpZWNlX19jLFVuaXRwcmljZV9Ub19hZ2VuY3lfX2MsT3V0Ym91bmRfRGF0ZV9fYyxMb3NlX3JlYXNvbl9fYw0KREItRlkyMDI0LTA2LVMzMTc4MTMtMDEs55u05o6l6ZSA5ZSu57uZ5Yy76ZmiLDgxMDU2NDAs5a6955S45Lic5qGl5bq35aSN5Yy76ZmiLOa2iOWMluenkSwsMTY4NzMyMjQ0NDUwOTI1MFVZR01QLCw1MDAs55uSLDE1LDIwMjMvNS8zMCzkuKLlpLHljp%2Flm6ANCg%3D%3D','%ET%','閲嶅簡','Testaccount001');
- //浜岀骇缁忛攢鍟嗕笉涓虹┖
- LexOutboundorderImportController.importCSVFile('TmFtZSxTdW1tb25zRm9yRGlyY3Rpb25fX2MsSG9zcGl0YWxDb2RlLE9yZGVyX0Zvckhvc3BpdGFsX19jLE9yZGVyX0ZvckN1c3RvbWVyVGV4dF9fYyxPcmRlcl9Gb3JEZWFsZXJfX2MsQmFyX0NvZGVfX2MsU2hpcG1lbnRfQ291bnRfX2MsRGVsaXZlcnlfTGlzdF9STUJfX2MsQm94X1BpZWNlX19jLFVuaXRwcmljZV9Ub19hZ2VuY3lfX2MsT3V0Ym91bmRfRGF0ZV9fYyxMb3NlX3JlYXNvbl9fYw0KREItRlkyMDI0LTA2LVMzMTc4MTMtMDEs6ZSA5ZSu57uZ5LqM57qn57uP6ZSA5ZWGLDgxMDU2NDAs5a6955S45Lic5qGl5bq35aSN5Yy76ZmiLOa2iOWMluenkSwsMTY4NzMyMjQ0NDUwOTI1MFVZR01QLDUsNTAwLOebkiwxNSwyMDIzLzUvMzAs5Lii5aSx5Y6f5ZugDQo%3D','%ET%','閲嶅簡','Testaccount001');
-
-
- }
-}
->>>>>>> LEXCommunityLiJun
diff --git a/force-app/main/default/classes/LexOverdueStockController.cls b/force-app/main/default/classes/LexOverdueStockController.cls
index 99b968d..f795ba1 100644
--- a/force-app/main/default/classes/LexOverdueStockController.cls
+++ b/force-app/main/default/classes/LexOverdueStockController.cls
@@ -40,30 +40,14 @@
codPageRecords = new List<orderBean>();
overduePageRecords = new List<orderBean>();
// 鑾峰彇鐢ㄦ埛鍜岀粡閿�鍟嗕俊鎭�
-<<<<<<< HEAD
- 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()];
->>>>>>> LEXCommunityLiJun
userWorkLocation = Useracc.Work_Location__c;
agencyProType = Useracc.UserPro_Type__c;
if (String.isBlank(Useracc.UserPro_Type__c)) {
agencyProType = 'ET';
}
sqlagencyProType = '%' + agencyProType + '%';
-<<<<<<< HEAD
- 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];
->>>>>>> LEXCommunityLiJun
// 杩囨湡搴撳瓨姹囨�讳俊鎭�
List<AggregateResult> orderDetZaiku = [
SELECT count(Id) countsum, Consumable_Product__c prodid, Consumable_Product__r.Name_Text__c prodname, Box_Piece__c boxPiece
@@ -119,21 +103,8 @@
userWorkLocation = userWorkLocationLWC;
// add by Wang Xueqin 2023/04/12
// 鑾峰彇鐢ㄦ埛鍜岀粡閿�鍟嗕俊鎭�
-<<<<<<< HEAD
- 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];
->>>>>>> LEXCommunityLiJun
iSinventory = true;
Set<String> barCodeoverdue = new Set<String>();
@@ -283,21 +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
// 鑾峰彇鐢ㄦ埛鍜岀粡閿�鍟嗕俊鎭�
-<<<<<<< HEAD
- 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];
->>>>>>> LEXCommunityLiJun
// 璺宠繃鏄庣粏2涓嶅繀瑕佹洿鏂�
StaticParameter.EscapeConsumableOrderDetail2Trigger = true;
@@ -330,15 +288,7 @@
po.RecordTypeid = System.Label.RT_ConOrder_Overdue;
try {
insert po;
-<<<<<<< HEAD
- 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];
->>>>>>> LEXCommunityLiJun
List<Consumable_orderdetails__c> InsList = new List<Consumable_orderdetails__c>();
for (orderBean header : codPageRecords) {
if (header.check == true) {
@@ -401,7 +351,6 @@
Buff.add(A + barcodeCountMap.get(A));
}
return Buff;
-<<<<<<< HEAD
}
// Data Bean
@@ -456,59 +405,3 @@
}
}
}
-=======
- }
-
- // Data Bean
- @TestVisible
- class orderBean implements Comparable {
- @AuraEnabled
- public Consumable_order_details2__c orderdetails2 { get; set; }
- @AuraEnabled
- public Product2__c Prod { get; set; }
- @AuraEnabled
- public Boolean check { get; set; }
-
- // 杩囨湡搴撳瓨
- @AuraEnabled
- public Integer overlimitCount { get; set; }
- // 閿�瀛樻暟閲�
- @AuraEnabled
- public Integer pandian { get; set; }
- // 閿�瀛樺師鍥�
- @AuraEnabled
- public String diffReason { get; set; }
- // 鍗曚綅
- @AuraEnabled
- public String boxPiece { get; set; }
- @AuraEnabled
- public String prodname { get; set; }
- @AuraEnabled
- public String prodid { get; set; }
- orderBean(Consumable_order_details2__c e, string str) {
- orderdetails2 = e;
- Prod = e.Consumable_Product__r;
- DiffReason = str;
- }
- public orderBean(AggregateResult e) {
- check = false;
- overlimitCount = Integer.valueOf(e.get('countsum'));
- prodname = String.valueOf(e.get('prodname'));
- prodid = String.valueOf(e.get('prodid'));
- boxPiece = String.valueOf(e.get('BoxPiece'));
- pandian = 0;
- }
- // 鎺掑簭
- public Integer compareTo(Object compareTo) {
- orderBean compareToesd = (orderBean) compareTo;
- Integer returnValue = 0;
- if (overlimitCount > compareToesd.overlimitCount) {
- returnValue = -1;
- } else if (overlimitCount < compareToesd.overlimitCount) {
- returnValue = 1;
- }
- return returnValue;
- }
- }
-}
->>>>>>> LEXCommunityLiJun
diff --git a/force-app/main/default/classes/LexOverdueStockControllerTest.cls b/force-app/main/default/classes/LexOverdueStockControllerTest.cls
index 9986207..ad359e3 100644
--- a/force-app/main/default/classes/LexOverdueStockControllerTest.cls
+++ b/force-app/main/default/classes/LexOverdueStockControllerTest.cls
@@ -1,31 +1,18 @@
@isTest
private class LexOverdueStockControllerTest {
static testMethod void testMethod1() {
-<<<<<<< HEAD
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搴�'
- ];
+ 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 = '鐥呴櫌'
- ];
+ 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(
@@ -218,166 +205,3 @@
}
}
}
-=======
- 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;
-
- 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;
-
-
- //璁㈠崟
- 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 = '鐩�';
- 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(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;
-
-
-
-
-
-
- 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();
-
- }
- }
-}
->>>>>>> LEXCommunityLiJun
diff --git a/force-app/main/default/classes/LexProductLimitEditControllerTest.cls b/force-app/main/default/classes/LexProductLimitEditControllerTest.cls
index 546b545..97b4157 100644
--- a/force-app/main/default/classes/LexProductLimitEditControllerTest.cls
+++ b/force-app/main/default/classes/LexProductLimitEditControllerTest.cls
@@ -1,21 +1,12 @@
@isTest
-<<<<<<< HEAD
private class LexProductLimitEditControllerTest {
@isTest
static void unittest() {
- 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)'
- ];
+ Profile prof = [SELECT Id FROM Profile WHERE Name = '901_缁忛攢鍟嗙ぞ鍖烘櫘閫氭潈闄恄2閲嶉獙璇�(ET)'];
Product2 prod01 = new Product2(
Name = 'Test01',
ProductCode = 'Test01',
@@ -50,59 +41,14 @@
// Given
// PageReference page = new PageReference('/apex/ProductLimitEdit?accountid=' + myAccount2.id);
-=======
-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 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;
- String myAccount2Id = myAccount2.Id;
- LexProductLimitEditController.init(myAccount2Id,'ENG');
- LexProductLimitEditController.init(myAccount2Id,'');
- LexProductLimitEditController.accountid = myAccount2Id;
- LexProductLimitEditController controllerLimit = new LexProductLimitEditController();
-
-
-
-
-
- // Given
- // PageReference page = new PageReference('/apex/ProductLimitEdit?accountid=' + myAccount2.id);
->>>>>>> LEXCommunityLiJun
// page.setRedirect(true);
// System.Test.setCurrentPage(page);
// ProductLimitEditController conTest = new ProductLimitEditController();
// conTest.init();
// System.assertEquals('Test01|5|55,Test02|2|4', conTest.product_Limit);
-<<<<<<< HEAD
// When
// Then
}
}
-=======
- // When
-
-
- // Then
-
- }
-}
->>>>>>> LEXCommunityLiJun
diff --git a/force-app/main/default/classes/LexRemoveBoxControllerTest.cls b/force-app/main/default/classes/LexRemoveBoxControllerTest.cls
index 9ff8eee..0cf8123 100644
--- a/force-app/main/default/classes/LexRemoveBoxControllerTest.cls
+++ b/force-app/main/default/classes/LexRemoveBoxControllerTest.cls
@@ -1,24 +1,15 @@
@isTest
-<<<<<<< HEAD
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搴�'
- ];
+ 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 Email)'];
myAccount2 = new Account(
name = 'Testaccount002',
Dealer_discount__c = 20,
@@ -50,37 +41,12 @@
}
System.runAs(myUser_Test) {
-=======
-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搴�'];
- 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');
- 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',Work_Location__c = '閲嶅簡');
- insert MyUser_Test;
- }
-
- System.runAs(myUser_Test){
->>>>>>> LEXCommunityLiJun
StaticParameter.EscapeConsumableOrderDetail2Trigger = true;
StaticParameter.EscapeNFM007Trigger = true;
StaticParameter.EscapeOpportunityBefUpdTrigger = true;
StaticParameter.EscapeOpportunityHpDeptUpdTrigger = true;
StaticParameter.EscapeSyncOpportunityTrigger = true;
StaticParameter.EscapeSyncProduct2Trigger = true;
-<<<<<<< HEAD
Product2 prod01 = new Product2(
Name = 'Test01',
ProductCode = 'Test01',
@@ -116,16 +82,6 @@
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};
->>>>>>> LEXCommunityLiJun
//璁㈠崟
Consumable_order__c Order1 = new Consumable_order__c();
Order1.Name = 'OCM_01_001';
@@ -147,13 +103,8 @@
Orderdet2.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJRF';
Orderdet2.Used_date__c = null;
Orderdet2.Lose_Flag__c = false;
-<<<<<<< HEAD
Orderdet2.Return_date__c = null;
Orderdet2.Send_Date__c = null;
-=======
- Orderdet2.Return_date__c= null;
- Orderdet2.Send_Date__c= null;
->>>>>>> LEXCommunityLiJun
Orderdet2.Box_Piece__c = '鐩�';
conList1.add(Orderdet2);
@@ -166,7 +117,6 @@
Orderdet3.Arrive_date__c = Date.today();
Orderdet3.Send_Date__c = Date.today();
Orderdet3.Box_Piece__c = '涓�';
-<<<<<<< HEAD
Orderdet3.RemoveBox_date__c = Date.today();
Orderdet3.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJRA';
Orderdet3.Used_date__c = null;
@@ -174,16 +124,6 @@
Orderdet3.Return_date__c = null;
conList1.add(Orderdet3);
-=======
- 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;
- conList1.add(Orderdet3);
-
-
->>>>>>> LEXCommunityLiJun
//sale
Consumable_order_details2__c Orderdet4 = new Consumable_order_details2__c();
Orderdet4.Name = 'OCM_01_001004';
@@ -192,19 +132,11 @@
Orderdet4.Asset_Model_No__c = 'Test02';
Orderdet4.Arrive_date__c = Date.today();
Orderdet4.Box_Piece__c = '涓�';
-<<<<<<< HEAD
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.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();
->>>>>>> LEXCommunityLiJun
conList1.add(Orderdet4);
List<Consumable_order_details2__c> conList = new List<Consumable_order_details2__c>();
@@ -217,19 +149,11 @@
Orderdet5.Arrive_date__c = Date.today();
//Orderdet5.Used_date__c = Date.today();
Orderdet5.Box_Piece__c = '鐩�';
-<<<<<<< HEAD
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.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;
->>>>>>> LEXCommunityLiJun
Orderdet5.Bar_Code__c = '010495317014059411170400172203311074K250DCWQW';
conList.add(Orderdet5);
//pandian
@@ -241,19 +165,11 @@
Orderdet7.Box_Piece__c = '鐩�';
Orderdet7.Lose_Flag__c = false;
Orderdet7.Bar_Code__c = '010495317014059411170400172203311074K250DBVUD';
-<<<<<<< HEAD
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();
-=======
- 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();
->>>>>>> LEXCommunityLiJun
Orderdet8.Name = 'OCM_01_001004';
Orderdet8.Consumable_order_minor__c = Order1.Id;
Orderdet8.Consumable_Product__c = pro2.Id;
@@ -264,22 +180,14 @@
Orderdet8.Bar_Code__c = '010495317014059411170400172203311074K250DBVUC';
Orderdet8.Used_date__c = null;
Orderdet8.Lose_Flag__c = false;
-<<<<<<< HEAD
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;
->>>>>>> LEXCommunityLiJun
conList.add(Orderdet8);
insert conList1;
insert conList;
-<<<<<<< HEAD
System.Test.startTest();
LexRemoveBoxController Controller = new LexRemoveBoxController();
LexRemoveBoxController.init();
@@ -296,43 +204,18 @@
List<Consumable_order_details2__c> orderDetaList = new List<Consumable_order_details2__c>();
LexRemoveBoxController.removeBoxConfirm(JSON.serialize(orderDetaList), 'Testaccount002', '閲嶅簡', 'ENG');
System.Test.stopTest();
-=======
-
- 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.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');
- System.Test.stopTest();
-
->>>>>>> LEXCommunityLiJun
}
}
static testMethod void testMethod1() {
user myUser_test;
Account myAccount2;
-<<<<<<< HEAD
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搴�'
- ];
+ 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 Email)'];
myAccount2 = new Account(
name = 'Testaccount002',
Dealer_discount__c = 20,
@@ -399,32 +282,6 @@
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 };
-=======
- 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');
- 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',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 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};
->>>>>>> LEXCommunityLiJun
//璁㈠崟
Consumable_order__c Order1 = new Consumable_order__c();
Order1.Name = 'OCM_01';
@@ -433,11 +290,7 @@
Order1.Dealer_Info__c = myAccount2.Id;
Order1.RecordTypeid = System.Label.RT_ConOrder_Delivery;
Order1.Order_ProType__c = 'ET';
-<<<<<<< HEAD
insert Order1;
-=======
- insert Order1;
->>>>>>> LEXCommunityLiJun
//鍙戣揣
Consumable_order__c Order2 = new Consumable_order__c();
Order2.Name = 'OCM_01';
@@ -448,13 +301,8 @@
Order2.Order_ProType__c = 'ENG';
insert Order2;
-<<<<<<< HEAD
List<Consumable_order_details2__c> conList1 = new List<Consumable_order_details2__c>();
//浜у搧绫诲瀷涓嶅悓
-=======
- List<Consumable_order_details2__c> conList1 = new List<Consumable_order_details2__c> ();
- //浜у搧绫诲瀷涓嶅悓
->>>>>>> LEXCommunityLiJun
Consumable_order_details2__c con = new Consumable_order_details2__c();
con.Name = 'OCM_01_001001';
con.Consumable_order_minor__c = Order1.Id;
@@ -464,7 +312,6 @@
con.Bar_Code__c = '10011';
con.Used_date__c = null;
con.Lose_Flag__c = false;
-<<<<<<< HEAD
con.Return_date__c = null;
con.Send_Date__c = null;
con.Box_Piece__c = '鐩�';
@@ -502,45 +349,6 @@
System.Test.startTest();
LexRemoveBoxController.searchConsumableorderdetails('10011', 'Testaccount002', '閲嶅簡', 'ET');
LexRemoveBoxController.searchConsumableorderdetails('10031\n10032', 'Testaccount002', '閲嶅簡', 'ENG');
-=======
- 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.Used_date__c = null;
- con2.Return_date__c = null;
- con2.Lose_Flag__c = false;
- con2.Box_Piece__c = '鐩�';
- con2.Consumable_Arrived_order__c = Order2.Id;
- con2.Consumable_Product__c = pro2.Id;
- con2.Consumable_order_minor__c = Order2.Id;
- con2.Bar_Code__c = '10031';
- conList1.add(con2);
- //瑙勬牸=1
- 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.Box_Piece__c = '鐩�';
- 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.Bar_Code__c = '10032';
- conList1.add(con3);
-
- insert conList1;
- System.Test.startTest();
- LexRemoveBoxController.searchConsumableorderdetails('10011','Testaccount002','閲嶅簡','ET');
- LexRemoveBoxController.searchConsumableorderdetails('10031\n10032','Testaccount002','閲嶅簡','ENG');
->>>>>>> LEXCommunityLiJun
System.Test.stopTest();
}
}
@@ -548,25 +356,16 @@
// TO DO: implement unit test
user myUser_test;
Account myAccount2;
-<<<<<<< HEAD
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搴�'
- ];
+ 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 Email)'];
myAccount2 = new Account(
name = 'Testaccount002',
Dealer_discount__c = 20,
@@ -633,35 +432,6 @@
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 };
-=======
- 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搴�'];
- 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');
- 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',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 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};
->>>>>>> LEXCommunityLiJun
List<Consumable_order__c> orderList = new List<Consumable_order__c>();
List<Consumable_order__c> orderList1 = new List<Consumable_order__c>();
//鍒拌揣
@@ -684,7 +454,6 @@
orderList.add(Order2);
insert orderList;
-<<<<<<< HEAD
//鍑鸿揣
Consumable_order__c Order3 = new Consumable_order__c();
Order3.Name = 'OCM_03';
@@ -708,31 +477,6 @@
List<Consumable_order_details2__c> conList1 = new List<Consumable_order_details2__c>();
//浜у搧绫诲瀷涓嶅悓
-=======
- //鍑鸿揣
- 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;
-
- List<Consumable_order_details2__c> conList1 = new List<Consumable_order_details2__c> ();
- //浜у搧绫诲瀷涓嶅悓
->>>>>>> LEXCommunityLiJun
Consumable_order_details2__c con = new Consumable_order_details2__c();
con.Name = 'OCM_01_001001';
con.Consumable_order_minor__c = Order1.Id;
@@ -742,7 +486,6 @@
con.Bar_Code__c = '10011';
con.Used_date__c = null;
con.Lose_Flag__c = false;
-<<<<<<< HEAD
con.Return_date__c = null;
con.Send_Date__c = null;
con.Box_Piece__c = '鐩�';
@@ -752,17 +495,6 @@
Consumable_order_details2__c con2 = new Consumable_order_details2__c();
con2.Arrive_date__c = null;
con2.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;
->>>>>>> LEXCommunityLiJun
con2.Used_date__c = null;
con2.Return_date__c = null;
con2.Lose_Flag__c = false;
@@ -775,11 +507,7 @@
//瑙勬牸=1
Consumable_order_details2__c con3 = new Consumable_order_details2__c();
con3.Arrive_date__c = Date.today();
-<<<<<<< HEAD
con3.Send_Date__c = null;
-=======
- con3.Send_Date__c =null;
->>>>>>> LEXCommunityLiJun
con3.Used_date__c = null;
con3.Return_date__c = null;
con3.Lose_Flag__c = false;
@@ -787,21 +515,13 @@
con3.Consumable_Arrived_order__c = Order2.Id;
con3.Consumable_Product__c = pro3.Id;
con3.Consumable_order_minor__c = Order2.Id;
-<<<<<<< HEAD
con3.RemoveBox_date__c = Date.today();
-=======
- con3.RemoveBox_date__c= Date.today();
->>>>>>> LEXCommunityLiJun
con3.Bar_Code__c = '10032';
conList1.add(con3);
insert conList1;
System.Test.startTest();
-<<<<<<< HEAD
LexRemoveBoxController.searchConsumableorderdetails('10031\n10032\n', 'Testaccount002', '閲嶅簡', 'ENG');
-=======
- LexRemoveBoxController.searchConsumableorderdetails('10031\n10032\n','Testaccount002','閲嶅簡','ENG');
->>>>>>> LEXCommunityLiJun
System.Test.stopTest();
}
}
@@ -809,25 +529,16 @@
// TO DO: implement unit test
user myUser_test;
Account myAccount2;
-<<<<<<< HEAD
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搴�'
- ];
+ 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 Email)'];
myAccount2 = new Account(
name = 'Testaccount002',
Dealer_discount__c = 20,
@@ -904,45 +615,6 @@
Order1.RecordTypeid = '01210000000c9dqAAA';
Order1.Order_ProType__c = 'ENG';
orderList.add(Order1);
-=======
- 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搴�'];
- 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');
- 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',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 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);
->>>>>>> LEXCommunityLiJun
//鍙戣揣
Consumable_order__c Order2 = new Consumable_order__c();
Order2.Name = 'OCM_01';
@@ -954,13 +626,8 @@
orderList.add(Order2);
insert orderList;
-<<<<<<< HEAD
List<Consumable_order_details2__c> conList1 = new List<Consumable_order_details2__c>();
//浜у搧绫诲瀷涓嶅悓
-=======
- List<Consumable_order_details2__c> conList1 = new List<Consumable_order_details2__c> ();
- //浜у搧绫诲瀷涓嶅悓
->>>>>>> LEXCommunityLiJun
Consumable_order_details2__c con = new Consumable_order_details2__c();
con.Name = 'OCM_01_001001';
con.Consumable_order_minor__c = Order1.Id;
@@ -970,7 +637,6 @@
con.Bar_Code__c = '10011';
con.Used_date__c = null;
con.Lose_Flag__c = false;
-<<<<<<< HEAD
con.Return_date__c = null;
con.Send_Date__c = null;
con.Box_Piece__c = '鐩�';
@@ -1013,49 +679,3 @@
}
}
}
-=======
- 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.Used_date__c = null;
- con2.Return_date__c = null;
- con2.Lose_Flag__c = false;
- con2.Box_Piece__c = '鐩�';
- con2.Consumable_Arrived_order__c = Order2.Id;
- con2.Consumable_Product__c = pro2.Id;
- con2.Consumable_order_minor__c = Order2.Id;
- con2.Bar_Code__c = '10031';
- conList1.add(con2);
- //瑙勬牸=1
- 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.Box_Piece__c = '鐩�';
- 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.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');
- System.Test.stopTest();
-
-
- }
- }
-}
->>>>>>> LEXCommunityLiJun
diff --git a/force-app/main/default/classes/LexSaleAndDeliveryControllerTest.cls b/force-app/main/default/classes/LexSaleAndDeliveryControllerTest.cls
index 714a7bf..ad392c8 100644
--- a/force-app/main/default/classes/LexSaleAndDeliveryControllerTest.cls
+++ b/force-app/main/default/classes/LexSaleAndDeliveryControllerTest.cls
@@ -1,26 +1,17 @@
@isTest
private class LexSaleAndDeliveryControllerTest {
@isTest
-<<<<<<< HEAD
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搴�'
- ];
+ 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 Email)'];
Product2 prod02 = new Product2(
Name = 'Test02181',
ProductCode = 'Test0218',
@@ -54,43 +45,16 @@
UserPro_Type__c = 'ENG',
Work_Location__c = '鍖椾含'
);
-=======
- 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搴�'];
- 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);
- insert pro2;
- 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);
- 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='鍖椾含');
->>>>>>> LEXCommunityLiJun
insert myUser_test;
myUser_test.UserPro_Type__c = '';
update myUser_test;
}
-<<<<<<< HEAD
System.runAs(MyUser_Test) {
-=======
- System.runAs(MyUser_Test){
->>>>>>> LEXCommunityLiJun
String accountId = myUser_test.accountid;
String agencyProType = myUser_test.UserPro_Type__c;
String userWorkLocation = myUser_test.Work_Location__c;
System.Test.startTest();
LexSaleAndDeliveryController.init();
-<<<<<<< HEAD
LexSaleAndDeliveryController.searchOrderInstatus(
'2023/01/01',
'2023/12/31',
@@ -123,13 +87,3 @@
}
}
}
-=======
- 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();
- }
- }
-}
->>>>>>> LEXCommunityLiJun
diff --git a/force-app/main/default/classes/LexSaleOrderController.cls b/force-app/main/default/classes/LexSaleOrderController.cls
index e1b3ebd..111588f 100644
--- a/force-app/main/default/classes/LexSaleOrderController.cls
+++ b/force-app/main/default/classes/LexSaleOrderController.cls
@@ -32,15 +32,7 @@
res.entity = data;
String UserName = UserInfo.getUserId();
-<<<<<<< HEAD
- user useracc = [
- SELECT Accountid, Work_Location__c
- FROM user
- WHERE id = :UserName
- ];
-=======
user useracc = [SELECT Accountid, Work_Location__c FROM user WHERE id = :UserName];
->>>>>>> LEXCommunityLiJun
accountid = useracc.Accountid;
userWorkLocation = useracc.Work_Location__c;
Account accountInfo = [SELECT Name FROM account WHERE id = :accountid];
@@ -263,15 +255,7 @@
}
Map<String, String> proHosMap = new Map<String, String>();
Map<String, String> proIdMap = new Map<String, String>();
-<<<<<<< HEAD
- 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];
->>>>>>> LEXCommunityLiJun
if (hpList != null && hpList.size() > 0) {
for (hospitalprice__c hp : hpList) {
if (hp.product__c != null && String.valueof(hp.product__c).length() >= 15) {
@@ -293,11 +277,7 @@
errorIdMap.put(newdet2[j].Bar_Code__c, newdet2[j].Bar_Code__c);
}
if (coc.OutPattern__c == true) {
-<<<<<<< HEAD
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);
->>>>>>> LEXCommunityLiJun
if (newdet2[j].Product_Pattern__c == orderdetails[i].Product_Pattern__c) {
//add by rentx 2021-03-22 start
if (newdet2[j].exchangeOutPattern__c == true) {
@@ -1226,7 +1206,6 @@
res.code = 200;
System.debug('res = ' + res);
return res;
-<<<<<<< HEAD
}
public static integer Getconsumableorderdetails2Nobox() {
@@ -1339,117 +1318,3 @@
}
}
}
-=======
- }
-
- public static integer Getconsumableorderdetails2Nobox() {
- if (String.isBlank(barcode)) {
- return 0;
- }
- List<String> barCodeListP = ParseBarCode(barcode);
- consumableorderdetails2Nobox = new List<Consumable_order_details2__c>();
- BarcodeCntMap.clear();
- consumableorderdetails2Nobox = [
- SELECT
- Id,
- Name,
- recordtypeid,
- Used_account__c,
- Product_Pattern__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,
- Intra_Trade_List_RMB__c,
- Asset_Model_No__c,
- Isoverdue__c,
- Box_Piece__c,
- ProductPacking_list_manual__c,
- Guarantee_period_for_products__c,
- hospitalSpecialOffer__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 Bar_Code__c != NULL
- AND Dealer_Info_text__c = :accountName
- AND Bar_Code__c IN :barCodeListP
- AND Arrive_Owner_Work_Location__c = :userWorkLocation
- AND Box_Piece__c = '涓�'
- ORDER BY RemoveBox_No__c DESC
- ];
-
- AggregateResult[] results = [
- SELECT Bar_Code__c, count(Id) recordCount
- 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 = :accountName
- AND Bar_Code__c IN :barCodeListP
- AND Arrive_Owner_Work_Location__c = :userWorkLocation
- AND Box_Piece__c = '涓�'
- GROUP BY Bar_Code__c
- ];
-
- for (AggregateResult ar : results) {
- String key = '' + ar.get('Bar_Code__c');
- BarcodeCntMap.put(key, Integer.valueOf(ar.get('recordCount')));
- }
- return consumableorderdetails2Nobox.size();
- }
-
- @TestVisible
- class ConsumableorderdetailsInfo implements Comparable {
- @AuraEnabled
- public Consumable_orderdetails__c orderdetails1 { get; set; }
- @AuraEnabled
- public Consumable_order_details2__c orderdetails2 { get; set; }
- @AuraEnabled
- public Product2__c Prod { get; set; }
- @AuraEnabled
- public String oldConsumableCount { get; set; }
- @AuraEnabled
- public String ErrorReason { get; set; }
- @AuraEnabled
- public Decimal outboundCount { get; set; }
-
- public ConsumableorderdetailsInfo(Consumable_order_details2__c e, string str) {
- orderdetails1 = new Consumable_orderdetails__c();
- orderdetails2 = e;
- Prod = e.Consumable_Product__r;
- oldConsumableCount = e.name;
- ErrorReason = str;
- }
-
- public ConsumableorderdetailsInfo(Consumable_order_details2__c e) {
- orderdetails1 = new Consumable_orderdetails__c();
- orderdetails2 = e;
- Prod = e.Consumable_Product__r;
- if (e.Box_Piece__c == '鐩�') {
- outboundCount = 1;
- }
- oldConsumableCount = e.name;
- }
-
- public ConsumableorderdetailsInfo(Consumable_orderdetails__c e) {
- orderdetails1 = e;
- Prod = e.Consumable_Product__r;
- outboundCount = e.Shipment_Count__c;
- }
- // 鎺掑簭
- public Integer compareTo(Object compareTo) {
- return null;
- }
- }
-}
->>>>>>> LEXCommunityLiJun
diff --git a/force-app/main/default/classes/LexSaleOrderControllerTest.cls b/force-app/main/default/classes/LexSaleOrderControllerTest.cls
index e261c54..9b69f41 100644
--- a/force-app/main/default/classes/LexSaleOrderControllerTest.cls
+++ b/force-app/main/default/classes/LexSaleOrderControllerTest.cls
@@ -2,44 +2,27 @@
private class LexSaleOrderControllerTest {
public static Map<String, String> orderpieceorboxMap;
public static Map<String, Decimal> orderpriceMap;
-<<<<<<< HEAD
public static Map<String, Decimal> orderagencypriceMap;
-=======
- public static Map<String, Decimal> orderagencypriceMap ;
->>>>>>> LEXCommunityLiJun
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
-<<<<<<< HEAD
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搴�'
- ];
+ 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)'
- ];
+ 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');
@@ -69,20 +52,11 @@
}
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
- ];
+ Account[] accountInfo = [SELECT Name FROM account WHERE id = :accountId LIMIT 1];
if (accountInfo.size() > 0) {
accountName = accountInfo[0].Name;
}
@@ -293,212 +267,6 @@
Orderdet1,
errorReason
);
-=======
- 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搴�'];
- if (rectCo.size() == 0) {
- return;
- }
- 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');
- insert accountItem1;
- 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);
- 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='澶ц繛');
- insert userTest;
- }
- System.runAs(userTest){
- String Id = UserInfo.getUserId();
- 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 ){
- 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 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.Deliver_date__c = Date.today();
- Order1.RecordTypeid = System.Label.RT_ConOrder_Order;
- Order1.Order_ForDealerText__c = 'Test';
- Order1.Order_ProType__c = 'ENG';
- Order1.Delivery_detail_count__c = 5;
- Order1.IsShipment__c = true;
- insert Order1;
- //鍒拌揣
- Consumable_order__c Order2 = new Consumable_order__c();
- Order2.Name = 'testMing2';
- Order2.Order_status__c = '鎵瑰噯';
- Order2.Deliver_date__c = Date.today();
- Order2.RecordTypeid = System.Label.RT_ConOrder_Arrive;
- Order2.Order_type__c = '璁㈠崟';
- Order2.Order_ProType__c = 'ENG';
- Order2.Arrive_Order__c = Order1.Id;
- Order2.Delivery_detail_count__c = 5;
- insert Order2;
-
- List<Consumable_order_details2__c> newdet2 = new List<Consumable_order_details2__c>();
- //鍦ㄥ簱 鐩�
- Consumable_order_details2__c Orderdet1 = new Consumable_order_details2__c();
- Orderdet1.Name = 'OCM_01_001002';
- Orderdet1.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
- Orderdet1.Bar_Code__c = '11111250AAAAA';
- Orderdet1.Arrive_date__c = Date.today();
- Orderdet1.Consumable_Product__c = pro1.Id;
- Orderdet1.Box_Piece__c = '鐩�';
- Orderdet1.TracingCode__c = 'AAAAA';
- //鏈埌璐�
- Consumable_order_details2__c Orderdet2 = new Consumable_order_details2__c();
- Orderdet2.Name = 'OCM_02_001002';
- Orderdet2.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
- Orderdet2.Bar_Code__c = '22222250BBBBB';
- Orderdet2.Consumable_Product__c = pro2.Id;
- Orderdet2.Box_Piece__c = '鐩�';
- Orderdet2.TracingCode__c = 'BBBBB';
- //閿�鍞�
- Consumable_order_details2__c Orderdet3 = new Consumable_order_details2__c();
- Orderdet3.Name = 'OCM_01_001003';
- Orderdet3.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
- Orderdet3.Bar_Code__c = '33333250CCCCC';
- Orderdet3.Consumable_Product__c = pro1.Id;
- Orderdet3.Used_date__c = Date.today();
- Orderdet3.Send_Date__c = Date.today();
- Orderdet3.Arrive_date__c = Date.today();
- Orderdet3.Box_Piece__c = '鐩�';
- Orderdet3.TracingCode__c = 'CCCCC';
-
- //鍦ㄥ簱 涓�
- Consumable_order_details2__c Orderdet4 = new Consumable_order_details2__c();
- Orderdet4.Name = 'OCM_01_001004';
- Orderdet4.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery ;
- Orderdet4.Bar_Code__c = '44444250DDDDD';
- Orderdet4.Consumable_Product__c = pro1.Id;
- Orderdet4.Arrive_date__c = Date.today();
- Orderdet4.Box_Piece__c = '涓�';
- Orderdet4.TracingCode__c = 'DDDDD';
-
- Consumable_order_details2__c Orderdet5 = new Consumable_order_details2__c();
- Orderdet5.Name = 'OCM_01_001004';
- 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 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.Order_type__c = '璁㈠崟';
- zsd01.RecordTypeid = System.Label.RT_ConOrder_Order;
- zsd01.Summons_Sale_Status__c = '閿�鍞�';
- zsd01.Outbound_Date__c = Date.today();
- zsd01.IsShipment__c = true;
- insert zsd01;
- System.debug('zsd01:' + zsd01.Id);
-
- List<Consumable_orderdetails__c> orderdetails = new List<Consumable_orderdetails__c>();
- 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.Consumable_Count__c = 12;
- Orderdet6.Consumable_Product__c = pro1.Id;
- Orderdet6.Delivery_List_RMB__c = 1;
- Orderdet6.Shipment_Count__c = 1;
- Orderdet6.Unitprice_To_agency__c = 1.00;
- Orderdet6.Dealer_Custom_Price__c = 999.00;
- Orderdet6.isOutPattern__c = true;
- Orderdet6.Box_Piece__c = '涓�';
- orderdetails.add(Orderdet6);
- Consumable_orderdetails__c Orderdetc6 = new Consumable_orderdetails__c();
- Orderdetc6.Name = 'ZSD_01_001001';
- Orderdetc6.Consumable_order__c = zsd01.Id;
- Orderdetc6.RecordTypeId = System.Label.RT_ConOrderDetail1_Order;
- Orderdetc6.Consumable_Count__c = 12;
- Orderdetc6.Consumable_Product__c = pro2.Id;
- Orderdetc6.Delivery_List_RMB__c = 1;
- Orderdetc6.Unitprice_To_agency__c = 1.00;
- Orderdetc6.Dealer_Custom_Price__c = 999.00;
- Orderdetc6.Shipment_Count__c = 1;
- Orderdetc6.isOutPattern__c = true;
- Orderdetc6.Box_Piece__c = '鐩�';
- orderdetails.add(Orderdetc6);
- insert orderdetails;
- System.debug('orderdetails:' + orderdetails.size());
-
- hospitalprice__c hp1 = new hospitalprice__c();
- hp1.hospital__c = accountId;
- hp1.account__c = accountId;
- hp1.product__c = pro1.Id;
- insert hp1;
-
- orderpieceorboxMap = new Map<String, String>();
- orderagencypriceMap = new Map<String, Decimal>();
- orderpriceMap = new Map<String, Decimal>();
- orderdetCountMap = new Map<String, Decimal>();
- 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) {
- orderagencypriceMap.put(orderdetails[i].Product_Pattern__c, orderdetails[i].Unitprice_To_agency__c);
- }
- orderpriceMap.put(orderdetails[i].Product_Pattern__c, orderdetails[i].Delivery_List_RMB__c);
- orderdetCountMap.put(orderdetails[i].Product_Pattern__c, orderdetails[i].Shipment_Count__c);
- }
- }
- String ESetId = Order2.Id;
- System.Test.startTest();
- LexSaleOrderController.GoodsDeliveryInit(ESetId);
- String barcode1 = '';
- String key = '';
- String baseUrl = '';
- 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);
- 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.Getconsumableorderdetails2Nobox();
-
-
- List<LexSaleOrderController.ConsumableorderdetailsInfo> inList = LexSaleOrderController.consumableorderdetailsRecords;
- 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);
->>>>>>> LEXCommunityLiJun
c2.orderdetails1 = null;
c2.orderdetails2 = Orderdet1;
c2.Prod = Orderdet1.Consumable_product__r;
@@ -511,22 +279,12 @@
c1.Prod = Orderdet2.Consumable_product__r;
c1.oldConsumableCount = Orderdet2.Name;
c1.compareTo(c2);
-<<<<<<< HEAD
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();
-=======
-
- 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();
-
->>>>>>> LEXCommunityLiJun
}
}
@@ -536,27 +294,14 @@
Account myAccount2;
Account olympus;
User MyUser_Test;
-<<<<<<< HEAD
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搴�'
- ];
+ 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);
@@ -586,39 +331,12 @@
}
System.runAs(MyUser_Test) {
String Id = UserInfo.getUserId();
- User thisUserInfo = [
- SELECT accountid, ContactId, Contact.AccountId, Work_Location__c
- FROM User
- WHERE id = :Id
- ];
-=======
- 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 = '鐥呴櫌'];
- 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);
- 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;
- }
- system.runAs(MyUser_Test){
- String Id = UserInfo.getUserId();
- User thisUserInfo = [SELECT accountid,ContactId,Contact.AccountId, Work_Location__c FROM User WHERE id =:Id];
->>>>>>> LEXCommunityLiJun
+ 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);
-<<<<<<< HEAD
Product2 prod01 = new Product2(
Name = 'Test01',
ProductCode = 'Test01',
@@ -641,25 +359,13 @@
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};
->>>>>>> LEXCommunityLiJun
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;
-<<<<<<< HEAD
Order1.IsShipment__c = true;
-=======
- Order1.IsShipment__c = True;
->>>>>>> LEXCommunityLiJun
Order1.OwnerId = MyUser_Test.Id;
insert Order1;
@@ -669,7 +375,6 @@
Order2.Order_type__c = '璁㈠崟';
Order2.RecordTypeid = System.Label.RT_ConOrder_Order;
Order2.Dealer_Info__c = myAccount2.Id;
-<<<<<<< HEAD
Order2.IsShipment__c = true;
insert Order2;
@@ -770,119 +475,13 @@
Orderdet3.Lose_Flag__c = true;
Orderdet3.TracingCode__c = 'EEEEE';
-=======
- 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.Dealer_Info__c = myAccount2.Id;
- Order3.SummonsForDirction__c ='鐩存帴閿�鍞粰鍖婚櫌';
- Order3.IsShipment__c = True;
- insert Order3;
-
- Consumable_order_details2__c Orderdet = new Consumable_order_details2__c();
- Orderdet.Name = 'OCM_01_001001';
- Orderdet.Consumable_Product__c = pro1.Id;
- Orderdet.Consumable_order_minor__c = Order1.Id;
- 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.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
- Orderdet.RemoveBox_No__c = 3;
- Orderdet.Bar_Code__c = '1111111111250AAAAA';
- Orderdet.Arrive_date__c = Date.today();
- Orderdet.Delivery_List_RMB__c = 11.11;
- 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);
- //鍙戣揣
- Consumable_order_details2__c Orderdet1 = new Consumable_order_details2__c();
- Orderdet1.Name = 'OCM_01_001001';
- Orderdet1.Consumable_Product__c = pro1.Id;
- Orderdet1.Consumable_order_minor__c = Order1.Id;
- Orderdet1.Consumable_ZS_order__c = Order3.Id;
- Orderdet1.Consumable_Return_order__c = Order1.Id;
- Orderdet1.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
- Orderdet1.RemoveBox_No__c = 3;
- Orderdet1.Bar_Code__c = '2222222222250BBBBB';
- Orderdet1.Arrive_date__c = Date.today();
- Orderdet1.Return_reason__c = null;
- Orderdet1.Return_date__c = null;
- 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);
- //閿�鍞�
- Consumable_order_details2__c Orderdet2 = new Consumable_order_details2__c();
- Orderdet2.Name = 'OCM_01_001002';
- Orderdet2.Consumable_order_minor__c = Order3.Id;
- Orderdet2.Consumable_Shipment_order__c = Order3.Id;
- Orderdet2.Consumable_Sale_order__c = Order3.Id;
- Orderdet2.Consumable_ZS_order__c = Order3.Id;
- Orderdet2.Consumable_Return_order__c = Order3.Id;
- Orderdet2.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
- Orderdet2.RemoveBox_No__c = 3;
- Orderdet2.Bar_Code__c = '3333333333250CCCCC';
- Orderdet2.Consumable_Product__c = pro1.Id;
- Orderdet2.Send_Date__c = null;
- Orderdet2.Used_date__c = null;
- 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.Arrive_date__c = Date.today();
- Orderdet2.Sterilization_limit__c = Date.today().addDays(-1);
- //閿�鍞�
- Consumable_order_details2__c Orderdet9 = new Consumable_order_details2__c();
- Orderdet9.Name = 'OCM_01_001002';
- Orderdet9.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
- Orderdet9.RemoveBox_No__c = 3;
- Orderdet9.Bar_Code__c = '4444444444250DDDDD';
- Orderdet9.Consumable_Product__c = pro1.Id;
- Orderdet9.Arrive_date__c = Date.today();
- Orderdet9.Used_date__c = Date.today();
- Orderdet9.Box_Piece__c = '涓�';
- Orderdet9.TracingCode__c = 'DDDDD';
- //鍑哄簱
- Consumable_order_details2__c Orderdet3 = new Consumable_order_details2__c();
- Orderdet3.Name = 'OCM_01_001003';
- Orderdet3.Consumable_order_minor__c = Order1.Id;
- Orderdet3.Consumable_Shipment_order__c = Order1.Id;
- Orderdet3.Consumable_Sale_order__c = null;
- Orderdet3.Consumable_ZS_order__c = Order1.Id;
- Orderdet3.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
- Orderdet3.Bar_Code__c = '5555555555250EEEEE';
- 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.TracingCode__c = 'EEEEE';
-
->>>>>>> LEXCommunityLiJun
//鍒拌揣
Consumable_order_details2__c Orderdet4 = new Consumable_order_details2__c();
Orderdet4.Name = 'OCM_01_001004';
Orderdet4.Consumable_order_minor__c = null;
Orderdet4.Consumable_Sale_order__c = null;
Orderdet4.Consumable_ZS_order__c = Order1.Id;
-<<<<<<< HEAD
Orderdet4.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
-=======
- Orderdet4.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery ;
->>>>>>> LEXCommunityLiJun
Orderdet4.Consumable_Arrived_order__c = Order1.Id;
Orderdet4.Sterilization_limit__c = Date.today().addDays(-1);
Orderdet4.Bar_Code__c = '6666666666250FFFFF';
@@ -912,11 +511,7 @@
Orderdet6.Consumable_Product__c = pro1.Id;
Orderdet6.Arrive_date__c = Date.today();
Orderdet6.RemoveBox_No__c = 3;
-<<<<<<< HEAD
Orderdet6.Sterilization_limit__c = Date.today().addDays(-2);
-=======
- Orderdet6.Sterilization_limit__c = Date.today().addDays(-2);
->>>>>>> LEXCommunityLiJun
Orderdet6.TracingCode__c = 'HHHHH';
hospitalprice__c hp1 = new hospitalprice__c();
@@ -924,7 +519,6 @@
hp1.account__c = accountId;
hp1.product__c = pro1.Id;
insert hp1;
-<<<<<<< HEAD
List<Consumable_order_details2__c> newdet2 = new List<Consumable_order_details2__c>();
newdet2.add(Orderdet);
@@ -936,17 +530,6 @@
FROM Consumable_order_details2__c
WHERE Id = :Orderdet.Id
];
-=======
-
- List<Consumable_order_details2__c> newdet2 = new List<Consumable_order_details2__c>();
- newdet2.add(Orderdet);
- insert newdet2;
- 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];
->>>>>>> LEXCommunityLiJun
System.debug('cod2:' + cod2);
String userWorkLocation = cod2[0].Arrive_Owner_Work_Location__c;
System.debug('userWorkLocation:' + userWorkLocation);
@@ -959,7 +542,6 @@
String key = '';
orderpieceorboxMap = new Map<String, String>();
List<Consumable_orderdetails__c> orderdetails = new List<Consumable_orderdetails__c>();
-<<<<<<< HEAD
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);
@@ -1025,31 +607,6 @@
Orderdet1,
errorReason
);
-=======
- 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);
- 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);
- 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.Getconsumableorderdetails2Nobox();
-
- List<LexSaleOrderController.ConsumableorderdetailsInfo> inList = LexSaleOrderController.consumableorderdetailsRecords;
- 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);
->>>>>>> LEXCommunityLiJun
c2.orderdetails1 = null;
c2.orderdetails2 = Orderdet1;
c2.Prod = Orderdet1.Consumable_product__r;
@@ -1063,35 +620,18 @@
c1.oldConsumableCount = Orderdet2.Name;
c1.compareTo(c2);
System.Test.stopTest();
-<<<<<<< HEAD
-=======
-
->>>>>>> LEXCommunityLiJun
}
}
@isTest
static void testProSale() {
StaticParameter.EscapeConsumableOrderDetail2Trigger = true;
-<<<<<<< HEAD
- 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);
@@ -1117,20 +657,11 @@
}
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
- ];
+ Account[] accountInfo = [SELECT Name FROM account WHERE id = :accountId LIMIT 1];
if (accountInfo.size() > 0) {
accountName = accountInfo[0].Name;
}
@@ -1156,40 +687,6 @@
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<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 = '鐥呴櫌'];
- 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);
- insert myAccount2;
- 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())){
- insert 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];
- 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 ){
- 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 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};
->>>>>>> LEXCommunityLiJun
Consumable_order__c Order1 = new Consumable_order__c();
Order1.Name = 'OCM_01_001';
@@ -1197,7 +694,6 @@
Order1.Order_type__c = '璁㈠崟';
Order1.RecordTypeid = System.Label.RT_ConOrder_Order;
Order1.Dealer_Info__c = myAccount2.Id;
-<<<<<<< HEAD
Order1.IsShipment__c = true;
insert Order1;
@@ -1239,49 +735,6 @@
insert orderdetails;
System.debug('orderdetails.size() = ' + orderdetails.size());
-=======
- 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.Dealer_Info__c = myAccount2.Id;
- 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.Consumable_Count__c = 12;
- conOrder1.Consumable_Product__c = pro1.Id;
- conOrder1.Delivery_List_RMB__c = 1;
- conOrder1.Shipment_Count__c = 1;
- conOrder1.Box_Piece__c = '鐩�';
-
- 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.Consumable_Count__c = 12;
- conOrder2.Consumable_Product__c = pro1.Id;
- conOrder2.Delivery_List_RMB__c = 1;
- conOrder2.Shipment_Count__c = 1;
- conOrder2.Box_Piece__c = '涓�';
-
- orderdetails.add(conOrder1);
- orderdetails.add(conOrder2);
- insert orderdetails;
- System.debug('orderdetails.size() = ' + orderdetails.size());
-
->>>>>>> LEXCommunityLiJun
Consumable_order_details2__c Orderdet = new Consumable_order_details2__c();
Orderdet.Name = 'OCM_01_001001';
Orderdet.Consumable_Product__c = pro1.Id;
@@ -1296,13 +749,8 @@
Orderdet.Box_Piece__c = '鐩�';
Orderdet.Return_date__c = null;
Orderdet.TracingCode__c = '';
-<<<<<<< HEAD
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);
->>>>>>> LEXCommunityLiJun
//鍙戣揣
Consumable_order_details2__c Orderdet1 = new Consumable_order_details2__c();
@@ -1320,13 +768,8 @@
Orderdet1.Delivery_List_RMB__c = 11.11;
Orderdet1.Box_Piece__c = '涓�';
Orderdet1.TracingCode__c = '';
-<<<<<<< HEAD
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);
->>>>>>> LEXCommunityLiJun
//閿�鍞�
Consumable_order_details2__c Orderdet2 = new Consumable_order_details2__c();
Orderdet2.Name = 'OCM_01_001002';
@@ -1341,25 +784,15 @@
Orderdet2.Consumable_Product__c = pro1.Id;
Orderdet2.Send_Date__c = null;
Orderdet2.Used_date__c = null;
-<<<<<<< HEAD
Orderdet2.Lose_Flag__c = false;
-=======
- Orderdet2.Lose_Flag__c = FALSE;
->>>>>>> LEXCommunityLiJun
Orderdet2.Return_reason__c = null;
Orderdet2.Return_date__c = null;
Orderdet2.Delivery_List_RMB__c = 11;
Orderdet2.Box_Piece__c = '鐩�';
Orderdet2.TracingCode__c = null;
-<<<<<<< HEAD
Orderdet2.Cancellation_Flag__c = true;
Orderdet2.Arrive_date__c = Date.today();
Orderdet2.Sterilization_limit__c = Date.today().addDays(-1);
-=======
- Orderdet2.Cancellation_Flag__c = TRUE;
- Orderdet2.Arrive_date__c = Date.today();
- Orderdet2.Sterilization_limit__c = Date.today().addDays(-1);
->>>>>>> LEXCommunityLiJun
//閿�鍞�
Consumable_order_details2__c Orderdet9 = new Consumable_order_details2__c();
Orderdet9.Name = 'OCM_01_001002';
@@ -1384,23 +817,14 @@
Orderdet3.Consumable_Product__c = pro1.Id;
Orderdet3.Send_Date__c = Date.today();
Orderdet3.Box_Piece__c = '鐩�';
-<<<<<<< HEAD
Orderdet3.Return_date__c = null;
Orderdet3.Lose_Flag__c = true;
-=======
- Orderdet3.Return_date__c= null;
- Orderdet3.Lose_Flag__c = True;
->>>>>>> LEXCommunityLiJun
Orderdet3.TracingCode__c = 'EEEEE';
List<Consumable_order_details2__c> newdet2 = new List<Consumable_order_details2__c>();
newdet2.add(Orderdet);
insert newdet2;
-<<<<<<< HEAD
insert new List<Consumable_order_details2__c>{ Orderdet1, Orderdet2, Orderdet3, Orderdet9 };
-=======
- insert new Consumable_order_details2__c[] {Orderdet1,Orderdet2,Orderdet3,Orderdet9};
->>>>>>> LEXCommunityLiJun
Map<String, object> data = new Map<String, object>();
String ESetId = Order3.Id;
@@ -1411,7 +835,6 @@
Integer i = 0;
Decimal a = 0;
orderpieceorboxMap = new Map<String, String>();
-<<<<<<< HEAD
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);
@@ -1442,31 +865,14 @@
List<LexSaleOrderController.ConsumableorderdetailsInfo> inList1 = new List<LexSaleOrderController.ConsumableorderdetailsInfo>();
for (LexSaleOrderController.ConsumableorderdetailsInfo ass : inList) {
ass.orderdetails2 = Orderdet1;
-=======
- 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);
-
-
- List<LexSaleOrderController.ConsumableorderdetailsInfo> inList = LexSaleOrderController.consumableorderdetailsRecords;
- List<LexSaleOrderController.ConsumableorderdetailsInfo> inList1 = new List<LexSaleOrderController.ConsumableorderdetailsInfo>();
- for(LexSaleOrderController.ConsumableorderdetailsInfo ass: inList){
- ass.orderdetails2= Orderdet1;
->>>>>>> LEXCommunityLiJun
inList1.add(ass);
}
String errorReason = 'success';
-<<<<<<< HEAD
LexSaleOrderController.ConsumableorderdetailsInfo c2 = new LexSaleOrderController.ConsumableorderdetailsInfo(
Orderdet1,
errorReason
);
-=======
- LexSaleOrderController.ConsumableorderdetailsInfo c2 = new LexSaleOrderController.ConsumableorderdetailsInfo(Orderdet1,errorReason);
->>>>>>> LEXCommunityLiJun
c2.orderdetails1 = null;
c2.orderdetails2 = Orderdet1;
c2.Prod = Orderdet1.Consumable_product__r;
@@ -1480,34 +886,17 @@
c1.oldConsumableCount = Orderdet2.Name;
c1.compareTo(c2);
System.Test.stopTest();
-<<<<<<< HEAD
-=======
-
->>>>>>> LEXCommunityLiJun
}
}
@isTest
static void testProdError() {
-<<<<<<< HEAD
- 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);
@@ -1533,20 +922,11 @@
//璁㈠崟
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
- ];
+ Account[] accountInfo = [SELECT Name FROM account WHERE id = :accountId LIMIT 1];
if (accountInfo.size() > 0) {
accountName = accountInfo[0].Name;
}
@@ -1582,43 +962,6 @@
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 };
-=======
- 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 = '鐥呴櫌'];
- 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);
- insert myAccount2;
- 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())){
- insert 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];
- 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 ){
- 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 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};
->>>>>>> LEXCommunityLiJun
//鍑哄簱鍗�
Consumable_order__c Order1 = new Consumable_order__c();
Order1.Name = 'OCM_01_001';
@@ -1626,11 +969,7 @@
Order1.Order_type__c = '浼犵エ';
Order1.RecordTypeid = System.Label.RT_ConOrder_Order;
Order1.Dealer_Info__c = myAccount2.Id;
-<<<<<<< HEAD
Order1.SummonsForDirction__c = '鐩存帴閿�鍞粰鍖婚櫌';
-=======
- Order1.SummonsForDirction__c ='鐩存帴閿�鍞粰鍖婚櫌';
->>>>>>> LEXCommunityLiJun
Order1.IsShipment__c = true;
insert Order1;
@@ -1639,11 +978,7 @@
Consumable_orderdetails__c Orderdet1 = new Consumable_orderdetails__c();
Orderdet1.Name = 'OCM_01_001001';
Orderdet1.Consumable_order__c = Order1.Id;
-<<<<<<< HEAD
Orderdet1.RecordTypeId = System.Label.RT_ConOrderDetail1_Order;
-=======
- Orderdet1.RecordTypeId = System.Label.RT_ConOrderDetail1_Order ;
->>>>>>> LEXCommunityLiJun
Orderdet1.Consumable_Count__c = 12;
Orderdet1.Consumable_Product__c = pro1.Id;
Orderdet1.Unitprice_To_agency__c = 1;
@@ -1653,11 +988,7 @@
Consumable_orderdetails__c Orderdet2 = new Consumable_orderdetails__c();
Orderdet2.Name = 'OCM_01_001002';
Orderdet2.Consumable_order__c = Order1.Id;
-<<<<<<< HEAD
Orderdet2.RecordTypeId = System.Label.RT_ConOrderDetail1_Order;
-=======
- Orderdet2.RecordTypeId = System.Label.RT_ConOrderDetail1_Order ;
->>>>>>> LEXCommunityLiJun
Orderdet2.Consumable_Count__c = 12;
Orderdet2.Consumable_Product__c = pro2.Id;
Orderdet2.Unitprice_To_agency__c = 1;
@@ -1667,7 +998,6 @@
orderdetails.add(Orderdet1);
orderdetails.add(Orderdet2);
insert orderdetails;
-<<<<<<< HEAD
//鏄庣粏2
Consumable_order_details2__c Orderdets1 = new Consumable_order_details2__c();
@@ -1755,95 +1085,6 @@
newdet2.add(Orderdets1);
insert newdet2;
insert new List<Consumable_order_details2__c>{ Orderdets2, Orderdets3, Orderdets4, Orderdets5 };
-=======
-
- //鏄庣粏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.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.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.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.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;
- 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.RemoveBox_No__c = 3;
- Orderdets3.Delivery_List_RMB__c = 11.11;
- Orderdets3.Box_Piece__c = '鐩�';
- Orderdets3.Sterilization_limit__c = Date.today().addDays(-1);
- Orderdets3.TracingCode__c = 'CCCCC';
- //鏈埌璐�
- Consumable_order_details2__c Orderdets4 = new Consumable_order_details2__c();
- Orderdets4.Name = 'OCM_01_0010001';
- 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.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
- Orderdets4.Bar_Code__c = '44444250DDDDD';
- Orderdets4.Arrive_date__c = Date.today();
- Orderdets4.Return_date__c= null;
- Orderdets4.Consumable_Product__c = pro1.Id;
- Orderdets4.Delivery_List_RMB__c = 11.11;
- Orderdets4.RemoveBox_No__c = 3;
- Orderdets4.Box_Piece__c = '鐩�';
- Orderdets4.Sterilization_limit__c = Date.today().addDays(-1);
- Orderdets4.TracingCode__c = 'DDDDD';
-
- Consumable_order_details2__c Orderdets5 = new Consumable_order_details2__c();
- Orderdets5.Name = 'OCM_01_0010003';
- Orderdets5.Consumable_order_minor__c = Order1.Id;
- Orderdets5.Consumable_ZS_order__c = Order1.Id;
- Orderdets5.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
- Orderdets5.Bar_Code__c = '33333250EEEEE';
- Orderdets5.Consumable_Product__c = pro3.Id;
- Orderdets5.Arrive_date__c = Date.today();
- Orderdets5.Return_date__c= null;
- Orderdets5.RemoveBox_No__c = 3;
- Orderdets5.Delivery_List_RMB__c = 11.11;
- Orderdets5.Box_Piece__c = '涓�';
- Orderdets5.Sterilization_limit__c = Date.today().addDays(-1);
- Orderdets5.TracingCode__c = 'EEEEE';
-
- List<Consumable_order_details2__c> newdet2 = new List<Consumable_order_details2__c>();
- newdet2.add(Orderdets1);
- insert newdet2;
- insert new Consumable_order_details2__c[] {Orderdets2,Orderdets3,Orderdets4,Orderdets5};
->>>>>>> LEXCommunityLiJun
List<String> barCodeListP = new List<String>();
Map<String, object> data = new Map<String, object>();
@@ -1858,7 +1099,6 @@
String key = '';
Integer idx = 0;
orderpieceorboxMap = new Map<String, String>();
-<<<<<<< HEAD
LexSaleOrderController.SearchPro(Order1, barcode, accountName, userWorkLocation, accountId, orderdetails, orderpieceorboxMap);
LexSaleOrderController.ProdElivery(
ESetId,
@@ -1889,19 +1129,11 @@
@isTest
static void searchTest1() {
- 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)'
- ];
+ Profile prof = [SELECT Id FROM Profile WHERE Name = '901_缁忛攢鍟嗙ぞ鍖烘櫘閫氭潈闄恄2閲嶉獙璇�(ET)'];
Account myAccount2 = new Account(
name = 'Testaccount002',
Dealer_discount__c = 20,
@@ -2062,19 +1294,11 @@
@isTest
static void searchTest2() {
- 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)'
- ];
+ Profile prof = [SELECT Id FROM Profile WHERE Name = '901_缁忛攢鍟嗙ぞ鍖烘櫘閫氭潈闄恄2閲嶉獙璇�(ET)'];
Account myAccount2 = new Account(
name = 'Testaccount002',
Dealer_discount__c = 20,
@@ -2204,19 +1428,11 @@
@isTest
static void searchTest3() {
- 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)'
- ];
+ Profile prof = [SELECT Id FROM Profile WHERE Name = '901_缁忛攢鍟嗙ぞ鍖烘櫘閫氭潈闄恄2閲嶉獙璇�(ET)'];
Account myAccount2 = new Account(
name = 'Testaccount002',
Dealer_discount__c = 20,
@@ -2344,296 +1560,3 @@
}
}
}
-=======
- 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 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 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;
- hp1.product__c = pro1.Id;
- 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.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';
- 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;
- 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';
- 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';
- // Orderdet2.Consumable_ZS_order__c = Order1.Id;
- // Orderdet2.Box_Piece__c = '涓�';
- 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);
- 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 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 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;
- hp1.product__c = pro1.Id;
- 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.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';
- 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;
- 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';
- 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;
- 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.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 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 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;
- hp1.product__c = pro1.Id;
- 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.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';
- 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;
- 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';
- 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;
- 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.ProSale(Order1.Id, LexSaleOrderController.coc, '01049531702003111115120017181000105ZK250BXJRF', myAccount1.Name, '', condetailList, LexSaleOrderController.orderdetails, LexSaleOrderController.orderpriceMap, LexSaleOrderController.orderagencypriceMap);
- System.Test.stopTest();
- }
- }
-}
->>>>>>> LEXCommunityLiJun
diff --git a/force-app/main/default/classes/LexSearchContractControllerTest.cls b/force-app/main/default/classes/LexSearchContractControllerTest.cls
index bc509c2..e6fb1d7 100644
--- a/force-app/main/default/classes/LexSearchContractControllerTest.cls
+++ b/force-app/main/default/classes/LexSearchContractControllerTest.cls
@@ -1,35 +1,18 @@
@istest
public class LexSearchContractControllerTest {
@IsTest
-<<<<<<< HEAD
static void lexSearchContractController1() {
-=======
- static void lexSearchContractController1(){
->>>>>>> LEXCommunityLiJun
User myUser_test = new User();
Account myAccount2;
Account contact;
Contact core;
User currentUser = [SELECT Id FROM User WHERE Id = :UserInfo.getUserId()];
-<<<<<<< HEAD
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)'
- ];
+ 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,
@@ -71,33 +54,9 @@
}
System.runAs(myUser_test) {
-=======
- 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);
- 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);
- insert 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');
- insert myUser_test;
- }
-
- System.runAs(myUser_test){
->>>>>>> LEXCommunityLiJun
LexSearchContractController.init('ET');
String accountId = myAccount2.Id;
LexSearchContractController.searchContract('Testaccount002', accountId, 'ET', false);
}
}
-<<<<<<< HEAD
}
-=======
-}
->>>>>>> LEXCommunityLiJun
diff --git a/force-app/main/default/classes/LexSearchHospitalControllerTest.cls b/force-app/main/default/classes/LexSearchHospitalControllerTest.cls
index 31fc4df..d2b6280 100644
--- a/force-app/main/default/classes/LexSearchHospitalControllerTest.cls
+++ b/force-app/main/default/classes/LexSearchHospitalControllerTest.cls
@@ -1,17 +1,9 @@
@istest
public class LexSearchHospitalControllerTest {
@IsTest
-<<<<<<< HEAD
static void lexSearchHospitalControllerTest1() {
-=======
- static void lexSearchHospitalControllerTest1(){
->>>>>>> LEXCommunityLiJun
LexSearchHospitalController.init();
LexSearchHospitalController.searchHospital('', '');
LexSearchHospitalController.searchHospital('test', '');
}
-<<<<<<< HEAD
}
-=======
-}
->>>>>>> LEXCommunityLiJun
diff --git a/force-app/main/default/classes/LexSummonsCreatController.cls b/force-app/main/default/classes/LexSummonsCreatController.cls
index 5f271a4..598c217 100644
--- a/force-app/main/default/classes/LexSummonsCreatController.cls
+++ b/force-app/main/default/classes/LexSummonsCreatController.cls
@@ -245,7 +245,6 @@
// 鐢婚潰鍒濆鍖�
@AuraEnabled
-<<<<<<< HEAD
public static ResponseBodyLWC init(
String ESetidJs,
String statusEdit,
@@ -253,9 +252,6 @@
Integer pageTokenLWC,
String arriveorderLWC
) {
-=======
- public static ResponseBodyLWC init(String ESetidJs, String statusEdit, Integer pageSizeLWC, Integer pageTokenLWC,String arriveorderLWC) {
->>>>>>> LEXCommunityLiJun
try {
firstInit(ESetidJs);
statusEdit = statusEdit;
@@ -289,23 +285,9 @@
editAble = true;
}
userId = UserInfo.getUserId();
-<<<<<<< HEAD
- 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
- ];
-=======
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];
->>>>>>> LEXCommunityLiJun
accountid = Useracc.accountid;
userWorkLocation = Useracc.Work_Location__c;
agencyProType = Useracc.UserPro_Type__c;
@@ -323,27 +305,11 @@
];
List<Agency_Hospital_Link__c> AgencyHospitalLink = new List<Agency_Hospital_Link__c>();
-<<<<<<< HEAD
- 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
- ];
-=======
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];
->>>>>>> LEXCommunityLiJun
if (hlist == null || hlist.size() == 0) {
hasHos = false;
} else {
@@ -383,10 +349,7 @@
for (AggregateResult orderdetail : orderdetailCount) {
zaikuId.add(String.valueOf(orderdetail.get('cpc')));
}
-<<<<<<< HEAD
-=======
System.debug('orderdetailCount = ' + orderdetailCount);
->>>>>>> LEXCommunityLiJun
System.debug('sqlagencyProType = ' + sqlagencyProType);
System.debug('userWorkLocation = ' + userWorkLocation);
System.debug('accountName = ' + accountName);
@@ -430,10 +393,7 @@
for (Integer i = 0; i < product2Selected.size(); i++) {
MidMap.put(product2Selected[i].Id, new ConsumableorderdetailsInfo(product2Selected[i]));
}
-<<<<<<< HEAD
-=======
System.debug('MidMap = ' + MidMap);
->>>>>>> LEXCommunityLiJun
for (Integer i = 0; i < CountDel.size(); i++) {
String str = '';
if (CountDel[i].hospitalSpecialOffer__c) {
@@ -441,11 +401,8 @@
} else {
str = 'notHos';
}
-<<<<<<< HEAD
-=======
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);
->>>>>>> LEXCommunityLiJun
//鏄庣粏2瀵瑰簲鐨勪骇鍝佸瓨鍦ㄤ簬MidMap涓�
if (MidMap.containsKey(CountDel[i].Consumable_Product__c)) {
//璁剧疆map涓璳ey鐨勫悗缂� 鐢ㄤ簬鍖哄垎鍖婚櫌鐗逛环鍜岄潪鍖婚櫌鐗逛环
@@ -790,15 +747,7 @@
SELECT Id, Name, Invoice_Date__c, NoConfirmedPrice__c, Invoice_total_amount__c, Invoice_status__c
FROM Consumable_order__c
WHERE
-<<<<<<< HEAD
- 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)
->>>>>>> LEXCommunityLiJun
AND Invoice_status__c != '鑽夋涓�'
];
@@ -1358,15 +1307,7 @@
// 鏄剧ず鏁版嵁鏉℃暟淇℃伅
// makeMessage();
//闄勪欢
-<<<<<<< HEAD
- attachmentinfo = [
- SELECT Id, Name, OwnerId
- FROM Attachment
- WHERE parentid = :ESetId
- ];
-=======
attachmentinfo = [SELECT Id, Name, OwnerId FROM Attachment WHERE parentid = :ESetId];
->>>>>>> LEXCommunityLiJun
if (attachmentinfo.size() > 0) {
for (Integer i = 0; i < attachmentinfo.size(); i++) {
attachmentRecoeds.add(new ConsumableorderdetailsInfo(attachmentinfo[i]));
@@ -1463,11 +1404,7 @@
System.debug('res = ' + res);
return res;
} catch (Exception e) {
-<<<<<<< HEAD
return new ResponseBodyLWC('Error', 500, e.getMessage() + e.getLineNumber(), '');
-=======
- return new ResponseBodyLWC('Error',500, e.getMessage() + e.getLineNumber(), '');
->>>>>>> LEXCommunityLiJun
}
}
@@ -1484,10 +1421,7 @@
WHERE Category3_text__c = :category3 AND Category4_text__c != NULL AND Category5_text__c != NULL
GROUP BY Category4_text__c
];
-<<<<<<< HEAD
-=======
System.debug('category4List ' + category4List);
->>>>>>> LEXCommunityLiJun
category4OptionList = new List<SelectOption>();
category4OptionList.add(new SelectOption('', '-鏃�-'));
category4OptionMap = new Map<String, String>();
@@ -1505,10 +1439,7 @@
GROUP BY Category5_text__c
];
-<<<<<<< HEAD
-=======
System.debug('category5List ' + category5List);
->>>>>>> LEXCommunityLiJun
category5OptionList = new List<SelectOption>();
category5OptionList.add(new SelectOption('', '-鏃�-'));
category5OptionMap = new Map<String, String>();
@@ -1540,10 +1471,7 @@
WHERE Category3_text__c = :category3 AND Category4_text__c != NULL AND Category5_text__c != NULL
GROUP BY Category4_text__c
];
-<<<<<<< HEAD
-=======
System.debug('category4List ' + category4List);
->>>>>>> LEXCommunityLiJun
category4OptionList = new List<SelectOption>();
category4OptionList.add(new SelectOption('', '-鏃�-'));
category4OptionMap = new Map<String, String>();
@@ -1561,10 +1489,7 @@
GROUP BY Category5_text__c
];
-<<<<<<< HEAD
-=======
System.debug('category5List ' + category5List);
->>>>>>> LEXCommunityLiJun
category5OptionList = new List<SelectOption>();
category5OptionList.add(new SelectOption('', '-鏃�-'));
category5OptionMap = new Map<String, String>();
@@ -1632,11 +1557,8 @@
AND Arrive_Owner_Work_Location__c = :userWorkLocationLwc
GROUP BY Consumable_Product__c, Box_Piece__c
];
-<<<<<<< HEAD
-=======
System.debug('orderdetailCount = ' + orderdetailCount);
->>>>>>> LEXCommunityLiJun
for (AggregateResult orderdetail : orderdetailCount) {
zaikuId.add(String.valueOf(orderdetail.get('cpc')));
}
@@ -2149,15 +2071,7 @@
//鐗逛环鍖婚櫌鍑哄簱闈炴湰鍖婚櫌缁存姢鐨勭壒浠峰晢鍝佹椂,鎶ラ敊 闈炵壒浠峰尰闄㈠嚭搴撶淮鎶ゅ湪鍖婚櫌鐗逛环鍏崇郴琛ㄧ殑浜у搧鏃� 鎶ラ敊
if (coc.SummonsForDirction__c != '浜掔浉璋冭揣') {
//闈炵壒浠峰尰闄㈠嚭搴撶壒浠蜂骇鍝佹椂 鎶ラ敊(褰撳墠缁忛攢鍟嗕笅娌℃湁鐗逛环鍖婚櫌闄ゅ)
-<<<<<<< HEAD
- 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];
->>>>>>> LEXCommunityLiJun
//缁忛攢鍟嗗搴斿尰闄笅鐨勬墍鏈夌壒浠蜂骇鍝�
Map<String, String> proMap = new Map<String, String>();
//缁忛攢鍟嗕笅鐨勬墍鏈夌壒浠蜂骇鍝�
@@ -2224,15 +2138,7 @@
return new ResponseBodyLWC(
'Error',
500,
-<<<<<<< HEAD
'缁忛攢鍟�:' + coc.Order_ForDealerText__c + ' 娌℃湁娑堣�楀搧:' + proStr.substring(0, proStr.length() - 1) + ' 鐨勭壒浠�',
-=======
- '缁忛攢鍟�:' +
- coc.Order_ForDealerText__c +
- ' 娌℃湁娑堣�楀搧:' +
- proStr.substring(0, proStr.length() - 1) +
- ' 鐨勭壒浠�',
->>>>>>> LEXCommunityLiJun
''
);
}
@@ -2289,14 +2195,10 @@
if (ass.orderdetails1.Delivery_List_RMB__c == null && coc.SummonsForDirction__c != '鍖婚櫌璇曠敤') {
return new ResponseBodyLWC('Error', 500, '璇疯緭鍏ユ纭殑鍑鸿揣鍗曚环 (鍏�)', '');
}
-<<<<<<< HEAD
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 != '鍖婚櫌璇曠敤') {
->>>>>>> LEXCommunityLiJun
return new ResponseBodyLWC('Error', 500, '璇疯緭鍏ュ嚭璐у崟浠� (鍏�)', '');
}
if (
@@ -2328,13 +2230,7 @@
return new ResponseBodyLWC(
'Error',
500,
-<<<<<<< HEAD
'娑堣�楀搧' + ass.orderdetails1.Consumable_Product__r.Name__c + '搴撳瓨涓嶈冻',
-=======
- '娑堣�楀搧' +
- ass.orderdetails1.Consumable_Product__r.Name__c +
- '搴撳瓨涓嶈冻',
->>>>>>> LEXCommunityLiJun
''
);
}
@@ -2350,13 +2246,7 @@
return new ResponseBodyLWC(
'Error',
500,
-<<<<<<< HEAD
'娑堣�楀搧' + ass.orderdetails1.Consumable_Product__r.Name__c + '搴撳瓨涓嶈冻',
-=======
- '娑堣�楀搧' +
- ass.orderdetails1.Consumable_Product__r.Name__c +
- '搴撳瓨涓嶈冻',
->>>>>>> LEXCommunityLiJun
''
);
}
@@ -2367,15 +2257,7 @@
insert p;
ESetId = p.id;
List<Consumable_order__c> detailName = new List<Consumable_order__c>();
-<<<<<<< HEAD
- detailName = [
- SELECT id, Name
- FROM Consumable_order__c
- WHERE id = :ESetId
- ];
-=======
detailName = [SELECT id, Name FROM Consumable_order__c WHERE id = :ESetId];
->>>>>>> LEXCommunityLiJun
Integer i = 1;
for (ConsumableorderdetailsInfoLwc ass : pageRecordsLwc) {
if (ass.check == true) {
@@ -2470,14 +2352,10 @@
return new ResponseBodyLWC('Error', 500, '璇疯緭鍏ユ纭殑鍑鸿揣鍗曚环 (鍏�)', '');
}
Consumable_orderdetails__c InsAfterDel = new Consumable_orderdetails__c();
-<<<<<<< HEAD
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 != '鍖婚櫌璇曠敤') {
->>>>>>> LEXCommunityLiJun
return new ResponseBodyLWC('Error', 500, '璇疯緭鍏ュ嚭璐у崟浠� (鍏�)', '');
}
if (
@@ -2503,13 +2381,7 @@
return new ResponseBodyLWC(
'Error',
500,
-<<<<<<< HEAD
'娑堣�楀搧' + ass.orderdetails1.Consumable_Product__r.Name__c + '搴撳瓨涓嶈冻',
-=======
- '娑堣�楀搧' +
- ass.orderdetails1.Consumable_Product__r.Name__c +
- '搴撳瓨涓嶈冻',
->>>>>>> LEXCommunityLiJun
''
);
}
@@ -2524,13 +2396,7 @@
return new ResponseBodyLWC(
'Error',
500,
-<<<<<<< HEAD
'娑堣�楀搧' + ass.orderdetails1.Consumable_Product__r.Name__c + '搴撳瓨涓嶈冻',
-=======
- '娑堣�楀搧' +
- ass.orderdetails1.Consumable_Product__r.Name__c +
- '搴撳瓨涓嶈冻',
->>>>>>> LEXCommunityLiJun
''
);
}
@@ -2548,10 +2414,7 @@
InsAfterDel.Name = p.name + '-' + str;
InsAfterDel.Shipment_Count__c = ass.orderdetails1.Shipment_Count__c;
InsAfterDel.Consumable_order__c = ESetId;
-<<<<<<< HEAD
-=======
System.debug('ass.Prod.id:' + ass.Prod.id);
->>>>>>> LEXCommunityLiJun
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;
@@ -2570,15 +2433,7 @@
}
update p;
List<Consumable_orderdetails__c> qs = new List<Consumable_orderdetails__c>();
-<<<<<<< HEAD
- qs = [
- SELECT Id
- FROM Consumable_orderdetails__c
- WHERE Consumable_order__c = :ESetId
- ];
-=======
qs = [SELECT Id FROM Consumable_orderdetails__c WHERE Consumable_order__c = :ESetId];
->>>>>>> LEXCommunityLiJun
if (qs.size() > 0) {
delete qs;
}
@@ -2690,11 +2545,7 @@
// FROM Account
// WHERE
// // Name = '濂ユ灄宸存柉锛堝寳浜級閿�鍞湇鍔℃湁闄愬叕鍙�'
-<<<<<<< HEAD
// // AND
-=======
- // // AND
->>>>>>> LEXCommunityLiJun
// Name LIKE :nameCondition
// AND RecordType.DeveloperName = 'AgencyContract'
// AND Contract_Decide_Start_Date__c >= :thisDatetime
@@ -2710,11 +2561,7 @@
// FROM Account
// WHERE
// // Name = '濂ユ灄宸存柉锛堝寳浜級閿�鍞湇鍔℃湁闄愬叕鍙�'
-<<<<<<< HEAD
// // AND
-=======
- // // AND
->>>>>>> LEXCommunityLiJun
// Name LIKE :nameCondition
// AND RecordType.DeveloperName = 'AgencyContract'
// AND Contract_Decide_Start_Date__c >= :thisDatetime
@@ -2725,10 +2572,6 @@
// ];
// }
-<<<<<<< HEAD
-=======
-
->>>>>>> LEXCommunityLiJun
Date today = Date.today();
//Date today = Date.newInstance(2023, 3, 1);
Integer thisMonth = today.month();
@@ -2737,11 +2580,7 @@
Integer lastYear = today.year() - 1;
Integer thisYear = today.year();
Integer nextYear = today.year() + 1;
-<<<<<<< HEAD
-=======
-
->>>>>>> LEXCommunityLiJun
Date lastDatetime = Date.newInstance(lastYear, 4, 1);
Date thisDatetime = Date.newInstance(thisYear, 4, 1);
Date thisDatetime2 = Date.newInstance(thisYear, 7, 1);
@@ -2751,12 +2590,7 @@
System.debug('thisDatetime2 = ' + thisDatetime2);
System.debug('nextDatetime = ' + nextDatetime);
System.debug('UserInfo.getUserId() = ' + UserInfo.getUserId());
-<<<<<<< HEAD
- 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) {
@@ -2764,16 +2598,6 @@
} else if (thisMonth >= 4 && thisMonth <= 6) {
sql += 'AND Contract_Decide_Start_Date__c >= :lastDatetime AND Contract_Decide_End_Date__c < :nextDatetime ';
} else {
-=======
- 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){
- sql += 'AND Contract_Decide_Start_Date__c >= :lastDatetime AND Contract_Decide_End_Date__c < :thisDatetime2 ';
- }else if(thisMonth >= 4 && thisMonth <= 6){
- sql += 'AND Contract_Decide_Start_Date__c >= :lastDatetime AND Contract_Decide_End_Date__c < :nextDatetime ';
- }else{
->>>>>>> LEXCommunityLiJun
sql += 'AND Contract_Decide_Start_Date__c >= :thisDatetime AND Contract_Decide_End_Date__c < :nextDatetime ';
}
if (UserProTypecTemp.UserPro_Type__c == 'ENG') {
@@ -2861,13 +2685,6 @@
ResponseBodyLWC res = new ResponseBodyLWC();
Map<String, object> data = new Map<String, object>();
res.entity = data;
-<<<<<<< HEAD
- 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) {
@@ -2880,7 +2697,7 @@
FROM ContentVersion
WHERE ContentDocumentId IN :documentIds
];
-
+
if (cvInfo.size() > 0) {
for (Integer i = 0; i < cvInfo.size(); i++) {
cvList.add(cvInfo[i]);
@@ -2892,7 +2709,6 @@
// FROM ContentVersion
// WHERE FirstPublishLocationId = :recordId
// ];
->>>>>>> LEXCommunityLiJun
data.put('cvList', cvList);
res.status = 'Success';
res.code = 200;
@@ -2902,35 +2718,15 @@
//鍒犻櫎闄勪欢
@AuraEnabled
-<<<<<<< HEAD
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, '', '');
} catch (Exception e) {
return new ResponseBodyLWC('Error', 500, e.getMessage() + e.getLineNumber(), '');
-=======
- public static ResponseBodyLWC deleteAtt(String contentVersionId){
- try {
- ContentVersion conVersion = [SELECT ContentDocumentId FROM ContentVersion WHERE Id = :contentVersionId];
- String contentDocumentId = conVersion.ContentDocumentId;
- ContentDocument conDocument = [SELECT Id FROM ContentDocument where Id = :contentDocumentId];
- delete conDocument;
- return new ResponseBodyLWC('Success',200,'','');
- } catch (Exception e) {
- return new ResponseBodyLWC('Error',500, e.getMessage() + e.getLineNumber(), '');
->>>>>>> LEXCommunityLiJun
}
}
@@ -2991,15 +2787,7 @@
try {
List<Consumable_order__c> qs = new List<Consumable_order__c>();
List<Consumable_orderdetails__c> Dqs = new List<Consumable_orderdetails__c>();
-<<<<<<< HEAD
- Dqs = [
- SELECT Id
- FROM Consumable_orderdetails__c
- WHERE Consumable_order__c = :ESetId
- ];
-=======
Dqs = [SELECT Id FROM Consumable_orderdetails__c WHERE Consumable_order__c = :ESetId];
->>>>>>> LEXCommunityLiJun
qs = [SELECT Id FROM Consumable_order__c WHERE Id = :ESetId];
if (Dqs.size() > 0 || qs.size() > 0) {
delete Dqs;
@@ -3105,14 +2893,9 @@
hospitalSpecialOffer = false;
hosPro = false;
}
-<<<<<<< HEAD
//闄勪欢
-=======
-
- //闄勪欢
@TestVisible
->>>>>>> LEXCommunityLiJun
public ConsumableorderdetailsInfo(Attachment e) {
concc = e;
hospitalSpecialOffer = false;
@@ -3241,8 +3024,4 @@
@AuraEnabled
public Integer recordEnd { get; set; }
}
-<<<<<<< HEAD
}
-=======
-}
->>>>>>> LEXCommunityLiJun
diff --git a/force-app/main/default/classes/LexSummonsCreatControllerTest.cls b/force-app/main/default/classes/LexSummonsCreatControllerTest.cls
index 0544c9e..69797ba 100644
--- a/force-app/main/default/classes/LexSummonsCreatControllerTest.cls
+++ b/force-app/main/default/classes/LexSummonsCreatControllerTest.cls
@@ -1,22 +1,13 @@
@isTest
private class LexSummonsCreatControllerTest {
@isTest
-<<<<<<< HEAD
static void testInit() {
-=======
- static void testInit(){
->>>>>>> LEXCommunityLiJun
Account accountItem1;
Account accountItem2;
User userTest;
String rectCo = Schema.SObjectType.Account.getRecordTypeInfosByDeveloperName().get('Agency').getRecordTypeId();
String rectHp = Schema.SObjectType.Account.getRecordTypeInfosByDeveloperName().get('HP').getRecordTypeId();
-<<<<<<< HEAD
- Profile prof = [
- SELECT Id
- FROM Profile
- WHERE Name = '901_缁忛攢鍟嗙ぞ鍖烘櫘閫氭潈闄恄2閲嶉獙璇�(ET)'
- ];
+ 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(
@@ -30,21 +21,12 @@
);
insert accountItem2;
Contact core = new Contact(email = 'jplumber@salesforce.com', firstname = 'Joe', lastname = 'Plumber', accountId = accountItem1.Id);
-=======
- 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);
- insert accountItem2;
- Contact core = new Contact(email='jplumber@salesforce.com', firstname='Joe', lastname='Plumber', accountId = accountItem1.Id);
->>>>>>> LEXCommunityLiJun
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;
-<<<<<<< HEAD
insert new List<Agency_Hospital_Link__c>{ ahl };
System.runAs(new user(ID = UserInfo.getUserID())) {
@@ -62,12 +44,6 @@
UserPro_Type__c = 'ENG',
Work_Location__c = '鍖椾含'
);
-=======
- 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='鍖椾含');
->>>>>>> LEXCommunityLiJun
insert userTest;
}
//鍙戣揣
@@ -83,7 +59,6 @@
insert consOrder;
// create ContentVersions
-<<<<<<< HEAD
list<ContentVersion> cvList = new List<ContentVersion>();
cvList.add(
new ContentVersion(
@@ -137,32 +112,6 @@
FROM User
WHERE id = :userId
];
-=======
- 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])
- {
- 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'));
- 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){
- 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];
->>>>>>> LEXCommunityLiJun
String accountId = thisUserInfo.accountid;
String accountName = thisUserInfo.Contact.Account.Name;
String agencyProType = thisUserInfo.UserPro_Type__c;
@@ -172,7 +121,6 @@
if (String.isBlank(thisUserInfo.UserPro_Type__c)) {
agencyProType = 'ET';
}
-<<<<<<< HEAD
Product2 prod07 = new Product2(
Name = 'Test07',
ProductCode = 'Test07',
@@ -199,14 +147,6 @@
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};
->>>>>>> LEXCommunityLiJun
//鍙戣揣
Consumable_order__c createIdSend = new Consumable_order__c();
createIdSend.Name = 'testMing1';
@@ -264,11 +204,7 @@
createIdSend3.SummonsStatus_c__c = '鎵瑰噯';
createIdSend3.Dealer_Info__c = accountItem1.Id;
createIdSend3.Delivery_detail_count__c = 5;
-<<<<<<< HEAD
-=======
-
->>>>>>> LEXCommunityLiJun
Consumable_order__c createIdSend4 = new Consumable_order__c();
createIdSend4.Name = 'testMing1';
createIdSend4.Order_status__c = '鎵瑰噯';
@@ -310,11 +246,7 @@
createIdSend6.SummonsStatus_c__c = '';
createIdSend6.Dealer_Info__c = accountItem1.Id;
createIdSend6.Delivery_detail_count__c = 5;
-<<<<<<< HEAD
-=======
-
->>>>>>> LEXCommunityLiJun
Consumable_order__c createIdSend7 = new Consumable_order__c();
createIdSend7.Name = 'testMing222222';
createIdSend7.Order_status__c = '鎵瑰噯';
@@ -328,11 +260,7 @@
createIdSend7.SummonsStatus_c__c = '';
createIdSend7.Dealer_Info__c = accountItem1.Id;
createIdSend7.Delivery_detail_count__c = 5;
-<<<<<<< HEAD
-=======
-
->>>>>>> LEXCommunityLiJun
Consumable_order__c createIdSend8 = new Consumable_order__c();
createIdSend8.Name = 'testMing222222';
createIdSend8.Order_status__c = '鎵瑰噯';
@@ -347,17 +275,10 @@
createIdSend8.Dealer_Info__c = accountItem1.Id;
createIdSend8.Delivery_detail_count__c = 5;
-<<<<<<< HEAD
//鍙戠エ淇℃伅
Consumable_order__c createIdSend9 = new Consumable_order__c();
createIdSend9.Name = 'invoice01';
createIdSend9.Invoice_status__c = '宸插畬鎴�';
-=======
- //鍙戠エ淇℃伅
- Consumable_order__c createIdSend9 = new Consumable_order__c();
- createIdSend9.Name = 'invoice01';
- createIdSend9.Invoice_status__c='宸插畬鎴�';
->>>>>>> LEXCommunityLiJun
createIdSend9.Order_type__c = '鍙戠エ';
createIdSend9.RecordTypeid = System.Label.RT_ConOrder_Invoice;
createIdSend9.Order_status__c = '鑽夋涓�';
@@ -384,7 +305,6 @@
createIdSend11.Order_ProType__c = 'ET';
Consumable_order__c testList1 = new Consumable_order__c();
-<<<<<<< HEAD
testList1.Name = 'Test1';
testList1.Summons_Sale_Status__c = '鍑鸿揣';
testList1.SummonsStatus_c__c = '宸插畬鎴�';
@@ -393,16 +313,6 @@
testList1.Order_status__c = '鑽夋涓�';
testList1.Order_type__c = '浼犵エ';
testList1.Dealer_info__c = accountItem1.Id;
-=======
- 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;
->>>>>>> LEXCommunityLiJun
testList1.ConInvoice_Code__c = createIdSend9.id;
//鍒拌揣
@@ -416,7 +326,6 @@
createIdArrived.orderPattern__c = 'promotionorder';
createIdArrived.Dealer_Info__c = accountItem1.Id;
createIdArrived.Delivery_detail_count__c = 5;
-<<<<<<< HEAD
insert new List<Consumable_order__c>{
createIdSend,
createIdSend1,
@@ -442,14 +351,6 @@
Invoice_Code_link__c = createIdSend9.Id
);
insert new List<Consumable_order_LinkTable__c>{ order_LinkTable1 };
-=======
- 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 Consumable_order_LinkTable__c[]{order_LinkTable1};
->>>>>>> LEXCommunityLiJun
Consumable_orderdetails__c coc = new Consumable_orderdetails__c();
coc.Name = 'Too001';
@@ -489,11 +390,7 @@
coc2.Delivery_List_RMB__c = -999.00;
coc2.Shipment_Count__c = 9999.00;
coc2.RecordTypeid = System.Label.RT_ConOrderDetail1_Order;
-<<<<<<< HEAD
insert new List<Consumable_orderdetails__c>{ coc, coc1, coc2 };
-=======
- insert new Consumable_orderdetails__c[]{coc,coc1,coc2};
->>>>>>> LEXCommunityLiJun
Consumable_order_details2__c conOrderDetail1 = new Consumable_order_details2__c();
conOrderDetail1.Name = 'OCM_01_001001';
@@ -511,18 +408,12 @@
conOrderDetail1.Cancellation_Flag__c = false;
conOrderDetail1.Box_Piece__c = '鐩�';
conOrderDetail1.Sterilization_limit__c = Date.Today();
-<<<<<<< HEAD
insert new List<Consumable_order_details2__c>{ conOrderDetail1 };
-=======
- insert new Consumable_order_details2__c[]{conOrderDetail1};
-
->>>>>>> LEXCommunityLiJun
hospitalprice__c hp1 = new hospitalprice__c();
hp1.hospital__c = accountId;
hp1.account__c = accountId;
hp1.product__c = pro1.Id;
-<<<<<<< HEAD
insert new List<hospitalprice__c>{ hp1 };
Dealer_elationship__c dealerelationship = new Dealer_elationship__c(
@@ -534,13 +425,6 @@
Dealer_subordinate__c = accountItem1.id
);
insert new List<Dealer_elationship__c>{ dealerelationship, dealerelationship1 };
-=======
- 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 Dealer_elationship__c[] {dealerelationship, dealerelationship1};
->>>>>>> LEXCommunityLiJun
LexSummonsCreatController.ConsumableorderdetailsInfo c0 = new LexSummonsCreatController.ConsumableorderdetailsInfo();
c0.packinglist = 0;
@@ -568,13 +452,9 @@
Map<String, String> boxorpieceMap = new Map<String, String>();
boxorpieceMap.put('鐩�', '鐩�');
boxorpieceMap.put('涓�', '涓�');
-<<<<<<< HEAD
LexSummonsCreatController.ConsumableorderdetailsInfo coder = new LexSummonsCreatController.ConsumableorderdetailsInfo(
conOrderDetail1
);
-=======
- LexSummonsCreatController.ConsumableorderdetailsInfo coder = new LexSummonsCreatController.ConsumableorderdetailsInfo(conOrderDetail1);
->>>>>>> LEXCommunityLiJun
coder.check = true;
coder.oldCheck = true;
coder.hospitalSpecialOffer = true;
@@ -604,11 +484,7 @@
c3.Boxnumber = 10;
c1.compareTo(c3);
c1.Boxnumber = 20;
-<<<<<<< HEAD
c3.Boxnumber = 10;
-=======
- c3.Boxnumber = 10;
->>>>>>> LEXCommunityLiJun
c1.compareTo(c3);
c3.Boxnumber = 10;
c1.Boxnumber = 20;
@@ -714,11 +590,7 @@
codi.boxorpiecein = null;
codi.orderdetails1 = coc;
codi.Prod = pro1;
-<<<<<<< HEAD
consumable.add(codi);
-=======
- consumable.add(codi);
->>>>>>> LEXCommunityLiJun
List<SelectOption> categoryOptionList = new List<SelectOption>();
System.Test.startTest();
Integer size = Integer.valueOf(System.Label.orderdetLimitsize);
@@ -727,11 +599,7 @@
String arrive = null;
String alertMessage = null;
-<<<<<<< HEAD
String category1 = '3400PK:PK閽� 5mm脳33cm';
-=======
- String category1= '3400PK:PK閽� 5mm脳33cm';
->>>>>>> LEXCommunityLiJun
String Category3 = '鑵硅厰闀滄墜鏈�';
String Category4 = 'PK';
String Category5 = 'G400';
@@ -767,17 +635,12 @@
optionMap.put('', '-鏃�-');
optionMap.put('ishos', '鍖婚櫌鐗逛环浜у搧');
optionMap.put('nothos', '闈炲尰闄㈢壒浠蜂骇鍝�');
-<<<<<<< HEAD
-=======
-
->>>>>>> LEXCommunityLiJun
Integer count = LexSummonsCreatController.consumableorderdetailsCount;
Consumable_order__c cocOrderId = new Consumable_order__c();
LexSummonsCreatController.coc = cocOrderId;
String consumableorderId = LexSummonsCreatController.consumableorderId;
LexSummonsCreatController summonCC = new LexSummonsCreatController();
-<<<<<<< HEAD
LexSummonsCreatController.init(testList1.Id, 'Test', 1, 100, testList1.Id);
LexSummonsCreatController.firstInit(ESetId);
@@ -993,61 +856,19 @@
LexSummonsCreatController.GoodsDelivery(createIdSend3, createIdSend3.Id, pageRecords);
LexSummonsCreatController.GoodsDelivery(createIdSend1, createIdSend1.Id, pageRecordsLwcLwc);
LexSummonsCreatController.GoodsDelivery(createIdSend6, createIdSend6.Id, pageRecordsLwcLwc);
-=======
-
- 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.checkOutPattern();
- 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);
->>>>>>> LEXCommunityLiJun
LexSummonsCreatController.DelConsumable(createIdSend.Id);
System.Test.stopTest();
}
}
@isTest
-<<<<<<< HEAD
static void testSaveMethod() {
-=======
- static void testSaveMethod(){
->>>>>>> LEXCommunityLiJun
Account accountItem1;
Account accountItem2;
User userTest;
String rectCo = Schema.SObjectType.Account.getRecordTypeInfosByDeveloperName().get('Agency').getRecordTypeId();
String rectHp = Schema.SObjectType.Account.getRecordTypeInfosByDeveloperName().get('HP').getRecordTypeId();
-<<<<<<< HEAD
- Profile prof = [
- SELECT Id
- FROM Profile
- WHERE Name = '901_缁忛攢鍟嗙ぞ鍖烘櫘閫氭潈闄恄2閲嶉獙璇�(ET)'
- ];
+ 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(
@@ -1086,22 +907,6 @@
FROM User
WHERE id = :userId
];
-=======
- 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);
- insert accountItem2;
- 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='鍖椾含');
- insert 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];
->>>>>>> LEXCommunityLiJun
String accountId = thisUserInfo.accountid;
String accountName = thisUserInfo.Contact.Account.Name;
String agencyProType = thisUserInfo.UserPro_Type__c;
@@ -1111,7 +916,6 @@
if (String.isBlank(thisUserInfo.UserPro_Type__c)) {
agencyProType = 'ET';
}
-<<<<<<< HEAD
Product2 prod07 = new Product2(
Name = 'Test07',
ProductCode = 'Test07',
@@ -1134,12 +938,6 @@
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};
->>>>>>> LEXCommunityLiJun
Consumable_order__c createIdSend = new Consumable_order__c();
createIdSend.Name = 'testMing1';
createIdSend.Order_status__c = '鎵瑰噯';
@@ -1167,7 +965,6 @@
createIdSend1.SummonsStatus_c__c = '浠锋牸鏈畾';
createIdSend1.Dealer_Info__c = accountItem1.Id;
createIdSend1.Delivery_detail_count__c = 5;
-<<<<<<< HEAD
insert new List<Consumable_order__c>{ createIdSend, createIdSend1 };
Consumable_orderdetails__c coc = new Consumable_orderdetails__c();
@@ -1196,36 +993,6 @@
coc1.Shipment_Count__c = 9999.00;
coc1.RecordTypeid = System.Label.RT_ConOrderDetail1_Order;
-=======
- 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;
- coc.Consumable_count__c = 3;
- coc.Consumable_product__c = pro1.Id;
- coc.Box_Piece__c = '鐩�';
- coc.isOutPattern__c = true;
- coc.Consumable_order__c = createIdSend.Id;
- coc.Unitprice_To_agency__c = 999.00;
- coc.Delivery_List_RMB__c = -999.00;
- coc.Shipment_Count__c = 9999.00;
- coc.RecordTypeid = System.Label.RT_ConOrderDetail1_Order;
-
- Consumable_orderdetails__c coc1 = new Consumable_orderdetails__c();
- coc1.Name = 'Too001';
- coc1.Dealer_Custom_Price__c = 999.00;
- coc1.Consumable_count__c = 3;
- coc1.Consumable_product__c = pro1.Id;
- coc1.Box_Piece__c = '鐩�';
- coc1.isOutPattern__c = true;
- coc1.Consumable_order__c = createIdSend.Id;
- coc1.Unitprice_To_agency__c = 999.00;
- coc1.Delivery_List_RMB__c = null;
- coc1.Shipment_Count__c = 9999.00;
- coc1.RecordTypeid = System.Label.RT_ConOrderDetail1_Order;
-
->>>>>>> LEXCommunityLiJun
Consumable_orderdetails__c coc2 = new Consumable_orderdetails__c();
coc2.Name = 'Too001';
coc2.Dealer_Custom_Price__c = 999.00;
@@ -1251,11 +1018,7 @@
coc3.Delivery_List_RMB__c = 100.00;
coc3.Shipment_Count__c = 9999.00;
coc3.RecordTypeid = System.Label.RT_ConOrderDetail1_Order;
-<<<<<<< HEAD
insert new List<Consumable_orderdetails__c>{ coc, coc1, coc2, coc3 };
-=======
- insert new Consumable_orderdetails__c[]{coc,coc1,coc2,coc3};
->>>>>>> LEXCommunityLiJun
Consumable_order_details2__c conOrderDetail1 = new Consumable_order_details2__c();
conOrderDetail1.Name = 'OCM_01_001001';
@@ -1272,12 +1035,7 @@
conOrderDetail1.Cancellation_Flag__c = false;
conOrderDetail1.Box_Piece__c = '鐩�';
conOrderDetail1.Sterilization_limit__c = Date.Today();
-<<<<<<< HEAD
insert new List<Consumable_order_details2__c>{ conOrderDetail1 };
-=======
- insert new Consumable_order_details2__c[]{conOrderDetail1};
-
->>>>>>> LEXCommunityLiJun
List<LexSummonsCreatController.ConsumableorderdetailsInfoLwc> pageRecords = new List<LexSummonsCreatController.ConsumableorderdetailsInfoLwc>();
LexSummonsCreatController.ConsumableorderdetailsInfoLwc c0 = new LexSummonsCreatController.ConsumableorderdetailsInfoLwc();
@@ -1433,7 +1191,6 @@
codi.boxorpiecein = null;
codi.orderdetails1 = coc;
codi.Prod = pro1;
-<<<<<<< HEAD
consumable.add(codi);
System.Test.startTest();
LexSummonsCreatController.save(
@@ -1508,37 +1265,18 @@
agencyProType,
userWorkLocation
);
-=======
- 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);
->>>>>>> LEXCommunityLiJun
System.Test.stopTest();
}
}
@isTest
-<<<<<<< HEAD
static void testSaveMethod1() {
-=======
- static void testSaveMethod1(){
->>>>>>> LEXCommunityLiJun
Account accountItem1;
Account accountItem2;
User userTest;
String rectCo = Schema.SObjectType.Account.getRecordTypeInfosByDeveloperName().get('Agency').getRecordTypeId();
String rectHp = Schema.SObjectType.Account.getRecordTypeInfosByDeveloperName().get('HP').getRecordTypeId();
-<<<<<<< HEAD
- Profile prof = [
- SELECT Id
- FROM Profile
- WHERE Name = '901_缁忛攢鍟嗙ぞ鍖烘櫘閫氭潈闄恄2閲嶉獙璇�(ET)'
- ];
+ 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(
@@ -1577,22 +1315,6 @@
FROM User
WHERE id = :userId
];
-=======
- 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);
- insert accountItem2;
- 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='鍖椾含');
- insert 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];
->>>>>>> LEXCommunityLiJun
String accountId = thisUserInfo.accountid;
String accountName = thisUserInfo.Contact.Account.Name;
String agencyProType = thisUserInfo.UserPro_Type__c;
@@ -1602,7 +1324,6 @@
if (String.isBlank(thisUserInfo.UserPro_Type__c)) {
agencyProType = 'ET';
}
-<<<<<<< HEAD
Product2 prod07 = new Product2(
Name = 'Test07',
ProductCode = 'Test07',
@@ -1628,13 +1349,6 @@
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};
->>>>>>> LEXCommunityLiJun
Consumable_order__c createIdSend = new Consumable_order__c();
createIdSend.Name = 'testMing1';
createIdSend.Order_status__c = '鎵瑰噯';
@@ -1662,7 +1376,6 @@
createIdSend1.SummonsStatus_c__c = '浠锋牸鏈畾';
createIdSend1.Dealer_Info__c = accountItem1.Id;
createIdSend1.Delivery_detail_count__c = 5;
-<<<<<<< HEAD
insert new List<Consumable_order__c>{ createIdSend, createIdSend1 };
Consumable_orderdetails__c coc = new Consumable_orderdetails__c();
@@ -1691,36 +1404,6 @@
coc1.Shipment_Count__c = null;
coc1.RecordTypeid = System.Label.RT_ConOrderDetail1_Order;
-=======
- 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;
- coc.Consumable_count__c = 3;
- coc.Consumable_product__c = pro1.Id;
- coc.Box_Piece__c = '涓�';
- coc.isOutPattern__c = true;
- coc.Consumable_order__c = createIdSend.Id;
- coc.Unitprice_To_agency__c = 999.00;
- coc.Delivery_List_RMB__c = 999.00;
- coc.Shipment_Count__c = 9999.00;
- coc.RecordTypeid = System.Label.RT_ConOrderDetail1_Order;
-
- Consumable_orderdetails__c coc1 = new Consumable_orderdetails__c();
- coc1.Name = 'Too002';
- coc1.Dealer_Custom_Price__c = 999.00;
- coc1.Consumable_count__c = 3;
- coc1.Consumable_product__c = pro1.Id;
- coc1.Box_Piece__c = '涓�';
- coc1.isOutPattern__c = true;
- coc1.Consumable_order__c = createIdSend.Id;
- coc1.Unitprice_To_agency__c = 999.00;
- coc1.Delivery_List_RMB__c = 999.00;
- coc1.Shipment_Count__c = null;
- coc1.RecordTypeid = System.Label.RT_ConOrderDetail1_Order;
-
->>>>>>> LEXCommunityLiJun
Consumable_orderdetails__c coc2 = new Consumable_orderdetails__c();
coc2.Name = 'Too003';
coc2.Dealer_Custom_Price__c = 999.00;
@@ -1793,11 +1476,7 @@
coc7.Delivery_List_RMB__c = 100;
coc7.Shipment_Count__c = 0;
coc7.RecordTypeid = System.Label.RT_ConOrderDetail1_Order;
-<<<<<<< HEAD
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};
->>>>>>> LEXCommunityLiJun
Consumable_order_details2__c conOrderDetail1 = new Consumable_order_details2__c();
conOrderDetail1.Name = 'OCM_01_001001';
@@ -1814,11 +1493,7 @@
conOrderDetail1.Cancellation_Flag__c = false;
conOrderDetail1.Box_Piece__c = '鐩�';
conOrderDetail1.Sterilization_limit__c = Date.Today();
-<<<<<<< HEAD
insert new List<Consumable_order_details2__c>{ conOrderDetail1 };
-=======
- insert new Consumable_order_details2__c[]{conOrderDetail1};
->>>>>>> LEXCommunityLiJun
List<LexSummonsCreatController.ConsumableorderdetailsInfoLwc> pageRecords = new List<LexSummonsCreatController.ConsumableorderdetailsInfoLwc>();
LexSummonsCreatController.ConsumableorderdetailsInfoLwc c0 = new LexSummonsCreatController.ConsumableorderdetailsInfoLwc();
c0.check = true;
@@ -1925,7 +1600,6 @@
codi.boxorpiecein = null;
codi.orderdetails1 = coc;
codi.Prod = pro1;
-<<<<<<< HEAD
consumable.add(codi);
System.Test.startTest();
LexSummonsCreatController.save(
@@ -1976,35 +1650,18 @@
agencyProType,
userWorkLocation
);
-=======
- 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);
->>>>>>> LEXCommunityLiJun
System.Test.stopTest();
}
}
@isTest
-<<<<<<< HEAD
static void testSave() {
-=======
- static void testSave(){
->>>>>>> LEXCommunityLiJun
Account accountItem1;
Account accountItem2;
User userTest;
String rectCo = Schema.SObjectType.Account.getRecordTypeInfosByDeveloperName().get('Agency').getRecordTypeId();
String rectHp = Schema.SObjectType.Account.getRecordTypeInfosByDeveloperName().get('HP').getRecordTypeId();
-<<<<<<< HEAD
- Profile prof = [
- SELECT Id
- FROM Profile
- WHERE Name = '901_缁忛攢鍟嗙ぞ鍖烘櫘閫氭潈闄恄2閲嶉獙璇�(ET)'
- ];
+ Profile prof = [SELECT Id FROM Profile WHERE Name = '901_缁忛攢鍟嗙ぞ鍖烘櫘閫氭潈闄恄2閲嶉獙璇�(ET)'];
accountItem1 = new Account(
Name = 'Testaccount001',
RecordTypeId = rectCo,
@@ -2046,22 +1703,6 @@
FROM User
WHERE id = :userId
];
-=======
- 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);
- insert accountItem2;
- 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='鍖椾含');
- insert 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];
->>>>>>> LEXCommunityLiJun
String accountId = thisUserInfo.accountid;
String accountName = thisUserInfo.Contact.Account.Name;
String agencyProType = thisUserInfo.UserPro_Type__c;
@@ -2071,7 +1712,6 @@
if (String.isBlank(thisUserInfo.UserPro_Type__c)) {
agencyProType = 'ET';
}
-<<<<<<< HEAD
Product2 prod07 = new Product2(
Name = 'Test07',
ProductCode = 'Test07',
@@ -2094,12 +1734,6 @@
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};
->>>>>>> LEXCommunityLiJun
Consumable_order__c createIdSend = new Consumable_order__c();
createIdSend.Name = 'testMing1';
@@ -2145,11 +1779,7 @@
createIdSend2.SummonsStatus_c__c = '浠锋牸鏈畾';
createIdSend2.Dealer_Info__c = accountItem1.Id;
createIdSend2.Delivery_detail_count__c = 5;
-<<<<<<< HEAD
insert new List<Consumable_order__c>{ createIdSend, createIdSend1, createIdSend2 };
-=======
- insert new Consumable_order__c[] {createIdSend,createIdSend1,createIdSend2};
->>>>>>> LEXCommunityLiJun
Consumable_orderdetails__c coc = new Consumable_orderdetails__c();
coc.Name = 'Too001';
@@ -2223,11 +1853,7 @@
coc5.Delivery_List_RMB__c = 100;
coc5.Shipment_Count__c = 10000;
coc5.RecordTypeid = System.Label.RT_ConOrderDetail1_Order;
-<<<<<<< HEAD
insert new List<Consumable_orderdetails__c>{ coc, coc1, coc2, coc3, coc4, coc5 };
-=======
- insert new Consumable_orderdetails__c[]{coc,coc1,coc2,coc3,coc4,coc5};
->>>>>>> LEXCommunityLiJun
Consumable_order_details2__c conOrderDetail1 = new Consumable_order_details2__c();
conOrderDetail1.Name = 'OCM_01_001001';
@@ -2242,22 +1868,13 @@
conOrderDetail1.Consumable_order_minor__c = createIdSend.Id;
conOrderDetail1.Lose_Flag__c = false;
conOrderDetail1.Box_Piece__c = '鐩�';
-<<<<<<< HEAD
insert new List<Consumable_order_details2__c>{ conOrderDetail1 };
-=======
- insert new Consumable_order_details2__c[]{conOrderDetail1};
-
->>>>>>> LEXCommunityLiJun
hospitalprice__c hp1 = new hospitalprice__c();
hp1.hospital__c = accountId;
hp1.account__c = accountId;
hp1.product__c = pro1.Id;
-<<<<<<< HEAD
insert new List<hospitalprice__c>{ hp1 };
-=======
- insert new hospitalprice__c[]{hp1};
->>>>>>> LEXCommunityLiJun
List<LexSummonsCreatController.ConsumableorderdetailsInfoLwc> pageRecordsList = new List<LexSummonsCreatController.ConsumableorderdetailsInfoLwc>();
LexSummonsCreatController.ConsumableorderdetailsInfoLwc cod = new LexSummonsCreatController.ConsumableorderdetailsInfoLwc();
@@ -2385,7 +2002,6 @@
String arrive = createIdSend.Id;
System.Test.startTest();
LexSummonsCreatController.firstInit(ESetId);
-<<<<<<< HEAD
LexSummonsCreatController.init(ESetId, statusEdit, 1, 100, arrive);
LexSummonsCreatController.init(ESetId, null, 1, 100, arrive);
LexSummonsCreatController.GoodsDelivery(createIdSend2, createIdSend2.Id, pageRecords);
@@ -2495,11 +2111,7 @@
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)'
- ];
+ Profile prof = [SELECT Id FROM Profile WHERE Name = '901_缁忛攢鍟嗙ぞ鍖烘櫘閫氭潈闄恄2閲嶉獙璇�(ET)'];
accountItem1 = new Account(
Name = 'Testaccount001',
RecordTypeId = rectCo,
@@ -2826,11 +2438,7 @@
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)'
- ];
+ Profile prof = [SELECT Id FROM Profile WHERE Name = '901_缁忛攢鍟嗙ぞ鍖烘櫘閫氭潈闄恄2閲嶉獙璇�(ET)'];
accountItem1 = new Account(
Name = 'Testaccount001',
RecordTypeId = rectCo,
@@ -3105,11 +2713,7 @@
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)'
- ];
+ 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(
@@ -3424,24 +3028,12 @@
@isTest
static void saveMethodTest1() {
- 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 rectCoO = [
- SELECT Id
- FROM RecordType
- WHERE IsActive = TRUE AND SobjectType = 'Account' AND Name = '鐥呴櫌'
- ];
+ 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 };
@@ -3609,24 +3201,12 @@
@isTest
static void initMethodTest1() {
- 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 rectCoO = [
- SELECT Id
- FROM RecordType
- WHERE IsActive = TRUE AND SobjectType = 'Account' AND Name = '鐥呴櫌'
- ];
+ 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 };
@@ -3733,24 +3313,12 @@
@isTest
static void initMethodTest2() {
- 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 rectCoO = [
- SELECT Id
- FROM RecordType
- WHERE IsActive = TRUE AND SobjectType = 'Account' AND Name = '鐥呴櫌'
- ];
+ 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 };
@@ -3855,931 +3423,3 @@
}
}
}
-=======
- 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(){
- 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);
- insert accountItem1;
- 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);
- 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='鍖椾含');
- insert 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];
- String accountId = thisUserInfo.accountid;
- String accountName = thisUserInfo.Contact.Account.Name;
- String agencyProType = thisUserInfo.UserPro_Type__c;
- String userWorkLocation = thisUserInfo.Work_Location__c;
- thisUserInfo.UserPro_Type__c = '';
- update thisUserInfo;
- 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 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 = '鎵瑰噯';
- createIdSend.Deliver_date__c = Date.today();
- createIdSend.RecordTypeid = System.Label.RT_ConOrder_Delivery;
- createIdSend.Order_type__c = '璁㈠崟';
- createIdSend.Order_ProType__c = 'ENG';
- createIdSend.SummonsForDirction__c = '鐩存帴閿�鍞粰鍖婚櫌';
- createIdSend.Order_ForDealerText__c = 'Test';
- createIdSend.Order_ForCustomerText__c = 'Test';
- createIdSend.SummonsStatus_c__c = '鎵瑰噯';
- createIdSend.Dealer_Info__c = accountItem1.Id;
- createIdSend.Delivery_detail_count__c = 5;
-
- Consumable_order__c createIdSend1 = new Consumable_order__c();
- createIdSend1.Name = 'testMing1';
- createIdSend1.Order_status__c = '鎵瑰噯';
- createIdSend1.Deliver_date__c = Date.today();
- createIdSend1.RecordTypeid = System.Label.RT_ConOrder_Delivery;
- createIdSend1.Order_type__c = '璁㈠崟';
- createIdSend1.Order_ProType__c = 'ENG';
- createIdSend1.SummonsForDirction__c = '鍖婚櫌璇曠敤';
- createIdSend1.Order_ForDealerText__c = 'Test';
- createIdSend1.Order_ForCustomerText__c = '';
- createIdSend1.SummonsStatus_c__c = '鎵瑰噯';
- createIdSend1.Dealer_Info__c = accountItem1.Id;
- createIdSend1.Delivery_detail_count__c = 5;
-
- Consumable_order__c createIdSend2 = new Consumable_order__c();
- createIdSend2.Name = 'testMing1';
- createIdSend2.Order_status__c = '鎵瑰噯';
- createIdSend2.Deliver_date__c = Date.today();
- createIdSend2.RecordTypeid = System.Label.RT_ConOrder_Delivery;
- createIdSend2.Order_type__c = '璁㈠崟';
- createIdSend2.Order_ProType__c = 'ENG';
- createIdSend2.SummonsForDirction__c = '浜掔浉璋冭揣';
- createIdSend2.Order_ForDealerText__c = '';
- createIdSend2.Order_ForCustomerText__c = 'Test';
- createIdSend2.SummonsStatus_c__c = '鎵瑰噯';
- createIdSend2.Dealer_Info__c = accountItem1.Id;
- createIdSend2.Delivery_detail_count__c = 5;
- insert new Consumable_order__c[] {createIdSend,createIdSend1,createIdSend2};
-
- Consumable_orderdetails__c coc = new Consumable_orderdetails__c();
- coc.Name = 'Too001';
- coc.Dealer_Custom_Price__c = 999.00;
- coc.Consumable_count__c = 3;
- coc.Consumable_product__c = pro1.Id;
- coc.Box_Piece__c = '鐩�';
- coc.isOutPattern__c = true;
- coc.Consumable_order__c = createIdSend.Id;
- coc.Unitprice_To_agency__c = 999.00;
- coc.Delivery_List_RMB__c = 999.00;
- coc.Shipment_Count__c = null;
- coc.RecordTypeid = System.Label.RT_ConOrderDetail1_Order;
- Consumable_orderdetails__c coc2 = new Consumable_orderdetails__c();
- coc2.Name = 'Too001';
- coc2.Dealer_Custom_Price__c = 999.00;
- coc2.Consumable_count__c = 3;
- coc2.Consumable_product__c = pro1.Id;
- coc2.Box_Piece__c = '涓�';
- coc2.isOutPattern__c = true;
- coc2.Consumable_order__c = createIdSend.Id;
- coc2.Unitprice_To_agency__c = 999.00;
- coc2.Delivery_List_RMB__c = 0;
- coc2.Shipment_Count__c = 0;
- coc2.RecordTypeid = System.Label.RT_ConOrderDetail1_Order;
- insert new Consumable_orderdetails__c[]{coc,coc2};
-
- Consumable_order_details2__c conOrderDetail1 = new Consumable_order_details2__c();
- conOrderDetail1.Name = 'OCM_01_001001';
- conOrderDetail1.Consumable_ZS_order__c = createIdSend.Id;
- conOrderDetail1.Consumable_Product__c = pro1.Id;
- conOrderDetail1.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
- conOrderDetail1.Bar_Code__c = '11111';
- conOrderDetail1.Arrive_date__c = Date.today().addDays(1);
- conOrderDetail1.Send_Date__c = null;
- conOrderDetail1.Used_date__c = null;
- conOrderDetail1.Return_date__c = null;
- conOrderDetail1.Consumable_order_minor__c = createIdSend.Id;
- conOrderDetail1.Lose_Flag__c = false;
- conOrderDetail1.Box_Piece__c = '鐩�';
- 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 hospitalprice__c[]{hp1};
-
- 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 Attachment[] {attach};
-
- System.Test.startTest();
- List<LexSummonsCreatController.ConsumableorderdetailsInfoLwc> pageRecordsLwcLwc = new List<LexSummonsCreatController.ConsumableorderdetailsInfoLwc>();
- LexSummonsCreatController.ConsumableorderdetailsInfoLwc c5 = new LexSummonsCreatController.ConsumableorderdetailsInfoLwc();
- c5.check = true;
- c5.hospitalSpecialOffer = true;
- c5.orderdetails1 = coc;
- c5.allnumber = 1999.00;
- pageRecordsLwcLwc.add(c5);
- List<LexSummonsCreatController.ConsumableorderdetailsInfoLwc> pageRecordsList= new List<LexSummonsCreatController.ConsumableorderdetailsInfoLwc>();
- LexSummonsCreatController.ConsumableorderdetailsInfoLwc c8 = new LexSummonsCreatController.ConsumableorderdetailsInfoLwc();
- c8.check = true;
- c8.hospitalSpecialOffer = true;
- c8.orderdetails1 = coc2;
- c8.allnumber = 1999.00;
- pageRecordsList.add(c8);
- List<LexSummonsCreatController.ConsumableorderdetailsInfoLwc> pageRecords = new List<LexSummonsCreatController.ConsumableorderdetailsInfoLwc>();
- LexSummonsCreatController.ConsumableorderdetailsInfoLwc c6 = new LexSummonsCreatController.ConsumableorderdetailsInfoLwc();
- c6.check = false;
- c6.hospitalSpecialOffer = false;
- c6.orderdetails1 = coc;
- c6.allnumber = 1999.00;
- pageRecords.add(c6);
- List<LexSummonsCreatController.ConsumableorderdetailsInfoLwc> pageRecordsLwc = new List<LexSummonsCreatController.ConsumableorderdetailsInfoLwc>();
- LexSummonsCreatController.ConsumableorderdetailsInfoLwc c7 = new LexSummonsCreatController.ConsumableorderdetailsInfoLwc();
- c7.check = true;
- c7.oldCheck = true;
- c7.hospitalSpecialOffer = true;
- c7.orderdetails1 = coc;
- c7.orderdetails2 = conOrderDetail1;
- c7.Prod = pro1;
- c7.Boxnumber = 0.00;
- c7.Piecenumber = 0.00;
- c7.allnumber = 1999.00;
- c7.oldConsumableCount = 1999.00;
- c7.canSelect = true;
- c7.sortBy = true;
- c7.packinglist = 1;
- c7.approbation_No = '';
- c7.expiration_Date = Date.Today();
- c7.boxorpiecein = '';
- c7.boxorpiece = null;
- c7.boxorpieceMap = null;
- c7.concc = null;
- c7.BoxPiece = null;
- c7.hosPro = true;
- pageRecordsLwc.add(c7);
-
- List<LexSummonsCreatController.ConsumableorderdetailsInfo> consumable = new List<LexSummonsCreatController.ConsumableorderdetailsInfo>();
- LexSummonsCreatController.ConsumableorderdetailsInfo codi = new LexSummonsCreatController.ConsumableorderdetailsInfo();
- codi.check = true;
- codi.oldCheck = true;
- codi.hospitalSpecialOffer = true;
- codi.packinglist = 0;
- codi.approbation_No = null;
- codi.expiration_Date = Date.Today();
- codi.boxorpiecein = null;
- codi.orderdetails1 = coc;
- codi.Prod = pro1;
- LexSummonsCreatController.ConsumableorderdetailsInfo codi1 = new LexSummonsCreatController.ConsumableorderdetailsInfo();
- codi1.check = false;
- codi1.oldCheck = true;
- codi1.hospitalSpecialOffer = false;
- codi1.packinglist = 0;
- codi1.approbation_No = null;
- codi1.expiration_Date = Date.Today();
- codi1.boxorpiecein = null;
- codi1.orderdetails1 = coc;
- codi1.Prod = pro1;
- consumable.add(codi);
-
- Integer size = Integer.valueOf(System.Label.orderdetLimitsize);
- String ESetId = createIdSend.Id;
- 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.ConsumableorderdetailsInfo con = new LexSummonsCreatController.ConsumableorderdetailsInfo(attach);
- con.concc = attach;
- con.hospitalSpecialOffer = false;
- con.hosPro = false;
- System.Test.stopTest();
- }
- }
-
- @isTest
- 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);
- insert accountItem1;
- 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);
- 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='鍖椾含');
- insert 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];
- String accountId = thisUserInfo.accountid;
- String accountName = thisUserInfo.Contact.Account.Name;
- String agencyProType = thisUserInfo.UserPro_Type__c;
- String userWorkLocation = thisUserInfo.Work_Location__c;
- thisUserInfo.UserPro_Type__c = '';
- update thisUserInfo;
- 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 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 = '鎵瑰噯';
- createIdSend.Deliver_date__c = Date.today();
- createIdSend.RecordTypeid = System.Label.RT_ConOrder_Delivery;
- createIdSend.Order_type__c = '璁㈠崟';
- createIdSend.Order_ProType__c = 'ENG';
- createIdSend.SummonsForDirction__c = '浜掔浉璋冭揣';
- createIdSend.Order_ForDealerText__c = '';
- createIdSend.Order_ForCustomerText__c = '';
- createIdSend.SummonsStatus_c__c = '';
- createIdSend.Dealer_Info__c = accountItem1.Id;
- createIdSend.Delivery_detail_count__c = 5;
-
- Consumable_order__c createIdSend1 = new Consumable_order__c();
- createIdSend1.Name = 'testMing1';
- createIdSend1.Order_status__c = '鎵瑰噯';
- createIdSend1.Deliver_date__c = Date.today();
- createIdSend1.RecordTypeid = System.Label.RT_ConOrder_Delivery;
- createIdSend1.Order_type__c = '璁㈠崟';
- createIdSend1.Order_ProType__c = 'ENG';
- createIdSend1.SummonsForDirction__c = '浜掔浉璋冭揣';
- createIdSend1.Order_ForDealerText__c = '';
- createIdSend1.Order_ForCustomerText__c = '';
- createIdSend1.SummonsStatus_c__c = '';
- createIdSend1.Arrive_Order__c = createIdSend.Id;
- createIdSend1.Order_ForDealerTextID__c = accountItem1.Id;
- createIdSend1.Dealer_Info__c = accountItem1.Id;
- createIdSend1.Delivery_detail_count__c = 5;
- 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;
- coc.Consumable_count__c = 3;
- coc.Consumable_product__c = pro1.Id;
- coc.Box_Piece__c = '鐩�';
- coc.isOutPattern__c = true;
- coc.Consumable_order__c = createIdSend.Id;
- coc.Unitprice_To_agency__c = 999.00;
- coc.Delivery_List_RMB__c = 999.00;
- coc.Shipment_Count__c = null;
- coc.RecordTypeid = System.Label.RT_ConOrderDetail1_Order;
- Consumable_orderdetails__c coc1 = new Consumable_orderdetails__c();
- coc1.Name = 'Too001';
- coc1.Dealer_Custom_Price__c = 999.00;
- coc1.Consumable_count__c = 3;
- coc1.Consumable_product__c = pro1.Id;
- coc1.Box_Piece__c = '鐩�';
- coc1.isOutPattern__c = true;
- coc1.Consumable_order__c = createIdSend.Id;
- coc1.Unitprice_To_agency__c = 999.00;
- coc1.Delivery_List_RMB__c = null;
- coc1.Shipment_Count__c = 10000;
- coc1.RecordTypeid = System.Label.RT_ConOrderDetail1_Order;
- insert new Consumable_orderdetails__c[]{coc,coc1};
-
- Consumable_order_details2__c conOrderDetail1 = new Consumable_order_details2__c();
- conOrderDetail1.Name = 'OCM_01_001001';
- conOrderDetail1.Consumable_ZS_order__c = createIdSend.Id;
- conOrderDetail1.Consumable_Product__c = pro1.Id;
- conOrderDetail1.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
- conOrderDetail1.Bar_Code__c = '11111';
- conOrderDetail1.Arrive_date__c = Date.today().addDays(1);
- conOrderDetail1.Send_Date__c = null;
- conOrderDetail1.Used_date__c = null;
- conOrderDetail1.Return_date__c = null;
- conOrderDetail1.Consumable_order_minor__c = createIdSend.Id;
- conOrderDetail1.Lose_Flag__c = false;
- conOrderDetail1.Box_Piece__c = '鐩�';
- 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 hospitalprice__c[]{hp1};
-
- Integer size = Integer.valueOf(System.Label.orderdetLimitsize);
- String ESetId = createIdSend.Id;
- String statusEdit = 'Test';
- String arrive = createIdSend.Id;
-
- List<LexSummonsCreatController.ConsumableorderdetailsInfoLwc> pageRecordsLwc = new List<LexSummonsCreatController.ConsumableorderdetailsInfoLwc>();
- LexSummonsCreatController.ConsumableorderdetailsInfoLwc c7 = new LexSummonsCreatController.ConsumableorderdetailsInfoLwc();
- c7.check = true;
- c7.oldCheck = true;
- c7.hospitalSpecialOffer = true;
- c7.orderdetails1 = coc;
- c7.orderdetails2 = conOrderDetail1;
- c7.Prod = pro1;
- c7.Boxnumber = 0.00;
- c7.Piecenumber = 0.00;
- c7.allnumber = 1999.00;
- c7.oldConsumableCount = 1999.00;
- c7.canSelect = true;
- c7.sortBy = true;
- c7.packinglist = 1;
- c7.approbation_No = '';
- c7.expiration_Date = Date.Today();
- c7.boxorpiecein = '';
- c7.boxorpiece = null;
- c7.boxorpieceMap = null;
- c7.concc = null;
- c7.BoxPiece = null;
- c7.hosPro = true;
- pageRecordsLwc.add(c7);
- List<LexSummonsCreatController.ConsumableorderdetailsInfoLwc> pageRecords1 = new List<LexSummonsCreatController.ConsumableorderdetailsInfoLwc>();
- LexSummonsCreatController.ConsumableorderdetailsInfoLwc c8 = new LexSummonsCreatController.ConsumableorderdetailsInfoLwc();
- c8.check = true;
- c8.oldCheck = true;
- c8.hospitalSpecialOffer = true;
- c8.orderdetails1 = coc1;
- c8.orderdetails2 = conOrderDetail1;
- c8.Prod = null;
- c8.Boxnumber = 0.00;
- c8.Piecenumber = 0.00;
- c8.allnumber = 1999.00;
- c8.oldConsumableCount = 1999.00;
- c8.canSelect = true;
- c8.sortBy = true;
- c8.packinglist = 1;
- c8.approbation_No = '';
- c8.expiration_Date = Date.Today();
- c8.boxorpiecein = '';
- c8.boxorpiece = null;
- c8.boxorpieceMap = null;
- c8.concc = null;
- c8.BoxPiece = null;
- c8.hosPro = true;
- pageRecords1.add(c8);
-
- List<LexSummonsCreatController.ConsumableorderdetailsInfo> consumable = new List<LexSummonsCreatController.ConsumableorderdetailsInfo>();
- LexSummonsCreatController.ConsumableorderdetailsInfo codi = new LexSummonsCreatController.ConsumableorderdetailsInfo();
- codi.check = true;
- codi.oldCheck = true;
- codi.hospitalSpecialOffer = true;
- codi.packinglist = 0;
- codi.approbation_No = null;
- codi.expiration_Date = Date.Today();
- codi.boxorpiecein = null;
- codi.orderdetails1 = coc;
- codi.Prod = pro1;
- LexSummonsCreatController.ConsumableorderdetailsInfo codi1 = new LexSummonsCreatController.ConsumableorderdetailsInfo();
- codi1.check = false;
- codi1.oldCheck = true;
- codi1.hospitalSpecialOffer = false;
- codi1.packinglist = 0;
- codi1.approbation_No = null;
- codi1.expiration_Date = Date.Today();
- codi1.boxorpiecein = null;
- codi1.orderdetails1 = coc;
- 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);
- System.Test.stopTest();
- }
- }
-
- 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');
- 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);
- insert accountItem2;
- 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='鍖椾含');
- insert 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];
- String accountId = thisUserInfo.accountid;
- String accountName = thisUserInfo.Contact.Account.Name;
- String agencyProType = thisUserInfo.UserPro_Type__c;
- String userWorkLocation = thisUserInfo.Work_Location__c;
- thisUserInfo.UserPro_Type__c = '';
- update thisUserInfo;
- 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 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 = '鎵瑰噯';
- createIdSend.Deliver_date__c = Date.today();
- createIdSend.RecordTypeid = System.Label.RT_ConOrder_Delivery;
- createIdSend.Order_type__c = '璁㈠崟';
- createIdSend.Order_ProType__c = 'ENG';
- createIdSend.SummonsForDirction__c = '娴嬭瘯0001';
- createIdSend.Order_ForDealerText__c = 'Testaccount003';
- createIdSend.Order_ForCustomerText__c = 'Test000';
- createIdSend.SummonsStatus_c__c = '鎵瑰噯';
- createIdSend.orderPattern__c = 'hospitalorder';
- createIdSend.Dealer_Info__c = accountItem1.Id;
- createIdSend.Delivery_detail_count__c = 5;
-
- Consumable_order__c createIdSend3 = new Consumable_order__c();
- createIdSend3.Name = 'testMing123456';
- createIdSend3.Order_status__c = '鎵瑰噯';
- createIdSend3.Deliver_date__c = Date.today();
- createIdSend3.Arrive_Order__c = createIdSend.Id;
- createIdSend3.RecordTypeid = System.Label.RT_ConOrder_Delivery;
- createIdSend3.Order_type__c = '璁㈠崟';
- createIdSend3.Order_ProType__c = 'ENG';
- createIdSend3.SummonsForDirction__c = '浜掔浉璋冭揣';
- createIdSend3.Order_ForDealerText__c = '';
- createIdSend3.Order_ForCustomerText__c = 'Test001';
- createIdSend3.SummonsStatus_c__c = '鎵瑰噯';
- createIdSend3.Dealer_Info__c = accountItem1.Id;
- createIdSend3.Delivery_detail_count__c = 5;
- //鍒拌揣
- Consumable_order__c createIdArrived = new Consumable_order__c();
- createIdArrived.Name = 'testMing2';
- createIdArrived.Order_status__c = '鎵瑰噯';
- createIdArrived.Deliver_date__c = Date.today();
- createIdArrived.RecordTypeid = System.Label.RT_ConOrder_Arrive;
- createIdArrived.Order_type__c = '璁㈠崟';
- createIdArrived.Order_ProType__c = 'ET';
- createIdArrived.Arrive_Order__c = createIdSend.Id;
- createIdArrived.SummonsStatus_c__c = '宸叉彁浜�';
- createIdArrived.orderPattern__c = 'promotionorder';
- createIdArrived.Dealer_Info__c = accountItem1.Id;
- createIdArrived.Delivery_detail_count__c = 5;
- 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;
- coc.Consumable_count__c = 3;
- coc.Consumable_product__c = pro1.Id;
- coc.Box_Piece__c = '鐩�';
- coc.isOutPattern__c = true;
- coc.Consumable_order__c = createIdSend.Id;
- coc.Unitprice_To_agency__c = 999.00;
- coc.Delivery_List_RMB__c = -999.00;
- coc.Shipment_Count__c = 9999.00;
- coc.RecordTypeid = System.Label.RT_ConOrderDetail1_Order;
-
- Consumable_orderdetails__c coc1 = new Consumable_orderdetails__c();
- coc1.Name = 'Too001';
- coc1.Dealer_Custom_Price__c = 999.00;
- coc1.Consumable_count__c = 3;
- coc1.Consumable_product__c = pro1.Id;
- coc1.Box_Piece__c = '鐩�';
- coc1.isOutPattern__c = true;
- coc1.Consumable_order__c = createIdSend3.Id;
- coc1.Unitprice_To_agency__c = 999.00;
- coc1.Delivery_List_RMB__c = 999.00;
- coc1.Shipment_Count__c = 9999.00;
- coc1.RecordTypeid = System.Label.RT_ConOrderDetail1_Order;
- insert new Consumable_orderdetails__c[]{coc,coc1};
-
- Consumable_order_details2__c conOrderDetail1 = new Consumable_order_details2__c();
- conOrderDetail1.Name = 'OCM_01_001001';
- conOrderDetail1.Consumable_ZS_order__c = createIdSend.Id;
- conOrderDetail1.Consumable_Product__c = pro1.Id;
- conOrderDetail1.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
- conOrderDetail1.Bar_Code__c = '11111';
- conOrderDetail1.Arrive_date__c = Date.today().addDays(1);
- conOrderDetail1.Send_Date__c = null;
- conOrderDetail1.Used_date__c = null;
- conOrderDetail1.Return_date__c = null;
- conOrderDetail1.Consumable_Arrived_order__c = createIdSend.Id;
- conOrderDetail1.Consumable_order_minor__c = createIdSend.Id;
- conOrderDetail1.Lose_Flag__c = false;
- conOrderDetail1.Cancellation_Flag__c = false;
- conOrderDetail1.exchangeOutPattern__c = true;
- conOrderDetail1.Box_Piece__c = '鐩�';
- conOrderDetail1.Sterilization_limit__c = Date.Today();
-
- Consumable_order_details2__c conOrderDetail2 = new Consumable_order_details2__c();
- conOrderDetail2.Name = 'OCM_01_001002';
- conOrderDetail2.Consumable_ZS_order__c = createIdArrived.Id;
- conOrderDetail2.Consumable_Product__c = pro1.Id;
- conOrderDetail2.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
- conOrderDetail2.Bar_Code__c = '22222';
- conOrderDetail2.Arrive_date__c = Date.today().addDays(1);
- conOrderDetail2.Send_Date__c = null;
- conOrderDetail2.Used_date__c = null;
- conOrderDetail2.Return_date__c = null;
- conOrderDetail2.Consumable_Arrived_order__c = createIdArrived.Id;
- conOrderDetail2.Consumable_order_minor__c = createIdArrived.Id;
- conOrderDetail2.Lose_Flag__c = false;
- conOrderDetail2.exchangeOutPattern__c = false;
- conOrderDetail2.Cancellation_Flag__c = false;
- conOrderDetail2.Box_Piece__c = '涓�';
- conOrderDetail2.Sterilization_limit__c = Date.Today();
- 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;
- c6.oldCheck = true;
- c6.hospitalSpecialOffer = true;
- c6.orderdetails1 = coc1;
- c6.orderdetails2 = conOrderDetail1;
- c6.Prod = pro1;
- c6.Boxnumber = 0.00;
- c6.Piecenumber = 0.00;
- c6.allnumber = 1999.00;
- c6.oldConsumableCount = 1999.00;
- c6.canSelect = true;
- c6.sortBy = true;
- c6.packinglist = 1;
- c6.approbation_No = '';
- c6.expiration_Date = Date.Today();
- c6.boxorpiecein = '';
- c6.boxorpiece = null;
- c6.boxorpieceMap = null;
- c6.concc = null;
- c6.BoxPiece = null;
- c6.hosPro = true;
- pageRecords.add(c6);
- List<LexSummonsCreatController.ConsumableorderdetailsInfoLwc> pageRecords1 = new List<LexSummonsCreatController.ConsumableorderdetailsInfoLwc>();
- LexSummonsCreatController.ConsumableorderdetailsInfoLwc c111 = new LexSummonsCreatController.ConsumableorderdetailsInfoLwc();
- c111.check = true;
- c111.oldCheck = true;
- c111.hospitalSpecialOffer = false;
- c111.orderdetails1 = coc1;
- c111.orderdetails2 = conOrderDetail1;
- c111.Prod = pro1;
- c111.Boxnumber = 0.00;
- c111.Piecenumber = 0.00;
- c111.allnumber = 1999.00;
- c111.oldConsumableCount = 1999.00;
- c111.canSelect = true;
- c111.sortBy = true;
- c111.packinglist = 1;
- c111.approbation_No = '';
- c111.expiration_Date = Date.Today();
- c111.boxorpiecein = '';
- c111.boxorpiece = null;
- c111.boxorpieceMap = null;
- c111.concc = null;
- c111.BoxPiece = null;
- c111.hosPro = true;
- pageRecords1.add(c111);
- List<LexSummonsCreatController.ConsumableorderdetailsInfo> consumable = new List<LexSummonsCreatController.ConsumableorderdetailsInfo>();
- LexSummonsCreatController.ConsumableorderdetailsInfo codi = new LexSummonsCreatController.ConsumableorderdetailsInfo();
- codi.check = true;
- codi.hospitalSpecialOffer = true;
- codi.packinglist = 0;
- codi.approbation_No = null;
- codi.expiration_Date = Date.Today();
- codi.boxorpiecein = null;
- codi.orderdetails1 = coc;
- codi.Prod = pro1;
- 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.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);
- List<LexSummonsCreatController.ConsumableorderdetailsInfo> cro = new List<LexSummonsCreatController.ConsumableorderdetailsInfo>();
- 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 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())){
- 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 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;
-
- 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;
- 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';
- 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();
- LexSummonsCreatController.init(Order1.Id, 'edit', 10, 1, '');
- List<LexSummonsCreatController.ConsumableorderdetailsInfoLwc> pList = new List<LexSummonsCreatController.ConsumableorderdetailsInfoLwc>();
- LexSummonsCreatController.ConsumableorderdetailsInfoLwc p = new LexSummonsCreatController.ConsumableorderdetailsInfoLwc();
- p.check = true;
- p.oldcheck = true;
- p.hospitalSpecialOffer = true;
- p.orderdetails1 = Orderdet;
- p.orderdetails2 = Orderdet1;
- p.Prod = pro1;
- p.Boxnumber = 2;
- p.Piecenumber = 2;
- pList.add(p);
- List<LexSummonsCreatController.ConsumableorderdetailsInfo> consumable = new List<LexSummonsCreatController.ConsumableorderdetailsInfo>();
- LexSummonsCreatController.ConsumableorderdetailsInfo codi = new LexSummonsCreatController.ConsumableorderdetailsInfo();
- codi.check = true;
- codi.hospitalSpecialOffer = true;
- codi.packinglist = 0;
- codi.approbation_No = null;
- codi.expiration_Date = Date.Today();
- codi.boxorpiecein = null;
- codi.orderdetails1 = Orderdet;
- codi.orderdetails2 = Orderdet1;
- codi.Prod = pro1;
- 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', '');
- Orderdet.Box_Piece__c = '涓�';
- 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();
- }
- }
-
- @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 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())){
- 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 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;
-
- 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;
- 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';
- 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();
- LexSummonsCreatController.init(Order1.Id, 'edit', 10, 1, '');
- 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 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())){
- 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 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;
-
- 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;
- 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';
- 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();
- LexSummonsCreatController.init('', 'edit', 10, 1, Order1.Id);
- System.Test.stopTest();
- }
- }
-}
->>>>>>> LEXCommunityLiJun
diff --git a/force-app/main/default/classes/LexTopPageControllerTest.cls b/force-app/main/default/classes/LexTopPageControllerTest.cls
index 192063c..a94e855 100644
--- a/force-app/main/default/classes/LexTopPageControllerTest.cls
+++ b/force-app/main/default/classes/LexTopPageControllerTest.cls
@@ -1,21 +1,12 @@
@IsTest
private class LexTopPageControllerTest {
@IsTest
-<<<<<<< HEAD
static void testMethod1() {
User currentUser = [SELECT Id FROM User WHERE Id = :UserInfo.getUserId()];
NoteStay__c n = new NoteStay__c(Name = 'NoteStay', IsStay__c = true);
insert n;
Test.startTest();
System.runAs(currentUser) {
-=======
- static void testMethod1(){
- User currentUser = [SELECT Id FROM User WHERE Id = :UserInfo.getUserId()];
- NoteStay__c n = new NoteStay__c(Name = 'NoteStay',IsStay__c = true);
- insert n;
- Test.startTest();
- System.runAs(currentUser){
->>>>>>> LEXCommunityLiJun
LexTopPageController.initAgency();
LexTopPageController.initPage(20, 1);
}
@@ -23,7 +14,6 @@
}
@IsTest
-<<<<<<< HEAD
static void testMethod2() {
user MyUser_Test;
Account myAccount1;
@@ -31,26 +21,14 @@
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搴�'
- ];
+ 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 = '鐥呴櫌'
- ];
+ 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(
@@ -217,144 +195,6 @@
dataForProductCount5.Box_Piece__c = '鐩�';
conList1.add(dataForProductCount5);
insert conList1;
-=======
- 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);
- 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(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 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 = '鐩�';
- 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(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;
->>>>>>> LEXCommunityLiJun
Test.startTest();
LexTopPageController.initAgency();
LexTopPageController.initPage(20, 1);
@@ -363,7 +203,6 @@
}
@IsTest
-<<<<<<< HEAD
static void testMethod3() {
user MyUser_Test;
Account myAccount1;
@@ -371,26 +210,14 @@
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搴�'
- ];
+ 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 = '鐥呴櫌'
- ];
+ 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(
@@ -556,144 +383,6 @@
dataForProductCount5.Box_Piece__c = '涓�';
conList1.add(dataForProductCount5);
insert conList1;
-=======
- 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);
- 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');
- 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;
-
-
- //璁㈠崟
- 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 = '涓�';
- 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(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;
->>>>>>> LEXCommunityLiJun
Test.startTest();
LexTopPageController.initAgency();
LexTopPageController.initPage(20, 1);
@@ -708,9 +397,4 @@
Test.stopTest();
}
}
-<<<<<<< HEAD
}
-=======
-
-}
->>>>>>> LEXCommunityLiJun
diff --git a/force-app/main/default/classes/LexUpAccountProLimit.cls b/force-app/main/default/classes/LexUpAccountProLimit.cls
index 922903c..37d85bc 100644
--- a/force-app/main/default/classes/LexUpAccountProLimit.cls
+++ b/force-app/main/default/classes/LexUpAccountProLimit.cls
@@ -1,19 +1,12 @@
public without sharing class LexUpAccountProLimit {
@AuraEnabled
-<<<<<<< HEAD
public static ResponseBodyLWC upAccount(String accountId, String productLimit, String userPro_Type) {
ResponseBodyLWC res = new ResponseBodyLWC();
Map<String, object> data = new Map<String, object>();
-=======
- public static ResponseBodyLWC upAccount(String accountId,String productLimit,String userPro_Type){
- ResponseBodyLWC res = new ResponseBodyLWC();
- Map<String,object> data = new Map<String,object>();
->>>>>>> LEXCommunityLiJun
res.entity = data;
//--------AddStart-----XHL--------------20180929-------------
Boolean EngFlag = false;
-<<<<<<< HEAD
Boolean ETFlag = false;
String userPro_Typestr = null;
if (String.isBlank(userPro_Type)) {
@@ -22,22 +15,11 @@
if (userPro_Type == 'ENG') {
EngFlag = true;
} else {
-=======
- Boolean ETFlag = false;
- String userPro_Typestr = null;
- if(String.isBlank(userPro_Type)){
- userPro_Type = 'ET';
- }
- if(userPro_Type == 'ENG'){
- EngFlag = true;
- }else{
->>>>>>> LEXCommunityLiJun
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 + '%';
-<<<<<<< HEAD
//--------AddEnd-----XHL--------------20180929-------------
system.debug('userPro_Type' + userPro_Type);
String checkResoultstr = checkResoult(productLimit);
@@ -59,39 +41,10 @@
if (null == acc || acc.size() == 0) {
// return '娌℃湁缁忛攢鍟嗭細' + accountId + '鐨勬暟鎹��';
return new ResponseBodyLWC('Error', 500, '娌℃湁缁忛攢鍟嗭細' + accountId + '鐨勬暟鎹��', '');
-=======
- //--------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+'', '');
- // return checkResoultstr;
- }
- //String[] proidList =new 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
- FOR UPDATE
- ];
- if(null == acc || acc.size() == 0) {
- // return '娌℃湁缁忛攢鍟嗭細' + accountId + '鐨勬暟鎹��';
- return new ResponseBodyLWC('Error',500,'娌℃湁缁忛攢鍟嗭細' + accountId + '鐨勬暟鎹��', '');
->>>>>>> LEXCommunityLiJun
}
//proidList = acc[0].view_product__c.split(',');
//--------UpdateStart-----XHL--------------20180929-------------
String sql = '';
-<<<<<<< HEAD
List<Product2__c> roduct2List = [
SELECT Asset_Model_No__c, Estimation_Entry_Possibility__c
@@ -191,103 +144,3 @@
}
}
}
-=======
-
- 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 '
- // + ' WHERE Pro2_Dealer_Object__c = true';
- //if(EngFlag){
- // sql += ' AND Pro2_Dealer_ENG__c =' + EngFlag ;
- //}else if(ETFlag){
- // sql += ' AND Pro2_Dealer_Object__c = ' + ETFlag;
- //}
- //system.debug('sqlZZZZZZ' + 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(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');
- break;
- }
- if(!productMap.containsKey(pro_List[i])){
- // return '缁忛攢鍟嗘病鏈� ' + pro_List[i] + ' 鐨勪骇鍝佷笂闄愯瀹氭潈闄愶紝鎴栦骇鍝佷笉瀛樺湪锛�';
- return new ResponseBodyLWC('Error',500,'缁忛攢鍟嗘病鏈� ' + pro_List[i] + ' 鐨勪骇鍝佷笂闄愯瀹氭潈闄愶紝鎴栦骇鍝佷笉瀛樺湪锛�', '');
- }
- }
- String productLimitDa = '';
- for(String str : productLimit.split(',')){
-
- if(str != null && str != ''){
- productLimitDa += ',' + str;
- }
- }
- Savepoint sp = Database.setSavepoint();
- 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);
- }
-
- UPDATE accinfo;
- res.status = 'Success';
- res.code = 200;
- System.debug('res = ' + res);
- return res;
- // return '';
- }catch(DmlException de){
- Database.rollback(sp);
- throw de;
- }
- }
- 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>();
- List<String> asstModelNoCount = new List<String>();
- for(Integer i = 0; i < proLimit.size(); i++){
- nowName = proLimit[i];
- 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])){
- asstModelNoCount.add(asstModelNo[i]);
- }else{
- asstModelNoMap.put(asstModelNo[i], asstModelNo[i]);
- }
- }
- if(asstModelNoCount.size() > 0){
- return '浜у搧锛�' + asstModelNoCount + '鐨勬暟鎹噸澶嶃��';
- // return new ResponseBodyLWC('Error',500,'浜у搧锛�' + asstModelNoCount + '鐨勬暟鎹噸澶嶃��', '');
- }else{
- return '';
- }
- }
-}
->>>>>>> LEXCommunityLiJun
diff --git a/force-app/main/default/classes/LexUpAccountProLimitControllerTest.cls b/force-app/main/default/classes/LexUpAccountProLimitControllerTest.cls
index 144dcf7..8766968 100644
--- a/force-app/main/default/classes/LexUpAccountProLimitControllerTest.cls
+++ b/force-app/main/default/classes/LexUpAccountProLimitControllerTest.cls
@@ -1,21 +1,12 @@
@isTest
-<<<<<<< HEAD
private class LexUpAccountProLimitControllerTest {
@isTest
static void proLimitTest() {
- 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)'
- ];
+ Profile prof = [SELECT Id FROM Profile WHERE Name = '901_缁忛攢鍟嗙ぞ鍖烘櫘閫氭潈闄恄2閲嶉獙璇�(ET)'];
Product2 prod01 = new Product2(
Name = 'Test01',
ProductCode = 'Test01',
@@ -44,11 +35,7 @@
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
- ];
+ 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');
@@ -56,19 +43,11 @@
}
@isTest
static void proLimitTest1() {
- 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)'
- ];
+ Profile prof = [SELECT Id FROM Profile WHERE Name = '901_缁忛攢鍟嗙ぞ鍖烘櫘閫氭潈闄恄2閲嶉獙璇�(ET)'];
Product2 prod01 = new Product2(
Name = 'Test01',
ProductCode = 'Test01',
@@ -119,83 +98,9 @@
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
- ];
+ 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);
}
}
-=======
-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 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');
- // 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搴�'];
- 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 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> 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);
-
- 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);
- }
-}
->>>>>>> LEXCommunityLiJun
diff --git a/force-app/main/default/classes/LexUtilityTest.cls b/force-app/main/default/classes/LexUtilityTest.cls
index 39e618b..445376c 100644
--- a/force-app/main/default/classes/LexUtilityTest.cls
+++ b/force-app/main/default/classes/LexUtilityTest.cls
@@ -1,31 +1,17 @@
@IsTest
private class LexUtilityTest {
@IsTest
-<<<<<<< HEAD
static void testMethod1() {
User currentUser = [SELECT Id FROM User WHERE Id = :UserInfo.getUserId()];
NoteStay__c n = new NoteStay__c(Name = 'NoteStay', IsStay__c = true);
-=======
- static void testMethod1(){
- User currentUser = [SELECT Id FROM User WHERE Id = :UserInfo.getUserId()];
- NoteStay__c n = new NoteStay__c(Name = 'NoteStay',IsStay__c = true);
->>>>>>> LEXCommunityLiJun
insert n;
LicenceReminderDate__c l = new LicenceReminderDate__c(Name = '180Days', ReminderDays__c = 180);
insert l;
Test.startTest();
-<<<<<<< HEAD
System.runAs(currentUser) {
-=======
- System.runAs(currentUser){
->>>>>>> LEXCommunityLiJun
LexUtility.getIsNoteStay();
LexUtility.getLicenceReminderDays();
}
Test.stopTest();
}
-<<<<<<< HEAD
}
-=======
-}
->>>>>>> LEXCommunityLiJun
diff --git a/force-app/main/default/classes/LookupSearchResultTest.cls b/force-app/main/default/classes/LookupSearchResultTest.cls
index 5769e86..8db8dda 100644
--- a/force-app/main/default/classes/LookupSearchResultTest.cls
+++ b/force-app/main/default/classes/LookupSearchResultTest.cls
@@ -1,13 +1,8 @@
@isTest
private class LookupSearchResultTest {
-<<<<<<< HEAD
@testSetup
static void testInfo() {
- 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;
}
@@ -19,12 +14,7 @@
static void testLookupSearchResult() {
String id = '';
String title = '';
- List<Account> account = [
- SELECT Id, Name
- FROM Account
- WHERE Name = 'Account001'
- LIMIT 1
- ];
+ List<Account> account = [SELECT Id, Name FROM Account WHERE Name = 'Account001' LIMIT 1];
for (Account acc : account) {
id = acc.Id;
}
@@ -45,40 +35,3 @@
System.Test.stopTest();
}
}
-=======
- @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');
- insert myAccount2;
- }
-
- @isTest
- static void testLookupSearchResult(){
- String id = '';
- String title = '';
- List<Account> account = [SELECT Id,Name FROM Account WHERE Name = 'Account001' limit 1];
- for(Account acc : account){
- id = acc.Id;
- }
- object compareTo = account;
- LookupSearchResult resultA = new LookupSearchResult(id, 'Account', 'standard:account', 'Account', 'Account');
- 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();
- resultB.compareTo(resultB);
- System.assertEquals(1, account.size(), 'expecting to find 1 Account');
- List<LookupSearchResult> con = new List<LookupSearchResult>();
- con.sort();
- System.Test.stopTest();
- }
-}
->>>>>>> LEXCommunityLiJun
diff --git a/force-app/main/default/classes/NewRepairController.cls b/force-app/main/default/classes/NewRepairController.cls
index 0e54e90..77ce6a1 100644
--- a/force-app/main/default/classes/NewRepairController.cls
+++ b/force-app/main/default/classes/NewRepairController.cls
@@ -1,63 +1,79 @@
/*
- *@Description:
- *@Author: Dennis Rodman
+ *@Description:
+ *@Author: Dennis Rodman
*@Date: 2022-03-10 10:26:47
-*/
+ */
global without sharing class NewRepairController {
- public String layoutSectionsStr {get; set;}//for dynamic add readonly attribute
- public List <LayoutDescriberHelper.LayoutSection > layoutSections{set;get;}
- public String awsToken{set;get;}
+ public String layoutSectionsStr { get; set; } //for dynamic add readonly attribute
+ public List<LayoutDescriberHelper.LayoutSection> layoutSections { get; set; }
+ public String awsToken { get; set; }
public static Map<String, Schema.SObjectType> schemaMap = Schema.getGlobalDescribe();
public static String sobjectTypeValue = 'Repair__c';
- public Boolean isNewMode{set;get;}
- public String rtTypeId {get; set;}
- public String AWSDataId{set;get;}
- public String DecryptAWSDataId{set;get;}
- public String ContactAWSDataId{set;get;}
- public List<String> encryptedAPIList{set;get;}
- public String staticResource {get; set;}
- public String staticResourceContact {get; set;}
- public String staticResourceAddress {get; set;}
- public String requiredFieldAPIListStr {get; set;}
- public String fieldAPIToLabelMapStr {get; set;}
- public String Input_Required_Field_Msg{set;get;}
- public String PIPL_Name_Label{set;get;}
- public String PIPL_Input_Account_Error_Msg{set;get;}
- public String sobjectPrefix{set;get;}
- public String sobjecttypeForFrontEnd{set;get;}
- public String sobjectId{set;get;}
- public String workLocationSelect{set;get;}
- public String RepairSubOrderAWSDataId{set;get;}
- public String staticResourceRepairSubOrder{set;get;}
- public String VLookUpFieldsJson{get;private set;}
+ public Boolean isNewMode { get; set; }
+ public String rtTypeId { get; set; }
+ public String AWSDataId { get; set; }
+ public String DecryptAWSDataId { get; set; }
+ public String ContactAWSDataId { get; set; }
+ public List<String> encryptedAPIList { get; set; }
+ public String staticResource { get; set; }
+ public String staticResourceContact { get; set; }
+ public String staticResourceAddress { get; set; }
+ public String requiredFieldAPIListStr { get; set; }
+ public String fieldAPIToLabelMapStr { get; set; }
+ public String Input_Required_Field_Msg { get; set; }
+ public String PIPL_Name_Label { get; set; }
+ public String PIPL_Input_Account_Error_Msg { get; set; }
+ public String sobjectPrefix { get; set; }
+ public String sobjecttypeForFrontEnd { get; set; }
+ public String sobjectId { get; set; }
+ public String workLocationSelect { get; set; }
+ public String RepairSubOrderAWSDataId { get; set; }
+ public String staticResourceRepairSubOrder { get; set; }
+ public String VLookUpFieldsJson { get; private set; }
//zhj MEBG鏂版柟妗堟敼閫� 2022-11-29 start
- public String staticResourceV2 {get; set;}
+ public String staticResourceV2 { get; set; }
//zhj MEBG鏂版柟妗堟敼閫� 2022-11-29 end
public NewRepairController(ApexPages.StandardController controller) {
- sobjectId = [SELECT CustomObjectId,CustomObjectName FROM CustomObjectUserLicenseMetrics where CustomObjectName ='Repair' limit 1].CustomObjectId;
+ //sobjectId = [SELECT CustomObjectId,CustomObjectName FROM CustomObjectUserLicenseMetrics where CustomObjectName ='Repair' limit 1].CustomObjectId;
+ sobjectId = [SELECT id, QualifiedApiName, DurableId, IsCustomizable FROM EntityDefinition WHERE QualifiedApiName = 'Repair__c']
+ .DurableId;
isNewMode = true;
Input_Required_Field_Msg = Label.Input_Required_Field_Msg;
PIPL_Name_Label = Label.PIPL_Name_Label;
PIPL_Input_Account_Error_Msg = label.PIPL_Input_Account_Error_Msg;
sobjecttypeForFrontEnd = sobjectTypeValue;
//鑾峰彇鎵�鏈夊瓧娈�
- List<String> fieldList = new List<String>(Schema.getGlobalDescribe().get('Repair__c').getDescribe().fields.getMap().keyset());
+ List<String> fieldList = new List<String>(Schema.getGlobalDescribe().get('Repair__c').getDescribe().fields.getMap().keyset());
// Add fields to controller. This is to avoid the SOQL error in visualforce page
- if(!Test.isRunningTest()){
- controller.addFields(fieldList);
+ if (!Test.isRunningTest()) {
+ controller.addFields(fieldList);
}
- SObject obj = controller.getRecord();
- if(obj.Id != null){
+ SObject obj = controller.getRecord();
+ if (obj.Id != null) {
//鏇存柊
isNewMode = false;
- Repair__c repairData = [select Id,RecordTypeId,AWS_Data_Id__c,Address_AWS_Data_Id__c,Contact_AWS_Data_Id__c,Address_Contacts_Encrypt__c,Address_Contacts_Name_Encrypt__c,Address_Telephone_Encrypt__c,Address_ZipCode_Encrypt__c,Detailed_Address_Encrypt__c from Repair__c where id =: obj.Id];
+ Repair__c repairData = [
+ SELECT
+ Id,
+ RecordTypeId,
+ AWS_Data_Id__c,
+ Address_AWS_Data_Id__c,
+ Contact_AWS_Data_Id__c,
+ Address_Contacts_Encrypt__c,
+ Address_Contacts_Name_Encrypt__c,
+ Address_Telephone_Encrypt__c,
+ Address_ZipCode_Encrypt__c,
+ Detailed_Address_Encrypt__c
+ FROM Repair__c
+ WHERE id = :obj.Id
+ ];
rtTypeId = repairData.RecordTypeId;
AWSDataId = repairData.AWS_Data_Id__c;
DecryptAWSDataId = String.valueOf(repairData.Address_AWS_Data_Id__c);
ContactAWSDataId = String.valueOf(repairData.Contact_AWS_Data_Id__c);
- }else{
+ } else {
//鏂板缓
-
+
// //淇悊鍝佽繑閫佸湴
// if(mso.containsKey('00N10000006P6SM')){
// controller.getRecord().put('SalesOfficeCode_selection__c',mso.get('00N10000006P6SM'));
@@ -81,7 +97,7 @@
// String o = mso.get('00N10000008rsVQ');
// controller.getRecord().put('DateReceiptQuestions__c',(String.isBlank(o)||String.isEmpty(o))? null:Date.valueOf(o.replace('/', '-')));
// }
-
+
// //鏄惁鏈夋浜°�佷激瀹炽�佹劅鏌�00N10000008rsW7
// if(mso.containsKey('00N10000008rsW7')){
// controller.getRecord().put('ifDeadHurt__c',mso.get('00N10000008rsW7'));
@@ -157,9 +173,7 @@
// if(mso.containsKey('00N10000006P1dw')){
// controller.getRecord().put('PaperRepairRequestNo__c',mso.get('00N10000006P1dw'));
// }
-
-
-
+
// //甯傚満澶氬勾淇濅慨 鏈夊伩/鏃犲伩淇悊00N10000008rG4p
// if(mso.containsKey('00N10000008rG4p')){
// controller.getRecord().put('RepairCostType__c',mso.get('00N10000008rG4p'));
@@ -183,7 +197,7 @@
// if(mso.containsKey(RepairApplicant)){
// controller.getRecord().put('RepairApplicant__c',mso.get(RepairApplicant));
// }
- // //鎶ヤ慨浜哄尰闄�00N1m0000054ufU
+ // //鎶ヤ慨浜哄尰闄�00N1m0000054ufU
// String RepairApplicantHospital = isTest==true?'00N1m0000054ufU':'00N10000009H1rP';
// if(mso.containsKey(RepairApplicantHospital)){
// controller.getRecord().put('RepairApplicantHospital__c',mso.get(RepairApplicantHospital));
@@ -197,11 +211,11 @@
// String RepairSubOrder = isTest==true?'CF00N1m0000054ufZ_lkid':'CF00N10000009H1rR_lkid';
// if(mso.containsKey(RepairSubOrder)){
// controller.getRecord().put('RepairSubOrder__c',mso.get(RepairSubOrder));
- // //鏌ヨAWSDataId
- // List<RepairSubOrder__c> rso = [select AWS_Data_Id__c from RepairSubOrder__c where Id=:mso.get(RepairSubOrder)];
- // if(rso.size() > 0){
- // RepairSubOrderAWSDataId = rso[0].AWS_Data_Id__c;
- // }
+ // //鏌ヨAWSDataId
+ // List<RepairSubOrder__c> rso = [select AWS_Data_Id__c from RepairSubOrder__c where Id=:mso.get(RepairSubOrder)];
+ // if(rso.size() > 0){
+ // RepairSubOrderAWSDataId = rso[0].AWS_Data_Id__c;
+ // }
// }
// //鎶ヤ慨鍙戣捣鏃�
// String RepairTime = isTest==true?'00N1m0000054ufa':'00N10000009H1rS';
@@ -251,7 +265,7 @@
// String o = mso.get(SubOrderCreatedDate);
// controller.getRecord().put('SubOrderCreatedDate__c',(String.isBlank(o)||String.isEmpty(o))? null:Date.valueOf(o.replace('/', '-')));
// }
-
+
// //閫佷慨鐗╂祦鏂瑰紡00N1m0000054ufE
// if(mso.containsKey('00N1m0000054ufE')){
// controller.getRecord().put('DeliveryLogisticsMode__c',mso.get('00N1m0000054ufE'));
@@ -273,9 +287,9 @@
// controller.getRecord().put('DelayReportReason__c',mso.get('00N10000008rsVS'));
// }
- Map<string,string> mso = ApexPages.currentPage().getParameters();
- system.debug('mso='+mso);
- AssignValueFromUrl(mso,controller.getRecord());
+ Map<string, string> mso = ApexPages.currentPage().getParameters();
+ system.debug('mso=' + mso);
+ AssignValueFromUrl(mso, controller.getRecord());
//閫氳繃id鏌� 闂
//PIPL zhj 2022-11-11 start
//浠庢姤淇瓙鍗曡繃鏉�00N10000009H1rR
@@ -283,8 +297,8 @@
String repairSubOrderId = mso.get('CF00N10000009H1rR_lkid');
System.debug('repairSubOrderId = ' + repairSubOrderId);
//鏌ヨAWSDataId
- List<RepairSubOrder__c> rso = [select AWS_Data_Id__c from RepairSubOrder__c where Id=:repairSubOrderId];
- if(rso.size() > 0){
+ List<RepairSubOrder__c> rso = [SELECT AWS_Data_Id__c FROM RepairSubOrder__c WHERE Id = :repairSubOrderId];
+ if (rso.size() > 0) {
RepairSubOrderAWSDataId = rso[0].AWS_Data_Id__c;
}
}
@@ -294,51 +308,71 @@
if (mso.containsKey('retURL')) {
String RepairId = mso.get('retURL').substring(1);
System.debug('RepairId = ' + RepairId);
- rc = [select Hospital__c,Department_Class__c,Account__c,Dealer__c,Incharge_Staff_Contact__c,Incharge_Staff__c, RepairSubOrder__c,On_Call_ID__c,QIS_ID__c, InsReport__c,Rental_Apply_Equipment_Set_Detail__c from Repair__c where id =:RepairId ];
+ rc = [
+ SELECT
+ Hospital__c,
+ Department_Class__c,
+ Account__c,
+ Dealer__c,
+ Incharge_Staff_Contact__c,
+ Incharge_Staff__c,
+ RepairSubOrder__c,
+ On_Call_ID__c,
+ QIS_ID__c,
+ InsReport__c,
+ Rental_Apply_Equipment_Set_Detail__c
+ FROM Repair__c
+ WHERE id = :RepairId
+ ];
System.debug('rc = ' + rc);
- if(rc.size() > 0){
- //鍖婚櫌
- controller.getRecord().put('Hospital__c',rc[0].Hospital__c);
+ if (rc.size() > 0) {
+ //鍖婚櫌
+ controller.getRecord().put('Hospital__c', rc[0].Hospital__c);
//鎴樼暐绉戝鍒嗙被
- controller.getRecord().put('Department_Class__c',rc[0].Department_Class__c);
+ controller.getRecord().put('Department_Class__c', rc[0].Department_Class__c);
//绉戝
- controller.getRecord().put('Account__c',rc[0].Account__c);
+ controller.getRecord().put('Account__c', rc[0].Account__c);
//缁忛攢鍟嗗悕
- controller.getRecord().put('Dealer__c',rc[0].Dealer__c);
+ controller.getRecord().put('Dealer__c', rc[0].Dealer__c);
//淇悊濮旀墭鑰咃紙鍛樺伐锛�
- controller.getRecord().put('Incharge_Staff_Contact__c',rc[0].Incharge_Staff_Contact__c);
+ controller.getRecord().put('Incharge_Staff_Contact__c', rc[0].Incharge_Staff_Contact__c);
//淇悊濮旀墭鑰�(FSE)
- controller.getRecord().put('Incharge_Staff__c',rc[0].Incharge_Staff__c);
+ controller.getRecord().put('Incharge_Staff__c', rc[0].Incharge_Staff__c);
//鎶ヤ慨瀛愬崟RepairSubOrder__c
- controller.getRecord().put('RepairSubOrder__c',rc[0].RepairSubOrder__c);
+ controller.getRecord().put('RepairSubOrder__c', rc[0].RepairSubOrder__c);
//鏌ヨAWSDataId
- List<RepairSubOrder__c> rso = [select AWS_Data_Id__c from RepairSubOrder__c where Id=:rc[0].RepairSubOrder__c];
- if(rso.size() > 0){
+ List<RepairSubOrder__c> rso = [SELECT AWS_Data_Id__c FROM RepairSubOrder__c WHERE Id = :rc[0].RepairSubOrder__c];
+ if (rso.size() > 0) {
RepairSubOrderAWSDataId = rso[0].AWS_Data_Id__c;
}
//On-Call鍙风爜On_Call_ID__c
- controller.getRecord().put('On_Call_ID__c',rc[0].On_Call_ID__c);
+ controller.getRecord().put('On_Call_ID__c', rc[0].On_Call_ID__c);
//QIS鍙风爜QIS_ID__c
- controller.getRecord().put('QIS_ID__c',rc[0].QIS_ID__c);
+ controller.getRecord().put('QIS_ID__c', rc[0].QIS_ID__c);
//鐐规鎶ュ憡涔nsReport__c
- controller.getRecord().put('InsReport__c',rc[0].InsReport__c);
+ controller.getRecord().put('InsReport__c', rc[0].InsReport__c);
//鍊熷嚭澶囧搧閰嶅涓�瑙堟槑缁哛ental_Apply_Equipment_Set_Detail__c
- controller.getRecord().put('Rental_Apply_Equipment_Set_Detail__c',rc[0].Rental_Apply_Equipment_Set_Detail__c);
+ controller.getRecord().put('Rental_Apply_Equipment_Set_Detail__c', rc[0].Rental_Apply_Equipment_Set_Detail__c);
}
-
}
-
+
rtTypeId = ApexPages.currentPage().getParameters().get('RecordType');
- if(String.isBlank(rtTypeId)||String.isEmpty(rtTypeId)){
- List<RecordType> rtList = new List<RecordType>([select Id,DeveloperName from RecordType where SobjectType ='Repair__c' and DeveloperName ='Repair']);
+ if (String.isBlank(rtTypeId) || String.isEmpty(rtTypeId)) {
+ List<RecordType> rtList = new List<RecordType>(
+ [SELECT Id, DeveloperName FROM RecordType WHERE SobjectType = 'Repair__c' AND DeveloperName = 'Repair']
+ );
rtTypeId = rtList[0].Id;
}
}
- LayoutDescriberHelper.LayoutWrapper LayoutWrapperValue = LayoutDescriberHelper.describeSectionWithFieldsWrapper(rtTypeId, 'Repair__c','classic');
+ LayoutDescriberHelper.LayoutWrapper LayoutWrapperValue = LayoutDescriberHelper.describeSectionWithFieldsWrapper(
+ rtTypeId,
+ 'Repair__c',
+ 'classic'
+ );
layoutSections = LayoutWrapperValue.layoutSections;
layoutSectionsStr = JSON.serialize(layoutSections); //for dynamic add readonly attribute
List<String> requiredFieldAPIList = LayoutWrapperValue.requiredFieldAPIList;
- Map<String,String> fieldAPIToLabelMap = LayoutWrapperValue.fieldAPIToLabelMap;
+ Map<String, String> fieldAPIToLabelMap = LayoutWrapperValue.fieldAPIToLabelMap;
requiredFieldAPIListStr = JSON.serialize(requiredFieldAPIList);
fieldAPIToLabelMapStr = JSON.serialize(fieldAPIToLabelMap);
PIHelper.PIIntegration piIntegration = PIHelper.getPIIntegrationInfo('Repair__c');
@@ -366,33 +400,33 @@
VLookUpFieldsJson = Json.serialize(VLookUpFields);
}
- global class Response{
- public String recordId{set;get;}
- public String message{set;get;}
- public String status{set;get;}
+ global class Response {
+ public String recordId { get; set; }
+ public String message { get; set; }
+ public String status { get; set; }
}
-
+
@RemoteAction
- global static Response EncryptUpdate(string rid){
- system.debug('rid='+rid);
+ global static Response EncryptUpdate(string rid) {
+ system.debug('rid=' + rid);
Response r = new Response();
List<Repair__c> reps = new List<Repair__c>();
- if(Test.isRunningTest()){
- if(rid=='a0J1m000001QqXk'){
- reps.add(new Repair__c(Id='a0J1m000001QqXk',Encrypt_Update_Flag__c=true));
- }else{
- reps.add(new Repair__c(Id='a0J1m000001QqXk',Encrypt_Update_Flag__c=false));
+ if (Test.isRunningTest()) {
+ if (rid == 'a0J1m000001QqXk') {
+ reps.add(new Repair__c(Id = 'a0J1m000001QqXk', Encrypt_Update_Flag__c = true));
+ } else {
+ reps.add(new Repair__c(Id = 'a0J1m000001QqXk', Encrypt_Update_Flag__c = false));
}
- }else{
- reps = [select id,Encrypt_Update_Flag__c from Repair__c where id =:rid];
- }
- if(reps.size()==0){
+ } else {
+ reps = [SELECT id, Encrypt_Update_Flag__c FROM Repair__c WHERE id = :rid];
+ }
+ if (reps.size() == 0) {
r.status = 'failed';
r.message = '绗﹀悎鏉′欢鐨勬暟鎹湭鎵惧埌';
return r;
}
Repair__c rep = reps[0];
- if(!rep.Encrypt_Update_Flag__c){
+ if (!rep.Encrypt_Update_Flag__c) {
r.status = 'success';
r.message = '';
return r;
@@ -400,17 +434,17 @@
//zhj MEBG鏂版柟妗堟敼閫� 2022-11-29 start
//boolean b = AWSServiceTool2.EncryptPushData(new string[]{rid});
System.debug('AWSServiceTool2V2.EncryptPushDataRepair start');
-
+
//AWSServiceTool2V2.EncryptPushDataRepair(rid);
boolean b = false;
- if(!Test.isRunningTest()){
+ if (!Test.isRunningTest()) {
b = AWSServiceTool2V2.EncryptPushDataRepair(rid);
}
//zhj MEBG鏂版柟妗堟敼閫� 2022-11-29 end
rep.Encrypt_Update_Flag__c = false;
- if(!Test.isRunningTest()){
+ if (!Test.isRunningTest()) {
update rep;
- }
+ }
r.status = b ? 'success' : 'failed';
r.message = b ? '' : '鍔犲瘑鎺ㄩ�佸け璐�';
r.recordId = rid;
@@ -418,83 +452,96 @@
}
@RemoteAction
- global static Response saveRepair(String repairJson,String transId,Boolean isNew) {
+ global static Response saveRepair(String repairJson, String transId, Boolean isNew) {
System.debug('Repair__c Info:' + JSON.serialize(repairJson));
//1. Prepare the payload for Repair__c
Schema.SObjectType repairSchema = schemaMap.get(sobjectTypeValue);
Map<String, Schema.SObjectField> fieldAPIToTypeMap = repairSchema.getDescribe().fields.getMap();
- Map<String,Object> fieldValueMap = (Map<String,Object>)JSON.deserializeUntyped(repairJson);
+ Map<String, Object> fieldValueMap = (Map<String, Object>) JSON.deserializeUntyped(repairJson);
Repair__c repairInfo = new Repair__c();
Boolean updateRepairCheck = false;
//鑷畾涔夋牸寮忚浆鎹�
- for (String fieldAPI: fieldValueMap.keySet()) {
- system.debug('field API'+fieldAPI);
- if(!fieldAPIToTypeMap.containskey(fieldAPI)){
+ for (String fieldAPI : fieldValueMap.keySet()) {
+ system.debug('field API' + fieldAPI);
+ if (!fieldAPIToTypeMap.containskey(fieldAPI)) {
continue;
}
- Schema.DisplayType fielddataType = fieldAPIToTypeMap.get(fieldAPI).getDescribe().getType();
- String fieldValue = String.valueOf(fieldValueMap.get(fieldAPI));
- if(String.valueOf(fielddataType)=='DATE'){
- repairInfo.put(fieldAPI,(String.isBlank(fieldValue)||String.isEmpty(fieldValue))? null:Date.valueOf(fieldValue.replace('/', '-')));
- }else if(String.valueOf(fielddataType)=='DATETIME'){
- if(String.isNotBlank(fieldValue)&&fieldValue.contains('T')){
- fieldValue = fieldValue.replace('T',' ');
+ Schema.DisplayType fielddataType = fieldAPIToTypeMap.get(fieldAPI).getDescribe().getType();
+ String fieldValue = String.valueOf(fieldValueMap.get(fieldAPI));
+ if (String.valueOf(fielddataType) == 'DATE') {
+ repairInfo.put(
+ fieldAPI,
+ (String.isBlank(fieldValue) || String.isEmpty(fieldValue)) ? null : Date.valueOf(fieldValue.replace('/', '-'))
+ );
+ } else if (String.valueOf(fielddataType) == 'DATETIME') {
+ if (String.isNotBlank(fieldValue) && fieldValue.contains('T')) {
+ fieldValue = fieldValue.replace('T', ' ');
repairInfo.put(fieldAPI, Datetime.valueOfGmt(fieldValue));
- }else if(String.isNotBlank(fieldValue)) {
+ } else if (String.isNotBlank(fieldValue)) {
fieldValue = fieldValue.replace('/', '-') + ':00';
System.debug('fieldValue = ' + fieldValue);
repairInfo.put(fieldAPI, Datetime.valueOf(fieldValue));
- }else{
+ } else {
repairInfo.put(fieldAPI, null);
}
-
- }else if(String.valueOf(fielddataType)=='PERCENT'||String.valueOf(fielddataType)=='CURRENCY'||String.valueOf(fielddataType)=='Number'||String.valueOf(fielddataType)=='DOUBLE' ){
- repairInfo.put(fieldAPI, (String.isBlank(fieldValue)||String.isEmpty(fieldValue))?null:Decimal.valueOf(fieldValue.replace(',', '')));
- } else if(String.valueof(fielddataType)=='BOOLEAN'){
- //check repair check value
- if(fieldAPI == 'Return_Without_Repair__c'&&Boolean.valueof(fieldValueMap.get(fieldAPI))){
+ } else if (
+ String.valueOf(fielddataType) == 'PERCENT' ||
+ String.valueOf(fielddataType) == 'CURRENCY' ||
+ String.valueOf(fielddataType) == 'Number' ||
+ String.valueOf(fielddataType) == 'DOUBLE'
+ ) {
+ repairInfo.put(
+ fieldAPI,
+ (String.isBlank(fieldValue) || String.isEmpty(fieldValue)) ? null : Decimal.valueOf(fieldValue.replace(',', ''))
+ );
+ } else if (String.valueof(fielddataType) == 'BOOLEAN') {
+ //check repair check value
+ if (fieldAPI == 'Return_Without_Repair__c' && Boolean.valueof(fieldValueMap.get(fieldAPI))) {
updateRepairCheck = true;
}
repairInfo.put(fieldAPI, fieldValueMap.get(fieldAPI));
- }else {
+ } else {
repairInfo.put(fieldAPI, String.valueOf(fieldValueMap.get(fieldAPI)));
- }
+ }
}
//2. Save Record Process
- String status = 'success';
+ String status = 'success';
Response resp = new Response();
Savepoint sp = Database.setSavepoint();
String rid = '';
- try{
+ try {
System.debug('abcde');
- if(isNew){
+ if (isNew) {
System.debug('repairInfozhj = ' + repairInfo);
insert repairInfo;
- }else{
+ } else {
System.debug('into update');
- String awsDataId = (String)repairInfo.get('AWS_Data_Id__c');
+ String awsDataId = (String) repairInfo.get('AWS_Data_Id__c');
System.debug('awsDataId = ' + awsDataId);
- Repair__c[] repairs = [select id,Return_Without_Repair_Reason__c,SAP_Transfer_time__c from Repair__c where AWS_Data_Id__c =:awsDataId];
- if(!updateRepairCheck){
- repairInfo.put('Return_Without_Repair_Reason__c',repairs[0].Return_Without_Repair_Reason__c);
+ Repair__c[] repairs = [
+ SELECT id, Return_Without_Repair_Reason__c, SAP_Transfer_time__c
+ FROM Repair__c
+ WHERE AWS_Data_Id__c = :awsDataId
+ ];
+ if (!updateRepairCheck) {
+ repairInfo.put('Return_Without_Repair_Reason__c', repairs[0].Return_Without_Repair_Reason__c);
}
- if(repairs!=null&&repairs[0]!=null){
- repairInfo.put('SAP_Transfer_time__c',repairs[0].SAP_Transfer_time__c);
+ if (repairs != null && repairs[0] != null) {
+ repairInfo.put('SAP_Transfer_time__c', repairs[0].SAP_Transfer_time__c);
}
System.debug('repairs[0].id = ' + repairs[0].id);
- repairInfo.put('Id',repairs[0].id);//For testing;
+ repairInfo.put('Id', repairs[0].id); //For testing;
update repairInfo;
}
- rid=repairInfo.Id;
- PIHelper.saveTransLog(sobjectTypeValue,(String)repairInfo.get('AWS_Data_Id__c'),rid,transId, repairJson ,status,'');
+ rid = repairInfo.Id;
+ PIHelper.saveTransLog(sobjectTypeValue, (String) repairInfo.get('AWS_Data_Id__c'), rid, transId, repairJson, status, '');
resp.recordId = repairInfo.Id;
resp.message = '';
resp.status = status;
System.debug('resp from sfdx back-end' + resp);
return resp;
-
- } catch(DmlException e) {
- rid=repairInfo.Id;
+ } catch (DmlException e) {
+ rid = repairInfo.Id;
Integer index = 0;
System.debug(e.getNumDml());
System.debug(e.getDmlFields(index));
@@ -503,60 +550,88 @@
System.debug(e.getDmlMessage(index));
System.debug(e.getDmlStatusCode(index));
System.debug(e.getDmlType(index));
- system.debug(e.getMessage());
+ system.debug(e.getMessage());
system.debug(e.getStackTraceString());
- System.debug('into catch'+e.getMessage());
+ System.debug('into catch' + e.getMessage());
Database.rollback(sp);
resp.status = 'Exception';
- resp.message ='淇濆瓨澶辫触锛屽師鍥�:'+ e.getDmlMessage(index);
- PIHelper.saveTransLog(sobjectTypeValue,(String)repairInfo.get('AWS_Data_Id__c'),rid,transId, repairJson ,status,e.getMessage()+e.getStackTraceString());
+ resp.message = '淇濆瓨澶辫触锛屽師鍥�:' + e.getDmlMessage(index);
+ PIHelper.saveTransLog(
+ sobjectTypeValue,
+ (String) repairInfo.get('AWS_Data_Id__c'),
+ rid,
+ transId,
+ repairJson,
+ status,
+ e.getMessage() + e.getStackTraceString()
+ );
return resp;
-
- } catch(Exception e) {
- System.debug('into catch'+e.getMessage());
+ } catch (Exception e) {
+ System.debug('into catch' + e.getMessage());
Database.rollback(sp);
status = 'fail';
- PIHelper.saveTransLog(sobjectTypeValue,(String)repairInfo.get('AWS_Data_Id__c'),rid,transId, repairJson ,status,e.getMessage()+e.getStackTraceString());
- resp.message = e.getMessage();
+ PIHelper.saveTransLog(
+ sobjectTypeValue,
+ (String) repairInfo.get('AWS_Data_Id__c'),
+ rid,
+ transId,
+ repairJson,
+ status,
+ e.getMessage() + e.getStackTraceString()
+ );
+ resp.message = e.getMessage();
resp.status = status;
return resp;
}
}
// 浠巙rl鍙傛暟璧嬪�煎埌褰撳墠椤甸潰
- public static void AssignValueFromUrl(Map<string,string> mso, sobject sobj){
-
+ public static void AssignValueFromUrl(Map<string, string> mso, sobject sobj) {
String sobject_name = sobj.getSObjectType().getDescribe().getName();
- Map<string,object> temp = new Map<string,object>();
- Map<string,FieldDefinition> fdm = new Map<string,FieldDefinition>();
- List<FieldDefinition> fds = [SELECT Id, DurableId, QualifiedApiName,ValueTypeId , EntityDefinitionId, NamespacePrefix,EntityDefinition.NamespacePrefix, DeveloperName, MasterLabel, Label FROM FieldDefinition where EntityDefinition.QualifiedApiName = :sobject_name];
- for(FieldDefinition fd : fds){
+ Map<string, object> temp = new Map<string, object>();
+ Map<string, FieldDefinition> fdm = new Map<string, FieldDefinition>();
+ List<FieldDefinition> fds = [
+ SELECT
+ Id,
+ DurableId,
+ QualifiedApiName,
+ ValueTypeId,
+ EntityDefinitionId,
+ NamespacePrefix,
+ EntityDefinition.NamespacePrefix,
+ DeveloperName,
+ MasterLabel,
+ Label
+ FROM FieldDefinition
+ WHERE EntityDefinition.QualifiedApiName = :sobject_name
+ ];
+ for (FieldDefinition fd : fds) {
//system.debug(fd.DurableId);
- fdm.put(fd.DurableId.split('\\.')[1],fd);
+ fdm.put(fd.DurableId.split('\\.')[1], fd);
}
-
- for(string key : mso.keySet()){
+
+ for (string key : mso.keySet()) {
if (key.toLowerCase() == 'id') {
System.debug('skip id assign');
continue;
}
string new_key = key;
- system.debug('new_key='+new_key);
- if(new_key.contains('_lkid')){
+ system.debug('new_key=' + new_key);
+ if (new_key.contains('_lkid')) {
new_key = new_key.replace('_lkid', '');
new_key = new_key.substring(2);
- }else{
- if(temp.containsKey(new_key)){
+ } else {
+ if (temp.containsKey(new_key)) {
continue;
}
}
-
- system.debug('now new_key='+new_key);
- if(fdm.containsKey(new_key)){
- system.debug('fdm.get(new_key)='+fdm.get(new_key));
+
+ system.debug('now new_key=' + new_key);
+ if (fdm.containsKey(new_key)) {
+ system.debug('fdm.get(new_key)=' + fdm.get(new_key));
string val_str = mso.get(key);
- system.debug('val_str='+val_str);
+ system.debug('val_str=' + val_str);
/*鏃犻渶鍋歞ecode锛宻f鍐呴儴宸茬粡鍋氬ソ
try{
val_str = EncodingUtil.urlDecode(mso.get(key),'UTF-8');
@@ -564,82 +639,81 @@
continue;
system.debug('Exception from get Key:'+e.getMessage());
system.debug(e.getStackTraceString());
- } */
+ } */
object val = null;
string type_id = fdm.get(new_key).ValueTypeId;
// address, boolean, date, datetime, double, id, location, string, time
- if(string.isBlank(val_str)){
+ if (string.isBlank(val_str)) {
val = null;
- }else if(type_id == 'boolean'){
- if(val_str == '1'){
+ } else if (type_id == 'boolean') {
+ if (val_str == '1') {
val = true;
- }else{
+ } else {
val = boolean.valueOf(val_str);
}
- }else if(type_id == 'date'){
+ } else if (type_id == 'date') {
//
- try{
+ try {
val = date.parse(val_str);
- }catch(Exception e){
- system.debug('val_str='+val_str);
+ } catch (Exception e) {
+ system.debug('val_str=' + val_str);
system.debug(e.getMessage());
system.debug(e.getStackTraceString());
- try{
+ try {
val = date.valueOf(val_str);
- }catch(Exception ee){
- system.debug('val_str='+val_str);
+ } catch (Exception ee) {
+ system.debug('val_str=' + val_str);
system.debug(ee.getMessage());
system.debug(ee.getStackTraceString());
continue;
}
}
- }else if(type_id == 'datetime'){
+ } else if (type_id == 'datetime') {
//
- try{
+ try {
val = datetime.parse(val_str);
- }catch(Exception e){
- system.debug('val_str='+val_str);
+ } catch (Exception e) {
+ system.debug('val_str=' + val_str);
system.debug(e.getMessage());
system.debug(e.getStackTraceString());
- try{
+ try {
val = datetime.valueOf(val_str);
- }catch(Exception ee){
- system.debug('val_str='+val_str);
+ } catch (Exception ee) {
+ system.debug('val_str=' + val_str);
system.debug(ee.getMessage());
system.debug(ee.getStackTraceString());
continue;
}
}
- }else if(type_id == 'double' || type_id == 'number'){
- try{
+ } else if (type_id == 'double' || type_id == 'number') {
+ try {
val = decimal.valueOf(val_str.replace(',', ''));
- }catch(Exception ee){
- system.debug('val_str='+val_str);
+ } catch (Exception ee) {
+ system.debug('val_str=' + val_str);
system.debug(ee.getMessage());
system.debug(ee.getStackTraceString());
continue;
}
-
- }else if(type_id == 'id' || type_id == 'string'){
+ } else if (type_id == 'id' || type_id == 'string') {
val = val_str;
- }else{
- system.debug('type_id='+type_id+' is not support to convert');
+ } else {
+ system.debug('type_id=' + type_id + ' is not support to convert');
continue;
}
- temp.put(fdm.get(new_key).QualifiedApiName,val);
- }else{
- system.debug(key+' is not in fdm');
+ temp.put(fdm.get(new_key).QualifiedApiName, val);
+ } else {
+ system.debug(key + ' is not in fdm');
}
}
-
- for(string key : temp.keySet()){
- system.debug('assign '+key+'='+temp.get(key));
- try{
+
+ for (string key : temp.keySet()) {
+ system.debug('assign ' + key + '=' + temp.get(key));
+ try {
sobj.put(key, temp.get(key));
- }catch(Exception e){
+ } catch (Exception e) {
system.debug(e.getMessage());
system.debug(e.getStackTraceString());
}
}
}
-}
\ No newline at end of file
+}
diff --git a/force-app/main/default/classes/ResponseBodyLWCTest.cls b/force-app/main/default/classes/ResponseBodyLWCTest.cls
index 9d07184..e4ba53d 100644
--- a/force-app/main/default/classes/ResponseBodyLWCTest.cls
+++ b/force-app/main/default/classes/ResponseBodyLWCTest.cls
@@ -2,14 +2,7 @@
public class ResponseBodyLWCTest {
static testMethod void test1() {
ResponseBodyLWC l1 = new ResponseBodyLWC();
-<<<<<<< HEAD
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>());
- }
-}
->>>>>>> LEXCommunityLiJun
diff --git a/force-app/main/default/classes/lexSearchAgencyHospitalControllerTest.cls b/force-app/main/default/classes/lexSearchAgencyHospitalControllerTest.cls
index f022ac8..41cad30 100644
--- a/force-app/main/default/classes/lexSearchAgencyHospitalControllerTest.cls
+++ b/force-app/main/default/classes/lexSearchAgencyHospitalControllerTest.cls
@@ -1,26 +1,17 @@
@isTest
private class lexSearchAgencyHospitalControllerTest {
@isTest
-<<<<<<< HEAD
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搴�'
- ];
+ 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 Email)'];
Product2 prod02 = new Product2(
Name = 'Test02181',
ProductCode = 'Test0218',
@@ -54,42 +45,15 @@
UserPro_Type__c = 'ENG',
Work_Location__c = '鍖椾含'
);
-=======
- 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搴�'];
- 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);
- insert pro2;
- 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);
- 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='鍖椾含');
->>>>>>> LEXCommunityLiJun
insert myUser_test;
myUser_test.UserPro_Type__c = '';
update myUser_test;
}
-<<<<<<< HEAD
System.runAs(MyUser_Test) {
-=======
- System.runAs(MyUser_Test){
->>>>>>> LEXCommunityLiJun
System.Test.startTest();
String accountId = myUser_test.accountid;
String agencyProType = myUser_test.UserPro_Type__c;
String searchName = '';
-<<<<<<< HEAD
List<Agency_Hospital_Link__c> ahlInfo = [
SELECT Hospital__c, Hospital__r.Name
FROM Agency_Hospital_Link__c
@@ -119,29 +83,3 @@
}
}
}
-=======
- 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){
- whoIds.add(ahl.Hospital__c);
- 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<String, object> data = new Map<String, object>();
- data.put('accInfo',accInfo);
- String ctype = 'ET';
- lexSearchAgencyHospitalController.init(ctype);
- lexSearchAgencyHospitalController.serContact(searchName,ctype);
- System.Test.stopTest();
- }
- }
-}
->>>>>>> LEXCommunityLiJun
diff --git a/force-app/main/default/lwc/customAccountUrlComp/customAccountUrlComp.html b/force-app/main/default/lwc/customAccountUrlComp/customAccountUrlComp.html
index e8fd634..c38ec0a 100644
--- a/force-app/main/default/lwc/customAccountUrlComp/customAccountUrlComp.html
+++ b/force-app/main/default/lwc/customAccountUrlComp/customAccountUrlComp.html
@@ -1,6 +1,5 @@
<template>
<template if:false={isDisable}>
-<<<<<<< HEAD
<lightning-formatted-url
value={accountUrl}
label={accountName}
@@ -9,11 +8,3 @@
</template>
<template if:true={isDisable}> {accountName} </template>
</template>
-=======
- <lightning-formatted-url value={accountUrl} label={accountName} target="_blank"></lightning-formatted-url>
- </template>
- <template if:true={isDisable}>
- {accountName}
- </template>
-</template>
->>>>>>> LEXCommunityLiJun
diff --git a/force-app/main/default/lwc/customAccountUrlComp/customAccountUrlComp.js b/force-app/main/default/lwc/customAccountUrlComp/customAccountUrlComp.js
index b175148..f7c9bad 100644
--- a/force-app/main/default/lwc/customAccountUrlComp/customAccountUrlComp.js
+++ b/force-app/main/default/lwc/customAccountUrlComp/customAccountUrlComp.js
@@ -1,29 +1,15 @@
-<<<<<<< HEAD
import { LightningElement, api } from 'lwc';
-=======
-import { LightningElement,api } from 'lwc';
->>>>>>> LEXCommunityLiJun
export default class CustomAccountUrlComp extends LightningElement {
@api accountName;
@api accountUrl;
@api isDisable;
-<<<<<<< HEAD
connectedCallback() {
console.log('zhj');
console.log('杩涘叆CustomAccountUrlComp');
-=======
- connectedCallback(){
- console.log('zhj')
- console.log('杩涘叆CustomAccountUrlComp')
->>>>>>> LEXCommunityLiJun
console.log('accountName = ' + this.accountName);
console.log('accountUrl = ' + this.accountUrl);
console.log('isDisable = ' + this.isDisable);
}
-<<<<<<< HEAD
}
-=======
-}
->>>>>>> LEXCommunityLiJun
diff --git a/force-app/main/default/lwc/customDeleteReasonComp/customDeleteReasonComp.html b/force-app/main/default/lwc/customDeleteReasonComp/customDeleteReasonComp.html
index e6e1c1d..ab51f15 100644
--- a/force-app/main/default/lwc/customDeleteReasonComp/customDeleteReasonComp.html
+++ b/force-app/main/default/lwc/customDeleteReasonComp/customDeleteReasonComp.html
@@ -1,12 +1,7 @@
<template>
-<<<<<<< HEAD
<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>
->>>>>>> LEXCommunityLiJun
diff --git a/force-app/main/default/lwc/customMydrComp/customMydrComp.html b/force-app/main/default/lwc/customMydrComp/customMydrComp.html
index 778abb0..e57cc8b 100644
--- a/force-app/main/default/lwc/customMydrComp/customMydrComp.html
+++ b/force-app/main/default/lwc/customMydrComp/customMydrComp.html
@@ -1,5 +1,4 @@
<template>
-<<<<<<< HEAD
<lightning-input
type="checkbox"
label="浠匨yDr"
@@ -9,8 +8,3 @@
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>
->>>>>>> LEXCommunityLiJun
diff --git a/force-app/main/default/lwc/customMydrComp/customMydrComp.js b/force-app/main/default/lwc/customMydrComp/customMydrComp.js
index 53ff28f..9e58427 100644
--- a/force-app/main/default/lwc/customMydrComp/customMydrComp.js
+++ b/force-app/main/default/lwc/customMydrComp/customMydrComp.js
@@ -1,32 +1,16 @@
-<<<<<<< HEAD
import { LightningElement, track, api } from 'lwc';
-=======
-import { LightningElement,track,api } from 'lwc';
->>>>>>> LEXCommunityLiJun
export default class CustomMydrComp extends LightningElement {
@api recordId;
@api isCheckedMyDr;
-<<<<<<< HEAD
connectedCallback() {
-=======
- connectedCallback(){
->>>>>>> LEXCommunityLiJun
console.log('this.recordId = ' + this.recordId);
console.log('this.isCheckedMyDr = ' + this.isCheckedMyDr);
}
-<<<<<<< HEAD
dataChange(event) {
this.isCheckedMyDr = event.target.checked;
console.log('this.isCheckedMyDr = ' + this.isCheckedMyDr);
}
}
-=======
- dataChange(event){
- this.isCheckedMyDr = event.target.checked;
- console.log('this.isCheckedMyDr = ' + this.isCheckedMyDr);
- }
-}
->>>>>>> LEXCommunityLiJun
diff --git a/force-app/main/default/lwc/lexArriveGoods/lexArriveGoods.html b/force-app/main/default/lwc/lexArriveGoods/lexArriveGoods.html
index 61fa4e7..fbf59ea 100644
--- a/force-app/main/default/lwc/lexArriveGoods/lexArriveGoods.html
+++ b/force-app/main/default/lwc/lexArriveGoods/lexArriveGoods.html
@@ -98,12 +98,8 @@
</div>
</td>
<td style="width: 200px">
-<<<<<<< HEAD
<lightning-formatted-text
style="font-size: 16px"
-=======
- <lightning-formatted-text style="font-size: 16px;"
->>>>>>> LEXCommunityLiJun
value={coc.Name}
></lightning-formatted-text>
</td>
@@ -119,12 +115,8 @@
</div>
</td>
<td style="width: 100px">
-<<<<<<< HEAD
<lightning-formatted-number
style="font-size: 16px"
-=======
- <lightning-formatted-number style="font-size: 16px;"
->>>>>>> LEXCommunityLiJun
value={coc.Total_num__c}
></lightning-formatted-number>
</td>
@@ -140,12 +132,8 @@
</div>
</td>
<td style="width: 100px">
-<<<<<<< HEAD
<lightning-formatted-number
style="font-size: 16px"
-=======
- <lightning-formatted-number style="font-size: 16px;"
->>>>>>> LEXCommunityLiJun
value={coc.OrderNumber_arrived__c}
></lightning-formatted-number>
</td>
@@ -161,12 +149,8 @@
</div>
</td>
<td style="width: 100px">
-<<<<<<< HEAD
<lightning-formatted-number
style="font-size: 16px"
-=======
- <lightning-formatted-number style="font-size: 16px;"
->>>>>>> LEXCommunityLiJun
value={coc.OrderNumber_notarrive__c}
></lightning-formatted-number>
</td>
@@ -474,8 +458,4 @@
</div>
</div>
</template>
-<<<<<<< HEAD
</template>
-=======
-</template>
->>>>>>> LEXCommunityLiJun
diff --git a/force-app/main/default/lwc/lexArriveGoods/lexArriveGoods.js b/force-app/main/default/lwc/lexArriveGoods/lexArriveGoods.js
index ae5f214..73304b7 100644
--- a/force-app/main/default/lwc/lexArriveGoods/lexArriveGoods.js
+++ b/force-app/main/default/lwc/lexArriveGoods/lexArriveGoods.js
@@ -370,7 +370,6 @@
console.error('Error loading custom styles');
});
}
-<<<<<<< HEAD
}
//鍒濆鍖�
@@ -909,543 +908,3 @@
// this.dispatchEvent(evt);
}
}
-=======
- }
-
- //鍒濆鍖�
- connectedCallback() {
- init({ arrType: this.arrType, eSetId: this.eSetId })
- .then((result) => {
- this.isNoteStay = result.isNoteStay;
- this.arrController = result.arrGoodCon;
- console.log('this.arrController:' + this.arrController);
- if (result.result == 'Success') {
- this.saveFLGbln = result.saveFLGbln;
- this.returnFLGbln = result.returnFLGbln;
- this.coc = result.coc;
- this.cocId = result.coc.Id;
- this.warningMsgs = result.warningMsgList;
- this.errorMsgs = result.errorMsgList;
- this.showSpinner = false;
- this.showPage = true;
- } else {
- this.warningMsgs = result.warningMsgList;
- this.errorMsgs = result.errorMsgList;
- this.showSpinner = false;
- this.showPage = true;
- console.log('error:' + result.errorMsg);
- this.showMyToast(
- '鍒濆鍖栭〉闈㈠け璐�',
- result.errorMsg,
- 'error'
- );
- }
- })
- .catch((error) => {
- this.showSpinner = false;
- this.showPage = true;
- console.log('error:' + JSON.stringify(error));
- this.showMyToast(
- '鍒濆鍖栭〉闈㈠け璐�',
- JSON.stringify(error),
- 'error'
- );
- });
- }
-
- //barcode change
- barcodeChange(event) {
- this.barcode = event.detail.value;
- }
-
- //鏍规嵁barcode鎼滅储
- barcodeEntrys() {
- this.showSpinner = true;
- searchProduct({
- barcode: this.barcode,
- arrControllerStr: this.arrController
- })
- .then((result) => {
- this.arrController = result.arrGoodCon;
- if (result.result == 'Success') {
- this.saveFLGbln = result.saveFLGbln;
- this.returnFLGbln = result.returnFLGbln;
- this.coc = result.coc;
- this.warningMsgs = result.warningMsgList;
- this.errorMsgs = result.errorMsgList;
- this.consumableInventory = result.consumableInventory;
- this.detailsSummary = result.detailsSummary;
- for (var i in this.detailsSummary) {
- if (this.detailsSummary[i].Prod != null) {
- this.detailsSummary[i]['recordId'] =
- this.detailsSummary[i].Prod.Id;
- this.detailsSummary[i]['assetModelNo'] =
- this.detailsSummary[i].Prod.Asset_Model_No__c;
- this.detailsSummary[i]['prodName'] =
- this.detailsSummary[i].Prod.Name__c;
- }
- }
- console.log(
- 'this.detailsSummary:' +
- JSON.stringify(this.detailsSummary)
- );
- this.consumableorderdetailsRecords =
- result.consumableorderdetailsRecords;
- var consumableorderdetailsRecordsview = [];
- for (var i in this.consumableorderdetailsRecords) {
- this.consumableorderdetailsRecords[i]['dataType'] =
- 'DataileRecords';
- consumableorderdetailsRecordsview.push(
- this.consumableorderdetailsRecords[i]
- );
- }
- for (var i in this.consumableInventory) {
- this.consumableInventory[i]['dataType'] = 'Inventory';
- consumableorderdetailsRecordsview.push(
- this.consumableInventory[i]
- );
- }
- this.consumableorderdetailsRecordsview =
- consumableorderdetailsRecordsview;
- for (var i in this.consumableorderdetailsRecordsview) {
- if (
- this.consumableorderdetailsRecordsview[i].Prod !=
- null
- ) {
- this.consumableorderdetailsRecordsview[i][
- 'recordId'
- ] =
- this.consumableorderdetailsRecordsview[
- i
- ].Prod.Id;
- this.consumableorderdetailsRecordsview[i][
- 'prodName'
- ] =
- this.consumableorderdetailsRecordsview[
- i
- ].Prod.Name__c;
- }
- if (
- this.consumableorderdetailsRecordsview[i][
- 'dataType'
- ] == 'Inventory'
- ) {
- this.consumableorderdetailsRecordsview[i][
- 'barCode'
- ] =
- this.consumableorderdetailsRecordsview[
- i
- ].barCodeNo;
- } else if (
- this.consumableorderdetailsRecordsview[i].esd !=
- null
- ) {
- this.consumableorderdetailsRecordsview[i][
- 'barCode'
- ] =
- this.consumableorderdetailsRecordsview[
- i
- ].esd.Bar_Code__c;
- }
- if (
- this.consumableorderdetailsRecordsview[i].esd !=
- null
- ) {
- this.consumableorderdetailsRecordsview[i][
- 'productPackingListManual'
- ] =
- this.consumableorderdetailsRecordsview[
- i
- ].esd.ProductPacking_list_manual__c;
- this.consumableorderdetailsRecordsview[i][
- 'status'
- ] =
- this.consumableorderdetailsRecordsview[
- i
- ].esd.CFDA_Status__c;
- this.consumableorderdetailsRecordsview[i][
- 'reportProductApprobation'
- ] =
- this.consumableorderdetailsRecordsview[
- i
- ].esd.Report_Product_Approbation__c;
- }
- }
- console.log(
- 'len1:' + this.consumableorderdetailsRecords.length
- );
- console.log(
- 'len2:' + this.consumableorderdetailsRecordsview.length
- );
- console.log(
- 'this.consumableorderdetailsRecordsview:' +
- JSON.stringify(
- this.consumableorderdetailsRecordsview
- )
- );
- this.showGoodsofReturnList = result.showGoodsofReturnList;
- var showGoodsofReturnListView = [];
- for (var i in this.showGoodsofReturnList) {
- this.showGoodsofReturnList[i]['dataType'] =
- 'GoodsoOfReturn';
- showGoodsofReturnListView.push(
- this.showGoodsofReturnList[i]
- );
- }
- for (var i in this.consumableInventory) {
- this.consumableInventory[i]['dataType'] = 'Inventory';
- showGoodsofReturnListView.push(
- this.consumableInventory[i]
- );
- }
- this.showGoodsofReturnListView = showGoodsofReturnListView;
- for (var i in this.showGoodsofReturnListView) {
- if (this.showGoodsofReturnListView[i].Prod != null) {
- this.showGoodsofReturnListView[i]['prodName'] =
- this.showGoodsofReturnListView[i].Prod.Name__c;
- }
- if (
- this.showGoodsofReturnListView[i]['dataType'] ==
- 'Inventory'
- ) {
- this.showGoodsofReturnListView[i]['barCode'] =
- this.showGoodsofReturnListView[i].barCodeNo;
- } else if (
- this.showGoodsofReturnListView[i].esd != null
- ) {
- this.showGoodsofReturnListView[i]['barCode'] =
- this.showGoodsofReturnListView[
- i
- ].esd.Bar_Code__c;
- }
- if (this.showGoodsofReturnListView[i].esd != null) {
- if (
- this.showGoodsofReturnListView[i].esd
- .Consumable_Shipment_order__c != '' &&
- this.showGoodsofReturnListView[i].esd
- .Consumable_Shipment_order__c != null
- ) {
- this.showGoodsofReturnListView[i]['recordId'] =
- this.showGoodsofReturnListView[
- i
- ].esd.Consumable_Shipment_order__c;
- this.showGoodsofReturnListView[i]['orderUrl'] =
- '/lexsummonscreat?ESetid=' +
- this.showGoodsofReturnListView[i].esd
- .Consumable_Shipment_order__c;
- this.showGoodsofReturnListView[i]['orderNo'] =
- this.showGoodsofReturnListView[
- i
- ].esd.Consumable_Shipment_order__r.Name;
- } else if (
- this.showGoodsofReturnListView[i].esd
- .Consumable_Sale_order__c != '' &&
- this.showGoodsofReturnListView[i].esd
- .Consumable_Sale_order__c != null
- ) {
- this.showGoodsofReturnListView[i]['recordId'] =
- this.showGoodsofReturnListView[
- i
- ].esd.Consumable_Sale_order__c;
- this.showGoodsofReturnListView[i]['orderUrl'] =
- '/lexsummonscreat?ESetid=' +
- this.showGoodsofReturnListView[i].esd
- .Consumable_Sale_order__c;
- this.showGoodsofReturnListView[i]['orderNo'] =
- this.showGoodsofReturnListView[
- i
- ].esd.Consumable_Sale_order__r.Name;
- }
- this.showGoodsofReturnListView[i]['prodOutDate'] =
- this.showGoodsofReturnListView[
- i
- ].esd.Product_OutDate__c;
- this.showGoodsofReturnListView[i][
- 'summonsForDirctionDet'
- ] =
- this.showGoodsofReturnListView[
- i
- ].esd.SummonsForDirction_det__c;
- this.showGoodsofReturnListView[i]['hospitalName'] =
- this.showGoodsofReturnListView[
- i
- ].esd.HospItal_Name__c;
- this.showGoodsofReturnListView[i]['orderDealer'] =
- this.showGoodsofReturnListView[
- i
- ].esd.Order_Dealer_Info__c;
- this.showGoodsofReturnListView[i][
- 'sterilizationLimit'
- ] =
- this.showGoodsofReturnListView[
- i
- ].esd.Sterilization_limit__c;
- this.showGoodsofReturnListView[i]['boxPiece'] =
- this.showGoodsofReturnListView[
- i
- ].esd.Box_Piece__c;
- this.showGoodsofReturnListView[i]['returnCount'] =
- this.showGoodsofReturnListView[
- i
- ].esd.Rrturn_count__c;
- console.log(
- 'returnCount:' +
- this.showGoodsofReturnListView[i].esd
- .Rrturn_count__c
- );
- this.showGoodsofReturnListView[i]['returnReason'] =
- this.showGoodsofReturnListView[
- i
- ].esd.Return_reason__c;
- }
- }
- console.log('len1:' + this.showGoodsofReturnList.length);
- console.log(
- 'len2:' + this.showGoodsofReturnListView.length
- );
- console.log(
- 'this.showGoodsofReturnListView:' +
- JSON.stringify(this.showGoodsofReturnListView)
- );
- // this.consumableInventory = result.consumableInventory;
- // for(var i in this.consumableInventory){
- // if(this.consumableInventory[i].Prod != null){
- // this.consumableInventory[i]['recordId'] = this.consumableInventory[i].Prod.Id;
- // this.consumableInventory[i]['prodName'] = this.consumableInventory[i].Prod.Name__c;
- // }
- // }
- console.log(
- 'this.consumableInventory:' +
- JSON.stringify(this.consumableInventory)
- );
- this.consumableorderdetailsRecordserror =
- result.consumableorderdetailsRecordserror;
- for (var i in this.consumableorderdetailsRecordserror) {
- if (
- this.consumableorderdetailsRecordserror[i].Prod !=
- null
- ) {
- this.consumableorderdetailsRecordserror[i][
- 'recordId'
- ] =
- this.consumableorderdetailsRecordserror[
- i
- ].Prod.Id;
- this.consumableorderdetailsRecordserror[i][
- 'prodName'
- ] =
- this.consumableorderdetailsRecordserror[
- i
- ].Prod.Name__c;
- }
- if (
- this.consumableorderdetailsRecordserror[i].esd !=
- null
- ) {
- this.consumableorderdetailsRecordserror[i][
- 'consumableOrderMinor'
- ] =
- this.consumableorderdetailsRecordserror[
- i
- ].esd.Consumable_order_minor__c;
- if (
- this.consumableorderdetailsRecordserror[i].esd
- .Consumable_order_minor__c != null
- ) {
- this.consumableorderdetailsRecordserror[i][
- 'consumableOrderMinorName'
- ] =
- this.consumableorderdetailsRecordserror[
- i
- ].esd.Consumable_order_minor__r.Name;
- this.consumableorderdetailsRecordserror[i][
- 'consumableOrderUrl'
- ] =
- '/s/detail/' +
- this.consumableorderdetailsRecordserror[i]
- .esd.Consumable_order_minor__c;
- }
- this.consumableorderdetailsRecordserror[i][
- 'barCode'
- ] =
- this.consumableorderdetailsRecordserror[
- i
- ].esd.Bar_Code__c;
- this.consumableorderdetailsRecordserror[i][
- 'boxPiece'
- ] =
- this.consumableorderdetailsRecordserror[
- i
- ].esd.Box_Piece__c;
- }
- }
- console.log(
- 'this.consumableorderdetailsRecordserror:' +
- JSON.stringify(
- this.consumableorderdetailsRecordserror
- )
- );
- this.showSpinner = false;
- if (this.errorMsgs.length < 1) {
- this.showMyToast('鑾峰彇鎴愬姛', '', 'success');
- }
- } else {
- this.showSpinner = false;
- this.warningMsgs = result.warningMsgList;
- this.errorMsgs = result.errorMsgList;
- console.log('error:' + result.errorMsg);
- this.showMyToast('鑾峰彇澶辫触', result.errorMsg, 'error');
- }
- })
- .catch((error) => {
- this.showSpinner = false;
- console.log('error:' + error);
- this.showMyToast('鑾峰彇澶辫触', error, 'error');
- });
- }
-
- //杩斿搧鏁伴噺change
- returnCountChange(event) {
- var value = event.detail.data.value;
- var boxPrice = event.detail.data.boxPrice;
- var recordId = event.detail.data.recordId;
- console.log('杩斿搧鏁伴噺:' + value + boxPrice + '---' + recordId);
- for (var i in this.showGoodsofReturnList) {
- if (this.showGoodsofReturnList[i]['recordId'] == recordId) {
- if (this.showGoodsofReturnList[i].canEdit) {
- this.showGoodsofReturnList[i].esd.Rrturn_count__c = 1;
- this.showGoodsofReturnList[i]['returnCount'] =
- this.showGoodsofReturnList[i].esd.Rrturn_count__c;
- } else {
- this.showGoodsofReturnList[i].esd.Rrturn_count__c = value;
- this.showGoodsofReturnList[i]['returnCount'] =
- this.showGoodsofReturnList[i].esd.Rrturn_count__c;
- }
- }
- }
- }
-
- //杩斿搧鍘熷洜change
- returnReasonChange(event) {
- var recordId = event.detail.data.recordId;
- var value = event.detail.data.value;
- console.log('杩斿搧鍘熷洜:' + value + '---' + recordId);
- for (var i in this.showGoodsofReturnList) {
- if (this.showGoodsofReturnList[i]['recordId'] == recordId) {
- this.showGoodsofReturnList[i].esd.Return_reason__c = value;
- this.showGoodsofReturnList[i]['returnReason'] =
- this.showGoodsofReturnList[i].esd.Return_reason__c;
- }
- }
- }
-
- // 鍒拌揣纭
- arriveGoodsConfim() {
- this.showSpinner = true;
- arriveGoodsConfim({ arrControllerStr: this.arrController })
- .then((result) => {
- this.arrController = result.arrGoodCon;
- if (result.result == 'Success') {
- this.showSpinner = false;
- this.warningMsgs = result.warningMsgList;
- this.errorMsgs = result.errorMsgList;
- var url = result.url;
- const config = {
- type: 'standard__webPage',
- attributes: {
- url: url
- }
- };
- this[NavigationMixin.Navigate](config);
- } else {
- this.showSpinner = false;
- this.warningMsgs = result.warningMsgList;
- this.errorMsgs = result.errorMsgList;
- console.log('error1:' + result.errorMsg);
- this.showMyToast('鍒拌揣纭澶辫触', result.errorMsg, 'error');
- }
- })
- .catch((error) => {
- this.showSpinner = false;
- console.log('error2:' + error);
- this.showMyToast('鍒拌揣纭澶辫触', error, 'error');
- });
- }
-
- // 鐧诲綍杩斿搧
- updateGoodsOfReturn() {
- this.showSpinner = true;
- updateGoodsOfReturn({
- arrControllerStr: this.arrController,
- showGoodsofReturnListStr: JSON.stringify(this.showGoodsofReturnList)
- })
- .then((result) => {
- this.showSpinner = false;
- this.arrController = result.arrGoodCon;
- if (result.result == 'Success') {
- this.warningMsgs = result.warningMsgList;
- this.errorMsgs = result.errorMsgList;
- var url = result.url;
- const config = {
- type: 'standard__webPage',
- attributes: {
- url: url
- }
- };
- this[NavigationMixin.Navigate](config);
- } else {
- console.log('error1:' + result.errorMsg);
- this.showSpinner = false;
- this.warningMsgs = result.warningMsgList;
- this.errorMsgs = result.errorMsgList;
- if (result.errorMsg.includes('鏃犳硶淇濆瓨姝よ褰�')) {
- result.errorMsg = '鏃犳硶淇濆瓨璁板綍';
- }
- this.showMyToast('鐧诲綍杩斿搧澶辫触', result.errorMsg, 'error');
- }
- })
- .catch((error) => {
- this.showSpinner = false;
- console.log('error2:' + JSON.stringify(error));
- this.showMyToast('鐧诲綍杩斿搧澶辫触', error, '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);
- // var mode;
- // if(this.isNoteStay){
- // mode ='sticky';
- // }else{
- // mode = 'dismissable';
- // }
- // const evt = new ShowToastEvent({
- // title: title,
- // message: message,
- // variant: variant,
- // mode: mode
- // });
- // this.dispatchEvent(evt);
- }
-}
->>>>>>> LEXCommunityLiJun
diff --git a/force-app/main/default/lwc/lexArriveGoodsMain/lexArriveGoodsMain.html b/force-app/main/default/lwc/lexArriveGoodsMain/lexArriveGoodsMain.html
index cb3380b..d8c0cbc 100644
--- a/force-app/main/default/lwc/lexArriveGoodsMain/lexArriveGoodsMain.html
+++ b/force-app/main/default/lwc/lexArriveGoodsMain/lexArriveGoodsMain.html
@@ -238,8 +238,4 @@
</section>
<div class="slds-backdrop slds-backdrop_open"></div>
</template>
-<<<<<<< HEAD
</template>
-=======
-</template>
->>>>>>> LEXCommunityLiJun
diff --git a/force-app/main/default/lwc/lexArriveGoodsMain/lexArriveGoodsMain.js b/force-app/main/default/lwc/lexArriveGoodsMain/lexArriveGoodsMain.js
index 47a5f09..f7572d2 100644
--- a/force-app/main/default/lwc/lexArriveGoodsMain/lexArriveGoodsMain.js
+++ b/force-app/main/default/lwc/lexArriveGoodsMain/lexArriveGoodsMain.js
@@ -526,8 +526,4 @@
// });
// this.dispatchEvent(evt);
}
-<<<<<<< HEAD
}
-=======
-}
->>>>>>> LEXCommunityLiJun
diff --git a/force-app/main/default/lwc/lexConInvoiceView/lexConInvoiceView.html b/force-app/main/default/lwc/lexConInvoiceView/lexConInvoiceView.html
index 2754039..60c6cad 100644
--- a/force-app/main/default/lwc/lexConInvoiceView/lexConInvoiceView.html
+++ b/force-app/main/default/lwc/lexConInvoiceView/lexConInvoiceView.html
@@ -1377,8 +1377,4 @@
</div>
</div>
</template>
-<<<<<<< HEAD
</template>
-=======
-</template>
->>>>>>> LEXCommunityLiJun
diff --git a/force-app/main/default/lwc/lexConInvoiceView/lexConInvoiceView.js b/force-app/main/default/lwc/lexConInvoiceView/lexConInvoiceView.js
index 299d046..7a4f259 100644
--- a/force-app/main/default/lwc/lexConInvoiceView/lexConInvoiceView.js
+++ b/force-app/main/default/lwc/lexConInvoiceView/lexConInvoiceView.js
@@ -2174,8 +2174,4 @@
this.showMyToast('閿欒', error.message, 'Error');
});
}
-<<<<<<< HEAD
}
-=======
-}
->>>>>>> LEXCommunityLiJun
diff --git a/force-app/main/default/lwc/lexConsumable/lexConsumable.html b/force-app/main/default/lwc/lexConsumable/lexConsumable.html
index e8dbd38..bbf9a83 100644
--- a/force-app/main/default/lwc/lexConsumable/lexConsumable.html
+++ b/force-app/main/default/lwc/lexConsumable/lexConsumable.html
@@ -681,10 +681,7 @@
onfirst={goFirstPage}
onlast={goLastPage}
page-size-options={pageSizeOptions}
-<<<<<<< HEAD
-=======
default-page-size={pageSize}
->>>>>>> LEXCommunityLiJun
previous-button-disabled={previousButtonDisabled}
next-button-disabled={nextButtonDisabled}
record-start={recordStart}
@@ -711,10 +708,7 @@
onfirst={goFirstPage}
onlast={goLastPage}
page-size-options={pageSizeOptions}
-<<<<<<< HEAD
-=======
default-page-size={pageSize}
->>>>>>> LEXCommunityLiJun
previous-button-disabled={previousButtonDisabled}
next-button-disabled={nextButtonDisabled}
record-start={recordStart}
@@ -1105,8 +1099,4 @@
<div class="slds-backdrop slds-backdrop_open"></div>
</template>
</template>
-<<<<<<< HEAD
</template>
-=======
-</template>
->>>>>>> LEXCommunityLiJun
diff --git a/force-app/main/default/lwc/lexConsumable/lexConsumable.js b/force-app/main/default/lwc/lexConsumable/lexConsumable.js
index 714e78a..f944034 100644
--- a/force-app/main/default/lwc/lexConsumable/lexConsumable.js
+++ b/force-app/main/default/lwc/lexConsumable/lexConsumable.js
@@ -85,15 +85,9 @@
@track sortedBy;
//鍒嗛〉
@track currentPage = 1;
-<<<<<<< HEAD
- @track pageSize = 10;
- // @track totalPage = 0;
- @track pageSizeOptions = [10, 25, 50, 100];
-=======
@track pageSize = 200;
// @track totalPage = 0;
- @track pageSizeOptions = [100, 200,300];
->>>>>>> LEXCommunityLiJun
+ @track pageSizeOptions = [100, 200, 300];
@track recordStart = 0;
@track recordEnd = 0;
//鎶ラ敊鎻愰啋
@@ -1781,8 +1775,4 @@
get nextButtonDisabled() {
return this.currentPage == this.totalPage;
}
-<<<<<<< HEAD
}
-=======
-}
->>>>>>> LEXCommunityLiJun
diff --git a/force-app/main/default/lwc/lexConsumableAccount/lexConsumableAccount.js b/force-app/main/default/lwc/lexConsumableAccount/lexConsumableAccount.js
index 191b028..cb6c4e2 100644
--- a/force-app/main/default/lwc/lexConsumableAccount/lexConsumableAccount.js
+++ b/force-app/main/default/lwc/lexConsumableAccount/lexConsumableAccount.js
@@ -228,11 +228,7 @@
//鍒嗛〉start
@track sortBy = '';
-<<<<<<< HEAD
- @track pageSize = 10;
-=======
@track pageSize = 200;
->>>>>>> LEXCommunityLiJun
error;
records;
currentPageToken = 0;
@@ -242,11 +238,7 @@
@track pageNumber = 1;
@track paginationVisibility = false;
@track totalPages = 1;
-<<<<<<< HEAD
- pageSizeOptions = [10, 25, 50, 100];
-=======
pageSizeOptions = [100, 200, 300];
->>>>>>> LEXCommunityLiJun
@track recordStart = 0;
@track recordEnd = 0;
//end
@@ -369,11 +361,7 @@
: r.entity.obj.Parent.Name;
console.log(
'this.accountDataInfo = ' +
-<<<<<<< HEAD
JSON.stringify(this.accountDataInfo)
-=======
- JSON.stringify(this.accountDataInfo)
->>>>>>> LEXCommunityLiJun
);
this.printUrl =
'/lexconsumableaccountinfoprint?AccId=' +
@@ -409,11 +397,7 @@
this.recordEnd = r.entity.paginatedAccounts.recordEnd;
this.totalPages = Math.ceil(
r.entity.paginatedAccounts.totalRecords /
-<<<<<<< HEAD
this.pageSize
-=======
- this.pageSize
->>>>>>> LEXCommunityLiJun
);
console.log('this.totalPages = ' + this.totalPages);
this.paginationVisibility =
@@ -448,20 +432,12 @@
}
console.log(
'this.listViewOptions = ' +
-<<<<<<< HEAD
JSON.stringify(this.listViewOptions)
-=======
- JSON.stringify(this.listViewOptions)
->>>>>>> LEXCommunityLiJun
);
console.log(
'r.entity.topInfo = ' +
-<<<<<<< HEAD
JSON.stringify(r.entity.topInfo)
-=======
- JSON.stringify(r.entity.topInfo)
->>>>>>> LEXCommunityLiJun
);
//top10瀹㈡埛
this.topInfo = r.entity.topInfo;
@@ -471,7 +447,6 @@
this.topAccountData = this.topInfo.acList;
console.log(
'this.topAccountData = ' +
-<<<<<<< HEAD
JSON.stringify(this.topAccountData)
);
console.log(
@@ -479,15 +454,6 @@
this.keepTwoDecimalStr(
this.amend(9, 3, '/').toFixed(2)
)
-=======
- JSON.stringify(this.topAccountData)
- );
- console.log(
- '9/3 = ' +
- this.keepTwoDecimalStr(
- this.amend(9, 3, '/').toFixed(2)
- )
->>>>>>> LEXCommunityLiJun
);
let total = 100;
try {
@@ -519,7 +485,6 @@
) * 100
).toFixed(2)
);
-<<<<<<< HEAD
console.log(
'this.amend = ' +
this.amend(
@@ -529,9 +494,6 @@
) *
100
);
-=======
- console.log('this.amend = ' + this.amend(this.topInfo.deList[i],this.topInfo.saleAmount,'/') * 100);
->>>>>>> LEXCommunityLiJun
total -= number;
this.topAccountData[i]['proportion'] =
number + '%';
@@ -539,7 +501,6 @@
console.log(
'this.topAccountData = ' +
-<<<<<<< HEAD
JSON.stringify(this.topAccountData)
);
@@ -550,26 +511,15 @@
? total.toFixed(2)
: '0.00')
);
-=======
- JSON.stringify(this.topAccountData)
- );
-
- //鍏朵粬
- console.log('(total.toFixed(2) > 0.00 ? total.toFixed(2) : 0.00) = ' + (total.toFixed(2) > 0.00 ? total.toFixed(2) : '0.00'))
->>>>>>> LEXCommunityLiJun
if (total != 100) {
this.topAccountData.push({
accountName: '...',
accountUrl: '/s/lexconsumableaccount',
isDisable: true,
-<<<<<<< HEAD
proportion:
(total.toFixed(2) > 0.0
? total.toFixed(2)
: '0.00') + '%',
-=======
- proportion: (total.toFixed(2) > 0.00 ? total.toFixed(2) : '0.00') + '%',
->>>>>>> LEXCommunityLiJun
CityMasterName: '...',
CityMasterNameUrl: '/lexconsumableaccount',
Town__c: '...',
@@ -695,11 +645,7 @@
this.topAccountData = this.topInfo.acList;
console.log(
'this.topAccountData = ' +
-<<<<<<< HEAD
JSON.stringify(this.topAccountData)
-=======
- JSON.stringify(this.topAccountData)
->>>>>>> LEXCommunityLiJun
);
let total = 100;
for (var i in this.topAccountData) {
@@ -740,14 +686,10 @@
accountName: '...',
accountUrl: '/s/lexconsumableaccount',
isDisable: true,
-<<<<<<< HEAD
proportion:
(total.toFixed(2) > 0.0
? total.toFixed(2)
: '0.00') + '%',
-=======
- proportion: (total.toFixed(2) > 0.00 ? total.toFixed(2) : '0.00') + '%',
->>>>>>> LEXCommunityLiJun
CityMasterName: '...',
CityMasterNameUrl: '/lexconsumableaccount',
Town__c: '...',
@@ -865,19 +807,11 @@
sortByMethod(field, reverse, primer) {
const key = primer
? function (x) {
-<<<<<<< HEAD
return primer(x[field]);
}
: function (x) {
return x[field];
};
-=======
- return primer(x[field]);
- }
- : function (x) {
- return x[field];
- };
->>>>>>> LEXCommunityLiJun
return function (a, b) {
a = key(a);
@@ -887,11 +821,7 @@
}
onHandleSort(event) {
-<<<<<<< HEAD
console.log('event.detail.fieldName = ' + event.detail.fieldName);
-=======
- console.log('event.detail.fieldName = ' + event.detail.fieldName)
->>>>>>> LEXCommunityLiJun
this.sortBy = event.detail.fieldName;
switch (this.sortBy) {
case 'NameUrl':
@@ -953,8 +883,4 @@
get nextButtonDisabled() {
return this.nextPageToken === undefined;
}
-<<<<<<< HEAD
}
-=======
-}
->>>>>>> LEXCommunityLiJun
diff --git a/force-app/main/default/lwc/lexCustomInventoryColor/lexCustomInventoryColor.html b/force-app/main/default/lwc/lexCustomInventoryColor/lexCustomInventoryColor.html
index 91fe24f..0f067e2 100644
--- a/force-app/main/default/lwc/lexCustomInventoryColor/lexCustomInventoryColor.html
+++ b/force-app/main/default/lwc/lexCustomInventoryColor/lexCustomInventoryColor.html
@@ -1,7 +1,6 @@
<template>
<template if:true={showNormal}>
<div
-<<<<<<< HEAD
style="
margin-left: 10px;
margin-right: 10px;
@@ -15,15 +14,10 @@
<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>
->>>>>>> LEXCommunityLiJun
</div>
</template>
<template if:true={showRed}>
<div
-<<<<<<< HEAD
style="
margin-left: 10px;
margin-right: 10px;
@@ -38,15 +32,10 @@
<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>
->>>>>>> LEXCommunityLiJun
</div>
</template>
<template if:true={showYellow}>
<div
-<<<<<<< HEAD
style="
margin-left: 10px;
margin-right: 10px;
@@ -64,10 +53,3 @@
</div>
</template>
</template>
-=======
- 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>
->>>>>>> LEXCommunityLiJun
diff --git a/force-app/main/default/lwc/lexInventory/lexInventory.html b/force-app/main/default/lwc/lexInventory/lexInventory.html
index c90c293..6f1c4f6 100644
--- a/force-app/main/default/lwc/lexInventory/lexInventory.html
+++ b/force-app/main/default/lwc/lexInventory/lexInventory.html
@@ -200,7 +200,6 @@
style="word-wrap: break-word; word-break: break-all"
>
</lightning-datatable>
-<<<<<<< HEAD
<c-paginator
onprevious={handlePrevious}
onnext={handleNext}
@@ -208,19 +207,13 @@
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>
-=======
- <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>
->>>>>>> LEXCommunityLiJun
</div>
<!-- </template> -->
</div>
diff --git a/force-app/main/default/lwc/lexInventory/lexInventory.js b/force-app/main/default/lwc/lexInventory/lexInventory.js
index bdcd664..5e89561 100644
--- a/force-app/main/default/lwc/lexInventory/lexInventory.js
+++ b/force-app/main/default/lwc/lexInventory/lexInventory.js
@@ -213,14 +213,13 @@
@track consumableorderdetailsRecords = [];
@track showcount = true;
-<<<<<<< HEAD
@track iSinventory = false;
@track numberDetail;
@track hidecheckbox = true;
//鍒嗛〉start
@track sortBy = '';
@track sortDirection = 'asc';
- @track pageSize = 10;
+ @track pageSize = 200;
error;
records;
currentPageToken = 0;
@@ -230,32 +229,10 @@
@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
-=======
- @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
->>>>>>> LEXCommunityLiJun
//鍔犺浇妗�
// @track casesSpinner = true;
diff --git a/force-app/main/default/lwc/lexSaleAndDelivery/lexSaleAndDelivery.html b/force-app/main/default/lwc/lexSaleAndDelivery/lexSaleAndDelivery.html
index a19ba16..fd35ca3 100644
--- a/force-app/main/default/lwc/lexSaleAndDelivery/lexSaleAndDelivery.html
+++ b/force-app/main/default/lwc/lexSaleAndDelivery/lexSaleAndDelivery.html
@@ -8,10 +8,6 @@
<div style="padding: 15px">
<div lwc:dom="manual" class="resultDiv"></div>
<div draggable="false">
-<<<<<<< HEAD
-=======
-
->>>>>>> LEXCommunityLiJun
<!-- <div class="slds-m-top_small slds-m-bottom_medium"> -->
<!-- <lightning-button label="鏂板缓鍑哄簱鍗�" onclick={neworderhead}
class="slds-m-left_x-small" disabled></lightning-button>
@@ -280,8 +276,4 @@
</div>
</div>
</div>
-<<<<<<< HEAD
</template>
-=======
-</template>
->>>>>>> LEXCommunityLiJun
diff --git a/force-app/main/default/lwc/lexSaleAndDelivery/lexSaleAndDelivery.js b/force-app/main/default/lwc/lexSaleAndDelivery/lexSaleAndDelivery.js
index f33bb52..80abe62 100644
--- a/force-app/main/default/lwc/lexSaleAndDelivery/lexSaleAndDelivery.js
+++ b/force-app/main/default/lwc/lexSaleAndDelivery/lexSaleAndDelivery.js
@@ -438,8 +438,4 @@
openModal() {
this.isModalOpen = true;
}
-<<<<<<< HEAD
}
-=======
-}
->>>>>>> LEXCommunityLiJun
diff --git a/force-app/main/default/lwc/lexSummonsCreat/lexSummonsCreat.css b/force-app/main/default/lwc/lexSummonsCreat/lexSummonsCreat.css
index f39a0c1..c28189d 100644
--- a/force-app/main/default/lwc/lexSummonsCreat/lexSummonsCreat.css
+++ b/force-app/main/default/lwc/lexSummonsCreat/lexSummonsCreat.css
@@ -1,5 +1,4 @@
@import 'c/lexCssUtility';
-<<<<<<< HEAD
.outerBorderCss {
border: 1px solid #d4d4d4;
border-radius: 5px;
@@ -20,28 +19,6 @@
text-align: center;
}
.centerCss .left {
-=======
-.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;
-}
-.headerDorderCss{
- border-top: 1px solid #565959;
- border-bottom: 1px solid #D4D4D4;
- padding:3px;
-}
-.centerCss{
- text-align: center;
-}
-.centerCss .left{
->>>>>>> LEXCommunityLiJun
margin-left: 100px;
}
.datatable {
@@ -58,17 +35,9 @@
.fileUpload {
font-size: 16px;
-<<<<<<< HEAD
--lwc-formLabelFontSize: 16px;
-=======
- --lwc-formLabelFontSize:16px;
->>>>>>> LEXCommunityLiJun
}
.disable-row-selection .slds-is-selected {
outline: none !important;
-<<<<<<< HEAD
}
-=======
- }
->>>>>>> LEXCommunityLiJun
diff --git a/force-app/main/default/lwc/lexSummonsCreat/lexSummonsCreat.html b/force-app/main/default/lwc/lexSummonsCreat/lexSummonsCreat.html
index 5a34891..5a8517f 100644
--- a/force-app/main/default/lwc/lexSummonsCreat/lexSummonsCreat.html
+++ b/force-app/main/default/lwc/lexSummonsCreat/lexSummonsCreat.html
@@ -4,7 +4,6 @@
<c-common-toast></c-common-toast>
<template if:true={isShowSpinner}>
<div class="slds-spinner_container">
-<<<<<<< HEAD
聽 聽 聽 聽 聽 聽
<div
role="status"
@@ -117,52 +116,6 @@
padding: 3px;
"
>
-=======
-聽 聽 聽 聽 聽 聽 <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;">
- <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>
- <span class="slds-assistive-text">Close</span>
- </button>
- <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%;">
- <tbody>
- <tr>
- <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>
- </tr>
- </tbody>
- </table>
- <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;">
->>>>>>> LEXCommunityLiJun
<lightning-layout>
<lightning-layout-item padding="around-small">
<p style="font-size: 18px">
@@ -172,7 +125,6 @@
</lightning-layout>
<!-- <p style="font-size: 16px;"><strong>鎼滅储缁撴灉</strong></p> -->
</div>
-<<<<<<< HEAD
<div class="myTable" style="padding: 10px">
<!-- <lightning-datatable class="wrapped-header-datatable" key-field="id"
hide-checkbox-column="true" data={hospitalList} columns={hosCols}
@@ -185,21 +137,11 @@
hide-checkbox-column="true"
onrowaction={searchHandleRowAction}
>
-=======
- <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}>
->>>>>>> LEXCommunityLiJun
</lightning-datatable>
</div>
</div>
</div>
<footer class="slds-modal__footer">
-<<<<<<< HEAD
<button
class="slds-button slds-button_neutral slds-button_stretch lexclearStyle"
label="鍙栨秷"
@@ -207,10 +149,6 @@
>
鍙栨秷
</button>
-=======
- <button class="slds-button slds-button_neutral slds-button_stretch lexclearStyle" label="鍙栨秷"
- onclick={closeModal}>鍙栨秷</button>
->>>>>>> LEXCommunityLiJun
</footer>
</div>
</section>
@@ -219,7 +157,6 @@
<!-- 涓婁紶闄勪欢寮圭獥 -->
<template if:true={showAttPop}>
-<<<<<<< HEAD
<section
role="dialog"
tabindex="-1"
@@ -279,33 +216,6 @@
<p style="font-size: 16px">
宸查�夋嫨鏂囦欢锛歿fileName}
-=======
- <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>
- </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>
- <span class="slds-assistive-text">Close</span>
- </button>
- <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-m-top_medium slds-m-bottom_x-large">
- <div class="slds-p-around_medium lgc-bg">
- <lightning-input class="fileUpload" type="file" label="闄勪欢涓婁紶"
- accept=".xlsx, .xls, .csv, .png, .doc, .docx, .pdf"
- onchange={attChange}></lightning-input>
- </div>
- <p style="font-size: 16px;">宸查�夋嫨鏂囦欢锛歿fileName}
->>>>>>> LEXCommunityLiJun
<template if:true={attDelBtn}>
<a onclick={removeAtt}>绉婚櫎</a>
</template>
@@ -317,7 +227,6 @@
onclick={closePop}></lightning-button>
<lightning-button style="margin-left: 10px;" variant="neutral" label="涓婁紶"
onclick={handleSave}></lightning-button> -->
-<<<<<<< HEAD
<button
class="slds-button slds-button_neutral slds-button_stretch lexclearStyle"
style="margin-left: 10px"
@@ -334,12 +243,6 @@
>
涓婁紶
</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>
->>>>>>> LEXCommunityLiJun
</footer>
</div>
</section>
@@ -378,14 +281,10 @@
style="width: 150px"></lightning-button> -->
<button
class="slds-button slds-button_neutral slds-button_stretch lexBorder"
-<<<<<<< HEAD
onclick={saveConfirmJs}
>
淇濆瓨
</button>
-=======
- onclick={saveConfirmJs}>淇濆瓨</button>
->>>>>>> LEXCommunityLiJun
</template>
</td>
<td colspan="4">
@@ -403,15 +302,11 @@
style="width: 150px" disabled={isEditDisabled}></lightning-button> -->
<button
class="slds-button slds-button_neutral slds-button_stretch lexBorder"
-<<<<<<< HEAD
onclick={EditConsumable}
disabled={isEditDisabled}
>
缂栬緫鍑哄簱鍗�
</button>
-=======
- onclick={EditConsumable} disabled={isEditDisabled}>缂栬緫鍑哄簱鍗�</button>
->>>>>>> LEXCommunityLiJun
</template>
</td>
@@ -421,15 +316,11 @@
style="width: 150px;" disabled={isDeliveryDisabled}></lightning-button> -->
<button
class="slds-button slds-button_neutral slds-button_stretch lexBorder"
-<<<<<<< HEAD
onclick={GoodsDeliveryJs}
disabled={isDeliveryDisabled}
>
鍑鸿揣/閿�鍞�
</button>
-=======
- onclick={GoodsDeliveryJs} disabled={isDeliveryDisabled}>鍑鸿揣/閿�鍞�</button>
->>>>>>> LEXCommunityLiJun
</template>
</td>
@@ -439,15 +330,11 @@
disabled={isOpenToInvoiceDisabled}></lightning-button> -->
<button
class="slds-button slds-button_neutral slds-button_stretch lexBorder"
-<<<<<<< HEAD
onclick={openToInvoiceJs}
disabled={isOpenToInvoiceDisabled}
>
寮�绁�
</button>
-=======
- onclick={openToInvoiceJs} disabled={isOpenToInvoiceDisabled}>寮�绁�</button>
->>>>>>> LEXCommunityLiJun
</template>
</td>
@@ -455,7 +342,6 @@
<template if:false={EditAble}>
<button
class="slds-button slds-button_neutral slds-button_stretch lexBorder"
-<<<<<<< HEAD
onclick={uploadOrder}
>
涓婁紶闄勪欢
@@ -464,13 +350,6 @@
</td>
</tr>
<tr style="height: 5px"></tr>
-=======
- onclick={uploadOrder}>涓婁紶闄勪欢</button>
- </template>
- </td>
- </tr>
- <tr style="height: 5px;"></tr>
->>>>>>> LEXCommunityLiJun
<tr>
<td></td>
<td>
@@ -479,29 +358,20 @@
disabled={isPraseToPDFDisabled}></lightning-button> -->
<button
class="slds-button slds-button_neutral slds-button_stretch lexBorder"
-<<<<<<< HEAD
onclick={PraseToPDFJs}
disabled={isPraseToPDFDisabled}
>
鎵撳嵃鎸囩ず鍗�
</button>
-=======
- onclick={PraseToPDFJs} disabled={isPraseToPDFDisabled}>鎵撳嵃鎸囩ず鍗�</button>
->>>>>>> LEXCommunityLiJun
</template>
</td>
<td>
-<<<<<<< HEAD
-=======
-
->>>>>>> LEXCommunityLiJun
<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"
-<<<<<<< HEAD
onclick={openReportJs}
disabled={isOpenReportDisabled}
>
@@ -510,27 +380,16 @@
</template>
</td>
<td>
-=======
- onclick={openReportJs} disabled={isOpenReportDisabled}>鏄剧ず鏄庣粏</button>
- </template>
- </td>
- <td>
-
->>>>>>> LEXCommunityLiJun
<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"
-<<<<<<< HEAD
onclick={DeleteConsumable}
disabled={isDeleteDisabled}
>
鍒犻櫎
</button>
-=======
- onclick={DeleteConsumable} disabled={isDeleteDisabled}>鍒犻櫎</button>
->>>>>>> LEXCommunityLiJun
</template>
</td>
<td></td>
@@ -556,7 +415,6 @@
<div lwc:dom="manual" class="resultDiv"></div>
<div draggable="false">
<!-- SummonsStatus_c__c == '浠锋牸鏈畾' -->
-<<<<<<< HEAD
<template
if:true={summonsStatusPriceNotDetermined}
>
@@ -1575,6 +1433,7 @@
onfirst={handleFirst}
onlast={handleLast}
page-size-options={pageSizeOptions}
+ default-page-size={pageSize}
previous-button-disabled={previousButtonDisabled}
next-button-disabled={nextButtonDisabled}
record-start={recordStart}
@@ -1613,6 +1472,7 @@
onfirst={editHandleFirst}
onlast={editHandleLast}
page-size-options={pageSizeOptions}
+ default-page-size={pageSize}
previous-button-disabled={previousButtonDisabled}
next-button-disabled={nextButtonDisabled}
record-start={recordStart}
@@ -1655,639 +1515,6 @@
</div>
</template>
-=======
- <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="5">
- <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-output-field
- field-name="SummonsStatus_c__c"></lightning-output-field>
- </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 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>
-
- <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>
-
- <lightning-layout-item class="hehe-layoutItem" size="5">
- <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 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>
-
- <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-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-output-field
- field-name="Shipment_total_amount__c"></lightning-output-field>
- </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-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}>
- <!-- 鍑哄簱鍗曞彿 鍑哄簱鍗曠姸鎬� -->
- <lightning-layout multiple-rows="true">
- <template if:true={isSummonsFlag}>
- <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>
-
- <lightning-layout-item class="hehe-layoutItem" size="5"
- style="padding-left: 100px;">
- <lightning-output-field
- field-name="SummonsStatus_c__c"></lightning-output-field>
- </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 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>
-
- <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">
- <div
- 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>
- </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="鎼滅储缁忛攢鍟�"
- onisdisabledfordealertext={isDisabledForDealerText}
- 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}
- data-field="Order_ForDealerText__c"
- disabled={isDisabledForDealerText} variant="label-inline"
- class="inputFont">
- </lightning-input>
- </template>
- </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 onchange={dataChange}
- data-field="ForCustomerText" value={ForCustomerText}
- field-name="Order_ForCustomerText__c"
- disabled={isDisabledForCustomerText}
- 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>
-
- <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>
-
-
-
- </lightning-layout>
- </lightning-record-edit-form>
- </template>
- </div>
- </div>
- </div>
- </template>
-
- <!-- 鍑哄簱鍗曚俊鎭� EditAble = false -->
- <template if:false={EditAble}>
- <div class="borderCss">
- <div class="headerDorderCss">
- <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: 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-layout multiple-rows="true">
- <template if:true={isSummonsFlag}>
- <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-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>
-
- <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="5">
- <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>
-
- <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>
-
- <lightning-layout-item size="5">
- <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="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>
- </template>
-
- <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="5">
- <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>
-
- <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="5">
- <lightning-output-field field-name="NoConfirmedPrice__c"
- class="hehe-layoutItem"></lightning-output-field>
- </lightning-layout-item>
- </lightning-layout>
-
- <!-- 闄勪欢棰勮 -->
- <template if:false={EditAble}>
- <lightning-layout multiple-rows="true">
- <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"
- 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"
- alternative-text={item.Title}
- 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>
- </p>
- <!-- <p>{item.updateDate} 路 {item.ownerName}</p> -->
- </lightning-layout-item>
- </template>
- </lightning-layout>
- </lightning-card>
- </lightning-layout-item>
- </lightning-layout>
- </template>
-
- </lightning-record-edit-form>
- </div>
- </div>
- </div>
- </template>
-
- <!-- 妫�绱� -->
- <template if:true={isSearchShow}>
- <div class="borderCss">
- <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>
- </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>
- </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>
-
- </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>
-
- </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>
- </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>
- </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>
- </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>
- </div>
-
- </lightning-layout-item>
- <template if:false={hasHosPro}>
- <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;"
- class="slds-button slds-button_neutral slds-button_stretch lexBorder lexclearStyle"
- 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>
- </div>
- </lightning-layout-item>
- <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;"
- class="slds-button slds-button_neutral slds-button_stretch lexBorder lexclearStyle"
- onclick={ClearJs}>娓呯┖</button>
- </div>
- </lightning-layout-item>
- </template>
- </lightning-layout>
- </div>
- </div>
- </div>
- </template>
-
- <!-- 鍑哄簱鍗曟槑缁� -->
- <div class="borderCss">
- <div class="headerDorderCss">
- <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: 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}
- 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">
- </c-lex-custom-lightning-datatable>
- </template>
- <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}
- 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">
- </c-lex-custom-lightning-datatable>
- <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>
- </template>
- </template>
-
- <template if:true={isEditShowSpinner}>
- <lightning-spinner alternative-text="Uploading now"></lightning-spinner>
- </template>
- </div>
- </div>
-
- <!-- 鍑哄簱浜у搧鏄庣粏 -->
- <template if:true={isShowOutboundProductDetails}>
- <div class="borderCss">
- <div class="headerDorderCss">
- <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: 7px">
- <lightning-datatable key-field="id" data={consumableorderdetails2Records}
- columns={consumableorderdetails2RecordsColumns} hide-checkbox-column
- class="wrapped-header-datatable">
- </lightning-datatable>
- </div>
- </div>
- </template>
-
->>>>>>> LEXCommunityLiJun
<!-- 涓婁紶闄勪欢 -->
<!-- <template if:false={EditAble}>
<div class="borderCss">
@@ -2339,7 +1566,6 @@
</lightning-layout-item>
</lightning-layout>
</div>
-<<<<<<< HEAD
<div style="padding: 7px">
<div lwc:dom="manual" class="resultDiv"></div>
<div draggable="false">
@@ -2385,47 +1611,16 @@
class="hehe-layoutItem"
size="4"
>
-=======
- <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-item>
- <template if:true={isSales}>
- <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>
- </lightning-layout-item>
- </template>
- <template if:false={isSales}>
- <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>
- </lightning-layout-item>
- </template>
- <lightning-layout-item class="hehe-layoutItem" size="4">
->>>>>>> LEXCommunityLiJun
</lightning-layout-item>
</lightning-layout>
<template if:true={isShowInformation}>
-<<<<<<< HEAD
<div class="borderCss" style="margin-top: 5px">
<div class="headerDorderCss">
<lightning-layout>
<lightning-layout-item
padding="around-small"
>
-=======
- <div class="borderCss" style="margin-top: 5px;">
- <div class="headerDorderCss">
- <lightning-layout>
- <lightning-layout-item padding="around-small">
->>>>>>> LEXCommunityLiJun
<p style="font-size: 18px">
<strong>鍑哄簱鍗曚俊鎭�</strong>
</p>
@@ -2433,7 +1628,6 @@
</lightning-layout>
</div>
<div style="padding: 7px">
-<<<<<<< HEAD
<div
lwc:dom="manual"
class="resultDiv"
@@ -2536,52 +1730,6 @@
field-name="SummonsForDirction__c"
variant="label-hidden"
></lightning-output-field>
-=======
- <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-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>
- </lightning-layout-item>
- <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>
- </div>
- </lightning-layout-item>
- <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>
- <lightning-output-field
- field-name="Order_ForCustomerText__c"
- variant="label-hidden"></lightning-output-field>
- </div>
- </lightning-layout-item>
- <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>
->>>>>>> LEXCommunityLiJun
</div>
</lightning-layout-item>
</lightning-layout>
@@ -2594,7 +1742,6 @@
<div class="borderCss">
<div class="headerDorderCss">
<lightning-layout>
-<<<<<<< HEAD
<lightning-layout-item
padding="around-small"
>
@@ -2602,17 +1749,11 @@
<strong
>BarCode褰曞叆</strong
>
-=======
- <lightning-layout-item padding="around-small">
- <p style="font-size: 18px">
- <strong>BarCode褰曞叆</strong>
->>>>>>> LEXCommunityLiJun
</p>
</lightning-layout-item>
</lightning-layout>
</div>
<div style="padding: 7px">
-<<<<<<< HEAD
<div
lwc:dom="manual"
class="resultDiv"
@@ -2631,21 +1772,11 @@
<lightning-layout-item
padding="around-small"
>
-=======
- <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">
->>>>>>> LEXCommunityLiJun
<!-- <lightning-textarea name="Barcode" label="BarCode鍙�"
onchange={dataChange} variant="label-inline"
data-field="Barcode"
value={Barcode}></lightning-textarea> -->
-<<<<<<< HEAD
<div
class="slds-grid"
>
@@ -2676,31 +1807,14 @@
<div
class="slds-form-element__label"
>
-=======
- <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">
->>>>>>> LEXCommunityLiJun
<!-- <lightning-button label="纭"
onclick={SalesearchProductJs}></lightning-button> -->
<button
class="slds-button slds-button_neutral slds-button_stretch lexBorder"
-<<<<<<< HEAD
onclick={SalesearchProductJs}
>
鑾峰彇鏄庣粏
</button>
-=======
- onclick={SalesearchProductJs}>鑾峰彇鏄庣粏</button>
->>>>>>> LEXCommunityLiJun
</div>
</div>
</lightning-layout-item>
@@ -2714,13 +1828,9 @@
<div class="borderCss">
<div class="headerDorderCss">
<lightning-layout>
-<<<<<<< HEAD
<lightning-layout-item
padding="around-small"
>
-=======
- <lightning-layout-item padding="around-small">
->>>>>>> LEXCommunityLiJun
<p style="font-size: 18px">
<strong>鍑鸿揣鏄庣粏</strong>
</p>
@@ -2728,21 +1838,16 @@
</lightning-layout>
</div>
<div style="padding: 7px">
-<<<<<<< HEAD
<div
lwc:dom="manual"
class="resultDiv"
></div>
-=======
- <div lwc:dom="manual" class="resultDiv"></div>
->>>>>>> LEXCommunityLiJun
<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> -->
-<<<<<<< HEAD
<c-lex-custom-lightning-datatable
key-field="Id"
data={salesData}
@@ -2755,13 +1860,6 @@
"
class="wrapped-header-datatable"
>
-=======
- <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">
->>>>>>> LEXCommunityLiJun
</c-lex-custom-lightning-datatable>
</div>
</div>
@@ -2770,7 +1868,6 @@
<div class="borderCss">
<div class="headerDorderCss">
<lightning-layout>
-<<<<<<< HEAD
<lightning-layout-item
padding="around-small"
>
@@ -2778,17 +1875,11 @@
<strong
>鍑鸿揣閿欒鏄庣粏</strong
>
-=======
- <lightning-layout-item padding="around-small">
- <p style="font-size: 18px">
- <strong>鍑鸿揣閿欒鏄庣粏</strong>
->>>>>>> LEXCommunityLiJun
</p>
</lightning-layout-item>
</lightning-layout>
</div>
<div style="padding: 7px">
-<<<<<<< HEAD
<div
lwc:dom="manual"
class="resultDiv"
@@ -2805,21 +1896,12 @@
"
class="wrapped-header-datatable"
>
-=======
- <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">
->>>>>>> LEXCommunityLiJun
</lightning-datatable>
</div>
</div>
</div>
<lightning-layout multiple-rows="true">
-<<<<<<< HEAD
<lightning-layout-item
class="hehe-layoutItem"
size="4"
@@ -2857,27 +1939,6 @@
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-button label="閿�鍞�" onclick={SaveP}></lightning-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-button label="鍑鸿揣" onclick={SaveE}></lightning-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">
->>>>>>> LEXCommunityLiJun
</lightning-layout-item>
</lightning-layout>
</template>
@@ -2887,8 +1948,4 @@
</template>
</div>
</div>
-<<<<<<< HEAD
</template>
-=======
-</template>
->>>>>>> LEXCommunityLiJun
diff --git a/force-app/main/default/lwc/lexSummonsCreat/lexSummonsCreat.js b/force-app/main/default/lwc/lexSummonsCreat/lexSummonsCreat.js
index 6c01a22..de41795 100644
--- a/force-app/main/default/lwc/lexSummonsCreat/lexSummonsCreat.js
+++ b/force-app/main/default/lwc/lexSummonsCreat/lexSummonsCreat.js
@@ -1,4 +1,3 @@
-<<<<<<< HEAD
import { LightningElement, wire, api, track } from 'lwc';
import init from '@salesforce/apex/LexSummonsCreatController.init';
import { ShowToastEvent } from 'lightning/platformShowToastEvent';
@@ -25,43 +24,11 @@
//table css
import { loadStyle } from 'lightning/platformResourceLoader';
import WrappedHeaderTable from '@salesforce/resourceUrl/lexdatatable';
-=======
-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";
->>>>>>> LEXCommunityLiJun
import ConsumableOutboundReportId from '@salesforce/label/c.ConsumableOutboundReportId';
const customLabel = {
ConsumableOutboundReportId
-<<<<<<< HEAD
};
-=======
-}
->>>>>>> LEXCommunityLiJun
export default class LexSummonsCreat extends NavigationMixin(LightningElement) {
@track label = customLabel;
@@ -70,7 +37,6 @@
@track showResults = true;
@track results = [
{
-<<<<<<< HEAD
Id: '1',
Name: 'z'
},
@@ -627,7 +593,7 @@
defaultSortDirection = 'asc';
sortDirection = 'asc';
sortedBy;
- @track pageSize = 10;
+ @track pageSize = 200;
error;
records;
currentPageToken = 0;
@@ -637,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
@@ -1336,1120 +1302,26 @@
this.isDisabledForCustomerText = false;
this.secondaryDistributor = '';
this.ForDealerText = '';
-=======
- Id: "1",
- Name: "z",
- },
- {
- Id: "2",
- Name: "h",
- },
- {
- Id: "3",
- Name: "j",
- },
- ];
-
- @track COLS = [
- {
- label: "Account Name",
- type: "customName",
- typeAttributes: {
- accountName: { fieldName: "Name" },
- },
- },
- ];
- @track columns = [
- {
- label: "娑堣�楀搧鍚嶇О",
- fieldName: "Name__c",
- hideDefaultActions: true,
- wrapText: true,
- initialWidth: 175,
- sortable: true
- },
- {
- label: "瑙勬牸",
- fieldName: "packinglist",
- cellAttributes: { alignment: "right" },
- wrapText: true,
- initialWidth: 50,
- hideDefaultActions: true,
- },
- {
- label: "CFDA鐘舵��",
- fieldName: "SFDA_Status__c",
- initialWidth: 105,
- wrapText: true,
- hideDefaultActions: true,
- },
- {
- label: "娉ㄥ唽璇佺紪鐮佸彿",
- fieldName: "approbation_No",
- wrapText: true,
- initialWidth: 105,
- hideDefaultActions: true,
- },
- {
- label: "娉ㄥ唽璇佹晥鏈�",
- wrapText: true,
- initialWidth: 115,
- fieldName: "expiration_Date",
- hideDefaultActions: true,
- },
- {
- label: "绗�3鍒嗙被",
- fieldName: "Category3__c",
- wrapText: true,
- initialWidth: 115,
- hideDefaultActions: true,
- sortable: true,
- },
- {
- label: "绗�4鍒嗙被",
- fieldName: "Category4__c",
- wrapText: true,
- initialWidth: 115,
- hideDefaultActions: true,
- sortable: true,
- },
- {
- label: "绗�5鍒嗙被",
- fieldName: "Category5__c",
- wrapText: true,
- initialWidth: 115,
- hideDefaultActions: true,
- sortable: true,
- },
- {
- label: "鍗曚綅",
- type: "customUnit",
- initialWidth: 100,
- hideDefaultActions: true,
- typeAttributes: {
- unitValue: { fieldName: "unitValue" },
- unitOptions: { fieldName: "unitOptions" },
- recordId: { fieldName: "Id" },
- }
- },
- {
- label: "鍑鸿揣鏁伴噺",
- type: "customShipment",
- initialWidth: 100,
- hideDefaultActions: true,
- cellAttributes: { alignment: "right" },
- typeAttributes: {
- recordId: { fieldName: "Id" },
- shipmentNumber: { fieldName: "shipmentNumber" },
- },
- },
- {
- label: "鍑鸿揣鍗曚环(鍏�)",
- type: "customShipmentUnitPrice",
- hideDefaultActions: true,
- initialWidth: 120,
- typeAttributes: {
- recordId: { fieldName: "Id" },
- shippingUnitPrice: { fieldName: "shippingUnitPrice" },
- },
- },
- {
- label: "鍑鸿揣閲戦(鍏�)",
- type: "customShipmentAmount",
- initialWidth: 120,
- cellAttributes: { alignment: "right" },
- hideDefaultActions: true,
- typeAttributes: {
- shipmentAmount: { fieldName: "shipmentAmount" },
- },
- },
- {
- label: "鏈夋晥鏈熷唴搴撳瓨(鐩�)",
- fieldName: "Boxnumber",
- cellAttributes: { alignment: "right" },
- wrapText: true,
- initialWidth: 160,
- hideDefaultActions: true,
- },
- {
- label: "鏈夋晥鏈熷唴搴撳瓨(涓�)",
- fieldName: "Piecenumber",
- cellAttributes: { alignment: "right" },
- wrapText: true,
- initialWidth: 160,
- hideDefaultActions: true,
- },
- ];
- @track editColumns = [
- {
- label: "娑堣�楀搧鍚嶇О",
- fieldName: "Name__c",
- hideDefaultActions: true,
- wrapText: true,
- sortable: true,
- },
- {
- label: "瑙勬牸",
- fieldName: "packinglist",
- initialWidth: 50,
- cellAttributes: { alignment: "right" },
- hideDefaultActions: true,
- wrapText: true,
- },
- {
- label: "CFDA鐘舵��",
- fieldName: "SFDA_Status__c",
- hideDefaultActions: true,
- initialWidth: 100,
- wrapText: true,
- },
- {
- label: "娉ㄥ唽璇佺紪鐮佸彿",
- fieldName: "approbation_No",
- hideDefaultActions: true,
- initialWidth: 170,
- wrapText: true,
- },
- {
- label: "娉ㄥ唽璇佹晥鏈�",
- fieldName: "expiration_Date",
- hideDefaultActions: true,
- initialWidth: 100,
- wrapText: true,
- },
- {
- label: "绗�3鍒嗙被",
- fieldName: "Category3__c",
- hideDefaultActions: true,
- sortable: true,
- wrapText: true,
- },
- {
- label: "绗�4鍒嗙被",
- fieldName: "Category4__c",
- hideDefaultActions: true,
- sortable: true,
- wrapText: true,
- },
- {
- label: "绗�5鍒嗙被",
- fieldName: "Category5__c",
- hideDefaultActions: true,
- sortable: true,
- wrapText: true,
- },
- {
- label: "鍗曚綅",
- fieldName: "Box_Piece__c",
- initialWidth: 50,
- hideDefaultActions: true,
- wrapText: true,
- },
- {
- label: "鍑鸿揣鏁伴噺",
- fieldName: "Shipment_Count__c",
- initialWidth: 90,
- cellAttributes: { alignment: "right" },
- hideDefaultActions: true,
- wrapText: true,
- },
- {
- label: "鍑鸿揣鍗曚环(鍏�)",
- fieldName: "shippingUnitPrice",
- type: "number",
- initialWidth: 100,
- typeAttributes: {
- minimumFractionDigits: 2,
- },
- hideDefaultActions: true,
- wrapText: true,
- },
- ];
- @track editData = [];
-
- @track hospitalList = [];
- @track hospitalColumns = [
- {
- label: "",
- fieldName: "Id1",
- type: "button",
- hideDefaultActions: true,
- initialWidth: 90,
- typeAttributes: {
- label: "閫夋嫨",
- name: "Id2",
- size: 1,
- },
- },
- {
- label: "鍖婚櫌鍚嶇О",
- fieldName: "Name",
- hideDefaultActions: true,
- wrapText: true,
- },
- {
- label: "鐪佷唤",
- fieldName: "stateMasterName",
- hideDefaultActions: true,
- }
- ];
-
- @track accountid = "";
- @track consumableproductdetailsRecords = [];
- @track SummonsStatus = "";
- @track ESetid = "";
- @track statusEdit = "";
- @track cocLwc = {};
- @track selectedRows = [];
- @track ConsumableOut_report = "";
- @track isMutualTransferGoods = false;
- @track Barcode = "";
- @track summonsForDirction = '';
- @track accountValue = '';
-
- @track consumableorderdetails2RecordsColumns = [
- {
- label: "娑堣�楀搧鍚嶇О",
- fieldName: "ProdName",
- hideDefaultActions: true,
- wrapText: true,
- },
- {
- label: "鎵规鍙�",
- fieldName: "orderdetails2SerialLotNo__c",
- hideDefaultActions: true,
- },
- {
- label: "绠$悊缂栫爜",
- fieldName: "orderdetails2TracingCode__c",
- hideDefaultActions: true,
- },
- {
- label: "浣跨敤鏈熼檺",
- fieldName: "orderdetails2Sterilization_limit__c",
- hideDefaultActions: true,
- },
- ];
- @track consumableorderdetails2Records = [];
-
- //鍑鸿揣/閿�鍞�
- @track salesColumns = [
- {
- label: "娑堣�楀搧璁㈠崟",
- fieldName: "ConsumableorderminorUrl",
- hideDefaultActions: true,
- type: "url",
- typeAttributes: {
- label: { fieldName: "Consumable_order_minor__c" },
- target: "_blank",
- },
- wrapText: true,
- },
- {
- label: "娑堣�楀搧鏄庣粏2鍚嶇О",
- fieldName: "orderdetails2NameUrl",
- type: "url",
- initialWidth: 150,
- typeAttributes: {
- label: { fieldName: "orderdetails2Name" },
- target: "_blank",
- },
- hideDefaultActions: true,
- wrapText: true,
- },
- {
- label: "鍗曚綅",
- fieldName: "Box_Piece__c",
- hideDefaultActions: true,
- wrapText: true,
- initialWidth: 50
- },
- {
- label: "娑堣�楀搧鍚嶇О",
- fieldName: "ProdName",
- initialWidth: 100,
- hideDefaultActions: true,
- wrapText: true,
- },
- {
- label: "鍙戣揣鏃ユ湡",
- fieldName: "Deliver_date__c",
- hideDefaultActions: true,
- wrapText: true,
- },
- {
- label: "BarCode",
- fieldName: "Bar_Code__c",
- hideDefaultActions: true,
- wrapText: true,
- initialWidth: 380
- },
- {
- label: "浣跨敤鏈熼檺",
- fieldName: "Sterilization_limit__c",
- hideDefaultActions: true,
- wrapText: true,
- },
- {
- label: "鍑鸿揣鏁伴噺",
- fieldName: 'outboundCount',
- hideDefaultActions: true,
- cellAttributes: { alignment: "right" },
- }
- ];
- @track salesData = [];
-
- @track salesErrorColumns = [
- {
- label: "娑堣�楀搧璁㈠崟",
- fieldName: "ConsumableorderminorUrl",
- hideDefaultActions: true,
- type: "url",
- typeAttributes: {
- label: { fieldName: "Consumable_order_minor__c" },
- target: "_blank",
- },
- wrapText: true,
- },
- {
- label: "娑堣�楀搧鏄庣粏2鍚嶇О",
- fieldName: "orderdetails2Name",
- hideDefaultActions: true,
- initialWidth: 150,
- wrapText: true,
- },
- {
- label: "娑堣�楀搧鍚嶇О",
- fieldName: "ProdName",
- hideDefaultActions: true,
- wrapText: true,
- },
- {
- label: "鍗曚綅",
- fieldName: "Box_Piece__c",
- hideDefaultActions: true,
- wrapText: true,
- initialWidth: 50
- },
- {
- label: "BarCode",
- fieldName: "Bar_Code__c",
- hideDefaultActions: true,
- wrapText: true,
- initialWidth: 380
- },
- {
- label: "浣跨敤鏈熼檺",
- fieldName: "Sterilization_limit__c",
- hideDefaultActions: true,
- wrapText: true,
- },
- {
- label: "閿欒鍘熷洜",
- fieldName: "ErrorReason",
- hideDefaultActions: true,
- wrapText: true,
- },
- ];
- @track salesErrorData = [];
- @track salesAccountName = "";
- @track salesUserWorkLocation = "";
- @track salesAccountid = "";
- @track salesOrderdetails = [];
- @track salesCoc = {};
- @track salesOrderpieceorboxMap;
- @track salesOrderpriceMap;
- @track salesOrderagencypriceMap;
-
- //鏄剧ず鎸夐挳
- @track isSaveShow = false;
- @track isEditShow = false;
- @track isDeliveryShow = false;
- @track isOpenToInvoiceShow = false;
- @track isPraseToPDFShow = false;
- @track isOpenReportShow = false;
- @track isDeleteShow = false;
- @track isFileShow = false;
- @track isShippingSales = false;
- @track isSales = false;
- @track isBarcode = true;
- @track isShowInformation = true;
- @track isShowOutboundProductDetails = false;
- @track showAttPop = false;
- @track showPopSpinner = false;
-
- //disable鎸夐挳
- @track isEditDisabled = false;
- @track isDeliveryDisabled = false;
- @track isOpenToInvoiceDisabled = true;
- @track isPraseToPDFDisabled = true;
- @track isOpenReportDisabled = true;
- @track isDeleteDisabled = false;
-
- //鍑哄簱鍗曚俊鎭�
- @track cocId = "";
- @track EditAble = false;
- @track summonsStatusPriceNotDetermined = false;
- @track isSummonsForDirctionTwoShow = false;
- @track isSummonsFlag = false;
- @track isConInvoiceShow = false;
- @track sumPrice = "";
- @track isSearchShow = false;
- @track Existarrive = false;
- @track Category3 = "";
- @track category3Options = [];
- @track Category4 = "";
- @track category4Options = [];
- @track Category5 = "";
- @track category5Options = [];
- //鍙戠エid
- @track invoiceId = '';
-
- //浜岀骇缁忛攢鍟�
- @track secondaryDistributor = "";
- @track secondaryDistributorOptions = [];
- @track isDisabledSecondaryDistributor = false;
-
- //缁忛攢鍟嗗綍鍏�
- @track ForDealerText = "";
- @track isDisabledForDealerText = false;
-
- //瀹㈡埛鍚�
- @track isModalOpen = false;
- @track HospitalName = "";
- @track searchHospitalName = "";
- @track OECId = "";
- @track isDisabledHospitalName = false;
-
- //绉戝
- @track ForCustomerText = "";
- @track isDisabledForCustomerText = false;
-
- //娌℃湁纭畾浠锋牸
- @track NoConfirmedPrice = false;
-
- //娑堣�楀搧鍚嶇О
- @track consumableName = "";
-
- @track agencyProType = "";
- @track accountName = "";
- @track userWorkLocation = "";
- @track OutPattern__c = false;
- @track outOutPattern = "";
-
- //鍑哄簱鍗曟槑缁�
- @track showTable = false;
- @track data = [];
- @track isSelectShow = false;
- @track hidecheckboxcolumn = false;
- @track is345Show = false;
- @track arriveorder = "";
- @track hasHosPro = false;
- @track InvoiceProNotLabel = "";
- @track RrturnProLabel = "";
- @track InvoicedLabel = "";
- @track outOutPatternOptionList = [];
-
- //鏂囦欢涓婁紶
- @track showLoadingSpinner = false;
- @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: "CreatedByName",
- hideDefaultActions: true,
- },
- {
- label: '',
- type: 'tableCellIcon',
- typeAttributes: {
- iconName: 'utility:delete',
- recordId: {
- fieldName: 'Id'
- }
- },
- initialWidth: 50,
- hideDefaultActions: true
- },
- ];
- filesUploaded = [];
- fileContents;
- fileReader;
- content;
- MAX_FILE_SIZE = 1500000;
-
- //鍒嗛〉start
- //@track sortBy = "";
- //@track sortDirection = "asc";
- defaultSortDirection = 'asc';
- sortDirection = 'asc';
- sortedBy;
- @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 SearchDone = '';
- @track hideCheckboxColumn = false;
-
- stylesLoaded = 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");
- });
- }
- }
-
-
- //InvoiceProNotLabel RrturnProLabel InvoicedLabel
- @wire(getObjectInfo, { objectApiName: OPPORTUNITY_OBJECT })
- oppInfo({ data, error }) {
- if (data) {
- 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);
- }
- }
-
- //鑾峰彇閾炬帴鍙傛暟
- 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;
- }
- connectedCallback() {
- 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;
- //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.isShowInformation = false;
- }
- 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));
-
- 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.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);
-
- 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);
- switch (value) {
- case "鐩存帴閿�鍞粰鍖婚櫌":
- this.isDisabledHospitalName = false;
- this.isDisabledForCustomerText = false;
- this.secondaryDistributor = "";
- this.ForDealerText = "";
->>>>>>> LEXCommunityLiJun
this.cocLwc['Order_ForDealerText__c'] = '';
this.isDisabledForDealerText = true;
this.isDisabledSecondaryDistributor = true;
this.isMutualTransferGoods = false;
break;
-<<<<<<< HEAD
case '鍖婚櫌璇曠敤':
-=======
- case "鍖婚櫌璇曠敤":
->>>>>>> LEXCommunityLiJun
this.isDisabledHospitalName = false;
this.isDisabledForCustomerText = false;
this.isDisabledForDealerText = false;
this.isDisabledSecondaryDistributor = false;
this.isMutualTransferGoods = false;
break;
-<<<<<<< HEAD
case '閿�鍞粰浜岀骇缁忛攢鍟�':
-=======
- case "閿�鍞粰浜岀骇缁忛攢鍟�":
->>>>>>> LEXCommunityLiJun
this.isDisabledHospitalName = false;
this.isDisabledForCustomerText = false;
this.isDisabledForDealerText = false;
this.isDisabledSecondaryDistributor = false;
this.isMutualTransferGoods = false;
break;
-<<<<<<< HEAD
case '浜掔浉璋冭揣':
-=======
- case "浜掔浉璋冭揣":
->>>>>>> LEXCommunityLiJun
this.isDisabledHospitalName = true;
this.HospitalName = '';
this.OECId = '';
@@ -2470,7 +1342,6 @@
}
dataChange(event) {
-<<<<<<< HEAD
let fieldName = event.target.getAttribute('data-field');
let value = event.detail.value;
console.log('fieldName = ' + fieldName + ' value = ' + value);
@@ -2507,44 +1378,6 @@
this.consumableName = value;
break;
case 'Category3':
-=======
- let fieldName = event.target.getAttribute("data-field");
- let value = event.detail.value;
- console.log("fieldName = " + fieldName + " value = " + value);
- switch (fieldName) {
- case "summonsForDirction":
- this.summonsForDirction = value;
- break;
- case "secondaryDistributor":
- this.secondaryDistributor = value;
- break;
- case "HospitalName":
- this.HospitalName = value;
- break;
- case "outOutPattern":
- this.outOutPattern = value;
- break;
- case "ForDealerText":
- this.ForDealerText = value;
- this.cocLwc["Order_ForDealerText__c"] = value;
- break;
- case "ForCustomerText":
- this.cocLwc["Order_ForCustomerText__c"] = value;
- this.ForCustomerText = value;
- break;
- case "sumPrice":
- this.sumPrice = value.toFixed(2);
- break;
- case "NoConfirmedPrice":
- this.NoConfirmedPrice = !this.NoConfirmedPrice;
- this.cocLwc["NoConfirmedPrice__c"] = this.NoConfirmedPrice;
- console.log("this.NoConfirmedPrice = " + this.NoConfirmedPrice);
- break;
- case "consumableName":
- this.consumableName = value;
- break;
- case "Category3":
->>>>>>> LEXCommunityLiJun
this.Category3 = value;
//璋冪敤鍚庡彴鏄剧ず绗洓浜斿垎绫�
this.showAllCate();
@@ -2553,11 +1386,7 @@
this.Category5 = '';
}
break;
-<<<<<<< HEAD
case 'Category4':
-=======
- case "Category4":
->>>>>>> LEXCommunityLiJun
this.Category4 = value;
//璋冪敤鍚庡彴鏄剧ず绗簲鍒嗙被
this.showCate();
@@ -2565,7 +1394,6 @@
this.Category5 = '';
}
break;
-<<<<<<< HEAD
case 'Category5':
this.Category5 = value;
break;
@@ -2577,25 +1405,11 @@
break;
case 'Order_ForDealerText__c':
this.cocLwc['Order_ForDealerText__c'] = value;
-=======
- case "Category5":
- this.Category5 = value;
- break;
- case "searchHospitalName":
- this.searchHospitalName = value;
- break;
- case "Barcode":
- this.Barcode = value;
- break;
- case "Order_ForDealerText__c":
- this.cocLwc["Order_ForDealerText__c"] = value;
->>>>>>> LEXCommunityLiJun
break;
}
}
showAllCate() {
-<<<<<<< HEAD
console.log('showAllCate');
categoryAllload({
category3Lwc: this.Category3
@@ -2677,81 +1491,6 @@
console.log('this.invoiceId = ' + this.invoiceId);
}
-=======
- 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');
- }
- }).catch((error) => {
- console.log("error" + JSON.stringify(error));
- });
- }
-
- showCate() {
- 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');
- }
- }).catch((error) => {
- console.log("error" + JSON.stringify(error));
- });
- }
-
- invoiceChange(event) {
- this.invoiceId = event.target.value;
- console.log('this.invoiceId = ' + this.invoiceId);
- }
-
->>>>>>> LEXCommunityLiJun
showMyToast(title, message, variant) {
this.isShowSpinner = false;
this.showLoadingSpinner = false;
@@ -2765,7 +1504,6 @@
iconName = 'utility:error';
}
if (message != '') {
-<<<<<<< HEAD
content =
'<h2><strong>' +
title +
@@ -2778,60 +1516,34 @@
this.template
.querySelector('c-common-toast')
.showToast(variant, content, iconName, 10000);
-=======
- 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);
->>>>>>> LEXCommunityLiJun
}
searchProductJs() {
this.isEditShowSpinner = true;
//this.showTable = false;
//鏌ヨ鏈夊摢浜涢�夋嫨浜嗙殑鐒跺悗check
-<<<<<<< HEAD
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;
-=======
- 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;
->>>>>>> LEXCommunityLiJun
}
for (var i in this.data) {
for (var j in selectedRows) {
if (this.data[i].Id == selectedRows[j].Id) {
-<<<<<<< HEAD
this.data[i]['check'] = true;
-=======
- this.data[i]["check"] = true;
->>>>>>> LEXCommunityLiJun
}
}
}
let cloneData = this.deepClone(this.data);
for (var i in cloneData) {
-<<<<<<< HEAD
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;
->>>>>>> LEXCommunityLiJun
delete cloneData[i].Name__c;
delete cloneData[i].Category3__c;
delete cloneData[i].Category4__c;
@@ -2839,11 +1551,7 @@
delete cloneData[i].Box_Piece__c;
}
-<<<<<<< HEAD
console.log('cloneData = ' + JSON.stringify(cloneData));
-=======
- console.log("cloneData = " + JSON.stringify(cloneData));
->>>>>>> LEXCommunityLiJun
searchConsumableorderdetails({
agencyProTypeLwc: this.agencyProType,
accountNameLwc: this.accountName,
@@ -2855,18 +1563,13 @@
category5: this.Category5,
editAbleLwc: this.EditAble,
pageRecordsLwcLwc: cloneData,
-<<<<<<< HEAD
consumableproductdetailsRecordsLwc:
this.consumableproductdetailsRecords,
-=======
- consumableproductdetailsRecordsLwc: this.consumableproductdetailsRecords,
->>>>>>> LEXCommunityLiJun
arriveorderLwc: this.arriveorder,
pageSizeLWC: this.pageSize,
pageTokenLWC: this.currentPageToken
}).then((r) => {
r = JSON.parse(JSON.stringify(r));
-<<<<<<< HEAD
console.log('r = ' + JSON.stringify(r));
if (r.status == 'Success') {
//鍒嗛〉
@@ -2874,18 +1577,10 @@
'r.entity.paginatedAccounts = ' +
JSON.stringify(r.entity.paginatedAccounts)
);
-=======
- console.log("r = " + JSON.stringify(r));
- if (r.status == "Success") {
-
- //鍒嗛〉
- console.log('r.entity.paginatedAccounts = ' + JSON.stringify(r.entity.paginatedAccounts));
->>>>>>> LEXCommunityLiJun
this.nextPageToken = r.entity.paginatedAccounts.nextPageToken;
this.totalRecords = r.entity.paginatedAccounts.totalRecords;
this.recordStart = r.entity.paginatedAccounts.recordStart;
this.recordEnd = r.entity.paginatedAccounts.recordEnd;
-<<<<<<< HEAD
this.totalPages = Math.ceil(
r.entity.paginatedAccounts.totalRecords / this.pageSize
);
@@ -2893,13 +1588,6 @@
this.hasHosPro = r.entity.hasHosPro;
console.log('this.hasHosPro = ' + this.hasHosPro);
-=======
- 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);
->>>>>>> LEXCommunityLiJun
this.SearchDone = r.entity.SearchDone;
let tempData = [];
@@ -2909,7 +1597,6 @@
let unitOptions = [];
for (var key in tempData[i].boxorpieceMap) {
let unitOption = {};
-<<<<<<< HEAD
unitOption['label'] = tempData[i].boxorpieceMap[key];
unitOption['value'] = key;
unitOptions.push(unitOption);
@@ -2993,66 +1680,11 @@
tempData[i]['shipmentNumber'],
tempData[i]['shippingUnitPrice'],
'*'
-=======
- 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"];
- 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"];
- } else {
- tempData[i]["InvoiceProNot_count__c"] =
- tempData[i].orderdetails1.InvoiceProNot_count__c;
- tempData[i]["RrturnPro_count__c"] =
- tempData[i].orderdetails1.RrturnPro_count__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]["Id"] = tempData[i].Prod.Id;
-
- console.log('tempData[i]["hospitalSpecialOffer"] = ' + tempData[i]["hospitalSpecialOffer"])
- if (this.hasHosPro) {
- if (tempData[i]["hospitalSpecialOffer"]) {
- tempData[i]["Id"] = tempData[i].Prod.Id + 'ishos';
- } else {
- 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;
-
- if (tempData[i]["shippingUnitPrice"] && tempData[i]["shipmentNumber"])
- tempData[i]["shipmentAmount"] = this.amend(
- tempData[i]["shipmentNumber"],
- tempData[i]["shippingUnitPrice"],
- "*"
->>>>>>> LEXCommunityLiJun
);
if (tempData[i]['check']) {
this.selectedRows.push(tempData[i].Id);
}
-<<<<<<< HEAD
-=======
-
->>>>>>> LEXCommunityLiJun
}
this.data = tempData;
@@ -3060,26 +1692,17 @@
console.log('this.hasHosPro = ' + this.hasHosPro);
if (this.hasHosPro) {
let object1 = {
-<<<<<<< HEAD
label: '鍖婚櫌鐗逛环',
fieldName: 'hospitalSpecialOffer',
type: 'boolean',
initialWidth: 80,
hideDefaultActions: true
-=======
- label: "鍖婚櫌鐗逛环",
- fieldName: "hospitalSpecialOffer",
- type: 'boolean',
- initialWidth: 80,
- hideDefaultActions: true,
->>>>>>> LEXCommunityLiJun
};
this.columns.push(object1);
this.editColumns.push(object1);
}
this.columns = [...this.columns];
this.editColumns = [...this.editColumns];
-<<<<<<< HEAD
console.log('this.columns = ' + JSON.stringify(this.columns));
console.log('this.data = ' + JSON.stringify(this.data));
console.log(
@@ -3089,20 +1712,10 @@
this.isEditShowSpinner = false;
} else {
console.log('r = ' + JSON.stringify(r));
-=======
- 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));
->>>>>>> LEXCommunityLiJun
this.showMyToast('鏌ヨ澶辫触', r.msg, 'Error');
}
});
}
-<<<<<<< HEAD
searchHospitalNameModal() {
console.log('searchHospitalNameModal');
@@ -4251,945 +2864,6 @@
return x[field];
};
-=======
-
- searchHospitalNameModal() {
- console.log("searchHospitalNameModal");
- hospitalInit({
- ctype: this.agencyProType,
- }).then((r) => {
- r = JSON.parse(JSON.stringify(r));
- if (r.status == "Success") {
- this.hospitalList = r.entity.at;
- for (var i in this.hospitalList) {
- this.hospitalList[i]["stateMasterName"] =
- this.hospitalList[i].State_Master__r.Name;
- }
- console.log("hospitalInit r = " + JSON.stringify(this.hospitalList));
- this.isModalOpen = true;
- }
- });
- }
-
- searchHospital() {
- console.log("this.searchHospitalName = " + this.searchHospitalName);
- serContact({
- searchName: this.searchHospitalName,
- ctype: this.agencyProType,
- }).then((r) => {
- r = JSON.parse(JSON.stringify(r));
- if (r.status == "Success") {
- this.hospitalList = r.entity.at;
- for (var i in this.hospitalList) {
- this.hospitalList[i]["stateMasterName"] =
- this.hospitalList[i].State_Master__r.Name;
- }
- console.log("hospitalInit r = " + JSON.stringify(this.hospitalList));
- }
- });
- }
-
- searchHandleRowAction(event) {
- 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.isModalOpen = false;
- console.log("this.isModalOpen = " + this.isModalOpen);
- }
-
- clearAgencyI(event) {
- this.HospitalName = event.target.value;
- 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 != "") {
- this.checkOutPattern();
- }
- }
-
- checkOutPattern() {
- //鏍规嵁鐢ㄦ埛閫変腑鐨勪骇鍝佺粰 鍑哄簱鍗曚笂鐨勬槸鍚﹀尰闄㈢壒浠峰嚭搴撳瓧娈佃祴鍊�
- let ishos = 0;
- for (var i in this.data) {
- if (
- this.data[i].check == true &&
- this.data[i].hospitalSpecialOffer == true
- ) {
- ishos = ishos + 1;
- }
- }
- if (ishos > 0) {
- this.cocLwc["OutPattern__c"] = true;
- } else {
- this.cocLwc["OutPattern__c"] = false;
- }
- }
-
- closeModal() {
- this.isModalOpen = false;
- }
-
- handleUnitChange(event) {
- console.log("handleUnitChange");
- const unitDetail = event.detail;
- 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;
- }
- }
- console.log("this.data = " + JSON.stringify(this.data));
- }
-
- handleShipmentNumber(event) {
- console.log("handleShipmentNumber");
- const numberDetail = event.detail;
- 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"] != '') {
- 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.data[i].check = false;
- }
- this.selectedRows = [...this.selectedRows];
- console.log('this.selectedRows = ' + JSON.stringify(this.selectedRows));
- }
- }
- this.data = [...this.data];
- this.ComputePrice(
- index,
- this.data[index].shipmentNumber,
- this.data[index].shippingUnitPrice
- );
- }
-
- handleShipmentUnitPrice(event) {
- console.log("handleShipmentUnitPrice");
- const priceDetail = event.detail;
- let index = 0;
- for (var i in this.data) {
- if (this.data[i].Id == priceDetail.data.recordId) {
- index = i;
- this.data[i].shippingUnitPrice = Number(
- priceDetail.data.shipmentunitprice
- );
- this.data[i].orderdetails1["Delivery_List_RMB__c"] = Number(
- priceDetail.data.shipmentunitprice
- );
- }
- }
- this.ComputePrice(
- index,
- this.data[index].shipmentNumber,
- this.data[index].shippingUnitPrice
- );
- }
-
- 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);
- 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;
- }
- this.sumPrice = sumPrice.toFixed(2) + "鍏�";
- //瀛樹笅閫夋嫨琛岋紝涓嶄細琚竻绌�
- // if (this.selectedRows.indexOf(this.data[index].Id) == -1)
- // this.selectedRows.push(this.data[index].Id);
- // this.selectedRows = [];
- // for (var i in this.data) {
- // if (this.data[i].check) {
- // this.selectedRows.push(this.data[i].Id);
- // }
- // }
- this.data = [...this.data];
- // this.selectedRows = [...this.selectedRows]
- // console.log("this.selectedRows = " + JSON.stringify(this.selectedRows));
- console.log("this.data = " + JSON.stringify(this.data));
- }
-
- //num1 num2浼犲叆涓や釜鍊� symbol +-*/绗﹀彿
- amend(num1, num2, symbol) {
- var str1 = num1.toString(),
- str2 = num2.toString(),
- result,
- str1Length,
- str2Length;
- //瑙e喅鏁存暟娌℃湁灏忔暟鐐规柟娉�
- try {
- str1Length = str1.split(".")[1].length;
- } catch (error) {
- str1Length = 0;
- }
- try {
- str2Length = str2.split(".")[1].length;
- } catch (error) {
- str2Length = 0;
- }
- var step = Math.pow(10, Math.max(str1Length, str2Length));
- //
- console.log(step);
- switch (symbol) {
- case "+":
- result = (num1 * step + num2 * step) / step;
- break;
- case "-":
- result = (num1 * step - num2 * step) / step;
- break;
- case "*":
- result = (num1 * step * (num2 * step)) / step / step;
- break;
- case "/":
- result = (num1 * step) / (num2 * step);
- break;
- default:
- break;
- }
- return result;
- }
-
- getSelectedRows(event) {
- let selectedRowsEvent = event.detail.selectedRows;
- console.log('selectedRowsEvent = ' + JSON.stringify(selectedRowsEvent))
- this.selectedRows = [];
- for (var i in selectedRowsEvent) {
- this.selectedRows.push(selectedRowsEvent[i].Id)
- }
- // for (var i in this.data) {
- // for (var j in selectedRowsEvent) {
- // if (this.data[i].Id == selectedRowsEvent[j].Prod.Id) {
- // this.ComputePrice(
- // i,
- // this.data[i].shipmentNumber,
- // this.data[i].shippingUnitPrice
- // );
- // }
- // }
- // }
- // this.ComputePrice(
- // index,
- // this.data[index].shipmentNumber,
- // this.data[index].shippingUnitPrice
- // );
- // const selectedRows = event.detail.selectedRows;
- // console.log("this.selectedRows = " + this.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].Id == selectedRows[j].Id) {
- // this.data[i]["check"] = true;
- // }
- // }
- // }
- }
-
- saveConfirmJs() {
- let msg = "鍑哄簱浠锋牸浠呭彲鎿嶄綔涓�娆″彉鏇达紝淇濆瓨鍚庡皢鏃犳硶淇敼銆俓n\n璇风‘璁わ紒";
- if (this.SummonsStatus == "浠锋牸鏈畾") {
- if (confirm(msg) == true) {
- this.saveConfirm();
- }
- } else {
- this.saveConfirm();
- }
- }
-
- deepClone(obj) {
- return JSON.parse(JSON.stringify(obj));
- }
-
- saveConfirm() {
- this.isShowSpinner = true;
-
- //鏌ヨ鏈夊摢浜涢�夋嫨浜嗙殑鐒跺悗check
- 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;
- }
- for (var i in this.data) {
- for (var j in selectedRows) {
- if (this.data[i].Id == selectedRows[j].Id) {
- 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]["shippingUnitPrice"] = cloneData[i]["shippingUnitPrice"] == '' ? 0 : cloneData[i]["shippingUnitPrice"];
- 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("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)
- );
- save({
- cocLwc: this.cocLwc,
- hospitalInfoLwc: this.OECId,
- hospitalNameLwc: this.HospitalName,
- secondaryDistributorLwc: this.secondaryDistributor,
- pageRecordsLwc: cloneData,
- accountidLwc: this.accountid,
- ESetIdLwc: this.ESetid,
- 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));
- });
- }
-
- //鎵撳嵃鎸囩ず鍗�
- PraseToPDFJs() {
- console.log("this.cocLwc = " + JSON.stringify(this.cocLwc));
- console.log("this.ESetId = " + this.ESetid);
- PraseToPDF({
- cocLwc: this.cocLwc,
- 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);
- } else {
- console.log("r.msg = " + r.msg);
- this.showMyToast('鎵撳嵃澶辫触', r.msg, 'Error');
- }
- });
- }
-
- //鏄剧ず鏄庣粏
- 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"}]';
- let reportUrl = this.label.ConsumableOutboundReportId;
- 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",
- // attributes: {
- // url: url,
- // target: '_blank'
- // },
- // });
- }
-
- vpClear2Delay(event) {
- 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));
- // console.log('this.cocLwc = ' + JSON.stringify(this.cocLwc));
- // this.ForDealerText = this.cocLwc['Order_ForDealerText__c'];
- // event.target.value = this.cocLwc['Order_ForDealerText__c'];
- // console.log('this.ForDealerText = ' + this.ForDealerText);
- }
- }
- handleSearch(event) {
- const lookupElement = event.target;
- 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));
- });
- }
-
- 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));
- }
-
- handleFilesChange(event) {
- console.log("handleFilesChange");
- if (event.target.files.length > 0) {
- this.filesUploaded = event.target.files;
- this.fileName = event.target.files[0].name;
- }
- }
-
- handleSave() {
- console.log("saveFile");
- if (this.filesUploaded.length > 0) {
- this.file = this.filesUploaded[0];
- if (this.file.size > this.MAX_FILE_SIZE) {
- this.showMyToast('淇濆瓨澶辫触', '鏂囦欢杩囧ぇ', 'Error');
- return;
- }
- this.showPopSpinner = true;
- this.fileReader = new FileReader();
-
- this.fileReader.onloadend = () => {
- this.fileContents = this.fileReader.result;
- 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 = "閫夋嫨涓�涓枃浠朵笂浼�";
- }
- }
-
- saveToFile() {
- 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');
- });
- }
-
- 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');
- });
- }
-
- GoodsDeliveryJs() {
- this.isShowSpinner = true;
-
- //鏌ヨ鏈夊摢浜涢�夋嫨浜嗙殑鐒跺悗check
- 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;
- }
- for (var i in this.data) {
- for (var j in selectedRows) {
- if (this.data[i].Id == selectedRows[j].Id) {
- 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;
- 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));
- 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');
- });
- }
-
- 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;
- }
- }
- }
- }
- 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);
- this.isShowSpinner = true;
- SearchPro({
- cocLwc: this.salesCoc,
- barcodeLwc: this.Barcode,
- accountName: this.salesAccountName,
- 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;
- }
- }
- }
-
- //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');
- }
- }).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
- }
- }
- console.log('this.salesData = ' + JSON.stringify(this.salesData))
- }
-
- SaveP() {
- let cloneSalesData = this.salesData;
- for (var i in cloneSalesData) {
- delete cloneSalesData[i].Consumable_order_minor__c;
- delete cloneSalesData[i].ConsumableorderminorUrl;
- delete cloneSalesData[i].orderdetails2Name;
- delete cloneSalesData[i].orderdetails2NameUrl;
- delete cloneSalesData[i].Box_Piece__c;
- delete cloneSalesData[i].ProdName;
- delete cloneSalesData[i].Deliver_date__c;
- delete cloneSalesData[i].Bar_Code__c;
- delete cloneSalesData[i].Sterilization_limit__c;
- cloneSalesData[i]["ErrorReason"] = "";
- }
- this.isShowSpinner = true;
- ProSale({
- ESetIdLwc: this.ESetid,
- cocLwc: this.salesCoc,
- barcodeLwc: this.Barcode,
- accountNameLwc: this.salesAccountName,
- userWorkLocationLwc: this.salesUserWorkLocation,
- 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');
- });
- }
-
- SaveE() {
- let cloneSalesData = this.salesData;
- for (var i in cloneSalesData) {
- delete cloneSalesData[i].Consumable_order_minor__c;
- delete cloneSalesData[i].orderdetails2Name;
- delete cloneSalesData[i].orderdetails2NameUrl;
- delete cloneSalesData[i].Box_Piece__c;
- delete cloneSalesData[i].ProdName;
- delete cloneSalesData[i].Deliver_date__c;
- delete cloneSalesData[i].Bar_Code__c;
- delete cloneSalesData[i].Sterilization_limit__c;
- cloneSalesData[i]["ErrorReason"] = "";
- }
- this.isShowSpinner = true;
- ProdElivery({
- ESetIdLwc: this.ESetid,
- cocLwc: this.salesCoc,
- barcodeLwc: this.Barcode,
- accountNameLwc: this.salesAccountName,
- userWorkLocationLwc: this.salesUserWorkLocation,
- 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');
- });
- }
-
- //鍙戠エ
- openToInvoiceJs() {
- 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";
- } else {
- url = "/s/lexconinvoiceview?deliveryId=" + this.ESetid + "&KeyWords=Redirect";
- }
- window.open(url);
- // this[NavigationMixin.Navigate]({
- // type: "standard__webPage",
- // attributes: {
- // url: url,
- // target:'_blank'
- // },
- // });
- }
-
- //鍒犻櫎
- 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');
- });
- }
-
- handleLoad() {
- console.log('handleLoad')
- try {
- const style = document.createElement('style');
- style.innerText = '.hehe-layoutItem .slds-button__icon {display: none;}';
- this.template.querySelector('.hideHelpText').appendChild(style);
- } catch (error) {
- console.log(error);
- }
- }
-
- handleLoad2() {
- console.log('handleLoad2')
- try {
- const style = document.createElement('style');
- 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}';
- this.template.querySelector('.hideHelpText').appendChild(style2);
- } catch (error) {
- console.log(error);
- }
- }
- //缂栬緫鍑哄簱鍗�
- EditConsumable() {
- let url = "/lexsummonscreat?ESetid=" + this.ESetid + "&KeyWords=Redirect";
- this[NavigationMixin.Navigate]({
- type: "standard__webPage",
- attributes: {
- url: url,
- },
- });
- }
-
- //鏄剧ず涓婁紶闄勪欢
- uploadOrder(event) {
- this.showAttPop = true;
- }
-
- //闄勪欢change浜嬩欢
- attChange(event) {
- if (event.target.files.length > 0) {
- this.filesUploaded = event.target.files;
- this.fileName = event.target.files[0].name;
- console.log('this.fileName:' + this.fileName);
- }
- }
-
- //鏄惁鏄剧ず闄勪欢绉婚櫎
- get attDelBtn() {
- if (this.fileName != '' && this.fileName != null && this.fileName != '璇烽�夋嫨涓�涓枃浠朵笂浼�') {
- return true;
- } else {
- return false;
- }
- }
-
- //鍏抽棴闄勪欢寮圭獥
- closePop() {
- this.showAttPop = false;
- this.filesUploaded = [];
- this.fileName = null;
- }
-
- //绉婚櫎闄勪欢
- removeAtt() {
- this.filesUploaded = [];
- this.fileName = '';
- }
-
- ClearJs() {
- this.consumableName = '';
- this.Category3 = '';
- this.Category4 = '';
- this.Category5 = '';
- this.searchProductJs();
- }
-
- sortBy(field, reverse, primer) {
- const key = primer
- ? function (x) {
- return primer(x[field]);
- }
- : function (x) {
- return x[field];
- };
-
->>>>>>> LEXCommunityLiJun
return function (a, b) {
a = key(a);
b = key(b);
@@ -5198,15 +2872,10 @@
}
onHandleSort(event) {
-<<<<<<< HEAD
-=======
-
->>>>>>> LEXCommunityLiJun
//灏嗗凡缁忛�夊ソ浜嗙殑鏀惧埌鍓嶉潰锛屼笉杩涜鎺掑簭
if (this.EditAble) {
const { fieldName: sortedBy, sortDirection } = event.detail;
const cloneData = [...this.data];
-<<<<<<< HEAD
cloneData.sort(
this.sortBy(sortedBy, sortDirection === 'asc' ? 1 : -1)
);
@@ -5214,11 +2883,6 @@
let selectedRows = this.template
.querySelector('c-lex-custom-lightning-datatable')
.getSelectedRows();
-=======
- cloneData.sort(this.sortBy(sortedBy, sortDirection === 'asc' ? 1 : -1));
- let index = 0;
- let selectedRows = this.template.querySelector('c-lex-custom-lightning-datatable').getSelectedRows();
->>>>>>> LEXCommunityLiJun
let selectedRowsIds = [];
for (var i in selectedRows) {
selectedRowsIds.push(selectedRows[i].Id);
@@ -5240,13 +2904,9 @@
} else {
const { fieldName: sortedBy, sortDirection } = event.detail;
const cloneData = [...this.editData];
-<<<<<<< HEAD
cloneData.sort(
this.sortBy(sortedBy, sortDirection === 'asc' ? 1 : -1)
);
-=======
- cloneData.sort(this.sortBy(sortedBy, sortDirection === 'asc' ? 1 : -1));
->>>>>>> LEXCommunityLiJun
this.editData = cloneData;
this.sortDirection = sortDirection;
this.sortedBy = sortedBy;
@@ -5254,22 +2914,14 @@
}
handlePrevious() {
-<<<<<<< HEAD
this.currentPageToken =
Number(this.currentPageToken) - Number(this.pageSize);
-=======
- this.currentPageToken = Number(this.currentPageToken) - Number(this.pageSize);
->>>>>>> LEXCommunityLiJun
this.searchProductJs();
}
handleNext() {
-<<<<<<< HEAD
this.currentPageToken =
Number(this.currentPageToken) + Number(this.pageSize);
-=======
- this.currentPageToken = Number(this.currentPageToken) + Number(this.pageSize);
->>>>>>> LEXCommunityLiJun
this.searchProductJs();
}
handleFirst() {
@@ -5278,12 +2930,8 @@
}
handleLast() {
-<<<<<<< HEAD
this.currentPageToken =
this.totalPages > 1 ? (this.totalPages - 1) * this.pageSize : 0;
-=======
- this.currentPageToken = this.totalPages > 1 ? (this.totalPages - 1) * this.pageSize : 0;
->>>>>>> LEXCommunityLiJun
this.searchProductJs();
}
@@ -5294,26 +2942,15 @@
this.searchProductJs();
}
-<<<<<<< HEAD
editHandlePrevious() {
this.currentPageToken =
Number(this.currentPageToken) - Number(this.pageSize);
-=======
-
-
- editHandlePrevious() {
- this.currentPageToken = Number(this.currentPageToken) - Number(this.pageSize);
->>>>>>> LEXCommunityLiJun
this.searchEditProductJs();
}
editHandleNext() {
-<<<<<<< HEAD
this.currentPageToken =
Number(this.currentPageToken) + Number(this.pageSize);
-=======
- this.currentPageToken = Number(this.currentPageToken) + Number(this.pageSize);
->>>>>>> LEXCommunityLiJun
this.searchEditProductJs();
}
editHandleFirst() {
@@ -5322,12 +2959,8 @@
}
editHandleLast() {
-<<<<<<< HEAD
this.currentPageToken =
this.totalPages > 1 ? (this.totalPages - 1) * this.pageSize : 0;
-=======
- this.currentPageToken = this.totalPages > 1 ? (this.totalPages - 1) * this.pageSize : 0;
->>>>>>> LEXCommunityLiJun
this.searchEditProductJs();
}
@@ -5346,7 +2979,6 @@
statusEdit: this.statusEdit,
pageSizeLWC: this.pageSize,
pageTokenLWC: this.currentPageToken
-<<<<<<< HEAD
})
.then((r) => {
r = JSON.parse(JSON.stringify(r));
@@ -5421,53 +3053,6 @@
.catch((error) => {
this.showMyToast('閿欒', '鎼滅储澶辫触', 'Error');
});
-=======
- }).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[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');
- }
- }).catch((error) => {
- this.showMyToast('閿欒', '鎼滅储澶辫触', 'Error');
- });
->>>>>>> LEXCommunityLiJun
}
get previousButtonDisabled() {
@@ -5482,7 +3067,6 @@
deleteAtt(event) {
this.isShowSpinner = true;
//var recordId = event.detail.data.recordId;
-<<<<<<< HEAD
var recordId = event.target.getAttribute('data-fileid');
console.log('attid:' + recordId);
deleteAtt({
@@ -5502,22 +3086,3 @@
});
}
}
-=======
- 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');
- })
- }
-}
->>>>>>> LEXCommunityLiJun
diff --git a/force-app/main/default/lwc/lexTopPage/lexTopPage.html b/force-app/main/default/lwc/lexTopPage/lexTopPage.html
index 240670e..fbd71f0 100644
--- a/force-app/main/default/lwc/lexTopPage/lexTopPage.html
+++ b/force-app/main/default/lwc/lexTopPage/lexTopPage.html
@@ -308,8 +308,4 @@
<div class="slds-backdrop slds-backdrop_open"></div>
</template>
</template>
-<<<<<<< HEAD
</template>
-=======
-</template>
->>>>>>> LEXCommunityLiJun
diff --git a/force-app/main/default/lwc/lexTopPage/lexTopPage.js b/force-app/main/default/lwc/lexTopPage/lexTopPage.js
index 972ef65..88ffbbb 100644
--- a/force-app/main/default/lwc/lexTopPage/lexTopPage.js
+++ b/force-app/main/default/lwc/lexTopPage/lexTopPage.js
@@ -650,7 +650,6 @@
editProductLimit(event) {
//add by Wang Xueqin 2023/05/05
//let url =
-<<<<<<< HEAD
// '/LexProductLimitEdit?accountid=' +
// this.accountId +
// '&userPro_Type=' +
@@ -660,13 +659,6 @@
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;
->>>>>>> LEXCommunityLiJun
const config = {
type: 'standard__webPage',
attributes: {
@@ -805,8 +797,4 @@
get nextButtonDisabled() {
return this.nextPageToken === undefined;
}
-<<<<<<< HEAD
}
-=======
-}
->>>>>>> LEXCommunityLiJun
diff --git a/force-app/main/default/lwc/lexinventoryViewLWC/lexinventoryViewLWC.html b/force-app/main/default/lwc/lexinventoryViewLWC/lexinventoryViewLWC.html
index 4b07073..2034d60 100644
--- a/force-app/main/default/lwc/lexinventoryViewLWC/lexinventoryViewLWC.html
+++ b/force-app/main/default/lwc/lexinventoryViewLWC/lexinventoryViewLWC.html
@@ -267,11 +267,7 @@
sorted-by={sortedBy}
onsort={onHandleSort}
hide-checkbox-column={hidecheckboxcolumn}
-<<<<<<< HEAD
style="word-wrap: break-word; word-break: break-all"
-=======
- style="word-wrap:break-word; word-break:break-all;"
->>>>>>> LEXCommunityLiJun
class="wrapped-header-datatable"
>
</c-lex-custom-lightning-datatable>
@@ -283,10 +279,7 @@
onfirst={handleFirst}
onlast={handleLast}
page-size-options={pageSizeOptions}
-<<<<<<< HEAD
-=======
default-page-size={pageSize}
->>>>>>> LEXCommunityLiJun
previous-button-disabled={previousButtonDisabled}
next-button-disabled={nextButtonDisabled}
record-start={recordStart}
@@ -297,8 +290,4 @@
</div>
</div>
</div>
-<<<<<<< HEAD
</template>
-=======
-</template>
->>>>>>> LEXCommunityLiJun
diff --git a/force-app/main/default/lwc/lexinventoryViewLWC/lexinventoryViewLWC.js b/force-app/main/default/lwc/lexinventoryViewLWC/lexinventoryViewLWC.js
index c532a8a..7fb5f5c 100644
--- a/force-app/main/default/lwc/lexinventoryViewLWC/lexinventoryViewLWC.js
+++ b/force-app/main/default/lwc/lexinventoryViewLWC/lexinventoryViewLWC.js
@@ -15,11 +15,7 @@
//鍒嗛〉start
@track sortBy = '';
//@track sortDirection = "asc";
-<<<<<<< HEAD
- @track pageSize = 10;
-=======
@track pageSize = 200;
->>>>>>> LEXCommunityLiJun
error;
records;
currentPageToken = 0;
@@ -29,11 +25,7 @@
@track pageNumber = 1;
@track paginationVisibility = false;
@track totalPages = 1;
-<<<<<<< HEAD
- pageSizeOptions = [10, 25, 50, 100];
-=======
pageSizeOptions = [100, 200, 300];
->>>>>>> LEXCommunityLiJun
@track recordStart = 0;
@track recordEnd = 0;
//end
@@ -671,7 +663,6 @@
} else {
this.rowNumberOffset = 0;
}
-<<<<<<< HEAD
}
handlePrevious() {
@@ -733,66 +724,3 @@
.showToast(variant, content, iconName, 10000);
}
}
-=======
- }
-
- handlePrevious() {
- this.currentPageToken =
- Number(this.currentPageToken) - Number(this.pageSize);
- this.searchOrderDetail();
- }
-
- handleNext() {
- this.currentPageToken =
- Number(this.currentPageToken) + Number(this.pageSize);
- this.searchOrderDetail();
- }
- handleFirst() {
- this.currentPageToken = 0;
- this.searchOrderDetail();
- }
-
- handleLast() {
- this.currentPageToken =
- this.totalPages > 1 ? (this.totalPages - 1) * this.pageSize : 0;
- this.searchOrderDetail();
- }
-
- handlePageschange(event) {
- console.log(event.detail);
- this.pageSize = event.detail;
- this.currentPageToken = 0;
- this.searchOrderDetail();
- }
- get previousButtonDisabled() {
- return this.currentPageToken === 0;
- }
-
- get nextButtonDisabled() {
- return this.nextPageToken === undefined;
- }
- 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);
- }
-}
->>>>>>> LEXCommunityLiJun
diff --git a/force-app/main/default/pages/DealerInquiryModifyState.page b/force-app/main/default/pages/DealerInquiryModifyState.page
index 5fe5a08..4fc33f6 100644
--- a/force-app/main/default/pages/DealerInquiryModifyState.page
+++ b/force-app/main/default/pages/DealerInquiryModifyState.page
@@ -1,4 +1,3 @@
-<<<<<<< HEAD
<apex:page
controller="DealerInquiryModifyStateController"
docType="html-5.0"
@@ -334,174 +333,6 @@
width: 178px;
} /*娲诲姩璁″垝(閿�鍞�)*/
/*table.list .col_Link1 {width:58px;}
-=======
-<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)}"/>
-
-<style>
- td .dateFormat {
- display: none;
- }
-
- div.inline { float:left; }
-
- .clearBoth { clear:both; }
-
- div.reportBlock table.list {
- width:auto;
- }
-
- 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#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
- }
-
- 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.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.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;}
- }
-
- table.list td {width:100px; }
-
- table.list td select {width:95%;}
-
- table.list td input {width:95%;}
-
- 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;}
->>>>>>> LEXCommunityLiJun
table.list .col_Link2 {width:58px;}
table.list .col_Link3 {width:58px;}
table.list .col_Link4 {width:58px;}
@@ -509,7 +340,6 @@
table.list .col_Link6 {width:58px;}
table.list .col_Link7 {width:58px;}
table.list .col_Link8 {width:58px;}*/
-<<<<<<< HEAD
body .pbBody table.list tr.headerRow td.colViewing {
/* 銉囥儠銈┿儷銉堝�ゃ�佹渶灏忓寲銈€偆銈炽兂銈掕〃绀� */
background-image: url('{!URLFOR($Resource.IconResizeMinus_5)}');
@@ -561,58 +391,12 @@
role="status"
class="slds-spinner slds-spinner_medium slds-spinner_brand"
>
-=======
- 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>
- <apex:slds />
- <div id="spinner" class="slds-spinner_container" style="display:none;">
- <div role="status" class="slds-spinner slds-spinner_medium slds-spinner_brand">
->>>>>>> LEXCommunityLiJun
<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">
-<<<<<<< HEAD
<apex:actionFunction
name="saveAndSearch"
action="{!save}"
@@ -883,135 +667,10 @@
/>
</apex:repeat>
</tr>
-=======
- <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: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: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}"/>
- </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>
- <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>
->>>>>>> LEXCommunityLiJun
<tr class="headerRow" height="30px">
<apex:variable value="{!0}" var="cnt" />
<apex:repeat value="{!titleLeft}" var="t">
<td class="col_{!columnLeftCss[cnt]}">
-<<<<<<< HEAD
<a
href="#"
onclick="sortTableJs_Account1('{!cnt}');return false;"
@@ -1028,16 +687,10 @@
value="{!cnt + 1}"
var="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" />
->>>>>>> LEXCommunityLiJun
</apex:repeat>
<!-- <td id="cell_Scroll" class="col_Scroll"></td> -->
</tr>
</table>
-<<<<<<< HEAD
</div>
<!-- out_Div -->
<div style="clear: both; height: 0px"></div>
@@ -1075,26 +728,11 @@
<td
class="dataCellBorder1 col_{!columnRightCss[cnt_3]} {!cnt}_col_{!columnRightCss[cnt_3]}"
>
-=======
-
- </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">
- <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:variable value="{!0}" var="cnt_3" />
- <apex:repeat value="{!columnsRightApi}" var="c">
- <td class="dataCellBorder1 col_{!columnRightCss[cnt_3]} {!cnt}_col_{!columnRightCss[cnt_3]}">
-
->>>>>>> LEXCommunityLiJun
<!-- 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 -->
-<<<<<<< HEAD
<apex:outputField
rendered="{!c[0] == 'Change_To_Opportunity_T__c' }"
value="{!or.opp[c[0]]}"
@@ -1114,28 +752,12 @@
</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: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' && (
- 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' && (
- 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}')"/>
->>>>>>> LEXCommunityLiJun
<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> -->
-<<<<<<< HEAD
<apex:outputField
rendered="{!c[0] == 'Strategic_department_Class_Name__c'}"
value="{!or.opp[c[0]]}"
@@ -1375,149 +997,3 @@
</apex:outputPanel>
</apex:form>
</apex:page>
-=======
- <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");
- }
- </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]]}" >
- <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:variable value="{!cnt + 1}" var="cnt" />
- </apex:repeat>
- </table>
-
- </div><!-- /in_Div -->
- </apex:outputPanel>
- </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>
- </apex:outputPanel>
- </apex:form>
-</apex:page>
->>>>>>> LEXCommunityLiJun
diff --git a/force-app/main/default/pages/NewAndEditReport.page b/force-app/main/default/pages/NewAndEditReport.page
index 6846592..e7e9c6e 100644
--- a/force-app/main/default/pages/NewAndEditReport.page
+++ b/force-app/main/default/pages/NewAndEditReport.page
@@ -1,9 +1,15 @@
-<apex:page standardController="Report__c" extensions="NewAndEditReportController" id="page" lightningStylesheets="true">
- <apex:stylesheet value="{!URLFOR($Resource.blockUIcss)}"/>
- <apex:includeScript value="{! URLFOR($Resource.AWSService, 'AWSService.js') }" />
- <apex:includeScript value="{!URLFOR($Resource.jquery183minjs)}"/>
- <apex:includeScript value="{!URLFOR($Resource.PleaseWaitDialog)}"/>
- <apex:includeScript value="{!URLFOR($Resource.connection20)}"/>
+<apex:page
+ standardController="Report__c"
+ extensions="NewAndEditReportController"
+ id="page"
+>
+ <apex:stylesheet value="{!URLFOR($Resource.blockUIcss)}" />
+ <apex:includeScript
+ value="{! URLFOR($Resource.AWSService, 'AWSService.js') }"
+ />
+ <apex:includeScript value="{!URLFOR($Resource.jquery183minjs)}" />
+ <apex:includeScript value="{!URLFOR($Resource.PleaseWaitDialog)}" />
+ <apex:includeScript value="{!URLFOR($Resource.connection20)}" />
<style>
.disabledbutton {
@@ -68,7 +74,7 @@
let t = jQuery("label[for$='textAreaDelegate_"+api_name+"']").parent().next().find("textarea")[0];
if(t && t.id){
return CKEDITOR.instances[t.id]
-
+
}
return null;
}
@@ -227,7 +233,7 @@
// if(phone1 && !/^1[3|5|8|7][0-9]\d{4,8}$/.test(phone1.value)){
// error_msg += ';淇℃伅鎻愪緵浜鸿仈绯绘柟寮忥紙鐢佃瘽锛夊彿鐮侀敊璇�';
// }
-
+
// let phone2 = document.querySelector(textPhone2);
// if(phone2 && !/^1[3|5|8|7][0-9]\d{4,8}$/.test(phone2.value)){
// error_msg += ';鑱旂郴鐢佃瘽鍙风爜閿欒';
@@ -262,7 +268,7 @@
}else{
blankRequiredFields =blankRequiredFields+',' + fieldAPIToLabelMap[requiredFieldAPIList[i]];
}
-
+
}
}
return blankRequiredFields;
@@ -290,7 +296,7 @@
}
return ['input','select','textarea','div'].indexOf(tag_name.toLowerCase())>-1;
}
-
+
function IsFormElement(e){
return IsFormTag(e.tagName);
}
@@ -318,7 +324,7 @@
return JSON.stringify(reportPayloadList);
}
-
+
//5.鏂板缓鎴栫紪杈�
function ProcessPI(reportJson, payloadForNewPI) {
@@ -382,7 +388,7 @@
function replaceSearchContactLookup() {
if (!{!isNewMode}) {
queryContactName();
- }
+ }
if(document.querySelector("[data-id='Practitioner1__c']") != null){
let contactHtmlString = '<img src="/img/s.gif" onclick="searchContact(\'page:form:contactId\',\'Practitioner1__c\')" alt="Reference Document Number Lookup" class="lookupIcon" title="Reference Document Number Lookup (New Window)"/>';
let lookUpNode = htmlToElement(contactHtmlString);
@@ -426,8 +432,8 @@
parentNode.replaceChild(lookUpNode, document.querySelector("[data-id='Person_In_Charge__c']").parentNode.children[2]);
}
}
- var newSearchContactWindow = null;
-
+ var newSearchContactWindow = null;
+
function htmlToElement(html) {
var template = document.createElement('template');
html = html.trim(); // Never return a text node of whitespace as the result
@@ -489,8 +495,8 @@
let accountValue = "";
if (document.querySelector("[data-id='Hospital_Department__c']")) {
let accountNodeId = document.querySelector("[data-id='Hospital_Department__c']").id + '_lkid';
- accountValue = document.getElementById(accountNodeId).value;
- }
+ accountValue = document.getElementById(accountNodeId).value;
+ }
console.log(accountValue);
if(accountValue !='000000000000000'){
let baseUrl = "/apex/SearchContactPage";
@@ -630,7 +636,7 @@
let payloadForNewPI = getPIPayload(reportJson);
console.log('鍔犲瘑瀛楁锛�'+payloadForNewPI);
- //5. report to AWS
+ //5. report to AWS
ProcessPI(reportJson, payloadForNewPI);
}
</script>
@@ -638,16 +644,24 @@
<div class="bPageTitle">
<div class="ptBody">
<div class="content">
- <img src="/img/s.gif" alt="鎶ュ憡涔�" class="pageTitleIcon" title="鎶ュ憡涔�" />
- <h1 class="pageType">鎶ュ憡涔�
+ <img
+ src="/img/s.gif"
+ alt="鎶ュ憡涔�"
+ class="pageTitleIcon"
+ title="鎶ュ憡涔�"
+ />
+ <h1 class="pageType">
+ 鎶ュ憡涔�
<span class="titleSeparatingColon">:</span>
</h1>
- <h2 class="pageDescription"> 鏂板缓鎶ュ憡涔�</h2>
+ <h2 class="pageDescription">鏂板缓鎶ュ憡涔�</h2>
<div class="blank"> </div>
</div>
<div class="links">
- <a href="javascript:openPopupFocusEscapePounds(%27https://help.salesforce.com/apex/htdoor?loc=help&target=leads_edit.htm&section=Leads&language=zh_CN&release=234.18.8&instance=CS117&showSplash=true%27, %27Help%27, 700, 600, %27width=700,height=600,resizable=yes,toolbar=yes,status=no,scrollbars=yes,menubar=yes,directories=no,location=no,dependant=no%27, false, false);"
- title="姝ら〉闈㈢殑甯姪 锛堟柊绐楀彛锛�">
+ <a
+ href="javascript:openPopupFocusEscapePounds(%27https://help.salesforce.com/apex/htdoor?loc=help&target=leads_edit.htm&section=Leads&language=zh_CN&release=234.18.8&instance=CS117&showSplash=true%27, %27Help%27, 700, 600, %27width=700,height=600,resizable=yes,toolbar=yes,status=no,scrollbars=yes,menubar=yes,directories=no,location=no,dependant=no%27, false, false);"
+ title="姝ら〉闈㈢殑甯姪 锛堟柊绐楀彛锛�"
+ >
<span class="helpLink">姝ら〉闈㈢殑甯姪</span>
<img src="/img/s.gif" alt="" class="helpIcon" />
</a>
@@ -667,44 +681,89 @@
<tbody>
<tr>
<td class="pbTitle">
- <img src="/img/s.gif" alt="" class="minWidth" title="" width="1" height="1" />
+ <img
+ src="/img/s.gif"
+ alt=""
+ class="minWidth"
+ title=""
+ width="1"
+ height="1"
+ />
<h2 class="mainTitle">鎶ュ憡涔︾紪杈�</h2>
</td>
- <td class="pbButton" id="topButtonRow" style="pointer-events: none; opacity: 0.4;">
- <input class="btn" type="Button" value="淇濆瓨" onclick="saveReportProcess('Save')" />
- <input class="btn" type="Button" value="淇濆瓨骞舵柊寤�" onclick="saveReportProcess('SaveAndNew')" />
- <apex:commandButton action="{!cancel}" value="鍙栨秷" />
+ <td
+ class="pbButton"
+ id="topButtonRow"
+ style="pointer-events: none; opacity: 0.4"
+ >
+ <input
+ class="btn"
+ type="Button"
+ value="淇濆瓨"
+ onclick="saveReportProcess('Save')"
+ />
+ <input
+ class="btn"
+ type="Button"
+ value="淇濆瓨骞舵柊寤�"
+ onclick="saveReportProcess('SaveAndNew')"
+ />
+ <apex:commandButton
+ action="{!cancel}"
+ value="鍙栨秷"
+ />
</td>
</tr>
</tbody>
</table>
</div>
<!-- Error Msg-->
- <div style="text-align: center;">
+ <div style="text-align: center">
<apex:outputPanel id="errorMsg">
<apex:pageMessages id="msgContent" escape="false" />
</apex:outputPanel>
- </div>
- <br/>
+ </div>
+ <br />
<!-- Iterate the layoutSections, which is a list of sections -->
<apex:repeat value="{!layoutSections}" var="layoutSection">
- <apex:pageBlockSection title="{!layoutSection.name}" showHeader="{!layoutSection.useHeader}" collapsible="{!layoutSection.allowCollapse}"
- columns="{!layoutSection.columns}">
-
+ <apex:pageBlockSection
+ title="{!layoutSection.name}"
+ showHeader="{!layoutSection.useHeader}"
+ collapsible="{!layoutSection.allowCollapse}"
+ columns="{!layoutSection.columns}"
+ >
<!--Each section has layoutFields, let's iterate them as well-->
- <apex:repeat value="{!layoutSection.layoutFields}" var="layoutField">
+ <apex:repeat
+ value="{!layoutSection.layoutFields}"
+ var="layoutField"
+ >
<!-- <apex:inputField html-title="{!layoutField.fieldAPI}" html-data-id="{!layoutField.fieldAPI}" styleClass="{!ApiPrefix} {!ApiPrefix}_{!layoutField.fieldAPI}" value="{!Report__c[layoutField.fieldAPI]}" rendered="{!not(layoutField.isPlaceHOlder)}"
required="{!layoutField.isRequired}" /> -->
- <apex:inputField styleClass="PIBackApi PIBackApi_{!layoutField.fieldAPI}" html-data-id="{!layoutField.fieldAPI}" value="{!Report__c[layoutField.fieldAPI]}" rendered="{!not(layoutField.isPlaceHOlder)&&isNewMode}"
- required="{!layoutField.isRequired}" />
- <apex:inputField styleClass="PIBackApi PIBackApi_{!layoutField.fieldAPI}" html-data-id="{!layoutField.fieldAPI}" value="{!Report__c[layoutField.fieldAPI]}" rendered="{!not(layoutField.isPlaceHOlder)&¬(isNewMode)&&layoutField.fieldAPI!='RecordTypeId'}"
- required="{!layoutField.isRequired}" />
- <apex:outputField styleClass="PIBackApi PIBackApi_{!layoutField.fieldAPI}" html-data-id="{!layoutField.fieldAPI}" value="{!Report__c[layoutField.fieldAPI]}" rendered="{!not(layoutField.isPlaceHOlder)&¬(isNewMode)&&layoutField.fieldAPI=='RecordTypeId'}"
+ <apex:inputField
+ styleClass="PIBackApi PIBackApi_{!layoutField.fieldAPI}"
+ html-data-id="{!layoutField.fieldAPI}"
+ value="{!Report__c[layoutField.fieldAPI]}"
+ rendered="{!not(layoutField.isPlaceHOlder)&&isNewMode}"
+ required="{!layoutField.isRequired}"
/>
- <apex:pageblocksectionitem rendered="{!layoutField.isPlaceHolder}">
+ <apex:inputField
+ styleClass="PIBackApi PIBackApi_{!layoutField.fieldAPI}"
+ html-data-id="{!layoutField.fieldAPI}"
+ value="{!Report__c[layoutField.fieldAPI]}"
+ rendered="{!not(layoutField.isPlaceHOlder)&¬(isNewMode)&&layoutField.fieldAPI!='RecordTypeId'}"
+ required="{!layoutField.isRequired}"
+ />
+ <apex:outputField
+ styleClass="PIBackApi PIBackApi_{!layoutField.fieldAPI}"
+ html-data-id="{!layoutField.fieldAPI}"
+ value="{!Report__c[layoutField.fieldAPI]}"
+ rendered="{!not(layoutField.isPlaceHOlder)&¬(isNewMode)&&layoutField.fieldAPI=='RecordTypeId'}"
+ />
+ <apex:pageblocksectionitem
+ rendered="{!layoutField.isPlaceHolder}"
+ >
</apex:pageblocksectionitem>
</apex:repeat>
-
</apex:pageBlockSection>
</apex:repeat>
<script>
@@ -716,12 +775,11 @@
if(e.getAttribute("multiple") != 'multiple' || e.style.display == 'none' && e.id.indexOf('selected') < 0){
api_id_map[GetEleApiName(e)] = e.id;
}
-
+
}
}
console.log(api_id_map);
sfdcPage.appendToOnloadQueue(function () {
- debugger
//鍒ゆ柇鏄惁涓哄彧璇婚�夐」
var layoutSections = JSON.parse('{!layoutSectionsStr}');
for (let m = 0; m < layoutSections.length; m++) {
@@ -745,7 +803,7 @@
//1. Set Last Name label
//document.querySelector("[data-id='LastName']").parentNode.parentNode.parentNode.children[2].children[0].innerText = '濮撳悕';
- //2. Query AWS Data by dataId
+ //2. Query AWS Data by dataId
console.log('Mode for Lead Page:' + {!isNewMode});
if (!{!isNewMode}) {
QueryLeadFromAWS();
@@ -765,10 +823,10 @@
document.getElementById(document.querySelector("[data-id='Loaner_request_no1__c']").id + '_lkid').value = '{!no1Id}'
}
}
-
+
document.getElementById('topButtonRow').style = '';
document.getElementById('bottomButtonRow').style = '';
-
+
let previous_value = {};
jQuery(".lookupInput input").each(function(i,e){
let je =jQuery(e);
@@ -823,17 +881,41 @@
<tbody>
<tr>
<td class="pbTitle">
- <img src="/img/s.gif" alt="" class="minWidth" title="" width="1" height="1" /> </td>
- <td class="pbButtonb" id="bottomButtonRow" style="pointer-events: none; opacity: 0.4;">
- <input class="btn" type="Button" value="淇濆瓨" onclick="saveReportProcess('Save')" />
- <input class="btn" type="Button" value="淇濆瓨骞舵柊寤�" onclick="saveReportProcess('SaveAndNew')" />
- <apex:commandButton action="{!cancel}" value="鍙栨秷" />
+ <img
+ src="/img/s.gif"
+ alt=""
+ class="minWidth"
+ title=""
+ width="1"
+ height="1"
+ />
+ </td>
+ <td
+ class="pbButtonb"
+ id="bottomButtonRow"
+ style="pointer-events: none; opacity: 0.4"
+ >
+ <input
+ class="btn"
+ type="Button"
+ value="淇濆瓨"
+ onclick="saveReportProcess('Save')"
+ />
+ <input
+ class="btn"
+ type="Button"
+ value="淇濆瓨骞舵柊寤�"
+ onclick="saveReportProcess('SaveAndNew')"
+ />
+ <apex:commandButton
+ action="{!cancel}"
+ value="鍙栨秷"
+ />
</td>
</tr>
</tbody>
</table>
</div>
</apex:pageblock>
-
</apex:form>
-</apex:page>
\ No newline at end of file
+</apex:page>
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 8a64f42..d26d5e1 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,13 +126,9 @@
</classAccesses>
<flowAccesses>
<enabled>true</enabled>
-<<<<<<< HEAD
<flow>
CommunityWeeklyReport;
</flow>
-=======
- <flow>CommunityWeeklyReport</flow>
->>>>>>> LEXCommunityLiJun
</flowAccesses>
<hasActivationRequired>false</hasActivationRequired>
<label>Community Consumable LEX PS</label>
diff --git a/force-app/main/default/triggers/ConsumableOrderDetail2Trigger.trigger b/force-app/main/default/triggers/ConsumableOrderDetail2Trigger.trigger
index 40e3ffc..09649e5 100644
--- a/force-app/main/default/triggers/ConsumableOrderDetail2Trigger.trigger
+++ b/force-app/main/default/triggers/ConsumableOrderDetail2Trigger.trigger
@@ -1,4 +1,3 @@
-<<<<<<< HEAD
trigger ConsumableOrderDetail2Trigger on Consumable_order_details2__c(after insert, after update, after delete) {
Set<String> orderSet = new Set<String>();
@@ -46,82 +45,22 @@
(results1.RemoveBox_No__c != null &&
results1.RemoveBox_No__c != 1)
) {
-=======
-trigger ConsumableOrderDetail2Trigger on Consumable_order_details2__c (after insert, after update, after delete) {
- Set<String> orderSet = new Set<String>();
-
- if (StaticParameter.EscapeOrderDetail2Trigger) {
- 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.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 (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 (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
- FROM Consumable_order_details2__c
- 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)){
->>>>>>> LEXCommunityLiJun
continue;
}
string Consumable_order_minor_str = String.valueOf(results1.Consumable_order_minor__c);
-<<<<<<< HEAD
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);
->>>>>>> LEXCommunityLiJun
}
}
List<Consumable_Order__c> consumableOrderlist = new List<Consumable_Order__c>();
-<<<<<<< HEAD
for (String strOrder : orderSet) {
Integer cnt = 0;
for (string key : orderSetResults.keySet()) {
if (key.equals(strOrder)) {
-=======
- for (String strOrder:orderSet){
- Integer cnt =0;
- for (string key : orderSetResults.keySet()) {
- if(key.equals(strOrder)){
->>>>>>> LEXCommunityLiJun
cnt = orderSetResults.get(key);
break;
}
@@ -133,11 +72,7 @@
consumableOrderlist.add(consumableOrder);
}
// 2018骞�8鏈�9鏃� HWAG-B3D9UV 鏇挎崲涓嬮潰鍘熸湁SQL 浣跨敤 map 瀹屾垚璧嬪�� end end by 寮犵帀灞�
-<<<<<<< HEAD
-=======
-
->>>>>>> LEXCommunityLiJun
/* 2018骞�8鏈�9鏃� HWAG-B3D9UV 鍘熸湁SQL 涓庤祴鍊� start by 寮犵帀灞�
AggregateResult[] results = [SELECT Consumable_order_minor__c,count(Id) cnt
FROM Consumable_order_details2__c
@@ -163,18 +98,12 @@
}
2018骞�8鏈�9鏃� HWAG-B3D9UV 鍘熸湁SQL 涓庤祴鍊� end by 寮犵帀灞�
*/
-<<<<<<< HEAD
if (consumableOrderlist.size() > 0) {
update consumableOrderlist;
-=======
- if (consumableOrderlist.size() > 0){
- update consumableOrderlist;
->>>>>>> LEXCommunityLiJun
}
//鏇存柊娑堣�楀搧璁㈠崟鐨勫彂璐ф棩鏈�
// 2018骞�8鏈�9鏃� HWAG-B3D9UV 鏇挎崲涓嬮潰鍘熸湁SQL 浣跨敤 map 瀹屾垚璧嬪�� start by 寮犵帀灞�
-<<<<<<< HEAD
Set<string> resultsKeySet = new Set<String>();
map<string, Date> DeliverdateResults = new Map<string, Date>(); //鏈�鏂板彂璐ф椂闂�
map<string, Date> DeliverdateminResults = new Map<string, Date>(); //鏈�鏃╁彂璐ф椂闂�
@@ -200,42 +129,10 @@
}
} else {
DeliverdateminResults.put(Consumable_order_minor_str, results1.Deliver_date__c);
-=======
- 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);
- resultsKeySet.add(Consumable_order_minor_str);
- }
- }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);
- resultsKeySet.add(Consumable_order_minor_str);
- }
- }else{
- DeliverdateminResults.put(Consumable_order_minor_str,results1.Deliver_date__c);
->>>>>>> LEXCommunityLiJun
resultsKeySet.add(Consumable_order_minor_str);
}
//鑾峰彇鏈�鏃╁彂璐ф椂闂� pk part1 end
}
-<<<<<<< HEAD
//涓や釜DeliverdateResults.keySet()锛孌eliverdateminResults.keySet() 鍚堝苟浣滀负涓�涓狶ist 锛岄亶鍘哃ist
//鑾峰彇鏈�鏃╁彂璐ф椂闂� pk part2 start
@@ -301,73 +198,6 @@
// system.debug('DeliverdateResults==============' + DeliverdateResults);
// //鑾峰彇鏈�鏃╁彂璐ф棩鏈� end
-=======
-
- //涓や釜DeliverdateResults.keySet()锛孌eliverdateminResults.keySet() 鍚堝苟浣滀负涓�涓狶ist 锛岄亶鍘哃ist
- //鑾峰彇鏈�鏃╁彂璐ф椂闂� pk part2 start
- consumableOrderlist = new List<Consumable_Order__c>();
- for(string temp : resultsKeySet){
- Consumable_Order__c consumableOrder1 = new Consumable_Order__c();
- consumableOrder1.Id = temp;
- if(DeliverdateResults.get(temp)!=null){
- consumableOrder1.Shipment_Date__c = DeliverdateResults.get(temp);
- }
- if(DeliverdateminResults.get(temp)!=null){
- consumableOrder1.First_Delivery__c = DeliverdateResults.get(temp);
- }
- consumableOrderlist.add(consumableOrder1);
- }
-
- //鑾峰彇鏈�鏃╁彂璐ф椂闂� pk part2 end
- // List<Consumable_Order__c> consumableOrderminlist = new List<Consumable_Order__c>();//鏈�鏃╁彂璐ф椂闂�
- // for (string key : DeliverdateminResults.keySet()) {
- // if(DeliverdateminResults.get(key)!=null){
- // Consumable_Order__c consumableOrder1 = new Consumable_Order__c();
- // consumableOrder1.Id = key;
- // consumableOrder1.First_Delivery__c = DeliverdateResults.get(key);
- // consumableOrderminlist.add(consumableOrder1);
- // }
- // }
-
- // 2018骞�8鏈�9鏃� HWAG-B3D9UV 鏇挎崲涓嬮潰鍘熸湁SQL 浣跨敤 map 瀹屾垚璧嬪�� end by 寮犵帀灞�
-
- //鑾峰彇鏃╁彂璐ф棩鏈� start
- // system.debug('DeliverdateResults==============' + DeliverdateResults);
- // system.debug('璧板埌鏈�鏃╁彂璐ф棩鏈�');
- // map<string,Date> DeliverdateminResults = new map<string,Date>();
- // for(Consumable_order_details2__c results1 : allresults){
- // if(results1.Dealer_Arrive__c == true || results1.Dealer_Returned__c== true){
- // continue;
- // }
- // string Consumable_order_minor_str = String.valueOf(results1.Consumable_order_minor__c);
- // if(DeliverdateminResults.containsKey(Consumable_order_minor_str)){
- // if(DeliverdateminResults.get(Consumable_order_minor_str)
- // > results1.Deliver_date__c
- // ){
- // DeliverdateminResults.put(Consumable_order_minor_str,results1.Deliver_date__c);
- // }
-
- // }else{
- // DeliverdateminResults.put(Consumable_order_minor_str,results1.Deliver_date__c);
- // }
- // }
- // List<Consumable_Order__c> consumableOrderminlist = new List<Consumable_Order__c>();
- // for (string key : DeliverdateminResults.keySet()) {
- // if(DeliverdateminResults.get(key)!=null){
- // Consumable_Order__c consumableOrder1 = new Consumable_Order__c();
- // consumableOrder1.Id = key;
- // consumableOrder1.First_Delivery__c = DeliverdateResults.get(key);
- // consumableOrderminlist.add(consumableOrder1);
- // }
- // }
-
- // if(consumableOrderminlist.size() > 0){
- // update consumableOrderminlist;
- // }
- // system.debug('DeliverdateResults==============' + DeliverdateResults);
- // //鑾峰彇鏈�鏃╁彂璐ф棩鏈� end
-
->>>>>>> LEXCommunityLiJun
/* 2018骞�8鏈�9鏃� HWAG-B3D9UV 鍘熸湁SQL 涓庤祴鍊� start by 寮犵帀灞�
AggregateResult[] results1 = [SELECT Consumable_order_minor__c,max(Deliver_date__c) Deliver_date__c
FROM Consumable_order_details2__c
@@ -386,7 +216,6 @@
}
}
2018骞�8鏈�9鏃� HWAG-B3D9UV 鍘熸湁SQL 涓庤祴鍊� end by 寮犵帀灞� */
-<<<<<<< HEAD
if (consumableOrderlist.size() > 0) {
update consumableOrderlist;
}
@@ -426,47 +255,6 @@
// 2018骞�8鏈�9鏃� HWAG-B3D9UV 鏇挎崲涓嬮潰鍘熸湁SQL 浣跨敤 map 瀹屾垚璧嬪�� end by 寮犵帀灞�
-=======
- 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){
- 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);
- }
- }
- consumableOrderlist = new List<Consumable_Order__c>();
- for (String strOrder:orderSet){
- Integer cnt =0;
- for (string key : resultsMap2.keySet()) {
- if(key.equals(strOrder)){
- cnt = resultsMap2.get(key);
- break;
- }
- }
-
- 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;}
- consumableOrderlist.add(consumableOrder2);
- }
-
- // 2018骞�8鏈�9鏃� HWAG-B3D9UV 鏇挎崲涓嬮潰鍘熸湁SQL 浣跨敤 map 瀹屾垚璧嬪�� end by 寮犵帀灞�
-
->>>>>>> LEXCommunityLiJun
/* 2018骞�8鏈�9鏃� HWAG-B3D9UV 鍘熸湁SQL 涓庤祴鍊� start by 寮犵帀灞�
AggregateResult[] results2 = [SELECT Consumable_order_minor__c,count(Id) cnt
FROM Consumable_order_details2__c
@@ -491,7 +279,6 @@
consumableOrderlist.add(consumableOrder2);
}
2018骞�8鏈�9鏃� HWAG-B3D9UV 鍘熸湁SQL 涓庤祴鍊� end by 寮犵帀灞� */
-<<<<<<< HEAD
if (consumableOrderlist.size() > 0) {
update consumableOrderlist;
}
@@ -538,11 +325,7 @@
// 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
- ]
+ [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
@@ -590,98 +373,12 @@
// 2018骞�8鏈�9鏃� HWAG-B3D9UV 鏇夸唬涓嬮潰SQL select end by 寮犵帀灞�
//Back up by DTT - Li Jun 2023-06-14 End
-=======
- if (consumableOrderlist.size() > 0){
- update consumableOrderlist;
- }
- }
- //Back up by DTT - Li Jun 2023-06-14 Start for reduce soql times
- // 2018骞�8鏈�9鏃� HWAG-B3D9UV 鑾峰彇鎵�鏈夌殑record ID start by 寮犵帀灞�
- //List<RecordType> allrtList = [select Id,DeveloperName from RecordType where SobjectType = 'Consumable_orderdetails__c'];
- // 2018骞�8鏈�9鏃� HWAG-B3D9UV 鑾峰彇鎵�鏈夌殑record ID end by 寮犵帀灞�
- //Back up by DTT - Li Jun 2023-06-14 Start
- //鍒拌揣鍜岃繑鍝佹椂,鐢熸垚鎴栦慨鏀规秷璐瑰搧璁㈣揣鏄庣粏
- Set<String> arrivedSet = new Set<String>();
- Set<String> returnSet = new Set<String>();
- 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 (detail2.Consumable_Arrived_order__c != null) {
- arrivedSet.add(detail2.Consumable_Arrived_order__c);
- }
-
- if ((oldDetail2 == null || oldDetail2.Consumable_Return_order__c == null) && detail2.Consumable_Return_order__c != null) {
- returnSet.add(detail2.Consumable_Return_order__c);
- }
- }
- }
- 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);
- }
-
- if (det2.Consumable_Return_order__c != null) {
- returnSet.add(det2.Consumable_Return_order__c);
- }
- }
- }
- System.debug('arrivedSet +++++' + arrivedSet);
- // 2018骞�8鏈�14鏃� HWAG-B3D9UV 鍦ㄨ繘琛孨FM110澶勭悊鏃� 璺宠繃arrivedset start by 寮犵帀灞�
- if (StaticParameter.EscapeConsumableOrderDetail2Trigger) {
- return ;
- }
- // 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>();
- for (Consumable_orderdetails__c detail1 : detail1List) {
- String key = '' + detail1.Consumable_order__c + detail1.Asset_Model_No__c;
- detail1Map.put(key, detail1);
- }
-
- arrivedSet.clear();
- for (Consumable_order__c arrivedCo : arrivedMap.values()) {
- if (arrivedCo.RecordType.DeveloperName == 'Arrive') {
- arrivedSet.add(arrivedCo.Id);
- }
- }
-
- 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){
- 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 寮犵帀灞�
- // List<RecordType> rtList = new List<RecordType>();
- // for(RecordType rtl : allrtList){
- // if('Detail1_Arrival'.equals(rtl.DeveloperName)){
- // rtList.add(rtl);
- // }
- // }
- // 2018骞�8鏈�9鏃� HWAG-B3D9UV 鏇夸唬涓嬮潰SQL select end by 寮犵帀灞�
- //Back up by DTT - Li Jun 2023-06-14 End
-
->>>>>>> LEXCommunityLiJun
/* 2018骞�8鏈�9鏃� HWAG-B3D9UV 鍘熻幏鍙� recordtype start by 寮犵帀灞�
List<RecordType> rtList = [select Id from RecordType where DeveloperName = 'Detail1_Arrival' and SobjectType = 'Consumable_orderdetails__c'];
2018骞�8鏈�9鏃� HWAG-B3D9UV 鍘熻幏鍙� recordtype end by 寮犵帀灞� */
//Back up by DTT - Li Jun 2023-06-14 Start
// Id recordTypeId = null;
// if (rtList.size() > 0) recordTypeId = rtList[0].Id;
-<<<<<<< HEAD
//Back up by DTT - Li Jun 2023-06-14 End
Id recordtypeId = Schema.SObjectType.Consumable_Orderdetails__c.getRecordTypeInfosByDeveloperName()
.get('Detail1_Arrival')
@@ -696,73 +393,38 @@
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')));
-=======
- //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')));
->>>>>>> LEXCommunityLiJun
}
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>();
-<<<<<<< HEAD
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 || 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;
->>>>>>> LEXCommunityLiJun
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);
-<<<<<<< HEAD
if (detail1 == null)
detail1 = new Consumable_orderdetails__c();
-=======
- if (detail1 == null) detail1 = new Consumable_orderdetails__c();
->>>>>>> LEXCommunityLiJun
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);
-<<<<<<< HEAD
if (index == null)
index = 0;
if (assetModelNoMap.containsKey(detail2.Asset_Model_No__c)) {
continue;
} else {
-=======
- if (index == null) index = 0;
- if(assetModelNoMap.containsKey(detail2.Asset_Model_No__c)){
- continue;
- }else{
->>>>>>> LEXCommunityLiJun
assetModelNoMap.put(detail2.Asset_Model_No__c, detail2.Asset_Model_No__c);
noCount.put(co.Id, index + 1);
}
noCount.put(co.Id, index + 1);
-<<<<<<< HEAD
String newName = co.Name + '-';
-=======
- String newName = co.Name+'-';
->>>>>>> LEXCommunityLiJun
System.debug('index +++++' + index);
if (index < 99) {
newName += '0';
@@ -779,16 +441,11 @@
detail1.RecordTypeId = recordTypeId;
//detail1.Consumable_principal__c = co.Id;
detail1.Intra_Trade_List_RMB__c = detail2.Intra_Trade_List_RMB__c;
-<<<<<<< HEAD
-=======
-
->>>>>>> LEXCommunityLiJun
}
upsertMap.put(key, detail1);
}
}
-<<<<<<< HEAD
if (Trigger.isUpdate) {
for (Consumable_order_details2__c detail2 : Trigger.old) {
//Dataloader銇у垵鏈熷湪搴櫥閷层倰銇椼仧銇傘仺銆併儑銉笺偪淇銇屽叆銇c仧銇ㄣ亶銇槑绱�1銇屾洿鏂般仌銈屻仾銇勩��
@@ -832,70 +489,19 @@
detail1.RecordTypeId = recordTypeId;
//detail1.Consumable_principal__c = co.Id;
detail1.Intra_Trade_List_RMB__c = detail2.Intra_Trade_List_RMB__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);
- Consumable_orderdetails__c detail1 = detail1Map.get(key);
- if ((count == null || count ==0) && detail1 !=null){
- //delete detail1;
- deletetMap.put(key,detail1);
- 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;
-
-
->>>>>>> LEXCommunityLiJun
}
upsertMap.put(key, detail1);
}
}
-<<<<<<< HEAD
if (Trigger.isDelete) {
for (Consumable_order_details2__c detail2 : Trigger.old) {
if (detail2.Consumable_Arrived_order__c == null)
continue;
-=======
- if (trigger.isDelete){
- for (Consumable_order_details2__c detail2 : Trigger.old) {
- if (detail2.Consumable_Arrived_order__c == null) continue;
->>>>>>> LEXCommunityLiJun
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);
-<<<<<<< HEAD
if ((count == null || count == 0) && detail1 != null) {
//delete detail1;
deletetMap.put(key, detail1);
@@ -903,29 +509,15 @@
}
if (detail1 == null)
detail1 = new Consumable_orderdetails__c();
-=======
- if ((count == null || count ==0) && detail1 !=null){
- //delete detail1;
- deletetMap.put(key,detail1);
- continue;
- }
- if (detail1 == null) detail1 = new Consumable_orderdetails__c();
->>>>>>> LEXCommunityLiJun
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);
-<<<<<<< HEAD
if (index == null)
index = 0;
noCount.put(co.Id, index + 1);
String newName = co.Name + '-';
-=======
- if (index == null) index = 0;
- noCount.put(co.Id, index + 1);
- String newName = co.Name+'-';
->>>>>>> LEXCommunityLiJun
if (index < 99) {
newName += '0';
}
@@ -940,7 +532,6 @@
detail1.RecordTypeId = recordTypeId;
//detail1.Consumable_principal__c = co.Id;
detail1.Intra_Trade_List_RMB__c = detail2.Intra_Trade_List_RMB__c;
-<<<<<<< HEAD
}
upsertMap.put(key, detail1);
}
@@ -961,11 +552,7 @@
// 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
- ]
+ [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
@@ -979,38 +566,6 @@
detail1Map.put(key, detail1);
}
-=======
-
- }
- upsertMap.put(key, detail1);
- }
- }
-
- Database.upsert(upsertMap.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>();
-
- for (Consumable_orderdetails__c detail1 : detail1List) {
- String key = '' + detail1.Consumable_order__c + detail1.Asset_Model_No__c;
- detail1Map.put(key, detail1);
- }
-
->>>>>>> LEXCommunityLiJun
returnSet.clear();
for (Consumable_order__c returnCo : returnMap.values()) {
if (returnCo.RecordType.DeveloperName == 'ReturnGoods') {
@@ -1018,7 +573,6 @@
}
}
-<<<<<<< HEAD
AggregateResult[] results = [
SELECT Consumable_Return_order__c, Asset_Model_No__c, count(Id) recordCount
FROM Consumable_order_details2__c
@@ -1031,19 +585,6 @@
keyCount.put(key, Integer.valueOf(ar.get('recordCount')));
}
//Back up by DTT - Li Jun 2023-06-14 Start for reduce soql times
-=======
- 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){
- 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
->>>>>>> LEXCommunityLiJun
// 2018骞�8鏈�9鏃� HWAG-B3D9UV 鏇夸唬涓嬮潰SQL select start by 寮犵帀灞�
// List<RecordType> rtList = new List<RecordType>();
// for(RecordType rtl : allrtList){
@@ -1052,16 +593,11 @@
// }
// }
// 2018骞�8鏈�9鏃� HWAG-B3D9UV 鏇夸唬涓嬮潰SQL select end by 寮犵帀灞�
-<<<<<<< HEAD
//Back up by DTT - Li Jun 2023-06-14 End
-=======
- //Back up by DTT - Li Jun 2023-06-14 End
->>>>>>> LEXCommunityLiJun
/* 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 寮犵帀灞� */
-<<<<<<< HEAD
Id recordTypeId = Schema.SObjectType.Consumable_Orderdetails__c.getRecordTypeInfosByDeveloperName()
.get('Detail1_ReturnGoods')
.getRecordTypeId();
@@ -1076,18 +612,6 @@
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')));
-=======
- 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];
- 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')));
->>>>>>> LEXCommunityLiJun
}
Map<String, Consumable_orderdetails__c> upsertMap = new Map<String, Consumable_orderdetails__c>();
@@ -1102,7 +626,6 @@
for (Consumable_order_details2__c detail2 : Trigger.New) {
Consumable_order_details2__c oldDetail2 = null;
-<<<<<<< HEAD
if (detail2.Consumable_Return_order__c == null)
continue;
@@ -1110,18 +633,10 @@
if (Trigger.isUpdate)
oldDetail2 = Trigger.oldMap.get(detail2.Id);
-=======
- 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);
->>>>>>> LEXCommunityLiJun
if (oldDetail2 != null) {
if (keyCount.containsKey(key)) {
returnCount += 1;
if (oldDetail2.Consumable_Sale_order__c != null) {
-<<<<<<< HEAD
Integer sCount = updatedSaleCount.containsKey(
'' + oldDetail2.Consumable_Sale_order__c + detail2.Asset_Model_No__c
)
@@ -1140,18 +655,6 @@
sCount += 1;
updatedShipmentCount.put('' + oldDetail2.Consumable_Shipment_order__c + detail2.Asset_Model_No__c, sCount);
-=======
- 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);
- 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;
- sCount += 1;
-
- updatedShipmentCount.put(''+oldDetail2.Consumable_Shipment_order__c+detail2.Asset_Model_No__c, sCount);
->>>>>>> LEXCommunityLiJun
updatedShipmentId.add(oldDetail2.Consumable_Shipment_order__c);
}
/*if (oldDetail2.Invoice_No__c != null) {
@@ -1169,37 +672,23 @@
}*/
}
}
-<<<<<<< HEAD
if (upsertMap.get(key) != null)
continue;
-=======
- if (upsertMap.get(key) != null) continue;
->>>>>>> LEXCommunityLiJun
Integer count = keyCount.get(key);
Consumable_orderdetails__c detail1 = detail1Map.get(key);
-<<<<<<< HEAD
if (detail1 == null)
detail1 = new Consumable_orderdetails__c();
-=======
- if (detail1 == null) detail1 = new Consumable_orderdetails__c();
->>>>>>> LEXCommunityLiJun
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);
-<<<<<<< HEAD
if (index == null)
index = 0;
noCount.put(co.Id, index + 1);
String newName = co.Name + '-';
-=======
- if (index == null) index = 0;
- noCount.put(co.Id, index + 1);
- String newName = co.Name+'-';
->>>>>>> LEXCommunityLiJun
if (index < 99) {
newName += '0';
}
@@ -1214,17 +703,12 @@
detail1.RecordTypeId = recordTypeId;
//detail1.Consumable_principal__c = co.Id;
detail1.Intra_Trade_List_RMB__c = detail2.Intra_Trade_List_RMB__c;
-<<<<<<< HEAD
-=======
-
->>>>>>> LEXCommunityLiJun
}
upsertMap.put(key, detail1);
}
Database.upsert(upsertMap.values(), true);
// 2018骞�8鏈�8鏃� HWAG-B3D9UV 鍑忓皯 select 鏁伴噺 start by 寮犵帀灞�
-<<<<<<< HEAD
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
@@ -1260,42 +744,6 @@
updatedConInvoiceId.contains(orderdetails.id) &&
'Order_Invoice'.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>();
-
- 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>();
-
- for (Consumable_orderdetails__c orderdetails : Consumable_orderdetailsList){
- if(updatedConInvoiceId.contains(orderdetails.id)
- && 'Order_Invoice'.equals(orderdetails.Consumable_order__r.RecordType.DeveloperName)){
->>>>>>> LEXCommunityLiJun
detail1ConInvoiceList.add(orderdetails);
}
}
@@ -1323,32 +771,20 @@
List<Consumable_orderdetails__c> updateData = new List<Consumable_orderdetails__c>();
for (Consumable_orderdetails__c detail1Sale : detail1SaleList) {
-<<<<<<< HEAD
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);
->>>>>>> LEXCommunityLiJun
if (count != null) {
detail1Sale.RrturnPro_count__c += count;
updateData.add(detail1Sale);
}
-<<<<<<< HEAD
}
for (Consumable_orderdetails__c detail1Shipment : detail1ShipmentList) {
Integer count = updatedShipmentCount.get('' + detail1Shipment.Consumable_order__c + detail1Shipment.Asset_Model_No__c);
-=======
-
- }
- for (Consumable_orderdetails__c detail1Shipment : detail1ShipmentList) {
- Integer count = updatedShipmentCount.get(''+detail1Shipment.Consumable_order__c+detail1Shipment.Asset_Model_No__c);
->>>>>>> LEXCommunityLiJun
if (count != null) {
detail1Shipment.RrturnPro_count__c += count;
updateData.add(detail1Shipment);
}
}
for (Consumable_orderdetails__c detail1ConInvoice : detail1ConInvoiceList) {
-<<<<<<< HEAD
Integer count = updatedConInvoiceCount.get(
'' +
detail1ConInvoice.Consumable_order__c +
@@ -1360,10 +796,6 @@
(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)) ) {
->>>>>>> LEXCommunityLiJun
detail1ConInvoice.RrturnPro_count__c += count;
//updateData.add(detail1ConInvoice);
}
@@ -1371,11 +803,5 @@
Database.upsert(updateData, true);
}
-<<<<<<< HEAD
}
}
-=======
-
- }
-}
->>>>>>> LEXCommunityLiJun
diff --git a/force-app/main/default/triggers/ContentDocumentLink.trigger b/force-app/main/default/triggers/ContentDocumentLink.trigger
index d01d1f6..4590320 100644
--- a/force-app/main/default/triggers/ContentDocumentLink.trigger
+++ b/force-app/main/default/triggers/ContentDocumentLink.trigger
@@ -1,14 +1,8 @@
-<<<<<<< HEAD
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){
+ if ((!Test.isRunningTest()) && UserInfo.getUserId() == System.Label.ByPassTrigger) {
System.debug('enter ContentDocumentLink but UserInfo.getUserId()==System.Label.ByPassTrigger');
->>>>>>> LEXCommunityLiJun
return;
}
system.debug('enter ContentDocumentLink');
diff --git a/force-app/main/default/triggers/ContentDocumentTrigger.trigger b/force-app/main/default/triggers/ContentDocumentTrigger.trigger
index 1a99718..83374a2 100644
--- a/force-app/main/default/triggers/ContentDocumentTrigger.trigger
+++ b/force-app/main/default/triggers/ContentDocumentTrigger.trigger
@@ -1,12 +1,8 @@
trigger ContentDocumentTrigger on ContentDocument(before delete) {
-<<<<<<< HEAD
- 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){
+ if ((!Test.isRunningTest()) && UserInfo.getUserId() == System.Label.ByPassTrigger) {
System.debug('enter ContentDocumentTrigger but UserInfo.getUserId()==System.Label.ByPassTrigger');
->>>>>>> LEXCommunityLiJun
return;
}
System.debug('enter ContentDocumentTrigger');
--
Gitblit v1.9.1