| | |
| | | global class GeData { |
| | | public RepairOderInfo repairOderInfo; |
| | | public ApplyRepairInfo applyRepairInfo; |
| | | public problem problem; |
| | | public isOts isOts; |
| | | } |
| | | //报修单信息 |
| | | public class RepairOderInfo { |
| | |
| | | public String departmentCd; //报修科室编码 |
| | | public String repairApplyPerson; //报修人用户编码 |
| | | public String repairApplicantName; //报修人姓名 |
| | | public String repairApplicantNameEncrypted; //报修人姓名密文 add20220214 |
| | | //public String repairApplicantNameEncrypted; //报修人姓名密文 add20220214 //zhj新方案改造 2022-12-07 |
| | | public String repairApplyPersonTel; //报修人联系人电话 |
| | | public String repairApplyPersonTelEncrypted;//保修人联系电话 密文 add 20220214 |
| | | //public String repairApplyPersonTelEncrypted;//保修人联系电话 密文 add 20220214 //zhj新方案改造 2022-12-07 |
| | | public String DataId;//aws 存储凭证 add 20220214 |
| | | public String repairApplyType; // 报修人岗位 |
| | | public String equipmentCategory; //设备大类 |
| | |
| | | public String cancelleRepairDate; //取消报修日 |
| | | public String cancelReportReason; //取消报修原因 |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | } |
| | | //设备信息 |
| | |
| | | public String equipmentCd; //机身编码(工程师) |
| | | public String responseResultDesc; //应对描述 |
| | | public String processResult; //处理结果 |
| | | } |
| | | //故障处理信息 |
| | | public class problem { |
| | | public String dateReceiptQuestions; //投诉知悉日(Complaint Aware Date) |
| | | public String ifDeadHurt; //是否有死亡、伤害、感染 |
| | | public String problemOccurred; //问题发生时间情况 |
| | | public String problemOccurredSelect; //问题发生时间情况 其他 |
| | | public String reportAdverseEvents; //医院有没有向政府机关报告不良事件或疑似不良事件 |
| | | public String whatProject; //做的是哪个项目 |
| | | public String operationOrExaminationName; //手术/检查名称 |
| | | public String breakORFallOff; //是否有发生断裂或脱落 |
| | | public String useFailProductFinish; //是否用该产品完成了手术/检查 |
| | | public String supportingProducts; //配套使用产品 |
| | | public String afterFailureInformation; //发现故障后,医院对患者的处理情况 |
| | | public String delay15Min; //发现故障现象后,有延误15分钟以上的手术实施的情况发生吗 |
| | | public String informationFrom; //信息是从医院的谁那里得到的 |
| | | public String failureQInHospital; //在医院,故障发生的频率是多少 |
| | | public String delayReportReason; //超时报告的理由 |
| | | public String isProductFaultRelated; //是否与这次产品故障相关 |
| | | } |
| | | //物流 |
| | | public class isOts { |
| | | public String senderOrgCode; //送修机构代码 |
| | | public String senderCompany; //送修机构名称 |
| | | public String senderName; //送修人姓名 |
| | | public String senderMobilePhone; //送修人手机 |
| | | public String senderAddress; //送修人地址 |
| | | public String recepientCompany; //接收机构名称 |
| | | public String recepientName; //接收送修人姓名 |
| | | public String recepientMobilePhone; //接收人手机 |
| | | public String recepientAddress; //接收人地址 |
| | | public String returnWayType; //返品方式 |
| | | public String orderNumber; //送修物流单号 |
| | | public String failureReason; //下单失败原因 |
| | | public String logisticsSendDate; //送修物流发送日 |
| | | public String item0010; //备用字段1 |
| | | public String item0020; //备用字段2 |
| | | public String item0030; //备用字段3 |
| | | public String item0040; //备用字段4 |
| | | public String item0050; //备用字段5 |
| | | } |
| | | @HttpPost |
| | | global static void doPost() { |
| | |
| | | global static void main(String rowData_Id) { |
| | | BatchIF_Log__c rowData = [Select Id, Name, Log__c, ErrorLog__c, Log2__c, Log3__c, Log4__c, Log5__c, Log6__c, Log7__c, Log8__c, Log9__c, Log10__c, Log11__c, Log12__c, MessageGroupNumber__c, retry_cnt__c from BatchIF_Log__c where RowDataFlg__c = true and Id =: rowData_Id]; |
| | | String logstr = ' start\n'; |
| | | String logerr = ''; |
| | | BatchIF_Log__c iflog = new BatchIF_Log__c(); |
| | | iflog.Type__c = LOG_TYPE; |
| | | iflog.MessageGroupNumber__c = rowData.MessageGroupNumber__c; |
| | |
| | | return; |
| | | } |
| | | Savepoint sp = Database.setSavepoint(); |
| | | /*List<RepairSubOrder__c> rsoList = [SELECT Id FROM RepairSubOrder__c WHERE Name = ged.repairOderInfo.repairOrderNo2]; |
| | | if (rsoList.size() > 0) { |
| | | |
| | | } |
| | | */ |
| | | try { |
| | | List < RepairSubOrder__c > repairList = new List < RepairSubOrder__c > (); |
| | | Map < String, GeData > gedMap = new Map < String, GeData > (); |
| | |
| | | String dataComplete = verify(ged); |
| | | if (!String.isBlank(dataComplete)) { |
| | | logstr += dataComplete; |
| | | logerr += '报修子单No['+ged.repairOderInfo.repairOrderNo2+']\n' + logstr; //2022-07-11 zyh add |
| | | continue; |
| | | } |
| | | gedMap.put(ged.repairOderInfo.repairOrderNo2, ged); |
| | |
| | | // 附件下载标记 |
| | | Boolean attachmentDownloadFlg = false; |
| | | String repairOrderNo2Str = '报修子单No [ \n'; |
| | | Map<String,RepairSubOrder__c> RsoMap = new Map<String,RepairSubOrder__c>(); |
| | | for (String repairOrderNo2: gedMap.keySet()) { |
| | | GeData ged = gedMap.get(repairOrderNo2); |
| | | |
| | | if (!accountMap.containsKey(ged.repairOderInfo.departmentCd)) { |
| | | logstr += ged.repairOderInfo.departmentCd + '该科室不存在,此条数据跳过!'; |
| | | logerr += '报修子单No['+repairOrderNo2+']\n' + logstr; //2022-07-11 zyh add |
| | | continue; |
| | | } |
| | | if (String.isNotBlank(ged.repairOderInfo.repairApplyPerson) && !personMap.containsKey(ged.repairOderInfo.repairApplyPerson)) { |
| | | logstr += ged.repairOderInfo.repairApplyPerson + '报修人用户编码不存在,此条数据跳过'; |
| | | logerr += '报修子单No['+repairOrderNo2+']\n' + logstr; //2022-07-11 zyh add |
| | | continue; |
| | | } |
| | | |
| | | if (!personMap.containsKey(ged.repairOderInfo.receiverId)) { |
| | | logstr += ged.repairOderInfo.receiverId + '受理人用户编号不存在,此条数据跳过'; |
| | | logerr += '报修子单No['+repairOrderNo2+']\n' + logstr; //2022-07-11 zyh add |
| | | continue; |
| | | } |
| | | |
| | | if ('申请修理'.equals(ged.applyRepairInfo.processResult) && !personMap.containsKey(ged.repairOderInfo.applicantId)) { |
| | | logstr += ged.repairOderInfo.applicantId + '申请修理人编号不存在,此条数据跳过'; |
| | | logerr += '报修子单No['+repairOrderNo2+']\n' + logstr; //2022-07-11 zyh add |
| | | continue; |
| | | } |
| | | if (!canidMap.containsKey(ged.repairOderInfo.repairOrderNo2FSEID)) { |
| | | logstr += ged.repairOderInfo.repairOrderNo2FSEID + '报修子单所属FSE的ID不存在,此条数据跳过'; |
| | | logerr += '报修子单No['+repairOrderNo2+']\n' + logstr; //2022-07-11 zyh add |
| | | continue; |
| | | } |
| | | RepairSubOrder__c repair = new RepairSubOrder__c(); |
| | |
| | | repair.Hospital__c = dep.Parent.ParentId; //报修医院编码 |
| | | repair.StrategicDepartment__c = dep.ParentId; //战略科室 |
| | | repair.Department__c = dep.Id; //报修科室编码 |
| | | //XLIU-CFZ3AR LY 20220705 Start |
| | | system.debug('12121121'+dep.Province_formula__c); |
| | | repair.State__c = dep.Province_formula__c; //省 |
| | | //XLIU-CFZ3AR LY 20220705 End |
| | | |
| | | repair.RepairApplicant__c = personMap.get(ged.repairOderInfo.repairApplyPerson); //报修人用户编码 |
| | | repair.RepairApplicantName__c = ged.repairOderInfo.repairApplicantName; //报修人姓名 |
| | |
| | | repair.EndTimeThird__c = NFMUtil.parseStr2DateTime(ged.repairOderInfo.endTimeThird); //三次上门结束时间 |
| | | repair.FaultDescriptionThird__c = ged.repairOderInfo.faultDescriptionThird; //三次故障描述 |
| | | repair.ApplicantType__c = ged.repairOderInfo.applicantType; //申请修理人类型 |
| | | repair.RepairApplicantName_Encrypted__c =ged.repairOderInfo.repairApplicantNameEncrypted; //报修人姓名密文 add 20220214 |
| | | repair.RepairApplicantTel_Encrypted__c = ged.repairOderInfo.repairApplyPersonTelEncrypted;//保修人联系电话密文 add 20220214 |
| | | //repair.RepairApplicantName_Encrypted__c =ged.repairOderInfo.repairApplicantNameEncrypted; //报修人姓名密文 add 20220214 //zhj 新方案改造 2022-12-09 |
| | | //repair.RepairApplicantTel_Encrypted__c = ged.repairOderInfo.repairApplyPersonTelEncrypted;//保修人联系电话密文 add 20220214 //zhj 新方案改造 2022-12-09 |
| | | repair.AWS_Data_Id__c =ged.repairOderInfo.DataId;//AWS 存储凭证 add 20220214 |
| | | // repair.Applicant__c = canidMap.get(ged.repairOderInfo.applicantId).Id; //申请修理人编号 |
| | | repair.Applicanter__c = personMap.get(ged.repairOderInfo.applicantId);//申请修理人编号 |
| | |
| | | // repair.CancelleRepairTime__c = NFMUtil.parseStr2Date(ged.repairOderInfo.CancelDate); //受理人取消报修日 |
| | | repair.RepairCancelReason__c = ged.repairOderInfo.cancelReportReason; //修理取消原因 |
| | | // 2022/4/6 zhangyuheng update end |
| | | |
| | | if ('问题已解决'.equals(ged.applyRepairInfo.processResult)) { |
| | | // 2023-02-20 zyh add start |
| | | repair.DateReceiptQuestions__c = ged.problem.dateReceiptQuestions; //投诉知悉日(Complaint Aware Date) |
| | | repair.IfDeadHurt__c = ged.problem.ifDeadHurt; //是否有死亡、伤害、感染 |
| | | repair.ProblemOccurred__c = ged.problem.problemOccurred; //问题发生时间情况 |
| | | repair.ProblemOccurredSelect__c = ged.problem.problemOccurredSelect; //问题发生时间情况 其他 |
| | | repair.ReportAdverseEvents__c = ged.problem.reportAdverseEvents; //医院有没有向政府机关报告不良事件或疑似不良事件 |
| | | repair.WhatProject__c = ged.problem.whatProject; //做的是哪个项目 |
| | | repair.OperationOrExaminationName__c = ged.problem.operationOrExaminationName; //手术/检查名称 |
| | | repair.BreakORFallOff__c = ged.problem.breakORFallOff; //是否有发生断裂或脱落 |
| | | repair.UseFailProductFinish__c = ged.problem.useFailProductFinish; //是否用该产品完成了手术/检查 |
| | | repair.SupportingProducts__c = ged.problem.supportingProducts; //配套使用产品 |
| | | repair.AfterFailureInformation__c = ged.problem.afterFailureInformation; //发现故障后,医院对患者的处理情况 |
| | | repair.Delay15Min__c = ged.problem.delay15Min; //发现故障现象后,有延误15分钟以上的手术实施的情况发生吗 |
| | | repair.InformationFrom__c = ged.problem.informationFrom; //信息是从医院的谁那里得到的 |
| | | repair.FailureQInHospital__c = ged.problem.failureQInHospital; //在医院,故障发生的频率是多少 |
| | | repair.DelayReportReason__c = ged.problem.delayReportReason; //超时报告的理由 |
| | | repair.IsProductFaultRelated__c = ged.problem.isProductFaultRelated; //是否与这次产品故障相关 |
| | | repair.SenderOrgCode__c = ged.isOts.senderOrgCode; //送修机构代码 |
| | | repair.SenderCompany__c = ged.isOts.senderCompany; //送修机构名称 |
| | | repair.SenderName__c = ged.isOts.senderName; //送修人姓名 |
| | | repair.SenderMobilePhone__c = ged.isOts.senderMobilePhone; //送修人手机 |
| | | repair.SenderAddress__c = ged.isOts.senderAddress; //送修人地址 |
| | | repair.RecepientCompany__c = ged.isOts.recepientCompany; //接收机构名称 |
| | | repair.RecepientName__c = ged.isOts.recepientName; //接收送修人姓名 |
| | | repair.RecepientMobilePhone__c = ged.isOts.recepientMobilePhone; //接收人手机 |
| | | repair.RecepientAddress__c = ged.isOts.recepientAddress; //接收人地址 |
| | | repair.ReturnWayType__c = ged.isOts.returnWayType; //返品方式 |
| | | repair.OrderNumber__c = ged.isOts.orderNumber; //送修物流单号 |
| | | repair.FailureReason__c = ged.isOts.failureReason; //下单失败原因 |
| | | repair.LogisticsSendDate__c = ged.isOts.logisticsSendDate; //送修物流发送日 |
| | | repair.Item0010__c = ged.isOts.item0010; //备用字段1 |
| | | repair.Item0020__c = ged.isOts.item0020; //备用字段2 |
| | | repair.Item0030__c = ged.isOts.item0030; //备用字段3 |
| | | repair.Item0040__c = ged.isOts.item0040; //备用字段4 |
| | | repair.Item0050__c = ged.isOts.item0050; //备用字段5 |
| | | // 2023-02-20 zyh add end |
| | | //LLIU-CG53S9 20220715 LY start |
| | | if ('问题已解决'.equals(ged.applyRepairInfo.processResult) ||'需做质量判定'.equals(ged.applyRepairInfo.processResult) ||'用户选择不修理'.equals(ged.applyRepairInfo.processResult)) { |
| | | //LLIU-CG53S9 20220715 LY end |
| | | // repair.Status__c = '关闭'; |
| | | repair.Status__c = '已完成'; // 2022/4/6 zhangyuheng |
| | | } else { |
| | |
| | | repairOrderNo2Str += repairOrderNo2 + '\n'; |
| | | repairList.add(repair); |
| | | repairNoList.add(ged.repairOderInfo.repairOrderNo2); |
| | | RsoMap.put(ged.repairOderInfo.repairOrderNo2,repair); |
| | | } |
| | | // 2022/4/6 zhangyuheng update start |
| | | List<RepairSubOrder__c> repairList1 = [SELECT Id FROM RepairSubOrder__c WHERE RepairSubOrderNo__c in: repairNoList]; |
| | | if (repairList1.size() > 0) { |
| | | List<RepairSubOrder__c> upList = new List<RepairSubOrder__c>(); |
| | | List<RepairSubOrder__c> repairSOList1 = [SELECT Id,RepairSubOrderNo__c,DateReceiptQuestions__c FROM RepairSubOrder__c WHERE RepairSubOrderNo__c in: repairNoList]; |
| | | if (repairSOList1.size() > 0) { |
| | | for(RepairSubOrder__c rso: repairSOList1){ |
| | | if(RsoMap.containsKey(rso.RepairSubOrderNo__c)){ |
| | | RepairSubOrder__c temp = new RepairSubOrder__c(); |
| | | temp = RsoMap.get(rso.RepairSubOrderNo__c); |
| | | temp.Id = rso .Id; |
| | | upList.add(temp); |
| | | } |
| | | } |
| | | logstr += repairOrderNo2Str + ']-已存在'; |
| | | update upList; |
| | | System.debug(repairSOList1[0].Id + '===' + repairSOList1[0].DateReceiptQuestions__c); |
| | | logstr += repairOrderNo2Str + '更新完成, 更新总数为:' + repairSOList1.size() + '\n' + repairSOList1; |
| | | } |
| | | // if (repairList.size() > 0) {==== 2022/4/6 zhangyuheng注释掉 |
| | | else { |
| | |
| | | } |
| | | update rowData; |
| | | iflog.Log__c = logstr; |
| | | |
| | | iflog.ErrorLog__c = logerr;//2022-07-11 zyh add |
| | | insert iflog; |
| | | } |
| | | /** |
| | |
| | | private static Map < String, Account > getAccountMap(List < String > managementCodeList) { |
| | | List < Account > accountList = |
| | | [SELECT id, Management_Code__c, ParentId, Parent.ParentId |
| | | //XLIU-CFZ3AR LY 20220705 Start |
| | | ,Province_formula__c |
| | | //XLIU-CFZ3AR LY 20220705 End |
| | | FROM Account |
| | | WHERE Management_Code__c |
| | | IN: managementCodeList |