| | |
| | | codPageRecords = new List<orderBean>(); |
| | | overduePageRecords = new List<orderBean>(); |
| | | // 获取用户和经销商信息 |
| | | user Useracc = [ |
| | | SELECT Accountid, Work_Location__c, UserPro_Type__c |
| | | FROM user |
| | | WHERE id = :UserInfo.getUserId() |
| | | ]; |
| | | user Useracc = [SELECT Accountid, Work_Location__c, UserPro_Type__c FROM user WHERE id = :UserInfo.getUserId()]; |
| | | userWorkLocation = Useracc.Work_Location__c; |
| | | agencyProType = Useracc.UserPro_Type__c; |
| | | if (String.isBlank(Useracc.UserPro_Type__c)) { |
| | | agencyProType = 'ET'; |
| | | } |
| | | sqlagencyProType = '%' + agencyProType + '%'; |
| | | accountInfo = [ |
| | | SELECT id, Name, Dealer_discount__c |
| | | FROM account |
| | | WHERE id = :Useracc.accountid |
| | | ]; |
| | | accountInfo = [SELECT id, Name, Dealer_discount__c FROM account WHERE id = :Useracc.accountid]; |
| | | // 过期库存汇总信息 |
| | | List<AggregateResult> orderDetZaiku = [ |
| | | SELECT |
| | | count(Id) countsum, |
| | | Consumable_Product__c prodid, |
| | | Consumable_Product__r.Name_Text__c prodname, |
| | | Box_Piece__c boxPiece |
| | | SELECT count(Id) countsum, Consumable_Product__c prodid, Consumable_Product__r.Name_Text__c prodname, Box_Piece__c boxPiece |
| | | FROM Consumable_order_details2__c |
| | | WHERE |
| | | Dealer_Arrive__c = TRUE |
| | |
| | | AND Product_Type__c LIKE :sqlagencyProType |
| | | AND Dealer_Info_text__c = :accountInfo.Name |
| | | AND Arrive_Owner_Work_Location__c = :userWorkLocation |
| | | GROUP BY |
| | | Consumable_Product__c, |
| | | Box_Piece__c, |
| | | Consumable_Product__r.Name_Text__c |
| | | GROUP BY Consumable_Product__c, Box_Piece__c, Consumable_Product__r.Name_Text__c |
| | | ]; |
| | | |
| | | for (AggregateResult overdue : orderDetZaiku) { |
| | |
| | | ResponseBodyLWC res = new ResponseBodyLWC(); |
| | | Map<String, object> data = new Map<String, object>(); |
| | | res.entity = data; |
| | | List<orderBean> codPageRecords = (List<orderBean>) JSON.deserialize( |
| | | codPageRecordsLWC, |
| | | List<orderBean>.class |
| | | ); |
| | | List<orderBean> codPageRecords = (List<orderBean>) JSON.deserialize(codPageRecordsLWC, List<orderBean>.class); |
| | | sqlagencyProType = '%' + agencyProTypeLWC + '%'; |
| | | system.debug('sqlagencyProType==>' + sqlagencyProType); |
| | | barcode = barcodeLWC; |
| | |
| | | userWorkLocation = userWorkLocationLWC; |
| | | // add by Wang Xueqin 2023/04/12 |
| | | // 获取用户和经销商信息 |
| | | user Useracc = [ |
| | | SELECT Accountid, Work_Location__c, UserPro_Type__c |
| | | FROM user |
| | | WHERE id = :UserInfo.getUserId() |
| | | ]; |
| | | accountInfo = [ |
| | | SELECT id, Name, Dealer_discount__c |
| | | FROM account |
| | | WHERE id = :Useracc.accountid |
| | | ]; |
| | | user Useracc = [SELECT Accountid, Work_Location__c, UserPro_Type__c FROM user WHERE id = :UserInfo.getUserId()]; |
| | | accountInfo = [SELECT id, Name, Dealer_discount__c FROM account WHERE id = :Useracc.accountid]; |
| | | |
| | | iSinventory = true; |
| | | Set<String> barCodeoverdue = new Set<String>(); |
| | |
| | | for (orderBean codPage : codPageRecords) { |
| | | if (codPage.check) { |
| | | for (Consumable_order_details2__c cod2 : orderDetZaiku) { |
| | | if ( |
| | | cod2.Consumable_Product__c == codPage.prodid && |
| | | codPage.boxPiece == cod2.Box_Piece__c |
| | | ) { |
| | | if (cod2.Consumable_Product__c == codPage.prodid && codPage.boxPiece == cod2.Box_Piece__c) { |
| | | overduePageRecords.add(new orderBean(cod2, '过期库存销存')); |
| | | overdueList.add(cod2); |
| | | } |
| | |
| | | cod2.Cancellation_Flag__c == false) && cod2.Isoverdue__c == 0 |
| | | ) { |
| | | for (orderBean codPage : codPageRecords) { |
| | | if ( |
| | | cod2.Consumable_Product__c == codPage.prodid && |
| | | cod2.Box_Piece__c == codPage.boxPiece |
| | | ) { |
| | | if (cod2.Consumable_Product__c == codPage.prodid && cod2.Box_Piece__c == codPage.boxPiece) { |
| | | overduePageRecords.add(new orderBean(cod2, '过期库存销存')); |
| | | overdueList.add(cod2); |
| | | codPage.pandian++; |
| | |
| | | |
| | | // 保存按钮 |
| | | @AuraEnabled |
| | | public static ResponseBodyLWC save( |
| | | Boolean iSinventory, |
| | | string saveCodPageRecords, |
| | | List<Consumable_order_details2__c> saveoverdueList |
| | | ) { |
| | | public static ResponseBodyLWC save(Boolean iSinventory, string saveCodPageRecords, List<Consumable_order_details2__c> saveoverdueList) { |
| | | ResponseBodyLWC res = new ResponseBodyLWC(); |
| | | Map<String, object> data = new Map<String, object>(); |
| | | res.entity = data; |
| | |
| | | |
| | | // } |
| | | |
| | | List<orderBean> codPageRecords = (List<orderBean>) JSON.deserialize( |
| | | saveCodPageRecords, |
| | | List<orderBean>.class |
| | | ); |
| | | List<orderBean> codPageRecords = (List<orderBean>) JSON.deserialize(saveCodPageRecords, List<orderBean>.class); |
| | | // List<Consumable_order_details2__c> overdueList = (List<Consumable_order_details2__c>)JSON.deserialize(saveoverdueList,List<Consumable_order_details2__c>.class); |
| | | // add by Wang Xueqin 2023/04/12 |
| | | // 获取用户和经销商信息 |
| | | user Useracc = [ |
| | | SELECT Accountid, Work_Location__c, UserPro_Type__c |
| | | FROM user |
| | | WHERE id = :UserInfo.getUserId() |
| | | ]; |
| | | accountInfo = [ |
| | | SELECT id, Name, Dealer_discount__c |
| | | FROM account |
| | | WHERE id = :Useracc.accountid |
| | | ]; |
| | | user Useracc = [SELECT Accountid, Work_Location__c, UserPro_Type__c FROM user WHERE id = :UserInfo.getUserId()]; |
| | | accountInfo = [SELECT id, Name, Dealer_discount__c FROM account WHERE id = :Useracc.accountid]; |
| | | |
| | | // 跳过明细2不必要更新 |
| | | StaticParameter.EscapeConsumableOrderDetail2Trigger = true; |
| | |
| | | po.RecordTypeid = System.Label.RT_ConOrder_Overdue; |
| | | try { |
| | | insert po; |
| | | Consumable_order__c order = [ |
| | | SELECT Name |
| | | FROM Consumable_order__c |
| | | WHERE id = :po.id |
| | | ]; |
| | | Consumable_order__c order = [SELECT Name FROM Consumable_order__c WHERE id = :po.id]; |
| | | List<Consumable_orderdetails__c> InsList = new List<Consumable_orderdetails__c>(); |
| | | for (orderBean header : codPageRecords) { |
| | | if (header.check == true) { |