From 07390e2fcb4adf27c928335bf27ae7939c5a80ad Mon Sep 17 00:00:00 2001
From: buli <137736985@qq.com>
Date: 星期二, 23 五月 2023 11:28:12 +0800
Subject: [PATCH] bakcup20230523
---
force-app/main/default/classes/otherButtonRepairController.cls | 144 +++++++++---------------------------------------
1 files changed, 27 insertions(+), 117 deletions(-)
diff --git a/force-app/main/default/classes/otherButtonRepairController.cls b/force-app/main/default/classes/otherButtonRepairController.cls
index 4ac753a..1907e8d 100644
--- a/force-app/main/default/classes/otherButtonRepairController.cls
+++ b/force-app/main/default/classes/otherButtonRepairController.cls
@@ -119,6 +119,7 @@
res.profileId = UserInfo.getProfileId();
res.userEmail = UserInfo.getUserEmail();
+
System.debug(LoggingLevel.INFO, '*** res: ' + res);
}catch(Exception e){
System.debug(LoggingLevel.INFO, '*** e: ' + e);
@@ -308,7 +309,7 @@
//閫氳繃Is_Validity__c鍜孖d瀛楁鏌ヨAccount鐨勮褰曞苟杩斿洖
@AuraEnabled
- public static List<Account> queryForFindInvalidLicense(Boolean isValidity,String dealerId){
+ public static List<Account> queryForFindInvalidLicense(String dealerId){
try {
List<Account> accounts = [select Id,Is_Validity__c from Account where Is_Validity__c = false And Id = :dealerId];
return accounts;
@@ -341,10 +342,9 @@
//閫氳繃Id鏌ヨRepair__c涓殑Dealer__c锛屽啀鏍规嵁Dealer__c鏌ヨAccount涓殑璁板綍骞惰繑鍥�
@AuraEnabled
- public static List<Account> queryForrecords3(String recordId){
+ public static List<Account> queryForrecords3(String dealer){
try {
- Repair__c repair = [select Repair__c.Dealer__c from Repair__c where Id =:recordId];
- List<Account> accounts = [select id, FirstParagraph__c from Account where name =:repair.Dealer__c];
+ List<Account> accounts = [SELECT id, FirstParagraph__c from Account where name =:dealer];
return accounts;
} catch (Exception e) {
throw new AuraHandledException(e.getMessage());
@@ -354,24 +354,24 @@
//鏇存柊Repair__c涓殑璁板綍锛屽皢Maintenance_Contract__c鍜孧aintenanceContractType__c瀛楁鏇存柊涓虹┖锛岃嫢鎹曡幏鍒板紓甯稿垯杩斿洖閿欒淇℃伅
@AuraEnabled
public static String updateForRepair1(String recordId){
+ String res='';
try {
Repair__c repair = new Repair__c();
- repair.ID = recordId;
+ repair.Id = recordId;
repair.Maintenance_Contract__c = null;
repair.MaintenanceContractType__c = null;
update repair;
return null;
} catch (Exception e) {
- String eMessage = e.getMessage();
- Integer left = eMessage.indexOf(',') + 1;
- Integer right = eMessage.length();
- return eMessage.substring(left,right);
+ res = e.getMessage();
}
+ return res;
}
//鏇存柊Repair__c涓殑璁板綍锛岃嫢鎹曡幏鍒板紓甯稿垯杩斿洖閿欒淇℃伅
@AuraEnabled
public static String updateRepair2(String recordId,User staff,Boolean DWSign,String statusc,String DOJStatus,String SAPcondition){
+ String res='';
try {
Repair__c repair = new Repair__c();
repair.Id = recordId;
@@ -398,126 +398,36 @@
repair.SAP_Transfer_time__c = Datetime.now();
}
update repair;
- return null;
} catch (Exception e) {
- String eMessage = e.getMessage();
- Integer left = eMessage.indexOf(',') + 1;
- Integer right = eMessage.length();
- return eMessage.substring(left,right);
+ res = e.getMessage();
}
+ return res;
}
- //鏌ヨAccount鐨勮褰�
- @AuraEnabled
- public static List<Account> selecctAccount(){
- try {
- List<Account> accounts = [SELECT Hospital_ID__c,Department_Class_ID_18__c,Id,Hospital__c,Department_Class__c,Name FROM Account];
- return accounts;
- } catch (Exception e) {
- throw new AuraHandledException(e.getMessage());
- }
- }
-
- //鏌ヨAccount淇悊鐢婚潰鈥滀慨鐞嗗搧杩旈�佸湴鈥濋棶棰樿皟鏌�-鍚庣画
- @AuraEnabled
- public static List<Account> selecctAccountById(String id){
- try {
- List<Account> accounts = [SELECT ParentId,Parent.RecordTypeId ,Parent.Parent.FSE_GI_Main_Leader__c, Parent.Parent.FSE_GI_Main_Leader__r.Name,Parent.Parent.FSE_SP_Main_Leader__r.Name,Parent.Parent.FSE_SP_Main_Leader__c,Parent.Parent.FSE_GI_Main_Leader__r.Work_Location__c,Parent.Parent.FSE_SP_Main_Leader__r.Work_Location__c FROM Account WHERE ID=:id];
- return accounts;
- } catch (Exception e) {
- throw new AuraHandledException(e.getMessage());
- }
- }
-
- //鏌ヨAccount淇悊鐢婚潰鈥滀慨鐞嗗搧杩旈�佸湴鈥濋棶棰樿皟鏌�-鍚庣画
- @AuraEnabled
- public static List<Account> selecctAccountBySegmentId(String segmentId){
- try {
- List<Account> accounts = [SELECT id,ParentId,Parent.RecordTypeId, Parent.Parent.FSE_GI_Main_Leader__r.Work_Location__c,Parent.Parent.FSE_SP_Main_Leader__r.Work_Location__c FROM Account WHERE Id=:segmentId];
- return accounts;
- } catch (Exception e) {
- throw new AuraHandledException(e.getMessage());
- }
- }
-
- //鏌ヨProduct2
- @AuraEnabled
- public static List<Product2> selecctProduct2ById(String Id){
- try {
- List<Product2> accounts = [SELECT id,Name,Can_Repair__c from Product2 where ID=:Id];
- return accounts;
- } catch (Exception e) {
- throw new AuraHandledException(e.getMessage());
- }
- }
-
- //鏌ヨQIS_Report__c
- @AuraEnabled
- public static List<QIS_Report__c> selecctQISReportByFomatToday(String AssetId,Date fomatToday){
- try {
- List<QIS_Report__c> accounts = [SELECT id,Name,QIS_Submit_day__c from QIS_Report__c where nonyushohin__c=:AssetId and QIS_Submit_day__c != null and QIS_Submit_day__c >=:fomatToday];
- return accounts;
- } catch (Exception e) {
- throw new AuraHandledException(e.getMessage());
- }
- }
-
- //鏌ヨRepair__c
- @AuraEnabled
- public static List<Repair__c> selecctRepairByFomatToday(String AssetId, Date fomatToday){
- try {
- List<Repair__c> accounts = [SELECT Name from Repair__c where Delivered_Product__c =:AssetId and Status2__c!='00.鍒犻櫎' and Status2__c!='00.鍙栨秷' and FSE_ApplyForRepair_Day__c >=: fomatToday order by FSE_ApplyForRepair_Day__c desc limit 1];
- return accounts;
- } catch (Exception e) {
- throw new AuraHandledException(e.getMessage());
- }
- }
-
- //鏌ヨlexCreateRepairFromDepartment User
+ // 鏌ユ壘绠�妗�
@AuraEnabled
- public static List<User> selecctUser(){
- try {
- List<User> user = [SELECT Id,RepairSalesPoint_Province_China__c,Employee_No__c FROM User];
- return user;
- } catch (Exception e) {
- throw new AuraHandledException(e.getMessage());
- }
- }
-
- //鏌ヨlexCreateRepairFromDepartment QIS_Report__c
- @AuraEnabled
- public static List<QIS_Report__c> selecctQISReport(){
- try {
- List<QIS_Report__c> user = [SELECT Hospital__c,Id,OCM_judgement__c,next_action__c,Special_follow__c,HP_ID__c,Source_OnCall__c,Name,Department_Class_Id__c,Department_Class__c,Hospital_Department__c,nonyushohin__c,Trable_occur_daY_collect__c,source_for_repair__c FROM QIS_Report__c];
- return user;
- } catch (Exception e) {
- throw new AuraHandledException(e.getMessage());
- }
- }
-
- //鏌ヨOnCall鐨勮褰�
- @AuraEnabled
- public static List<On_Call__c> selecctOnCallC(){
- try {
- List<On_Call__c> accounts = [SELECT Id,Name,segment__c,HP__c,HospitalId__c,Salesdepartment_HP_ID__c,Salesdepartment_HP__c,Oncall_Equipment__c,Trable_occur_daY_collect_c__c FROM On_Call__c];
- return accounts;
- } catch (Exception e) {
- throw new AuraHandledException(e.getMessage());
- }
- }
-
- // 鏌ユ壘淇濇湁璁惧
- @AuraEnabled
- public static List<Asset> selectAsset(){
- List<Asset> res = new List<Asset>();
+ public static List<Profile> initSelectProfile(String profileId){
+ List<Profile> res = new List<Profile>();
try{
- res = [SELECT Id,NoPartRiskDate_F__c,Product_ID__c,AccountId,HP_Id__c,Hospital__c,Department_Class__c,Name FROM Asset];
+ res = [SELECT Id,name FROM Profile WHERE Id=: profileId ];
}catch(Exception e){
System.debug(LoggingLevel.INFO, '*** e: ' + e);
}
return res;
}
+ // 鏌ユ壘UserName
+ @AuraEnabled
+ public static List<User> initUserName(String userId){
+ List<User> res = new List<User>();
+ try{
+ res = [SELECT Id,name FROM User WHERE Id=: userId ];
+ }catch(Exception e){
+ System.debug(LoggingLevel.INFO, '*** e: ' + e);
+ }
+ return res;
+ }
+
public class InitData{
@AuraEnabled
public String detailedAddress;
--
Gitblit v1.9.1