| | |
| | | res.profileId = UserInfo.getProfileId(); |
| | | res.userId = UserInfo.getUserId(); |
| | | res.luShengId = getUserIdByName(LightingButtonConstant.LU_SHENG_NAME); |
| | | res.huDiAnId = getUserIdByName(LightingButtonConstant.HU_DI_AN_NAME); |
| | | // res.huDiAnId = getUserIdByName(LightingButtonConstant.HU_DI_AN_NAME); |
| | | res.systemProfileId = getProfileIdByName(LightingButtonConstant.SYSTEM_PROFILE_NAME); |
| | | System.debug(LoggingLevel.INFO, '*** res: ' + res); |
| | | } catch (Exception e) { |
| | |
| | | return null; |
| | | } catch (Exception e) { |
| | | if (e.getMessage().contains(',')) { |
| | | String eMessage = e.getMessage(); |
| | | Integer left = eMessage.indexOf(','); |
| | | Integer right = eMessage.length(); |
| | | return eMessage.substring(left,right); |
| | | System.debug(LoggingLevel.INFO, '*** e: ' + e); |
| | | String exc = '' + e.getMessage(); |
| | | Integer left = exc.indexOf(':') + 1; |
| | | Integer right = exc.lastIndexOf(':'); |
| | | String str = exc.substring(left,right); |
| | | left = str.indexOf(',') + 1; |
| | | String newStr = str.substring(left); |
| | | return newStr; |
| | | }else { |
| | | return e.getMessage(); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | //OPDtoSIS操作更新相应数据 |
| | |
| | | return null; |
| | | } catch (Exception e) { |
| | | if (e.getMessage().contains(',')) { |
| | | String eMessage = e.getMessage(); |
| | | Integer left = eMessage.indexOf(','); |
| | | Integer right = eMessage.length(); |
| | | return eMessage.substring(left,right); |
| | | System.debug(LoggingLevel.INFO, '*** e: ' + e); |
| | | String exc = '' + e.getMessage(); |
| | | Integer left = exc.indexOf(':') + 1; |
| | | Integer right = exc.lastIndexOf(':'); |
| | | String str = exc.substring(left,right); |
| | | left = str.indexOf(',') + 1; |
| | | String newStr = str.substring(left); |
| | | return newStr; |
| | | }else { |
| | | return e.getMessage(); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | |
| | | return null; |
| | | } catch (Exception e) { |
| | | if (e.getMessage().contains(',')) { |
| | | String eMessage = e.getMessage(); |
| | | Integer left = eMessage.indexOf(','); |
| | | Integer right = eMessage.length(); |
| | | return eMessage.substring(left,right); |
| | | System.debug(LoggingLevel.INFO, '*** e: ' + e); |
| | | String exc = '' + e.getMessage(); |
| | | Integer left = exc.indexOf(':') + 1; |
| | | Integer right = exc.lastIndexOf(':'); |
| | | String str = exc.substring(left,right); |
| | | left = str.indexOf(',') + 1; |
| | | String newStr = str.substring(left); |
| | | return newStr; |
| | | }else { |
| | | return e.getMessage(); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | //完毕操作更新相应数据 |
| | |
| | | return null; |
| | | } catch (Exception e) { |
| | | if (e.getMessage().contains(',')) { |
| | | String eMessage = e.getMessage(); |
| | | Integer left = eMessage.indexOf(','); |
| | | Integer right = eMessage.length(); |
| | | return eMessage.substring(left,right); |
| | | System.debug(LoggingLevel.INFO, '*** e: ' + e); |
| | | String exc = '' + e.getMessage(); |
| | | Integer left = exc.indexOf(':') + 1; |
| | | Integer right = exc.lastIndexOf(':'); |
| | | String str = exc.substring(left,right); |
| | | left = str.indexOf(',') + 1; |
| | | String newStr = str.substring(left); |
| | | return newStr; |
| | | }else { |
| | | return e.getMessage(); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | //OCSM要报告操作更新相应数据 |
| | |
| | | return null; |
| | | } catch (Exception e) { |
| | | if (e.getMessage().contains(',')) { |
| | | String eMessage = e.getMessage(); |
| | | Integer left = eMessage.indexOf(','); |
| | | Integer right = eMessage.length(); |
| | | return eMessage.substring(left,right); |
| | | System.debug(LoggingLevel.INFO, '*** e: ' + e); |
| | | String exc = '' + e.getMessage(); |
| | | Integer left = exc.indexOf(':') + 1; |
| | | Integer right = exc.lastIndexOf(':'); |
| | | String str = exc.substring(left,right); |
| | | left = str.indexOf(',') + 1; |
| | | String newStr = str.substring(left); |
| | | return newStr; |
| | | }else { |
| | | return e.getMessage(); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | |
| | | return null; |
| | | } catch (Exception e) { |
| | | if (e.getMessage().contains(',')) { |
| | | String eMessage = e.getMessage(); |
| | | Integer left = eMessage.indexOf(','); |
| | | Integer right = eMessage.length(); |
| | | return eMessage.substring(left,right); |
| | | System.debug(LoggingLevel.INFO, '*** e: ' + e); |
| | | String exc = '' + e.getMessage(); |
| | | Integer left = exc.indexOf(':') + 1; |
| | | Integer right = exc.lastIndexOf(':'); |
| | | String str = exc.substring(left,right); |
| | | left = str.indexOf(',') + 1; |
| | | String newStr = str.substring(left); |
| | | return newStr; |
| | | }else { |
| | | return e.getMessage(); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | //DispatchOCSMQARA操作更新相应数据 |
| | |
| | | return null; |
| | | } catch (Exception e) { |
| | | if (e.getMessage().contains(',')) { |
| | | String eMessage = e.getMessage(); |
| | | Integer left = eMessage.indexOf(','); |
| | | Integer right = eMessage.length(); |
| | | return eMessage.substring(left,right); |
| | | System.debug(LoggingLevel.INFO, '*** e: ' + e); |
| | | String exc = '' + e.getMessage(); |
| | | Integer left = exc.indexOf(':') + 1; |
| | | Integer right = exc.lastIndexOf(':'); |
| | | String str = exc.substring(left,right); |
| | | left = str.indexOf(',') + 1; |
| | | String newStr = str.substring(left); |
| | | return newStr; |
| | | }else { |
| | | return e.getMessage(); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | //OCSM不要报告操作更新相应数据 |
| | |
| | | return null; |
| | | } catch (Exception e) { |
| | | if (e.getMessage().contains(',')) { |
| | | String eMessage = e.getMessage(); |
| | | Integer left = eMessage.indexOf(','); |
| | | Integer right = eMessage.length(); |
| | | return eMessage.substring(left,right); |
| | | System.debug(LoggingLevel.INFO, '*** e: ' + e); |
| | | String exc = '' + e.getMessage(); |
| | | Integer left = exc.indexOf(':') + 1; |
| | | Integer right = exc.lastIndexOf(':'); |
| | | String str = exc.substring(left,right); |
| | | left = str.indexOf(',') + 1; |
| | | String newStr = str.substring(left); |
| | | return newStr; |
| | | }else { |
| | | return e.getMessage(); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | |
| | | return null; |
| | | } catch (Exception e) { |
| | | if (e.getMessage().contains(',')) { |
| | | String eMessage = e.getMessage(); |
| | | Integer left = eMessage.indexOf(','); |
| | | Integer right = eMessage.length(); |
| | | return eMessage.substring(left,right); |
| | | System.debug(LoggingLevel.INFO, '*** e: ' + e); |
| | | String exc = '' + e.getMessage(); |
| | | Integer left = exc.indexOf(':') + 1; |
| | | Integer right = exc.lastIndexOf(':'); |
| | | String str = exc.substring(left,right); |
| | | left = str.indexOf(',') + 1; |
| | | String newStr = str.substring(left); |
| | | return newStr; |
| | | }else { |
| | | return e.getMessage(); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | |
| | | return null; |
| | | } catch (Exception e) { |
| | | if (e.getMessage().contains(',')) { |
| | | String eMessage = e.getMessage(); |
| | | Integer left = eMessage.indexOf(','); |
| | | Integer right = eMessage.length(); |
| | | return eMessage.substring(left,right); |
| | | System.debug(LoggingLevel.INFO, '*** e: ' + e); |
| | | String exc = '' + e.getMessage(); |
| | | Integer left = exc.indexOf(':') + 1; |
| | | Integer right = exc.lastIndexOf(':'); |
| | | String str = exc.substring(left,right); |
| | | left = str.indexOf(',') + 1; |
| | | String newStr = str.substring(left); |
| | | return newStr; |
| | | }else { |
| | | return e.getMessage(); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | |
| | | return null; |
| | | } catch (Exception e) { |
| | | if (e.getMessage().contains(',')) { |
| | | String eMessage = e.getMessage(); |
| | | Integer left = eMessage.indexOf(','); |
| | | Integer right = eMessage.length(); |
| | | return eMessage.substring(left,right); |
| | | System.debug(LoggingLevel.INFO, '*** e: ' + e); |
| | | String exc = '' + e.getMessage(); |
| | | Integer left = exc.indexOf(':') + 1; |
| | | Integer right = exc.lastIndexOf(':'); |
| | | String str = exc.substring(left,right); |
| | | left = str.indexOf(',') + 1; |
| | | String newStr = str.substring(left); |
| | | return newStr; |
| | | }else { |
| | | return e.getMessage(); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | //VOC回答更新相应数据 |
| | |
| | | User[] records = [SELECT Job_Category__c FROM User WHERE Id = :createdById]; |
| | | List<String> userAccess = new List<String>(); |
| | | if (records[0].Job_Category__c == LightingButtonConstant.TYPE_OF_SALES_SERVICES) { |
| | | userAccess.add(rac.JingliApprovalManager__c + LightingButtonConstant.USER_ACCESS_READ); |
| | | userAccess.add(rac.BuchangApprovalManager__c + LightingButtonConstant.USER_ACCESS_READ); |
| | | rac.VOC_CreatedBy_jingli__c = rac.JingliApprovalManager__c; |
| | | rac.VOC_CreatedBy_buzhang__c = rac.BuchangApprovalManager__c; |
| | | } else { |
| | | userAccess.add(rac.SalesManager__c + LightingButtonConstant.USER_ACCESS_READ); |
| | | userAccess.add(rac.BuchangApprovalManagerSales__c + LightingButtonConstant.USER_ACCESS_READ); |
| | | rac.VOC_CreatedBy_jingli__c = rac.SalesManager__c; |
| | | rac.VOC_CreatedBy_buzhang__c = rac.BuchangApprovalManagerSales__c; |
| | | if(rac.JingliApprovalManager__c != null){ |
| | | userAccess.add(rac.JingliApprovalManager__c + LightingButtonConstant.USER_ACCESS_READ); |
| | | rac.VOC_CreatedBy_jingli__c = rac.JingliApprovalManager__c; |
| | | } |
| | | userAccess.add(rac.ZongjianApprovalManager__c + LightingButtonConstant.USER_ACCESS_READ); |
| | | if(rac.BuchangApprovalManager__c != null){ |
| | | userAccess.add(rac.BuchangApprovalManager__c + LightingButtonConstant.USER_ACCESS_READ); |
| | | rac.VOC_CreatedBy_buzhang__c = rac.BuchangApprovalManager__c; |
| | | } |
| | | |
| | | |
| | | } else { |
| | | if(rac.SalesManager__c != null){ |
| | | userAccess.add(rac.SalesManager__c + LightingButtonConstant.USER_ACCESS_READ); |
| | | rac.VOC_CreatedBy_jingli__c = rac.SalesManager__c; |
| | | } |
| | | if(rac.BuchangApprovalManagerSales__c != null){ |
| | | userAccess.add(rac.BuchangApprovalManagerSales__c + LightingButtonConstant.USER_ACCESS_READ); |
| | | rac.VOC_CreatedBy_buzhang__c = rac.BuchangApprovalManagerSales__c; |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | } |
| | | if(rac.ZongjianApprovalManager__c != null){ |
| | | userAccess.add(rac.ZongjianApprovalManager__c + LightingButtonConstant.USER_ACCESS_READ); |
| | | } |
| | | String rtn = ControllerUtil.setSObjectShare(LightingButtonConstant.SOBJECT_NAME_OF_REPORT_SHARE,LightingButtonConstant.SOBJECT_NAME_OF_VOC_SHARE,recordId,userAccess,rac.Owner.Id); |
| | | if (rtn != LightingButtonConstant.OK) { |
| | | return rtn; |
| | |
| | | return null; |
| | | } catch (Exception e) { |
| | | if (e.getMessage().contains(',')) { |
| | | String eMessage = e.getMessage(); |
| | | Integer left = eMessage.indexOf(','); |
| | | Integer right = eMessage.length(); |
| | | return eMessage.substring(left,right); |
| | | System.debug(LoggingLevel.INFO, '*** e: ' + e); |
| | | String exc = '' + e.getMessage(); |
| | | Integer left = exc.indexOf(':') + 1; |
| | | Integer right = exc.lastIndexOf(':'); |
| | | String str = exc.substring(left,right); |
| | | left = str.indexOf(',') + 1; |
| | | String newStr = str.substring(left); |
| | | return newStr; |
| | | }else { |
| | | return e.getMessage(); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | //VOC判定更新相应数据 |
| | |
| | | // VOC対応者の経理部長総監を設定 |
| | | User[] records = [SELECT Id, Job_Category__c, JingliApprovalManager__c, SalesManager__c, BuchangApprovalManager__c, BuchangApprovalManagerSales__c, ZongjianApprovalManager__c FROM User WHERE Id = :personId]; |
| | | if (records[0].job_Category__c == LightingButtonConstant.TYPE_OF_SALES_SERVICES) { |
| | | rac.VOC_jingli__c = records[0].JingliApprovalManager__c == null ? '' : records[0].JingliApprovalManager__c; |
| | | rac.VOC_buzhang__c = records[0].BuchangApprovalManager__c == null ? '' : records[0].BuchangApprovalManager__c; |
| | | rac.VOC_jingli__c = records[0].JingliApprovalManager__c == null ? null : records[0].JingliApprovalManager__c; |
| | | rac.VOC_buzhang__c = records[0].BuchangApprovalManager__c == null ? null : records[0].BuchangApprovalManager__c; |
| | | } else { |
| | | rac.VOC_jingli__c = records[0].SalesManager__c == null ? '' : records[0].SalesManager__c; |
| | | rac.VOC_buzhang__c = records[0].BuchangApprovalManagerSales__c == null ? '' : records[0].BuchangApprovalManagerSales__c; |
| | | rac.VOC_jingli__c = records[0].SalesManager__c == null ? null : records[0].SalesManager__c; |
| | | rac.VOC_buzhang__c = records[0].BuchangApprovalManagerSales__c == null ? null : records[0].BuchangApprovalManagerSales__c; |
| | | } |
| | | rac.VOC_zongjian__c = records[0].ZongjianApprovalManager__c == null ? '' : records[0].ZongjianApprovalManager__c; |
| | | rac.VOC_zongjian__c = records[0].ZongjianApprovalManager__c == null ? null : records[0].ZongjianApprovalManager__c; |
| | | rac.Status__c = LightingButtonConstant.STATUS_VOC_CHECK_OVER; |
| | | rac.VOC_Finish__c = false; |
| | | Date serverTimestamp = Date.today(); |
| | | rac.VOC_share_date__c = serverTimestamp; |
| | | // share |
| | | List<String> userAccess = new List<String>(); |
| | | userAccess.add(rac.Responsible_Person__c + LightingButtonConstant.USER_ACCESS_EDIT); |
| | | userAccess.add(rac.VOC_jingli__c + LightingButtonConstant.USER_ACCESS_READ); |
| | | userAccess.add(rac.VOC_buzhang__c + LightingButtonConstant.USER_ACCESS_READ); |
| | | userAccess.add(rac.VOC_zongjian__c + LightingButtonConstant.USER_ACCESS_READ); |
| | | if(rac.Responsible_Person__c != null){ |
| | | userAccess.add(rac.Responsible_Person__c + LightingButtonConstant.USER_ACCESS_EDIT); |
| | | } |
| | | if(rac.VOC_jingli__c != null){ |
| | | userAccess.add(rac.VOC_jingli__c + LightingButtonConstant.USER_ACCESS_READ); |
| | | } |
| | | if(rac.VOC_buzhang__c != null){ |
| | | userAccess.add(rac.VOC_buzhang__c + LightingButtonConstant.USER_ACCESS_READ); |
| | | } |
| | | if(rac.VOC_zongjian__c != null){ |
| | | userAccess.add(rac.VOC_zongjian__c + LightingButtonConstant.USER_ACCESS_READ); |
| | | } |
| | | String rtn = ControllerUtil.setSObjectShare(LightingButtonConstant.SOBJECT_NAME_OF_REPORT_SHARE,LightingButtonConstant.SOBJECT_NAME_OF_VOC_SHARE,recordId,userAccess,rac.Owner.Id); |
| | | if (rtn != LightingButtonConstant.OK) { |
| | | return null; |
| | | return rtn; |
| | | } |
| | | update rac; |
| | | } else { |
| | |
| | | return null; |
| | | } catch (Exception e) { |
| | | if (e.getMessage().contains(',')) { |
| | | String eMessage = e.getMessage(); |
| | | Integer left = eMessage.indexOf(','); |
| | | Integer right = eMessage.length(); |
| | | return eMessage.substring(left,right); |
| | | System.debug(LoggingLevel.INFO, '*** e: ' + e); |
| | | String exc = '' + e.getMessage(); |
| | | Integer left = exc.indexOf(':') + 1; |
| | | Integer right = exc.lastIndexOf(':'); |
| | | String str = exc.substring(left,right); |
| | | left = str.indexOf(',') + 1; |
| | | String newStr = str.substring(left); |
| | | return newStr; |
| | | }else { |
| | | return e.getMessage(); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | @AuraEnabled |