updated
This commit is contained in:
@@ -13,26 +13,81 @@
|
||||
<parent>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-parent</artifactId>
|
||||
<version>3.5.7</version>
|
||||
<version>4.2.0-M1</version>
|
||||
<relativePath />
|
||||
</parent>
|
||||
|
||||
<properties>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
<java.version>21</java.version>
|
||||
<maven.compiler.source>${java.version}</maven.compiler.source>
|
||||
<maven.compiler.target>${java.version}</maven.compiler.target>
|
||||
<java.version>21</java.version>
|
||||
<netty.version>4.2.18.Final</netty.version>
|
||||
<httpclient5.version>5.6.4</httpclient5.version>
|
||||
<httpclient5-win.version>5.2.3</httpclient5-win.version>
|
||||
<httpcore5.version>5.4.3</httpcore5.version>
|
||||
<activemq.version>6.2.7</activemq.version>
|
||||
<fasterxml.jackson.version>2.22.3</fasterxml.jackson.version>
|
||||
<tools.jackson.version>3.2.3</tools.jackson.version>
|
||||
<log4j2.version>2.26.1</log4j2.version>
|
||||
<maven.compiler.source>${java.version}</maven.compiler.source>
|
||||
<maven.compiler.target>${java.version}</maven.compiler.target>
|
||||
<activemq.version>6.3.1</activemq.version>
|
||||
</properties>
|
||||
|
||||
<dependencyManagement>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>io.netty</groupId>
|
||||
<artifactId>netty-bom</artifactId>
|
||||
<version>${netty.version}</version>
|
||||
<type>pom</type>
|
||||
<scope>import</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.httpcomponents.core5</groupId>
|
||||
<artifactId>httpcore5-h2</artifactId>
|
||||
<version>${httpcore5.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.fasterxml.jackson</groupId>
|
||||
<artifactId>jackson-bom</artifactId>
|
||||
<version>${fasterxml.jackson.version}</version>
|
||||
<type>pom</type>
|
||||
<scope>import</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>tools.jackson</groupId>
|
||||
<artifactId>jackson-bom</artifactId>
|
||||
<version>${tools.jackson.version}</version>
|
||||
<type>pom</type>
|
||||
<scope>import</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</dependencyManagement>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter</artifactId>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-logging</artifactId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-web</artifactId>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-logging</artifactId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-log4j2</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
@@ -54,6 +109,8 @@
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-aop</artifactId>
|
||||
<version>4.0.0-M2</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
@@ -63,11 +120,16 @@
|
||||
<groupId>com.microsoft.sqlserver</groupId>
|
||||
<artifactId>mssql-jdbc</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.httpcomponents.client5</groupId>
|
||||
<artifactId>httpclient5</artifactId>
|
||||
<version>5.5</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.httpcomponents.client5</groupId>
|
||||
<artifactId>httpclient5</artifactId>
|
||||
<version>${httpclient5.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.httpcomponents.client5</groupId>
|
||||
<artifactId>httpclient5-win</artifactId>
|
||||
<version>${httpclient5-win.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-tomcat</artifactId>
|
||||
@@ -146,7 +208,7 @@
|
||||
<dependency>
|
||||
<groupId>org.springdoc</groupId>
|
||||
<artifactId>springdoc-openapi-starter-webmvc-ui</artifactId>
|
||||
<version>2.8.11</version>
|
||||
<version>3.1.1</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.mapstruct</groupId>
|
||||
|
||||
@@ -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.data.jpa.repository.config.EnableJpaRepositories;
|
||||
import org.springframework.jms.annotation.EnableJms;
|
||||
import org.springframework.scheduling.annotation.EnableAsync;
|
||||
@@ -15,7 +15,7 @@ import org.springframework.transaction.annotation.EnableTransactionManagement;
|
||||
@EntityScan(basePackages="com.mgm.mcrm")
|
||||
@EnableJpaRepositories(basePackages= "com.mgm.mcrm")
|
||||
@EnableTransactionManagement
|
||||
@ServletComponentScan
|
||||
@ServletComponentScan
|
||||
@EnableScheduling
|
||||
@EnableAsync
|
||||
@EnableJms
|
||||
|
||||
@@ -23,6 +23,7 @@ import jakarta.servlet.http.HttpServletResponse;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.commons.lang3.Strings;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
@@ -44,7 +45,7 @@ public class PlayerController {
|
||||
@Resource
|
||||
private UserMapper userMapper;
|
||||
|
||||
@RequestMapping(value = "/web/user/lookup", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
|
||||
@RequestMapping(value = "/web/user/lookup", method = RequestMethod.POST, produces = "application/json;charset=UTF-8",consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||
public ResponseEntity<LookupUserResponse> lookupUser(HttpServletRequest request, HttpServletResponse response, @RequestBody LookupUserRequest params) throws Exception {
|
||||
LookupUserResponse result = new LookupUserResponse();
|
||||
String userId = params.getUserId();
|
||||
@@ -71,7 +72,7 @@ public class PlayerController {
|
||||
return ResponseEntity.status(HttpStatus.OK).body(result);
|
||||
}
|
||||
|
||||
@RequestMapping(value = "/web/player/lookup", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
|
||||
@RequestMapping(value = "/web/player/lookup", method = RequestMethod.POST, produces = "application/json;charset=UTF-8",consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||
public ResponseEntity<LookupPlayerResponse> lookupPlayer(HttpServletRequest request, HttpServletResponse response,
|
||||
@RequestBody LookupPlayerRequest params) throws Exception {
|
||||
LookupPlayerResponse result = new LookupPlayerResponse();
|
||||
@@ -104,7 +105,7 @@ public class PlayerController {
|
||||
return ResponseEntity.status(HttpStatus.OK).body(result);
|
||||
}
|
||||
|
||||
@RequestMapping(value = "/web/user/check_approver", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
|
||||
@RequestMapping(value = "/web/user/check_approver", method = RequestMethod.POST, produces = "application/json;charset=UTF-8",consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||
public AjaxResult checkApprover(HttpServletRequest request, HttpServletResponse response,
|
||||
@RequestBody Map<String,String> params) throws Exception {
|
||||
boolean isSuccess = false;
|
||||
@@ -138,7 +139,7 @@ public class PlayerController {
|
||||
return processResult;
|
||||
}
|
||||
|
||||
@RequestMapping(value = "/web/user/lookup_name", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
|
||||
@RequestMapping(value = "/web/user/lookup_name", method = RequestMethod.POST, produces = "application/json;charset=UTF-8",consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||
public AjaxResult findUserInfoByUserName(HttpServletRequest request, HttpServletResponse response,
|
||||
@RequestBody Map<String,String> params) throws Exception {
|
||||
boolean isSuccess = false;
|
||||
@@ -165,7 +166,7 @@ public class PlayerController {
|
||||
return processResult;
|
||||
}
|
||||
|
||||
@RequestMapping(value = "/web/mgm/check_second_tpd_by_playerId_room_dates", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
|
||||
@RequestMapping(value = "/web/mgm/check_second_tpd_by_playerId_room_dates", method = RequestMethod.POST, produces = "application/json;charset=UTF-8",consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||
public AjaxResult checkSecondRoomCriteria(HttpServletRequest request, HttpServletResponse response,
|
||||
@RequestBody(required=false) Map<String,Object> params) throws Exception {
|
||||
boolean isSuccess = false;
|
||||
@@ -209,7 +210,7 @@ public class PlayerController {
|
||||
return processResult;
|
||||
}
|
||||
|
||||
@RequestMapping(value = "/web/mgm/check_tpd_by_playerId_room_dates", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
|
||||
@RequestMapping(value = "/web/mgm/check_tpd_by_playerId_room_dates", method = RequestMethod.POST, produces = "application/json;charset=UTF-8",consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||
public AjaxResult checkFirstRoomCriteria(HttpServletRequest request, HttpServletResponse response,
|
||||
@RequestBody(required=false) Map<String,Object> params) throws Exception {
|
||||
boolean isSuccess = false;
|
||||
|
||||
@@ -7,6 +7,7 @@ import jakarta.annotation.Resource;
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMethod;
|
||||
@@ -25,7 +26,7 @@ public class SendEmailController {
|
||||
@Resource
|
||||
private SendEmailService emailService;
|
||||
|
||||
@RequestMapping(value = "/web/email_template/generate", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
|
||||
@RequestMapping(value = "/web/email_template/generate", method = RequestMethod.POST, produces = "application/json;charset=UTF-8",consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||
public AjaxResult generateEmailTemplates(HttpServletRequest request, HttpServletResponse response,
|
||||
@RequestBody JSONObject params) throws Exception {
|
||||
boolean isSuccess = false;
|
||||
@@ -46,7 +47,7 @@ public class SendEmailController {
|
||||
return processResult;
|
||||
}
|
||||
|
||||
@RequestMapping(value = "/web/email_template/send", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
|
||||
@RequestMapping(value = "/web/email_template/send", method = RequestMethod.POST, produces = "application/json;charset=UTF-8",consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||
public AjaxResult sendEmailTemplates(HttpServletRequest request, HttpServletResponse response,
|
||||
@RequestBody JSONObject params) throws Exception {
|
||||
boolean isSuccess = false;
|
||||
|
||||
@@ -22,6 +22,7 @@ import jakarta.annotation.Resource;
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMethod;
|
||||
@@ -49,7 +50,7 @@ public class SysGroupController {
|
||||
|
||||
@CheckPermission(routerId="00902",permissionCode="ADD")
|
||||
@OperationLog(eventCode="user_group_create")
|
||||
@RequestMapping(value = "/system/sys_group/create", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
|
||||
@RequestMapping(value = "/system/sys_group/create", method = RequestMethod.POST, produces = "application/json;charset=UTF-8",consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||
public AjaxResult createSysGroup(HttpServletRequest request, @RequestBody SysGroupCreateUpdateRequest sysGroupCreateUpdateRequest) {
|
||||
boolean isSuccess = false;
|
||||
String processMessage="";
|
||||
@@ -86,7 +87,7 @@ public class SysGroupController {
|
||||
|
||||
@CheckPermission(routerId="00902",permissionCode="MODIFY")
|
||||
@OperationLog(eventCode="user_group_update")
|
||||
@RequestMapping(value = "/system/sys_group/update", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
|
||||
@RequestMapping(value = "/system/sys_group/update", method = RequestMethod.POST, produces = "application/json;charset=UTF-8",consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||
public AjaxResult updateSysGroup(HttpServletRequest request, @RequestBody SysGroupCreateUpdateRequest sysGroupCreateUpdateRequest) {
|
||||
boolean isSuccess = false;
|
||||
String processMessage="";
|
||||
@@ -128,7 +129,7 @@ public class SysGroupController {
|
||||
}
|
||||
|
||||
@CheckPermission(routerId="00902",permissionCode="VIEW")
|
||||
@RequestMapping(value = "/system/sys_group/get", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
|
||||
@RequestMapping(value = "/system/sys_group/get", method = RequestMethod.POST, produces = "application/json;charset=UTF-8",consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||
public AjaxResult getSysGroupById(HttpServletRequest request, @RequestBody(required=false)SysGroupGetByIdRequest sysGroupGetByIdRequest) {
|
||||
boolean isSuccess = false;
|
||||
String processMessage="";
|
||||
@@ -159,7 +160,7 @@ public class SysGroupController {
|
||||
}
|
||||
|
||||
@CheckPermission(routerId="00902",permissionCode="VIEW")
|
||||
@RequestMapping(value = "/system/sys_group/get_view", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
|
||||
@RequestMapping(value = "/system/sys_group/get_view", method = RequestMethod.POST, produces = "application/json;charset=UTF-8",consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||
public AjaxResult getSysGroupViewById(HttpServletRequest request, @RequestBody(required=false)SysGroupGetByIdRequest sysGroupGetByIdRequest) {
|
||||
boolean isSuccess = false;
|
||||
String processMessage="";
|
||||
@@ -185,7 +186,7 @@ public class SysGroupController {
|
||||
|
||||
@CheckPermission(routerId="00902",permissionCode="MODIFY")
|
||||
@OperationLog(eventCode="user_group_disable")
|
||||
@RequestMapping(value = "/system/sys_group/disable", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
|
||||
@RequestMapping(value = "/system/sys_group/disable", method = RequestMethod.POST, produces = "application/json;charset=UTF-8",consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||
public AjaxResult disableSysGroup(HttpServletRequest request, @RequestBody SysGroup sysGroup) {
|
||||
boolean isSuccess = false;
|
||||
String processMessage="";
|
||||
@@ -205,7 +206,7 @@ public class SysGroupController {
|
||||
|
||||
@CheckPermission(routerId="00902",permissionCode="REMOVE")
|
||||
@OperationLog(eventCode="user_group_delete")
|
||||
@RequestMapping(value = "/system/sys_group/delete", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
|
||||
@RequestMapping(value = "/system/sys_group/delete", method = RequestMethod.POST, produces = "application/json;charset=UTF-8",consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||
public AjaxResult deleteSysGroup(@RequestBody SysGroupDeleteByIdRequest sysGroupDeleteByIdRequest) {
|
||||
boolean isSuccess = false;
|
||||
String processMessage="";
|
||||
@@ -224,7 +225,7 @@ public class SysGroupController {
|
||||
return processResult;
|
||||
}
|
||||
|
||||
@RequestMapping(value = "/system/sys_group/list", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
|
||||
@RequestMapping(value = "/system/sys_group/list", method = RequestMethod.POST, produces = "application/json;charset=UTF-8",consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||
public AjaxResult querySysGroupView(HttpServletRequest request, @RequestBody(required=false) Map<String,Object> queryParas) {
|
||||
QueryFilter queryFilter = (queryParas!=null?new QueryFilter(queryParas):new QueryFilter(request));
|
||||
boolean isSuccess = false;
|
||||
@@ -249,21 +250,21 @@ public class SysGroupController {
|
||||
}
|
||||
|
||||
@CheckPermission(routerId="00902",permissionCode="VIEW")
|
||||
@RequestMapping(value = "/system/sys_group/list_page", produces = "application/json;charset=UTF-8")
|
||||
@RequestMapping(value = "/system/sys_group/list_page", produces = "application/json;charset=UTF-8",consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||
public AjaxResult querySysGroupByPage(HttpServletRequest request, @RequestBody(required=false) SysGroupPageRequest sysGroupPageRequest) {
|
||||
return processPageRequest(sysGroupPageRequest);
|
||||
}
|
||||
|
||||
|
||||
@CheckPermission(routerId="00902",permissionCode="VIEW")
|
||||
@RequestMapping(value = "/system/sys_group/get_page", produces = "application/json;charset=UTF-8")
|
||||
@RequestMapping(value = "/system/sys_group/get_page", produces = "application/json;charset=UTF-8",consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||
public AjaxResult getSysGroupByPage(HttpServletRequest request, @RequestBody(required=false) SysGroupPageRequest sysGroupPageRequest) {
|
||||
return processPageRequest(sysGroupPageRequest);
|
||||
}
|
||||
|
||||
@CheckPermission(routerId="00902",permissionCode="ASSIGN")
|
||||
@OperationLog(eventCode="user_group_assign")
|
||||
@RequestMapping(value = "/system/sys_group/assign_user", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
|
||||
@RequestMapping(value = "/system/sys_group/assign_user", method = RequestMethod.POST, produces = "application/json;charset=UTF-8",consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||
public AjaxResult updateGroupUserAssign(HttpServletRequest request, @RequestBody AssignGroupUserObject assignGroupUserObject) {
|
||||
boolean isSuccess = false;
|
||||
String processMessage="";
|
||||
@@ -291,7 +292,7 @@ public class SysGroupController {
|
||||
return processResult;
|
||||
}
|
||||
|
||||
@RequestMapping(value = "/system/sys_group/list_permission_setting", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
|
||||
@RequestMapping(value = "/system/sys_group/list_permission_setting", method = RequestMethod.POST, produces = "application/json;charset=UTF-8",consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||
public AjaxResult queryGroupPermissionSetting(HttpServletRequest request, @RequestBody(required=false)SysGroupPermissionSettingRequest sysGroupPermissionSettingRequest) {
|
||||
boolean isSuccess = false;
|
||||
String processMessage="";
|
||||
@@ -326,7 +327,7 @@ public class SysGroupController {
|
||||
|
||||
@CheckPermission(routerId="00902",permissionCode="MODIFY")
|
||||
@OperationLog(eventCode="user_group_permisison")
|
||||
@RequestMapping(value = "/system/sys_group/assign_group_permission", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
|
||||
@RequestMapping(value = "/system/sys_group/assign_group_permission", method = RequestMethod.POST, produces = "application/json;charset=UTF-8",consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||
public AjaxResult assignGroupPermission(HttpServletRequest request, @RequestBody AssignGroupPermission assignGroupPermission) {
|
||||
boolean isSuccess = true;
|
||||
String processMessage="";
|
||||
@@ -360,7 +361,7 @@ public class SysGroupController {
|
||||
return processResult;
|
||||
}
|
||||
|
||||
@RequestMapping(value = "/system/sys_group/list_data_access_setting", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
|
||||
@RequestMapping(value = "/system/sys_group/list_data_access_setting", method = RequestMethod.POST, produces = "application/json;charset=UTF-8",consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||
public AjaxResult queryGroupAccessSetting(HttpServletRequest request, @RequestBody(required=false)SysGroupGetAccessSettingRequest sysGroupGetAccessSettingRequest) {
|
||||
boolean isSuccess = false;
|
||||
String processMessage="";
|
||||
@@ -391,7 +392,7 @@ public class SysGroupController {
|
||||
|
||||
@CheckPermission(routerId="00902",permissionCode="MODIFY")
|
||||
@OperationLog(eventCode="user_group_access_control")
|
||||
@RequestMapping(value = "/system/sys_group/save_data_access_setting", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
|
||||
@RequestMapping(value = "/system/sys_group/save_data_access_setting", method = RequestMethod.POST, produces = "application/json;charset=UTF-8",consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||
public AjaxResult saveGroupAccessControl(HttpServletRequest request, @RequestBody SysGroupSaveAccessSettingRequest sysGroupSaveAccessSettingRequest) {
|
||||
boolean isSuccess = true;
|
||||
String processMessage="";
|
||||
|
||||
@@ -22,6 +22,7 @@ import org.apache.commons.lang3.StringUtils;
|
||||
|
||||
import org.apache.commons.lang3.Strings;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMethod;
|
||||
@@ -40,7 +41,7 @@ public class SysServerStateController {
|
||||
private AppControlMsgSender ctrlMsgSender;
|
||||
private static final String TEXT_SPLIT_CHAR = ",";
|
||||
|
||||
@RequestMapping(value = "/get_server_state", method = RequestMethod.GET, produces = "application/json;charset=UTF-8")
|
||||
@RequestMapping(value = "/get_server_state", method = RequestMethod.GET, produces = "application/json;charset=UTF-8",consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||
public AjaxResult getServerStateInfo(HttpServletRequest request, HttpServletResponse response) {
|
||||
AjaxResult processResult = new AjaxResult();
|
||||
processResult.setSuccess(true);
|
||||
@@ -49,7 +50,7 @@ public class SysServerStateController {
|
||||
return processResult;
|
||||
}
|
||||
|
||||
@RequestMapping(value = "/update_app_config", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
|
||||
@RequestMapping(value = "/update_app_config", method = RequestMethod.POST, produces = "application/json;charset=UTF-8",consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||
public AjaxResult updateServerConfigItem(HttpServletRequest request, @RequestBody AppSettingMsgData updateRequest) {
|
||||
AjaxResult processResult = new AjaxResult();
|
||||
if(ctrlMsgSender!=null) {
|
||||
|
||||
@@ -19,6 +19,7 @@ import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import jakarta.annotation.Resource;
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMethod;
|
||||
@@ -45,7 +46,7 @@ public class SysUserController {
|
||||
|
||||
@CheckPermission(routerId="00901",permissionCode="ADD")
|
||||
@OperationLog(eventCode = "user_create")
|
||||
@RequestMapping(value = "/system/sys_user/create", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
|
||||
@RequestMapping(value = "/system/sys_user/create", method = RequestMethod.POST, produces = "application/json;charset=UTF-8",consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||
public AjaxResult createSysUser(HttpServletRequest request, @RequestBody SysUserCreateUpdateRequest sysUserCreateUpdateRequest) {
|
||||
boolean isSuccess = false;
|
||||
String processMessage="";
|
||||
@@ -79,7 +80,7 @@ public class SysUserController {
|
||||
|
||||
@CheckPermission(routerId="00901",permissionCode="MODIFY")
|
||||
@OperationLog(eventCode="user_update")
|
||||
@RequestMapping(value = "/system/sys_user/update", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
|
||||
@RequestMapping(value = "/system/sys_user/update", method = RequestMethod.POST, produces = "application/json;charset=UTF-8",consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||
public AjaxResult updateSysUser(HttpServletRequest request, @RequestBody SysUserCreateUpdateRequest sysUserCreateUpdateRequest) {
|
||||
boolean isSuccess = false;
|
||||
String processMessage="";
|
||||
@@ -116,7 +117,7 @@ public class SysUserController {
|
||||
}
|
||||
|
||||
@CheckPermission(routerId="00901",permissionCode="VIEW")
|
||||
@RequestMapping(value = "/system/sys_user/get", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
|
||||
@RequestMapping(value = "/system/sys_user/get", method = RequestMethod.POST, produces = "application/json;charset=UTF-8",consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||
public AjaxResult getSysUserById(HttpServletRequest request, @RequestBody(required=false)SysUserGetByIdRequest sysUserGetByIdRequest) {
|
||||
boolean isSuccess = false;
|
||||
String processMessage="";
|
||||
@@ -141,7 +142,7 @@ public class SysUserController {
|
||||
}
|
||||
|
||||
@CheckPermission(routerId="00901",permissionCode="VIEW")
|
||||
@RequestMapping(value = "/system/sys_user/get_view", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
|
||||
@RequestMapping(value = "/system/sys_user/get_view", method = RequestMethod.POST, produces = "application/json;charset=UTF-8",consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||
public AjaxResult getSysUserViewById(HttpServletRequest request, @RequestBody(required=false)SysUserGetByIdRequest sysUserGetByIdRequest) {
|
||||
boolean isSuccess = false;
|
||||
String processMessage="";
|
||||
@@ -167,7 +168,7 @@ public class SysUserController {
|
||||
|
||||
@CheckPermission(routerId="00901",permissionCode="MODIFY")
|
||||
@OperationLog(eventCode="user_status")
|
||||
@RequestMapping(value = "/system/sys_user/update_status", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
|
||||
@RequestMapping(value = "/system/sys_user/update_status", method = RequestMethod.POST, produces = "application/json;charset=UTF-8",consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||
public AjaxResult updateSysUserStatus(HttpServletRequest request, @RequestBody SysUserUpdateStatusRequest sysUserUpdateStatusRequest) {
|
||||
boolean isSuccess = false;
|
||||
String processMessage="";
|
||||
@@ -186,7 +187,7 @@ public class SysUserController {
|
||||
|
||||
@CheckPermission(routerId="00901",permissionCode="REMOVE")
|
||||
@OperationLog(eventCode="user_delete")
|
||||
@RequestMapping(value = "/system/sys_user/delete", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
|
||||
@RequestMapping(value = "/system/sys_user/delete", method = RequestMethod.POST, produces = "application/json;charset=UTF-8",consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||
public AjaxResult deleteSysUser(HttpServletRequest request, @RequestBody SysUser sysUser) {
|
||||
boolean isSuccess = false;
|
||||
String processMessage="";
|
||||
@@ -205,7 +206,7 @@ public class SysUserController {
|
||||
}
|
||||
|
||||
@CheckPermission(routerId="00901",permissionCode="VIEW")
|
||||
@RequestMapping(value = "/system/sys_user/list", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
|
||||
@RequestMapping(value = "/system/sys_user/list", method = RequestMethod.POST, produces = "application/json;charset=UTF-8",consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||
public AjaxResult querySysUserView(HttpServletRequest request, @RequestBody(required=false)SysUserPageRequest sysUserPageRequest) {
|
||||
boolean isSuccess = false;
|
||||
String processMessage="";
|
||||
@@ -229,7 +230,7 @@ public class SysUserController {
|
||||
}
|
||||
|
||||
@CheckPermission(routerId="00901",permissionCode="VIEW")
|
||||
@RequestMapping(value = "/system/sys_user/get_page", produces = "application/json;charset=UTF-8")
|
||||
@RequestMapping(value = "/system/sys_user/get_page", produces = "application/json;charset=UTF-8",consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||
public AjaxResult getSysUserByPage(HttpServletRequest request, @RequestBody(required=false)SysUserPageRequest sysUserPageRequest) {
|
||||
|
||||
boolean isSuccess = false;
|
||||
@@ -254,7 +255,7 @@ public class SysUserController {
|
||||
}
|
||||
|
||||
@CheckPermission(routerId="00901",permissionCode="VIEW")
|
||||
@RequestMapping(value = "/system/sys_user/get_group_user_list", produces = "application/json;charset=UTF-8")
|
||||
@RequestMapping(value = "/system/sys_user/get_group_user_list", produces = "application/json;charset=UTF-8",consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||
public AjaxResult getSysUserByGroupPage(HttpServletRequest request, @RequestBody(required=false)SysUserPageRequest sysUserPageRequest) {
|
||||
boolean isSuccess = false;
|
||||
String processMessage="";
|
||||
@@ -277,7 +278,7 @@ public class SysUserController {
|
||||
return processResult;
|
||||
}
|
||||
@CheckPermission(routerId="00901",permissionCode="VIEW")
|
||||
@RequestMapping(value = "/system/sys_user/get_unassign_user_list", produces = "application/json;charset=UTF-8")
|
||||
@RequestMapping(value = "/system/sys_user/get_unassign_user_list", produces = "application/json;charset=UTF-8",consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||
public AjaxResult getSysUserByNoGroupPage(HttpServletRequest request, @RequestBody(required=false)SysUserPageRequest sysUserPageRequest) {
|
||||
boolean isSuccess = false;
|
||||
String processMessage="";
|
||||
@@ -301,7 +302,7 @@ public class SysUserController {
|
||||
}
|
||||
|
||||
@CheckPermission(routerId="00901",permissionCode="VIEW")
|
||||
@RequestMapping(value = "/system/sys_user/get_group_user_status", produces = "application/json;charset=UTF-8")
|
||||
@RequestMapping(value = "/system/sys_user/get_group_user_status", produces = "application/json;charset=UTF-8",consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||
public AjaxResult getGroupUserStatus(HttpServletRequest request, @RequestBody(required=false)SysUserPageRequest sysUserPageRequest) {
|
||||
boolean isSuccess = false;
|
||||
String processMessage="";
|
||||
|
||||
@@ -1,11 +1,8 @@
|
||||
package com.mgm.mcrm.admin.services;
|
||||
|
||||
import java.time.Duration;
|
||||
import java.time.Instant;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
|
||||
import com.mgm.mcrm.admin.dtos.SysUserDto;
|
||||
import com.mgm.mcrm.admin.dtos.request.SysUserCreateUpdateRequest;
|
||||
@@ -20,7 +17,6 @@ import com.mgm.mcrm.admin.repositories.SysUserDao;
|
||||
import com.mgm.mcrm.admin.repositories.SysUserViewDao;
|
||||
import com.mgm.mcrm.appsetting.models.CfgSettings;
|
||||
import com.mgm.mcrm.appsetting.services.SettingService;
|
||||
import com.mgm.mcrm.authorization.models.Token;
|
||||
import com.mgm.mcrm.authorization.repositories.TokenDao;
|
||||
import com.mgm.mcrm.common.dtos.DataTableResult;
|
||||
import com.mgm.mcrm.common.dtos.QueryFilter;
|
||||
@@ -36,6 +32,7 @@ import jakarta.servlet.http.HttpServletRequest;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.commons.lang3.Strings;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.data.domain.Page;
|
||||
import org.springframework.data.domain.PageRequest;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
@@ -50,7 +47,6 @@ import com.mgm.mcrm.common.constants.SysCommon;
|
||||
import com.mgm.mcrm.common.constants.SysConstants;
|
||||
|
||||
import com.auth0.jwt.JWT;
|
||||
import com.auth0.jwt.algorithms.Algorithm;
|
||||
|
||||
@Service
|
||||
public class SysUserService {
|
||||
@@ -68,6 +64,9 @@ public class SysUserService {
|
||||
@Resource
|
||||
private TokenDao tokenDao;
|
||||
|
||||
@Value("${mcrm.admin.user-init-pwd}")
|
||||
private String userInitPassword;
|
||||
|
||||
private static final long accessTokenExpiration = 5;
|
||||
|
||||
public ServiceResult createSysUser(SysUserCreateUpdateRequest sysUserCreateUpdateRequest) {
|
||||
@@ -80,7 +79,7 @@ public class SysUserService {
|
||||
sysUserDto.setUpdatedAt(createDate);
|
||||
|
||||
SysUser sysUser = sysUserMapper.toSysUser(sysUserDto);
|
||||
sysUser.setPassword("8cffb494ef5ff3f74a571206e141d4fb84f833e431b98c8b3be43727c4cbddc1");
|
||||
sysUser.setPassword(userInitPassword);
|
||||
sysUser.setTryTimes(0);
|
||||
|
||||
sysUserDao.save(sysUser);
|
||||
|
||||
@@ -24,6 +24,7 @@ import jakarta.servlet.http.HttpServletRequest;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMethod;
|
||||
@@ -67,7 +68,7 @@ public class OtherAllotmentController {
|
||||
@CheckPermissions(routerIds = {"00328", "00528"}, permissionCodes = {"ADD"})
|
||||
@CheckPermission(routerId="00328",permissionCode="ADD")
|
||||
@OperationLog(actionName="Create Room Criteria", eventCode = "other_allotment_create")
|
||||
@RequestMapping(value = "/app/other_allotment/create", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
|
||||
@RequestMapping(value = "/app/other_allotment/create", method = RequestMethod.POST, produces = "application/json;charset=UTF-8",consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||
public AjaxResult createOtherAllotment(HttpServletRequest request, @RequestBody CfgOtherAllotment allotment) {
|
||||
boolean isSuccess = false;
|
||||
String processMessage="";
|
||||
@@ -101,7 +102,7 @@ public class OtherAllotmentController {
|
||||
@CheckPermissions(routerIds = {"00328", "00528"}, permissionCodes = {"MODIFY"})
|
||||
@CheckPermission(routerId="00328",permissionCode="MODIFY")
|
||||
@OperationLog(eventCode="other_allotment_update",actionName="Update Room Criteria")
|
||||
@RequestMapping(value = "/app/other_allotment/update", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
|
||||
@RequestMapping(value = "/app/other_allotment/update", method = RequestMethod.POST, produces = "application/json;charset=UTF-8",consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||
public AjaxResult updateOtherAllotment(HttpServletRequest request, @RequestBody CfgOtherAllotment allotment) {
|
||||
boolean isSuccess = false;
|
||||
String processMessage="";
|
||||
@@ -142,7 +143,7 @@ public class OtherAllotmentController {
|
||||
@CheckPermissions(routerIds = {"00328", "00528"}, permissionCodes = {"MODIFY"})
|
||||
@CheckPermission(routerId="00328",permissionCode="MODIFY")
|
||||
@OperationLog(eventCode="other_allotment_batch_update",actionName="Update Batch Room Criteria")
|
||||
@RequestMapping(value = "/app/other_allotment/batch_update", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
|
||||
@RequestMapping(value = "/app/other_allotment/batch_update", method = RequestMethod.POST, produces = "application/json;charset=UTF-8",consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||
public AjaxResult updateBatchOtherAllotment(HttpServletRequest request, @RequestBody Map<String,String> params ) {
|
||||
boolean isSuccess = false;
|
||||
String processMessage="";
|
||||
@@ -169,7 +170,7 @@ public class OtherAllotmentController {
|
||||
@CheckPermissions(routerIds = {"00328", "00528"}, permissionCodes = {"MODIFY"})
|
||||
@CheckPermission(routerId="00328",permissionCode="MODIFY")
|
||||
@OperationLog(eventCode="other_allotment_batch_update_channel",actionName="Update Batch Room Criteria App Channel")
|
||||
@RequestMapping(value = "/app/other_allotment/batch_channel_update", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
|
||||
@RequestMapping(value = "/app/other_allotment/batch_channel_update", method = RequestMethod.POST, produces = "application/json;charset=UTF-8",consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||
public AjaxResult updateBatchAppChannel(HttpServletRequest request, @RequestBody Map<String,String> params ) {
|
||||
boolean isSuccess = false;
|
||||
String processMessage="";
|
||||
@@ -197,7 +198,7 @@ public class OtherAllotmentController {
|
||||
|
||||
@CheckPermissions(routerIds = {"00328", "00528"}, permissionCodes = {"VIEW"})
|
||||
@CheckPermission(routerId="00328",permissionCode="VIEW")
|
||||
@RequestMapping(value = "/app/other_allotment/get", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
|
||||
@RequestMapping(value = "/app/other_allotment/get", method = RequestMethod.POST, produces = "application/json;charset=UTF-8",consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||
public AjaxResult getOtherAllotmentById(HttpServletRequest request, @RequestBody(required=false) Map<String,Object> queryParas) {
|
||||
boolean isSuccess = false;
|
||||
String processMessage="";
|
||||
@@ -224,7 +225,7 @@ public class OtherAllotmentController {
|
||||
|
||||
@CheckPermissions(routerIds = {"00328", "00528"}, permissionCodes = {"VIEW"})
|
||||
@CheckPermission(routerId="00328",permissionCode="VIEW")
|
||||
@RequestMapping(value = "/app/other_allotment/get_view", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
|
||||
@RequestMapping(value = "/app/other_allotment/get_view", method = RequestMethod.POST, produces = "application/json;charset=UTF-8",consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||
public AjaxResult getOtherAllotmentViewById(HttpServletRequest request, @RequestBody(required=false) Map<String,Object> queryParas) {
|
||||
boolean isSuccess = false;
|
||||
String processMessage="";
|
||||
@@ -252,7 +253,7 @@ public class OtherAllotmentController {
|
||||
@CheckPermissions(routerIds = {"00328", "00528"}, permissionCodes = {"REMOVE"})
|
||||
@CheckPermission(routerId="00328",permissionCode="REMOVE")
|
||||
@OperationLog(eventCode="other_allotment_delete",actionName="Delete Room Criteria")
|
||||
@RequestMapping(value = "/app/other_allotment/delete", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
|
||||
@RequestMapping(value = "/app/other_allotment/delete", method = RequestMethod.POST, produces = "application/json;charset=UTF-8",consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||
public AjaxResult deleteOtherAllotment(HttpServletRequest request, @RequestBody CfgOtherAllotment allotment) {
|
||||
boolean isSuccess = false;
|
||||
String processMessage="";
|
||||
@@ -272,7 +273,7 @@ public class OtherAllotmentController {
|
||||
|
||||
@CheckPermissions(routerIds = {"00328", "00528"}, permissionCodes = {"VIEW"})
|
||||
@CheckPermission(routerId="00328",permissionCode="VIEW")
|
||||
@RequestMapping(value = "/app/other_allotment/get_page", produces = "application/json;charset=UTF-8")
|
||||
@RequestMapping(value = "/app/other_allotment/get_page", produces = "application/json;charset=UTF-8",consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||
public AjaxResult getOtherAllotmentByPage(@RequestBody(required=false)OtherAllotmentDashboardGetDataRequest otherAllotmentDashboardGetDataRequest) {
|
||||
boolean isSuccess = false;
|
||||
String processMessage="";
|
||||
@@ -296,7 +297,7 @@ public class OtherAllotmentController {
|
||||
return processResult;
|
||||
}
|
||||
|
||||
@RequestMapping(value = "/app/other_allotment/list", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
|
||||
@RequestMapping(value = "/app/other_allotment/list", method = RequestMethod.POST, produces = "application/json;charset=UTF-8",consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||
public AjaxResult queryOtherAllotment(@RequestBody(required=false) OtherAllotmentDashboardGetDataRequest otherAllotmentDashboardGetDataRequest) {
|
||||
boolean isSuccess = false;
|
||||
String processMessage="";
|
||||
@@ -320,7 +321,7 @@ public class OtherAllotmentController {
|
||||
return processResult;
|
||||
}
|
||||
|
||||
@RequestMapping(value = "/app/other_allotment/calendar", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
|
||||
@RequestMapping(value = "/app/other_allotment/calendar", method = RequestMethod.POST, produces = "application/json;charset=UTF-8",consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||
public AjaxResult queryOtherAllotmentCalendar(HttpServletRequest request, @RequestBody(required=false) Map<String,String> queryParas) {
|
||||
boolean isSuccess = false;
|
||||
String processMessage="";
|
||||
@@ -344,7 +345,7 @@ public class OtherAllotmentController {
|
||||
return processResult;
|
||||
}
|
||||
|
||||
@RequestMapping(value = "/app/other_allotment/available_room", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
|
||||
@RequestMapping(value = "/app/other_allotment/available_room", method = RequestMethod.POST, produces = "application/json;charset=UTF-8",consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||
public AjaxResult queryOtherAllotmentAvailableRoom(HttpServletRequest request, @RequestBody(required=false) Map<String,Object> queryParas) {
|
||||
boolean isSuccess = false;
|
||||
String processMessage="";
|
||||
|
||||
+5
-4
@@ -19,6 +19,7 @@ import jakarta.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.commons.lang3.Strings;
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMethod;
|
||||
@@ -48,7 +49,7 @@ public class OtherAllotmentDashboardController {
|
||||
private OtherSegmentService segmentService;
|
||||
|
||||
@CheckPermission(routerId="00404",permissionCode="VIEW")
|
||||
@RequestMapping(value = "/app/other_allotment_dashboard/get_dashboard_column", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
|
||||
@RequestMapping(value = "/app/other_allotment_dashboard/get_dashboard_column", method = RequestMethod.POST, produces = "application/json;charset=UTF-8",consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||
public AjaxResult getAllotmentDashboardSegment(@RequestBody(required=false)OtherAllotmentDashboardGetDataRequest otherAllotmentDashboardGetDataRequest) {
|
||||
boolean isSuccess = false;
|
||||
String processMessage="";
|
||||
@@ -73,7 +74,7 @@ public class OtherAllotmentDashboardController {
|
||||
}
|
||||
|
||||
@CheckPermission(routerId="00404",permissionCode="VIEW")
|
||||
@RequestMapping(value = "/app/other_allotment_dashboard/get_dashboard_data", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
|
||||
@RequestMapping(value = "/app/other_allotment_dashboard/get_dashboard_data", method = RequestMethod.POST, produces = "application/json;charset=UTF-8",consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||
public AjaxResult getOtherAllotmentViewById(@RequestBody(required=false) OtherAllotmentDashboardGetDataRequest OtherAllotmentDashboardGetDataRequest) {
|
||||
boolean isSuccess = false;
|
||||
String processMessage="";
|
||||
@@ -99,8 +100,8 @@ public class OtherAllotmentDashboardController {
|
||||
|
||||
@CheckPermission(routerId="00404",permissionCode="EXPORT")
|
||||
@RequestMapping(value = "/app/other_allotment_dashboard/export_excel")
|
||||
public void exportExcel(HttpServletRequest request, HttpServletResponse response,@RequestBody(required=false) OtherAllotmentDashboardGetDataRequest otherAllotmentDashboardGetDataRequest) throws Exception {
|
||||
|
||||
public void exportExcel(HttpServletRequest request, HttpServletResponse response) throws Exception {
|
||||
OtherAllotmentDashboardGetDataRequest otherAllotmentDashboardGetDataRequest = (new QueryFilter(request)).convertToRequest(OtherAllotmentDashboardGetDataRequest.class);
|
||||
ExportDefine reportDef = ExcelUtils.getExportDefineByName("EXPORT_OTHER_DASHBOARD");
|
||||
if(reportDef!=null) {
|
||||
//--
|
||||
|
||||
@@ -24,6 +24,7 @@ import jakarta.servlet.http.HttpServletRequest;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMethod;
|
||||
@@ -56,7 +57,7 @@ public class RoomCriteriaController {
|
||||
|
||||
@CheckPermission(routerId="00314",permissionCode="ADD")
|
||||
@OperationLog(actionName="Create Room Criteria", eventCode = "criteria_create")
|
||||
@RequestMapping(value = "/app/criteria/create", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
|
||||
@RequestMapping(value = "/app/criteria/create", method = RequestMethod.POST, produces = "application/json;charset=UTF-8",consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||
public AjaxResult createRoomCriteria(HttpServletRequest request, @RequestBody CfgRoomCriteriaRequest criteria) {
|
||||
boolean isSuccess = false;
|
||||
String processMessage="";
|
||||
@@ -89,7 +90,7 @@ public class RoomCriteriaController {
|
||||
|
||||
@CheckPermission(routerId="00314",permissionCode="MODIFY")
|
||||
@OperationLog(eventCode="criteria_update",actionName="Update Room Criteria")
|
||||
@RequestMapping(value = "/app/criteria/update", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
|
||||
@RequestMapping(value = "/app/criteria/update", method = RequestMethod.POST, produces = "application/json;charset=UTF-8",consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||
public AjaxResult updateRoomCriteria(HttpServletRequest request, @RequestBody CfgRoomCriteriaRequest criteria) {
|
||||
boolean isSuccess = false;
|
||||
String processMessage="";
|
||||
@@ -129,7 +130,7 @@ public class RoomCriteriaController {
|
||||
|
||||
@CheckPermission(routerId="00314",permissionCode="MODIFY")
|
||||
@OperationLog(eventCode="criteria_batch_update",actionName="Update Batch Room Criteria")
|
||||
@RequestMapping(value = "/app/criteria/batch_update", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
|
||||
@RequestMapping(value = "/app/criteria/batch_update", method = RequestMethod.POST, produces = "application/json;charset=UTF-8",consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||
public AjaxResult updateBatchRoomCriteria(HttpServletRequest request, @RequestBody Map<String,String> params ) {
|
||||
boolean isSuccess = false;
|
||||
String processMessage="";
|
||||
@@ -155,7 +156,7 @@ public class RoomCriteriaController {
|
||||
|
||||
@CheckPermission(routerId="00314",permissionCode="MODIFY")
|
||||
@OperationLog(eventCode="criteria_batch_update_channel",actionName="Update Batch Room Criteria App Channel")
|
||||
@RequestMapping(value = "/app/criteria/batch_channel_update", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
|
||||
@RequestMapping(value = "/app/criteria/batch_channel_update", method = RequestMethod.POST, produces = "application/json;charset=UTF-8",consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||
public AjaxResult updateBatchAppChannel(HttpServletRequest request, @RequestBody Map<String,String> params ) {
|
||||
boolean isSuccess = false;
|
||||
String processMessage="";
|
||||
@@ -182,7 +183,7 @@ public class RoomCriteriaController {
|
||||
}
|
||||
|
||||
@CheckPermission(routerId="00314",permissionCode="VIEW")
|
||||
@RequestMapping(value = "/app/criteria/get", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
|
||||
@RequestMapping(value = "/app/criteria/get", method = RequestMethod.POST, produces = "application/json;charset=UTF-8",consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||
public AjaxResult getRoomCriteriaById(HttpServletRequest request, @RequestBody(required=false) Map<String,Object> queryParas) {
|
||||
boolean isSuccess = false;
|
||||
String processMessage="";
|
||||
@@ -208,7 +209,7 @@ public class RoomCriteriaController {
|
||||
}
|
||||
|
||||
@CheckPermission(routerId="00314",permissionCode="VIEW")
|
||||
@RequestMapping(value = "/app/criteria/get_view", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
|
||||
@RequestMapping(value = "/app/criteria/get_view", method = RequestMethod.POST, produces = "application/json;charset=UTF-8",consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||
public AjaxResult getRoomCriteriaViewById(HttpServletRequest request, @RequestBody(required=false) Map<String,Object> queryParas) {
|
||||
boolean isSuccess = false;
|
||||
String processMessage="";
|
||||
@@ -235,7 +236,7 @@ public class RoomCriteriaController {
|
||||
|
||||
@CheckPermission(routerId="00314",permissionCode="REMOVE")
|
||||
@OperationLog(eventCode="criteria_delete",actionName="Delete Room Criteria")
|
||||
@RequestMapping(value = "/app/criteria/delete", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
|
||||
@RequestMapping(value = "/app/criteria/delete", method = RequestMethod.POST, produces = "application/json;charset=UTF-8",consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||
public AjaxResult deleteRoomCriteria(HttpServletRequest request, @RequestBody CfgRoomCriterias criteria) {
|
||||
boolean isSuccess = false;
|
||||
String processMessage="";
|
||||
@@ -254,7 +255,7 @@ public class RoomCriteriaController {
|
||||
}
|
||||
|
||||
@CheckPermission(routerId="00314",permissionCode="VIEW")
|
||||
@RequestMapping(value = "/app/criteria/get_page", produces = "application/json;charset=UTF-8")
|
||||
@RequestMapping(value = "/app/criteria/get_page", produces = "application/json;charset=UTF-8",consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||
public AjaxResult getRoomCriteriaByPage(HttpServletRequest request,@RequestBody(required=true) QueryRoomCriteriaRequest queryFilter) {
|
||||
queryFilter.setSearchCategory("BOOKING");
|
||||
queryFilter.validatePageInfo();
|
||||
@@ -283,7 +284,7 @@ public class RoomCriteriaController {
|
||||
return processResult;
|
||||
}
|
||||
|
||||
@RequestMapping(value = "/app/criteria/list", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
|
||||
@RequestMapping(value = "/app/criteria/list", method = RequestMethod.POST, produces = "application/json;charset=UTF-8",consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||
public AjaxResult queryRoomCriteria(HttpServletRequest request, @RequestBody(required=true) QueryRoomCriteriaRequest queryFilter) {
|
||||
boolean isSuccess = false;
|
||||
String processMessage="";
|
||||
@@ -307,7 +308,7 @@ public class RoomCriteriaController {
|
||||
return processResult;
|
||||
}
|
||||
|
||||
@RequestMapping(value = "/app/criteria/calendar", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
|
||||
@RequestMapping(value = "/app/criteria/calendar", method = RequestMethod.POST, produces = "application/json;charset=UTF-8",consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||
public AjaxResult queryRoomCriteriaCalendar(@RequestBody(required=false) CheckCalendarRequest checkCalendarRequest) throws Exception {
|
||||
boolean isSuccess = false;
|
||||
String processMessage="";
|
||||
@@ -331,7 +332,7 @@ public class RoomCriteriaController {
|
||||
return processResult;
|
||||
}
|
||||
|
||||
@RequestMapping(value = "/app/criteria/availabe_room", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
|
||||
@RequestMapping(value = "/app/criteria/availabe_room", method = RequestMethod.POST, produces = "application/json;charset=UTF-8",consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||
public AjaxResult queryRoomCriteriaAvailableRoom(HttpServletRequest request, @RequestBody(required=false) Map<String,Object> queryParas) {
|
||||
boolean isSuccess = false;
|
||||
String processMessage="";
|
||||
|
||||
+13
-12
@@ -27,6 +27,7 @@ import jakarta.servlet.http.HttpServletResponse;
|
||||
import jakarta.validation.Valid;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
@@ -52,7 +53,7 @@ public class RoomCriteriaDaylightController {
|
||||
|
||||
@CheckPermission(routerId = "00514", permissionCode = "ADD")
|
||||
@OperationLog(actionName = "Create Room Criteria", eventCode = "criteria_create")
|
||||
@RequestMapping(value = "/app/criteria_daylight/create", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
|
||||
@RequestMapping(value = "/app/criteria_daylight/create", method = RequestMethod.POST, produces = "application/json;charset=UTF-8",consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||
public AjaxResult createRoomCriteria(HttpServletRequest request, @RequestBody CfgRoomCriteriaDaylightRequest requestData) {
|
||||
boolean isSuccess = false;
|
||||
String processMessage = "";
|
||||
@@ -80,7 +81,7 @@ public class RoomCriteriaDaylightController {
|
||||
|
||||
@CheckPermission(routerId = "00514", permissionCode = "MODIFY")
|
||||
@OperationLog(eventCode = "criteria_update", actionName = "Update Room Criteria")
|
||||
@RequestMapping(value = "/app/criteria_daylight/update", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
|
||||
@RequestMapping(value = "/app/criteria_daylight/update", method = RequestMethod.POST, produces = "application/json;charset=UTF-8",consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||
public AjaxResult updateRoomCriteria(HttpServletRequest request, @RequestBody CfgRoomCriteriaDaylightRequest requestData) {
|
||||
boolean isSuccess = false;
|
||||
String processMessage = "";
|
||||
@@ -114,7 +115,7 @@ public class RoomCriteriaDaylightController {
|
||||
|
||||
@CheckPermission(routerId = "00514", permissionCode = "MODIFY")
|
||||
@OperationLog(eventCode = "criteria_batch_update", actionName = "Update Batch Room Criteria")
|
||||
@RequestMapping(value = "/app/criteria_daylight/batch_update", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
|
||||
@RequestMapping(value = "/app/criteria_daylight/batch_update", method = RequestMethod.POST, produces = "application/json;charset=UTF-8",consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||
public AjaxResult updateBatchRoomCriteria(HttpServletRequest request, @RequestBody Map<String, String> params) {
|
||||
boolean isSuccess = false;
|
||||
String processMessage = "";
|
||||
@@ -140,7 +141,7 @@ public class RoomCriteriaDaylightController {
|
||||
|
||||
@CheckPermission(routerId = "00514", permissionCode = "MODIFY")
|
||||
@OperationLog(eventCode = "criteria_batch_update_channel", actionName = "Update Batch Room Criteria App Channel")
|
||||
@RequestMapping(value = "/app/criteria_daylight/batch_channel_update", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
|
||||
@RequestMapping(value = "/app/criteria_daylight/batch_channel_update", method = RequestMethod.POST, produces = "application/json;charset=UTF-8",consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||
public AjaxResult updateBatchAppChannel(HttpServletRequest request, @RequestBody Map<String, String> params) {
|
||||
boolean isSuccess = false;
|
||||
String processMessage = "";
|
||||
@@ -169,7 +170,7 @@ public class RoomCriteriaDaylightController {
|
||||
|
||||
@CheckPermission(routerId = "00514", permissionCode = "MODIFY")
|
||||
@OperationLog(eventCode = "criteria_sync_calendar", actionName = "Sync Daylight Allotment from API")
|
||||
@RequestMapping(value = "/app/criteria_daylight/sync_calendar", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
|
||||
@RequestMapping(value = "/app/criteria_daylight/sync_calendar", method = RequestMethod.POST, produces = "application/json;charset=UTF-8",consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||
public ResponseEntity<AjaxResult> syncDaylightAllotment(HttpServletRequest request,
|
||||
@RequestBody(required=true) @Valid SyncDaylightAllotmentRequest syncRequest) {
|
||||
AjaxResult processResult = criteriaDaylightService.syncCalendarAllotment(syncRequest);
|
||||
@@ -178,7 +179,7 @@ public class RoomCriteriaDaylightController {
|
||||
}
|
||||
|
||||
@CheckPermission(routerId = "00514", permissionCode = "VIEW")
|
||||
@RequestMapping(value = "/app/criteria_daylight/get", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
|
||||
@RequestMapping(value = "/app/criteria_daylight/get", method = RequestMethod.POST, produces = "application/json;charset=UTF-8",consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||
public AjaxResult getRoomCriteriaById(HttpServletRequest request, @RequestBody(required = false) Map<String, Object> queryParas) {
|
||||
boolean isSuccess = false;
|
||||
String processMessage = "";
|
||||
@@ -203,7 +204,7 @@ public class RoomCriteriaDaylightController {
|
||||
}
|
||||
|
||||
@CheckPermission(routerId = "00514", permissionCode = "VIEW")
|
||||
@RequestMapping(value = "/app/criteria_daylight/get_view", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
|
||||
@RequestMapping(value = "/app/criteria_daylight/get_view", method = RequestMethod.POST, produces = "application/json;charset=UTF-8",consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||
public AjaxResult getRoomCriteriaViewById(HttpServletRequest request, @RequestBody(required = false) Map<String, Object> queryParas) {
|
||||
boolean isSuccess = false;
|
||||
String processMessage = "";
|
||||
@@ -230,7 +231,7 @@ public class RoomCriteriaDaylightController {
|
||||
|
||||
@CheckPermission(routerId = "00514", permissionCode = "REMOVE")
|
||||
@OperationLog(eventCode = "criteria_delete", actionName = "Delete Room Criteria")
|
||||
@RequestMapping(value = "/app/criteria_daylight/delete", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
|
||||
@RequestMapping(value = "/app/criteria_daylight/delete", method = RequestMethod.POST, produces = "application/json;charset=UTF-8",consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||
public AjaxResult deleteRoomCriteria(HttpServletRequest request, @RequestBody CfgRoomCriteriasDaylight criteria) {
|
||||
boolean isSuccess = false;
|
||||
String processMessage = "";
|
||||
@@ -249,7 +250,7 @@ public class RoomCriteriaDaylightController {
|
||||
}
|
||||
|
||||
@CheckPermission(routerId = "00514", permissionCode = "VIEW")
|
||||
@RequestMapping(value = "/app/criteria_daylight/get_page", produces = "application/json;charset=UTF-8")
|
||||
@RequestMapping(value = "/app/criteria_daylight/get_page", produces = "application/json;charset=UTF-8",consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||
public AjaxResult getRoomCriteriaByPage(HttpServletRequest request, @RequestBody(required = true) QueryRoomCriteriaRequest queryFilter) {
|
||||
queryFilter.setSearchCategory("BOOKING");
|
||||
queryFilter.validatePageInfo();
|
||||
@@ -278,7 +279,7 @@ public class RoomCriteriaDaylightController {
|
||||
return processResult;
|
||||
}
|
||||
|
||||
@RequestMapping(value = "/app/criteria_daylight/list", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
|
||||
@RequestMapping(value = "/app/criteria_daylight/list", method = RequestMethod.POST, produces = "application/json;charset=UTF-8",consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||
public AjaxResult queryRoomCriteria(HttpServletRequest request, @RequestBody(required = true) QueryRoomCriteriaRequest queryFilter) {
|
||||
boolean isSuccess = false;
|
||||
String processMessage = "";
|
||||
@@ -302,7 +303,7 @@ public class RoomCriteriaDaylightController {
|
||||
return processResult;
|
||||
}
|
||||
|
||||
@RequestMapping(value = "/app/criteria_daylight/calendar", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
|
||||
@RequestMapping(value = "/app/criteria_daylight/calendar", method = RequestMethod.POST, produces = "application/json;charset=UTF-8",consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||
public AjaxResult queryRoomCriteriaCalendar(@RequestBody(required = false) CheckCalendarDaylightRequest checkCalendarRequest) throws Exception {
|
||||
boolean isSuccess = false;
|
||||
String processMessage = "";
|
||||
@@ -318,7 +319,7 @@ public class RoomCriteriaDaylightController {
|
||||
return processResult;
|
||||
}
|
||||
|
||||
@RequestMapping(value = "/app/criteria_daylight/available_room", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
|
||||
@RequestMapping(value = "/app/criteria_daylight/available_room", method = RequestMethod.POST, produces = "application/json;charset=UTF-8",consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||
public AjaxResult queryRoomCriteriaAvailableRoom(HttpServletRequest request, @RequestBody(required = false) Map<String, Object> queryParas) {
|
||||
boolean isSuccess = false;
|
||||
String processMessage = "";
|
||||
|
||||
+11
-10
@@ -30,6 +30,7 @@ import jakarta.servlet.http.HttpServletRequest;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMethod;
|
||||
@@ -66,7 +67,7 @@ public class RoomWaitlistCriteriaController {
|
||||
@CheckPermissions(routerIds = {"00324", "00524"}, permissionCodes = {"ADD"})
|
||||
@CheckPermission(routerId = "00324", permissionCode = "ADD")
|
||||
@OperationLog(actionName = "Create Waitlist Criteria", eventCode = "waitlist_criteria_create")
|
||||
@RequestMapping(value = "/app/waitlist_criteria/create", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
|
||||
@RequestMapping(value = "/app/waitlist_criteria/create", method = RequestMethod.POST, produces = "application/json;charset=UTF-8",consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||
public AjaxResult createRoomCriteria(HttpServletRequest request, @RequestBody CfgRoomCriteriaRequest criteria) {
|
||||
AjaxResult validateResult = validateData(criteria, new String[]{"lastLoginTime"}, new String[]{"lastLoginTime"});
|
||||
if (!validateResult.isSuccess()) {
|
||||
@@ -84,7 +85,7 @@ public class RoomWaitlistCriteriaController {
|
||||
@CheckPermissions(routerIds = {"00324", "00524"}, permissionCodes = {"MODIFY"})
|
||||
@CheckPermission(routerId = "00324", permissionCode = "MODIFY")
|
||||
@OperationLog(eventCode = "waitlist_criteria_update", actionName = "Update Waitlist Criteria")
|
||||
@RequestMapping(value = "/app/waitlist_criteria/update", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
|
||||
@RequestMapping(value = "/app/waitlist_criteria/update", method = RequestMethod.POST, produces = "application/json;charset=UTF-8",consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||
public AjaxResult updateRoomCriteria(HttpServletRequest request, @RequestBody CfgRoomCriteriaRequest criteria) {
|
||||
AjaxResult validateResult = validateData(criteria, new String[]{"lastLoginTime"}, new String[]{"lastLoginTime"});
|
||||
if (!validateResult.isSuccess()) {
|
||||
@@ -105,7 +106,7 @@ public class RoomWaitlistCriteriaController {
|
||||
@CheckPermissions(routerIds = {"00324", "00524"}, permissionCodes = {"MODIFY"})
|
||||
@CheckPermission(routerId = "00324", permissionCode = "MODIFY")
|
||||
@OperationLog(eventCode = "waitlist_criteria_batch_update", actionName = "Update Batch Waitlist Criteria")
|
||||
@RequestMapping(value = "/app/waitlist_criteria/batch_update", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
|
||||
@RequestMapping(value = "/app/waitlist_criteria/batch_update", method = RequestMethod.POST, produces = "application/json;charset=UTF-8",consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||
public AjaxResult updateBatchRoomCriteria(HttpServletRequest request, @RequestBody Map<String, String> params) {
|
||||
JSONArray criteria = JSONObject.parseArray(params.get("criteria"));
|
||||
Integer type = Integer.valueOf(String.valueOf(params.get("type")));
|
||||
@@ -120,7 +121,7 @@ public class RoomWaitlistCriteriaController {
|
||||
|
||||
@CheckPermissions(routerIds = {"00324", "00524"}, permissionCodes = {"VIEW"})
|
||||
@CheckPermission(routerId = "00324", permissionCode = "VIEW")
|
||||
@RequestMapping(value = "/app/waitlist_criteria/get", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
|
||||
@RequestMapping(value = "/app/waitlist_criteria/get", method = RequestMethod.POST, produces = "application/json;charset=UTF-8",consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||
public AjaxResult getRoomCriteriaById(HttpServletRequest request, @RequestBody(required = false) Map<String, Object> queryParas) {
|
||||
QueryFilter queryFilter = (queryParas != null ? new QueryFilter(queryParas) : new QueryFilter(request));
|
||||
CfgRoomCriteriaDto criteria = criteriaService.getRoomCriteriaById(queryFilter.getInt("searchId"));
|
||||
@@ -132,7 +133,7 @@ public class RoomWaitlistCriteriaController {
|
||||
|
||||
@CheckPermissions(routerIds = {"00324", "00524"}, permissionCodes = {"VIEW"})
|
||||
@CheckPermission(routerId = "00324", permissionCode = "VIEW")
|
||||
@RequestMapping(value = "/app/waitlist_criteria/get_view", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
|
||||
@RequestMapping(value = "/app/waitlist_criteria/get_view", method = RequestMethod.POST, produces = "application/json;charset=UTF-8",consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||
public AjaxResult getRoomCriteriaViewById(HttpServletRequest request, @RequestBody(required = false) Map<String, Object> queryParas) {
|
||||
QueryFilter queryFilter = (queryParas != null ? new QueryFilter(queryParas) : new QueryFilter(request));
|
||||
CfgRoomCriteriaViewDto criteria = criteriaService.getRoomCriteriaViewById(Long.valueOf(queryFilter.getInt("searchId")));
|
||||
@@ -145,7 +146,7 @@ public class RoomWaitlistCriteriaController {
|
||||
@CheckPermissions(routerIds = {"00324", "00524"}, permissionCodes = {"REMOVE"})
|
||||
@CheckPermission(routerId = "00324", permissionCode = "REMOVE")
|
||||
@OperationLog(eventCode = "waitlist_criteria_delete", actionName = "Delete Waitlist Criteria")
|
||||
@RequestMapping(value = "/app/waitlist_criteria/delete", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
|
||||
@RequestMapping(value = "/app/waitlist_criteria/delete", method = RequestMethod.POST, produces = "application/json;charset=UTF-8",consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||
public AjaxResult deleteRoomCriteria(HttpServletRequest request, @RequestBody CfgRoomCriteriaRequest criteria) {
|
||||
boolean isSuccess = criteriaService.deleteRoomCriteria(criteria);
|
||||
if (isSuccess) {
|
||||
@@ -156,7 +157,7 @@ public class RoomWaitlistCriteriaController {
|
||||
|
||||
@CheckPermissions(routerIds = {"00324", "00524"}, permissionCodes = {"VIEW"})
|
||||
@CheckPermission(routerId = "00324", permissionCode = "VIEW")
|
||||
@RequestMapping(value = "/app/waitlist_criteria/get_page", produces = "application/json;charset=UTF-8")
|
||||
@RequestMapping(value = "/app/waitlist_criteria/get_page", produces = "application/json;charset=UTF-8",consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||
public AjaxResult getRoomCriteriaByPage(HttpServletRequest request, @RequestBody(required = false) Map<String, Object> queryParas) {
|
||||
QueryFilter queryFilter = (queryParas != null ? new QueryFilter(queryParas) : new QueryFilter(request));
|
||||
QueryRoomCriteriaRequest requestFilter = queryFilter.convertToRequest(QueryRoomCriteriaRequest.class);
|
||||
@@ -169,7 +170,7 @@ public class RoomWaitlistCriteriaController {
|
||||
return roomWaitlistCriteriaResponseFactory.buildQuerySuccess(resultData);
|
||||
}
|
||||
|
||||
@RequestMapping(value = "/app/waitlist_criteria/list", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
|
||||
@RequestMapping(value = "/app/waitlist_criteria/list", method = RequestMethod.POST, produces = "application/json;charset=UTF-8",consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||
public AjaxResult queryRoomCriteria(HttpServletRequest request, @RequestBody(required = false) Map<String, Object> queryParas) {
|
||||
QueryFilter queryFilter = (queryParas != null ? new QueryFilter(queryParas) : new QueryFilter(request));
|
||||
QueryRoomCriteriaRequest requestFilter = queryFilter.convertToRequest(QueryRoomCriteriaRequest.class);
|
||||
@@ -178,7 +179,7 @@ public class RoomWaitlistCriteriaController {
|
||||
return roomWaitlistCriteriaResponseFactory.buildQuerySuccess(listCfgSourceCodes);
|
||||
}
|
||||
|
||||
@RequestMapping(value = "/app/waitlist_criteria/calendar", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
|
||||
@RequestMapping(value = "/app/waitlist_criteria/calendar", method = RequestMethod.POST, produces = "application/json;charset=UTF-8",consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||
public AjaxResult queryRoomCriteriaCalendar(HttpServletRequest request, @RequestBody(required = false) Map<String, String> queryParas) throws Exception {
|
||||
// queryParas.put("searchCategory", "WAIT_LIST");
|
||||
// Map<String, JSONObject> listCfgSourceCodes = criteriaService.listRoomCriteriaCalendar(queryParas);
|
||||
@@ -186,7 +187,7 @@ public class RoomWaitlistCriteriaController {
|
||||
return null;
|
||||
}
|
||||
|
||||
@RequestMapping(value = "/app/waitlist_criteria/availabe_room", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
|
||||
@RequestMapping(value = "/app/waitlist_criteria/availabe_room", method = RequestMethod.POST, produces = "application/json;charset=UTF-8",consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||
public AjaxResult queryRoomCriteriaAvailableRoom(HttpServletRequest request, @RequestBody(required = false) Map<String, Object> queryParas) {
|
||||
queryParas.put("searchCategory", "WAIT_LIST");
|
||||
HashSet listCfgSourceCodes = (HashSet) criteriaService.listRoomCriteriaAvailableRoom(queryParas);
|
||||
|
||||
@@ -139,7 +139,7 @@ public class OtherAllotmentService {
|
||||
segment.setAppChannel(0);
|
||||
}
|
||||
CfgOtherAppChannel channel = new CfgOtherAppChannel();
|
||||
CfgOtherAppChannel getChannel = otherAppChannelDao.findByAllotmentIdAndSegmentId(nc.getId(),Long.valueOf(segment.getId()));
|
||||
CfgOtherAppChannel getChannel = otherAppChannelDao.findByAllotmentIdAndSegmentId(nc.getId(), segment.getId());
|
||||
int pickUp = bookingDao.getOtherPickupBooking(nc.getPropertyId(), nc.getRoomId().intValue(), segment.getId(), nc.getBookDate(), roomStatusId);
|
||||
if(getChannel!=null) {
|
||||
getChannel.setAppChannel(segment.getAppChannel());
|
||||
@@ -148,7 +148,7 @@ public class OtherAllotmentService {
|
||||
channelLsit.add(getChannel);
|
||||
}else {
|
||||
channel.setAllotmentId(nc.getId());
|
||||
channel.setSegmentId(Long.valueOf(segment.getId()));
|
||||
channel.setSegmentId(segment.getId());
|
||||
channel.setAppChannel(segment.getAppChannel());
|
||||
channel.setPickedUp(pickUp);
|
||||
channel.setAvailable(segment.getAppChannel()-(channel.getPickedUp()==null?0:channel.getPickedUp()));
|
||||
@@ -353,24 +353,6 @@ public class OtherAllotmentService {
|
||||
return otherAllotmentDao.save(otherAllotment);
|
||||
}
|
||||
|
||||
public DataTableResult<CfgOtherAllotment> getOtherAllotmentByPage(QueryFilter queryFilter) {
|
||||
// Specification<CfgOtherAllotment> listSpec = buildSpecificationByQueryFilter(queryFilter);
|
||||
// int pageSize = queryFilter.getPageSize();
|
||||
// int pageStart = queryFilter.getPageNo();
|
||||
// Sort sort = DaoUtil.buildSortByFilter(queryFilter, "bookDate-desc");
|
||||
// Pageable pageable = PageRequest.of(pageStart, pageSize, sort);
|
||||
// Page<CfgOtherAllotment> resultPage = otherAllotmentDao.findAll(listSpec, pageable);
|
||||
// DataTableResult<CfgOtherAllotment> dataResult = new DataTableResult<CfgOtherAllotment>();
|
||||
// dataResult.setTotalRecords(resultPage.getTotalElements());
|
||||
// dataResult.setPageSize(pageSize);
|
||||
// List<CfgOtherAllotment> resultList = resultPage.getContent();
|
||||
// if (resultList == null) {
|
||||
// resultList = new ArrayList<CfgOtherAllotment>();
|
||||
// }
|
||||
// dataResult.setRowData(resultList);
|
||||
// return dataResult;
|
||||
return null;
|
||||
}
|
||||
|
||||
public DataTableResult<CfgOtherAllotmentViewDto> getOtherAllotmentViewByPage(OtherAllotmentDashboardGetDataRequest otherAllotmentDashboardGetDataRequest) {
|
||||
//--先主表找分页,然后再按照分页结果找View的对象
|
||||
@@ -399,7 +381,7 @@ public class OtherAllotmentService {
|
||||
if(channels!=null) {
|
||||
for(CfgOtherAppChannelDto channel:channels) {
|
||||
if(channel.getAppChannel()!=null) {
|
||||
totalAllotment+=channel.getAppChannel().intValue();
|
||||
totalAllotment+= channel.getAppChannel();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -410,13 +392,7 @@ public class OtherAllotmentService {
|
||||
dataResult.setRowData(resultList);
|
||||
return dataResult;
|
||||
}
|
||||
public List<CfgOtherAllotment> listOtherAllotment(QueryFilter queryFilter) {
|
||||
// Specification<CfgOtherAllotment> listSpec = buildSpecificationByQueryFilter(queryFilter);
|
||||
// Sort sort = DaoUtil.buildSortByFilter(queryFilter, "bookDate-desc");
|
||||
// List<CfgOtherAllotment> resultList = otherAllotmentDao.findAll(listSpec,sort);
|
||||
// return resultList;
|
||||
return null;
|
||||
}
|
||||
|
||||
public List<CfgOtherAllotmentView> listOtherAllotmentsView(OtherAllotmentDashboardGetDataRequest otherAllotmentDashboardGetDataRequest) {
|
||||
Specification<CfgOtherAllotmentView> listSpec = buildSpecificationViewByQueryFilter(otherAllotmentDashboardGetDataRequest);
|
||||
Sort sort = DaoUtil.buildSortByString(otherAllotmentDashboardGetDataRequest.getSortOrder(), "bookDate-desc");
|
||||
@@ -424,7 +400,7 @@ public class OtherAllotmentService {
|
||||
return resultList;
|
||||
}
|
||||
private Specification<CfgOtherAllotment> buildSpecificationByQueryFilter(OtherAllotmentDashboardGetDataRequest otherAllotmentDashboardGetDataRequest) {
|
||||
Specification<CfgOtherAllotment> OtherAllotmentpec = (root, criteriaQuery, cb) -> {
|
||||
return (root, criteriaQuery, cb) -> {
|
||||
List<Predicate> list = new ArrayList<>();
|
||||
if (StringUtils.isNotBlank(otherAllotmentDashboardGetDataRequest.getPropertyId()) && !Strings.CS.equals(otherAllotmentDashboardGetDataRequest.getPropertyId(), "0")) {
|
||||
list.add(cb.equal(root.get("propertyId"),
|
||||
@@ -467,43 +443,39 @@ public class OtherAllotmentService {
|
||||
criteriaQuery.where(list.toArray(predicates));
|
||||
return cb.and(list.toArray(predicates));
|
||||
};
|
||||
return OtherAllotmentpec;
|
||||
}
|
||||
|
||||
private Specification<CfgOtherAllotmentView> buildSpecificationViewByQueryFilter(OtherAllotmentDashboardGetDataRequest otherAllotmentDashboardGetDataRequest) {
|
||||
Specification<CfgOtherAllotmentView> OtherAllotmentpec = new Specification<CfgOtherAllotmentView>() {
|
||||
@Override
|
||||
public Predicate toPredicate(Root<CfgOtherAllotmentView> root, CriteriaQuery<?> criteriaQuery, CriteriaBuilder cb) {
|
||||
List<Predicate> list = new ArrayList<>();
|
||||
if (StringUtils.isNotBlank(otherAllotmentDashboardGetDataRequest.getPropertyId())&& !Strings.CS.equals(otherAllotmentDashboardGetDataRequest.getPropertyId(),"0")) {
|
||||
list.add(cb.equal(root.get("propertyId"),
|
||||
otherAllotmentDashboardGetDataRequest.getPropertyId()));
|
||||
}
|
||||
if (otherAllotmentDashboardGetDataRequest.getSearchBookDate()!=null) {
|
||||
ArrayList<String> date = (ArrayList<String>) otherAllotmentDashboardGetDataRequest.getSearchBookDate();
|
||||
list.add(cb.greaterThanOrEqualTo(root.get("bookDate"),DateTimeUtil.getDateFromString(date.get(0), "yyyy-MM-dd") ));
|
||||
list.add(cb.lessThanOrEqualTo(root.get("bookDate"), DateTimeUtil.getDateFromString(date.get(1), "yyyy-MM-dd") ));
|
||||
}
|
||||
if(otherAllotmentDashboardGetDataRequest.getSearchRoomId()!=null) {
|
||||
List<Long> roomIds = (ArrayList<Long>) otherAllotmentDashboardGetDataRequest.getSearchRoomId();
|
||||
if(roomIds.size()>0) {
|
||||
list.add(root.get("roomId").in(roomIds));
|
||||
}
|
||||
}
|
||||
if(otherAllotmentDashboardGetDataRequest.getSearchDow()!=null) {
|
||||
List<Integer> dows = (ArrayList<Integer>) otherAllotmentDashboardGetDataRequest.getSearchDow();
|
||||
if (dows.size()>0) {
|
||||
list.add(root.get("bookDow").in(dows));
|
||||
}
|
||||
}
|
||||
if(otherAllotmentDashboardGetDataRequest.getPageIds()!=null) {
|
||||
List<Long> pageIds = (List<Long>)otherAllotmentDashboardGetDataRequest.getPageIds();
|
||||
list.add(root.get("id").in(pageIds));
|
||||
}
|
||||
Predicate[] predicates = new Predicate[list.size()];
|
||||
criteriaQuery.where(list.toArray(predicates));
|
||||
return cb.and(list.toArray(predicates));
|
||||
Specification<CfgOtherAllotmentView> OtherAllotmentpec = (root, criteriaQuery, cb) -> {
|
||||
List<Predicate> list = new ArrayList<>();
|
||||
if (StringUtils.isNotBlank(otherAllotmentDashboardGetDataRequest.getPropertyId())&& !Strings.CS.equals(otherAllotmentDashboardGetDataRequest.getPropertyId(),"0")) {
|
||||
list.add(cb.equal(root.get("propertyId"),
|
||||
otherAllotmentDashboardGetDataRequest.getPropertyId()));
|
||||
}
|
||||
if (otherAllotmentDashboardGetDataRequest.getSearchBookDate()!=null) {
|
||||
ArrayList<String> date = (ArrayList<String>) otherAllotmentDashboardGetDataRequest.getSearchBookDate();
|
||||
list.add(cb.greaterThanOrEqualTo(root.get("bookDate"),DateTimeUtil.getDateFromString(date.get(0), "yyyy-MM-dd") ));
|
||||
list.add(cb.lessThanOrEqualTo(root.get("bookDate"), DateTimeUtil.getDateFromString(date.get(1), "yyyy-MM-dd") ));
|
||||
}
|
||||
if(otherAllotmentDashboardGetDataRequest.getSearchRoomId()!=null) {
|
||||
List<Long> roomIds = otherAllotmentDashboardGetDataRequest.getSearchRoomId();
|
||||
if(roomIds.size()>0) {
|
||||
list.add(root.get("roomId").in(roomIds));
|
||||
}
|
||||
}
|
||||
if(otherAllotmentDashboardGetDataRequest.getSearchDow()!=null) {
|
||||
List<Integer> dows = otherAllotmentDashboardGetDataRequest.getSearchDow();
|
||||
if (dows.size()>0) {
|
||||
list.add(root.get("bookDow").in(dows));
|
||||
}
|
||||
}
|
||||
if(otherAllotmentDashboardGetDataRequest.getPageIds()!=null) {
|
||||
List<Long> pageIds = otherAllotmentDashboardGetDataRequest.getPageIds();
|
||||
list.add(root.get("id").in(pageIds));
|
||||
}
|
||||
Predicate[] predicates = new Predicate[list.size()];
|
||||
criteriaQuery.where(list.toArray(predicates));
|
||||
return cb.and(list.toArray(predicates));
|
||||
};
|
||||
return OtherAllotmentpec;
|
||||
}
|
||||
@@ -518,7 +490,7 @@ public class OtherAllotmentService {
|
||||
Map<String,JSONObject> resultList = new HashMap();
|
||||
LocalDateTime today = DateTimeUtil.getCurrentDateTime("yyyy-MM-dd");
|
||||
String maxDay = settingDao.getByKeys("MAX_ADVANCE_BOOKING_DAYS").getKeyValues();
|
||||
LocalDateTime endDate = DateTimeUtil.addDay(today, Integer.valueOf(maxDay));
|
||||
LocalDateTime endDate = DateTimeUtil.addDay(today, Integer.parseInt(maxDay));
|
||||
Long segmentId = Long.valueOf(queryParas.get("segmentId"));
|
||||
Long propertyId = Long.valueOf(queryParas.get("propertyId"));
|
||||
Long roomId = Long.valueOf(queryParas.get("roomId"));
|
||||
@@ -535,7 +507,7 @@ public class OtherAllotmentService {
|
||||
Set<CfgOtherAppChannel> channels = c.getChannels();
|
||||
for(CfgOtherAppChannel a:channels) {
|
||||
if(a.getSegmentId()!=null&&segmentId!=null) {
|
||||
if(a.getSegmentId().longValue()==segmentId.longValue()) channel = a;
|
||||
if(a.getSegmentId().equals(segmentId)) channel = a;
|
||||
}
|
||||
}
|
||||
res.put("available",channel.getAvailable());
|
||||
@@ -589,7 +561,7 @@ public class OtherAllotmentService {
|
||||
for(CfgRooms item:roomCates) {
|
||||
int pId = 0;
|
||||
if(propertyId!=null) {
|
||||
pId = Integer.valueOf(String.valueOf(propertyId));
|
||||
pId = Integer.parseInt(String.valueOf(propertyId));
|
||||
}
|
||||
if(Strings.CI.equals(item.getName(), name)&&pId==item.getPropertyId().intValue()) {
|
||||
matchId = item.getId().intValue();
|
||||
@@ -632,23 +604,23 @@ public class OtherAllotmentService {
|
||||
}
|
||||
}
|
||||
for(int i=0;i<otherAllotmentList.size();i++) {
|
||||
String errMsg="";
|
||||
StringBuilder errMsg= new StringBuilder();
|
||||
boolean isPassed = true;
|
||||
OtherAllotmentImportRow pItem = otherAllotmentList.get(i);
|
||||
if(StringUtils.isBlank(pItem.getPropertyName())){
|
||||
errMsg+= "Property Name is blank;";
|
||||
errMsg.append("Property Name is blank;");
|
||||
isPassed=false;
|
||||
}else {
|
||||
int propertyId = this.getMatchPropertyId(propertyList, pItem.getPropertyName());
|
||||
if(propertyId>0) {
|
||||
pItem.setPropertyId(Long.valueOf((long) propertyId));
|
||||
pItem.setPropertyId((long) propertyId);
|
||||
}else {
|
||||
errMsg+= "No match Other Property of ["+pItem.getPropertyName()+"];";
|
||||
errMsg.append("No match Other Property of [").append(pItem.getPropertyName()).append("];");
|
||||
isPassed=false;
|
||||
}
|
||||
}
|
||||
if(StringUtils.isBlank(pItem.getBookDateText())){
|
||||
errMsg+= "Date is blank;";
|
||||
errMsg.append("Date is blank;");
|
||||
isPassed=false;
|
||||
}else {
|
||||
LocalDateTime bookDate = null;
|
||||
@@ -656,7 +628,7 @@ public class OtherAllotmentService {
|
||||
try {
|
||||
bookDate = DateTimeUtil.getDateFromString(pItem.getBookDateText(),"yyyy-MM-dd");
|
||||
if(!DateTimeUtil.isValidDate(pItem.getBookDateText())) {
|
||||
errMsg+= "Invalid date,Date value should be yyyy-mm-dd format;";
|
||||
errMsg.append("Invalid date,Date value should be yyyy-mm-dd format;");
|
||||
isPassed=false;
|
||||
}
|
||||
}catch(Exception err) {
|
||||
@@ -665,26 +637,26 @@ public class OtherAllotmentService {
|
||||
if(bookDate !=null) {
|
||||
pItem.setBookDate(bookDate);
|
||||
}else {
|
||||
errMsg+= "Invalid date,Date value should be yyyy-mm-dd format;";
|
||||
errMsg.append("Invalid date,Date value should be yyyy-mm-dd format;");
|
||||
isPassed=false;
|
||||
}
|
||||
}
|
||||
if(StringUtils.isBlank(pItem.getRoomCategory())){
|
||||
errMsg+= "Room Group is blank;";
|
||||
errMsg.append("Room Group is blank;");
|
||||
isPassed=false;
|
||||
}else {
|
||||
int roomId = this.getMatchRoomId(roomList, pItem.getRoomCategory(),pItem.getPropertyId());
|
||||
if(roomId>0) {
|
||||
pItem.setRoomId(Long.valueOf(roomId));
|
||||
}else {
|
||||
errMsg+= "No match Room Group of ["+pItem.getRoomCategory()+"];";
|
||||
errMsg.append("No match Room Group of [").append(pItem.getRoomCategory()).append("];");
|
||||
isPassed=false;
|
||||
}
|
||||
}
|
||||
if(isPassed) {
|
||||
String bizKey = pItem.getPropertyId()+"-"+pItem.getBookDateText()+"-"+pItem.getRoomCategory();
|
||||
if(uniqueKeys.containsKey(bizKey)) {
|
||||
errMsg+= "Duplicate records ["+pItem.getPropertyName()+"--"+pItem.getBookDateText()+"--"+pItem.getRoomCategory()+"] in list";
|
||||
errMsg.append("Duplicate records [").append(pItem.getPropertyName()).append("--").append(pItem.getBookDateText()).append("--").append(pItem.getRoomCategory()).append("] in list");
|
||||
isPassed=false;
|
||||
}else {
|
||||
uniqueKeys.put(bizKey,bizKey);
|
||||
@@ -692,7 +664,7 @@ public class OtherAllotmentService {
|
||||
}
|
||||
if(isPassed) {
|
||||
if(StringUtils.isBlank(pItem.getSharerValue())){
|
||||
errMsg+= "Sharer Flag is blank;";
|
||||
errMsg.append("Sharer Flag is blank;");
|
||||
isPassed=false;
|
||||
}else {
|
||||
if(Strings.CI.equals("YES", pItem.getSharerValue())) {
|
||||
@@ -700,12 +672,12 @@ public class OtherAllotmentService {
|
||||
}else if(Strings.CI.equals("NO", pItem.getSharerValue())) {
|
||||
pItem.setSharerFlag(0);
|
||||
}else {
|
||||
errMsg+= "Sharer should be value of [Yes/No];";
|
||||
errMsg.append("Sharer should be value of [Yes/No];");
|
||||
isPassed=false;
|
||||
}
|
||||
}
|
||||
if(StringUtils.isBlank(pItem.getWaitListValue())){
|
||||
errMsg+= "Waitlist Flag is blank;";
|
||||
errMsg.append("Waitlist Flag is blank;");
|
||||
isPassed=false;
|
||||
}else {
|
||||
if(Strings.CI.equals("YES", pItem.getWaitListValue())) {
|
||||
@@ -713,7 +685,7 @@ public class OtherAllotmentService {
|
||||
}else if(Strings.CI.equals("NO", pItem.getWaitListValue())) {
|
||||
pItem.setWaitlistFlag(0);
|
||||
}else {
|
||||
errMsg+= "Waitlist should be value of [Yes/No];";
|
||||
errMsg.append("Waitlist should be value of [Yes/No];");
|
||||
isPassed=false;
|
||||
}
|
||||
}
|
||||
@@ -731,14 +703,14 @@ public class OtherAllotmentService {
|
||||
if(appChannelRows!=null && appChannelRows.size()>0) {
|
||||
for(OtherAppChannelImportRow channelRow:appChannelRows) {
|
||||
if(StringUtils.isBlank(channelRow.getSegmentName())) {
|
||||
errMsg+= "Empty Segment name;";
|
||||
errMsg.append("Empty Segment name;");
|
||||
isPassed=false;
|
||||
}else {
|
||||
int segmentId = this.getMatchSegmentId(segmentList, channelRow.getSegmentName());
|
||||
if(segmentId>0) {
|
||||
channelRow.setSegmentId(Long.valueOf(segmentId));
|
||||
channelRow.setSegmentId((long) segmentId);
|
||||
}else {
|
||||
errMsg+= "No Match Segment name ["+channelRow.getSegmentName()+"];";
|
||||
errMsg.append("No Match Segment name [").append(channelRow.getSegmentName()).append("];");
|
||||
isPassed=false;
|
||||
}
|
||||
if(StringUtils.isBlank(channelRow.getAppChannelVal())) {
|
||||
@@ -748,26 +720,26 @@ public class OtherAllotmentService {
|
||||
channelRow.setAppChannel(Integer.parseInt(channelRow.getAppChannelVal()));
|
||||
totalAllotment+=channelRow.getAppChannel();
|
||||
}catch(Exception err) {
|
||||
errMsg+= "Invalid number of app channel for segment ["+channelRow.getSegmentName()+"];";
|
||||
errMsg.append("Invalid number of app channel for segment [").append(channelRow.getSegmentName()).append("];");
|
||||
isPassed=false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}else {
|
||||
errMsg+= "No any app channel is set;";
|
||||
errMsg.append("No any app channel is set;");
|
||||
isPassed=false;
|
||||
}
|
||||
pItem.setTotalAllotment(totalAllotment);
|
||||
}
|
||||
if(isPassed==true) {
|
||||
if(otherAllotmentDao.countByKeys(pItem.getPropertyId(),pItem.getBookDate(),pItem.getRoomId())>0) {
|
||||
errMsg+="Record exists";
|
||||
errMsg.append("Record exists");
|
||||
isPassed =false;
|
||||
}
|
||||
}
|
||||
pItem.setValidatePassed(isPassed);
|
||||
pItem.setErrorMessage(errMsg);
|
||||
pItem.setErrorMessage(errMsg.toString());
|
||||
if(isPassed)
|
||||
successRows++;
|
||||
else
|
||||
@@ -909,23 +881,23 @@ public class OtherAllotmentService {
|
||||
exportItem.setRoomCategory(exportItem.getRoom().getName());
|
||||
Set<CfgRoomTypes> roomTypes = exportItem.getRoomType();
|
||||
if(roomTypes!=null) {
|
||||
String roomTypeNames ="";
|
||||
StringBuilder roomTypeNames = new StringBuilder();
|
||||
for(CfgRoomTypes roomType:roomTypes) {
|
||||
if(!roomTypeNames.equals("")) {
|
||||
roomTypeNames+=",";
|
||||
if(!roomTypeNames.toString().isEmpty()) {
|
||||
roomTypeNames.append(",");
|
||||
}
|
||||
roomTypeNames+=roomType.getCode();
|
||||
roomTypeNames.append(roomType.getCode());
|
||||
}
|
||||
exportItem.setRoomTypeNames(roomTypeNames);
|
||||
exportItem.setRoomTypeNames(roomTypeNames.toString());
|
||||
}
|
||||
}
|
||||
int totalAllotment=0;
|
||||
Set<CfgOtherAppChannel> appChannels = exportItem.getChannels();
|
||||
List<CfgOtherAppChannel> appChannelList = new ArrayList<CfgOtherAppChannel>();
|
||||
List<CfgOtherAppChannel> appChannelList = new ArrayList<>();
|
||||
if(appChannels!=null) {
|
||||
for(CfgOtherAppChannel appChannel:appChannels) {
|
||||
if(appChannel.getAppChannel()!=null) {
|
||||
totalAllotment+=appChannel.getAppChannel().intValue();
|
||||
totalAllotment+= appChannel.getAppChannel();
|
||||
}
|
||||
appChannelList.add(appChannel);
|
||||
}
|
||||
@@ -949,7 +921,7 @@ public class OtherAllotmentService {
|
||||
|
||||
if(StringUtils.isNotBlank(otherAllotmentDashboardGetDataRequest.getSearchPropertyId())
|
||||
&& !Strings.CS.equals(otherAllotmentDashboardGetDataRequest.getSearchPropertyId(), "0")) {
|
||||
if(Long.valueOf(otherAllotmentDashboardGetDataRequest.getSearchPropertyId()) == roomItem.getPropertyId()) {
|
||||
if(Long.valueOf(otherAllotmentDashboardGetDataRequest.getSearchPropertyId()).equals(roomItem.getPropertyId())) {
|
||||
col.put("channelKey", "ROOM_" + roomItem.getRoomId());
|
||||
col.put("channelName", roomItem.getPropertyName() + " - " + roomItem.getRoomName());
|
||||
cols.add(col);
|
||||
@@ -997,7 +969,7 @@ public class OtherAllotmentService {
|
||||
JSONObject roomData = new JSONObject();
|
||||
String roomKey = "ROOM_"+roomItem.getRoomId();
|
||||
if(StringUtils.isNotBlank(otherAllotmentDashboardGetDataRequest.getPropertyName())&& !Strings.CS.equals(otherAllotmentDashboardGetDataRequest.getPropertyName(),"All")) {
|
||||
if(Long.valueOf(otherAllotmentDashboardGetDataRequest.getSearchPropertyId())==roomItem.getPropertyId()) {
|
||||
if(Objects.equals(roomItem.getPropertyId(), Long.valueOf(otherAllotmentDashboardGetDataRequest.getSearchPropertyId()))) {
|
||||
roomData.put("block", 0);
|
||||
roomData.put("pickup", 0);
|
||||
roomData.put("available", 0);
|
||||
@@ -1026,13 +998,13 @@ public class OtherAllotmentService {
|
||||
Set<CfgOtherAppChannelDto> channels = allotItem.getChannels();
|
||||
if(channels!=null) {
|
||||
for(CfgOtherAppChannelDto channel:channels) {
|
||||
if(matchSegmentId<0 || channel.getSegmentId().longValue()==matchSegmentId) {
|
||||
if(matchSegmentId<0 || channel.getSegmentId().equals(matchSegmentId)) {
|
||||
int blockCnt = (allotRoomData.containsKey("block")?allotRoomData.getIntValue("block"):0);
|
||||
int pickupCnt = (allotRoomData.containsKey("pickup")?allotRoomData.getIntValue("pickup"):0);
|
||||
int availableCnt = (allotRoomData.containsKey("available")?allotRoomData.getIntValue("available"):0);
|
||||
blockCnt+=(channel.getAppChannel()!=null?channel.getAppChannel().intValue():0);
|
||||
pickupCnt+=(channel.getPickedUp()!=null?channel.getPickedUp().intValue():0);
|
||||
availableCnt+=(channel.getAvailable()!=null?channel.getAvailable().intValue():0);
|
||||
blockCnt+=(channel.getAppChannel()!=null? channel.getAppChannel() :0);
|
||||
pickupCnt+=(channel.getPickedUp()!=null? channel.getPickedUp() :0);
|
||||
availableCnt+=(channel.getAvailable()!=null? channel.getAvailable() :0);
|
||||
allotRoomData.put("block", blockCnt);
|
||||
allotRoomData.put("pickup", pickupCnt);
|
||||
allotRoomData.put("available", availableCnt);
|
||||
|
||||
@@ -30,7 +30,7 @@ public class SettingController {
|
||||
@CheckPermissions(routerIds = {"00301", "00501"}, permissionCodes = {"MODIFY"})
|
||||
@CheckPermission(routerId = "00301", permissionCode = "MODIFY")
|
||||
@OperationLog(eventCode = "appsetting_update", actionName = "Update AppSetting")
|
||||
@PostMapping(value = "/app/appsetting/save", produces = "application/json;charset=UTF-8")
|
||||
@PostMapping(value = "/app/appsetting/save", produces = "application/json;charset=UTF-8",consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||
public ResponseEntity<CfgSettingsResponse> updateCfgSettings(HttpServletRequest request, @RequestBody CfgSettingsRequest cfgSettingsRequest) {
|
||||
|
||||
boolean saveResult = settingService.saveAll(cfgSettingsRequest.getCfgSettingsList());
|
||||
@@ -50,7 +50,7 @@ public class SettingController {
|
||||
return ResponseEntity.ok(response);
|
||||
}
|
||||
|
||||
@PostMapping(value = "/app/appsetting/get", produces = "application/json;charset=UTF-8")
|
||||
@PostMapping(value = "/app/appsetting/get", produces = "application/json;charset=UTF-8",consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||
public ResponseEntity<CfgSettingsResponse> getCfgSettings() {
|
||||
|
||||
CfgSettingsResponse response = new CfgSettingsResponse();
|
||||
|
||||
@@ -30,10 +30,12 @@ import jakarta.annotation.Resource;
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
|
||||
import jakarta.validation.Valid;
|
||||
import org.apache.commons.lang3.StringEscapeUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
@@ -78,8 +80,8 @@ public class LoginController {
|
||||
private LoginEntryMapper loginEntryMapper;
|
||||
|
||||
@OperationLog(eventCode = "user_login",actionName="login")
|
||||
@RequestMapping("/user_login")
|
||||
public AjaxResult userLogin(HttpServletRequest request, @RequestBody Map<String,String> loginData, HttpServletRequest httpServletRequest)throws IllegalAccessException, InvocationTargetException {
|
||||
@RequestMapping(value="/user_login",consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||
public AjaxResult userLogin(HttpServletRequest request, @Valid @RequestBody Map<String,String> loginData, HttpServletRequest httpServletRequest)throws IllegalAccessException, InvocationTargetException {
|
||||
AjaxResult result = new AjaxResult();
|
||||
String passwordVal = loginData.get("password");
|
||||
if(StringUtils.isNotBlank(passwordVal)) {
|
||||
@@ -159,13 +161,13 @@ public class LoginController {
|
||||
}
|
||||
return result;
|
||||
}
|
||||
@RequestMapping(value = "/verify_token", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
|
||||
@RequestMapping(value = "/verify_token", method = RequestMethod.POST, produces = "application/json;charset=UTF-8",consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||
public HashMap<String, String> verifyToken(HttpServletRequest request, HttpServletResponse response) {
|
||||
HashMap<String, String> objReturn = new HashMap<String, String>();
|
||||
// 这里可以return一些信息,每次刷新页面或者跳转页面的时候重新拿一次某些信息。
|
||||
return objReturn;
|
||||
}
|
||||
@RequestMapping(value = "/refresh_token", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
|
||||
@RequestMapping(value = "/refresh_token", method = RequestMethod.POST, produces = "application/json;charset=UTF-8",consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||
public ResponseEntity<RefreshTokenResponse> refreshToken(HttpServletRequest request, HttpServletResponse response) throws IOException {
|
||||
LoginUserInfo loginUser = JwtTokenUtil.parseUserFromRequest(request);
|
||||
RefreshTokenResponse result = new RefreshTokenResponse();
|
||||
@@ -187,8 +189,8 @@ public class LoginController {
|
||||
}
|
||||
|
||||
@OperationLog(eventCode = "sso_login",actionName="sso_login")
|
||||
@RequestMapping("/sso_login")
|
||||
public AjaxResult ssoLogin(HttpServletRequest request, @RequestBody Map<String,String> ssoData, HttpServletRequest httpServletRequest)throws IllegalAccessException, InvocationTargetException, UnsupportedEncodingException {
|
||||
@RequestMapping(value="/sso_login",produces = "application/json;charset=UTF-8",consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||
public AjaxResult ssoLogin(HttpServletRequest request,@Valid @RequestBody Map<String,String> ssoData, HttpServletRequest httpServletRequest)throws IllegalAccessException, InvocationTargetException, UnsupportedEncodingException {
|
||||
AjaxResult result = new AjaxResult();
|
||||
// build request body
|
||||
result.setRequestData(ssoData);
|
||||
@@ -265,8 +267,8 @@ public class LoginController {
|
||||
}
|
||||
|
||||
@OperationLog(eventCode = "user_logout")
|
||||
@RequestMapping("/process_logout")
|
||||
public AjaxResult processLogout(HttpServletRequest request, @RequestBody SysUser loginUser, HttpServletRequest requestData) throws IllegalAccessException, InvocationTargetException {
|
||||
@RequestMapping(value="/process_logout",produces = "application/json;charset=UTF-8",consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||
public AjaxResult processLogout(HttpServletRequest request,@Valid @RequestBody SysUser loginUser, HttpServletRequest requestData) throws IllegalAccessException, InvocationTargetException {
|
||||
AjaxResult result = new AjaxResult();
|
||||
String token = request.getHeader("Authorization");
|
||||
if(token==null) {
|
||||
|
||||
+14
-8
@@ -16,6 +16,7 @@ import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import jakarta.annotation.Resource;
|
||||
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import com.mgm.mcrm.common.annotation.logging.OperationLog;
|
||||
@@ -40,7 +41,7 @@ public class BlockCodeController {
|
||||
@CheckPermissions(routerIds = {"00306", "00506"}, permissionCodes = {"ADD", "ADD"})
|
||||
// @CheckPermission(routerId = "00306", permissionCode = "ADD")
|
||||
@OperationLog(actionName = "Create Block Code", eventCode = "block_code_create")
|
||||
@RequestMapping(value = "/app/block_code/create", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
|
||||
@RequestMapping(value = "/app/block_code/create", method = RequestMethod.POST, produces = "application/json;charset=UTF-8",consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||
public AjaxResult createBlockCode(HttpServletRequest request, @RequestBody CreateUpdateCfgBlockCodeRequest createRequest) {
|
||||
boolean isSuccess;
|
||||
String processMessage;
|
||||
@@ -73,7 +74,7 @@ public class BlockCodeController {
|
||||
@CheckPermissions(routerIds = {"00306", "00506"}, permissionCodes = {"MODIFY", "MODIFY"})
|
||||
// @CheckPermission(routerId = "00306", permissionCode = "MODIFY")
|
||||
@OperationLog(eventCode = "block_code_update", actionName = "Update Block Code")
|
||||
@RequestMapping(value = "/app/block_code/update", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
|
||||
@RequestMapping(value = "/app/block_code/update", method = RequestMethod.POST, produces = "application/json;charset=UTF-8",consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||
public AjaxResult updateBlockCode(HttpServletRequest request, @RequestBody CreateUpdateCfgBlockCodeRequest updateRequest) {
|
||||
boolean isSuccess = false;
|
||||
String processMessage;
|
||||
@@ -109,7 +110,7 @@ public class BlockCodeController {
|
||||
|
||||
@CheckPermissions(routerIds = {"00306", "00506"}, permissionCodes = {"VIEW", "VIEW"})
|
||||
// @CheckPermission(routerId = "00306", permissionCode = "VIEW")
|
||||
@RequestMapping(value = "/app/block_code/get", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
|
||||
@RequestMapping(value = "/app/block_code/get", method = RequestMethod.POST, produces = "application/json;charset=UTF-8",consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||
public AjaxResult getBlockCodeById(HttpServletRequest request, @RequestBody GetBlockCodeRequest requestData) {
|
||||
boolean isSuccess;
|
||||
String processMessage;
|
||||
@@ -136,7 +137,7 @@ public class BlockCodeController {
|
||||
@CheckPermissions(routerIds = {"00306", "00506"}, permissionCodes = {"REMOVE", "REMOVE"})
|
||||
// @CheckPermission(routerId = "00306", permissionCode = "REMOVE")
|
||||
@OperationLog(eventCode = "block_code_delete", actionName = "Delete Block Code")
|
||||
@RequestMapping(value = "/app/block_code/delete", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
|
||||
@RequestMapping(value = "/app/block_code/delete", method = RequestMethod.POST, produces = "application/json;charset=UTF-8",consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||
public AjaxResult deleteBlockCode(HttpServletRequest request, @RequestBody DeleteBlockCodeRequest requestData) {
|
||||
boolean isSuccess;
|
||||
String processMessage;
|
||||
@@ -154,7 +155,7 @@ public class BlockCodeController {
|
||||
|
||||
@CheckPermissions(routerIds = {"00306", "00506"}, permissionCodes = {"VIEW", "VIEW"})
|
||||
// @CheckPermission(routerId = "00306", permissionCode = "VIEW")
|
||||
@RequestMapping(value = "/app/block_code/get_page", produces = "application/json;charset=UTF-8")
|
||||
@RequestMapping(value = "/app/block_code/get_page", produces = "application/json;charset=UTF-8",consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||
public AjaxResult getBlockCodeByPage(HttpServletRequest request, @RequestBody CfgBlockCodePageRequest pageRequest) {
|
||||
boolean isSuccess;
|
||||
String processMessage;
|
||||
@@ -177,7 +178,7 @@ public class BlockCodeController {
|
||||
return processResult;
|
||||
}
|
||||
|
||||
@RequestMapping(value = "/app/block_code/list", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
|
||||
@RequestMapping(value = "/app/block_code/list", method = RequestMethod.POST, produces = "application/json;charset=UTF-8",consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||
public AjaxResult queryCfgBlockCodes(HttpServletRequest request, @RequestBody CfgBlockCodePageRequest pageRequest) {
|
||||
boolean isSuccess;
|
||||
String processMessage;
|
||||
@@ -192,7 +193,7 @@ public class BlockCodeController {
|
||||
return processResult;
|
||||
}
|
||||
|
||||
@PostMapping(value = "/app/block_code/daylight_block_code_list", produces = "application/json;charset=UTF-8")
|
||||
@PostMapping(value = "/app/block_code/daylight_block_code_list", produces = "application/json;charset=UTF-8",consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||
public AjaxResult daylightBlockCodeList(@RequestBody PropertyIdRequest dlPropertyIdRequest) {
|
||||
AjaxResult processResult = new AjaxResult();
|
||||
|
||||
@@ -211,7 +212,12 @@ public class BlockCodeController {
|
||||
}
|
||||
|
||||
private boolean validateDuplicate(CreateUpdateCfgBlockCodeRequest createRequest) {
|
||||
CfgBlockCodes block = blockCodeService.checkDuplicateByKey(createRequest.getId(), createRequest.getCode(), createRequest.getCategory());
|
||||
CfgBlockCodes block = blockCodeService.checkDuplicateByKey(
|
||||
createRequest.getId(),
|
||||
createRequest.getCode(),
|
||||
createRequest.getCategory(),
|
||||
createRequest.getPropertyId()
|
||||
);
|
||||
return block != null;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,6 +16,7 @@ import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import jakarta.annotation.Resource;
|
||||
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import com.mgm.mcrm.common.annotation.logging.OperationLog;
|
||||
@@ -34,7 +35,7 @@ public class BlockController {
|
||||
|
||||
@CheckPermission(routerId = "00305", permissionCode = "ADD")
|
||||
@OperationLog(eventCode = "block_create")
|
||||
@PostMapping(value = "/app/block/create", produces = "application/json;charset=UTF-8")
|
||||
@PostMapping(value = "/app/block/create", produces = "application/json;charset=UTF-8",consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||
public AjaxResult createCfgBlocks(HttpServletRequest request, @RequestBody CreateUpdateCfgBlocksRequest createRequest) {
|
||||
boolean isSuccess;
|
||||
String processMessage;
|
||||
@@ -66,7 +67,7 @@ public class BlockController {
|
||||
|
||||
@CheckPermission(routerId = "00305", permissionCode = "MODIFY")
|
||||
@OperationLog(eventCode = "block_update")
|
||||
@PostMapping(value = "/app/block/update", produces = "application/json;charset=UTF-8")
|
||||
@PostMapping(value = "/app/block/update", produces = "application/json;charset=UTF-8",consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||
public AjaxResult updateCfgBlocks(HttpServletRequest request, @RequestBody CreateUpdateCfgBlocksRequest updateRequest) {
|
||||
boolean isSuccess = false;
|
||||
String processMessage;
|
||||
@@ -103,7 +104,7 @@ public class BlockController {
|
||||
}
|
||||
|
||||
@CheckPermission(routerId = "00305", permissionCode = "VIEW")
|
||||
@PostMapping(value = "/app/block/get", produces = "application/json;charset=UTF-8")
|
||||
@PostMapping(value = "/app/block/get", produces = "application/json;charset=UTF-8",consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||
public AjaxResult getCfgBlocksById(HttpServletRequest request, @RequestBody GetCfgBlocksRequest requestData) {
|
||||
boolean isSuccess;
|
||||
String processMessage;
|
||||
@@ -128,7 +129,7 @@ public class BlockController {
|
||||
}
|
||||
|
||||
@CheckPermission(routerId = "00305", permissionCode = "VIEW")
|
||||
@PostMapping(value = "/app/block/get_view", produces = "application/json;charset=UTF-8")
|
||||
@PostMapping(value = "/app/block/get_view", produces = "application/json;charset=UTF-8",consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||
public AjaxResult getCfgBlocksViewById(HttpServletRequest request, @RequestBody GetCfgBlocksRequest requestData) {
|
||||
boolean isSuccess;
|
||||
String processMessage;
|
||||
@@ -154,7 +155,7 @@ public class BlockController {
|
||||
|
||||
@CheckPermission(routerId = "00305", permissionCode = "REMOVE")
|
||||
@OperationLog(eventCode = "block_delete")
|
||||
@PostMapping(value = "/app/block/delete", produces = "application/json;charset=UTF-8")
|
||||
@PostMapping(value = "/app/block/delete", produces = "application/json;charset=UTF-8",consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||
public AjaxResult deleteCfgBlocks(HttpServletRequest request, @RequestBody DeleteCfgBlocksRequest requestData) {
|
||||
boolean isSuccess;
|
||||
String processMessage;
|
||||
@@ -171,7 +172,7 @@ public class BlockController {
|
||||
return processResult;
|
||||
}
|
||||
|
||||
@PostMapping(value = "/app/block/list", produces = "application/json;charset=UTF-8")
|
||||
@PostMapping(value = "/app/block/list", produces = "application/json;charset=UTF-8",consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||
public AjaxResult queryCfgBlocks(HttpServletRequest request, @RequestBody CfgBlocksPageRequest pageRequest) {
|
||||
boolean isSuccess;
|
||||
String processMessage;
|
||||
@@ -195,7 +196,7 @@ public class BlockController {
|
||||
}
|
||||
|
||||
@CheckPermission(routerId = "00305", permissionCode = "VIEW")
|
||||
@RequestMapping(value = "/app/block/get_page", produces = "application/json;charset=UTF-8")
|
||||
@RequestMapping(value = "/app/block/get_page", produces = "application/json;charset=UTF-8",consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||
public AjaxResult getCfgBlocksByPage(HttpServletRequest request, @RequestBody CfgBlocksPageRequest pageRequest) {
|
||||
boolean isSuccess;
|
||||
String processMessage;
|
||||
|
||||
+8
-7
@@ -18,6 +18,7 @@ import jakarta.annotation.Resource;
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMethod;
|
||||
@@ -43,7 +44,7 @@ public class BookingTypeController {
|
||||
@CheckPermissions(routerIds = {"00322", "00522"}, permissionCodes = {"ADD", "ADD"})
|
||||
@CheckPermission(routerId = "00322", permissionCode = "ADD")
|
||||
@OperationLog(eventCode = "booking_type_create", actionName = "Create Booking Type")
|
||||
@RequestMapping(value = "/create", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
|
||||
@RequestMapping(value = "/create", method = RequestMethod.POST, produces = "application/json;charset=UTF-8",consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||
public AjaxResult createCfgBookingTypes(HttpServletRequest request, @RequestBody CfgBookingTypeRequest requestDate) {
|
||||
if (bookingTypeService.validateDuplicate(requestDate)) {
|
||||
return bookingTypeResponseFactory.buildCreateFailedDuplicate(requestDate);
|
||||
@@ -63,7 +64,7 @@ public class BookingTypeController {
|
||||
@CheckPermissions(routerIds = {"00322", "00522"}, permissionCodes = {"MODIFY", "MODIFY"})
|
||||
// @CheckPermission(routerId = "00322", permissionCode = "MODIFY")
|
||||
@OperationLog(eventCode = "booking_type_update", actionName = "Update Booking Type")
|
||||
@RequestMapping(value = "/update", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
|
||||
@RequestMapping(value = "/update", method = RequestMethod.POST, produces = "application/json;charset=UTF-8",consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||
public AjaxResult updateCfgBookingTypes(HttpServletRequest request, @RequestBody CfgBookingTypeRequest cfgBookingTypes) {
|
||||
if (cfgBookingTypes.getId() == null) {
|
||||
return bookingTypeResponseFactory.buildValidateFailedIdEmpty(cfgBookingTypes);
|
||||
@@ -82,14 +83,14 @@ public class BookingTypeController {
|
||||
|
||||
@CheckPermissions(routerIds = {"00322", "00522"}, permissionCodes = {"VIEW", "VIEW"})
|
||||
// @CheckPermission(routerId = "00322", permissionCode = "VIEW")
|
||||
@RequestMapping(value = "/get", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
|
||||
@RequestMapping(value = "/get", method = RequestMethod.POST, produces = "application/json;charset=UTF-8",consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||
public AjaxResult getCfgBookingTypesById(HttpServletRequest request, @RequestBody(required = false) Map<String, Object> queryParas) {
|
||||
return getAjaxResult(request, queryParas);
|
||||
}
|
||||
|
||||
@CheckPermissions(routerIds = {"00322", "00522"}, permissionCodes = {"VIEW", "VIEW"})
|
||||
// @CheckPermission(routerId = "00322", permissionCode = "VIEW")
|
||||
@RequestMapping(value = "/get_view", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
|
||||
@RequestMapping(value = "/get_view", method = RequestMethod.POST, produces = "application/json;charset=UTF-8",consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||
public AjaxResult getCfgBookingTypesViewById(HttpServletRequest request, @RequestBody(required = false) Map<String, Object> queryParas) {
|
||||
return getAjaxResult(request, queryParas);
|
||||
}
|
||||
@@ -97,7 +98,7 @@ public class BookingTypeController {
|
||||
@CheckPermissions(routerIds = {"00322", "00522"}, permissionCodes = {"REMOVE", "REMOVE"})
|
||||
// @CheckPermission(routerId = "00322", permissionCode = "REMOVE")
|
||||
@OperationLog(eventCode = "booking_type_delete", actionName = "Delete Booking Type")
|
||||
@RequestMapping(value = "/delete", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
|
||||
@RequestMapping(value = "/delete", method = RequestMethod.POST, produces = "application/json;charset=UTF-8",consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||
public AjaxResult deleteCfgBookingTypes(HttpServletRequest request, @RequestBody CfgBookingTypeRequest cfgBookingTypes) {
|
||||
boolean canDelete = bookingTypeService.checkReference(cfgBookingTypes);
|
||||
if (!canDelete) {
|
||||
@@ -110,7 +111,7 @@ public class BookingTypeController {
|
||||
return bookingTypeResponseFactory.buildDeleteFailed(cfgBookingTypes);
|
||||
}
|
||||
|
||||
@RequestMapping(value = "/list", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
|
||||
@RequestMapping(value = "/list", method = RequestMethod.POST, produces = "application/json;charset=UTF-8",consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||
public AjaxResult queryCfgBookingTypes(HttpServletRequest request, @RequestBody(required = false) Map<String, Object> queryParas) {
|
||||
QueryFilter queryFilter = (queryParas != null ? new QueryFilter(queryParas) : new QueryFilter(request));
|
||||
List<CfgBookingTypeResponse> responseList = bookingTypeService.listBookingType(queryFilter);
|
||||
@@ -119,7 +120,7 @@ public class BookingTypeController {
|
||||
|
||||
@CheckPermissions(routerIds = {"00322", "00522"}, permissionCodes = {"VIEW", "VIEW"})
|
||||
// @CheckPermission(routerId = "00322", permissionCode = "VIEW")
|
||||
@RequestMapping(value = "/get_page", produces = "application/json;charset=UTF-8")
|
||||
@RequestMapping(value = "/get_page", produces = "application/json;charset=UTF-8",consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||
public AjaxResult getCfgBookingTypesByPage(HttpServletRequest request, @RequestBody(required = false) Map<String, Object> queryParas) throws Exception {
|
||||
QueryFilter queryFilter = (queryParas != null ? new QueryFilter(queryParas) : new QueryFilter(request));
|
||||
DataTableResult<CfgBookingTypeResponse> resultData = bookingTypeService.listBookingTypePage(queryFilter);
|
||||
|
||||
+12
-9
@@ -23,6 +23,8 @@ import jakarta.annotation.Resource;
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
|
||||
import jakarta.validation.Valid;
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
import com.mgm.mcrm.common.annotation.logging.OperationLog;
|
||||
@@ -47,7 +49,7 @@ public class DaylightController {
|
||||
|
||||
@CheckPermission(routerId = "00513", permissionCode = "ADD")
|
||||
@OperationLog(actionName = "Create Daylight", eventCode = "daylight_create")
|
||||
@RequestMapping(value = "/create", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
|
||||
@RequestMapping(value = "/create", method = RequestMethod.POST, produces = "application/json;charset=UTF-8",consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||
public AjaxResult createDaylight(HttpServletRequest request, @RequestBody CreateUpdateCfgDaylightRequest createRequest) {
|
||||
boolean isSuccess;
|
||||
String processMessage;
|
||||
@@ -73,7 +75,7 @@ public class DaylightController {
|
||||
|
||||
@CheckPermission(routerId = "00513", permissionCode = "MODIFY")
|
||||
@OperationLog(eventCode = "opera_update", actionName = "Update Opera")
|
||||
@RequestMapping(value = "/update", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
|
||||
@RequestMapping(value = "/update", method = RequestMethod.POST, produces = "application/json;charset=UTF-8",consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||
public AjaxResult updateOpera(HttpServletRequest request, @RequestBody CreateUpdateCfgDaylightRequest updateRequest) {
|
||||
boolean isSuccess = false;
|
||||
String processMessage = "";
|
||||
@@ -103,7 +105,7 @@ public class DaylightController {
|
||||
}
|
||||
|
||||
@CheckPermission(routerId = "00513", permissionCode = "VIEW")
|
||||
@RequestMapping(value = "/get", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
|
||||
@RequestMapping(value = "/get", method = RequestMethod.POST, produces = "application/json;charset=UTF-8",consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||
public AjaxResult getOperaById(HttpServletRequest request, @RequestBody GetDaylightRequest getRequest) {
|
||||
boolean isSuccess;
|
||||
String processMessage;
|
||||
@@ -129,7 +131,7 @@ public class DaylightController {
|
||||
|
||||
@CheckPermission(routerId = "00513", permissionCode = "REMOVE")
|
||||
@OperationLog(eventCode = "opera_delete", actionName = "Delete Opera")
|
||||
@RequestMapping(value = "/delete", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
|
||||
@RequestMapping(value = "/delete", method = RequestMethod.POST, produces = "application/json;charset=UTF-8",consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||
public AjaxResult deleteOpera(HttpServletRequest request, @RequestBody DeleteDaylightRequest deleteRequest) {
|
||||
boolean isSuccess = false;
|
||||
String processMessage = "";
|
||||
@@ -147,7 +149,7 @@ public class DaylightController {
|
||||
}
|
||||
|
||||
@CheckPermission(routerId = "00513", permissionCode = "VIEW")
|
||||
@RequestMapping(value = "/get_page", produces = "application/json;charset=UTF-8")
|
||||
@RequestMapping(value = "/get_page", produces = "application/json;charset=UTF-8",consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||
public AjaxResult getDaylightByPage(HttpServletRequest request, @RequestBody DaylightPageRequest pageRequest) {
|
||||
|
||||
boolean isSuccess;
|
||||
@@ -174,7 +176,8 @@ public class DaylightController {
|
||||
|
||||
@CheckPermission(routerId = "00513", permissionCode = "EXPORT")
|
||||
@RequestMapping(value = "/export_excel")
|
||||
public void exportExcel(HttpServletRequest request, HttpServletResponse response, @ModelAttribute DaylightPageRequest pageRequest) throws Exception {
|
||||
public void exportExcel(HttpServletRequest request, HttpServletResponse response) throws Exception {
|
||||
DaylightPageRequest pageRequest = (new QueryFilter(request)).convertToRequest(DaylightPageRequest.class);
|
||||
ExportDefine reportDef = ExcelUtils.getExportDefineByName("EXPORT_USER_ROOM_MAPPING");
|
||||
if (reportDef != null) {
|
||||
List<CfgDaylightView> listOperaMapping = dlMappingService.listDaylightView(pageRequest);
|
||||
@@ -289,7 +292,7 @@ public class DaylightController {
|
||||
return processResult;
|
||||
}
|
||||
|
||||
@PostMapping("/daylight_complimentary_type_list")
|
||||
@PostMapping(value="/daylight_complimentary_type_list",produces = "application/json;charset=UTF-8",consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||
public AjaxResult daylightComplimentaryTypeList(
|
||||
@RequestBody PropertyIdRequest propertyIdRequest) {
|
||||
AjaxResult processResult = new AjaxResult();
|
||||
@@ -310,7 +313,7 @@ public class DaylightController {
|
||||
return processResult;
|
||||
}
|
||||
|
||||
@PostMapping("/daylight_payment_method_code_list")
|
||||
@PostMapping(value="/daylight_payment_method_code_list",produces = "application/json;charset=UTF-8",consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||
public AjaxResult daylightPaymentMethodCodeList(
|
||||
@RequestBody PropertyIdRequest propertyIdRequest
|
||||
) {
|
||||
@@ -332,7 +335,7 @@ public class DaylightController {
|
||||
return processResult;
|
||||
}
|
||||
|
||||
@PostMapping("/daylight_complimentary_preset_list")
|
||||
@PostMapping(value="/daylight_complimentary_preset_list",produces = "application/json;charset=UTF-8",consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||
public AjaxResult daylightComplimentaryPresetList(
|
||||
@RequestBody PropertyIdRequest propertyIdRequest
|
||||
) {
|
||||
|
||||
+10
-10
@@ -20,6 +20,7 @@ import com.mgm.mcrm.basesetting.daylight.models.CfgExceptionDaylightView;
|
||||
import com.mgm.mcrm.basesetting.daylight.services.ExceptionDlMappingService;
|
||||
import com.mgm.mcrm.basesetting.room.models.CfgRoomTypes;
|
||||
import com.mgm.mcrm.common.dtos.DataTableResult;
|
||||
import com.mgm.mcrm.common.dtos.QueryFilter;
|
||||
import com.mgm.mcrm.common.dtos.ServiceResult;
|
||||
import com.mgm.mcrm.common.dtos.dataimport.appsetting.ExceptionOperaImportRow;
|
||||
import com.mgm.mcrm.common.dtos.excelmodel.ExportDefine;
|
||||
@@ -31,10 +32,8 @@ import jakarta.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMethod;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import com.mgm.mcrm.common.annotation.logging.OperationLog;
|
||||
@@ -70,7 +69,7 @@ public class ExceptionDaylightController {
|
||||
|
||||
@CheckPermission(routerId="00521",permissionCode="ADD")
|
||||
@OperationLog(actionName="Create Exception Opera", eventCode = "exception_opera_create")
|
||||
@RequestMapping(value = "/create", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
|
||||
@RequestMapping(value = "/create", method = RequestMethod.POST, produces = "application/json;charset=UTF-8",consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||
public AjaxResult createOpera(HttpServletRequest request, @RequestBody CreateUpdateExceptionDaylightRequest cfgExceptionOperaRequest) {
|
||||
AjaxResult validateResult = validateData(cfgExceptionOperaRequest, "CREATE");
|
||||
if (!validateResult.isSuccess()) {
|
||||
@@ -90,7 +89,7 @@ public class ExceptionDaylightController {
|
||||
|
||||
@CheckPermission(routerId="00521",permissionCode="MODIFY")
|
||||
@OperationLog(eventCode="exception_opera_update",actionName="Update Exception Opera")
|
||||
@RequestMapping(value = "/update", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
|
||||
@RequestMapping(value = "/update", method = RequestMethod.POST, produces = "application/json;charset=UTF-8",consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||
public AjaxResult updateOpera(HttpServletRequest request, @RequestBody CreateUpdateExceptionDaylightRequest opera) {
|
||||
AjaxResult validateResult = validateData(opera, "UPDATE");
|
||||
if (!validateResult.isSuccess()) {
|
||||
@@ -113,7 +112,7 @@ public class ExceptionDaylightController {
|
||||
}
|
||||
|
||||
@CheckPermission(routerId = "00521", permissionCode = "VIEW")
|
||||
@RequestMapping(value = "/get", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
|
||||
@RequestMapping(value = "/get", method = RequestMethod.POST, produces = "application/json;charset=UTF-8",consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||
public AjaxResult getDaylightById(HttpServletRequest request, @RequestBody GetExceptionDaylightRequest getRequest) {
|
||||
CfgExceptionDaylightView opera = exceptionDlMappingService.getExceptionDaylightViewById(getRequest.getSearchId());
|
||||
if (opera != null) {
|
||||
@@ -124,7 +123,7 @@ public class ExceptionDaylightController {
|
||||
|
||||
@CheckPermission(routerId = "00521", permissionCode = "REMOVE")
|
||||
@OperationLog(eventCode = "exception_opera_delete", actionName = "Delete Exception Opera")
|
||||
@RequestMapping(value = "/delete", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
|
||||
@RequestMapping(value = "/delete", method = RequestMethod.POST, produces = "application/json;charset=UTF-8",consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||
public AjaxResult deleteOpera(HttpServletRequest request, @RequestBody DeleteExceptionDaylightRequest deleteRequest) {
|
||||
boolean isSuccess = exceptionDlMappingService.deleteExceptionDaylight(deleteRequest);
|
||||
if (isSuccess) {
|
||||
@@ -134,7 +133,7 @@ public class ExceptionDaylightController {
|
||||
}
|
||||
|
||||
@CheckPermission(routerId = "00521", permissionCode = "VIEW")
|
||||
@RequestMapping(value = "/get_page", produces = "application/json;charset=UTF-8")
|
||||
@RequestMapping(value = "/get_page", produces = "application/json;charset=UTF-8",consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||
public AjaxResult getOperaByPage(HttpServletRequest request, @RequestBody ExceptionDaylightPageRequest pageRequest) {
|
||||
DataTableResult<CfgExceptionDaylightResponse> resultData = exceptionDlMappingService.getExceptionDaylightViewByPage(pageRequest);
|
||||
return exceptionDaylightResponseFactory.buildQuerySuccess(resultData);
|
||||
@@ -142,7 +141,8 @@ public class ExceptionDaylightController {
|
||||
|
||||
@CheckPermission(routerId = "00521", permissionCode = "EXPORT")
|
||||
@RequestMapping(value = "/export_excel")
|
||||
public void exportExcel(HttpServletRequest request, HttpServletResponse response, @RequestBody ExceptionDaylightPageRequest pageRequest) throws Exception {
|
||||
public void exportExcel(HttpServletRequest request, HttpServletResponse response) throws Exception {
|
||||
ExceptionDaylightPageRequest pageRequest = (new QueryFilter(request)).convertToRequest(ExceptionDaylightPageRequest.class);
|
||||
ExportDefine reportDef = ExcelUtils.getExportDefineByName("EXPORT_EXCEPTION_DAYLIGHT");
|
||||
if (reportDef != null) {
|
||||
List<CfgExceptionDaylightResponse> listOperaMapping = exceptionDlMappingService.listExceptionDaylightView(pageRequest);
|
||||
|
||||
+18
-10
@@ -16,6 +16,7 @@ import com.mgm.mcrm.basesetting.daylight.services.DaylightService;
|
||||
import com.mgm.mcrm.basesetting.daylight.services.ItemInventoryService;
|
||||
import com.mgm.mcrm.common.annotation.security.CheckPermissions;
|
||||
import com.mgm.mcrm.common.dtos.DataTableResult;
|
||||
import com.mgm.mcrm.common.dtos.QueryFilter;
|
||||
import com.mgm.mcrm.common.dtos.ServiceResult;
|
||||
import com.mgm.mcrm.common.dtos.dataimport.appsetting.ItemInventoryDaylightImportRow;
|
||||
import com.mgm.mcrm.common.dtos.dataimport.appsetting.ItemInventoryImportRow;
|
||||
@@ -26,6 +27,7 @@ import jakarta.annotation.Resource;
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
import org.springframework.web.multipart.MultipartHttpServletRequest;
|
||||
@@ -51,7 +53,7 @@ public class ItemInventoryController {
|
||||
@CheckPermissions(routerIds = {"00317", "00517"}, permissionCodes = {"ADD", "ADD"})
|
||||
// @CheckPermission(routerId = "00317", permissionCode = "ADD")
|
||||
@OperationLog(eventCode = "inventory_create")
|
||||
@RequestMapping(value = "/app/item_inventory/create", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
|
||||
@RequestMapping(value = "/app/item_inventory/create", method = RequestMethod.POST, produces = "application/json;charset=UTF-8",consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||
public AjaxResult createCfgItemInventory(HttpServletRequest request, @RequestBody CreateUpdateItemInventoryRequest createRequest) {
|
||||
boolean isSuccess;
|
||||
String processMessage;
|
||||
@@ -85,7 +87,7 @@ public class ItemInventoryController {
|
||||
@CheckPermissions(routerIds = {"00317", "00517"}, permissionCodes = {"MODIFY", "MODIFY"})
|
||||
// @CheckPermission(routerId = "00317", permissionCode = "MODIFY")
|
||||
@OperationLog(eventCode = "inventory_update")
|
||||
@RequestMapping(value = "/app/item_inventory/update", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
|
||||
@RequestMapping(value = "/app/item_inventory/update", method = RequestMethod.POST, produces = "application/json;charset=UTF-8",consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||
public AjaxResult updateCfgItemInventory(HttpServletRequest request, @RequestBody CreateUpdateItemInventoryRequest updateRequest) {
|
||||
boolean isSuccess = false;
|
||||
String processMessage;
|
||||
@@ -122,7 +124,7 @@ public class ItemInventoryController {
|
||||
|
||||
@CheckPermissions(routerIds = {"00317", "00517"}, permissionCodes = {"VIEW", "VIEW"})
|
||||
// @CheckPermission(routerId = "00317", permissionCode = "VIEW")
|
||||
@RequestMapping(value = "/app/item_inventory/get", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
|
||||
@RequestMapping(value = "/app/item_inventory/get", method = RequestMethod.POST, produces = "application/json;charset=UTF-8",consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||
public AjaxResult getCfgItemInventoryById(HttpServletRequest request, @RequestBody GetItemInventoryRequest requestData) {
|
||||
boolean isSuccess = false;
|
||||
String processMessage;
|
||||
@@ -148,7 +150,7 @@ public class ItemInventoryController {
|
||||
@CheckPermissions(routerIds = {"00317", "00517"}, permissionCodes = {"REMOVE", "REMOVE"})
|
||||
// @CheckPermission(routerId = "00317", permissionCode = "REMOVE")
|
||||
@OperationLog(eventCode = "inventory_delete")
|
||||
@RequestMapping(value = "/app/item_inventory/delete", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
|
||||
@RequestMapping(value = "/app/item_inventory/delete", method = RequestMethod.POST, produces = "application/json;charset=UTF-8",consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||
public AjaxResult deleteCfgItemInventory(HttpServletRequest request, @RequestBody DeleteItemInventoryRequest requestData) {
|
||||
boolean isSuccess;
|
||||
String processMessage;
|
||||
@@ -165,7 +167,7 @@ public class ItemInventoryController {
|
||||
return processResult;
|
||||
}
|
||||
|
||||
@RequestMapping(value = "/app/item_inventory/list", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
|
||||
@RequestMapping(value = "/app/item_inventory/list", method = RequestMethod.POST, produces = "application/json;charset=UTF-8",consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||
public AjaxResult queryCfgItemInventory(HttpServletRequest request, @RequestBody ItemInventoryPageRequest pageRequest) {
|
||||
boolean isSuccess;
|
||||
String processMessage;
|
||||
@@ -190,7 +192,7 @@ public class ItemInventoryController {
|
||||
|
||||
@CheckPermissions(routerIds = {"00317", "00517"}, permissionCodes = {"VIEW", "VIEW"})
|
||||
// @CheckPermission(routerId = "00317", permissionCode = "VIEW")
|
||||
@RequestMapping(value = "/app/item_inventory/get_page", produces = "application/json;charset=UTF-8")
|
||||
@RequestMapping(value = "/app/item_inventory/get_page", produces = "application/json;charset=UTF-8",consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||
public AjaxResult getCfgItemInventoryByPage(HttpServletRequest request, @RequestBody ItemInventoryPageRequest pageRequest) {
|
||||
boolean isSuccess;
|
||||
String processMessage;
|
||||
@@ -215,7 +217,13 @@ public class ItemInventoryController {
|
||||
|
||||
private boolean validateDuplicate(CreateUpdateItemInventoryRequest createRequest) {
|
||||
boolean isDuplicate = false;
|
||||
CfgItemInventory existsClass = itemInventoryService.checkDuplicateByKey(createRequest.getId(), createRequest.getTierId(), createRequest.getRoomId());
|
||||
CfgItemInventory existsClass = itemInventoryService.checkDuplicateByKey(
|
||||
createRequest.getId(),
|
||||
createRequest.getTierId(),
|
||||
createRequest.getRoomId(),
|
||||
createRequest.getCategory(),
|
||||
createRequest.getPropertyId()
|
||||
);
|
||||
if (existsClass != null) {
|
||||
isDuplicate = true;
|
||||
}
|
||||
@@ -225,8 +233,8 @@ public class ItemInventoryController {
|
||||
@CheckPermissions(routerIds = {"00317", "00517"}, permissionCodes = {"EXPORT", "EXPORT"})
|
||||
// @CheckPermission(routerId = "00317", permissionCode = "EXPORT")
|
||||
@RequestMapping(value = "/app/item_inventory/export_excel")
|
||||
public void exportExcel(HttpServletRequest request, HttpServletResponse response, @ModelAttribute ItemInventoryPageRequest pageRequest) throws Exception {
|
||||
|
||||
public void exportExcel(HttpServletRequest request, HttpServletResponse response) throws Exception {
|
||||
ItemInventoryPageRequest pageRequest = (new QueryFilter(request)).convertToRequest(ItemInventoryPageRequest.class);
|
||||
ExportDefine reportDef = null;
|
||||
if ("DAYLIGHT".equalsIgnoreCase(pageRequest.getCategory())) {
|
||||
reportDef = ExcelUtils.getExportDefineByName("EXPORT_ITEM_INVENTORY_DAYLIGHT");
|
||||
@@ -352,7 +360,7 @@ public class ItemInventoryController {
|
||||
return processResult;
|
||||
}
|
||||
|
||||
@PostMapping("/app/item_inventory/daylight_purchase_element_list")
|
||||
@PostMapping(value="/app/item_inventory/daylight_purchase_element_list",produces = "application/json;charset=UTF-8",consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||
public AjaxResult daylightPurchaseElementList(@RequestBody PropertyIdRequest propertyIdRequest) throws Exception {
|
||||
AjaxResult processResult = new AjaxResult();
|
||||
|
||||
|
||||
+14
-8
@@ -16,6 +16,7 @@ import jakarta.annotation.Resource;
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import com.mgm.mcrm.common.annotation.logging.OperationLog;
|
||||
@@ -41,7 +42,7 @@ public class MarketCodeController {
|
||||
@CheckPermissions(routerIds = {"00309", "00509"}, permissionCodes = {"ADD", "ADD"})
|
||||
// @CheckPermission(routerId = "00309", permissionCode = "ADD")
|
||||
@OperationLog(actionName = "Create Market Code", eventCode = "market_code_create")
|
||||
@RequestMapping(value = "/app/market_code/create", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
|
||||
@RequestMapping(value = "/app/market_code/create", method = RequestMethod.POST, produces = "application/json;charset=UTF-8",consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||
public AjaxResult createMarketCode(HttpServletRequest request, @RequestBody CreateUpdateCfgMarketCodesRequest createRequest) {
|
||||
boolean isSuccess;
|
||||
String processMessage;
|
||||
@@ -74,7 +75,7 @@ public class MarketCodeController {
|
||||
@CheckPermissions(routerIds = {"00309", "00509"}, permissionCodes = {"MODIFY", "MODIFY"})
|
||||
// @CheckPermission(routerId = "00309", permissionCode = "MODIFY")
|
||||
@OperationLog(eventCode = "market_code_update", actionName = "Update Market Code")
|
||||
@RequestMapping(value = "/app/market_code/update", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
|
||||
@RequestMapping(value = "/app/market_code/update", method = RequestMethod.POST, produces = "application/json;charset=UTF-8",consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||
public AjaxResult updateMarketCode(HttpServletRequest request, @RequestBody CreateUpdateCfgMarketCodesRequest updateRequest) {
|
||||
boolean isSuccess = false;
|
||||
String processMessage;
|
||||
@@ -111,7 +112,7 @@ public class MarketCodeController {
|
||||
|
||||
@CheckPermissions(routerIds = {"00309", "00509"}, permissionCodes = {"VIEW", "VIEW"})
|
||||
// @CheckPermission(routerId = "00309", permissionCode = "VIEW")
|
||||
@RequestMapping(value = "/app/market_code/get", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
|
||||
@RequestMapping(value = "/app/market_code/get", method = RequestMethod.POST, produces = "application/json;charset=UTF-8",consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||
public AjaxResult getMarketCodeById(HttpServletRequest request, @RequestBody GetMarketCodeRequest requestData) {
|
||||
boolean isSuccess;
|
||||
String processMessage;
|
||||
@@ -138,7 +139,7 @@ public class MarketCodeController {
|
||||
@CheckPermissions(routerIds = {"00309", "00509"}, permissionCodes = {"REMOVE", "REMOVE"})
|
||||
// @CheckPermission(routerId = "00309", permissionCode = "REMOVE")
|
||||
@OperationLog(eventCode = "market_code_delete", actionName = "Delete Market Code")
|
||||
@RequestMapping(value = "/app/market_code/delete", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
|
||||
@RequestMapping(value = "/app/market_code/delete", method = RequestMethod.POST, produces = "application/json;charset=UTF-8",consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||
public AjaxResult deleteMarketCode(HttpServletRequest request, @RequestBody DeleteMarketCodeRequest requestData) {
|
||||
boolean isSuccess;
|
||||
String processMessage;
|
||||
@@ -157,7 +158,7 @@ public class MarketCodeController {
|
||||
|
||||
@CheckPermissions(routerIds = {"00309", "00509"}, permissionCodes = {"VIEW", "VIEW"})
|
||||
// @CheckPermission(routerId = "00309", permissionCode = "VIEW")
|
||||
@RequestMapping(value = "/app/market_code/get_page", produces = "application/json;charset=UTF-8")
|
||||
@RequestMapping(value = "/app/market_code/get_page", produces = "application/json;charset=UTF-8",consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||
public AjaxResult getMarketCodeByPage(HttpServletRequest request, @RequestBody MarketCodePageRequest pageRequest) {
|
||||
boolean isSuccess;
|
||||
String processMessage;
|
||||
@@ -179,7 +180,7 @@ public class MarketCodeController {
|
||||
return processResult;
|
||||
}
|
||||
|
||||
@RequestMapping(value = "/app/market_code/list", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
|
||||
@RequestMapping(value = "/app/market_code/list", method = RequestMethod.POST, produces = "application/json;charset=UTF-8",consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||
public AjaxResult queryMarketCodes(HttpServletRequest request, @RequestBody MarketCodePageRequest pageRequest) {
|
||||
boolean isSuccess;
|
||||
String processMessage;
|
||||
@@ -202,7 +203,7 @@ public class MarketCodeController {
|
||||
return processResult;
|
||||
}
|
||||
|
||||
@PostMapping("/app/market_code/daylight_market_segment_list")
|
||||
@PostMapping(value="/app/market_code/daylight_market_segment_list",produces = "application/json;charset=UTF-8",consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||
public AjaxResult daylightMarketCodeList(
|
||||
HttpServletRequest request,
|
||||
HttpServletResponse response,
|
||||
@@ -225,6 +226,11 @@ public class MarketCodeController {
|
||||
|
||||
private boolean validateDuplicate(CreateUpdateCfgMarketCodesRequest request) {
|
||||
|
||||
return marketCodeService.checkDuplicateByKey(request.getId(), request.getCode(), request.getCategory());
|
||||
return marketCodeService.checkDuplicateByKey(
|
||||
request.getId(),
|
||||
request.getCode(),
|
||||
request.getCategory(),
|
||||
request.getPropertyId()
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
+8
-7
@@ -15,6 +15,7 @@ import com.mgm.mcrm.logging.services.SysLogOperationService;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import jakarta.annotation.Resource;
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMethod;
|
||||
@@ -39,7 +40,7 @@ public class NonMGMStatusMappingController {
|
||||
@CheckPermissions(routerIds = {"00323", "00523"}, permissionCodes = {"ADD"})
|
||||
// @CheckPermission(routerId = "00323", permissionCode = "ADD")
|
||||
@OperationLog(eventCode = "status_mapping_create", actionName = "Create Status Mapping")
|
||||
@RequestMapping(value = "/create", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
|
||||
@RequestMapping(value = "/create", method = RequestMethod.POST, produces = "application/json;charset=UTF-8",consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||
public AjaxResult createStatusMapping(HttpServletRequest request, @RequestBody CfgNonMGMStatusRequest statusMapping) {
|
||||
if (nonMGMStatusService.validateDuplicate(statusMapping)) {
|
||||
return nonMGMStatusMappingResponseFactory.buildCreateFailedDuplicate(statusMapping);
|
||||
@@ -56,7 +57,7 @@ public class NonMGMStatusMappingController {
|
||||
@CheckPermissions(routerIds = {"00323", "00523"}, permissionCodes = {"MODIFY"})
|
||||
// @CheckPermission(routerId = "00323", permissionCode = "MODIFY")
|
||||
@OperationLog(eventCode = "status_mapping_update", actionName = "Update Status Mapping")
|
||||
@RequestMapping(value = "/update", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
|
||||
@RequestMapping(value = "/update", method = RequestMethod.POST, produces = "application/json;charset=UTF-8",consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||
public AjaxResult updateRoom(HttpServletRequest request, @RequestBody CfgNonMGMStatusRequest statusMapping) {
|
||||
if (nonMGMStatusService.validateDuplicate(statusMapping)) {
|
||||
return nonMGMStatusMappingResponseFactory.buildUpdateFailedDuplicate(statusMapping);
|
||||
@@ -75,7 +76,7 @@ public class NonMGMStatusMappingController {
|
||||
|
||||
@CheckPermissions(routerIds = {"00323", "00523"}, permissionCodes = {"VIEW"})
|
||||
// @CheckPermission(routerId = "00323", permissionCode = "VIEW")
|
||||
@RequestMapping(value = "/get", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
|
||||
@RequestMapping(value = "/get", method = RequestMethod.POST, produces = "application/json;charset=UTF-8",consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||
public AjaxResult getRoomById(HttpServletRequest request, @RequestBody(required = false) Map<String, Object> queryParas) {
|
||||
QueryFilter queryFilter = (queryParas != null ? new QueryFilter(queryParas) : new QueryFilter(request));
|
||||
CfgNonMGMStatusResponse statusMapping = nonMGMStatusService.getStatusMappingById(queryFilter.getInt("searchId"));
|
||||
@@ -88,7 +89,7 @@ public class NonMGMStatusMappingController {
|
||||
@CheckPermissions(routerIds = {"00323", "00523"}, permissionCodes = {"REMOVE"})
|
||||
// @CheckPermission(routerId = "00323", permissionCode = "REMOVE")
|
||||
@OperationLog(eventCode = "status_mapping_delete", actionName = "Delete Status Mapping")
|
||||
@RequestMapping(value = "/delete", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
|
||||
@RequestMapping(value = "/delete", method = RequestMethod.POST, produces = "application/json;charset=UTF-8",consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||
public AjaxResult deleteRoom(HttpServletRequest request, @RequestBody CfgNonMGMStatusRequest statusMapping) {
|
||||
boolean isSuccess = nonMGMStatusService.deleteStatusMapping(statusMapping);
|
||||
if (isSuccess) {
|
||||
@@ -99,7 +100,7 @@ public class NonMGMStatusMappingController {
|
||||
|
||||
@CheckPermissions(routerIds = {"00323", "00523"}, permissionCodes = {"VIEW"})
|
||||
// @CheckPermission(routerId = "00323", permissionCode = "VIEW")
|
||||
@RequestMapping(value = "/get_page", produces = "application/json;charset=UTF-8")
|
||||
@RequestMapping(value = "/get_page", produces = "application/json;charset=UTF-8",consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||
public AjaxResult getRoomByPage(HttpServletRequest request, @RequestBody(required = false) Map<String, Object> queryParas) {
|
||||
QueryFilter queryFilter = (queryParas != null ? new QueryFilter(queryParas) : new QueryFilter(request));
|
||||
return processPageRequest(queryFilter);
|
||||
@@ -110,13 +111,13 @@ public class NonMGMStatusMappingController {
|
||||
return nonMGMStatusMappingResponseFactory.buildQuerySuccess(resultData);
|
||||
}
|
||||
|
||||
@RequestMapping(value = "/list", produces = "application/json;charset=UTF-8")
|
||||
@RequestMapping(value = "/list", produces = "application/json;charset=UTF-8",consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||
public AjaxResult queryStatusMapping(HttpServletRequest request, @RequestBody(required = false) Map<String, Object> queryParas) {
|
||||
QueryFilter queryFilter = (queryParas != null ? new QueryFilter(queryParas) : new QueryFilter(request));
|
||||
return processListRequest(queryFilter);
|
||||
}
|
||||
|
||||
@RequestMapping(value = "/list_all_status", produces = "application/json;charset=UTF-8")
|
||||
@RequestMapping(value = "/list_all_status", produces = "application/json;charset=UTF-8",consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||
public AjaxResult queryStatusList(HttpServletRequest request, @RequestBody(required = false) Map<String, Object> queryParas) {
|
||||
List<String> statusNameList = nonMGMStatusService.getStatusNameList();
|
||||
return nonMGMStatusMappingResponseFactory.buildQuerySuccess(statusNameList);
|
||||
|
||||
+2
-1
@@ -10,6 +10,7 @@ import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import jakarta.annotation.Resource;
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
@@ -27,7 +28,7 @@ public class OtherFollowUpStatusController {
|
||||
@Resource
|
||||
private OtherFollowUpStatusService otherFollowUpStatusService;
|
||||
|
||||
@RequestMapping(value = "/app/other_follow_up_status/list", produces = "application/json;charset=UTF-8")
|
||||
@RequestMapping(value = "/app/other_follow_up_status/list", produces = "application/json;charset=UTF-8",consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||
public AjaxResult queryOtherRoomStatus(HttpServletRequest request,@RequestBody(required=false) Map<String,Object> queryParas) {
|
||||
QueryFilter queryFilter = (queryParas!=null?new QueryFilter(queryParas):new QueryFilter(request));
|
||||
return processListRequest(queryFilter);
|
||||
|
||||
+8
-7
@@ -21,6 +21,7 @@ import jakarta.annotation.Resource;
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMethod;
|
||||
@@ -51,7 +52,7 @@ public class OtherSegmentController {
|
||||
@CheckPermissions(routerIds = {"00326", "00526"}, permissionCodes = {"ADD"})
|
||||
// @CheckPermission(routerId = "00326", permissionCode = "ADD")
|
||||
@OperationLog(actionName = "Create Other Property Segment", eventCode = "other_segment_create")
|
||||
@RequestMapping(value = "/create", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
|
||||
@RequestMapping(value = "/create", method = RequestMethod.POST, produces = "application/json;charset=UTF-8",consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||
public AjaxResult createOtherSegment(HttpServletRequest request, @RequestBody CfgOtherSegmentRequest segment) {
|
||||
if (otherSegmentService.validateDuplicate(segment)) {
|
||||
return otherSegmentResponseFactory.buildCreateFailedDuplicate(segment);
|
||||
@@ -68,7 +69,7 @@ public class OtherSegmentController {
|
||||
@CheckPermissions(routerIds = {"00326", "00526"}, permissionCodes = {"MODIFY"})
|
||||
// @CheckPermission(routerId = "00326", permissionCode = "MODIFY")
|
||||
@OperationLog(eventCode = "other_segment_update", actionName = "Update Other Property Segment")
|
||||
@RequestMapping(value = "/update", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
|
||||
@RequestMapping(value = "/update", method = RequestMethod.POST, produces = "application/json;charset=UTF-8",consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||
public AjaxResult updateRoom(HttpServletRequest request, @RequestBody CfgOtherSegmentRequest segment) {
|
||||
if (otherSegmentService.validateDuplicate(segment)) {
|
||||
return otherSegmentResponseFactory.buildUpdateFailedDuplicate(segment);
|
||||
@@ -87,7 +88,7 @@ public class OtherSegmentController {
|
||||
|
||||
@CheckPermissions(routerIds = {"00326", "00526"}, permissionCodes = {"VIEW"})
|
||||
// @CheckPermission(routerId = "00326", permissionCode = "VIEW")
|
||||
@RequestMapping(value = "/get", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
|
||||
@RequestMapping(value = "/get", method = RequestMethod.POST, produces = "application/json;charset=UTF-8",consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||
public AjaxResult getRoomById(HttpServletRequest request, @RequestBody(required = false) Map<String, Object> queryParas) {
|
||||
QueryFilter queryFilter = (queryParas != null ? new QueryFilter(queryParas) : new QueryFilter(request));
|
||||
CfgOtherSegmentResponse otherSegment = otherSegmentService.getOtherSegmentById(queryFilter.getInt("searchId"));
|
||||
@@ -100,7 +101,7 @@ public class OtherSegmentController {
|
||||
@CheckPermissions(routerIds = {"00326", "00526"}, permissionCodes = {"REMOVE"})
|
||||
// @CheckPermission(routerId = "00326", permissionCode = "REMOVE")
|
||||
@OperationLog(eventCode = "other_segment_delete", actionName = "Delete Other Property Segment")
|
||||
@RequestMapping(value = "/delete", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
|
||||
@RequestMapping(value = "/delete", method = RequestMethod.POST, produces = "application/json;charset=UTF-8",consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||
public AjaxResult deleteRoom(HttpServletRequest request, @RequestBody CfgOtherSegmentRequest segment) {
|
||||
boolean isSuccess = otherSegmentService.deleteOtherSegment(segment);
|
||||
if (isSuccess) {
|
||||
@@ -111,7 +112,7 @@ public class OtherSegmentController {
|
||||
|
||||
@CheckPermissions(routerIds = {"00326", "00526"}, permissionCodes = {"VIEW"})
|
||||
// @CheckPermission(routerId = "00326", permissionCode = "VIEW")
|
||||
@RequestMapping(value = "/get_page", produces = "application/json;charset=UTF-8")
|
||||
@RequestMapping(value = "/get_page", produces = "application/json;charset=UTF-8",consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||
public AjaxResult getRoomByPage(HttpServletRequest request, @RequestBody(required = false) Map<String, Object> queryParas) {
|
||||
QueryFilter queryFilter = (queryParas != null ? new QueryFilter(queryParas) : new QueryFilter(request));
|
||||
return processPageRequest(queryFilter);
|
||||
@@ -122,7 +123,7 @@ public class OtherSegmentController {
|
||||
return otherSegmentResponseFactory.buildQuerySuccess(resultData);
|
||||
}
|
||||
|
||||
@RequestMapping(value = "/list", produces = "application/json;charset=UTF-8")
|
||||
@RequestMapping(value = "/list", produces = "application/json;charset=UTF-8",consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||
public AjaxResult queryOtherSegment(HttpServletRequest request, @RequestBody(required = false) Map<String, Object> queryParas) {
|
||||
QueryFilter queryFilter = (queryParas != null ? new QueryFilter(queryParas) : new QueryFilter(request));
|
||||
return processListRequest(queryFilter);
|
||||
@@ -131,7 +132,7 @@ public class OtherSegmentController {
|
||||
@CheckPermissions(routerIds = {"00326", "00526"}, permissionCodes = {"EXPORT"})
|
||||
// @CheckPermission(routerId = "00326", permissionCode = "EXPORT")
|
||||
@RequestMapping(value = "/export_excel")
|
||||
public void exportExcel(HttpServletRequest request, HttpServletResponse response, @RequestBody(required = false) Map<String, Object> queryParas) throws Exception {
|
||||
public void exportExcel(HttpServletRequest request, HttpServletResponse response) throws Exception {
|
||||
QueryFilter queryFilter = new QueryFilter(request);
|
||||
ExportDefine reportDef = ExcelUtils.getExportDefineByName("EXPORT_ROOM_TYPE");
|
||||
if (reportDef != null) {
|
||||
|
||||
+15
-8
@@ -15,6 +15,7 @@ import jakarta.annotation.Resource;
|
||||
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import com.mgm.mcrm.common.annotation.logging.OperationLog;
|
||||
@@ -36,7 +37,7 @@ public class RateCodeController {
|
||||
@CheckPermissions(routerIds = {"00307", "00507"}, permissionCodes = {"ADD"})
|
||||
// @CheckPermission(routerId = "00307", permissionCode = "ADD")
|
||||
@OperationLog(actionName = "Create Rate Code", eventCode = "rate_code_create")
|
||||
@RequestMapping(value = "/app/rate_code/create", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
|
||||
@RequestMapping(value = "/app/rate_code/create", method = RequestMethod.POST, produces = "application/json;charset=UTF-8",consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||
public AjaxResult createRateCode(HttpServletRequest request, @RequestBody CreateUpdateRateCodeRequest createRequest) {
|
||||
boolean isSuccess;
|
||||
String processMessage;
|
||||
@@ -69,7 +70,7 @@ public class RateCodeController {
|
||||
@CheckPermissions(routerIds = {"00307", "00507"}, permissionCodes = {"MODIFY"})
|
||||
@CheckPermission(routerId = "00307", permissionCode = "MODIFY")
|
||||
@OperationLog(eventCode = "rate_code_update", actionName = "Update Rate Code")
|
||||
@RequestMapping(value = "/app/rate_code/update", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
|
||||
@RequestMapping(value = "/app/rate_code/update", method = RequestMethod.POST, produces = "application/json;charset=UTF-8",consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||
public AjaxResult updateRateCode(HttpServletRequest request, @RequestBody CreateUpdateRateCodeRequest updateRequest) {
|
||||
boolean isSuccess = false;
|
||||
String processMessage = "";
|
||||
@@ -107,7 +108,7 @@ public class RateCodeController {
|
||||
|
||||
@CheckPermissions(routerIds = {"00307", "00507"}, permissionCodes = {"VIEW"})
|
||||
@CheckPermission(routerId = "00307", permissionCode = "VIEW")
|
||||
@RequestMapping(value = "/app/rate_code/get", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
|
||||
@RequestMapping(value = "/app/rate_code/get", method = RequestMethod.POST, produces = "application/json;charset=UTF-8",consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||
public AjaxResult getRateCodeById(HttpServletRequest request, @RequestBody GetRateCodeRequest requestData) {
|
||||
boolean isSuccess;
|
||||
String processMessage;
|
||||
@@ -134,7 +135,7 @@ public class RateCodeController {
|
||||
@CheckPermissions(routerIds = {"00307", "00507"}, permissionCodes = {"REMOVE"})
|
||||
@CheckPermission(routerId = "00307", permissionCode = "REMOVE")
|
||||
@OperationLog(eventCode = "rate_code_delete", actionName = "Delete Rate Code")
|
||||
@RequestMapping(value = "/app/rate_code/delete", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
|
||||
@RequestMapping(value = "/app/rate_code/delete", method = RequestMethod.POST, produces = "application/json;charset=UTF-8",consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||
public AjaxResult deleteRateCode(HttpServletRequest request, @RequestBody DeleteRateCodeRequest requestData) {
|
||||
boolean isSuccess;
|
||||
String processMessage;
|
||||
@@ -153,7 +154,7 @@ public class RateCodeController {
|
||||
|
||||
@CheckPermissions(routerIds = {"00307", "00507"}, permissionCodes = {"VIEW"})
|
||||
// @CheckPermission(routerId = "00307", permissionCode = "VIEW")
|
||||
@RequestMapping(value = "/app/rate_code/get_page", produces = "application/json;charset=UTF-8")
|
||||
@RequestMapping(value = "/app/rate_code/get_page", produces = "application/json;charset=UTF-8",consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||
public AjaxResult getRateCodeByPage(HttpServletRequest request, @RequestBody RateCodePageRequest pageRequest) {
|
||||
|
||||
boolean isSuccess;
|
||||
@@ -177,7 +178,7 @@ public class RateCodeController {
|
||||
return processResult;
|
||||
}
|
||||
|
||||
@RequestMapping(value = "/app/rate_code/list", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
|
||||
@RequestMapping(value = "/app/rate_code/list", method = RequestMethod.POST, produces = "application/json;charset=UTF-8",consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||
public AjaxResult queryCfgRateCodes(HttpServletRequest request, @RequestBody RateCodePageRequest pageRequest) {
|
||||
boolean isSuccess;
|
||||
String processMessage;
|
||||
@@ -200,7 +201,7 @@ public class RateCodeController {
|
||||
return processResult;
|
||||
}
|
||||
|
||||
@PostMapping(value = "/app/rate_code/daylight_rate_plan_list", produces = "application/json;charset=UTF-8")
|
||||
@PostMapping(value = "/app/rate_code/daylight_rate_plan_list", produces = "application/json;charset=UTF-8",consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||
public AjaxResult daylightRatePlanList(
|
||||
HttpServletRequest request,
|
||||
HttpServletResponse response,
|
||||
@@ -223,6 +224,12 @@ public class RateCodeController {
|
||||
|
||||
private boolean validateDuplicate(CreateUpdateRateCodeRequest createRequest) {
|
||||
|
||||
return rateCodeService.checkDuplicateByKey(createRequest.getId(), createRequest.getDlRatePlanId(), createRequest.getCode(), createRequest.getCategory());
|
||||
return rateCodeService.checkDuplicateByKey(
|
||||
createRequest.getId(),
|
||||
createRequest.getDlRatePlanId(),
|
||||
createRequest.getCode(),
|
||||
createRequest.getCategory(),
|
||||
createRequest.getPropertyId()
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
+9
-8
@@ -18,6 +18,7 @@ import jakarta.servlet.http.HttpServletRequest;
|
||||
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import jakarta.validation.Valid;
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import com.mgm.mcrm.common.annotation.logging.OperationLog;
|
||||
@@ -41,7 +42,7 @@ public class SourceCodeController {
|
||||
@CheckPermissions(routerIds = {"00308", "00508"}, permissionCodes = {"ADD"})
|
||||
// @CheckPermission(routerId = "00308", permissionCode = "ADD")
|
||||
@OperationLog(actionName = "Create Source Code", eventCode = "source_code_create")
|
||||
@RequestMapping(value = "/app/source_code/create", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
|
||||
@RequestMapping(value = "/app/source_code/create", method = RequestMethod.POST, produces = "application/json;charset=UTF-8",consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||
public AjaxResult createSourceCode(HttpServletRequest request, @RequestBody CreateUpdateSourceCodeRequest createRequest) {
|
||||
boolean isSuccess;
|
||||
String processMessage;
|
||||
@@ -74,7 +75,7 @@ public class SourceCodeController {
|
||||
@CheckPermissions(routerIds = {"00308", "00508"}, permissionCodes = {"MODIFY"})
|
||||
@CheckPermission(routerId = "00308", permissionCode = "MODIFY")
|
||||
@OperationLog(eventCode = "source_code_update", actionName = "Update Source Code")
|
||||
@RequestMapping(value = "/app/source_code/update", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
|
||||
@RequestMapping(value = "/app/source_code/update", method = RequestMethod.POST, produces = "application/json;charset=UTF-8",consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||
public AjaxResult updateSourceCode(HttpServletRequest request, @RequestBody CreateUpdateSourceCodeRequest updateRequest) {
|
||||
boolean isSuccess = false;
|
||||
String processMessage;
|
||||
@@ -110,7 +111,7 @@ public class SourceCodeController {
|
||||
|
||||
@CheckPermissions(routerIds = {"00308", "00508"}, permissionCodes = {"VIEW"})
|
||||
@CheckPermission(routerId = "00308", permissionCode = "VIEW")
|
||||
@RequestMapping(value = "/app/source_code/get", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
|
||||
@RequestMapping(value = "/app/source_code/get", method = RequestMethod.POST, produces = "application/json;charset=UTF-8",consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||
public AjaxResult getSourceCodeById(HttpServletRequest request, @RequestBody GetSourceCodeRequest requestData) {
|
||||
boolean isSuccess;
|
||||
String processMessage;
|
||||
@@ -137,7 +138,7 @@ public class SourceCodeController {
|
||||
@CheckPermissions(routerIds = {"00308", "00508"}, permissionCodes = {"REMOVE"})
|
||||
@CheckPermission(routerId = "00308", permissionCode = "REMOVE")
|
||||
@OperationLog(eventCode = "source_code_delete", actionName = "Delete Source Code")
|
||||
@RequestMapping(value = "/app/source_code/delete", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
|
||||
@RequestMapping(value = "/app/source_code/delete", method = RequestMethod.POST, produces = "application/json;charset=UTF-8",consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||
public AjaxResult deleteSourceCode(HttpServletRequest request, @RequestBody DeleteSourceCodeRequest requestData) {
|
||||
boolean isSuccess;
|
||||
String processMessage;
|
||||
@@ -156,7 +157,7 @@ public class SourceCodeController {
|
||||
|
||||
@CheckPermissions(routerIds = {"00308", "00508"}, permissionCodes = {"VIEW", "VIEW"})
|
||||
// @CheckPermission(routerId = "00308", permissionCode = "VIEW")
|
||||
@RequestMapping(value = "/app/source_code/get_page", produces = "application/json;charset=UTF-8")
|
||||
@RequestMapping(value = "/app/source_code/get_page", produces = "application/json;charset=UTF-8",consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||
public AjaxResult getSourceCodeByPage(HttpServletRequest request, @RequestBody @Valid SourceCodePageRequest pageRequest) {
|
||||
boolean isSuccess;
|
||||
String processMessage;
|
||||
@@ -179,7 +180,7 @@ public class SourceCodeController {
|
||||
return processResult;
|
||||
}
|
||||
|
||||
@RequestMapping(value = "/app/source_code/list", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
|
||||
@RequestMapping(value = "/app/source_code/list", method = RequestMethod.POST, produces = "application/json;charset=UTF-8",consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||
public AjaxResult querySourceCodes(HttpServletRequest request, @RequestBody SourceCodePageRequest pageRequest) {
|
||||
boolean isSuccess;
|
||||
String processMessage;
|
||||
@@ -202,7 +203,7 @@ public class SourceCodeController {
|
||||
return processResult;
|
||||
}
|
||||
|
||||
@PostMapping("/app/source_code/daylight_source_list")
|
||||
@PostMapping(value="/app/source_code/daylight_source_list",produces = "application/json;charset=UTF-8",consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||
public AjaxResult daylightSourceList(
|
||||
HttpServletRequest request,
|
||||
HttpServletResponse response,
|
||||
@@ -224,6 +225,6 @@ public class SourceCodeController {
|
||||
}
|
||||
|
||||
private boolean validateDuplicate(CreateUpdateSourceCodeRequest request) {
|
||||
return sourceCodeService.checkDuplicateByKey(request.getId(), request.getCode(), request.getCategory());
|
||||
return sourceCodeService.checkDuplicateByKey(request.getId(), request.getCode(), request.getCategory(), request.getDlSourceId());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,6 +16,7 @@ import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import jakarta.annotation.Resource;
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import com.mgm.mcrm.common.annotation.logging.OperationLog;
|
||||
@@ -40,7 +41,7 @@ public class TierController {
|
||||
@CheckPermissions(routerIds = {"00315", "00515"}, permissionCodes = {"ADD"})
|
||||
@CheckPermission(routerId = "00315", permissionCode = "ADD")
|
||||
@OperationLog(eventCode = "tier_create")
|
||||
@RequestMapping(value = "/app/tier/create", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
|
||||
@RequestMapping(value = "/app/tier/create", method = RequestMethod.POST, produces = "application/json;charset=UTF-8",consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||
public AjaxResult createCfgTiers(HttpServletRequest request, @RequestBody CreateUpdateTierRequest createRequest) {
|
||||
boolean isSuccess;
|
||||
String processMessage;
|
||||
@@ -74,7 +75,7 @@ public class TierController {
|
||||
@CheckPermissions(routerIds = {"00315", "00515"}, permissionCodes = {"MODIFY"})
|
||||
@CheckPermission(routerId = "00315", permissionCode = "MODIFY")
|
||||
@OperationLog(eventCode = "tier_update")
|
||||
@RequestMapping(value = "/app/tier/update", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
|
||||
@RequestMapping(value = "/app/tier/update", method = RequestMethod.POST, produces = "application/json;charset=UTF-8",consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||
public AjaxResult updateCfgTiers(HttpServletRequest request, @RequestBody CreateUpdateTierRequest updateRequest) {
|
||||
boolean isSuccess = false;
|
||||
String processMessage;
|
||||
@@ -112,7 +113,7 @@ public class TierController {
|
||||
|
||||
@CheckPermissions(routerIds = {"00315", "00515"}, permissionCodes = {"VIEW"})
|
||||
@CheckPermission(routerId = "00315", permissionCode = "VIEW")
|
||||
@RequestMapping(value = "/app/tier/get", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
|
||||
@RequestMapping(value = "/app/tier/get", method = RequestMethod.POST, produces = "application/json;charset=UTF-8",consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||
public AjaxResult getCfgTiersById(HttpServletRequest request, @RequestBody GetTierRequest requestData) {
|
||||
boolean isSuccess;
|
||||
String processMessage;
|
||||
@@ -138,7 +139,7 @@ public class TierController {
|
||||
@CheckPermissions(routerIds = {"00315", "00515"}, permissionCodes = {"REMOVE"})
|
||||
@CheckPermission(routerId = "00315", permissionCode = "REMOVE")
|
||||
@OperationLog(eventCode = "tier_delete")
|
||||
@RequestMapping(value = "/app/tier/delete", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
|
||||
@RequestMapping(value = "/app/tier/delete", method = RequestMethod.POST, produces = "application/json;charset=UTF-8",consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||
public AjaxResult deleteCfgTiers(HttpServletRequest request, @RequestBody DeleteTierRequest requestData) {
|
||||
boolean isSuccess;
|
||||
String processMessage;
|
||||
@@ -155,7 +156,7 @@ public class TierController {
|
||||
return processResult;
|
||||
}
|
||||
|
||||
@RequestMapping(value = "/app/tier/list", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
|
||||
@RequestMapping(value = "/app/tier/list", method = RequestMethod.POST, produces = "application/json;charset=UTF-8",consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||
public AjaxResult queryCfgTiers(HttpServletRequest request, @RequestBody TierPageRequest pageRequest) {
|
||||
boolean isSuccess;
|
||||
String processMessage;
|
||||
@@ -180,7 +181,7 @@ public class TierController {
|
||||
|
||||
@CheckPermissions(routerIds = {"00315", "00515"}, permissionCodes = {"VIEW"})
|
||||
@CheckPermission(routerId = "00315", permissionCode = "VIEW")
|
||||
@RequestMapping(value = "/app/tier/get_page", produces = "application/json;charset=UTF-8")
|
||||
@RequestMapping(value = "/app/tier/get_page", produces = "application/json;charset=UTF-8",consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||
public AjaxResult getCfgTiersByPage(HttpServletRequest request, @RequestBody TierPageRequest pageRequest) {
|
||||
boolean isSuccess;
|
||||
String processMessage;
|
||||
@@ -212,7 +213,7 @@ public class TierController {
|
||||
return isDuplicate;
|
||||
}
|
||||
|
||||
@PostMapping(value = "/app/tier/daylight_tier_list")
|
||||
@PostMapping(value = "/app/tier/daylight_tier_list",produces = "application/json;charset=UTF-8",consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||
public AjaxResult daylightTierList(@RequestBody PropertyIdRequest propertyIdRequest) {
|
||||
AjaxResult processResult = new AjaxResult();
|
||||
|
||||
|
||||
@@ -174,19 +174,28 @@ public class BlockCodeService {
|
||||
return true;
|
||||
}
|
||||
|
||||
public CfgBlockCodes checkDuplicateByKey(Long excludeId, String code, String category) {
|
||||
public CfgBlockCodes checkDuplicateByKey(
|
||||
Long excludeId,
|
||||
String code,
|
||||
String category,
|
||||
Integer propertyId) {
|
||||
Specification<CfgBlockCodes> checkDuplicateSpec = (root, query, cb) -> {
|
||||
List<Predicate> list = new ArrayList<>();
|
||||
if (excludeId != null && excludeId.intValue() > 0) {
|
||||
list.add(cb.notEqual(root.get("id"), excludeId));
|
||||
}
|
||||
list.add(cb.equal(cb.upper(root.get("code")), code.toUpperCase()));
|
||||
// list.add(cb.equal(cb.upper(root.get("category")), category.toUpperCase()));
|
||||
list.add(cb.equal(cb.upper(root.get("category")), category.toUpperCase()));
|
||||
|
||||
list.add(cb.equal(root.get("code"), code));
|
||||
if ("DAYLIGHT".equals(category)) {
|
||||
list.add(cb.equal(root.get("propertyId"), propertyId));
|
||||
}
|
||||
|
||||
Predicate[] predicates = new Predicate[list.size()];
|
||||
query.where(list.toArray(predicates));
|
||||
return cb.and(list.toArray(predicates));
|
||||
};
|
||||
List<CfgBlockCodes> existsClass = blockCodeDao.findAll(checkDuplicateSpec);
|
||||
return (existsClass != null && !existsClass.isEmpty() ? existsClass.get(0) : null);
|
||||
return (existsClass != null && !existsClass.isEmpty() ? existsClass.getFirst() : null);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -104,6 +104,9 @@ public class ItemInventoryService {
|
||||
CfgItemInventory cfgItemInventory = new CfgItemInventory();
|
||||
BeanUtils.copyProperties(createRequest, cfgItemInventory);
|
||||
|
||||
// if ("DAYLIGHT".equalsIgnoreCase(createRequest.getCategory()))
|
||||
// cfgItemInventory.setPropertyId(createRequest.getPropertyId());
|
||||
|
||||
cfgItemInventory.setId(null);
|
||||
cfgItemInventory.setCreatedAt(createDate);
|
||||
cfgItemInventory.setUpdatedAt(createDate);
|
||||
@@ -122,6 +125,9 @@ public class ItemInventoryService {
|
||||
} else {
|
||||
String[] ignoreProperties = new String[]{"id", "createdAt", "updatedAt", "createdBy", "updatedBy"};
|
||||
BeanUtils.copyProperties(updateRequest, existsType, ignoreProperties);
|
||||
|
||||
// if ("DAYLIGHT".equalsIgnoreCase(updateRequest.getCategory()))
|
||||
// existsType.setPropertyId(updateRequest.getPropertyId());
|
||||
existsType.setUpdatedAt(LocalDateTime.now());
|
||||
itemInventoryDao.save(existsType);
|
||||
processResult.setReturnData(existsType);
|
||||
@@ -291,7 +297,12 @@ public class ItemInventoryService {
|
||||
};
|
||||
}
|
||||
|
||||
public CfgItemInventory checkDuplicateByKey(Long excludeId, Long tierId, Long roomId) {
|
||||
public CfgItemInventory checkDuplicateByKey(
|
||||
Long excludeId,
|
||||
Long tierId,
|
||||
Long roomId,
|
||||
String category,
|
||||
Long propertyId) {
|
||||
Specification<CfgItemInventory> checkDuplicateSpec = (root, criteriaQuery, cb) -> {
|
||||
List<Predicate> list = new ArrayList<>();
|
||||
if (excludeId != null && excludeId > 0) {
|
||||
@@ -303,6 +314,11 @@ public class ItemInventoryService {
|
||||
if (roomId != null) {
|
||||
list.add(cb.equal(root.get("roomId"), roomId));
|
||||
}
|
||||
//
|
||||
// if ("DAYLIGHT".equals(category)) {
|
||||
// list.add(cb.equal(root.get("propertyId"), propertyId));
|
||||
// }
|
||||
|
||||
Predicate[] predicates = new Predicate[list.size()];
|
||||
criteriaQuery.where(list.toArray(predicates));
|
||||
return cb.and(list.toArray(predicates));
|
||||
|
||||
@@ -132,14 +132,21 @@ public class MarketCodeService {
|
||||
return true;
|
||||
}
|
||||
|
||||
public boolean checkDuplicateByKey(Long excludeId, String code, String category) {
|
||||
public boolean checkDuplicateByKey(Long excludeId, String code, String category, Integer propertyId) {
|
||||
Specification<CfgMarketCodes> checkDuplicateSpec = (root, query, cb) -> {
|
||||
List<Predicate> list = new ArrayList<>();
|
||||
if (excludeId != null && excludeId.intValue() > 0) {
|
||||
list.add(cb.notEqual(root.get("id"), excludeId));
|
||||
}
|
||||
list.add(cb.equal(cb.upper(root.get("code")), code.toUpperCase()));
|
||||
|
||||
list.add(cb.equal(cb.upper(root.get("category")), category.toUpperCase()));
|
||||
|
||||
list.add(cb.equal(root.get("code"), code));
|
||||
|
||||
if ("DAYLIGHT".equals(category)) {
|
||||
list.add(cb.equal(root.get("propertyId"), propertyId));
|
||||
}
|
||||
|
||||
Predicate[] predicates = new Predicate[list.size()];
|
||||
query.where(list.toArray(predicates));
|
||||
return cb.and(list.toArray(predicates));
|
||||
|
||||
@@ -138,15 +138,21 @@ public class RateCodeService {
|
||||
return true;
|
||||
}
|
||||
|
||||
public boolean checkDuplicateByKey(Long excludeId, String dlRatePlanId, String code, String category) {
|
||||
public boolean checkDuplicateByKey(Long excludeId, String dlRatePlanId, String code, String category, Integer propertyId) {
|
||||
Specification<CfgRateCodes> checkDuplicateSpec = (root, criteriaQuery, cb) -> {
|
||||
List<Predicate> list = new ArrayList<>();
|
||||
if (excludeId != null && excludeId > 0) {
|
||||
list.add(cb.notEqual(root.get("id"), excludeId));
|
||||
}
|
||||
list.add(cb.equal(root.get("dlRatePlanId"), dlRatePlanId));
|
||||
list.add(cb.equal(root.get("code"), code));
|
||||
|
||||
list.add(cb.equal(root.get("category"), category));
|
||||
|
||||
if ("DAYLIGHT".equals(category)) {
|
||||
list.add(cb.equal(root.get("propertyId"), propertyId));
|
||||
list.add(cb.equal(root.get("dlRatePlanId"), dlRatePlanId));
|
||||
} else if ("OPERA".equals(category)) {
|
||||
list.add(cb.equal(root.get("code"), code));
|
||||
}
|
||||
Predicate[] predicates = new Predicate[list.size()];
|
||||
criteriaQuery.where(list.toArray(predicates));
|
||||
return cb.and(list.toArray(predicates));
|
||||
|
||||
@@ -127,14 +127,19 @@ public class SourceCodeService {
|
||||
return true;
|
||||
}
|
||||
|
||||
public boolean checkDuplicateByKey(Long excludeId, String code, String category) {
|
||||
public boolean checkDuplicateByKey(Long excludeId, String code, String category, String dlId) {
|
||||
Specification<CfgSourceCodes> checkDuplicateSpec = (root, query, cb) -> {
|
||||
List<Predicate> list = new ArrayList<>();
|
||||
if (excludeId != null && excludeId.intValue() > 0) {
|
||||
list.add(cb.notEqual(root.get("id"), excludeId));
|
||||
}
|
||||
list.add(cb.equal(cb.upper(root.get("code")), code.toUpperCase()));
|
||||
|
||||
list.add(cb.equal(cb.upper(root.get("category")), category.toUpperCase()));
|
||||
|
||||
if ("DAYLIGHT".equals(category)) {
|
||||
list.add(cb.equal(root.get("dlSourceId"), dlId));
|
||||
}
|
||||
|
||||
Predicate[] predicates = new Predicate[list.size()];
|
||||
query.where(list.toArray(predicates));
|
||||
return cb.and(list.toArray(predicates));
|
||||
|
||||
@@ -162,9 +162,9 @@ public class TierService {
|
||||
if (excludeId != null && excludeId > 0) {
|
||||
list.add(cb.notEqual(root.get("id"), excludeId));
|
||||
}
|
||||
list.add(cb.or(cb.equal(cb.upper(root.get("tierName")), name != null ? name.toUpperCase() : ""),
|
||||
cb.equal(cb.upper(root.get("daylightTier")), daylightTier),
|
||||
cb.equal(cb.upper(root.get("operaTier")), operaTier)
|
||||
list.add(cb.or(cb.equal(root.get("tierName"), name != null ? name : ""),
|
||||
cb.equal(root.get("daylightTier"), daylightTier),
|
||||
cb.equal(root.get("operaTier"), operaTier)
|
||||
));
|
||||
|
||||
list.add(cb.equal(cb.upper(root.get("category")), category));
|
||||
|
||||
+6
-5
@@ -21,6 +21,7 @@ import jakarta.servlet.http.HttpServletRequest;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.commons.lang3.Strings;
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMethod;
|
||||
@@ -44,7 +45,7 @@ public class ExceptionOperaController {
|
||||
|
||||
@CheckPermission(routerId = "00321", permissionCode = "ADD")
|
||||
@OperationLog(actionName = "Create Exception Opera", eventCode = "exception_opera_create")
|
||||
@RequestMapping(value = "/app/exception_opera/create", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
|
||||
@RequestMapping(value = "/app/exception_opera/create", method = RequestMethod.POST, produces = "application/json;charset=UTF-8",consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||
public AjaxResult createOpera(HttpServletRequest request, @RequestBody CfgExceptionOpera opera) {
|
||||
boolean isSuccess;
|
||||
String processMessage;
|
||||
@@ -77,7 +78,7 @@ public class ExceptionOperaController {
|
||||
|
||||
@CheckPermission(routerId = "00321", permissionCode = "MODIFY")
|
||||
@OperationLog(eventCode = "exception_opera_update", actionName = "Update Exception Opera")
|
||||
@RequestMapping(value = "/app/exception_opera/update", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
|
||||
@RequestMapping(value = "/app/exception_opera/update", method = RequestMethod.POST, produces = "application/json;charset=UTF-8",consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||
public AjaxResult updateOpera(HttpServletRequest request, @RequestBody CfgExceptionOpera opera) {
|
||||
boolean isSuccess = false;
|
||||
String processMessage;
|
||||
@@ -115,7 +116,7 @@ public class ExceptionOperaController {
|
||||
}
|
||||
|
||||
@CheckPermission(routerId = "00321", permissionCode = "VIEW")
|
||||
@RequestMapping(value = "/app/exception_opera/get", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
|
||||
@RequestMapping(value = "/app/exception_opera/get", method = RequestMethod.POST, produces = "application/json;charset=UTF-8",consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||
public AjaxResult getOperaById(HttpServletRequest request, @RequestBody(required = false) Map<String, Object> queryParas) {
|
||||
boolean isSuccess;
|
||||
String processMessage;
|
||||
@@ -142,7 +143,7 @@ public class ExceptionOperaController {
|
||||
|
||||
@CheckPermission(routerId = "00321", permissionCode = "REMOVE")
|
||||
@OperationLog(eventCode = "exception_opera_delete", actionName = "Delete Exception Opera")
|
||||
@RequestMapping(value = "/app/exception_opera/delete", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
|
||||
@RequestMapping(value = "/app/exception_opera/delete", method = RequestMethod.POST, produces = "application/json;charset=UTF-8",consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||
public AjaxResult deleteOpera(HttpServletRequest request, @RequestBody CfgExceptionOpera opera) {
|
||||
boolean isSuccess;
|
||||
String processMessage;
|
||||
@@ -160,7 +161,7 @@ public class ExceptionOperaController {
|
||||
}
|
||||
|
||||
@CheckPermission(routerId = "00321", permissionCode = "VIEW")
|
||||
@RequestMapping(value = "/app/exception_opera/get_page", produces = "application/json;charset=UTF-8")
|
||||
@RequestMapping(value = "/app/exception_opera/get_page", produces = "application/json;charset=UTF-8",consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||
public AjaxResult getOperaByPage(HttpServletRequest request, @RequestBody(required = false) Map<String, Object> queryParas) {
|
||||
QueryFilter queryFilter = (queryParas != null ? new QueryFilter(queryParas) : new QueryFilter(request));
|
||||
return processPageRequest(queryFilter);
|
||||
|
||||
@@ -22,6 +22,7 @@ import com.mgm.mcrm.logging.services.SysLogOperationService;
|
||||
import jakarta.annotation.Resource;
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
@@ -42,7 +43,7 @@ public class OperaController {
|
||||
|
||||
@CheckPermission(routerId = "00313", permissionCode = "ADD")
|
||||
@OperationLog(actionName = "Create Opera", eventCode = "opera_create")
|
||||
@RequestMapping(value = "/app/opera/create", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
|
||||
@RequestMapping(value = "/app/opera/create", method = RequestMethod.POST, produces = "application/json;charset=UTF-8",consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||
public AjaxResult createOpera(HttpServletRequest request, @RequestBody CreateUpdateOperaRequest createRequest) {
|
||||
boolean isSuccess;
|
||||
String processMessage;
|
||||
@@ -70,7 +71,7 @@ public class OperaController {
|
||||
|
||||
@CheckPermission(routerId = "00313", permissionCode = "MODIFY")
|
||||
@OperationLog(eventCode = "opera_update", actionName = "Update Opera")
|
||||
@RequestMapping(value = "/app/opera/update", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
|
||||
@RequestMapping(value = "/app/opera/update", method = RequestMethod.POST, produces = "application/json;charset=UTF-8",consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||
public AjaxResult updateOpera(HttpServletRequest request, @RequestBody CreateUpdateOperaRequest updateRequest) {
|
||||
boolean isSuccess = false;
|
||||
String processMessage;
|
||||
@@ -100,7 +101,7 @@ public class OperaController {
|
||||
}
|
||||
|
||||
@CheckPermission(routerId = "00313", permissionCode = "VIEW")
|
||||
@RequestMapping(value = "/app/opera/get", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
|
||||
@RequestMapping(value = "/app/opera/get", method = RequestMethod.POST, produces = "application/json;charset=UTF-8",consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||
public AjaxResult getOperaById(HttpServletRequest request, @RequestBody GetOperaRequest getOperaRequest) {
|
||||
boolean isSuccess;
|
||||
String processMessage;
|
||||
@@ -126,7 +127,7 @@ public class OperaController {
|
||||
|
||||
@CheckPermission(routerId = "00313", permissionCode = "REMOVE")
|
||||
@OperationLog(eventCode = "opera_delete", actionName = "Delete Opera")
|
||||
@RequestMapping(value = "/app/opera/delete", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
|
||||
@RequestMapping(value = "/app/opera/delete", method = RequestMethod.POST, produces = "application/json;charset=UTF-8",consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||
public AjaxResult deleteOpera(HttpServletRequest request, @RequestBody DeleteOperaRequest deleteOperaRequest) {
|
||||
boolean isSuccess;
|
||||
String processMessage;
|
||||
@@ -144,7 +145,7 @@ public class OperaController {
|
||||
}
|
||||
|
||||
@CheckPermission(routerId = "00313", permissionCode = "VIEW")
|
||||
@RequestMapping(value = "/app/opera/get_page", produces = "application/json;charset=UTF-8")
|
||||
@RequestMapping(value = "/app/opera/get_page", produces = "application/json;charset=UTF-8",consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||
public AjaxResult getOperaByPage(HttpServletRequest request, @RequestBody OperaPageRequest pageRequest) {
|
||||
boolean isSuccess;
|
||||
String processMessage;
|
||||
@@ -166,10 +167,11 @@ public class OperaController {
|
||||
processResult.setMessage(processMessage);
|
||||
return processResult;
|
||||
}
|
||||
|
||||
@ModelAttribute
|
||||
@CheckPermission(routerId = "00313", permissionCode = "EXPORT")
|
||||
@RequestMapping(value = "/app/opera/export_excel")
|
||||
public void exportExcel(HttpServletRequest request, HttpServletResponse response, @ModelAttribute OperaPageRequest pageRequest) throws Exception {
|
||||
public void exportExcel(HttpServletRequest request, HttpServletResponse response) throws Exception {
|
||||
OperaPageRequest pageRequest = (new QueryFilter(request)).convertToRequest(OperaPageRequest.class);
|
||||
ExportDefine reportDef = ExcelUtils.getExportDefineByName("EXPORT_OPERA_MAPPING");
|
||||
if (reportDef != null) {
|
||||
List<CfgOperaView> listOperaMapping = operaService.listOperaView(pageRequest);
|
||||
|
||||
+10
-7
@@ -18,6 +18,7 @@ import com.mgm.mcrm.common.annotation.security.CheckPermissions;
|
||||
import com.mgm.mcrm.common.constants.SysConstants;
|
||||
import com.mgm.mcrm.common.dtos.AjaxResult;
|
||||
import com.mgm.mcrm.common.dtos.DataTableResult;
|
||||
import com.mgm.mcrm.common.dtos.QueryFilter;
|
||||
import com.mgm.mcrm.common.dtos.ServiceResult;
|
||||
import com.mgm.mcrm.common.dtos.dataimport.appsetting.PropertyImportRow;
|
||||
import com.mgm.mcrm.common.dtos.excelmodel.ExportDefine;
|
||||
@@ -30,6 +31,7 @@ import jakarta.servlet.http.HttpServletResponse;
|
||||
import jakarta.validation.Valid;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.commons.lang3.Strings;
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
@@ -51,7 +53,7 @@ public class PropertyController {
|
||||
@CheckPermissions(routerIds = {"00304", "00504"}, permissionCodes = {"ADD"})
|
||||
@CheckPermission(routerId = "00304", permissionCode = "ADD")
|
||||
@OperationLog(eventCode = "property_create")
|
||||
@PostMapping(value = "/app/property/create", produces = "application/json;charset=UTF-8")
|
||||
@PostMapping(value = "/app/property/create", produces = "application/json;charset=UTF-8",consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||
public AjaxResult createCfgProperties(HttpServletRequest request, @RequestBody CreateUpdatePropertyRequest createRequest) {
|
||||
boolean isSuccess;
|
||||
String processMessage;
|
||||
@@ -85,7 +87,7 @@ public class PropertyController {
|
||||
@CheckPermissions(routerIds = {"00304", "00504"}, permissionCodes = {"MODIFY"})
|
||||
@CheckPermission(routerId = "00304", permissionCode = "MODIFY")
|
||||
@OperationLog(eventCode = "property_update")
|
||||
@PostMapping(value = "/app/property/update", produces = "application/json;charset=UTF-8")
|
||||
@PostMapping(value = "/app/property/update", produces = "application/json;charset=UTF-8",consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||
public AjaxResult updateCfgProperties(HttpServletRequest request, @RequestBody CreateUpdatePropertyRequest updateRequest) {
|
||||
boolean isSuccess = false;
|
||||
String processMessage;
|
||||
@@ -122,7 +124,7 @@ public class PropertyController {
|
||||
|
||||
@CheckPermissions(routerIds = {"00304", "00504"}, permissionCodes = {"VIEW"})
|
||||
@CheckPermission(routerId = "00304", permissionCode = "VIEW")
|
||||
@PostMapping(value = "/app/property/get", produces = "application/json;charset=UTF-8")
|
||||
@PostMapping(value = "/app/property/get", produces = "application/json;charset=UTF-8",consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||
public AjaxResult getCfgPropertiesById(HttpServletRequest request, @RequestBody GetPropertyRequest requestData) {
|
||||
boolean isSuccess;
|
||||
String processMessage;
|
||||
@@ -149,7 +151,7 @@ public class PropertyController {
|
||||
@CheckPermissions(routerIds = {"00304", "00504"}, permissionCodes = {"REMOVE"})
|
||||
@CheckPermission(routerId = "00304", permissionCode = "REMOVE")
|
||||
@OperationLog(eventCode = "property_delete")
|
||||
@PostMapping(value = "/app/property/delete", produces = "application/json;charset=UTF-8")
|
||||
@PostMapping(value = "/app/property/delete", produces = "application/json;charset=UTF-8",consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||
public AjaxResult deleteCfgProperties(HttpServletRequest request, @RequestBody DeleteCfgPropertyRequest requestData) {
|
||||
boolean isSuccess;
|
||||
String processMessage;
|
||||
@@ -166,7 +168,7 @@ public class PropertyController {
|
||||
return processResult;
|
||||
}
|
||||
|
||||
@PostMapping(value = "/app/property/list", produces = "application/json;charset=UTF-8")
|
||||
@PostMapping(value = "/app/property/list", produces = "application/json;charset=UTF-8",consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||
public AjaxResult queryCfgProperties(HttpServletRequest request, @RequestBody PropertiesPageRequest pageRequest) {
|
||||
boolean isSuccess;
|
||||
String processMessage;
|
||||
@@ -203,7 +205,7 @@ public class PropertyController {
|
||||
|
||||
@CheckPermissions(routerIds = {"00304", "00504"}, permissionCodes = {"VIEW"})
|
||||
@CheckPermission(routerId = "00304", permissionCode = "VIEW")
|
||||
@PostMapping(value = "/app/property/get_page", produces = "application/json;charset=UTF-8")
|
||||
@PostMapping(value = "/app/property/get_page", produces = "application/json;charset=UTF-8",consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||
public AjaxResult getCfgPropertiesByPage(HttpServletRequest request, @RequestBody @Valid PropertiesPageRequest pageRequest) {
|
||||
|
||||
boolean isSuccess;
|
||||
@@ -230,7 +232,8 @@ public class PropertyController {
|
||||
@CheckPermissions(routerIds = {"00304", "00504"}, permissionCodes = {"EXPORT"})
|
||||
@CheckPermission(routerId = "00304", permissionCode = "EXPORT")
|
||||
@RequestMapping(value = "/app/property/export_excel")
|
||||
public void exportExcel(HttpServletRequest request, HttpServletResponse response, @ModelAttribute PropertiesPageRequest pageRequest) throws Exception {
|
||||
public void exportExcel(HttpServletRequest request, HttpServletResponse response) throws Exception {
|
||||
PropertiesPageRequest pageRequest = (new QueryFilter(request)).convertToRequest(PropertiesPageRequest.class);
|
||||
ExportDefine reportDef = ExcelUtils.getExportDefineByName("EXPORT_PROPERTY");
|
||||
if (reportDef != null) {
|
||||
List<CfgPropertiesDto> listProperty = propertyService.listProperty(pageRequest);
|
||||
|
||||
+1
-1
@@ -27,5 +27,5 @@ public class CreateUpdatePropertyRequest {
|
||||
|
||||
private Integer calendarOrder;
|
||||
|
||||
private Integer showCalendar;
|
||||
private Integer showCalendar = 0;
|
||||
}
|
||||
|
||||
@@ -23,6 +23,7 @@ import jakarta.annotation.Resource;
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMethod;
|
||||
@@ -51,7 +52,7 @@ public class BedTypeController {
|
||||
@CheckPermissions(routerIds = {"00320", "00520"}, permissionCodes = {"ADD"})
|
||||
@CheckPermission(routerId="00320",permissionCode="ADD")
|
||||
@OperationLog(actionName="Create BedType", eventCode = "bedType_create")
|
||||
@RequestMapping(value = "/create", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
|
||||
@RequestMapping(value = "/create", method = RequestMethod.POST, produces = "application/json;charset=UTF-8",consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||
public AjaxResult createCfgBedTypeMapping(HttpServletRequest request, @RequestBody CfgBedTypeRequest cfgBedTypeRequest) {
|
||||
AjaxResult validateResult = validateData(cfgBedTypeRequest,"CREATE");
|
||||
if(!validateResult.isSuccess()) {
|
||||
@@ -72,7 +73,7 @@ public class BedTypeController {
|
||||
@CheckPermissions(routerIds = {"00320", "00520"}, permissionCodes = {"MODIFY"})
|
||||
@CheckPermission(routerId="00320",permissionCode="MODIFY")
|
||||
@OperationLog(eventCode="bedType_update",actionName="Update BedType")
|
||||
@RequestMapping(value = "/update", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
|
||||
@RequestMapping(value = "/update", method = RequestMethod.POST, produces = "application/json;charset=UTF-8",consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||
public AjaxResult updateCfgBedTypeMapping(HttpServletRequest request, @RequestBody CfgBedTypeRequest cfgBedTypeRequest) {
|
||||
AjaxResult validateResult = validateData(cfgBedTypeRequest,"UPDATE");
|
||||
if(!validateResult.isSuccess()) {
|
||||
@@ -92,7 +93,7 @@ public class BedTypeController {
|
||||
|
||||
@CheckPermissions(routerIds = {"00320", "00520"}, permissionCodes = {"VIEW"})
|
||||
@CheckPermission(routerId="00320",permissionCode="VIEW")
|
||||
@RequestMapping(value = "/get", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
|
||||
@RequestMapping(value = "/get", method = RequestMethod.POST, produces = "application/json;charset=UTF-8",consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||
public AjaxResult getCfgBedTypeMappingById(HttpServletRequest request, @RequestBody(required=false) Map<String,Object> queryParas) {
|
||||
QueryFilter queryFilter = (queryParas!=null ? new QueryFilter(queryParas) : new QueryFilter(request));
|
||||
//--
|
||||
@@ -105,7 +106,7 @@ public class BedTypeController {
|
||||
|
||||
@CheckPermissions(routerIds = {"00320", "00520"}, permissionCodes = {"VIEW"})
|
||||
@CheckPermission(routerId="00320",permissionCode="VIEW")
|
||||
@RequestMapping(value = "/get_view", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
|
||||
@RequestMapping(value = "/get_view", method = RequestMethod.POST, produces = "application/json;charset=UTF-8",consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||
public AjaxResult getCfgBedTypeMappingViewById(HttpServletRequest request, @RequestBody(required=false) Map<String,Object> queryParas) {
|
||||
QueryFilter queryFilter = (queryParas!=null?new QueryFilter(queryParas):new QueryFilter(request));
|
||||
//--
|
||||
@@ -119,7 +120,7 @@ public class BedTypeController {
|
||||
@CheckPermissions(routerIds = {"00320", "00520"}, permissionCodes = {"REMOVE"})
|
||||
@CheckPermission(routerId="00320",permissionCode="REMOVE")
|
||||
@OperationLog(eventCode="bedType_delete",actionName="Delete BedType")
|
||||
@RequestMapping(value = "/delete", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
|
||||
@RequestMapping(value = "/delete", method = RequestMethod.POST, produces = "application/json;charset=UTF-8",consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||
public AjaxResult deleteCfgBedTypeMapping(HttpServletRequest request, @RequestBody CfgBedTypeRequest cfgBedTypeRequest) {
|
||||
boolean isSuccess = bedTypeService.deleteCfgBedTypeMapping(cfgBedTypeRequest);
|
||||
if(isSuccess) {
|
||||
@@ -128,7 +129,7 @@ public class BedTypeController {
|
||||
return bedTypeResponseFactory.buildDeleteFailed(cfgBedTypeRequest, "");
|
||||
}
|
||||
|
||||
@RequestMapping(value = "/list", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
|
||||
@RequestMapping(value = "/list", method = RequestMethod.POST, produces = "application/json;charset=UTF-8",consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||
public AjaxResult queryCfgBedTypeMapping(HttpServletRequest request, @RequestBody(required=false) Map<String,Object> queryParas) {
|
||||
QueryFilter queryFilter = (queryParas!=null?new QueryFilter(queryParas):new QueryFilter(request));
|
||||
//--
|
||||
@@ -138,13 +139,13 @@ public class BedTypeController {
|
||||
|
||||
@CheckPermissions(routerIds = {"00320", "00520"}, permissionCodes = {"VIEW"})
|
||||
@CheckPermission(routerId="00320",permissionCode="VIEW")
|
||||
@RequestMapping(value = "/get_page", produces = "application/json;charset=UTF-8")
|
||||
@RequestMapping(value = "/get_page", produces = "application/json;charset=UTF-8",consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||
public AjaxResult getCfgBedTypeMappingByPage(HttpServletRequest request,@RequestBody(required=false) Map<String,Object> queryParas) throws Exception {
|
||||
QueryFilter queryFilter = (queryParas != null ? new QueryFilter(queryParas) : new QueryFilter(request));
|
||||
return processPageRequest(queryFilter);
|
||||
}
|
||||
|
||||
@RequestMapping(value = "/list_view", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
|
||||
@RequestMapping(value = "/list_view", method = RequestMethod.POST, produces = "application/json;charset=UTF-8",consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||
public AjaxResult queryCfgBedTypeMappingView(HttpServletRequest request, @RequestBody(required=false) Map<String,Object> queryParas) {
|
||||
QueryFilter queryFilter = (queryParas!=null?new QueryFilter(queryParas):new QueryFilter(request));
|
||||
//--
|
||||
@@ -198,7 +199,7 @@ public class BedTypeController {
|
||||
@CheckPermissions(routerIds = {"00320", "00520"}, permissionCodes = {"EXPORT"})
|
||||
@CheckPermission(routerId="00320",permissionCode="EXPORT")
|
||||
@RequestMapping(value = "/export_excel")
|
||||
public void exportExcel(HttpServletRequest request, HttpServletResponse response,@RequestBody(required=false) Map<String,Object> queryParas) throws Exception {
|
||||
public void exportExcel(HttpServletRequest request, HttpServletResponse response) throws Exception {
|
||||
QueryFilter queryFilter =new QueryFilter(request);
|
||||
queryFilter.setParaValue("groupType","GROUP");
|
||||
ExportDefine reportDef = ExcelUtils.getExportDefineByName("EXPORT_BED_TYPE_MAPPING");
|
||||
|
||||
+10
-8
@@ -22,6 +22,8 @@ import jakarta.annotation.Resource;
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
|
||||
import jakarta.validation.Valid;
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMethod;
|
||||
@@ -50,8 +52,8 @@ public class OtherRoomStatusController {
|
||||
@CheckPermissions(routerIds = {"00325", "00525"}, permissionCodes = {"ADD"})
|
||||
@CheckPermission(routerId="00325",permissionCode="ADD")
|
||||
@OperationLog(actionName="Create Other Property Room Status", eventCode = "other_room_status_create")
|
||||
@RequestMapping(value = "/app/other_room_status/create", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
|
||||
public AjaxResult createOtherRoomStatus(HttpServletRequest request, @RequestBody CfgOtherRoomStatusRequest roomStatus) {
|
||||
@RequestMapping(value = "/app/other_room_status/create", method = RequestMethod.POST, produces = "application/json;charset=UTF-8",consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||
public AjaxResult createOtherRoomStatus(HttpServletRequest request, @Valid @RequestBody CfgOtherRoomStatusRequest roomStatus) {
|
||||
if(otherRoomStatusService.validateDuplicate(roomStatus)) {
|
||||
return otherRoomStatusResponseFactory.buildCreateFailedDuplicate(roomStatus);
|
||||
}
|
||||
@@ -67,7 +69,7 @@ public class OtherRoomStatusController {
|
||||
@CheckPermissions(routerIds = {"00325", "00525"}, permissionCodes = {"MODIFY"})
|
||||
@CheckPermission(routerId="00325",permissionCode="MODIFY")
|
||||
@OperationLog(eventCode="other_room_status_update",actionName="Update Other Property Room Status")
|
||||
@RequestMapping(value = "/app/other_room_status/update", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
|
||||
@RequestMapping(value = "/app/other_room_status/update", method = RequestMethod.POST, produces = "application/json;charset=UTF-8",consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||
public AjaxResult updateRoom(HttpServletRequest request, @RequestBody CfgOtherRoomStatusRequest roomStatus) {
|
||||
if(otherRoomStatusService.validateDuplicate(roomStatus)) {
|
||||
return otherRoomStatusResponseFactory.buildUpdateFailedDuplicate(roomStatus);
|
||||
@@ -86,7 +88,7 @@ public class OtherRoomStatusController {
|
||||
|
||||
@CheckPermissions(routerIds = {"00325", "00525"}, permissionCodes = {"VIEW"})
|
||||
@CheckPermission(routerId="00325",permissionCode="VIEW")
|
||||
@RequestMapping(value = "/app/other_room_status/get", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
|
||||
@RequestMapping(value = "/app/other_room_status/get", method = RequestMethod.POST, produces = "application/json;charset=UTF-8",consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||
public AjaxResult getRoomById(HttpServletRequest request, @RequestBody(required=false) Map<String,Object> queryParas) {
|
||||
QueryFilter queryFilter = (queryParas!=null?new QueryFilter(queryParas):new QueryFilter(request));
|
||||
CfgOtherRoomStatusResponse otherRoomStatus = otherRoomStatusService.getOtherRoomStatusById(queryFilter.getInt("searchId"));
|
||||
@@ -99,7 +101,7 @@ public class OtherRoomStatusController {
|
||||
@CheckPermissions(routerIds = {"00325", "00525"}, permissionCodes = {"REMOVE"})
|
||||
@CheckPermission(routerId="00325",permissionCode="REMOVE")
|
||||
@OperationLog(eventCode="other_room_status_delete",actionName="Delete Other Property Room Status")
|
||||
@RequestMapping(value = "/app/other_room_status/delete", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
|
||||
@RequestMapping(value = "/app/other_room_status/delete", method = RequestMethod.POST, produces = "application/json;charset=UTF-8",consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||
public AjaxResult deleteRoom(HttpServletRequest request, @RequestBody CfgOtherRoomStatus roomStatus) {
|
||||
boolean isSuccess = otherRoomStatusService.deleteOtherRoomStatus(roomStatus);
|
||||
if(isSuccess) {
|
||||
@@ -110,7 +112,7 @@ public class OtherRoomStatusController {
|
||||
|
||||
@CheckPermissions(routerIds = {"00325", "00525"}, permissionCodes = {"VIEW"})
|
||||
@CheckPermission(routerId="00325",permissionCode="VIEW")
|
||||
@RequestMapping(value = "/app/other_room_status/get_page", produces = "application/json;charset=UTF-8")
|
||||
@RequestMapping(value = "/app/other_room_status/get_page", produces = "application/json;charset=UTF-8",consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||
public AjaxResult getRoomByPage(HttpServletRequest request,@RequestBody(required=false) Map<String,Object> queryParas) {
|
||||
QueryFilter queryFilter = (queryParas!=null?new QueryFilter(queryParas):new QueryFilter(request));
|
||||
return processPageRequest(queryFilter);
|
||||
@@ -121,7 +123,7 @@ public class OtherRoomStatusController {
|
||||
return otherRoomStatusResponseFactory.buildQuerySuccess(resultData);
|
||||
}
|
||||
|
||||
@RequestMapping(value = "/app/other_room_status/list", produces = "application/json;charset=UTF-8")
|
||||
@RequestMapping(value = "/app/other_room_status/list", produces = "application/json;charset=UTF-8",consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||
public AjaxResult queryOtherRoomStatus(HttpServletRequest request,@RequestBody(required=false) Map<String,Object> queryParas) {
|
||||
QueryFilter queryFilter = (queryParas!=null?new QueryFilter(queryParas):new QueryFilter(request));
|
||||
return processListRequest(queryFilter);
|
||||
@@ -130,7 +132,7 @@ public class OtherRoomStatusController {
|
||||
@CheckPermissions(routerIds = {"00325", "00525"}, permissionCodes = {"EXPORT"})
|
||||
@CheckPermission(routerId="00325",permissionCode="EXPORT")
|
||||
@RequestMapping(value = "/app/other_room_status/export_excel")
|
||||
public void exportExcel(HttpServletRequest request, HttpServletResponse response,@RequestBody(required=false) Map<String,Object> queryParas) throws Exception {
|
||||
public void exportExcel(HttpServletRequest request, HttpServletResponse response) throws Exception {
|
||||
QueryFilter queryFilter =new QueryFilter(request);
|
||||
ExportDefine reportDef = ExcelUtils.getExportDefineByName("EXPORT_ROOM_TYPE");
|
||||
if(reportDef!=null) {
|
||||
|
||||
@@ -30,6 +30,7 @@ import jakarta.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.commons.lang3.Strings;
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
@@ -58,7 +59,7 @@ public class RoomController {
|
||||
@CheckPermissions(routerIds = {"00310", "00510"}, permissionCodes = {"ADD"})
|
||||
@CheckPermission(routerId = "00310", permissionCode = "ADD")
|
||||
@OperationLog(eventCode = "room_create")
|
||||
@RequestMapping(value = "/app/room/create", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
|
||||
@RequestMapping(value = "/app/room/create", method = RequestMethod.POST, produces = "application/json;charset=UTF-8",consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||
public AjaxResult createRoom(HttpServletRequest request, @RequestBody CreateUpdateRoomRequest createRequest) {
|
||||
boolean isSuccess;
|
||||
String processMessage;
|
||||
@@ -85,7 +86,7 @@ public class RoomController {
|
||||
@CheckPermissions(routerIds = {"00310", "00510"}, permissionCodes = {"MODIFY"})
|
||||
@CheckPermission(routerId = "00310", permissionCode = "MODIFY")
|
||||
@OperationLog(eventCode = "room_update")
|
||||
@RequestMapping(value = "/app/room/update", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
|
||||
@RequestMapping(value = "/app/room/update", method = RequestMethod.POST, produces = "application/json;charset=UTF-8",consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||
public AjaxResult updateRoom(HttpServletRequest request, @RequestBody CreateUpdateRoomRequest updateRequest) {
|
||||
boolean isSuccess = false;
|
||||
String processMessage;
|
||||
@@ -119,7 +120,7 @@ public class RoomController {
|
||||
|
||||
@CheckPermissions(routerIds = {"00310", "00510"}, permissionCodes = {"VIEW"})
|
||||
@CheckPermission(routerId = "00310", permissionCode = "VIEW")
|
||||
@RequestMapping(value = "/app/room/get", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
|
||||
@RequestMapping(value = "/app/room/get", method = RequestMethod.POST, produces = "application/json;charset=UTF-8",consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||
public AjaxResult getRoomById(HttpServletRequest request, @RequestBody GetRoomRequest requestData) {
|
||||
boolean isSuccess;
|
||||
String processMessage;
|
||||
@@ -146,7 +147,7 @@ public class RoomController {
|
||||
@CheckPermissions(routerIds = {"00310", "00510"}, permissionCodes = {"ADD"})
|
||||
@CheckPermission(routerId = "00310", permissionCode = "REMOVE")
|
||||
@OperationLog(eventCode = "room_delete")
|
||||
@RequestMapping(value = "/app/room/delete", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
|
||||
@RequestMapping(value = "/app/room/delete", method = RequestMethod.POST, produces = "application/json;charset=UTF-8",consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||
public AjaxResult deleteRoom(HttpServletRequest request, @RequestBody DeleteRoomRequest deleteRoomRequest) {
|
||||
boolean isSuccess;
|
||||
String processMessage;
|
||||
@@ -165,7 +166,7 @@ public class RoomController {
|
||||
|
||||
@CheckPermissions(routerIds = {"00310", "00510"}, permissionCodes = {"VIEW"})
|
||||
@CheckPermission(routerId = "00310", permissionCode = "VIEW")
|
||||
@RequestMapping(value = "/app/room/get_page", produces = "application/json;charset=UTF-8")
|
||||
@RequestMapping(value = "/app/room/get_page", produces = "application/json;charset=UTF-8",consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||
public AjaxResult getRoomByPage(HttpServletRequest request, @RequestBody RoomPageRequest pageRequest) {
|
||||
boolean isSuccess;
|
||||
String processMessage;
|
||||
@@ -188,7 +189,7 @@ public class RoomController {
|
||||
return processResult;
|
||||
}
|
||||
|
||||
@RequestMapping(value = "/app/room/list", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
|
||||
@RequestMapping(value = "/app/room/list", method = RequestMethod.POST, produces = "application/json;charset=UTF-8",consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||
public AjaxResult queryRoom(HttpServletRequest request, @RequestBody RoomPageRequest pageRequest) {
|
||||
boolean isSuccess;
|
||||
String processMessage;
|
||||
@@ -221,7 +222,8 @@ public class RoomController {
|
||||
@CheckPermissions(routerIds = {"00310", "00510"}, permissionCodes = {"EXPORT"})
|
||||
@CheckPermission(routerId = "00310", permissionCode = "EXPORT")
|
||||
@RequestMapping(value = "/app/room/export_excel")
|
||||
public void exportExcel(HttpServletRequest request, HttpServletResponse response, @ModelAttribute RoomPageRequest pageRequest) throws Exception {
|
||||
public void exportExcel(HttpServletRequest request, HttpServletResponse response) throws Exception {
|
||||
RoomPageRequest pageRequest = (new QueryFilter(request)).convertToRequest(RoomPageRequest.class);
|
||||
ExportDefine reportDef = ExcelUtils.getExportDefineByName("EXPORT_ROOM_SETTING");
|
||||
if (reportDef != null) {
|
||||
List<CfgRoomsDto> listRoom = roomService.listRoom(pageRequest);
|
||||
|
||||
@@ -21,6 +21,7 @@ import com.mgm.mcrm.logging.services.SysLogOperationService;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import jakarta.annotation.Resource;
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMethod;
|
||||
@@ -43,7 +44,7 @@ public class RoomFeatureController {
|
||||
@CheckPermissions(routerIds = {"00316", "00516"}, permissionCodes = {"ADD"})
|
||||
@CheckPermission(routerId = "00316", permissionCode = "ADD")
|
||||
@OperationLog(eventCode = "room_feature_create")
|
||||
@RequestMapping(value = "/app/room_feature/create", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
|
||||
@RequestMapping(value = "/app/room_feature/create", method = RequestMethod.POST, produces = "application/json;charset=UTF-8",consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||
public AjaxResult createCfgRoomFeatures(HttpServletRequest request, @RequestBody CreateUpdateRoomFeatureRequest createRequest) {
|
||||
boolean isSuccess;
|
||||
String processMessage;
|
||||
@@ -76,7 +77,7 @@ public class RoomFeatureController {
|
||||
@CheckPermissions(routerIds = {"00316", "00516"}, permissionCodes = {"MODIFY"})
|
||||
@CheckPermission(routerId = "00316", permissionCode = "MODIFY")
|
||||
@OperationLog(eventCode = "room_feature_update")
|
||||
@RequestMapping(value = "/app/room_feature/update", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
|
||||
@RequestMapping(value = "/app/room_feature/update", method = RequestMethod.POST, produces = "application/json;charset=UTF-8",consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||
public AjaxResult updateCfgRoomFeatures(HttpServletRequest request, @RequestBody CreateUpdateRoomFeatureRequest updateRequest) {
|
||||
boolean isSuccess = false;
|
||||
String processMessage;
|
||||
@@ -114,7 +115,7 @@ public class RoomFeatureController {
|
||||
|
||||
@CheckPermissions(routerIds = {"00316", "00516"}, permissionCodes = {"VIEW"})
|
||||
@CheckPermission(routerId = "00316", permissionCode = "VIEW")
|
||||
@RequestMapping(value = "/app/room_feature/get", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
|
||||
@RequestMapping(value = "/app/room_feature/get", method = RequestMethod.POST, produces = "application/json;charset=UTF-8",consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||
public AjaxResult getCfgRoomFeaturesById(HttpServletRequest request, @RequestBody GetRoomFeatureRequest requestData) {
|
||||
boolean isSuccess;
|
||||
String processMessage;
|
||||
@@ -141,7 +142,7 @@ public class RoomFeatureController {
|
||||
@CheckPermissions(routerIds = {"00316", "00516"}, permissionCodes = {"REMOVE"})
|
||||
@CheckPermission(routerId = "00316", permissionCode = "REMOVE")
|
||||
@OperationLog(eventCode = "room_feature_delete")
|
||||
@RequestMapping(value = "/app/room_feature/delete", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
|
||||
@RequestMapping(value = "/app/room_feature/delete", method = RequestMethod.POST, produces = "application/json;charset=UTF-8",consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||
public AjaxResult deleteCfgRoomFeatures(HttpServletRequest request, @RequestBody DeleteRoomFeatureRequest requestData) {
|
||||
boolean isSuccess;
|
||||
String processMessage;
|
||||
@@ -158,7 +159,7 @@ public class RoomFeatureController {
|
||||
return processResult;
|
||||
}
|
||||
|
||||
@RequestMapping(value = "/app/room_feature/list", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
|
||||
@RequestMapping(value = "/app/room_feature/list", method = RequestMethod.POST, produces = "application/json;charset=UTF-8",consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||
public AjaxResult queryCfgRoomFeatures(HttpServletRequest request, @RequestBody RoomFeaturePageRequest pageRequest) {
|
||||
boolean isSuccess;
|
||||
String processMessage;
|
||||
@@ -183,7 +184,7 @@ public class RoomFeatureController {
|
||||
|
||||
@CheckPermissions(routerIds = {"00316", "00516"}, permissionCodes = {"VIEW"})
|
||||
@CheckPermission(routerId = "00316", permissionCode = "VIEW")
|
||||
@RequestMapping(value = "/app/room_feature/get_page", produces = "application/json;charset=UTF-8")
|
||||
@RequestMapping(value = "/app/room_feature/get_page", produces = "application/json;charset=UTF-8",consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||
public AjaxResult getCfgRoomFeaturesByPage(HttpServletRequest request, @RequestBody RoomFeaturePageRequest pageRequest) {
|
||||
boolean isSuccess;
|
||||
String processMessage;
|
||||
@@ -208,7 +209,13 @@ public class RoomFeatureController {
|
||||
|
||||
private boolean validateDuplicate(CreateUpdateRoomFeatureRequest request) {
|
||||
boolean isDuplicate = false;
|
||||
CfgRoomFeatures existsClass = roomFeatureService.checkDuplicateByKey(request.getId(), request.getCode(), request.getDlAttributeId(), request.getCategory());
|
||||
CfgRoomFeatures existsClass = roomFeatureService.checkDuplicateByKey(
|
||||
request.getId(),
|
||||
request.getCode(),
|
||||
request.getDlAttributeId(),
|
||||
request.getCategory(),
|
||||
request.getPropertyId()
|
||||
);
|
||||
if (existsClass != null) {
|
||||
isDuplicate = true;
|
||||
}
|
||||
@@ -217,7 +224,7 @@ public class RoomFeatureController {
|
||||
|
||||
@CheckPermissions(routerIds = {"00316", "00516"}, permissionCodes = {"VIEW"})
|
||||
@CheckPermission(routerId = "00316", permissionCode = "VIEW")
|
||||
@RequestMapping(value = "/app/room_feature/get_daylight_list", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
|
||||
@RequestMapping(value = "/app/room_feature/get_daylight_list", method = RequestMethod.POST, produces = "application/json;charset=UTF-8",consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||
public AjaxResult getDayLightRoomFeatures(
|
||||
HttpServletRequest request,
|
||||
@RequestBody PropertyIdRequest propertyIdRequest) throws Exception {
|
||||
|
||||
@@ -26,6 +26,7 @@ import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import jakarta.annotation.Resource;
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
@@ -48,7 +49,7 @@ public class RoomTypeController {
|
||||
@CheckPermissions(routerIds = {"00311", "00511"}, permissionCodes = {"ADD"})
|
||||
@CheckPermission(routerId = "00311", permissionCode = "ADD")
|
||||
@OperationLog(actionName = "Create Room Type", eventCode = "room_type_create")
|
||||
@RequestMapping(value = "/app/room_type/create", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
|
||||
@RequestMapping(value = "/app/room_type/create", method = RequestMethod.POST, produces = "application/json;charset=UTF-8",consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||
public AjaxResult createRoomType(HttpServletRequest request, @RequestBody CreateUpdateRoomTypeRequest createRequest) {
|
||||
boolean isSuccess;
|
||||
String processMessage;
|
||||
@@ -82,7 +83,7 @@ public class RoomTypeController {
|
||||
@CheckPermissions(routerIds = {"00311", "00511"}, permissionCodes = {"MODIFY"})
|
||||
@CheckPermission(routerId = "00311", permissionCode = "MODIFY")
|
||||
@OperationLog(eventCode = "room_type_update", actionName = "Update Room Type")
|
||||
@RequestMapping(value = "/app/room_type/update", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
|
||||
@RequestMapping(value = "/app/room_type/update", method = RequestMethod.POST, produces = "application/json;charset=UTF-8",consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||
public AjaxResult updateRoom(HttpServletRequest request, @RequestBody CreateUpdateRoomTypeRequest updateRequest) {
|
||||
boolean isSuccess = false;
|
||||
String processMessage;
|
||||
@@ -121,7 +122,7 @@ public class RoomTypeController {
|
||||
|
||||
@CheckPermissions(routerIds = {"00311", "00511"}, permissionCodes = {"VIEW"})
|
||||
@CheckPermission(routerId = "00311", permissionCode = "VIEW")
|
||||
@RequestMapping(value = "/app/room_type/get", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
|
||||
@RequestMapping(value = "/app/room_type/get", method = RequestMethod.POST, produces = "application/json;charset=UTF-8",consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||
public AjaxResult getRoomById(HttpServletRequest request, @RequestBody GetRoomTypeRequest requestData) {
|
||||
boolean isSuccess;
|
||||
String processMessage;
|
||||
@@ -148,7 +149,7 @@ public class RoomTypeController {
|
||||
@CheckPermissions(routerIds = {"00311", "00511"}, permissionCodes = {"REMOVE"})
|
||||
@CheckPermission(routerId = "00311", permissionCode = "REMOVE")
|
||||
@OperationLog(eventCode = "room_type_delete", actionName = "Delete Room Type")
|
||||
@RequestMapping(value = "/app/room_type/delete", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
|
||||
@RequestMapping(value = "/app/room_type/delete", method = RequestMethod.POST, produces = "application/json;charset=UTF-8",consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||
public AjaxResult deleteRoom(HttpServletRequest request, @RequestBody DeleteRoomTypeRequest requestData) {
|
||||
boolean isSuccess;
|
||||
String processMessage;
|
||||
@@ -172,7 +173,7 @@ public class RoomTypeController {
|
||||
|
||||
@CheckPermissions(routerIds = {"00311", "00511"}, permissionCodes = {"VIEW"})
|
||||
@CheckPermission(routerId = "00311", permissionCode = "VIEW")
|
||||
@RequestMapping(value = "/app/room_type/get_page", produces = "application/json;charset=UTF-8")
|
||||
@RequestMapping(value = "/app/room_type/get_page", produces = "application/json;charset=UTF-8",consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||
public AjaxResult getRoomByPage(HttpServletRequest request, @RequestBody RoomTypePageRequest pageRequest) {
|
||||
boolean isSuccess;
|
||||
String processMessage;
|
||||
@@ -195,7 +196,7 @@ public class RoomTypeController {
|
||||
return processResult;
|
||||
}
|
||||
|
||||
@RequestMapping(value = "/app/room_type/list", produces = "application/json;charset=UTF-8")
|
||||
@RequestMapping(value = "/app/room_type/list", produces = "application/json;charset=UTF-8",consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||
public AjaxResult queryRoomType(HttpServletRequest request, @RequestBody RoomTypePageRequest pageRequest) {
|
||||
boolean isSuccess;
|
||||
String processMessage;
|
||||
@@ -221,7 +222,8 @@ public class RoomTypeController {
|
||||
@CheckPermissions(routerIds = {"00311", "00511"}, permissionCodes = {"EXPORT"})
|
||||
@CheckPermission(routerId = "00311", permissionCode = "EXPORT")
|
||||
@RequestMapping(value = "/app/room_type/export_excel")
|
||||
public void exportExcel(HttpServletRequest request, HttpServletResponse response, @ModelAttribute RoomTypePageRequest pageRequest) throws Exception {
|
||||
public void exportExcel(HttpServletRequest request, HttpServletResponse response) throws Exception {
|
||||
RoomTypePageRequest pageRequest = (new QueryFilter(request)).convertToRequest(RoomTypePageRequest.class);
|
||||
ExportDefine reportDef = ExcelUtils.getExportDefineByName("EXPORT_ROOM_TYPE");
|
||||
if (reportDef != null) {
|
||||
List<CfgRoomTypesDto> listRoomType = roomTypeService.listRoomType(pageRequest);
|
||||
@@ -290,7 +292,7 @@ public class RoomTypeController {
|
||||
}
|
||||
|
||||
@OperationLog(eventCode = "day_light_room_type_list")
|
||||
@RequestMapping(value = "/app/room_type/day_light_room_type_list", method = RequestMethod.POST)
|
||||
@RequestMapping(value = "/app/room_type/day_light_room_type_list", method = RequestMethod.POST,consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||
public AjaxResult daylightRoomTypeList(@RequestBody PropertyIdRequest propertyIdRequest) throws Exception {
|
||||
AjaxResult processResult = new AjaxResult();
|
||||
try {
|
||||
@@ -309,7 +311,7 @@ public class RoomTypeController {
|
||||
|
||||
private boolean validateDuplicate(CreateUpdateRoomTypeRequest createRequest) {
|
||||
boolean isDuplicate = false;
|
||||
boolean existsClass = roomTypeService.checkDuplicateByKey(createRequest.getId(), createRequest.getDlRoomTypeId(), createRequest.getCategory(), createRequest.getCode());
|
||||
boolean existsClass = roomTypeService.checkDuplicateByKey(createRequest.getId(), createRequest.getDlRoomTypeId(), createRequest.getCategory(), createRequest.getPropertyId());
|
||||
if (existsClass) {
|
||||
isDuplicate = true;
|
||||
}
|
||||
|
||||
+2
-2
@@ -37,9 +37,9 @@ public class CreateUpdateRoomRequest {
|
||||
|
||||
private String calendarName;
|
||||
|
||||
private Integer showCalendar;
|
||||
private Integer showCalendar = 0;
|
||||
|
||||
private Integer defaultShowCalendar;
|
||||
private Integer defaultShowCalendar = 0;
|
||||
|
||||
private Integer calendarOrder;
|
||||
}
|
||||
|
||||
@@ -148,7 +148,13 @@ public class RoomFeatureService {
|
||||
};
|
||||
}
|
||||
|
||||
public CfgRoomFeatures checkDuplicateByKey(Integer excludeId, String code, String dlCode, String category) {
|
||||
public CfgRoomFeatures checkDuplicateByKey(
|
||||
Integer excludeId,
|
||||
String code,
|
||||
String dlAttributeId,
|
||||
String category,
|
||||
Integer propertyId
|
||||
) {
|
||||
Specification<CfgRoomFeatures> checkDuplicateSpec = (root, criteriaQuery, cb) -> {
|
||||
List<Predicate> list = new ArrayList<>();
|
||||
if (excludeId != null && excludeId > 0) {
|
||||
@@ -160,10 +166,10 @@ public class RoomFeatureService {
|
||||
if ("OPERA".equals(category)) {
|
||||
list.add(cb.equal(root.get("code"), code));
|
||||
} else if ("DAYLIGHT".equals(category)) {
|
||||
list.add(cb.equal(root.get("code"), code));
|
||||
list.add(cb.equal(root.get("propertyId"), propertyId));;
|
||||
list.add(
|
||||
cb.or(
|
||||
cb.equal(root.get("dlAttributeId"), dlCode)
|
||||
cb.equal(root.get("dlAttributeId"), dlAttributeId)
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
@@ -147,7 +147,7 @@ public class RoomTypeService {
|
||||
return true;
|
||||
}
|
||||
|
||||
public boolean checkDuplicateByKey(Long excludeId, String dlRoomTypeId, String category, String code) {
|
||||
public boolean checkDuplicateByKey(Long excludeId, String dlRoomTypeId, String category, Integer propertyId) {
|
||||
Specification<CfgRoomTypes> checkDuplicateSpec = (root, criteriaQuery, cb) -> {
|
||||
List<Predicate> list = new ArrayList<>();
|
||||
if (excludeId != null && excludeId > 0) {
|
||||
@@ -158,7 +158,7 @@ public class RoomTypeService {
|
||||
}
|
||||
list.add(cb.equal(root.get("category"), category));
|
||||
|
||||
list.add(cb.equal(root.get("code"), code));
|
||||
list.add(cb.equal(root.get("propertyId"), propertyId));
|
||||
|
||||
Predicate[] predicates = new Predicate[list.size()];
|
||||
criteriaQuery.where(list.toArray(predicates));
|
||||
|
||||
@@ -12,6 +12,7 @@ import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import jakarta.annotation.Resource;
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMethod;
|
||||
@@ -33,7 +34,7 @@ public class AppUserController {
|
||||
private SysLogOperationService sysAuditLogService;
|
||||
|
||||
@OperationLog(actionName="Create AppUser", eventCode = "user_create")
|
||||
@RequestMapping(value = "/app/user/create", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
|
||||
@RequestMapping(value = "/app/user/create", method = RequestMethod.POST, produces = "application/json;charset=UTF-8",consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||
public AjaxResult createAppUser(HttpServletRequest request, @RequestBody AppUsers user) {
|
||||
boolean isSuccess = false;
|
||||
String processMessage="";
|
||||
@@ -64,7 +65,7 @@ public class AppUserController {
|
||||
}
|
||||
|
||||
@OperationLog(eventCode="user_update",actionName="Update AppUser")
|
||||
@RequestMapping(value = "/app/user/update", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
|
||||
@RequestMapping(value = "/app/user/update", method = RequestMethod.POST, produces = "application/json;charset=UTF-8",consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||
public AjaxResult updateAppUser(HttpServletRequest request, @RequestBody AppUsers user) {
|
||||
boolean isSuccess = false;
|
||||
String processMessage="";
|
||||
@@ -101,7 +102,7 @@ public class AppUserController {
|
||||
return processResult;
|
||||
}
|
||||
|
||||
@RequestMapping(value = "/app/user/get", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
|
||||
@RequestMapping(value = "/app/user/get", method = RequestMethod.POST, produces = "application/json;charset=UTF-8",consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||
public AjaxResult getAppUserById(HttpServletRequest request, @RequestBody(required=false) Map<String,Object> queryParas) {
|
||||
boolean isSuccess = false;
|
||||
String processMessage="";
|
||||
@@ -127,7 +128,7 @@ public class AppUserController {
|
||||
}
|
||||
|
||||
@OperationLog(eventCode="user_delete",actionName="Delete AppUser")
|
||||
@RequestMapping(value = "/app/user/delete", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
|
||||
@RequestMapping(value = "/app/user/delete", method = RequestMethod.POST, produces = "application/json;charset=UTF-8",consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||
public AjaxResult deleteAppUser(HttpServletRequest request, @RequestBody AppUsers user) {
|
||||
boolean isSuccess = false;
|
||||
String processMessage="";
|
||||
@@ -144,7 +145,7 @@ public class AppUserController {
|
||||
return processResult;
|
||||
}
|
||||
|
||||
@RequestMapping(value = "/app/user/get_page", produces = "application/json;charset=UTF-8")
|
||||
@RequestMapping(value = "/app/user/get_page", produces = "application/json;charset=UTF-8",consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||
public AjaxResult getAppUserByPage(HttpServletRequest request,@RequestBody(required=false) Map<String,Object> queryParas) {
|
||||
QueryFilter queryFilter = (queryParas!=null?new QueryFilter(queryParas):new QueryFilter(request));
|
||||
return processPageRequest(queryFilter,"");
|
||||
|
||||
@@ -23,6 +23,7 @@ import jakarta.annotation.Resource;
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
@@ -44,7 +45,7 @@ public class DepartmentController {
|
||||
@CheckPermissions(routerIds = {"00303", "00503"}, permissionCodes = {"ADD"})
|
||||
@CheckPermission(routerId="00303",permissionCode="ADD")
|
||||
@OperationLog(actionName="Create Department", eventCode = "department_create")
|
||||
@RequestMapping(value = "/app/department/create", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
|
||||
@RequestMapping(value = "/app/department/create", method = RequestMethod.POST, produces = "application/json;charset=UTF-8",consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||
public AjaxResult createCfgDepartments(HttpServletRequest request, @RequestBody CreateUpdateCfgDepartmentRequest createRequest) {
|
||||
boolean isSuccess;
|
||||
String processMessage;
|
||||
@@ -77,7 +78,7 @@ public class DepartmentController {
|
||||
@CheckPermissions(routerIds = {"00303", "00503"}, permissionCodes = {"MODIFY"})
|
||||
@CheckPermission(routerId = "00303",permissionCode = "MODIFY")
|
||||
@OperationLog(eventCode = "department_update", actionName = "Update Department")
|
||||
@RequestMapping(value = "/app/department/update", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
|
||||
@RequestMapping(value = "/app/department/update", method = RequestMethod.POST, produces = "application/json;charset=UTF-8",consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||
public AjaxResult updateCfgDepartments(HttpServletRequest request, @RequestBody CreateUpdateCfgDepartmentRequest updateRequest) {
|
||||
boolean isSuccess = false;
|
||||
String processMessage;
|
||||
@@ -115,7 +116,7 @@ public class DepartmentController {
|
||||
|
||||
@CheckPermissions(routerIds = {"00303", "00503"}, permissionCodes = {"VIEW"})
|
||||
@CheckPermission(routerId = "00303",permissionCode = "VIEW")
|
||||
@PostMapping(value = "/app/department/get", produces = "application/json;charset=UTF-8")
|
||||
@PostMapping(value = "/app/department/get", produces = "application/json;charset=UTF-8",consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||
public AjaxResult getCfgDepartmentsById(HttpServletRequest request, @RequestBody GetCfgDepartmentRequest requestData) {
|
||||
boolean isSuccess;
|
||||
String processMessage;
|
||||
@@ -142,7 +143,7 @@ public class DepartmentController {
|
||||
@CheckPermissions(routerIds = {"00303", "00503"}, permissionCodes = {"REMOVE"})
|
||||
@CheckPermission(routerId = "00303",permissionCode = "REMOVE")
|
||||
@OperationLog(eventCode = "department_delete",actionName = "Delete Department")
|
||||
@PostMapping(value = "/app/department/delete", produces = "application/json;charset=UTF-8")
|
||||
@PostMapping(value = "/app/department/delete", produces = "application/json;charset=UTF-8",consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||
public AjaxResult deleteCfgDepartments(HttpServletRequest request, @RequestBody DeleteCfgDepartmentRequest requestData) {
|
||||
boolean isSuccess;
|
||||
String processMessage;
|
||||
@@ -164,7 +165,7 @@ public class DepartmentController {
|
||||
return processResult;
|
||||
}
|
||||
|
||||
@RequestMapping(value = "/app/department/list", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
|
||||
@RequestMapping(value = "/app/department/list", method = RequestMethod.POST, produces = "application/json;charset=UTF-8",consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||
public AjaxResult queryCfgDepartments(HttpServletRequest request, @RequestBody DepartmentPageRequest requestData) {
|
||||
boolean isSuccess;
|
||||
String processMessage;
|
||||
@@ -189,7 +190,7 @@ public class DepartmentController {
|
||||
|
||||
@CheckPermissions(routerIds = {"00303", "00503"}, permissionCodes = {"VIEW"})
|
||||
@CheckPermission(routerId = "00303",permissionCode = "VIEW")
|
||||
@RequestMapping(value = "/app/department/get_page", produces = "application/json;charset=UTF-8")
|
||||
@RequestMapping(value = "/app/department/get_page", produces = "application/json;charset=UTF-8",consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||
public AjaxResult getCfgDepartmentsByPage(HttpServletRequest request, @RequestBody DepartmentPageRequest requestData) {
|
||||
|
||||
boolean isSuccess;
|
||||
@@ -217,7 +218,8 @@ public class DepartmentController {
|
||||
@CheckPermissions(routerIds = {"00303", "00503"}, permissionCodes = {"EXPORT"})
|
||||
@CheckPermission(routerId="00303",permissionCode="EXPORT")
|
||||
@RequestMapping(value = "/app/department/export_excel")
|
||||
public void exportExcel(HttpServletRequest request, HttpServletResponse response,@RequestBody DepartmentPageRequest pageRequest) throws Exception {
|
||||
public void exportExcel(HttpServletRequest request, HttpServletResponse response) throws Exception {
|
||||
DepartmentPageRequest pageRequest = (new QueryFilter(request)).convertToRequest(DepartmentPageRequest.class);
|
||||
ExportDefine reportDef = ExcelUtils.getExportDefineByName("EXPORT_DEPARTMENT");
|
||||
if(reportDef!=null) {
|
||||
List<CfgDepartmentsDto> listCfgDepartments = departmentService.listDepartment(pageRequest);
|
||||
|
||||
@@ -23,6 +23,7 @@ import jakarta.annotation.Resource;
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
@@ -46,7 +47,7 @@ public class DivisionController {
|
||||
@CheckPermissions(routerIds = {"00302", "00502"}, permissionCodes = {"ADD"})
|
||||
@CheckPermission(routerId = "00302", permissionCode = "ADD")
|
||||
@OperationLog(eventCode = "division_create")
|
||||
@PostMapping(value = "/app/division/create", produces = "application/json;charset=UTF-8")
|
||||
@PostMapping(value = "/app/division/create", produces = "application/json;charset=UTF-8",consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||
public AjaxResult createCfgDivisions(HttpServletRequest request, @RequestBody CreateUpdateCfgDivisionRequest createRequest) {
|
||||
AjaxResult processResult = new AjaxResult();
|
||||
|
||||
@@ -76,7 +77,7 @@ public class DivisionController {
|
||||
@CheckPermissions(routerIds = {"00302", "00502"}, permissionCodes = {"MODIFY"})
|
||||
@CheckPermission(routerId = "00302", permissionCode = "MODIFY")
|
||||
@OperationLog(eventCode = "division_update")
|
||||
@PostMapping(value = "/app/division/update", produces = "application/json;charset=UTF-8")
|
||||
@PostMapping(value = "/app/division/update", produces = "application/json;charset=UTF-8",consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||
public AjaxResult updateCfgDivisions(HttpServletRequest request, @RequestBody CreateUpdateCfgDivisionRequest updateRequest) {
|
||||
|
||||
AjaxResult processResult = new AjaxResult();
|
||||
@@ -111,7 +112,7 @@ public class DivisionController {
|
||||
|
||||
@CheckPermissions(routerIds = {"00302", "00502"}, permissionCodes = {"VIEW"})
|
||||
@CheckPermission(routerId = "00302", permissionCode = "VIEW")
|
||||
@PostMapping(value = "/app/division/get", produces = "application/json;charset=UTF-8")
|
||||
@PostMapping(value = "/app/division/get", produces = "application/json;charset=UTF-8",consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||
public AjaxResult getCfgDivisionsById(HttpServletRequest request, @RequestBody GetCfgDivisionRequest requestData) {
|
||||
|
||||
AjaxResult processResult = new AjaxResult();
|
||||
@@ -133,7 +134,7 @@ public class DivisionController {
|
||||
|
||||
@CheckPermissions(routerIds = {"00302", "00502"}, permissionCodes = {"VIEW"})
|
||||
@CheckPermission(routerId = "00302", permissionCode = "VIEW")
|
||||
@RequestMapping(value = "/app/division/get_view", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
|
||||
@RequestMapping(value = "/app/division/get_view", method = RequestMethod.POST, produces = "application/json;charset=UTF-8",consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||
public AjaxResult getCfgDivisionsViewById(HttpServletRequest request, @RequestBody GetCfgDivisionRequest requestData) {
|
||||
|
||||
AjaxResult processResult = new AjaxResult();
|
||||
@@ -156,7 +157,7 @@ public class DivisionController {
|
||||
@CheckPermissions(routerIds = {"00302", "00502"}, permissionCodes = {"REMOVE"})
|
||||
@CheckPermission(routerId = "00302", permissionCode = "REMOVE")
|
||||
@OperationLog(eventCode = "division_delete")
|
||||
@PostMapping(value = "/app/division/delete", produces = "application/json;charset=UTF-8")
|
||||
@PostMapping(value = "/app/division/delete", produces = "application/json;charset=UTF-8",consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||
public AjaxResult deleteCfgDivisions(HttpServletRequest request, @RequestBody DeleteCfgDivisionRequest requestData) {
|
||||
AjaxResult processResult = new AjaxResult();
|
||||
|
||||
@@ -174,7 +175,7 @@ public class DivisionController {
|
||||
return processResult;
|
||||
}
|
||||
|
||||
@RequestMapping(value = "/app/division/list", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
|
||||
@RequestMapping(value = "/app/division/list", method = RequestMethod.POST, produces = "application/json;charset=UTF-8",consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||
public AjaxResult queryCfgDivisions(HttpServletRequest request, @RequestBody DivisionPageRequest requestData) {
|
||||
|
||||
AjaxResult processResult = new AjaxResult();
|
||||
@@ -195,7 +196,7 @@ public class DivisionController {
|
||||
|
||||
@CheckPermissions(routerIds = {"00302", "00502"}, permissionCodes = {"VIEW"})
|
||||
@CheckPermission(routerId = "00302", permissionCode = "VIEW")
|
||||
@PostMapping(value = "/app/division/get_page", produces = "application/json;charset=UTF-8")
|
||||
@PostMapping(value = "/app/division/get_page", produces = "application/json;charset=UTF-8",consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||
public AjaxResult getCfgDivisionsByPage(HttpServletRequest request, @RequestBody DivisionPageRequest requestData) {
|
||||
|
||||
AjaxResult processResult = new AjaxResult();
|
||||
@@ -217,7 +218,8 @@ public class DivisionController {
|
||||
@CheckPermissions(routerIds = {"00302", "00502"}, permissionCodes = {"EXPORT"})
|
||||
@CheckPermission(routerId = "00302", permissionCode = "EXPORT")
|
||||
@RequestMapping(value = "/app/division/export_excel")
|
||||
public void exportExcel(HttpServletRequest request, HttpServletResponse response, @RequestBody DivisionPageRequest pageRequest) throws Exception {
|
||||
public void exportExcel(HttpServletRequest request, HttpServletResponse response) throws Exception {
|
||||
DivisionPageRequest pageRequest = (new QueryFilter(request)).convertToRequest(DivisionPageRequest.class);
|
||||
ExportDefine reportDef = ExcelUtils.getExportDefineByName("EXPORT_DIVISION");
|
||||
if (reportDef != null) {
|
||||
List<CfgDivisionsDto> listDivision = divisionService.listDivision(pageRequest);
|
||||
|
||||
+7
-6
@@ -22,6 +22,7 @@ import jakarta.annotation.Resource;
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMethod;
|
||||
@@ -55,7 +56,7 @@ public class OtherUserMappingController {
|
||||
@CheckPermissions(routerIds = {"00327", "00527"}, permissionCodes = {"ADD"})
|
||||
@CheckPermission(routerId = "00327", permissionCode = "ADD")
|
||||
@OperationLog(actionName = "Create OtherUserMapping", eventCode = "other_user_mapping_create")
|
||||
@RequestMapping(value = "/create", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
|
||||
@RequestMapping(value = "/create", method = RequestMethod.POST, produces = "application/json;charset=UTF-8",consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||
public AjaxResult createOtherUserMapping(HttpServletRequest request, @RequestBody CfgOtherUserRequest userMapping) {
|
||||
AjaxResult validateResult = validateData(userMapping, new String[]{"createdAt"}, new String[]{"createdAt"});
|
||||
if (!validateResult.isSuccess()) {
|
||||
@@ -78,7 +79,7 @@ public class OtherUserMappingController {
|
||||
@CheckPermissions(routerIds = {"00327", "00527"}, permissionCodes = {"MODIFY"})
|
||||
@CheckPermission(routerId = "00327", permissionCode = "MODIFY")
|
||||
@OperationLog(eventCode = "other_user_mapping_update", actionName = "Update OtherUserMapping")
|
||||
@RequestMapping(value = "/update", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
|
||||
@RequestMapping(value = "/update", method = RequestMethod.POST, produces = "application/json;charset=UTF-8",consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||
public AjaxResult updateOtherUserMapping(HttpServletRequest request, @RequestBody CfgOtherUserRequest userMapping) {
|
||||
AjaxResult validateResult = validateData(userMapping, new String[]{"createdAt"}, new String[]{"createdAt"});
|
||||
if (!validateResult.isSuccess()) {
|
||||
@@ -98,7 +99,7 @@ public class OtherUserMappingController {
|
||||
|
||||
@CheckPermissions(routerIds = {"00327", "00527"}, permissionCodes = {"VIEW"})
|
||||
@CheckPermission(routerId = "00327", permissionCode = "VIEW")
|
||||
@RequestMapping(value = "/get", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
|
||||
@RequestMapping(value = "/get", method = RequestMethod.POST, produces = "application/json;charset=UTF-8",consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||
public AjaxResult getOtherUserMappingById(HttpServletRequest request, @RequestBody(required = false) Map<String, Object> queryParas) {
|
||||
QueryFilter queryFilter = (queryParas != null ? new QueryFilter(queryParas) : new QueryFilter(request));
|
||||
CfgOtherUserMappingView userMapping = userMappingService.getOtherUserMappingViewById(queryFilter.getInt("searchId"));
|
||||
@@ -111,7 +112,7 @@ public class OtherUserMappingController {
|
||||
@CheckPermissions(routerIds = {"00327", "00527"}, permissionCodes = {"REMOVE"})
|
||||
@CheckPermission(routerId = "00327", permissionCode = "REMOVE")
|
||||
@OperationLog(eventCode = "other_user_mapping_delete", actionName = "Delete Other User Mapping")
|
||||
@RequestMapping(value = "/delete", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
|
||||
@RequestMapping(value = "/delete", method = RequestMethod.POST, produces = "application/json;charset=UTF-8",consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||
public AjaxResult deleteOtherUserMapping(HttpServletRequest request, @RequestBody CfgOtherUserRequest userMapping) {
|
||||
boolean isSuccess = userMappingService.deleteOtherUserMapping(userMapping);
|
||||
if (isSuccess) {
|
||||
@@ -122,7 +123,7 @@ public class OtherUserMappingController {
|
||||
|
||||
@CheckPermissions(routerIds = {"00327", "00527"}, permissionCodes = {"VIEW"})
|
||||
@CheckPermission(routerId = "00327", permissionCode = "VIEW")
|
||||
@RequestMapping(value = "/get_page", produces = "application/json;charset=UTF-8")
|
||||
@RequestMapping(value = "/get_page", produces = "application/json;charset=UTF-8",consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||
public AjaxResult getOtherUserMappingByPage(HttpServletRequest request, @RequestBody(required = false) Map<String, Object> queryParas) {
|
||||
QueryFilter queryFilter = (queryParas != null ? new QueryFilter(queryParas) : new QueryFilter(request));
|
||||
return processPageRequest(queryFilter);
|
||||
@@ -131,7 +132,7 @@ public class OtherUserMappingController {
|
||||
@CheckPermissions(routerIds = {"00327", "00527"}, permissionCodes = {"EXPORT"})
|
||||
@CheckPermission(routerId = "00327", permissionCode = "EXPORT")
|
||||
@RequestMapping(value = "/export_excel")
|
||||
public void exportExcel(HttpServletRequest request, HttpServletResponse response, @RequestBody(required = false) Map<String, Object> queryParas) throws Exception {
|
||||
public void exportExcel(HttpServletRequest request, HttpServletResponse response) throws Exception {
|
||||
QueryFilter queryFilter = new QueryFilter(request);
|
||||
ExportDefine reportDef = ExcelUtils.getExportDefineByName("EXPORT_OTHER_USER_MAPPING");
|
||||
if (reportDef != null) {
|
||||
|
||||
@@ -14,6 +14,7 @@ import com.mgm.mcrm.basesetting.team.models.CfgSections;
|
||||
import com.mgm.mcrm.basesetting.team.services.SectionService;
|
||||
import com.mgm.mcrm.common.annotation.security.CheckPermissions;
|
||||
import com.mgm.mcrm.common.dtos.DataTableResult;
|
||||
import com.mgm.mcrm.common.dtos.QueryFilter;
|
||||
import com.mgm.mcrm.common.dtos.ServiceResult;
|
||||
import com.mgm.mcrm.common.dtos.dataimport.appsetting.SectionImportRow;
|
||||
import com.mgm.mcrm.common.dtos.excelmodel.ExportDefine;
|
||||
@@ -23,6 +24,7 @@ import jakarta.annotation.Resource;
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
@@ -48,7 +50,7 @@ public class SectionController {
|
||||
@CheckPermissions(routerIds = {"00318", "00518"}, permissionCodes = {"ADD"})
|
||||
@CheckPermission(routerId = "00318", permissionCode = "ADD")
|
||||
@OperationLog(actionName = "Create Section", eventCode = "section_create")
|
||||
@RequestMapping(value = "/app/section/create", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
|
||||
@RequestMapping(value = "/app/section/create", method = RequestMethod.POST, produces = "application/json;charset=UTF-8",consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||
public AjaxResult createCfgSections(HttpServletRequest request, @RequestBody CreateUpdateSectionRequest createRequest) {
|
||||
boolean isSuccess;
|
||||
String processMessage;
|
||||
@@ -81,7 +83,7 @@ public class SectionController {
|
||||
@CheckPermissions(routerIds = {"00318", "00518"}, permissionCodes = {"MODIFY"})
|
||||
@CheckPermission(routerId = "00318", permissionCode = "MODIFY")
|
||||
@OperationLog(eventCode = "section_update", actionName = "Update Section")
|
||||
@RequestMapping(value = "/app/section/update", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
|
||||
@RequestMapping(value = "/app/section/update", method = RequestMethod.POST, produces = "application/json;charset=UTF-8",consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||
public AjaxResult updateCfgSections(HttpServletRequest request, @RequestBody CreateUpdateSectionRequest updateRequest) {
|
||||
boolean isSuccess = false;
|
||||
String processMessage;
|
||||
@@ -120,7 +122,7 @@ public class SectionController {
|
||||
|
||||
@CheckPermissions(routerIds = {"00318", "00518"}, permissionCodes = {"VIEW"})
|
||||
@CheckPermission(routerId = "00318", permissionCode = "VIEW")
|
||||
@RequestMapping(value = "/app/section/get", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
|
||||
@RequestMapping(value = "/app/section/get", method = RequestMethod.POST, produces = "application/json;charset=UTF-8",consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||
public AjaxResult getCfgSectionsById(HttpServletRequest request, @RequestBody GetCfgSectionRequest requestData) {
|
||||
boolean isSuccess;
|
||||
String processMessage;
|
||||
@@ -147,7 +149,7 @@ public class SectionController {
|
||||
@CheckPermissions(routerIds = {"00318", "00518"}, permissionCodes = {"REMOVE"})
|
||||
@CheckPermission(routerId = "00318", permissionCode = "REMOVE")
|
||||
@OperationLog(eventCode = "section_delete", actionName = "Delete Section")
|
||||
@RequestMapping(value = "/app/section/delete", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
|
||||
@RequestMapping(value = "/app/section/delete", method = RequestMethod.POST, produces = "application/json;charset=UTF-8",consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||
public AjaxResult deleteCfgSections(HttpServletRequest request, @RequestBody DeleteCfgSectionRequest requestData) {
|
||||
boolean isSuccess;
|
||||
String processMessage;
|
||||
@@ -169,7 +171,7 @@ public class SectionController {
|
||||
return processResult;
|
||||
}
|
||||
|
||||
@RequestMapping(value = "/app/section/list", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
|
||||
@RequestMapping(value = "/app/section/list", method = RequestMethod.POST, produces = "application/json;charset=UTF-8",consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||
public AjaxResult queryCfgSections(HttpServletRequest request, @RequestBody SectionPageRequest pageRequest) {
|
||||
boolean isSuccess;
|
||||
String processMessage;
|
||||
@@ -194,7 +196,7 @@ public class SectionController {
|
||||
|
||||
@CheckPermissions(routerIds = {"00318", "00518"}, permissionCodes = {"VIEW"})
|
||||
@CheckPermission(routerId = "00318", permissionCode = "VIEW")
|
||||
@RequestMapping(value = "/app/section/get_page", produces = "application/json;charset=UTF-8")
|
||||
@RequestMapping(value = "/app/section/get_page", produces = "application/json;charset=UTF-8",consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||
public AjaxResult getCfgSectionsByPage(HttpServletRequest request, @RequestBody SectionPageRequest pageRequest) {
|
||||
|
||||
boolean isSuccess;
|
||||
@@ -222,7 +224,8 @@ public class SectionController {
|
||||
@CheckPermissions(routerIds = {"00318", "00518"}, permissionCodes = {"EXPORT"})
|
||||
@CheckPermission(routerId = "00318", permissionCode = "EXPORT")
|
||||
@RequestMapping(value = "/app/section/export_excel")
|
||||
public void exportExcel(HttpServletRequest request, HttpServletResponse response, @RequestBody SectionPageRequest pageRequest) throws Exception {
|
||||
public void exportExcel(HttpServletRequest request, HttpServletResponse response) throws Exception {
|
||||
SectionPageRequest pageRequest = (new QueryFilter(request)).convertToRequest(SectionPageRequest.class);
|
||||
ExportDefine reportDef = ExcelUtils.getExportDefineByName("EXPORT_SECTION");
|
||||
if (reportDef != null) {
|
||||
List<CfgSectionsDto> listCfgSections = sectionService.listSection(pageRequest);
|
||||
|
||||
+10
-8
@@ -24,6 +24,7 @@ import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import jakarta.annotation.Resource;
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMethod;
|
||||
@@ -46,7 +47,7 @@ public class TeamStructureController {
|
||||
|
||||
@CheckPermission(routerId = "00319", permissionCode = "ADD")
|
||||
@OperationLog(actionName = "Create TeamStructure", eventCode = "teamStructure_create")
|
||||
@RequestMapping(value = "/app/team_structure/create", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
|
||||
@RequestMapping(value = "/app/team_structure/create", method = RequestMethod.POST, produces = "application/json;charset=UTF-8",consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||
public AjaxResult createCfgTeamStructure(HttpServletRequest request, @RequestBody CreateUpdateTeamStructureRequest createRequest) {
|
||||
boolean isSuccess;
|
||||
String processMessage;
|
||||
@@ -78,7 +79,7 @@ public class TeamStructureController {
|
||||
|
||||
@CheckPermission(routerId = "00319", permissionCode = "MODIFY")
|
||||
@OperationLog(eventCode = "teamStructure_update", actionName = "Update TeamStructure")
|
||||
@RequestMapping(value = "/app/team_structure/update", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
|
||||
@RequestMapping(value = "/app/team_structure/update", method = RequestMethod.POST, produces = "application/json;charset=UTF-8",consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||
public AjaxResult updateCfgTeamStructure(HttpServletRequest request, @RequestBody CreateUpdateTeamStructureRequest updateRequest) {
|
||||
boolean isSuccess = false;
|
||||
String processMessage;
|
||||
@@ -113,7 +114,7 @@ public class TeamStructureController {
|
||||
}
|
||||
|
||||
@CheckPermission(routerId = "00319", permissionCode = "VIEW")
|
||||
@RequestMapping(value = "/app/team_structure/get", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
|
||||
@RequestMapping(value = "/app/team_structure/get", method = RequestMethod.POST, produces = "application/json;charset=UTF-8",consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||
public AjaxResult getCfgTeamStructureById(HttpServletRequest request, @RequestBody GetTeamStructureRequest requestData) {
|
||||
boolean isSuccess;
|
||||
String processMessage;
|
||||
@@ -138,7 +139,7 @@ public class TeamStructureController {
|
||||
|
||||
@CheckPermission(routerId = "00319", permissionCode = "REMOVE")
|
||||
@OperationLog(eventCode = "teamStructure_delete", actionName = "Delete TeamStructure")
|
||||
@RequestMapping(value = "/app/team_structure/delete", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
|
||||
@RequestMapping(value = "/app/team_structure/delete", method = RequestMethod.POST, produces = "application/json;charset=UTF-8",consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||
public AjaxResult deleteCfgTeamStructure(HttpServletRequest request, @RequestBody DeleteTeamStructureRequest requestData) {
|
||||
boolean isSuccess;
|
||||
String processMessage;
|
||||
@@ -155,7 +156,7 @@ public class TeamStructureController {
|
||||
return processResult;
|
||||
}
|
||||
|
||||
@RequestMapping(value = "/app/team_structure/list", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
|
||||
@RequestMapping(value = "/app/team_structure/list", method = RequestMethod.POST, produces = "application/json;charset=UTF-8",consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||
public AjaxResult queryCfgTeamStructure(HttpServletRequest request, @RequestBody TeamStructurePageRequest pageRequest) {
|
||||
boolean isSuccess;
|
||||
String processMessage;
|
||||
@@ -179,7 +180,7 @@ public class TeamStructureController {
|
||||
}
|
||||
|
||||
@CheckPermission(routerId = "00319", permissionCode = "VIEW")
|
||||
@RequestMapping(value = "/app/team_structure/get_page", produces = "application/json;charset=UTF-8")
|
||||
@RequestMapping(value = "/app/team_structure/get_page", produces = "application/json;charset=UTF-8",consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||
public AjaxResult getCfgTeamStructureByPage(HttpServletRequest request, @RequestBody TeamStructurePageRequest pageRequest) {
|
||||
boolean isSuccess;
|
||||
String processMessage;
|
||||
@@ -203,7 +204,7 @@ public class TeamStructureController {
|
||||
}
|
||||
|
||||
@CheckPermission(routerId = "00319", permissionCode = "VIEW")
|
||||
@RequestMapping(value = "/app/team_structure/list_view", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
|
||||
@RequestMapping(value = "/app/team_structure/list_view", method = RequestMethod.POST, produces = "application/json;charset=UTF-8",consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||
public AjaxResult queryCfgTeamStructureView(HttpServletRequest request, @RequestBody TeamStructurePageRequest pageRequest) {
|
||||
boolean isSuccess;
|
||||
String processMessage;
|
||||
@@ -228,7 +229,8 @@ public class TeamStructureController {
|
||||
|
||||
@CheckPermission(routerId = "00319", permissionCode = "EXPORT")
|
||||
@RequestMapping(value = "/app/team_structure/export_excel")
|
||||
public void exportExcel(HttpServletRequest request, HttpServletResponse response, @RequestBody TeamStructurePageRequest pageRequest) throws Exception {
|
||||
public void exportExcel(HttpServletRequest request, HttpServletResponse response) throws Exception {
|
||||
TeamStructurePageRequest pageRequest = (new QueryFilter(request)).convertToRequest(TeamStructurePageRequest.class);
|
||||
ExportDefine reportDef = ExcelUtils.getExportDefineByName("EXPORT_TEAM_STRUCTURE");
|
||||
if (reportDef != null) {
|
||||
List<CfgTeamStructureViewDto> listCfgTeamStructure = teamStructureService.listTeamStructureView(pageRequest);
|
||||
|
||||
@@ -0,0 +1,57 @@
|
||||
package com.mgm.mcrm.common.config;
|
||||
|
||||
import com.mgm.mcrm.common.dtos.config.ApiGatewaySetting;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
||||
@Configuration
|
||||
public class ApiGatewayConfig {
|
||||
|
||||
@Value("${api-gateway.base-url}")
|
||||
private String serverUrl;
|
||||
|
||||
@Value("${api-gateway.request-timeout-ms:60000}")
|
||||
private int apiRequestTimeout;
|
||||
|
||||
//-- Daylight
|
||||
@Value("${api-gateway.daylight.proxy-path}")
|
||||
private String daylightProxyPath;
|
||||
|
||||
@Value("${api-gateway.daylight.app-id}")
|
||||
private String daylightAppId;
|
||||
|
||||
@Value("${api-gateway.daylight.auth-code}")
|
||||
private String daylightAppSecret;
|
||||
|
||||
@Value("${api-gateway.daylight.system-id}")
|
||||
private String daylightSystemId;
|
||||
|
||||
//-- Notification
|
||||
@Value("${api-gateway.notification.proxy-path}")
|
||||
private String notificationProxyPath;
|
||||
|
||||
@Value("${api-gateway.notification.app-id}")
|
||||
private String notificationAppId;
|
||||
|
||||
@Value("${api-gateway.notification.auth-code}")
|
||||
private String notificationAppSecret;
|
||||
|
||||
|
||||
@Bean
|
||||
public ApiGatewaySetting configApiGateway() {
|
||||
ApiGatewaySetting config = new ApiGatewaySetting();
|
||||
config.setBaseUrl(serverUrl);
|
||||
config.setRequestTimeout(apiRequestTimeout);
|
||||
config.setDaylightProxyUrl(serverUrl+daylightProxyPath);
|
||||
config.setDaylightAppId(daylightAppId);
|
||||
config.setDaylightAppSecret(daylightAppSecret);
|
||||
config.setDaylightSystemId(daylightSystemId);
|
||||
config.setNotificationProxyUrl(serverUrl+notificationProxyPath);
|
||||
config.setNotificationAppId(notificationAppId);
|
||||
config.setNotificationAppSecret(notificationAppSecret);
|
||||
//--
|
||||
return config;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,6 +7,7 @@ import java.io.FileInputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.InputStreamReader;
|
||||
import java.security.KeyStore;
|
||||
import java.time.ZoneOffset;
|
||||
import java.util.*;
|
||||
import java.time.LocalDateTime;
|
||||
@@ -15,7 +16,6 @@ import java.util.Map.Entry;
|
||||
import com.mgm.mcrm.admin.dtos.AppServerState;
|
||||
import com.mgm.mcrm.admin.models.SysSetting;
|
||||
import com.mgm.mcrm.admin.models.SysUser;
|
||||
import com.mgm.mcrm.admin.models.SysUserView;
|
||||
import com.mgm.mcrm.authorization.dtos.LoginUserInfo;
|
||||
import com.mgm.mcrm.authorization.utils.JwtTokenUtil;
|
||||
import com.mgm.mcrm.common.dtos.APIConfig;
|
||||
@@ -24,6 +24,8 @@ import com.mgm.mcrm.common.dtos.msg.UpdateCfgItem;
|
||||
import com.mgm.mcrm.logging.models.SysLogLogin;
|
||||
import com.mgm.mcrm.logging.models.SysLogOperation;
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import lombok.Getter;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.commons.lang3.Strings;
|
||||
import org.springframework.boot.system.ApplicationHome;
|
||||
@@ -33,11 +35,13 @@ import org.springframework.core.io.Resource;
|
||||
import org.springframework.web.servlet.support.RequestContextUtils;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.auth0.jwt.JWT;
|
||||
import com.auth0.jwt.interfaces.DecodedJWT;
|
||||
import com.mgm.mcrm.common.utils.LogUtil;
|
||||
import com.mgm.mcrm.common.utils.NetworkUtil;
|
||||
|
||||
import javax.net.ssl.TrustManager;
|
||||
import javax.net.ssl.TrustManagerFactory;
|
||||
import javax.net.ssl.X509TrustManager;
|
||||
|
||||
public class SysCommon {
|
||||
|
||||
public static String runtime_path = "";
|
||||
@@ -55,12 +59,13 @@ public class SysCommon {
|
||||
public static int tokenExpMin = 1;
|
||||
public static APIConfig apiConfig = new APIConfig();
|
||||
private static Map<String,String> notifyTemplateMap = new HashMap<String,String>();
|
||||
private static Map<String, AppServerState> appServerStates = new HashMap<String,AppServerState>();
|
||||
private static List<String> allowOriginSource = new ArrayList<String>();
|
||||
private static List<String> soapServers = new ArrayList<String>();
|
||||
private static List<String> httpApiServers = new ArrayList<String>();
|
||||
private static List<String> allowIPSource = new ArrayList<String>();
|
||||
private static String apiGatewayIp;
|
||||
private static final Map<String, AppServerState> appServerStates = new HashMap<String,AppServerState>();
|
||||
private static final List<String> allowOriginSource = new ArrayList<String>();
|
||||
@Getter
|
||||
private static final List<String> soapServers = new ArrayList<>();
|
||||
@Getter
|
||||
private static final List<String> httpApiServers = new ArrayList<String>();
|
||||
private static final List<String> allowIPSource = new ArrayList<String>();
|
||||
|
||||
// @Autowired
|
||||
private static MessageSource messageSource;
|
||||
@@ -172,30 +177,6 @@ public class SysCommon {
|
||||
return RequestContextUtils.getLocaleResolver(request).resolveLocale(request);
|
||||
}
|
||||
|
||||
public static String getStatusMessageByCode(int statusCode, String langType) {
|
||||
String statusMessage = "";
|
||||
Locale locale = Locale.US;
|
||||
if (Strings.CI.equals("TC", langType)) {
|
||||
locale = Locale.TAIWAN;
|
||||
} else if (Strings.CI.equals("SC", langType)) {
|
||||
locale = Locale.CHINA;
|
||||
}
|
||||
statusMessage = messageSource.getMessage("common.error_message.error_code_" + statusCode, null, locale);
|
||||
return statusMessage;
|
||||
}
|
||||
|
||||
public static String getMessageByLangType(String messageCode, String langType) {
|
||||
String statusMessage = "";
|
||||
Locale locale = Locale.US;
|
||||
if (Strings.CI.equals("TC", langType)) {
|
||||
locale = Locale.TAIWAN;
|
||||
} else if (Strings.CI.equals("SC", langType)) {
|
||||
locale = Locale.CHINA;
|
||||
}
|
||||
statusMessage = messageSource.getMessage(messageCode, null, locale);
|
||||
return statusMessage;
|
||||
}
|
||||
|
||||
public static SysLogOperation createLogOperationByRequest(
|
||||
HttpServletRequest request,
|
||||
String eventCode,
|
||||
@@ -492,6 +473,22 @@ public class SysCommon {
|
||||
}
|
||||
return isAllow;
|
||||
}
|
||||
|
||||
public static boolean shouldBypassOriginCheck(String sanitizedOrigin, String clientIp) {
|
||||
boolean originBlank = StringUtils.isBlank(sanitizedOrigin);
|
||||
return originBlank && NetworkUtil.isLocalServerIp(clientIp);
|
||||
}
|
||||
|
||||
public static boolean applyAllowOriginHeader(HttpServletResponse response, String sanitizedOrigin, String clientIp) {
|
||||
if(shouldBypassOriginCheck(sanitizedOrigin, clientIp)) {
|
||||
return true;
|
||||
}
|
||||
if(isAllowOriginSource(sanitizedOrigin)) {
|
||||
response.setHeader("Access-Control-Allow-Origin", sanitizedOrigin);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public static void loadSoapServerConfig(String soapConfig) {
|
||||
if(soapConfig!=null) {
|
||||
@@ -581,11 +578,19 @@ public class SysCommon {
|
||||
return isAllow;
|
||||
}
|
||||
|
||||
public static void setApiGatewayIp(String apiGatewayIp) {
|
||||
SysCommon.apiGatewayIp = apiGatewayIp;
|
||||
}
|
||||
|
||||
public static String getApiGatewayIp() {
|
||||
return apiGatewayIp;
|
||||
public static X509TrustManager getDefaultTrustManager() {
|
||||
try {
|
||||
// 获取 JVM 默认的 TrustManager 作为核心校验逻辑
|
||||
TrustManagerFactory tmf = TrustManagerFactory.getInstance(TrustManagerFactory.getDefaultAlgorithm());
|
||||
tmf.init((KeyStore) null); // 使用系统的默认信任库
|
||||
for (TrustManager tm : tmf.getTrustManagers()) {
|
||||
if (tm instanceof X509TrustManager) {
|
||||
return (X509TrustManager) tm;
|
||||
}
|
||||
}
|
||||
}catch(Exception err){
|
||||
LogUtil.error(SysCommon.class,"Default X509TrustManager not found["+err.getMessage()+"]");
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
package com.mgm.mcrm.common.dtos.config;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class ApiGatewaySetting {
|
||||
private String baseUrl;
|
||||
private int requestTimeout=30000;
|
||||
private String daylightProxyUrl;
|
||||
private String daylightSystemId;
|
||||
private String daylightAppId;
|
||||
private String daylightAppSecret;
|
||||
private String notificationProxyUrl;
|
||||
private String notificationAppId;
|
||||
private String notificationAppSecret;
|
||||
}
|
||||
@@ -48,19 +48,14 @@ public class ConfigHeaderFilter implements Filter {
|
||||
httpServletResponse.setHeader("Server", "");
|
||||
}
|
||||
String origin = ((HttpServletRequest)request).getHeader("Origin");
|
||||
String sanitizedOrigin = NetworkUtil.sanitizeCRLF(origin);
|
||||
if(isIgnoreOriginChecking((HttpServletRequest)request)){
|
||||
httpServletResponse.setHeader("Access-Control-Allow-Origin",origin);
|
||||
httpServletResponse.setHeader("Access-Control-Allow-Origin",sanitizedOrigin);
|
||||
}else{
|
||||
if(StringUtils.isBlank(origin) && "127.0.0.1".equals(NetworkUtil.getClientIpAddr((HttpServletRequest)request))){
|
||||
httpServletResponse.setHeader("Access-Control-Allow-Origin",null);
|
||||
}else{
|
||||
String sanitizedOrigin = NetworkUtil.encodePathWithSpring(origin);
|
||||
if(SysCommon.isAllowOriginSource(sanitizedOrigin)) {
|
||||
httpServletResponse.setHeader("Access-Control-Allow-Origin",sanitizedOrigin);
|
||||
}else {
|
||||
LogUtil.warn(ConfigHeaderFilter.class, "Origin of ["+origin+"] is not allowed");
|
||||
throw new ServletException("Origin of ["+sanitizedOrigin+"] is not allowed");
|
||||
}
|
||||
String clientIp = NetworkUtil.getClientIpAddr((HttpServletRequest)request);
|
||||
if(!SysCommon.applyAllowOriginHeader(httpServletResponse, sanitizedOrigin, clientIp)) {
|
||||
LogUtil.warn(ConfigHeaderFilter.class, "Origin of ["+origin+"] is not allowed (clientIp="+clientIp+")");
|
||||
throw new ServletException("Origin of ["+sanitizedOrigin+"] is not allowed");
|
||||
}
|
||||
}
|
||||
httpServletResponse.setHeader("Access-Control-Allow-Methods", "GET, POST, PUT, DELETE, OPTIONS, HEAD");
|
||||
|
||||
@@ -1,14 +1,13 @@
|
||||
package com.mgm.mcrm.common.httpclient;
|
||||
|
||||
import com.mgm.mcrm.common.constants.SysCommon;
|
||||
import com.mgm.mcrm.common.services.ConfigurableTrustHandler;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import org.apache.hc.client5.http.ssl.SSLConnectionSocketFactory;
|
||||
import org.apache.hc.core5.ssl.SSLContexts;
|
||||
|
||||
import javax.net.ssl.HostnameVerifier;
|
||||
import javax.net.ssl.SSLContext;
|
||||
import javax.net.ssl.SSLSession;
|
||||
import javax.net.ssl.SSLSocketFactory;
|
||||
import javax.net.ssl.TrustManager;
|
||||
import javax.net.ssl.X509TrustManager;
|
||||
import javax.net.ssl.*;
|
||||
import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
import java.io.IOException;
|
||||
@@ -18,75 +17,36 @@ import java.security.KeyStoreException;
|
||||
import java.security.NoSuchAlgorithmException;
|
||||
import java.security.cert.CertificateException;
|
||||
|
||||
/**
|
||||
* SSL 支持类(基于 HttpClient 5)
|
||||
*
|
||||
* 提供:
|
||||
* - 信任所有证书的 SSLSocketFactory
|
||||
* - 信任所有证书的 SSLConnectionSocketFactory
|
||||
*
|
||||
* 注意:默认实现信任所有证书,仅适用于内部系统或测试环境。
|
||||
*
|
||||
* @author Anka
|
||||
* @version 2.0 (client5)
|
||||
*/
|
||||
public class HttpSslSupport {
|
||||
private static final SSLHandler SIMPLE_VERIFIER = new SSLHandler();
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
private static boolean skipValidation=true;
|
||||
|
||||
private static ConfigurableTrustHandler trustHandler=null;
|
||||
|
||||
private static SSLSocketFactory sslFactory;
|
||||
// 注意:SSLConnectionSocketFactory 在 HttpClient 5 中被标记为 deprecated,
|
||||
// 但这是目前唯一可用的方式,新的 API 尚未稳定
|
||||
@SuppressWarnings("deprecation")
|
||||
private static SSLConnectionSocketFactory sslConnFactory;
|
||||
|
||||
private static final HttpSslSupport INSTANCE = new HttpSslSupport();
|
||||
|
||||
private SSLContext sc;
|
||||
|
||||
public static HttpSslSupport getInstance() {
|
||||
return INSTANCE;
|
||||
}
|
||||
|
||||
public static HttpSslSupport create() {
|
||||
return new HttpSslSupport();
|
||||
}
|
||||
|
||||
/**
|
||||
* 重写 X509TrustManager 和 HostnameVerifier,信任所有证书与主机名。
|
||||
* 仅推荐在内部环境或调试场景使用。
|
||||
*/
|
||||
private static class SSLHandler implements X509TrustManager, HostnameVerifier {
|
||||
|
||||
@Override
|
||||
public java.security.cert.X509Certificate[] getAcceptedIssuers() {
|
||||
return new java.security.cert.X509Certificate[]{};
|
||||
}
|
||||
|
||||
@Override
|
||||
public void checkServerTrusted(java.security.cert.X509Certificate[] chain,
|
||||
String authType) throws java.security.cert.CertificateException {
|
||||
// 信任所有服务器证书
|
||||
}
|
||||
|
||||
@Override
|
||||
public void checkClientTrusted(java.security.cert.X509Certificate[] chain,
|
||||
String authType) throws java.security.cert.CertificateException {
|
||||
// 信任所有客户端证书
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean verify(String paramString, SSLSession paramSSLSession) {
|
||||
// 信任所有主机名
|
||||
return true;
|
||||
public static ConfigurableTrustHandler getTrustHandler(){
|
||||
if(trustHandler==null){
|
||||
trustHandler =new ConfigurableTrustHandler(skipValidation, SysCommon.getDefaultTrustManager(), SysCommon.getHttpApiServers());
|
||||
}
|
||||
return trustHandler;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取默认 HostnameVerifier(信任所有主机名)
|
||||
*/
|
||||
public static HostnameVerifier getVerifier() {
|
||||
return SIMPLE_VERIFIER;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取信任所有证书的 {@link SSLSocketFactory}
|
||||
@@ -97,7 +57,9 @@ public class HttpSslSupport {
|
||||
}
|
||||
try {
|
||||
SSLContext context = getSSLContext(sslpv);
|
||||
context.init(null, new TrustManager[]{SIMPLE_VERIFIER}, null);
|
||||
context.init(null, new TrustManager[]{
|
||||
getTrustHandler()
|
||||
}, null);
|
||||
sslFactory = context.getSocketFactory();
|
||||
return sslFactory;
|
||||
} catch (KeyManagementException e) {
|
||||
@@ -118,8 +80,11 @@ public class HttpSslSupport {
|
||||
}
|
||||
try {
|
||||
SSLContext context = getSSLContext(sslpv);
|
||||
context.init(null, new TrustManager[]{SIMPLE_VERIFIER}, new java.security.SecureRandom());
|
||||
sslConnFactory = new SSLConnectionSocketFactory(context, SIMPLE_VERIFIER);
|
||||
ConfigurableTrustHandler trustHandler = getTrustHandler();
|
||||
context.init(null, new TrustManager[]{
|
||||
trustHandler
|
||||
}, new java.security.SecureRandom());
|
||||
sslConnFactory = new SSLConnectionSocketFactory(context, trustHandler);
|
||||
return sslConnFactory;
|
||||
} catch (KeyManagementException e) {
|
||||
throw new RuntimeException("初始化 SSLConnectionSocketFactory 失败", e);
|
||||
|
||||
@@ -5,7 +5,9 @@ import java.util.List;
|
||||
import com.mgm.mcrm.admin.dtos.AppServerState;
|
||||
import com.mgm.mcrm.admin.models.SysSetting;
|
||||
import com.mgm.mcrm.admin.services.SysSettingService;
|
||||
import com.mgm.mcrm.allotment.services.RoomCriteriaDaylightService;
|
||||
import com.mgm.mcrm.common.httpclient.HttpSslSupport;
|
||||
import com.mgm.mcrm.common.utils.HttpUtil;
|
||||
import com.mgm.mcrm.common.utils.SOAPUtil;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
@@ -31,9 +33,13 @@ public class ConfigListener implements ApplicationListener<ApplicationStartedEve
|
||||
//@Value("${allow_forwarder_ip}")
|
||||
private String allowForwarderIP="";
|
||||
|
||||
@Value("${mcrm.api-gateway.url}")
|
||||
private String apiGatewayUrl;
|
||||
|
||||
@Value("${trust-store.http-support.skip-validation}")
|
||||
private boolean skipHttpSupportValidation;
|
||||
@Value("${trust-store.http-util.skip-validation}")
|
||||
private boolean skipHttpUtilValidation;
|
||||
@Value("${trust-store.soap-util.skip-validation}")
|
||||
private boolean skipSoapUtilValidation;
|
||||
|
||||
@Resource
|
||||
private SysSettingService sysSettingService;
|
||||
|
||||
@@ -52,7 +58,6 @@ public class ConfigListener implements ApplicationListener<ApplicationStartedEve
|
||||
SysCommon.setMessageSource(i18nMessage);
|
||||
SysCommon.initRuntimePath();
|
||||
SysCommon.loadSystemConfig();
|
||||
SysCommon.setApiGatewayIp(apiGatewayUrl);
|
||||
|
||||
// load settings from DB
|
||||
List<SysSetting> sysSettings = sysSettingService.getSysSettingsAll();
|
||||
@@ -63,6 +68,11 @@ public class ConfigListener implements ApplicationListener<ApplicationStartedEve
|
||||
SysCommon.loadApiServerConfig(httpApiServers);
|
||||
ExcelUtils.loadExcelDefines();
|
||||
|
||||
//-- Set Trust Manager validation
|
||||
HttpSslSupport.setSkipValidation(skipHttpSupportValidation);
|
||||
HttpUtil.setSkipValidation(skipHttpUtilValidation);
|
||||
SOAPUtil.setSkipValidation(skipSoapUtilValidation);
|
||||
|
||||
if(ctrlMsgSender!=null) {
|
||||
AppServerState serverState = SysCommon.refreshAppServerState();
|
||||
boolean sendResult = ctrlMsgSender.sendMessage("REQ_SYNC_SERVER_STATE",serverState);
|
||||
|
||||
@@ -0,0 +1,63 @@
|
||||
package com.mgm.mcrm.common.services;
|
||||
|
||||
import com.mgm.mcrm.common.utils.LogUtil;
|
||||
import org.apache.commons.lang3.Strings;
|
||||
|
||||
import javax.net.ssl.HostnameVerifier;
|
||||
import javax.net.ssl.SSLSession;
|
||||
import javax.net.ssl.X509TrustManager;
|
||||
import java.util.List;
|
||||
|
||||
public class ConfigurableTrustHandler implements X509TrustManager, HostnameVerifier {
|
||||
private final boolean skipValidation;
|
||||
private final X509TrustManager defaultTrustManager;
|
||||
private final List<String> allowedServers;
|
||||
|
||||
public ConfigurableTrustHandler(boolean skipValidation, X509TrustManager defaultTrustManager, List<String> allowedServers ) {
|
||||
this.skipValidation = skipValidation;
|
||||
this.defaultTrustManager = defaultTrustManager;
|
||||
this.allowedServers = allowedServers;
|
||||
}
|
||||
|
||||
@Override
|
||||
public java.security.cert.X509Certificate[] getAcceptedIssuers() {
|
||||
if (skipValidation) {
|
||||
return new java.security.cert.X509Certificate[0];
|
||||
}else{
|
||||
return defaultTrustManager != null ? defaultTrustManager.getAcceptedIssuers() : new java.security.cert.X509Certificate[0];
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void checkServerTrusted(java.security.cert.X509Certificate[] chain,
|
||||
String authType) throws java.security.cert.CertificateException {
|
||||
if (!skipValidation && defaultTrustManager != null) {
|
||||
defaultTrustManager.checkServerTrusted(chain, authType);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void checkClientTrusted(java.security.cert.X509Certificate[] chain,
|
||||
String authType) throws java.security.cert.CertificateException {
|
||||
if (!skipValidation && defaultTrustManager != null) {
|
||||
defaultTrustManager.checkClientTrusted(chain, authType);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean verify(String hostname, SSLSession paramSSLSession) {
|
||||
boolean isAllow = skipValidation;
|
||||
if(!skipValidation && allowedServers!=null && !allowedServers.isEmpty()){
|
||||
for(String allowItem:allowedServers) {
|
||||
if(Strings.CI.startsWith(hostname, allowItem)) {
|
||||
isAllow=true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if(!skipValidation && !isAllow) {
|
||||
LogUtil.warn(ConfigurableTrustHandler.class, "API Server of ["+hostname+"] is not allowed");
|
||||
}
|
||||
return isAllow;
|
||||
}
|
||||
}
|
||||
@@ -2,6 +2,7 @@ package com.mgm.mcrm.common.services;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.mgm.mcrm.common.dtos.HttpResult;
|
||||
import com.mgm.mcrm.common.dtos.config.ApiGatewaySetting;
|
||||
import com.mgm.mcrm.common.enums.HttpMethods;
|
||||
import com.mgm.mcrm.common.httpclient.HttpClientExecutor;
|
||||
import com.mgm.mcrm.common.httpclient.HttpRequestOptions;
|
||||
@@ -9,12 +10,16 @@ import jakarta.annotation.Resource;
|
||||
import org.apache.hc.client5.http.config.RequestConfig;
|
||||
import org.apache.hc.client5.http.impl.classic.CloseableHttpClient;
|
||||
import org.apache.hc.core5.http.Header;
|
||||
import org.apache.hc.core5.http.message.BasicHeader;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Qualifier;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
@@ -35,11 +40,20 @@ public class HttpService {
|
||||
@Qualifier("httpRequestConfig")
|
||||
private RequestConfig requestConfig;
|
||||
|
||||
@Value("${daylight.url}")
|
||||
private String daylightUrl;
|
||||
@Resource
|
||||
private ApiGatewaySetting apiGatewaySetting;
|
||||
|
||||
|
||||
private Header[] supplementDaylightProxySecurity(Header[] headers){
|
||||
List<Header> newHeaders = (headers == null ? new ArrayList<>() : new ArrayList<>(Arrays.asList(headers)));
|
||||
newHeaders.add(new BasicHeader("application-id",apiGatewaySetting.getDaylightAppId()));
|
||||
newHeaders.add(new BasicHeader("Authorization",apiGatewaySetting.getDaylightAppSecret()));
|
||||
return newHeaders.toArray(new Header[0]);
|
||||
}
|
||||
|
||||
public String sslGet(String url, Header[] headers, Map<String, Object> map) throws Exception {
|
||||
|
||||
String daylightUrl=apiGatewaySetting.getDaylightProxyUrl();
|
||||
// todo 在這裏需要把請求頭的信息插入到數據庫裏
|
||||
log.info("======sslGet======url:{}===========headers:{} =============== map:{}", daylightUrl + url,JSON.toJSONString(headers),JSON.toJSONString(map));
|
||||
// 使用 HttpRequestOptions 配置 GET 请求(带参数)
|
||||
@@ -50,7 +64,7 @@ public class HttpService {
|
||||
.encoding("utf-8")
|
||||
.client(httpClient);
|
||||
|
||||
String result = HttpClientExecutor.get(options, headers);
|
||||
String result = HttpClientExecutor.get(options, supplementDaylightProxySecurity(headers));
|
||||
log.info("====== GET request result:{}", result);
|
||||
|
||||
return result;
|
||||
@@ -65,6 +79,7 @@ public class HttpService {
|
||||
* @throws Exception 異常
|
||||
*/
|
||||
public String sslPostForm(String url, Header[] headers, Map<String, Object> map) throws Exception {
|
||||
String daylightUrl=apiGatewaySetting.getDaylightProxyUrl();
|
||||
log.info("======sslPostForm======url:{}===========headers:{} =============== map:{}", daylightUrl + url,JSON.toJSONString(headers),JSON.toJSONString(map));
|
||||
// 使用 HttpRequestOptions 配置 POST 请求(form-urlencoded 格式)
|
||||
HttpRequestOptions options = HttpRequestOptions.create()
|
||||
@@ -75,7 +90,7 @@ public class HttpService {
|
||||
.encoding("utf-8")
|
||||
.client(httpClient);
|
||||
|
||||
String result = HttpClientExecutor.post(options, headers);
|
||||
String result = HttpClientExecutor.post(options, supplementDaylightProxySecurity(headers));
|
||||
log.info("====== POST Form request result:{}", result);
|
||||
|
||||
return result;
|
||||
@@ -90,6 +105,7 @@ public class HttpService {
|
||||
* @throws Exception 異常
|
||||
*/
|
||||
public String sslPostJson(String url, Header[] headers, Map<String, Object> map) throws Exception {
|
||||
String daylightUrl=apiGatewaySetting.getDaylightProxyUrl();
|
||||
log.info("======sslPostJson======url:{}===========headers:{} =============== map:{}", daylightUrl + url,JSON.toJSONString(headers),JSON.toJSONString(map));
|
||||
// 使用 HttpRequestOptions 配置 POST 请求(JSON 格式)
|
||||
HttpRequestOptions options = HttpRequestOptions.create()
|
||||
@@ -100,12 +116,13 @@ public class HttpService {
|
||||
.encoding("utf-8")
|
||||
.client(httpClient);
|
||||
|
||||
String result = HttpClientExecutor.post(options, headers);
|
||||
String result = HttpClientExecutor.post(options, supplementDaylightProxySecurity(headers));
|
||||
log.info("====== POST Json request result:{}", result);
|
||||
return result;
|
||||
}
|
||||
|
||||
public String sslPostJsonContent(String url, Header[] headers, String jsonContent) throws Exception {
|
||||
String daylightUrl=apiGatewaySetting.getDaylightProxyUrl();
|
||||
// 使用 HttpRequestOptions 配置 POST 请求(JSON 格式)
|
||||
HttpRequestOptions options = HttpRequestOptions.create()
|
||||
.url(daylightUrl + url)
|
||||
@@ -115,7 +132,7 @@ public class HttpService {
|
||||
.encoding("utf-8")
|
||||
.client(httpClient);
|
||||
|
||||
return HttpClientExecutor.post(options, headers);
|
||||
return HttpClientExecutor.post(options, supplementDaylightProxySecurity(headers));
|
||||
}
|
||||
|
||||
|
||||
@@ -128,6 +145,7 @@ public class HttpService {
|
||||
* @throws Exception 異常
|
||||
*/
|
||||
public String sslPut(String url, Header[] headers, Map<String, Object> map) throws Exception {
|
||||
String daylightUrl=apiGatewaySetting.getDaylightProxyUrl();
|
||||
log.info("======sslPut======url:{}===========headers:{} =============== map:{}", daylightUrl + url,JSON.toJSONString(headers),JSON.toJSONString(map));
|
||||
HttpRequestOptions options = HttpRequestOptions.create()
|
||||
.url(daylightUrl + url)
|
||||
@@ -136,7 +154,7 @@ public class HttpService {
|
||||
.json(JSON.toJSONString(map))
|
||||
.encoding("utf-8")
|
||||
.client(httpClient);
|
||||
String result = HttpClientExecutor.execute(options, headers);
|
||||
String result = HttpClientExecutor.execute(options, supplementDaylightProxySecurity(headers));
|
||||
log.info("====== PUT request result:{}", result);
|
||||
|
||||
return result;
|
||||
@@ -151,13 +169,14 @@ public class HttpService {
|
||||
* @throws Exception 異常
|
||||
*/
|
||||
public String sslPutDelete(String url, Header[] headers, Map<String, Object> map) throws Exception {
|
||||
String daylightUrl=apiGatewaySetting.getDaylightProxyUrl();
|
||||
log.info("======sslPutDelete======url:{}===========headers:{} =============== map:{}", daylightUrl + url,JSON.toJSONString(headers),JSON.toJSONString(map));
|
||||
HttpRequestOptions options = HttpRequestOptions.create()
|
||||
.url(daylightUrl + url)
|
||||
.timeout(requestConfig)
|
||||
.method(HttpMethods.DELETE)
|
||||
.client(httpClient);
|
||||
String result = HttpClientExecutor.execute(options, headers);
|
||||
String result = HttpClientExecutor.execute(options, supplementDaylightProxySecurity(headers));
|
||||
System.out.println("DELETE 请求结果:\n" + result);
|
||||
log.info("====== DELETE request result:{}", result);
|
||||
return result;
|
||||
@@ -172,6 +191,7 @@ public class HttpService {
|
||||
* @throws Exception 異常
|
||||
*/
|
||||
public HttpResult sslPostHttpResult(String url, Header[] headers, Map<String,Object> map) throws Exception {
|
||||
String daylightUrl=apiGatewaySetting.getDaylightProxyUrl();
|
||||
log.info("======sslPutDelete======url:{}===========headers:{}", daylightUrl + url,JSON.toJSONString(headers));
|
||||
HttpRequestOptions postConfig = HttpRequestOptions.create()
|
||||
.url(daylightUrl + url)
|
||||
@@ -179,14 +199,14 @@ public class HttpService {
|
||||
.json(JSON.toJSONString(map))
|
||||
.method(HttpMethods.POST)
|
||||
.client(httpClient);
|
||||
HttpResult result = HttpClientExecutor.sendAndPostResp(postConfig, headers);
|
||||
HttpResult result = HttpClientExecutor.sendAndPostResp(postConfig, supplementDaylightProxySecurity(headers));
|
||||
System.out.println("POST 请求结果:\n" + result);
|
||||
log.info("====== POST request result:{}", result);
|
||||
return result;
|
||||
}
|
||||
|
||||
public HttpResult sslGetHttpResult(String url, Header[] headers, Map<String, Object> map) throws Exception {
|
||||
|
||||
String daylightUrl=apiGatewaySetting.getDaylightProxyUrl();
|
||||
// todo 在這裏需要把請求頭的信息插入到數據庫裏
|
||||
log.info("======sslGet======url:{}===========headers:{} =============== map:{}", daylightUrl + url,JSON.toJSONString(headers),JSON.toJSONString(map));
|
||||
// 使用 HttpConfig 配置 GET 请求(带参数)
|
||||
@@ -197,7 +217,7 @@ public class HttpService {
|
||||
.encoding("utf-8")
|
||||
.client(httpClient);
|
||||
|
||||
HttpResult result = HttpClientExecutor.sendAndGetResp(getConfig, headers);
|
||||
HttpResult result = HttpClientExecutor.sendAndGetResp(getConfig, supplementDaylightProxySecurity(headers));
|
||||
log.info("====== GET request result:{}", result.getResult());
|
||||
|
||||
Map<String, String> mapResult = JSON.parseObject(result.getResult(), Map.class);
|
||||
|
||||
@@ -818,7 +818,7 @@ public class ExcelUtils {
|
||||
public static void exportToResponse(ExportDefine reportDef, String reportFileName, Map<String,List> exportData,Map<String,List<GroupItem>> groupKeys, HttpServletResponse response, HttpServletRequest request,List<String> columnData) throws Exception {
|
||||
File file = ExcelUtils.exportEXCEL(reportDef,exportData,groupKeys,columnData);
|
||||
String origin = request.getHeader("Origin");
|
||||
String sanitizedOrigin = NetworkUtil.encodePathWithSpring(origin);
|
||||
String sanitizedOrigin = NetworkUtil.sanitizeCRLF(origin);
|
||||
response.reset();
|
||||
if(SysCommon.isAllowOriginSource(sanitizedOrigin)) {
|
||||
String basePath = SysCommon.runtime_path + "\\"+SysCommon.runtimeName+"\\tmp\\";
|
||||
|
||||
@@ -3,19 +3,20 @@ package com.mgm.mcrm.common.utils;
|
||||
import java.io.BufferedReader;
|
||||
import java.io.IOException;
|
||||
import java.nio.charset.Charset;
|
||||
import java.security.cert.X509Certificate;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import javax.net.ssl.SSLContext;
|
||||
import javax.net.ssl.TrustManager;
|
||||
import javax.net.ssl.X509TrustManager;
|
||||
import java.security.cert.CertificateException;
|
||||
|
||||
import com.mgm.mcrm.common.dtos.HttpRequestDefine;
|
||||
import com.mgm.mcrm.common.dtos.HttpResponseResult;
|
||||
import com.mgm.mcrm.common.dtos.config.ApiGatewaySetting;
|
||||
import com.mgm.mcrm.common.services.ConfigurableTrustHandler;
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.commons.lang3.Strings;
|
||||
import org.apache.hc.client5.http.config.RequestConfig;
|
||||
@@ -35,7 +36,6 @@ import org.apache.hc.core5.http.Header;
|
||||
import org.apache.hc.core5.http.config.Registry;
|
||||
import org.apache.hc.core5.http.config.RegistryBuilder;
|
||||
import org.apache.hc.core5.http.io.entity.EntityUtils;
|
||||
import org.apache.hc.core5.http.io.entity.StringEntity;
|
||||
import org.apache.hc.core5.http.message.BasicHeader;
|
||||
import org.apache.hc.core5.ssl.SSLContextBuilder;
|
||||
import org.apache.hc.core5.util.Timeout;
|
||||
@@ -53,9 +53,22 @@ import com.mgm.mcrm.common.httpclient.HttpEntityBuilder;
|
||||
import com.mgm.mcrm.common.httpclient.HttpRequestOptions;
|
||||
|
||||
public class HttpUtil {
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
private static boolean skipValidation=true;
|
||||
|
||||
private static ConfigurableTrustHandler trustHandler=null;
|
||||
|
||||
public static ConfigurableTrustHandler getTrustHandler(){
|
||||
if(trustHandler==null){
|
||||
trustHandler =new ConfigurableTrustHandler(skipValidation, SysCommon.getDefaultTrustManager(), SysCommon.getHttpApiServers());
|
||||
}
|
||||
return trustHandler;
|
||||
}
|
||||
|
||||
public static HttpResponseResult invokeWebAPI(JSONObject requestContent, String requestMethod,
|
||||
HttpServletRequest request, MultipartFile[] files) throws Exception {
|
||||
HttpServletRequest request, MultipartFile[] files) throws Exception {
|
||||
String serverUrl="";
|
||||
int timeoutTime = 0;
|
||||
serverUrl=SysCommon.apiConfig.getServerUrl_WEB();
|
||||
@@ -109,9 +122,9 @@ public class HttpUtil {
|
||||
}
|
||||
|
||||
public static HttpResponseResult invokeGatewayAPI(JSONObject requestContent, String requestMethod,
|
||||
HttpServletRequest request, MultipartFile[] files) throws Exception {
|
||||
String serverUrl = SysCommon.getApiGatewayIp();
|
||||
int timeoutTime = SysCommon.apiConfig.getTimeout_WEB();
|
||||
HttpServletRequest request, MultipartFile[] files, ApiGatewaySetting apiGatewaySetting) throws Exception {
|
||||
String serverUrl = apiGatewaySetting.getBaseUrl();
|
||||
int timeoutTime = apiGatewaySetting.getRequestTimeout();
|
||||
|
||||
HttpRequestDefine requestDef = new HttpRequestDefine();
|
||||
String uri = request.getRequestURI();
|
||||
@@ -130,8 +143,8 @@ public class HttpUtil {
|
||||
String token = request.getHeader("Authorization");
|
||||
String clientId = request.getHeader("clientId");
|
||||
requestHeader.put("Origin", "MGM_CRM_CMS");
|
||||
requestHeader.put("application-id", "MCRM_CMS");
|
||||
requestHeader.put("authorization", "seCuritykeyOfCrmCms8wetw432");
|
||||
requestHeader.put("application-id", apiGatewaySetting.getNotificationAppId());
|
||||
requestHeader.put("authorization", apiGatewaySetting.getNotificationAppSecret());
|
||||
if (StringUtils.isNotBlank(token)) {
|
||||
requestHeader.put("Authorization", token);
|
||||
}
|
||||
@@ -214,19 +227,66 @@ public class HttpUtil {
|
||||
LogUtil.info(HttpUtil.class, "[invokeWebAPIForArray]getResponseContent:"+gson.toJson(httpResult.getResponseContent()));
|
||||
return httpResult;
|
||||
}
|
||||
|
||||
|
||||
public static void invokeWebAPIForNotification(JSONObject requestContent, String requestMethod,
|
||||
HttpServletRequest request) throws Exception {
|
||||
String serverUrl="";
|
||||
int timeoutTime = 0;
|
||||
serverUrl=SysCommon.apiConfig.getServerUrl_WEB();
|
||||
timeoutTime=SysCommon.apiConfig.getTimeout_WEB();
|
||||
|
||||
HttpRequestDefine requestDef = new HttpRequestDefine();
|
||||
|
||||
String apiLink = "/api/notification/send_notification";
|
||||
String requestUrl = serverUrl + apiLink;
|
||||
Map<String, String> requestHeader = new HashMap<String,String>();
|
||||
String token = request.getHeader("Authorization");
|
||||
String clientId = request.getHeader("clientId");
|
||||
requestHeader.put("Origin", "MGM_CRM_CMS");
|
||||
requestHeader.put("Authorization", token);
|
||||
requestHeader.put("clientId", clientId);
|
||||
requestHeader.put("Content-type", "application/json;charset=utf-8");
|
||||
|
||||
requestDef.setRequestUrl(requestUrl);
|
||||
requestDef.setRequestMethod(requestMethod);
|
||||
requestDef.setTimeout(timeoutTime);
|
||||
requestDef.setHeaders(requestHeader);
|
||||
|
||||
if(requestContent!=null) {
|
||||
requestDef.setEntityContent(requestContent.toString());
|
||||
}else {
|
||||
requestDef.setEntityContent("");
|
||||
}
|
||||
// --
|
||||
LogUtil.info(HttpUtil.class, "[invokeWebAPIForNotification] start request:");
|
||||
HttpResponseResult httpResult =(HttpUtil.processHttpRequest(requestDef));
|
||||
httpResult.setRequestContent(requestDef.getEntityContent());
|
||||
Gson gson = new Gson();
|
||||
LogUtil.info(HttpUtil.class, "[invokeWebAPIForNotification]getRequestUrl:"+gson.toJson(requestDef.getRequestUrl()));
|
||||
LogUtil.info(HttpUtil.class, "[invokeWebAPIForNotification]getHeaders:"+gson.toJson(requestDef.getHeaders()));
|
||||
LogUtil.info(HttpUtil.class, "[invokeWebAPIForNotification]getRequestMethod:"+gson.toJson(requestDef.getRequestMethod()));
|
||||
LogUtil.info(HttpUtil.class, "[invokeWebAPIForNotification]getEntityContent:"+gson.toJson(requestContent));
|
||||
LogUtil.info(HttpUtil.class, "[invokeWebAPIForNotification]getStatusCode:"+gson.toJson(httpResult.getStatusCode()));
|
||||
LogUtil.info(HttpUtil.class, "[invokeWebAPIForNotification]getErrorMessage:"+gson.toJson(httpResult.getErrorMessage()));
|
||||
LogUtil.info(HttpUtil.class, "[invokeWebAPIForNotification]getResponseContent:"+gson.toJson(httpResult.getResponseContent()));
|
||||
}
|
||||
|
||||
|
||||
//-----------
|
||||
public static HttpResponseResult processHttpRequest(HttpRequestDefine request) {
|
||||
HttpResponseResult responseResult = new HttpResponseResult();
|
||||
CloseableHttpClient httpclient=null;
|
||||
String requestUrl =request.getRequestUrl();
|
||||
String orgRequestUrl =request.getRequestUrl();
|
||||
|
||||
if(!NetworkUtil.isValidURL(requestUrl)){
|
||||
throw new SecurityException("Invalid URL of ["+requestUrl+"]");
|
||||
if(!NetworkUtil.isValidURL(orgRequestUrl)){
|
||||
throw new SecurityException("Invalid URL of ["+orgRequestUrl+"]");
|
||||
}
|
||||
if (!SysCommon.isAllowApiServer(requestUrl)) {
|
||||
if (!SysCommon.isAllowApiServer(orgRequestUrl)) {
|
||||
throw new SecurityException("URL not allowed");
|
||||
}
|
||||
}
|
||||
String requestUrl = NetworkUtil.validateAndSanitizeUrl(orgRequestUrl);
|
||||
|
||||
// Only encode the path portion, keep query string intact (? should not be encoded to %3F)
|
||||
int queryIdx = requestUrl.indexOf('?');
|
||||
if (queryIdx >= 0) {
|
||||
@@ -273,13 +333,25 @@ public class HttpUtil {
|
||||
Map<String, String> headermap = request.getHeaders();
|
||||
for (Map.Entry<String, String> entry : headermap.entrySet()) {
|
||||
if (!Strings.CS.contains("Content-type", entry.getKey())) {
|
||||
httppost.addHeader(entry.getKey(), NetworkUtil.sanitizeHeaderValue(entry.getValue()));
|
||||
httppost.addHeader(entry.getKey(), NetworkUtil.sanitizeCRLF(entry.getValue()));
|
||||
}
|
||||
}
|
||||
}
|
||||
MultipartFile processFile = request.getUploadFile();
|
||||
MultipartEntityBuilder builder = MultipartEntityBuilder.create();
|
||||
builder.addBinaryBody(request.getFileParaName(), processFile.getInputStream(), ContentType.MULTIPART_FORM_DATA, processFile.getName());
|
||||
String uploadFileName = processFile.getOriginalFilename();
|
||||
if (StringUtils.isBlank(uploadFileName)) {
|
||||
uploadFileName = "upload.xlsx";
|
||||
}
|
||||
ContentType uploadType = ContentType.APPLICATION_OCTET_STREAM;
|
||||
if (StringUtils.isNotBlank(processFile.getContentType())) {
|
||||
try {
|
||||
uploadType = ContentType.parse(processFile.getContentType());
|
||||
} catch (Exception ignored) {
|
||||
uploadType = ContentType.APPLICATION_OCTET_STREAM;
|
||||
}
|
||||
}
|
||||
builder.addBinaryBody(request.getFileParaName(), processFile.getInputStream(), uploadType, uploadFileName);
|
||||
HttpEntity entity = builder.build();
|
||||
httppost.setEntity(entity);
|
||||
|
||||
@@ -350,7 +422,7 @@ public class HttpUtil {
|
||||
}
|
||||
return headerMap.entrySet().stream()
|
||||
.filter(e -> !Strings.CI.equals("Content-Length", e.getKey()))
|
||||
.map(e -> new BasicHeader(e.getKey(), NetworkUtil.sanitizeHeaderValue(e.getValue())))
|
||||
.map(e -> new BasicHeader(e.getKey(), NetworkUtil.sanitizeCRLF(e.getValue())))
|
||||
.toArray(Header[]::new);
|
||||
}
|
||||
|
||||
@@ -384,36 +456,9 @@ public class HttpUtil {
|
||||
//-----------
|
||||
public static SSLContext getSSLContext() {
|
||||
try {
|
||||
// 这里可以填两种值 TLS和LLS , 具体差别可以自行搜索
|
||||
SSLContext sc = SSLContext.getInstance("TLS");
|
||||
// 构建新对象
|
||||
X509TrustManager manager = new X509TrustManager() {
|
||||
@Override
|
||||
public void checkServerTrusted(X509Certificate[] chain, String arg1) throws CertificateException {
|
||||
if (chain == null || chain.length == 0) {
|
||||
throw new IllegalArgumentException("No server certificates provided");
|
||||
}
|
||||
for (X509Certificate cert : chain) {
|
||||
cert.checkValidity();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void checkClientTrusted(X509Certificate[] chain, String arg1) throws CertificateException {
|
||||
if (chain == null || chain.length == 0) {
|
||||
throw new CertificateException("No client certificates provided");
|
||||
}
|
||||
for (X509Certificate cert : chain) {
|
||||
cert.checkValidity(); // 检查证书是否在有效期内
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public X509Certificate[] getAcceptedIssuers() {
|
||||
return new java.security.cert.X509Certificate[] {};
|
||||
}
|
||||
|
||||
};
|
||||
ConfigurableTrustHandler manager = getTrustHandler();
|
||||
sc.init(null, new TrustManager[]{manager}, null);
|
||||
return sc;
|
||||
} catch (Exception e) {
|
||||
|
||||
@@ -1,343 +1,232 @@
|
||||
package com.mgm.mcrm.common.utils;
|
||||
|
||||
import java.lang.management.ManagementFactory;
|
||||
import java.net.*;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Enumeration;
|
||||
import java.util.List;
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
import java.util.*;
|
||||
|
||||
import com.mgm.mcrm.common.constants.SysCommon;
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.commons.lang3.Strings;
|
||||
import org.apache.commons.text.StringEscapeUtils;
|
||||
import org.springframework.web.util.UriUtils;
|
||||
|
||||
public class NetworkUtil {
|
||||
private static final List<String> interalIpPatterns = new ArrayList<String>();
|
||||
private static final Pattern IPV4_PATTERN =
|
||||
Pattern.compile("^((25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$");
|
||||
private static final List<String> INTERNAL_IP_PREFIXES = Arrays.asList(
|
||||
"10.", "192.168.", "172.16.", "172.17.", "172.18.", "172.19.",
|
||||
"172.20.", "172.21.", "172.22.", "172.23.", "172.24.", "172.25.",
|
||||
"172.26.", "172.27.", "172.28.", "172.29.", "172.30.", "172.31."
|
||||
|
||||
private static final Set<String> ALLOWED_PROTOCOLS = new HashSet<>(
|
||||
Arrays.asList("http", "https")
|
||||
);
|
||||
|
||||
public static void setInternalIpPattern(String patternConfig) {
|
||||
interalIpPatterns.clear();
|
||||
String[] patternItems = patternConfig.split(";");
|
||||
for(String pItem:patternItems) {
|
||||
String pVal = pItem.trim();
|
||||
if(StringUtils.isNotBlank(patternConfig)) {
|
||||
interalIpPatterns.add(pVal);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static boolean isMatchInternal(String ipContent) {
|
||||
boolean internalFlag = false;
|
||||
if(StringUtils.isNotBlank(ipContent) && !interalIpPatterns.isEmpty()) {
|
||||
String ipPart = "\\b(25[0-5]|2[0-4]\\d|[01]?\\d\\d?)\\b";
|
||||
for(String ipItem:interalIpPatterns) {
|
||||
if(ipItem.contains("*")) {
|
||||
String itemPattern = ipItem.replace(".", "\\.");
|
||||
itemPattern = itemPattern.replace("*", ipPart);
|
||||
Pattern pt = Pattern.compile(itemPattern);
|
||||
Matcher mt = pt.matcher(ipContent);
|
||||
if(mt.find()) {
|
||||
internalFlag=true;
|
||||
break;
|
||||
}
|
||||
}else {
|
||||
if(Strings.CS.contains(ipContent, ipItem)) {
|
||||
internalFlag=true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return internalFlag;
|
||||
}
|
||||
// 本机 IP 缓存,首次访问时初始化
|
||||
private static volatile Set<String> LOCAL_SERVER_IPS = null;
|
||||
|
||||
/**
|
||||
* Gets the client ip addr.
|
||||
*
|
||||
* @param request the request
|
||||
* @return the client ip addr
|
||||
* 判断给定 IP 是否属于本机(后端服务器自身)。
|
||||
* 包含 127.0.0.1 / IPv6 回环以及所有本机网卡上的 IPv4 地址。
|
||||
*/
|
||||
public static String getClientIpAddr(HttpServletRequest request) {
|
||||
String ip = getIpFromHeaders(request);
|
||||
if(ip==null){
|
||||
ip = request.getRemoteAddr();
|
||||
}
|
||||
return "0:0:0:0:0:0:0:1".equals(ip) ? "127.0.0.1" : ip;
|
||||
}
|
||||
|
||||
private static String getIpFromHeaders(HttpServletRequest request) {
|
||||
String[] headerNames = {
|
||||
"X-Real-IP",
|
||||
"X-Forwarded-For",
|
||||
"Proxy-Client-IP",
|
||||
"WL-Proxy-Client-IP",
|
||||
"HTTP_CLIENT_IP",
|
||||
"HTTP_X_FORWARDED_FOR"
|
||||
};
|
||||
boolean isContainForwardHeader=false;
|
||||
for (String headerName : headerNames) {
|
||||
String headerValue = request.getHeader(headerName);
|
||||
if (headerValue != null && !headerValue.isEmpty()) {
|
||||
isContainForwardHeader=true;
|
||||
//LogUtil.info(NetworkUtil.class,"Check header["+headerName+"] of value["+headerValue+"]");
|
||||
String ip = extractValidIp(headerValue);
|
||||
if (ip != null) {
|
||||
return ip;
|
||||
}else{
|
||||
LogUtil.info(NetworkUtil.class,"Header is not empty but not valid IP");
|
||||
}
|
||||
}
|
||||
}
|
||||
return (isContainForwardHeader?"INVALID_IP":null);
|
||||
}
|
||||
|
||||
private static String extractValidIp(String headerValue) {
|
||||
if (headerValue.contains(",")) {
|
||||
String[] ips = headerValue.split(",");
|
||||
for(int i=ips.length-1;i>=0;i--){
|
||||
String ip = ips[i].trim();
|
||||
if (isValidPublicIp(ip)) {
|
||||
return ip;
|
||||
}
|
||||
}
|
||||
return isValidIp(ips[ips.length - 1].trim())?ips[ips.length - 1].trim():null;
|
||||
} else {
|
||||
String ip = headerValue.trim();
|
||||
return isValidIp(ip) ? ip : null;
|
||||
}
|
||||
}
|
||||
|
||||
private static boolean isValidPublicIp(String ip) {
|
||||
return isValidIp(ip) && !isInternalIp(ip);
|
||||
}
|
||||
|
||||
private static boolean isValidIp(String ip) {
|
||||
return ip != null && !ip.isEmpty() &&
|
||||
!"unknown".equalsIgnoreCase(ip) &&
|
||||
IPV4_PATTERN.matcher(ip).matches();
|
||||
}
|
||||
|
||||
private static boolean isInternalIp(String ip) {
|
||||
if (ip == null) return false;
|
||||
if (ip.equals("127.0.0.1") || ip.equals("0:0:0:0:0:0:0:1")) {
|
||||
return true;
|
||||
}
|
||||
for (String prefix : INTERNAL_IP_PREFIXES) {
|
||||
if (ip.startsWith(prefix)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the real ips.
|
||||
*
|
||||
* @return the real ips
|
||||
*/
|
||||
public static List<String> getRealIps() {
|
||||
List<String> ips = new ArrayList<String>();
|
||||
String localip = null;// 本地IP,如果没有配置外网IP则返回它
|
||||
String netip = null;// 外网IP
|
||||
Enumeration<NetworkInterface> netInterfaces;
|
||||
try {
|
||||
netInterfaces = NetworkInterface.getNetworkInterfaces();
|
||||
} catch (SocketException e) {
|
||||
return null;
|
||||
}
|
||||
|
||||
InetAddress ip = null;
|
||||
boolean finded = false;// 是否找到外网IP
|
||||
while (netInterfaces.hasMoreElements() && !finded) {
|
||||
NetworkInterface ni = netInterfaces.nextElement();
|
||||
Enumeration<InetAddress> address = ni.getInetAddresses();
|
||||
while (address.hasMoreElements()) {
|
||||
ip = address.nextElement();
|
||||
if (!ip.isSiteLocalAddress() && !ip.isLoopbackAddress() && !ip.getHostAddress().contains(":")) {
|
||||
netip = ip.getHostAddress();
|
||||
ips.add(netip);
|
||||
finded = true;
|
||||
break;
|
||||
} else if (ip.isSiteLocalAddress() && !ip.isLoopbackAddress()
|
||||
&& !ip.getHostAddress().contains(":")) {// 内网IP
|
||||
localip = ip.getHostAddress();
|
||||
ips.add(localip);
|
||||
}
|
||||
}
|
||||
}
|
||||
return ips;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the real ip.
|
||||
*
|
||||
* @return the real ip
|
||||
*/
|
||||
public static String getRealIp() {
|
||||
return getRealIps().iterator().next();
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取访问者内网IP
|
||||
*
|
||||
* @return the server ip
|
||||
*/
|
||||
public static String getInternalIp() {
|
||||
// 本地IP,如果没有配置外网IP则返回它
|
||||
String localip = null;
|
||||
// 外网IP
|
||||
String netip = null;
|
||||
try {
|
||||
Enumeration netInterfaces = NetworkInterface.getNetworkInterfaces();
|
||||
InetAddress ip = null;
|
||||
// 是否找到外网IP
|
||||
boolean finded = false;
|
||||
while (netInterfaces.hasMoreElements() && !finded) {
|
||||
NetworkInterface ni = (NetworkInterface) netInterfaces.nextElement();
|
||||
Enumeration address = ni.getInetAddresses();
|
||||
while (address.hasMoreElements()) {
|
||||
ip = (InetAddress) address.nextElement();
|
||||
if (!ip.isSiteLocalAddress() && !ip.isLoopbackAddress() && ip.getHostAddress().indexOf(":") == -1) {
|
||||
// 外网IP
|
||||
netip = ip.getHostAddress();
|
||||
finded = true;
|
||||
break;
|
||||
} else if (ip.isSiteLocalAddress() && !ip.isLoopbackAddress()
|
||||
&& ip.getHostAddress().indexOf(":") == -1) {
|
||||
// 内网IP
|
||||
localip = ip.getHostAddress();
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (SocketException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
if (netip != null && !"".equals(netip)) {
|
||||
return netip;
|
||||
} else {
|
||||
return localip;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 判断ip是否在网段cidr内,cidr格式192.168.0.1/255
|
||||
*
|
||||
* @return the server ip
|
||||
*/
|
||||
public static boolean ipInRange(String ip, String cidr) {
|
||||
try {
|
||||
String[] tmp = cidr.split("/");
|
||||
|
||||
if (tmp.length > 1) {
|
||||
|
||||
String[] ips = ip.split("\\.");
|
||||
int ipAddr = (Integer.parseInt(ips[0]) << 24) | (Integer.parseInt(ips[1]) << 16)
|
||||
| (Integer.parseInt(ips[2]) << 8) | Integer.parseInt(ips[3]);
|
||||
int type = Integer.parseInt(cidr.replaceAll(".*/", ""));
|
||||
int mask = 0xFFFFFFFF << (32 - type);
|
||||
String cidrIp = cidr.replaceAll("/.*", "");
|
||||
String[] cidrIps = cidrIp.split("\\.");
|
||||
int cidrIpAddr = (Integer.parseInt(cidrIps[0]) << 24) | (Integer.parseInt(cidrIps[1]) << 16)
|
||||
| (Integer.parseInt(cidrIps[2]) << 8) | Integer.parseInt(cidrIps[3]);
|
||||
return (ipAddr & mask) == (cidrIpAddr & mask);
|
||||
} else if (tmp.length == 1 && ip.equals(cidr)) {
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
} catch (Exception ex) {
|
||||
ex.printStackTrace();
|
||||
public static boolean isLocalServerIp(String ip) {
|
||||
if (ip == null || ip.isEmpty()) {
|
||||
return false;
|
||||
}
|
||||
if ("127.0.0.1".equals(ip) || "0:0:0:0:0:0:0:1".equals(ip) || "::1".equals(ip)) {
|
||||
return true;
|
||||
}
|
||||
Set<String> localIps = LOCAL_SERVER_IPS;
|
||||
if (localIps == null) {
|
||||
synchronized (NetworkUtil.class) {
|
||||
if (LOCAL_SERVER_IPS == null) {
|
||||
Set<String> tmp = new HashSet<>();
|
||||
try {
|
||||
Enumeration<NetworkInterface> netInterfaces = NetworkInterface.getNetworkInterfaces();
|
||||
while (netInterfaces != null && netInterfaces.hasMoreElements()) {
|
||||
NetworkInterface ni = netInterfaces.nextElement();
|
||||
Enumeration<InetAddress> address = ni.getInetAddresses();
|
||||
while (address.hasMoreElements()) {
|
||||
InetAddress addr = address.nextElement();
|
||||
String host = addr.getHostAddress();
|
||||
if (host != null && !host.isEmpty()) {
|
||||
int zoneIdx = host.indexOf('%');
|
||||
if (zoneIdx > 0) {
|
||||
host = host.substring(0, zoneIdx);
|
||||
}
|
||||
tmp.add(host);
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (SocketException e) {
|
||||
// ignore, fall back to loopback-only matching
|
||||
}
|
||||
LOCAL_SERVER_IPS = tmp;
|
||||
}
|
||||
localIps = LOCAL_SERVER_IPS;
|
||||
}
|
||||
}
|
||||
return localIps.contains(ip);
|
||||
}
|
||||
|
||||
public static String getServerName() {
|
||||
String serverName="";
|
||||
try {
|
||||
// 禁止的端口
|
||||
private static final Set<Integer> BLOCKED_PORTS = new HashSet<>(
|
||||
Arrays.asList(22, 23, 25, 53, 110, 143, 3306, 5432, 6379, 27017)
|
||||
);
|
||||
|
||||
/**
|
||||
* Gets the client ip addr.
|
||||
*
|
||||
* @param request the request
|
||||
* @return the client ip addr
|
||||
*/
|
||||
public static String getClientIpAddr(HttpServletRequest request) {
|
||||
String ip = request.getHeader("x-forwarded-for");
|
||||
String unknown = "unknown";
|
||||
if (ip == null || ip.length() == 0 || unknown.equalsIgnoreCase(ip)) {
|
||||
ip = request.getHeader("Proxy-Client-IP");
|
||||
}
|
||||
if (ip == null || ip.length() == 0 || unknown.equalsIgnoreCase(ip)) {
|
||||
ip = request.getHeader("WL-Proxy-Client-IP");
|
||||
}
|
||||
if (ip == null || ip.length() == 0 || unknown.equalsIgnoreCase(ip)) {
|
||||
ip = request.getHeader("HTTP_CLIENT_IP");
|
||||
}
|
||||
if (ip == null || ip.length() == 0 || unknown.equalsIgnoreCase(ip)) {
|
||||
ip = request.getHeader("HTTP_X_FORWARDED_FOR");
|
||||
}
|
||||
if (ip == null || ip.length() == 0 || unknown.equalsIgnoreCase(ip)) {
|
||||
ip = request.getRemoteAddr();
|
||||
}
|
||||
return "0:0:0:0:0:0:0:1".equals(ip) ? "127.0.0.1" : ip;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the real ips.
|
||||
*
|
||||
* @return the real ips
|
||||
*/
|
||||
public static List<String> getRealIps() {
|
||||
List<String> ips = new ArrayList<String>();
|
||||
String localip = null;// 本地IP,如果没有配置外网IP则返回它
|
||||
String netip = null;// 外网IP
|
||||
Enumeration<NetworkInterface> netInterfaces;
|
||||
try {
|
||||
netInterfaces = NetworkInterface.getNetworkInterfaces();
|
||||
} catch (SocketException e) {
|
||||
return null;
|
||||
}
|
||||
|
||||
InetAddress ip = null;
|
||||
boolean finded = false;// 是否找到外网IP
|
||||
while (netInterfaces.hasMoreElements() && !finded) {
|
||||
NetworkInterface ni = netInterfaces.nextElement();
|
||||
Enumeration<InetAddress> address = ni.getInetAddresses();
|
||||
while (address.hasMoreElements()) {
|
||||
ip = address.nextElement();
|
||||
if (!ip.isSiteLocalAddress() && !ip.isLoopbackAddress() && ip.getHostAddress().indexOf(":") == -1) {// 外网IP
|
||||
netip = ip.getHostAddress();
|
||||
ips.add(netip);
|
||||
finded = true;
|
||||
break;
|
||||
} else if (ip.isSiteLocalAddress() && !ip.isLoopbackAddress()
|
||||
&& ip.getHostAddress().indexOf(":") == -1) {// 内网IP
|
||||
localip = ip.getHostAddress();
|
||||
ips.add(localip);
|
||||
}
|
||||
}
|
||||
}
|
||||
return ips;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the real ip.
|
||||
*
|
||||
* @return the real ip
|
||||
*/
|
||||
public static String getRealIp() {
|
||||
return getRealIps().iterator().next();
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取访问者内网IP
|
||||
*
|
||||
* @return the server ip
|
||||
*/
|
||||
public static String getInternalIp() {
|
||||
// 本地IP,如果没有配置外网IP则返回它
|
||||
String localip = null;
|
||||
// 外网IP
|
||||
String netip = null;
|
||||
try {
|
||||
Enumeration netInterfaces = NetworkInterface.getNetworkInterfaces();
|
||||
InetAddress ip = null;
|
||||
// 是否找到外网IP
|
||||
boolean finded = false;
|
||||
while (netInterfaces.hasMoreElements() && !finded) {
|
||||
NetworkInterface ni = (NetworkInterface) netInterfaces.nextElement();
|
||||
Enumeration address = ni.getInetAddresses();
|
||||
while (address.hasMoreElements()) {
|
||||
ip = (InetAddress) address.nextElement();
|
||||
if (!ip.isSiteLocalAddress() && !ip.isLoopbackAddress() && ip.getHostAddress().indexOf(":") == -1) {
|
||||
// 外网IP
|
||||
netip = ip.getHostAddress();
|
||||
finded = true;
|
||||
break;
|
||||
} else if (ip.isSiteLocalAddress() && !ip.isLoopbackAddress()
|
||||
&& ip.getHostAddress().indexOf(":") == -1) {
|
||||
// 内网IP
|
||||
localip = ip.getHostAddress();
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (SocketException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
if (netip != null && !"".equals(netip)) {
|
||||
return netip;
|
||||
} else {
|
||||
return localip;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 判断ip是否在网段cidr内,cidr格式192.168.0.1/255
|
||||
*
|
||||
* @return the server ip
|
||||
*/
|
||||
public static boolean ipInRange(String ip, String cidr) {
|
||||
try {
|
||||
String[] tmp = cidr.split("/");
|
||||
|
||||
if (tmp.length > 1) {
|
||||
|
||||
String[] ips = ip.split("\\.");
|
||||
int ipAddr = (Integer.parseInt(ips[0]) << 24) | (Integer.parseInt(ips[1]) << 16)
|
||||
| (Integer.parseInt(ips[2]) << 8) | Integer.parseInt(ips[3]);
|
||||
int type = Integer.parseInt(cidr.replaceAll(".*/", ""));
|
||||
int mask = 0xFFFFFFFF << (32 - type);
|
||||
String cidrIp = cidr.replaceAll("/.*", "");
|
||||
String[] cidrIps = cidrIp.split("\\.");
|
||||
int cidrIpAddr = (Integer.parseInt(cidrIps[0]) << 24) | (Integer.parseInt(cidrIps[1]) << 16)
|
||||
| (Integer.parseInt(cidrIps[2]) << 8) | Integer.parseInt(cidrIps[3]);
|
||||
return (ipAddr & mask) == (cidrIpAddr & mask);
|
||||
} else if (tmp.length == 1 && ip.equals(cidr)) {
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
} catch (Exception ex) {
|
||||
ex.printStackTrace();
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public static String getServerName() {
|
||||
String serverName="";
|
||||
try {
|
||||
InetAddress localhost = InetAddress.getLocalHost();
|
||||
serverName = localhost.getHostName();
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return serverName;
|
||||
}
|
||||
return serverName;
|
||||
}
|
||||
|
||||
/**
|
||||
* 判断ip是否在网段cidr内,cidr格式192.168.0.1/255
|
||||
*
|
||||
* @return the server ip
|
||||
*/
|
||||
public static boolean isMacauIp(String ip,String macauIps) {
|
||||
try {
|
||||
String[] cidrArr = StringUtils.split(macauIps,";");
|
||||
if(cidrArr.length>0) {
|
||||
for(String cidr : cidrArr) {
|
||||
String[] tmp = cidr.split("/");
|
||||
if (tmp.length > 1) {
|
||||
String[] ips = ip.split("\\.");
|
||||
try {
|
||||
Integer.parseInt(ips[0]);
|
||||
Integer.parseInt(ips[1]);
|
||||
Integer.parseInt(ips[2]);
|
||||
Integer.parseInt(ips[3]);
|
||||
} catch (Exception e) {
|
||||
continue;
|
||||
}
|
||||
int ipAddr = (Integer.parseInt(ips[0]) << 24) | (Integer.parseInt(ips[1]) << 16)
|
||||
| (Integer.parseInt(ips[2]) << 8) | Integer.parseInt(ips[3]);
|
||||
int type = Integer.parseInt(cidr.replaceAll(".*/", ""));
|
||||
int mask = 0xFFFFFFFF << (32 - type);
|
||||
String cidrIp = cidr.replaceAll("/.*", "");
|
||||
String[] cidrIps = cidrIp.split("\\.");
|
||||
int cidrIpAddr = (Integer.parseInt(cidrIps[0]) << 24) | (Integer.parseInt(cidrIps[1]) << 16)
|
||||
| (Integer.parseInt(cidrIps[2]) << 8) | Integer.parseInt(cidrIps[3]);
|
||||
if((ipAddr & mask) == (cidrIpAddr & mask)) return true;
|
||||
} else if (tmp.length == 1 && ip.equals(cidr)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}else {
|
||||
return false;
|
||||
}
|
||||
|
||||
} catch (Exception ex) {
|
||||
ex.printStackTrace();
|
||||
return false;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public static boolean isRequestFromTrustedSource(HttpServletRequest request) {
|
||||
if(StringUtils.isNotBlank(request.getHeader("x-forwarded-for"))
|
||||
||StringUtils.isNotBlank(request.getHeader("Proxy-Client-IP"))
|
||||
||StringUtils.isNotBlank(request.getHeader("WL-Proxy-Client-IP"))
|
||||
||StringUtils.isNotBlank(request.getHeader("HTTP_CLIENT_IP"))
|
||||
||StringUtils.isNotBlank(request.getHeader("HTTP_X_FORWARDED_FOR"))){
|
||||
|
||||
String remoteAddr = request.getRemoteAddr();
|
||||
if(SysCommon.isAllowForwarderIPSource(remoteAddr)) {
|
||||
LogUtil.warn(NetworkUtil.class, "IP remoteAddr="+remoteAddr);
|
||||
return true;
|
||||
}else {
|
||||
LogUtil.warn(NetworkUtil.class, "IP of ["+remoteAddr+"] is not allowed proxy IP");
|
||||
return false;
|
||||
}
|
||||
}else{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
public static boolean isValidURL(String requestUrl){
|
||||
try {
|
||||
@@ -348,7 +237,6 @@ public class NetworkUtil {
|
||||
return false;
|
||||
}
|
||||
if(host.matches("\\d+\\.\\d+\\.\\d+\\.\\d+")) {
|
||||
LogUtil.warn(NetworkUtil.class, "Validate URL failed of as IP address");
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
@@ -357,23 +245,131 @@ public class NetworkUtil {
|
||||
}
|
||||
}
|
||||
|
||||
public static String encodeParaWithSpring(String value) {
|
||||
if(value==null)
|
||||
value="";
|
||||
value= value.replace("\r", "").replace("\n", "");
|
||||
return UriUtils.encode(value, StandardCharsets.UTF_8);
|
||||
public static String sanitizeCRLF(String input){
|
||||
if(input==null)
|
||||
return null;
|
||||
return input.replaceAll("[\r\n]+", "");
|
||||
}
|
||||
|
||||
public static String sanitizeHeaderValue(String headerValue) {
|
||||
return headerValue==null? null :(StringEscapeUtils.escapeJava(
|
||||
headerValue.replace("\r", "").replace("\n", "")
|
||||
));
|
||||
public static String encodeParaWithSpring(String value) {
|
||||
if(value==null)
|
||||
value="";
|
||||
value= value.replace("\r", "").replace("\n", "");
|
||||
return UriUtils.encode(value, StandardCharsets.UTF_8);
|
||||
}
|
||||
|
||||
public static String encodePathWithSpring(String value) {
|
||||
if(value==null)
|
||||
value="";
|
||||
value= value.replace("\r", "").replace("\n", "");
|
||||
return UriUtils.encodePath(value, StandardCharsets.UTF_8);
|
||||
}
|
||||
|
||||
public static String validateAndSanitizeUrl(String userInputUrl) throws SecurityException {
|
||||
if (userInputUrl == null || userInputUrl.trim().isEmpty()) {
|
||||
throw new SecurityException("URL should not be blank");
|
||||
}
|
||||
|
||||
try {
|
||||
// 1. 解析URL
|
||||
URL url = new URI(userInputUrl).toURL();
|
||||
|
||||
// 2. 验证协议
|
||||
validateProtocol(url.getProtocol());
|
||||
|
||||
// 3. 验证主机名/IP
|
||||
String host = url.getHost();
|
||||
validateHost(host);
|
||||
|
||||
// 4. 验证端口
|
||||
int port = url.getPort();
|
||||
if (port == -1) {
|
||||
port = url.getDefaultPort();
|
||||
}
|
||||
validatePort(port);
|
||||
|
||||
// 5. 验证路径(防止路径遍历)
|
||||
validatePath(url.getPath());
|
||||
|
||||
// 6. 返回净化后的URL(标准化)
|
||||
return sanitizeUrl(url);
|
||||
|
||||
} catch (Exception e) {
|
||||
throw new SecurityException("Invalid URL: " + e.getMessage(), e);
|
||||
}
|
||||
}
|
||||
|
||||
public static String encodePathWithSpring(String value) {
|
||||
if(value==null)
|
||||
value="";
|
||||
value= value.replace("\r", "").replace("\n", "");
|
||||
return UriUtils.encodePath(value, StandardCharsets.UTF_8);
|
||||
private static void validateProtocol(String protocol) throws SecurityException {
|
||||
if (!ALLOWED_PROTOCOLS.contains(protocol.toLowerCase())) {
|
||||
throw new SecurityException("No support protocol: " + protocol + ", only for HTTP/HTTPS");
|
||||
}
|
||||
}
|
||||
|
||||
private static void validateHost(String host) throws SecurityException {
|
||||
if (host == null || host.isEmpty()) {
|
||||
throw new SecurityException("Host name can not be empty");
|
||||
}
|
||||
|
||||
// 解析IP并验证
|
||||
try {
|
||||
InetAddress address = InetAddress.getByName(host);
|
||||
String ip = address.getHostAddress();
|
||||
|
||||
// 检查是否为回环地址(Debug 模式下允许,便于本地联调)
|
||||
if (address.isLoopbackAddress() && !isDebugMode()) {
|
||||
throw new SecurityException("Forbit loopback address");
|
||||
}
|
||||
|
||||
} catch (UnknownHostException e) {
|
||||
throw new SecurityException("Invalid host: " + host);
|
||||
}
|
||||
}
|
||||
|
||||
private static boolean isDebugMode() {
|
||||
if (SysCommon.appDebugLog) {
|
||||
return true;
|
||||
}
|
||||
return ManagementFactory.getRuntimeMXBean().getInputArguments().stream()
|
||||
.anyMatch(arg -> arg.contains("-agentlib:jdwp") || arg.contains("-Xrunjdwp"));
|
||||
}
|
||||
|
||||
private static void validatePort(int port) throws SecurityException {
|
||||
// 检查是否为禁止端口
|
||||
if (BLOCKED_PORTS.contains(port)) {
|
||||
throw new SecurityException("Invalid Port: " + port);
|
||||
}
|
||||
}
|
||||
|
||||
private static void validatePath(String path) throws SecurityException {
|
||||
if (path == null) return;
|
||||
|
||||
// 防止路径遍历攻击
|
||||
if (path.contains("..")) {
|
||||
throw new SecurityException("Invalid path contains '..'");
|
||||
}
|
||||
if (path.toLowerCase().contains("://")) {
|
||||
throw new SecurityException("Invalid path prefix");
|
||||
}
|
||||
}
|
||||
|
||||
private static String sanitizeUrl(URL url) {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append(url.getProtocol()).append("://");
|
||||
sb.append(url.getHost());
|
||||
|
||||
int port = url.getPort();
|
||||
if (port != -1 && port != url.getDefaultPort()) {
|
||||
sb.append(":").append(port);
|
||||
}
|
||||
|
||||
sb.append(url.getPath());
|
||||
|
||||
String query = url.getQuery();
|
||||
if (query != null && !query.isEmpty()) {
|
||||
sb.append("?").append(query);
|
||||
}
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -1,31 +1,26 @@
|
||||
package com.mgm.mcrm.common.utils;
|
||||
|
||||
import java.io.BufferedReader;
|
||||
import java.io.ByteArrayInputStream;
|
||||
import java.io.InputStream;
|
||||
import java.io.InputStreamReader;
|
||||
import java.io.OutputStream;
|
||||
import java.io.OutputStreamWriter;
|
||||
import java.net.*;
|
||||
import java.security.cert.CertificateException;
|
||||
import java.security.cert.X509Certificate;
|
||||
|
||||
import javax.xml.soap.SOAPMessage;
|
||||
|
||||
import com.mgm.mcrm.common.constants.SysCommon;
|
||||
import com.mgm.mcrm.common.services.ConfigurableTrustHandler;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
import javax.net.ssl.HostnameVerifier;
|
||||
import javax.net.ssl.HttpsURLConnection;
|
||||
import javax.net.ssl.SSLContext;
|
||||
import javax.net.ssl.SSLSession;
|
||||
import javax.net.ssl.SSLSocketFactory;
|
||||
import javax.net.ssl.TrustManager;
|
||||
import javax.net.ssl.X509TrustManager;
|
||||
import javax.xml.soap.MessageFactory;
|
||||
|
||||
|
||||
|
||||
public class SOAPUtil {
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* 远程访问SOAP协议接口
|
||||
*
|
||||
@@ -40,6 +35,19 @@ public class SOAPUtil {
|
||||
* 参考---》http://www.webxml.com.cn/WebServices/WeatherWebService.asmx?op=getWeatherbyCityName
|
||||
*/
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
private static boolean skipValidation=true;
|
||||
|
||||
private static ConfigurableTrustHandler trustHandler=null;
|
||||
|
||||
public static ConfigurableTrustHandler getTrustHandler(){
|
||||
if(trustHandler==null){
|
||||
trustHandler =new ConfigurableTrustHandler(skipValidation, SysCommon.getDefaultTrustManager(), SysCommon.getSoapServers());
|
||||
}
|
||||
return trustHandler;
|
||||
}
|
||||
|
||||
public static String getWebServiceSOAP(String url,String action,StringBuffer sendSoapString){
|
||||
String soap = sendSoapString.toString();
|
||||
if (soap == null) {
|
||||
@@ -48,12 +56,13 @@ public class SOAPUtil {
|
||||
|
||||
try {
|
||||
URL soapUrl = new URL(url);
|
||||
Boolean isHttps = url.startsWith("https");
|
||||
boolean isHttps = url.startsWith("https");
|
||||
HttpURLConnection conn = (HttpURLConnection) soapUrl.openConnection();
|
||||
if(isHttps) {
|
||||
HttpsURLConnection https = (HttpsURLConnection) conn;
|
||||
trustAllHosts(https);
|
||||
https.setHostnameVerifier(checkSoapServer);
|
||||
ConfigurableTrustHandler manager = getTrustHandler();
|
||||
trustAllHosts(https,manager);
|
||||
https.setHostnameVerifier(manager);
|
||||
}
|
||||
conn.setUseCaches(false);
|
||||
conn.setDoInput(true);
|
||||
@@ -97,12 +106,13 @@ public class SOAPUtil {
|
||||
|
||||
try {
|
||||
URL soapUrl = new URL(url);
|
||||
Boolean isHttps = url.startsWith("https");
|
||||
boolean isHttps = url.startsWith("https");
|
||||
HttpURLConnection conn = (HttpURLConnection) soapUrl.openConnection();
|
||||
if(isHttps) {
|
||||
HttpsURLConnection https = (HttpsURLConnection) conn;
|
||||
trustAllHosts(https);
|
||||
https.setHostnameVerifier(checkSoapServer);
|
||||
ConfigurableTrustHandler manager = getTrustHandler();
|
||||
trustAllHosts(https,manager);
|
||||
https.setHostnameVerifier(manager);
|
||||
}
|
||||
conn.setUseCaches(false);
|
||||
conn.setDoInput(true);
|
||||
@@ -137,70 +147,13 @@ public class SOAPUtil {
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public static SOAPMessage getSOAPMessageFromXMLString(String xmlString) {
|
||||
|
||||
SOAPMessage soapMessage = null;
|
||||
try {
|
||||
InputStream is = new ByteArrayInputStream(xmlString.getBytes());
|
||||
soapMessage = MessageFactory.newInstance().createMessage(null, is);
|
||||
//SOAPEnvelope soapEnvelope = soapMessage.getSOAPPart().getEnvelope();
|
||||
//soapEnvelope.addNamespaceDeclaration(namespacePrefix, namespaceURI);
|
||||
//soapMessage.saveChanges();
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return soapMessage;
|
||||
}
|
||||
|
||||
private static final TrustManager[] trustAllCerts = new TrustManager[] {new X509TrustManager() {
|
||||
|
||||
@Override
|
||||
public X509Certificate[] getAcceptedIssuers() {
|
||||
return new java.security.cert.X509Certificate[] {};
|
||||
}
|
||||
|
||||
@Override
|
||||
public void checkServerTrusted(X509Certificate[] chain, String arg1) throws CertificateException {
|
||||
if (chain == null || chain.length == 0) {
|
||||
throw new IllegalArgumentException("No server certificates provided");
|
||||
}
|
||||
for (X509Certificate cert : chain) {
|
||||
cert.checkValidity();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void checkClientTrusted(X509Certificate[] chain, String arg1) throws CertificateException {
|
||||
if (chain == null || chain.length == 0) {
|
||||
throw new CertificateException("No client certificates provided");
|
||||
}
|
||||
for (X509Certificate cert : chain) {
|
||||
cert.checkValidity(); // 检查证书是否在有效期内
|
||||
}
|
||||
}
|
||||
}};
|
||||
|
||||
private static final HostnameVerifier checkSoapServer = new HostnameVerifier() {
|
||||
public boolean verify(String hostname, SSLSession session) {
|
||||
boolean isServerAllow = SysCommon.isAllowSoapServer(hostname);
|
||||
if(isServerAllow==false) {
|
||||
LogUtil.warn(SOAPUtil.class, "SOAP Server of ["+hostname+"] is not allowed");
|
||||
}
|
||||
return SysCommon.isAllowSoapServer(hostname);
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* 信任所有
|
||||
* @param connection
|
||||
* @return
|
||||
*/
|
||||
private static SSLSocketFactory trustAllHosts(HttpsURLConnection conn) {
|
||||
private static SSLSocketFactory trustAllHosts(HttpsURLConnection conn,ConfigurableTrustHandler manager) {
|
||||
SSLSocketFactory oldFactory = conn.getSSLSocketFactory();
|
||||
try {
|
||||
SSLContext sc = SSLContext.getInstance("TLS");
|
||||
sc.init(null, trustAllCerts, new java.security.SecureRandom());
|
||||
sc.init(null, new TrustManager[]{manager}, new java.security.SecureRandom());
|
||||
SSLSocketFactory newFactory = sc.getSocketFactory();
|
||||
conn.setSSLSocketFactory(newFactory);
|
||||
} catch (Exception e) {
|
||||
|
||||
@@ -16,6 +16,7 @@ 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.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
@@ -34,7 +35,7 @@ public class BookingLogController {
|
||||
@Resource
|
||||
private SysLogBookingMapper logBookingMapper;
|
||||
|
||||
@RequestMapping(value = "/system/log_booking/get", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
|
||||
@RequestMapping(value = "/system/log_booking/get", method = RequestMethod.POST, produces = "application/json;charset=UTF-8",consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||
public ResponseEntity<SysLogBookingResponse> getLogById(HttpServletRequest request, @RequestBody(required=false) SysLogBookingGetPageRequest sysLogBookingGetPageRequest) {
|
||||
SysLogBookingResponse result = new SysLogBookingResponse();
|
||||
boolean isSuccess = false;
|
||||
@@ -58,7 +59,7 @@ public class BookingLogController {
|
||||
return ResponseEntity.status(HttpStatus.OK).body(result);
|
||||
}
|
||||
|
||||
@RequestMapping(value = "/system/log_booking/get_page", produces = "application/json;charset=UTF-8")
|
||||
@RequestMapping(value = "/system/log_booking/get_page", produces = "application/json;charset=UTF-8",consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||
public AjaxResult getRoomByPage(HttpServletRequest request,@RequestBody(required=false) Map<String,Object> queryParas) {
|
||||
QueryFilter queryFilter = (queryParas!=null?new QueryFilter(queryParas):new QueryFilter(request));
|
||||
return processPageRequest(queryFilter);
|
||||
|
||||
@@ -7,6 +7,7 @@ import com.mgm.mcrm.logging.services.SysLogApproverService;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import jakarta.annotation.Resource;
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMethod;
|
||||
@@ -30,7 +31,7 @@ public class LogApproverController {
|
||||
@Resource
|
||||
private SysLogApproverService sysLogApproverService;
|
||||
|
||||
// @RequestMapping(value = "/system/log_approver/get", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
|
||||
// @RequestMapping(value = "/system/log_approver/get", method = RequestMethod.POST, produces = "application/json;charset=UTF-8",consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||
// public AjaxResult getLogById(HttpServletRequest request, @RequestBody(required=false) Map<String,Object> queryParas) {
|
||||
// boolean isSuccess = false;
|
||||
// String processMessage="";
|
||||
@@ -55,7 +56,7 @@ public class LogApproverController {
|
||||
// return processResult;
|
||||
// }
|
||||
|
||||
@RequestMapping(value = "/system/log_approver/get_page", produces = "application/json;charset=UTF-8")
|
||||
@RequestMapping(value = "/system/log_approver/get_page", produces = "application/json;charset=UTF-8",consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||
public AjaxResult getRoomByPage(HttpServletRequest request,@RequestBody(required=false) Map<String,Object> queryParas) {
|
||||
QueryFilter queryFilter = (queryParas!=null?new QueryFilter(queryParas):new QueryFilter(request));
|
||||
return processPageRequest(queryFilter);
|
||||
|
||||
@@ -13,6 +13,7 @@ import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import jakarta.annotation.Resource;
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMethod;
|
||||
@@ -30,7 +31,7 @@ public class SysLogAppController {
|
||||
private SysLogAppService logService;
|
||||
|
||||
|
||||
@RequestMapping(value = "/app/log_app/get_event_list", method = RequestMethod.GET, produces = "application/json;charset=UTF-8")
|
||||
@RequestMapping(value = "/app/log_app/get_event_list", method = RequestMethod.GET, produces = "application/json;charset=UTF-8",consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||
public AjaxResult getEventList(HttpServletRequest request, @RequestBody(required=false) Map<String,Object> queryParas) {
|
||||
boolean isSuccess = false;
|
||||
String processMessage="";
|
||||
@@ -55,13 +56,13 @@ public class SysLogAppController {
|
||||
return processResult;
|
||||
}
|
||||
|
||||
@RequestMapping(value = "/app/log_app/get_page", produces = "application/json;charset=UTF-8")
|
||||
@RequestMapping(value = "/app/log_app/get_page", produces = "application/json;charset=UTF-8",consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||
public AjaxResult getlogLoginByPage(HttpServletRequest request,@RequestBody(required=false) Map<String,Object> queryParas) {
|
||||
QueryFilter queryFilter = (queryParas!=null?new QueryFilter(queryParas):new QueryFilter(request));
|
||||
return processPageRequest(queryFilter);
|
||||
}
|
||||
|
||||
@RequestMapping(value = "/app/log_app/get", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
|
||||
@RequestMapping(value = "/app/log_app/get", method = RequestMethod.POST, produces = "application/json;charset=UTF-8",consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||
public AjaxResult getOperationLogById(HttpServletRequest request, @RequestBody(required=false) Map<String,Object> queryParas) {
|
||||
boolean isSuccess = false;
|
||||
String processMessage="";
|
||||
|
||||
@@ -15,6 +15,7 @@ import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import jakarta.annotation.Resource;
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMethod;
|
||||
@@ -32,7 +33,7 @@ public class SysLogConfirmController {
|
||||
private SysLogConfirmService logService;
|
||||
|
||||
@CheckPermission(routerId="00805",permissionCode="VIEW")
|
||||
@RequestMapping(value = "/app/log_confirm/get_page", produces = "application/json;charset=UTF-8")
|
||||
@RequestMapping(value = "/app/log_confirm/get_page", produces = "application/json;charset=UTF-8",consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||
public AjaxResult getlogLoginByPage(HttpServletRequest request, @RequestBody(required=false)SysLogConfirmPageRequest sysLogConfirmPageRequest) {
|
||||
boolean isSuccess = false;
|
||||
String processMessage="";
|
||||
@@ -70,7 +71,7 @@ public class SysLogConfirmController {
|
||||
|
||||
|
||||
@CheckPermission(routerId="00805",permissionCode="VIEW")
|
||||
@RequestMapping(value = "/app/log_confirm/get", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
|
||||
@RequestMapping(value = "/app/log_confirm/get", method = RequestMethod.POST, produces = "application/json;charset=UTF-8",consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||
public AjaxResult getOperationLogById(HttpServletRequest request, @RequestBody(required=false)SysLogConfirmGetByIdRequest sysLogConfirmGetByIdRequest) {
|
||||
boolean isSuccess = false;
|
||||
String processMessage="";
|
||||
|
||||
@@ -6,6 +6,7 @@ import com.mgm.mcrm.logging.dtos.Request.SysLogEtaPageRequest;
|
||||
import com.mgm.mcrm.logging.dtos.SysLogETADto;
|
||||
import com.mgm.mcrm.logging.services.SysLogETAService;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import com.mgm.mcrm.common.annotation.security.CheckPermission;
|
||||
import com.mgm.mcrm.common.dtos.AjaxResult;
|
||||
@@ -27,7 +28,7 @@ public class SysLogETAController {
|
||||
private SysLogETAService sysLogETAService;
|
||||
|
||||
@CheckPermission(routerId = "00806", permissionCode = "VIEW")
|
||||
@PostMapping(value = "/app/log_ETA/get_page", produces = "application/json;charset=UTF-8")
|
||||
@PostMapping(value = "/app/log_ETA/get_page", produces = "application/json;charset=UTF-8",consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||
public AjaxResult getLogETAByPage(HttpServletRequest request, @RequestBody(required = false) SysLogEtaPageRequest pageRequest) {
|
||||
boolean isSuccess;
|
||||
String processMessage;
|
||||
@@ -64,7 +65,7 @@ public class SysLogETAController {
|
||||
}
|
||||
|
||||
@CheckPermission(routerId = "00806", permissionCode = "VIEW")
|
||||
@PostMapping(value = "/app/log_ETA/get", produces = "application/json;charset=UTF-8")
|
||||
@PostMapping(value = "/app/log_ETA/get", produces = "application/json;charset=UTF-8",consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||
public AjaxResult getOperationLogById(HttpServletRequest request, @RequestBody(required = false) SysLogEtaGetByIdRequest sysLogEtaGetByIdRequest) {
|
||||
boolean isSuccess;
|
||||
String processMessage;
|
||||
|
||||
@@ -20,6 +20,7 @@ import jakarta.servlet.http.HttpServletRequest;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMethod;
|
||||
@@ -44,7 +45,7 @@ public class SysLogEmailController {
|
||||
private SysLogEmailService logService;
|
||||
|
||||
@CheckPermission(routerId="00804",permissionCode="VIEW")
|
||||
@RequestMapping(value = "/app/log_email/get_page", produces = "application/json;charset=UTF-8")
|
||||
@RequestMapping(value = "/app/log_email/get_page", produces = "application/json;charset=UTF-8",consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||
public AjaxResult getlogLoginByPage(HttpServletRequest request, @RequestBody(required=false)SysLogEmailPageRequest sysLogEmailPageRequest) {
|
||||
boolean isSuccess = false;
|
||||
String processMessage="";
|
||||
@@ -81,7 +82,7 @@ public class SysLogEmailController {
|
||||
}
|
||||
|
||||
@CheckPermission(routerId="00804",permissionCode="VIEW")
|
||||
@RequestMapping(value = "/app/log_email/get", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
|
||||
@RequestMapping(value = "/app/log_email/get", method = RequestMethod.POST, produces = "application/json;charset=UTF-8",consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||
public AjaxResult getEmailLogById(HttpServletRequest request, @RequestBody(required=false)SysLogEmailGetByIdRequest sysLogEmailGetByIdRequest) {
|
||||
boolean isSuccess = false;
|
||||
String processMessage="";
|
||||
@@ -107,8 +108,8 @@ public class SysLogEmailController {
|
||||
|
||||
@CheckPermission(routerId="00804",permissionCode="EXPORT")
|
||||
@RequestMapping(value = "/app/log_email/export_excel")
|
||||
public void exportExcel(HttpServletRequest request, HttpServletResponse response,@RequestBody(required=false) SysLogEmailPageRequest sysLogEmailPageRequest) throws Exception {
|
||||
QueryFilter queryFilter =new QueryFilter(request);
|
||||
public void exportExcel(HttpServletRequest request, HttpServletResponse response) throws Exception {
|
||||
SysLogEmailPageRequest sysLogEmailPageRequest = (new QueryFilter(request)).convertToRequest(SysLogEmailPageRequest.class);
|
||||
ExportDefine reportDef = ExcelUtils.getExportDefineByName("EXPORT_EMAIL_LOG");
|
||||
if(reportDef!=null) {
|
||||
List<String> dateRange = sysLogEmailPageRequest.getSearchOperateDate();
|
||||
|
||||
@@ -18,6 +18,7 @@ import jakarta.servlet.http.HttpServletRequest;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMethod;
|
||||
@@ -41,7 +42,7 @@ public class SysLogLoginController {
|
||||
private SysLogLoginService logService;
|
||||
|
||||
@CheckPermission(routerId="00802",permissionCode="VIEW")
|
||||
@RequestMapping(value = "/app/log_login/get_page", produces = "application/json;charset=UTF-8")
|
||||
@RequestMapping(value = "/app/log_login/get_page", produces = "application/json;charset=UTF-8",consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||
public AjaxResult getlogLoginByPage(HttpServletRequest request, @RequestBody(required=false)SysLogLoginPageRequest sysLogLoginPageRequest) {
|
||||
boolean isSuccess = false;
|
||||
String processMessage="";
|
||||
@@ -81,7 +82,7 @@ public class SysLogLoginController {
|
||||
|
||||
|
||||
@CheckPermission(routerId="00802",permissionCode="VIEW")
|
||||
@RequestMapping(value = "/app/log_login/get", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
|
||||
@RequestMapping(value = "/app/log_login/get", method = RequestMethod.POST, produces = "application/json;charset=UTF-8",consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||
public AjaxResult getLoginLogById(HttpServletRequest request, @RequestBody(required=false)SysLogLoginGetByIdRequest sysLogLoginGetByIdRequest) {
|
||||
boolean isSuccess = false;
|
||||
String processMessage="";
|
||||
@@ -106,8 +107,8 @@ public class SysLogLoginController {
|
||||
}
|
||||
@CheckPermission(routerId="00802",permissionCode="EXPORT")
|
||||
@RequestMapping(value = "/app/log_login/export_excel")
|
||||
public void exportExcel(HttpServletRequest request, HttpServletResponse response,@RequestBody(required=false)SysLogLoginPageRequest sysLogLoginPageRequest) throws Exception {
|
||||
QueryFilter queryFilter =new QueryFilter(request);
|
||||
public void exportExcel(HttpServletRequest request, HttpServletResponse response) throws Exception {
|
||||
SysLogLoginPageRequest sysLogLoginPageRequest = (new QueryFilter(request)).convertToRequest(SysLogLoginPageRequest.class);
|
||||
ExportDefine reportDef = ExcelUtils.getExportDefineByName("EXPORT_LOGIN_LOG");
|
||||
if(reportDef!=null) {
|
||||
List<String> dateRange = sysLogLoginPageRequest.getSearchOperateDate();
|
||||
|
||||
@@ -20,6 +20,7 @@ import jakarta.servlet.http.HttpServletRequest;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMethod;
|
||||
@@ -44,7 +45,7 @@ public class SysLogOperationController {
|
||||
private SysLogOperationService logService;
|
||||
|
||||
|
||||
@RequestMapping(value = "/app/log_operation/get_event_list", method = RequestMethod.GET, produces = "application/json;charset=UTF-8")
|
||||
@RequestMapping(value = "/app/log_operation/get_event_list", method = RequestMethod.GET, produces = "application/json;charset=UTF-8",consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||
public AjaxResult getEventList(HttpServletRequest request, @RequestBody(required=false) Map<String,Object> queryParas) {
|
||||
boolean isSuccess = false;
|
||||
String processMessage="";
|
||||
@@ -70,7 +71,7 @@ public class SysLogOperationController {
|
||||
}
|
||||
|
||||
@CheckPermission(routerId="00801",permissionCode="VIEW")
|
||||
@RequestMapping(value = "/app/log_operation/get_page", produces = "application/json;charset=UTF-8")
|
||||
@RequestMapping(value = "/app/log_operation/get_page", produces = "application/json;charset=UTF-8",consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||
public AjaxResult getlogLoginByPage(HttpServletRequest request, @RequestBody(required=false)SysLogOperationPageRequest sysLogOperationPageRequest) {
|
||||
boolean isSuccess = false;
|
||||
String processMessage="";
|
||||
@@ -107,7 +108,7 @@ public class SysLogOperationController {
|
||||
}
|
||||
|
||||
@CheckPermission(routerId="00801",permissionCode="VIEW")
|
||||
@RequestMapping(value = "/app/log_operation/get", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
|
||||
@RequestMapping(value = "/app/log_operation/get", method = RequestMethod.POST, produces = "application/json;charset=UTF-8",consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||
public AjaxResult getOperationLogById(HttpServletRequest request, @RequestBody(required=false)SysLogOperationGetByIdRequest sysLogOperationGetByIdRequest) {
|
||||
boolean isSuccess = false;
|
||||
String processMessage="";
|
||||
@@ -133,8 +134,8 @@ public class SysLogOperationController {
|
||||
|
||||
@CheckPermission(routerId="00801",permissionCode="EXPORT")
|
||||
@RequestMapping(value = "/app/log_operation/export_excel")
|
||||
public void exportExcel(HttpServletRequest request, HttpServletResponse response,@RequestBody(required=false) SysLogOperationPageRequest sysLogOperationPageRequest) throws Exception {
|
||||
QueryFilter queryFilter =new QueryFilter(request);
|
||||
public void exportExcel(HttpServletRequest request, HttpServletResponse response) throws Exception {
|
||||
SysLogOperationPageRequest sysLogOperationPageRequest = (new QueryFilter(request)).convertToRequest(SysLogOperationPageRequest.class);
|
||||
ExportDefine reportDef = ExcelUtils.getExportDefineByName("EXPORT_OPERATION_LOG");
|
||||
if(reportDef!=null) {
|
||||
List<String> dateRange = sysLogOperationPageRequest.getSearchOperateDate();
|
||||
|
||||
@@ -16,6 +16,7 @@ import jakarta.annotation.Resource;
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMethod;
|
||||
@@ -39,7 +40,7 @@ public class SysLogOwsController {
|
||||
private SysLogOwsService logService;
|
||||
|
||||
@CheckPermission(routerId="00803",permissionCode="VIEW")
|
||||
@RequestMapping(value = "/app/log_ows/get_page", produces = "application/json;charset=UTF-8")
|
||||
@RequestMapping(value = "/app/log_ows/get_page", produces = "application/json;charset=UTF-8",consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||
public AjaxResult getlogLoginByPage(HttpServletRequest request, @RequestBody(required=false)SysLogOwsPageRequest sysLogOwsPageRequest) {
|
||||
boolean isSuccess = false;
|
||||
String processMessage="";
|
||||
@@ -76,7 +77,7 @@ public class SysLogOwsController {
|
||||
}
|
||||
|
||||
@CheckPermission(routerId="00803",permissionCode="VIEW")
|
||||
@RequestMapping(value = "/app/log_ows/get", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
|
||||
@RequestMapping(value = "/app/log_ows/get", method = RequestMethod.POST, produces = "application/json;charset=UTF-8",consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||
public AjaxResult getOwsLogById(HttpServletRequest request, @RequestBody(required=false)SysLogOwsGetByIdRequest sysLogOwsGetByIdRequest) {
|
||||
boolean isSuccess = false;
|
||||
String processMessage="";
|
||||
@@ -102,8 +103,8 @@ public class SysLogOwsController {
|
||||
|
||||
@CheckPermission(routerId="00803",permissionCode="EXPORT")
|
||||
@RequestMapping(value = "/app/log_ows/export_excel")
|
||||
public void exportExcel(HttpServletRequest request, HttpServletResponse response,@RequestBody(required=false) SysLogOwsPageRequest sysLogOwsPageRequest) throws Exception {
|
||||
QueryFilter queryFilter =new QueryFilter(request);
|
||||
public void exportExcel(HttpServletRequest request, HttpServletResponse response) throws Exception {
|
||||
SysLogOwsPageRequest sysLogOwsPageRequest = (new QueryFilter(request)).convertToRequest(SysLogOwsPageRequest.class);
|
||||
ExportDefine reportDef = ExcelUtils.getExportDefineByName("EXPORT_OWS_LOG");
|
||||
if(reportDef!=null) {
|
||||
List<String> dateRange = sysLogOwsPageRequest.getSearchOperateDate();
|
||||
|
||||
@@ -18,6 +18,7 @@ import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import jakarta.annotation.Resource;
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMethod;
|
||||
@@ -43,7 +44,7 @@ public class EmailTemplateController {
|
||||
|
||||
@CheckPermission(routerId="00329",permissionCode="ADD")
|
||||
@OperationLog(actionName="Create Email Template", eventCode = "email_template_create")
|
||||
@RequestMapping(value = "/app/email_template/create", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
|
||||
@RequestMapping(value = "/app/email_template/create", method = RequestMethod.POST, produces = "application/json;charset=UTF-8",consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||
public AjaxResult createEmailTemplate(HttpServletRequest request, @RequestBody CfgEmailTemplateCreateUpdateRequest cfgEmailTemplateCreateUpdateRequest) {
|
||||
boolean isSuccess = false;
|
||||
String processMessage="";
|
||||
@@ -70,7 +71,7 @@ public class EmailTemplateController {
|
||||
|
||||
@CheckPermission(routerId="00329",permissionCode="MODIFY")
|
||||
@OperationLog(eventCode="email_template_update",actionName="Update Email Template")
|
||||
@RequestMapping(value = "/app/email_template/update", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
|
||||
@RequestMapping(value = "/app/email_template/update", method = RequestMethod.POST, produces = "application/json;charset=UTF-8",consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||
public AjaxResult updateEmailTemplate(HttpServletRequest request, @RequestBody CfgEmailTemplateCreateUpdateRequest cfgEmailTemplateCreateUpdateRequest) {
|
||||
boolean isSuccess = false;
|
||||
String processMessage="";
|
||||
@@ -102,7 +103,7 @@ public class EmailTemplateController {
|
||||
}
|
||||
|
||||
@CheckPermission(routerId="00329",permissionCode="VIEW")
|
||||
@RequestMapping(value = "/app/email_template/get", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
|
||||
@RequestMapping(value = "/app/email_template/get", method = RequestMethod.POST, produces = "application/json;charset=UTF-8",consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||
public AjaxResult getEmailTemplateById(HttpServletRequest request, @RequestBody(required=false) CfgEmailTemplateGetByIdRequest cfgEmailTemplateGetByIdRequest) {
|
||||
boolean isSuccess = false;
|
||||
String processMessage="";
|
||||
@@ -128,7 +129,7 @@ public class EmailTemplateController {
|
||||
|
||||
@CheckPermission(routerId="00329",permissionCode="REMOVE")
|
||||
@OperationLog(eventCode="email_template_delete",actionName="Delete Email Template")
|
||||
@RequestMapping(value = "/app/email_template/delete", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
|
||||
@RequestMapping(value = "/app/email_template/delete", method = RequestMethod.POST, produces = "application/json;charset=UTF-8",consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||
public AjaxResult deleteEmailTemplate(HttpServletRequest request, @RequestBody CfgEmailTemplateDeleteByIdRequest cfgEmailTemplateDeleteByIdRequest) {
|
||||
boolean isSuccess = false;
|
||||
String processMessage="";
|
||||
@@ -148,7 +149,7 @@ public class EmailTemplateController {
|
||||
|
||||
|
||||
@CheckPermission(routerId="00329",permissionCode="VIEW")
|
||||
@RequestMapping(value = "/app/email_template/get_page", produces = "application/json;charset=UTF-8")
|
||||
@RequestMapping(value = "/app/email_template/get_page", produces = "application/json;charset=UTF-8",consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||
public AjaxResult getEmailTemplateByPage(HttpServletRequest request, @RequestBody(required=false) CfgEmailTemplatePageRequest cfgEmailTemplatePageRequest) {
|
||||
boolean isSuccess = false;
|
||||
String processMessage="";
|
||||
@@ -172,7 +173,7 @@ public class EmailTemplateController {
|
||||
}
|
||||
|
||||
// 前端没有调用该接口
|
||||
//@RequestMapping(value = "/app/email_template/list", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
|
||||
//@RequestMapping(value = "/app/email_template/list", method = RequestMethod.POST, produces = "application/json;charset=UTF-8",consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||
public AjaxResult queryEmailTemplates(HttpServletRequest request, @RequestBody(required=false) Map<String,Object> queryParas) {
|
||||
boolean isSuccess = false;
|
||||
String processMessage="";
|
||||
@@ -197,7 +198,7 @@ public class EmailTemplateController {
|
||||
}
|
||||
|
||||
|
||||
// @RequestMapping(value = "/app/email_template/generate", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
|
||||
// @RequestMapping(value = "/app/email_template/generate", method = RequestMethod.POST, produces = "application/json;charset=UTF-8",consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||
public AjaxResult generateEmailTemplates(HttpServletRequest request, @RequestBody(required=false) Map<String,Object> queryParas) {
|
||||
boolean isSuccess = false;
|
||||
String processMessage="";
|
||||
|
||||
@@ -1,37 +1,22 @@
|
||||
package com.mgm.mcrm.notification.services;
|
||||
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Random;
|
||||
|
||||
import com.mgm.mcrm.common.dtos.HttpResponseResult;
|
||||
import com.mgm.mcrm.common.dtos.ServiceResult;
|
||||
import com.mgm.mcrm.common.dtos.config.ApiGatewaySetting;
|
||||
import jakarta.annotation.Resource;
|
||||
import jakarta.persistence.EntityManager;
|
||||
import jakarta.persistence.EntityManagerFactory;
|
||||
import jakarta.persistence.StoredProcedureQuery;
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Qualifier;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
|
||||
|
||||
|
||||
import com.mgm.mcrm.common.utils.HttpUtil;
|
||||
|
||||
|
||||
|
||||
@Service
|
||||
public class SendEmailService {
|
||||
@Resource
|
||||
private ApiGatewaySetting apiGatewaySetting;
|
||||
|
||||
public ServiceResult generateEmailTemplate(HttpServletRequest request, JSONObject temp) throws Exception {
|
||||
ServiceResult result = new ServiceResult();
|
||||
@@ -59,7 +44,7 @@ public class SendEmailService {
|
||||
public ServiceResult sendEmailTemplates(HttpServletRequest request,JSONObject temp) throws Exception {
|
||||
ServiceResult result = new ServiceResult();
|
||||
JSONObject requestObj = temp;
|
||||
HttpResponseResult httpResult = HttpUtil.invokeGatewayAPI(requestObj, "POST", request, null);
|
||||
HttpResponseResult httpResult = HttpUtil.invokeGatewayAPI(requestObj, "POST", request, null, apiGatewaySetting);
|
||||
String content = httpResult.getResponseContent();
|
||||
JSONObject obj = JSONObject.parseObject(content);
|
||||
if(obj.getBooleanValue("success")) {
|
||||
|
||||
@@ -29,6 +29,7 @@ import jakarta.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
@@ -66,7 +67,7 @@ public class BookingController {
|
||||
|
||||
@CheckPermission(routerId="00403",permissionCode="ADD")
|
||||
@OperationLog(actionName="Create Booking", eventCode = "booking_create")
|
||||
@RequestMapping(value = "/app/booking/create", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
|
||||
@RequestMapping(value = "/app/booking/create", method = RequestMethod.POST, produces = "application/json;charset=UTF-8",consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||
public AjaxResult createBooking(HttpServletRequest request, @RequestBody Map<String,Object> booking) {
|
||||
boolean isSuccess = false;
|
||||
String processMessage="";
|
||||
@@ -94,7 +95,7 @@ public class BookingController {
|
||||
|
||||
// @CheckPermission(routerId="00403",permissionCode="MODIFY")
|
||||
// @OperationLog(eventCode="booking_update",actionName="Update Booking")
|
||||
// @RequestMapping(value = "/app/booking/update", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
|
||||
// @RequestMapping(value = "/app/booking/update", method = RequestMethod.POST, produces = "application/json;charset=UTF-8",consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||
// public AjaxResult updateBooking(HttpServletRequest request, @RequestBody Bookings booking) {
|
||||
// boolean isSuccess = false;
|
||||
// String processMessage="";
|
||||
@@ -139,7 +140,7 @@ public class BookingController {
|
||||
|
||||
@CheckPermission(routerId="00403",permissionCode="MODIFY")
|
||||
@OperationLog(eventCode="booking_update",actionName="Update Booking")
|
||||
@RequestMapping(value = "/app/booking/update_failed", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
|
||||
@RequestMapping(value = "/app/booking/update_failed", method = RequestMethod.POST, produces = "application/json;charset=UTF-8",consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||
public ResponseEntity<GetBookingResponse> updateBooking(HttpServletRequest request, @RequestBody Bookings booking) {
|
||||
boolean isSuccess = false;
|
||||
String processMessage="";
|
||||
@@ -175,7 +176,7 @@ public class BookingController {
|
||||
return ResponseEntity.status(HttpStatus.OK).body(result);
|
||||
}
|
||||
|
||||
@RequestMapping(value = "/app/booking/get", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
|
||||
@RequestMapping(value = "/app/booking/get", method = RequestMethod.POST, produces = "application/json;charset=UTF-8",consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||
public ResponseEntity<GetBookingResponse> getBookingById(HttpServletRequest request, @RequestBody(required=false) OtherBookingGetByIdRequest otherBookingGetByIdRequest) {
|
||||
boolean isSuccess = false;
|
||||
String processMessage="";
|
||||
@@ -198,7 +199,7 @@ public class BookingController {
|
||||
return ResponseEntity.status(HttpStatus.OK).body(result);
|
||||
}
|
||||
|
||||
@RequestMapping(value = "/app/booking/get_follow_up_num", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
|
||||
@RequestMapping(value = "/app/booking/get_follow_up_num", method = RequestMethod.POST, produces = "application/json;charset=UTF-8",consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||
public AjaxResult getFollowUpBookingNum(HttpServletRequest request, @RequestBody(required=false) BookingGetFollowUpNumRequest bookingGetFollowUpNumRequest) {
|
||||
boolean isSuccess = false;
|
||||
String processMessage="";
|
||||
@@ -222,7 +223,7 @@ public class BookingController {
|
||||
return processResult;
|
||||
}
|
||||
|
||||
@RequestMapping(value = "/app/booking/get_page", produces = "application/json;charset=UTF-8")
|
||||
@RequestMapping(value = "/app/booking/get_page", produces = "application/json;charset=UTF-8",consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||
public ResponseEntity<BookingResponse> getBookingByPage(HttpServletRequest request,@RequestBody(required=false) OtherPropertyPageRequest otherPropertyPageRequest) throws Exception {
|
||||
//--
|
||||
if(StringUtils.isNotBlank(otherPropertyPageRequest.getPermissionId())) {
|
||||
|
||||
@@ -17,6 +17,7 @@ import jakarta.annotation.Resource;
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMethod;
|
||||
@@ -48,7 +49,7 @@ public class OtherBookingController {
|
||||
private SysLogOperationService sysAuditLogService;
|
||||
|
||||
@OperationLog(actionName="Update Batch Other Booking Room Status", eventCode = "other_booking_update")
|
||||
@RequestMapping(value = "/app/other_booking/update_batch_room_status", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
|
||||
@RequestMapping(value = "/app/other_booking/update_batch_room_status", method = RequestMethod.POST, produces = "application/json;charset=UTF-8",consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||
public AjaxResult updateBatchRoomStatus(HttpServletRequest request, @RequestBody BookingUpdateRoomStatusRequest bookingUpdateRoomStatusRequest) throws Exception {
|
||||
boolean isSuccess = false;
|
||||
String processMessage="";
|
||||
@@ -74,7 +75,7 @@ public class OtherBookingController {
|
||||
}
|
||||
|
||||
@OperationLog(actionName="Update Batch Other Booking Follow Up Status", eventCode = "other_booking_update")
|
||||
@RequestMapping(value = "/app/other_booking/update_batch_follow_up_status", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
|
||||
@RequestMapping(value = "/app/other_booking/update_batch_follow_up_status", method = RequestMethod.POST, produces = "application/json;charset=UTF-8",consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||
public AjaxResult updateBatchFollowUpStatus(HttpServletRequest request, @RequestBody BookingUpdateFollowUpStatusRequest bookingUpdateFollowUpStatusRequest) throws Exception {
|
||||
boolean isSuccess = false;
|
||||
String processMessage="";
|
||||
@@ -101,7 +102,7 @@ public class OtherBookingController {
|
||||
|
||||
@CheckPermission(routerId="00404",permissionCode="ADD")
|
||||
@OperationLog(actionName="Create Other Property Booking", eventCode = "booking_other_create")
|
||||
@RequestMapping(value = "/app/other_booking/create", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
|
||||
@RequestMapping(value = "/app/other_booking/create", method = RequestMethod.POST, produces = "application/json;charset=UTF-8",consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||
public AjaxResult createBooking(HttpServletRequest request, @RequestBody OtherPropertyCreateUpdateRequest otherPropertyCreateUpdateRequest) throws Exception {
|
||||
boolean isSuccess = false;
|
||||
String processMessage="";
|
||||
@@ -129,7 +130,7 @@ public class OtherBookingController {
|
||||
|
||||
@CheckPermission(routerId="00402",permissionCode="MODIFY")
|
||||
@OperationLog(actionName="Update Other Property Booking", eventCode = "booking_other_update")
|
||||
@RequestMapping(value = "/app/other_booking/update", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
|
||||
@RequestMapping(value = "/app/other_booking/update", method = RequestMethod.POST, produces = "application/json;charset=UTF-8",consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||
public AjaxResult editBooking(HttpServletRequest request, @RequestBody OtherPropertyCreateUpdateRequest booking) throws Exception {
|
||||
boolean isSuccess = false;
|
||||
String processMessage="";
|
||||
|
||||
@@ -18,6 +18,7 @@ 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.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
@@ -49,7 +50,7 @@ public class WaitlistController {
|
||||
|
||||
@CheckPermission(routerId="00401",permissionCode="MODIFY")
|
||||
@OperationLog(eventCode="booking_update",actionName="Update Waitlist Booking Reamrk")
|
||||
@RequestMapping(value = "/app/waitlist/update_waitlist_remark", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
|
||||
@RequestMapping(value = "/app/waitlist/update_waitlist_remark", method = RequestMethod.POST, produces = "application/json;charset=UTF-8",consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||
public ResponseEntity<WaitlistRemarkResponse> updateWaitlistRemark(HttpServletRequest request, @RequestBody BookingsDto booking) {
|
||||
boolean isSuccess = false;
|
||||
String processMessage="";
|
||||
@@ -86,7 +87,7 @@ public class WaitlistController {
|
||||
|
||||
@CheckPermission(routerId="00401",permissionCode="ADD")
|
||||
@OperationLog(actionName="Create Waitlist Booking", eventCode = "booking_waitlist_create")
|
||||
@RequestMapping(value = "/app/waitlist/create", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
|
||||
@RequestMapping(value = "/app/waitlist/create", method = RequestMethod.POST, produces = "application/json;charset=UTF-8",consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||
public ResponseEntity<BookingResponse> createBooking(HttpServletRequest request, @RequestBody Map<String,Object> booking) throws Exception {
|
||||
boolean isSuccess = false;
|
||||
String processMessage="";
|
||||
@@ -112,7 +113,7 @@ public class WaitlistController {
|
||||
|
||||
@CheckPermission(routerId="00401",permissionCode="MODIFY")
|
||||
@OperationLog(actionName="Update Waitlist Booking", eventCode = "booking_waitlist_update")
|
||||
@RequestMapping(value = "/app/waitlist/update", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
|
||||
@RequestMapping(value = "/app/waitlist/update", method = RequestMethod.POST, produces = "application/json;charset=UTF-8",consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||
public ResponseEntity<BookingResponse> editBooking(HttpServletRequest request, @RequestBody Map<String,Object> booking) throws Exception {
|
||||
boolean isSuccess = false;
|
||||
String processMessage="";
|
||||
|
||||
@@ -36,7 +36,7 @@ public class WebBookingController {
|
||||
@Resource
|
||||
private WebBookingService webBookingService;
|
||||
|
||||
@RequestMapping(value = "/web/bookings/search", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
|
||||
@RequestMapping(value = "/web/bookings/search", method = RequestMethod.POST, produces = "application/json;charset=UTF-8",consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||
public ResponseEntity<BookingResponse> webRecordSearch(HttpServletRequest request, HttpServletResponse response,
|
||||
@RequestBody JSONObject params) throws Exception {
|
||||
BookingResponse result = new BookingResponse();
|
||||
@@ -53,7 +53,7 @@ public class WebBookingController {
|
||||
return ResponseEntity.status(HttpStatus.OK).body(result);
|
||||
}
|
||||
|
||||
@RequestMapping(value = "/web/booking/get_gaming_data", produces = "application/json;charset=UTF-8", method = RequestMethod.POST)
|
||||
@RequestMapping(value = "/web/booking/get_gaming_data", produces = "application/json;charset=UTF-8", method = RequestMethod.POST,consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||
public ResponseEntity<BookingResponse> getGamingData(HttpServletRequest request, HttpServletResponse response,
|
||||
@RequestBody JSONObject params) throws Exception {
|
||||
BookingResponse result = new BookingResponse();
|
||||
@@ -70,7 +70,7 @@ public class WebBookingController {
|
||||
return ResponseEntity.status(HttpStatus.OK).body(result);
|
||||
}
|
||||
|
||||
@RequestMapping(value = "/web/waitlist/update_batch_waitlist_status", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
|
||||
@RequestMapping(value = "/web/waitlist/update_batch_waitlist_status", method = RequestMethod.POST, produces = "application/json;charset=UTF-8",consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||
public ResponseEntity<BookingResponse> updateBatchWaitlistStatus(HttpServletRequest request, HttpServletResponse response,
|
||||
@RequestBody JSONObject params) throws Exception {
|
||||
BookingResponse result = new BookingResponse();
|
||||
@@ -88,7 +88,7 @@ public class WebBookingController {
|
||||
return ResponseEntity.status(HttpStatus.OK).body(result);
|
||||
}
|
||||
|
||||
@RequestMapping(value = "/web/booking/get_page", produces = "application/json;charset=UTF-8")
|
||||
@RequestMapping(value = "/web/booking/get_page", produces = "application/json;charset=UTF-8",consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||
public ResponseEntity<BookingResponse> getBookingByPage(HttpServletRequest request, HttpServletResponse response,
|
||||
@RequestBody JSONObject params) throws Exception {
|
||||
ServiceResult serviceResult = webBookingService.getBookingByPage(request,params);
|
||||
@@ -105,7 +105,7 @@ public class WebBookingController {
|
||||
return ResponseEntity.status(HttpStatus.OK).body(result);
|
||||
}
|
||||
|
||||
@RequestMapping(value = "/web/other_booking/import_batch", method = RequestMethod.POST)
|
||||
@RequestMapping(value = "/web/other_booking/import_batch", method = RequestMethod.POST,consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||
public ResponseEntity<BookingResponse> batchImportRows(HttpServletRequest request, HttpServletResponse response,
|
||||
@RequestBody JSONArray params) throws Exception {
|
||||
BookingResponse result = new BookingResponse();
|
||||
|
||||
@@ -1015,7 +1015,7 @@ public class WaitlistService {
|
||||
Long roomTypeId = null;
|
||||
String roomTypeCode = "";
|
||||
List<CfgRoomsRoomTypes> roomTypes;
|
||||
List<CfgBedTypeMapping> bedTypes = new ArrayList<>();
|
||||
|
||||
roomTypes = roomRoomTypeDao.queryByRoomId(Integer.valueOf(String.valueOf(roomId)));
|
||||
if(roomTypes!=null && !roomTypes.isEmpty()) {
|
||||
ArrayList<Object> failedRoomType = new ArrayList<>();
|
||||
|
||||
@@ -158,18 +158,19 @@ public class WebBookingService {
|
||||
HttpResponseResult httpResult = HttpUtil.invokeWebAPI(requestObj, "POST", request,files);
|
||||
String content = httpResult.getResponseContent();
|
||||
JSONObject obj = JSONObject.parseObject(content);
|
||||
obj.put("success", true);
|
||||
if(obj.getBooleanValue("success")) {
|
||||
if (obj != null && obj.getBooleanValue("success") && obj.get("data") != null) {
|
||||
result.setSuccess(true);
|
||||
Object getData = obj.get("data");
|
||||
result.setReturnData(getData);
|
||||
}else {
|
||||
result.setReturnData(obj.get("data"));
|
||||
} else {
|
||||
result.setSuccess(false);
|
||||
if(obj.getString("message")!=null && "".equals(obj.getString("message"))) {
|
||||
result.setErrorMessage(obj.getString("message"));
|
||||
}else {
|
||||
result.setErrorMessage("System Error");
|
||||
String message = obj == null ? null : obj.getString("message");
|
||||
if (message == null || message.isEmpty()) {
|
||||
message = httpResult.getErrorMessage();
|
||||
}
|
||||
if (message == null || message.isEmpty()) {
|
||||
message = "System Error";
|
||||
}
|
||||
result.setErrorMessage(message);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -53,12 +53,29 @@ mcrm:
|
||||
secret-key: SecretKeyWhichShouldBeLongEnoughToBeSecure67848563
|
||||
api-token-expiration: 5
|
||||
cms-session-expiration: 30
|
||||
|
||||
api-gateway:
|
||||
url: http://localhost:9087
|
||||
#============== Daylight Service ===================
|
||||
daylight:
|
||||
url: http://localhost:9087/api/daylight/proxy
|
||||
admin:
|
||||
user-init-pwd: 8cffb494ef5ff3f74a571206e141d4fb84f833e431b98c8b3be43727c4cbddc1
|
||||
#============== Api gateway Setting ===================
|
||||
api-gateway:
|
||||
base-url: http://localhost:9087
|
||||
request-timeout-ms: 30000
|
||||
daylight:
|
||||
proxy-path: /api/daylight/proxy
|
||||
system-id: 3a151ad3-46be-4644-b656-71d3b037b309
|
||||
app-id: MCRM_CMS
|
||||
auth-code: seCuritykeyOfCrmCms8wetw432
|
||||
notification:
|
||||
proxy-path: /api/notification/proxy
|
||||
app-id: MCRM_CMS
|
||||
auth-code: seCuritykeyOfCrmCms8wetw432
|
||||
#============== Truststore Manager Setting ==============
|
||||
trust-store:
|
||||
http-support:
|
||||
skip-validation: true
|
||||
http-util:
|
||||
skip-validation: true
|
||||
soap-util:
|
||||
skip-validation: true
|
||||
|
||||
server:
|
||||
port: 9085
|
||||
@@ -67,7 +84,7 @@ server:
|
||||
uri-encoding: UTF-8
|
||||
|
||||
logging:
|
||||
config: classpath:logback.xml
|
||||
config: classpath:log4j2-spring.xml
|
||||
|
||||
check_token_match: true
|
||||
app_ctrl_topic: cms_app_control
|
||||
|
||||
@@ -0,0 +1,41 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Configuration>
|
||||
<Properties>
|
||||
<Property name="logPath">crm_runtime/logs</Property>
|
||||
<Property name="logPattern">%d{yyyy-MM-dd HH:mm:ss.SSS} [%t] %-5level %logger{36} - %msg%n</Property>
|
||||
</Properties>
|
||||
<appenders>
|
||||
<Console name="Console" target="SYSTEM_OUT">
|
||||
<PatternLayout pattern="${logPattern}"/>
|
||||
</Console>
|
||||
<RollingFile name="FILE-APPENDER"
|
||||
fileName="${logPath}/cms-api-active.log"
|
||||
filePattern="${logPath}/cms-api-%d{yyyy-MM-dd}-%i.log">
|
||||
<PatternLayout pattern="${logPattern}" />
|
||||
<Policies>
|
||||
<SizeBasedTriggeringPolicy size="200 MB"/>
|
||||
<TimeBasedTriggeringPolicy interval="1" modulate="true"/>
|
||||
</Policies>
|
||||
<DefaultRolloverStrategy max="30"/>
|
||||
</RollingFile>
|
||||
</appenders>
|
||||
|
||||
<loggers>
|
||||
<root level="info">
|
||||
<AppenderRef ref="Console"/>
|
||||
<appender-ref ref="FILE-APPENDER"/>
|
||||
</root>
|
||||
<Logger name="org.springframework" level="WARN" additivity="false">
|
||||
<AppenderRef ref="Console"/>
|
||||
<AppenderRef ref="FILE-APPENDER"/>
|
||||
</Logger>
|
||||
<Logger name="org.apache.shiro" level="WARN" additivity="false">
|
||||
<AppenderRef ref="Console"/>
|
||||
<AppenderRef ref="FILE-APPENDER"/>
|
||||
</Logger>
|
||||
<Logger name="org.hibernate" level="WARN" additivity="false">
|
||||
<AppenderRef ref="Console"/>
|
||||
<AppenderRef ref="FILE-APPENDER"/>
|
||||
</Logger>
|
||||
</loggers>
|
||||
</Configuration>
|
||||
@@ -1,61 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<configuration>
|
||||
<!--======================================= 本地变量 ======================================== -->
|
||||
<!--在没有定义${LOG_HOME}系统变量的时候,可以设置此本地变量。提交测试、上线时,要将其注释掉,使用系统变量。 -->
|
||||
<!-- <property name="LOG_HOME" value="D:/data/logs" /> -->
|
||||
|
||||
<!-- 应用名称:和统一配置中的项目代码保持一致(小写) -->
|
||||
<property name="APP_NAME" value="crm_runtime" />
|
||||
<!--日志文件保留天数 -->
|
||||
<property name="LOG_MAX_HISTORY" value="180" />
|
||||
<!--定义日志文件的存储地址 勿在 LogBack 的配置中使用相对路径 -->
|
||||
<!--应用日志文件保存路径 -->
|
||||
<property name="LOG_APP_HOME" value="${APP_NAME}/logs" />
|
||||
|
||||
<!--=========================== 按照每天生成日志文件:默认配置=================================== -->
|
||||
<!-- 控制台输出 -->
|
||||
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
|
||||
<encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder">
|
||||
<pattern>
|
||||
%d{yyyy-MM-dd HH:mm:ss.SSS} [%-5level] [%thread] %logger{50} - %msg%n
|
||||
</pattern>
|
||||
</encoder>
|
||||
</appender>
|
||||
<!-- 按照每天生成日志文件:主项目日志 -->
|
||||
<appender name="APP"
|
||||
class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
|
||||
<!--日志文件输出的文件名 -->
|
||||
<FileNamePattern>${LOG_APP_HOME}/base.%d{yyyy-MM-dd}.log
|
||||
</FileNamePattern>
|
||||
<!--日志文件保留天数 -->
|
||||
<MaxHistory>${LOG_MAX_HISTORY}</MaxHistory>
|
||||
</rollingPolicy>
|
||||
<encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder">
|
||||
<!--格式化输出:%d表示日期,%thread表示线程名,%-5level:级别从左显示5个字符宽度%msg:日志消息,%n是换行符 -->
|
||||
<pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{500} - %msg%n</pattern>
|
||||
</encoder>
|
||||
</appender>
|
||||
<!--=============================== 日志输出: 默认主业务日志 ====================================== -->
|
||||
<logger name="org.springframework" level="WARN">
|
||||
|
||||
</logger>
|
||||
<logger name="org.apache.shiro" level="WARN">
|
||||
|
||||
</logger>
|
||||
<logger name="freemarker" level="WARN">
|
||||
|
||||
</logger>
|
||||
<logger name="org.hibernate" level="WARN">
|
||||
|
||||
</logger>
|
||||
<!--
|
||||
<logger name="org.hibernate.SQL">
|
||||
<level value="DEBUG" />
|
||||
</logger>
|
||||
-->
|
||||
<root level="INFO">
|
||||
<appender-ref ref="APP" />
|
||||
<appender-ref ref="STDOUT" />
|
||||
</root>
|
||||
</configuration>
|
||||
@@ -1,3 +0,0 @@
|
||||
#web Setting
|
||||
web_server=https://localhost:9086
|
||||
web_request_timeout=30000
|
||||
@@ -1,182 +0,0 @@
|
||||
{
|
||||
"exportName": "EXPORT_APPROVAL_ROUTING",
|
||||
"exportPages": [{
|
||||
"sheetIndx": 0,
|
||||
"sheetName": "Approval Routing",
|
||||
"dataElements": [{
|
||||
"blockName": "masterData",
|
||||
"offsetRow": 0,
|
||||
"offsetCol": 0,
|
||||
"elementType": 2,
|
||||
"isShowHeader": true,
|
||||
"headerAlign": "center",
|
||||
"headerColor": "#f5ebd9",
|
||||
"headerTextColor": "#000000",
|
||||
"textAlign": "left",
|
||||
"textColor": "#000000",
|
||||
"objClassName": "com.mgm.mcrm.reservation.dtos.BookingsViewDto",
|
||||
"columnDefs": [
|
||||
{
|
||||
"columnHeader": "Id",
|
||||
"attrName": "id",
|
||||
"dataType": "String",
|
||||
"columnWidth": 20
|
||||
},
|
||||
{
|
||||
"columnHeader": "Status",
|
||||
"attrName": "approveStatus",
|
||||
"dataType": "String",
|
||||
"columnWidth": 20
|
||||
},
|
||||
{
|
||||
"columnHeader": "Create Time",
|
||||
"attrName": "createdAt",
|
||||
"dataType": "Date",
|
||||
"formatVal": "yyyy-MM-dd HH:mm:ss",
|
||||
"columnWidth": 30
|
||||
},
|
||||
{
|
||||
"columnHeader": "Conf#",
|
||||
"attrName": "confirmationNo",
|
||||
"dataType": "String",
|
||||
"columnWidth": 20
|
||||
},
|
||||
{
|
||||
"columnHeader": "Patron ID",
|
||||
"attrName": "playerId",
|
||||
"dataType": "String",
|
||||
"columnWidth": 20
|
||||
},
|
||||
{
|
||||
"columnHeader": "Player Name",
|
||||
"attrName": "memberLastName",
|
||||
"dataType": "String",
|
||||
"columnWidth": 20
|
||||
},
|
||||
{
|
||||
"columnHeader": "Tier",
|
||||
"attrName": "tier",
|
||||
"dataType": "String",
|
||||
"columnWidth": 20
|
||||
},
|
||||
{
|
||||
"columnHeader": "Property",
|
||||
"attrName": "propertyName",
|
||||
"dataType": "String",
|
||||
"columnWidth": 20
|
||||
},
|
||||
{
|
||||
"columnHeader": "Room Catagory",
|
||||
"attrName": "room",
|
||||
"dataType": "String",
|
||||
"columnWidth": 20
|
||||
},
|
||||
{
|
||||
"columnHeader": "Room Type",
|
||||
"attrName": "roomTypeCode",
|
||||
"dataType": "String",
|
||||
"columnWidth": 20
|
||||
},
|
||||
{
|
||||
"columnHeader": "Type",
|
||||
"attrName": "bookType",
|
||||
"dataType": "String",
|
||||
"columnWidth": 20
|
||||
},
|
||||
{
|
||||
"columnHeader": "Check in Date",
|
||||
"attrName": "checkinDate",
|
||||
"dataType": "Date",
|
||||
"formatVal": "yyyy-MM-dd",
|
||||
"columnWidth": 30
|
||||
},
|
||||
{
|
||||
"columnHeader": "Check Out Date",
|
||||
"attrName": "checkoutDate",
|
||||
"dataType": "Date",
|
||||
"formatVal": "yyyy-MM-dd",
|
||||
"columnWidth": 30
|
||||
},
|
||||
{
|
||||
"columnHeader": "Continuous / Overlap Booking(C/I to C/O)",
|
||||
"attrName": "overlapBooking",
|
||||
"dataType": "String",
|
||||
"columnWidth": 40
|
||||
},
|
||||
{
|
||||
"columnHeader": "Booker Team",
|
||||
"attrName": "sectionName",
|
||||
"dataType": "String",
|
||||
"columnWidth": 20
|
||||
},
|
||||
{
|
||||
"columnHeader": "Booker ID",
|
||||
"attrName": "createdBy",
|
||||
"dataType": "String",
|
||||
"columnWidth": 20
|
||||
},
|
||||
{
|
||||
"columnHeader": "Booker Name",
|
||||
"attrName": "booker",
|
||||
"dataType": "String",
|
||||
"columnWidth": 20
|
||||
},
|
||||
{
|
||||
"columnHeader": "Sharer",
|
||||
"attrName": "sharer",
|
||||
"dataType": "String",
|
||||
"columnWidth": 20
|
||||
},
|
||||
{
|
||||
"columnHeader": "Remarks",
|
||||
"attrName": "remark",
|
||||
"dataType": "String",
|
||||
"columnWidth": 30
|
||||
},
|
||||
{
|
||||
"columnHeader": "Ranking By Player Evaluation",
|
||||
"attrName": "dailyTheoProfit",
|
||||
"dataType": "String",
|
||||
"columnWidth": 30
|
||||
},
|
||||
{
|
||||
"columnHeader": "Approval Remark",
|
||||
"attrName": "mscRemark",
|
||||
"dataType": "String",
|
||||
"columnWidth": 30
|
||||
},
|
||||
{
|
||||
"columnHeader": "Received Approver ID",
|
||||
"attrName": "approverId",
|
||||
"dataType": "String",
|
||||
"columnWidth": 25
|
||||
},
|
||||
{
|
||||
"columnHeader": "Received Approver",
|
||||
"attrName": "approverName",
|
||||
"dataType": "String",
|
||||
"columnWidth": 25
|
||||
},
|
||||
{
|
||||
"columnHeader": "Approval Reason",
|
||||
"attrName": "approvalReason",
|
||||
"dataType": "String",
|
||||
"columnWidth": 30
|
||||
},
|
||||
{
|
||||
"columnHeader": "Approver",
|
||||
"attrName": "approvedId",
|
||||
"dataType": "String",
|
||||
"columnWidth": 20
|
||||
},
|
||||
{
|
||||
"columnHeader": "Approved Date",
|
||||
"attrName": "approvedAt",
|
||||
"dataType": "Date",
|
||||
"formatVal": "yyyy-MM-dd HH:mm:ss",
|
||||
"columnWidth": 30
|
||||
}
|
||||
]
|
||||
}]
|
||||
}]
|
||||
}
|
||||
@@ -1,63 +0,0 @@
|
||||
{
|
||||
"exportName":"EXPORT_BED_TYPE_MAPPING",
|
||||
"exportPages":[{
|
||||
"sheetIndx": 0,
|
||||
"sheetName":"Bed Type Mapping",
|
||||
"dataElements": [{
|
||||
"blockName":"masterData",
|
||||
"offsetRow": 0,
|
||||
"offsetCol": 0,
|
||||
"elementType":2,
|
||||
"isShowHeader":true,
|
||||
"headerAlign":"center",
|
||||
"headerColor":"#f5ebd9",
|
||||
"headerTextColor":"#000000",
|
||||
"textAlign":"left",
|
||||
"textColor":"#000000",
|
||||
"objClassName": "com.mgm.mcrm.basesetting.room.dtos.response.CfgBedTypeMappingViewResponse",
|
||||
"columnDefs": [{
|
||||
"columnHeader":"Property",
|
||||
"attrName": "propertyName",
|
||||
"dataType": "String",
|
||||
"columnWidth":30
|
||||
},
|
||||
{
|
||||
"columnHeader":"Room",
|
||||
"attrName": "roomName",
|
||||
"dataType": "String",
|
||||
"columnWidth":30
|
||||
},
|
||||
{
|
||||
"columnHeader":"Room Type",
|
||||
"attrName": "roomTypeNames",
|
||||
"dataType": "String",
|
||||
"columnWidth":60
|
||||
},
|
||||
{
|
||||
"columnHeader":"Bed Type",
|
||||
"attrName": "bedTypeName",
|
||||
"dataType": "String",
|
||||
"columnWidth":30
|
||||
},
|
||||
{
|
||||
"columnHeader":"Category",
|
||||
"attrName": "category",
|
||||
"dataType": "String",
|
||||
"columnWidth":30
|
||||
},
|
||||
{
|
||||
"columnHeader":"Created Time",
|
||||
"attrName": "createdAt",
|
||||
"dataType": "String",
|
||||
"columnWidth":30
|
||||
},
|
||||
{
|
||||
"columnHeader":"Updated Time",
|
||||
"attrName": "updatedAt",
|
||||
"dataType": "String",
|
||||
"columnWidth":30
|
||||
}
|
||||
]
|
||||
}]
|
||||
}]
|
||||
}
|
||||
@@ -1,118 +0,0 @@
|
||||
{
|
||||
"exportName":"EXPORT_DAYLIGHT_MAPPING",
|
||||
"exportPages":[{
|
||||
"sheetIndx": 0,
|
||||
"sheetName":"User-Room Mapping",
|
||||
"dataElements": [{
|
||||
"blockName":"masterData",
|
||||
"offsetRow": 0,
|
||||
"offsetCol": 0,
|
||||
"elementType":2,
|
||||
"isShowHeader":true,
|
||||
"headerAlign":"center",
|
||||
"headerColor":"#f5ebd9",
|
||||
"headerTextColor":"#000000",
|
||||
"textAlign":"left",
|
||||
"textColor":"#000000",
|
||||
"objClassName": "com.mgm.mcrm.basesetting.daylight.models.CfgDaylightView",
|
||||
"columnDefs": [
|
||||
{
|
||||
"columnHeader":"Booking Type",
|
||||
"attrName": "bookingTypeName",
|
||||
"dataType": "String",
|
||||
"columnWidth":20
|
||||
},
|
||||
{
|
||||
"columnHeader":"Section",
|
||||
"attrName": "sectionName",
|
||||
"dataType": "String",
|
||||
"columnWidth":20
|
||||
},
|
||||
{
|
||||
"columnHeader":"Hotel Property",
|
||||
"attrName": "propertyName",
|
||||
"dataType": "String",
|
||||
"columnWidth":20
|
||||
},
|
||||
{
|
||||
"columnHeader":"Block Code",
|
||||
"attrName": "blockCodeName",
|
||||
"dataType": "String",
|
||||
"columnWidth":20
|
||||
},
|
||||
{
|
||||
"columnHeader":"Rate Code",
|
||||
"attrName": "rateCodeName",
|
||||
"dataType": "String",
|
||||
"columnWidth":20
|
||||
},
|
||||
{
|
||||
"columnHeader":"Room Type",
|
||||
"attrName": "roomTypeNames",
|
||||
"dataType": "String",
|
||||
"columnWidth":40
|
||||
},
|
||||
{
|
||||
"columnHeader":"Source Code",
|
||||
"attrName": "sourceCodeName",
|
||||
"dataType": "String",
|
||||
"columnWidth":20
|
||||
},
|
||||
{
|
||||
"columnHeader":"Market Code",
|
||||
"attrName": "marketCodeName",
|
||||
"dataType": "String",
|
||||
"columnWidth":20
|
||||
},
|
||||
{
|
||||
"columnHeader":"Approver",
|
||||
"attrName": "approver",
|
||||
"dataType": "String",
|
||||
"columnWidth":30
|
||||
},
|
||||
{
|
||||
"columnHeader":"Room Category",
|
||||
"attrName": "compRuleCategory",
|
||||
"dataType": "String",
|
||||
"columnWidth":30
|
||||
},
|
||||
{
|
||||
"columnHeader":"Complimentary Type",
|
||||
"attrName": "compTypeContent",
|
||||
"dataType": "String",
|
||||
"columnWidth":30
|
||||
},
|
||||
{
|
||||
"columnHeader":"Complimentary Type Id",
|
||||
"attrName": "dlCompTypeId",
|
||||
"dataType": "String",
|
||||
"columnWidth":30
|
||||
},
|
||||
{
|
||||
"columnHeader":"Payment Method Code",
|
||||
"attrName": "paymentMethodCodeContent",
|
||||
"dataType": "String",
|
||||
"columnWidth":30
|
||||
},
|
||||
{
|
||||
"columnHeader":"Payment Method Code Id",
|
||||
"attrName": "dlPaymentMethodCodeId",
|
||||
"dataType": "String",
|
||||
"columnWidth":30
|
||||
},
|
||||
{
|
||||
"columnHeader":"Complimentary Preset",
|
||||
"attrName": "compPresetContent",
|
||||
"dataType": "String",
|
||||
"columnWidth":30
|
||||
},
|
||||
{
|
||||
"columnHeader":"Complimentary Preset Id",
|
||||
"attrName": "compPresetId",
|
||||
"dataType": "String",
|
||||
"columnWidth":30
|
||||
}
|
||||
]
|
||||
}]
|
||||
}]
|
||||
}
|
||||
@@ -1,39 +0,0 @@
|
||||
{
|
||||
"exportName":"EXPORT_DEPARTMENT",
|
||||
"exportPages":[{
|
||||
"sheetIndx": 0,
|
||||
"sheetName":"Department",
|
||||
"dataElements": [{
|
||||
"blockName":"masterData",
|
||||
"offsetRow": 0,
|
||||
"offsetCol": 0,
|
||||
"elementType":2,
|
||||
"isShowHeader":true,
|
||||
"headerAlign":"center",
|
||||
"headerColor":"#f5ebd9",
|
||||
"headerTextColor":"#000000",
|
||||
"textAlign":"left",
|
||||
"textColor":"#000000",
|
||||
"objClassName": "com.mgm.mcrm.basesetting.team.dtos.CfgDepartmentsDto",
|
||||
"columnDefs": [{
|
||||
"columnHeader":"Department Name",
|
||||
"attrName": "name",
|
||||
"dataType": "String",
|
||||
"columnWidth":30
|
||||
},
|
||||
{
|
||||
"columnHeader":"Created Time",
|
||||
"attrName": "createdAt",
|
||||
"dataType": "String",
|
||||
"columnWidth":30
|
||||
},
|
||||
{
|
||||
"columnHeader":"Updated Time",
|
||||
"attrName": "updatedAt",
|
||||
"dataType": "String",
|
||||
"columnWidth":30
|
||||
}
|
||||
]
|
||||
}]
|
||||
}]
|
||||
}
|
||||
@@ -1,39 +0,0 @@
|
||||
{
|
||||
"exportName":"EXPORT_DIVISION",
|
||||
"exportPages":[{
|
||||
"sheetIndx": 0,
|
||||
"sheetName":"Division",
|
||||
"dataElements": [{
|
||||
"blockName":"masterData",
|
||||
"offsetRow": 0,
|
||||
"offsetCol": 0,
|
||||
"elementType":2,
|
||||
"isShowHeader":true,
|
||||
"headerAlign":"center",
|
||||
"headerColor":"#f5ebd9",
|
||||
"headerTextColor":"#000000",
|
||||
"textAlign":"left",
|
||||
"textColor":"#000000",
|
||||
"objClassName": "com.mgm.mcrm.basesetting.team.dtos.CfgDivisionsDto",
|
||||
"columnDefs": [{
|
||||
"columnHeader":"Division Name",
|
||||
"attrName": "name",
|
||||
"dataType": "String",
|
||||
"columnWidth":30
|
||||
},
|
||||
{
|
||||
"columnHeader":"Created Time",
|
||||
"attrName": "createdAt",
|
||||
"dataType": "String",
|
||||
"columnWidth":30
|
||||
},
|
||||
{
|
||||
"columnHeader":"Updated Time",
|
||||
"attrName": "updatedAt",
|
||||
"dataType": "String",
|
||||
"columnWidth":30
|
||||
}
|
||||
]
|
||||
}]
|
||||
}]
|
||||
}
|
||||
@@ -1,70 +0,0 @@
|
||||
{
|
||||
"exportName":"EXPORT_EXCEPTION_DAYLIGHT",
|
||||
"exportPages":[{
|
||||
"sheetIndx": 0,
|
||||
"sheetName":"Exception Daylight Mapping",
|
||||
"dataElements": [{
|
||||
"blockName":"masterData",
|
||||
"offsetRow": 0,
|
||||
"offsetCol": 0,
|
||||
"elementType":2,
|
||||
"isShowHeader":true,
|
||||
"headerAlign":"center",
|
||||
"headerColor":"#f5ebd9",
|
||||
"headerTextColor":"#000000",
|
||||
"textAlign":"left",
|
||||
"textColor":"#000000",
|
||||
"objClassName": "com.mgm.mcrm.basesetting.daylight.dtos.response.CfgExceptionDaylightResponse",
|
||||
"columnDefs": [
|
||||
{
|
||||
"columnHeader":"User ID",
|
||||
"attrName": "userId",
|
||||
"dataType": "String",
|
||||
"columnWidth":20
|
||||
},
|
||||
{
|
||||
"columnHeader":"Booking Type",
|
||||
"attrName": "bookingTypeName",
|
||||
"dataType": "String",
|
||||
"columnWidth":20
|
||||
},
|
||||
{
|
||||
"columnHeader":"Hotel Property",
|
||||
"attrName": "propertyName",
|
||||
"dataType": "String",
|
||||
"columnWidth":20
|
||||
},
|
||||
{
|
||||
"columnHeader":"Block Code",
|
||||
"attrName": "blockCodeName",
|
||||
"dataType": "String",
|
||||
"columnWidth":20
|
||||
},
|
||||
{
|
||||
"columnHeader":"Rate Code",
|
||||
"attrName": "rateCodeName",
|
||||
"dataType": "String",
|
||||
"columnWidth":20
|
||||
},
|
||||
{
|
||||
"columnHeader":"Room Type",
|
||||
"attrName": "roomTypeNames",
|
||||
"dataType": "String",
|
||||
"columnWidth":40
|
||||
},
|
||||
{
|
||||
"columnHeader":"Source Code",
|
||||
"attrName": "sourceCodeName",
|
||||
"dataType": "String",
|
||||
"columnWidth":20
|
||||
},
|
||||
{
|
||||
"columnHeader":"Market Code",
|
||||
"attrName": "marketCodeName",
|
||||
"dataType": "String",
|
||||
"columnWidth":20
|
||||
}
|
||||
]
|
||||
}]
|
||||
}]
|
||||
}
|
||||
@@ -1,70 +0,0 @@
|
||||
{
|
||||
"exportName":"EXPORT_EXCEPTION_OPERA",
|
||||
"exportPages":[{
|
||||
"sheetIndx": 0,
|
||||
"sheetName":"Exception Opera Mapping",
|
||||
"dataElements": [{
|
||||
"blockName":"masterData",
|
||||
"offsetRow": 0,
|
||||
"offsetCol": 0,
|
||||
"elementType":2,
|
||||
"isShowHeader":true,
|
||||
"headerAlign":"center",
|
||||
"headerColor":"#f5ebd9",
|
||||
"headerTextColor":"#000000",
|
||||
"textAlign":"left",
|
||||
"textColor":"#000000",
|
||||
"objClassName": "com.mgm.mcrm.basesetting.opera.models.CfgExceptionOperaView",
|
||||
"columnDefs": [
|
||||
{
|
||||
"columnHeader":"User ID",
|
||||
"attrName": "userId",
|
||||
"dataType": "String",
|
||||
"columnWidth":20
|
||||
},
|
||||
{
|
||||
"columnHeader":"Booking Type",
|
||||
"attrName": "bookingTypeName",
|
||||
"dataType": "String",
|
||||
"columnWidth":20
|
||||
},
|
||||
{
|
||||
"columnHeader":"Hotel Property",
|
||||
"attrName": "propertyName",
|
||||
"dataType": "String",
|
||||
"columnWidth":20
|
||||
},
|
||||
{
|
||||
"columnHeader":"Block Code",
|
||||
"attrName": "blockCodeName",
|
||||
"dataType": "String",
|
||||
"columnWidth":20
|
||||
},
|
||||
{
|
||||
"columnHeader":"Rate Code",
|
||||
"attrName": "rateCodeName",
|
||||
"dataType": "String",
|
||||
"columnWidth":20
|
||||
},
|
||||
{
|
||||
"columnHeader":"Room Type",
|
||||
"attrName": "roomTypeNames",
|
||||
"dataType": "String",
|
||||
"columnWidth":40
|
||||
},
|
||||
{
|
||||
"columnHeader":"Source Code",
|
||||
"attrName": "sourceCodeName",
|
||||
"dataType": "String",
|
||||
"columnWidth":20
|
||||
},
|
||||
{
|
||||
"columnHeader":"Market Code",
|
||||
"attrName": "marketCodeName",
|
||||
"dataType": "String",
|
||||
"columnWidth":20
|
||||
}
|
||||
]
|
||||
}]
|
||||
}]
|
||||
}
|
||||
@@ -1,119 +0,0 @@
|
||||
{
|
||||
"exportName":"EXPORT_FAILED_LIST",
|
||||
"exportPages":[{
|
||||
"sheetIndx": 0,
|
||||
"sheetName":"Failed Booking",
|
||||
"dataElements": [{
|
||||
"blockName":"masterData",
|
||||
"offsetRow": 0,
|
||||
"offsetCol": 0,
|
||||
"elementType":2,
|
||||
"isShowHeader":true,
|
||||
"headerAlign":"center",
|
||||
"headerColor":"#f5ebd9",
|
||||
"headerTextColor":"#000000",
|
||||
"textAlign":"left",
|
||||
"textColor":"#000000",
|
||||
"objClassName": "com.mgm.mcrm.reservation.dtos.BookingsViewDto",
|
||||
"columnDefs": [{
|
||||
"columnHeader":"Failure ID",
|
||||
"attrName": "id",
|
||||
"dataType": "String",
|
||||
"columnWidth":20
|
||||
},
|
||||
{
|
||||
"columnHeader":"Complation Status",
|
||||
"attrName": "approveStatusName",
|
||||
"dataType": "String",
|
||||
"columnWidth":20
|
||||
},
|
||||
{
|
||||
"columnHeader":"Reason",
|
||||
"attrName": "errorMessage",
|
||||
"dataType": "String",
|
||||
"columnWidth":20
|
||||
},
|
||||
{
|
||||
"columnHeader":"Input Date/Time",
|
||||
"attrName": "createdAt",
|
||||
"dataType": "String",
|
||||
"columnWidth":30
|
||||
},
|
||||
{
|
||||
"columnHeader":"Player ID",
|
||||
"attrName": "playerId",
|
||||
"dataType": "String",
|
||||
"columnWidth":20
|
||||
},
|
||||
{
|
||||
"columnHeader":"Properties",
|
||||
"attrName": "propertyName",
|
||||
"dataType": "String",
|
||||
"columnWidth":20
|
||||
},
|
||||
{
|
||||
"columnHeader":"No. of Rooms",
|
||||
"attrName": "numOfRooms",
|
||||
"dataType": "String",
|
||||
"columnWidth":20
|
||||
},
|
||||
{
|
||||
"columnHeader":"Room Type",
|
||||
"attrName": "roomTypeCode",
|
||||
"dataType": "String",
|
||||
"columnWidth":20
|
||||
},
|
||||
{
|
||||
"columnHeader":"Check in Date/Extension Date",
|
||||
"attrName": "checkinDate",
|
||||
"dataType": "Date",
|
||||
"formatVal":"yyyy-MM-dd",
|
||||
"columnWidth":40
|
||||
},
|
||||
{
|
||||
"columnHeader":"Check Out Date",
|
||||
"attrName": "checkoutDate",
|
||||
"dataType": "Date",
|
||||
"formatVal":"yyyy-MM-dd",
|
||||
"columnWidth":40
|
||||
},
|
||||
{
|
||||
"columnHeader":"Night Of Stay",
|
||||
"attrName": "numOfNight",
|
||||
"dataType": "String",
|
||||
"columnWidth":20
|
||||
},
|
||||
{
|
||||
"columnHeader":"Booker",
|
||||
"attrName": "booker",
|
||||
"dataType": "String",
|
||||
"columnWidth":20
|
||||
},
|
||||
{
|
||||
"columnHeader":"Section",
|
||||
"attrName": "sectionName",
|
||||
"dataType": "String",
|
||||
"columnWidth":20
|
||||
},
|
||||
{
|
||||
"columnHeader":"Remarks By MSC",
|
||||
"attrName": "mscRemark",
|
||||
"dataType": "String",
|
||||
"columnWidth":20
|
||||
},
|
||||
{
|
||||
"columnHeader":"Updated By",
|
||||
"attrName": "updatedBy",
|
||||
"dataType": "String",
|
||||
"columnWidth":20
|
||||
},
|
||||
{
|
||||
"columnHeader":"Updated Time",
|
||||
"attrName": "updatedAt",
|
||||
"dataType": "String",
|
||||
"columnWidth":30
|
||||
}
|
||||
]
|
||||
}]
|
||||
}]
|
||||
}
|
||||
@@ -1,76 +0,0 @@
|
||||
{
|
||||
"exportName":"EXPORT_ITEM_INVENTORY",
|
||||
"exportPages":[{
|
||||
"sheetIndx": 0,
|
||||
"sheetName":"Item Inventory",
|
||||
"dataElements": [{
|
||||
"blockName":"masterData",
|
||||
"offsetRow": 0,
|
||||
"offsetCol": 0,
|
||||
"elementType":2,
|
||||
"isShowHeader":true,
|
||||
"headerAlign":"center",
|
||||
"headerColor":"#f5ebd9",
|
||||
"headerTextColor":"#000000",
|
||||
"textAlign":"left",
|
||||
"textColor":"#000000",
|
||||
"objClassName": "com.mgm.mcrm.basesetting.daylight.dtos.CfgItemInventoryViewDto",
|
||||
"columnDefs": [
|
||||
{
|
||||
"columnHeader":"Opera Tier",
|
||||
"attrName": "operaTierId",
|
||||
"dataType": "String",
|
||||
"columnWidth":30
|
||||
},
|
||||
{
|
||||
"columnHeader":"IGT Tier ID",
|
||||
"attrName": "igtTierId",
|
||||
"dataType": "String",
|
||||
"columnWidth":30
|
||||
},
|
||||
{
|
||||
"columnHeader":"IGT Tier Name",
|
||||
"attrName": "igtTierName",
|
||||
"dataType": "String",
|
||||
"columnWidth":30
|
||||
},
|
||||
{
|
||||
"columnHeader":"Property",
|
||||
"attrName": "propertyName",
|
||||
"dataType": "String",
|
||||
"columnWidth":30
|
||||
},
|
||||
{
|
||||
"columnHeader":"Room",
|
||||
"attrName": "roomName",
|
||||
"dataType": "String",
|
||||
"columnWidth":30
|
||||
},
|
||||
{
|
||||
"columnHeader":"Amenity Package Code",
|
||||
"attrName": "amenityPackageCode",
|
||||
"dataType": "String",
|
||||
"columnWidth":50
|
||||
},
|
||||
{
|
||||
"columnHeader":"Category",
|
||||
"attrName": "category",
|
||||
"dataType": "String",
|
||||
"columnWidth":50
|
||||
},
|
||||
{
|
||||
"columnHeader":"Created Time",
|
||||
"attrName": "createdAt",
|
||||
"dataType": "String",
|
||||
"columnWidth":30
|
||||
},
|
||||
{
|
||||
"columnHeader":"Updated Time",
|
||||
"attrName": "updatedAt",
|
||||
"dataType": "String",
|
||||
"columnWidth":30
|
||||
}
|
||||
]
|
||||
}]
|
||||
}]
|
||||
}
|
||||
@@ -1,81 +0,0 @@
|
||||
{
|
||||
"exportName":"EXPORT_ITEM_INVENTORY_DAYLIGHT",
|
||||
"exportPages":[{
|
||||
"sheetIndx": 0,
|
||||
"sheetName":"Item Inventory",
|
||||
"dataElements": [{
|
||||
"blockName":"masterData",
|
||||
"offsetRow": 0,
|
||||
"offsetCol": 0,
|
||||
"elementType":2,
|
||||
"isShowHeader":true,
|
||||
"headerAlign":"center",
|
||||
"headerColor":"#f5ebd9",
|
||||
"headerTextColor":"#000000",
|
||||
"textAlign":"left",
|
||||
"textColor":"#000000",
|
||||
"objClassName": "com.mgm.mcrm.basesetting.daylight.dtos.CfgItemInventoryViewDto",
|
||||
"columnDefs": [{
|
||||
"columnHeader":"Tier Code",
|
||||
"attrName": "daylightTier",
|
||||
"dataType": "String",
|
||||
"columnWidth":30
|
||||
},
|
||||
{
|
||||
"columnHeader":"IGT Tier ID",
|
||||
"attrName": "igtTierId",
|
||||
"dataType": "String",
|
||||
"columnWidth":30
|
||||
},
|
||||
{
|
||||
"columnHeader":"IGT Tier Name",
|
||||
"attrName": "igtTierName",
|
||||
"dataType": "String",
|
||||
"columnWidth":30
|
||||
},
|
||||
{
|
||||
"columnHeader":"Property",
|
||||
"attrName": "propertyName",
|
||||
"dataType": "String",
|
||||
"columnWidth":30
|
||||
},
|
||||
{
|
||||
"columnHeader":"Room",
|
||||
"attrName": "roomName",
|
||||
"dataType": "String",
|
||||
"columnWidth":30
|
||||
},
|
||||
{
|
||||
"columnHeader":"Purchase Element",
|
||||
"attrName": "dlCode",
|
||||
"dataType": "String",
|
||||
"columnWidth":50
|
||||
},
|
||||
{
|
||||
"columnHeader":"Category",
|
||||
"attrName": "category",
|
||||
"dataType": "String",
|
||||
"columnWidth":50
|
||||
},
|
||||
{
|
||||
"columnHeader":"Daylight Purchase Element Id",
|
||||
"attrName": "dlPurchaseElementId",
|
||||
"dataType": "String",
|
||||
"columnWidth":50
|
||||
},
|
||||
{
|
||||
"columnHeader":"Created Time",
|
||||
"attrName": "createdAt",
|
||||
"dataType": "String",
|
||||
"columnWidth":30
|
||||
},
|
||||
{
|
||||
"columnHeader":"Updated Time",
|
||||
"attrName": "updatedAt",
|
||||
"dataType": "String",
|
||||
"columnWidth":30
|
||||
}
|
||||
]
|
||||
}]
|
||||
}]
|
||||
}
|
||||
@@ -1,57 +0,0 @@
|
||||
{
|
||||
"exportName":"EXPORT_LOGIN_LOG",
|
||||
"exportPages":[{
|
||||
"sheetIndx": 0,
|
||||
"sheetName":"Login_Logout Log",
|
||||
"dataElements": [{
|
||||
"blockName":"masterData",
|
||||
"offsetRow": 0,
|
||||
"offsetCol": 0,
|
||||
"elementType":2,
|
||||
"isShowHeader":true,
|
||||
"headerAlign":"center",
|
||||
"headerColor":"#f5ebd9",
|
||||
"headerTextColor":"#000000",
|
||||
"textAlign":"left",
|
||||
"textColor":"#000000",
|
||||
"objClassName": "com.mgm.mcrm.logging.dtos.SysLogLoginDto",
|
||||
"columnDefs": [{
|
||||
"columnHeader":"Event",
|
||||
"attrName": "eventCode",
|
||||
"dataType": "String",
|
||||
"columnWidth":30
|
||||
},
|
||||
{
|
||||
"columnHeader":"Description",
|
||||
"attrName": "logDesc",
|
||||
"dataType": "String",
|
||||
"columnWidth":50
|
||||
},
|
||||
{
|
||||
"columnHeader":"User Code",
|
||||
"attrName": "loginId",
|
||||
"dataType": "String",
|
||||
"columnWidth":20
|
||||
},
|
||||
{
|
||||
"columnHeader":"Operated Time",
|
||||
"attrName": "occurTime",
|
||||
"dataType": "Date",
|
||||
"columnWidth":30
|
||||
},
|
||||
{
|
||||
"columnHeader":"Access IP",
|
||||
"attrName": "ipAddress",
|
||||
"dataType": "String",
|
||||
"columnWidth":30
|
||||
},
|
||||
{
|
||||
"columnHeader":"Client Name",
|
||||
"attrName": "computerName",
|
||||
"dataType": "String",
|
||||
"columnWidth":30
|
||||
}
|
||||
]
|
||||
}]
|
||||
}]
|
||||
}
|
||||
@@ -1,94 +0,0 @@
|
||||
{
|
||||
"exportName":"EXPORT_OPERA_MAPPING",
|
||||
"exportPages":[{
|
||||
"sheetIndx": 0,
|
||||
"sheetName":"Opera Mapping",
|
||||
"dataElements": [{
|
||||
"blockName":"masterData",
|
||||
"offsetRow": 0,
|
||||
"offsetCol": 0,
|
||||
"elementType":2,
|
||||
"isShowHeader":true,
|
||||
"headerAlign":"center",
|
||||
"headerColor":"#f5ebd9",
|
||||
"headerTextColor":"#000000",
|
||||
"textAlign":"left",
|
||||
"textColor":"#000000",
|
||||
"objClassName": "com.mgm.mcrm.basesetting.opera.models.CfgOperaView",
|
||||
"columnDefs": [
|
||||
{
|
||||
"columnHeader":"Booking Type",
|
||||
"attrName": "bookingTypeName",
|
||||
"dataType": "String",
|
||||
"columnWidth":20
|
||||
},
|
||||
{
|
||||
"columnHeader":"User Division",
|
||||
"attrName": "divisionName",
|
||||
"dataType": "String",
|
||||
"columnWidth":20
|
||||
},
|
||||
{
|
||||
"columnHeader":"Department",
|
||||
"attrName": "departmentName",
|
||||
"dataType": "String",
|
||||
"columnWidth":20
|
||||
},
|
||||
{
|
||||
"columnHeader":"Section",
|
||||
"attrName": "sectionName",
|
||||
"dataType": "String",
|
||||
"columnWidth":20
|
||||
},
|
||||
{
|
||||
"columnHeader":"Hotel Property",
|
||||
"attrName": "propertyName",
|
||||
"dataType": "String",
|
||||
"columnWidth":20
|
||||
},
|
||||
{
|
||||
"columnHeader":"Block Code",
|
||||
"attrName": "blockCodeName",
|
||||
"dataType": "String",
|
||||
"columnWidth":20
|
||||
},
|
||||
{
|
||||
"columnHeader":"Rate Code",
|
||||
"attrName": "rateCodeName",
|
||||
"dataType": "String",
|
||||
"columnWidth":20
|
||||
},
|
||||
{
|
||||
"columnHeader":"Room Type",
|
||||
"attrName": "roomTypeNames",
|
||||
"dataType": "String",
|
||||
"columnWidth":40
|
||||
},
|
||||
{
|
||||
"columnHeader":"Source Code",
|
||||
"attrName": "sourceCodeName",
|
||||
"dataType": "String",
|
||||
"columnWidth":20
|
||||
},
|
||||
{
|
||||
"columnHeader":"Market Code",
|
||||
"attrName": "marketCodeName",
|
||||
"dataType": "String",
|
||||
"columnWidth":20
|
||||
},
|
||||
{
|
||||
"columnHeader":"Created Time",
|
||||
"attrName": "createdAt",
|
||||
"dataType": "String",
|
||||
"columnWidth":30
|
||||
},
|
||||
{
|
||||
"columnHeader":"Updated Time",
|
||||
"attrName": "updatedAt",
|
||||
"dataType": "String",
|
||||
"columnWidth":30
|
||||
}
|
||||
]
|
||||
}]
|
||||
}]
|
||||
}
|
||||
@@ -1,69 +0,0 @@
|
||||
{
|
||||
"exportName":"EXPORT_OPERATION_LOG",
|
||||
"exportPages":[{
|
||||
"sheetIndx": 0,
|
||||
"sheetName":"Operation Log",
|
||||
"dataElements": [{
|
||||
"blockName":"masterData",
|
||||
"offsetRow": 0,
|
||||
"offsetCol": 0,
|
||||
"elementType":2,
|
||||
"isShowHeader":true,
|
||||
"headerAlign":"center",
|
||||
"headerColor":"#f5ebd9",
|
||||
"headerTextColor":"#000000",
|
||||
"textAlign":"left",
|
||||
"textColor":"#000000",
|
||||
"objClassName": "com.mgm.mcrm.logging.dtos.SysLogOperationDto",
|
||||
"columnDefs": [{
|
||||
"columnHeader":"Event",
|
||||
"attrName": "eventCode",
|
||||
"dataType": "String",
|
||||
"columnWidth":30
|
||||
},
|
||||
{
|
||||
"columnHeader":"Description",
|
||||
"attrName": "logDesc",
|
||||
"dataType": "String",
|
||||
"columnWidth":50
|
||||
},
|
||||
{
|
||||
"columnHeader":"User Code",
|
||||
"attrName": "loginId",
|
||||
"dataType": "String",
|
||||
"columnWidth":20
|
||||
},
|
||||
{
|
||||
"columnHeader":"Operated Time",
|
||||
"attrName": "occurTime",
|
||||
"dataType": "String",
|
||||
"columnWidth":30
|
||||
},
|
||||
{
|
||||
"columnHeader":"Request Data",
|
||||
"attrName": "requestBody",
|
||||
"dataType": "String",
|
||||
"columnWidth":50
|
||||
},
|
||||
{
|
||||
"columnHeader":"Response Data",
|
||||
"attrName": "responseBody",
|
||||
"dataType": "String",
|
||||
"columnWidth":50
|
||||
},
|
||||
{
|
||||
"columnHeader":"Access IP",
|
||||
"attrName": "ipAddress",
|
||||
"dataType": "String",
|
||||
"columnWidth":30
|
||||
},
|
||||
{
|
||||
"columnHeader":"Client Name",
|
||||
"attrName": "computerName",
|
||||
"dataType": "String",
|
||||
"columnWidth":30
|
||||
}
|
||||
]
|
||||
}]
|
||||
}]
|
||||
}
|
||||
@@ -1,106 +0,0 @@
|
||||
{
|
||||
"exportName":"EXPORT_OTHER_ALLOTMENT",
|
||||
"exportPages":[{
|
||||
"sheetIndx": 0,
|
||||
"sheetName":"Other Property Allotment",
|
||||
"dataElements": [{
|
||||
"blockName":"masterData",
|
||||
"offsetRow": 0,
|
||||
"offsetCol": 0,
|
||||
"elementType":2,
|
||||
"isShowHeader":true,
|
||||
"headerRowNum":2,
|
||||
"headerAlign":"center",
|
||||
"headerColor":"#f5ebd9",
|
||||
"headerTextColor":"#000000",
|
||||
"textAlign":"left",
|
||||
"textColor":"#000000",
|
||||
"objClassName": "com.mgm.mcrm.allotment.models.CfgOtherAllotmentView",
|
||||
"columnDefs": [{
|
||||
"columnHeader":"Property",
|
||||
"attrName": "propertyName",
|
||||
"dataType": "String",
|
||||
"headerRowIdx":1,
|
||||
"columnWidth":20
|
||||
},
|
||||
{
|
||||
"columnHeader":"Date",
|
||||
"attrName": "bookDateText",
|
||||
"dataType": "String",
|
||||
"headerRowIdx":1,
|
||||
"columnWidth":20
|
||||
},
|
||||
{
|
||||
"columnHeader":"DOW",
|
||||
"attrName": "bookWeekDay",
|
||||
"dataType": "String",
|
||||
"headerRowIdx":1,
|
||||
"columnWidth":20
|
||||
},
|
||||
{
|
||||
"columnHeader":"Room Group",
|
||||
"attrName": "roomCategory",
|
||||
"dataType": "String",
|
||||
"headerRowIdx":1,
|
||||
"columnWidth":20
|
||||
},
|
||||
{
|
||||
"columnHeader":"Room Type",
|
||||
"attrName": "roomTypeNames",
|
||||
"dataType": "String",
|
||||
"headerRowIdx":1,
|
||||
"columnWidth":40
|
||||
},
|
||||
{
|
||||
"columnHeader":"Total Allotment",
|
||||
"attrName": "totalAllotment",
|
||||
"dataType": "Integer",
|
||||
"formatVal":"0",
|
||||
"headerRowIdx":1,
|
||||
"columnWidth":20
|
||||
},
|
||||
{
|
||||
"columnHeader":"App Channel",
|
||||
"groupName":"CHANNEL_GROUP",
|
||||
"attrName": "channelList",
|
||||
"groupKeyAttrName":"segmentId",
|
||||
"dataType": "com.mgm.mcrm.allotment.models.CfgOtherAppChannel",
|
||||
"headerRowIdx":0,
|
||||
"columnWidth":20,
|
||||
"groupColumns":[
|
||||
{
|
||||
"columnHeader":"",
|
||||
"headerAttrName":"segmentName",
|
||||
"attrName": "appChannel",
|
||||
"dataType": "Integer",
|
||||
"formatVal":"0",
|
||||
"headerRowIdx":-1,
|
||||
"columnWidth":20
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"columnHeader":"Rate",
|
||||
"attrName": "rate",
|
||||
"dataType": "String",
|
||||
"headerRowIdx":1,
|
||||
"columnWidth":20
|
||||
},
|
||||
{
|
||||
"columnHeader":"Sharer",
|
||||
"attrName": "sharerValue",
|
||||
"dataType": "String",
|
||||
"headerRowIdx":1,
|
||||
"columnWidth":20
|
||||
},
|
||||
{
|
||||
"columnHeader":"Waitlist",
|
||||
"attrName": "waitListValue",
|
||||
"dataType": "String",
|
||||
"headerRowIdx":1,
|
||||
"columnWidth":20
|
||||
}
|
||||
]
|
||||
}]
|
||||
}]
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user