public with sharing class lexConsumApplyController {
|
|
@AuraEnabled
|
public static InitData init(String recordId){
|
InitData res = new InitData();
|
try {
|
List<Consum_Apply__c> caList = [SELECT Id, Campaign__c, Campaign__r.Status, Wei_Assigned_Cnt__c, Status__c,
|
Assigned_Not_Shipment__c,Bollow_Date__c,Yi_loaner_arranged__c, AccDealerBlacklist__c
|
FROM Consum_Apply__c WHERE Id = :recordId];
|
if(caList.size()>0){
|
Consum_Apply__c ca = caList[0];
|
if(ca.Campaign__c != null){
|
res.campaignId = ca.Campaign__c;
|
}
|
res.weiAssignedCnt = Integer.valueOf(ca.Wei_Assigned_Cnt__c);
|
res.consumApplyStatus = ca.Status__c;
|
res.campaignStatus = ca.Campaign__r.Status;
|
res.assignedNotShipment = Integer.valueOf(ca.Assigned_Not_Shipment__c);
|
res.bollowDate = ca.Bollow_Date__c;
|
res.yiLoanerArranged = Integer.valueOf(ca.Yi_loaner_arranged__c);
|
res.accDealerBlacklist = ca.AccDealerBlacklist__c;
|
}
|
}
|
catch (Exception e) {
|
System.debug('********lexConsumApplyController*****'+e.getMessage());
|
}
|
return res;
|
}
|
|
@AuraEnabled
|
public static Integer getLength1(String recordId){
|
//AND Shippment_loaner_time__c != null
|
List<Consum_Apply_Equipment_Set__c> caeList = [SELECT Id from Consum_Apply_Equipment_Set__c WHERE Consum_Apply__c =:recordId AND RAES_Status__c != '已分配' AND RAES_Status__c != '取消分配'];
|
return caeList.size();
|
}
|
|
@AuraEnabled
|
public static Integer getLength2(String recordId){
|
List<Consum_Apply_Equipment_Set__c> caeList = [SELECT Id from Consum_Apply_Equipment_Set__c WHERE Consum_Apply__c =:recordId AND RAES_Status__c != '已分配' AND RAES_Status__c != '取消分配'];
|
return caeList.size();
|
}
|
|
@AuraEnabled
|
public static Consum_Apply_Equipment_Set__c getSet(String setId){
|
Consum_Apply_Equipment_Set__c cae = [select Id, Zan_Ding_Fen_Pei_Shu__c from Consum_Apply_Equipment_Set__c where Id= :setId];
|
return cae;
|
}
|
|
public class InitData{
|
@AuraEnabled
|
public String campaignId; //学会Id
|
@AuraEnabled
|
public String campaignStatus; //学会状态
|
@AuraEnabled
|
public Integer weiAssignedCnt; //未分配件数
|
@AuraEnabled
|
public String consumApplyStatus; //状态
|
@AuraEnabled
|
public Integer assignedNotShipment; //已分配未出库指示
|
@AuraEnabled
|
public Date bollowDate; //备品中心出库日
|
@AuraEnabled
|
public Integer yiLoanerArranged; //已出库件数
|
@AuraEnabled
|
public String accDealerBlacklist;
|
}
|
}
|