Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
工
工位预约
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
jiatao
工位预约
Commits
f59e4670
Commit
f59e4670
authored
Nov 13, 2025
by
jiatao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
提交初始化配置
parent
14c61009
Changes
24
Show whitespace changes
Inline
Side-by-side
Showing
24 changed files
with
396 additions
and
218 deletions
+396
-218
CasAuthService.java
ruoyi-admin/src/main/java/com/ruoyi/cas/CasAuthService.java
+14
-113
CasController.java
ruoyi-admin/src/main/java/com/ruoyi/cas/CasController.java
+5
-11
ReservationApprovalController.java
.../web/controller/system/ReservationApprovalController.java
+37
-10
SchoolBuildController.java
...om/ruoyi/web/controller/system/SchoolBuildController.java
+5
-5
SchoolCampusController.java
...m/ruoyi/web/controller/system/SchoolCampusController.java
+4
-4
SchoolFloorController.java
...om/ruoyi/web/controller/system/SchoolFloorController.java
+5
-5
SchoolStudentInfoController.java
...yi/web/controller/system/SchoolStudentInfoController.java
+1
-1
SpaceController.java
...java/com/ruoyi/web/controller/system/SpaceController.java
+5
-5
SpaceSeatController.java
.../com/ruoyi/web/controller/system/SpaceSeatController.java
+5
-17
SysLoginController.java
...a/com/ruoyi/web/controller/system/SysLoginController.java
+1
-0
application-dev.yml
ruoyi-admin/src/main/resources/application-dev.yml
+2
-1
application-prod.yml
ruoyi-admin/src/main/resources/application-prod.yml
+1
-0
application.yml
ruoyi-admin/src/main/resources/application.yml
+1
-1
cas_success_response.xml
ruoyi-admin/src/main/resources/cas/cas_success_response.xml
+15
-13
pom.xml
ruoyi-common/pom.xml
+17
-0
Attributes.java
...system/src/main/java/com/ruoyi/system/cas/Attributes.java
+142
-0
AuthenticationSuccess.java
...main/java/com/ruoyi/system/cas/AuthenticationSuccess.java
+34
-0
CasUserInfo.java
...ystem/src/main/java/com/ruoyi/system/cas/CasUserInfo.java
+48
-30
CasXmlParser.java
...stem/src/main/java/com/ruoyi/system/cas/CasXmlParser.java
+22
-0
ReservationApprovalImpl.java
...om/ruoyi/system/service/impl/ReservationApprovalImpl.java
+2
-0
SchoolStudentInfoServiceImpl.java
...oyi/system/service/impl/SchoolStudentInfoServiceImpl.java
+2
-1
SchoolTeacherInfoServiceImpl.java
...oyi/system/service/impl/SchoolTeacherInfoServiceImpl.java
+1
-0
SpaceServiceImpl.java
.../java/com/ruoyi/system/service/impl/SpaceServiceImpl.java
+14
-1
AlreadyApprovalProcessor.java
...k/verifyReservationApproval/AlreadyApprovalProcessor.java
+13
-0
No files found.
ruoyi-admin/src/main/java/com/ruoyi/cas/CasAuthService.java
View file @
f59e4670
...
@@ -16,6 +16,7 @@ import com.ruoyi.framework.web.service.SysLoginService;
...
@@ -16,6 +16,7 @@ import com.ruoyi.framework.web.service.SysLoginService;
import
com.ruoyi.framework.web.service.SysPermissionService
;
import
com.ruoyi.framework.web.service.SysPermissionService
;
import
com.ruoyi.system.cas.CasUserInfo
;
import
com.ruoyi.system.cas.CasUserInfo
;
import
com.ruoyi.system.cas.CasValidationResult
;
import
com.ruoyi.system.cas.CasValidationResult
;
import
com.ruoyi.system.cas.CasXmlParser
;
import
com.ruoyi.system.service.ISysDeptService
;
import
com.ruoyi.system.service.ISysDeptService
;
import
com.ruoyi.system.service.ISysRoleService
;
import
com.ruoyi.system.service.ISysRoleService
;
import
com.ruoyi.system.service.ISysUserService
;
import
com.ruoyi.system.service.ISysUserService
;
...
@@ -102,9 +103,9 @@ public class CasAuthService {
...
@@ -102,9 +103,9 @@ public class CasAuthService {
public
AjaxResult
validateTicket
(
String
ticket
,
String
service
)
{
public
AjaxResult
validateTicket
(
String
ticket
,
String
service
)
{
try
{
try
{
// 构建验证URL
// 构建验证URL
String
validateUrl
=
StringUtils
.
format
(
"{}/serviceValidate?service={}&ticket={}
&format=XML
"
,
String
validateUrl
=
StringUtils
.
format
(
"{}/serviceValidate?service={}&ticket={}"
,
casServerUrl
,
casServerUrl
,
URLEncoder
.
encode
(
service
,
StandardCharsets
.
UTF_8
.
toString
())
,
service
,
ticket
);
ticket
);
logger
.
info
(
"CAS验证URL: {}"
,
validateUrl
);
logger
.
info
(
"CAS验证URL: {}"
,
validateUrl
);
...
@@ -117,14 +118,10 @@ public class CasAuthService {
...
@@ -117,14 +118,10 @@ public class CasAuthService {
logger
.
info
(
"CAS验证响应: {}"
,
xmlResponse
);
logger
.
info
(
"CAS验证响应: {}"
,
xmlResponse
);
// 解析响应
CasValidationResult
result
=
parseCasResponse
(
xmlResponse
);
if
(
result
.
isSuccess
())
{
CasUserInfo
userInfo
=
CasXmlParser
.
parseCasResponse
(
xmlResponse
);
return
handleSuccessfulLogin
(
result
.
getUserInfo
());
}
else
{
return
handleSuccessfulLogin
(
userInfo
);
return
AjaxResult
.
error
(
"CAS认证失败: "
+
result
.
getErrorCode
());
}
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
logger
.
error
(
"CAS票据验证异常"
,
e
);
logger
.
error
(
"CAS票据验证异常"
,
e
);
...
@@ -132,96 +129,7 @@ public class CasAuthService {
...
@@ -132,96 +129,7 @@ public class CasAuthService {
}
}
}
}
/**
* 解析CAS响应
*/
private
CasValidationResult
parseCasResponse
(
String
xmlResponse
)
throws
Exception
{
CasValidationResult
result
=
new
CasValidationResult
();
if
(
StringUtils
.
isBlank
(
xmlResponse
))
{
result
.
setSuccess
(
false
);
result
.
setErrorCode
(
"EMPTY_RESPONSE"
);
return
result
;
}
// 检查是否包含认证成功标签
if
(
xmlResponse
.
contains
(
"<cas:authenticationSuccess>"
))
{
// 使用DOM解析XML
DocumentBuilderFactory
factory
=
DocumentBuilderFactory
.
newInstance
();
DocumentBuilder
builder
=
factory
.
newDocumentBuilder
();
Document
doc
=
builder
.
parse
(
new
InputSource
(
new
StringReader
(
xmlResponse
)));
// 获取用户名
NodeList
userNodes
=
doc
.
getElementsByTagName
(
"cas:user"
);
if
(
userNodes
.
getLength
()
>
0
)
{
String
username
=
userNodes
.
item
(
0
).
getTextContent
();
CasUserInfo
userInfo
=
new
CasUserInfo
();
userInfo
.
setUsername
(
username
);
// 解析属性
parseUserAttributes
(
doc
,
userInfo
);
result
.
setSuccess
(
true
);
result
.
setUserInfo
(
userInfo
);
}
else
{
result
.
setSuccess
(
false
);
result
.
setErrorCode
(
"NO_USER_FOUND"
);
}
}
else
{
// 认证失败
result
.
setSuccess
(
false
);
// 尝试提取错误信息
if
(
xmlResponse
.
contains
(
"INVALID_TICKET"
))
{
result
.
setErrorCode
(
"INVALID_TICKET"
);
}
else
if
(
xmlResponse
.
contains
(
"INVALID_SERVICE"
))
{
result
.
setErrorCode
(
"INVALID_SERVICE"
);
}
else
{
result
.
setErrorCode
(
"AUTH_FAILED"
);
}
}
return
result
;
}
/**
* 解析用户属性
*/
private
void
parseUserAttributes
(
Document
doc
,
CasUserInfo
userInfo
)
{
try
{
NodeList
attributeNodes
=
doc
.
getElementsByTagName
(
"cas:attribute"
);
for
(
int
i
=
0
;
i
<
attributeNodes
.
getLength
();
i
++)
{
Node
node
=
attributeNodes
.
item
(
i
);
if
(
node
.
getNodeType
()
==
Node
.
ELEMENT_NODE
)
{
Element
element
=
(
Element
)
node
;
String
name
=
element
.
getAttribute
(
"name"
);
String
value
=
element
.
getTextContent
();
switch
(
name
)
{
case
"name"
:
userInfo
.
setName
(
value
);
break
;
case
"userId"
:
userInfo
.
setUserId
(
value
);
break
;
case
"userName"
:
userInfo
.
setUsername
(
value
);
break
;
case
"identityTypeCode"
:
userInfo
.
setIdentityTypeCode
(
value
);
break
;
case
"organizationCode"
:
userInfo
.
setOrganizationCode
(
value
);
break
;
case
"organizationName"
:
userInfo
.
setOrganizationName
(
value
);
break
;
}
}
}
}
catch
(
Exception
e
)
{
logger
.
warn
(
"解析用户属性失败"
,
e
);
}
}
/**
/**
* 处理登录成功
* 处理登录成功
...
@@ -256,7 +164,7 @@ public class CasAuthService {
...
@@ -256,7 +164,7 @@ public class CasAuthService {
// 返回登录结果
// 返回登录结果
Map
<
String
,
Object
>
authResult
=
new
HashMap
<>();
Map
<
String
,
Object
>
authResult
=
new
HashMap
<>();
authResult
.
put
(
"token"
,
token
);
authResult
.
put
(
"token"
,
token
);
authResult
.
put
(
"loginType"
,
"cas"
);
return
AjaxResult
.
success
(
"CAS认证成功"
,
authResult
);
return
AjaxResult
.
success
(
"CAS认证成功"
,
authResult
);
...
@@ -270,6 +178,8 @@ public class CasAuthService {
...
@@ -270,6 +178,8 @@ public class CasAuthService {
* 根据CAS信息创建用户
* 根据CAS信息创建用户
*/
*/
private
SysUser
createUserFromCasInfo
(
CasUserInfo
userInfo
)
{
private
SysUser
createUserFromCasInfo
(
CasUserInfo
userInfo
)
{
log
.
info
(
"组装的用户信息:{}"
,
userInfo
);
// 根据业务需求实现用户自动创建逻辑
// 根据业务需求实现用户自动创建逻辑
// 这里可以根据CAS返回的身份代码决定用户角色等
// 这里可以根据CAS返回的身份代码决定用户角色等
logger
.
info
(
"自动创建用户: {}"
,
userInfo
.
getUsername
());
logger
.
info
(
"自动创建用户: {}"
,
userInfo
.
getUsername
());
...
@@ -277,7 +187,7 @@ public class CasAuthService {
...
@@ -277,7 +187,7 @@ public class CasAuthService {
SysUser
user
=
new
SysUser
();
SysUser
user
=
new
SysUser
();
user
.
setUserName
(
userInfo
.
getUsername
());
user
.
setUserName
(
userInfo
.
getUsername
());
user
.
setNickName
(
userInfo
.
getName
());
user
.
setNickName
(
userInfo
.
getName
());
user
.
setPassword
((
SecurityUtils
.
encryptPassword
(
RuoYiConfig
.
getDefaultPassword
()
)));
user
.
setPassword
((
SecurityUtils
.
encryptPassword
(
"xjtugwyy@."
)));
user
.
setStatus
(
"0"
);
user
.
setStatus
(
"0"
);
user
.
setCreateBy
(
userInfo
.
getUsername
());
user
.
setCreateBy
(
userInfo
.
getUsername
());
user
.
setCreateTime
(
new
Date
());
user
.
setCreateTime
(
new
Date
());
...
@@ -316,14 +226,10 @@ public class CasAuthService {
...
@@ -316,14 +226,10 @@ public class CasAuthService {
* 构建CAS登录URL
* 构建CAS登录URL
*/
*/
public
String
buildLoginUrl
(
String
redirectUrl
)
{
public
String
buildLoginUrl
(
String
redirectUrl
)
{
try
{
String
service
=
URLEncoder
.
encode
(
clientHostUrl
+
redirectUrl
,
"UTF-8"
);
String
service
=
clientHostUrl
+
redirectUrl
;
return
casServerUrl
+
"/login?service="
+
service
;
return
casServerUrl
+
"/login?service="
+
service
;
}
catch
(
UnsupportedEncodingException
e
)
{
logger
.
error
(
"构建CAS登录URL失败"
,
e
);
throw
new
ServiceException
(
"构建CAS登录URL失败,请刷新重试"
);
}
}
}
...
@@ -332,12 +238,7 @@ public class CasAuthService {
...
@@ -332,12 +238,7 @@ public class CasAuthService {
*/
*/
public
String
buildLogoutUrl
(
String
redirectUrl
)
{
public
String
buildLogoutUrl
(
String
redirectUrl
)
{
if
(
StringUtils
.
isNotEmpty
(
redirectUrl
))
{
if
(
StringUtils
.
isNotEmpty
(
redirectUrl
))
{
try
{
return
casServerUrl
+
"/logout?service="
+
clientHostUrl
+
redirectUrl
;
return
casServerUrl
+
"/logout?service="
+
URLEncoder
.
encode
(
redirectUrl
,
String
.
valueOf
(
StandardCharsets
.
UTF_8
));
}
catch
(
UnsupportedEncodingException
e
)
{
throw
new
RuntimeException
(
e
);
}
}
}
return
casServerUrl
+
"/logout"
;
return
casServerUrl
+
"/logout"
;
}
}
...
...
ruoyi-admin/src/main/java/com/ruoyi/cas/CasController.java
View file @
f59e4670
...
@@ -3,6 +3,7 @@ package com.ruoyi.cas;
...
@@ -3,6 +3,7 @@ package com.ruoyi.cas;
import
com.ruoyi.common.core.controller.BaseController
;
import
com.ruoyi.common.core.controller.BaseController
;
import
com.ruoyi.common.core.domain.AjaxResult
;
import
com.ruoyi.common.core.domain.AjaxResult
;
import
com.ruoyi.common.core.domain.model.LoginUser
;
import
com.ruoyi.common.core.domain.model.LoginUser
;
import
com.ruoyi.common.utils.SecurityUtils
;
import
com.ruoyi.common.utils.StringUtils
;
import
com.ruoyi.common.utils.StringUtils
;
import
com.ruoyi.framework.web.service.TokenService
;
import
com.ruoyi.framework.web.service.TokenService
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
@@ -54,9 +55,9 @@ public class CasController extends BaseController {
...
@@ -54,9 +55,9 @@ public class CasController extends BaseController {
* 退出登录
* 退出登录
*/
*/
@PostMapping
(
"/logout"
)
@PostMapping
(
"/logout"
)
public
AjaxResult
logout
(
HttpServletRequest
request
,
@RequestParam
(
required
=
false
)
String
redirect
)
{
public
AjaxResult
logout
(
@RequestParam
(
required
=
false
)
String
redirect
)
{
// 获取当前登录用户
// 获取当前登录用户
LoginUser
loginUser
=
tokenService
.
getLoginUser
(
request
);
LoginUser
loginUser
=
SecurityUtils
.
getLoginUser
(
);
if
(
loginUser
!=
null
)
{
if
(
loginUser
!=
null
)
{
// 删除本地用户缓存
// 删除本地用户缓存
tokenService
.
delLoginUser
(
loginUser
.
getToken
());
tokenService
.
delLoginUser
(
loginUser
.
getToken
());
...
@@ -73,15 +74,8 @@ public class CasController extends BaseController {
...
@@ -73,15 +74,8 @@ public class CasController extends BaseController {
*/
*/
private
String
buildServiceUrl
(
String
redirect
)
{
private
String
buildServiceUrl
(
String
redirect
)
{
String
baseUrl
=
getBaseUrl
();
String
baseUrl
=
getBaseUrl
();
String
service
=
baseUrl
+
"/api/cas/callback"
;
return
baseUrl
+
redirect
;
if
(
StringUtils
.
isNotEmpty
(
redirect
))
{
try
{
service
+=
"?redirect="
+
URLEncoder
.
encode
(
redirect
,
String
.
valueOf
(
StandardCharsets
.
UTF_8
));
}
catch
(
UnsupportedEncodingException
e
)
{
throw
new
RuntimeException
(
e
);
}
}
return
service
;
}
}
/**
/**
...
...
ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/ReservationApprovalController.java
View file @
f59e4670
package
com
.
ruoyi
.
web
.
controller
.
system
;
package
com
.
ruoyi
.
web
.
controller
.
system
;
import
cn.hutool.core.date.DateUtil
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.ruoyi.common.core.controller.BaseController
;
import
com.ruoyi.common.core.controller.BaseController
;
import
com.ruoyi.common.core.domain.AjaxResult
;
import
com.ruoyi.common.core.domain.AjaxResult
;
...
@@ -19,6 +20,7 @@ import org.springframework.security.access.prepost.PreAuthorize;
...
@@ -19,6 +20,7 @@ import org.springframework.security.access.prepost.PreAuthorize;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.bind.annotation.*
;
import
java.util.Comparator
;
import
java.util.Date
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Map
;
...
@@ -100,9 +102,18 @@ public class ReservationApprovalController extends BaseController {
...
@@ -100,9 +102,18 @@ public class ReservationApprovalController extends BaseController {
List
<
ReservationApproval
>
list
=
reservationApprovalService
.
list
(
new
LambdaQueryWrapper
<
ReservationApproval
>()
List
<
ReservationApproval
>
list
=
reservationApprovalService
.
list
(
new
LambdaQueryWrapper
<
ReservationApproval
>()
.
eq
(
ReservationApproval:
:
getSubmitBy
,
SecurityUtils
.
getUsername
())
.
eq
(
ReservationApproval:
:
getSubmitBy
,
SecurityUtils
.
getUsername
())
.
in
(
ReservationApproval:
:
getStatus
,
ApprovalStatus
.
PASS
.
getCode
(),
ApprovalStatus
.
WAITING
.
getCode
())
.
in
(
ReservationApproval:
:
getStatus
,
ApprovalStatus
.
PASS
.
getCode
(),
ApprovalStatus
.
WAITING
.
getCode
()
,
ApprovalStatus
.
ALREADY_SIGN
.
getCode
()
)
.
ge
(
ReservationApproval:
:
getStartAt
,
new
Date
())
.
ge
(
ReservationApproval:
:
getStartAt
,
new
Date
())
.
last
(
"limit 0,3"
));
.
last
(
"limit 0,3"
))
//按特定顺序排序 待签到 -> 待审核 -> 已签到
.
stream
().
sorted
(
Comparator
.
comparingInt
(
r
->{
int
status
=
Integer
.
parseInt
(
r
.
getStatus
());
if
(
status
==
1
)
return
0
;
else
if
(
status
==
0
)
return
1
;
else
if
(
status
==
2
)
return
2
;
else
return
3
;
})).
collect
(
Collectors
.
toList
());
List
<
String
>
seatCodes
=
list
.
stream
().
map
(
ReservationApproval:
:
getSeatCode
).
collect
(
Collectors
.
toList
());
List
<
String
>
seatCodes
=
list
.
stream
().
map
(
ReservationApproval:
:
getSeatCode
).
collect
(
Collectors
.
toList
());
...
@@ -122,6 +133,7 @@ public class ReservationApprovalController extends BaseController {
...
@@ -122,6 +133,7 @@ public class ReservationApprovalController extends BaseController {
* @param reservationApproval
* @param reservationApproval
* @return
* @return
*/
*/
@PreAuthorize
(
"@ss.hasPermi('system:approval:submit')"
)
@PostMapping
(
"/submit"
)
@PostMapping
(
"/submit"
)
public
AjaxResult
submit
(
@RequestBody
ReservationApproval
reservationApproval
){
public
AjaxResult
submit
(
@RequestBody
ReservationApproval
reservationApproval
){
return
AjaxResult
.
success
(
reservationApprovalService
.
submitApproval
(
reservationApproval
));
return
AjaxResult
.
success
(
reservationApprovalService
.
submitApproval
(
reservationApproval
));
...
@@ -134,6 +146,7 @@ public class ReservationApprovalController extends BaseController {
...
@@ -134,6 +146,7 @@ public class ReservationApprovalController extends BaseController {
* @param reservationApproval
* @param reservationApproval
* @return
* @return
*/
*/
@PreAuthorize
(
"@ss.hasPermi('system:approval:approval')"
)
@PostMapping
(
"/approval"
)
@PostMapping
(
"/approval"
)
public
AjaxResult
approval
(
@RequestBody
ReservationApproval
reservationApproval
){
public
AjaxResult
approval
(
@RequestBody
ReservationApproval
reservationApproval
){
...
@@ -169,6 +182,7 @@ public class ReservationApprovalController extends BaseController {
...
@@ -169,6 +182,7 @@ public class ReservationApprovalController extends BaseController {
* @param approvalId
* @param approvalId
* @return
* @return
*/
*/
@PreAuthorize
(
"@ss.hasPermi('system:approval:submit')"
)
@PostMapping
(
"/sign/{approvalId}"
)
@PostMapping
(
"/sign/{approvalId}"
)
public
AjaxResult
sign
(
@PathVariable
(
"approvalId"
)
Long
approvalId
){
public
AjaxResult
sign
(
@PathVariable
(
"approvalId"
)
Long
approvalId
){
...
@@ -179,14 +193,14 @@ public class ReservationApprovalController extends BaseController {
...
@@ -179,14 +193,14 @@ public class ReservationApprovalController extends BaseController {
throw
new
ServiceException
(
"参数错误,查询不到指定的申请"
);
throw
new
ServiceException
(
"参数错误,查询不到指定的申请"
);
}
}
//
Date currDate = new Date();
Date
currDate
=
new
Date
();
//
if (currDate.getTime() < DateUtil.offsetMinute(reservationApproval.getStartAt(),-10).getTime()){
if
(
currDate
.
getTime
()
<
DateUtil
.
offsetMinute
(
reservationApproval
.
getStartAt
(),-
10
).
getTime
()){
//
throw new ServiceException("还未到签到时间");
throw
new
ServiceException
(
"还未到签到时间"
);
//
}
}
//
//
if (currDate.getTime() > reservationApproval.getEndAt().getTime()){
if
(
currDate
.
getTime
()
>
reservationApproval
.
getEndAt
().
getTime
()){
//
throw new ServiceException("已过签到时间");
throw
new
ServiceException
(
"已过签到时间"
);
//
}
}
reservationApproval
.
setStatus
(
ApprovalStatus
.
ALREADY_SIGN
.
getCode
());
reservationApproval
.
setStatus
(
ApprovalStatus
.
ALREADY_SIGN
.
getCode
());
...
@@ -201,6 +215,7 @@ public class ReservationApprovalController extends BaseController {
...
@@ -201,6 +215,7 @@ public class ReservationApprovalController extends BaseController {
* @param approvalId
* @param approvalId
* @return
* @return
*/
*/
@PreAuthorize
(
"@ss.hasPermi('system:approval:submit')"
)
@PostMapping
(
"/cancel/{approvalId}"
)
@PostMapping
(
"/cancel/{approvalId}"
)
public
AjaxResult
cancelApproval
(
@PathVariable
(
"approvalId"
)
Long
approvalId
){
public
AjaxResult
cancelApproval
(
@PathVariable
(
"approvalId"
)
Long
approvalId
){
...
@@ -213,4 +228,16 @@ public class ReservationApprovalController extends BaseController {
...
@@ -213,4 +228,16 @@ public class ReservationApprovalController extends BaseController {
}
}
/**
* 删除申请信息
* @param approvalId
* @return
*/
@PreAuthorize
(
"@ss.hasPermi('system:approval:del')"
)
@DeleteMapping
(
"/del/{approvalId}"
)
public
AjaxResult
del
(
@PathVariable
(
"approvalId"
)
Long
approvalId
){
return
AjaxResult
.
success
(
reservationApprovalService
.
removeById
(
approvalId
));
}
}
}
ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SchoolBuildController.java
View file @
f59e4670
...
@@ -38,7 +38,7 @@ public class SchoolBuildController extends BaseController
...
@@ -38,7 +38,7 @@ public class SchoolBuildController extends BaseController
/**
/**
* 查询楼宇列表
* 查询楼宇列表
*/
*/
@PreAuthorize
(
"@ss.hasPermi('
system:build
:list')"
)
@PreAuthorize
(
"@ss.hasPermi('
basic:builds
:list')"
)
@GetMapping
(
"/list"
)
@GetMapping
(
"/list"
)
public
TableDataInfo
list
(
SchoolBuild
schoolBuild
)
public
TableDataInfo
list
(
SchoolBuild
schoolBuild
)
{
{
...
@@ -54,7 +54,7 @@ public class SchoolBuildController extends BaseController
...
@@ -54,7 +54,7 @@ public class SchoolBuildController extends BaseController
/**
/**
* 获取楼宇详细信息
* 获取楼宇详细信息
*/
*/
@PreAuthorize
(
"@ss.hasPermi('
system:build:query
')"
)
@PreAuthorize
(
"@ss.hasPermi('
basic:builds:list
')"
)
@GetMapping
(
value
=
"/{buildId}"
)
@GetMapping
(
value
=
"/{buildId}"
)
public
AjaxResult
getInfo
(
@PathVariable
(
"buildId"
)
Long
buildId
)
public
AjaxResult
getInfo
(
@PathVariable
(
"buildId"
)
Long
buildId
)
{
{
...
@@ -64,7 +64,7 @@ public class SchoolBuildController extends BaseController
...
@@ -64,7 +64,7 @@ public class SchoolBuildController extends BaseController
/**
/**
* 新增楼宇
* 新增楼宇
*/
*/
@PreAuthorize
(
"@ss.hasPermi('
system:build
:add')"
)
@PreAuthorize
(
"@ss.hasPermi('
basic:builds
:add')"
)
@Log
(
title
=
"楼宇"
,
businessType
=
BusinessType
.
INSERT
)
@Log
(
title
=
"楼宇"
,
businessType
=
BusinessType
.
INSERT
)
@PostMapping
@PostMapping
public
AjaxResult
add
(
@RequestBody
SchoolBuild
schoolBuild
)
public
AjaxResult
add
(
@RequestBody
SchoolBuild
schoolBuild
)
...
@@ -75,7 +75,7 @@ public class SchoolBuildController extends BaseController
...
@@ -75,7 +75,7 @@ public class SchoolBuildController extends BaseController
/**
/**
* 修改楼宇
* 修改楼宇
*/
*/
@PreAuthorize
(
"@ss.hasPermi('
system:build:edit
')"
)
@PreAuthorize
(
"@ss.hasPermi('
basic:builds:update
')"
)
@Log
(
title
=
"楼宇"
,
businessType
=
BusinessType
.
UPDATE
)
@Log
(
title
=
"楼宇"
,
businessType
=
BusinessType
.
UPDATE
)
@PutMapping
@PutMapping
public
AjaxResult
edit
(
@RequestBody
SchoolBuild
schoolBuild
)
public
AjaxResult
edit
(
@RequestBody
SchoolBuild
schoolBuild
)
...
@@ -86,7 +86,7 @@ public class SchoolBuildController extends BaseController
...
@@ -86,7 +86,7 @@ public class SchoolBuildController extends BaseController
/**
/**
* 删除楼宇
* 删除楼宇
*/
*/
@PreAuthorize
(
"@ss.hasPermi('
system:build:remov
e')"
)
@PreAuthorize
(
"@ss.hasPermi('
basic:builds:delet
e')"
)
@Log
(
title
=
"楼宇"
,
businessType
=
BusinessType
.
DELETE
)
@Log
(
title
=
"楼宇"
,
businessType
=
BusinessType
.
DELETE
)
@DeleteMapping
(
"/{buildId}"
)
@DeleteMapping
(
"/{buildId}"
)
public
AjaxResult
remove
(
@PathVariable
Long
buildId
)
public
AjaxResult
remove
(
@PathVariable
Long
buildId
)
...
...
ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SchoolCampusController.java
View file @
f59e4670
...
@@ -50,7 +50,7 @@ public class SchoolCampusController extends BaseController
...
@@ -50,7 +50,7 @@ public class SchoolCampusController extends BaseController
/**
/**
* 查询校区列表
* 查询校区列表
*/
*/
@PreAuthorize
(
"@ss.hasPermi('
system
:campus:list')"
)
@PreAuthorize
(
"@ss.hasPermi('
basic
:campus:list')"
)
@GetMapping
(
"/list"
)
@GetMapping
(
"/list"
)
public
TableDataInfo
list
(
SchoolCampus
schoolCampus
)
public
TableDataInfo
list
(
SchoolCampus
schoolCampus
)
{
{
...
@@ -65,7 +65,7 @@ public class SchoolCampusController extends BaseController
...
@@ -65,7 +65,7 @@ public class SchoolCampusController extends BaseController
/**
/**
* 获取校区详细信息
* 获取校区详细信息
*/
*/
@PreAuthorize
(
"@ss.hasPermi('
system:campus:query
')"
)
@PreAuthorize
(
"@ss.hasPermi('
basic:campus:list
')"
)
@GetMapping
(
value
=
"/{campusId}"
)
@GetMapping
(
value
=
"/{campusId}"
)
public
AjaxResult
getInfo
(
@PathVariable
(
"campusId"
)
Long
campusId
)
public
AjaxResult
getInfo
(
@PathVariable
(
"campusId"
)
Long
campusId
)
{
{
...
@@ -86,7 +86,7 @@ public class SchoolCampusController extends BaseController
...
@@ -86,7 +86,7 @@ public class SchoolCampusController extends BaseController
/**
/**
* 修改校区
* 修改校区
*/
*/
@PreAuthorize
(
"@ss.hasPermi('
system:campus:edit
')"
)
@PreAuthorize
(
"@ss.hasPermi('
basic:campus:update
')"
)
@Log
(
title
=
"校区"
,
businessType
=
BusinessType
.
UPDATE
)
@Log
(
title
=
"校区"
,
businessType
=
BusinessType
.
UPDATE
)
@PutMapping
@PutMapping
public
AjaxResult
edit
(
@RequestBody
SchoolCampus
schoolCampus
)
public
AjaxResult
edit
(
@RequestBody
SchoolCampus
schoolCampus
)
...
@@ -97,7 +97,7 @@ public class SchoolCampusController extends BaseController
...
@@ -97,7 +97,7 @@ public class SchoolCampusController extends BaseController
/**
/**
* 删除校区
* 删除校区
*/
*/
@PreAuthorize
(
"@ss.hasPermi('
system:campus:remov
e')"
)
@PreAuthorize
(
"@ss.hasPermi('
basic:campus:delet
e')"
)
@Log
(
title
=
"校区"
,
businessType
=
BusinessType
.
DELETE
)
@Log
(
title
=
"校区"
,
businessType
=
BusinessType
.
DELETE
)
@DeleteMapping
(
"/{campusId}"
)
@DeleteMapping
(
"/{campusId}"
)
public
AjaxResult
remove
(
@PathVariable
Long
campusId
)
public
AjaxResult
remove
(
@PathVariable
Long
campusId
)
...
...
ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SchoolFloorController.java
View file @
f59e4670
...
@@ -38,7 +38,7 @@ public class SchoolFloorController extends BaseController
...
@@ -38,7 +38,7 @@ public class SchoolFloorController extends BaseController
/**
/**
* 查询楼层列表
* 查询楼层列表
*/
*/
@PreAuthorize
(
"@ss.hasPermi('
system:floor
:list')"
)
@PreAuthorize
(
"@ss.hasPermi('
basic:floors
:list')"
)
@GetMapping
(
"/list"
)
@GetMapping
(
"/list"
)
public
TableDataInfo
list
(
SchoolFloor
schoolFloor
)
public
TableDataInfo
list
(
SchoolFloor
schoolFloor
)
{
{
...
@@ -54,7 +54,7 @@ public class SchoolFloorController extends BaseController
...
@@ -54,7 +54,7 @@ public class SchoolFloorController extends BaseController
/**
/**
* 获取楼层详细信息
* 获取楼层详细信息
*/
*/
@PreAuthorize
(
"@ss.hasPermi('
system:floor:query
')"
)
@PreAuthorize
(
"@ss.hasPermi('
basic:floors:list
')"
)
@GetMapping
(
value
=
"/{floorId}"
)
@GetMapping
(
value
=
"/{floorId}"
)
public
AjaxResult
getInfo
(
@PathVariable
(
"floorId"
)
Long
floorId
)
public
AjaxResult
getInfo
(
@PathVariable
(
"floorId"
)
Long
floorId
)
{
{
...
@@ -64,7 +64,7 @@ public class SchoolFloorController extends BaseController
...
@@ -64,7 +64,7 @@ public class SchoolFloorController extends BaseController
/**
/**
* 新增楼层
* 新增楼层
*/
*/
@PreAuthorize
(
"@ss.hasPermi('
system:floor
:add')"
)
@PreAuthorize
(
"@ss.hasPermi('
basic:floors
:add')"
)
@Log
(
title
=
"楼层"
,
businessType
=
BusinessType
.
INSERT
)
@Log
(
title
=
"楼层"
,
businessType
=
BusinessType
.
INSERT
)
@PostMapping
@PostMapping
public
AjaxResult
add
(
@RequestBody
SchoolFloor
schoolFloor
)
public
AjaxResult
add
(
@RequestBody
SchoolFloor
schoolFloor
)
...
@@ -75,7 +75,7 @@ public class SchoolFloorController extends BaseController
...
@@ -75,7 +75,7 @@ public class SchoolFloorController extends BaseController
/**
/**
* 修改楼层
* 修改楼层
*/
*/
@PreAuthorize
(
"@ss.hasPermi('
system:floor:edit
')"
)
@PreAuthorize
(
"@ss.hasPermi('
basic:floors:update
')"
)
@Log
(
title
=
"楼层"
,
businessType
=
BusinessType
.
UPDATE
)
@Log
(
title
=
"楼层"
,
businessType
=
BusinessType
.
UPDATE
)
@PutMapping
@PutMapping
public
AjaxResult
edit
(
@RequestBody
SchoolFloor
schoolFloor
)
public
AjaxResult
edit
(
@RequestBody
SchoolFloor
schoolFloor
)
...
@@ -86,7 +86,7 @@ public class SchoolFloorController extends BaseController
...
@@ -86,7 +86,7 @@ public class SchoolFloorController extends BaseController
/**
/**
* 删除楼层
* 删除楼层
*/
*/
@PreAuthorize
(
"@ss.hasPermi('
system:floor:remov
e')"
)
@PreAuthorize
(
"@ss.hasPermi('
basic:floors:delet
e')"
)
@Log
(
title
=
"楼层"
,
businessType
=
BusinessType
.
DELETE
)
@Log
(
title
=
"楼层"
,
businessType
=
BusinessType
.
DELETE
)
@DeleteMapping
(
"/{floorId}"
)
@DeleteMapping
(
"/{floorId}"
)
public
AjaxResult
remove
(
@PathVariable
Long
floorId
)
public
AjaxResult
remove
(
@PathVariable
Long
floorId
)
...
...
ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SchoolStudentInfoController.java
View file @
f59e4670
...
@@ -32,7 +32,7 @@ public class SchoolStudentInfoController extends BaseController
...
@@ -32,7 +32,7 @@ public class SchoolStudentInfoController extends BaseController
/**
/**
* 查询【请填写功能名称】列表
* 查询【请填写功能名称】列表
*/
*/
@PreAuthorize
(
"@ss.hasPermi('system:
info
:list')"
)
@PreAuthorize
(
"@ss.hasPermi('system:
student
:list')"
)
@GetMapping
(
"/list"
)
@GetMapping
(
"/list"
)
public
TableDataInfo
list
(
SchoolStudentInfo
schoolStudentInfo
)
public
TableDataInfo
list
(
SchoolStudentInfo
schoolStudentInfo
)
{
{
...
...
ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SpaceController.java
View file @
f59e4670
...
@@ -41,7 +41,7 @@ public class SpaceController extends BaseController
...
@@ -41,7 +41,7 @@ public class SpaceController extends BaseController
/**
/**
* 查询房间列表
* 查询房间列表
*/
*/
@PreAuthorize
(
"@ss.hasPermi('
system:space
:list')"
)
@PreAuthorize
(
"@ss.hasPermi('
basic:spaces
:list')"
)
@GetMapping
(
"/list"
)
@GetMapping
(
"/list"
)
public
TableDataInfo
list
(
Space
space
)
public
TableDataInfo
list
(
Space
space
)
{
{
...
@@ -73,7 +73,7 @@ public class SpaceController extends BaseController
...
@@ -73,7 +73,7 @@ public class SpaceController extends BaseController
/**
/**
* 获取房间详细信息
* 获取房间详细信息
*/
*/
@PreAuthorize
(
"@ss.hasPermi('
system:space:query
')"
)
@PreAuthorize
(
"@ss.hasPermi('
basic:spaces:list
')"
)
@GetMapping
(
value
=
"/{spaceId}"
)
@GetMapping
(
value
=
"/{spaceId}"
)
public
AjaxResult
getInfo
(
@PathVariable
(
"spaceId"
)
Long
spaceId
)
public
AjaxResult
getInfo
(
@PathVariable
(
"spaceId"
)
Long
spaceId
)
{
{
...
@@ -83,7 +83,7 @@ public class SpaceController extends BaseController
...
@@ -83,7 +83,7 @@ public class SpaceController extends BaseController
/**
/**
* 新增房间
* 新增房间
*/
*/
@PreAuthorize
(
"@ss.hasPermi('
system:space
:add')"
)
@PreAuthorize
(
"@ss.hasPermi('
basic:spaces
:add')"
)
@Log
(
title
=
"房间"
,
businessType
=
BusinessType
.
INSERT
)
@Log
(
title
=
"房间"
,
businessType
=
BusinessType
.
INSERT
)
@PostMapping
@PostMapping
public
AjaxResult
add
(
@RequestBody
Space
space
)
public
AjaxResult
add
(
@RequestBody
Space
space
)
...
@@ -95,7 +95,7 @@ public class SpaceController extends BaseController
...
@@ -95,7 +95,7 @@ public class SpaceController extends BaseController
/**
/**
* 修改房间
* 修改房间
*/
*/
@PreAuthorize
(
"@ss.hasPermi('
system:space:edit
')"
)
@PreAuthorize
(
"@ss.hasPermi('
basic:spaces:update
')"
)
@Log
(
title
=
"房间"
,
businessType
=
BusinessType
.
UPDATE
)
@Log
(
title
=
"房间"
,
businessType
=
BusinessType
.
UPDATE
)
@PutMapping
@PutMapping
public
AjaxResult
edit
(
@RequestBody
Space
space
)
public
AjaxResult
edit
(
@RequestBody
Space
space
)
...
@@ -108,7 +108,7 @@ public class SpaceController extends BaseController
...
@@ -108,7 +108,7 @@ public class SpaceController extends BaseController
/**
/**
* 删除房间
* 删除房间
*/
*/
@PreAuthorize
(
"@ss.hasPermi('
system:space:remov
e')"
)
@PreAuthorize
(
"@ss.hasPermi('
basic:spaces:delet
e')"
)
@Log
(
title
=
"房间"
,
businessType
=
BusinessType
.
DELETE
)
@Log
(
title
=
"房间"
,
businessType
=
BusinessType
.
DELETE
)
@DeleteMapping
(
"/{spaceIds}"
)
@DeleteMapping
(
"/{spaceIds}"
)
public
AjaxResult
remove
(
@PathVariable
Long
[]
spaceIds
)
public
AjaxResult
remove
(
@PathVariable
Long
[]
spaceIds
)
...
...
ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SpaceSeatController.java
View file @
f59e4670
...
@@ -37,7 +37,7 @@ public class SpaceSeatController extends BaseController
...
@@ -37,7 +37,7 @@ public class SpaceSeatController extends BaseController
/**
/**
* 查询座位列表
* 查询座位列表
*/
*/
@PreAuthorize
(
"@ss.hasPermi('
system
:seat:list')"
)
@PreAuthorize
(
"@ss.hasPermi('
basic
:seat:list')"
)
@GetMapping
(
"/list"
)
@GetMapping
(
"/list"
)
public
TableDataInfo
list
(
SpaceSeat
spaceSeat
)
public
TableDataInfo
list
(
SpaceSeat
spaceSeat
)
{
{
...
@@ -46,23 +46,11 @@ public class SpaceSeatController extends BaseController
...
@@ -46,23 +46,11 @@ public class SpaceSeatController extends BaseController
return
getDataTable
(
list
);
return
getDataTable
(
list
);
}
}
/**
* 导出座位列表
*/
@PreAuthorize
(
"@ss.hasPermi('system:seat:export')"
)
@Log
(
title
=
"座位"
,
businessType
=
BusinessType
.
EXPORT
)
@PostMapping
(
"/export"
)
public
void
export
(
HttpServletResponse
response
,
SpaceSeat
spaceSeat
)
{
List
<
SpaceSeat
>
list
=
spaceSeatService
.
selectSpaceSeatList
(
spaceSeat
);
ExcelUtil
<
SpaceSeat
>
util
=
new
ExcelUtil
<
SpaceSeat
>(
SpaceSeat
.
class
);
util
.
exportExcel
(
response
,
list
,
"座位数据"
);
}
/**
/**
* 获取座位详细信息
* 获取座位详细信息
*/
*/
@PreAuthorize
(
"@ss.hasPermi('
system:seat:query
')"
)
@PreAuthorize
(
"@ss.hasPermi('
basic:seat:list
')"
)
@GetMapping
(
value
=
"/{seatId}"
)
@GetMapping
(
value
=
"/{seatId}"
)
public
AjaxResult
getInfo
(
@PathVariable
(
"seatId"
)
Long
seatId
)
public
AjaxResult
getInfo
(
@PathVariable
(
"seatId"
)
Long
seatId
)
{
{
...
@@ -72,7 +60,7 @@ public class SpaceSeatController extends BaseController
...
@@ -72,7 +60,7 @@ public class SpaceSeatController extends BaseController
/**
/**
* 新增座位
* 新增座位
*/
*/
@PreAuthorize
(
"@ss.hasPermi('
system
:seat:add')"
)
@PreAuthorize
(
"@ss.hasPermi('
basic
:seat:add')"
)
@Log
(
title
=
"座位"
,
businessType
=
BusinessType
.
INSERT
)
@Log
(
title
=
"座位"
,
businessType
=
BusinessType
.
INSERT
)
@PostMapping
@PostMapping
public
AjaxResult
add
(
@RequestBody
SpaceSeat
spaceSeat
)
public
AjaxResult
add
(
@RequestBody
SpaceSeat
spaceSeat
)
...
@@ -83,7 +71,7 @@ public class SpaceSeatController extends BaseController
...
@@ -83,7 +71,7 @@ public class SpaceSeatController extends BaseController
/**
/**
* 修改座位
* 修改座位
*/
*/
@PreAuthorize
(
"@ss.hasPermi('
system:seat:edit
')"
)
@PreAuthorize
(
"@ss.hasPermi('
basic:seat:update
')"
)
@Log
(
title
=
"座位"
,
businessType
=
BusinessType
.
UPDATE
)
@Log
(
title
=
"座位"
,
businessType
=
BusinessType
.
UPDATE
)
@PutMapping
@PutMapping
public
AjaxResult
edit
(
@RequestBody
SpaceSeat
spaceSeat
)
public
AjaxResult
edit
(
@RequestBody
SpaceSeat
spaceSeat
)
...
@@ -94,7 +82,7 @@ public class SpaceSeatController extends BaseController
...
@@ -94,7 +82,7 @@ public class SpaceSeatController extends BaseController
/**
/**
* 删除座位
* 删除座位
*/
*/
@PreAuthorize
(
"@ss.hasPermi('
system:seat:remov
e')"
)
@PreAuthorize
(
"@ss.hasPermi('
basic:seat:delet
e')"
)
@Log
(
title
=
"座位"
,
businessType
=
BusinessType
.
DELETE
)
@Log
(
title
=
"座位"
,
businessType
=
BusinessType
.
DELETE
)
@DeleteMapping
(
"/{seatIds}"
)
@DeleteMapping
(
"/{seatIds}"
)
public
AjaxResult
remove
(
@PathVariable
Long
[]
seatIds
)
public
AjaxResult
remove
(
@PathVariable
Long
[]
seatIds
)
...
...
ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysLoginController.java
View file @
f59e4670
...
@@ -61,6 +61,7 @@ public class SysLoginController
...
@@ -61,6 +61,7 @@ public class SysLoginController
String
token
=
loginService
.
login
(
loginBody
.
getUsername
(),
loginBody
.
getPassword
(),
loginBody
.
getCode
(),
String
token
=
loginService
.
login
(
loginBody
.
getUsername
(),
loginBody
.
getPassword
(),
loginBody
.
getCode
(),
loginBody
.
getUuid
());
loginBody
.
getUuid
());
ajax
.
put
(
Constants
.
TOKEN
,
token
);
ajax
.
put
(
Constants
.
TOKEN
,
token
);
ajax
.
put
(
"loginType"
,
"console"
);
return
ajax
;
return
ajax
;
}
}
...
...
ruoyi-admin/src/main/resources/application-dev.yml
View file @
f59e4670
...
@@ -36,8 +36,9 @@ spring:
...
@@ -36,8 +36,9 @@ spring:
password
:
123456
password
:
123456
# 从库数据源
# 从库数据源
slave
:
slave
:
enabled
:
true
# 从数据源开关/默认关闭
# 从数据源开关/默认关闭
url
:
jdbc:mysql://192.168.1.7:3306/lms
_
laboratory?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
url
:
jdbc:mysql://192.168.1.7:3306/lms
-
laboratory?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
username
:
root
username
:
root
password
:
123456
password
:
123456
# 初始连接数
# 初始连接数
...
...
ruoyi-admin/src/main/resources/application-prod.yml
View file @
f59e4670
...
@@ -36,6 +36,7 @@ spring:
...
@@ -36,6 +36,7 @@ spring:
password
:
${SPRING_DATASOURCE_PASSWORD}
password
:
${SPRING_DATASOURCE_PASSWORD}
# 从库数据源
# 从库数据源
slave
:
slave
:
enabled
:
false
# 从数据源开关/默认关闭
# 从数据源开关/默认关闭
url
:
jdbc:mysql://10.184.203.56:3306/lms-laboratory?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
url
:
jdbc:mysql://10.184.203.56:3306/lms-laboratory?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
username
:
rs_service
username
:
rs_service
...
...
ruoyi-admin/src/main/resources/application.yml
View file @
f59e4670
...
@@ -35,7 +35,7 @@ server:
...
@@ -35,7 +35,7 @@ server:
# 日志配置
# 日志配置
logging
:
logging
:
level
:
level
:
com.ruoyi
:
debug
com.ruoyi
:
info
org.springframework
:
warn
org.springframework
:
warn
# 用户配置
# 用户配置
...
...
ruoyi-admin/src/main/resources/cas/cas_success_response.xml
View file @
f59e4670
<cas:serviceResponse
xmlns:cas=
"http://www.yale.edu/tp/cas"
>
<cas:serviceResponse
xmlns:cas=
'http://www.yale.edu/tp/cas'
>
<cas:authenticationSuccess>
<cas:authenticationSuccess>
<cas:user>
test001
</cas:user>
<cas:user>
0202019370
</cas:user>
<cas:attributes>
<cas:attributes>
<cas:attribute
name=
"name"
>
测试用户
</cas:attribute>
<cas:accountName>
0202019370
</cas:accountName>
<cas:attribute
name=
"accountId"
>
1001
</cas:attribute>
<cas:identityTypeName>
教职工
</cas:identityTypeName>
<cas:attribute
name=
"userId"
>
1001
</cas:attribute>
<cas:organizationId>
3deb96c046b511f0b3f80af204f479f0
</cas:organizationId>
<cas:attribute
name=
"userName"
>
student003
</cas:attribute>
<cas:lang>
en
</cas:lang>
<cas:attribute
name=
"identityTypeId"
>
1
</cas:attribute>
<cas:identityTypeCode>
T01
</cas:identityTypeCode>
<cas:attribute
name=
"identityTypeCode"
>
S01
</cas:attribute>
<cas:organizationName>
未知
</cas:organizationName>
<cas:attribute
name=
"identityTypeName"
>
本科生
</cas:attribute>
<cas:userName>
校友测试01
</cas:userName>
<cas:attribute
name=
"organizationId"
>
1
</cas:attribute>
<cas:userId>
0b55d730473111f0b3f80af204f479f0
</cas:userId>
<cas:attribute
name=
"organizationCode"
>
13002000
</cas:attribute>
<cas:accountId>
0b57abf0473111f0b3f80af204f479f0
</cas:accountId>
<cas:attribute
name=
"organizationName"
>
计算机学院
</cas:attribute>
<cas:organizationCode>
99999999
</cas:organizationCode>
<cas:name>
校友测试01
</cas:name>
<cas:identityTypeId>
3f63ab50412411f01845fe72bb852ecf
</cas:identityTypeId>
</cas:attributes>
</cas:attributes>
</cas:authenticationSuccess>
</cas:authenticationSuccess>
</cas:serviceResponse>
</cas:serviceResponse>
ruoyi-common/pom.xml
View file @
f59e4670
...
@@ -151,6 +151,23 @@
...
@@ -151,6 +151,23 @@
<version>
3.6.4
</version>
<version>
3.6.4
</version>
</dependency>
</dependency>
<dependency>
<groupId>
javax.xml.bind
</groupId>
<artifactId>
jaxb-api
</artifactId>
<version>
2.3.1
</version>
</dependency>
<dependency>
<groupId>
com.sun.xml.bind
</groupId>
<artifactId>
jaxb-impl
</artifactId>
<version>
2.3.3
</version>
</dependency>
<dependency>
<groupId>
com.sun.xml.bind
</groupId>
<artifactId>
jaxb-core
</artifactId>
<version>
2.3.0.1
</version>
</dependency>
</dependencies>
</dependencies>
</project>
</project>
\ No newline at end of file
ruoyi-system/src/main/java/com/ruoyi/system/cas/Attributes.java
0 → 100644
View file @
f59e4670
package
com
.
ruoyi
.
system
.
cas
;
import
javax.xml.bind.annotation.XmlAccessType
;
import
javax.xml.bind.annotation.XmlAccessorType
;
import
javax.xml.bind.annotation.XmlElement
;
@XmlAccessorType
(
XmlAccessType
.
FIELD
)
class
Attributes
{
@XmlElement
(
name
=
"accountName"
,
namespace
=
"http://www.yale.edu/tp/cas"
)
private
String
accountName
;
@XmlElement
(
name
=
"identityTypeName"
,
namespace
=
"http://www.yale.edu/tp/cas"
)
private
String
identityTypeName
;
@XmlElement
(
name
=
"organizationId"
,
namespace
=
"http://www.yale.edu/tp/cas"
)
private
String
organizationId
;
@XmlElement
(
name
=
"lang"
,
namespace
=
"http://www.yale.edu/tp/cas"
)
private
String
lang
;
@XmlElement
(
name
=
"identityTypeCode"
,
namespace
=
"http://www.yale.edu/tp/cas"
)
private
String
identityTypeCode
;
@XmlElement
(
name
=
"organizationName"
,
namespace
=
"http://www.yale.edu/tp/cas"
)
private
String
organizationName
;
@XmlElement
(
name
=
"userName"
,
namespace
=
"http://www.yale.edu/tp/cas"
)
private
String
userName
;
@XmlElement
(
name
=
"userId"
,
namespace
=
"http://www.yale.edu/tp/cas"
)
private
String
userId
;
@XmlElement
(
name
=
"accountId"
,
namespace
=
"http://www.yale.edu/tp/cas"
)
private
String
accountId
;
@XmlElement
(
name
=
"organizationCode"
,
namespace
=
"http://www.yale.edu/tp/cas"
)
private
String
organizationCode
;
@XmlElement
(
name
=
"name"
,
namespace
=
"http://www.yale.edu/tp/cas"
)
private
String
name
;
@XmlElement
(
name
=
"identityTypeId"
,
namespace
=
"http://www.yale.edu/tp/cas"
)
private
String
identityTypeId
;
// Getters and Setters
public
String
getAccountName
()
{
return
accountName
;
}
public
void
setAccountName
(
String
accountName
)
{
this
.
accountName
=
accountName
;
}
public
String
getIdentityTypeName
()
{
return
identityTypeName
;
}
public
void
setIdentityTypeName
(
String
identityTypeName
)
{
this
.
identityTypeName
=
identityTypeName
;
}
public
String
getOrganizationId
()
{
return
organizationId
;
}
public
void
setOrganizationId
(
String
organizationId
)
{
this
.
organizationId
=
organizationId
;
}
public
String
getLang
()
{
return
lang
;
}
public
void
setLang
(
String
lang
)
{
this
.
lang
=
lang
;
}
public
String
getIdentityTypeCode
()
{
return
identityTypeCode
;
}
public
void
setIdentityTypeCode
(
String
identityTypeCode
)
{
this
.
identityTypeCode
=
identityTypeCode
;
}
public
String
getOrganizationName
()
{
return
organizationName
;
}
public
void
setOrganizationName
(
String
organizationName
)
{
this
.
organizationName
=
organizationName
;
}
public
String
getUserName
()
{
return
userName
;
}
public
void
setUserName
(
String
userName
)
{
this
.
userName
=
userName
;
}
public
String
getUserId
()
{
return
userId
;
}
public
void
setUserId
(
String
userId
)
{
this
.
userId
=
userId
;
}
public
String
getAccountId
()
{
return
accountId
;
}
public
void
setAccountId
(
String
accountId
)
{
this
.
accountId
=
accountId
;
}
public
String
getOrganizationCode
()
{
return
organizationCode
;
}
public
void
setOrganizationCode
(
String
organizationCode
)
{
this
.
organizationCode
=
organizationCode
;
}
public
String
getName
()
{
return
name
;
}
public
void
setName
(
String
name
)
{
this
.
name
=
name
;
}
public
String
getIdentityTypeId
()
{
return
identityTypeId
;
}
public
void
setIdentityTypeId
(
String
identityTypeId
)
{
this
.
identityTypeId
=
identityTypeId
;
}
}
\ No newline at end of file
ruoyi-system/src/main/java/com/ruoyi/system/cas/AuthenticationSuccess.java
0 → 100644
View file @
f59e4670
package
com
.
ruoyi
.
system
.
cas
;
import
lombok.Data
;
import
javax.xml.bind.annotation.XmlAccessType
;
import
javax.xml.bind.annotation.XmlAccessorType
;
import
javax.xml.bind.annotation.XmlElement
;
@XmlAccessorType
(
XmlAccessType
.
FIELD
)
class
AuthenticationSuccess
{
@XmlElement
(
name
=
"user"
,
namespace
=
"http://www.yale.edu/tp/cas"
)
private
String
user
;
@XmlElement
(
name
=
"attributes"
,
namespace
=
"http://www.yale.edu/tp/cas"
)
private
Attributes
attributes
;
// Getters and Setters
public
String
getUser
()
{
return
user
;
}
public
void
setUser
(
String
user
)
{
this
.
user
=
user
;
}
public
Attributes
getAttributes
()
{
return
attributes
;
}
public
void
setAttributes
(
Attributes
attributes
)
{
this
.
attributes
=
attributes
;
}
}
\ No newline at end of file
ruoyi-system/src/main/java/com/ruoyi/system/cas/CasUserInfo.java
View file @
f59e4670
...
@@ -2,36 +2,54 @@ package com.ruoyi.system.cas;
...
@@ -2,36 +2,54 @@ package com.ruoyi.system.cas;
import
lombok.Data
;
import
lombok.Data
;
import
javax.xml.bind.annotation.XmlAccessType
;
import
javax.xml.bind.annotation.XmlAccessorType
;
import
javax.xml.bind.annotation.XmlElement
;
import
javax.xml.bind.annotation.XmlRootElement
;
@XmlRootElement
(
name
=
"serviceResponse"
,
namespace
=
"http://www.yale.edu/tp/cas"
)
@XmlAccessorType
(
XmlAccessType
.
FIELD
)
@Data
@Data
public
class
CasUserInfo
{
public
class
CasUserInfo
{
/**
@XmlElement
(
name
=
"authenticationSuccess"
,
namespace
=
"http://www.yale.edu/tp/cas"
)
* 用户名(登录账号)
private
AuthenticationSuccess
authenticationSuccess
;
*/
private
String
username
;
// Getters and Setters
public
AuthenticationSuccess
getAuthenticationSuccess
()
{
/**
return
authenticationSuccess
;
* 姓名
}
*/
private
String
name
;
public
void
setAuthenticationSuccess
(
AuthenticationSuccess
authenticationSuccess
)
{
this
.
authenticationSuccess
=
authenticationSuccess
;
/**
}
* 用户ID
*/
// 便捷方法,直接获取用户信息
private
String
userId
;
public
String
getUsername
()
{
return
authenticationSuccess
!=
null
?
authenticationSuccess
.
getUser
()
:
null
;
}
/**
* 身份代码
public
String
getName
()
{
*/
return
authenticationSuccess
!=
null
&&
authenticationSuccess
.
getAttributes
()
!=
null
?
private
String
identityTypeCode
;
authenticationSuccess
.
getAttributes
().
getName
()
:
null
;
}
/**
* 组织机构编码
public
String
getUserId
()
{
*/
return
authenticationSuccess
!=
null
&&
authenticationSuccess
.
getAttributes
()
!=
null
?
private
String
organizationCode
;
authenticationSuccess
.
getAttributes
().
getUserId
()
:
null
;
}
/**
* 组织机构名称
public
String
getIdentityTypeCode
()
{
*/
return
authenticationSuccess
!=
null
&&
authenticationSuccess
.
getAttributes
()
!=
null
?
private
String
organizationName
;
authenticationSuccess
.
getAttributes
().
getIdentityTypeCode
()
:
null
;
}
public
String
getOrganizationCode
()
{
return
authenticationSuccess
!=
null
&&
authenticationSuccess
.
getAttributes
()
!=
null
?
authenticationSuccess
.
getAttributes
().
getOrganizationCode
()
:
null
;
}
public
String
getOrganizationName
()
{
return
authenticationSuccess
!=
null
&&
authenticationSuccess
.
getAttributes
()
!=
null
?
authenticationSuccess
.
getAttributes
().
getOrganizationName
()
:
null
;
}
}
}
\ No newline at end of file
ruoyi-system/src/main/java/com/ruoyi/system/cas/CasXmlParser.java
0 → 100644
View file @
f59e4670
package
com
.
ruoyi
.
system
.
cas
;
import
javax.xml.bind.JAXBContext
;
import
javax.xml.bind.JAXBException
;
import
javax.xml.bind.Unmarshaller
;
import
java.io.StringReader
;
public
class
CasXmlParser
{
public
static
CasUserInfo
parseCasResponse
(
String
xmlString
)
{
try
{
JAXBContext
jaxbContext
=
JAXBContext
.
newInstance
(
CasUserInfo
.
class
);
Unmarshaller
unmarshaller
=
jaxbContext
.
createUnmarshaller
();
StringReader
reader
=
new
StringReader
(
xmlString
);
return
(
CasUserInfo
)
unmarshaller
.
unmarshal
(
reader
);
}
catch
(
JAXBException
e
)
{
throw
new
RuntimeException
(
"解析CAS响应失败"
,
e
);
}
}
}
\ No newline at end of file
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/ReservationApprovalImpl.java
View file @
f59e4670
...
@@ -49,6 +49,8 @@ public class ReservationApprovalImpl extends ServiceImpl<ReservationApprovalMapp
...
@@ -49,6 +49,8 @@ public class ReservationApprovalImpl extends ServiceImpl<ReservationApprovalMapp
for
(
VerifyReservationApprovalProcessor
processor
:
processors
)
{
for
(
VerifyReservationApprovalProcessor
processor
:
processors
)
{
processor
.
VerifyReservationApproval
(
reservationApproval
);
processor
.
VerifyReservationApproval
(
reservationApproval
);
}
}
reservationApproval
.
setSubmitAt
(
new
Date
());
reservationApproval
.
setSubmitAt
(
new
Date
());
reservationApproval
.
setSubmitBy
(
SecurityUtils
.
getUsername
());
reservationApproval
.
setSubmitBy
(
SecurityUtils
.
getUsername
());
reservationApproval
.
setStatus
(
ApprovalStatus
.
WAITING
.
getCode
());
reservationApproval
.
setStatus
(
ApprovalStatus
.
WAITING
.
getCode
());
...
...
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SchoolStudentInfoServiceImpl.java
View file @
f59e4670
...
@@ -18,7 +18,7 @@ import com.ruoyi.system.service.ISchoolStudentInfoService;
...
@@ -18,7 +18,7 @@ import com.ruoyi.system.service.ISchoolStudentInfoService;
* @date 2025-11-10
* @date 2025-11-10
*/
*/
@Service
@Service
@DataSource
(
DataSourceType
.
SLAVE
)
public
class
SchoolStudentInfoServiceImpl
implements
ISchoolStudentInfoService
public
class
SchoolStudentInfoServiceImpl
implements
ISchoolStudentInfoService
{
{
@Autowired
@Autowired
...
@@ -43,6 +43,7 @@ public class SchoolStudentInfoServiceImpl implements ISchoolStudentInfoService
...
@@ -43,6 +43,7 @@ public class SchoolStudentInfoServiceImpl implements ISchoolStudentInfoService
* @return 【请填写功能名称】
* @return 【请填写功能名称】
*/
*/
@Override
@Override
@DataSource
(
value
=
DataSourceType
.
SLAVE
)
public
List
<
SchoolStudentInfo
>
selectSchoolStudentInfoList
(
SchoolStudentInfo
schoolStudentInfo
)
public
List
<
SchoolStudentInfo
>
selectSchoolStudentInfoList
(
SchoolStudentInfo
schoolStudentInfo
)
{
{
return
schoolStudentInfoMapper
.
selectSchoolStudentInfoList
(
schoolStudentInfo
);
return
schoolStudentInfoMapper
.
selectSchoolStudentInfoList
(
schoolStudentInfo
);
...
...
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SchoolTeacherInfoServiceImpl.java
View file @
f59e4670
...
@@ -43,6 +43,7 @@ public class SchoolTeacherInfoServiceImpl implements ISchoolTeacherInfoService
...
@@ -43,6 +43,7 @@ public class SchoolTeacherInfoServiceImpl implements ISchoolTeacherInfoService
* @return 【请填写功能名称】
* @return 【请填写功能名称】
*/
*/
@Override
@Override
@DataSource
(
value
=
DataSourceType
.
SLAVE
)
public
List
<
SchoolTeacherInfo
>
selectSchoolTeacherInfoList
(
SchoolTeacherInfo
schoolTeacherInfo
)
public
List
<
SchoolTeacherInfo
>
selectSchoolTeacherInfoList
(
SchoolTeacherInfo
schoolTeacherInfo
)
{
{
return
schoolTeacherInfoMapper
.
selectSchoolTeacherInfoList
(
schoolTeacherInfo
);
return
schoolTeacherInfoMapper
.
selectSchoolTeacherInfoList
(
schoolTeacherInfo
);
...
...
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SpaceServiceImpl.java
View file @
f59e4670
...
@@ -7,8 +7,11 @@ import cn.hutool.core.date.DateUtil;
...
@@ -7,8 +7,11 @@ import cn.hutool.core.date.DateUtil;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.ruoyi.common.enums.ApprovalStatus
;
import
com.ruoyi.common.exception.ServiceException
;
import
com.ruoyi.common.exception.ServiceException
;
import
com.ruoyi.common.utils.SecurityUtils
;
import
com.ruoyi.common.utils.StringUtils
;
import
com.ruoyi.common.utils.StringUtils
;
import
com.ruoyi.system.domain.ReservationApproval
;
import
com.ruoyi.system.domain.SpaceSeat
;
import
com.ruoyi.system.domain.SpaceSeat
;
import
com.ruoyi.system.service.IReservationApprovalService
;
import
com.ruoyi.system.service.IReservationApprovalService
;
import
com.ruoyi.system.service.ISpaceSeatService
;
import
com.ruoyi.system.service.ISpaceSeatService
;
...
@@ -71,6 +74,13 @@ public class SpaceServiceImpl extends ServiceImpl<SpaceMapper,Space> implements
...
@@ -71,6 +74,13 @@ public class SpaceServiceImpl extends ServiceImpl<SpaceMapper,Space> implements
throw
new
ServiceException
(
"房间信息错误"
);
throw
new
ServiceException
(
"房间信息错误"
);
}
}
long
submitNum
=
reservationApprovalService
.
count
(
new
LambdaQueryWrapper
<
ReservationApproval
>()
.
eq
(
ReservationApproval:
:
getSubmitBy
,
SecurityUtils
.
getUsername
())
.
in
(
ReservationApproval:
:
getStatus
,
ApprovalStatus
.
WAITING
.
getCode
(),
ApprovalStatus
.
ALREADY_SIGN
.
getCode
(),
ApprovalStatus
.
PASS
.
getCode
())
.
ge
(
ReservationApproval:
:
getEndAt
,
startAt
)
.
le
(
ReservationApproval:
:
getStartAt
,
endAt
));
List
<
SpaceSeat
>
spaceSeats
=
spaceSeatService
.
list
(
new
LambdaQueryWrapper
<
SpaceSeat
>()
List
<
SpaceSeat
>
spaceSeats
=
spaceSeatService
.
list
(
new
LambdaQueryWrapper
<
SpaceSeat
>()
.
select
(
SpaceSeat:
:
getSeatId
,
SpaceSeat:
:
getSeatCode
,
SpaceSeat:
:
getSpaceCode
,
SpaceSeat:
:
getSeatName
)
.
select
(
SpaceSeat:
:
getSeatId
,
SpaceSeat:
:
getSeatCode
,
SpaceSeat:
:
getSpaceCode
,
SpaceSeat:
:
getSeatName
)
.
eq
(
SpaceSeat:
:
getSpaceCode
,
space
.
getSpaceCode
()));
.
eq
(
SpaceSeat:
:
getSpaceCode
,
space
.
getSpaceCode
()));
...
@@ -86,11 +96,14 @@ public class SpaceServiceImpl extends ServiceImpl<SpaceMapper,Space> implements
...
@@ -86,11 +96,14 @@ public class SpaceServiceImpl extends ServiceImpl<SpaceMapper,Space> implements
for
(
SpaceSeat
spaceSeat
:
spaceSeats
)
{
for
(
SpaceSeat
spaceSeat
:
spaceSeats
)
{
spaceSeat
.
setReservable
(
spaceSeat
.
setReservable
(
!
reservedSeatCodes
.
contains
(
spaceSeat
.
getSeatCode
())
//是否占用
//是否占用
!
reservedSeatCodes
.
contains
(
spaceSeat
.
getSeatCode
())
//是否达到最小预约时长
//是否达到最小预约时长
&&
DateUtil
.
between
(
startAt
,
endAt
,
DateUnit
.
MINUTE
)
>=
space
.
getMiniMumDuration
()
&&
DateUtil
.
between
(
startAt
,
endAt
,
DateUnit
.
MINUTE
)
>=
space
.
getMiniMumDuration
()
// 是否达到最小预约间隔
// 是否达到最小预约间隔
&&
DateUtil
.
between
(
new
Date
(),
startAt
,
DateUnit
.
DAY
)
>=
space
.
getInAdvanceDuration
()
&&
DateUtil
.
between
(
new
Date
(),
startAt
,
DateUnit
.
DAY
)
>=
space
.
getInAdvanceDuration
()
// 同时段不能有申请
&&
submitNum
==
0
);
);
}
}
...
...
ruoyi-system/src/main/java/com/ruoyi/system/task/verifyReservationApproval/AlreadyApprovalProcessor.java
View file @
f59e4670
...
@@ -28,6 +28,19 @@ public class AlreadyApprovalProcessor implements VerifyReservationApprovalProces
...
@@ -28,6 +28,19 @@ public class AlreadyApprovalProcessor implements VerifyReservationApprovalProces
public
void
VerifyReservationApproval
(
ReservationApproval
reservationApproval
)
{
public
void
VerifyReservationApproval
(
ReservationApproval
reservationApproval
)
{
long
submitNum
=
reservationApprovalService
.
count
(
new
LambdaQueryWrapper
<
ReservationApproval
>()
.
eq
(
ReservationApproval:
:
getSubmitBy
,
reservationApproval
.
getSubmitBy
())
.
in
(
ReservationApproval:
:
getStatus
,
ApprovalStatus
.
WAITING
.
getCode
(),
ApprovalStatus
.
ALREADY_SIGN
.
getCode
(),
ApprovalStatus
.
PASS
.
getCode
())
.
ge
(
ReservationApproval:
:
getEndAt
,
reservationApproval
.
getStartAt
())
.
le
(
ReservationApproval:
:
getStartAt
,
reservationApproval
.
getEndAt
()));
if
(
submitNum
>
0
){
throw
new
ServiceException
(
"你存在一个时间重合的申请,请重新选择时段"
);
}
int
maxWait
=
Integer
.
parseInt
(
configService
.
selectConfigByKey
(
CONFIG_KEY
));
int
maxWait
=
Integer
.
parseInt
(
configService
.
selectConfigByKey
(
CONFIG_KEY
));
long
count
=
reservationApprovalService
.
count
(
new
LambdaQueryWrapper
<
ReservationApproval
>()
long
count
=
reservationApprovalService
.
count
(
new
LambdaQueryWrapper
<
ReservationApproval
>()
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment