| | |
| | | */ |
| | | @RestResource(urlMapping = '/NFM607/*') |
| | | global with sharing class NFM607Rest { |
| | | //add to AWS 回复 start sushanhu 20220225 |
| | | static Boolean SFStatus=true; |
| | | static String SFMessage=''; |
| | | //add to AWS 回复 end sushanhu 20220225 |
| | | private static final String LOG_TYPE = 'NFM607'; |
| | | //add Response to aws 20220221 add sushanhu |
| | | static NFMUtil.NFMResponse result = new NFMUtil.NFMResponse(); |
| | | |
| | | global class GeData { |
| | | public String mngCd; // ASE管理编码 |
| | |
| | | public String activityStartTime; //活动开始时间 |
| | | public String activityEndTime; //活动结束时间 |
| | | public String workDesc; //工作描述 |
| | | //add wangweipeng 2022/02/14 start |
| | | // add 加密字段索引 add 20220210 |
| | | public String DataId; //加密字段索引 |
| | | //add 加密字段密文 20220210 |
| | | public String customerNmEncrypted; |
| | | //add wangweipeng 2022/02/14 start |
| | | public String customerTel;//客户手机号码 |
| | | public String workPlace;//工作场所 |
| | | //add wangweipeng 2022/02/14 end |
| | | //add wangweipeng 2022/02/14 end |
| | | //add 20220216 sushanhu start |
| | | public String customerTelEncrypted; |
| | | public String workPlaceEncrypted; |
| | | // add 20220216 sushanhu end |
| | | |
| | | |
| | | } |
| | | |
| | | @HttpPost |
| | |
| | | // 取得接口传输内容 |
| | | String strData = RestContext.request.requestBody.toString(); |
| | | List < GeData > ges = (List < GeData > ) JSON.deserializeStrict(strData, List < GeData > .class); |
| | | |
| | | system.debug('ges---'+ges); |
| | | if (ges == null) { |
| | | return; |
| | | } |
| | |
| | | RestResponse res = RestContext.response; |
| | | res.addHeader('Content-Type', 'application/json'); |
| | | res.statusCode = 200; |
| | | String jsonResponse = '{"status": "Success", "Message":"成功"}'; |
| | | res.responseBody = Blob.valueOf(jsonResponse); |
| | | // 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(ged.departmentCd)) { |
| | | accountCodeList.add(ged.departmentCd); |
| | | } |
| | | |
| | | system.debug('date---'+Date.valueOf(ged.activityDailyDate)); |
| | | dateCalendarMap.put(Date.valueOf(ged.activityDailyDate), null); |
| | | |
| | | } |
| | |
| | | ASEAct.VisitStaff__c = ged.customerNm; |
| | | ASEAct.ReporterASE__c = contactId;//报告者 |
| | | ASEAct.DurationInMinutes__c = getDurationInMinutes(ged);//持续时间分钟 |
| | | activityIDStr += ged.activityID +'\n'; |
| | | //add wangweipeng 2022/02/14 start |
| | | ASEAct.CustomerTel__c = ged.customerTel;//客户手机号码 |
| | | ASEAct.WorkPlace__c = ged.workPlace;//工作场所 |
| | | //add wangweipeng 2022/02/14 end |
| | | activityIDStr += ged.activityID +'\n'; |
| | | ASEAct.AWS_Data_Id__c =ged.DataId;//加密索引 20220207 |
| | | ASEAct.VisitStaffEncrypt__c=ged.customerNmEncrypted;//密文 20220207 |
| | | //add sushanhu 2022/02/16 sart |
| | | ASEAct.CustomerTel_Encrypted__c=ged.customerTelEncrypted; |
| | | ASEAct.WorkPlace_Encrypted__c =ged.workPlaceEncrypted; |
| | | //add sushanhu 2022/02/16 end |
| | | upsertASEList.add(ASEAct); |
| | | } |
| | | |
| | |
| | | if (String.isBlank(ged.visitDistinction) ) { |
| | | result += 'DataError: 拜访区分 [ visitDistinction ] is null!\n'; |
| | | } |
| | | // if (String.isBlank(ged.DataId) ) { |
| | | // result += 'DataError: 加密索引 [ DataId ] is null!\n'; |
| | | // } |
| | | // if (String.isBlank(ged.customerNmEncrypted)) { |
| | | // result += 'DataError: 客户姓名密文 [ customerNmEncrypted ] is null!\n'; |
| | | // } |
| | | |
| | | if (String.isNotBlank(activityID) && String.isNotBlank(result)) { |
| | | result = activityID + result; |
| | | } |
| | | |
| | | return result; |
| | | } |
| | | |