sunxia
2022-11-21 0fd788ee4e392c702c15ac9e1754e0a94770de8f
force-app/main/default/classes/ReceivingNoteWaitingReceiptController.cls
@@ -528,7 +528,7 @@
                                    }
                                }else{
                                    key1 += 'N0;';
                                    if(SalesdepartmentI == 0 || (SalesdepartmentI > 6 && SalesdepartmentI < 12)){
                                    if(SalesdepartmentI == 0 || (SalesdepartmentI > 6 && SalesdepartmentI < 12) || SalesdepartmentI == 16){
                                        key1 += ass.Product_category__c+';'+locationMap.get(ass.Internal_asset_location__c);
                                    }else if(SalesdepartmentI < 7){
                                        key1 += ass.Product_category__c;
@@ -567,7 +567,7 @@
                                }else{
                                    key2 += 'N0;';
                                    key2 += String.isNotBlank(RNde.Product_category__c)?RNde.Product_category__c:RNde.Product_category_F__c;
                                    if(SalesdepartmentI == 0 || (SalesdepartmentI > 6 && SalesdepartmentI < 12)){
                                    if(SalesdepartmentI == 0 || (SalesdepartmentI > 6 && SalesdepartmentI < 12) || SalesdepartmentI == 16){
                                        key2 +=';'+locationMap.get(RNde.Internal_asset_location__c);
                                    }
                                }
@@ -604,12 +604,12 @@
                }
            }
            //重新编码
            // 2021203 ljh SFDC-C8ZATE start
            // 20211203 ljh SFDC-C8ZATE start
            List<Asset_EquipmentSet_Managment_Code__c> aemCodeList = new List<Asset_EquipmentSet_Managment_Code__c>();
            Map<String,Asset_EquipmentSet_Managment_Code__c> oldCodeMap = new Map<String,Asset_EquipmentSet_Managment_Code__c>();
            // 2021203 ljh SFDC-C8ZATE end
            // 20211203 ljh SFDC-C8ZATE end
            if(codeNewMap.size() > 0){
                // 2021203 ljh SFDC-C8ZATE start
                // 20211203 ljh SFDC-C8ZATE start
                // List<Asset_EquipmentSet_Managment_Code__c> aemCodeList = [SELECT Id, key__c, code__c, 
                aemCodeList = [SELECT Id, key__c, code__c,   
                        LastNo__c, keyName__c, isSpecial__c, MaxLastNo__c FROM Asset_EquipmentSet_Managment_Code__c
@@ -646,7 +646,7 @@
                            rndMap.put(rnde1.Id,rnde2); 
                        }
                        oldCodeMap.put(aem.Id,aem); // 2021203 ljh SFDC-C8ZATE end
                        oldCodeMap.put(aem.Id,aem); // 20211203 ljh SFDC-C8ZATE end
                        Asset_EquipmentSet_Managment_Code__c aesm = new Asset_EquipmentSet_Managment_Code__c();
                        aesm.Id = aem.Id;
                        aesm.LastNo__c = code;
@@ -671,7 +671,7 @@
                    }
                }
                //20210804 ljh 管理编码 end
                // 2021203 ljh SFDC-C8ZATE start
                // 20211203 ljh SFDC-C8ZATE start
                // 判断此时此刻的值 是否和最初的值是否一样,不一样提示
                List<Asset_EquipmentSet_Managment_Code__c> aemCodeNowList = [SELECT Id, key__c, code__c,   
                        LastNo__c, keyName__c, isSpecial__c, MaxLastNo__c FROM Asset_EquipmentSet_Managment_Code__c
@@ -685,7 +685,7 @@
                    //}
                }        
                update aesmUList; //20210809 ljh 管理编码
                // 2021203 ljh SFDC-C8ZATE end
                // 20211203 ljh SFDC-C8ZATE end
                update rndList; 
                // update aesmUList; //20210809 ljh 管理编码
                pageRef.getParameters().put('message','已保存');