| | |
| | | private static List<ConsumableorderdetailsInfo> consumableorderdetailsSelectRecords = new List<ConsumableorderdetailsInfo>(); |
| | | //明细2 |
| | | @AuraEnabled |
| | | public static List<ConsumableorderdetailsInfo> consumableorderdetailsRecords { |
| | | get; |
| | | set; |
| | | } |
| | | public static List<ConsumableorderdetailsInfo> consumableorderdetailsRecords { get; set; } |
| | | //错误明细 |
| | | @AuraEnabled |
| | | public static List<ConsumableorderdetailsInfo> consumableorderdetailsRecordserror { |
| | | get; |
| | | set; |
| | | } |
| | | public static List<ConsumableorderdetailsInfo> consumableorderdetailsRecordserror { get; set; } |
| | | @AuraEnabled |
| | | public static List<ConsumableorderdetailsInfo> pageRecords { get; set; } |
| | | public static List<ConsumableorderdetailsInfoLwc> pageRecordsLwc { get; set; } |
| | | //public List<List<ConsumableorderdetailsInfo>> consumableorderdetailsRecordsview { get; set; } |
| | | public static List<ConsumableorderdetailsInfo> consumableorderdetails2Records { |
| | | get; |
| | | set; |
| | | } |
| | | public static List<ConsumableorderdetailsInfo> consumableorderdetails2Records { get; set; } |
| | | public static List<Consumable_order__c> consumableInvoiceRecords { get; set; } |
| | | private static List<ConsumableorderdetailsInfo> consumableproductdetailsRecords = new List<ConsumableorderdetailsInfo>(); |
| | | private static List<Attachment> attachmentinfo = new List<Attachment>(); |
| | |
| | | //消耗品明细2数量 |
| | | public static Integer consumableorderdetails2Count { |
| | | get { |
| | | return consumableorderdetails2Records == null |
| | | ? 0 |
| | | : consumableorderdetails2Records.size(); |
| | | return consumableorderdetails2Records == null ? 0 : consumableorderdetails2Records.size(); |
| | | } |
| | | } |
| | | //订货单号 |
| | |
| | | |
| | | // 画面初始化 |
| | | @AuraEnabled |
| | | public static ResponseBodyLWC init( |
| | | String ESetidJs, |
| | | String statusEdit, |
| | | Integer pageSizeLWC, |
| | | Integer pageTokenLWC, |
| | | String arriveorderLWC |
| | | ) { |
| | | public static ResponseBodyLWC init(String ESetidJs, String statusEdit, Integer pageSizeLWC, Integer pageTokenLWC,String arriveorderLWC) { |
| | | try { |
| | | firstInit(ESetidJs); |
| | | statusEdit = statusEdit; |
| | |
| | | //cate1ForSort = ''; |
| | | sumPrice = 0; |
| | | IdCheck = EsetId; |
| | | if ( |
| | | ESetId != null && |
| | | ESetId != '' && |
| | | (statusEdit == '' || |
| | | statusEdit == null) |
| | | ) { |
| | | if (ESetId != null && ESetId != '' && (statusEdit == '' || statusEdit == null)) { |
| | | editAble = false; |
| | | } else if ( |
| | | (ESetId == null || ESetId == '') && |
| | | (statusEdit == '' || |
| | | statusEdit == null) |
| | | ) { |
| | | } else if ((ESetId == null || ESetId == '') && (statusEdit == '' || statusEdit == null)) { |
| | | editAble = true; |
| | | } else if ( |
| | | ESetId != null && |
| | | ESetId != '' && |
| | | statusEdit != '' && |
| | | statusEdit != null |
| | | ) { |
| | | } else if (ESetId != null && ESetId != '' && statusEdit != '' && statusEdit != null) { |
| | | editAble = true; |
| | | } |
| | | userId = UserInfo.getUserId(); |
| | | localuser = [ |
| | | SELECT id, State_Hospital__c |
| | | FROM User |
| | | WHERE id = :UserInfo.getUserId() |
| | | ]; |
| | | localuser = [SELECT id, State_Hospital__c FROM User WHERE id = :UserInfo.getUserId()]; |
| | | //userId = '00510000005QO75'; |
| | | user Useracc = [ |
| | | SELECT accountid, Work_Location__c, UserPro_Type__c |
| | | FROM user |
| | | WHERE id = :userId |
| | | ]; |
| | | user Useracc = [SELECT accountid, Work_Location__c, UserPro_Type__c FROM user WHERE id = :userId]; |
| | | accountid = Useracc.accountid; |
| | | userWorkLocation = Useracc.Work_Location__c; |
| | | agencyProType = Useracc.UserPro_Type__c; |
| | |
| | | ]; |
| | | |
| | | List<Agency_Hospital_Link__c> AgencyHospitalLink = new List<Agency_Hospital_Link__c>(); |
| | | AgencyHospitalLink = [ |
| | | SELECT Id, Hospital__c, Hospital__r.Name |
| | | FROM Agency_Hospital_Link__c |
| | | WHERE Agency__c = :accountid |
| | | ]; |
| | | AgencyHospitalLink = [SELECT Id, Hospital__c, Hospital__r.Name FROM Agency_Hospital_Link__c WHERE Agency__c = :accountid]; |
| | | |
| | | //add by rentx 2021-3-1 start |
| | | //判断当前经销商下是否有特价医院 |
| | | List<hospitalprice__c> hlist = [ |
| | | SELECT id, product__c |
| | | FROM hospitalprice__c |
| | | WHERE account__c = :accountid |
| | | ]; |
| | | List<hospitalprice__c> hlist = [SELECT id, product__c FROM hospitalprice__c WHERE account__c = :accountid]; |
| | | if (hlist == null || hlist.size() == 0) { |
| | | hasHos = false; |
| | | } else { |
| | |
| | | for (AggregateResult orderdetail : orderdetailCount) { |
| | | zaikuId.add(String.valueOf(orderdetail.get('cpc'))); |
| | | } |
| | | System.debug('orderdetailCount = ' + orderdetailCount); |
| | | System.debug('sqlagencyProType = ' + sqlagencyProType); |
| | | System.debug('userWorkLocation = ' + userWorkLocation); |
| | | System.debug('accountName = ' + accountName); |
| | |
| | | if (String.isBlank(arriveorder)) { |
| | | EditDelCommitBtnDisabled = true; |
| | | for (Integer i = 0; i < product2Selected.size(); i++) { |
| | | MidMap.put( |
| | | product2Selected[i].Id, |
| | | new ConsumableorderdetailsInfo(product2Selected[i]) |
| | | ); |
| | | MidMap.put(product2Selected[i].Id, new ConsumableorderdetailsInfo(product2Selected[i])); |
| | | } |
| | | System.debug('MidMap = ' + MidMap); |
| | | for (Integer i = 0; i < CountDel.size(); i++) { |
| | | String str = ''; |
| | | if (CountDel[i].hospitalSpecialOffer__c) { |
| | |
| | | } else { |
| | | str = 'notHos'; |
| | | } |
| | | System.debug('CountDel[i].Consumable_Product__c= ' + CountDel[i].Consumable_Product__c); |
| | | System.debug('CountDel[i].Consumable_Product__c + str= ' + CountDel[i].Consumable_Product__c + str); |
| | | //明细2对应的产品存在于MidMap中 |
| | | if (MidMap.containsKey(CountDel[i].Consumable_Product__c)) { |
| | | //设置map中key的后缀 用于区分医院特价和非医院特价 |
| | | if ( |
| | | MidMap2.containsKey(CountDel[i].Consumable_Product__c + str) |
| | | ) { |
| | | ConsumableorderdetailsInfo Jstage = MidMap2.get( |
| | | CountDel[i].Consumable_Product__c + str |
| | | ); |
| | | if (MidMap2.containsKey(CountDel[i].Consumable_Product__c + str)) { |
| | | ConsumableorderdetailsInfo Jstage = MidMap2.get(CountDel[i].Consumable_Product__c + str); |
| | | Jstage.allnumber = Jstage.allnumber + 1; |
| | | if (CountDel[i].Box_Piece__c == '盒') { |
| | | Jstage.Boxnumber = Jstage.Boxnumber + 1; |
| | |
| | | MidMap2.put(CountDel[i].Consumable_Product__c + str, Jstage); |
| | | } else { |
| | | //midmap2中没有对应的产品 |
| | | ConsumableorderdetailsInfo Jstage = MidMap.get( |
| | | CountDel[i].Consumable_Product__c |
| | | ) |
| | | .clone(); |
| | | ConsumableorderdetailsInfo Jstage = MidMap.get(CountDel[i].Consumable_Product__c).clone(); |
| | | Jstage.allnumber = Jstage.allnumber + 1; |
| | | if (CountDel[i].Box_Piece__c == '盒') { |
| | | Jstage.Boxnumber = Jstage.Boxnumber + 1; |
| | |
| | | for (ConsumableorderdetailsInfo bss : MidMap2.values()) { |
| | | //update by rentx 2021-01-29 |
| | | //if(bss.allnumber>0){ |
| | | bss.packinglist = Integer.valueOf( |
| | | bss.Prod.Product2__r.Packing_list_manual__c |
| | | ); |
| | | bss.packinglist = Integer.valueOf(bss.Prod.Product2__r.Packing_list_manual__c); |
| | | bss.approbation_No = bss.Prod.Product2__r.SFDA_Approbation_No__c; |
| | | bss.expiration_Date = bss.Prod.Product2__r.SFDA_Expiration_Date__c; |
| | | consumableorderdetailsSelectRecords.add(bss); |
| | |
| | | } |
| | | |
| | | Integer ishosnum = 0; |
| | | for ( |
| | | ConsumableorderdetailsInfo ass : consumableorderdetailsSelectRecords |
| | | ) { |
| | | for (ConsumableorderdetailsInfo ass : consumableorderdetailsSelectRecords) { |
| | | //ass.sortBy = sortOrderAsc; |
| | | //add by rentx 2021-3-10 |
| | | if (ass.hospitalSpecialOffer) { |
| | |
| | | WHERE Consumable_order__c = :coc.Arrive_Order__c |
| | | ORDER BY Name |
| | | ]; |
| | | for ( |
| | | Consumable_Orderdetails__c cdc1 : consumableorderdetailsSelected |
| | | ) { |
| | | for (Consumable_Orderdetails__c cdc1 : consumableorderdetailsSelected) { |
| | | orderzaikuId.add(cdc1.Consumable_Product__c); |
| | | } |
| | | msoql = makeSoqlorderdet(); |
| | |
| | | size = product2Selected.size(); |
| | | initStandardController(msoql); |
| | | for (Integer i = 0; i < product2Selected.size(); i++) { |
| | | MidMap.put( |
| | | product2Selected[i].Id, |
| | | new ConsumableorderdetailsInfo(product2Selected[i]) |
| | | ); |
| | | MidMap.put(product2Selected[i].Id, new ConsumableorderdetailsInfo(product2Selected[i])); |
| | | } |
| | | //update by rentx 2021-01-29 |
| | | /*for(Integer i = 0 ; i< CountDel.size();i++){ |
| | |
| | | //明细2对应的产品存在于MidMap中 |
| | | if (MidMap.containsKey(CountDel[i].Consumable_Product__c)) { |
| | | //设置map中key的后缀 用于区分医院特价和非医院特价 |
| | | if ( |
| | | MidMap2.containsKey(CountDel[i].Consumable_Product__c + str) |
| | | ) { |
| | | ConsumableorderdetailsInfo Jstage = MidMap2.get( |
| | | CountDel[i].Consumable_Product__c + str |
| | | ); |
| | | if (MidMap2.containsKey(CountDel[i].Consumable_Product__c + str)) { |
| | | ConsumableorderdetailsInfo Jstage = MidMap2.get(CountDel[i].Consumable_Product__c + str); |
| | | Jstage.allnumber = Jstage.allnumber + 1; |
| | | if (CountDel[i].Box_Piece__c == '盒') { |
| | | Jstage.Boxnumber = Jstage.Boxnumber + 1; |
| | |
| | | MidMap2.put(CountDel[i].Consumable_Product__c + str, Jstage); |
| | | } else { |
| | | //midmap2中没有对应的产品 |
| | | ConsumableorderdetailsInfo Jstage = MidMap.get( |
| | | CountDel[i].Consumable_Product__c |
| | | ) |
| | | .clone(); |
| | | ConsumableorderdetailsInfo Jstage = MidMap.get(CountDel[i].Consumable_Product__c).clone(); |
| | | Jstage.allnumber = Jstage.allnumber + 1; |
| | | if (CountDel[i].Box_Piece__c == '盒') { |
| | | Jstage.Boxnumber = Jstage.Boxnumber + 1; |
| | |
| | | // for(ConsumableorderdetailsInfo bss : MidMap.values()){ |
| | | for (ConsumableorderdetailsInfo bss : MidMap2.values()) { |
| | | //update by rentx 2021-01-29 |
| | | bss.packinglist = Integer.valueOf( |
| | | bss.Prod.Product2__r.Packing_list_manual__c |
| | | ); |
| | | bss.packinglist = Integer.valueOf(bss.Prod.Product2__r.Packing_list_manual__c); |
| | | bss.approbation_No = bss.Prod.Product2__r.SFDA_Approbation_No__c; |
| | | bss.expiration_Date = bss.Prod.Product2__r.SFDA_Expiration_Date__c; |
| | | consumableorderdetailsSelectRecords.add(bss); |
| | |
| | | //return; |
| | | |
| | | Integer ishosnum = 0; |
| | | for ( |
| | | ConsumableorderdetailsInfo ass : consumableorderdetailsSelectRecords |
| | | ) { |
| | | for (ConsumableorderdetailsInfo ass : consumableorderdetailsSelectRecords) { |
| | | //ass.sortBy = sortOrderAsc; |
| | | for ( |
| | | Consumable_Orderdetails__c cdc1 : consumableorderdetailsSelected |
| | | ) { |
| | | for (Consumable_Orderdetails__c cdc1 : consumableorderdetailsSelected) { |
| | | cdc1.Shipment_Count__c = cdc1.Consumable_count__c; |
| | | if (ass.prod.Id == cdc1.Consumable_Product__c) { |
| | | ass.check = true; |
| | |
| | | AND Dealer_Arrive__c = TRUE |
| | | ORDER BY Name |
| | | ]; |
| | | for ( |
| | | Integer i = 0; |
| | | i < consumablearriveproductdetailsSelected.size(); |
| | | i++ |
| | | ) { |
| | | for (Integer i = 0; i < consumablearriveproductdetailsSelected.size(); i++) { |
| | | if ( |
| | | consumablearriveproductdetailsSelected[i] |
| | | .hospitalSpecialOffer__c && |
| | | HosProMap.containsKey( |
| | | consumablearriveproductdetailsSelected[i].Consumable_product__c |
| | | ) |
| | | consumablearriveproductdetailsSelected[i].hospitalSpecialOffer__c && |
| | | HosProMap.containsKey(consumablearriveproductdetailsSelected[i].Consumable_product__c) |
| | | ) { |
| | | coc.OutPattern__c = true; |
| | | } |
| | | consumableproductdetailsRecords.add( |
| | | new ConsumableorderdetailsInfo( |
| | | consumablearriveproductdetailsSelected[i] |
| | | ) |
| | | ); |
| | | consumableproductdetailsRecords.add(new ConsumableorderdetailsInfo(consumablearriveproductdetailsSelected[i])); |
| | | } |
| | | } |
| | | } else { |
| | |
| | | SummonsFlag = 'visible'; |
| | | // update start by vivek 2019-7-15 add “NoConfirmedPrice__c” in select |
| | | consumableInvoiceRecords = [ |
| | | SELECT |
| | | Id, |
| | | Name, |
| | | Invoice_Date__c, |
| | | NoConfirmedPrice__c, |
| | | Invoice_total_amount__c, |
| | | Invoice_status__c |
| | | SELECT Id, Name, Invoice_Date__c, NoConfirmedPrice__c, Invoice_total_amount__c, Invoice_status__c |
| | | FROM Consumable_order__c |
| | | WHERE |
| | | Id IN ( |
| | | SELECT Invoice_Code_link__c |
| | | FROM Consumable_order_LinkTable__c |
| | | WHERE Outboundorder_Code_link__c = :ESetId |
| | | ) |
| | | Id IN (SELECT Invoice_Code_link__c FROM Consumable_order_LinkTable__c WHERE Outboundorder_Code_link__c = :ESetId) |
| | | AND Invoice_status__c != '草案中' |
| | | ]; |
| | | |
| | |
| | | Onchange_order__c, |
| | | OutPattern__c |
| | | FROM Consumable_order__c |
| | | WHERE |
| | | Id = :ESetId |
| | | AND Order_Owner_WorkLocal__c = :userWorkLocation |
| | | AND Order_type__c = '传票' |
| | | WHERE Id = :ESetId AND Order_Owner_WorkLocal__c = :userWorkLocation AND Order_type__c = '传票' |
| | | ]; |
| | | // update start by vivek 2019-7-15 |
| | | if (getExistarrive()) { |
| | |
| | | if (editAble) { |
| | | alertMessage = '到货订单直接出库,出库单明细不可编辑'; |
| | | } |
| | | if ( |
| | | coc.SummonsStatus_c__c == '已提交' || |
| | | coc.SummonsStatus_c__c == '批准' |
| | | ) { |
| | | if (coc.SummonsStatus_c__c == '已提交' || coc.SummonsStatus_c__c == '批准') { |
| | | system.debug('coc.SummonsStatus_c__c : ' + coc.SummonsStatus_c__c); |
| | | saveBtnDisabled = true; |
| | | SorderBtnDisabled = true; |
| | |
| | | //医院二级经销商分类 |
| | | Integer io = 0; |
| | | while (io < Dealerelationship.size()) { |
| | | if ( |
| | | coc.Order_ForDealer__c == |
| | | Dealerelationship[io].Dealer_subordinate__c |
| | | ) { |
| | | if (coc.Order_ForDealer__c == Dealerelationship[io].Dealer_subordinate__c) { |
| | | SecondDealer = Dealerelationship[io].Dealer_subordinate__c; |
| | | coc.Order_ForDealer__c = null; |
| | | io = io + Dealerelationship.size(); |
| | |
| | | |
| | | Integer ik = 0; |
| | | while (ik < AgencyHospitalLink.size()) { |
| | | if ( |
| | | coc.Order_ForHospital__c == AgencyHospitalLink[ik].Hospital__c |
| | | ) { |
| | | if (coc.Order_ForHospital__c == AgencyHospitalLink[ik].Hospital__c) { |
| | | HospitalInfo = AgencyHospitalLink[ik].Hospital__c; |
| | | HospitalName = AgencyHospitalLink[ik].Hospital__r.Name; |
| | | coc.Order_ForHospital__c = null; |
| | |
| | | Consumable_Product__r.Product2__r.SFDA_Expiration_Date__c, |
| | | isOutPattern__c |
| | | FROM Consumable_orderdetails__c |
| | | WHERE |
| | | Consumable_order__c = :ESetId |
| | | AND Consumable_order__r.Order_Owner_WorkLocal__c = :userWorkLocation |
| | | WHERE Consumable_order__c = :ESetId AND Consumable_order__r.Order_Owner_WorkLocal__c = :userWorkLocation |
| | | ORDER BY Name |
| | | ]; |
| | | Map<String, Consumable_Orderdetails__c> cocMap = new Map<String, Consumable_Orderdetails__c>(); |
| | | |
| | | for ( |
| | | Consumable_Orderdetails__c cdc1 : consumableorderdetailsSelected |
| | | ) { |
| | | for (Consumable_Orderdetails__c cdc1 : consumableorderdetailsSelected) { |
| | | sumPrice += cdc1.Shipment_amount__c; |
| | | orderzaikuId.add(cdc1.Consumable_Product__c); |
| | | //add by rentx 2021-2-26 |
| | |
| | | initStandardController(msoql); |
| | | |
| | | for (Integer i = 0; i < product2Selected.size(); i++) { |
| | | MidMap.put( |
| | | product2Selected[i].Id, |
| | | new ConsumableorderdetailsInfo(product2Selected[i]) |
| | | ); |
| | | MidMap.put(product2Selected[i].Id, new ConsumableorderdetailsInfo(product2Selected[i])); |
| | | } |
| | | //update by rentx 2021-01-29 |
| | | /*for(Integer i = 0 ; i< CountDel.size();i++){ |
| | |
| | | //明细2对应的产品存在于MidMap中 |
| | | if (MidMap.containsKey(CountDel[i].Consumable_Product__c)) { |
| | | //设置map中key的后缀 用于区分医院特价和非医院特价 |
| | | if ( |
| | | MidMap2.containsKey(CountDel[i].Consumable_Product__c + str) |
| | | ) { |
| | | ConsumableorderdetailsInfo Jstage = MidMap2.get( |
| | | CountDel[i].Consumable_Product__c + str |
| | | ); |
| | | if (MidMap2.containsKey(CountDel[i].Consumable_Product__c + str)) { |
| | | ConsumableorderdetailsInfo Jstage = MidMap2.get(CountDel[i].Consumable_Product__c + str); |
| | | Jstage.allnumber = Jstage.allnumber + 1; |
| | | if (CountDel[i].Box_Piece__c == '盒') { |
| | | Jstage.Boxnumber = Jstage.Boxnumber + 1; |
| | |
| | | MidMap2.put(CountDel[i].Consumable_Product__c + str, Jstage); |
| | | } else { |
| | | //midmap2中没有对应的产品 |
| | | ConsumableorderdetailsInfo Jstage = MidMap.get( |
| | | CountDel[i].Consumable_Product__c |
| | | ) |
| | | .clone(); |
| | | ConsumableorderdetailsInfo Jstage = MidMap.get(CountDel[i].Consumable_Product__c).clone(); |
| | | Jstage.allnumber = Jstage.allnumber + 1; |
| | | if (CountDel[i].Box_Piece__c == '盒') { |
| | | Jstage.Boxnumber = Jstage.Boxnumber + 1; |
| | |
| | | |
| | | //if(bss.allnumber > 0){ |
| | | //bss.UnitpriceToagency = bss.orderdetails1.Unitprice_To_agency__c == null || bss.orderdetails1.Unitprice_To_agency__c == 0 ? '' :bss.orderdetails1.Unitprice_To_agency__c.format(); |
| | | bss.packinglist = Integer.valueOf( |
| | | bss.Prod.Product2__r.Packing_list_manual__c |
| | | ); |
| | | bss.packinglist = Integer.valueOf(bss.Prod.Product2__r.Packing_list_manual__c); |
| | | bss.approbation_No = bss.Prod.Product2__r.SFDA_Approbation_No__c; |
| | | bss.expiration_Date = bss.Prod.Product2__r.SFDA_Expiration_Date__c; |
| | | |
| | | //update by rentx 2021-2-26 start |
| | | if ( |
| | | cocMap.containsKey(bss.Prod.Id + 'ishos') && |
| | | bss.hospitalSpecialOffer == true |
| | | ) { |
| | | if (cocMap.containsKey(bss.Prod.Id + 'ishos') && bss.hospitalSpecialOffer == true) { |
| | | consumableorderdetailsSelectRecords.add(bss); |
| | | } else if ( |
| | | cocMap.containsKey(bss.Prod.Id + 'nothos') && |
| | | bss.hospitalSpecialOffer == false |
| | | ) { |
| | | } else if (cocMap.containsKey(bss.Prod.Id + 'nothos') && bss.hospitalSpecialOffer == false) { |
| | | consumableorderdetailsSelectRecords.add(bss); |
| | | } |
| | | //update by rentx 2021-2-26 end |
| | |
| | | //} |
| | | } |
| | | Integer ishosnum = 0; |
| | | for ( |
| | | ConsumableorderdetailsInfo ass : consumableorderdetailsSelectRecords |
| | | ) { |
| | | for ( |
| | | Consumable_Orderdetails__c cdc1 : consumableorderdetailsSelected |
| | | ) { |
| | | for (ConsumableorderdetailsInfo ass : consumableorderdetailsSelectRecords) { |
| | | for (Consumable_Orderdetails__c cdc1 : consumableorderdetailsSelected) { |
| | | //update by rentx 2012-3-1 start |
| | | // if(ass.prod.Id == cdc1.Consumable_Product__c){ |
| | | // ass.check = true; |
| | | // ass.orderdetails1 = cdc1; |
| | | // } |
| | | if ( |
| | | ass.Prod.Id == cdc1.Consumable_Product__c && |
| | | ass.hospitalSpecialOffer == cdc1.isOutPattern__c |
| | | ) { |
| | | if (ass.Prod.Id == cdc1.Consumable_Product__c && ass.hospitalSpecialOffer == cdc1.isOutPattern__c) { |
| | | ass.check = true; |
| | | ass.orderdetails1 = cdc1; |
| | | } |
| | |
| | | WHERE Consumable_ZS_order__c = :ESetId |
| | | ORDER BY Name |
| | | ]; |
| | | for ( |
| | | Integer i = 0; i < consumableorderdetails2RecordsList.size(); i++ |
| | | ) { |
| | | consumableorderdetails2Records.add( |
| | | new ConsumableorderdetailsInfo( |
| | | consumableorderdetails2RecordsList[i] |
| | | ) |
| | | ); |
| | | for (Integer i = 0; i < consumableorderdetails2RecordsList.size(); i++) { |
| | | consumableorderdetails2Records.add(new ConsumableorderdetailsInfo(consumableorderdetails2RecordsList[i])); |
| | | } |
| | | //产品明细取得 |
| | | consumablearriveproductdetailsSelected = [ |
| | |
| | | WHERE Consumable_ZS_order__c = :ESetId |
| | | ORDER BY Name |
| | | ]; |
| | | for ( |
| | | Integer i = 0; |
| | | i < consumablearriveproductdetailsSelected.size(); |
| | | i++ |
| | | ) { |
| | | consumableproductdetailsRecords.add( |
| | | new ConsumableorderdetailsInfo( |
| | | consumablearriveproductdetailsSelected[i] |
| | | ) |
| | | ); |
| | | for (Integer i = 0; i < consumablearriveproductdetailsSelected.size(); i++) { |
| | | consumableproductdetailsRecords.add(new ConsumableorderdetailsInfo(consumablearriveproductdetailsSelected[i])); |
| | | } |
| | | } else { |
| | | // 不是到货订单来的时候 |
| | | if ( |
| | | coc.SummonsStatus_c__c == '已提交' || |
| | | coc.SummonsStatus_c__c == '批准' |
| | | ) { |
| | | if (coc.SummonsStatus_c__c == '已提交' || coc.SummonsStatus_c__c == '批准') { |
| | | system.debug('coc.SummonsStatus_c__c : ' + coc.SummonsStatus_c__c); |
| | | saveBtnDisabled = true; |
| | | SorderBtnDisabled = true; |
| | |
| | | //医院二级经销商分类 |
| | | Integer io = 0; |
| | | while (io < Dealerelationship.size()) { |
| | | if ( |
| | | coc.Order_ForDealer__c == |
| | | Dealerelationship[io].Dealer_subordinate__c |
| | | ) { |
| | | if (coc.Order_ForDealer__c == Dealerelationship[io].Dealer_subordinate__c) { |
| | | SecondDealer = Dealerelationship[io].Dealer_subordinate__c; |
| | | coc.Order_ForDealer__c = null; |
| | | io = io + Dealerelationship.size(); |
| | |
| | | } |
| | | Integer ik = 0; |
| | | while (ik < AgencyHospitalLink.size()) { |
| | | if ( |
| | | coc.Order_ForHospital__c == AgencyHospitalLink[ik].Hospital__c |
| | | ) { |
| | | if (coc.Order_ForHospital__c == AgencyHospitalLink[ik].Hospital__c) { |
| | | HospitalInfo = AgencyHospitalLink[ik].Hospital__c; |
| | | HospitalName = AgencyHospitalLink[ik].Hospital__r.Name; |
| | | coc.Order_ForHospital__c = null; |
| | |
| | | Consumable_Product__r.Product2__r.SFDA_Expiration_Date__c, |
| | | isOutPattern__c |
| | | FROM Consumable_orderdetails__c |
| | | WHERE |
| | | Consumable_order__c = :ESetId |
| | | AND Consumable_order__r.Order_Owner_WorkLocal__c = :userWorkLocation |
| | | WHERE Consumable_order__c = :ESetId AND Consumable_order__r.Order_Owner_WorkLocal__c = :userWorkLocation |
| | | ORDER BY Name |
| | | ]; |
| | | //add by rentx 202-2-26 |
| | | Map<String, Consumable_Orderdetails__c> cocMap = new Map<String, Consumable_Orderdetails__c>(); |
| | | |
| | | for ( |
| | | Consumable_Orderdetails__c cdc1 : consumableorderdetailsSelected |
| | | ) { |
| | | for (Consumable_Orderdetails__c cdc1 : consumableorderdetailsSelected) { |
| | | sumPrice += cdc1.Shipment_amount__c; |
| | | orderzaikuId.add(cdc1.Consumable_Product__c); |
| | | //add by rentx 2021-2-26 |
| | |
| | | size = product2Selected.size(); |
| | | initStandardController(msoql); |
| | | for (Integer i = 0; i < product2Selected.size(); i++) { |
| | | MidMap.put( |
| | | product2Selected[i].Id, |
| | | new ConsumableorderdetailsInfo(product2Selected[i]) |
| | | ); |
| | | MidMap.put(product2Selected[i].Id, new ConsumableorderdetailsInfo(product2Selected[i])); |
| | | } |
| | | |
| | | for (Integer i = 0; i < CountDel.size(); i++) { |
| | |
| | | //明细2对应的产品存在于MidMap中 |
| | | if (MidMap.containsKey(CountDel[i].Consumable_Product__c)) { |
| | | //设置map中key的后缀 用于区分医院特价和非医院特价 |
| | | if ( |
| | | MidMap2.containsKey(CountDel[i].Consumable_Product__c + str) |
| | | ) { |
| | | ConsumableorderdetailsInfo Jstage = MidMap2.get( |
| | | CountDel[i].Consumable_Product__c + str |
| | | ); |
| | | if (MidMap2.containsKey(CountDel[i].Consumable_Product__c + str)) { |
| | | ConsumableorderdetailsInfo Jstage = MidMap2.get(CountDel[i].Consumable_Product__c + str); |
| | | Jstage.allnumber = Jstage.allnumber + 1; |
| | | if (CountDel[i].Box_Piece__c == '盒') { |
| | | Jstage.Boxnumber = Jstage.Boxnumber + 1; |
| | |
| | | MidMap2.put(CountDel[i].Consumable_Product__c + str, Jstage); |
| | | } else { |
| | | //midmap2中没有对应的产品 |
| | | ConsumableorderdetailsInfo Jstage = MidMap.get( |
| | | CountDel[i].Consumable_Product__c |
| | | ) |
| | | .clone(); |
| | | ConsumableorderdetailsInfo Jstage = MidMap.get(CountDel[i].Consumable_Product__c).clone(); |
| | | Jstage.allnumber = Jstage.allnumber + 1; |
| | | if (CountDel[i].Box_Piece__c == '盒') { |
| | | Jstage.Boxnumber = Jstage.Boxnumber + 1; |
| | |
| | | //update by rentx 2021-01-29 |
| | | |
| | | //if(bss.allnumber>0){ |
| | | bss.packinglist = Integer.valueOf( |
| | | bss.Prod.Product2__r.Packing_list_manual__c |
| | | ); |
| | | bss.packinglist = Integer.valueOf(bss.Prod.Product2__r.Packing_list_manual__c); |
| | | bss.approbation_No = bss.Prod.Product2__r.SFDA_Approbation_No__c; |
| | | bss.expiration_Date = bss.Prod.Product2__r.SFDA_Expiration_Date__c; |
| | | |
| | | //update by rentx 2021-2-26 start |
| | | if ( |
| | | cocMap.containsKey(bss.Prod.Id + 'ishos') && |
| | | bss.hospitalSpecialOffer == true |
| | | ) { |
| | | if (cocMap.containsKey(bss.Prod.Id + 'ishos') && bss.hospitalSpecialOffer == true) { |
| | | consumableorderdetailsSelectRecords.add(bss); |
| | | } else if ( |
| | | cocMap.containsKey(bss.Prod.Id + 'nothos') && |
| | | bss.hospitalSpecialOffer == false |
| | | ) { |
| | | } else if (cocMap.containsKey(bss.Prod.Id + 'nothos') && bss.hospitalSpecialOffer == false) { |
| | | consumableorderdetailsSelectRecords.add(bss); |
| | | } |
| | | // consumableorderdetailsSelectRecords.add(bss); |
| | |
| | | } |
| | | // return null; |
| | | Integer ishosnum = 0; |
| | | for ( |
| | | ConsumableorderdetailsInfo ass : consumableorderdetailsSelectRecords |
| | | ) { |
| | | for (ConsumableorderdetailsInfo ass : consumableorderdetailsSelectRecords) { |
| | | //ass.sortBy = sortOrderAsc; |
| | | for ( |
| | | Consumable_Orderdetails__c cdc1 : consumableorderdetailsSelected |
| | | ) { |
| | | for (Consumable_Orderdetails__c cdc1 : consumableorderdetailsSelected) { |
| | | //update by rentx 2012-3-1 start |
| | | // if(ass.prod.Id == cdc1.Consumable_Product__c){ |
| | | // ass.check = true; |
| | | // ass.orderdetails1 = cdc1; |
| | | // } |
| | | if ( |
| | | ass.Prod.Id == cdc1.Consumable_Product__c && |
| | | ass.hospitalSpecialOffer == cdc1.isOutPattern__c |
| | | ) { |
| | | if (ass.Prod.Id == cdc1.Consumable_Product__c && ass.hospitalSpecialOffer == cdc1.isOutPattern__c) { |
| | | ass.check = true; |
| | | ass.orderdetails1 = cdc1; |
| | | } |
| | |
| | | WHERE Consumable_ZS_order__c = :ESetId |
| | | ORDER BY Name |
| | | ]; |
| | | for ( |
| | | Integer i = 0; i < consumableorderdetails2RecordsList.size(); i++ |
| | | ) { |
| | | consumableorderdetails2Records.add( |
| | | new ConsumableorderdetailsInfo( |
| | | consumableorderdetails2RecordsList[i] |
| | | ) |
| | | ); |
| | | for (Integer i = 0; i < consumableorderdetails2RecordsList.size(); i++) { |
| | | consumableorderdetails2Records.add(new ConsumableorderdetailsInfo(consumableorderdetails2RecordsList[i])); |
| | | } |
| | | } |
| | | } |
| | |
| | | provinceOptsMap.put('', '-无-'); |
| | | for (Integer i = 0; i < Dealerelationship.size(); i++) { |
| | | provinceOpts.add( |
| | | new SelectOption( |
| | | Dealerelationship[i].Dealer_subordinate__c, |
| | | Dealerelationship[i].Dealer_subordinate__r.Name |
| | | ) |
| | | new SelectOption(Dealerelationship[i].Dealer_subordinate__c, Dealerelationship[i].Dealer_subordinate__r.Name) |
| | | ); |
| | | provinceOptsMap.put( |
| | | Dealerelationship[i].Dealer_subordinate__c, |
| | | Dealerelationship[i].Dealer_subordinate__r.Name |
| | | ); |
| | | provinceOptsMap.put(Dealerelationship[i].Dealer_subordinate__c, Dealerelationship[i].Dealer_subordinate__r.Name); |
| | | } |
| | | } else { |
| | | provinceOpts.add(new SelectOption('', '-无-')); |
| | |
| | | for (Integer i = 0; i < Dealerelationship.size(); i++) { |
| | | if (Dealerelationship[i].Dealer_subordinate__c == SecondDealer) { |
| | | provinceOpts.add( |
| | | new SelectOption( |
| | | Dealerelationship[i].Dealer_subordinate__c, |
| | | Dealerelationship[i].Dealer_subordinate__r.Name |
| | | ) |
| | | new SelectOption(Dealerelationship[i].Dealer_subordinate__c, Dealerelationship[i].Dealer_subordinate__r.Name) |
| | | ); |
| | | provinceOptsMap.put( |
| | | Dealerelationship[i].Dealer_subordinate__c, |
| | | Dealerelationship[i].Dealer_subordinate__r.Name |
| | | ); |
| | | provinceOptsMap.put(Dealerelationship[i].Dealer_subordinate__c, Dealerelationship[i].Dealer_subordinate__r.Name); |
| | | } |
| | | } |
| | | for (Integer i = 0; i < Dealerelationship.size(); i++) { |
| | | if (Dealerelationship[i].Dealer_subordinate__c != SecondDealer) { |
| | | provinceOpts.add( |
| | | new SelectOption( |
| | | Dealerelationship[i].Dealer_subordinate__c, |
| | | Dealerelationship[i].Dealer_subordinate__r.Name |
| | | ) |
| | | new SelectOption(Dealerelationship[i].Dealer_subordinate__c, Dealerelationship[i].Dealer_subordinate__r.Name) |
| | | ); |
| | | provinceOptsMap.put( |
| | | Dealerelationship[i].Dealer_subordinate__c, |
| | | Dealerelationship[i].Dealer_subordinate__r.Name |
| | | ); |
| | | provinceOptsMap.put(Dealerelationship[i].Dealer_subordinate__c, Dealerelationship[i].Dealer_subordinate__r.Name); |
| | | } |
| | | } |
| | | } |
| | |
| | | // 显示数据条数信息 |
| | | // makeMessage(); |
| | | //附件 |
| | | attachmentinfo = [ |
| | | SELECT Id, Name, OwnerId |
| | | FROM Attachment |
| | | WHERE parentid = :ESetId |
| | | ]; |
| | | attachmentinfo = [SELECT Id, Name, OwnerId FROM Attachment WHERE parentid = :ESetId]; |
| | | if (attachmentinfo.size() > 0) { |
| | | for (Integer i = 0; i < attachmentinfo.size(); i++) { |
| | | attachmentRecoeds.add( |
| | | new ConsumableorderdetailsInfo(attachmentinfo[i]) |
| | | ); |
| | | attachmentRecoeds.add(new ConsumableorderdetailsInfo(attachmentinfo[i])); |
| | | } |
| | | } |
| | | AggregateResult[] categoryList = [ |
| | |
| | | System.debug('pageToken = ' + pageToken); |
| | | System.debug('pageSize = ' + pageSize); |
| | | System.debug('totalCount = ' + totalCount); |
| | | paginatedAccounts.nextPageToken = (pageToken + pageSize < totalCount) |
| | | ? pageToken + pageSize |
| | | : null; |
| | | System.debug( |
| | | 'paginatedAccounts.nextPageToken = ' + paginatedAccounts.nextPageToken |
| | | ); |
| | | paginatedAccounts.nextPageToken = (pageToken + pageSize < totalCount) ? pageToken + pageSize : null; |
| | | System.debug('paginatedAccounts.nextPageToken = ' + paginatedAccounts.nextPageToken); |
| | | paginatedAccounts.recordStart = pageToken + 1; |
| | | paginatedAccounts.pageNumber = pageToken / pageSize + 1; |
| | | Integer recordEnd = pageSize * paginatedAccounts.pageNumber; |
| | | paginatedAccounts.recordEnd = totalCount >= recordEnd |
| | | ? recordEnd |
| | | : totalCount; |
| | | paginatedAccounts.recordEnd = totalCount >= recordEnd ? recordEnd : totalCount; |
| | | paginatedAccounts.totalRecords = totalCount; |
| | | |
| | | Integer startIdx; |
| | |
| | | |
| | | Boolean Existarrive = (coc.Arrive_Order__c != null); |
| | | String ConsumableOut_report = System.Label.ConsumableOut_report; |
| | | System.debug( |
| | | 'consumableproductdetailsRecords = ' + consumableproductdetailsRecords |
| | | ); |
| | | System.debug('consumableproductdetailsRecords = ' + consumableproductdetailsRecords); |
| | | |
| | | data.put('paginatedAccounts', paginatedAccounts); |
| | | data.put('ConsumableOut_report', ConsumableOut_report); |
| | | data.put('accountid', accountid); |
| | | data.put( |
| | | 'consumableproductdetailsRecords', |
| | | consumableproductdetailsRecords |
| | | ); |
| | | data.put('consumableproductdetailsRecords', consumableproductdetailsRecords); |
| | | data.put('agencyProType', agencyProType); |
| | | data.put('accountName', accountName); |
| | | data.put('userWorkLocation', userWorkLocation); |
| | |
| | | data.put('pageRecords', pageRecordsTemp); |
| | | data.put('arriveorder', arriveorder); |
| | | data.put('consumableorderdetails2Count', consumableorderdetails2Count); |
| | | data.put( |
| | | 'consumableorderdetails2Records', |
| | | consumableorderdetails2Records |
| | | ); |
| | | data.put('consumableorderdetails2Records', consumableorderdetails2Records); |
| | | data.put('HospitalInfo', HospitalInfo); |
| | | res.status = 'Success'; |
| | | res.code = 200; |
| | | System.debug('res = ' + res); |
| | | return res; |
| | | } catch (Exception e) { |
| | | return new ResponseBodyLWC( |
| | | 'Error', |
| | | 500, |
| | | e.getMessage() + e.getLineNumber(), |
| | | '' |
| | | ); |
| | | return new ResponseBodyLWC('Error',500, e.getMessage() + e.getLineNumber(), ''); |
| | | } |
| | | } |
| | | |
| | |
| | | AggregateResult[] category4List = [ |
| | | SELECT Count(id), Category4_text__c c4c |
| | | FROM Product2__c |
| | | WHERE |
| | | Category3_text__c = :category3 |
| | | AND Category4_text__c != NULL |
| | | AND Category5_text__c != NULL |
| | | WHERE Category3_text__c = :category3 AND Category4_text__c != NULL AND Category5_text__c != NULL |
| | | GROUP BY Category4_text__c |
| | | ]; |
| | | System.debug('category4List ' + category4List); |
| | | category4OptionList = new List<SelectOption>(); |
| | | category4OptionList.add(new SelectOption('', '-无-')); |
| | | category4OptionMap = new Map<String, String>(); |
| | |
| | | AggregateResult[] category5List = [ |
| | | SELECT Count(id), Category5_text__c c5c |
| | | FROM Product2__c |
| | | WHERE |
| | | Category3_text__c = :category3 |
| | | AND Category4_text__c != NULL |
| | | AND Category5_text__c != NULL |
| | | WHERE Category3_text__c = :category3 AND Category4_text__c != NULL AND Category5_text__c != NULL |
| | | GROUP BY Category5_text__c |
| | | ]; |
| | | |
| | | System.debug('category5List ' + category5List); |
| | | category5OptionList = new List<SelectOption>(); |
| | | category5OptionList.add(new SelectOption('', '-无-')); |
| | | category5OptionMap = new Map<String, String>(); |
| | |
| | | } |
| | | |
| | | @AuraEnabled |
| | | public static ResponseBodyLWC categoryload( |
| | | String category3Lwc, |
| | | String category4Lwc |
| | | ) { |
| | | public static ResponseBodyLWC categoryload(String category3Lwc, String category4Lwc) { |
| | | ResponseBodyLWC res = new ResponseBodyLWC(); |
| | | Map<String, object> data = new Map<String, object>(); |
| | | res.entity = data; |
| | |
| | | AggregateResult[] category4List = [ |
| | | SELECT Count(id), Category4_text__c c4c |
| | | FROM Product2__c |
| | | WHERE |
| | | Category3_text__c = :category3 |
| | | AND Category4_text__c != NULL |
| | | AND Category5_text__c != NULL |
| | | WHERE Category3_text__c = :category3 AND Category4_text__c != NULL AND Category5_text__c != NULL |
| | | GROUP BY Category4_text__c |
| | | ]; |
| | | System.debug('category4List ' + category4List); |
| | | category4OptionList = new List<SelectOption>(); |
| | | category4OptionList.add(new SelectOption('', '-无-')); |
| | | category4OptionMap = new Map<String, String>(); |
| | |
| | | AggregateResult[] category5List = [ |
| | | SELECT Count(id), Category5_text__c c5c |
| | | FROM Product2__c |
| | | WHERE |
| | | Category3_text__c = :category3 |
| | | AND Category4_text__c = :category4 |
| | | AND Category5_text__c != NULL |
| | | WHERE Category3_text__c = :category3 AND Category4_text__c = :category4 AND Category5_text__c != NULL |
| | | GROUP BY Category5_text__c |
| | | ]; |
| | | |
| | | System.debug('category5List ' + category5List); |
| | | category5OptionList = new List<SelectOption>(); |
| | | category5OptionList.add(new SelectOption('', '-无-')); |
| | | category5OptionMap = new Map<String, String>(); |
| | |
| | | AND Arrive_Owner_Work_Location__c = :userWorkLocationLwc |
| | | GROUP BY Consumable_Product__c, Box_Piece__c |
| | | ]; |
| | | System.debug('orderdetailCount = ' + orderdetailCount); |
| | | |
| | | for (AggregateResult orderdetail : orderdetailCount) { |
| | | zaikuId.add(String.valueOf(orderdetail.get('cpc'))); |
| | | } |
| | |
| | | String countdelSoql = 'SELECT Id,Bar_Code__c,Name,Inventory_date__c,Consumable_Product__c,Consumable_Product__r.Asset_Model_No__c,Recordtypeid,Box_Piece__c,ProductPacking_list_manual__c,hospitalSpecialOffer__c FROM Consumable_order_details2__c WHERE Dealer_Arrive__c = true AND Dealer_Shipment__c = false AND Dealer_Saled__c = false AND Dealer_Returned__c = false AND Lose_Flag__c = false AND Bar_Code__c != null AND Isoverdue__c = 1 AND Arrive_Owner_Work_Location__c = :userWorkLocation AND Dealer_Info_text__c = :accountName '; |
| | | if (String.isNotBlank(outOutPattern) && outOutPattern.equals('ishos')) { |
| | | countdelSoql += ' AND hospitalSpecialOffer__c = true'; |
| | | } else if ( |
| | | String.isNotBlank(outOutPattern) && outOutPattern.equals('nothos') |
| | | ) { |
| | | } else if (String.isNotBlank(outOutPattern) && outOutPattern.equals('nothos')) { |
| | | countdelSoql += ' AND hospitalSpecialOffer__c = false'; |
| | | } |
| | | System.debug('countdelSoql = ' + countdelSoql); |
| | |
| | | System.debug('soql = ' + soql); |
| | | product2Selected = Database.query(soql); |
| | | for (Integer i = 0; i < product2Selected.size(); i++) { |
| | | MidMap.put( |
| | | product2Selected[i].Id, |
| | | new ConsumableorderdetailsInfo(product2Selected[i]) |
| | | ); |
| | | MidMap.put(product2Selected[i].Id, new ConsumableorderdetailsInfo(product2Selected[i])); |
| | | } |
| | | |
| | | for (Integer i = 0; i < CountDel.size(); i++) { |
| | |
| | | if (MidMap.containsKey(CountDel[i].Consumable_Product__c)) { |
| | | //设置map中key的后缀 用于区分医院特价和非医院特价 |
| | | if (MidMap2.containsKey(CountDel[i].Consumable_Product__c + str)) { |
| | | ConsumableorderdetailsInfo Jstage = MidMap2.get( |
| | | CountDel[i].Consumable_Product__c + str |
| | | ); |
| | | ConsumableorderdetailsInfo Jstage = MidMap2.get(CountDel[i].Consumable_Product__c + str); |
| | | Jstage.allnumber = Jstage.allnumber + 1; |
| | | if (CountDel[i].Box_Piece__c == '盒') { |
| | | Jstage.Boxnumber = Jstage.Boxnumber + 1; |
| | |
| | | MidMap2.put(CountDel[i].Consumable_Product__c + str, Jstage); |
| | | } else { |
| | | //midmap2中没有对应的产品 |
| | | ConsumableorderdetailsInfo Jstage = MidMap.get( |
| | | CountDel[i].Consumable_Product__c |
| | | ) |
| | | .clone(); |
| | | ConsumableorderdetailsInfo Jstage = MidMap.get(CountDel[i].Consumable_Product__c).clone(); |
| | | Jstage.allnumber = Jstage.allnumber + 1; |
| | | if (CountDel[i].Box_Piece__c == '盒') { |
| | | Jstage.Boxnumber = Jstage.Boxnumber + 1; |
| | |
| | | continue; |
| | | } else { |
| | | bss.sortBy = false; |
| | | bss.packinglist = Integer.valueOf( |
| | | bss.Prod.Product2__r.Packing_list_manual__c |
| | | ); |
| | | bss.packinglist = Integer.valueOf(bss.Prod.Product2__r.Packing_list_manual__c); |
| | | bss.approbation_No = bss.Prod.Product2__r.SFDA_Approbation_No__c; |
| | | bss.expiration_Date = bss.Prod.Product2__r.SFDA_Expiration_Date__c; |
| | | consumableorderdetailsSelectRecords.add(bss); |
| | |
| | | //分页 |
| | | PaginatedAccounts paginatedAccounts = new PaginatedAccounts(); |
| | | totalCount = pageRecords.size(); |
| | | paginatedAccounts.nextPageToken = (pageToken + pageSize < totalCount) |
| | | ? pageToken + pageSize |
| | | : null; |
| | | paginatedAccounts.nextPageToken = (pageToken + pageSize < totalCount) ? pageToken + pageSize : null; |
| | | paginatedAccounts.recordStart = pageToken + 1; |
| | | paginatedAccounts.pageNumber = pageToken / pageSize + 1; |
| | | Integer recordEnd = pageSize * paginatedAccounts.pageNumber; |
| | | paginatedAccounts.recordEnd = totalCount >= recordEnd |
| | | ? recordEnd |
| | | : totalCount; |
| | | paginatedAccounts.recordEnd = totalCount >= recordEnd ? recordEnd : totalCount; |
| | | paginatedAccounts.totalRecords = totalCount; |
| | | |
| | | System.debug('addSize = ' + addSize); |
| | |
| | | System.debug('pageRecords = ' + pageRecords.size()); |
| | | String hos = ''; |
| | | for (Integer i = startIdx; i < endIdx; i++) { |
| | | System.debug( |
| | | 'skipData.get(pageRecords.get(i).Prod.Id) = ' + |
| | | skipData.get(pageRecords.get(i).Prod.Id) |
| | | ); |
| | | System.debug('skipData.get(pageRecords.get(i).Prod.Id) = ' + skipData.get(pageRecords.get(i).Prod.Id)); |
| | | if (pageRecords.get(i).hospitalSpecialOffer == true) { |
| | | hos = 'ishos'; |
| | | } else { |
| | |
| | | return res; |
| | | } |
| | | |
| | | private static String makeSoql( |
| | | String CateName, |
| | | String Category3, |
| | | String Category4, |
| | | String Category5 |
| | | ) { |
| | | private static String makeSoql(String CateName, String Category3, String Category4, String Category5) { |
| | | String sqlTail1 = '(\''; |
| | | for (Integer i = 0; i < zaikuId.size(); i++) { |
| | | if (zaikuId[i] != null) { |
| | |
| | | //Integer pageendNo = (setCon.getPageNumber() * size)>noOfRecords ? noOfRecords :(setCon.getPageNumber() * size-1); |
| | | Integer addNo = 0; |
| | | //update by rentx 2021-2-26 start |
| | | System.debug( |
| | | 'consumableorderdetailsSelectRecords.size() = ' + |
| | | consumableorderdetailsSelectRecords.size() |
| | | ); |
| | | for ( |
| | | ConsumableorderdetailsInfo info : consumableorderdetailsSelectRecords |
| | | ) { |
| | | System.debug('consumableorderdetailsSelectRecords.size() = ' + consumableorderdetailsSelectRecords.size()); |
| | | for (ConsumableorderdetailsInfo info : consumableorderdetailsSelectRecords) { |
| | | Consumable_Orderdetails__c orderdetails1 = new Consumable_Orderdetails__c(); |
| | | if ( |
| | | (info.hospitalSpecialOffer && |
| | | selectedIdMap.containsKey(info.Prod.Id + 'ishos')) || |
| | | (info.hospitalSpecialOffer == false && |
| | | selectedIdMap.containsKey(info.Prod.Id + 'nothos')) |
| | | (info.hospitalSpecialOffer && selectedIdMap.containsKey(info.Prod.Id + 'ishos')) || |
| | | (info.hospitalSpecialOffer == false && selectedIdMap.containsKey(info.Prod.Id + 'nothos')) |
| | | ) { |
| | | addNo++; |
| | | } else { |
| | |
| | | //Integer pageendNo = (setCon.getPageNumber() * size)>noOfRecords ? noOfRecords :(setCon.getPageNumber() * size-1); |
| | | Integer addNo = 0; |
| | | //update by rentx 2021-2-26 start |
| | | System.debug( |
| | | 'consumableorderdetailsSelectRecords.size() = ' + |
| | | consumableorderdetailsSelectRecords.size() |
| | | ); |
| | | for ( |
| | | ConsumableorderdetailsInfo info : consumableorderdetailsSelectRecords |
| | | ) { |
| | | System.debug('consumableorderdetailsSelectRecords.size() = ' + consumableorderdetailsSelectRecords.size()); |
| | | for (ConsumableorderdetailsInfo info : consumableorderdetailsSelectRecords) { |
| | | Consumable_Orderdetails__c orderdetails1 = new Consumable_Orderdetails__c(); |
| | | if ( |
| | | (info.hospitalSpecialOffer && |
| | | selectedIdMap.containsKey(info.Prod.Id + 'ishos')) || |
| | | (info.hospitalSpecialOffer == false && |
| | | selectedIdMap.containsKey(info.Prod.Id + 'nothos')) |
| | | (info.hospitalSpecialOffer && selectedIdMap.containsKey(info.Prod.Id + 'ishos')) || |
| | | (info.hospitalSpecialOffer == false && selectedIdMap.containsKey(info.Prod.Id + 'nothos')) |
| | | ) { |
| | | System.debug('去掉的id : ' + info.Prod.Id); |
| | | addNo++; |
| | |
| | | System.debug('SecondDealer = ' + SecondDealer); |
| | | System.debug('pageRecordsLwc = ' + pageRecordsLwc); |
| | | System.debug('accountid = ' + accountid); |
| | | System.debug( |
| | | 'consumableproductdetailsRecords = ' + consumableproductdetailsRecords |
| | | ); |
| | | System.debug('consumableproductdetailsRecords = ' + consumableproductdetailsRecords); |
| | | System.debug('ESetId = ' + ESetId); |
| | | ResponseBodyLWC res = new ResponseBodyLWC(); |
| | | Map<String, object> data = new Map<String, object>(); |
| | |
| | | // coc.Order_ForCustomerText__c.addError('请输入科室'); |
| | | // return null; |
| | | return new ResponseBodyLWC('Error', 500, '请输入科室', ''); |
| | | } else if ( |
| | | String.isNotBlank(SecondDealer) || |
| | | String.isNotBlank(coc.Order_ForDealerText__c) |
| | | ) { |
| | | } else if (String.isNotBlank(SecondDealer) || String.isNotBlank(coc.Order_ForDealerText__c)) { |
| | | // coc.addError('不需要二级经销商和经销商(录入)信息' ); |
| | | // return null; |
| | | return new ResponseBodyLWC( |
| | | 'Error', |
| | | 500, |
| | | '不需要二级经销商和经销商(录入)信息', |
| | | '' |
| | | ); |
| | | return new ResponseBodyLWC('Error', 500, '不需要二级经销商和经销商(录入)信息', ''); |
| | | } |
| | | } else if (coc.SummonsForDirction__c == '医院试用') { |
| | | if (String.isBlank(HospitalInfo) || String.isBlank(HospitalName)) { |
| | |
| | | return new ResponseBodyLWC('Error', 500, '请输入科室', ''); |
| | | } |
| | | } else if (coc.SummonsForDirction__c == '销售给二级经销商') { |
| | | if ( |
| | | String.isBlank(SecondDealer) && |
| | | String.isBlank(coc.Order_ForDealerText__c) |
| | | ) { |
| | | if (String.isBlank(SecondDealer) && String.isBlank(coc.Order_ForDealerText__c)) { |
| | | // coc.addError('必须输入二级经销商或经销商(录入)'); |
| | | // return null; |
| | | return new ResponseBodyLWC( |
| | | 'Error', |
| | | 500, |
| | | '必须输入二级经销商或经销商(录入)', |
| | | '' |
| | | ); |
| | | return new ResponseBodyLWC('Error', 500, '必须输入二级经销商或经销商(录入)', ''); |
| | | } |
| | | if (String.isBlank(HospitalInfo) || String.isBlank(HospitalName)) { |
| | | // coc.addError('请输入医院'); |
| | |
| | | // return null; |
| | | return new ResponseBodyLWC('Error', 500, '不需要输入科室', ''); |
| | | } |
| | | if ( |
| | | String.isBlank(SecondDealer) && |
| | | String.isBlank(coc.Order_ForDealerText__c) |
| | | ) { |
| | | if (String.isBlank(SecondDealer) && String.isBlank(coc.Order_ForDealerText__c)) { |
| | | // coc.addError('必须输入二级经销商或经销商(录入)'); |
| | | // return null; |
| | | return new ResponseBodyLWC( |
| | | 'Error', |
| | | 500, |
| | | '必须输入二级经销商或经销商(录入)', |
| | | '' |
| | | ); |
| | | return new ResponseBodyLWC('Error', 500, '必须输入二级经销商或经销商(录入)', ''); |
| | | } |
| | | } |
| | | |
| | |
| | | //特价医院出库非本医院维护的特价商品时,报错 非特价医院出库维护在医院特价关系表的产品时 报错 |
| | | if (coc.SummonsForDirction__c != '互相调货') { |
| | | //非特价医院出库特价产品时 报错(当前经销商下没有特价医院除外) |
| | | List<hospitalprice__c> hopList = [ |
| | | SELECT id, hospital__c, product__c |
| | | FROM hospitalprice__c |
| | | WHERE account__c = :accountid |
| | | ]; |
| | | List<hospitalprice__c> hopList = [SELECT id, hospital__c, product__c FROM hospitalprice__c WHERE account__c = :accountid]; |
| | | //经销商对应医院下的所有特价产品 |
| | | Map<String, String> proMap = new Map<String, String>(); |
| | | //经销商下的所有特价产品 |
| | |
| | | //用户选中非当前医院维护的特价产品 |
| | | // ApexPages.addmessage(new ApexPages.message(ApexPages.severity.Error, '当前医院没有维护 消耗品:'+ ass.Prod.Name__c +' 的特价')); |
| | | // return null; |
| | | return new ResponseBodyLWC( |
| | | 'Error', |
| | | 500, |
| | | '当前医院没有维护 消耗品:' + ass.Prod.Name__c + '的特价', |
| | | '' |
| | | ); |
| | | return new ResponseBodyLWC('Error', 500, '当前医院没有维护 消耗品:' + ass.Prod.Name__c + '的特价', ''); |
| | | } |
| | | } //非医院特价产品可以出库给任意医院,所以不需要判断 |
| | | } |
| | |
| | | p.Name = '*'; |
| | | p.Order_type__c = '传票'; |
| | | p.Order_ProType__c = agencyProType; |
| | | if ( |
| | | coc.SummonsStatus_c__c == null || String.isBlank(coc.SummonsStatus_c__c) |
| | | ) |
| | | if (coc.SummonsStatus_c__c == null || String.isBlank(coc.SummonsStatus_c__c)) |
| | | coc.SummonsStatus_c__c = '草案中'; |
| | | // update strat by vivek 2019-7-12 |
| | | p.NoConfirmedPrice__c = coc.NoConfirmedPrice__c; |
| | |
| | | p.Offers_Price__c = coc.Offers_Price__c; |
| | | p.Dealer_Info__c = accountid; |
| | | if (String.isBlank(SecondDealer)) { |
| | | p.Order_ForHospital__c = String.isNotBlank(HospitalInfo) |
| | | ? HospitalInfo |
| | | : null; |
| | | p.Order_ForHospital__c = String.isNotBlank(HospitalInfo) ? HospitalInfo : null; |
| | | p.Order_ForCustomerText__c = coc.Order_ForCustomerText__c; |
| | | } else { |
| | | p.Order_ForHospital__c = String.isNotBlank(HospitalInfo) |
| | | ? HospitalInfo |
| | | : null; |
| | | p.Order_ForHospital__c = String.isNotBlank(HospitalInfo) ? HospitalInfo : null; |
| | | p.Order_ForCustomerText__c = coc.Order_ForCustomerText__c; |
| | | p.Order_ForDealer__c = SecondDealer; |
| | | } |
| | |
| | | for (ConsumableorderdetailsInfoLwc ass : pageRecordsLwc) { |
| | | if (ass.check == true) { |
| | | if (ass.orderdetails1.Delivery_List_RMB__c < 0) { |
| | | return new ResponseBodyLWC( |
| | | 'Error', |
| | | 500, |
| | | '请输入正确的出货单价 (元)', |
| | | '' |
| | | ); |
| | | return new ResponseBodyLWC('Error', 500, '请输入正确的出货单价 (元)', ''); |
| | | } |
| | | if ( |
| | | ass.orderdetails1.Delivery_List_RMB__c == null && |
| | | coc.SummonsForDirction__c != '医院试用' |
| | | ) { |
| | | return new ResponseBodyLWC( |
| | | 'Error', |
| | | 500, |
| | | '请输入正确的出货单价 (元)', |
| | | '' |
| | | ); |
| | | if (ass.orderdetails1.Delivery_List_RMB__c == null && coc.SummonsForDirction__c != '医院试用') { |
| | | return new ResponseBodyLWC('Error', 500, '请输入正确的出货单价 (元)', ''); |
| | | } |
| | | if ( |
| | | (ass.orderdetails1.Delivery_List_RMB__c == null || |
| | | ass.orderdetails1.Delivery_List_RMB__c == 0) && |
| | | coc.SummonsForDirction__c != '医院试用' |
| | | ) { |
| | | if ((ass.orderdetails1.Delivery_List_RMB__c == null || ass.orderdetails1.Delivery_List_RMB__c == 0) && coc.SummonsForDirction__c != '医院试用') { |
| | | return new ResponseBodyLWC('Error', 500, '请输入出货单价 (元)', ''); |
| | | } |
| | | if ( |
| | |
| | | ) { |
| | | return new ResponseBodyLWC('Error', 500, '请输入出货单价 (元)', ''); |
| | | } |
| | | if ( |
| | | ass.orderdetails1.Shipment_Count__c == null || |
| | | ass.orderdetails1.Shipment_Count__c == 0 |
| | | ) { |
| | | if (ass.orderdetails1.Shipment_Count__c == null || ass.orderdetails1.Shipment_Count__c == 0) { |
| | | // ass.orderdetails1.Shipment_Count__c.addError('请输入出货数量'); |
| | | // return null; |
| | | return new ResponseBodyLWC('Error', 500, '请输入出货数量', ''); |
| | | } |
| | | |
| | | if ( |
| | | ass.orderdetails1.Box_Piece__c == null || |
| | | ass.orderdetails1.Box_Piece__c == '' |
| | | ) { |
| | | if (ass.orderdetails1.Box_Piece__c == null || ass.orderdetails1.Box_Piece__c == '') { |
| | | // ass.orderdetails1.Box_Piece__c.addError('请输入单位'); |
| | | // return null; |
| | | return new ResponseBodyLWC('Error', 500, '请输入单位', ''); |
| | |
| | | //ass.orderdetails1.Shipment_Count__c.addError('库存不足'); |
| | | if (ass.oldCheck == false) { |
| | | // ApexPages.addmessage(new ApexPages.message(ApexPages.severity.Error, '消耗品'+ ass.Prod.Name__c + '库存不足')); |
| | | return new ResponseBodyLWC( |
| | | 'Error', |
| | | 500, |
| | | '消耗品' + ass.Prod.Name__c + '库存不足', |
| | | '' |
| | | ); |
| | | return new ResponseBodyLWC('Error', 500, '消耗品' + ass.Prod.Name__c + '库存不足', ''); |
| | | } else { |
| | | // ApexPages.addmessage(new ApexPages.message(ApexPages.severity.Error, '消耗品'+ ass.orderdetails1.Consumable_Product__r.Name__c + '库存不足')); |
| | | return new ResponseBodyLWC( |
| | |
| | | //ass.orderdetails1.Shipment_Count__c.addError('库存不足'); |
| | | if (ass.oldCheck == false) { |
| | | // ApexPages.addmessage(new ApexPages.message(ApexPages.severity.Error, '消耗品'+ ass.Prod.Name__c + '库存不足')); |
| | | return new ResponseBodyLWC( |
| | | 'Error', |
| | | 500, |
| | | '消耗品' + ass.Prod.Name__c + '库存不足', |
| | | '' |
| | | ); |
| | | return new ResponseBodyLWC('Error', 500, '消耗品' + ass.Prod.Name__c + '库存不足', ''); |
| | | } else { |
| | | // ApexPages.addmessage(new ApexPages.message(ApexPages.severity.Error, '消耗品'+ ass.orderdetails1.Consumable_Product__r.Name__c + '库存不足')); |
| | | return new ResponseBodyLWC( |
| | |
| | | insert p; |
| | | ESetId = p.id; |
| | | List<Consumable_order__c> detailName = new List<Consumable_order__c>(); |
| | | detailName = [ |
| | | SELECT id, Name |
| | | FROM Consumable_order__c |
| | | WHERE id = :ESetId |
| | | ]; |
| | | detailName = [SELECT id, Name FROM Consumable_order__c WHERE id = :ESetId]; |
| | | Integer i = 1; |
| | | for (ConsumableorderdetailsInfoLwc ass : pageRecordsLwc) { |
| | | if (ass.check == true) { |
| | |
| | | List<Consumable_order__c> cocinfo = new List<Consumable_order__c>(); |
| | | // update start by vivek 2019-7-15 add "NoConfirmedPrice__c" in select |
| | | cocinfo = [ |
| | | SELECT |
| | | Id, |
| | | Name, |
| | | SummonsStatus_c__c, |
| | | NoConfirmedPrice__c, |
| | | Dealer_Info__c, |
| | | Order_ForHospital__c, |
| | | SummonsForDirction__c |
| | | SELECT Id, Name, SummonsStatus_c__c, NoConfirmedPrice__c, Dealer_Info__c, Order_ForHospital__c, SummonsForDirction__c |
| | | FROM Consumable_order__c |
| | | WHERE Id = :ESetId |
| | | ]; |
| | |
| | | p.Dealer_Info__c = accountid; |
| | | p.Order_ProType__c = agencyProType; |
| | | if (String.isEmpty(SecondDealer)) { |
| | | p.Order_ForHospital__c = String.isNotBlank(HospitalInfo) |
| | | ? HospitalInfo |
| | | : null; |
| | | p.Order_ForHospital__c = String.isNotBlank(HospitalInfo) ? HospitalInfo : null; |
| | | p.Order_ForCustomerText__c = coc.Order_ForCustomerText__c; |
| | | System.debug('SecondDealer = ' + SecondDealer); |
| | | p.Order_ForDealer__c = null; |
| | | } else { |
| | | p.Order_ForHospital__c = String.isNotBlank(HospitalInfo) |
| | | ? HospitalInfo |
| | | : null; |
| | | p.Order_ForHospital__c = String.isNotBlank(HospitalInfo) ? HospitalInfo : null; |
| | | p.Order_ForCustomerText__c = coc.Order_ForCustomerText__c; |
| | | p.Order_ForDealer__c = SecondDealer; |
| | | } |
| | |
| | | for (ConsumableorderdetailsInfoLwc ass : pageRecordsLwc) { |
| | | if (ass.check == true) { |
| | | if (ass.orderdetails1.Delivery_List_RMB__c < 0) { |
| | | return new ResponseBodyLWC( |
| | | 'Error', |
| | | 500, |
| | | '请输入正确的出货单价 (元)', |
| | | '' |
| | | ); |
| | | return new ResponseBodyLWC('Error', 500, '请输入正确的出货单价 (元)', ''); |
| | | } |
| | | Consumable_orderdetails__c InsAfterDel = new Consumable_orderdetails__c(); |
| | | if ( |
| | | (ass.orderdetails1.Delivery_List_RMB__c == null || |
| | | ass.orderdetails1.Delivery_List_RMB__c == 0) && |
| | | coc.SummonsForDirction__c != '医院试用' |
| | | ) { |
| | | if ((ass.orderdetails1.Delivery_List_RMB__c == null || ass.orderdetails1.Delivery_List_RMB__c == 0) && coc.SummonsForDirction__c != '医院试用') { |
| | | return new ResponseBodyLWC('Error', 500, '请输入出货单价 (元)', ''); |
| | | } |
| | | if ( |
| | |
| | | ) { |
| | | return new ResponseBodyLWC('Error', 500, '请输入出货单价 (元)', ''); |
| | | } |
| | | if ( |
| | | ass.orderdetails1.Box_Piece__c == null || |
| | | ass.orderdetails1.Box_Piece__c == '' |
| | | ) { |
| | | if (ass.orderdetails1.Box_Piece__c == null || ass.orderdetails1.Box_Piece__c == '') { |
| | | // ass.orderdetails1.Box_Piece__c.addError('请输入单位'); |
| | | // return null; |
| | | return new ResponseBodyLWC('Error', 500, '请输入单位', ''); |
| | |
| | | //ass.orderdetails1.Shipment_Count__c.addError('库存不足'); |
| | | if (ass.oldCheck == false) { |
| | | // ApexPages.addmessage(new ApexPages.message(ApexPages.severity.Error, '消耗品'+ ass.Prod.Name__c + '库存不足')); |
| | | return new ResponseBodyLWC( |
| | | 'Error', |
| | | 500, |
| | | '消耗品' + ass.Prod.Name__c + '库存不足', |
| | | '' |
| | | ); |
| | | return new ResponseBodyLWC('Error', 500, '消耗品' + ass.Prod.Name__c + '库存不足', ''); |
| | | } else { |
| | | // ApexPages.addmessage(new ApexPages.message(ApexPages.severity.Error, '消耗品'+ ass.orderdetails1.Consumable_Product__r.Name__c + '库存不足')); |
| | | return new ResponseBodyLWC( |
| | |
| | | if (ass.orderdetails1.Shipment_Count__c > ass.Piecenumber) { |
| | | if (ass.oldCheck == false) { |
| | | // ApexPages.addmessage(new ApexPages.message(ApexPages.severity.Error, '消耗品'+ ass.Prod.Name__c + '库存不足')); |
| | | return new ResponseBodyLWC( |
| | | 'Error', |
| | | 500, |
| | | '消耗品' + ass.Prod.Name__c + '库存不足', |
| | | '' |
| | | ); |
| | | return new ResponseBodyLWC('Error', 500, '消耗品' + ass.Prod.Name__c + '库存不足', ''); |
| | | } else { |
| | | //ApexPages.addmessage(new ApexPages.message(ApexPages.severity.Error, '消耗品'+ ass.orderdetails1.Consumable_Product__r.Name__c + '库存不足')); |
| | | return new ResponseBodyLWC( |
| | |
| | | } |
| | | } |
| | | } |
| | | if ( |
| | | ass.orderdetails1.Shipment_Count__c == null || |
| | | ass.orderdetails1.Shipment_Count__c == 0 |
| | | ) { |
| | | if (ass.orderdetails1.Shipment_Count__c == null || ass.orderdetails1.Shipment_Count__c == 0) { |
| | | // ass.orderdetails1.Shipment_Count__c.addError('请输入出货数量'); |
| | | // return null; |
| | | return new ResponseBodyLWC('Error', 500, '请输入出货数量', ''); |
| | |
| | | InsAfterDel.Name = p.name + '-' + str; |
| | | InsAfterDel.Shipment_Count__c = ass.orderdetails1.Shipment_Count__c; |
| | | InsAfterDel.Consumable_order__c = ESetId; |
| | | System.debug('ass.Prod.id:' + ass.Prod.id); |
| | | InsAfterDel.Consumable_Product__c = ass.Prod.id; |
| | | InsAfterDel.Intra_Trade_List_RMB__c = ass.Prod.Intra_Trade_List_RMB__c; |
| | | InsAfterDel.Delivery_List_RMB__c = ass.orderdetails1.Delivery_List_RMB__c; |
| | |
| | | } |
| | | update p; |
| | | List<Consumable_orderdetails__c> qs = new List<Consumable_orderdetails__c>(); |
| | | qs = [ |
| | | SELECT Id |
| | | FROM Consumable_orderdetails__c |
| | | WHERE Consumable_order__c = :ESetId |
| | | ]; |
| | | qs = [SELECT Id FROM Consumable_orderdetails__c WHERE Consumable_order__c = :ESetId]; |
| | | if (qs.size() > 0) { |
| | | delete qs; |
| | | } |
| | |
| | | |
| | | //打印PDF |
| | | @AuraEnabled |
| | | public static ResponseBodyLWC PraseToPDF( |
| | | Consumable_order__c cocLwc, |
| | | String ESetId |
| | | ) { |
| | | public static ResponseBodyLWC PraseToPDF(Consumable_order__c cocLwc, String ESetId) { |
| | | System.debug('cocLwc = ' + cocLwc); |
| | | System.debug('ESetId = ' + ESetId); |
| | | coc = cocLwc; |
| | |
| | | public static List<LookupSearchResult> search(String searchTerm) { |
| | | System.debug('searchTerm = ' + searchTerm); |
| | | String nameCondition = ''; |
| | | nameCondition += |
| | | '%' + |
| | | String.escapeSingleQuotes(searchTerm.replaceAll('%', '\\%')) + |
| | | '%'; |
| | | nameCondition += '%' + String.escapeSingleQuotes(searchTerm.replaceAll('%', '\\%')) + '%'; |
| | | List<Account> accs = new List<Account>(); |
| | | System.debug('nameCondition = ' + nameCondition); |
| | | //查询条件修改 |
| | |
| | | // ]; |
| | | // } |
| | | |
| | | |
| | | Date today = Date.today(); |
| | | //Date today = Date.newInstance(2023, 3, 1); |
| | | Integer thisMonth = today.month(); |
| | |
| | | System.debug('thisDatetime2 = ' + thisDatetime2); |
| | | System.debug('nextDatetime = ' + nextDatetime); |
| | | System.debug('UserInfo.getUserId() = ' + UserInfo.getUserId()); |
| | | User UserProTypecTemp = [ |
| | | SELECT UserPro_Type__c |
| | | FROM User |
| | | WHERE id = :UserInfo.getUserId() |
| | | ]; |
| | | User UserProTypecTemp = [select UserPro_Type__c from User where id =: UserInfo.getUserId()]; |
| | | |
| | | String sql = 'SELECT id, Parentid FROM Account WHERE Parent.Name LIKE :nameCondition '; |
| | | if (thisMonth < 4) { |
| | |
| | | } |
| | | |
| | | accs = [ |
| | | SELECT |
| | | Id, |
| | | Name, |
| | | Department_Class__c, |
| | | Department_Class__r.Name, |
| | | Hospital__c, |
| | | Hospital__r.Name, |
| | | BillingCity |
| | | SELECT Id, Name, Department_Class__c, Department_Class__r.Name, Hospital__c, Hospital__r.Name, BillingCity |
| | | FROM Account |
| | | WHERE |
| | | (Id IN :pids |
| | |
| | | List<LookupSearchResult> results = new List<LookupSearchResult>(); |
| | | String accountIcon = 'standard:account'; |
| | | for (Account account : accs) { |
| | | String subtitle = account.BillingCity == null |
| | | ? 'Account' |
| | | : 'Account • ' + account.BillingCity; |
| | | results.add( |
| | | new LookupSearchResult( |
| | | account.Id, |
| | | 'Account', |
| | | accountIcon, |
| | | account.Name, |
| | | subtitle |
| | | ) |
| | | ); |
| | | String subtitle = account.BillingCity == null ? 'Account' : 'Account • ' + account.BillingCity; |
| | | results.add(new LookupSearchResult(account.Id, 'Account', accountIcon, account.Name, subtitle)); |
| | | } |
| | | results.sort(); |
| | | System.debug('results = ' + results); |
| | |
| | | |
| | | //保存附件 |
| | | @AuraEnabled |
| | | public static String saveFile( |
| | | Id recordId, |
| | | String fileName, |
| | | String base64Data |
| | | ) { |
| | | public static String saveFile(Id recordId, String fileName, String base64Data) { |
| | | base64Data = EncodingUtil.urlDecode(base64Data, 'UTF-8'); |
| | | ContentVersion cv = new ContentVersion(); |
| | | cv.Title = fileName; |
| | |
| | | ResponseBodyLWC res = new ResponseBodyLWC(); |
| | | Map<String, object> data = new Map<String, object>(); |
| | | res.entity = data; |
| | | List<ContentVersion> cvList = [ |
| | | SELECT |
| | | id, |
| | | Title, |
| | | CreatedBy.Name, |
| | | PathOnClient, |
| | | CreatedDate, |
| | | ContentDocumentId |
| | | List<ContentVersion> cvList = new List<ContentVersion>(); |
| | | List<ContentDocumentLink> links = [SELECT Id, ContentDocumentId FROM ContentDocumentLink WHERE LinkedEntityId = :recordId]; |
| | | if (links != null && links.size() > 0) { |
| | | List<String> documentIds = new List<String>(); |
| | | for (ContentDocumentLink link : links) { |
| | | documentIds.add(link.ContentDocumentId); |
| | | } |
| | | List<ContentVersion> cvInfo = [ |
| | | SELECT Id, Title, OwnerId, Owner.Name, CreatedDate, ContentDocumentId |
| | | FROM ContentVersion |
| | | WHERE FirstPublishLocationId = :recordId |
| | | WHERE ContentDocumentId IN :documentIds |
| | | ]; |
| | | |
| | | if (cvInfo.size() > 0) { |
| | | for (Integer i = 0; i < cvInfo.size(); i++) { |
| | | cvList.add(cvInfo[i]); |
| | | } |
| | | } |
| | | } |
| | | // List<ContentVersion> cvList = [ |
| | | // SELECT id, Title, CreatedBy.Name, PathOnClient, CreatedDate, ContentDocumentId |
| | | // FROM ContentVersion |
| | | // WHERE FirstPublishLocationId = :recordId |
| | | // ]; |
| | | data.put('cvList', cvList); |
| | | res.status = 'Success'; |
| | | res.code = 200; |
| | |
| | | @AuraEnabled |
| | | public static ResponseBodyLWC deleteAtt(String contentVersionId) { |
| | | try { |
| | | ContentVersion conVersion = [ |
| | | SELECT ContentDocumentId |
| | | FROM ContentVersion |
| | | WHERE Id = :contentVersionId |
| | | ]; |
| | | ContentVersion conVersion = [SELECT ContentDocumentId FROM ContentVersion WHERE Id = :contentVersionId]; |
| | | String contentDocumentId = conVersion.ContentDocumentId; |
| | | ContentDocument conDocument = [ |
| | | SELECT Id |
| | | FROM ContentDocument |
| | | WHERE Id = :contentDocumentId |
| | | ]; |
| | | ContentDocument conDocument = [SELECT Id FROM ContentDocument where Id = :contentDocumentId]; |
| | | delete conDocument; |
| | | return new ResponseBodyLWC('Success', 200, '', ''); |
| | | } catch (Exception e) { |
| | | return new ResponseBodyLWC( |
| | | 'Error', |
| | | 500, |
| | | e.getMessage() + e.getLineNumber(), |
| | | '' |
| | | ); |
| | | return new ResponseBodyLWC('Error',500, e.getMessage() + e.getLineNumber(), ''); |
| | | } |
| | | } |
| | | |
| | |
| | | List<Account> accList = [ |
| | | SELECT Id |
| | | FROM Account |
| | | WHERE |
| | | Name = :coc.Order_ForDealerText__c |
| | | AND RecordType.DeveloperName = 'Agency' |
| | | WHERE Name = :coc.Order_ForDealerText__c AND RecordType.DeveloperName = 'Agency' |
| | | ]; |
| | | if (accList.size() < 1) { |
| | | // ApexPages.addmessage(new ApexPages.message(ApexPages.severity.Error, '请输入二级经销商全称!')); |
| | |
| | | if (ass.orderdetails1.Shipment_Count__c > ass.allnumber) { |
| | | // ApexPages.addmessage(new ApexPages.message(ApexPages.severity.Error, '消耗品'+ ass.orderdetails1.Consumable_Product__r.Name__c + '库存不足')); |
| | | // return null; |
| | | return new ResponseBodyLWC( |
| | | 'Error', |
| | | 500, |
| | | '消耗品' + |
| | | ass.orderdetails1.Consumable_Product__r.Name__c + |
| | | '库存不足', |
| | | '' |
| | | ); |
| | | return new ResponseBodyLWC('Error', 500, '消耗品' + ass.orderdetails1.Consumable_Product__r.Name__c + '库存不足', ''); |
| | | } |
| | | } |
| | | data.put('ESetid', ESetid); |
| | |
| | | try { |
| | | List<Consumable_order__c> qs = new List<Consumable_order__c>(); |
| | | List<Consumable_orderdetails__c> Dqs = new List<Consumable_orderdetails__c>(); |
| | | Dqs = [ |
| | | SELECT Id |
| | | FROM Consumable_orderdetails__c |
| | | WHERE Consumable_order__c = :ESetId |
| | | ]; |
| | | Dqs = [SELECT Id FROM Consumable_orderdetails__c WHERE Consumable_order__c = :ESetId]; |
| | | qs = [SELECT Id FROM Consumable_order__c WHERE Id = :ESetId]; |
| | | if (Dqs.size() > 0 || qs.size() > 0) { |
| | | delete Dqs; |
| | |
| | | } |
| | | |
| | | //附件 |
| | | @TestVisible |
| | | public ConsumableorderdetailsInfo(Attachment e) { |
| | | concc = e; |
| | | hospitalSpecialOffer = false; |