Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
E
education
Project
Project
Details
Activity
Releases
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
李丛阳
education
Commits
14fbc593
Commit
14fbc593
authored
Oct 16, 2019
by
root
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/meiteng' into meiteng
parents
cebee36d
c16bccbb
Changes
15
Hide whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
86 additions
and
46 deletions
+86
-46
BChapterController.java
...soft/business/bchapter/controller/BChapterController.java
+2
-5
BChapterServiceImpl.java
...t/business/bchapter/service/impl/BChapterServiceImpl.java
+20
-4
BRStudentChapterRepository.java
...ness/brstudentchapter/dao/BRStudentChapterRepository.java
+8
-0
BRStudentChapterServiceImpl.java
...dentchapter/service/impl/BRStudentChapterServiceImpl.java
+6
-6
ContactFeignClient.java
...g/rcisoft/common/util/feignClient/ContactFeignClient.java
+1
-3
MTCotactApiRequestClient.java
...isoft/common/util/outClient/MTCotactApiRequestClient.java
+1
-1
SysRoleController.java
...va/org/rcisoft/sys/role/controller/SysRoleController.java
+3
-3
SysRoleRepository.java
...main/java/org/rcisoft/sys/role/dao/SysRoleRepository.java
+3
-2
SysRoleService.java
...ain/java/org/rcisoft/sys/role/service/SysRoleService.java
+4
-3
SysRoleServiceImpl.java
...org/rcisoft/sys/role/service/impl/SysRoleServiceImpl.java
+5
-4
SysUser.java
src/main/java/org/rcisoft/sys/user/entity/SysUser.java
+0
-1
SysUserServiceImpl.java
...org/rcisoft/sys/user/service/impl/SysUserServiceImpl.java
+25
-7
application-dev.yml
src/main/resources/application-dev.yml
+6
-5
application-prod.yml
src/main/resources/application-prod.yml
+1
-1
application.yml
src/main/resources/application.yml
+1
-1
No files found.
src/main/java/org/rcisoft/business/bchapter/controller/BChapterController.java
View file @
14fbc593
...
...
@@ -33,10 +33,7 @@ import org.rcisoft.sys.role.dao.SysRoleRepository;
import
org.rcisoft.sys.user.bean.CurUser
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.validation.BindingResult
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.multipart.MultipartFile
;
import
javax.servlet.http.HttpServletRequest
;
...
...
@@ -116,7 +113,7 @@ public class BChapterController extends PaginationController<BChapter> {
}
@ApiOperation
(
value
=
"205 查询章节带进度"
,
notes
=
"根据lessonId查询章节带进度"
,
response
=
QueryChapterListResDTO
.
class
)
@GetMapping
(
value
=
"/queryBChaptersWithProgress"
)
public
Result
queryBChaptersWithProgress
(
CurUser
curUser
,
@Valid
String
lessonId
,
BindingResult
br
)
{
public
Result
queryBChaptersWithProgress
(
CurUser
curUser
,
@RequestParam
String
lessonId
,
BindingResult
br
)
{
Map
<
String
,
Object
>
map
=
new
HashedMap
();
return
Result
.
builder
(
new
PersistModel
(
1
),
MessageConstant
.
MESSAGE_ALERT_SUCCESS
,
...
...
src/main/java/org/rcisoft/business/bchapter/service/impl/BChapterServiceImpl.java
View file @
14fbc593
...
...
@@ -40,6 +40,7 @@ import java.io.*;
import
java.nio.file.Files
;
import
java.nio.file.Path
;
import
java.nio.file.Paths
;
import
java.text.DecimalFormat
;
import
java.util.ArrayList
;
import
java.util.HashMap
;
import
java.util.List
;
...
...
@@ -98,16 +99,31 @@ public class BChapterServiceImpl implements BChapterService {
model
.
setLessonId
(
lessonId
);
model
.
setStudentId
(
curUser
.
getUserId
());
List
<
QueryChapterListResDTO
>
queryChapterListResDTOS
=
queryChapterListResDTO
(
model
,
curUser
.
getCorpId
());
queryChapterListResDTOS
.
stream
().
forEach
(
queryChapterListResDTO
->
{
queryChapterListResDTO
.
getChildList
().
stream
().
forEach
(
childList
->
{
int
i
=
0
;
int
percent
=
0
;
for
(
QueryChapterListResDTO
queryChapterListResDTO:
queryChapterListResDTOS
){
for
(
QueryChapterListResDTO
childList:
queryChapterListResDTO
.
getChildList
()){
List
<
BRStudentChapter
>
brStudentChapterList
=
brStudentChapterRepository
.
queryByStuIdAndChapter
(
childList
.
getBusinessId
(),
curUser
.
getUserId
());
if
(
null
!=
brStudentChapterList
&&
brStudentChapterList
.
size
()
>
0
)
{
childList
.
setProgress
(
brStudentChapterList
.
get
(
0
).
getProgress
());
String
temp
=
brStudentChapterList
.
get
(
0
).
getProgress
().
substring
(
0
,
brStudentChapterList
.
get
(
0
).
getProgress
().
length
()-
1
);
percent
+=
Float
.
valueOf
(
temp
);
}
});
});
i
++;
}
}
// queryChapterListResDTOS.stream().forEach(queryChapterListResDTO -> {
// queryChapterListResDTO.getChildList().stream().forEach(childList -> {
// List<BRStudentChapter> brStudentChapterList = brStudentChapterRepository.queryByStuIdAndChapter(childList.getBusinessId(), curUser.getUserId());
// if (null != brStudentChapterList && brStudentChapterList.size() > 0) {
// childList.setProgress(brStudentChapterList.get(0).getProgress());
// }
// });
// });
Map
map
=
new
HashMap
();
DecimalFormat
df
=
new
DecimalFormat
(
"0.00"
);
//设置保留位数
map
.
put
(
"chapterList"
,
queryChapterListResDTOS
);
map
.
put
(
"totalProgress"
,
df
.
format
((
float
)
percent
/
i
)
+
"%"
);
map
.
put
(
"lessonInfo"
,
bLessonRepository
.
selectByPrimaryKey
(
model
.
getLessonId
()));
return
map
;
}
...
...
src/main/java/org/rcisoft/business/brstudentchapter/dao/BRStudentChapterRepository.java
View file @
14fbc593
package
org
.
rcisoft
.
business
.
brstudentchapter
.
dao
;
import
org.apache.ibatis.annotations.Param
;
import
org.apache.ibatis.annotations.Update
;
import
org.rcisoft.business.brstudentchapter.dto.BRStudentChapterDto
;
import
org.rcisoft.core.base.BaseMapper
;
import
org.rcisoft.business.brstudentchapter.entity.BRStudentChapter
;
...
...
@@ -38,5 +39,12 @@ public interface BRStudentChapterRepository extends BaseMapper<BRStudentChapter>
+
"</script>"
)
@ResultMap
(
value
=
"BRStudentChapterResultMap"
)
List
<
BRStudentChapter
>
queryByStuIdAndChapter
(
@Param
(
"chapterId"
)
String
chapterId
,
@Param
(
"studentId"
)
String
studentId
);
@Update
(
"UPDATE b_r_student_chapter "
+
"SET progress = #{progress} "
+
"WHERE "
+
" business_id = #{businessId} "
)
@ResultMap
(
value
=
"BRStudentChapterResultMap"
)
int
updateById
(
BRStudentChapter
brStudentChapter
);
}
src/main/java/org/rcisoft/business/brstudentchapter/service/impl/BRStudentChapterServiceImpl.java
View file @
14fbc593
...
...
@@ -44,16 +44,16 @@ public class BRStudentChapterServiceImpl implements BRStudentChapterService {
public
PersistModel
save
(
BRStudentChapterDto
brStudentChapterDto
){
int
line
=
0
;
List
<
BRStudentChapter
>
brStudentChapterList
=
bRStudentChapterRepository
.
queryByStuIdAndChapter
(
brStudentChapterDto
.
getChapterId
(),
brStudentChapterDto
.
getStudentId
());
DecimalFormat
df
=
new
DecimalFormat
(
"0.00"
);
//设置保留位数
if
(
null
!=
brStudentChapterList
&&
brStudentChapterList
.
size
()
>
0
){
// DecimalFormat df=new DecimalFormat("0.00");//设置保留位数
// df.format((float)brStudentChapterDto.getCurrent()/brStudentChapterDto.getDuration());
BRStudentChapter
brStudentChapter
=
brStudentChapterList
.
get
(
0
);
if
(
brStudentChapterDto
.
getCurrent
()
==
brStudentChapterDto
.
getDuration
()){
// who finish
brStudentChapter
.
setProgress
(
"100%"
);
}
else
brStudentChapter
.
setProgress
(
brStudentChapterDto
.
getCurrent
()/
brStudentChapterDto
.
getDuration
()*
100
+
"%"
);
line
=
bRStudentChapterRepository
.
updateByPrimaryKey
(
brStudentChapter
);
}
else
{
brStudentChapter
.
setProgress
(
df
.
format
((
float
)
brStudentChapterDto
.
getCurrent
()/
brStudentChapterDto
.
getDuration
()*
100
)+
"%"
);
}
line
=
bRStudentChapterRepository
.
updateById
(
brStudentChapter
);
}
else
{
BRStudentChapter
brStudentChapter
=
new
BRStudentChapter
();
brStudentChapter
.
setBusinessId
(
IdGen
.
uuid
());
...
...
@@ -66,7 +66,7 @@ public class BRStudentChapterServiceImpl implements BRStudentChapterService {
}
else
{
brStudentChapter
.
setIsComplete
(
"0"
);
// brStudentChapter.setAutomatic("0");
brStudentChapter
.
setProgress
(
brStudentChapterDto
.
getCurrent
()/
brStudentChapterDto
.
getDuration
()*
100
+
"%"
);
brStudentChapter
.
setProgress
(
df
.
format
(
brStudentChapterDto
.
getCurrent
()/
brStudentChapterDto
.
getDuration
()*
100
)
+
"%"
);
}
line
=
bRStudentChapterRepository
.
insertSelective
(
brStudentChapter
);
}
...
...
src/main/java/org/rcisoft/common/util/feignClient/ContactFeignClient.java
View file @
14fbc593
...
...
@@ -3,8 +3,6 @@ package org.rcisoft.common.util.feignClient;
import
org.rcisoft.core.result.Ret
;
import
org.rcisoft.common.util.feignDto.*
;
import
org.springframework.cloud.openfeign.FeignClient
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.stereotype.Component
;
import
org.springframework.stereotype.Service
;
import
org.springframework.web.bind.annotation.*
;
...
...
@@ -13,7 +11,7 @@ import java.util.List;
/**
* 通讯录客户端接口
*/
@
Component
@
Service
@FeignClient
(
value
=
"ZX-CONTACT"
)
public
interface
ContactFeignClient
{
...
...
src/main/java/org/rcisoft/common/util/outClient/MTCotactApiRequestClient.java
View file @
14fbc593
...
...
@@ -41,7 +41,7 @@ public class MTCotactApiRequestClient {
@Autowired
private
ContactFeignClient
contactFeignClient
;
//
@Autowired
@Autowired
private
GateWayFeignClient
gateWayFeignClient
;
/**
...
...
src/main/java/org/rcisoft/sys/role/controller/SysRoleController.java
View file @
14fbc593
...
...
@@ -36,8 +36,8 @@ public class SysRoleController extends PaginationController<SysRole> {
@ApiOperation
(
value
=
"1001 分页查询角色"
,
notes
=
"分页查询角色"
)
@GetMapping
(
value
=
"/queryRoles"
)
public
GridModel
queryRolesByPagination
(
CurUser
curUser
,
@Valid
FindRolePaginDTO
findRolePaginDTO
,
BindingResult
bindingResult
){
sysRoleServiceImpl
.
queryRolesByPagination
(
getPaginationUtility
(),
findRolePaginDTO
);
public
GridModel
queryRolesByPagination
(
CurUser
curUser
){
sysRoleServiceImpl
.
queryRolesByPagination
(
getPaginationUtility
(),
curUser
.
getCorpId
()
);
GridModel
gridModel
=
getGridModelResponse
();
return
gridModel
;
}
...
...
@@ -48,7 +48,7 @@ public class SysRoleController extends PaginationController<SysRole> {
return
Result
.
builder
(
new
PersistModel
(
1
),
MessageConstant
.
MESSAGE_ALERT_SUCCESS
,
MessageConstant
.
MESSAGE_ALERT_ERROR
,
sysRoleServiceImpl
.
queryRolesAll
());
sysRoleServiceImpl
.
queryRolesAll
(
curUser
.
getCorpId
()
));
}
...
...
src/main/java/org/rcisoft/sys/role/dao/SysRoleRepository.java
View file @
14fbc593
...
...
@@ -29,10 +29,11 @@ public interface SysRoleRepository extends BaseMapper<SysRole> {
*/
@Select
(
"<script>select * from tm_admin_role "
+
"where r_status = 1 "
+
"and r_id not in ('主管理员','子管理员') "
+
"and r_name not in ('主管理员','子管理员') "
+
"and corp_id = #{corpId} "
+
" order by r_name desc </script>"
)
@ResultMap
(
value
=
"SelectAllAndUserNum"
)
List
<
SysRole
>
queryRoles
();
List
<
SysRole
>
queryRoles
(
@Param
(
"corpId"
)
String
corpId
);
//获得此角色的用户数
int
countUserNum
(
String
roleId
);
...
...
src/main/java/org/rcisoft/sys/role/service/SysRoleService.java
View file @
14fbc593
...
...
@@ -7,6 +7,7 @@ import org.rcisoft.core.model.PersistModel;
import
org.rcisoft.sys.dept.entity.DeptRole
;
import
org.rcisoft.sys.role.dto.*
;
import
org.rcisoft.sys.role.entity.SysRole
;
import
org.rcisoft.sys.user.bean.CurUser
;
import
java.util.List
;
...
...
@@ -39,13 +40,13 @@ public interface SysRoleService {
/**
* 分页查询角色
* @param pageUtil
* @param
findRolePaginDTO
* @param
corpId
* @return
*/
List
<
SysRole
>
queryRolesByPagination
(
PageUtil
pageUtil
,
FindRolePaginDTO
findRolePaginDTO
);
List
<
SysRole
>
queryRolesByPagination
(
PageUtil
pageUtil
,
String
corpId
);
List
<
SysRole
>
queryRolesAll
();
List
<
SysRole
>
queryRolesAll
(
String
corpId
);
//select
List
<
SysRole
>
queryRolesSelect
(
SysRole
sysRole
);
...
...
src/main/java/org/rcisoft/sys/role/service/impl/SysRoleServiceImpl.java
View file @
14fbc593
...
...
@@ -13,6 +13,7 @@ import org.rcisoft.sys.role.dao.SysRoleRepository;
import
org.rcisoft.sys.role.dto.*
;
import
org.rcisoft.sys.role.entity.SysRole
;
import
org.rcisoft.sys.role.service.SysRoleService
;
import
org.rcisoft.sys.user.bean.CurUser
;
import
org.rcisoft.sys.user.dao.SysUserMapper
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
...
@@ -89,21 +90,21 @@ public class SysRoleServiceImpl implements SysRoleService {
}
@Override
public
List
<
SysRole
>
queryRolesByPagination
(
PageUtil
pageUtil
,
FindRolePaginDTO
findRolePaginDTO
)
{
public
List
<
SysRole
>
queryRolesByPagination
(
PageUtil
pageUtil
,
String
corpId
)
{
// SysRole sysRole = new SysRole();
// BeanUtils.copyProperties(findRolePaginDTO,sysRole);
// sysRole.setNotDeleted();
// sysRole.setStart();
return
sysRoleRepository
.
queryRoles
();
return
sysRoleRepository
.
queryRoles
(
corpId
);
}
@Override
public
List
<
SysRole
>
queryRolesAll
()
{
public
List
<
SysRole
>
queryRolesAll
(
String
corpId
)
{
// SysRole sysRole = new SysRole();
// BeanUtils.copyProperties(findRolePaginDTO,sysRole);
// sysRole.setNotDeleted();
// sysRole.setStart();
return
sysRoleRepository
.
queryRoles
();
return
sysRoleRepository
.
queryRoles
(
corpId
);
}
@Override
...
...
src/main/java/org/rcisoft/sys/user/entity/SysUser.java
View file @
14fbc593
...
...
@@ -49,7 +49,6 @@ public class SysUser extends IdEntity<SysUser> {
private
String
gitLabId
;
//gitLab账号id
private
String
gitLabUsername
;
//gitLab账号
private
String
gitLabImpressionToken
;
//gitLab账号模拟令牌
@Transient
private
String
depart
;
@Transient
...
...
src/main/java/org/rcisoft/sys/user/service/impl/SysUserServiceImpl.java
View file @
14fbc593
...
...
@@ -120,10 +120,7 @@ public class SysUserServiceImpl implements SysUserService {
userRoles
.
add
(
userRole
);
}
}
result
+=
sysUserMapper
.
insertUserRoleById
(
userRoles
);
if
(
result
>
0
)
{
return
1
;
}
result
=
sysUserMapper
.
insertUserRoleById
(
userRoles
);
}
return
0
;
}
...
...
@@ -174,7 +171,28 @@ public class SysUserServiceImpl implements SysUserService {
@Override
public
List
<
QueryMenuResDTO
>
queryMenusById
(
String
corpId
,
String
id
,
String
modelId
)
{
return
sysUserMapper
.
queryMenus
(
corpId
,
id
,
modelId
);
List
<
QueryMenuResDTO
>
menus
=
sysUserMapper
.
queryMenus
(
corpId
,
id
,
modelId
);
String
[]
strings
=
new
String
[]{
"题库管理"
,
"试卷管理"
,
"统计分析"
};
QueryMenuResDTO
newMenu
=
new
QueryMenuResDTO
();
newMenu
.
setMenuName
(
"在线考试"
);
newMenu
.
setHref
(
"newTest"
);
newMenu
.
setMenuId
(
"000"
);
int
size
=
menus
.
size
();
for
(
String
str
:
strings
)
{
for
(
QueryMenuResDTO
menu
:
menus
)
{
if
(
menu
.
getMenuName
().
equals
(
str
))
{
menus
.
add
(
newMenu
);
break
;
}
}
if
(
size
<
menus
.
size
()){
break
;
}
}
return
menus
;
}
@Override
...
...
@@ -263,7 +281,7 @@ public class SysUserServiceImpl implements SysUserService {
}
String
updateTime
=
df
.
format
(
synchronizationTime
.
getSynchronizationTime
());
List
<
GetAllRspDTO
>
userGetRspDTOList
=
mtCotactApiRequestClient
.
accountGetMyInfoList
(
corpId
,
updateTime
);
if
(
null
==
userGetRspDTOList
){
if
(
null
==
userGetRspDTOList
)
{
throw
new
ServiceException
(
ResultServiceEnums
.
ZX_FAILED
);
}
List
<
SysUser
>
personnelsList
=
new
ArrayList
<>();
...
...
@@ -295,7 +313,7 @@ public class SysUserServiceImpl implements SysUserService {
@Override
public
MyInfoDTO
queryMyInfo
(
CurUser
curUser
)
{
MyInfoDTO
myInfoDTOCount
=
sysUserMapper
.
queryMyLessonCount
(
curUser
);
MyInfoDTO
myInfoDTO
=
sysUserMapper
.
queryMyInfo
(
curUser
);
MyInfoDTO
myInfoDTO
=
sysUserMapper
.
queryMyInfo
(
curUser
);
myInfoDTO
.
setLessonCount
(
myInfoDTOCount
.
getLessonCount
());
myInfoDTO
.
setTrainCount
(
myInfoDTOCount
.
getTrainCount
());
myInfoDTO
.
setNotFinishedExam
(
myInfoDTOCount
.
getNotFinishedExam
());
...
...
src/main/resources/application-dev.yml
View file @
14fbc593
...
...
@@ -5,7 +5,7 @@ server:
servlet
:
context-path
:
/
#uri-encoding: UTF-8
type
:
dev
1
type
:
dev
maxHttpHeaderSize
:
102400
#logging:
...
...
@@ -14,22 +14,20 @@ server:
# org.springframework.web: DEBUG
druid
:
url
:
jdbc:mysql://127.0.0.1:330
7/edu_db2
?useUnicode=true&characterEncoding=UTF-8&zeroDateTimeBehavior=convertToNull&allowMultiQueries=true&useSSL=false
url
:
jdbc:mysql://127.0.0.1:330
6/mt
?useUnicode=true&characterEncoding=UTF-8&zeroDateTimeBehavior=convertToNull&allowMultiQueries=true&useSSL=false
# url: jdbc:mysql://10.96.131.16:55558/edu_db?useUnicode=true&characterEncoding=UTF-8&zeroDateTimeBehavior=convertToNull&allowMultiQueries=true&useSSL=false
#url: jdbc:mysql://120.52.179.75:13318/edu_db?useUnicode=true&characterEncoding=UTF-8&zeroDateTimeBehavior=convertToNull&allowMultiQueries=true&useSSL=false
username
:
root
# password: 91isoft
password
:
123456
password
:
root
initial-size
:
1
min-idle
:
1
max-active
:
20
test-on-borrow
:
true
mybatis
:
mapper-locations
:
classpath:mapper/**/**/*.xml
mapper
:
mappers
:
-
org.rcisoft.core.base.BaseMapper
...
...
@@ -60,6 +58,8 @@ spring:
multipart
:
max-file-size
:
100MB
max-request-size
:
100MB
application
:
name
:
zx-education
global
:
lk
:
...
...
@@ -91,6 +91,7 @@ libreoffice:
ip
:
192.168.1.125
port
:
10188
mt
:
# api: http://192.168.5.41/api/
api
:
http://221.239.114.20:6789/api/
...
...
src/main/resources/application-prod.yml
View file @
14fbc593
...
...
@@ -99,4 +99,4 @@ eureka:
register-with-eureka
:
true
fetch-registry
:
true
service-url
:
defaultZone
:
http://zx:zgiot@192.168.5.48:7001/eureka/
\ No newline at end of file
defaultZone
:
http://zx:zgiot@192.168.5.48:7001/eureka
src/main/resources/application.yml
View file @
14fbc593
spring
:
profiles
:
# active: dev
active
:
prod
# active: prod
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