| | |
| | | public without sharing class LexConsumableGoodsInfo { |
| | | |
| | | //所有产品一览 |
| | | @AuraEnabled |
| | | public static Results initTotalNum(String ordId, String type) { |
| | |
| | | try { |
| | | if (!(orderId.size() > 0)) { |
| | | String userId = UserInfo.getUserId(); |
| | | List<User> userList = [ |
| | | SELECT accountid, Work_Location__c, UserPro_Type__c |
| | | List<User> userList = [SELECT accountid, Work_Location__c,UserPro_Type__c |
| | | FROM user |
| | | WHERE id = :userId |
| | | ]; |
| | | WHERE id = :userId ]; |
| | | String accountid = userList[0].accountid; |
| | | String userPro_Type = userList[0].UserPro_Type__c; |
| | | String userWorklocation = userList[0].Work_Location__c; |
| | |
| | | List<Consumable_order__c> conorderlist = new List<Consumable_order__c>(); |
| | | //20200916 ljh update start |
| | | if (type != null && type.equals('all')) { |
| | | conorderlist = [ |
| | | SELECT id, Owner.Name |
| | | FROM Consumable_order__c |
| | | WHERE |
| | | Order_type__c = '订单' |
| | | AND recordtypeid = :rtTypeDelivery |
| | | AND Dealer_Info__c = :accountid |
| | | AND (OrderNumber_notarrive__c > 0 |
| | | OR Delivery_detail_count__c > 0) |
| | | AND Order_ProType__c = :userPro_Type |
| | | AND Order_Owner_WorkLocal__c = :userWorklocation |
| | | AND showFalseNotshowTrue__c = FALSE |
| | | ]; |
| | | conorderlist = [select id,Owner.Name from Consumable_order__c where Order_type__c = '订单' and recordtypeid = :rtTypeDelivery and Dealer_Info__c = :accountid and (OrderNumber_notarrive__c > 0 or Delivery_detail_count__c >0) and Order_ProType__c = :userPro_Type and Order_Owner_WorkLocal__c = :userWorklocation and showFalseNotshowTrue__c = false]; |
| | | } else { |
| | | conorderlist = [ |
| | | SELECT id, Owner.Name |
| | | FROM Consumable_order__c |
| | | WHERE |
| | | Order_type__c = '订单' |
| | | AND recordtypeid = :rtTypeDelivery |
| | | AND Dealer_Info__c = :accountid |
| | | AND Delivery_detail_count__c > 0 |
| | | AND Order_ProType__c = :userPro_Type |
| | | AND Order_Owner_WorkLocal__c = :userWorklocation |
| | | AND showFalseNotshowTrue__c = FALSE |
| | | ]; |
| | | conorderlist = [select id,Owner.Name from Consumable_order__c where Order_type__c = '订单' and recordtypeid = :rtTypeDelivery and Dealer_Info__c = :accountid and Delivery_detail_count__c >0 and Order_ProType__c = :userPro_Type and Order_Owner_WorkLocal__c = :userWorklocation and showFalseNotshowTrue__c = false]; |
| | | } |
| | | for (Consumable_order__c conorder : conorderlist) { |
| | | String temp = (String) conorder.Id; |
| | |
| | | } |
| | | List<Consumable_Orderdetails__c> conOrderList1 = new List<Consumable_Orderdetails__c>(); |
| | | |
| | | conOrderList1 = [ |
| | | SELECT Asset_Model_No__c, Consumable_count__c |
| | | FROM Consumable_Orderdetails__c |
| | | WHERE Consumable_order__c = :orderId |
| | | ]; |
| | | conOrderList1 = [SELECT Asset_Model_No__c ,Consumable_count__c FROM Consumable_Orderdetails__c WHERE Consumable_order__c =:orderId]; |
| | | |
| | | Map<String, Decimal> allConOrderMap = new Map<String, Decimal>(); |
| | | for (Consumable_Orderdetails__c con : conOrderList1) { |
| | |
| | | Results results = new Results(); |
| | | List<ShowRecords> arrDetIifo = new List<ShowRecords>(); |
| | | try { |
| | | List<Consumable_order_details2__c> conList = [ |
| | | SELECT id, Bar_Code__c |
| | | FROM Consumable_order_details2__c |
| | | WHERE Dealer_Arrive__c = TRUE AND Consumable_order_minor__c = :orderId |
| | | ]; |
| | | List<Consumable_order_details2__c> conList = [SELECT id,Bar_Code__c FROM Consumable_order_details2__c WHERE Dealer_Arrive__c = true AND Consumable_order_minor__c = :orderId]; |
| | | Map<String, String> srtMap = new Map<String, String>(); |
| | | for (Consumable_order_details2__c con : conList) { |
| | | srtMap.put(con.Bar_Code__c, con.Id); |
| | |
| | | for (String s : srtMap.keySet()) { |
| | | str.add(srtMap.get(s)); |
| | | } |
| | | List<AggregateResult> arrDetList = [ |
| | | SELECT Asset_Model_No__c prodModel, count(Id) recordCount |
| | | FROM Consumable_order_details2__c |
| | | List<AggregateResult> arrDetList = [SELECT Asset_Model_No__c prodModel,count(Id) recordCount FROM Consumable_order_details2__c |
| | | WHERE Id = :str |
| | | GROUP BY Asset_Model_No__c |
| | | ]; |
| | | GROUP BY Asset_Model_No__c]; |
| | | for (Integer i = 0; i < arrDetList.size(); i++) { |
| | | arrDetIifo.add(new showRecords(arrDetList[i])); |
| | | } |
| | |
| | | List<ShowRecords> allArrDetIifo = new List<ShowRecords>(); |
| | | try { |
| | | String userId = UserInfo.getUserId(); |
| | | List<User> userList = [ |
| | | SELECT accountid, Work_Location__c, UserPro_Type__c |
| | | List<User> userList = [SELECT accountid, Work_Location__c,UserPro_Type__c |
| | | FROM user |
| | | WHERE id = :userId |
| | | ]; |
| | | WHERE id = :userId ]; |
| | | String accountid = userList[0].accountid; |
| | | String userPro_Type = userList[0].UserPro_Type__c; |
| | | String userWorklocation = userList[0].Work_Location__c; |
| | |
| | | //20200916 ljh update start |
| | | //conorderlist = [select id,name,Owner.Name from Consumable_order__c where Order_type__c = '订单' and recordtypeid = :rtTypeDelivery and Dealer_Info__c = :accountid and Delivery_detail_count__c >0 and Order_ProType__c = :userPro_Type and Order_Owner_WorkLocal__c = :userWorklocation]; |
| | | if (type != null && type.equals('all')) { |
| | | conorderlist = [ |
| | | SELECT id, Owner.Name |
| | | FROM Consumable_order__c |
| | | WHERE |
| | | Order_type__c = '订单' |
| | | AND recordtypeid = :rtTypeDelivery |
| | | AND Dealer_Info__c = :accountid |
| | | AND (OrderNumber_notarrive__c > 0 |
| | | OR Delivery_detail_count__c > 0) |
| | | AND Order_ProType__c = :userPro_Type |
| | | AND Order_Owner_WorkLocal__c = :userWorklocation |
| | | AND showFalseNotshowTrue__c = FALSE |
| | | ]; |
| | | conorderlist = [select id,Owner.Name from Consumable_order__c where Order_type__c = '订单' and recordtypeid = :rtTypeDelivery and Dealer_Info__c = :accountid and (OrderNumber_notarrive__c > 0 or Delivery_detail_count__c >0) and Order_ProType__c = :userPro_Type and Order_Owner_WorkLocal__c = :userWorklocation and showFalseNotshowTrue__c = false]; |
| | | } else { |
| | | conorderlist = [ |
| | | SELECT id, Owner.Name |
| | | FROM Consumable_order__c |
| | | WHERE |
| | | Order_type__c = '订单' |
| | | AND recordtypeid = :rtTypeDelivery |
| | | AND Dealer_Info__c = :accountid |
| | | AND Delivery_detail_count__c > 0 |
| | | AND Order_ProType__c = :userPro_Type |
| | | AND Order_Owner_WorkLocal__c = :userWorklocation |
| | | AND showFalseNotshowTrue__c = FALSE |
| | | ]; |
| | | conorderlist = [select id,Owner.Name from Consumable_order__c where Order_type__c = '订单' and recordtypeid = :rtTypeDelivery and Dealer_Info__c = :accountid and Delivery_detail_count__c >0 and Order_ProType__c = :userPro_Type and Order_Owner_WorkLocal__c = :userWorklocation and showFalseNotshowTrue__c = false]; |
| | | } |
| | | //20200916 ljh update end |
| | | // List<Consumable_order__c> conorderlist = [select id,Owner.Name from Consumable_order__c where Order_type__c = '订单' and recordtypeid = :rtTypeDelivery and Dealer_Info__c = :accountid and Delivery_detail_count__c > 0 and Order_ProType__c = :userPro_Type and Order_Owner_WorkLocal__c = :userWorklocation]; |
| | |
| | | //20200916 ljh update start |
| | | //conList = [SELECT id,Bar_Code__c FROM Consumable_order_details2__c WHERE Dealer_Arrive__c = true AND Consumable_order_minor__c = :orderId AND Deliver_date__c < :orderdate AND recordtypeid = :System.Label.RT_ConOrderDetail2_Delivery]; |
| | | if (type != null && type.equals('all')) { |
| | | conList = [ |
| | | SELECT id, Bar_Code__c |
| | | FROM Consumable_order_details2__c |
| | | WHERE |
| | | Dealer_Arrive__c = TRUE |
| | | AND Consumable_order_minor__c = :orderId |
| | | AND recordtypeid = :System.Label.RT_ConOrderDetail2_Delivery |
| | | ]; |
| | | conList = [SELECT id,Bar_Code__c FROM Consumable_order_details2__c WHERE Dealer_Arrive__c = true AND Consumable_order_minor__c = :orderId AND recordtypeid = :System.Label.RT_ConOrderDetail2_Delivery]; |
| | | } else { |
| | | conList = [ |
| | | SELECT id, Bar_Code__c |
| | | FROM Consumable_order_details2__c |
| | | WHERE |
| | | Dealer_Arrive__c = TRUE |
| | | AND Consumable_order_minor__c = :orderId |
| | | AND Deliver_date__c < :orderdate |
| | | AND recordtypeid = :System.Label.RT_ConOrderDetail2_Delivery |
| | | ]; |
| | | conList = [SELECT id,Bar_Code__c FROM Consumable_order_details2__c WHERE Dealer_Arrive__c = true AND Consumable_order_minor__c = :orderId AND Deliver_date__c < :orderdate AND recordtypeid = :System.Label.RT_ConOrderDetail2_Delivery]; |
| | | } |
| | | //20200916 ljh update end |
| | | // List<Consumable_order_details2__c> conList = [SELECT id,Bar_Code__c FROM Consumable_order_details2__c WHERE Dealer_Arrive__c = false AND Consumable_order_minor__c = :orderId AND Deliver_date__c < :orderdate AND recordtypeid = :System.Label.RT_ConOrderDetail2_Delivery]; |
| | |
| | | for (String s : srtMap.keySet()) { |
| | | str.add(srtMap.get(s)); |
| | | } |
| | | List<AggregateResult> arrDetList = [ |
| | | SELECT Asset_Model_No__c prodModel, count(Id) recordCount |
| | | FROM Consumable_order_details2__c |
| | | List<AggregateResult> arrDetList = [SELECT Asset_Model_No__c prodModel,count(Id) recordCount FROM Consumable_order_details2__c |
| | | WHERE Id = :str |
| | | GROUP BY Asset_Model_No__c |
| | | ]; |
| | | GROUP BY Asset_Model_No__c]; |
| | | // List<showRecords> allArrDetIifo = new List<showRecords>(); |
| | | for (Integer i = 0; i < arrDetList.size(); i++) { |
| | | allArrDetIifo.add(new showRecords(arrDetList[i])); |
| | |
| | | Results results = new Results(); |
| | | List<ShowRecords> notArrDetIifo = new List<ShowRecords>(); |
| | | try { |
| | | List<AggregateResult> notArrDetList = [ |
| | | SELECT Asset_Model_No__c prodModel, count(Id) recordCount |
| | | FROM Consumable_order_details2__c |
| | | WHERE Dealer_Arrive__c = FALSE AND Consumable_order_minor__c = :orderId |
| | | GROUP BY Asset_Model_No__c |
| | | ]; |
| | | List<AggregateResult> notArrDetList = [SELECT Asset_Model_No__c prodModel,count(Id) recordCount FROM Consumable_order_details2__c |
| | | WHERE Dealer_Arrive__c = false |
| | | AND Consumable_order_minor__c = :orderId |
| | | GROUP BY Asset_Model_No__c]; |
| | | for (Integer i = 0; i < notArrDetList.size(); i++) { |
| | | notArrDetIifo.add(new showRecords(notArrDetList[i])); |
| | | } |
| | |
| | | List<ShowRecords> allNotArrDetIifo = new List<ShowRecords>(); |
| | | try { |
| | | String userId = UserInfo.getUserId(); |
| | | List<User> userList = [ |
| | | SELECT accountid, Work_Location__c, UserPro_Type__c |
| | | List<User> userList = [SELECT accountid, Work_Location__c,UserPro_Type__c |
| | | FROM user |
| | | WHERE id = :userId |
| | | ]; |
| | | WHERE id = :userId ]; |
| | | String accountid = userList[0].accountid; |
| | | String userPro_Type = userList[0].UserPro_Type__c; |
| | | String userWorklocation = userList[0].Work_Location__c; |
| | |
| | | //20200916 ljh update start |
| | | //conorderlist = [select id,name,Owner.Name from Consumable_order__c where Order_type__c = '订单' and recordtypeid = :rtTypeDelivery and Dealer_Info__c = :accountid and Delivery_detail_count__c >0 and Order_ProType__c = :userPro_Type and Order_Owner_WorkLocal__c = :userWorklocation]; |
| | | if (type != null && type.equals('all')) { |
| | | conorderlist = [ |
| | | SELECT id, Owner.Name |
| | | FROM Consumable_order__c |
| | | WHERE |
| | | Order_type__c = '订单' |
| | | AND recordtypeid = :rtTypeDelivery |
| | | AND Dealer_Info__c = :accountid |
| | | AND (OrderNumber_notarrive__c > 0 |
| | | OR Delivery_detail_count__c > 0) |
| | | AND Order_ProType__c = :userPro_Type |
| | | AND Order_Owner_WorkLocal__c = :userWorklocation |
| | | AND showFalseNotshowTrue__c = FALSE |
| | | ]; |
| | | conorderlist = [select id,Owner.Name from Consumable_order__c where Order_type__c = '订单' and recordtypeid = :rtTypeDelivery and Dealer_Info__c = :accountid and (OrderNumber_notarrive__c > 0 or Delivery_detail_count__c >0) and Order_ProType__c = :userPro_Type and Order_Owner_WorkLocal__c = :userWorklocation and showFalseNotshowTrue__c = false]; |
| | | } else { |
| | | conorderlist = [ |
| | | SELECT id, Owner.Name |
| | | FROM Consumable_order__c |
| | | WHERE |
| | | Order_type__c = '订单' |
| | | AND recordtypeid = :rtTypeDelivery |
| | | AND Dealer_Info__c = :accountid |
| | | AND Delivery_detail_count__c > 0 |
| | | AND Order_ProType__c = :userPro_Type |
| | | AND Order_Owner_WorkLocal__c = :userWorklocation |
| | | AND showFalseNotshowTrue__c = FALSE |
| | | ]; |
| | | conorderlist = [select id,Owner.Name from Consumable_order__c where Order_type__c = '订单' and recordtypeid = :rtTypeDelivery and Dealer_Info__c = :accountid and Delivery_detail_count__c >0 and Order_ProType__c = :userPro_Type and Order_Owner_WorkLocal__c = :userWorklocation and showFalseNotshowTrue__c = false]; |
| | | } |
| | | //20200916 ljh update end |
| | | // List<Consumable_order__c> conorderlist = [select id,Owner.Name from Consumable_order__c where Order_type__c = '订单' and recordtypeid = :rtTypeDelivery and Dealer_Info__c = :accountid and Delivery_detail_count__c > 0 and Order_ProType__c = :userPro_Type and Order_Owner_WorkLocal__c = :userWorklocation]; |
| | |
| | | //20200916 ljh update start |
| | | //conList = [SELECT id,Bar_Code__c FROM Consumable_order_details2__c WHERE Dealer_Arrive__c = false AND Consumable_order_minor__c = :orderId AND Deliver_date__c < :orderdate AND recordtypeid = :System.Label.RT_ConOrderDetail2_Delivery]; |
| | | if (type != null && type.equals('all')) { |
| | | conList = [ |
| | | SELECT id, Bar_Code__c |
| | | FROM Consumable_order_details2__c |
| | | WHERE |
| | | Dealer_Arrive__c = FALSE |
| | | AND Consumable_order_minor__c = :orderId |
| | | AND recordtypeid = :System.Label.RT_ConOrderDetail2_Delivery |
| | | ]; |
| | | conList = [SELECT id,Bar_Code__c FROM Consumable_order_details2__c WHERE Dealer_Arrive__c = false AND Consumable_order_minor__c = :orderId AND recordtypeid = :System.Label.RT_ConOrderDetail2_Delivery]; |
| | | } else { |
| | | conList = [ |
| | | SELECT id, Bar_Code__c |
| | | FROM Consumable_order_details2__c |
| | | WHERE |
| | | Dealer_Arrive__c = FALSE |
| | | AND Consumable_order_minor__c = :orderId |
| | | AND Deliver_date__c < :orderdate |
| | | AND recordtypeid = :System.Label.RT_ConOrderDetail2_Delivery |
| | | ]; |
| | | conList = [SELECT id,Bar_Code__c FROM Consumable_order_details2__c WHERE Dealer_Arrive__c = false AND Consumable_order_minor__c = :orderId AND Deliver_date__c < :orderdate AND recordtypeid = :System.Label.RT_ConOrderDetail2_Delivery]; |
| | | } |
| | | //20200916 ljh update end |
| | | // List<Consumable_order_details2__c> conList = [SELECT id,Bar_Code__c FROM Consumable_order_details2__c WHERE Dealer_Arrive__c = false AND Consumable_order_minor__c = :orderId AND Deliver_date__c < :orderdate AND recordtypeid = :System.Label.RT_ConOrderDetail2_Delivery]; |
| | |
| | | for (String s : srtMap.keySet()) { |
| | | str.add(srtMap.get(s)); |
| | | } |
| | | List<AggregateResult> arrDetList = [ |
| | | SELECT Asset_Model_No__c prodModel, count(Id) recordCount |
| | | FROM Consumable_order_details2__c |
| | | WHERE Id = :str AND Cancellation_Flag__c = FALSE |
| | | GROUP BY Asset_Model_No__c |
| | | ]; |
| | | List<AggregateResult> arrDetList = [SELECT Asset_Model_No__c prodModel,count(Id) recordCount FROM Consumable_order_details2__c |
| | | WHERE Id =: str and Cancellation_Flag__c = false |
| | | GROUP BY Asset_Model_No__c]; |
| | | // List<showRecords> allArrDetIifo = new List<showRecords>(); |
| | | for (Integer i = 0; i < arrDetList.size(); i++) { |
| | | allNotArrDetIifo.add(new showRecords(arrDetList[i])); |
| | |
| | | List<showRecords> notArrDetIifo = new List<showRecords>(); |
| | | List<showRecords> allArrDetIifo = new List<showRecords>(); |
| | | // List<Consumable_order_details2__c> conList = [SELECT id,Bar_Code__c FROM Consumable_order_details2__c WHERE Dealer_Arrive__c = true AND Consumable_order_minor__c = :orderId]; |
| | | List<Consumable_order_details2__c> conList = [ |
| | | SELECT id, Bar_Code__c |
| | | FROM Consumable_order_details2__c |
| | | WHERE Consumable_order_minor__c = :orderId |
| | | ]; |
| | | List<Consumable_order_details2__c> conList = [SELECT id,Bar_Code__c FROM Consumable_order_details2__c WHERE Consumable_order_minor__c = :orderId]; |
| | | Map<String, String> srtMap = new Map<String, String>(); |
| | | for (Consumable_order_details2__c con : conList) { |
| | | srtMap.put(con.Bar_Code__c, con.Id); |
| | |
| | | for (String s : srtMap.keySet()) { |
| | | str.add(srtMap.get(s)); |
| | | } |
| | | List<AggregateResult> arrDetList = [ |
| | | SELECT Asset_Model_No__c prodModel, count(Id) recordCount |
| | | FROM Consumable_order_details2__c |
| | | WHERE Id = :str AND Dealer_Arrive__c = TRUE |
| | | GROUP BY Asset_Model_No__c |
| | | ]; |
| | | List<AggregateResult> arrDetList = [SELECT Asset_Model_No__c prodModel,count(Id) recordCount FROM Consumable_order_details2__c |
| | | WHERE Id =: str AND Dealer_Arrive__c = true |
| | | GROUP BY Asset_Model_No__c]; |
| | | for (Integer i = 0; i < arrDetList.size(); i++) { |
| | | arrDetIifo.add(new showRecords(arrDetList[i])); |
| | | } |
| | | |
| | | List<AggregateResult> notArrDetList = [ |
| | | SELECT Asset_Model_No__c prodModel, count(Id) recordCount |
| | | FROM Consumable_order_details2__c |
| | | WHERE Dealer_Arrive__c = FALSE AND Consumable_order_minor__c = :orderId |
| | | GROUP BY Asset_Model_No__c |
| | | ]; |
| | | List<AggregateResult> notArrDetList = [SELECT Asset_Model_No__c prodModel,count(Id) recordCount FROM Consumable_order_details2__c |
| | | WHERE Dealer_Arrive__c = false |
| | | AND Consumable_order_minor__c = :orderId |
| | | GROUP BY Asset_Model_No__c]; |
| | | for (Integer i = 0; i < notArrDetList.size(); i++) { |
| | | notArrDetIifo.add(new showRecords(notArrDetList[i])); |
| | | } |
| | |
| | | // List<AggregateResult> allArrDetList = [SELECT Asset_Model_No__c prodModel,count(Id) recordCount FROM Consumable_order_details2__c |
| | | // WHERE Id =: str |
| | | // GROUP BY Asset_Model_No__c]; |
| | | List<Consumable_Orderdetails__c> allArrDetList = [ |
| | | SELECT Asset_Model_No__c, Consumable_count__c |
| | | FROM Consumable_Orderdetails__c |
| | | WHERE Consumable_order__c = :orderId |
| | | ]; |
| | | List<Consumable_Orderdetails__c> allArrDetList = [SELECT Asset_Model_No__c,Consumable_count__c FROM Consumable_Orderdetails__c |
| | | WHERE Consumable_order__c =: orderId]; |
| | | // for(Integer i = 0 ; i< allArrDetList.size();i++){ |
| | | // allArrDetIifo.add(new showRecords(notArrDetList[i])); |
| | | // } |
| | |
| | | List<ShowRecords> allOtherDetIifo = new List<ShowRecords>(); |
| | | try { |
| | | String userId = UserInfo.getUserId(); |
| | | List<User> userList = [ |
| | | SELECT accountid, Work_Location__c, UserPro_Type__c |
| | | List<User> userList = [SELECT accountid, Work_Location__c,UserPro_Type__c |
| | | FROM user |
| | | WHERE id = :userId |
| | | ]; |
| | | WHERE id = :userId ]; |
| | | String accountid = userList[0].accountid; |
| | | String userPro_Type = userList[0].UserPro_Type__c; |
| | | String userWorklocation = userList[0].Work_Location__c; |
| | |
| | | //20200916 ljh update start |
| | | //conorderlist = [select id,name,Owner.Name from Consumable_order__c where Order_type__c = '订单' and recordtypeid = :rtTypeDelivery and Dealer_Info__c = :accountid and Delivery_detail_count__c >0 and Order_ProType__c = :userPro_Type and Order_Owner_WorkLocal__c = :userWorklocation]; |
| | | if (type != null && type.equals('all')) { |
| | | conorderlist = [ |
| | | SELECT id, Owner.Name |
| | | FROM Consumable_order__c |
| | | WHERE |
| | | Order_type__c = '订单' |
| | | AND recordtypeid = :rtTypeDelivery |
| | | AND Dealer_Info__c = :accountid |
| | | AND (OrderNumber_notarrive__c > 0 |
| | | OR Delivery_detail_count__c > 0) |
| | | AND Order_ProType__c = :userPro_Type |
| | | AND Order_Owner_WorkLocal__c = :userWorklocation |
| | | AND showFalseNotshowTrue__c = FALSE |
| | | ]; |
| | | conorderlist = [select id,Owner.Name from Consumable_order__c where Order_type__c = '订单' and recordtypeid = :rtTypeDelivery and Dealer_Info__c = :accountid and (OrderNumber_notarrive__c > 0 or Delivery_detail_count__c >0) and Order_ProType__c = :userPro_Type and Order_Owner_WorkLocal__c = :userWorklocation and showFalseNotshowTrue__c = false]; |
| | | } else { |
| | | conorderlist = [ |
| | | SELECT id, Owner.Name |
| | | FROM Consumable_order__c |
| | | WHERE |
| | | Order_type__c = '订单' |
| | | AND recordtypeid = :rtTypeDelivery |
| | | AND Dealer_Info__c = :accountid |
| | | AND Delivery_detail_count__c > 0 |
| | | AND Order_ProType__c = :userPro_Type |
| | | AND Order_Owner_WorkLocal__c = :userWorklocation |
| | | AND showFalseNotshowTrue__c = FALSE |
| | | ]; |
| | | conorderlist = [select id,Owner.Name from Consumable_order__c where Order_type__c = '订单' and recordtypeid = :rtTypeDelivery and Dealer_Info__c = :accountid and Delivery_detail_count__c >0 and Order_ProType__c = :userPro_Type and Order_Owner_WorkLocal__c = :userWorklocation and showFalseNotshowTrue__c = false]; |
| | | } |
| | | //20200916 ljh update end |
| | | // List<Consumable_order__c> conorderlist = [select id,Owner.Name from Consumable_order__c where Order_type__c = '订单' and recordtypeid = :rtTypeDelivery and Dealer_Info__c = :accountid and Delivery_detail_count__c > 0 and Order_ProType__c = :userPro_Type and Order_Owner_WorkLocal__c = :userWorklocation]; |
| | |
| | | //20200916 ljh update start |
| | | //conList = [SELECT id,Bar_Code__c FROM Consumable_order_details2__c WHERE Consumable_order_minor__c = :orderId AND Deliver_date__c < :orderdate AND recordtypeid = :System.Label.RT_ConOrderDetail2_Delivery]; |
| | | if (type != null && type.equals('all')) { |
| | | conList = [ |
| | | SELECT id, Bar_Code__c |
| | | FROM Consumable_order_details2__c |
| | | WHERE Consumable_order_minor__c = :orderId AND recordtypeid = :System.Label.RT_ConOrderDetail2_Delivery |
| | | ]; |
| | | conList = [SELECT id,Bar_Code__c FROM Consumable_order_details2__c WHERE Consumable_order_minor__c = :orderId AND recordtypeid = :System.Label.RT_ConOrderDetail2_Delivery]; |
| | | } else { |
| | | conList = [ |
| | | SELECT id, Bar_Code__c |
| | | FROM Consumable_order_details2__c |
| | | WHERE |
| | | Consumable_order_minor__c = :orderId |
| | | AND Deliver_date__c < :orderdate |
| | | AND recordtypeid = :System.Label.RT_ConOrderDetail2_Delivery |
| | | ]; |
| | | conList = [SELECT id,Bar_Code__c FROM Consumable_order_details2__c WHERE Consumable_order_minor__c = :orderId AND Deliver_date__c < :orderdate AND recordtypeid = :System.Label.RT_ConOrderDetail2_Delivery]; |
| | | } |
| | | //20200916 ljh update end |
| | | // List<Consumable_order_details2__c> conList = [SELECT id,Bar_Code__c FROM Consumable_order_details2__c WHERE Consumable_order_minor__c = :orderId AND Deliver_date__c < :orderdate AND recordtypeid = :System.Label.RT_ConOrderDetail2_Delivery]; |
| | |
| | | for (String s : srtMap.keySet()) { |
| | | str.add(srtMap.get(s)); |
| | | } |
| | | List<AggregateResult> arrDetList = [ |
| | | SELECT Asset_Model_No__c prodModel, count(Id) recordCount |
| | | FROM Consumable_order_details2__c |
| | | WHERE Id = :str AND Cancellation_Flag__c = FALSE |
| | | GROUP BY Asset_Model_No__c |
| | | ]; |
| | | List<AggregateResult> arrDetList = [SELECT Asset_Model_No__c prodModel,count(Id) recordCount FROM Consumable_order_details2__c |
| | | WHERE Id =: str and Cancellation_Flag__c = false |
| | | GROUP BY Asset_Model_No__c]; |
| | | Map<String, Decimal> conOrderMap = new Map<String, Decimal>(); |
| | | for (AggregateResult agg : arrDetList) { |
| | | conOrderMap.put(String.valueOf(agg.get('prodModel')), Integer.valueOf(agg.get('recordCount'))); |
| | | } |
| | | |
| | | List<Consumable_Orderdetails__c> conOrderList1 = [ |
| | | SELECT Asset_Model_No__c, Consumable_count__c |
| | | FROM Consumable_Orderdetails__c |
| | | WHERE Consumable_order__c = :orderId |
| | | ]; |
| | | List<Consumable_Orderdetails__c> conOrderList1 = [SELECT Asset_Model_No__c ,Consumable_count__c FROM Consumable_Orderdetails__c WHERE Consumable_order__c =: orderId ]; |
| | | Map<String, Decimal> allConOrderMap = new Map<String, Decimal>(); |
| | | for (Consumable_Orderdetails__c con : conOrderList1) { |
| | | if (con.Consumable_count__c == null) { |
| | |
| | | Results results = new Results(); |
| | | List<ShowRecords> morethansevendaysIifo = new List<ShowRecords>(); |
| | | try { |
| | | List<AggregateResult> morethan7daysList = [ |
| | | SELECT Asset_Model_No__c prodModel, count(Id) recordCount |
| | | FROM Consumable_order_details2__c |
| | | WHERE |
| | | Consumable_order_minor__c != NULL |
| | | AND Dealer_Shipment__c = FALSE |
| | | AND Dealer_Arrive__c = FALSE |
| | | AND Dealer_Saled__c = FALSE |
| | | AND Consumable_order_minor__r.showFalseNotshowTrue__c = FALSE |
| | | List<AggregateResult> morethan7daysList = [SELECT Asset_Model_No__c prodModel,count(Id) recordCount FROM Consumable_order_details2__c |
| | | WHERE Consumable_order_minor__c != null |
| | | AND Dealer_Shipment__c = false |
| | | AND Dealer_Arrive__c = false |
| | | AND Dealer_Saled__c = false |
| | | AND Consumable_order_minor__r.showFalseNotshowTrue__c = false |
| | | AND Deliver_date__c < LAST_N_DAYS:7 |
| | | AND Consumable_order_minor__c = :orderId |
| | | GROUP BY Asset_Model_No__c |
| | | ]; |
| | | GROUP BY Asset_Model_No__c]; |
| | | |
| | | for (Integer i = 0; i < morethan7daysList.size(); i++) { |
| | | morethansevendaysIifo.add(new showRecords(morethan7daysList[i])); |
| | |
| | | List<ShowRecords> morethansevendaysIifo = new List<ShowRecords>(); |
| | | try { |
| | | String userId = UserInfo.getUserId(); |
| | | List<User> userList = [ |
| | | SELECT accountid, Work_Location__c, UserPro_Type__c |
| | | List<User> userList = [SELECT accountid, Work_Location__c,UserPro_Type__c |
| | | FROM user |
| | | WHERE id = :userId |
| | | ]; |
| | | WHERE id = :userId ]; |
| | | String accountid = userList[0].accountid; |
| | | String userPro_Type = userList[0].UserPro_Type__c; |
| | | String userWorklocation = userList[0].Work_Location__c; |
| | |
| | | //20200916 ljh update start |
| | | //conorderlist = [select id,name,Owner.Name from Consumable_order__c where Order_type__c = '订单' and recordtypeid = :rtTypeDelivery and Dealer_Info__c = :accountid and Delivery_detail_count__c >0 and Order_ProType__c = :userPro_Type and Order_Owner_WorkLocal__c = :userWorklocation]; |
| | | if (type != null && type.equals('all')) { |
| | | conorderlist = [ |
| | | SELECT id, Owner.Name |
| | | FROM Consumable_order__c |
| | | WHERE |
| | | Order_type__c = '订单' |
| | | AND recordtypeid = :rtTypeDelivery |
| | | AND Dealer_Info__c = :accountid |
| | | AND (OrderNumber_notarrive__c > 0 |
| | | OR Delivery_detail_count__c > 0) |
| | | AND Order_ProType__c = :userPro_Type |
| | | AND Order_Owner_WorkLocal__c = :userWorklocation |
| | | AND showFalseNotshowTrue__c = FALSE |
| | | ]; |
| | | conorderlist = [select id,Owner.Name from Consumable_order__c where Order_type__c = '订单' and recordtypeid = :rtTypeDelivery and Dealer_Info__c = :accountid and (OrderNumber_notarrive__c > 0 or Delivery_detail_count__c >0) and Order_ProType__c = :userPro_Type and Order_Owner_WorkLocal__c = :userWorklocation and showFalseNotshowTrue__c = false]; |
| | | } else { |
| | | conorderlist = [ |
| | | SELECT id, Owner.Name |
| | | FROM Consumable_order__c |
| | | WHERE |
| | | Order_type__c = '订单' |
| | | AND recordtypeid = :rtTypeDelivery |
| | | AND Dealer_Info__c = :accountid |
| | | AND Delivery_detail_count__c > 0 |
| | | AND Order_ProType__c = :userPro_Type |
| | | AND Order_Owner_WorkLocal__c = :userWorklocation |
| | | AND showFalseNotshowTrue__c = FALSE |
| | | ]; |
| | | conorderlist = [select id,Owner.Name from Consumable_order__c where Order_type__c = '订单' and recordtypeid = :rtTypeDelivery and Dealer_Info__c = :accountid and Delivery_detail_count__c >0 and Order_ProType__c = :userPro_Type and Order_Owner_WorkLocal__c = :userWorklocation and showFalseNotshowTrue__c = false]; |
| | | } |
| | | system.debug('==============>conorderlist' + conorderlist); |
| | | system.debug('==============>conorderlist' + conorderlist.size()); |
| | |
| | | //conList = [SELECT id,Bar_Code__c FROM Consumable_order_details2__c WHERE Dealer_Arrive__c = false AND Consumable_order_minor__c = :orderId AND Deliver_date__c < :orderdate AND recordtypeid = :System.Label.RT_ConOrderDetail2_Delivery]; |
| | | if (type != null && type.equals('all')) { |
| | | system.debug('all============'); |
| | | conList = [ |
| | | SELECT id, Bar_Code__c |
| | | FROM Consumable_order_details2__c |
| | | WHERE |
| | | Dealer_Arrive__c = FALSE |
| | | AND Consumable_order_minor__c = :orderId |
| | | AND recordtypeid = :System.Label.RT_ConOrderDetail2_Delivery |
| | | ]; |
| | | conList = [SELECT id,Bar_Code__c FROM Consumable_order_details2__c WHERE Dealer_Arrive__c = false AND Consumable_order_minor__c = :orderId AND recordtypeid = :System.Label.RT_ConOrderDetail2_Delivery]; |
| | | system.debug('allconList===========' + conList.size()); |
| | | } else { |
| | | system.debug('notall============='); |
| | | conList = [ |
| | | SELECT id, Bar_Code__c |
| | | FROM Consumable_order_details2__c |
| | | WHERE |
| | | Dealer_Arrive__c = FALSE |
| | | AND Consumable_order_minor__c = :orderId |
| | | AND Deliver_date__c < :orderdate |
| | | AND recordtypeid = :System.Label.RT_ConOrderDetail2_Delivery |
| | | ]; |
| | | conList = [SELECT id,Bar_Code__c FROM Consumable_order_details2__c WHERE Dealer_Arrive__c = false AND Consumable_order_minor__c = :orderId AND Deliver_date__c < :orderdate AND recordtypeid = :System.Label.RT_ConOrderDetail2_Delivery]; |
| | | system.debug('notallconList===========' + conList.size()); |
| | | } |
| | | //20200916 ljh update end |
| | |
| | | for (String s : srtMap.keySet()) { |
| | | str.add(srtMap.get(s)); |
| | | } |
| | | List<AggregateResult> morethan7daysList = [ |
| | | SELECT Asset_Model_No__c prodModel, count(Id) recordCount |
| | | FROM Consumable_order_details2__c |
| | | WHERE |
| | | Id = :str |
| | | AND Cancellation_Flag__c = FALSE |
| | | AND Consumable_order_minor__c != NULL |
| | | AND Dealer_Shipment__c = FALSE |
| | | AND Dealer_Arrive__c = FALSE |
| | | AND Dealer_Saled__c = FALSE |
| | | AND Consumable_order_minor__r.showFalseNotshowTrue__c = FALSE |
| | | List<AggregateResult> morethan7daysList = [SELECT Asset_Model_No__c prodModel,count(Id) recordCount FROM Consumable_order_details2__c |
| | | WHERE Id =: str and Cancellation_Flag__c = false |
| | | AND Consumable_order_minor__c != null |
| | | AND Dealer_Shipment__c = false |
| | | AND Dealer_Arrive__c = false |
| | | AND Dealer_Saled__c = false |
| | | AND Consumable_order_minor__r.showFalseNotshowTrue__c = false |
| | | AND Deliver_date__c < LAST_N_DAYS:7 |
| | | GROUP BY Asset_Model_No__c |
| | | ]; |
| | | GROUP BY Asset_Model_No__c]; |
| | | system.debug('Morethan7daysList================>' + morethan7daysList.size()); |
| | | for (Integer i = 0; i < morethan7daysList.size(); i++) { |
| | | morethansevendaysIifo.add(new showRecords(morethan7daysList[i])); |
| | |
| | | public List<ShowRecords> recordList; |
| | | } |
| | | |
| | | |
| | | public class ShowRecords implements Comparable { |
| | | @AuraEnabled |
| | | public Decimal recordCount { get; set; } |
| | | @AuraEnabled |
| | | public String prodModel { get; set; } |
| | | |
| | | public ShowRecords() { |
| | | } |
| | | public ShowRecords() {} |
| | | |
| | | public ShowRecords(AggregateResult e) { |
| | | recordCount = Integer.valueOf(e.get('recordCount')); |