Li Jun
2022-03-17 03523642de0c4f319d90d0aec8a756f9e80e6a7e
force-app/main/default/classes/StraightBackAddressController.cls
@@ -100,7 +100,9 @@
     * 开始方法
     */
    public PageReference init(){
        System.debug('RepairId-----'+RepairId);
        String RepairSql = makeTextRepairSql(RepairId);
        System.debug('RepairSql-----'+RepairSql);
        try{
            pc = Database.query(RepairSql);
            system.debug('pc = ' + pc);
@@ -142,6 +144,8 @@
        }catch(exception e){
            //失败提示
            ApexPages.addMessages(e);
            System.debug(e.getMessage());
            System.debug(e.getlineNumber());
        }
        insUpdData = new Address__c();
        newCon = new Contact();
@@ -232,7 +236,7 @@
                        try{
                            //保存数据到修理表中
                            Repair__c rc = new Repair__c();
                            rc.id=RepairId;
                            rc.id = RepairId;
                            rc.Address_AWS_Data_Id__c = tableData[i].address.AWS_Data_Id__c;
                            rc.Contact_AWS_Data_Id__c = contactawsDataId;
                            rc.address_Contacts__c = contactsName;
@@ -350,12 +354,14 @@
            List<Address__c> dataList = Database.query(AddressSql);
            if(dataList != null && dataList.size()> 0){
                indexCou += dataList.size();
                System.debug('dataList-----'+dataList);
                for(Integer i = 0;i<dataList.size();i++){
                    String createID = dataList[i].CreatedByid;
                    createId = createId.substring(0,15);
                    //办事处的地址不可修改
                    if(dataList[i].Address_Classification__c == '办事处'){
                            tableData.add(new AddressData(dataList[i],'none','none','inline'));
                        tableData.add(new AddressData(dataList[i],'none','none','inline'));
                    }else{
                        //只能改自己创建的地址数据,系统管理员、GPI_系统管理员New 没限制
                        if(loginPerson == createId ||loginPerson == '00e10000000dzzG' ||loginPerson == '00e10000000Y3o5'){
@@ -470,7 +476,6 @@
                }
            }
            //判断联系人是否都为空
            if(insUpdData.Contacts__c == null || String.isBlank(insUpdData.Contacts__c)){
                //判断新建联系人是否为空
                if(insUpdData.Create_Contacts__c == null || String.isBlank(insUpdData.Create_Contacts__c)){