diff --git a/crm_mobile_runtime/appconfig.properties b/crm_mobile_runtime/appconfig.properties
index 2f2b56e..a5188ec 100644
--- a/crm_mobile_runtime/appconfig.properties
+++ b/crm_mobile_runtime/appconfig.properties
@@ -1,21 +1,23 @@
#ESB Setting
esb_app_id=mgmtestuser001
esb_app_secret=MGM@!666
-esb_server=https://mmesbdevapp14/api/crmapp/v1.0
+#esb_server=https://mmesbdevapp14/api/crmapp/v1.0
+esb_server=https://dlhcadev.mcmsapoc.com/api/esb/proxy
esb_request_timeout=30000
#OWS Setting
-ows_server=https://mgpmsdevows45
-ows_request_timeout=30000
+#ows_server=https://mgpmsdevows45
+ows_server=https://dlhcadev.mcmsapoc.com/api/opera/proxy
+ows_request_timeout=60000
#ESB Limo Setting
-esb_limo_server=https://mmesbdevapp14/api/limo/v1.0
+esb_limo_server=https://dlhcadev.mcmsapoc.com/api/esb_limo/v1.0
esb_limo_app_id=Limotest
esb_limo_app_key=Limotest123
#SMTP setting
-mail_port=25
-mail_smtp_host=smtp.aliyun.com
-mail_sender=linp168@aliyun.com
-mail_sender_password=linpeng060504
-mail_send_to=1441170195@qq.com;feng.cai@willtechmacau.com
\ No newline at end of file
+mail_port=587
+mail_smtp_host=smtp.qq.com
+mail_sender=201249946@qq.com
+mail_sender_password=oheejklduyydbife
+mail_send_to=mauve.chan@willtechmacau.com
\ No newline at end of file
diff --git a/crm_mobile_runtime/convert/bin/BookingService$1.class b/crm_mobile_runtime/convert/bin/BookingService$1.class
deleted file mode 100644
index 39d5a8b..0000000
Binary files a/crm_mobile_runtime/convert/bin/BookingService$1.class and /dev/null differ
diff --git a/crm_mobile_runtime/convert/bin/BookingService.class b/crm_mobile_runtime/convert/bin/BookingService.class
deleted file mode 100644
index abc5f29..0000000
Binary files a/crm_mobile_runtime/convert/bin/BookingService.class and /dev/null differ
diff --git a/pom.xml b/pom.xml
index 6714486..ee28e21 100644
--- a/pom.xml
+++ b/pom.xml
@@ -13,26 +13,80 @@
org.springframework.boot
spring-boot-starter-parent
- 3.5.13
+ 4.2.0-M1
- 21
- 1.5.25
- 6.3.1
- 2.21.2
- 10.1.54
- 6.2.18
+ UTF-8
+ 21
+ 4.2.18.Final
+ 5.6.4
+ 5.2.3
+ 5.4.3
+ 6.2.7
+ 2.22.3
+ 3.2.3
+ 2.26.1
+ ${java.version}
+ ${java.version}
+
+
+
+
+ io.netty
+ netty-bom
+ ${netty.version}
+ pom
+ import
+
+
+ org.apache.httpcomponents.core5
+ httpcore5-h2
+ ${httpcore5.version}
+
+
+ com.fasterxml.jackson
+ jackson-bom
+ ${fasterxml.jackson.version}
+ pom
+ import
+
+
+ tools.jackson
+ jackson-bom
+ ${tools.jackson.version}
+ pom
+ import
+
+
+
+
org.springframework.boot
spring-boot-starter
+
+
+ org.springframework.boot
+ spring-boot-starter-logging
+
+
org.springframework.boot
spring-boot-starter-web
+
+
+ org.springframework.boot
+ spring-boot-starter-logging
+
+
+
+
+ org.springframework.boot
+ spring-boot-starter-log4j2
org.springframework.boot
@@ -49,7 +103,7 @@
org.apache.activemq
activemq-client
- 6.2.4
+ ${activemq.version}
org.springframework.boot
@@ -59,6 +113,8 @@
org.springframework.boot
spring-boot-starter-aop
+ 4.0.0-M2
+ compile
org.springframework.boot
@@ -73,16 +129,16 @@
com.microsoft.sqlserver
mssql-jdbc
-
- org.apache.httpcomponents.client5
- httpclient5
- 5.5
-
-
- org.apache.httpcomponents.client5
- httpclient5-win
- 5.2.1
-
+
+ org.apache.httpcomponents.client5
+ httpclient5
+ ${httpclient5.version}
+
+
+ org.apache.httpcomponents.client5
+ httpclient5-win
+ ${httpclient5-win.version}
+
org.springframework.boot
spring-boot-starter-tomcat
@@ -130,11 +186,6 @@
commons-text
1.14.0
-
- org.jsoup
- jsoup
- 1.23.1
-
org.springframework.boot
spring-boot-devtools
diff --git a/src/main/java/com/mgm/mcrm/CRMMobileApplication.java b/src/main/java/com/mgm/mcrm/CRMMobileApplication.java
index 823b750..f3af859 100644
--- a/src/main/java/com/mgm/mcrm/CRMMobileApplication.java
+++ b/src/main/java/com/mgm/mcrm/CRMMobileApplication.java
@@ -2,8 +2,8 @@ package com.mgm.mcrm;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
-import org.springframework.boot.autoconfigure.domain.EntityScan;
-import org.springframework.boot.web.servlet.ServletComponentScan;
+import org.springframework.boot.persistence.autoconfigure.EntityScan;
+import org.springframework.boot.web.server.servlet.context.ServletComponentScan;
import org.springframework.cache.annotation.EnableCaching;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.jms.annotation.EnableJms;
@@ -16,11 +16,10 @@ import org.springframework.transaction.annotation.EnableTransactionManagement;
@ComponentScan(basePackages="com.mgm.mcrm")
@EntityScan(basePackages="com.mgm.mcrm")
@EnableTransactionManagement
-@ServletComponentScan
+@ServletComponentScan
@EnableScheduling
@EnableAsync
@EnableJms
-@EnableCaching
public class CRMMobileApplication{
public static void main( String[] args ) {
SpringApplication.run(CRMMobileApplication.class, args);
diff --git a/src/main/java/com/mgm/mcrm/adfs/controllers/SSORestProcessController.java b/src/main/java/com/mgm/mcrm/adfs/controllers/SSORestProcessController.java
index d3bf33c..705c8d3 100644
--- a/src/main/java/com/mgm/mcrm/adfs/controllers/SSORestProcessController.java
+++ b/src/main/java/com/mgm/mcrm/adfs/controllers/SSORestProcessController.java
@@ -86,9 +86,11 @@ public class SSORestProcessController {
private boolean checkValidUrl(String requestUrl){
boolean isValid = NetworkUtil.isValidURL(requestUrl);
- if(isValid){
- if(!requestUrl.startsWith(loginCallbackUrl)
+ if(isValid){
+ String callbackHost = loginCallbackUrl.replace("/sso_callback/login","");
+ if(!requestUrl.startsWith(callbackHost)
&& !requestUrl.startsWith(adfsHost)){
+ LogUtil.info(SSORestProcessController.class,"Failed validate of valid url["+callbackHost+"]["+adfsHost+"]");
isValid =false;
}
}
@@ -128,7 +130,21 @@ public class SSORestProcessController {
String paraRelying = StringUtils.isNotBlank(request.getParameter("relyingParty"))?request.getParameter("relyingParty"):relyingParty;
String authorizedUrl = adfsHost+ "/adfs/ls/IdpInitiatedSignOn.aspx?loginToRp="+paraRelying;
String requestClientId = request.getParameter("client_request_id");
- Map cookieValues = new HashMap();
+ Map cookieValues = new HashMap();String origin = request.getHeader("Origin");
+ LogUtil.info(SSORestProcessController.class,"URI:"+request.getRequestURI()+",Origin:"+origin);
+//
+// String origin = request.getHeader("Origin");
+ String sanitizedOrigin = NetworkUtil.sanitizeCRLF(origin);
+ if(SysCommon.isAllowOriginSource(sanitizedOrigin)) {
+ response.setHeader("Access-Control-Allow-Origin", NetworkUtil.sanitizeCRLF(sanitizedOrigin));
+ }else {
+ LogUtil.warn(SSORestProcessController.class, "Origin of ["+origin+"] is not allowed");
+ response.setHeader("Access-Control-Allow-Origin","");
+ //
+ String errorMessage = HtmlUtils.htmlEscape(("Origin of ["+origin+"] is not allowed"));
+ response.sendError(401, errorMessage);
+ }
+
if(StringUtils.isBlank(requestClientId)) {
requestClientId = UUID.randomUUID().toString();
}
@@ -182,6 +198,7 @@ public class SSORestProcessController {
String redirectUrl = loginCallbackUrl+"?";
redirectUrl+=("error="+URLEncoder.encode(errorCode,"UTF-8"));
redirectUrl+=("&errorMessage="+URLEncoder.encode(errorMessage,"UTF-8"));
+ response.setHeader("Origin","MGM_CRM_APP");
response.sendRedirect(redirectUrl);
}else {
CookieStore cookieStore = new BasicCookieStore();
@@ -242,7 +259,7 @@ public class SSORestProcessController {
for(String cookieKey:cookieKeys) {
try {
String cookieVal = cookieValues.get(cookieKey);
- LogUtil.info(SSORestProcessController.class,"Set Cookie ["+cookieKey+"]="+cookieVal);
+ //LogUtil.info(SSORestProcessController.class,"Set Cookie ["+cookieKey+"]="+cookieVal);
if(cookieSetting!=null && !cookieSetting.isEmpty()) {
Iterator cookieSetKeys = cookieSetting.keySet().iterator();
while(cookieSetKeys.hasNext()) {
@@ -253,7 +270,7 @@ public class SSORestProcessController {
cookieDomain="";
}
for(String cookiePath:cookiePaths) {
- BasicClientCookie cookie = new BasicClientCookie(cookieKey, cookieVal);
+ BasicClientCookie cookie = new BasicClientCookie(NetworkUtil.sanitizeCRLF(cookieKey), NetworkUtil.sanitizeCRLF(cookieVal));
try {
Date currentDate = new Date();
Date expiryDate = new Date(currentDate.getTime() + 1800 * 1000);
@@ -261,8 +278,8 @@ public class SSORestProcessController {
}catch(Exception ignored) {
}
- cookie.setPath(cookiePath);
- cookie.setDomain(cookieDomain);
+ cookie.setPath(NetworkUtil.sanitizeCRLF(cookiePath));
+ cookie.setDomain(NetworkUtil.sanitizeCRLF(cookieDomain));
cookie.setSecure(true);
cookie.setAttribute("httponly", "true");
cookieStore.addCookie(cookie);
@@ -363,7 +380,7 @@ public class SSORestProcessController {
extraHeaders.forEach((key, value) -> {
//LogUtil.info(SSORestProcessController.class,"Expend Header:"+key+" Value:"+value);
if(!"content-type".equalsIgnoreCase(key)){
- request.getHeaders().add(key, NetworkUtil.sanitizeHeaderValue(value));
+ request.getHeaders().add(key, NetworkUtil.sanitizeCRLF(value));
}
});
}
@@ -524,7 +541,7 @@ public class SSORestProcessController {
LogUtil.info(SSORestProcessController.class,"Read Response Body Failed:"+err.getMessage());
}
String responseBody = stringBuilder.toString();
- LogUtil.info(SSORestProcessController.class,"Response 200:["+responseBody+"]");
+ //LogUtil.info(SSORestProcessController.class,"Response 200:["+responseBody+"]");
responseBody = responseBody.replace("", "\n");
responseBody = responseBody.replace("//", "");
@@ -614,7 +631,7 @@ public class SSORestProcessController {
resHeaders.forEach((key, value) -> {
try {
//LogUtil.info(SSORestProcessController.class,"Res Header:"+key+" Value:"+value);
- response.setHeader(key, NetworkUtil.sanitizeHeaderValue(value));
+ response.setHeader(key, NetworkUtil.sanitizeCRLF(value));
}catch(Exception ignored) {
}
@@ -628,34 +645,36 @@ public class SSORestProcessController {
response.setHeader("Content-Length", Long.toString(contentLength));
StreamUtils.copy(outputData, response.getOutputStream());
}else if(Strings.CS.equals(nextStep, "Redirect")){
- String redirectUrl = nextUrl;
+ String redirectUrl = NetworkUtil.validateAndSanitizeUrl(nextUrl);
if(!checkValidUrl(redirectUrl)){
throw new Exception("Invalid redirect url:"+redirectUrl);
}
if(StringUtils.isBlank(response.getHeader("Location"))) {
LogUtil.info(SSORestProcessController.class,"Redirect location:"+redirectUrl);
- response.setHeader("Location", NetworkUtil.sanitizeHeaderValue(redirectUrl));
+ response.setHeader("Location", NetworkUtil.sanitizeCRLF(redirectUrl));
}
response.sendRedirect(redirectUrl);
}else {
String redirectUrl = callbackUrl+"?";
- redirectUrl+=("errorCode="+URLEncoder.encode(errorCode,"UTF-8"));
- redirectUrl+=("&errorMessage="+URLEncoder.encode(errorMessage,"UTF-8"));
+ redirectUrl+=("errorCode="+URLEncoder.encode(errorCode, StandardCharsets.UTF_8));
+ redirectUrl+=("&errorMessage="+URLEncoder.encode(errorMessage, StandardCharsets.UTF_8));
if(!checkValidUrl(redirectUrl)){
throw new Exception("Invalid redirect url:"+redirectUrl);
}
- response.setHeader("Location", NetworkUtil.sanitizeHeaderValue(redirectUrl));
+ String saintUrl = NetworkUtil.validateAndSanitizeUrl(redirectUrl);
+ response.setHeader("Location", NetworkUtil.sanitizeCRLF(saintUrl));
response.setHeader("Content-Length","0");
- LogUtil.info(SSORestProcessController.class,"Callback with ErrorCode:"+redirectUrl+" [errorMessage]:"+errorMessage);
- response.sendRedirect(redirectUrl);
+ LogUtil.info(SSORestProcessController.class,"Callback with ErrorCode:"+saintUrl+" [errorMessage]:"+errorMessage);
+ response.sendRedirect(saintUrl);
}
}else {
String redirectUrl = callbackUrl+"?errorCode=Invalid_Result&errorMessage=Invalid_Result";
if(!checkValidUrl(redirectUrl)){
throw new Exception("Invalid redirect url:"+redirectUrl);
}
- response.setHeader("Location", NetworkUtil.sanitizeHeaderValue(redirectUrl));
+ response.setHeader("Location", NetworkUtil.sanitizeCRLF(redirectUrl));
response.setHeader("Content-Length","0");
+ response.setHeader("Origin","MGM_CRM_APP");
response.sendRedirect(redirectUrl);
}
}
diff --git a/src/main/java/com/mgm/mcrm/approval/repositories/ApprovalRoutingDao.java b/src/main/java/com/mgm/mcrm/approval/repositories/ApprovalRoutingDao.java
index de04410..7788629 100644
--- a/src/main/java/com/mgm/mcrm/approval/repositories/ApprovalRoutingDao.java
+++ b/src/main/java/com/mgm/mcrm/approval/repositories/ApprovalRoutingDao.java
@@ -29,21 +29,9 @@ public interface ApprovalRoutingDao extends JpaRepository findByBookingStatus(String bookingStatus);
-
- Integer countByBookingStatus(String bookingStatus);
-
- Integer countByBookingStatusAndApproverId(String bookingStatus, String approverId);
CfgApprovalRouting getByBookingId(Long bookingId);
- List findByBookingStatusAndApproverId(String ap, String userId);
-
@Query(value = "select * from cfg_approval_routing where booking_status = 'AP' and approver_id like concat('%', ?1, '%')", nativeQuery = true)
List getApprovalList(String userId);
diff --git a/src/main/java/com/mgm/mcrm/approval/service/ApprovalService.java b/src/main/java/com/mgm/mcrm/approval/service/ApprovalService.java
index 6303f98..42903c7 100644
--- a/src/main/java/com/mgm/mcrm/approval/service/ApprovalService.java
+++ b/src/main/java/com/mgm/mcrm/approval/service/ApprovalService.java
@@ -50,11 +50,12 @@ import com.mgm.mcrm.common.dtos.BaseApiResponse;
import com.mgm.mcrm.common.dtos.EumnApprovalStatus;
import com.mgm.mcrm.common.dtos.http_util.HttpResponseResult;
import com.mgm.mcrm.common.dtos.mgm_api.ApprovalGamingDataResult;
+import com.mgm.mcrm.common.dtos.mgm_api.ApproverRecordResult;
import com.mgm.mcrm.common.dtos.mgm_api.ApproverResult;
import com.mgm.mcrm.common.dtos.mgm_api.PlayerProfileEntry;
import com.mgm.mcrm.common.dtos.mgm_api.UserInfoApiRecord;
import com.mgm.mcrm.common.jms.BookingControlMsgSender;
-import com.mgm.mcrm.common.services.MGMApiService;
+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;
@@ -63,6 +64,7 @@ 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.player.services.PlayerService;
import jakarta.annotation.Resource;
import jakarta.servlet.http.HttpServletRequest;
@@ -100,7 +102,7 @@ public class ApprovalService {
@Resource
private RequestReasonDao requestReasonDao;
@Resource
- private MGMApiService mgmApiService;
+ private MGMEsbApiService mgmEsbApiService;
@Resource
private PropertyDao propertyDao;
@Resource
@@ -188,9 +190,11 @@ public class ApprovalService {
}
try {
- HttpResponseResult httpResult = mgmApiService.invokeGetApprover(playerId,bookingType,propertyName,roomCategory,checkInDate,checkOutDate,userId);
+ HttpResponseResult httpResult = mgmEsbApiService.invokeGetApprover(playerId,bookingType,propertyName,roomCategory,checkInDate,checkOutDate,userId);
try {
+ JSONObject rawResult = JSONObject.parseObject(httpResult.getResponseContent());
ApproverResult resultObj = JSONObject.parseObject(httpResult.getResponseContent(), ApproverResult.class, Feature.SupportNonPublicField,Feature.IgnoreNotMatch);
+ fillApproverListFromRawJson(resultObj, rawResult);
if(Strings.CS.equals(resultObj.getStatusCode(), "OK")) {
if (resultObj.getRecords() != null && !resultObj.getRecords().isEmpty()) {
response.setSuccess(true);
@@ -222,11 +226,39 @@ public class ApprovalService {
return response;
}
+ private void fillApproverListFromRawJson(ApproverResult resultObj, JSONObject rawResult) {
+ if (resultObj == null || resultObj.getRecords() == null || rawResult == null) {
+ return;
+ }
+ JSONArray rawRecords = rawResult.getJSONArray("Records");
+ if (rawRecords == null) {
+ return;
+ }
+ List records = resultObj.getRecords();
+ int size = Math.min(records.size(), rawRecords.size());
+ for (int i = 0; i < size; i++) {
+ JSONObject rawRecord = rawRecords.getJSONObject(i);
+ if (rawRecord == null) {
+ continue;
+ }
+ records.get(i).setApproverList(rawRecord.get("ApproverList"));
+ }
+ }
+
public BaseApiResponse getApprovalData(String bookingId) throws Exception {
BaseApiResponse response = new BaseApiResponse<>();
- ApprovalGamingDataResult approvalGamingData = new ApprovalGamingDataResult();
+ ApprovalGamingDataResult approvalGamingData;
try {
- HttpResponseResult httpResult = mgmApiService.invokeGetApprovalData(bookingId);
+// String bookingCategory = bookingDao.findCategoryById(Long.valueOf(bookingId));
+
+// HttpResponseResult httpResult;
+// if ("DAYLIGHT".equalsIgnoreCase(bookingCategory)) {
+// httpResult = mgmApiService.invokeGetApprovalData(bookingId, 1);
+// } else {
+// httpResult = mgmApiService.invokeGetApprovalData(bookingId, 0);
+// }
+ HttpResponseResult httpResult = mgmEsbApiService.invokeGetApprovalData(bookingId, 1);
+
try {
approvalGamingData = JSONObject.parseObject(httpResult.getResponseContent(), ApprovalGamingDataResult.class, Feature.SupportNonPublicField,Feature.IgnoreNotMatch);
if(StringUtils.equalsIgnoreCase(approvalGamingData.getStatusCode(),"OK")) {
@@ -722,7 +754,7 @@ public class ApprovalService {
LogUtil.info(ApprovalService.class,"Submit Approval.UserId:"+userId);
//相同 处理approvalRouting记录 并调用 Call OWS createbooking
approvalRouting.setBookingStatus("AA");
- CfgApprovalRouting changeRecord = approvalRoutingDao.save(approvalRouting);
+ approvalRoutingDao.save(approvalRouting);
//处理Pending Approval Booking 记录
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
@@ -791,8 +823,14 @@ public class ApprovalService {
// 获取Property
CfgProperties properties = propertyDao.findById(originBooking.getPropertyId()).orElse(null);
- Boolean isOverBook = this.checkIsOverbook(bookingView.getRoomId(), bookingView.getCheckinDate(),
- bookingView.getCheckoutDate(), bookingView.getPropertyId(), bookingView.getBlockId());
+ Boolean isOverBook;
+ if ("DAYLIGHT".equalsIgnoreCase(bookingView.getPropertyCategory())) {
+ isOverBook = false;
+ } else {
+ isOverBook = this.checkIsOverbook(bookingView.getRoomId(), bookingView.getCheckinDate(),
+ bookingView.getCheckoutDate(), bookingView.getPropertyId(), bookingView.getBlockId());
+ }
+
Boolean isOtherOverBook = this.checkOtherIsOverbook(Math.toIntExact(originBooking.getRoomId()), originBooking.getCheckoutDate(),
originBooking.getCheckinDate(), originBooking.getPropertyId(), originBooking.getSegmentId());
@@ -812,6 +850,7 @@ public class ApprovalService {
// BookingsView 中 roomId/blockId 为 Long,Bookings 为 Integer,copyProperties 会跳过;View 无 bookingTypeId
newBooking.setApprovalBookingId(String.valueOf(originBooking.getId()));
+ newBooking.setCategory("OPERA");
if (originBookingView.getRoomId() != null) {
newBooking.setRoomId(originBookingView.getRoomId());
@@ -850,6 +889,7 @@ public class ApprovalService {
newBooking.setApprovalBookingId(String.valueOf(originBooking.getId()));
newBooking.setDateList(originBooking.getDateList());
newBooking.setMember(originBooking.getMember());
+ newBooking.setCategory("DAYLIGHT");
if (originBookingView.getRoomId() != null) {
newBooking.setRoomId(originBookingView.getRoomId());
@@ -889,6 +929,7 @@ public class ApprovalService {
email.setBookId(originBooking.getId());
email.setCreatedAt(creatdDate);
email.setCreatedBy(originBooking.getCreatedBy());
+ emailBook.setCategory("OTHER");
email = SendEmail.sendApprovalNewEmail(emailBook, originBookingView,email,userId,userName,true,false,emailAddress.getKeyValues());
if(email.getStatus()==1) {
originBooking.setApproveStatus("AA");
@@ -905,6 +946,7 @@ public class ApprovalService {
newBooking.setLastOperaStatus("PENDING");
newBooking.setApprovedBy(userName);
newBooking.setApprovedId(Long.valueOf(userId));
+ newBooking.setCategory("OTHER");
//获取other room status
CfgOtherRoomStatus roomStatus = roomStatusDao.findByStatusName("Pending");
if(roomStatus!=null) {
@@ -960,6 +1002,35 @@ public class ApprovalService {
response.setLogMessage("Send Email Failed");
response.setMessage("Send Email Failed");
}
+ }else if (Strings.CS.equals(properties.getCategory(),"DAYLIGHT")) {
+ //调用daylight接口去Extend Booking
+ BaseApiResponse findPlayerResult = playerService.findPlayerProfileByPlayerIdAndUserId(originBooking.getPlayerId(), userId);
+ if(findPlayerResult.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{
+ response.setSuccess(false);
+ response.setMessage("Send Email Failed");
+ response.setLogMessage("Send Email Failed");
+ }
}else{
//send email instead of sync other booking
BookingsView originBookingView = bookingViewDao.findById(Long.parseLong(originBooking.getApprovalBookingId()));
diff --git a/src/main/java/com/mgm/mcrm/appsetting/controllers/CfgSettingController.java b/src/main/java/com/mgm/mcrm/appsetting/controllers/CfgSettingController.java
index 837a3d4..d191477 100644
--- a/src/main/java/com/mgm/mcrm/appsetting/controllers/CfgSettingController.java
+++ b/src/main/java/com/mgm/mcrm/appsetting/controllers/CfgSettingController.java
@@ -12,6 +12,7 @@ import com.mgm.mcrm.common.utils.NetworkUtil;
import jakarta.annotation.Resource;
import jakarta.servlet.http.HttpServletRequest;
import org.springframework.http.HttpStatus;
+import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;
@@ -20,7 +21,6 @@ import java.util.List;
@RestController
-@CrossOrigin(origins = "*")
@RequestMapping("/api")
public class CfgSettingController {
private static final List PUBLIC_LOGIN_SETTING_KEYS = List.of("APP_MOCK_SSO", "APP_MOCK_TPD");
@@ -30,12 +30,12 @@ public class CfgSettingController {
@Resource
private SysSettingService sysSettingService;
- @PostMapping(value = "/app/setting/get_calendar_setting", produces = "application/json;charset=UTF-8")
+ @PostMapping(value = "/app/setting/get_calendar_setting", produces = "application/json;charset=UTF-8",consumes = MediaType.APPLICATION_JSON_VALUE)
public ResponseEntity>> getCalendarSetting() {
return ResponseEntity.ok(BaseApiResponse.ok("Get Setting Successed", settingService.getCalendarSetting()));
}
- @RequestMapping(value = "/web/setting/get_setting_by_key", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
+ @RequestMapping(value = "/web/setting/get_setting_by_key", method = RequestMethod.POST, produces = "application/json;charset=UTF-8",consumes = MediaType.APPLICATION_JSON_VALUE)
public ResponseEntity> getSettingByKey(HttpServletRequest request, @RequestBody CfgSettingQueryRequest params) throws Exception {
boolean isSuccess = false;
String processMessage="";
@@ -57,7 +57,7 @@ public class CfgSettingController {
return ResponseEntity.status(HttpStatus.OK).body(result);
}
- @PostMapping(value = "/web/setting/get_public_setting_by_key", produces = "application/json;charset=UTF-8")
+ @PostMapping(value = "/web/setting/get_public_setting_by_key", produces = "application/json;charset=UTF-8",consumes = MediaType.APPLICATION_JSON_VALUE)
public ResponseEntity> getPublicSettingByKey(HttpServletRequest request,
@RequestBody(required=false) CfgSettingQueryRequest params) throws Exception {
if (params == null || !"MACAU_STRING".equals(params.getKeyName())) {
@@ -66,7 +66,7 @@ public class CfgSettingController {
return getSettingByKey(request, params);
}
- @PostMapping(value = "/system/sys_setting/get_public_login_settings", produces = "application/json;charset=UTF-8")
+ @PostMapping(value = "/system/sys_setting/get_public_login_settings", produces = "application/json;charset=UTF-8",consumes = MediaType.APPLICATION_JSON_VALUE)
public ResponseEntity>> getPublicLoginSettings(HttpServletRequest request) {
boolean internalNetwork = NetworkUtil.isMatchInternal(NetworkUtil.getClientIpAddr(request));
List settings = new ArrayList<>();
@@ -80,7 +80,7 @@ public class CfgSettingController {
return ResponseEntity.ok(BaseApiResponse.ok("", settings));
}
- @RequestMapping(value = "/system/sys_setting/get", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
+ @RequestMapping(value = "/system/sys_setting/get", method = RequestMethod.POST, produces = "application/json;charset=UTF-8",consumes = MediaType.APPLICATION_JSON_VALUE)
public ResponseEntity> getSysSettingByKey(HttpServletRequest request, @RequestBody SysSettingQueryRequest queryFilter) {
BaseApiResponse result = new BaseApiResponse<>();
//--
@@ -99,7 +99,7 @@ public class CfgSettingController {
}
return ResponseEntity.status(HttpStatus.OK).body(result);
}
- @RequestMapping(value = "/system/sys_setting/get_list", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
+ @RequestMapping(value = "/system/sys_setting/get_list", method = RequestMethod.POST, produces = "application/json;charset=UTF-8",consumes = MediaType.APPLICATION_JSON_VALUE)
public ResponseEntity>> getSysSettings(HttpServletRequest request, @RequestBody(required=false) SysSettingQueryRequest queryFilter) {
boolean isSuccess = false;
String processMessage="";
diff --git a/src/main/java/com/mgm/mcrm/appsetting/controllers/ConfigController.java b/src/main/java/com/mgm/mcrm/appsetting/controllers/ConfigController.java
index 27e69fc..053ca40 100644
--- a/src/main/java/com/mgm/mcrm/appsetting/controllers/ConfigController.java
+++ b/src/main/java/com/mgm/mcrm/appsetting/controllers/ConfigController.java
@@ -16,6 +16,7 @@ import com.mgm.mcrm.common.utils.LogUtil;
import jakarta.annotation.Resource;
import jakarta.servlet.http.HttpServletRequest;
import org.springframework.http.HttpStatus;
+import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;
@@ -24,14 +25,13 @@ import java.util.List;
import java.util.Map;
@RestController
-@CrossOrigin(origins = "*")
@RequestMapping("/api")
public class ConfigController {
@Resource
private ConfigService configService;
- @RequestMapping(value = "/app/config/property_list", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
+ @RequestMapping(value = "/app/config/property_list", method = RequestMethod.POST, produces = "application/json;charset=UTF-8",consumes = MediaType.APPLICATION_JSON_VALUE)
public ResponseEntity>> queryCfgPropertys(HttpServletRequest request, @RequestBody(required=true) PropertyQueryRequest queryFilter) {
BaseApiResponse> processResult = new BaseApiResponse<>();
//--
@@ -42,7 +42,7 @@ public class ConfigController {
return ResponseEntity.status(HttpStatus.OK).body(processResult);
}
- @RequestMapping(value = "/app/config/room_list", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
+ @RequestMapping(value = "/app/config/room_list", method = RequestMethod.POST, produces = "application/json;charset=UTF-8",consumes = MediaType.APPLICATION_JSON_VALUE)
public ResponseEntity>> queryRoom(HttpServletRequest request, @RequestBody(required=true) RoomQueryRequest queryFilter) {
BaseApiResponse> processResult = new BaseApiResponse<>();
List listCfgRooms = configService.listRoom(queryFilter);
@@ -52,7 +52,7 @@ public class ConfigController {
return ResponseEntity.status(HttpStatus.OK).body(processResult);
}
- @RequestMapping(value = "/app/config/room_type_list", produces = "application/json;charset=UTF-8")
+ @RequestMapping(value = "/app/config/room_type_list", produces = "application/json;charset=UTF-8",consumes = MediaType.APPLICATION_JSON_VALUE)
public ResponseEntity>> queryRoomType(HttpServletRequest request,@RequestBody(required=true) RoomTypeQueryRequest queryFilter) {
BaseApiResponse> processResult = new BaseApiResponse<>();
//--
@@ -62,7 +62,7 @@ public class ConfigController {
return ResponseEntity.status(HttpStatus.OK).body(processResult);
}
- @RequestMapping(value = "/app/config/bed_type_list", produces = "application/json;charset=UTF-8")
+ @RequestMapping(value = "/app/config/bed_type_list", produces = "application/json;charset=UTF-8",consumes = MediaType.APPLICATION_JSON_VALUE)
public ResponseEntity>> queryBedType(HttpServletRequest request,@RequestBody(required=true) BedTypeQueryRequest queryFilter) {
BaseApiResponse> processResult = new BaseApiResponse<>();
//--
@@ -72,7 +72,7 @@ public class ConfigController {
return ResponseEntity.status(HttpStatus.OK).body(processResult);
}
- @RequestMapping(value = "/app/config/special_list", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
+ @RequestMapping(value = "/app/config/special_list", method = RequestMethod.POST, produces = "application/json;charset=UTF-8",consumes = MediaType.APPLICATION_JSON_VALUE)
public ResponseEntity>> queryCfgRoomFeatures(HttpServletRequest request, @RequestBody(required=true) RoomFeatureQueryRequest queryFilter) {
BaseApiResponse> processResult = new BaseApiResponse<>();
//--
@@ -82,7 +82,7 @@ public class ConfigController {
return ResponseEntity.status(HttpStatus.OK).body(processResult);
}
- @RequestMapping(value = "/app/config/criteria_list", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
+ @RequestMapping(value = "/app/config/criteria_list", method = RequestMethod.POST, produces = "application/json;charset=UTF-8",consumes = MediaType.APPLICATION_JSON_VALUE)
public ResponseEntity>> queryRoomCriteria(HttpServletRequest request, @RequestBody(required=true) RoomCriteriaQueryRequest queryParas) throws Exception {
BaseApiResponse