buli
2023-05-23 07390e2fcb4adf27c928335bf27ae7939c5a80ad
force-app/main/default/classes/ArriveGoodsController.cls
@@ -77,6 +77,7 @@
    //public String[] proidList =new String[]{};
    public Decimal orderCountAll = 0;
    public Decimal orderCountNotarrive = 0;
    //LWC:Lwcflag和报错提醒 update by Link 2023-04-27
    public id return_Order_id = null;
    public id inventory_Order_id = null;
    public boolean ReturnFLGbln {get;set;}
@@ -335,6 +336,16 @@
    //========20160311======ADD_End==================================
    //获取明细
    public void SearchPro() {
        //从下边移上来 by Link 2023-5-23
        if(barcode == null || barcode.trim() ==''){
            //LWC:Lwcflag和报错提醒 update by Link 2023-04-27
            if(isLwc){
                returnError = '请输入BarCode号';
            }else {
                ApexPages.addmessage(new ApexPages.message(ApexPages.severity.INFO,'请输入BarCode号。'));
            }
            return;
        }
        notInlist = new list<String>();
        otherAgencyMap = new Map<String, String>();
        barMcodeMap = new Map<String, String>();
@@ -416,15 +427,16 @@
        List<Consumable_order_details2__c> Ins = New List<Consumable_order_details2__c>();
        List<Consumable_order_details2__c> reSet = new List<Consumable_order_details2__c>();
        List<Consumable_order_details2__c> reSet1 = new List<Consumable_order_details2__c>();
        if(barcode == null || barcode.trim() ==''){
            //LWC:Lwcflag和报错提醒 update by Link 2023-04-27
            if(isLwc){
                returnError = '请输入BarCode号';
            }else {
                ApexPages.addmessage(new ApexPages.message(ApexPages.severity.INFO,'请输入BarCode号。'));
            }
            return;
        }
        //移到最上边 by Link 2023-5-23
        // if(barcode == null || barcode.trim() ==''){
        //     //LWC:Lwcflag和报错提醒 update by Link 2023-04-27
        //     if(isLwc){
        //         returnError = '请输入BarCode号';
        //     }else {
        //         ApexPages.addmessage(new ApexPages.message(ApexPages.severity.INFO,'请输入BarCode号。'));
        //     }
        //     return;
        // }
        //对比全部库存中是否存在管理编码一样,barcode号不一样的产品
        reSet1 = [SELECT Id,  Name,TracingCode__c,Bar_Code__c,Report_Product_Expiration__c 
                    FROM Consumable_order_details2__c
@@ -3604,7 +3616,11 @@
                    }
                    if(codi.esd.Return_reason__c==null||codi.esd.Return_reason__c==''){
                        codi.esd.Return_reason__c.addError('请补充返品原因');
                        if(isLwc){
                            returnError = '请补充返品原因';
                        }else {
                            codi.esd.Return_reason__c.addError('请补充返品原因');
                        }
                        return null;
                    }
@@ -3613,7 +3629,11 @@
                        String key = '' + codi.esd.Consumable_ZS_order__c + codi.esd.Bar_Code__c;
                        Integer deliverycnt = BarcodeCntMap.get(key);
                        if(codi.esd.Rrturn_count__c > deliverycnt){
                            codi.esd.Rrturn_count__c.addError('超出出库数量');
                            if(isLwc){
                                returnError = '超出出库数量';
                            }else {
                                codi.esd.Rrturn_count__c.addError('超出出库数量');
                            }
                            return null;
                        }  
                    }