unknown
2023-07-20 b40a8ed02c127f594fdf3d41ea69c006c1e86a60
button-lexConsumSelect

分配-耗材一览
2个文件已添加
69 ■■■■■ 已修改文件
force-app/main/default/classes/lexConsumApplyController.cls 64 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/classes/lexConsumApplyController.cls-meta.xml 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/classes/lexConsumApplyController.cls
New file
@@ -0,0 +1,64 @@
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
                                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);
            }
        }
        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;    //已出库件数
    }
}
force-app/main/default/classes/lexConsumApplyController.cls-meta.xml
New file
@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<ApexClass xmlns="http://soap.sforce.com/2006/04/metadata">
    <apiVersion>50.0</apiVersion>
    <status>Active</status>
</ApexClass>