Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
spring-microservice-exam
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
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
汪想
spring-microservice-exam
Commits
7456c507
Commit
7456c507
authored
May 26, 2020
by
wangx
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bug修改
parent
1044e59b
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
43 additions
and
9 deletions
+43
-9
exam-service.yml
config-service/src/main/resources/config/exam-service.yml
+1
-1
OauthClientMapper.xml
...h-service/src/main/resources/mapper/OauthClientMapper.xml
+1
-2
ExamRecordService.java
...ava/com/github/tangyi/exam/service/ExamRecordService.java
+8
-2
SubjectService.java
...n/java/com/github/tangyi/exam/service/SubjectService.java
+7
-1
UserService.java
...main/java/com/github/tangyi/user/service/UserService.java
+10
-2
LogMapper.xml
...rent/user-service/src/main/resources/mapper/LogMapper.xml
+9
-1
TenantMapper.xml
...t/user-service/src/main/resources/mapper/TenantMapper.xml
+7
-0
No files found.
config-service/src/main/resources/config/exam-service.yml
View file @
7456c507
...
...
@@ -83,7 +83,7 @@ sys:
logoUrl
:
/static/img/exam
logoCount
:
22
logoSuffix
:
.jpeg
qrCodeUrl
:
http://
${QR_CODE_URL:localhost}:${QR_CODE_PORT:8080}
/#/mobile
qrCodeUrl
:
http://
exam.lencti.com/web
/#/mobile
# feign相关配置
feign
:
...
...
modules/auth-service-parent/auth-service/src/main/resources/mapper/OauthClientMapper.xml
View file @
7456c507
...
...
@@ -49,13 +49,12 @@
<!-- where 条件 -->
<sql
id=
"whereColumnList"
>
<if
test=
"clientId != null and clientId != ''"
>
and a.client_id like
#{clientId}
and a.client_id like
CONCAT('%', #{clientId},'%')
</if>
<if
test=
"tenantCode != null and tenantCode != ''"
>
and a.tenant_code = #{tenantCode}
</if>
</sql>
<select
id=
"getById"
resultMap=
"oauthClientResultMap"
>
SELECT
<include
refid=
"oauthClientColumns"
/>
...
...
modules/exam-service-parent/exam-service/src/main/java/com/github/tangyi/exam/service/ExamRecordService.java
View file @
7456c507
...
...
@@ -86,7 +86,7 @@ public class ExamRecordService extends CrudService<ExamRecordMapper, Examination
* @author tangyi
* @date 2018/11/10 21:33
*/
public
PageInfo
<
ExaminationRecordDto
>
examRecordList
(
ExaminationRecord
examRecord
,
String
pageNum
,
String
pageSize
,
String
sort
,
String
order
)
{
public
PageInfo
<
ExaminationRecordDto
>
examRecordList
(
ExaminationRecord
examRecord
,
String
pageNum
,
String
pageSize
,
String
sort
,
String
order
,
String
examinationName
)
{
examRecord
.
setTenantCode
(
SysUtil
.
getTenantCode
());
PageInfo
<
ExaminationRecordDto
>
examRecordDtoPageInfo
=
new
PageInfo
<>();
List
<
ExaminationRecordDto
>
examRecordDtoList
=
new
ArrayList
<>();
...
...
@@ -125,7 +125,13 @@ public class ExamRecordService extends CrudService<ExamRecordMapper, Examination
examRecordDtoPageInfo
.
setPages
(
examRecordPageInfo
.
getPages
());
examRecordDtoPageInfo
.
setPageSize
(
examRecordPageInfo
.
getPageSize
());
examRecordDtoPageInfo
.
setPageNum
(
examRecordPageInfo
.
getPageNum
());
examRecordDtoPageInfo
.
setList
(
examRecordDtoList
);
if
(!
examinationName
.
isEmpty
()){
List
<
ExaminationRecordDto
>
examRecordDtoLists
=
examRecordDtoList
.
stream
().
filter
(
f
->
f
.
getExaminationName
().
contains
(
examinationName
)).
collect
(
Collectors
.
toList
());
examRecordDtoPageInfo
.
setList
(
examRecordDtoLists
);
}
else
{
examRecordDtoPageInfo
.
setList
(
examRecordDtoList
);
}
return
examRecordDtoPageInfo
;
}
...
...
modules/exam-service-parent/exam-service/src/main/java/com/github/tangyi/exam/service/SubjectService.java
View file @
7456c507
...
...
@@ -153,7 +153,13 @@ public class SubjectService {
}
PageInfo
<
SubjectDto
>
subjectDtoPageInfo
=
new
PageInfo
<>();
PageUtil
.
copyProperties
(
examinationSubjectPageInfo
,
subjectDtoPageInfo
);
subjectDtoPageInfo
.
setList
(
subjectDtos
);
if
(!
subjectDto
.
getSubjectName
().
isEmpty
()){
List
<
SubjectDto
>
subjectDtos1
=
subjectDtos
.
stream
().
filter
(
f
->
f
.
getSubjectName
().
contains
(
subjectDto
.
getSubjectName
())).
collect
(
Collectors
.
toList
());
subjectDtoPageInfo
.
setList
(
subjectDtos1
);
}
else
{
subjectDtoPageInfo
.
setList
(
subjectDtos
);
}
return
subjectDtoPageInfo
;
}
...
...
modules/user-service-parent/user-service/src/main/java/com/github/tangyi/user/service/UserService.java
View file @
7456c507
...
...
@@ -5,6 +5,7 @@ import com.github.tangyi.common.basic.properties.SysProperties;
import
com.github.tangyi.common.basic.vo.UserVo
;
import
com.github.tangyi.common.core.constant.CommonConstant
;
import
com.github.tangyi.common.core.exceptions.CommonException
;
import
com.github.tangyi.common.core.exceptions.ServiceException
;
import
com.github.tangyi.common.core.service.CrudService
;
import
com.github.tangyi.common.core.utils.AesUtil
;
import
com.github.tangyi.common.core.utils.DateUtils
;
...
...
@@ -316,6 +317,7 @@ public class UserService extends CrudService<UserMapper, User> {
@Transactional
@CacheEvict
(
value
=
"user"
,
key
=
"#userDto.identifier"
)
public
int
updatePassword
(
UserDto
userDto
)
{
log
.
info
(
"用户参数 userDto{}"
+
userDto
);
userDto
.
setTenantCode
(
SysUtil
.
getTenantCode
());
if
(
StringUtils
.
isBlank
(
userDto
.
getNewPassword
()))
throw
new
CommonException
(
"新密码不能为空."
);
...
...
@@ -325,10 +327,13 @@ public class UserService extends CrudService<UserMapper, User> {
userAuths
.
setIdentifier
(
userDto
.
getIdentifier
());
userAuths
.
setTenantCode
(
userDto
.
getTenantCode
());
userAuths
=
userAuthsService
.
getByIdentifier
(
userAuths
);
log
.
info
(
"用户参数 userAuths{}"
+
userAuths
);
if
(
userAuths
==
null
)
throw
new
CommonException
(
"账号不存在."
);
throw
new
CommonException
(
"账号不存在"
);
log
.
info
(
"账号不存在 {}"
+
userAuths
);
if
(!
encoder
.
matches
(
userDto
.
getOldPassword
(),
userAuths
.
getCredential
()))
{
throw
new
CommonException
(
"新旧密码不匹配"
);
log
.
info
(
"新旧密码不匹配 {}"
+
userAuths
);
throw
new
ServiceException
(
"新旧密码不匹配"
);
}
else
{
// 新旧密码一致,修改密码
userAuths
.
setCredential
(
encoder
.
encode
(
userDto
.
getNewPassword
()));
...
...
@@ -382,6 +387,9 @@ public class UserService extends CrudService<UserMapper, User> {
return
null
;
// 查询用户信息
User
user
=
this
.
get
(
userAuths
.
getUserId
());
if
(
user
.
getStatus
().
equals
(
1
)){
throw
new
ServiceException
(
"该用户已被禁用"
);
}
if
(
user
==
null
)
return
null
;
// 查询用户角色
...
...
modules/user-service-parent/user-service/src/main/resources/mapper/LogMapper.xml
View file @
7456c507
...
...
@@ -42,7 +42,13 @@
a.application_code,
a.tenant_code
</sql>
<!-- where 条件 -->
<sql
id=
"whereColumnList"
>
<if
test=
"title != null and title != ''"
>
and a.title like CONCAT('%', #{title},'%')
</if>
</sql>
<select
id=
"getById"
resultMap=
"logResultMap"
>
SELECT
<include
refid=
"logColumns"
/>
...
...
@@ -61,7 +67,9 @@
SELECT
<include
refid=
"logColumns"
/>
FROM sys_log a
WHERE a.del_flag = 0 order by a.create_date desc
WHERE a.del_flag = 0
<include
refid=
"whereColumnList"
/>
order by a.create_date desc
</select>
<insert
id=
"insert"
>
...
...
modules/user-service-parent/user-service/src/main/resources/mapper/TenantMapper.xml
View file @
7456c507
...
...
@@ -27,6 +27,12 @@
a.del_flag
</sql>
<!-- where 条件 -->
<sql
id=
"whereColumnList"
>
<if
test=
"tenantCode != null and tenantCode != ''"
>
and a.tenant_code like CONCAT('%', #{tenantCode},'%')
</if>
</sql>
<select
id=
"getById"
resultMap=
"tenantResultMap"
>
SELECT
<include
refid=
"tenantColumns"
/>
...
...
@@ -53,6 +59,7 @@
<include
refid=
"tenantColumns"
/>
FROM sys_tenant a
WHERE a.del_flag = 0
<include
refid=
"whereColumnList"
/>
</select>
<select
id=
"findListById"
resultMap=
"tenantResultMap"
>
...
...
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