From 67c32f8d0600867b73eb15902798a568f77acd4e Mon Sep 17 00:00:00 2001
From: unknown <sunxia@prec-tech.com>
Date: 星期四, 13 四月 2023 17:36:49 +0800
Subject: [PATCH] Merge branch 'LEX_dev' of http://47.92.229.245:8089/r/lightningupdate into LEX_dev

---
 force-app/main/default/lwc/lexOSHSubmit/lexOSHSubmit.js                                    |   49 
 force-app/main/default/lwc/lexFinLibrary3/lexFinLibrary3.html                              |    4 
 force-app/main/default/lwc/lexOLYwinBid/lexOLYwinBid.css                                   |   10 
 force-app/main/default/classes/FinLibraryButtonController3.cls                             |   13 
 force-app/main/default/classes/OpportunityLightingButtonController.cls                     |  332 ++++
 force-app/main/default/lwc/lexFinLibrary3/lexFinLibrary3.css                               |   11 
 force-app/main/default/lwc/lexVOCAnswer/lexVOCAnswer.js                                    |   14 
 force-app/main/default/lwc/lexPredictedDateChange/lexPredictedDateChange.html              |    6 
 force-app/main/default/lwc/lexSendQIS/lexSendQIS.js                                        |  121 +
 force-app/main/default/lwc/lexSubmit/lexSubmit.css                                         |   10 
 force-app/main/default/lwc/lexRCRecieved/lexRCRecieved.css                                 |   22 
 force-app/main/default/lwc/lexVOCSubmit/lexVOCSubmit.js                                    |   12 
 force-app/main/default/lwc/lexOLYwinBid/lexOLYwinBid.js                                    |   97 +
 force-app/main/default/lwc/lexRequestDB/lexRequestDB.js-meta.xml                           |   11 
 force-app/main/default/lwc/lexVOCFinish/lexVOCFinish.js                                    |   12 
 force-app/main/default/classes/OpportunityWebService.cls                                   |  506 +++++++
 force-app/main/default/lwc/lexOCSMNoToReportForReport/lexOCSMNoToReportForReport.js        |    6 
 force-app/main/default/lwc/lexBeforeOPDPDFBtnSIS/lexBeforeOPDPDFBtnSIS.js                  |   97 +
 force-app/main/default/lwc/lexFinLibrary3/lexFinLibrary3.js                                |   58 
 force-app/main/default/lwc/lexOLYwinBid/lexOLYwinBid.html                                  |    6 
 force-app/main/default/lwc/lexAgencyAuthorize/lexAgencyAuthorize.js-meta.xml               |   11 
 force-app/main/default/lwc/lexVOCConfirm/lexVOCConfirm.js                                  |   13 
 force-app/main/default/lwc/lexFinLibrary3/lexFinLibrary3.js-meta.xml                       |   11 
 force-app/main/default/lwc/lexComplete/lexComplete.js                                      |   18 
 force-app/main/default/lwc/lexFinLibrary2/lexFinLibrary2.html                              |    4 
 force-app/main/default/classes/OpportunityLightingButtonController.cls-meta.xml            |    5 
 force-app/main/default/lwc/lexRCRecieved/lexRCRecieved.html                                |    5 
 force-app/main/default/lwc/lexAgencyAuthorize/lexAgencyAuthorize.css                       |   10 
 force-app/main/default/lwc/lexRequestDB/__tests__/lexRequestDB.test.js                     |   25 
 force-app/main/default/lwc/lexCancelSubmitReport/lexCancelSubmitReport.js                  |   12 
 force-app/main/default/lwc/lexOLYwinBid/lexOLYwinBid.js-meta.xml                           |   11 
 force-app/main/default/lwc/lexFinLibrary/lexFinLibrary.html                                |    4 
 force-app/main/default/classes/Add_Report.cls                                              |  565 +++++++
 force-app/main/default/classes/QISReportController.cls                                     |  101 +
 force-app/main/default/lwc/lexBeforeOPDPDFBtnSIS/__tests__/lexBeforeOPDPDFBtnSIS.test.js   |   25 
 force-app/main/default/lwc/lexFinLibrary2/lexFinLibrary2.js-meta.xml                       |   11 
 force-app/main/default/lwc/lexBeforeOPDPDFBtnSIS/lexBeforeOPDPDFBtnSIS.html                |   14 
 force-app/main/default/lwc/lexSIStoOPD/lexSIStoOPD.js                                      |    6 
 force-app/main/default/lwc/lexFinLibrary2/lexFinLibrary2.css                               |   11 
 force-app/main/default/classes/FinLibraryButtonController.cls                              |   24 
 force-app/main/default/lwc/lexBeforeOPDPDFBtn/lexBeforeOPDPDFBtn.html                      |    6 
 force-app/main/default/lwc/lexRequestDB/lexRequestDB.js                                    |  107 +
 force-app/main/default/lwc/lexCreateEvent/lexCreateEvent.js                                |   59 
 force-app/main/default/lwc/lexPredictedDateChange/__tests__/lexPredictedDateChange.test.js |   25 
 force-app/main/default/lwc/lexFinLibrary/lexFinLibrary.js                                  |   55 
 force-app/main/default/lwc/lexLoseBid/lexLoseBid.js-meta.xml                               |   11 
 force-app/main/default/lwc/lexPredictedDateChange/lexPredictedDateChange.css               |   10 
 force-app/main/default/lwc/lexSendQIS/lexSendQIS.html                                      |    5 
 force-app/main/default/lwc/lexBeforeOPDPDFBtn/lexBeforeOPDPDFBtn.js                        |   89 +
 force-app/main/default/lwc/lexCreateEvent/lexCreateEvent.html                              |    6 
 force-app/main/default/lwc/lexVOCCheck/lexVOCCheck.js                                      |    8 
 force-app/main/default/lwc/lexBeforeOPDPDFBtn/lexBeforeOPDPDFBtn.css                       |   10 
 force-app/main/default/classes/FinLibraryButtonController2.cls-meta.xml                    |    5 
 force-app/main/default/classes/OpportunityService.cls-meta.xml                             |    5 
 force-app/main/default/lwc/lexSubmit/lexSubmit.js                                          |   68 
 force-app/main/default/lwc/lexSubmit/lexSubmit.js-meta.xml                                 |   11 
 force-app/main/default/classes/ControllerUtil.cls                                          |    3 
 force-app/main/default/lwc/lexOCSMToReport/lexOCSMToReport.js                              |   14 
 force-app/main/default/lwc/lexSubmit/lexSubmit.html                                        |    7 
 force-app/main/default/classes/FinLibraryButtonController2.cls                             |   24 
 force-app/main/default/classes/OpportunityService.cls                                      |  457 ++++++
 force-app/main/default/lwc/lexRCRecieved/lexRCRecieved.js                                  |  103 +
 force-app/main/default/lwc/lexRequestDB/lexRequestDB.html                                  |    6 
 force-app/main/default/lwc/lexLoseBid/lexLoseBid.css                                       |   18 
 force-app/main/default/lwc/lexRCRecieved/lexRCRecieved.js-meta.xml                         |   11 
 force-app/main/default/classes/OpportunityWebService.cls-meta.xml                          |    5 
 force-app/main/default/classes/ReportController.cls                                        |  104 +
 force-app/main/default/lwc/lexRequestDB/lexRequestDB.css                                   |   10 
 force-app/main/default/classes/FinLibraryButtonController.cls-meta.xml                     |    5 
 force-app/main/default/lwc/lexPredictedDateChange/lexPredictedDateChange.js-meta.xml       |   11 
 force-app/main/default/lwc/lexSubmitCompetitorReport/lexSubmitCompetitorReport.js          |   12 
 force-app/main/default/lwc/lexAgencyAuthorize/__tests__/lexAgencyAuthorize.test.js         |   25 
 force-app/main/default/lwc/lexCancel/lexCancel.js                                          |   23 
 force-app/main/default/lwc/lexOLYwinBid/__tests__/lexOLYwinBid.test.js                     |   25 
 force-app/main/default/lwc/lexFinLibrary/lexFinLibrary.js-meta.xml                         |   11 
 force-app/main/default/lwc/lexBeforeOPDPDFBtnSIS/lexBeforeOPDPDFBtnSIS.css                 |   10 
 force-app/main/default/lwc/lexPredictedDateChange/lexPredictedDateChange.js                |   82 +
 force-app/main/default/classes/MonthlyReportController.cls                                 |   11 
 force-app/main/default/classes/Add_Report.cls-meta.xml                                     |    5 
 force-app/main/default/lwc/lexFinLibrary/lexFinLibrary.css                                 |   11 
 force-app/main/default/lwc/lexSendQIS/lexSendQIS.js-meta.xml                               |   11 
 force-app/main/default/lwc/lexDispatchOCSMQARA/lexDispatchOCSMQARA.js                      |   12 
 force-app/main/default/lwc/lexCancelSubmit/lexCancelSubmit.js                              |   13 
 force-app/main/default/lwc/lexBeforeOPDPDFBtnSIS/lexBeforeOPDPDFBtnSIS.js-meta.xml         |   11 
 force-app/main/default/lwc/lexCreateEvent/__tests__/lexCreateEvent.test.js                 |   25 
 force-app/main/default/lwc/lexSendQIS/lexSendQIS.css                                       |   22 
 force-app/main/default/lwc/lexAgencyAuthorize/lexAgencyAuthorize.js                        |  198 ++
 force-app/main/default/lwc/lexBeforeOPDPDFBtn/__tests__/lexBeforeOPDPDFBtn.test.js         |   25 
 force-app/main/default/lwc/lexBeforeOPDPDFBtn/lexBeforeOPDPDFBtn.js-meta.xml               |   11 
 force-app/main/default/lwc/lexAgencyAuthorize/lexAgencyAuthorize.html                      |    6 
 force-app/main/default/lwc/lexLoseBid/__tests__/lexLoseBid.test.js                         |   25 
 force-app/main/default/classes/FinLibraryButtonController3.cls-meta.xml                    |    5 
 force-app/main/default/lwc/lexFinLibrary2/lexFinLibrary2.js                                |   62 
 force-app/main/default/lwc/lexLoseBid/lexLoseBid.html                                      |    6 
 force-app/main/default/lwc/lexLoseBid/lexLoseBid.js                                        |   89 +
 force-app/main/default/lwc/lexOPDtoSIS/lexOPDtoSIS.js                                      |   14 
 force-app/main/default/lwc/lexCreateEvent/lexCreateEvent.js-meta.xml                       |   11 
 97 files changed, 4,180 insertions(+), 122 deletions(-)

diff --git a/force-app/main/default/classes/Add_Report.cls b/force-app/main/default/classes/Add_Report.cls
new file mode 100644
index 0000000..b1ea2b3
--- /dev/null
+++ b/force-app/main/default/classes/Add_Report.cls
@@ -0,0 +1,565 @@
+global class Add_Report {
+	// TODO report銇甶d銇ф绱€仒銈冦仾銇忋�乪vent_id__c銇ф绱�
+	WebService static String addReportPr(String repOwnerId, String reportId, String dailyReportId, String eventId, String recordType, String aId, String visitor1, String visitor2, String visitor3, String visitor4,String visitor5, String description, String reportDate){
+		String rt = selectRecordType(recordType);
+		List<Account> aList = selectAccount(aId);
+
+		if(reportId != null && reportId != ''){
+			List<Report__c> rList = [select id, Daily_Report__c, RecordTypeId, Event_Id__c, Hospital_Department__c, Department_Class_Ref__c, Hospital_Reference__c, Date__c, Practitioner1__c, Practitioner2__c, Practitioner3__c, Practitioner4__c, Practitioner5__c, Comment__c from Report__c where id =:reportId];
+			if (rList.size() > 0) {
+				return rList.get(0).id;
+			}
+		}
+
+		Report__c r = new Report__c();
+
+		if(aList.size() != 0){
+			Account a = aList.get(0);
+			r.Hospital_Department__c = a.Id;
+			r.Department_Class_Ref__c = a.Department_Class__r.Id;
+			r.Hospital_Reference__c = a.Hospital__r.Id;
+		} else {
+			r.Manual_Name__c = aId;
+		}
+
+		r.Daily_Report__c = dailyReportId;
+		r.OwnerId = repOwnerId;
+		r.RecordTypeId = rt;
+		r.Event_Id__c = eventId;
+		if(reportDate != null && reportDate != ''){
+			r.Date__c = date.parse(reportDate);
+		}
+		if(visitor1 != null && visitor1 != ''){
+			r.Practitioner1__c = visitor1;
+		}
+		if(visitor2 != null && visitor2 != ''){
+			r.Practitioner2__c = visitor2;
+		}
+		if(visitor3 != null && visitor3 != ''){
+			r.Practitioner3__c = visitor3;
+		}
+		if(visitor4 != null && visitor4 != ''){
+			r.Practitioner4__c = visitor4;
+		}
+		if(visitor5 != null && visitor5 != ''){
+			r.Practitioner5__c = visitor5;
+		}
+		r.Comment__c = description;
+		upsert r;
+
+		updateEvent(r.id,eventId,recordType);
+
+		return r.id;
+	}
+
+	WebService static String addReportOP(String repOwnerId, String reportId, String dailyReportId, String eventId, String recordType, String aId, String visitor1, String visitor2, String visitor3, String visitor4, String visitor5, String opp1, String opp2, String opp3, String opp4, String opp5, String reportDate){
+		return addReportOPWithEvaluationPDF(repOwnerId, reportId, dailyReportId, eventId, recordType, aId, visitor1, visitor2, visitor3, visitor4, visitor5, opp1, opp2, opp3, opp4, opp5, reportDate, '', '', '', '');
+	}
+	WebService static String addReportOP2(String repOwnerId, String reportId, String dailyReportId, String eventId, String recordType, String aId, String visitor1, String visitor2, String visitor3, String visitor4, String visitor5, String opp1, String opp2, String opp3, String opp4, String opp5, String reportDate, String sTime, String eTime){
+		return addReportOPWithEvaluationPDF(repOwnerId, reportId, dailyReportId, eventId, recordType, aId, visitor1, visitor2, visitor3, visitor4, visitor5, opp1, opp2, opp3, opp4, opp5, reportDate, '', '', sTime, eTime);
+	}
+	@AuraEnabled
+	WebService static String addReportOPWithEvaluationPDF(String repOwnerId, String reportId, String dailyReportId, String eventId, String recordType, String aId, String visitor1, String visitor2, String visitor3, String visitor4, String visitor5, String opp1, String opp2, String opp3, String opp4, String opp5, String reportDate, String evaluationPDFNumber, String pro1, String sTime, String eTime) {
+		String rt = selectRecordType(recordType);
+		List<Account> aList = selectAccount(aId);
+
+		if(reportId != null && reportId != ''){
+			List<Report__c> rList = [select id, Daily_Report__c, RecordTypeId, Event_Id__c, Hospital_Department__c, Department_Class_Ref__c, Hospital_Reference__c, Date__c, Practitioner1__c, Practitioner2__c, Practitioner3__c, Practitioner4__c, Practitioner5__c, Opportunity1__c, Opportunity2__c, Opportunity3__c, Opportunity4__c, Opportunity5__c from Report__c where id =:reportId];
+			if(rList.size() > 0){
+				return rList.get(0).id;
+			}
+		}
+
+		Report__c r = new Report__c();
+		
+		if(aList.size() != 0){
+			Account a = aList.get(0);
+			r.Hospital_Department__c = a.Id;
+			r.Department_Class_Ref__c = a.Department_Class__r.Id;
+			r.Hospital_Reference__c = a.Hospital__r.Id;
+		} else {
+			r.Manual_Name__c = aId;
+		}
+
+		if (String.isBlank(dailyReportId) == false) r.Daily_Report__c = dailyReportId;
+		r.OwnerId = repOwnerId;
+		r.RecordTypeId = rt;
+		if (String.isBlank(eventId) == false) r.Event_Id__c = eventId;
+		r.Evaluation_PDF_number__c = evaluationPDFNumber;
+		if(reportDate != null && reportDate != ''){
+			r.Date__c = date.parse(reportDate);
+		}
+		if(visitor1 != null && visitor1 != ''){
+			r.Practitioner1__c = visitor1;
+		}
+		if(visitor2 != null && visitor2 != ''){
+			r.Practitioner2__c = visitor2;
+		}
+		if(visitor3 != null && visitor3 != ''){
+			r.Practitioner3__c = visitor3;
+		}
+		if(visitor4 != null && visitor4 != ''){
+			r.Practitioner4__c = visitor4;
+		}
+		if(visitor5 != null && visitor5 != ''){
+			r.Practitioner5__c = visitor5;
+		}
+
+		List<String> oppIdList = new List<String>();
+		if(opp1 != null && opp1 != ''){
+			oppIdList.add(opp1);
+		}
+		if(opp2 != null && opp2 != ''){
+			oppIdList.add(opp2);
+		}
+		if(opp3 != null && opp3 != ''){
+			oppIdList.add(opp3);
+		}
+		if(opp4 != null && opp4 != ''){
+			oppIdList.add(opp4);
+		}
+		if(opp5 != null && opp5 != ''){
+			oppIdList.add(opp5);
+		}
+
+		if(oppIdList.size() > 0){
+			if(opp1 != null && opp1 != ''){
+				r.Opportunity1__c = opp1;
+			}
+			if(opp2 != null && opp2 != ''){
+				r.Opportunity2__c = opp2;
+			}
+			if(opp3 != null && opp3 != ''){
+				r.Opportunity3__c = opp3;
+			}
+			if(opp4 != null && opp4 != ''){
+				r.Opportunity4__c = opp4;
+			}
+			if(opp5 != null && opp5 != ''){
+				r.Opportunity5__c = opp5;
+			}
+			r.Opportunity_Situation__c = '寮曞悎鐧虹敓';
+		}
+		else{
+			r.Opportunity_Situation__c = '寮曞悎鐒�';
+		}
+		
+		if (String.isBlank(pro1) == false) {
+			r.Product1__c = pro1;
+		}
+
+		if (sTime != null && sTime != '') {
+			r.Operation_From__c = datetime.parse(sTime);
+		}
+		if (eTime != null && eTime != '') {
+			r.Operation_To__c = datetime.parse(eTime);
+		}
+		upsert r;
+
+		if (String.isBlank(eventId) == false) updateEvent(r.id,eventId,recordType);
+
+		return r.id;
+	}
+
+	WebService static String addReportNT(String repOwnerId, String reportId, String dailyReportId, String eventId, String recordType, String aId, String visitor1, String visitor2, String visitor3, String visitor4, String visitor5, String sTime, String eTime, String mainPlace){
+		String rt = selectRecordType(recordType);
+		List<Account> aList = selectAccount(aId);
+
+		if(reportId != null && reportId != ''){
+			List<Report__c> rList = [select id, Daily_Report__c, RecordTypeId, Event_Id__c, Hospital_Department__c, Department_Class_Ref__c, Hospital_Reference__c, Date__c, Practitioner1__c, Practitioner2__c, Practitioner3__c, Practitioner4__c, Practitioner5__c, From__c, To__c, Location__c from Report__c where id =:reportId];
+			if(rList.size() > 0){
+				return rList.get(0).id;
+			}
+		}
+
+		Report__c r = new Report__c();
+
+		if(aList.size() != 0){
+			Account a = aList.get(0);
+			r.Hospital_Department__c = a.Id;
+			r.Department_Class_Ref__c = a.Department_Class__r.Id;
+			r.Hospital_Reference__c = a.Hospital__r.Id;
+		} else {
+			r.Manual_Name__c = aId;
+		}
+
+		r.Daily_Report__c = dailyReportId;
+		r.OwnerId = repOwnerId;
+		r.RecordTypeId = rt;
+		r.Event_Id__c = eventId;
+		if(visitor1 != null && visitor1 != ''){
+			r.Practitioner1__c = visitor1;
+		}
+		if(visitor2 != null && visitor2 != ''){
+			r.Practitioner2__c = visitor2;
+		}
+		if(visitor3 != null && visitor3 != ''){
+			r.Practitioner3__c = visitor3;
+		}
+		if(visitor4 != null && visitor4 != ''){
+			r.Practitioner4__c = visitor4;
+		}
+		if(visitor5 != null && visitor5 != ''){
+			r.Practitioner5__c = visitor5;
+		}
+		if(sTime != null && sTime != ''){
+			//sTime = sTime.substring(0,16);
+			r.From__c = datetime.parse(sTime);
+		}
+		if(eTime != null && eTime != ''){
+			//eTime = eTime.substring(0,16);
+			r.To__c = datetime.parse(eTime);
+		}
+		r.Location__c = mainPlace;
+		upsert r;
+
+		updateEvent(r.id,eventId,recordType);
+
+		return r.id;
+	}
+
+	WebService static String addReportOn(String repOwnerId, String reportId, String dailyReportId, String eventId, String recordType, String aId, String reportDate, String v1Str, String startHour, String startMin, String endHour, String endMin, String description){
+		List<Account> aList = selectAccount(aId);
+
+		if(reportId != null && reportId != ''){
+			List<On_Call__c> oList = [select id, Daily_Report__c, Event_Id__c, segment__c from On_Call__c where id =:reportId];
+			if(oList.size() > 0){
+				return oList.get(0).id;
+			}
+		}
+		
+		On_Call__c o = new On_Call__c();
+		
+		if(aList.size() != 0){
+			Account a = aList.get(0);
+			o.segment__c = a.Id;
+			// 鐥呴櫌ID(18妗�)宸炯銇�
+			o.Hospital__c = a.Hospital__r.Id;
+		}
+
+		o.Daily_Report__c = dailyReportId;
+		o.OwnerId = repOwnerId;
+		o.Event_Id__c = eventId;
+		o.Responsible_Person_HP__c = v1Str;
+		if(String.isBlank(description) == false){
+			if(description.length() > 255){
+				o.Customer_Problem_c__c = description.substring(0, 255);
+			} else {
+				o.Customer_Problem_c__c = description;
+			}
+
+		}
+		Date rDate = date.parse(reportDate);
+		o.From_c__c = Datetime.newInstance(rDate.year(), rDate.month(), rDate.day(), Integer.valueOf(startHour), Integer.valueOf(StartMin), 0);
+		o.To_c__c = Datetime.newInstance(rDate.year(), rDate.month(), rDate.day(), Integer.valueOf(endHour), Integer.valueOf(endMin), 0);
+
+		upsert o;
+		
+		updateEvent(o.id,eventId,recordType);
+		
+		return o.id;
+	}
+	
+	WebService static String addReportAc(String repOwnerId, String reportId, String dailyReportId, String eventId, String recordType, String aId, String reportDate, String description){
+		List<Account> aList = selectAccount(aId);
+
+		if(reportId != null && reportId != ''){
+			List<Visit_Report__c> rList = [select id, Daily_Report__c, Event_Id__c, Hospital_Reference__c, Department_Class__c, Department__c, Date__c from Visit_Report__c where id =:reportId];
+			if(rList.size() > 0){
+				return rList.get(0).id;
+			}
+		}
+
+		Visit_Report__c r = new Visit_Report__c();
+
+		if(aList.size() != 0){
+			Account a = aList.get(0);
+			r.Hospital_Reference__c = a.Hospital__r.Id;
+			r.Department_Class__c = a.Department_Class__r.Id;
+			r.Department__c = a.Id;
+//        } else {
+//            r.Manual_Name__c = aId;
+		}
+		
+		r.Daily_Report__c = dailyReportId;
+		r.OwnerId = repOwnerId;
+		r.Event_Id__c = eventId;
+		r.Evaluate_And_Problem__c = description;
+		if(reportDate != null && reportDate != ''){
+			r.Date__c = date.parse(reportDate);
+		}
+
+		upsert r;
+
+		updateEvent(r.id,eventId,recordType);
+
+		return r.id;
+	}
+	
+	WebService static String addClaim(String repOwnerId, String reportId, String dailyReportId, String eventId, String recordType, String aId, String reportDate, String description){
+		List<Account> aList = selectAccount(aId);
+
+		if(reportId != null && reportId != ''){
+			List<QIS_Report__c> rList = [select id, Daily_Report__c, Event_Id__c, Hospital_Department__c, Date__c from QIS_Report__c where id =:reportId];
+			if(rList.size() > 0){
+				return rList.get(0).id;
+			}
+		}
+
+		QIS_Report__c r = new QIS_Report__c();
+
+		if(aList.size() != 0){
+			Account a = aList.get(0);
+			r.Hospital_Department__c = a.Id;
+			r.Department_Class__c = a.Department_Class__r.Id;
+			r.Hospital__c = a.Hospital__r.Id;
+		}
+		r.Daily_Report__c = dailyReportId;
+		r.OwnerId = repOwnerId;
+		r.Event_Id__c = eventId;
+		//r.Department_Class_Ref__c = a.Department_Class__r.Id;
+		//r.Hospital_Reference__c = a.Hospital__r.Id;
+		r.problem_detail__c = description;
+		if(reportDate != null && reportDate != ''){
+			r.Date__c = date.parse(reportDate);
+		}
+		r.Generation_Source__c = '鏃ユ姤';
+		r.Name = '*';
+
+		upsert r;
+
+		updateEvent(r.id,eventId,recordType);
+
+		return r.id;
+	}
+
+	// MarketCondition or Competitor
+	WebService static String addReportEx(String repOwnerId, String reportId, String dailyReportId, String eventId, String recordType, String aId, String visitor1, String reportDate, String description){
+		String rt = selectRecordType(recordType);
+		List<Account> aList = selectAccount(aId);
+
+		if(reportId != null && reportId != ''){
+			List<Report__c> rList = [select id, Daily_Report__c, RecordTypeId, Event_Id__c, Hospital_Department__c, Department_Class_Ref__c, Hospital_Reference__c, Date__c, Practitioner1__c, Practitioner2__c, Practitioner3__c, Practitioner4__c, Practitioner5__c, Comment__c from Report__c where id =:reportId];
+			if(rList.size() > 0){
+				return rList.get(0).id;
+			}
+		}
+		Report__c r = new Report__c();
+		if(aList.size() != 0){
+			Account a = aList.get(0);
+			r.Hospital_Department__c = a.Id;
+			r.Department_Class_Ref__c = a.Department_Class__r.Id;
+			r.Hospital_Reference__c = a.Hospital__r.Id;
+		}
+		r.Daily_Report__c = dailyReportId;
+		r.OwnerId = repOwnerId;
+		r.RecordTypeId = rt;
+		r.Event_Id__c = eventId;
+		if (String.isBlank(visitor1) == false) {
+			r.Person_In_Charge__c = visitor1;
+		}
+		if(reportDate != null && reportDate != ''){
+			r.Date__c = date.parse(reportDate);
+		}
+		r.Comment__c = description;
+
+		upsert r;
+
+		updateEvent(r.id,eventId,recordType);
+
+		return r.id;
+	}
+
+
+	WebService static String addReportIm(String repOwnerId, String reportId, String dailyReportId, String eventId, String recordType, String aId, String reportDate, String description){
+		String rt = selectRecordType(recordType);
+		List<Account> aList = selectAccount(aId);
+
+		if(reportId != null && reportId != ''){
+			List<Report__c> rList = [select id, Daily_Report__c, RecordTypeId, Event_Id__c, Hospital_Department__c, Department_Class_Ref__c, Hospital_Reference__c, Date__c, Practitioner1__c, Practitioner2__c, Practitioner3__c, Practitioner4__c, Practitioner5__c, Comment__c from Report__c where id =:reportId];
+			if(rList.size() > 0){
+				return rList.get(0).id;
+			}
+		}
+
+		Report__c r = new Report__c();
+
+		if(aList.size() != 0){
+			Account a = aList.get(0);
+			r.Hospital_Reference__c = a.Hospital__r.Id;
+		}
+
+		r.Daily_Report__c = dailyReportId;
+		r.OwnerId = repOwnerId;
+		r.RecordTypeId = rt;
+		r.Event_Id__c = eventId;
+		if(reportDate != null && reportDate != ''){
+			r.Date__c = date.parse(reportDate);
+		}
+		r.Comment__c = description;
+
+		upsert r;
+
+		updateEvent(r.id,eventId,recordType);
+
+		return r.id;
+	}
+
+//    // Maintenance_Contract
+//    WebService static String addMC(String repOwnerId, String reportId, String dailyReportId, String eventId, String recordType, String aId, String reportDate, String description){
+//        List<Account> aList = selectAccount(aId);
+//
+//        if(reportId != null && reportId != ''){
+//            List<Maintenance_Contract__c> rList = [select id, Daily_Report__c, Event_Id__c from Maintenance_Contract__c where id =:reportId];
+//            if(rList.size() > 0){
+//                return rList.get(0).id;
+//            }
+//        }
+//
+//        Maintenance_Contract__c r = new Maintenance_Contract__c();
+//
+//        if(aList.size() != 0){
+//            Account a = aList.get(0);
+//            r.Hospital__c = a.Hospital__r.Id;
+//            r.Department_Class__c = a.Department_Class__r.Id;
+//            r.Department__c = a.Id;
+//        }
+//        
+//        r.Daily_Report__c = dailyReportId;
+//        r.Event_Id__c = eventId;
+//        r.Description__c = description;
+////        if(reportDate != null && reportDate != ''){
+////            r.Estimation_Create_Date__c = date.parse(reportDate);
+////        }
+//
+//        upsert r;
+//
+//        updateEvent(r.id,eventId,recordType);
+//
+//        return r.id;
+//    }
+
+	// Rental_Apply
+	WebService static String addRA(String repOwnerId, String reportId, String dailyReportId, String eventId, String recordType, String aId, String reportDate, String description,String followOpps){
+		List<Account> aList = selectAccount(aId);
+
+		if(reportId != null && reportId != ''){
+			List<Rental_Apply__c> rList = [select id, Daily_Report__c, Event_Id__c from Rental_Apply__c where id =:reportId];
+			if(rList.size() > 0){
+				return rList.get(0).id;
+			}
+		}
+
+		Rental_Apply__c r = new Rental_Apply__c();
+
+		if(aList.size() != 0){
+			Account a = aList.get(0);
+			r.Hospital__c = a.Hospital__r.Id;
+			r.Strategic_dept__c = a.Department_Class__r.Id;
+			r.Account__c = a.Id;
+		}
+		
+		r.Daily_Report__c = dailyReportId;
+		r.Event_Id__c = eventId;
+		r.Demo_purpose_text__c = description;
+		r.Request_return_day__c = Date.today();
+		r.Person_In_Charge__c = repOwnerId;
+		r.applyUser__c = repOwnerId;
+		if(followOpps!=null&&followOpps!=''){
+			r.Follow_UP_Opp__c = followOpps;
+		}
+		upsert r;
+
+		updateEvent(r.id,eventId,recordType);
+
+		return r.id;
+	}
+	
+	WebService static String selectRecordType(String recordTypeName){
+		List<RecordType> rtList = [select id from RecordType where IsActive = true and DeveloperName =:recordTypeName];
+		return rtList.get(0).id;
+	}
+
+	WebService static List<Account> selectAccount(String aId){
+		List<Account> aList = new List<Account>();
+		if (aId != null && aId.startsWith('001')) {
+			aList = [select Id, Department_Class__r.Id, Hospital__r.Id from Account where Id =:aId];
+		}
+		return aList;
+	}
+
+	WebService static void updateEvent(String rId, String eventId, String recordType){
+		Event__c e = [
+			select id,Maintenance_Contract_ID__c, Asset_Manual_ID__c, Rental_Apply_ID__c,
+				   Product_Description_Id__c, OPD_ID__c, NTC_ID__c, ReportAccompanied_ID__c, CityStatus_ID__c, Improvement_ID__c, Conflict_ID__c, Claim_ID__c
+			  from Event__c where id =:eventId
+		];
+//        if(recordType == 'Maintenance_Contract'){
+//            e.Maintenance_Contract_ID__c = rId;
+//        }
+		if(recordType == 'Rental_Apply'){
+			e.Rental_Apply_ID__c = rId;
+		}
+		if(recordType == 'Asset_Manual'){
+			e.Asset_Manual_ID__c = rId;
+		}
+		if(recordType == 'Product_Explanation'){
+			e.Product_Description_Id__c = rId;
+		}
+		else if(recordType == 'OPD' || recordType == 'SIS'){
+			e.OPD_ID__c = rId;
+		}
+		else if(recordType == 'NTC'){
+			e.NTC_ID__c = rId;
+		}
+		else if(recordType == 'On_Call'){
+			e.OnCall_ID__c = rId;
+		}
+		else if(recordType == 'Visit_With'){
+			e.ReportAccompanied_ID__c = rId;
+		}
+		else if(recordType == 'MarketCondition'){
+			e.CityStatus_ID__c = rId;
+		}
+		else if(recordType == 'Improvement'){
+			e.Improvement_ID__c = rId;
+		}
+		else if(recordType == 'Competitor'){
+			e.Conflict_ID__c = rId;
+		}
+		else if(recordType == 'Complaint'){
+			e.Claim_ID__c = rId;
+		}
+
+		update e;
+	}
+	
+	WebService static Product2 getProduct2(String a){
+		Product2 p2 = [select Id, Name, Intra_Trade_Cost_RMB__c, Intra_Trade_List_RMB__c FROM Product2 Where Id =:a];
+		return p2;
+	}
+
+	WebService static Product2 getProduct2US(String a){
+		Product2 p2 = [select Id, Name, Foreign_Trade_Cost_US__c, Foreign_Trade_List_US__c FROM Product2 Where Id =:a];
+		return p2;
+	}
+	
+	WebService static String getReportId(String oId, String rDate){
+		List<Daily_Report__c> rtList = [select Id from Daily_Report__c where OwnerId =:oId and Reported_Date__c =:date.parse(rDate)];
+		return rtList.get(0).id;
+	}
+	
+	WebService static String checkAccountMatch(String name, String id){
+		List<Account> accList = [select Id from Account where Name = :name and Id = :id];
+		if (accList.size() > 0) {
+			return 'OK';
+		}
+		return 'NG';
+	}
+	
+	WebService static Account getAccountForJs(String id){
+		return [select Id, Name, Department_Class__r.Name, Department_Class__r.Id,
+				Hospital__r.Name, Hospital__r.Id, Hospital__r.OCM_Category__c
+				from Account where Id = :id];
+	}
+}
\ No newline at end of file
diff --git a/force-app/main/default/classes/Add_Report.cls-meta.xml b/force-app/main/default/classes/Add_Report.cls-meta.xml
new file mode 100644
index 0000000..b6a4861
--- /dev/null
+++ b/force-app/main/default/classes/Add_Report.cls-meta.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ApexClass xmlns="http://soap.sforce.com/2006/04/metadata">
+    <apiVersion>20.0</apiVersion>
+    <status>Active</status>
+</ApexClass>
diff --git a/force-app/main/default/classes/ControllerUtil.cls b/force-app/main/default/classes/ControllerUtil.cls
index a70f2f2..e422a7a 100644
--- a/force-app/main/default/classes/ControllerUtil.cls
+++ b/force-app/main/default/classes/ControllerUtil.cls
@@ -2717,7 +2717,7 @@
         i++;
         i++;
     }
-    
+    @AuraEnabled
     WebService static String selectCommonSequence(String valueField, String formatField) {
         Boolean insertNew = false;
         //鍙栧緱鍏遍�氭帯鐣簭鍒�
@@ -4968,6 +4968,7 @@
     /**
     OCM-SI闇�姹傝〃鐢紝澶嶅埗鍔熻兘锛屼粎闄愬綋鍓嶆墍鏈塖I闇�姹傝〃澶辨晥鐨勬椂鍊欙紝鎵嶈兘浣跨敤
     */
+    @AuraEnabled
     WebService static String ISO_Copy_Func(id isoID){
         IS_Opportunity_Demand__c checkISO = [select Opportunity_ID__c from IS_Opportunity_Demand__c where id =:isoID];
         String opporID = checkISO.Opportunity_ID__c;
diff --git a/force-app/main/default/classes/FinLibraryButtonController.cls b/force-app/main/default/classes/FinLibraryButtonController.cls
new file mode 100644
index 0000000..a20d79e
--- /dev/null
+++ b/force-app/main/default/classes/FinLibraryButtonController.cls
@@ -0,0 +1,24 @@
+/**********************************************************************
+ * 
+ *
+ * @url: /services/apexrest/rest
+ * @data:
+ *  {
+        
+    }
+*************************************************************************/
+
+global with sharing class FinLibraryButtonController {
+   
+   @AuraEnabled
+   public static Bulletin_Board__c  getBulletinBoard(String recordId){
+    Bulletin_Board__c res=new Bulletin_Board__c();
+    try {
+            res=[select iPad_Finlibrary__c from Bulletin_Board__c where Id=: recordId];
+    }
+    catch (Exception e) {
+        System.debug(Logginglevel.info,'*******e'+e);
+    }
+    return res;
+   }
+}
\ No newline at end of file
diff --git a/force-app/main/default/classes/FinLibraryButtonController.cls-meta.xml b/force-app/main/default/classes/FinLibraryButtonController.cls-meta.xml
new file mode 100644
index 0000000..d75b058
--- /dev/null
+++ b/force-app/main/default/classes/FinLibraryButtonController.cls-meta.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ApexClass xmlns="http://soap.sforce.com/2006/04/metadata">
+    <apiVersion>51.0</apiVersion>
+    <status>Active</status>
+</ApexClass>
diff --git a/force-app/main/default/classes/FinLibraryButtonController2.cls b/force-app/main/default/classes/FinLibraryButtonController2.cls
new file mode 100644
index 0000000..8421838
--- /dev/null
+++ b/force-app/main/default/classes/FinLibraryButtonController2.cls
@@ -0,0 +1,24 @@
+/**********************************************************************
+ * 
+ *
+ * @url: /services/apexrest/rest
+ * @data:
+ *  {
+        
+    }
+*************************************************************************/
+
+global with sharing class FinLibraryButtonController2 {
+   
+   @AuraEnabled
+   public static Bulletin_Board__c getBulletinBoard(String recordId){
+    Bulletin_Board__c  res=new Bulletin_Board__c();
+    try{
+        res=[select iPad_Finlibrary_2__c from Bulletin_Board__c where Id=: recordId];
+    }
+    catch(Exception e){
+        System.debug(Logginglevel.info,'*******e'+e);
+    }
+    return res;
+   }
+}
\ No newline at end of file
diff --git a/force-app/main/default/classes/FinLibraryButtonController2.cls-meta.xml b/force-app/main/default/classes/FinLibraryButtonController2.cls-meta.xml
new file mode 100644
index 0000000..d75b058
--- /dev/null
+++ b/force-app/main/default/classes/FinLibraryButtonController2.cls-meta.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ApexClass xmlns="http://soap.sforce.com/2006/04/metadata">
+    <apiVersion>51.0</apiVersion>
+    <status>Active</status>
+</ApexClass>
diff --git a/force-app/main/default/classes/FinLibraryButtonController3.cls b/force-app/main/default/classes/FinLibraryButtonController3.cls
new file mode 100644
index 0000000..b6228d1
--- /dev/null
+++ b/force-app/main/default/classes/FinLibraryButtonController3.cls
@@ -0,0 +1,13 @@
+global with sharing class FinLibraryButtonController3 {
+   @AuraEnabled
+   public static Bulletin_Board__c getBulletinBoard(String recordId){
+    Bulletin_Board__c res=new Bulletin_Board__c();
+    try{
+        res=[select iPad_Finlibrary_3__c from Bulletin_Board__c where  Id= : recordId];
+    }
+    catch(Exception e){
+        System.debug(Logginglevel.info,'*******e'+e);
+    }
+    return res;
+   }
+}
\ No newline at end of file
diff --git a/force-app/main/default/classes/FinLibraryButtonController3.cls-meta.xml b/force-app/main/default/classes/FinLibraryButtonController3.cls-meta.xml
new file mode 100644
index 0000000..d75b058
--- /dev/null
+++ b/force-app/main/default/classes/FinLibraryButtonController3.cls-meta.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ApexClass xmlns="http://soap.sforce.com/2006/04/metadata">
+    <apiVersion>51.0</apiVersion>
+    <status>Active</status>
+</ApexClass>
diff --git a/force-app/main/default/classes/MonthlyReportController.cls b/force-app/main/default/classes/MonthlyReportController.cls
index 3822866..1448292 100644
--- a/force-app/main/default/classes/MonthlyReportController.cls
+++ b/force-app/main/default/classes/MonthlyReportController.cls
@@ -51,7 +51,7 @@
     }
     //鍙栨秷鎻愪氦鎿嶄綔鏇存柊鐩稿簲鏁版嵁
     @AuraEnabled
-    public static void cancel(String recordId) {
+    public static String cancel(String recordId) {
        try {
         Monthly_Report__c report = [SELECT 	Id,Status__c,Submit_check_flag__c,RecordTypeId,Submit_time__c FROM Monthly_Report__c WHERE Id = :recordId LIMIT 1];
         report.Status__c = LightingButtonConstant.STATUS_DRAFT;
@@ -59,12 +59,13 @@
         report.Submit_check_flag__c = false;
         report.Submit_time__c = null;
         update report;
+        return null;
        } catch (Exception e) {
-        System.debug(LoggingLevel.INFO, '*** e: ' + e);
-       } finally {
-
+        String eMessage = e.getMessage();
+        Integer left = eMessage.indexOf(',') + 1;
+        Integer right = eMessage.length();
+        return eMessage.substring(left,right);
        }
-
     }
 
 
diff --git a/force-app/main/default/classes/OpportunityLightingButtonController.cls b/force-app/main/default/classes/OpportunityLightingButtonController.cls
new file mode 100644
index 0000000..45124f4
--- /dev/null
+++ b/force-app/main/default/classes/OpportunityLightingButtonController.cls
@@ -0,0 +1,332 @@
+/*
+ * @Description: 
+ * @version: 
+ * @Author: chen jing wu
+ * @Date: 2023-04-12 11:16:07
+ * @LastEditors: chen jing wu
+ * @LastEditTime: 2023-04-13 17:02:46
+ */
+public with sharing class OpportunityLightingButtonController {
+    @AuraEnabled
+    public static InitData initForPredictedDateChangeButton(String recordId){
+        InitData res = new InitData();
+        try {
+            Opportunity opportunity = [
+            select 
+            DirectLossFLG__c,
+            Created_Day__c
+            from Opportunity where Id =: recordId];
+            res.createdDay = opportunity.Created_Day__c;
+            res.directLossFLG = opportunity.DirectLossFLG__c;
+        } catch (Exception e) {
+            System.debug('e:****' + e);
+        }
+        return res;
+    }
+    @AuraEnabled
+    public static InitData initForAgencyAuthorizeButton(String recordId){
+        InitData res = new InitData();
+        try {
+            Opportunity opportunity = [
+                select 
+                Agency1_ID_18__c,
+                StageName,
+                SAP_Send_OK__c,
+                Opp_order_Type__c,
+                If_Have_170__c,
+                If_Have_AH__c,
+                Cnt_Lost_cancel_Draft__c,
+                Cnt_Lost_cancel_report__c,
+                Estimation_Id__c,
+                DetailNum__c,
+                Estimation_Decision__c,
+                Sales_Root__c,
+                AcecideCntCheck__c,
+                IF_Submit__c ,
+                Trade__c,
+                Is_Corrosion__c,
+                If_Authorizing_Lock__c 
+                from Opportunity where Id =: recordId 
+            ];
+            res.agency1Id = opportunity.Agency1_ID_18__c;
+            res.stageName = opportunity.StageName;
+            res.sapSendOK = opportunity.SAP_Send_OK__c;
+            res.oppOrderType = opportunity.Opp_order_Type__c;
+            res.ifHave170 = opportunity.If_Have_170__c;
+            res.ifHaveAH = opportunity.If_Have_AH__c;
+            res.cntLostCancelDraft = opportunity.Cnt_Lost_cancel_Draft__c;
+            res.cntLostCancelReport = opportunity.Cnt_Lost_cancel_report__c;
+            res.estimationId = opportunity.Estimation_Id__c;
+            res.detailNum = opportunity.DetailNum__c;
+            res.estimationDecision = opportunity.Estimation_Decision__c;
+            res.salesRoot = opportunity.Sales_Root__c;
+            res.acecideCntCheck = opportunity.AcecideCntCheck__c;
+            res.ifSubmit = opportunity.IF_Submit__c;
+            res.trade = opportunity.Trade__c;
+            res.isCorrosion = opportunity.Is_Corrosion__c;
+            res.ifAuthorizingLock = opportunity.If_Authorizing_Lock__c;
+            String profile18 = UserInfo.getProfileId();
+            res.profileId = profile18.substring(0,profile18.length() - 3);
+        } catch (Exception e) {
+            System.debug('e:****' + e);
+        }
+        return res;
+    }
+    @AuraEnabled
+    public static InitData initForLoseBidButton(String recordId){
+        InitData res = new InitData();
+        try {
+            Opportunity opportunity = [
+                select
+                ifOpenBid__c
+                from Opportunity where Id =: recordId
+            ];
+            res.ifOpenBid = opportunity.ifOpenBid__c;
+        } catch (Exception e) {
+            System.debug('e:****' + e);
+        }
+        return res;
+    }
+    @AuraEnabled
+    public static InitData initForOLYwinBidButton(String recordId){
+        InitData res = new InitData();
+        try {
+            Opportunity opportunity = [
+                select
+                ifOpenBid__c
+                from Opportunity where Id =: recordId
+            ];
+            res.ifOpenBid = opportunity.ifOpenBid__c;
+        } catch (Exception e) {
+            System.debug('e:****' + e);
+        }
+        return res;
+    }
+    @AuraEnabled
+    public static InitData initForCreateEventButton(String recordId){
+        InitData res = new InitData();
+        try {
+            Opportunity opportunity = [
+                select 
+                AccountId 
+                from Opportunity where Id =: recordId];
+            res.accountId = opportunity.AccountId;
+        } catch (Exception e) {
+            System.debug('e:****' + e);
+        }
+        return res;
+    }
+    @AuraEnabled
+    public static InitData initFoBeforeOPDPDFBtnButton(String recordId){
+        InitData res = new InitData();
+        try {
+            Opportunity opportunity = [
+                select
+                AccountId
+                from Opportunity where Id =: recordId
+            ];
+            res.accountId = opportunity.AccountId;
+            res.userId = UserInfo.getUserId();
+        } catch (Exception e) {
+            System.debug('e:****' + e);
+        }
+        return res;
+    }
+    @AuraEnabled
+    public static InitData initFoBeforeOPDPDFBtnSISButton(String recordId){
+        InitData res = new InitData();
+        try {
+            Opportunity opportunity = [
+                select
+                AccountId
+                from Opportunity where Id =: recordId
+            ];
+            res.accountId = opportunity.AccountId;
+            res.userId = UserInfo.getUserId();
+        } catch (Exception e) {
+            System.debug('e:****' + e);
+        }
+        return res;
+    }
+    @AuraEnabled
+    public static InitData initForRequestDBButton(String recordId){
+        InitData res = new InitData();
+        try {
+            Opportunity opportunity = [
+                select
+                StageName,
+                SAP_Send_OK__c,
+                Cnt_Lost_cancel_report__c,
+                Cnt_Lost_cancel_Draft__c,
+                Agency1__c,
+                Agency1_ID_18__c,
+                Name,
+                Bid_Planned_Date__c,
+                Sales_assistant_name__c,
+                Sales_assistant_ID__c
+                from Opportunity where Id =: recordId
+            ];
+            res.stageName = opportunity.StageName;
+            res.sapSendOK = opportunity.SAP_Send_OK__c;
+            res.cntLostCancelReport = opportunity.Cnt_Lost_cancel_report__c;
+            res.cntLostCancelDraft = opportunity.Cnt_Lost_cancel_Draft__c;
+            res.agency1 = opportunity.Agency1__c;
+            res.agency1Id = opportunity.Agency1_ID_18__c;
+            res.name = opportunity.Name;
+            res.bidPlannedDate = opportunity.Bid_Planned_Date__c;
+            res.salesAssistantName = opportunity.Sales_assistant_name__c;
+            res.salesAssistantID = opportunity.Sales_assistant_ID__c;
+            String profileId18 = UserInfo.getProfileId();
+            res.profileId = profileId18.substring(0, profileId18.length() - 3);
+        } catch (Exception e) {
+            System.debug('e:****' + e);
+        }
+        return res;
+    }
+    @AuraEnabled
+    public static string updateForAgencyAuthorizeButton(String recordId){
+        try {
+            Opportunity opp = new Opportunity();
+            opp.Id = recordId;
+            opp.If_Authorizing__c = true;
+            opp.if_Interface_Lock__c = true;
+            opp.IF_Submit__c = true;
+            update opp;
+            return null;
+        } catch (Exception e) {
+            String eMessage = e.getMessage();
+            Integer left  = eMessage.indexOf(',') + 1;
+            Integer right = eMessage.length();
+            return eMessage.substring(left,right);
+        }
+    }
+    @AuraEnabled
+    public static string updateForLoseBidButton(String recordId){
+        try {
+            Opportunity opp = new Opportunity();
+            opp.Id = recordId;
+            opp.ConfirmationofAward__c = '绔炰簤瀵规墜涓爣';
+            update opp;
+            return null;
+        } catch (Exception e) {
+            String eMessage = e.getMessage();
+            Integer left = eMessage.indexOf(',') + 1;
+            Integer right = eMessage.length();
+            return eMessage.substring(left,right);
+        }
+    }
+    @AuraEnabled
+    public static string updateForOLYwinBidButton(String recordId){
+        try {
+            Opportunity opp = [select ConfirmationofAward__c,Closing_Bid_Date__c from Opportunity where Id =: recordId];
+            opp.ConfirmationofAward__c = 'OLY涓爣';
+            if (opp.Closing_Bid_Date__c == null) {
+                opp.Closing_Bid_Date__c = Date.today();
+            }
+            update opp;
+            return null;
+        } catch (Exception e) {
+            String eMessage = e.getMessage();
+            Integer left = eMessage.indexOf(',') + 1;
+            Integer right = eMessage.length();
+            return eMessage.substring(left,right);
+        }
+    }
+    @AuraEnabled
+    public static List<InquiryPredictsDateChange__c> queryForPredictedDateChangeButton(String recordId){
+        List<InquiryPredictsDateChange__c> rac = null;
+        try {
+            rac = [
+                select 
+                id 
+                from InquiryPredictsDateChange__c where Predicted_Date_Status__c = '瀹℃壒涓�' and Opportunity__c =:recordId];
+        } catch (Exception e) {
+            System.debug('e:****' + e);
+        }
+        return rac;
+    }
+    @AuraEnabled
+    public static List<task__c> queryForLoseBidButton(String recordId){
+        List<task__c> tasks = null;
+        try {
+            tasks = [
+                select
+                taskStatus__c
+                from task__c where OpportunityId__c =: recordId and name like '%涓爣缁撴灉纭%'];
+        } catch (Exception e) {
+            System.debug('e:****' + e);
+        }
+        return tasks;
+    }
+    @AuraEnabled
+    public static List<task__c> queryForOLYwinBidButton(String recordId){
+        List<task__c> tasks = null;
+        try {
+            tasks = [
+                select
+                taskStatus__c
+                from task__c where OpportunityId__c =: recordId and name like '%涓爣缁撴灉纭%'];
+        } catch (Exception e) {
+            System.debug('e:****' + e);
+        }
+        return tasks;
+    }
+    public class InitData{
+        @AuraEnabled
+        public Boolean directLossFLG;
+        @AuraEnabled
+        public Date createdDay;
+        @AuraEnabled
+        public String agency1Id;
+        @AuraEnabled
+        public String agency1;
+        @AuraEnabled
+        public String stageName;
+        @AuraEnabled
+        public Boolean sapSendOK;
+        @AuraEnabled
+        public String oppOrderType;
+        @AuraEnabled
+        public Boolean ifHave170;
+        @AuraEnabled
+        public Boolean ifHaveAH;
+        @AuraEnabled
+        public Decimal cntLostCancelDraft;
+        @AuraEnabled
+        public Decimal cntLostCancelReport;
+        @AuraEnabled
+        public String estimationId;
+        @AuraEnabled
+        public Decimal detailNum;
+        @AuraEnabled
+        public Boolean estimationDecision;
+        @AuraEnabled
+        public String salesRoot;
+        @AuraEnabled
+        public Boolean acecideCntCheck;
+        @AuraEnabled
+        public Boolean ifSubmit;
+        @AuraEnabled
+        public String trade;
+        @AuraEnabled
+        public Boolean isCorrosion;
+        @AuraEnabled
+        public Boolean ifAuthorizingLock;
+        @AuraEnabled
+        public String profileId;
+        @AuraEnabled
+        public String ifOpenBid;
+        @AuraEnabled
+        public String accountId;
+        @AuraEnabled
+        public String userId;
+        @AuraEnabled
+        public String name;
+        @AuraEnabled
+        public Date bidPlannedDate;
+        @AuraEnabled
+        public String salesAssistantName;
+        @AuraEnabled
+        public String salesAssistantID;
+    }
+}
\ No newline at end of file
diff --git a/force-app/main/default/classes/OpportunityLightingButtonController.cls-meta.xml b/force-app/main/default/classes/OpportunityLightingButtonController.cls-meta.xml
new file mode 100644
index 0000000..fbbad0a
--- /dev/null
+++ b/force-app/main/default/classes/OpportunityLightingButtonController.cls-meta.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ApexClass xmlns="http://soap.sforce.com/2006/04/metadata">
+    <apiVersion>56.0</apiVersion>
+    <status>Active</status>
+</ApexClass>
diff --git a/force-app/main/default/classes/OpportunityService.cls b/force-app/main/default/classes/OpportunityService.cls
new file mode 100644
index 0000000..f8044db
--- /dev/null
+++ b/force-app/main/default/classes/OpportunityService.cls
@@ -0,0 +1,457 @@
+public with sharing   class OpportunityService{
+
+  private static String opp_search_field = ' Id, Name, Account_Name_F__c, OwnerId, Hospital__c, Opportunity_No__c, Opportunity_stage__c, StageName__c, Bidding_Project_Name_Bid__c, Department_Class__r.RecordTypeId ';
+  
+  // 鏌ヨ宸蹭繚瀛樼殑鏁版嵁  
+  //noStr 璇环鐨処D
+  //daccountID 瀹㈡埛鐨処D 鐜板湪娌$敤
+  // IdStr 鎷涙姇鏍囩殑ID
+  //hospital 鍖婚櫌鐨処D
+  @AuraEnabled
+  public  static string GetNormalProductDataSearch(String noStr,String accountId,String IdStr,String hospital,String[] hospitalArr, String departments) {
+
+    String sql = 'select ';
+    // sql += CommonUtils.GetSqlToPorps(Opportunity.SObjectType);
+    sql += opp_search_field;
+    sql += ' from Opportunity';
+    // 澶氬澶氬叧绯� 鍘绘帀鏈叧鑱旂殑鍒ゆ柇 start
+    // sql += ' where Bidding_Project_Name_Bid__c = null ';
+    sql += ' where id != null ';
+    // 澶氬澶氬叧绯� 鍘绘帀鏈叧鑱旂殑鍒ゆ柇 end
+    if(noStr != null && noStr != '' && noStr != ' ')
+    {
+      sql += ' and Opportunity_No__c = :noStr';
+    }
+
+    if(hospitalArr!= null && hospitalArr.size() > 0)
+    {
+      sql += ' and Hospital__c in :hospitalArr';
+    }
+    if(hospital != null && hospital != '' && hospital != ' ')
+    {
+      sql += ' and Hospital__c = :hospital';
+    }
+
+    // String paremt1 = '012100000006KMe';
+    // String paremt2 = '01210000000QekK';
+    // String paremt3 = '寮曞悎';
+    // sql += ' and (recordtypeid = :paremt1 or recordtypeid = :paremt2) and stagename = :paremt3 ';
+    sql += ' and recordtype.developername in (\'Opportunity\',\'SI_Oppor\') and Hospital__r.Is_Active__c = \'鏈夊姽\' '+
+        // 杩欓噷鏈変慨鏀癸紝鍒粰鐩栦簡
+    ' and ( (SAP_Send_OK__c = true and SAP_Send_OK_Date__c   = LAST_N_DAYS:183  ) '+
+        'or( stagename = \'鏁楁垿\' and Final_Contract_Proceeded_Date__c = LAST_N_DAYS:183  ) or stagename = \'寮曞悎\' ) ';
+      // 杩欓噷鏈変慨鏀癸紝鍒粰鐩栦簡
+    // 20210914 鎴樼暐绉戝淇敼
+    //if (departments != null && String.isNotBlank(departments)) {
+    //  String[] depart_types = departments.split(';');
+    //  if (depart_types != null && depart_types.size() > 0 && depart_types.size() < 6) {
+    //    sql += ' and Department_Class__r.RecordTypeId in :depart_types ';
+    //  }
+    //}
+    // 20210914 鎴樼暐绉戝淇敼
+    // 鍘绘帀宸茬粡鍏宠仈鐨勬嫑鏍�
+    if(IdStr != null && String.isNotBlank(IdStr)) {
+      sql += ' and id not in (select Opportunity__c from Tender_Opportunity_Link__c where Tender_information__c = :IdStr) ';
+    }
+    // 20221014 ljh SWAG-CK28WT add start
+    String proId = UserInfo.getProfileId();
+    String p_2M4 = System.Label.ProfileId_2M4;
+    if(proId.substring(0,15) == p_2M4.substring(0,15)){
+       sql += ' AND OwnerId =\''+UserInfo.getUserId()+'\'';
+    }
+    System.debug('sql:'+sql);
+    // 20221014 ljh SWAG-CK28WT add end
+    sql += '  limit 50';
+    List<Opportunity> arrays = Database.query(sql);
+    return JSON.serialize(arrays); 
+    
+  }
+ 
+ // 鏌ヨ鏈繚瀛樼殑鏁版嵁  
+  // IdStr 鎷涙姇鏍囩殑ID
+  //hospital 鍖婚櫌鐨処D
+  @AuraEnabled
+  public  static string GetNormalProductDataNotSave(String IdStr,String[] hospital, String departments) {
+
+    //TODU
+    // QueryWrapper query = new QueryWrapper(Tender_information__c.SObjectType);
+    // query.eq('Id',IdStr);
+
+    // 鎷涙爣-璇环鍏宠仈淇敼 20210813 start
+    String sql = 'select ';
+    // sql += CommonUtils.GetSqlToPorps(Opportunity.SObjectType);
+    sql += opp_search_field;
+    sql += ' from Opportunity';
+    // 澶氬澶氬叧绯� 鍘绘帀鏈叧鑱旂殑鍒ゆ柇 start
+    // sql += ' where Bidding_Project_Name_Bid__c = null ';
+    // 澶氬澶氬叧绯� 鍘绘帀鏈叧鑱旂殑鍒ゆ柇 end
+    // String paremt1 = '012100000006KMe';
+    // String paremt2 = '01210000000QekK';
+    // String paremt3 = '寮曞悎';
+    // sql += ' and (recordtypeid = :paremt1 or recordtypeid = :paremt2) and stagename = \'寮曞悎\' ';
+    // sql += ' and recordtype.developername in (\'Opportunity\',\'SI_Oppor\') and Hospital__r.Is_Active__c = \'鏈夊姽\' '+
+    sql += ' where recordtype.developername in (\'Opportunity\',\'SI_Oppor\') and Hospital__r.Is_Active__c = \'鏈夊姽\' '+
+        // 杩欓噷鏈変慨鏀癸紝鍒粰鐩栦簡
+    ' and ( (SAP_Send_OK__c = true and SAP_Send_OK_Date__c   = LAST_N_DAYS:183 ) '+
+        'or( stagename = \'鏁楁垿\' and Final_Contract_Proceeded_Date__c = LAST_N_DAYS:183  ) or stagename = \'寮曞悎\' ) ';
+      // 杩欓噷鏈変慨鏀癸紝鍒粰鐩栦簡
+    // 鍘绘帀宸茬粡鍏宠仈鐨勬嫑鏍�
+    if(IdStr != null && String.isNotBlank(IdStr)) {
+      sql += ' and id not in (select Opportunity__c from Tender_Opportunity_Link__c where Tender_information__c = :IdStr) ';
+    }
+    // 20210914 鎴樼暐绉戝淇敼
+    //if (departments != null && String.isNotBlank(departments)) {
+    //  String[] depart_types = departments.split(';');
+    //  if (depart_types != null && depart_types.size() > 0 && depart_types.size() < 6) {
+    //    sql += ' and Department_Class__r.RecordTypeId in :depart_types ';
+    //  }
+    //}
+    // 20210914 鎴樼暐绉戝淇敼
+    if(hospital!= null && hospital.size() > 0)
+    {
+      sql += ' and Hospital__c in :hospital';
+    }
+    // 20221014 ljh SWAG-CK28WT add start
+    String proId = UserInfo.getProfileId();
+    String p_2M4 = System.Label.ProfileId_2M4;
+    if(proId.substring(0,15) == p_2M4.substring(0,15)){
+       sql += ' AND OwnerId =\''+UserInfo.getUserId()+'\'';
+    }
+    System.debug('sql:'+sql);
+    // 20221014 ljh SWAG-CK28WT add end
+    sql += '  limit 50';
+    List<Opportunity> arrays = Database.query(sql);
+
+    // Tender_information__c
+    return JSON.serialize(arrays); 
+    
+    // 鎷涙爣-璇环鍏宠仈淇敼 20210813 end
+  }
+
+
+
+
+
+  //鏌ヨ宸蹭繚瀛�
+  // 鍙湁涓�涓� 褰撳墠鎷涙姇鏍�
+  //IdStr 鎷涙姇鏍囩殑ID
+  @AuraEnabled
+  public  static string GetNormalProductDataIsSave(String IdStr) {
+    // 鎷涙爣-璇环鍏宠仈淇敼 20210817 start
+    // 鏌ヨ鏂瑰紡鎴栬搴旇浼樺寲涓�涓�
+    // QueryWrapper query = new QueryWrapper(Opportunity.SObjectType);
+    // query.eq('Bidding_Project_Name_Bid__c', IdStr);
+    // List<Opportunity> arrays = DataBasePlus.listPlus(query);
+    List<Id> oppIds = new List<Id>();
+    List<Tender_Opportunity_Link__c> links = [select Opportunity__c from Tender_Opportunity_Link__c where Tender_information__c = :IdStr];
+    if (links != null && links.size() > 0) {
+      for (Tender_Opportunity_Link__c link : links) {
+        oppIds.add(link.Opportunity__c);
+      }
+    }
+    // String sql = 'select ' + CommonUtils.GetSqlToPorps(Opportunity.SObjectType) + ' from Opportunity ';
+    String sql = 'select ' + opp_search_field + ' from Opportunity ';
+    sql += 'where Id in :oppIds';
+    List<Opportunity> arrays = Database.query(sql);
+    // 鎷涙爣-璇环鍏宠仈淇敼 20210817 end
+    return JSON.serialize(arrays); 
+  }
+   
+
+
+  
+  //淇濆瓨
+   //JsonSelected JSON鏍煎紡鐨勬嫑鎶曟爣鐨勫凡閫夋嫨鏁版嵁闆嗗悎
+   //JsonNotSelected JSON鏍煎紡鐨勬嫑鎶曟爣鐨勬湭閫夋嫨鏁版嵁闆嗗悎
+   // BiddingId 瀵瑰簲鐨勬嫑鏍囬」鐩悕锛堟嫑鎶曟爣锛�
+   // flag  淇敼 鎷涙姇鏍囬」鐩� 鍏宠仈璇环鏃堕棿鐨勪竴涓爣璇�
+  @AuraEnabled
+  public  static string SaveData(String JsonSelected,String JsonNotSelected,String BiddingId,Boolean flag) {
+
+    try{
+      // 鏂板鎷涙爣-璇环鍏宠仈鍏崇郴琛紝鍘绘帀鏇存柊璇环涓婄殑鏈�鏂版嫑鏍囦俊鎭� 20210813 start
+      // if(JsonSelected != null &&  JsonSelected != '' && JsonSelected !='[]')
+      // {
+      //   List<Opportunity> SelectedList = (List<Opportunity>)JSON.deserialize(JsonSelected,List<Opportunity>.class);
+
+      //   for(Opportunity item :SelectedList){
+      //     item.Bidding_Project_Name_Bid__c = null;
+      //   }
+       
+
+              
+      // Database.update(SelectedList,false);
+      // }
+      // string OppOwnerId = '';
+      // if(JsonNotSelected != null &&  JsonNotSelected != '' && JsonNotSelected !='[]')
+      // {
+      //   List<Opportunity> NotSelectedList = (List<Opportunity>)JSON.deserialize(JsonNotSelected,List<Opportunity>.class);
+
+      //   for(Opportunity item :NotSelectedList){
+      //     item.Bidding_Project_Name_Bid__c = BiddingId;
+      //   }
+      //   OppOwnerId = NotSelectedList[0].ownerId;
+      //   Database.update(NotSelectedList);
+      // }
+      // if(flag != null && flag == true)
+      // {
+      //   string tenProp = CommonUtils.GetSqlToPorps(Tender_information__c.SObjectType);
+      //   String sql = 'select '+tenProp+' from Tender_information__c  where Id = :BiddingId';
+      //   List<Tender_information__c> arrays = Database.query(sql);
+      //   arrays[0].RelateOppTime__c = datetime.now();
+      //   //if( arrays[0].IsBid__c == null && OppOwnerId != '')
+      //   //{
+      //   //  arrays[0].ownerId = OppOwnerId;
+      //   //}
+      //   if (arrays != null && arrays.size() >0 &&
+      //   (arrays[0].ownerId == '00510000005sEEM' || arrays[0].ownerId == '00510000000gmxH')
+      //   && OppOwnerId != '')
+      //   {
+      //     arrays[0].ownerId = OppOwnerId;
+      //   }
+      //   Database.update(arrays);
+      // }
+      // 鏂板鎷涙爣-璇环鍏宠仈鍏崇郴琛紝鍘绘帀鏇存柊璇环涓婄殑鏈�鏂版嫑鏍囦俊鎭� 20210813 end
+
+      // 鎷涙爣-璇环鍏宠仈淇敼 20210813 start
+      // 鏌ヨ鎷涙爣
+      // string tenProp = CommonUtils.GetSqlToPorps(Tender_information__c.SObjectType);
+      // String sql = 'select '+tenProp+' from Tender_information__c  where Id = :BiddingId';
+      String sql = 'SELECT ';
+      sql += 'Id, ';
+      sql += 'NotBidApprovalStatus__c, ';
+      sql += 'IsBid__c, ';
+      sql += 'TenderBeginTime__c, ';
+      sql += 'InfoType__c, ';
+      sql += 'OwnerId, ';
+      sql += 'IsReactionOpp__c, ';
+      sql += 'IsRelateProject__c, ';
+      sql += 'RelateOppTime__c, ';
+      sql += 'irrelevantReasons__c, ';
+      sql += 'irrelevantReasonOther__c, ';
+      sql += 'Hospital__c, ';
+      sql += 'Hospital1__c, ';
+      sql += 'Hospital2__c, ';
+      sql += 'Hospital3__c, ';
+      sql += 'Hospital4__c, ';
+      sql += 'publicDate__c, ';// 20221114 ljh SWAG-CKL5UC
+      sql += 'Tender_Order__c, ';  //20220620 you SWAG-CFD4SU 
+      sql += 'subInfoType__c ';  //20220718 you 鎷涙爣浠诲姟 
+      sql += 'FROM Tender_information__c  WHERE Id = :BiddingId order by Tender_Order__c desc,relativeTime_F__c desc'; //20220620 you SWAG-CFD4SU 澧炲姞 order by
+      List<Tender_information__c> arrays = Database.query(sql);
+      Tender_information__c tender = arrays[0];
+      
+      // 涓嶅簲鏍囩敵璇蜂腑鐨勬椂鍊� 璋冨洖鐢宠淇敼 20210907 start
+      if (tender.NotBidApprovalStatus__c != null && tender.NotBidApprovalStatus__c == '鐢宠涓�') {
+        List<Approval.ProcessWorkitemRequest> requests = new List<Approval.ProcessWorkitemRequest> ();
+        ProcessInstance pi = [Select Id, SubmittedById from ProcessInstance where TargetObjectId = :tender.Id and Status = 'Pending' order by CreatedDate desc limit 1];
+        if (pi != null) {
+          for(ProcessInstanceWorkItem wi : [Select Id from ProcessInstanceWorkItem where ProcessInstanceId = :pi.Id]){
+            Approval.ProcessWorkitemRequest req2 = new Approval.ProcessWorkitemRequest();
+            if (pi.SubmittedById.equals(Userinfo.getUserId())) {
+              req2.setAction('Removed');
+              tender.NotBidApprovalStatus__c = '鑽夋涓�';
+            } else {
+              req2.setAction('Reject');
+              tender.NotBidApprovalStatus__c = '椹冲洖';
+              tender.IsBid__c = null;
+            }
+            req2.setWorkitemId(wi.Id);
+            requests.add(req2);
+          }
+          system.debug('==requests.size()=='+requests.size());
+          if (requests.size() > 0) {
+            Approval.ProcessResult[] processResults = null;
+            processResults = Approval.process(requests, true);
+            system.debug('==璋冨洖缁撴灉=='+processResults);
+          }
+        }
+      }
+      // 涓嶅簲鏍囩敵璇蜂腑鐨勬椂鍊� 璋冨洖鐢宠淇敼 20210907 end
+      
+      // 鍚堝苟宸插叧鑱斿拰鏈叧鑱斿垪琛�
+      List<Opportunity> all_selected_list = new List<Opportunity>();
+      if (JsonSelected != null &&  JsonSelected != '' && JsonSelected !='[]') {
+        all_selected_list.addAll((List<Opportunity>)JSON.deserialize(JsonSelected,List<Opportunity>.class));
+      }
+      if (JsonNotSelected != null &&  JsonNotSelected != '' && JsonNotSelected !='[]') {
+        all_selected_list.addAll((List<Opportunity>)JSON.deserialize(JsonNotSelected,List<Opportunity>.class));
+      }
+      // 鎷涙爣鎵�鏈変汉鏄惁瑕佷慨鏀筬lag
+      // boolean owner_change = false;
+      // 鍏堝垹闄ゆ棫鐨刲ink
+      // 璺宠繃trigger鏍囪
+      // 娌℃湁鍒犻櫎閫昏緫
+      StaticParameter.EscapeTOLinkTrigger = true;
+      // List<Tender_Opportunity_Link__c> del_links = [select Id from Tender_Opportunity_Link__c where Tender_information__c = :BiddingId];
+      // if (del_links != null && del_links.size() > 0) {
+      //   delete del_links;
+      // }
+      // 鏇存柊璇环
+      List<Opportunity> upd_opps = new List<Opportunity>();
+      List<Opportunity> upd_opps1 = new List<Opportunity>();
+      List<String> owners = new List<String>();
+      // 鎻掑叆link
+      if (all_selected_list.size() > 0) {
+        // 璁剧疆鎷涙爣鎵�鏈変汉
+        // OppOwnerId = all_selected_list[0].ownerId;
+        // 鍒濆鍖栧弬鏁�
+        List<Tender_Opportunity_Link__c> add_list = new List<Tender_Opportunity_Link__c>();
+        // 褰撹浠峰叧鑱旇繃缁撴灉闃舵鐨勬嫑鏍囬」鐩紝鍐嶈鍙︿竴涓粨鏋滈樁娈电殑鎷涙爣椤圭洰鍏宠仈鏃讹紝浼氬洜涓烘暟鎹閿佸畾鑰屾姤閿�
+        // 鍦ㄦ澶勯噸鏂版绱㈣浠�
+        List<String> oppIds = new List<String>();
+        for (Opportunity opp : all_selected_list) {
+          oppIds.add(opp.Id);
+          owners.add(opp.ownerId);
+          // 鏂板缓link
+          Tender_Opportunity_Link__c link = new Tender_Opportunity_Link__c();
+          link.Tender_information__c = tender.Id;
+          link.Opportunity__c = opp.Id;
+          link.Tender_Opportunity_Uniq__c = String.valueOf(tender.Id) + String.valueOf(opp.Id);
+
+          add_list.add(link);
+        }
+        // 鎻掑叆link
+        if (add_list.size() > 0) {
+          insert add_list;
+        }
+        // 鎭㈠trigger鏍囪
+        StaticParameter.EscapeTOLinkTrigger = false;
+        //20220620 you SWAG-CFD4SU 鏀归�� start  濮嬬粓鏄剧ず鏈�鏂扮殑 鈶� 3锛氱粨鏋�,鈶� 4锛氬彉鏇�,鈶� 2锛氬叕鍛�,鈶� 1锛氶鍛�,鈶� 5锛氬叾浠� 
+        List<String> tenIds = new List<String>();//20220718 you 鎷涙爣浠诲姟
+        system.debug('opportunityservicetest'+oppIds);
+        if (oppIds.size() > 0) {
+          // 20221114 SWAG-CKL5UC ljh 澧炲姞 Created_Day__c,LeadSource,LeakageNumber__c
+          List<Opportunity> wait_upd_opps = [select id,Opp_Order__c,Tender_Number__c, Bidding_Project_Name_Bid__c, Bidding_Project_Name_Bid__r.InfoType__c,Created_Day__c,LeadSource,LeakageNumber__c from Opportunity where id in :oppIds ];//and Bidding_Project_Name_Bid__r.InfoType__c != '3锛氱粨鏋�'];
+          if (wait_upd_opps != null && wait_upd_opps.size() > 0) {
+            for (Opportunity opp : wait_upd_opps) {
+              /**
+              if (opp.Bidding_Project_Name_Bid__c == null || String.isBlank(opp.Bidding_Project_Name_Bid__c)) {
+                opp.Bidding_Project_Name_Bid__c = tender.Id;
+                opp.TenderBeginDate_Text__c = tender.TenderBeginTime__c;
+                upd_opps.add(opp);
+              } else if (tender.InfoType__c == '3锛氱粨鏋�' && opp.Bidding_Project_Name_Bid__r.InfoType__c != '3锛氱粨鏋�') {
+                opp.Bidding_Project_Name_Bid__c = tender.Id;
+                upd_opps.add(opp);
+              }
+              **/
+              if(opp.Opp_Order__c <= tender.Tender_Order__c){
+                opp.Bidding_Project_Name_Bid__c =tender.Id;
+                //opp.TenderBeginDate_Text__c = tender.TenderDate__c;//鏇存敼璇环2鏃朵慨鏀硅繖涓瓧娈碉紝寮曠敤瓒�20锛宼ender.TenderBeginTime__c;
+                upd_opps.add(opp);
+                //20220715 you 鎷涙爣椤圭洰 start
+                if(String.isNotBlank(tender.InfoType__c) && tender.InfoType__c=='3锛氱粨鏋�' && String.isNotBlank(tender.subInfoType__c) && (tender.subInfoType__c=='3-5锛氫腑鏍囬�氱煡' || tender.subInfoType__c=='3-6锛氬悎鍚屽叕鍛�')){
+                  tenIds.add(opp.id); //绗﹀悎鏉′欢鐢熸垚浠诲姟
+                }
+                //20220715 you 鎷涙爣椤圭洰 end
+                break;
+              }
+
+            }
+            //20220829 you SWAG-CHL67J start
+            for (Opportunity opp : wait_upd_opps) {
+              Integer returncount =0;
+              if(String.isNotBlank(tender.InfoType__c) && tender.InfoType__c!='1锛氶鍛�' && String.isNotBlank(tender.subInfoType__c) && tender.subInfoType__c!='3-1锛氬簾鏍囧叕鍛�' && tender.subInfoType__c!='3-2锛氭祦鏍囧叕鍛�'){  
+                  returncount += 1;
+                }
+              opp.Tender_Number__c = returncount;
+              // 20221114 ljh SWAG-CKL5UC start 
+              if(opp.LeakageNumber__c != 1 && tender.publicDate__c != null && String.isNotBlank(opp.LeadSource) && opp.LeadSource == '鎷涙爣缃�' && opp.Created_Day__c > tender.publicDate__c){
+                opp.LeakageNumber__c = 1;
+              }
+              // 20221114 ljh SWAG-CKL5UC start 
+              upd_opps1.add(opp);  
+            }  
+                 
+            //20220829 you SWAG-CHL67J end 
+          }
+        }
+        if (upd_opps1.size() > 0) {
+          update upd_opps1;
+        }
+        //20220620 you SWAG-CFD4SU 鏀归�� end
+        // 鏇存柊璇环涓婄殑鎷涙爣椤圭洰
+        if (upd_opps.size() > 0) {
+          update upd_opps;
+        }
+         //20220718 you 鎷涙爣浠诲姟 start
+                             
+        if (tenIds !=null && tenIds.size() > 0) {
+            Database.executeBatch(new TenderResultConfirmTaskBatch(tenIds));
+          }
+          //20220718 you 鎷涙爣浠诲姟 end
+      }
+
+      // 鏌ヨ鎷涙爣鏁伴噺骞舵洿鏂�
+      List<Tender_Opportunity_Link__c> tenderLinks = [SELECT id, Tender_information__c, Opportunity__c, Opportunity__r.Hospital__c, Opportunity__r.OwnerId FROM Tender_Opportunity_Link__c WHERE Tender_information__c = :tender.Id];
+      List<String> oppOwnerInLinks = new List<String>();
+      for (Tender_Opportunity_Link__c link : tenderLinks) {
+        oppOwnerInLinks.add(link.Opportunity__r.OwnerId);
+      }
+      // 鏇存柊鎷涙爣涓婄殑鎵�鏈変汉
+      if (tender.OwnerId == null || '00510000000gmxH'.equals(tender.OwnerId) || (oppOwnerInLinks.size() > 0 && !oppOwnerInLinks.contains(tender.OwnerId))) {
+        tender.ownerId = owners.size() > 0 ? owners.get(0) : '00510000000gmxH';
+      }
+      // 鍙嶆槧璇环鐘舵��
+      tender.IsReactionOpp__c = true;
+      // 鏌ヨ鎷涙爣鏁伴噺骞舵洿鏂�
+      //List<Tender_Opportunity_Link__c> tenderLinks = [SELECT id, Tender_information__c, Opportunity__c, Opportunity__r.Hospital__c FROM Tender_Opportunity_Link__c WHERE Tender_information__c = :tender.Id];
+      tender.OpportunityNum__c = tenderLinks != null ? tenderLinks.size() : 0;
+      // 鍏宠仈璇环鏃堕棿鍜屾槸鍚︾浉鍏崇姸鎬�
+      if (tender.IsRelateProject__c != '鏄�') {
+        tender.IsRelateProject__c = '鏄�';
+        tender.RelateOppTime__c = datetime.now();
+        tender.irrelevantReasons__c = null;
+        tender.irrelevantReasonOther__c = null;
+      }
+      // 鏇存柊鍏宠仈鍖婚櫌
+      if (tenderLinks != null && tenderLinks.size() > 0) {
+        // 鎷涙爣椤圭洰鐨勫尰闄�
+        Map<String,String> fiveHospitalMap = new Map<String,String>();
+        fiveHospitalMap.put('Hospital__c', tender.Hospital__c);
+        fiveHospitalMap.put('Hospital1__c', tender.Hospital1__c);
+        fiveHospitalMap.put('Hospital2__c', tender.Hospital2__c);
+        fiveHospitalMap.put('Hospital3__c', tender.Hospital3__c);
+        fiveHospitalMap.put('Hospital4__c', tender.Hospital4__c);
+        for(Integer i = 0; i<tenderLinks.size();i++) {
+          //褰撴嫑鎶曟爣椤圭洰鐨勪簲涓尰闄㈣祴鍊煎畬鎴愬悗涓嶅啀璧嬪��
+          Boolean HospitalIsNeedBreak = false;
+          for(String ApiName :fiveHospitalMap.keySet()){
+              HospitalIsNeedBreak = fiveHospitalMap.get(ApiName)==null?false:true;
+          }
+          
+          if(HospitalIsNeedBreak){
+              break;
+          }
+
+          //缁欐嫑鎶曟爣椤圭洰鐨�5涓尰闄㈣鍊�
+          for(String ApiName : fiveHospitalMap.keySet()){
+            String tempTenderHospId = fiveHospitalMap.get(ApiName)==null?'':fiveHospitalMap.get(ApiName);
+            String oppHospId = tenderLinks.get(i).Opportunity__r.Hospital__c; 
+            //濡傛灉鎷涙爣椤圭洰宸茬粡鏈夎鍖婚櫌灏卞垽鏂笅涓�涓浠风殑鍖婚櫌
+            if(tempTenderHospId.contains(oppHospId)){
+                break;
+            }
+
+            //鍖婚櫌涓虹┖,璧嬪�煎尰闄�(璧嬪�间箣鍚庤繘琛岃祴鍊间笅涓�涓尰闄�)
+            if(String.isBlank( fiveHospitalMap.get(ApiName) )){
+                fiveHospitalMap.put(ApiName,oppHospId);
+                break;
+            }
+          }
+        }
+        tender.Hospital__c = fiveHospitalMap.get('Hospital__c');
+        tender.Hospital1__c = fiveHospitalMap.get('Hospital1__c');
+        tender.Hospital2__c = fiveHospitalMap.get('Hospital2__c');
+        tender.Hospital3__c = fiveHospitalMap.get('Hospital3__c');
+        tender.Hospital4__c = fiveHospitalMap.get('Hospital4__c');
+      }
+      update tender;
+      // 鎷涙爣-璇环鍏宠仈淇敼 20210813 end
+      return '鎴愬姛'; 
+    }catch (Exception ex) {
+      return  ex.getMessage();
+    }
+
+  }
+}
\ No newline at end of file
diff --git a/force-app/main/default/classes/OpportunityService.cls-meta.xml b/force-app/main/default/classes/OpportunityService.cls-meta.xml
new file mode 100644
index 0000000..d75b058
--- /dev/null
+++ b/force-app/main/default/classes/OpportunityService.cls-meta.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ApexClass xmlns="http://soap.sforce.com/2006/04/metadata">
+    <apiVersion>51.0</apiVersion>
+    <status>Active</status>
+</ApexClass>
diff --git a/force-app/main/default/classes/OpportunityWebService.cls b/force-app/main/default/classes/OpportunityWebService.cls
new file mode 100644
index 0000000..31ce276
--- /dev/null
+++ b/force-app/main/default/classes/OpportunityWebService.cls
@@ -0,0 +1,506 @@
+global class OpportunityWebService {
+    
+    @AuraEnabled
+    WebService static String changeTrade(String oppId){
+
+        List<Quote> quoList = [select id from Quote where OpportunityId = :oppId];
+        List<OpportunityLineItem> oppLI = [select id from OpportunityLineItem where Opportunity.id = :oppId];
+
+        Opportunity opp = new Opportunity();
+        opp.id = oppId;
+        opp.Estimation_Decision__c = false;
+        opp.Estimation_Id__c = null;
+        opp.Quote_Update_Sum__c = null;
+        opp.Estimation_No__c = null;
+        opp.Estimation_Proposal_Date__c = null;
+        opp.Estimation_Name__c = null;
+        // LHJ SWAG-C9QAAJ 鍘绘帀 Start
+        // opp.Authorized_Finish_Sales__c = null;
+        // opp.Authorized_DB_No__c = null;
+        // opp.Authorized_Date__c = null;
+        // opp.Autholization_Activated_Date__c = null;
+        // opp.Bidding_Content__c = null;
+        // opp.Bid_Date__c = null;
+        // opp.Bidding_No__c = null;
+        // opp.Bidding_Project_Name__c = null;
+        // LHJ End
+
+        Savepoint sp = Database.setSavepoint();
+        try {
+            delete quoList;
+            delete oppLI;
+            update opp;
+            return '1';     
+        } catch (Exception ex) {
+            Database.rollback(sp);
+            return  ex.getMessage() + ' | Line:' + ex.getLineNumber();
+        }
+    } 
+
+    // LHJ CBPR Start
+    webservice String parameter { get; set; }
+
+    public OpportunityWebService() {
+        this.parameter = 'value';
+    }
+    @AuraEnabled
+    WebService static String oppCheck(String oppid, String saveFlg) {
+
+        Map<Id, String> proMap= new Map<Id, String>();
+        List<OpportunityLineItem> OppItemList = [select PricebookEntry.Product2Id, PricebookEntry.Product2.Name
+                                                   From OpportunityLineItem 
+                                                  Where OpportunityId = :oppid];
+
+        if (OppItemList.size() > 0) {
+            for (OpportunityLineItem opl : OppItemList) {
+                proMap.put(opl.PricebookEntry.Product2Id, opl.PricebookEntry.Product2.Name);
+            }
+        }
+
+        List<Opportunity> oppList = [select Agency1__c from Opportunity where id = :oppid];
+        String angencyId = oppList[0].Agency1__c;
+        String strRet = '';
+
+        if (saveFlg == '1') {
+            strRet = checkProRegisterDecide(proMap, angencyId, oppid);
+        } else {
+            strRet = checkProRegisterDecide(proMap, angencyId, '');
+        }
+        return strRet;
+    }
+    @AuraEnabled
+    // LHJ 闃胯タ璧涘妫�鏌� Start
+    WebService  static String checkDangerItem(String agency1) {
+        //娌℃湁鍗卞寲鍝佽瘉鐓х殑鎻愮ず淇℃伅
+        String licenseStr = '绗竴缁忛攢鍟嗘病鏈夋湁鏁堢殑鍗遍櫓鍖栧鍝佺粡钀ヨ鍙瘉銆�';
+        //娌℃湁闃胯タ璧涘缁忛攢鍟嗗崗璁殑鎻愮ず淇℃伅
+        String accStr = '绗竴缁忛攢鍟嗘病鏈夐樋瑗胯禌澶氱粡閿�鍟嗗崗璁��';
+
+        //妫�鏌ユ槸鍚︽湁璇佺収
+        List<License_Information__c> licenseList = [SELECT Id
+                                                      FROM License_Information__c
+                                                     WHERE LicenseAndAccount__c = :agency1
+                                                       AND LicenseType__c = '鍗遍櫓鍖栧鍝佺粡钀ヨ鍙瘉'
+                                                       AND Is_Active_Formula__c = true
+                                                       
+                                                    ];
+        //妫�鏌ユ槸鍚︽湁闃胯タ璧涘鍗忚
+        List<Account> accountList = [SELECT Id
+                                                      FROM Account
+                                                     WHERE Parent.id = :agency1
+                                                       //闃胯タ璧涘 澧炲姞妫�绱㈤樋瑗胯禌澶氬崗璁� 浠ュ強 鍙互鍋氭姤浠�(澶嶉�夋) 绮剧悽鎶�鏈� wql 2021/01/04 start
+                                                       AND Contract_Quote_Decide_Flag_checkbox__c =true
+                                                       AND Assiesedo_Dealer__c  = true
+                                                       //闃胯タ璧涘 澧炲姞妫�绱㈤樋瑗胯禌澶氬崗璁� 浠ュ強 鍙互鍋氭姤浠�(澶嶉�夋) 绮剧悽鎶�鏈� wql 2021/01/04 end
+                                                    ];
+
+        system.debug('licenseList:'+licenseList.size());
+        system.debug('agency1:'+agency1);
+        //鈶犳棦娌℃湁鍗卞寲鍝佽瘉涔熸病鏈夐樋瑗胯禌澶氬崗璁�
+        if(licenseList.size() == 0 && accountList.size() ==0){
+            return licenseStr+accStr;
+        }
+        //鈶℃病鏈夊嵄鍖栧搧璇�
+        else if(licenseList.size() ==0){
+            return licenseStr;
+        }
+        //鈶℃病鏈夐樋瑗胯禌澶氱粡閿�鍟嗗崗璁�
+        else if(accountList.size() ==0){
+            return accStr;
+        }
+        //鈶㈠叏閮芥湁
+        else{
+            return 'OK';
+        }
+    }
+    // LHJ 闃胯タ璧涘妫�鏌� End
+
+    public static Map<String, String> MapCheckProRegisterDecide(Map<Id, String> proMap, String agency1, String OppId) {
+
+        Map<String, String> retMap = new Map<String, String>();
+        String errormessage = '';
+        Boolean error = false;
+        Map<String,List<String>> proAllBSstrMap;
+        List<String> proNotNeedList = new List<String>();
+
+        Map<String,List<String>> old_newMap = new Map<String,List<String>>();
+        Map<String,List<String>> new_oldMap = new Map<String,List<String>>();
+
+        // 鍙栧緱 缁忚惀鑼冨洿瀵瑰簲浜у搧鍏崇郴
+        List<String> midStr = new List<String>();
+        List<String> midStrO = new List<String>();
+
+        // List<Product_Register_contrast__c> rrList = Product_Register_contrast__c.getall().values();
+
+        // for (Product_Register_contrast__c rr : rrList) {
+
+        //     midStr = new List<String>();
+        //     midStrO = new List<String>();
+
+        //     // 缁忚惀鑼冨洿瀵瑰簲浜у搧鍏崇郴 Map浣滄垚 鏃�-鏂板鐓�
+        //     if (old_newMap.containsKey(rr.Register_old__c)) {
+        //         old_newMap.get(rr.Register_old__c).add(rr.Register_new__c);
+        //     } else {
+        //         midStrO.add(rr.Register_new__c);
+        //         old_newMap.put(rr.Register_old__c, midStrO.clone());
+        //     }
+
+        //     // 缁忚惀鑼冨洿瀵瑰簲浜у搧鍏崇郴 Map浣滄垚 鏂�-鏃у鐓�
+        //     if (new_oldMap.containsKey(rr.Register_new__c)) {
+        //         new_oldMap.get(rr.Register_new__c).add(rr.Register_old__c);
+        //     } else {
+        //         midStr.add(rr.Register_old__c);
+        //         new_oldMap.put(rr.Register_new__c, midStr.clone());
+        //     }
+            
+        // }
+        // 鍙栧緱缁忛攢鍟� 鍖荤枟鍣ㄦ缁忚惀璁稿彲璇�
+        List<License_Information__c> licenseList = [SELECT Id,
+                                                           ScopeKey__c, 
+                                                           LicenseType__c
+                                                      FROM License_Information__c
+                                                     WHERE LicenseAndAccount__c = :agency1
+                                                    AND (LicenseType__c = '鍖荤枟鍣ㄦ缁忚惀璁稿彲璇�'
+                                                        OR LicenseType__c = '绗簩绫诲尰鐤楀櫒姊扮粡钀ュ妗堝嚟璇�')
+                                                      AND Is_Active_Formula__c = true
+                                                    ];
+        // 鍒ゆ柇 鍖荤枟鍣ㄦ缁忚惀璁稿彲璇� 鏄惁瀛樺湪
+        if (licenseList.size() == 0) {
+            error = true;
+            errormessage = '绗竴缁忛攢鍟嗘病鏈夋湁鏁堢殑鍖荤枟鍣ㄦ缁忚惀璁稿彲璇併��';
+            retMap.put('agency', '0');
+
+        } else {
+            //缁忛攢鍟嗙粡钀ヨ寖鍥�
+            List<String> agListA = new List<String>();
+            List<String> agListTemp = new List<String>();
+            List<String> agList = new List<String>();
+
+            //鍙栫粡閿�鍟嗕笅 鎵�鏈夊尰鐤楀櫒姊扮粡钀ヨ鍙瘉銆佺浜岀被鍖荤枟鍣ㄦ缁忚惀澶囨鍑瘉
+            for (License_Information__c li : licenseList) {
+                if (li.ScopeKey__c != null) {
+                    agListA.addAll(li.ScopeKey__c.split(';'));
+                    agListTemp.addAll(li.ScopeKey__c.split(';'));
+                }
+            }
+            for (String a : agListTemp) {
+                if (a.length() >= 6) {
+                    agList.add(a.substring(0, a.length() - 1));
+                } else {
+                    agList.add(a.trim());
+                }                
+            }
+
+            //浜у搧娉ㄥ唽璇�
+            Map<String,Map<String,String>> proBSMap = new Map<String,Map<String,String>>();
+            
+            Map<String,String> proMidMap = null;
+            //浜у搧鎵�鏈夋湁鏁堟敞鍐岃瘉锛堝彲浠ュ拰缁忛攢鍟嗗尮閰嶏級
+            proAllBSstrMap = new Map<String,List<String>>();
+            set<Id> proIdList = new set<Id>();
+
+            for (String qli : proMap.keySet()) {     
+                    proIdList.add(qli);
+                    proBSMap.put(qli, proMidMap);
+                    List<String> empList = new List<String>();
+                    proAllBSstrMap.put(qli, empList);
+                
+            }
+
+            List<Product_Register_Link__c> prls = [
+                                                 Select Product2__c,
+                                                        Product2__r.Asset_Model_No__c,
+                                                        Product2__r.SFDA_Approbated_Status__c,
+                                                        Product2__r.SFDA_Status_New__c, // 浜у搧鐨凜FDA鏈�缁堢姸鎬� 20181225
+                                                        Product_Register__r.Name,
+                                                        Product_Register__r.BusinessScopeKey__c, 
+                                                        Product_Register__r.RegisterNoStatus__c,
+                                                        Product_Register__r.MedPrdClass__c 
+                                                   From Product_Register_Link__c
+                                                  where Product2__c in :proIdList
+                                                  ];
+
+            // LHJ 20190102 澧炲姞璺宠繃閫昏緫 Start
+            List<Product2> productList = [select ID,SFDA_Status__c from Product2 where id in :proIdList];
+            for (Product2 pro : productList) {
+                if (pro.SFDA_Status__c == '涓嶈') {
+                    proNotNeedList.add(pro.ID);
+                }
+            }
+            // LHJ 20190102 澧炲姞璺宠繃閫昏緫 End
+
+            for (Product_Register_Link__c prl : prls) {
+                
+                // 璁剧疆浜у搧绫诲埆MAP
+                if (String.isNotBlank(prl.Product_Register__r.BusinessScopeKey__c)) {
+                    system.debug('Product2 +++++++' + prl.Product2__c);
+                    if (proBSMap.get(prl.Product2__c) != null) {
+                        proBSMap.get(prl.Product2__c).put(prl.Product_Register__r.Name, prl.Product_Register__r.BusinessScopeKey__c);
+                    
+                    } else {
+                        Map<String,String> toooMap = new Map<String,String>();
+                        toooMap.put(prl.Product_Register__r.Name, prl.Product_Register__r.BusinessScopeKey__c);
+                        proBSMap.put(prl.Product2__c, toooMap.clone());
+                    }
+                }
+
+                // 浜у搧鐨勪骇鍝佹敞鍐岃瘉鏄�"涓嶈"鐘舵�� 涓嶉渶瑕佸尮閰嶆敞鍐岃瘉 20181225
+                if (prl.Product2__r.SFDA_Approbated_Status__c == '涓嶈' 
+                        
+                        || prl.Product_Register__r.MedPrdClass__c == '1') {
+                     proNotNeedList.add(prl.Product2__c);
+                }
+            }
+            system.debug('proBSMap +++++++' + proBSMap);
+            for (String qli : proMap.keySet()) {
+
+                String proId = qli;
+                String proName = proMap.get(proId);
+
+                if (proId != null) {
+                    Boolean haveBS = false;
+
+                    // 浜у搧灞炰簬闈炲尰鐤楋紝涓嶇敤鍒ゆ柇缁忚惀鑼冨洿
+                    if (proNotNeedList.contains(proId)) {
+                        haveBS = true;
+                        continue;
+                    }
+
+                    if (proBSMap.get(proId) == null) {
+                        error = true;
+                        errormessage += '浜у搧"' + proName + '"娌℃湁鏈夋晥鐨勪骇鍝佹敞鍐岃瘉銆俓n';
+                        retMap.put(proId, '1');
+                        continue;
+                    }
+
+
+                    if (proBSMap.get(proId) != null) {
+                        system.debug('111 +++++++' + proBSMap);
+                        Map<String,String> midMap = new Map<String,String>();
+                        midMap = proBSMap.get(proId);
+
+                        for (String str : midMap.keySet()) {
+                            // LHJ 20200711 Start
+                            String strMidMap = midMap.get(str);
+                            List<String> proRegList = new List<String>();
+                            proRegList.addAll(strMidMap.split(';'));
+                            // LHJ 20200711 End
+                            for(String strReg:proRegList){
+                                // 琚畾涔変负"6815A"鐨勪骇鍝佺被鍒�,缁忚惀鑼冨洿涓繀椤绘湁6815鎴栬��6815A澶栨墠鍙互鍖归厤銆�
+                                if (strReg.length() == 6) {
+                                
+                                    for(String strAg:agListA){
+                                        if(strAg.length() >= 5 && midMap.get(str.substring(0, str.length() - 1)) == strAg.substring(0,5)){
+                                            proAllBSstrMap.get(proId).add(str.substring(0, str.length() - 1));
+                                            haveBS = true;
+                                            break;
+                                        }
+                                    }
+
+                                    /*if (agListA.contains(midMap.get(str.substring(0, str.length() - 1)))) {
+                                        proAllBSstrMap.get(proId).add(str.substring(0, str.length() - 1));
+                                        haveBS = true;
+                                    }*/
+                                } else {
+                                    system.debug('agList +++++++' + agList);
+                                    system.debug('midMap +++++++' + strReg);
+
+                                    if (agList.contains(strReg)) {
+
+                                        //浜у搧绫诲埆,鍖归厤鍒扮粡閿�鍟嗙被鍒�
+                                        proAllBSstrMap.get(proId).add(str);
+                                        haveBS = true;
+                                        break;
+                                    }
+                                }  
+                            }
+                            
+                                                      
+                        }
+                    }
+
+                    if (!haveBS) {
+                        error = true;
+                        errormessage += '绗竴缁忛攢鍟嗙殑缁忚惀鑼冨洿涓笉鍖呭惈浜у搧" ' + proName + '"銆俓n';
+                        retMap.put(proId, '2');
+                    }
+                }
+            }
+        }
+
+        if (retMap.isEmpty() == false) {
+            //return errormessage;
+            
+        } else {
+            if (OppId != '') {
+                // 鏇存柊鎵�鏈夋敞鍐岃瘉淇℃伅
+                String strRegister_alleffective;
+                List<Product2> pro2List = new List<Product2>();
+                Map<String, Product2> pro2Map = new Map<String, Product2>();
+                List<OpportunityLineItem> updList = new List<OpportunityLineItem>();
+                List<OpportunityLineItem> OppItemList = [select id, Id__c, Register_alleffective__c,PricebookEntry.Product2Id
+                                                           From OpportunityLineItem 
+                                                          Where OpportunityId = :OppId];
+                // 闈炲尰鐤楁垨1绫讳骇鍝侊紝鍙栧緱
+                if (proNotNeedList != null && proNotNeedList.size() > 0) {
+                    pro2List = [select id, SFDA_Approbated_Status__c, RegisterNo_ALL__c from Product2 where Id in :proNotNeedList];
+                }
+                for (Product2 pro2 : pro2List) {
+                    pro2Map.put(pro2.Id, pro2);
+                }
+
+                for (OpportunityLineItem ol : OppItemList) {
+                    if (proAllBSstrMap.containsKey(ol.PricebookEntry.Product2Id)) {
+                        ol.Register_alleffective__c = '';
+                        for(String str: proAllBSstrMap.get(ol.PricebookEntry.Product2Id)) {
+
+                            if (String.isNotBlank(ol.Register_alleffective__c)) {
+                                ol.Register_alleffective__c += ';' + str;
+                            } else {
+                                ol.Register_alleffective__c = str;
+                            }
+                        }
+                        // 闈炲尰鐤楁垨1绫讳骇鍝�
+                        if (pro2Map.containskey(ol.PricebookEntry.Product2Id)) {
+                            if (pro2Map.get(ol.PricebookEntry.Product2Id).SFDA_Approbated_Status__c == '涓嶈') {
+                                ol.Register_alleffective__c = 'FYL';
+                            } else {
+                                ol.Register_alleffective__c = pro2Map.get(ol.PricebookEntry.Product2Id).RegisterNo_ALL__c;
+                            }
+                        }
+                    }
+                    updList.add(ol);
+                }
+                if (updList.size() > 0)  update updList;
+            }
+        }
+        //濡傛灉涓嶆弧瓒抽樋瑗胯禌澶氱殑鏉′欢锛岃繘鍏ヨ繖涓彉閲� 20200821 ljh 
+        return retMap;
+    }
+
+    public static String checkProRegisterDecide(Map<Id, String> proMap, String agency1, String OppId) {
+    
+        String errormessage = '';
+        Boolean error = false;
+
+        Map<String, String> CheckMap = new Map<String, String>();
+        CheckMap = MapCheckProRegisterDecide(proMap, agency1, OppId);
+        if (CheckMap.isEmpty()) {
+            return 'OK';
+        } else {
+            return '鏈変笉鍙攢鍞骇鍝佹垨瓒呭嚭缁忛攢鍟嗙粡钀ヨ寖鍥达紝璇锋洿鏂版姤浠峰崟' + CheckMap;
+        }
+
+    }
+    @AuraEnabled
+    WebService static String updReg(String  oppid) {
+
+        List<OpportunityLineItem> updList = new List<OpportunityLineItem>();
+        List<OpportunityLineItem> OppItemList = [select id, Id__c, Register_alleffective__c,
+                                                        PricebookEntry.Product2.RegisterNo_ALL__c 
+                                                           From OpportunityLineItem 
+                                                          Where OpportunityId = :oppid];
+        for (OpportunityLineItem ol : OppItemList) {
+            ol.Register_alleffective__c = ol.PricebookEntry.Product2.RegisterNo_ALL__c;
+            updList.add(ol);
+        }
+        if (updList.size() > 0)  update updList;
+        return 'OK';
+    }
+    //SWAG-CG88AG銆愬鎵樸�戞彁鍑轰环鏍肩敵璇锋槸鍦ㄥ崗璁湁鏁堟湡鍐咃紝鍏佽WIN fy start 
+    WebService static Boolean judgeIsAssistantAppliedOutTime(String  Quoteid) {
+        List<PromotionSales__c> PromotionSalesList = [select id,IsAssistantAppliedOutTime__c from PromotionSales__c where Quote__r.Quote_No__c =:Quoteid];
+        for(PromotionSales__c pro : PromotionSalesList){
+            if(pro.IsAssistantAppliedOutTime__c){
+                return false;
+            }
+        }
+        return true;
+    }
+    //SWAG-CG88AG銆愬鎵樸�戞彁鍑轰环鏍肩敵璇锋槸鍦ㄥ崗璁湁鏁堟湡鍐咃紝鍏佽WIN fy end 
+
+    //璐告槗鍚堣 20230307 you start
+    WebService static Boolean accSendEmail(String  AccDealerBlacklist,String accname,String angency1,String angency2,String ownerids,String ddid,String oppid) {
+      //鍙戦�侀偖浠�
+        List<Messaging.SingleEmailMessage> sendMails = new List<Messaging.SingleEmailMessage>();
+        List<String>  MailsList = new List<String>();
+        List<String> userIdList = new List<String>();
+        if(String.isNotBlank(ownerids)){
+            userIdList.add(ownerids);
+        }
+        if(String.isNotBlank(ddid)){
+            userIdList.add(ddid);
+        }
+         //璇环鎵�鏈変汉锛屼骇鍝佹媴褰擄紝鍙戦偖浠�
+        List<User> UsrList = [SELECT email FROM user WHERE id in :userIdList]; 
+        //鑾峰彇鍚勪釜鐢ㄦ埛鐨別mail
+        for (User u : UsrList){
+            MailsList.add(u.email);
+        }
+        MailsList.add('youchang@prec-tech.com');
+        system.debug('111===:'+MailsList);
+        if (MailsList!=null&&MailsList.size()>0){
+            String title = '';
+            String body = '';
+            title = ' 鏂板缓璇环鍖婚櫌/缁忛攢鍟嗘秹鍙婇粦鍚嶅崟';
+            if(AccDealerBlacklist=='123'){
+                body += '榛戝悕鍗曠殑瀹㈡埛涓猴細' + accname+ '<br/>';
+                body += '榛戝悕鍗曠殑缁忛攢鍟�1涓猴細' + angency1+ '<br/>';
+                body += '榛戝悕鍗曠殑缁忛攢鍟�2涓猴細' + angency2+ '<br/>';
+            }else if(AccDealerBlacklist=='12'){
+                body += '榛戝悕鍗曠殑瀹㈡埛涓猴細' + accname+ '<br/>';
+                body += '榛戝悕鍗曠殑缁忛攢鍟�1涓猴細' + angency1+ '<br/>';
+            }else if(AccDealerBlacklist=='23'){
+                body += '榛戝悕鍗曠殑缁忛攢鍟�1涓猴細' + angency1+ '<br/>';
+                body += '榛戝悕鍗曠殑缁忛攢鍟�2涓猴細' + angency2+ '<br/>';
+            }else if(AccDealerBlacklist=='13'){
+                body += '榛戝悕鍗曠殑瀹㈡埛涓猴細' + accname+ '<br/>';
+                body += '榛戝悕鍗曠殑缁忛攢鍟�2涓猴細' + angency2+ '<br/>';
+            }else if(AccDealerBlacklist=='1'){
+                body += '榛戝悕鍗曠殑瀹㈡埛涓猴細' + accname+ '<br/>';
+            }else if(AccDealerBlacklist=='2'){
+                body += '榛戝悕鍗曠殑缁忛攢鍟�1涓猴細' + angency2+ '<br/>';
+            }else if(AccDealerBlacklist=='3'){
+                body += '榛戝悕鍗曠殑缁忛攢鍟�2涓猴細' + angency2+ '<br/>';
+            }
+           
+            body += '<a href="' + System.Label.Environment_Url + oppid + '">'
+                    + System.Label.Environment_Url+ oppid +'</a><br/>'; 
+            body += '璋㈣阿锛�';
+  
+            Messaging.SingleEmailMessage messageNEW = new Messaging.SingleEmailMessage();
+            messageNEW.setSubject(title);
+            messageNEW.setHtmlBody(body);
+            messageNEW.setCharset('UTF-8');
+            messageNEW.setToAddresses(MailsList); 
+
+            //List<String> toCcMailsList = new List<String>();
+            //toCcMailsList.add('youchang@prec-tech.com');
+            //messageNEW.setCcAddresses(toCcMailsList); 
+            
+            sendMails.add(messageNEW);
+
+        }                      
+            
+        boolean rs = true;
+        if (sendMails.size() > 0) {
+            Messaging.Email[] allMails = new Messaging.Email[]{};
+            for(Integer j = 0; j < sendMails.size(); j++) {
+                allMails.add(sendMails.get(j));
+            }
+            system.debug('222===:'+allMails);
+        
+            Messaging.SendEmailResult[] results = Messaging.sendEmail(allMails);
+            System.debug('results 缁撴灉 :'+results);
+            for (Integer i = 0; i < results.size(); i++) {
+                if (results[i].success == false) {
+                    system.debug('=====send mail error:' + results[i].errors[0].message);
+                    rs = false;
+                }   
+            }
+        }
+        return rs;
+    }
+    //璐告槗鍚堣 20230307 you end
+
+}
\ No newline at end of file
diff --git a/force-app/main/default/classes/OpportunityWebService.cls-meta.xml b/force-app/main/default/classes/OpportunityWebService.cls-meta.xml
new file mode 100644
index 0000000..38aa015
--- /dev/null
+++ b/force-app/main/default/classes/OpportunityWebService.cls-meta.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ApexClass xmlns="http://soap.sforce.com/2006/04/metadata">
+    <apiVersion>36.0</apiVersion>
+    <status>Active</status>
+</ApexClass>
diff --git a/force-app/main/default/classes/QISReportController.cls b/force-app/main/default/classes/QISReportController.cls
index 3b375e1..3d6a036 100644
--- a/force-app/main/default/classes/QISReportController.cls
+++ b/force-app/main/default/classes/QISReportController.cls
@@ -413,15 +413,114 @@
         }
          return re;
     }
+    //鍙戦�丵IS鍒癝PO
+    @AuraEnabled
+    public static InitData initForlexSendQISButton (String recordId){
+        InitData res = new initData();
+        ID myUserID = UserInfo.getUserId();
+        User userinfo = [SELECT id,Profile.name FROM User WHERE Id = :myUserID LIMIT 1];
+        try{
+            QIS_Report__c report = [SELECT  id ,RecordTypeId,IsSendQIS__c FROM QIS_Report__c WHERE Id = :recordId LIMIT 1];
+            RecordType rec = [SELECT id,name FROM RecordType where  Id = :report.RecordTypeId];
+            res.Id = report.Id;
+            res.qisRecordTypeId = report.RecordTypeId;
+            res.qisRecordName = rec.name;
+            res.profileName = userinfo.Profile.name;
+            res.IsSendQIS = report.IsSendQIS__c;
+            System.debug(LoggingLevel.INFO, '*** res: ' + res);
+        }catch(Exception e){
+            System.debug(LoggingLevel.INFO, '*** e: ' + e);
+        }
+        return res;
+    }
+
+    @AuraEnabled
+    public static String updateQisForSendQIS (String recordId){
+        String re = '鎴愬姛'; 
+        QIS_Report__c report = [SELECT Id,Name,IsSendQIS__c FROM QIS_Report__c WHERE Id = :recordId LIMIT 1];
+        if(report == null ){
+            return '娌℃湁QIS锛�' + recordId + '鐨勬暟鎹��';
+        }
+        Savepoint sp = Database.setSavepoint(); 
+        try{    
+                
+                QIS_Report__c rac  = new QIS_Report__c();   
+                rac.id = recordId;
+                rac.IsSendQIS__c = true;
+                update rac;
+        }catch(Exception e){
+            Database.rollback(sp);
+            System.debug(LoggingLevel.INFO, '*** e: ' + e);
+            re = e.getMessage();
+        }
+         return re;
+    }
+    // OCSM鏈嶅姟鏈儴鏀跺埌瀹炵墿
+    @AuraEnabled
+    public static InitData initForlexRCRecievedButton (String recordId){
+        InitData res = new initData();
+        ID myUserID = UserInfo.getUserId();
+        User userinfo = [SELECT id,Profile.name FROM User WHERE Id = :myUserID LIMIT 1];
+        try{
+            QIS_Report__c report = [SELECT  id ,isAE_Profile__c,QIS_Status__c,isPAE_Profile__c,is_CNBuy__c FROM QIS_Report__c WHERE Id = :recordId LIMIT 1];
+            res.Id = report.Id;
+            res.isAEProfile = report.isAE_Profile__c;
+            res.isPAEProfile = report.isPAE_Profile__c;
+            res.QIStatus = report.QIS_Status__c;
+            res.isCNBuy = report.is_CNBuy__c;
+            System.debug(LoggingLevel.INFO, '*** res: ' + res);
+        }catch(Exception e){
+            System.debug(LoggingLevel.INFO, '*** e: ' + e);
+        }
+        return res;
+    }
+
+    @AuraEnabled
+    public static String updateQisForRCRecieved (String recordId){
+        String re = '鎴愬姛'; 
+        ID myUserID = UserInfo.getUserId();
+        User userinfo = [SELECT id,Alias,BuchangApprovalManagerSales__c,JingliApprovalManager__c, BuchangApprovalManager__c, ZongjianApprovalManager__c FROM User WHERE Id = :myUserID LIMIT 1];
+
+        try{    
+                QIS_Report__c rac  = new QIS_Report__c();   
+                rac.id = recordId;
+
+                rac.QIS_Status__c = 'RC妫�娴嬩腑';
+                rac.OCM_RC_RecievedDate__c = Date.today();
+                rac.RC__c = myUserID;
+                rac.RC_Receive_staff__c = userinfo.Alias;
+
+                if (userinfo != null  && userinfo.BuchangApprovalManagerSales__c!= null) {
+                    rac.RC_Manager__c = userinfo.BuchangApprovalManagerSales__c;
+                } else {
+                    rac.RC_Manager__c = myUserID;
+                }
+                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 qISSCReport;
+        @AuraEnabled
+        public String name;
+        @AuraEnabled
+        public String qISSCId;
         @AuraEnabled
         public String ownerId;
         @AuraEnabled
         public String qisRecordTypeId;
         @AuraEnabled
         public String qisRecordName;
+        @AuraEnabled
+        public String nextaction;
+        @AuraEnabled
+        public String qISMarketCategory;
         @AuraEnabled
         public String profileName;
         @AuraEnabled
@@ -455,6 +554,8 @@
         @AuraEnabled
         public Date qISInstallDate;
         @AuraEnabled
+        public Date oSHInspectionDate;
+        @AuraEnabled
         public Date cdsdate;
         @AuraEnabled
         public Date awaredate;
diff --git a/force-app/main/default/classes/ReportController.cls b/force-app/main/default/classes/ReportController.cls
index aea48b6..790ccbc 100644
--- a/force-app/main/default/classes/ReportController.cls
+++ b/force-app/main/default/classes/ReportController.cls
@@ -218,7 +218,7 @@
 
     //缁欐彁浜ょ浉搴旂殑js鎻愪緵鍒濆鍖栨暟鎹�
     @AuraEnabled
-    public static void updateForSubmitButton(String reocrdId){
+    public static String updateForSubmitButton(String reocrdId){
         try {
             Report__c rac = new Report__c();
             rac.Id = reocrdId;
@@ -226,26 +226,34 @@
             rac.Submit_time__c = Datetime.now();
             rac.Submit_report_day__c = Date.today();
             update rac;
+            return null;
         } catch (Exception e) {
-            throw new AuraHandledException(e.getMessage());
+            String eMessage = e.getMessage();
+            Integer left = eMessage.indexOf(',') + 1;
+            Integer right = eMessage.length();
+            return eMessage.substring(left,right);
         }
     }
     //OPDtoSIS鎿嶄綔鏇存柊鐩稿簲鏁版嵁
     @AuraEnabled
-    public static void updateForOPDtoSISButton(String recordId){
+    public static String updateForOPDtoSISButton(String recordId){
         try {
             Report__c rac = new Report__c();
             rac.Id = recordId;
             rac.RecordTypeId = Schema.SObjectType.Report__c.getRecordTypeInfosByName().get(LightingButtonConstant.RECORD_TYPE_NAME_BY_OPD).getRecordTypeId();
             update rac;
+            return null;
         } catch (Exception e) {
-            System.debug(LoggingLevel.INFO, '*** e: ' + e);
+            String eMessage = e.getMessage();
+            Integer left = eMessage.indexOf(',') + 1;
+            Integer right = eMessage.length();
+            return eMessage.substring(left,right);
         }
     }
 
     //鍙栨秷鎻愪氦鎿嶄綔鏇存柊鐩稿簲鏁版嵁
     @AuraEnabled
-    public static void updateForCancelSubmitReportButton(String recordId){
+    public static String updateForCancelSubmitReportButton(String recordId){
         try {
             Report__c rac = new Report__c();
             rac.Id = recordId;
@@ -253,33 +261,45 @@
             rac.Submit_report_day__c = null;
             rac.Submit_time__c = null;
             update rac;
+            return null;
         } catch (Exception e) {
-            throw new AuraHandledException(e.getMessage());
+            String eMessage = e.getMessage();
+            Integer left = eMessage.indexOf(',') + 1;
+            Integer right = eMessage.length();
+            return eMessage.substring(left,right);
         }
     }
     //瀹屾瘯鎿嶄綔鏇存柊鐩稿簲鏁版嵁
     @AuraEnabled
-    public static void updateForCompleteButton(String recordId){
+    public static String updateForCompleteButton(String recordId){
         Report__c rac = new Report__c();
         try {
             rac.Id = recordId;
             rac.Status__c = LightingButtonConstant.STATUS_COMPLETE;
             rac.RecordTypeId = Schema.SObjectType.Report__c.getRecordTypeInfosByName().get(LightingButtonConstant.VOC_NAME).getRecordTypeId();
             update rac;
+            return null;
         } catch (Exception e) {
-            throw new AuraHandledException(e.getMessage());
+            String eMessage = e.getMessage();
+            Integer left = eMessage.indexOf(',') + 1;
+            Integer right = eMessage.length();
+            return eMessage.substring(left,right);
         }
     }
     //OCSM瑕佹姤鍛婃搷浣滄洿鏂扮浉搴旀暟鎹�
     @AuraEnabled
-    public static void updateForOCSMToReportButton(String recordId){
+    public static String updateForOCSMToReportButton(String recordId){
         try {
             Report__c rac = new Report__c();
             rac.Id = recordId;
             rac.OCSMAdministrativeReportStatus__c = LightingButtonConstant.STATUS_TO_BE_REPORTED;
             update rac;
+            return null;
         } catch (Exception e) {
-            System.debug(LoggingLevel.INFO, '*** e: ' + e);
+            String eMessage = e.getMessage();
+            Integer left = eMessage.indexOf(',') + 1;
+            Integer right = eMessage.length();
+            return eMessage.substring(left,right);
         }
     }
 
@@ -293,50 +313,65 @@
             update rac;
             return null;
         } catch (Exception e) {
-            return e.getMessage();
+            String eMessage = e.getMessage();
+            Integer left = eMessage.indexOf(',') + 1;
+            Integer right = eMessage.length();
+            return eMessage.substring(left,right);
         }
     }
     //DispatchOCSMQARA鎿嶄綔鏇存柊鐩稿簲鏁版嵁
     @AuraEnabled
-    public static void updateForDispatchOCSMQARAButton(String recordId){
+    public static String updateForDispatchOCSMQARAButton(String recordId){
         try {
             Report__c rac = new Report__c();
             rac.Id = recordId;
             rac.Dispatch_OCSM_QARA__c = true;
             update rac;
+            return null;
         } catch (Exception e) {
-            System.debug(LoggingLevel.INFO, '*** e: ' + e);
+            String eMessage = e.getMessage();
+            Integer left = eMessage.indexOf(',');
+            Integer right = eMessage.length();
+            return eMessage.substring(left,right);
         }
     }
     //OCSM涓嶈鎶ュ憡鎿嶄綔鏇存柊鐩稿簲鏁版嵁
     @AuraEnabled
-    public static void updateForOCSMNoToReportButton(String recordId){
+    public static String updateForOCSMNoToReportButton(String recordId){
         try {
             Report__c rac = new Report__c();
             rac.Id = recordId;
             rac.OCSMAdministrativeReportStatus__c  = LightingButtonConstant.STATUS_TO_NOT_REPORT;
             update rac;
+            return null;
         } catch (Exception e) {
-            System.debug(LoggingLevel.INFO, '*** e: ' + e);
+            String eMessage = e.getMessage();
+            Integer left = eMessage.indexOf(',');
+            Integer right = eMessage.length();
+            return eMessage.substring(left,right); 
         }
     }
 
     //鍙栨秷鎿嶄綔鏇存柊鐩稿簲鏁版嵁
     @AuraEnabled
-    public static void updateForCancelButton(String recordId){
+    public static String updateForCancelButton(String recordId){
         try {
             Report__c rac = new Report__c();
             rac.Id = recordId;
             rac.Status__c = LightingButtonConstant.STATUS_CANCEL;
             update rac;
+            return null;
         } catch (Exception e) {
-            System.debug(LoggingLevel.INFO, '*** e: ' + e);
+            String eMessage = e.getMessage();
+            Integer left = eMessage.indexOf(',');
+            Integer right = eMessage.length();
+            return eMessage.substring(left,right);
         }
     }
     
     //VOC缁撴灉纭鏇存柊鐩稿簲鏁版嵁
     @AuraEnabled
-    public static void updateForVOCConfirmButton(String recordId,String Satisfy,String Satisfy1){
+    public static String updateForVOCConfirmButton(String recordId,String Satisfy,String Satisfy1){
         try {
             Report__c rac = new Report__c();
             rac.Id = recordId;
@@ -362,8 +397,12 @@
                 }
                 }
             update rac;
+            return null;
         } catch (Exception e) {
-            System.debug(LoggingLevel.INFO, '*** e: ' + e);
+            String eMessage = e.getMessage();
+            Integer left = eMessage.indexOf(',');
+            Integer right = eMessage.length();
+            return eMessage.substring(left,right);
         }
     }
     //VOC鍥炵瓟鏇存柊鐩稿簲鏁版嵁
@@ -388,7 +427,7 @@
 
     //鎻愪氦绔炰簤瀵规墜鎶ュ憡鏇存柊鐩稿簲鏁版嵁
     @AuraEnabled
-    public static void updateForSubmitCompetitorReportButton(String recordId){
+    public static String updateForSubmitCompetitorReportButton(String recordId){
         try {
             Report__c rac = new Report__c();
             rac.Id = recordId;
@@ -397,13 +436,17 @@
             rac.Submit_report_day__c = Date.today();
             rac.Date__c = Date.today();
             update rac;
+            return null;
         } catch (Exception e) {
-            System.debug(LoggingLevel.INFO, '*** e: ' + e);
+            String eMessage = e.getMessage();
+            Integer left = eMessage.indexOf(',');
+            Integer right = eMessage.length();
+            return eMessage.substring(left,right);
         }
     }
     //VOC鍥炵瓟鏇存柊鐩稿簲鏁版嵁
     @AuraEnabled
-    public static void updateForVOCSubmitButton(String recordId ,String createdById){
+    public static String updateForVOCSubmitButton(String recordId ,String createdById){
         try {
             Report__c rac = [select Status__c,JingliApprovalManager__r.Id,BuchangApprovalManager__r.Id,SalesManager__r.Id,BuchangApprovalManagerSales__r.Id,ZongjianApprovalManager__c,Submit_time__c,Submit_report_day__c,Owner.Id from Report__c where Id = :recordId];
             // share
@@ -424,15 +467,18 @@
             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;
+            return null;
             }
             rac.Status__c = LightingButtonConstant.STATUS_VOC_WRITE_OVER;
             rac.Submit_time__c = Date.today();
             rac.Submit_report_day__c = Date.today();
             update rac;
+            return null;
         } catch (Exception e) {
-            System.debug(LoggingLevel.INFO, '*** e: ' + e);
-            
+            String eMessage = e.getMessage();
+            Integer left = eMessage.indexOf(',');
+            Integer right = eMessage.length();
+            return eMessage.substring(left, right);
         }
     }
     //VOC鍒ゅ畾鏇存柊鐩稿簲鏁版嵁
@@ -480,13 +526,17 @@
     }
     //VOC瀹屾瘯鎿嶄綔鏇存柊鐩稿簲鏁版嵁
     @AuraEnabled
-    public static void updateForVOCFinishButton (String recordId) {
+    public static String updateForVOCFinishButton (String recordId) {
         try {
             Report__c report = [select Id,Status__C from Report__c where Id = :recordId];
             report.Status__c = LightingButtonConstant.STATUS_VOC_FINISH;
             update report;
+            return null;
         } catch (Exception e) {
-            System.debug(LoggingLevel.INFO, '*** e: ' + e);
+            String eMessage = e.getMessage();
+            Integer left = eMessage.indexOf(',');
+            Integer right = eMessage.length();
+            return eMessage.substring(left,right);
         }
     }
     public class InitData{
diff --git a/force-app/main/default/lwc/lexAgencyAuthorize/__tests__/lexAgencyAuthorize.test.js b/force-app/main/default/lwc/lexAgencyAuthorize/__tests__/lexAgencyAuthorize.test.js
new file mode 100644
index 0000000..23a8f06
--- /dev/null
+++ b/force-app/main/default/lwc/lexAgencyAuthorize/__tests__/lexAgencyAuthorize.test.js
@@ -0,0 +1,25 @@
+import { createElement } from 'lwc';
+import LexAgencyAuthorize from 'c/lexAgencyAuthorize';
+
+describe('c-lex-agency-authorize', () => {
+    afterEach(() => {
+        // The jsdom instance is shared across test cases in a single file so reset the DOM
+        while (document.body.firstChild) {
+            document.body.removeChild(document.body.firstChild);
+        }
+    });
+
+    it('TODO: test case generated by CLI command, please fill in test logic', () => {
+        // Arrange
+        const element = createElement('c-lex-agency-authorize', {
+            is: LexAgencyAuthorize
+        });
+
+        // Act
+        document.body.appendChild(element);
+
+        // Assert
+        // const div = element.shadowRoot.querySelector('div');
+        expect(1).toBe(1);
+    });
+});
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexAgencyAuthorize/lexAgencyAuthorize.css b/force-app/main/default/lwc/lexAgencyAuthorize/lexAgencyAuthorize.css
new file mode 100644
index 0000000..689c97d
--- /dev/null
+++ b/force-app/main/default/lwc/lexAgencyAuthorize/lexAgencyAuthorize.css
@@ -0,0 +1,10 @@
+.inASACEditorHolder{
+    position: relative;
+    display: inline-block;
+    width: 80px;
+    height: 80px;
+    text-align: center;
+}
+.container .uiContainerManager{
+	display: none !important;
+}
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexAgencyAuthorize/lexAgencyAuthorize.html b/force-app/main/default/lwc/lexAgencyAuthorize/lexAgencyAuthorize.html
new file mode 100644
index 0000000..e6785e4
--- /dev/null
+++ b/force-app/main/default/lwc/lexAgencyAuthorize/lexAgencyAuthorize.html
@@ -0,0 +1,6 @@
+<template>
+    <div class="inASACEditorHolder" if:true={IsLoading}>
+        <lightning-spinner alternative-text="Loading" size="medium"></lightning-spinner>
+        <lightning-button label="Show Toast" onclick={showSuccess}></lightning-button>
+    </div>
+</template>
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexAgencyAuthorize/lexAgencyAuthorize.js b/force-app/main/default/lwc/lexAgencyAuthorize/lexAgencyAuthorize.js
new file mode 100644
index 0000000..6cd891a
--- /dev/null
+++ b/force-app/main/default/lwc/lexAgencyAuthorize/lexAgencyAuthorize.js
@@ -0,0 +1,198 @@
+/*
+ * @Description: 
+ * @version: 
+ * @Author: chen jing wu
+ * @Date: 2023-04-12 14:51:44
+ * @LastEditors: chen jing wu
+ * @LastEditTime: 2023-04-13 09:54:19
+ */
+import { api, wire,LightningElement } from 'lwc';
+import { CurrentPageReference } from "lightning/navigation";
+import { CloseActionScreenEvent } from 'lightning/actions';
+import init  from '@salesforce/apex/OpportunityLightingButtonController.initForAgencyAuthorizeButton';
+import updateForAgencyAuthorizeButton  from '@salesforce/apex/OpportunityLightingButtonController.updateForAgencyAuthorizeButton';
+import { updateRecord } from 'lightning/uiRecordApi';
+import { ShowToastEvent } from 'lightning/platformShowToastEvent';
+import checkDangerItem from '@salesforce/apex/OpportunityWebService.checkDangerItem';
+import oppCheck from '@salesforce/apex/OpportunityWebService.oppCheck';
+import updReg from '@salesforce/apex/OpportunityWebService.updReg';
+
+export default class LexAgencyAuthorize extends LightningElement {
+    @api recordId;
+    agency1Id;
+    stageName;
+    sapSendOK;
+    oppOrderType;
+    ifHave170;
+    ifHaveAH;
+    cntLostCancelDraft;
+    cntLostCancelReport;
+    estimationId;
+    detailNum;
+    estimationDecision;
+    salesRoot;
+    acecideCntCheck;
+    ifSubmit;
+    trade;
+    isCorrosion;
+    profileId;
+    ifAuthorizingLock;
+    IsLoading = true;
+    @wire(CurrentPageReference)
+    getStateParameters(currentPageReference) {
+            console.log(111);
+            console.log(currentPageReference);
+
+        if (currentPageReference) {
+          const urlValue = currentPageReference.state.recordId;
+          if (urlValue) {
+            let str = `${urlValue}`;
+            console.log("str");
+            console.log(str);
+            this.recordId = str;
+          }
+        }
+    }
+    connectedCallback(){
+        init({
+            recordId: this.recordId
+        }).then(result=>{
+            console.log(result);
+            this.agency1Id = result.agency1Id;
+            this.stageName = result.stageName;
+            this.sapSendOK = result.sapSendOK;
+            this.oppOrderType = result.oppOrderType;
+            this.ifHave170 = result.ifHave170;
+            this.ifHaveAH = result.ifHaveAH;
+            this.cntLostCancelDraft = result.cntLostCancelDraft;
+            this.cntLostCancelReport = result.cntLostCancelReport;
+            this.estimationId = result.estimationId;
+            this.detailNum = result.detailNum;
+            this.estimationDecision = result.estimationDecision;
+            this.salesRoot = result.salesRoot;
+            this.acecideCntCheck = result.acecideCntCheck;
+            this.ifSubmit = result.ifSubmit;
+            this.trade = result.trade;
+            this.isCorrosion = result.isCorrosion;
+            this.profileId = result.profileId;
+            this.ifAuthorizingLock = result.ifAuthorizingLock;
+            this.AgencyAuthorize();
+        })
+    }
+    AgencyAuthorize(){
+        var btns = document.getElementsByName("agency_authorize");
+        for (var i=0; i<btns.length; i++) {
+        btns[i].disabled = true;
+        btns[i].className = 'btnDisabled';
+        }
+        //2021-10-21 gwy 鐗堟湰鏇存敼涓�51.0
+        var oppid = this.recordId;
+        var angency = this.agency1Id;
+        var profileId = this.profileId;
+        
+        if (profileId != '00e10000000Y3o5' && profileId != '00e10000000Nab7' && profileId != '00e10000000xnpR' && profileId != '00e10000000xyK6' && profileId != '00e10000000NbCE'
+        && profileId != '00e10000000xyK6' && profileId != '00e10000000Nb7i') {
+            this.showToast("鎮ㄦ病鏈夋巿鏉冪敵璇风殑鏉冮檺銆傝鑱旂郴绯荤粺绠$悊鍛樸��","error");
+            return;
+        }
+        if (this.stageName != '寮曞悎' && this.stageName != '璇环' ) {
+            this.showToast("鐘舵��1:" + this.stageName + "銆佷笉鑳藉仛鎺堟潈鐢宠锛�","error");
+            return;
+        } else if (this.sapSendOK == '1') {
+            this.showToast("宸茬粡涓婁紶SAP銆佷笉鑳藉仛鎺堟潈鐢宠浜嗭紒","error");
+            return;
+        } else if (this.oppOrderType != '' && this.ifHave170 == true) {
+            this.showToast("鑰楁潗涓嶅彲涓�170浜у搧鍚屾椂瀛樺湪锛�","error");
+            return;
+        } else if (this.oppOrderType != '' && this.ifHaveAH == true) {
+            this.showToast("鑰楁潗涓嶅彲涓庡ゥ杈変骇鍝佸悓鏃跺瓨鍦紒","error");
+            return;
+        } else if (this.cntLostCancelDraft > 0) {
+        if(!confirm('璇环鏈夎崏妗堜腑鐨勫彇娑�/澶卞崟鎶ュ憡锛屾槸鍚︾户缁紵')){
+            return ;
+        }
+        } else if (this.cntLostCancelReport - this.cntLostCancelDraft > 0) {
+            this.showToast('璇环鏈夊凡鎻愪氦鐨勫彇娑�/澶卞崟鎶ュ憡銆�',"error");
+            return;
+        } else if (this.estimationId == '' || this.detailNum == 0) {
+            this.showToast('鎶ヤ环鏈畬鎴愶紝璇峰厛鎶ヤ环銆�',"error");
+            return;
+        } else if (this.estimationDecision == '1') {
+            this.showToast('鎶ヤ环宸插喅瀹氾紝涓嶈兘杩涜鎺堟潈鐢宠銆�',"error");
+            return;
+        } else if (this.salesRoot != '璨╁2搴�') {
+            this.showToast('鍖婚櫌鐩撮攢涓嶉渶瑕佹巿鏉冪敵璇枫��',"error");
+            return;
+        }
+        // else if ('{!Opportunity.AcecideCntCheck__c}' != '1') {
+        // alert('闃胯タ璧涘璇环鍙兘鍖呭惈鍗卞寲鍝侊紝鎴栬�咃紝鏅�氳浠蜂笉鑳藉寘鍚嵄鍖栧搧銆�');
+        // return;
+        // }
+        else if (this.ifSubmit == '1') {
+            this.showToast('涓婁紶澶辫触锛岃鑱旂郴绯荤粺绠$悊鍛�!',"error");
+            return;
+        }
+        if (this.ifAuthorizingLock == 'true') {
+            this.showToast('璇环姝e湪鎺堟潈涓紝璇蜂笉瑕侀噸澶嶆彁浜ゃ��',"error");
+            return;
+        }
+        if (this.trade == '鍐呰部') {
+            if(this.isCorrosion == '1'){
+                checkDangerItem({
+                    agency1: angency
+                }).then(result=>{
+                    var rtn1 = result;
+                    if (rtn1 != 'OK') {
+                        this.showToast(rtn1,"error");
+                        return;
+                    }
+                    this.update();
+            });
+            }else{
+                oppCheck({
+                    oppid: oppid,
+                    saveFlg: '1'
+                }).then(result=>{
+                    var rtn = result;
+                    if (rtn != 'OK') {
+                        this.showToast(rtn,"error");
+                        return;
+                    }
+                    this.update();
+                })
+            }
+        } else {
+            updReg({
+                oppid: oppid
+            }).then(()=>{
+                this.update();
+            });
+        }  
+    }
+    showToast(msg,type) {
+        const event = new ShowToastEvent({
+            title: '',
+            message: msg,
+            variant: type
+        });
+        this.dispatchEvent(event);
+        this.dispatchEvent(new CloseActionScreenEvent());
+    }
+    updateRecordView(recordId) {
+        updateRecord({fields: { Id: recordId }});
+    }
+    update(){
+        updateForAgencyAuthorizeButton({
+            recordId: this.recordId
+        }).then(result=>{
+            if(result){
+                this.showToast(result,"error");
+            }else{
+                this.updateRecordView(this.recordId);
+                window.open("https://olympus.sharepoint.cn/sites/GSPWF/SitePages/HomePage.aspx");
+                this.showToast('鎻愪氦鎴愬姛銆傝鍦⊿PO绯荤粺涓畬鎴愭巿鏉冪敵璇枫��',"success");
+            }
+            this.IsLoading = false;
+        })
+    }
+}
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexAgencyAuthorize/lexAgencyAuthorize.js-meta.xml b/force-app/main/default/lwc/lexAgencyAuthorize/lexAgencyAuthorize.js-meta.xml
new file mode 100644
index 0000000..329e839
--- /dev/null
+++ b/force-app/main/default/lwc/lexAgencyAuthorize/lexAgencyAuthorize.js-meta.xml
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata">
+    <apiVersion>54.0</apiVersion>
+    <isExposed>true</isExposed>
+    <targets>
+		<target>lightning__RecordPage</target>
+		<target>lightning__AppPage</target>
+		<target>lightning__HomePage</target>
+		<target>lightning__RecordAction</target>
+	</targets>
+</LightningComponentBundle>
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexBeforeOPDPDFBtn/__tests__/lexBeforeOPDPDFBtn.test.js b/force-app/main/default/lwc/lexBeforeOPDPDFBtn/__tests__/lexBeforeOPDPDFBtn.test.js
new file mode 100644
index 0000000..e80318e
--- /dev/null
+++ b/force-app/main/default/lwc/lexBeforeOPDPDFBtn/__tests__/lexBeforeOPDPDFBtn.test.js
@@ -0,0 +1,25 @@
+import { createElement } from 'lwc';
+import LexBeforeOPDPDFBtn from 'c/lexBeforeOPDPDFBtn';
+
+describe('c-lex-before-opdpdf-btn', () => {
+    afterEach(() => {
+        // The jsdom instance is shared across test cases in a single file so reset the DOM
+        while (document.body.firstChild) {
+            document.body.removeChild(document.body.firstChild);
+        }
+    });
+
+    it('TODO: test case generated by CLI command, please fill in test logic', () => {
+        // Arrange
+        const element = createElement('c-lex-before-opdpdf-btn', {
+            is: LexBeforeOPDPDFBtn
+        });
+
+        // Act
+        document.body.appendChild(element);
+
+        // Assert
+        // const div = element.shadowRoot.querySelector('div');
+        expect(1).toBe(1);
+    });
+});
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexBeforeOPDPDFBtn/lexBeforeOPDPDFBtn.css b/force-app/main/default/lwc/lexBeforeOPDPDFBtn/lexBeforeOPDPDFBtn.css
new file mode 100644
index 0000000..049e19f
--- /dev/null
+++ b/force-app/main/default/lwc/lexBeforeOPDPDFBtn/lexBeforeOPDPDFBtn.css
@@ -0,0 +1,10 @@
+.lexBeforeOPDPDFBtnHolder{
+    position: relative;
+    display: inline-block;
+    width: 80px;
+    height: 80px;
+    text-align: center;
+}
+.container .uiContainerManager{
+	display: none !important;
+}
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexBeforeOPDPDFBtn/lexBeforeOPDPDFBtn.html b/force-app/main/default/lwc/lexBeforeOPDPDFBtn/lexBeforeOPDPDFBtn.html
new file mode 100644
index 0000000..d0f5bfb
--- /dev/null
+++ b/force-app/main/default/lwc/lexBeforeOPDPDFBtn/lexBeforeOPDPDFBtn.html
@@ -0,0 +1,6 @@
+<template>
+    <div class="lexBeforeOPDPDFBtnHolder" if:true={IsLoading}>
+        <lightning-spinner alternative-text="Loading" size="medium"></lightning-spinner>
+        <lightning-button label="Show Toast" onclick={showSuccess}></lightning-button>
+    </div>
+</template>
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexBeforeOPDPDFBtn/lexBeforeOPDPDFBtn.js b/force-app/main/default/lwc/lexBeforeOPDPDFBtn/lexBeforeOPDPDFBtn.js
new file mode 100644
index 0000000..e1ba4a1
--- /dev/null
+++ b/force-app/main/default/lwc/lexBeforeOPDPDFBtn/lexBeforeOPDPDFBtn.js
@@ -0,0 +1,89 @@
+import { api, wire,LightningElement } from 'lwc';
+import { CurrentPageReference } from "lightning/navigation";
+import { CloseActionScreenEvent } from 'lightning/actions';
+import init  from '@salesforce/apex/OpportunityLightingButtonController.initFoBeforeOPDPDFBtnButton';
+import { ShowToastEvent } from 'lightning/platformShowToastEvent';
+import selectCommonSequence from '@salesforce/apex/ControllerUtil.selectCommonSequence';
+import addReportOPWithEvaluationPDF from '@salesforce/apex/Add_Report.addReportOPWithEvaluationPDF';
+
+export default class LexBeforeOPDPDFBtn extends LightningElement {
+    @api recordId;
+    accountId;
+    userId;
+    IsLoading = true;
+    @wire(CurrentPageReference)
+    getStateParameters(currentPageReference) {
+            console.log(111);
+            console.log(currentPageReference);
+
+        if (currentPageReference) {
+          const urlValue = currentPageReference.state.recordId;
+          if (urlValue) {
+            let str = `${urlValue}`;
+            console.log("str");
+            console.log(str);
+            this.recordId = str;
+          }
+        }
+    }
+    connectedCallback(){
+        init({
+            recordId: this.recordId
+        }).then(result=>{
+            this.accountId = result.accountId;
+            this.userId = result.userId;
+            this.beforeOPDPDFBtn();
+        })
+    }
+    beforeOPDPDFBtn(){
+        if (window.confirm('鏄惁鏂板缓OPD鎶ュ憡涔︼紵\n[纭畾] => 鏂板缓OPD\n[鍙栨秷] => 鍙敓鎴� 锛讳骇鍝佽瘯鐢ㄨ瘎浠凤冀')) {
+            try {
+            selectCommonSequence({
+                valueField: 'EvaluationPDF_NextValue__c',
+                formatField: 'EvaluationPDF_Format__c'
+            }).then(result=>{
+                var pdfno = result;
+                addReportOPWithEvaluationPDF({
+                    "repOwnerId": this.userId,
+                    "reportId": "",
+                    "dailyReportId": "",
+                    "eventId": "",
+                    "recordType": "OPD",
+                    "aId": this.accountId,
+                    "visitor1": "",
+                    "visitor2": "",
+                    "visitor3": "",
+                    "visitor4": "",
+                    "visitor5": "",
+                    "opp1": this.recordId,
+                    "opp2": "",
+                    "opp3": "",
+                    "opp4": "",
+                    "opp5": "",
+                    "reportDate": "",
+                    "evaluationPDFNumber": pdfno
+                }).then(()=>{
+                    // 20220913 ljh WLIG-CHMATN update end
+                    this.IsLoading = false;
+                    window.open('/apex/BeforeOPDPDF?oid=' + this.recordId + '&pdfNo=' + pdfno, 'BeforeOPDPDF');
+                    this.dispatchEvent(new CloseActionScreenEvent());
+                })
+            });
+            } catch(e) {
+                this.showToast(e,"error");
+                this.dispatchEvent(new CloseActionScreenEvent());
+            }
+        } else {
+            window.open('/apex/BeforeOPDPDF?oid=' + this.recordId, 'BeforeOPDPDF');
+            this.dispatchEvent(new CloseActionScreenEvent());
+        }
+    }
+    showToast(msg,type) {
+        const event = new ShowToastEvent({
+            title: '',
+            message: msg,
+            variant: type
+        });
+        this.dispatchEvent(event);
+    }
+}
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexBeforeOPDPDFBtn/lexBeforeOPDPDFBtn.js-meta.xml b/force-app/main/default/lwc/lexBeforeOPDPDFBtn/lexBeforeOPDPDFBtn.js-meta.xml
new file mode 100644
index 0000000..329e839
--- /dev/null
+++ b/force-app/main/default/lwc/lexBeforeOPDPDFBtn/lexBeforeOPDPDFBtn.js-meta.xml
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata">
+    <apiVersion>54.0</apiVersion>
+    <isExposed>true</isExposed>
+    <targets>
+		<target>lightning__RecordPage</target>
+		<target>lightning__AppPage</target>
+		<target>lightning__HomePage</target>
+		<target>lightning__RecordAction</target>
+	</targets>
+</LightningComponentBundle>
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexBeforeOPDPDFBtnSIS/__tests__/lexBeforeOPDPDFBtnSIS.test.js b/force-app/main/default/lwc/lexBeforeOPDPDFBtnSIS/__tests__/lexBeforeOPDPDFBtnSIS.test.js
new file mode 100644
index 0000000..f21bd5a
--- /dev/null
+++ b/force-app/main/default/lwc/lexBeforeOPDPDFBtnSIS/__tests__/lexBeforeOPDPDFBtnSIS.test.js
@@ -0,0 +1,25 @@
+import { createElement } from 'lwc';
+import LexBeforeOPDPDFBtnSIS from 'c/lexBeforeOPDPDFBtnSIS';
+
+describe('c-lex-before-opdpdf-btn-sis', () => {
+    afterEach(() => {
+        // The jsdom instance is shared across test cases in a single file so reset the DOM
+        while (document.body.firstChild) {
+            document.body.removeChild(document.body.firstChild);
+        }
+    });
+
+    it('TODO: test case generated by CLI command, please fill in test logic', () => {
+        // Arrange
+        const element = createElement('c-lex-before-opdpdf-btn-sis', {
+            is: LexBeforeOPDPDFBtnSIS
+        });
+
+        // Act
+        document.body.appendChild(element);
+
+        // Assert
+        // const div = element.shadowRoot.querySelector('div');
+        expect(1).toBe(1);
+    });
+});
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexBeforeOPDPDFBtnSIS/lexBeforeOPDPDFBtnSIS.css b/force-app/main/default/lwc/lexBeforeOPDPDFBtnSIS/lexBeforeOPDPDFBtnSIS.css
new file mode 100644
index 0000000..7980084
--- /dev/null
+++ b/force-app/main/default/lwc/lexBeforeOPDPDFBtnSIS/lexBeforeOPDPDFBtnSIS.css
@@ -0,0 +1,10 @@
+.lexBeforeOPDPDFBtnSISHolder{
+    position: relative;
+    display: inline-block;
+    width: 80px;
+    height: 80px;
+    text-align: center;
+}
+.container .uiContainerManager{
+	display: none !important;
+}
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexBeforeOPDPDFBtnSIS/lexBeforeOPDPDFBtnSIS.html b/force-app/main/default/lwc/lexBeforeOPDPDFBtnSIS/lexBeforeOPDPDFBtnSIS.html
new file mode 100644
index 0000000..234e137
--- /dev/null
+++ b/force-app/main/default/lwc/lexBeforeOPDPDFBtnSIS/lexBeforeOPDPDFBtnSIS.html
@@ -0,0 +1,14 @@
+<!--
+ * @Description: 
+ * @version: 
+ * @Author: chen jing wu
+ * @Date: 2023-04-13 15:55:45
+ * @LastEditors: chen jing wu
+ * @LastEditTime: 2023-04-13 15:56:58
+-->
+<template>
+    <div class="lexBeforeOPDPDFBtnSISHolder" if:true={IsLoading}>
+        <lightning-spinner alternative-text="Loading" size="medium"></lightning-spinner>
+        <lightning-button label="Show Toast" onclick={showSuccess}></lightning-button>
+    </div>
+</template>
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexBeforeOPDPDFBtnSIS/lexBeforeOPDPDFBtnSIS.js b/force-app/main/default/lwc/lexBeforeOPDPDFBtnSIS/lexBeforeOPDPDFBtnSIS.js
new file mode 100644
index 0000000..db99c83
--- /dev/null
+++ b/force-app/main/default/lwc/lexBeforeOPDPDFBtnSIS/lexBeforeOPDPDFBtnSIS.js
@@ -0,0 +1,97 @@
+/*
+ * @Description: 
+ * @version: 
+ * @Author: chen jing wu
+ * @Date: 2023-04-13 15:55:45
+ * @LastEditors: chen jing wu
+ * @LastEditTime: 2023-04-13 16:04:14
+ */
+import { api, wire,LightningElement } from 'lwc';
+import { CurrentPageReference } from "lightning/navigation";
+import { CloseActionScreenEvent } from 'lightning/actions';
+import init  from '@salesforce/apex/OpportunityLightingButtonController.initFoBeforeOPDPDFBtnSISButton';
+import { ShowToastEvent } from 'lightning/platformShowToastEvent';
+import selectCommonSequence from '@salesforce/apex/ControllerUtil.selectCommonSequence';
+import addReportOPWithEvaluationPDF from '@salesforce/apex/Add_Report.addReportOPWithEvaluationPDF';
+
+export default class LexBeforeOPDPDFBtnSIS extends LightningElement {
+    @api recordId;
+    accountId;
+    userId;
+    IsLoading = true;
+    @wire(CurrentPageReference)
+    getStateParameters(currentPageReference) {
+            console.log(111);
+            console.log(currentPageReference);
+
+        if (currentPageReference) {
+          const urlValue = currentPageReference.state.recordId;
+          if (urlValue) {
+            let str = `${urlValue}`;
+            console.log("str");
+            console.log(str);
+            this.recordId = str;
+          }
+        }
+    }
+    connectedCallback(){
+        init({
+            recordId: this.recordId
+        }).then(result=>{
+            this.accountId = result.accountId;
+            this.userId = result.userId;
+            this.beforeOPDPDFBtn();
+        })
+    }
+    beforeOPDPDFBtn(){
+        if (window.confirm('鏄惁鏂板缓SIS鎶ュ憡涔︼紵')) {
+            try {
+            selectCommonSequence({
+                valueField: 'EvaluationPDF_NextValue__c',
+                formatField: 'EvaluationPDF_Format__c'
+            }).then(result=>{
+                var pdfno = result;
+                addReportOPWithEvaluationPDF({
+                    "repOwnerId": this.userId,
+                    "reportId": "",
+                    "dailyReportId": "",
+                    "eventId": "",
+                    "recordType": "SIS",
+                    "aId": this.accountId,
+                    "visitor1": "",
+                    "visitor2": "",
+                    "visitor3": "",
+                    "visitor4": "",
+                    "visitor5": "",
+                    "opp1": this.recordId,
+                    "opp2": "",
+                    "opp3": "",
+                    "opp4": "",
+                    "opp5": "",
+                    "reportDate": "",
+                    "evaluationPDFNumber": pdfno
+                }).then(()=>{
+                    // 20220913 ljh WLIG-CHMATN update end
+                    this.IsLoading = false;
+                    window.open('/apex/BeforeOPDPDF?oid=' + this.recordId + '&pdfNo=' + pdfno, 'BeforeOPDPDF');
+                    this.dispatchEvent(new CloseActionScreenEvent());
+                })
+            });
+            } catch(e) {
+                this.showToast(e,"error");
+                this.dispatchEvent(new CloseActionScreenEvent());
+            }
+        } else {
+            window.open('/apex/BeforeOPDPDF?oid=' + this.recordId, 'BeforeOPDPDF');
+            this.dispatchEvent(new CloseActionScreenEvent());
+        }
+    }
+    showToast(msg,type) {
+        const event = new ShowToastEvent({
+            title: '',
+            message: msg,
+            variant: type
+        });
+        this.dispatchEvent(event);
+    }
+}
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexBeforeOPDPDFBtnSIS/lexBeforeOPDPDFBtnSIS.js-meta.xml b/force-app/main/default/lwc/lexBeforeOPDPDFBtnSIS/lexBeforeOPDPDFBtnSIS.js-meta.xml
new file mode 100644
index 0000000..329e839
--- /dev/null
+++ b/force-app/main/default/lwc/lexBeforeOPDPDFBtnSIS/lexBeforeOPDPDFBtnSIS.js-meta.xml
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata">
+    <apiVersion>54.0</apiVersion>
+    <isExposed>true</isExposed>
+    <targets>
+		<target>lightning__RecordPage</target>
+		<target>lightning__AppPage</target>
+		<target>lightning__HomePage</target>
+		<target>lightning__RecordAction</target>
+	</targets>
+</LightningComponentBundle>
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexCancel/lexCancel.js b/force-app/main/default/lwc/lexCancel/lexCancel.js
index 29ffc5c..77a0e59 100644
--- a/force-app/main/default/lwc/lexCancel/lexCancel.js
+++ b/force-app/main/default/lwc/lexCancel/lexCancel.js
@@ -2,9 +2,9 @@
  * @Description: 
  * @version: 
  * @Author: chen jing wu
- * @Date: 2023-04-07 09:02:03
+ * @Date: 2023-03-27 13:47:21
  * @LastEditors: chen jing wu
- * @LastEditTime: 2023-04-11 09:00:54
+ * @LastEditTime: 2023-04-11 16:44:49
  */
 import { api, wire,LightningElement } from 'lwc';
 import { CurrentPageReference } from "lightning/navigation";
@@ -45,13 +45,10 @@
                 this.status = result.status;
                 console.log(this.status);
                 this.cancel();
-
             }
         }).catch(error => {
             console.log("error");
             console.log(error);
-        }).finally(() => {
-            
         });
 
     }
@@ -72,30 +69,34 @@
 
     cancel () {
         if (this.status == "鍙栨秷") {
-            ShowToastEvent("宸茬粡鍙栨秷锛�","error");
+            this.showToast("宸茬粡鍙栨秷锛�","error");
             this.dispatchEvent(new CloseActionScreenEvent());
             return;
             }
         if (this.status == "鎵瑰噯") {
-            ShowToastEvent("宸茬粡鎵瑰噯锛屼笉鑳藉垹闄わ紒","error");
+            this.showToast("宸茬粡鎵瑰噯锛屼笉鑳藉垹闄わ紒","error");
             this.dispatchEvent(new CloseActionScreenEvent());
             return;
         }
         if (this.status == "瀹屾瘯") {
-            ShowToastEvent("宸茬粡瀹屾瘯锛屼笉鑳藉垹闄わ紒","error");
+            this.showToast("宸茬粡瀹屾瘯锛屼笉鑳藉垹闄わ紒","error");
             this.dispatchEvent(new CloseActionScreenEvent());
             return;
         }
         if (this.status == "鎻愪氦") {
-            ShowToastEvent("宸茬粡鎻愪氦锛屼笉鑳藉垹闄わ紒","error");
+            this.showToast("宸茬粡鎻愪氦锛屼笉鑳藉垹闄わ紒","error");
             this.dispatchEvent(new CloseActionScreenEvent());
             return;
         }
         updateForCancelButton({
             recordId: this.recordId
         }).then(result =>{
-            this.showToast("鍙栨秷鎴愬姛锛�","success");
-            this.updateRecordView(this.recordId);
+            if(result){
+                this.showToast(result,"error");
+            }else{
+                this.showToast("鍙栨秷鎴愬姛锛�","success");
+                this.updateRecordView(this.recordId);
+            }
             this.IsLoading = false;
             this.dispatchEvent(new CloseActionScreenEvent());
         });
diff --git a/force-app/main/default/lwc/lexCancelSubmit/lexCancelSubmit.js b/force-app/main/default/lwc/lexCancelSubmit/lexCancelSubmit.js
index f5e217a..17d0216 100644
--- a/force-app/main/default/lwc/lexCancelSubmit/lexCancelSubmit.js
+++ b/force-app/main/default/lwc/lexCancelSubmit/lexCancelSubmit.js
@@ -4,7 +4,7 @@
  * @Author: chen jing wu
  * @Date: 2023-04-07 09:02:03
  * @LastEditors: chen jing wu
- * @LastEditTime: 2023-04-11 09:05:05
+ * @LastEditTime: 2023-04-11 11:17:24
  */
 import { LightningElement,wire,track,api} from 'lwc';
 import { CurrentPageReference } from "lightning/navigation";
@@ -54,8 +54,6 @@
         }).catch(error => {
             console.log("error");
             console.log(error);
-        }).finally(() => {
-            
         });   
     }
 
@@ -76,8 +74,13 @@
             cancel({
                 recordId: this.recordId
             }).then(result=>{
-                this.showToast("鎴愬姛","success");
-                this.updateRecordView(this.recordId);
+                if(result){
+                    this.showToast(result,"error");
+                }else{
+                    this.showToast("鎴愬姛","success");
+                    this.updateRecordView(this.recordId);
+                }
+                this.IsLoading = false;
                 this.dispatchEvent(new CloseActionScreenEvent());
             });
             console.log("321");
diff --git a/force-app/main/default/lwc/lexCancelSubmitReport/lexCancelSubmitReport.js b/force-app/main/default/lwc/lexCancelSubmitReport/lexCancelSubmitReport.js
index 00557d0..becb18d 100644
--- a/force-app/main/default/lwc/lexCancelSubmitReport/lexCancelSubmitReport.js
+++ b/force-app/main/default/lwc/lexCancelSubmitReport/lexCancelSubmitReport.js
@@ -4,7 +4,7 @@
  * @Author: chen jing wu
  * @Date: 2023-04-07 09:02:03
  * @LastEditors: chen jing wu
- * @LastEditTime: 2023-04-11 09:06:00
+ * @LastEditTime: 2023-04-11 11:18:36
  */
 import { LightningElement,wire,track,api} from 'lwc';
 import { CurrentPageReference } from "lightning/navigation";
@@ -41,12 +41,14 @@
         cancel({
             recordId: this.recordId
         }).then(result =>{
-            this.showToast("鍙栨秷鎻愪氦鎴愬姛锛�","success");
-            this.updateRecordView(this.recordId);
+            if(result){
+                this.showToast(result,"error");
+            }else{
+                this.showToast("鍙栨秷鎻愪氦鎴愬姛锛�","success");
+                this.updateRecordView(this.recordId);
+            }
             this.IsLoading = false;
             this.dispatchEvent(new CloseActionScreenEvent());
-        }).catch(error=>{
-            this.showToast(error,"error");
         });
     }
 
diff --git a/force-app/main/default/lwc/lexComplete/lexComplete.js b/force-app/main/default/lwc/lexComplete/lexComplete.js
index 27029f0..fb737d5 100644
--- a/force-app/main/default/lwc/lexComplete/lexComplete.js
+++ b/force-app/main/default/lwc/lexComplete/lexComplete.js
@@ -4,7 +4,7 @@
  * @Author: chen jing wu
  * @Date: 2023-04-07 09:02:03
  * @LastEditors: chen jing wu
- * @LastEditTime: 2023-04-11 09:06:48
+ * @LastEditTime: 2023-04-11 11:21:30
  */
 import { LightningElement,wire,track,api} from 'lwc';
 import { CurrentPageReference } from "lightning/navigation";
@@ -46,14 +46,11 @@
                 this.status = result.status;
                 this.profileId = result.profileId;
                 this.complete();
-                this.dispatchEvent(new CloseActionScreenEvent());
                 //window.location.replace("https://ocsm--partial.sandbox.lightning.force.com/lightning/r/Report__c/" + this.recordId + "/view");
             }
         }).catch(error => {
             console.log("error");
             console.log(error);
-        }).finally(() => {
-            
         });   
         //this.updateRecordView(this.recordId);
     }
@@ -76,19 +73,24 @@
     complete () {
         // 闄嗚儨锛岃儭杩畨锛岀郴缁熺鐞嗗憳浠ュ娌℃湁鏉冮檺
         if (UserInfo_Owner.Id != "00510000004reg2" && UserInfo_Owner.Id != "00510000000gWAE" && this.profileId != "00e10000000Y3o5") {
-            ShowToastEvent("浣犳病鏈夋潈闄�","error");
+            this.showToast("浣犳病鏈夋潈闄�","error");
             return;
         }
         if (this.status == "瀹屾瘯") {
-            ShowToastEvent("宸茬粡瀹屾瘯锛�","error");
+            this.showToast("宸茬粡瀹屾瘯锛�","error");
             return;
         }
         updateForCompleteButton({
             recordId: this.recordId
         }).then(result =>{
+            if(result){
+                this.showToast(result,"error");
+            }else{
+                this.updateRecordView(this.recordId);
+                this.showToast("瀹屾瘯鎴愬姛锛�","success");
+            }
             this.IsLoading = false;
-            this.updateRecordView(this.recordId);
-            this.showToast("瀹屾瘯鎴愬姛锛�","success");
+            this.dispatchEvent(new CloseActionScreenEvent());
         });
     }
 }
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexCreateEvent/__tests__/lexCreateEvent.test.js b/force-app/main/default/lwc/lexCreateEvent/__tests__/lexCreateEvent.test.js
new file mode 100644
index 0000000..9d8a9ae
--- /dev/null
+++ b/force-app/main/default/lwc/lexCreateEvent/__tests__/lexCreateEvent.test.js
@@ -0,0 +1,25 @@
+import { createElement } from 'lwc';
+import LexCreateEvent from 'c/lexCreateEvent';
+
+describe('c-lex-create-event', () => {
+    afterEach(() => {
+        // The jsdom instance is shared across test cases in a single file so reset the DOM
+        while (document.body.firstChild) {
+            document.body.removeChild(document.body.firstChild);
+        }
+    });
+
+    it('TODO: test case generated by CLI command, please fill in test logic', () => {
+        // Arrange
+        const element = createElement('c-lex-create-event', {
+            is: LexCreateEvent
+        });
+
+        // Act
+        document.body.appendChild(element);
+
+        // Assert
+        // const div = element.shadowRoot.querySelector('div');
+        expect(1).toBe(1);
+    });
+});
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexCreateEvent/lexCreateEvent.html b/force-app/main/default/lwc/lexCreateEvent/lexCreateEvent.html
new file mode 100644
index 0000000..617f069
--- /dev/null
+++ b/force-app/main/default/lwc/lexCreateEvent/lexCreateEvent.html
@@ -0,0 +1,6 @@
+<template>
+    <div class="lexCreateEventReportHolder" if:true={IsLoading}>
+        <lightning-spinner alternative-text="Loading" size="medium"></lightning-spinner>
+        <lightning-button label="Show Toast" onclick={ShowToastEvent}></lightning-button>
+    </div>
+</template>
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexCreateEvent/lexCreateEvent.js b/force-app/main/default/lwc/lexCreateEvent/lexCreateEvent.js
new file mode 100644
index 0000000..453f9df
--- /dev/null
+++ b/force-app/main/default/lwc/lexCreateEvent/lexCreateEvent.js
@@ -0,0 +1,59 @@
+/*
+ * @Description: 
+ * @version: 
+ * @Author: chen jing wu
+ * @Date: 2023-04-13 13:50:23
+ * @LastEditors: chen jing wu
+ * @LastEditTime: 2023-04-13 14:39:54
+ */
+import { api, wire,LightningElement } from 'lwc';
+import { CurrentPageReference } from "lightning/navigation";
+import { CloseActionScreenEvent } from 'lightning/actions';
+import init  from '@salesforce/apex/OpportunityLightingButtonController.initForCreateEventButton';
+import { updateRecord } from 'lightning/uiRecordApi';
+import { ShowToastEvent } from 'lightning/platformShowToastEvent';
+export default class LexCreateEvent extends LightningElement {
+    @api recordId;
+    accountId;
+    @wire(CurrentPageReference)
+    getStateParameters(currentPageReference) {
+            console.log(111);
+            console.log(currentPageReference);
+
+        if (currentPageReference) {
+          const urlValue = currentPageReference.state.recordId;
+          if (urlValue) {
+            let str = `${urlValue}`;
+            console.log("str");
+            console.log(str);
+            this.recordId = str;
+          }
+        }
+    }
+    connectedCallback(){
+        init({
+            recordId: this.recordId
+        }).then(result=>{
+            this.accountId = result.accountId;
+            this.createEvent();
+        }).catch(error=>{
+            console.log("error");
+            console.log(error);
+        })
+    }
+    createEvent(){
+        window.open("/00U/e?retURL=%2Fapex%2FVFClosePage&accid=" + this.accountId + "&oid=" + this.recordId, "鏂板缓璁″垝");
+        this.dispatchEvent(new CloseActionScreenEvent());
+    }
+    showToast(msg,type) {
+        const event = new ShowToastEvent({
+            title: '',
+            message: msg,
+            variant: type
+        });
+        this.dispatchEvent(event);
+    }
+    updateRecordView(recordId) {
+        updateRecord({fields: { Id: recordId }});
+    }
+}
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexCreateEvent/lexCreateEvent.js-meta.xml b/force-app/main/default/lwc/lexCreateEvent/lexCreateEvent.js-meta.xml
new file mode 100644
index 0000000..3392981
--- /dev/null
+++ b/force-app/main/default/lwc/lexCreateEvent/lexCreateEvent.js-meta.xml
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata">
+    <apiVersion>54.0</apiVersion>
+	<isExposed>true</isExposed>
+	<targets>
+		<target>lightning__RecordPage</target>
+		<target>lightning__AppPage</target>
+		<target>lightning__HomePage</target>
+		<target>lightning__RecordAction</target>
+	</targets>
+</LightningComponentBundle>
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexDispatchOCSMQARA/lexDispatchOCSMQARA.js b/force-app/main/default/lwc/lexDispatchOCSMQARA/lexDispatchOCSMQARA.js
index 09c3a26..2076d74 100644
--- a/force-app/main/default/lwc/lexDispatchOCSMQARA/lexDispatchOCSMQARA.js
+++ b/force-app/main/default/lwc/lexDispatchOCSMQARA/lexDispatchOCSMQARA.js
@@ -4,7 +4,7 @@
  * @Author: chen jing wu
  * @Date: 2023-04-07 09:02:03
  * @LastEditors: chen jing wu
- * @LastEditTime: 2023-04-11 09:07:34
+ * @LastEditTime: 2023-04-11 11:23:37
  */
 import { api, wire,LightningElement } from 'lwc';
 import { CurrentPageReference } from "lightning/navigation";
@@ -58,9 +58,13 @@
             updateForDispatchOCSMQARAButton({
                 recordId: this.recordId
             }).then(result =>{
-                this.showToast("鎴愬姛","success");
-                this.updateRecordView(this.recordId);
-                this.IsLoading = false;
+                if(result){
+                    this.showToast(result,"error");
+                }else{
+                    this.showToast("鎴愬姛","success");
+                    this.updateRecordView(this.recordId);
+                    this.IsLoading = false;
+                }
                 this.dispatchEvent(new CloseActionScreenEvent());
                 });
     }
diff --git a/force-app/main/default/lwc/lexFinLibrary/lexFinLibrary.css b/force-app/main/default/lwc/lexFinLibrary/lexFinLibrary.css
new file mode 100644
index 0000000..b606828
--- /dev/null
+++ b/force-app/main/default/lwc/lexFinLibrary/lexFinLibrary.css
@@ -0,0 +1,11 @@
+.lexFinlibraryHolder{
+ position: relative;
+ display: inline-block;
+ width: 80px;
+ height: 80px;
+ text-align: center;
+}
+
+.container .uiContainerManager{
+ display : none !important;
+}
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexFinLibrary/lexFinLibrary.html b/force-app/main/default/lwc/lexFinLibrary/lexFinLibrary.html
new file mode 100644
index 0000000..aab9e0c
--- /dev/null
+++ b/force-app/main/default/lwc/lexFinLibrary/lexFinLibrary.html
@@ -0,0 +1,4 @@
+<template>
+<div class="lexFinlibraryHolder" if:true={IsLoding}>
+<lightning-spinner alternative-text="Loading" size="medium">  </lightning-spinner> </div>
+</template>
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexFinLibrary/lexFinLibrary.js b/force-app/main/default/lwc/lexFinLibrary/lexFinLibrary.js
new file mode 100644
index 0000000..febcdf5
--- /dev/null
+++ b/force-app/main/default/lwc/lexFinLibrary/lexFinLibrary.js
@@ -0,0 +1,55 @@
+import { LightningElement, track, wire,api } from 'lwc';
+import getBulletinBoard  from '@salesforce/apex/FinLibraryButtonController.getBulletinBoard';
+import {CurrentPageReference} from 'lightning/navigation';
+import { CloseActionScreenEvent } from 'lightning/actions';
+export default class lexFinLibrary extends LightningElement {
+
+		@api recordId;
+		IsLoading;
+		Bulletin_Board__c;
+
+
+		@wire(CurrentPageReference)
+    getStateParameters(currentPageReference){
+    	if(currentPageReference){
+    		console.log(currentPageReference);
+    		console.log("杩涘叆鑾峰彇page鍙傛暟")
+    		const IdValue=currentPageReference.state.recordId;
+    		if(IdValue){
+    			let str=`${IdValue}`;
+    			this.recordId=str;
+    			console.log("recordId="+str);
+    		}
+    	}
+    }
+
+
+    connectedCallback(){
+    getBulletinBoard({recordId:this.recordId}).then(res=>{
+    	if(res!=null){
+    	this.IsLoading=false;
+    	console.log("res");
+    	console.log(res);
+    	console.log("杩涘叆鍒濆鍖栧璞″叾浠栧睘鎬�");
+    	this.Bulletin_Board__c=res;
+    	console.log(this.Bulletin_Board__c);
+        this.FinLibrary();
+    	}
+    	else{
+    		 var a="娌¤繘鏂规硶";
+ 			console.log(a);
+    	}
+    }).catch(error =>{
+    	console.log("error");
+    	console.log(error.message);
+    }).finally(()=>{
+
+    });
+    }
+
+    FinLibrary(){
+    	window.open(this.Bulletin_Board__c.iPad_Finlibrary__c, 'FinLibrary', '_top');
+    	this.dispatchEvent(new CloseActionScreenEvent());
+    }
+
+}
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexFinLibrary/lexFinLibrary.js-meta.xml b/force-app/main/default/lwc/lexFinLibrary/lexFinLibrary.js-meta.xml
new file mode 100644
index 0000000..79fced5
--- /dev/null
+++ b/force-app/main/default/lwc/lexFinLibrary/lexFinLibrary.js-meta.xml
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata" fqn="lexFinLibrary">
+    <apiVersion>51.0</apiVersion>
+    <isExposed>true</isExposed>
+     <targets>
+        <target>lightning__AppPage</target>
+        <target>lightning__RecordPage</target>
+        <target>lightning__HomePage</target>
+        <target>lightning__RecordAction</target>
+    </targets>
+</LightningComponentBundle>
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexFinLibrary2/lexFinLibrary2.css b/force-app/main/default/lwc/lexFinLibrary2/lexFinLibrary2.css
new file mode 100644
index 0000000..bb273c4
--- /dev/null
+++ b/force-app/main/default/lwc/lexFinLibrary2/lexFinLibrary2.css
@@ -0,0 +1,11 @@
+.lexFinlibraryHolder2{
+ position: relative;
+ display: inline-block;
+ width: 80px;
+ height: 80px;
+ text-align: center;
+}
+
+.container .uiContainerManager{
+ display : none !important;
+}
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexFinLibrary2/lexFinLibrary2.html b/force-app/main/default/lwc/lexFinLibrary2/lexFinLibrary2.html
new file mode 100644
index 0000000..81373b2
--- /dev/null
+++ b/force-app/main/default/lwc/lexFinLibrary2/lexFinLibrary2.html
@@ -0,0 +1,4 @@
+<template>
+<div class="lexFinlibraryHolder2" if:true={IsLoding}>
+<lightning-spinner alternative-text="Loading" size="medium">  </lightning-spinner> </div>
+</template>
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexFinLibrary2/lexFinLibrary2.js b/force-app/main/default/lwc/lexFinLibrary2/lexFinLibrary2.js
new file mode 100644
index 0000000..3db3717
--- /dev/null
+++ b/force-app/main/default/lwc/lexFinLibrary2/lexFinLibrary2.js
@@ -0,0 +1,62 @@
+import { LightningElement, track, wire,api } from 'lwc';
+import getBulletinBoard  from '@salesforce/apex/FinLibraryButtonController2.getBulletinBoard';
+import {CurrentPageReference} from 'lightning/navigation';
+import { CloseActionScreenEvent } from 'lightning/actions';
+export default class lexFinLibrary2 extends LightningElement {
+
+
+	@api recordId;
+	IsLoading;
+	Bulletin_Board__c;
+
+
+	@wire(CurrentPageReference)
+    getStateParameters(currentPageReference){
+    	if(currentPageReference){
+    		console.log(currentPageReference);
+    		console.log("杩涘叆鑾峰彇page鍙傛暟")
+    		const IdValue=currentPageReference.state.recordId;
+    		if(IdValue){
+    			let str=`${IdValue}`;
+    			this.recordId=str;
+    			console.log("recordId="+str);
+    		}
+    	}
+    }
+
+
+
+
+    connectedCallback(){
+    getBulletinBoard({recordId:this.recordId}).then(res=>{
+    	if(res!=null){
+    	this.IsLoading=false;
+    	console.log("res");
+    	console.log(res);
+    	console.log("杩涘叆鍒濆鍖栧璞″叾浠栧睘鎬�");
+    	this.Bulletin_Board__c=res;
+    	console.log(this.Bulletin_Board__c);
+        this.FinLibrary2();
+    	}
+    	else{
+    		 var a="娌¤繘鏂规硶";
+ 			console.log(a);
+    	}
+    }).catch(error =>{
+    	console.log("error");
+    	console.log(error.message);
+    }).finally(()=>{
+
+    });
+    }
+
+
+    FinLibrary2(){
+
+
+    	window.open(this.Bulletin_Board__c.iPad_Finlibrary_2__c, 'FinLibrary', '_top');
+    	this.dispatchEvent(new CloseActionScreenEvent());
+
+    }
+
+}
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexFinLibrary2/lexFinLibrary2.js-meta.xml b/force-app/main/default/lwc/lexFinLibrary2/lexFinLibrary2.js-meta.xml
new file mode 100644
index 0000000..f128d90
--- /dev/null
+++ b/force-app/main/default/lwc/lexFinLibrary2/lexFinLibrary2.js-meta.xml
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata" fqn="lexFinLibrary2">
+    <apiVersion>51.0</apiVersion>
+    <isExposed>true</isExposed>
+      <targets>
+        <target>lightning__AppPage</target>
+        <target>lightning__RecordPage</target>
+        <target>lightning__HomePage</target>
+        <target>lightning__RecordAction</target>
+    </targets>
+</LightningComponentBundle>
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexFinLibrary3/lexFinLibrary3.css b/force-app/main/default/lwc/lexFinLibrary3/lexFinLibrary3.css
new file mode 100644
index 0000000..69ceae8
--- /dev/null
+++ b/force-app/main/default/lwc/lexFinLibrary3/lexFinLibrary3.css
@@ -0,0 +1,11 @@
+.lexFinlibraryHolder3{
+ position: relative;
+ display: inline-block;
+ width: 80px;
+ height: 80px;
+ text-align: center;
+}
+
+.container .uiContainerManager{
+ display : none !important;
+}
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexFinLibrary3/lexFinLibrary3.html b/force-app/main/default/lwc/lexFinLibrary3/lexFinLibrary3.html
new file mode 100644
index 0000000..2e542b1
--- /dev/null
+++ b/force-app/main/default/lwc/lexFinLibrary3/lexFinLibrary3.html
@@ -0,0 +1,4 @@
+<template>
+<div class="lexFinlibraryHolder3" if:true={IsLoding}>
+<lightning-spinner alternative-text="Loading" size="medium">  </lightning-spinner> </div>
+</template>
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexFinLibrary3/lexFinLibrary3.js b/force-app/main/default/lwc/lexFinLibrary3/lexFinLibrary3.js
new file mode 100644
index 0000000..21eca75
--- /dev/null
+++ b/force-app/main/default/lwc/lexFinLibrary3/lexFinLibrary3.js
@@ -0,0 +1,58 @@
+import { LightningElement, track, wire,api } from 'lwc';
+import getBulletinBoard  from '@salesforce/apex/FinLibraryButtonController3.getBulletinBoard';
+import {CurrentPageReference} from 'lightning/navigation';
+import { CloseActionScreenEvent } from 'lightning/actions';
+export default class lexFinLibrary3 extends LightningElement {
+
+	@api recordId;
+	IsLoading;
+	Bulletin_Board__c;
+
+	@wire(CurrentPageReference)
+    getStateParameters(currentPageReference){
+    	if(currentPageReference){
+    		console.log(currentPageReference);
+    		console.log("杩涘叆鑾峰彇page鍙傛暟")
+    		const IdValue=currentPageReference.state.recordId;
+    		if(IdValue){
+    			let str=`${IdValue}`;
+    			this.recordId=str;
+    			console.log("recordId="+str);
+    		}
+    	}
+    }
+
+
+
+
+    connectedCallback(){
+    getBulletinBoard({recordId:this.recordId}).then(res=>{
+    	if(res!=null){
+    	this.IsLoading=false;
+    	console.log("res");
+    	console.log(res);
+    	console.log("杩涘叆鍒濆鍖栧璞″叾浠栧睘鎬�");
+    	this.Bulletin_Board__c=res;
+    	console.log(this.Bulletin_Board__c);
+        this.FinLibrary3();
+    	}
+    	else{
+    		 var a="娌¤繘鏂规硶";
+ 			console.log(a);
+    	}
+    }).catch(error =>{
+    	console.log("error");
+    	console.log(error.message);
+    }).finally(()=>{
+
+    });
+    }
+
+
+    FinLibrary3(){
+    	window.open(this.Bulletin_Board__c.iPad_Finlibrary_3__c, 'FinLibrary', '_top');
+    	this.dispatchEvent(new CloseActionScreenEvent());
+    }
+
+
+}
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexFinLibrary3/lexFinLibrary3.js-meta.xml b/force-app/main/default/lwc/lexFinLibrary3/lexFinLibrary3.js-meta.xml
new file mode 100644
index 0000000..5323374
--- /dev/null
+++ b/force-app/main/default/lwc/lexFinLibrary3/lexFinLibrary3.js-meta.xml
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata" fqn="lexFinLibrary3">
+    <apiVersion>51.0</apiVersion>
+    <isExposed>true</isExposed>
+     <targets>
+        <target>lightning__AppPage</target>
+        <target>lightning__RecordPage</target>
+        <target>lightning__HomePage</target>
+        <target>lightning__RecordAction</target>
+    </targets>
+</LightningComponentBundle>
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexLoseBid/__tests__/lexLoseBid.test.js b/force-app/main/default/lwc/lexLoseBid/__tests__/lexLoseBid.test.js
new file mode 100644
index 0000000..559fd0b
--- /dev/null
+++ b/force-app/main/default/lwc/lexLoseBid/__tests__/lexLoseBid.test.js
@@ -0,0 +1,25 @@
+import { createElement } from 'lwc';
+import LexLoseBid from 'c/lexLoseBid';
+
+describe('c-lex-lose-bid', () => {
+    afterEach(() => {
+        // The jsdom instance is shared across test cases in a single file so reset the DOM
+        while (document.body.firstChild) {
+            document.body.removeChild(document.body.firstChild);
+        }
+    });
+
+    it('TODO: test case generated by CLI command, please fill in test logic', () => {
+        // Arrange
+        const element = createElement('c-lex-lose-bid', {
+            is: LexLoseBid
+        });
+
+        // Act
+        document.body.appendChild(element);
+
+        // Assert
+        // const div = element.shadowRoot.querySelector('div');
+        expect(1).toBe(1);
+    });
+});
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexLoseBid/lexLoseBid.css b/force-app/main/default/lwc/lexLoseBid/lexLoseBid.css
new file mode 100644
index 0000000..fe3c9f1
--- /dev/null
+++ b/force-app/main/default/lwc/lexLoseBid/lexLoseBid.css
@@ -0,0 +1,18 @@
+/*
+ * @Description: 
+ * @version: 
+ * @Author: chen jing wu
+ * @Date: 2023-04-13 10:31:18
+ * @LastEditors: chen jing wu
+ * @LastEditTime: 2023-04-13 10:46:09
+ */
+.lexLoseBidHolder{
+    position: relative;
+    display: inline-block;
+    width: 80px;
+    height: 80px;
+    text-align: center;
+}
+.container .uiContainerManager{
+	display: none !important;
+}
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexLoseBid/lexLoseBid.html b/force-app/main/default/lwc/lexLoseBid/lexLoseBid.html
new file mode 100644
index 0000000..6c30e33
--- /dev/null
+++ b/force-app/main/default/lwc/lexLoseBid/lexLoseBid.html
@@ -0,0 +1,6 @@
+<template>
+    <div class="lexLoseBidHolder" if:true={IsLoading}>
+        <lightning-spinner alternative-text="Loading" size="medium"></lightning-spinner>
+        <lightning-button label="Show Toast" onclick={ShowToastEvent}></lightning-button>
+    </div>
+</template>
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexLoseBid/lexLoseBid.js b/force-app/main/default/lwc/lexLoseBid/lexLoseBid.js
new file mode 100644
index 0000000..db1b2da
--- /dev/null
+++ b/force-app/main/default/lwc/lexLoseBid/lexLoseBid.js
@@ -0,0 +1,89 @@
+import { api, wire,LightningElement } from 'lwc';
+import { CurrentPageReference } from "lightning/navigation";
+import { CloseActionScreenEvent } from 'lightning/actions';
+import { updateRecord } from 'lightning/uiRecordApi';
+import { ShowToastEvent } from 'lightning/platformShowToastEvent';
+import init  from '@salesforce/apex/OpportunityLightingButtonController.initForLoseBidButton';
+import updateForLoseBidButton  from '@salesforce/apex/OpportunityLightingButtonController.updateForLoseBidButton';
+import queryForLexLoseBidButton  from '@salesforce/apex/OpportunityLightingButtonController.queryForLoseBidButton';
+export default class LexLoseBid extends LightningElement {
+    @api recordId;
+    ifOpenBid;
+    IsLoading = true;
+    @wire(CurrentPageReference)
+    getStateParameters(currentPageReference) {
+            console.log(111);
+            console.log(currentPageReference);
+
+        if (currentPageReference) {
+          const urlValue = currentPageReference.state.recordId;
+          if (urlValue) {
+            let str = `${urlValue}`;
+            console.log("str");
+            console.log(str);
+            this.recordId = str;
+          }
+        }
+    }
+    connectedCallback(){
+        init({
+            recordId: this.recordId
+        }).then(result=>{
+            console.log(result);
+            this.ifOpenBid = result.ifOpenBid;
+            this.lexLoseBid();
+        }).catch(error=>{
+            console.log("error");
+            console.log(error);
+        })
+    }
+    lexLoseBid(){
+        console.log("query start");
+        queryForLexLoseBidButton({
+            recordId: this.recordId
+        }).then(result=>{
+            console.log("query end");
+            console.log(result);
+            var flag = true;
+            var taskslist = result;
+            for(var task of taskslist ){
+                if(task.taskStatus__c != '04 鍙栨秷'){
+                flag = false;
+            }
+            }
+            if(this.ifOpenBid == '闈炲叕寮�鎷涙爣'){
+                flag = false;
+            }
+    
+            if(flag){
+                this.showToast("鏉′欢涓嶇鍚堬紝涓嶅彲鎿嶄綔","error");
+            }else{
+                if (window.confirm('鏄惁纭绔炰簤瀵规墜涓爣锛�')) {
+                    updateForLoseBidButton({
+                        recordId: this.recordId
+                    }).then(result=>{
+                        if (result) {
+                            this.showToast(result,"error");
+                        }else{
+                            this.IsLoading = false;
+                            this.updateRecordView(this.recordId);
+                            this.showToast("鎿嶄綔鎴愬姛锛�","success");
+                        }
+                    })  
+                }
+            }
+        });    
+    }
+    showToast(msg,type) {
+        const event = new ShowToastEvent({
+            title: '',
+            message: msg,
+            variant: type
+        });
+        this.dispatchEvent(event);
+        this.dispatchEvent(new CloseActionScreenEvent());
+    }
+    updateRecordView(recordId) {
+        updateRecord({fields: { Id: recordId }});
+    }
+}
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexLoseBid/lexLoseBid.js-meta.xml b/force-app/main/default/lwc/lexLoseBid/lexLoseBid.js-meta.xml
new file mode 100644
index 0000000..3392981
--- /dev/null
+++ b/force-app/main/default/lwc/lexLoseBid/lexLoseBid.js-meta.xml
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata">
+    <apiVersion>54.0</apiVersion>
+	<isExposed>true</isExposed>
+	<targets>
+		<target>lightning__RecordPage</target>
+		<target>lightning__AppPage</target>
+		<target>lightning__HomePage</target>
+		<target>lightning__RecordAction</target>
+	</targets>
+</LightningComponentBundle>
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexOCSMNoToReportForReport/lexOCSMNoToReportForReport.js b/force-app/main/default/lwc/lexOCSMNoToReportForReport/lexOCSMNoToReportForReport.js
index 6b44bc5..b4a883a 100644
--- a/force-app/main/default/lwc/lexOCSMNoToReportForReport/lexOCSMNoToReportForReport.js
+++ b/force-app/main/default/lwc/lexOCSMNoToReportForReport/lexOCSMNoToReportForReport.js
@@ -4,7 +4,7 @@
  * @Author: chen jing wu
  * @Date: 2023-03-28 15:59:44
  * @LastEditors: chen jing wu
- * @LastEditTime: 2023-04-11 09:08:30
+ * @LastEditTime: 2023-04-11 11:24:51
  */
 import { api, wire,LightningElement } from 'lwc';
 import { CurrentPageReference } from "lightning/navigation";
@@ -82,9 +82,13 @@
            updateForOCSMNoToReportButton({
                 recordId: this.recordId
            }).then(result=>{
+            if(result){
+                this.showToast(result,"error");
+            }else{
                 this.showToast("OCSM涓嶈鎶ュ憡鎴愬姛","success");
                 this.updateRecordView(this.recordId);
                 this.IsLoading = false;
+            }
                 this.dispatchEvent(new CloseActionScreenEvent());
            });
         }else{
diff --git a/force-app/main/default/lwc/lexOCSMToReport/lexOCSMToReport.js b/force-app/main/default/lwc/lexOCSMToReport/lexOCSMToReport.js
index fab2fbb..a7d8d5f 100644
--- a/force-app/main/default/lwc/lexOCSMToReport/lexOCSMToReport.js
+++ b/force-app/main/default/lwc/lexOCSMToReport/lexOCSMToReport.js
@@ -4,7 +4,7 @@
  * @Author: chen jing wu
  * @Date: 2023-04-07 09:02:03
  * @LastEditors: chen jing wu
- * @LastEditTime: 2023-04-11 09:09:14
+ * @LastEditTime: 2023-04-11 11:26:11
  */
 import { api, wire,LightningElement } from 'lwc';
 import { CurrentPageReference } from "lightning/navigation";
@@ -50,8 +50,6 @@
         }).catch(error => {
             console.log("error");
             console.log(error);
-        }).finally(() => {
-            
         });
 
     }
@@ -81,9 +79,13 @@
             updateForOCSMToReportButton({
                 recordId: this.recordId
             }).then(result =>{
-                this.showToast("鎴愬姛","success");
-                this.updateRecordView(this.recordId);
-                this.IsLoading = false;
+                if(result){
+                    this.showToast(result,"error");
+                }else{
+                    this.showToast("鎴愬姛","success");
+                    this.updateRecordView(this.recordId);
+                    this.IsLoading = false;
+                }
                 this.dispatchEvent(new CloseActionScreenEvent());
                 });
         }else{
diff --git a/force-app/main/default/lwc/lexOLYwinBid/__tests__/lexOLYwinBid.test.js b/force-app/main/default/lwc/lexOLYwinBid/__tests__/lexOLYwinBid.test.js
new file mode 100644
index 0000000..a030bea
--- /dev/null
+++ b/force-app/main/default/lwc/lexOLYwinBid/__tests__/lexOLYwinBid.test.js
@@ -0,0 +1,25 @@
+import { createElement } from 'lwc';
+import LexOLYwinBid from 'c/lexOLYwinBid';
+
+describe('c-lex-ol-ywin-bid', () => {
+    afterEach(() => {
+        // The jsdom instance is shared across test cases in a single file so reset the DOM
+        while (document.body.firstChild) {
+            document.body.removeChild(document.body.firstChild);
+        }
+    });
+
+    it('TODO: test case generated by CLI command, please fill in test logic', () => {
+        // Arrange
+        const element = createElement('c-lex-ol-ywin-bid', {
+            is: LexOLYwinBid
+        });
+
+        // Act
+        document.body.appendChild(element);
+
+        // Assert
+        // const div = element.shadowRoot.querySelector('div');
+        expect(1).toBe(1);
+    });
+});
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexOLYwinBid/lexOLYwinBid.css b/force-app/main/default/lwc/lexOLYwinBid/lexOLYwinBid.css
new file mode 100644
index 0000000..a9b43eb
--- /dev/null
+++ b/force-app/main/default/lwc/lexOLYwinBid/lexOLYwinBid.css
@@ -0,0 +1,10 @@
+.lexOLYwinBidHolder{
+    position: relative;
+    display: inline-block;
+    width: 80px;
+    height: 80px;
+    text-align: center;
+}
+.container .uiContainerManager{
+	display: none !important;
+}
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexOLYwinBid/lexOLYwinBid.html b/force-app/main/default/lwc/lexOLYwinBid/lexOLYwinBid.html
new file mode 100644
index 0000000..cdbdc27
--- /dev/null
+++ b/force-app/main/default/lwc/lexOLYwinBid/lexOLYwinBid.html
@@ -0,0 +1,6 @@
+<template>
+    <div class="lexOLYwinBidHolder" if:true={IsLoading}>
+        <lightning-spinner alternative-text="Loading" size="medium"></lightning-spinner>
+        <lightning-button label="Show Toast" onclick={ShowToastEvent}></lightning-button>
+    </div>
+</template>
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexOLYwinBid/lexOLYwinBid.js b/force-app/main/default/lwc/lexOLYwinBid/lexOLYwinBid.js
new file mode 100644
index 0000000..3aa9239
--- /dev/null
+++ b/force-app/main/default/lwc/lexOLYwinBid/lexOLYwinBid.js
@@ -0,0 +1,97 @@
+/*
+ * @Description: 
+ * @version: 
+ * @Author: chen jing wu
+ * @Date: 2023-04-13 13:15:52
+ * @LastEditors: chen jing wu
+ * @LastEditTime: 2023-04-13 13:37:19
+ */
+import { api, wire,LightningElement } from 'lwc';
+import { CurrentPageReference } from "lightning/navigation";
+import { CloseActionScreenEvent } from 'lightning/actions';
+import { updateRecord } from 'lightning/uiRecordApi';
+import { ShowToastEvent } from 'lightning/platformShowToastEvent';
+import init  from '@salesforce/apex/OpportunityLightingButtonController.initForOLYwinBidButton';
+import updateForOLYwinBidButton  from '@salesforce/apex/OpportunityLightingButtonController.updateForOLYwinBidButton';
+import queryForOLYwinBidButton  from '@salesforce/apex/OpportunityLightingButtonController.queryForOLYwinBidButton';
+export default class LexOLYwinBid extends LightningElement {
+    @api recordId;
+    ifOpenBid;
+    IsLoading = true;
+    @wire(CurrentPageReference)
+    getStateParameters(currentPageReference) {
+            console.log(111);
+            console.log(currentPageReference);
+
+        if (currentPageReference) {
+          const urlValue = currentPageReference.state.recordId;
+          if (urlValue) {
+            let str = `${urlValue}`;
+            console.log("str");
+            console.log(str);
+            this.recordId = str;
+          }
+        }
+    }
+    connectedCallback(){
+        init({
+            recordId: this.recordId
+        }).then(result=>{
+            console.log(result);
+            this.ifOpenBid = result.ifOpenBid;
+            this.lexLoseBid();
+        }).catch(error=>{
+            console.log("error");
+            console.log(error);
+        })
+    }
+    lexLoseBid(){
+        console.log("query start");
+        queryForOLYwinBidButton({
+            recordId: this.recordId
+        }).then(result=>{
+            console.log("query end");
+            console.log(result);
+            var flag = true;
+            var taskslist = result;
+            for(var task of taskslist ){
+                if(task.taskStatus__c != '04 鍙栨秷'){
+                flag = false;
+            }
+            }
+            if(this.ifOpenBid == '闈炲叕寮�鎷涙爣'){
+                flag = false;
+            }
+    
+            if(flag){
+                this.showToast("鏉′欢涓嶇鍚堬紝涓嶅彲鎿嶄綔","error");
+            }else{
+                if (window.confirm('鏄惁纭OLY涓爣锛�')) {
+                    updateForOLYwinBidButton({
+                        recordId: this.recordId
+                    }).then(result=>{
+                        if (result) {
+                            this.showToast(result,"error");
+                        }else{
+                            this.IsLoading = false;
+                            this.updateRecordView(this.recordId);
+                            this.showToast("鎿嶄綔鎴愬姛锛�","success");
+                        }
+                    })  
+                }
+            }
+        });    
+    }
+    showToast(msg,type) {
+        const event = new ShowToastEvent({
+            title: '',
+            message: msg,
+            variant: type
+        });
+        this.dispatchEvent(event);
+        this.dispatchEvent(new CloseActionScreenEvent());
+    }
+    updateRecordView(recordId) {
+        updateRecord({fields: { Id: recordId }});
+    }
+}
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexOLYwinBid/lexOLYwinBid.js-meta.xml b/force-app/main/default/lwc/lexOLYwinBid/lexOLYwinBid.js-meta.xml
new file mode 100644
index 0000000..3392981
--- /dev/null
+++ b/force-app/main/default/lwc/lexOLYwinBid/lexOLYwinBid.js-meta.xml
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata">
+    <apiVersion>54.0</apiVersion>
+	<isExposed>true</isExposed>
+	<targets>
+		<target>lightning__RecordPage</target>
+		<target>lightning__AppPage</target>
+		<target>lightning__HomePage</target>
+		<target>lightning__RecordAction</target>
+	</targets>
+</LightningComponentBundle>
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexOPDtoSIS/lexOPDtoSIS.js b/force-app/main/default/lwc/lexOPDtoSIS/lexOPDtoSIS.js
index ef83f36..3d287d0 100644
--- a/force-app/main/default/lwc/lexOPDtoSIS/lexOPDtoSIS.js
+++ b/force-app/main/default/lwc/lexOPDtoSIS/lexOPDtoSIS.js
@@ -4,7 +4,7 @@
  * @Author: chen jing wu
  * @Date: 2023-04-07 09:02:03
  * @LastEditors: chen jing wu
- * @LastEditTime: 2023-04-11 09:10:06
+ * @LastEditTime: 2023-04-11 11:27:14
  */
 import { api, wire,LightningElement } from 'lwc';
 import { CurrentPageReference } from "lightning/navigation";
@@ -55,8 +55,6 @@
         }).catch(error => {
             console.log("error");
             console.log(error);
-        }).finally(() => {
-            
         });
 
     }
@@ -79,9 +77,13 @@
             updateForOPDtoSISButton({
                 recordId: this.recordId
             }).then(result =>{
-                this.updateRecordView(this.recordId);
-                this.showToast("鎴愬姛锛�","success");
-                this.IsLoading = false;
+                if(result){
+                    this.showToast(result,"error");
+                }else{
+                    this.updateRecordView(this.recordId);
+                    this.showToast("鎴愬姛锛�","success");
+                    this.IsLoading = false;
+                }
                 this.dispatchEvent(new CloseActionScreenEvent());
                 });
             } else {
diff --git a/force-app/main/default/lwc/lexOSHSubmit/lexOSHSubmit.js b/force-app/main/default/lwc/lexOSHSubmit/lexOSHSubmit.js
index 0e82f06..515ea3e 100644
--- a/force-app/main/default/lwc/lexOSHSubmit/lexOSHSubmit.js
+++ b/force-app/main/default/lwc/lexOSHSubmit/lexOSHSubmit.js
@@ -2,6 +2,7 @@
 import { CurrentPageReference } from "lightning/navigation";
 import { CloseActionScreenEvent } from 'lightning/actions';
 import { NavigationMixin } from 'lightning/navigation';
+import { ShowToastEvent } from 'lightning/platformShowToastEvent';
 import init  from '@salesforce/apex/QISReportController.initForOSHSubmitButton';
 import updateQis  from '@salesforce/apex/QISReportController.updateQis1';
 import UserInfo_Owner from '@salesforce/apex/TaskFeedbackController.UserInfo_Owner';
@@ -44,27 +45,59 @@
             console.log('this.OSHstaff='+this.OSHstaff);
             console.log('this.OSHstaffEmail='+this.OSHstaffEmail);
          	if (this.qisStatus=='OSH妫�娴嬬敵璇�' && this.qisStatus=='瀹屾瘯') {
-         		alert('闇�瑕佸厛鐐瑰嚮锛籓SH妫�鏌ュ彈鐞嗭冀'); 
-         		return;
+                const evt = new ShowToastEvent({
+                            title : '闇�瑕佸厛鐐瑰嚮锛籓SH妫�鏌ュ彈鐞嗭冀',
+                            message: '',
+                            variant: 'error'
+                        });
+                        this.dispatchEvent(evt);
+                        this.dispatchEvent(new CloseActionScreenEvent());
+                        return;
          	}
          	if (this.qisStatus!='OSH妫�娴嬩腑') {
-         		alert('宸茬粡鎻愪氦瀹℃壒');
-         		return;
+                const evt = new ShowToastEvent({
+                            title : '宸茬粡鎻愪氦瀹℃壒',
+                            message: '',
+                            variant: 'error'
+                        });
+                        this.dispatchEvent(evt);
+                        this.dispatchEvent(new CloseActionScreenEvent());
+                        return;
          	}
          	if (!confirm("涓�鏃︽彁浜ゆ璁板綍浠ュ緟鎵瑰噯锛屾牴鎹偍鐨勮缃偍鍙兘涓嶅啀鑳藉缂栬緫姝よ褰曟垨灏嗕粬浠庢壒鍑嗚繃绋嬩腑璋冨洖銆傛槸鍚︾户缁紵")) {
 				return;
 			}
 			if (this.OSHstaff==null||this.OSHstaffEmail==null) {
-				alert("OSH鎷呭綋蹇呴』濉啓");
-				return;
+                const evt = new ShowToastEvent({
+                            title : 'OSH鎷呭綋蹇呴』濉啓',
+                            message: '',
+                            variant: 'error'
+                        });
+                        this.dispatchEvent(evt);
+                        this.dispatchEvent(new CloseActionScreenEvent());
+                        return;
 			}
             try{
                 this.updateQisSubmit();
             }catch(err){
                 if(err.faultstring !=undefined && err.faultstring.indexOf('INVALID_SESSION_ID') != -1) {
-                    alert('褰撳墠缃戦〉宸茬櫥鍑猴紝璇锋偍閲嶆柊鐧诲綍鍚庡埛鏂拌缃戦〉锛�');
+                    const evt = new ShowToastEvent({
+                            title : '褰撳墠缃戦〉宸茬櫥鍑猴紝璇锋偍閲嶆柊鐧诲綍鍚庡埛鏂拌缃戦〉锛�',
+                            message: '',
+                            variant: 'error'
+                        });
+                        this.dispatchEvent(evt);
+                        this.dispatchEvent(new CloseActionScreenEvent());
+                        return;
                 } else {
-                    alert(err.faultstring);
+                    const evt = new ShowToastEvent({
+                            title : err.faultstring,
+                            message: '',
+                            variant: 'error'
+                        });
+                        this.dispatchEvent(evt);
+                        this.dispatchEvent(new CloseActionScreenEvent());
+                        return;
                 }
                 return;
             }
diff --git a/force-app/main/default/lwc/lexPredictedDateChange/__tests__/lexPredictedDateChange.test.js b/force-app/main/default/lwc/lexPredictedDateChange/__tests__/lexPredictedDateChange.test.js
new file mode 100644
index 0000000..db2a484
--- /dev/null
+++ b/force-app/main/default/lwc/lexPredictedDateChange/__tests__/lexPredictedDateChange.test.js
@@ -0,0 +1,25 @@
+import { createElement } from 'lwc';
+import LexPredictedDateChange from 'c/lexPredictedDateChange';
+
+describe('c-lex-predicted-date-change', () => {
+    afterEach(() => {
+        // The jsdom instance is shared across test cases in a single file so reset the DOM
+        while (document.body.firstChild) {
+            document.body.removeChild(document.body.firstChild);
+        }
+    });
+
+    it('TODO: test case generated by CLI command, please fill in test logic', () => {
+        // Arrange
+        const element = createElement('c-lex-predicted-date-change', {
+            is: LexPredictedDateChange
+        });
+
+        // Act
+        document.body.appendChild(element);
+
+        // Assert
+        // const div = element.shadowRoot.querySelector('div');
+        expect(1).toBe(1);
+    });
+});
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexPredictedDateChange/lexPredictedDateChange.css b/force-app/main/default/lwc/lexPredictedDateChange/lexPredictedDateChange.css
new file mode 100644
index 0000000..548c121
--- /dev/null
+++ b/force-app/main/default/lwc/lexPredictedDateChange/lexPredictedDateChange.css
@@ -0,0 +1,10 @@
+.predictedDateChangeHolder{
+    position: relative;
+    display: inline-block;
+    width: 80px;
+    height: 80px;
+    text-align: center;
+}
+.container .uiContainerManager{
+	display: none !important;
+}
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexPredictedDateChange/lexPredictedDateChange.html b/force-app/main/default/lwc/lexPredictedDateChange/lexPredictedDateChange.html
new file mode 100644
index 0000000..621521f
--- /dev/null
+++ b/force-app/main/default/lwc/lexPredictedDateChange/lexPredictedDateChange.html
@@ -0,0 +1,6 @@
+<template>
+    <div class="predictedDateChangeHolder" if:true={IsLoading}>
+        <lightning-spinner alternative-text="Loading" size="medium"></lightning-spinner>
+        <lightning-button label="Show Toast" onclick={ShowToastEvent}></lightning-button>
+    </div>
+</template>
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexPredictedDateChange/lexPredictedDateChange.js b/force-app/main/default/lwc/lexPredictedDateChange/lexPredictedDateChange.js
new file mode 100644
index 0000000..c121740
--- /dev/null
+++ b/force-app/main/default/lwc/lexPredictedDateChange/lexPredictedDateChange.js
@@ -0,0 +1,82 @@
+/*
+ * @Description: 
+ * @version: 
+ * @Author: chen jing wu
+ * @Date: 2023-04-12 10:46:24
+ * @LastEditors: chen jing wu
+ * @LastEditTime: 2023-04-12 13:48:26
+ */
+import { api, wire,LightningElement } from 'lwc';
+import { CurrentPageReference } from "lightning/navigation";
+import { CloseActionScreenEvent } from 'lightning/actions';
+import queryForPredictedDateChangeButton  from '@salesforce/apex/OpportunityLightingButtonController.queryForPredictedDateChangeButton';
+import init  from '@salesforce/apex/OpportunityLightingButtonController.initForPredictedDateChangeButton';
+import { updateRecord } from 'lightning/uiRecordApi';
+import { ShowToastEvent } from 'lightning/platformShowToastEvent';
+export default class LexPredictedDateChange extends LightningElement {
+    @api recordId;
+    IsLoading = true;
+    directLossFLG;
+    createdDay;
+    @wire(CurrentPageReference)
+    getStateParameters(currentPageReference) {
+            console.log(111);
+            console.log(currentPageReference);
+
+        if (currentPageReference) {
+          const urlValue = currentPageReference.state.recordId;
+          if (urlValue) {
+            let str = `${urlValue}`;
+            console.log("str");
+            console.log(str);
+            this.recordId = str;
+          }
+        }
+    }
+    showToast(msg,type) {
+      const event = new ShowToastEvent({
+          title: '',
+          message: msg,
+          variant: type
+      });
+      this.dispatchEvent(event);
+    }
+    updateRecordView(recordId) {
+      updateRecord({fields: { Id: recordId }});
+    }
+    connectedCallback(){
+      init({
+        recordId: this.recordId
+      }).then(result=>{
+        this.directLossFLG = result.directLossFLG;
+        this.createdDay = result.createdDay;
+        this.predictedDateChange();
+      }).catch(error=>{
+        console.log("error");
+        console.log(error);
+      })
+    }
+    predictedDateChange(){
+      // 20221206 ljh DB202212030068 start
+      var DirectLossFLG = this.directLossFLG;
+      var CreatedDay = this.createdDay;
+      var Day =  Date('2022-12-03');
+      if((DirectLossFLG == 'true' || DirectLossFLG == 1 ) && CreatedDay > Day){
+        this.showToast("浠庢嫑鏍囬」鐩偣鍑诲け鍗曟柊寤虹殑璇环锛岄娴婳CSM绛剧害鏃�(KPI)鍜岄娴嬪彂璐ф棩涓嶅厑璁镐慨鏀�","error");
+        return;
+      }
+      // 20221206 ljh DB202212030068 end
+      queryForPredictedDateChangeButton({
+        recordId: this.recordId
+      }).then(result=>{
+        var sqlResult = result;
+        if (sqlResult.size > 0) {
+          this.showToast("宸插瓨鍦ㄥ緟瀹℃壒鐨勫彉鏇寸敵璇凤紒","error");
+          return;
+        } else {
+          window.open('/apex/ImprovedForecastTime?id=' + this.recordId,'','height=500,width=800,top=200,left=250,location=no');
+          this.dispatchEvent(new CloseActionScreenEvent());
+        }
+      })
+    }
+}
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexPredictedDateChange/lexPredictedDateChange.js-meta.xml b/force-app/main/default/lwc/lexPredictedDateChange/lexPredictedDateChange.js-meta.xml
new file mode 100644
index 0000000..3392981
--- /dev/null
+++ b/force-app/main/default/lwc/lexPredictedDateChange/lexPredictedDateChange.js-meta.xml
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata">
+    <apiVersion>54.0</apiVersion>
+	<isExposed>true</isExposed>
+	<targets>
+		<target>lightning__RecordPage</target>
+		<target>lightning__AppPage</target>
+		<target>lightning__HomePage</target>
+		<target>lightning__RecordAction</target>
+	</targets>
+</LightningComponentBundle>
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexRCRecieved/lexRCRecieved.css b/force-app/main/default/lwc/lexRCRecieved/lexRCRecieved.css
new file mode 100644
index 0000000..635bc6c
--- /dev/null
+++ b/force-app/main/default/lwc/lexRCRecieved/lexRCRecieved.css
@@ -0,0 +1,22 @@
+.outerBorderCss{
+    border: 1px solid #D4D4D4;
+    border-radius : 5px;
+    border-top : 3px solid #565959;
+}
+.borderCss{
+    border: 1px solid #D4D4D4;
+    border-radius : 5px;
+    margin-bottom : 7px;
+    border-top : 3px solid #565959;
+}
+.headerDorderCss{
+    border-top: 1px solid #565959;
+    border-bottom: 1px solid #D4D4D4;
+    padding:3px;
+}
+.centerCss{
+    text-align: center;
+}
+.centerCss .left{
+    margin-left: 100px;
+}/* sample css file */
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexRCRecieved/lexRCRecieved.html b/force-app/main/default/lwc/lexRCRecieved/lexRCRecieved.html
new file mode 100644
index 0000000..49a10f7
--- /dev/null
+++ b/force-app/main/default/lwc/lexRCRecieved/lexRCRecieved.html
@@ -0,0 +1,5 @@
+<template>
+    <div class="sisToOPDHolder" if:true={IsLoading}>
+        <lightning-spinner alternative-text="Loading" size="medium"></lightning-spinner>
+    </div>
+</template>
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexRCRecieved/lexRCRecieved.js b/force-app/main/default/lwc/lexRCRecieved/lexRCRecieved.js
new file mode 100644
index 0000000..2afabee
--- /dev/null
+++ b/force-app/main/default/lwc/lexRCRecieved/lexRCRecieved.js
@@ -0,0 +1,103 @@
+import { LightningElement,wire,track,api} from 'lwc';
+import { CurrentPageReference } from "lightning/navigation";
+import { CloseActionScreenEvent } from 'lightning/actions';
+import { NavigationMixin } from 'lightning/navigation';
+import { ShowToastEvent } from 'lightning/platformShowToastEvent';
+import { updateRecord } from 'lightning/uiRecordApi';
+import init  from '@salesforce/apex/QISReportController.initForlexRCRecievedButton';
+import updateQis  from '@salesforce/apex/QISReportController.updateQisForRCRecieved';
+
+export default class lexRCRecieved extends LightningElement {
+	@api recordId;
+	err;
+	IsLoading = true;
+	qisReportId;
+	qisStatus;
+	isAEProfile;
+	isPAEProfile;
+	isCNBuy;
+	 @wire(CurrentPageReference)
+     getStateParameters(currentPageReference) {
+             console.log(111);
+             console.log(currentPageReference);
+
+         if (currentPageReference) {
+           const urlValue = currentPageReference.state.recordId;
+           if (urlValue) {
+             let str = `${urlValue}`;
+             console.log("str");
+             console.log(str);
+             this.recordId = str;
+           }
+         }
+     }
+
+     connectedCallback () {
+        init({
+            recordId: this.recordId
+        }).then(result => {
+            this.IsLoading = false;
+            this.qisReportId = result.Id;
+            this.qisStatus = result.qIStatus;
+            this.isAEProfile = result.isAEProfile;
+            this.isPAEProfile = result.isPAEProfile;
+            this.isCNBuy = result.isCNBuy;
+            console.log('this.qisStatus='+this.qisStatus);   
+         	if (this.qisStatus!='RC妫�娴嬬敵璇�') {
+                const evt = new ShowToastEvent({
+                        title : 'OCM鏈嶅姟鏈儴宸茬粡鏀跺埌瀹炵墿',
+                        message: '',
+                        variant: 'error'
+                    });
+                this.dispatchEvent(evt);
+                this.dispatchEvent(new CloseActionScreenEvent());
+                return;
+         	}else{
+         		if (this.isAEProfile == null || this.isPAEProfile == null || this.isCNBuy != 'true') {
+         			const evt = new ShowToastEvent({
+                        title : '瀹夊叏淇℃伅鏈垽瀹氾紝璇疯仈绯昏川閲忔硶瑙勯儴',
+                        message: '',
+                        variant: 'error'
+                    });
+	                this.dispatchEvent(evt);
+	                this.dispatchEvent(new CloseActionScreenEvent());
+	                return;
+         		}else{
+         			this.updateQisSubmit();
+         		}
+         	}
+        }).catch(error => {
+            console.log('error='+error);
+        }).finally(() => {
+            
+        }); 
+    }
+
+    updateRecordView(recordId) {
+        updateRecord({fields: { Id: recordId }});
+    }
+
+    updateQisSubmit(){
+        	updateQis({
+        		 recordId: this.recordId
+        		}).then(result =>{
+                    
+        			console.log('result'+result);
+        			this.err = result;
+        			if (result!='鎴愬姛') {
+                        const evt = new ShowToastEvent({
+                            title : '鏇存柊澶辫触',
+                            message: this.err,
+                            variant: 'error'
+                        });
+                        this.dispatchEvent(evt);
+                    }
+                this.dispatchEvent(new CloseActionScreenEvent());
+                this.updateRecordView(this.recordId);
+        		}).catch(error => {
+           				 console.log('error='+error);
+		        }).finally(() => {
+		            
+		        });
+    }
+}
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexRCRecieved/lexRCRecieved.js-meta.xml b/force-app/main/default/lwc/lexRCRecieved/lexRCRecieved.js-meta.xml
new file mode 100644
index 0000000..120b162
--- /dev/null
+++ b/force-app/main/default/lwc/lexRCRecieved/lexRCRecieved.js-meta.xml
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata" fqn="lexRCRecieved">
+   <apiVersion>54.0</apiVersion>
+    <isExposed>true</isExposed>
+    <targets>
+        <target>lightning__RecordPage</target>
+        <target>lightning__AppPage</target>
+        <target>lightning__HomePage</target>
+        <target>lightning__RecordAction</target>
+    </targets>
+</LightningComponentBundle>
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexRequestDB/__tests__/lexRequestDB.test.js b/force-app/main/default/lwc/lexRequestDB/__tests__/lexRequestDB.test.js
new file mode 100644
index 0000000..832098e
--- /dev/null
+++ b/force-app/main/default/lwc/lexRequestDB/__tests__/lexRequestDB.test.js
@@ -0,0 +1,25 @@
+import { createElement } from 'lwc';
+import LexRequestDB from 'c/lexRequestDB';
+
+describe('c-lex-request-db', () => {
+    afterEach(() => {
+        // The jsdom instance is shared across test cases in a single file so reset the DOM
+        while (document.body.firstChild) {
+            document.body.removeChild(document.body.firstChild);
+        }
+    });
+
+    it('TODO: test case generated by CLI command, please fill in test logic', () => {
+        // Arrange
+        const element = createElement('c-lex-request-db', {
+            is: LexRequestDB
+        });
+
+        // Act
+        document.body.appendChild(element);
+
+        // Assert
+        // const div = element.shadowRoot.querySelector('div');
+        expect(1).toBe(1);
+    });
+});
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexRequestDB/lexRequestDB.css b/force-app/main/default/lwc/lexRequestDB/lexRequestDB.css
new file mode 100644
index 0000000..a524923
--- /dev/null
+++ b/force-app/main/default/lwc/lexRequestDB/lexRequestDB.css
@@ -0,0 +1,10 @@
+.lexRequestDBHolder{
+    position: relative;
+    display: inline-block;
+    width: 80px;
+    height: 80px;
+    text-align: center;
+}
+.container .uiContainerManager{
+	display: none !important;
+}
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexRequestDB/lexRequestDB.html b/force-app/main/default/lwc/lexRequestDB/lexRequestDB.html
new file mode 100644
index 0000000..b4aff5b
--- /dev/null
+++ b/force-app/main/default/lwc/lexRequestDB/lexRequestDB.html
@@ -0,0 +1,6 @@
+<template>
+    <div class="lexRequestDBHolder" if:true={IsLoading}>
+        <lightning-spinner alternative-text="Loading" size="medium"></lightning-spinner>
+        <lightning-button label="Show Toast" onclick={ShowToastEvent}></lightning-button>
+    </div>
+</template>
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexRequestDB/lexRequestDB.js b/force-app/main/default/lwc/lexRequestDB/lexRequestDB.js
new file mode 100644
index 0000000..b3ddb3a
--- /dev/null
+++ b/force-app/main/default/lwc/lexRequestDB/lexRequestDB.js
@@ -0,0 +1,107 @@
+import { api, wire,LightningElement } from 'lwc';
+import { CurrentPageReference } from "lightning/navigation";
+import { CloseActionScreenEvent } from 'lightning/actions';
+import init  from '@salesforce/apex/OpportunityLightingButtonController.initForRequestDBButton';
+import { updateRecord } from 'lightning/uiRecordApi';
+import { ShowToastEvent } from 'lightning/platformShowToastEvent';
+
+export default class LexRequestDB extends LightningElement {
+    @api recordId;
+    stageName;
+    sapSendOK;
+    cntLostCancelReport;
+    cntLostCancelDraft;
+    agency1;
+    agency1Id;
+    name;
+    bidPlannedDate;
+    salesAssistantName;
+    salesAssistantID;
+    profileId;
+    @wire(CurrentPageReference)
+    getStateParameters(currentPageReference) {
+            console.log(111);
+            console.log(currentPageReference);
+
+        if (currentPageReference) {
+          const urlValue = currentPageReference.state.recordId;
+          if (urlValue) {
+            let str = `${urlValue}`;
+            console.log("str");
+            console.log(str);
+            this.recordId = str;
+          }
+        }
+    }
+    connectedCallback(){
+        init({
+            recordId: this.recordId
+        }).then(result=>{
+            this.stageName = result.stageName;
+            this.sapSendOK = result.sapSendOK;
+            this.cntLostCancelReport = result.cntLostCancelReport;
+            this.cntLostCancelDraft = result.cntLostCancelDraft;
+            this.agency1 = result.agency1;
+            this.agency1Id = result.agency1Id;
+            this.name = result.name;
+            this.bidPlannedDate = result.bidPlannedDate;
+            this.salesAssistantName = result.salesAssistantName;
+            this.salesAssistantID = result.salesAssistantID;
+            this.profileId = result.profileId;
+            this.requestDB();
+        })
+    }
+    requestDB(){
+        var profileId = this.profileId;
+        if (profileId != '00e10000000Y3o5' && profileId != '00e10000000xnp2' &&
+        profileId != '00e10000000xnpH') {
+            this.showToast("鎮ㄦ病鏈夋巿鏉冨鎵樼殑鏉冮檺銆傝鑱旂郴绯荤粺绠$悊鍛樸��","error");
+        }
+        // js銇牬鍚堛�佺炕瑷炽仌銈屻仧鍊ゃ亴銇с倠銇仹銆佽娉ㄦ剰
+        else if (this.stageName != '寮曞悎'
+        && this.stageName != '璇环'
+        ) {
+            this.showToast("鐘舵��1:" + this.stageName + "銆佷笉鑳藉仛鎺堟潈鐢宠锛�","");
+        }
+        else if (this.sapSendOK == '1') {
+            this.showToast("宸茬粡涓婁紶SAP銆佷笉鑳藉仛鎺堟潈鐢宠浜嗭紒","error");
+        }
+        else if (this.cntLostCancelReport - this.cntLostCancelDraft > 0) {
+            this.showToast("璇环宸茬粡鏈夊彇娑堬紡澶卞崟鎶ュ憡浜嗭紒","error");
+        }
+        else {
+        location.href = '/a2C/e?retURL=%2F' + 
+            encodeURI(this.recordId) +
+            '&RecordType=01210000000RNXi' +
+            '&CF00N10000006QdJz=' +
+            encodeURI(this.agency1) +
+            '&CF00N10000006QdJz_lkid=' +
+            encodeURI(this.agency1Id) +
+            '&CF00N10000006QdKn=' +
+            encodeURI(this.name) +
+            '&CF00N10000006QdKn_lkid=' +
+            encodeURI(this.recordId) +
+            '&00N10000006QdK4=' +
+            encodeURI(this.name) +
+            '&00N10000006QdYB=' +
+            encodeURI(this.bidPlannedDate) +
+            '&CF00N10000006QdZT=' +
+            encodeURI(this.salesAssistantName) +
+            '&CF00N10000006QdZT_lkid=' +
+            encodeURI(this.salesAssistantID) +
+            '';
+        };
+        this.dispatchEvent(new CloseActionScreenEvent());
+    }
+    showToast(msg,type) {
+      const event = new ShowToastEvent({
+          title: '',
+          message: msg,
+          variant: type
+      });
+      this.dispatchEvent(event);
+    }
+    updateRecordView(recordId) {
+      updateRecord({fields: { Id: recordId }});
+    }
+}
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexRequestDB/lexRequestDB.js-meta.xml b/force-app/main/default/lwc/lexRequestDB/lexRequestDB.js-meta.xml
new file mode 100644
index 0000000..3392981
--- /dev/null
+++ b/force-app/main/default/lwc/lexRequestDB/lexRequestDB.js-meta.xml
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata">
+    <apiVersion>54.0</apiVersion>
+	<isExposed>true</isExposed>
+	<targets>
+		<target>lightning__RecordPage</target>
+		<target>lightning__AppPage</target>
+		<target>lightning__HomePage</target>
+		<target>lightning__RecordAction</target>
+	</targets>
+</LightningComponentBundle>
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexSIStoOPD/lexSIStoOPD.js b/force-app/main/default/lwc/lexSIStoOPD/lexSIStoOPD.js
index 1996195..a44bcae 100644
--- a/force-app/main/default/lwc/lexSIStoOPD/lexSIStoOPD.js
+++ b/force-app/main/default/lwc/lexSIStoOPD/lexSIStoOPD.js
@@ -4,7 +4,7 @@
  * @Author: chen jing wu
  * @Date: 2023-04-07 09:02:03
  * @LastEditors: chen jing wu
- * @LastEditTime: 2023-04-11 09:10:42
+ * @LastEditTime: 2023-04-12 10:15:28
  */
 import { api, wire,LightningElement } from 'lwc';
 import { CurrentPageReference } from "lightning/navigation";
@@ -52,7 +52,6 @@
         }).catch(error => {
             console.log("error");
             console.log(error);
-        }).finally(() => {
         });
 
     }
@@ -86,6 +85,9 @@
                 this.IsLoading = false;
                 this.dispatchEvent(new CloseActionScreenEvent());
             });              
+    } else {
+        this.showToast("鍙崏妗堜腑鐘舵�佸強OPD/SIS鎶ュ憡涔︾殑鎵�鏈変汉鍙互鎻愪氦","error");
+        this.dispatchEvent(new CloseActionScreenEvent());
     }
     
 }
diff --git a/force-app/main/default/lwc/lexSendQIS/lexSendQIS.css b/force-app/main/default/lwc/lexSendQIS/lexSendQIS.css
new file mode 100644
index 0000000..635bc6c
--- /dev/null
+++ b/force-app/main/default/lwc/lexSendQIS/lexSendQIS.css
@@ -0,0 +1,22 @@
+.outerBorderCss{
+    border: 1px solid #D4D4D4;
+    border-radius : 5px;
+    border-top : 3px solid #565959;
+}
+.borderCss{
+    border: 1px solid #D4D4D4;
+    border-radius : 5px;
+    margin-bottom : 7px;
+    border-top : 3px solid #565959;
+}
+.headerDorderCss{
+    border-top: 1px solid #565959;
+    border-bottom: 1px solid #D4D4D4;
+    padding:3px;
+}
+.centerCss{
+    text-align: center;
+}
+.centerCss .left{
+    margin-left: 100px;
+}/* sample css file */
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexSendQIS/lexSendQIS.html b/force-app/main/default/lwc/lexSendQIS/lexSendQIS.html
new file mode 100644
index 0000000..c8bdbfc
--- /dev/null
+++ b/force-app/main/default/lwc/lexSendQIS/lexSendQIS.html
@@ -0,0 +1,5 @@
+<template>
+   <div class="sisToOPDHolder" if:true={IsLoading}>
+        <lightning-spinner alternative-text="Loading" size="medium"></lightning-spinner>
+    </div>
+</template>
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexSendQIS/lexSendQIS.js b/force-app/main/default/lwc/lexSendQIS/lexSendQIS.js
new file mode 100644
index 0000000..f1ca368
--- /dev/null
+++ b/force-app/main/default/lwc/lexSendQIS/lexSendQIS.js
@@ -0,0 +1,121 @@
+import { LightningElement,wire,track,api} from 'lwc';
+import { CurrentPageReference } from "lightning/navigation";
+import { CloseActionScreenEvent } from 'lightning/actions';
+import { NavigationMixin } from 'lightning/navigation';
+import { ShowToastEvent } from 'lightning/platformShowToastEvent';
+import init  from '@salesforce/apex/QISReportController.initForlexSendQISButton';
+import sendSPO  from '@salesforce/apex/QISReportController.updateQisForSendQIS';
+import UserInfo_Owner from '@salesforce/apex/TaskFeedbackController.UserInfo_Owner';
+import { updateRecord } from 'lightning/uiRecordApi';
+
+export default class lexSendQIS extends LightningElement {
+	@api recordId;
+    str;
+    err;
+    IsLoading = true;
+    qisReportId;
+    qisRecordTypeId;
+    qisRecordName;
+    ProfileName;
+    IsSendQIS;
+    @wire(CurrentPageReference)
+    getStateParameters(currentPageReference) {
+        if (currentPageReference) {
+            const urlValue = currentPageReference.state.recordId;
+            if (urlValue) {
+                let str = `${urlValue}`;
+                this.recordId = str;
+            }
+        }
+    }
+
+    connectedCallback() {
+        console.log(this.recordId);
+        init({
+            recordId: this.recordId
+        }).then(result => {
+            console.log(result);
+                this.IsLoading = false;
+                this.qisRecordTypeId = result.qisRecordTypeId;
+                this.qisReportId = result.Id;
+                this.qisRecordName = result.qisRecordName;
+                this.ProfileName = result.profileName;
+                this.IsSendQIS = result.isSendQIS;
+                if (this.qisRecordName == '2.OCSM') {
+                	const evt = new ShowToastEvent({
+                            title : '涓嶈兘鎻愪氦鍒癝PO',
+                            message: '璁板綍绫诲瀷涓�'+this.qisRecordName,
+                            variant: 'error'
+                        });
+                        this.dispatchEvent(evt);
+                        this.dispatchEvent(new CloseActionScreenEvent());
+                        return;
+                }
+
+                if (!(this.ProfileName == '绯荤粺绠$悊鍛�' || this.ProfileName == '2F4_鎶�鏈帹杩涢儴' || this.ProfileName == '2F1_鏈嶅姟绐楀彛')) {
+                	const evt = new ShowToastEvent({
+                            title : '娌℃湁鏉冮檺鎻愪氦锛岃鑱旂郴绯荤粺绠$悊鍛�',
+                            message: '',
+                            variant: 'error'
+                        });
+                        this.dispatchEvent(evt);
+                        this.dispatchEvent(new CloseActionScreenEvent());
+                        return;
+                }
+
+                if (this.IsSendQIS) {
+                	const evt = new ShowToastEvent({
+                            title : '宸叉彁浜ゅ埌SPO锛岃涓嶈閲嶅鎻愪氦',
+                            message: '',
+                            variant: 'error'
+                        });
+                        this.dispatchEvent(evt);
+                        this.dispatchEvent(new CloseActionScreenEvent());
+                        return;
+                }
+                this.send2SPO();
+        }).catch(error => {
+            console.log(error.getMessage());
+        }).finally(() => {
+
+        });
+    }
+    updateRecordView(recordId) {
+        updateRecord({fields: { Id: recordId }});
+    }
+
+    send2SPO(){
+        	sendSPO({
+        		 recordId: this.recordId
+        		}).then(result =>{
+        			console.log('result'+result);
+                     this.err = result;
+        			if (result!='鎴愬姛') {
+                        const evt = new ShowToastEvent({
+                            title : '鏇存柊澶辫触',
+                            message: this.err,
+                            variant: 'error'
+                        });
+                        this.dispatchEvent(evt);
+                        this.dispatchEvent(new CloseActionScreenEvent());
+                        return;
+                    }else{
+                    	const evt = new ShowToastEvent({
+                            title : '鎻愪氦鎴愬姛锛佽鍦⊿PO绯荤粺涓畬鎴愰��鎹㈣揣鐢宠',
+                            message: '',
+                            variant: 'success'
+                        });
+		                this.dispatchEvent(evt);   
+		                this.dispatchEvent(new CloseActionScreenEvent());
+		                this.updateRecordView(this.recordId);
+                        window.location.replace("https://olympus.sharepoint.cn/sites/GSPWF/SitePages/HomePage.aspx");
+                    }
+                
+        		}).catch(error => {
+            console.log('error='+error);
+        }).finally(() => {
+            
+        });
+    }
+
+}
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexSendQIS/lexSendQIS.js-meta.xml b/force-app/main/default/lwc/lexSendQIS/lexSendQIS.js-meta.xml
new file mode 100644
index 0000000..814503e
--- /dev/null
+++ b/force-app/main/default/lwc/lexSendQIS/lexSendQIS.js-meta.xml
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata" fqn="lexSendQIS">
+   <apiVersion>54.0</apiVersion>
+    <isExposed>true</isExposed>
+    <targets>
+        <target>lightning__RecordPage</target>
+        <target>lightning__AppPage</target>
+        <target>lightning__HomePage</target>
+        <target>lightning__RecordAction</target>
+    </targets>
+</LightningComponentBundle>
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexSubmit/lexSubmit.css b/force-app/main/default/lwc/lexSubmit/lexSubmit.css
new file mode 100644
index 0000000..4379b62
--- /dev/null
+++ b/force-app/main/default/lwc/lexSubmit/lexSubmit.css
@@ -0,0 +1,10 @@
+.submitHolder{
+    position: relative;
+    display: inline-block;
+    width: 80px;
+    height: 80px;
+    text-align: center;
+}
+.container .uiContainerManager{
+	display: none !important;
+}
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexSubmit/lexSubmit.html b/force-app/main/default/lwc/lexSubmit/lexSubmit.html
new file mode 100644
index 0000000..b494fe1
--- /dev/null
+++ b/force-app/main/default/lwc/lexSubmit/lexSubmit.html
@@ -0,0 +1,7 @@
+<template>
+    <div class="submitHolder" if:true={IsLoading}>
+        <lightning-spinner alternative-text="Loading" size="medium"></lightning-spinner>
+        <lightning-button label="Show Toast" onclick={ShowToastEvent}></lightning-button>
+
+    </div>
+</template>
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexSubmit/lexSubmit.js b/force-app/main/default/lwc/lexSubmit/lexSubmit.js
new file mode 100644
index 0000000..f282667
--- /dev/null
+++ b/force-app/main/default/lwc/lexSubmit/lexSubmit.js
@@ -0,0 +1,68 @@
+/*
+ * @Description: 
+ * @version: 
+ * @Author: chen jing wu
+ * @Date: 2023-04-11 16:46:48
+ * @LastEditors: chen jing wu
+ * @LastEditTime: 2023-04-11 16:48:05
+ */
+import { LightningElement,wire,track,api} from 'lwc';
+import { CurrentPageReference } from "lightning/navigation";
+import { CloseActionScreenEvent } from 'lightning/actions';
+import updateForSubmitButton  from '@salesforce/apex/ReportController.updateForSubmitButton';
+import { updateRecord } from 'lightning/uiRecordApi';
+import { ShowToastEvent } from 'lightning/platformShowToastEvent';
+export default class LexSubmit extends LightningElement {
+    @api recordId;
+    IsLoading = true;
+    @wire(CurrentPageReference)
+     getStateParameters(currentPageReference) {
+             console.log(111);
+             console.log(currentPageReference);
+
+         if (currentPageReference) {
+           const urlValue = currentPageReference.state.recordId;
+           if (urlValue) {
+             let str = `${urlValue}`;
+             console.log("str");
+             console.log(str);
+             this.recordId = str;
+           }
+         }
+     }
+
+     connectedCallback(){
+        this.submit();
+        
+     }
+
+
+     showToast(msg,type) {
+      const event = new ShowToastEvent({
+          title: '',
+          message: msg,
+          variant: type
+      });
+      this.dispatchEvent(event);
+    }
+
+
+     updateRecordView(recordId) {
+        updateRecord({fields: { Id: recordId }});
+    }
+
+     submit(){
+        updateForSubmitButton({
+          recordId: this.recordId
+        }).then(result=>{
+          if(result){
+            this.showToast(result,"error");
+          }else{
+            this.updateRecordView(this.recordId);
+            this.showToast("鎻愪氦鎴愬姛","success");
+          }
+          this.IsLoading = false;
+          this.dispatchEvent(new CloseActionScreenEvent());
+        });
+     }
+}
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexSubmit/lexSubmit.js-meta.xml b/force-app/main/default/lwc/lexSubmit/lexSubmit.js-meta.xml
new file mode 100644
index 0000000..329e839
--- /dev/null
+++ b/force-app/main/default/lwc/lexSubmit/lexSubmit.js-meta.xml
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata">
+    <apiVersion>54.0</apiVersion>
+    <isExposed>true</isExposed>
+    <targets>
+		<target>lightning__RecordPage</target>
+		<target>lightning__AppPage</target>
+		<target>lightning__HomePage</target>
+		<target>lightning__RecordAction</target>
+	</targets>
+</LightningComponentBundle>
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexSubmitCompetitorReport/lexSubmitCompetitorReport.js b/force-app/main/default/lwc/lexSubmitCompetitorReport/lexSubmitCompetitorReport.js
index 213dc1c..cff5fa6 100644
--- a/force-app/main/default/lwc/lexSubmitCompetitorReport/lexSubmitCompetitorReport.js
+++ b/force-app/main/default/lwc/lexSubmitCompetitorReport/lexSubmitCompetitorReport.js
@@ -4,7 +4,7 @@
  * @Author: chen jing wu
  * @Date: 2023-04-07 09:02:03
  * @LastEditors: chen jing wu
- * @LastEditTime: 2023-04-11 09:11:11
+ * @LastEditTime: 2023-04-11 11:28:51
  */
 import { LightningElement,wire,track,api} from 'lwc';
 import { CurrentPageReference } from "lightning/navigation";
@@ -61,9 +61,13 @@
       otherButtonInSubmitCompetitorReport({
         recordId: this.recordId
     }).then(result=>{
-      this.showToast("鎻愪氦瀵规墜绔炰簤鎶ュ憡鎴愬姛","success")
-      this.updateRecordView(this.recordId);
-      this.IsLoading = false;  
+      if(result){
+        this.showToast(result,"error");
+      }else{
+        this.showToast("鎻愪氦瀵规墜绔炰簤鎶ュ憡鎴愬姛","success")
+        this.updateRecordView(this.recordId);  
+      }
+      this.IsLoading = false;
       this.dispatchEvent(new CloseActionScreenEvent());
     });
     }
diff --git a/force-app/main/default/lwc/lexVOCAnswer/lexVOCAnswer.js b/force-app/main/default/lwc/lexVOCAnswer/lexVOCAnswer.js
index c4b9a85..99cc31c 100644
--- a/force-app/main/default/lwc/lexVOCAnswer/lexVOCAnswer.js
+++ b/force-app/main/default/lwc/lexVOCAnswer/lexVOCAnswer.js
@@ -4,7 +4,7 @@
  * @Author: chen jing wu
  * @Date: 2023-03-27 14:05:59
  * @LastEditors: chen jing wu
- * @LastEditTime: 2023-04-10 17:56:04
+ * @LastEditTime: 2023-04-11 11:30:45
  */
 import { LightningElement, wire, track, api } from "lwc";
 import { CurrentPageReference } from "lightning/navigation";
@@ -50,8 +50,7 @@
       .catch((error) => {
         console.log("error");
         console.log(error);
-      })
-      .finally(() => {});
+      });
     //window.location.replace("https://ocsm--partial.sandbox.lightning.force.com/lightning/r/Report__c/" + this.recordId + "/view");
   }
 
@@ -76,13 +75,12 @@
     updateForVOCAnswerButton({
       recordId: this.recordId
     }).then(result => {
-      if (result == null) {
-        this.showToast("鎴愬姛", "success");
-      } else {
-        console.log(result);
+      if (result) {
         this.showToast(result,"error");
+      } else {
+        this.showToast("鎴愬姛", "success");
+        this.updateRecordView(this.recordId);
       }
-      this.updateRecordView(this.recordId);
       this.Isloading = false;
       this.dispatchEvent(new CloseActionScreenEvent());
     }).catch(error=>{
diff --git a/force-app/main/default/lwc/lexVOCCheck/lexVOCCheck.js b/force-app/main/default/lwc/lexVOCCheck/lexVOCCheck.js
index 59e1cc3..edccdf5 100644
--- a/force-app/main/default/lwc/lexVOCCheck/lexVOCCheck.js
+++ b/force-app/main/default/lwc/lexVOCCheck/lexVOCCheck.js
@@ -52,8 +52,6 @@
         }).catch(error => {
             console.log("error");
             console.log(error);
-        }).finally(() => {
-            
         });
     }
 
@@ -95,11 +93,11 @@
                     personId:this.personId
                 }
             ).then(result =>{
-                if(result == null){
+                if(result){
+                    this.showToast(result,"error");
+                }else{
                     this.showToast("鎴愬姛","success");
                     this.updateRecordView(this.recordId);
-                }else {
-                    this.showToast(result,"error");
                 }
                 this.Isloading = false;   
                 this.dispatchEvent(new CloseActionScreenEvent());
diff --git a/force-app/main/default/lwc/lexVOCConfirm/lexVOCConfirm.js b/force-app/main/default/lwc/lexVOCConfirm/lexVOCConfirm.js
index b364850..1f3ffdf 100644
--- a/force-app/main/default/lwc/lexVOCConfirm/lexVOCConfirm.js
+++ b/force-app/main/default/lwc/lexVOCConfirm/lexVOCConfirm.js
@@ -4,7 +4,7 @@
  * @Author: chen jing wu
  * @Date: 2023-03-27 14:08:56
  * @LastEditors: chen jing wu
- * @LastEditTime: 2023-04-10 17:49:00
+ * @LastEditTime: 2023-04-11 11:33:01
  */
 import { LightningElement,wire,track,api} from 'lwc';
 import { CurrentPageReference } from "lightning/navigation";
@@ -56,11 +56,8 @@
         }).catch(error => {
             console.log("error");
             console.log(error);
-        }).finally(() => {
-            
         });
         //window.location.replace("https://ocsm--partial.sandbox.lightning.force.com/lightning/r/Report__c/" + this.recordId + "/view");
-        this.updateRecordView(this.recordId);
     }
 
     updateRecordView(recordId) {
@@ -93,8 +90,12 @@
             Satisfy: this.VOCSatisfy,
             Satisfy1: this.VOCSatisfy1    
         }).then(result=>{
-            this.updateRecordView(this.recordId);
-            this.showToast("鎴愬姛","success");
+            if(result){
+                this.showToast(result,"error");
+            }else{
+                this.updateRecordView(this.recordId);
+                this.showToast("鎴愬姛","success");
+            }
             this.Isloading = false;
             this.dispatchEvent(new CloseActionScreenEvent());
         });
diff --git a/force-app/main/default/lwc/lexVOCFinish/lexVOCFinish.js b/force-app/main/default/lwc/lexVOCFinish/lexVOCFinish.js
index 44d128d..edcb0f1 100644
--- a/force-app/main/default/lwc/lexVOCFinish/lexVOCFinish.js
+++ b/force-app/main/default/lwc/lexVOCFinish/lexVOCFinish.js
@@ -4,7 +4,7 @@
  * @Author: chen jing wu
  * @Date: 2023-03-27 14:11:17
  * @LastEditors: chen jing wu
- * @LastEditTime: 2023-04-10 17:52:00
+ * @LastEditTime: 2023-04-11 11:34:01
  */
 import { api, wire,LightningElement } from 'lwc';
 import { CurrentPageReference } from "lightning/navigation";
@@ -50,8 +50,6 @@
         }).catch(error => {
             console.log("error");
             console.log(error);
-        }).finally(() => {
-            
         });
         //window.location.replace("https://ocsm--partial.sandbox.lightning.force.com/lightning/r/Report__c/" + this.recordId + "/view");
         //this.updateRecordView(this.recordId);
@@ -85,8 +83,12 @@
             update({
                 recordId: this.recordId
             }).then(result =>{
-                this.showToast("鎴愬姛","success");
-                this.updateRecordView(this.recordId);
+                if(result){
+                    this.showToast(result,"error");
+                }else{
+                    this.showToast("鎴愬姛","success");
+                    this.updateRecordView(this.recordId);
+                }
                 this.IsLoading = false;
                 this.dispatchEvent(new CloseActionScreenEvent());
             });
diff --git a/force-app/main/default/lwc/lexVOCSubmit/lexVOCSubmit.js b/force-app/main/default/lwc/lexVOCSubmit/lexVOCSubmit.js
index 93f5e5f..62acb75 100644
--- a/force-app/main/default/lwc/lexVOCSubmit/lexVOCSubmit.js
+++ b/force-app/main/default/lwc/lexVOCSubmit/lexVOCSubmit.js
@@ -4,7 +4,7 @@
  * @Author: chen jing wu
  * @Date: 2023-03-27 13:39:23
  * @LastEditors: chen jing wu
- * @LastEditTime: 2023-04-10 17:57:16
+ * @LastEditTime: 2023-04-11 11:35:31
  */
 import { LightningElement,wire,track,api} from 'lwc';
 import { CurrentPageReference } from "lightning/navigation";
@@ -51,8 +51,6 @@
         }).catch(error => {
             console.log("error");
             console.log(error);
-        }).finally(() => {
-            
         });   
         //this.updateRecordView(this.recordId);
     }
@@ -80,8 +78,12 @@
                 recordId: this.recordId,
                 createdById: this.createdById
             }).then(result =>{
-                this.showToast("鎴愬姛","success");
-                this.updateRecordView(this.recordId);
+                if(result){
+                    this.showToast(result,"error");
+                }else{
+                    this.showToast("鎴愬姛","success");
+                    this.updateRecordView(this.recordId);
+                }
                 this.IsLoading = false;
                 this.dispatchEvent(new CloseActionScreenEvent());
             });

--
Gitblit v1.9.1