| | |
| | | update consumableOrderlist; |
| | | } |
| | | } |
| | | |
| | | //Back up by DTT - Li Jun 2023-06-14 Start for reduce soql times |
| | | // 2018年8月9日 HWAG-B3D9UV 获取所有的record ID start by 张玉山 |
| | | List<RecordType> allrtList = [select Id,DeveloperName from RecordType where SobjectType = 'Consumable_orderdetails__c']; |
| | | //List<RecordType> allrtList = [select Id,DeveloperName from RecordType where SobjectType = 'Consumable_orderdetails__c']; |
| | | // 2018年8月9日 HWAG-B3D9UV 获取所有的record ID end by 张玉山 |
| | | //Back up by DTT - Li Jun 2023-06-14 Start |
| | | //到货和返品时,生成或修改消费品订货明细 |
| | | Set<String> arrivedSet = new Set<String>(); |
| | | Set<String> returnSet = new Set<String>(); |
| | |
| | | String key = '' + ar.get('Consumable_Arrived_order__c') + ar.get('Asset_Model_No__c'); |
| | | keyCount.put(key, Integer.valueOf(ar.get('recordCount'))); |
| | | } |
| | | // 2018年8月9日 HWAG-B3D9UV 替代下面SQL select start by 张玉山 |
| | | List<RecordType> rtList = new List<RecordType>(); |
| | | for(RecordType rtl : allrtList){ |
| | | if('Detail1_Arrival'.equals(rtl.DeveloperName)){ |
| | | rtList.add(rtl); |
| | | } |
| | | } |
| | | //Back up by DTT - Li Jun 2023-06-14 Start |
| | | // 2018年8月9日 HWAG-B3D9UV 替代下面SQL select start by 张玉山 |
| | | // List<RecordType> rtList = new List<RecordType>(); |
| | | // for(RecordType rtl : allrtList){ |
| | | // if('Detail1_Arrival'.equals(rtl.DeveloperName)){ |
| | | // rtList.add(rtl); |
| | | // } |
| | | // } |
| | | // 2018年8月9日 HWAG-B3D9UV 替代下面SQL select end by 张玉山 |
| | | //Back up by DTT - Li Jun 2023-06-14 End |
| | | |
| | | /* 2018年8月9日 HWAG-B3D9UV 原获取 recordtype start by 张玉山 |
| | | List<RecordType> rtList = [select Id from RecordType where DeveloperName = 'Detail1_Arrival' and SobjectType = 'Consumable_orderdetails__c']; |
| | | 2018年8月9日 HWAG-B3D9UV 原获取 recordtype end by 张玉山 */ |
| | | Id recordTypeId = null; |
| | | if (rtList.size() > 0) recordTypeId = rtList[0].Id; |
| | | |
| | | //Back up by DTT - Li Jun 2023-06-14 Start |
| | | // Id recordTypeId = null; |
| | | // if (rtList.size() > 0) recordTypeId = rtList[0].Id; |
| | | //Back up by DTT - Li Jun 2023-06-14 End |
| | | Id recordtypeId = Schema.SObjectType.Consumable_Orderdetails__c.getRecordTypeInfosByDeveloperName().get('Detail1_Arrival').getRecordTypeId(); |
| | | results = [select Consumable_order__c, count(Id) noCount |
| | | from Consumable_orderdetails__c |
| | | where Consumable_order__c in :arrivedSet |
| | |
| | | String key = '' + ar.get('Consumable_Return_order__c') + ar.get('Asset_Model_No__c'); |
| | | keyCount.put(key, Integer.valueOf(ar.get('recordCount'))); |
| | | } |
| | | |
| | | //Back up by DTT - Li Jun 2023-06-14 Start for reduce soql times |
| | | // 2018年8月9日 HWAG-B3D9UV 替代下面SQL select start by 张玉山 |
| | | List<RecordType> rtList = new List<RecordType>(); |
| | | for(RecordType rtl : allrtList){ |
| | | if('Detail1_ReturnGoods'.equals(rtl.DeveloperName)){ |
| | | rtList.add(rtl); |
| | | } |
| | | } |
| | | // List<RecordType> rtList = new List<RecordType>(); |
| | | // for(RecordType rtl : allrtList){ |
| | | // if('Detail1_ReturnGoods'.equals(rtl.DeveloperName)){ |
| | | // rtList.add(rtl); |
| | | // } |
| | | // } |
| | | // 2018年8月9日 HWAG-B3D9UV 替代下面SQL select end by 张玉山 |
| | | |
| | | //Back up by DTT - Li Jun 2023-06-14 End |
| | | /* 2018年8月9日 HWAG-B3D9UV 原获取 recordtype start by 张玉山 |
| | | List<RecordType> rtList = [select Id from RecordType where DeveloperName = 'Detail1_ReturnGoods' and SobjectType = 'Consumable_orderdetails__c']; |
| | | 2018年8月9日 HWAG-B3D9UV 原获取 recordtype end by 张玉山 */ |
| | | |
| | | Id recordTypeId = null; |
| | | if (rtList.size() > 0) recordTypeId = rtList[0].Id; |
| | | Id recordTypeId = Schema.SObjectType.Consumable_Orderdetails__c.getRecordTypeInfosByDeveloperName().get('Detail1_ReturnGoods').getRecordTypeId(); |
| | | //if (rtList.size() > 0) recordTypeId = rtList[0].Id; |
| | | |
| | | results = [select Consumable_order__c, count(Id) noCount |
| | | from Consumable_orderdetails__c |