| | |
| | | @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; |
| | |
| | | public String Request; // 委托事项 |
| | | public String RequestDetail; // 委托事项详细 |
| | | public String ApproverID; // 审核人员员工编码 |
| | | public String ContactWayEncrypted; //联系方式密文 for pi |
| | | public String DataId; //AWS 加密凭据 |
| | | public Integer ContactType; //联系方式 1为邮箱 2为电话 |
| | | } |
| | | |
| | | @HttpPost |
| | |
| | | // 取得接口传输内容 |
| | | String strData = RestContext.request.requestBody.toString(); |
| | | GeDatas ges = (GeDatas) JSON.deserializeStrict(strData, GeDatas.class); |
| | | |
| | | system.debug('rquest----'+strData); |
| | | if (ges == null ) { |
| | | return; |
| | | } |
| | |
| | | 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; |
| | | } |
| | | |
| | |
| | | if (String.isNotBlank(geData.Campaign)) { |
| | | camNoList.add(geData.Campaign); |
| | | } |
| | | |
| | | |
| | | geDataListNew.add(geData); |
| | | } |
| | | //使用统一用户ID获取科室、战略科室分类、用户姓名并存入Map |
| | |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | // 将XML各数据项更新到商品询问单对象中 |
| | | for (GeData geData : geDataListNew) { |
| | | |
| | | |
| | | Inquiry_form__c inquiry = new Inquiry_form__c(); |
| | | |
| | | inquiry.ComPlat_Name__c = geData.Name; //询问单名称 |
| | |
| | | inquiry.ContactId__c = geData.ContactId; //统一用户ID |
| | | 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(';'); |
| | | String request1 = ''; |
| | | for (String req11 : requestList) { |
| | | request1 += NFMUtil.getMapValue(transferMap, 'Request1__c', req11, iflog) + ';'; |
| | | } |
| | | } |
| | | inquiry.Request1__c = request1.substring(0, request1.length() - 1); //委托事项 |
| | | |
| | | |
| | | //使用统一用户ID获取科室、战略科室、客户姓名 |
| | | if (conInfoMap.containsKey(geData.ContactId)) { |
| | | Contact contact = conInfoMap.get(geData.ContactId); |
| | | inquiry.Hospital_Name__c = contact.Account.Id; //科室名 |
| | | //inquiry.Department_Class__c = contact.Strategic_dept_Class__c; //战略科室分类 |
| | | inquiry.Hospital_Name__c = contact.Account.Id; //科室名 |
| | | // inquiry.Department_Class__c = contact.Strategic_dept_Class__c; //战略科室分类 |
| | | inquiry.Contact_Name__c = contact.Id; //客户姓名 |
| | | //inquiry.OwnerId = contact.Strategic_dept_Class__r.OwnerId; //所有人 |
| | | } |
| | | // inquiry.OwnerId = contact.Strategic_dept_Class__r.OwnerId; //所有人 |
| | | } |
| | | //使用市场活动编码获取市场活动ID |
| | | if (String.isNotBlank(geData.Campaign)) { |
| | | if (String.isNotBlank(camInfoMap.get(geData.Campaign))) { |
| | |
| | | inquiry.LeadSource__c = '学会会议'; //询问单来源 |
| | | } else { |
| | | iflog.ErrorLog__c += geData.InquiryNo + ':市场活动编码不存在。\n'; |
| | | continue; |
| | | continue; |
| | | } |
| | | } else { |
| | | inquiry.LeadSource__c = '智慧医疗'; //询问单来源 |
| | | } |
| | | logstr += '咨询单来源:' + inquiry.LeadSource__c + '\n'; |
| | | 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))) { |