| | |
| | | // private static final String API = '/admin/api/scd/save'; |
| | | private static final String API = '/admin/api/repair/save'; |
| | | |
| | | // 2022-05-05 zyh update start |
| | | private static List < BatchIF_Log__c > logList = new List < BatchIF_Log__c > (); |
| | | private static List < BatchIF_Log__c > rowList = new List < BatchIF_Log__c > (); |
| | | private static Map < Id,BatchIF_Log__c > logMap = new Map < Id,BatchIF_Log__c > (); |
| | | // 2022-05-05 zyh update end |
| | | public static Integer status; |
| | | public static String message; |
| | | public class RepairOrderInfo { |
| | |
| | | public String QuotationGread; //报价等级(new) |
| | | public String detectionResult; //检测结果 |
| | | public String cus_dn; //DN号 |
| | | //修理增加OTS运单号字段 thh 20220308 start |
| | | public String OTSRepairOrder; |
| | | //修理增加OTS运单号字段 thh 20220308 end |
| | | |
| | | //送修物流 |
| | | public String deliveryLogisticsMode; //送修物流方式 |
| | | public String engineerSendDate; //工程师修理品寄送日 |
| | |
| | | |
| | | public static void executefuture(BatchIF_Log__c iflog, List < String > repairOrderIdList) { |
| | | Datetime nowDT = Datetime.now(); |
| | | String nowStr = nowDT.format('yyyyMMddHHmm'); |
| | | String nowStr = nowDT.format('yyyyMMddHHmmss'); |
| | | if (iflog != null) { |
| | | iflog.ErrorLog__c = ''; |
| | | } else { |
| | |
| | | iflog.MessageGroupNumber__c = nowStr; |
| | | } |
| | | List < RepairOrderInfo > repairs = new List < RepairOrderInfo > (); |
| | | List < RepairOrderInfo > repairs1 = new List < RepairOrderInfo > (); |
| | | BatchIF_Log__c rowData = null; |
| | | List < Repair__c > repairList = new List < Repair__c > (); |
| | | if (repairOrderIdList != null && repairOrderIdList.size() > 0) { |
| | |
| | | RcSorcDate__c, |
| | | SorcAcceptDate__c, |
| | | SorcOgzDate__c, |
| | | RcOgzDate__c, |
| | | Returns_Product_waySAP__c, |
| | | DnNO__c, |
| | | OgzAcceptDate__c, |
| | |
| | | Repair_Final_Inspection_DateTime__c, |
| | | Repair_Shipped_DateTime__c, |
| | | Repair_Discount_approval_DateTime_form__c, |
| | | Agreed_DateTime__c |
| | | Agreed_DateTime__c, |
| | | //修理增加OTS运单号字段 thh 20220308 start |
| | | OTSRepairOrder__c |
| | | //修理增加OTS运单号字段 thh 20220308 end |
| | | from Repair__c where id in: repairOrderIdList |
| | | ]; |
| | | } |
| | |
| | | // 备品出借记录 查找备品出借一览明细的 产品型号 |
| | | Map < id, List < SparePartsLendingRecord >> rentalMap = getrentalMap(repairIdList); |
| | | |
| | | // String downSDt = ''; 2022-5-10 zyh update |
| | | // String downEDt = ''; 2022-5-10 zyh update |
| | | // String upSDt = ''; 2022-5-10 zyh update |
| | | // String upEDt = ''; 2022-5-10 zyh update |
| | | |
| | | |
| | | for (Repair__c repair: repairList) { |
| | |
| | | info.OgzAcceptDate = NFMUtil.formatDateTime2Str(repair.OgzAcceptDateTime__c);//OGZ受理日(小程序) |
| | | //update wangweipeng 2022/02/16 end |
| | | |
| | | info.SorcOgzDate = NFMUtil.formatDate2StrDateTime(repair.SorcOgzDate__c); |
| | | // info.SorcOgzDate = NFMUtil.formatDate2StrDateTime(repair.SorcOgzDate__c);RcOgzDate__c |
| | | |
| | | //update zhangyuheng 2022/03/07 |
| | | info.SorcOgzDate = NFMUtil.formatDate2StrDateTime(repair.RcOgzDate__c); |
| | | |
| | | info.cus_dn = repair.DnNO__c; |
| | | //修理增加OTS运单号字段 thh 20220308 start |
| | | info.OTSRepairOrder = repair.OTSRepairOrder__c; |
| | | //修理增加OTS运单号字段 thh 20220308 end |
| | | |
| | | //报价日、初次报价日、RC修理品RC受理日(小程序)时间判断 zyh 20220315 start |
| | | // downSDt = DownStartDt(); // 2022-5-10 zyh update 定义上下班时间同步修改 |
| | | // downEDt = DownEndDt(); // 2022-5-10 zyh update 定义上下班时间同步修改 |
| | | // upSDt = UpStartDt(); // 2022-5-10 zyh update 定义上下班时间同步修改 |
| | | // upEDt = UpEndDt(); // 2022-5-10 zyh update 定义上下班时间同步修改 |
| | | // 2022-05-07 zyh update start |
| | | if (String.isNotBlank(info.FirstQuotationDate)) { |
| | | info.FirstQuotationDate = info.FirstQuotationDate.deleteWhitespace(); |
| | | } |
| | | if (String.isNotBlank(info.quotationDate)) { |
| | | info.quotationDate = info.quotationDate.deleteWhitespace(); |
| | | } |
| | | // 2022-05-07 zyh update end |
| | | //定义下班时间 |
| | | if (String.valueOf(info.FirstQuotationDate) >= String.valueOf(DownStartDt(info.FirstQuotationDate)) && String.valueOf(info.FirstQuotationDate) <= String.valueOf(DownEndDt(info.FirstQuotationDate))) { |
| | | info.FirstQuotationDate = DownDt(info.FirstQuotationDate);//初次报价日 |
| | | } |
| | | if (String.valueOf(info.RCacceptanceDate) >= String.valueOf(DownStartDt(info.RCacceptanceDate)) && String.valueOf(info.RCacceptanceDate) <= String.valueOf(DownEndDt(info.RCacceptanceDate))) { |
| | | info.RCacceptanceDate = DownDt(info.RCacceptanceDate);//4.修理品RC受理日 |
| | | } |
| | | if (String.valueOf(info.quotationDate) >= String.valueOf(DownStartDt(info.quotationDate)) && String.valueOf(info.quotationDate) <= String.valueOf(DownEndDt(info.quotationDate))) { |
| | | info.quotationDate = DownDt(info.quotationDate);//报价日 |
| | | } |
| | | if (String.valueOf(info.FSErepairApplyDate) >= String.valueOf(DownStartDt(info.FSErepairApplyDate)) && String.valueOf(info.FSErepairApplyDate) <= String.valueOf(DownEndDt(info.FSErepairApplyDate))) { |
| | | info.FSErepairApplyDate = DownDt(info.FSErepairApplyDate);//FSE修理申请时间 2022-05-06--zyh--add |
| | | } |
| | | if (String.valueOf(info.RCreturnDate) >= String.valueOf(DownStartDt(info.RCreturnDate)) && String.valueOf(info.RCreturnDate) <= String.valueOf(DownEndDt(info.RCreturnDate))) { |
| | | info.RCreturnDate = DownDt(info.RCreturnDate);//RC修理品返送日 2022-05-06--zyh--add |
| | | } |
| | | if (String.valueOf(info.finalTestDate) >= String.valueOf(DownStartDt(info.finalTestDate)) && String.valueOf(info.finalTestDate) <= String.valueOf(DownEndDt(info.finalTestDate))) { |
| | | info.finalTestDate = DownDt(info.finalTestDate);//10.最终检测日(小程序) 2022-05-06--zyh--add |
| | | } |
| | | if (String.valueOf(info.userAgreeDAte) >= String.valueOf(DownStartDt(info.userAgreeDAte)) && String.valueOf(info.userAgreeDAte) <= String.valueOf(DownEndDt(info.userAgreeDAte))) { |
| | | info.userAgreeDAte = DownDt(info.userAgreeDAte);//7.用户同意日(小程序) 2022-05-06--zyh--add |
| | | } |
| | | if (String.valueOf(info.engineerSendDate) >= String.valueOf(DownStartDt(info.engineerSendDate)) && String.valueOf(info.engineerSendDate) <= String.valueOf(DownEndDt(info.engineerSendDate))) { |
| | | info.engineerSendDate = DownDt(info.engineerSendDate);//工程师修理品寄送日 2022-05-06--zyh--add |
| | | } |
| | | //定义上班时间 |
| | | if (String.valueOf(info.FirstQuotationDate) >= String.valueOf(UpStartDt(info.FirstQuotationDate)) && String.valueOf(info.FirstQuotationDate) <= String.valueOf(UpEndDt(info.FirstQuotationDate))) { |
| | | info.FirstQuotationDate = UpDt(info.FirstQuotationDate);//初次报价日 |
| | | } |
| | | if (String.valueOf(info.RCacceptanceDate) >= String.valueOf(UpStartDt(info.RCacceptanceDate)) && String.valueOf(info.RCacceptanceDate) <= String.valueOf(UpEndDt(info.RCacceptanceDate))) { |
| | | info.RCacceptanceDate = UpDt(info.RCacceptanceDate);//4.修理品RC受理日 |
| | | } |
| | | if (String.valueOf(info.quotationDate) >= String.valueOf(UpStartDt(info.quotationDate)) && String.valueOf(info.quotationDate) <= String.valueOf(UpEndDt(info.quotationDate))) { |
| | | info.quotationDate = UpDt(info.quotationDate);//报价日 |
| | | } |
| | | if (String.valueOf(info.FSErepairApplyDate) >= String.valueOf(UpStartDt(info.FSErepairApplyDate)) && String.valueOf(info.FSErepairApplyDate) <= String.valueOf(UpEndDt(info.FSErepairApplyDate))) { |
| | | info.FSErepairApplyDate = UpDt(info.FSErepairApplyDate);//FSE修理申请时间 2022-05-06--zyh--add |
| | | } |
| | | if (String.valueOf(info.RCreturnDate) >= String.valueOf(UpStartDt(info.RCreturnDate)) && String.valueOf(info.RCreturnDate) <= String.valueOf(UpEndDt(info.RCreturnDate))) { |
| | | info.RCreturnDate = UpDt(info.RCreturnDate);//RC修理品返送日 2022-05-06--zyh--add |
| | | } |
| | | if (String.valueOf(info.finalTestDate) >= String.valueOf(UpStartDt(info.finalTestDate)) && String.valueOf(info.finalTestDate) <= String.valueOf(UpEndDt(info.finalTestDate))) { |
| | | info.finalTestDate = UpDt(info.finalTestDate);//10.最终检测日(小程序) 2022-05-06--zyh--add |
| | | } |
| | | if (String.valueOf(info.userAgreeDAte) >= String.valueOf(UpStartDt(info.userAgreeDAte)) && String.valueOf(info.userAgreeDAte) <= String.valueOf(UpEndDt(info.userAgreeDAte))) { |
| | | info.userAgreeDAte = UpDt(info.userAgreeDAte);//7.用户同意日(小程序) 2022-05-06--zyh--add |
| | | } |
| | | if (String.valueOf(info.engineerSendDate) >= String.valueOf(UpStartDt(info.engineerSendDate)) && String.valueOf(info.engineerSendDate) <= String.valueOf(UpEndDt(info.engineerSendDate))) { |
| | | info.engineerSendDate = UpDt(info.engineerSendDate);//工程师修理品寄送日 2022-05-06--zyh--add |
| | | } |
| | | //报价日、初次报价日、RC修理品RC受理日(小程序)时间判断 zyh 20220315 end |
| | | repairs.add(info); |
| | | System.debug('repairs1:' + repairs); |
| | | } |
| | | logstr += '\nend'; |
| | | if (repairs.size() > 0) { |
| | | rowData = NFMUtil.makeRowData(iflog, LOG_TYPE, repairs); |
| | | execute(rowData, iflog); |
| | | // 2022-05-05 zyh update start |
| | | for (RepairOrderInfo roi : repairs ) { |
| | | repairs1.add(roi); |
| | | rowData = NFMUtil.makeRowData(iflog, LOG_TYPE, repairs1); |
| | | // 2022-05-07 zyh update start |
| | | if (String.isBlank(rowData.MessageGroupNumber__c)) { |
| | | rowData.MessageGroupNumber__c = nowStr; |
| | | } |
| | | // 2022-05-07 zyh update end |
| | | execute1(rowData, iflog); |
| | | // rowData = NFMUtil.makeRowData(iflog, LOG_TYPE, repairs); |
| | | // execute(rowData, iflog); |
| | | repairs1 = new List < RepairOrderInfo > (); |
| | | } |
| | | upsert logList; |
| | | upsert rowList; |
| | | delete logMap.values(); |
| | | // 2022-05-05 zyh update end |
| | | // upsert rowData; |
| | | } |
| | | } catch (Exception e) { |
| | | // 发生错误时 |
| | |
| | | logstr += ex.getMessage(); |
| | | iflog.ErrorLog__c += ex.getMessage() + '\n'; |
| | | iflog.ErrorLog__c += ex.getStackTraceString() + '\n'; |
| | | rowDataSFDC = NFMUtil.LogAutoSend(rowDataSFDC, ex, null); |
| | | if(!Test.isRunningTest()){ |
| | | rowDataSFDC = NFMUtil.LogAutoSend(rowDataSFDC, ex, null); |
| | | } |
| | | } |
| | | iflog.Log__c = logstr; |
| | | upsert iflog; |
| | | upsert rowDataSFDC; |
| | | // logList.add(iflog); |
| | | // rowList.add(rowDataSFDC); |
| | | |
| | | } |
| | | // 2022-05-05 zyh update start |
| | | public static void execute1(BatchIF_Log__c rowDataSFDC, BatchIF_Log__c iflog) { |
| | | Integer batch_retry_max_cnt = Integer.valueOf(System.Label.batch_retry_max_cnt); |
| | | |
| | | String logstr = rowDataSFDC.MessageGroupNumber__c + ' start\n'; |
| | | if (iflog == null) { |
| | | iflog = new BatchIF_Log__c(); |
| | | iflog.Type__c = LOG_TYPE; |
| | | iflog.MessageGroupNumber__c = rowDataSFDC.MessageGroupNumber__c; |
| | | iflog.Log__c = logstr; |
| | | iflog.ErrorLog__c = ''; |
| | | |
| | | } else { |
| | | // iflog.Type__c = LOG_TYPE; |
| | | // iflog.MessageGroupNumber__c = rowDataSFDC.MessageGroupNumber__c; |
| | | // logstr = iflog.Log__c; |
| | | logMap.put(iflog.Id, iflog); |
| | | iflog = new BatchIF_Log__c(); |
| | | iflog.Type__c = LOG_TYPE; |
| | | iflog.MessageGroupNumber__c = rowDataSFDC.MessageGroupNumber__c; |
| | | iflog.Log__c = logstr; |
| | | iflog.ErrorLog__c = ''; |
| | | } |
| | | |
| | | try { |
| | | String data = NFMUtil.getRowDataStr(rowDataSFDC); |
| | | String status = NFMUtil.sendToAWS(data, API); |
| | | System.debug('NFM603Log--status->' + status); |
| | | |
| | | if ('OK'.equals(status)) { |
| | | logstr += status + '\n'; |
| | | rowDataSFDC.retry_cnt__c = 0; |
| | | } else { |
| | | rowDataSFDC = NFMUtil.LogAutoSend(rowDataSFDC, null, status); |
| | | } |
| | | |
| | | } catch (Exception ex) { |
| | | // TODO IOException |
| | | // 错误发生时 |
| | | logstr += ex.getMessage(); |
| | | iflog.ErrorLog__c += ex.getMessage() + '\n'; |
| | | iflog.ErrorLog__c += ex.getStackTraceString() + '\n'; |
| | | if(!Test.isRunningTest()){ |
| | | rowDataSFDC = NFMUtil.LogAutoSend(rowDataSFDC, ex, null); |
| | | } |
| | | } |
| | | iflog.Log__c = logstr; |
| | | // upsert iflog; |
| | | // upsert rowDataSFDC; |
| | | logList.add(iflog); |
| | | rowList.add(rowDataSFDC); |
| | | |
| | | } |
| | | |
| | | // 2022-05-05 zyh update end |
| | | // 故障描述 |
| | | private static Map < id, List < FaultDesc >> getFaultDescMap(List < String > repairOrderIdList) { |
| | | List < Repair_reason__c > reasonList = |
| | |
| | | |
| | | public static Set < Id > NFM603_Ids = new Set < Id > (); |
| | | // public static Map<Id,Id> rprIdMap = new Map<Id,Id>(); |
| | | |
| | | |
| | | public static void NFM603Trigger(List < Repair__c > newList, Map < Id, Repair__c > newMap, List < Repair__c > oldList, Map < Id, Repair__c > oldMap) { |
| | | List < String > rprIds = new List < String > (); |
| | | Map < Id, Id > rprIdMap = new Map < Id, Id > (); |
| | |
| | | Repair__c oldrpr = oldMap.get(rpr.Id); |
| | | // 修理有报修子单号,并且 待发送AWS为false 发送给AWS |
| | | if (String.isNotBlank(rpr.RepairSubOrder__c) && !rpr.AwaitToSendAWS__c) { |
| | | if (((rpr.status__c == '0.申请完毕' || rpr.status__c == '1.受理完毕') && (oldrpr.SAP_Transfer_time__c == null && rpr.SAP_Transfer_time__c != null)) || (rpr.Address_type__c == 'X' && (rpr.Address_Type_Index__c != oldrpr.Address_Type_Index__c))) { |
| | | if (((rpr.status__c == '0.申请完毕' || rpr.status__c == '1.受理完毕') && (oldrpr.SAP_Transfer_time__c == null && rpr.SAP_Transfer_time__c != null)) || |
| | | (rpr.Address_type__c == 'X' && (rpr.Address_Type_Index__c != oldrpr.Address_Type_Index__c)) || |
| | | // 2022/4/6 zhangyuheng update start |
| | | (rpr.OTSRepairOrder__c != oldrpr.OTSRepairOrder__c) || // OTS订单号有值,发送AWS |
| | | // 2022/4/6 zhangyuheng update end |
| | | // 2022/4/7 zhangyuheng update start |
| | | (rpr.DeliveryLogisticsNo__c != oldrpr.DeliveryLogisticsNo__c) || // 送修物流单号有值,发送AWS |
| | | // ((rpr.Discount_Price_formula__c != oldrpr.Discount_Price_formula__c) && rpr.Repair_Firstestimated_Date_formula__c != null) || // 报价金额发生改变且初次报价日有值,发送AWS |
| | | ((rpr.Returns_Product_waySAP__c != oldrpr.Returns_Product_waySAP__c) && rpr.Repair_Shipped_DateTime__c != null) || // 送修方式发生改变且寄送日有值,发送AWS |
| | | // 2022/4/7 zhangyuheng update end |
| | | // 2022/4/18 zhangyuheng update start |
| | | (rpr.FSE_ApplyForRepair_time__c != oldrpr.FSE_ApplyForRepair_time__c) || // FSE申请修理日发生改变,发送AWS |
| | | (rpr.Repair_Ordered_DateTime__c != oldrpr.Repair_Ordered_DateTime__c) || // 4.修理品RC受理日(小程序)发生改变,发送AWS |
| | | (rpr.Repair_Firstestimated_Date__c != oldrpr.Repair_Firstestimated_Date__c) || // 初次报价日(不用)发生改变,发送AWS |
| | | (rpr.Repair_Shipped_DateTime__c != oldrpr.Repair_Shipped_DateTime__c) || // 11.RC修理品返送日(小程序)发生改变,发送AWS |
| | | (rpr.Repair_Final_Inspection_DateTime__c != oldrpr.Repair_Final_Inspection_DateTime__c) || // 10.最终检测日(小程序)发生改变,发送AWS |
| | | (rpr.Agreed_DateTime__c != oldrpr.Agreed_DateTime__c) || //7.用户同意日(小程序)发生改变,发送AWS |
| | | (rpr.Agreed_Date__c != oldrpr.Agreed_Date__c) || // 7.用户同意日发生改变,发送AWS |
| | | (rpr.engineerSendDate__c != oldrpr.engineerSendDate__c) //修理品寄送日发生改变,发送AWS |
| | | // 2022/4/18 zhangyuheng update start |
| | | ) { |
| | | |
| | | if (NFM603Controller.NFM603_Ids.contains(rpr.Id) == false) { |
| | | NFM603Controller.NFM603_Ids.add(rpr.Id); |
| | | rprIdMap.put(rpr.Id, rpr.Id); |
| | | } |
| | | } |
| | | // 2022/4/19 zhangyuheng update start |
| | | // 如果同期中的修理报价(Repair_Quotation_Id__c)为空,判断初次报价日和报价金额 |
| | | if (rpr.Repair_Quotation_Id__c != oldrpr.Repair_Quotation_Id__c) { |
| | | if (NFM603Controller.NFM603_Ids.contains(rpr.Id) == false) { |
| | | NFM603Controller.NFM603_Ids.add(rpr.Id); |
| | | rprIdMap.put(rpr.Id, rpr.Id); |
| | | } |
| | | } |
| | | if (rpr.Repair_Quotation_Id__c == null) { |
| | | // 如果初次报价日(不用)或折扣后金额(不用)发生改变,发送AWS |
| | | if (rpr.Discount_Price__c != oldrpr.Discount_Price__c || rpr.Repair_Estimated_Date__c != oldrpr.Repair_Estimated_Date__c) { |
| | | if (NFM603Controller.NFM603_Ids.contains(rpr.Id) == false) { |
| | | NFM603Controller.NFM603_Ids.add(rpr.Id); |
| | | rprIdMap.put(rpr.Id, rpr.Id); |
| | | } |
| | | } |
| | | } |
| | | // 如果同期中的修理报价(Repair_Quotation_Id__c)不为空,在RepairQuoteTrigger.ChangeRepair进行判断触发 |
| | | // 2022/4/19 zhangyuheng update end |
| | | |
| | | // 2022/4/6 zhangyuheng update start |
| | | //OTS订单号有值,发送AWS |
| | | // if ((oldrpr.OTSRepairOrder__c == null && String.isNotBlank(rpr.OTSRepairOrder__c)) || rpr.OTSRepairOrder__c != oldrpr.OTSRepairOrder__c) { |
| | | // if (NFM603Controller.NFM603_Ids.contains(rpr.Id) == false) { |
| | | // NFM603Controller.NFM603_Ids.add(rpr.Id); |
| | | // rprIdMap.put(rpr.Id, rpr.Id); |
| | | // } |
| | | // } |
| | | // 2022/4/6 zhangyuheng update end |
| | | // 2022/4/7 zhangyuheng update start |
| | | //送修物流单号有值,发送AWS |
| | | // if ((oldrpr.DeliveryLogisticsNo__c == null && String.isNotBlank(rpr.DeliveryLogisticsNo__c)) || rpr.DeliveryLogisticsNo__c != oldrpr.DeliveryLogisticsNo__c) { |
| | | // if (NFM603Controller.NFM603_Ids.contains(rpr.Id) == false) { |
| | | // NFM603Controller.NFM603_Ids.add(rpr.Id); |
| | | // rprIdMap.put(rpr.Id, rpr.Id); |
| | | // } |
| | | // } |
| | | //报价金额发生改变且初次报价日有值,发送AWS |
| | | // if ((rpr.Discount_Price_formula__c != oldrpr.Discount_Price_formula__c) && rpr.Repair_Firstestimated_Date_formula__c != null) { |
| | | // if (NFM603Controller.NFM603_Ids.contains(rpr.Id) == false) { |
| | | // NFM603Controller.NFM603_Ids.add(rpr.Id); |
| | | // rprIdMap.put(rpr.Id, rpr.Id); |
| | | // } |
| | | // } |
| | | // if ((rpr.Returns_Product_waySAP__c != oldrpr.Returns_Product_waySAP__c) && rpr.Repair_Shipped_DateTime__c != null) { |
| | | // if (NFM603Controller.NFM603_Ids.contains(rpr.Id) == false) { |
| | | // NFM603Controller.NFM603_Ids.add(rpr.Id); |
| | | // rprIdMap.put(rpr.Id, rpr.Id); |
| | | // } |
| | | // } |
| | | // 2022/4/7 zhangyuheng update end |
| | | // 2022/4/18 zhangyuheng update start |
| | | // FSE申请修理日发生改变,发送AWS |
| | | // if (rpr.FSE_ApplyForRepair_time__c != oldrpr.FSE_ApplyForRepair_time__c) { |
| | | // if (NFM603Controller.NFM603_Ids.contains(rpr.Id) == false) { |
| | | // NFM603Controller.NFM603_Ids.add(rpr.Id); |
| | | // rprIdMap.put(rpr.Id, rpr.Id); |
| | | // } |
| | | // } |
| | | // 4.修理品RC受理日(小程序)发生改变,发送AWS |
| | | // if (rpr.Repair_Ordered_DateTime__c != oldrpr.Repair_Ordered_DateTime__c) { |
| | | // if (NFM603Controller.NFM603_Ids.contains(rpr.Id) == false) { |
| | | // NFM603Controller.NFM603_Ids.add(rpr.Id); |
| | | // rprIdMap.put(rpr.Id, rpr.Id); |
| | | // } |
| | | // } |
| | | // 初次报价日(不用)发生改变,发送AWS |
| | | // if (rpr.Repair_Firstestimated_Date__c != oldrpr.Repair_Firstestimated_Date__c) { |
| | | // if (NFM603Controller.NFM603_Ids.contains(rpr.Id) == false) { |
| | | // NFM603Controller.NFM603_Ids.add(rpr.Id); |
| | | // rprIdMap.put(rpr.Id, rpr.Id); |
| | | // } |
| | | // } |
| | | // 11.RC修理品返送日(小程序)发生改变,发送AWS |
| | | // if (rpr.Repair_Shipped_DateTime__c != oldrpr.Repair_Shipped_DateTime__c) { |
| | | // if (NFM603Controller.NFM603_Ids.contains(rpr.Id) == false) { |
| | | // NFM603Controller.NFM603_Ids.add(rpr.Id); |
| | | // rprIdMap.put(rpr.Id, rpr.Id); |
| | | // } |
| | | // } |
| | | // 10.最终检测日(小程序)发生改变,发送AWS |
| | | // if (rpr.Repair_Final_Inspection_DateTime__c != oldrpr.Repair_Final_Inspection_DateTime__c) { |
| | | // if (NFM603Controller.NFM603_Ids.contains(rpr.Id) == false) { |
| | | // NFM603Controller.NFM603_Ids.add(rpr.Id); |
| | | // rprIdMap.put(rpr.Id, rpr.Id); |
| | | // } |
| | | // } |
| | | // 2022/4/18 zhangyuheng update end |
| | | // 测试环境测试用,上线前请注掉 |
| | | if (rpr.Repair_Firstestimated_Date__c != oldrpr.Repair_Firstestimated_Date__c) { |
| | | if (NFM603Controller.NFM603_Ids.contains(rpr.Id) == false) { |
| | | NFM603Controller.NFM603_Ids.add(rpr.Id); |
| | | // rprIds.add(rpr.Id); |
| | | rprIdMap.put(rpr.Id, rpr.Id); |
| | | } |
| | | } |
| | | if (rpr.Repair_Shipped_Date__c != oldrpr.Repair_Shipped_Date__c) { |
| | | if (NFM603Controller.NFM603_Ids.contains(rpr.Id) == false) { |
| | | NFM603Controller.NFM603_Ids.add(rpr.Id); |
| | | rprIdMap.put(rpr.Id, rpr.Id); |
| | | } |
| | | } |
| | | // if (rpr.Repair_Firstestimated_Date__c != oldrpr.Repair_Firstestimated_Date__c) { |
| | | // if (NFM603Controller.NFM603_Ids.contains(rpr.Id) == false) { |
| | | // NFM603Controller.NFM603_Ids.add(rpr.Id); |
| | | // // rprIds.add(rpr.Id); |
| | | // rprIdMap.put(rpr.Id, rpr.Id); |
| | | // } |
| | | // } |
| | | // if (rpr.Repair_Shipped_Date__c != oldrpr.Repair_Shipped_Date__c) { |
| | | // if (NFM603Controller.NFM603_Ids.contains(rpr.Id) == false) { |
| | | // NFM603Controller.NFM603_Ids.add(rpr.Id); |
| | | // rprIdMap.put(rpr.Id, rpr.Id); |
| | | // } |
| | | // } |
| | | // 测试环境测试用,上线前请注掉 |
| | | } |
| | | |
| | |
| | | iflog.Type__c = LOG_TYPE; |
| | | iflog.Log__c = 'callout start\n'; |
| | | insert iflog; |
| | | NFM603Controller.callout(iflog.Id, rprIds); |
| | | // 2022-04-29 zyh update start |
| | | if(UserInfo.getUserId().equals(System.Label.interfaceUserID)){ |
| | | NFM603Controller.executefuture(iflog, rprIds); |
| | | }else{ |
| | | NFM603Controller.callout(iflog.Id, rprIds); |
| | | } |
| | | // 2022-04-29 zyh update end |
| | | } |
| | | } else { |
| | | if (Trigger.isUpdate) { |
| | |
| | | } |
| | | } |
| | | } |
| | | |
| | | //报价日、初次报价日、RC修理品RC受理日(小程序)时间方法 zyh 20220315 start |
| | | //下班开始时间 |
| | | public static String DownStartDt(String dt){ |
| | | // String timenow = Datetime.now().format('yyyyMMddHHmmss'); 2022-5-10 zyh update |
| | | // String dt = NFMUtil.formatDate2Str(Date.today()); 2022-5-10 zyh update |
| | | String rtn = null; |
| | | if (dt == null) { |
| | | return rtn; |
| | | } |
| | | dt = dt.substring(0,8); // 2022-5-10 zyh update |
| | | rtn = String.valueOf(dt); |
| | | rtn = rtn.replaceAll('-', ''); |
| | | if (rtn >= '40001231') { |
| | | rtn = '99991231'; |
| | | } else if (rtn < '19000101') { |
| | | rtn = '19000101'; |
| | | } |
| | | return rtn + '173001'; |
| | | } |
| | | //下班结束时间 |
| | | public static String DownEndDt(String dt){ |
| | | // String dt = NFMUtil.formatDate2Str(Date.today()); 2022-5-10 zyh update |
| | | String rtn = null; |
| | | if (dt == null) { |
| | | return rtn; |
| | | } |
| | | dt = dt.substring(0,8); // 2022-5-10 zyh update |
| | | rtn = String.valueOf(dt); |
| | | rtn = rtn.replaceAll('-', ''); |
| | | if (rtn >= '40001231') { |
| | | rtn = '99991231'; |
| | | } else if (rtn < '19000101') { |
| | | rtn = '19000101'; |
| | | } |
| | | return rtn + '235959'; |
| | | } |
| | | //上班开始时间 |
| | | public static String UpStartDt(String dt){ |
| | | // String dt = NFMUtil.formatDate2Str(Date.today()); 2022-5-10 zyh update |
| | | String rtn = null; |
| | | if (dt == null) { |
| | | return rtn; |
| | | } |
| | | dt = dt.substring(0,8); // 2022-5-10 zyh update |
| | | rtn = String.valueOf(dt); |
| | | rtn = rtn.replaceAll('-', ''); |
| | | if (rtn >= '40001231') { |
| | | rtn = '99991231'; |
| | | } else if (rtn < '19000101') { |
| | | rtn = '19000101'; |
| | | } |
| | | return rtn + '000000'; |
| | | } |
| | | //上班结束时间 |
| | | public static String UpEndDt(String dt){ |
| | | // String dt = NFMUtil.formatDate2Str(Date.today()); 2022-5-10 zyh update |
| | | String rtn = null; |
| | | if (dt == null) { |
| | | return rtn; |
| | | } |
| | | dt = dt.substring(0,8); // 2022-5-10 zyh update |
| | | rtn = String.valueOf(dt); |
| | | rtn = rtn.replaceAll('-', ''); |
| | | if (rtn >= '40001231') { |
| | | rtn = '99991231'; |
| | | } else if (rtn < '19000101') { |
| | | rtn = '19000101'; |
| | | } |
| | | return rtn + '084459'; |
| | | } |
| | | //上班定义时间 |
| | | public static String UpDt(String dt){ |
| | | // String dt = NFMUtil.formatDate2Str(Date.today()); 2022-5-10 zyh update |
| | | String rtn = null; |
| | | if (dt == null) { |
| | | return rtn; |
| | | } |
| | | dt = dt.substring(0,8); // 2022-5-10 zyh update |
| | | rtn = String.valueOf(dt); |
| | | rtn = rtn.replaceAll('-', ''); |
| | | if (rtn >= '40001231') { |
| | | rtn = '99991231'; |
| | | } else if (rtn < '19000101') { |
| | | rtn = '19000101'; |
| | | } |
| | | return rtn + '090000'; |
| | | } |
| | | //下班定义时间 |
| | | public static String DownDt(String dt){ |
| | | // String dt = NFMUtil.formatDate2Str(Date.today()); 2022-5-10 zyh update |
| | | String rtn = null; |
| | | if (dt == null) { |
| | | return rtn; |
| | | } |
| | | dt = dt.substring(0,8); // 2022-5-10 zyh update |
| | | rtn = String.valueOf(dt); |
| | | rtn = rtn.replaceAll('-', ''); |
| | | if (rtn >= '40001231') { |
| | | rtn = '99991231'; |
| | | } else if (rtn < '19000101') { |
| | | rtn = '19000101'; |
| | | } |
| | | return rtn + '170000'; |
| | | } |
| | | //报价日、初次报价日、RC修理品RC受理日(小程序)时间方法 zyh 20220315 end |
| | | |
| | | } |