| | |
| | | consumableorderdetailsRecordsview.add(recordsdummy); |
| | | } |
| | | |
| | | // Integer count = recordsdummy.size() / 1000; |
| | | // Integer last = recordsdummy.size() - (1000*count); |
| | | // Integer count = recordsdummy.size() / 1000; |
| | | // Integer last = recordsdummy.size() - (1000*count); |
| | | |
| | | // for(Integer i = 0; i < count ; i++){ |
| | | // List<ConsumableorderdetailsInfo> tempList = new List<ConsumableorderdetailsInfo>(); |
| | |
| | | HosErrorMap = new Map<String,String>(); |
| | | //add by rentx 2021-01-27 end |
| | | |
| | | 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 != ''){ |
| | | 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 != ''){ |
| | | List<Consumable_order_details2__c> reSet1 = [SELECT Id, |
| | | Name, |
| | | Intra_Trade_List_RMB__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; |
| | |
| | | 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){ |
| | | ApexPages.addmessage(new ApexPages.message(ApexPages.severity.WARNING,'此管理编码已入库且BarCode不一致,请核对管理编码('+ str +')的入库及库存数据。')); |
| | | 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; |
| | |
| | | } |
| | | //add by rentx 2021-01-27 end |
| | | |
| | | makeArrivedSummary(); |
| | | makeArrivedSummary(); |
| | | |
| | | |
| | | //add by rentx 20210602 start CHAN-C3K4ZQ |
| | |
| | | |
| | | } |
| | | |
| | | public void confimResultWithoutOrder() { |
| | | /*list<String> overOrderproList = new list<String>(); |
| | | public void confimResultWithoutOrder() { |
| | | /*list<String> overOrderproList = new list<String>(); |
| | | list<String> overOrderBARcodeCunList = new list<String>(); |
| | | orderProductCunMap.clear(); |
| | | orderProductArrivedCunMap.clear(); |
| | |
| | | /*orderWantArriveCunMap.put(ass.esd.Consumable_order_minor__c + ass.esd.Asset_Model_No__c,orderWantArriveCunMap.get(ass.esd.Consumable_order_minor__c + ass.esd.Asset_Model_No__c)+1); |
| | | } |
| | | return overOrderproList;*/ |
| | | } |
| | | } |
| | | |
| | | // WYIN-BLZE48盘点丢失产品增加入库方式 update by vivek 2020-03-05 start |
| | | // 虚拟盘点单消耗品明细1创建巡回 |
| | |
| | | ins.Used_date__c = Date.today(); |
| | | ins.OwnerId = arriveAccount.OwnerId; |
| | | |
| | | insDetail1.add(ins); |
| | | } |
| | | insDetail1Map.put(acc, insDetail1); |
| | | } |
| | | insert orderList; |
| | | insDetail1.add(ins); |
| | | } |
| | | insDetail1Map.put(acc, insDetail1); |
| | | } |
| | | insert orderList; |
| | | |
| | | List<Id> orderIdList = new List<Id> (); |
| | | for (Consumable_order__c co : orderList) { |
| | |
| | | insDetail1List.add(dtl1); |
| | | } |
| | | |
| | | // 明细2 |
| | | List<Consumable_order_details2__c> d2list = accountGroupMap.get(setId.Dealer_Info__r.Name + setId.Order_Owner_WorkLocal__c); |
| | | for (Consumable_order_details2__c dtl2 : d2list) { |
| | | dtl2.Send_Date__c = Date.today(); |
| | | dtl2.Consumable_Sale_order__c = null; |
| | | dtl2.Consumable_Return_order__c = null; |
| | | dtl2.Consumable_ZS_order__c = setId.Id; |
| | | //dtl2.Delivery_List_RMB__c = null; |
| | | dtl2.Return_date__c = null; |
| | | dtl2.Return_reason__c = null; |
| | | dtl2.Consumable_Shipment_order__c = setId.Id; |
| | | // 更新借调信息 add by gzw 2020-0-415 start |
| | | dtl2.Transfer_Time__c = 1; |
| | | dtl2.Agency_Transfer__c = true; |
| | | dtl2.Frist_Transfer_Agency__c = dtl2.Dealer_Info_text__c; |
| | | // 更新借调信息 add by gzw 2020-0-415 end |
| | | updDetail2List.add(dtl2); |
| | | } |
| | | } |
| | | |
| | | insert insDetail1List; |
| | | update updDetail2List; |
| | | // 明细2 |
| | | List<Consumable_order_details2__c> d2list = accountGroupMap.get( |
| | | setId.Dealer_Info__r.Name + setId.Order_Owner_WorkLocal__c |
| | | ); |
| | | for (Consumable_order_details2__c dtl2 : d2list) { |
| | | dtl2.Send_Date__c = Date.today(); |
| | | dtl2.Consumable_Sale_order__c = null; |
| | | dtl2.Consumable_Return_order__c = null; |
| | | dtl2.Consumable_ZS_order__c = setId.Id; |
| | | //dtl2.Delivery_List_RMB__c = null; |
| | | dtl2.Return_date__c = null; |
| | | dtl2.Return_reason__c = null; |
| | | dtl2.Consumable_Shipment_order__c = setId.Id; |
| | | // 更新借调信息 add by gzw 2020-0-415 start |
| | | dtl2.Transfer_Time__c = 1; |
| | | dtl2.Agency_Transfer__c = true; |
| | | dtl2.Frist_Transfer_Agency__c = dtl2.Dealer_Info_text__c; |
| | | // 更新借调信息 add by gzw 2020-0-415 end |
| | | updDetail2List.add(dtl2); |
| | | } |
| | | } |
| | | |
| | | insert insDetail1List; |
| | | update updDetail2List; |
| | | } |
| | | |
| | | //到货确认 |
| | | public PageReference ArriveGoodsConfim() { |
| | |
| | | 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; |
| | |
| | | } |
| | | } |
| | | |
| | | if (addSaleOrderList.size() > 0) { |
| | | addSaleOrderAuto(addSaleOrderList); |
| | | } |
| | | if (addSaleOrderList.size() > 0) { |
| | | addSaleOrderAuto(addSaleOrderList); |
| | | } |
| | | |
| | | if(updateconsumableorderdetails2.size() > 0){ |
| | | update updateconsumableorderdetails2; |
| | | } |
| | | |
| | | List<Consumable_order_details2__c> insertconsumableorderdetails2 = new List<Consumable_order_details2__c>(); |
| | | for(Consumable_order_details2__c Cod2 : consumableorderdetails2Insert){ |
| | | //ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR,'------4------')); |
| | |
| | | i++; |
| | | } |
| | | |
| | | //return null; |
| | | // return null; |
| | | |
| | | if(insertconsumableorderdetails2.size() >0){ |
| | | insert insertconsumableorderdetails2; |
| | |
| | | // 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 |
| | |
| | | } |
| | | } |
| | | |
| | | return BarcodeRetrunResult.size(); |
| | | } |
| | | return BarcodeRetrunResult.size(); |
| | | } |
| | | |
| | | // 单位为个的Barcode对应的出库单 |
| | | public integer Getconsumableorderdetails2Nobox(){ |
| | |
| | | // 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; |
| | |
| | | // tcm end |
| | | //add by rentx 2020-10-14 end |
| | | |
| | | codcorderdetList.add(codcorderdetail); |
| | | codcorderdetList.add(codcorderdetail); |
| | | |
| | | //返品明细 |
| | | retorddetail.Return_reason__c = ass.ReturnReason; |
| | |
| | | |
| | | 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; |
| | |
| | | // tcm end |
| | | //add by rentx 2020-10-14 end |
| | | |
| | | codcorderdetList.add(retorddetail); |
| | | i++; |
| | | } |
| | | codcorderdetList.add(retorddetail); |
| | | i++; |
| | | } |
| | | |
| | | // ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR,'------end------')); |
| | | // return null; |
| | | // ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR,'------end------')); |
| | | // return null; |
| | | |
| | | if(codcList.size()>0){ |
| | | ControllerUtil.updateOrderDetailsSatus( codcList ); |
| | |
| | | // ApexPages.addMessages(e); |
| | | // ApexPages.addMessages(e.getLineNumber() + ' 11111111111111111'); |
| | | |
| | | //return null; |
| | | } |
| | | //return null; |
| | | } |
| | | } |
| | | |
| | | //跳转到返品页面 |
| | | public Pagereference ToReturnGoodsPage(){ |
| | |
| | | return ref; |
| | | } |
| | | |
| | | class ConsumableorderdetailsInfo implements Comparable { |
| | | public Consumable_order_details2__c esd { get; set; } |
| | | public Product2__c Prod { get; set; } |
| | | public String ProductName { get; set; } |
| | | //public Boolean canSELECT { get; set; } |
| | | public String barCodeNo { get; set; } |
| | | public Date sterilizationlimitDate { get; set; } |
| | | public String serialNoorLotNo { get; set; } |
| | | public String tracingCodeNo { get; set; } |
| | | public String ReturnReason { get; set; } |
| | | public String oldConsumableCount { get; set; } |
| | | public String ErrorReason { get; set; } |
| | | public boolean canEdit { get; set; } |
| | | public Integer intMark { get; set; } |
| | | public Decimal arriveAmount { get; set; } |
| | | public Decimal arrivedCount { get; set; } |
| | | public class ConsumableorderdetailsInfo implements Comparable { |
| | | public Consumable_order_details2__c esd { get; set; } |
| | | public Product2__c Prod { get; set; } |
| | | public String ProductName { get; set; } |
| | | //public Boolean canSELECT { get; set; } |
| | | public String barCodeNo { get; set; } |
| | | public Date sterilizationlimitDate { get; set; } |
| | | public String serialNoorLotNo { get; set; } |
| | | public String tracingCodeNo { get; set; } |
| | | public String ReturnReason { get; set; } |
| | | public String oldConsumableCount { get; set; } |
| | | public String ErrorReason { get; set; } |
| | | public boolean canEdit { get; set; } |
| | | public Integer intMark { get; set; } |
| | | public Decimal arriveAmount { get; set; } |
| | | public Decimal arrivedCount { get; set; } |
| | | |
| | | public String ReportProductExpirationDate {get;set;} |
| | | public ConsumableorderdetailsInfo(Consumable_order_details2__c e,string str) { |
| | |
| | | return null; |
| | | } |
| | | } |
| | | } |
| | | } |