update
This commit is contained in:
@@ -58,13 +58,12 @@ import com.mgm.mcrm.common.jms.BookingControlMsgSender;
|
||||
import com.mgm.mcrm.common.services.MGMEsbApiService;
|
||||
import com.mgm.mcrm.common.utils.DateTimeUtil;
|
||||
import com.mgm.mcrm.common.utils.LogUtil;
|
||||
import com.mgm.mcrm.common.utils.SendEmail;
|
||||
import com.mgm.mcrm.logging.models.SysLogBooking;
|
||||
import com.mgm.mcrm.logging.repositories.SysLogBookingDao;
|
||||
import com.mgm.mcrm.logging.services.SysLogBookingService;
|
||||
import com.mgm.mcrm.notification.models.Email;
|
||||
import com.mgm.mcrm.notification.repositories.EmailDao;
|
||||
import com.mgm.mcrm.player.dtos.request.TodoChangeDateRequest;
|
||||
import com.mgm.mcrm.notification.services.SendEmailService;
|
||||
import com.mgm.mcrm.player.services.PlayerService;
|
||||
import jakarta.annotation.Resource;
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
@@ -149,6 +148,8 @@ public class ApprovalService {
|
||||
private NonMGMBookingService nonMGMBookingService;
|
||||
@Autowired
|
||||
private TeamStructureDao teamStructureDao;
|
||||
@Resource
|
||||
private SendEmailService sendEmailService;
|
||||
|
||||
public BaseApiResponse<List<CfgRequestReason>> getRequestReason() throws Exception {
|
||||
// 新建對象
|
||||
@@ -930,7 +931,7 @@ public class ApprovalService {
|
||||
email.setCreatedAt(creatdDate);
|
||||
email.setCreatedBy(originBooking.getCreatedBy());
|
||||
emailBook.setCategory("OTHER");
|
||||
email = SendEmail.sendApprovalNewEmail(emailBook, originBookingView,email,userId,userName,true,false,emailAddress.getKeyValues());
|
||||
email = sendEmailService.sendApprovalNewEmail(emailBook, originBookingView,email,userId,userName,true,false,emailAddress.getKeyValues());
|
||||
if(email.getStatus()==1) {
|
||||
originBooking.setApproveStatus("AA");
|
||||
bookingDao.save(originBooking);
|
||||
@@ -968,7 +969,7 @@ public class ApprovalService {
|
||||
email.setCreatedAt(creatdDate);
|
||||
email.setCreatedBy(originBooking.getCreatedBy());
|
||||
|
||||
email = SendEmail.sendApprovalNewEmail(emailBook, originBookingView,email,userId,userName,false,true,emailAddress.getKeyValues());
|
||||
email = sendEmailService.sendApprovalNewEmail(emailBook, originBookingView,email,userId,userName,false,true,emailAddress.getKeyValues());
|
||||
emailDao.save(email);
|
||||
}
|
||||
|
||||
@@ -988,7 +989,7 @@ public class ApprovalService {
|
||||
email.setCreatedAt(creatdDate);
|
||||
email.setCreatedBy(originBooking.getCreatedBy());
|
||||
|
||||
email = SendEmail.sendApprovalExtendEmail(emailBook, originBookingView,email,userId,userName,originBookingView,false,emailAddress.getKeyValues());
|
||||
email = sendEmailService.sendApprovalExtendEmail(emailBook, originBookingView,email,userId,userName,originBookingView,false,emailAddress.getKeyValues());
|
||||
LogUtil.info(ApprovalService.class,"Send Email Approved Id = "+originBooking.getId());
|
||||
if(email.getStatus()==1) {
|
||||
originBooking.setApproveStatus("AA");
|
||||
@@ -1003,33 +1004,24 @@ public class ApprovalService {
|
||||
response.setMessage("Send Email Failed");
|
||||
}
|
||||
}else if (Strings.CS.equals(properties.getCategory(),"DAYLIGHT")) {
|
||||
//调用daylight接口去Extend Booking
|
||||
BaseApiResponse<PlayerProfileEntry> findPlayerResult = playerService.findPlayerProfileByPlayerIdAndUserId(originBooking.getPlayerId(), userId);
|
||||
if(findPlayerResult.isSuccess()) {
|
||||
BaseApiResponse<PlayerProfileEntry> findPlayerResult = playerService
|
||||
.findPlayerProfileByPlayerIdAndUserId(originBooking.getPlayerId(), userId);
|
||||
if (!findPlayerResult.isSuccess() || findPlayerResult.getData() == null) {
|
||||
response.setSuccess(false);
|
||||
response.setCode("Player Profile Not Found");
|
||||
} else {
|
||||
BaseApiResponse<List<Bookings>> extendResult = bookingService.extendDaylightApprovalBooking(
|
||||
originBooking, findPlayerResult.getData(), userId, userName);
|
||||
if (extendResult.isSuccess()) {
|
||||
originBooking.setApproveStatus("AA");
|
||||
bookingDao.save(originBooking);
|
||||
}else{
|
||||
response.setSuccess(false);
|
||||
response.setCode("Player Profile Not Found");
|
||||
}
|
||||
//Directly send email when submit Approval Routing for daylight
|
||||
BookingsView originBookingView = bookingViewDao.findById(Long.parseLong(originBooking.getApprovalBookingId()));
|
||||
originBookingView = this.getEmailInfo(originBookingView,originBookingView.getCreatedBy()).getData();
|
||||
Email email = new Email();
|
||||
|
||||
email.setBookId(originBooking.getId());
|
||||
email.setCreatedAt(creatdDate);
|
||||
email.setCreatedBy(originBooking.getCreatedBy());
|
||||
|
||||
email = SendEmail.sendApprovalExtendEmail(originBooking, originBookingView,email,userId,userName,bookingView,isOtherOverBook,emailAddress.getKeyValues());
|
||||
if(email.getStatus()==1) {
|
||||
emailDao.save(email);
|
||||
response.setSuccess(true);
|
||||
response.setData(approvalMapper.toSubmitApprovalResponse(originBooking));
|
||||
}else{
|
||||
} else {
|
||||
response.setSuccess(false);
|
||||
response.setMessage("Send Email Failed");
|
||||
response.setLogMessage("Send Email Failed");
|
||||
response.setMessage(extendResult.getMessage());
|
||||
response.setLogMessage(extendResult.getLogMessage());
|
||||
}
|
||||
}
|
||||
}else{
|
||||
//send email instead of sync other booking
|
||||
@@ -1041,7 +1033,7 @@ public class ApprovalService {
|
||||
email.setCreatedAt(creatdDate);
|
||||
email.setCreatedBy(originBooking.getCreatedBy());
|
||||
|
||||
email = SendEmail.sendApprovalExtendEmail(originBooking, originBookingView,email,userId,userName,bookingView,isOtherOverBook,emailAddress.getKeyValues());
|
||||
email = sendEmailService.sendApprovalExtendEmail(originBooking, originBookingView,email,userId,userName,bookingView,isOtherOverBook,emailAddress.getKeyValues());
|
||||
if(email.getStatus()==1) {
|
||||
originBooking.setApproveStatus("AA");
|
||||
bookingDao.save(originBooking);
|
||||
@@ -1480,5 +1472,4 @@ public class ApprovalService {
|
||||
booking.setUpdatedAt(now);
|
||||
bookingDao.save(booking);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user