| | |
| | | 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 |
| | |
| | | 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>(); |
| | |
| | | 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;} |
| | |
| | | //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]; |
| | |
| | | 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 |
| | | } |
| | | } |
| | |
| | | barMcodeMap.put(B,tracingCode); |
| | | } |
| | | outPut.add(B); |
| | | } |
| | | }system.debug('barMcodeMap等于'+barMcodeMap); |
| | | return outPut; |
| | | } |
| | | |
| | |
| | | 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, |
| | |
| | | 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 |
| | |
| | | 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>(); |
| | |
| | | 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 |
| | |
| | | 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 |
| | |
| | | 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 |
| | |
| | | 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 |
| | |
| | | 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 |
| | |
| | | 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 |
| | |
| | | //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 |
| | |
| | | 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; |
| | |
| | | //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 |
| | | |
| | |
| | | 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 |
| | |
| | | //add by rentx 2020-10-13 end 互相调货时,借入方记录SAP合同号 |
| | | ,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 |
| | |
| | | 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; |
| | |
| | | //add by rentx 2020-10-13 end 互相调货时,借入方记录SAP合同号 |
| | | |
| | | //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 |
| | | |
| | |
| | | // 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 |
| | |
| | | // 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 |
| | |
| | | } |
| | | 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); |
| | | } |
| | | } |
| | |
| | | |
| | | |
| | | // 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 |
| | |
| | | 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 |
| | |
| | | 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 |
| | |
| | | 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 |
| | |
| | | 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 |
| | |
| | | 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 |
| | |
| | | |
| | | //到货确认 |
| | | 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; |
| | |
| | | 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; |
| | |
| | | // } |
| | | 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; |
| | |
| | | // 追加首次入库经销商 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; |
| | |
| | | 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------')); |
| | |
| | | i++; |
| | | } |
| | | |
| | | //return null; |
| | | // return null; |
| | | |
| | | if(insertconsumableorderdetails2.size() >0){ |
| | | insert insertconsumableorderdetails2; |
| | |
| | | ,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 |
| | |
| | | // 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 |
| | |
| | | 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; |
| | |
| | | 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; |
| | |
| | | codcList.add( codi.esd ); |
| | | } |
| | | } |
| | | |
| | | //明细2不存在的对应的到货订单明细 2017-07-05 |
| | | Integer i = 1; |
| | | //for(ConsumableorderdetailsInfo ass : consumableInventoryUse){ |
| | |
| | | //到货明细 |
| | | 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; |
| | |
| | | |
| | | 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; |
| | |
| | | //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 |
| | | |
| | |
| | | } |
| | | }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; |
| | | } |
| | | } |
| | |
| | | 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; |
| | |
| | | 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) { |
| | |
| | | } |
| | | 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; |