| | |
| | | public with sharing class QISReportController { |
| | | // Final universal code编辑 |
| | | @AuraEnabled |
| | | public static InitData initForQisUniversalFailureCodeButton (String recordId){ |
| | | InitData res = new initData(); |
| | |
| | | @AuraEnabled |
| | | public static InitData sqlForPAE (String qisReportId){ |
| | | InitData res = new initData(); |
| | | String RecordTypeId = 'ASACDecision'; |
| | | |
| | | String recordTypeId = LightingButtonConstant.DEVELOPER_NAME_ASAC_DECISION; |
| | | try{ |
| | | PAE_DecisionRecord__c RCPAED_IdList = [SELECT LastModifiedDate, Id, Name, LastModifiedById,RecordType.DeveloperName FROM PAE_DecisionRecord__c where PAE_QIS__c = :qisReportId And RecordType.DeveloperName = :RecordTypeId limit 1]; |
| | | res.PAEid = RCPAED_IdList.id; |
| | | PAE_DecisionRecord__c RCPAEDIdList = [SELECT LastModifiedDate, Id, Name, LastModifiedById,RecordType.DeveloperName FROM PAE_DecisionRecord__c where PAE_QIS__c = :qisReportId And RecordType.DeveloperName = :recordTypeId limit 1]; |
| | | res.pAEid = RCPAEDIdList.id; |
| | | System.debug(LoggingLevel.INFO, '*** res: ' + res); |
| | | }catch(Exception e){ |
| | | System.debug(LoggingLevel.INFO, '*** e: ' + e); |
| | |
| | | return res; |
| | | } |
| | | |
| | | //Intake universal code编辑 |
| | | @AuraEnabled |
| | | public static InitData initForlexQISIntakeuniversalcodeButton (String recordId){ |
| | | InitData res = new initData(); |
| | | try{ |
| | | QIS_Report__c report = [SELECT id FROM QIS_Report__c WHERE Id = :recordId LIMIT 1]; |
| | | res.Id = report.Id; |
| | | System.debug(LoggingLevel.INFO, '*** res: ' + res); |
| | | }catch(Exception e){ |
| | | System.debug(LoggingLevel.INFO, '*** e: ' + e); |
| | | } |
| | | return res; |
| | | } |
| | | |
| | | @AuraEnabled |
| | | public static InitData sqlForPAE1 (String qisReportId){ |
| | | InitData res = new initData(); |
| | | |
| | | String recordTypeId = LightingButtonConstant.DEVELOPER_NAME_ASRC_DECISION; |
| | | try{ |
| | | PAE_DecisionRecord__c ASRCDIdList = [SELECT LastModifiedDate, Id, Name, LastModifiedById,RecordType.DeveloperName FROM PAE_DecisionRecord__c where PAE_QIS__c = :qisReportId And RecordType.DeveloperName = :recordTypeId Limit 1]; |
| | | res.pAEid = ASRCDIdList.id; |
| | | System.debug(LoggingLevel.INFO, '*** res: ' + res); |
| | | }catch(Exception e){ |
| | | System.debug(LoggingLevel.INFO, '*** e: ' + e); |
| | | } |
| | | return res; |
| | | } |
| | | //OSH现品收到 |
| | | @AuraEnabled |
| | | public static InitData initForOSHRecievedButton (String recordId){ |
| | | InitData res = new initData(); |
| | |
| | | String re = '成功'; |
| | | try{ |
| | | ID myUserID = UserInfo.getUserId(); |
| | | |
| | | User tempUser = [select id,Alias,Email from user where id = : myUserID ]; |
| | | QIS_Report__c rac = new QIS_Report__c(); |
| | | rac.id = recordId; |
| | | rac.QIS_Status__c = 'OSH检测中'; |
| | | // 待补充 |
| | | rac.QIS_Status__c = LightingButtonConstant.STATUS_QIS_OSH_TESTING; |
| | | rac.OSHRecievedDate__c = Date.today(); |
| | | System.debug( 'OSHRecievedDate__c=' + rac.OSHRecievedDate__c); |
| | | rac.OSH_Receive_staff__c = tempUser.Alias; |
| | | rac.OSH_staff__c = tempUser.Alias; |
| | | rac.OSH_staff_email__c = tempUser.email; |
| | |
| | | return re; |
| | | } |
| | | |
| | | |
| | | //提交待审批1 |
| | | @AuraEnabled |
| | | public static InitData initForOSHSubmitButton (String recordId){ |
| | | InitData res = new initData(); |
| | |
| | | public static String updateQis1 (String recordId){ |
| | | String re = '成功'; |
| | | try{ |
| | | |
| | | QIS_Report__c rac = new QIS_Report__c(); |
| | | rac.id = recordId; |
| | | rac.QIS_Status__c = 'OSH填写完毕'; |
| | | rac.QIS_Status__c = LightingButtonConstant.STATUS_QIS_OSH_COMPLATED; |
| | | update rac; |
| | | }catch(Exception e){ |
| | | System.debug(LoggingLevel.INFO, '*** e: ' + e); |
| | |
| | | } |
| | | return re; |
| | | } |
| | | |
| | | //提交待审批 |
| | | @AuraEnabled |
| | | public static InitData initForRCSubmitButton (String recordId){ |
| | | InitData res = new initData(); |
| | |
| | | @AuraEnabled |
| | | public static String updateQisWithRC (String recordId,String type,String oldQIStatus){ |
| | | String re = '成功'; |
| | | |
| | | ID myUserID = UserInfo.getUserId(); |
| | | User userinfo = [SELECT Id, JingliApprovalManager__c, BuchangApprovalManager__c, ZongjianApprovalManager__c, BuchangApprovalManagerSales__c, SalesManager__c FROM User WHERE Id = :myUserID LIMIT 1]; |
| | | QIS_Report__c rac = new QIS_Report__c(); |
| | | rac.id = recordId; |
| | | if (type == '1') { |
| | | QIS_Report__c report1 = [SELECT id,RC_problem_not_found__c,RC_FixedJudgement__c FROM QIS_Report__c WHERE Id = :recordId LIMIT 1]; |
| | | rac.QIS_Status__c = 'RC填写完毕'; |
| | | rac.QIS_Status__c = LightingButtonConstant.STATUS_QIS_RC_COMPLATED; |
| | | if (report1.RC_problem_not_found__c == true && report1.RC_FixedJudgement__c == false) { |
| | | QIS_Report__c qisreport = [SELECT Id, Reason_bloken__c, Special_follow__c, next_action__c, QIS_Reply_Comment__c, OCM_judgement__c FROM QIS_Report__c WHERE Id = :recordId LIMIT 1]; |
| | | if (qisreport != null) { |
| | |
| | | } |
| | | } |
| | | if (type == '2') { |
| | | rac.QIS_Status__c = '取消申请'; |
| | | rac.QIS_Status__c = LightingButtonConstant.STATUS_QIS_CANCEL; |
| | | rac.QIS_Cancel_Submit_day__c = Date.today(); |
| | | } |
| | | try{ |
| | |
| | | rac.RC_Manager__c = myUserID; |
| | | } |
| | | if (userinfo!=null) { |
| | | if (oldQIStatus == 'RC检测中') { |
| | | if (oldQIStatus == LightingButtonConstant.STATUS_QIS_RC_CHECKING) { |
| | | rac.RC__c = myUserID; |
| | | } |
| | | if (userinfo.SalesManager__c != null ) { |
| | |
| | | } |
| | | return re; |
| | | } |
| | | |
| | | // 提交 |
| | | @AuraEnabled |
| | | public static InitData initForOCMSubmitButton (String recordId){ |
| | | InitData res = new initData(); |
| | |
| | | try{ |
| | | QIS_Report__c rac = new QIS_Report__c(); |
| | | rac.id = recordId; |
| | | rac.QIS_Status__c = 'FSE填写完毕'; |
| | | rac.QIS_Status__c = LightingButtonConstant.STATUS_QIS_FSE_COMPLATED; |
| | | rac.OCM_Manager_Mail__c = report.OCM_Manager_Mail_F__c; |
| | | rac.OCM_Member_Mail__c = report.OCM_Member_Mail_F__c; |
| | | rac.OCM_Repair_Mail__c = report.OCM_Repair_Mail_F__c; |
| | |
| | | if (report.is_aohui_product__c == true) { |
| | | rac.OCM_judgement__c = '质量问题'; |
| | | rac.next_action__c = '无偿维修'; |
| | | rac.RecordTypeId = '01210000000RLWm'; |
| | | rac.QIS_Status__c = 'OSH检测申请'; |
| | | rac.RecordTypeId = Schema.SObjectType.QIS_Report__c.getRecordTypeInfosByName().get(LightingButtonConstant.RECORD_TYPE_NAME_BY_OSH).getRecordTypeId(); |
| | | rac.QIS_Status__c = LightingButtonConstant.STATUS_QIS_OSH_TESTING_APP; |
| | | } |
| | | if (report.QuolityApproveResult__c == null || report.QuolityApproveResult__c == '') { |
| | | rac.QuolityApproveResult__c = '3.已审核,一般质量问题'; |
| | |
| | | } |
| | | return re; |
| | | } |
| | | |
| | | // QIS结果跟进完毕 |
| | | @AuraEnabled |
| | | public static InitData initForQisAgreeButton (String recordId){ |
| | | InitData res = new initData(); |
| | | try{ |
| | | QIS_Report__c report = [SELECT id ,OwnerId FROM QIS_Report__c WHERE Id = :recordId LIMIT 1]; |
| | | res.Id = report.Id; |
| | | res.ownerId = report.OwnerId; |
| | | System.debug(LoggingLevel.INFO, '*** res: ' + res); |
| | | }catch(Exception e){ |
| | | System.debug(LoggingLevel.INFO, '*** e: ' + e); |
| | | } |
| | | return res; |
| | | } |
| | | |
| | | @AuraEnabled |
| | | public static String updateQisForQisAgree (String recordId){ |
| | | String re = '成功'; |
| | | ID myUserID = UserInfo.getUserId(); |
| | | |
| | | String answerComp = Schema.SObjectType.QIS_Report__c.getRecordTypeInfosByName().get(LightingButtonConstant.RECORD_TYPE_NAME_BY_OSH_FINASH).getRecordTypeId(); |
| | | String fina = Schema.SObjectType.QIS_Report__c.getRecordTypeInfosByName().get(LightingButtonConstant.RECORD_TYPE_NAME_BY_FINAL).getRecordTypeId(); |
| | | String comp = Schema.SObjectType.QIS_Report__c.getRecordTypeInfosByName().get(LightingButtonConstant.RECORD_TYPE_NAME_BY_COMP).getRecordTypeId(); |
| | | // RecordType rectyp = [SELECT id ,name FROM RecordType where id = '01210000000gFTH']; |
| | | QIS_Report__c report = [SELECT id,OwnerId,RecordTypeId FROM QIS_Report__c WHERE Id = :recordId LIMIT 1]; |
| | | try{ |
| | | if (report.ownerid == myUserID) { |
| | | QIS_Report__c rac = new QIS_Report__c(); |
| | | rac.id = recordId; |
| | | rac.QIS_Status__c = LightingButtonConstant.STATUS_QIS_COMPLATED; |
| | | if (report.RecordTypeId == answerComp) { |
| | | rac.RecordTypeId = fina; |
| | | }else{ |
| | | rac.RecordTypeId = comp; |
| | | } |
| | | rac.QIS_Complete_Day__c = Date.today(); |
| | | update rac; |
| | | } |
| | | |
| | | }catch(Exception e){ |
| | | System.debug(LoggingLevel.INFO, '*** e: ' + e); |
| | | re = e.getMessage(); |
| | | } |
| | | return re; |
| | | } |
| | | //OCSM服务本部CDS完毕 |
| | | @AuraEnabled |
| | | public static InitData initForRCCDScompleteButton (String recordId){ |
| | | InitData res = new initData(); |
| | | try{ |
| | | QIS_Report__c report = [SELECT id ,CDS_date__c,QIS_Status__c FROM QIS_Report__c WHERE Id = :recordId LIMIT 1]; |
| | | res.Id = report.Id; |
| | | res.cdsdate = report.CDS_date__c; |
| | | res.QIStatus = report.QIS_Status__c; |
| | | System.debug(LoggingLevel.INFO, '*** res: ' + res); |
| | | }catch(Exception e){ |
| | | System.debug(LoggingLevel.INFO, '*** e: ' + e); |
| | | } |
| | | return res; |
| | | } |
| | | |
| | | @AuraEnabled |
| | | public static String updateQisForRCCDScomplete (String recordId){ |
| | | String re = '成功'; |
| | | ID myUserID = UserInfo.getUserId(); |
| | | User userinfo = [SELECT id,Alias__c FROM User WHERE Id = :myUserID LIMIT 1]; |
| | | QIS_Report__c report = [SELECT id FROM QIS_Report__c WHERE Id = :recordId LIMIT 1]; |
| | | try{ |
| | | QIS_Report__c rac = new QIS_Report__c(); |
| | | rac.id = recordId; |
| | | rac.CDS_date__c = Date.today(); |
| | | rac.RC_CDS_staff__c = userinfo.Alias__c; |
| | | update rac; |
| | | }catch(Exception e){ |
| | | System.debug(LoggingLevel.INFO, '*** e: ' + e); |
| | | re = e.getMessage(); |
| | | } |
| | | return re; |
| | | } |
| | | |
| | | //OCSM不要报告 |
| | | @AuraEnabled |
| | | public static InitData initForlexOCSMNoToReportLightingButton (String recordId){ |
| | | InitData res = new initData(); |
| | | try{ |
| | | QIS_Report__c report = [SELECT id ,OCSMAdministrativeReportNumber__c,OCSMAdministrativeReportDate__c,Aware_date__c FROM QIS_Report__c WHERE Id = :recordId LIMIT 1]; |
| | | res.Id = report.Id; |
| | | res.oCSMAdministrativeReportNumber = report.OCSMAdministrativeReportNumber__c; |
| | | res.oCSMAdministrativeReportDate = report.OCSMAdministrativeReportDate__c; |
| | | res.Awaredate = report.Aware_date__c; |
| | | System.debug(LoggingLevel.INFO, '*** res: ' + res); |
| | | }catch(Exception e){ |
| | | System.debug(LoggingLevel.INFO, '*** e: ' + e); |
| | | } |
| | | return res; |
| | | } |
| | | @AuraEnabled |
| | | public static String updateQisForlexOCSMNoToReportLighting (String recordId){ |
| | | String re = '成功'; |
| | | QIS_Report__c report = [SELECT id FROM QIS_Report__c WHERE Id = :recordId LIMIT 1]; |
| | | try{ |
| | | QIS_Report__c rac = new QIS_Report__c(); |
| | | rac.id = recordId; |
| | | rac.OCSMAdministrativeReportStatus__c = '无需报告'; |
| | | update rac; |
| | | }catch(Exception e){ |
| | | System.debug(LoggingLevel.INFO, '*** e: ' + e); |
| | | re = e.getMessage(); |
| | | } |
| | | return re; |
| | | } |
| | | //OCSM要报告 |
| | | @AuraEnabled |
| | | public static InitData initForlexOCSMToReportLightingButton (String recordId){ |
| | | InitData res = new initData(); |
| | | try{ |
| | | QIS_Report__c report = [SELECT id ,OCSMAdministrativeReportStatus__c,Aware_date__c FROM QIS_Report__c WHERE Id = :recordId LIMIT 1]; |
| | | res.Id = report.Id; |
| | | res.oCSMAdministrativeReportStatus = report.OCSMAdministrativeReportStatus__c; |
| | | res.Awaredate = report.Aware_date__c; |
| | | System.debug(LoggingLevel.INFO, '*** res: ' + res); |
| | | }catch(Exception e){ |
| | | System.debug(LoggingLevel.INFO, '*** e: ' + e); |
| | | } |
| | | return res; |
| | | } |
| | | |
| | | @AuraEnabled |
| | | public static String updateQisForlexOCSMToReportLighting (String recordId){ |
| | | String re = '成功'; |
| | | QIS_Report__c report = [SELECT id FROM QIS_Report__c WHERE Id = :recordId LIMIT 1]; |
| | | try{ |
| | | QIS_Report__c rac = new QIS_Report__c(); |
| | | rac.id = recordId; |
| | | rac.OCSMAdministrativeReportStatus__c = '待报告'; |
| | | update rac; |
| | | }catch(Exception e){ |
| | | System.debug(LoggingLevel.INFO, '*** e: ' + e); |
| | | re = e.getMessage(); |
| | | } |
| | | return re; |
| | | } |
| | | public class InitData{ |
| | | @AuraEnabled |
| | | public String Id; |
| | | @AuraEnabled |
| | | public String PAEid; |
| | | public String ownerId; |
| | | @AuraEnabled |
| | | public String QIStatus; |
| | | public String qisRecordTypeId; |
| | | @AuraEnabled |
| | | public String OSHstaff; |
| | | public String qisRecordName; |
| | | @AuraEnabled |
| | | public String OSHstaffEmail; |
| | | public String profileName; |
| | | @AuraEnabled |
| | | public String CancelQISReason; |
| | | public String isAEProfile; |
| | | @AuraEnabled |
| | | public String RCid; |
| | | public String isPAEProfile; |
| | | @AuraEnabled |
| | | public String isCNBuy; |
| | | @AuraEnabled |
| | | public String pAEid; |
| | | @AuraEnabled |
| | | public String oCSMAdministrativeReportNumber; |
| | | @AuraEnabled |
| | | public String oCSMAdministrativeReportStatus; |
| | | @AuraEnabled |
| | | public String qIStatus; |
| | | @AuraEnabled |
| | | public String oSHstaff; |
| | | @AuraEnabled |
| | | public String oSHstaffEmail; |
| | | @AuraEnabled |
| | | public String cancelQISReason; |
| | | @AuraEnabled |
| | | public String rCid; |
| | | @AuraEnabled |
| | | public String contractnumber; |
| | | @AuraEnabled |
| | | public Date RCinspectionDate; |
| | | public Date rCinspectionDate; |
| | | @AuraEnabled |
| | | public Date QISReplyDay; |
| | | public Date qISReplyDay; |
| | | @AuraEnabled |
| | | public Date QISInstallDate; |
| | | public Date qISInstallDate; |
| | | @AuraEnabled |
| | | public Boolean RCproblemnotfound; |
| | | public Date cdsdate; |
| | | @AuraEnabled |
| | | public Date awaredate; |
| | | @AuraEnabled |
| | | public Date oCSMAdministrativeReportDate; |
| | | @AuraEnabled |
| | | public Boolean rCproblemnotfound; |
| | | @AuraEnabled |
| | | public Boolean isaohuiproduct; |
| | | @AuraEnabled |
| | | public Boolean isSendQIS; |
| | | } |
| | | |
| | | } |