buli
2022-03-11 02ddc35714cbd1688b7cb057f770f1410de79dab
force-app/main/default/classes/NFM620Rest.cls
@@ -10,7 +10,10 @@
@RestResource(urlMapping = '/NFM620/*')
global with sharing class NFM620Rest {
    //新增NFM620Rest 商品询问单接收数据接口 精琢技术 start
   //add to AWS 回复 start sushanhu 20220225
   static Boolean SFStatus=true;
   static String SFMessage='';
  //add to AWS 回复 end sushanhu 20220225
    global class GeDatas {
        public NFMUtil.Monitoring Monitoring;
        public  GeData[] GeData;
@@ -26,6 +29,9 @@
        public String Request;                   // 委托事项
        public String RequestDetail;             // 委托事项详细
        public String ApproverID;                // 审核人员员工编码
        public String ContactWayEncrypted;         //联系方式密文 for pi
        public String DataId;                      //AWS 加密凭据
        public Integer ContactType;                 //联系方式 1为邮箱 2为电话
    }
    @HttpPost
@@ -34,7 +40,7 @@
        // 取得接口传输内容
        String strData = RestContext.request.requestBody.toString();
        GeDatas ges = (GeDatas) JSON.deserializeStrict(strData, GeDatas.class);
        system.debug('rquest----'+strData);
        if (ges == null ) {
            return;
        }
@@ -53,8 +59,16 @@
        RestResponse res = RestContext.response;
        res.addHeader('Content-Type', 'application/json');
        res.statusCode = 200;
        String jsonResponse = '{"status": "Success", "Message":""}';
        // String jsonResponse = '{"status": "Success", "Message":""}';
        // res.responseBody = blob.valueOf(jsonResponse);
        //updata response toAWS 20220225 sushanhu start
        NFMUtil.NFMResponse result = NFMUtil.getNFMResponse();
        result.SFStatus=SFStatus;
        result.SFMessage=SFMessage;
        String jsonResponse =JSON.serialize(result);
        system.debug('result---'+jsonResponse);
        res.responseBody = blob.valueOf(jsonResponse);
        //updata response toAWS 20220225 sushanhu end
        return;
    }
@@ -177,9 +191,6 @@
                    }
                }
            }
            // 将XML各数据项更新到商品询问单对象中
            for (GeData geData : geDataListNew) {
@@ -195,6 +206,8 @@
                if (String.isNotBlank(ownerMap.get(geData.ApproverID))){
                    inquiry.OwnerId = ownerMap.get(geData.ApproverID);            //所有人
                }
                inquiry.AWS_Data_Id__c =geData.DataId;                              //AWS加密凭据 add 200220214
                
                //委托事项取值后拆分
                List<String> requestList = geData.Request.split(';');
@@ -226,12 +239,17 @@
                }
                logstr += '咨询单来源:' + inquiry.LeadSource__c + '\n';
                //联系方式的值是否包含@来判断是邮箱还是电话
                if (geData.ContactWay.contains('@')) {
                if (geData.ContactType==1) {
                    inquiry.Phone__c = '';                            //电话
                    inquiry.Phone_Encrypted__c='';                     //电话密文 add 20220214
                    inquiry.Email__c = geData.ContactWay;             //邮箱
                    inquiry.Email_Encrypted__c =geData.ContactWayEncrypted; //邮箱密文 add 20220214
                } else {
                    inquiry.Phone__c = geData.ContactWay;
                    inquiry.Email__c = '';
                    inquiry.Email_Encrypted__c = ''; //邮箱密文 add 20220214
                    inquiry.Phone_Encrypted__c=geData.ContactWayEncrypted;    //电话密文 add 20220214
                }
                if (String.isNotBlank(inqInfoMap.get(geData.InquiryNo))) {