| | |
| | | //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;} |
| | |
| | | public String product_Type = null; |
| | | public Boolean EngFlag = false; |
| | | public Boolean ETFlag = false; |
| | | |
| | | //LWC:Lwcflag和报错提醒 update by Link 2023-04-27 |
| | | public Boolean isLwc = false; |
| | | public String returnError; |
| | | public List<String> warningList; |
| | | public List<String> errorList; |
| | | public String urlType; |
| | | |
| | | public ArriveGoodsController(){ |
| | | baseUrl = URL.getSalesforceBaseUrl().toExternalForm(); |
| | | ESetId = ApexPages.currentPage().getParameters().get('esetId'); |
| | |
| | | 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){ |
| | | this.ESetId = eSetId; |
| | | this.ArrType = arrType; |
| | | ConsumableorderdetailsRecords = new List<ConsumableorderdetailsInfo>(); |
| | | ConsumableorderdetailsRecordserror = new List<ConsumableorderdetailsInfo>(); |
| | | ConsumableorderdetailsRecordsdummy = new List<ConsumableorderdetailsInfo>(); |
| | | consumableInventory = new List<ConsumableorderdetailsInfo>(); |
| | | consumableorderdetailsRecordsUse = new List<ConsumableorderdetailsInfo>(); |
| | | consumableInventoryUse = new List<ConsumableorderdetailsInfo>(); |
| | | consumableorderdetails2Cancle = new List<Consumable_order_details2__c>(); |
| | | orderdetails2trMap = new Map<String,Consumable_order_details2__c>(); |
| | | detailsSummary = new List<ConsumableorderdetailsInfo>(); |
| | | saveFLGbln = FALSE; |
| | | consumableorderdetailsRecordsview = new List<List<ConsumableorderdetailsInfo>>(); |
| | | noboxBarcodeList = new Set<String>(); |
| | | //LWC:Lwcflag和报错提醒 update by Link 2023-04-27 |
| | | warningList = new List<String>(); |
| | | errorList = new List<String>(); |
| | | returnError = null; |
| | | urlType = null; |
| | | } |
| | | |
| | | //add by rentx 20210602 CHAN-C3K4ZQ start 出错的原因是页面最多展示1000条数据,但是需要展示的数据超过了1000条,现在把展示上线改为1000 * 1000 |
| | |
| | | //========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 = '请输入BarCode号'; |
| | | }else { |
| | | ApexPages.addmessage(new ApexPages.message(ApexPages.severity.INFO,'请输入BarCode号。')); |
| | | } |
| | | return; |
| | | } |
| | | notInlist = new list<String>(); |
| | | otherAgencyMap = new Map<String, String>(); |
| | | barMcodeMap = new Map<String, String>(); |
| | |
| | | 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>(); |
| | |
| | | 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,'请输入BarCode号。')); |
| | | return; |
| | | } |
| | | //移到最上边 by Link 2023-5-23 |
| | | // if(barcode == null || barcode.trim() ==''){ |
| | | // //LWC:Lwcflag和报错提醒 update by Link 2023-04-27 |
| | | // if(isLwc){ |
| | | // returnError = '请输入BarCode号'; |
| | | // }else { |
| | | // ApexPages.addmessage(new ApexPages.message(ApexPages.severity.INFO,'请输入BarCode号。')); |
| | | // } |
| | | // return; |
| | | // } |
| | | //对比全部库存中是否存在管理编码一样,barcode号不一样的产品 |
| | | reSet1 = [SELECT Id, Name,TracingCode__c,Bar_Code__c,Report_Product_Expiration__c |
| | | FROM Consumable_order_details2__c |
| | |
| | | }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); |
| | | } |
| | |
| | | } |
| | | //ApexPages.addmessage(new ApexPages.message(ApexPages.severity.INFO, '管理编码为空的产品 ' + ErrorIdMap)); |
| | | //整体到货 |
| | | System.debug('EsetId===>'+EsetId); |
| | | System.debug('ArrType===>'+ArrType); |
| | | if(EsetId == null || EsetId == ''){ |
| | | if(ArrType!='ReG'){ |
| | | //到货但产品类型与用户的类型不符 |
| | |
| | | } |
| | | } |
| | | } |
| | | 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, |
| | |
| | | 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; |
| | |
| | | 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 |
| | |
| | | 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; |
| | |
| | | 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 |
| | |
| | | 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+'存在丢失记录'));//如果丢失产品就给提示。 |
| | | //LWC:Lwcflag和报错提醒 update by Link 2023-04-27 |
| | | if(isLwc){ |
| | | warningList.add('产品'+reSet1[i].Consumable_Product__r.Name+'存在丢失记录'); |
| | | }else { |
| | | ApexPages.addmessage(new ApexPages.message(ApexPages.severity.WARNING, '产品'+reSet1[i].Consumable_Product__r.Name+'存在丢失记录'));//如果丢失产品就给提示。 |
| | | } |
| | | } |
| | | if (reSet1[i].Lose_Flag__c == true && reSet1[i].ToDueDateDays__c < 0) { |
| | | str = '过期已销存产品,不允许返品'; |
| | |
| | | }else{ |
| | | Matcher n = Pattern.compile('[0-9]').matcher(reSet[i].TracingCode__c); |
| | | if(n.find()){ |
| | | String str = '管理编码中有数字,请与管理员确认是否错误。'; |
| | | // 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 |
| | | } |
| | | if(otherAgencyMap.containsKey(reSet[i].Bar_Code__c)){ |
| | | for (Integer j=0; j<consumableInventory.size(); j++) { |
| | |
| | | continue; |
| | | }else{ |
| | | Matcher n = Pattern.compile('[0-9]').matcher(reSet[i].TracingCode__c); |
| | | if(n.find()){ |
| | | String str = '管理编码中有数字,请与管理员确认是否错误。'; |
| | | 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()){ |
| | | // 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 |
| | | //LWC:Lwcflag和报错提醒 update by Link 2023-04-27 |
| | | if(isLwc){ |
| | | warningList.add('条形码为('+ str +')的入库数据与发货数据不一致'); |
| | | }else { |
| | | // 20220815 ljh SWAG-CH65B7 start |
| | | // ApexPages.addmessage(new ApexPages.message(ApexPages.severity.WARNING,'此管理编码与实际发货BarCode不一致,请核对管理编码('+ str +')的入库及库存数据。')); |
| | | ApexPages.addmessage(new ApexPages.message(ApexPages.severity.WARNING,'条形码为('+ str +')的入库数据与发货数据不一致')); |
| | | // 20220815 ljh SWAG-CH65B7 end |
| | | } |
| | | } |
| | | if(barMcodeMap.get(str) == reSet[i].TracingCode__c){ |
| | | reSet[i].Bar_Code__c = str; |
| | |
| | | }else{ |
| | | for(String str : barMcodeMap.keySet()){ |
| | | if(barMcodeMap.get(str) == reSet1[i].TracingCode__c){ |
| | | ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR, 'barcode' +str + '与出库单' + reSet1[i].Sale_orderName__c + ' 中的管理编码一致,但Barcode不同,请确认具体数据。')); |
| | | //LWC:Lwcflag和报错提醒 update by Link 2023-04-27 |
| | | if(isLwc){ |
| | | errorList.add('barcode' +str + '与出库单' + reSet1[i].Sale_orderName__c + ' 中的管理编码一致,但Barcode不同,请确认具体数据。'); |
| | | }else { |
| | | ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR, 'barcode' +str + '与出库单' + reSet1[i].Sale_orderName__c + ' 中的管理编码一致,但Barcode不同,请确认具体数据。')); |
| | | } |
| | | ErrorIdMap.put(str,str); |
| | | ErrorIdMap.put(reSet1[i].Bar_Code__c,reSet1[i].Bar_Code__c); |
| | | } |
| | |
| | | if(ArrType!='ReG'){ |
| | | inventoryEntryNoESetId(notInlist); |
| | | if(notInStorelist.size() > 0){ |
| | | ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR,'BarCode号'+ notInStorelist + '不存在。')); |
| | | //LWC:Lwcflag和报错提醒 update by Link 2023-04-27 |
| | | if(isLwc){ |
| | | returnError = 'BarCode号'+ notInStorelist + '不存在'; |
| | | }else { |
| | | ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR,'BarCode号'+ notInStorelist + '不存在。')); |
| | | } |
| | | return; |
| | | } |
| | | }else{ |
| | | ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR,'BarCode号'+ notInlist + '不存在,无对应的出库单,请先操作产品入库。')); |
| | | //LWC:Lwcflag和报错提醒 update by Link 2023-04-27 |
| | | if(isLwc){ |
| | | returnError = 'BarCode号'+ notInlist + '不存在,无对应的出库单,请先操作产品入库'; |
| | | }else { |
| | | ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR,'BarCode号'+ notInlist + '不存在,无对应的出库单,请先操作产品入库。')); |
| | | } |
| | | return; |
| | | } |
| | | } |
| | |
| | | //add by rentx 2021-01-27 start |
| | | if (HosErrorList.size() > 0) { |
| | | for (String str : HosErrorList) { |
| | | ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR,'BarCode号:' + str + HosErrorMap.get(str)+'')); |
| | | |
| | | //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{ |
| | | Matcher n = Pattern.compile('[0-9]').matcher(reSet[i].TracingCode__c); |
| | | if(n.find()){ |
| | | String str = '管理编码中有数字,请与管理员确认是否错误。'; |
| | | // 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])); |
| | |
| | | }else{ |
| | | Matcher n = Pattern.compile('[0-9]').matcher(reSet[i].TracingCode__c); |
| | | if(n.find()){ |
| | | String str = '管理编码中有数字,请与管理员确认是否错误。'; |
| | | // 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(notInlist.size()>0){ |
| | | inventoryEntry(notInlist); |
| | | if(notInStorelist.size() > 0){ |
| | | ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR,'BarCode号'+ notInStorelist + '不存在。')); |
| | | //LWC:Lwcflag和报错提醒 update by Link 2023-04-27 |
| | | if(isLwc){ |
| | | returnError = 'BarCode号'+ notInStorelist + '不存在'; |
| | | }else { |
| | | ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR,'BarCode号'+ notInStorelist + '不存在。')); |
| | | } |
| | | return; |
| | | } |
| | | } |
| | |
| | | //add by rentx 2021-01-27 start 当订单为医院特价类型的订单时,如果找不到barcode,不解析,并且默认该barcode对应的明细2为非医院特价产品,直接报错 |
| | | if (HosErrorList.size() > 0) { |
| | | for (String str : HosErrorList) { |
| | | ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR,'BarCode号:' + str +'是非医院特价产品')); |
| | | //LWC:Lwcflag和报错提醒 update by Link 2023-04-27 |
| | | if(isLwc){ |
| | | errorList.add('BarCode号:' + str +'是非医院特价产品'); |
| | | }else { |
| | | ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR,'BarCode号:' + str +'是非医院特价产品')); |
| | | } |
| | | |
| | | } |
| | | } |
| | |
| | | //生产日期 |
| | | 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 { |
| | | //if(barCodeList[i].substring(0,2) !='01'){ |
| | |
| | | try{ |
| | | Decimal test = Decimal.valueOf(janCodeMark); |
| | | }catch(Exception e){ |
| | | ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR,'产品BarCode(' + barCodeList[i] + ')的janCode错误!')); |
| | | //LWC:Lwcflag和报错提醒 update by Link 2023-04-27 |
| | | if(isLwc){ |
| | | errorList.add('产品BarCode(' + barCodeList[i] + ')的janCode错误!'); |
| | | }else { |
| | | ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR,'产品BarCode(' + barCodeList[i] + ')的janCode错误!')); |
| | | } |
| | | 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'){ |
| | |
| | | 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){ |
| | |
| | | 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){ |
| | |
| | | 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){ |
| | |
| | | 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; |
| | | // gzw DB202305352696 入库管理编码验证程序调整 start |
| | | if (tracingCode.length() == 5) { |
| | | String tr = tracingCode; |
| | | String Ctr = tr.substring(tr.length() - 3,tr.length()); |
| | | String Btr = tr.substring(tr.length() - 4,tr.length()-3); |
| | | String Atr = tr.substring(tr.length() - 5,tr.length()-4); |
| | | if (Pattern.compile('[0-9]').matcher(Atr).find() || Pattern.compile('[0-9]').matcher(Ctr).find()) { |
| | | //LWC:Lwcflag和报错提醒 update by Link 2023-04-27 |
| | | String str = '管理编码有误,请检查条形码数据。'; |
| | | if(isLwc){ |
| | | errorList.add('产品BarCode(' + barCodeList[i] + ')管理编码有误,请检查条形码数据。'); |
| | | }else { |
| | | ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR,'产品BarCode(' + barCodeList[i] + ')管理编码有误,请检查条形码数据。')); |
| | | } |
| | | continue; |
| | | } |
| | | } |
| | | } |
| | | }else{ |
| | | ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR,'产品BarCode(' + barCodeList[i] + ')的tracingCode错误!')); |
| | | //LWC:Lwcflag和报错提醒 update by Link 2023-04-27 |
| | | if(isLwc){ |
| | | errorList.add('产品BarCode(' + barCodeList[i] + ')的tracingCode错误!'); |
| | | }else { |
| | | ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR,'产品BarCode(' + barCodeList[i] + ')的tracingCode错误!')); |
| | | } |
| | | continue; |
| | | } |
| | | } |
| | |
| | | barCode01List.add(barCodeList[i]); |
| | | }else if(barCodeList[i].substring(0,3) =='241'){ |
| | | if(barCodeList[i].length() > 8 && barCodeList[i].substring(barCodeList[i].length() - 8,barCodeList[i].length()-5)!='250'){ |
| | | ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR, '产品BarCode(' + barCodeList[i] + ')没有管理编码!')); |
| | | //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); |
| | |
| | | barOtcodeMap.put(barCodeList[i], otCodeMap); |
| | | barCode241List.add(barCodeList[i]); |
| | | }else{ |
| | | 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; |
| | | } |
| | | }else{ |
| | | 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(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+']不符')); |
| | | } |
| | | } |
| | | } |
| | | } |
| | |
| | | } |
| | | } |
| | | 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,Product2_Jancode__c, |
| | | Pro2_Dealer_ENG__c,Pro2_Dealer_Object__c |
| | |
| | | productDateStr = '20' + bar.substring(oTcodeLength + 5,oTcodeLength + 7) + '-' + bar.substring(oTcodeLength + 7,oTcodeLength + 9) + '-01' ; |
| | | productionDate = Date.valueOf(productDateStr); |
| | | }catch(Exception e){ |
| | | ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR, '产品BarCode(' + bar + ')的生产日期' + productDateStr + '错误!')); |
| | | //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){ |
| | |
| | | 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){ |
| | |
| | | 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){ |
| | |
| | | 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 + ')的tracingCode错误!')); |
| | | //LWC:Lwcflag和报错提醒 update by Link 2023-04-27 |
| | | if(isLwc){ |
| | | errorList.add('产品BarCode(' + bar + ')的tracingCode错误!'); |
| | | }else { |
| | | ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR,'产品BarCode(' + bar + ')的tracingCode错误!')); |
| | | } |
| | | continue; |
| | | } |
| | | } |
| | |
| | | //生产日期 |
| | | 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] + ')的janCode错误!')); |
| | | //LWC:Lwcflag和报错提醒 update by Link 2023-04-27 |
| | | if(isLwc){ |
| | | errorList.add('产品BarCode(' + barCodeList[i] + ')的janCode错误!'); |
| | | }else { |
| | | ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR,'产品BarCode(' + barCodeList[i] + ')的janCode错误!')); |
| | | } |
| | | 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'){ |
| | |
| | | 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){ |
| | |
| | | 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){ |
| | |
| | | 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){ |
| | |
| | | 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; |
| | | // gzw DB202305352696 入库管理编码验证程序调整 start |
| | | if (tracingCode.length() == 5) { |
| | | String tr = tracingCode; |
| | | String Ctr = tr.substring(tr.length() - 3,tr.length()); |
| | | String Btr = tr.substring(tr.length() - 4,tr.length()-3); |
| | | String Atr = tr.substring(tr.length() - 5,tr.length()-4); |
| | | if (Pattern.compile('[0-9]').matcher(Atr).find() || Pattern.compile('[0-9]').matcher(Ctr).find()) { |
| | | String str = '管理编码不正确,请与管理员确认是否错误。'; |
| | | //LWC:Lwcflag和报错提醒 update by Link 2023-04-27 |
| | | if(isLwc){ |
| | | errorList.add('产品BarCode(' + barCodeList[i] + ')管理编码有误,请检查条形码数据。'); |
| | | }else { |
| | | ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR,'产品BarCode(' + barCodeList[i] + ')管理编码有误,请检查条形码数据。')); |
| | | } |
| | | continue; |
| | | } |
| | | } |
| | | // String str = '管理编码不正确,请与管理员确认是否错误。'; |
| | | // ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR,'产品BarCode(' + barCodeList[i] + ')管理编码中有数字,请与管理员确认是否错误!')); |
| | | // continue; |
| | | // gzw DB202305352696 入库管理编码验证程序调整 end |
| | | } |
| | | }else{ |
| | | ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR,'产品BarCode(' + barCodeList[i] + ')的tracingCode错误!')); |
| | | //LWC:Lwcflag和报错提醒 update by Link 2023-04-27 |
| | | if(isLwc){ |
| | | errorList.add('产品BarCode(' + barCodeList[i] + ')的tracingCode错误!'); |
| | | }else { |
| | | ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR,'产品BarCode(' + barCodeList[i] + ')的tracingCode错误!')); |
| | | } |
| | | continue; |
| | | } |
| | | } |
| | |
| | | barCode01List.add(barCodeList[i]); |
| | | }else if(barCodeList[i].substring(0,3) =='241'){ |
| | | if(barCodeList[i].length() > 8 && barCodeList[i].substring(barCodeList[i].length() - 8,barCodeList[i].length()-5)!='250'){ |
| | | ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR, '产品BarCode(' + barCodeList[i] + ')没有管理编码!')); |
| | | //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); |
| | |
| | | barOtcodeMap.put(barCodeList[i], otCodeMap); |
| | | barCode241List.add(barCodeList[i]); |
| | | }else{ |
| | | ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR,'产品BarCode(' + barCodeList[i] + ')没有janCode或OTcode,不符合要求!')); |
| | | //LWC:Lwcflag和报错提醒 update by Link 2023-04-27 |
| | | if(isLwc){ |
| | | errorList.add('产品BarCode(' + barCodeList[i] + ')没有janCode或OTcode,不符合要求!'); |
| | | }else { |
| | | ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR,'产品BarCode(' + barCodeList[i] + ')没有janCode或OTcode,不符合要求!')); |
| | | } |
| | | continue; |
| | | } |
| | | } |
| | |
| | | } |
| | | } |
| | | 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,Product2_Jancode__c, |
| | |
| | | } |
| | | } |
| | | 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 |
| | |
| | | productDateStr = '20' + bar.substring(oTcodeLength + 5,oTcodeLength + 7) + '-' + bar.substring(oTcodeLength + 7,oTcodeLength + 9) + '-01' ; |
| | | productionDate = Date.valueOf(productDateStr); |
| | | }catch(Exception e){ |
| | | ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR, '产品BarCode(' + bar + ')的生产日期' + productDateStr + '错误!')); |
| | | //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){ |
| | |
| | | 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){ |
| | |
| | | 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){ |
| | |
| | | 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 + ')的tracingCode错误!')); |
| | | //LWC:Lwcflag和报错提醒 update by Link 2023-04-27 |
| | | if(isLwc){ |
| | | errorList.add('产品BarCode(' + bar + ')的tracingCode错误!'); |
| | | }else { |
| | | ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR,'产品BarCode(' + bar + ')的tracingCode错误!')); |
| | | } |
| | | continue; |
| | | } |
| | | } |
| | |
| | | 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)); |
| | | } |
| | | } |
| | | } |
| | | } |
| | |
| | | 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; |
| | | } |
| | | if(EsetId != null && EsetId != ''){ |
| | |
| | | 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() +'个订货的数量。')); |
| | | //LWC:Lwcflag和报错提醒 update by Link 2023-04-27 |
| | | if(isLwc){ |
| | | warningList.add('产品' + widget + '本次到货数量超过' + overOrderBARcodeCunMap.get(widget).size() +'个订货的数量。'); |
| | | }else { |
| | | ApexPages.addmessage(new ApexPages.message(ApexPages.severity.INFO, '产品' + widget + '本次到货数量超过' + overOrderBARcodeCunMap.get(widget).size() +'个订货的数量。')); |
| | | } |
| | | for(String barcodeListTTT : (List<String>)overOrderBARcodeCunMap.get(widget)) { |
| | | 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)); |
| | | } |
| | | } |
| | | } |
| | | } |
| | |
| | | // } |
| | | insAfterDel.Name = consumable_order[0].Name + '-'+ str; |
| | | insAfterDel.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery; |
| | | if(EsetId != null && EsetId != ''){ |
| | | // 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; |
| | | }else{ |
| | | insAfterDel.Intra_Trade_List_RMB__c = 0; |
| | | } |
| | | //gzw 手动入库 默认产品单价 20230307 |
| | | insAfterDel.Asset_Model_No__c = ass.Prod.Asset_Model_No__c; |
| | | if(EsetId != null && EsetId != ''){ |
| | | insAfterDel.Consumable_order_minor__c = ESetId; |
| | |
| | | // 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; |
| | | } |
| | | if(resultcheck.length() > 0){ |
| | |
| | | }else if(resultcheckWithoutOrder.size() >0){ |
| | | return null; |
| | | } else{ |
| | | urlType = 'UnabletoEdit'; |
| | | return UnabletoEdit(); |
| | | // return null; |
| | | } |
| | |
| | | // 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 |
| | |
| | | |
| | | Matcher n = Pattern.compile('[0-9]').matcher(codc.TracingCode__c); |
| | | if(n.find()){ |
| | | String str = '管理编码中有数字,请与管理员确认是否错误。'; |
| | | // 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); |
| | |
| | | // 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 |
| | |
| | | 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>(); |
| | |
| | | } |
| | | |
| | | 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; |
| | | } |
| | | |
| | |
| | | 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; |
| | | } |
| | | } |
| | |
| | | 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; |
| | |
| | | // } |
| | | |
| | | if(ass.ReturnReason==null || ass.ReturnReason==''){ |
| | | 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; |
| | | } |
| | | |
| | | //到货明细 |
| | | 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; |
| | |
| | | // WYIN-BPE3T4 虚拟盘点单 update by vivek 2020-05-11 start |
| | | // return ToReturnGoodsPage(); |
| | | if(hasLoseGoods){ |
| | | urlType = 'ToInventoryGoodsPage'; |
| | | return ToInventoryGoodsPage(); |
| | | // return null; |
| | | }else{ |
| | | urlType = 'ToReturnGoodsPage'; |
| | | return ToReturnGoodsPage(); |
| | | // return null; |
| | | } |
| | | // WYIN-BPE3T4 虚拟盘点单 update by vivek 2020-05-11 start |
| | | } |
| | | else{ |
| | | ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR,'没有需要登录的返品')); |
| | | //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); |
| | | //LWC:Lwcflag和报错提醒 update by Link 2023-04-27 |
| | | if(isLwc){ |
| | | returnError = e.getLineNumber()+'---'+e.getMessage(); |
| | | }else { |
| | | ApexPages.addMessages(e); |
| | | } |
| | | return null; |
| | | } |
| | | } |
| | |
| | | return ref; |
| | | } |
| | | |
| | | class ConsumableorderdetailsInfo implements Comparable { |
| | | 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 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; |