From ecf60bb0cd5a04ce38120302be4cf55fd3c3a27b Mon Sep 17 00:00:00 2001
From: 高章伟 <gaozhangwei@prec-tech.com>
Date: 星期二, 04 四月 2023 16:23:38 +0800
Subject: [PATCH] 返品限制条件验证
---
force-app/main/default/classes/ArriveGoodsController.cls | 239 ++++++++++++++++++++++++++++++++++++++++-------------------
1 files changed, 161 insertions(+), 78 deletions(-)
diff --git a/force-app/main/default/classes/ArriveGoodsController.cls b/force-app/main/default/classes/ArriveGoodsController.cls
index 6289fe7..cb91f3b 100644
--- a/force-app/main/default/classes/ArriveGoodsController.cls
+++ b/force-app/main/default/classes/ArriveGoodsController.cls
@@ -15,7 +15,7 @@
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 List<ConsumableorderdetailsInfo> ConsumableorderdetailsRecordsdummy { get; set; }
+ public transient List<ConsumableorderdetailsInfo> ConsumableorderdetailsRecordsdummy { get; set; }
public List<ConsumableorderdetailsInfo> ShowGoodsofReturnList{get;set;}
public List<ConsumableorderdetailsInfo> ShowGoodsofRemoveBoxReturnList{get;set;}
//add by rentx 20210602 CHAN-C3K4ZQ
@@ -34,15 +34,16 @@
return ConsumableorderdetailsRecordserror.size();
}
Set<String> noboxBarcodeList = new Set<String>();
- Map<String, String> ExistIdMap = new Map<String, String>();
- Map<String, String> ErrorIdMap = new Map<String, String>();
- Map<String, String> AllMap = new Map<String, String>();
+ public transient Map<String, String> ExistIdMap = new Map<String, String>();
+ public transient Map<String, String> ErrorIdMap = new Map<String, String>();
+ public transient Map<String, String> AllMap = new Map<String, String>();
Map<String, String> otherAgencyMap = new Map<String, String>();
- Map<String, String> barMcodeMap = new Map<String, String>();
+ public transient Map<String, String> barMcodeMap = new Map<String, String>();
Map<String, Integer> BarcodeCntMap = new Map<String, Integer>();
- public List<String> BarCodeListP = new List<String>();
+ //qi
+ public transient List<String> BarCodeListP = new List<String>();
- Map<String, String> OrderAllMap = new Map<String, String>();
+ // public transient Map<String, String> OrderAllMap = new Map<String, String>();
Map<String, Decimal> orderProductCunMap = new Map<String, Decimal>();
Map<String, Decimal> orderProductArrivedCunMap = new Map<String, Decimal>();
Map<String, Decimal> orderWantArriveCunMap = new Map<String, Decimal>();
@@ -65,7 +66,7 @@
list<String> exitBarCodeList = new list<String>();
- Map<String, Consumable_order_details2__c> reallMap = new Map<String, Consumable_order_details2__c>();
+ // 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;}
@@ -108,36 +109,65 @@
//add by rentx 20210602 CHAN-C3K4ZQ start
consumableorderdetailsRecordsview = new List<List<ConsumableorderdetailsInfo>>();
//add by rentx 20210602 CHAN-C3K4ZQ end
+ // OrderAllMap = new Map<String, String>();
}
- //add by rentx 20210602 CHAN-C3K4ZQ start 鍑洪敊鐨勫師鍥犳槸椤甸潰鏈�澶氬睍绀�1000鏉℃暟鎹�,浣嗘槸闇�瑕佸睍绀虹殑鏁版嵁瓒呰繃浜�1000鏉�,鐜板湪鎶婂睍绀轰笂绾挎敼涓�2000
+ //add by rentx 20210602 CHAN-C3K4ZQ start 鍑洪敊鐨勫師鍥犳槸椤甸潰鏈�澶氬睍绀�1000鏉℃暟鎹�,浣嗘槸闇�瑕佸睍绀虹殑鏁版嵁瓒呰繃浜�1000鏉�,鐜板湪鎶婂睍绀轰笂绾挎敼涓�1000 * 1000
public void makeRecordsView(List<ConsumableorderdetailsInfo> recordsdummy){
- //鎷嗗垎鏆傜敤list
- List<ConsumableorderdetailsInfo> ConsumableorderdetailsRecordsbreak = new List<ConsumableorderdetailsInfo>();
- List<ConsumableorderdetailsInfo> ConsumableorderdetailsRecordsbreakover = new List<ConsumableorderdetailsInfo>();
- ConsumableorderdetailsInfo c = null;
- ConsumableorderdetailsRecordsbreak.clear();
- ConsumableorderdetailsRecordsbreakover.clear();
- consumableorderdetailsRecordsview.clear();
+ consumableorderdetailsRecordsview = new List<List<ConsumableorderdetailsInfo>>();
if(recordsdummy.size() > 1000){
- for(Integer i = 0; i < recordsdummy.size(); i++){
- if(i < 1000){
- c = recordsdummy.get(i);
- ConsumableorderdetailsRecordsbreak.add(c);
- }else{
- c = recordsdummy.get(i);
- ConsumableorderdetailsRecordsbreakover.add(c);
+ List<ConsumableorderdetailsInfo> ConsumableorderdetailsRecordsbreak = new List<ConsumableorderdetailsInfo>();
+ List<ConsumableorderdetailsInfo> ConsumableorderdetailsRecordsbreakover = new List<ConsumableorderdetailsInfo>();
+ ConsumableorderdetailsInfo c = null;
+ ConsumableorderdetailsRecordsbreak.clear();
+ ConsumableorderdetailsRecordsbreakover.clear();
+ consumableorderdetailsRecordsview.clear();
+ //閫夋嫨浜у搧view
+ ConsumableorderdetailsRecordsbreak = new List<ConsumableorderdetailsInfo>();
+ ConsumableorderdetailsRecordsbreakover = new List<ConsumableorderdetailsInfo>();
+ if(recordsdummy.size() > 1000){
+ for(Integer i = 0; i < recordsdummy.size(); i++){
+ if(i < 1000){
+ c = recordsdummy.get(i);
+ ConsumableorderdetailsRecordsbreak.add(c);
+ }else{
+ c = recordsdummy.get(i);
+ ConsumableorderdetailsRecordsbreakover.add(c);
+ }
}
+ consumableorderdetailsRecordsview.add(ConsumableorderdetailsRecordsbreak);
+ consumableorderdetailsRecordsview.add(ConsumableorderdetailsRecordsbreakover);
+ }else{
+ consumableorderdetailsRecordsview.add(recordsdummy);
}
- consumableorderdetailsRecordsview.add(ConsumableorderdetailsRecordsbreak);
- consumableorderdetailsRecordsview.add(ConsumableorderdetailsRecordsbreakover);
+
+ // Integer count = recordsdummy.size() / 1000;
+ // Integer last = recordsdummy.size() - (1000*count);
+
+ // for(Integer i = 0; i < count ; i++){
+ // List<ConsumableorderdetailsInfo> tempList = new List<ConsumableorderdetailsInfo>();
+ // for(Integer j=0; j < 1000; j++){
+ // tempList.add(recordsdummy.get(i * count + j ));
+ // // itemList.add(resList.get(i*count+j));
+ // }
+ // consumableorderdetailsRecordsview.add(tempList);
+ // }
+ // if (last > 0) {
+ // List<ConsumableorderdetailsInfo> tempList = new List<ConsumableorderdetailsInfo>();
+ // for(Integer j=0; j < last; j++){
+ // tempList.add(recordsdummy.get(count * 1000 + j ));
+ // // itemList.add(resList.get(i*count+j));
+ // }
+ // consumableorderdetailsRecordsview.add(tempList);
+ // }
}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];
@@ -235,14 +265,16 @@
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);
- ConsumableorderdetailsRecordsdummy.add(new ConsumableorderdetailsInfo(reSet1[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);
+ // makeRecordsView(ConsumableorderdetailsRecordsdummy);
//add by rentx 20210602 end CHAN-C3K4ZQ
}
}
@@ -264,7 +296,7 @@
barMcodeMap.put(B,tracingCode);
}
outPut.add(B);
- }
+ }system.debug('barMcodeMap绛変簬'+barMcodeMap);
return outPut;
}
@@ -287,12 +319,15 @@
noboxBarcodeList.clear();
//鍐嶆绱㈤」鐩竻绌�
ConsumableorderdetailsRecordserror = new List<ConsumableorderdetailsInfo>();
+ ErrorIdMap = new Map<String, String>();
ErrorIdMap.clear();
+ AllMap = new Map<String, String>();
AllMap.clear();
+ ExistIdMap = new Map<String, String>();
ExistIdMap.clear();
consumableorderdetails2Insert = new List<Consumable_order_details2__c>();
ConsumableorderdetailsRecordsdummy = new List<ConsumableorderdetailsInfo>();
- if(EsetId != null && EsetId != ''){
+ /*if(EsetId != null && EsetId != ''){
List<Consumable_order_details2__c> reSet1 = [SELECT Id,
Name,
Intra_Trade_List_RMB__c,
@@ -316,10 +351,7 @@
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
+ ,ContractNo_text__c,/*ContractNo__c1*
//add by rentx 2020-10-14 end
,hospitalSpecialOffer__c
FROM Consumable_order_details2__c
@@ -328,19 +360,22 @@
AND Arrive_Owner_Work_Location__c =: userWorkLocation
AND Dealer_Arrive__c = true ];
for (Integer i = 0; i < reSet1.size(); i++) {
- OrderAllMap.put(reSet1[i].Bar_Code__c,reSet1[i].Bar_Code__c);
+ // OrderAllMap.put(reSet1[i].Bar_Code__c,reSet1[i].Bar_Code__c);
//add by rentx 2021-01-27
- reallMap.put(reSet1[i].Bar_Code__C, reSet1[i]);
+ // reallMap.put(reSet1[i].Bar_Code__C, reSet1[i]);
//add by rentx 2021-01-27
- ConsumableorderdetailsRecordsdummy.add(new ConsumableorderdetailsInfo(reSet1[i]));
+ //涓嶉渶瑕佸睍绀哄凡鍒拌揣鐨勬槑缁� update by rentx 20210617 start 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);
//}
}
- }
+ }*/
ConsumableorderdetailsRecords = new List<ConsumableorderdetailsInfo>();
-
+ BarCodeListP = new List<String>();
BarCodeListP = ParseBarCode(barcode);
Consumable_order_details2__c p = new Consumable_order_details2__c();
List<Consumable_order_details2__c> Ins = New List<Consumable_order_details2__c>();
@@ -351,7 +386,7 @@
return;
}
//瀵规瘮鍏ㄩ儴搴撳瓨涓槸鍚﹀瓨鍦ㄧ鐞嗙紪鐮佷竴鏍凤紝barcode鍙蜂笉涓�鏍风殑浜у搧
- reSet1 = [SELECT Id, Name,TracingCode__c,Bar_Code__c
+ 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
@@ -385,7 +420,7 @@
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
+ TracingCode__c,Report_Product_Expiration__c
FROM Consumable_order_details2__c
WHERE Bar_Code__c in :BarCodeListP
AND Dealer_Info_text__c = :accountName
@@ -451,7 +486,7 @@
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
+ 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
@@ -483,7 +518,7 @@
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
+ 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
@@ -508,7 +543,7 @@
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
+ 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
@@ -537,7 +572,7 @@
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
+ 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
@@ -583,6 +618,7 @@
//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
@@ -631,7 +667,8 @@
Consumable_order_details2__c codsIns = new Consumable_order_details2__c();
codsIns.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
- codsIns.Intra_Trade_List_RMB__c =null;
+ 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;
@@ -661,8 +698,9 @@
//add by rentx 2020-10-13 end
//add by rentx 2021-03-22 start
- if (reSet1[i].Lose_Flag__c == true){
- codsIns.exchangeOutPattern__c = reSet1[i].hospitalSpecialOffer__c;
+ // if (reSet1[i].Lose_Flag__c == true){
+ if (reSet1[i].hospitalSpecialOffer__c == true && reSet1[i].SummonsForDirction_det__c == '浜掔浉璋冭揣'){
+ codsIns.exchangeOutPattern__c = true;
}
//add by rentx 2021-03-22 end
@@ -685,7 +723,7 @@
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
+ 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
@@ -698,7 +736,7 @@
//add by rentx 2020-10-13 end 浜掔浉璋冭揣鏃�,鍊熷叆鏂硅褰昐AP鍚堝悓鍙�
,hospitalSpecialOffer__c
,exchangeOutPattern__c
- ,Lose_Flag__c
+ ,Lose_Flag__c,Report_Product_Expiration__c
FROM Consumable_order_details2__c
WHERE Dealer_Arrive__c = FALSE
AND Dealer_Shipment__c= FALSE
@@ -747,7 +785,8 @@
Consumable_order_details2__c codsIns = new Consumable_order_details2__c();
codsIns.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
- codsIns.Intra_Trade_List_RMB__c =null;
+ 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;
@@ -778,8 +817,9 @@
//add by rentx 2020-10-13 end 浜掔浉璋冭揣鏃�,鍊熷叆鏂硅褰昐AP鍚堝悓鍙�
//add by rentx 2021-03-22 start
- if (reSet1[i].Lose_Flag__c == true){
- codsIns.exchangeOutPattern__c = reSet1[i].hospitalSpecialOffer__c;
+ // if (reSet1[i].Lose_Flag__c == true){
+ if (reSet1[i].hospitalSpecialOffer__c == true && reSet1[i].SummonsForDirction_det__c == '浜掔浉璋冭揣'){
+ codsIns.exchangeOutPattern__c = true;
}
//add by rentx 2021-03-22 end
@@ -839,11 +879,14 @@
// 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
@@ -870,6 +913,7 @@
// 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
@@ -1075,8 +1119,17 @@
}
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);
}
}
@@ -1088,7 +1141,7 @@
// CHAN-BD43NK 鍏抽棴鐩存帴杩斿搧鍔熻兘 杩藉姞 barcode涓嶄竴鑷村垽鏂�
- reSet1 = [SELECT Id,Name,TracingCode__c,Bar_Code__c,Sale_orderName__c
+ 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
@@ -1170,7 +1223,7 @@
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
+ 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
@@ -1197,7 +1250,7 @@
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
+ 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
@@ -1222,7 +1275,7 @@
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
+ 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
@@ -1247,7 +1300,7 @@
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
+ 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
@@ -1275,7 +1328,7 @@
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
+ 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
@@ -2669,11 +2722,15 @@
//鍒拌揣纭
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){
ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR,'涓嶅瓨鍦ㄥ埌璐ф槑缁�'));
return null;
@@ -2714,7 +2771,6 @@
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;
@@ -2746,11 +2802,14 @@
// }
insAfterDel.Name = consumable_order[0].Name + '-'+ str;
insAfterDel.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
- 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;
- }
+ // 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;
@@ -2784,7 +2843,7 @@
// 杩藉姞棣栨鍏ュ簱缁忛攢鍟� 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*/;
+ //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;
@@ -2823,7 +2882,6 @@
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------'));
@@ -2855,7 +2913,7 @@
i++;
}
- //return null;
+ // return null;
if(insertconsumableorderdetails2.size() >0){
insert insertconsumableorderdetails2;
@@ -3016,6 +3074,8 @@
,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
@@ -3124,7 +3184,10 @@
// 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
@@ -3326,7 +3389,8 @@
codcorderdet.SerialLotNo__c = codi.esd.SerialLotNo__c;
codcorderdet.TracingCode__c = codi.esd.TracingCode__c;
codcorderdet.Sterilization_limit__c = codi.esd.Sterilization_limit__c;
- codcorderdet.Intra_Trade_List_RMB__c = codi.esd.Intra_Trade_List_RMB__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;
@@ -3408,7 +3472,8 @@
codcorderdet.SerialLotNo__c = codi.esd.SerialLotNo__c;
codcorderdet.TracingCode__c = codi.esd.TracingCode__c;
codcorderdet.Sterilization_limit__c = codi.esd.Sterilization_limit__c;
- codcorderdet.Intra_Trade_List_RMB__c = codi.esd.Intra_Trade_List_RMB__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){
codcorderdet.loseInventory__c = true;
@@ -3441,7 +3506,6 @@
codcList.add( codi.esd );
}
}
-
//鏄庣粏2涓嶅瓨鍦ㄧ殑瀵瑰簲鐨勫埌璐ц鍗曟槑缁� 2017-07-05
Integer i = 1;
//for(ConsumableorderdetailsInfo ass : consumableInventoryUse){
@@ -3462,7 +3526,8 @@
//鍒拌揣鏄庣粏
codcorderdetail.Name = consumable_order_arr[0].Name + '-'+ str;
codcorderdetail.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
- codcorderdetail.Intra_Trade_List_RMB__c = null;
+ 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;
@@ -3502,7 +3567,8 @@
retorddetail.Name = consumable_order_ret[0].Name + '-'+ str;
retorddetail.RecordTypeId = System.Label.RT_ConOrderDetail2_Return;
- retorddetail.Intra_Trade_List_RMB__c = null;
+ 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;
@@ -3520,11 +3586,11 @@
//add by rentx 2020-10-14 start
// retorddetail.ContractNo_text__c = /*ass.esd.ContractNo__c*/;
// tcm start
- // if (String.isBlank(ass.esd.Consumable_order_minor__r.ContractNo__c)) {
- // retorddetail.ContractNo_text__c= ass.esd.ContractNo_text__c;
- // }else {
+ if (String.isBlank(ass.esd.Consumable_order_minor__r.ContractNo__c)) {
+ retorddetail.ContractNo_text__c= ass.esd.ContractNo_text__c;
+ }else {
retorddetail.ContractNo_text__c= ass.esd.Consumable_order_minor__r.ContractNo__c;
- // }
+ }
// tcm end
//add by rentx 2020-10-14 end
@@ -3618,7 +3684,10 @@
}
}catch(Exception e){
//Database.rollback(sp);
- ApexPages.addMessages(e);
+ throw new ControllerUtil.myException('e::'+e + ' linenumber::'+e.getLineNumber());
+ // ApexPages.addMessages(e);
+ // ApexPages.addMessages(e.getLineNumber() + ' 11111111111111111');
+
//return null;
}
}
@@ -3661,12 +3730,18 @@
public Integer intMark { get; set; }
public Decimal arriveAmount { get; set; }
public Decimal arrivedCount { get; set; }
+
+ public String ReportProductExpirationDate {get;set;}
public ConsumableorderdetailsInfo(Consumable_order_details2__c e,string str) {
esd = e;
Prod = e.Consumable_Product__r;
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;
@@ -3678,6 +3753,10 @@
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) {
@@ -3702,6 +3781,10 @@
}
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;
--
Gitblit v1.9.1