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
c5eec4d0
Commit
c5eec4d0
authored
Nov 14, 2019
by
zhangqingle
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/meiteng' into zql
parents
e6864226
93eb912d
Changes
17
Hide whitespace changes
Inline
Side-by-side
Showing
17 changed files
with
336 additions
and
50 deletions
+336
-50
MenuDTO.java
.../java/org/rcisoft/business/bexternallink/dto/MenuDTO.java
+15
-0
BPersonValueController.java
...iness/bpersonvalue/controller/BPersonValueController.java
+11
-10
BPersonValue.java
...rg/rcisoft/business/bpersonvalue/entity/BPersonValue.java
+1
-1
BPersonValueService.java
...ft/business/bpersonvalue/service/BPersonValueService.java
+1
-7
BPersonValueServiceImpl.java
...ss/bpersonvalue/service/impl/BPersonValueServiceImpl.java
+1
-1
BReleaseValueController.java
...ess/breleasevalue/controller/BReleaseValueController.java
+45
-5
BReleaseValueRepository.java
...t/business/breleasevalue/dao/BReleaseValueRepository.java
+83
-3
LessonValueDto.java
...rg/rcisoft/business/breleasevalue/dto/LessonValueDto.java
+17
-0
UserValueDto.java
.../org/rcisoft/business/breleasevalue/dto/UserValueDto.java
+17
-0
BReleaseValueService.java
.../business/breleasevalue/service/BReleaseValueService.java
+7
-0
BReleaseValueServiceImpl.java
.../breleasevalue/service/impl/BReleaseValueServiceImpl.java
+101
-18
SysMenuRepository.java
...main/java/org/rcisoft/sys/menu/dao/SysMenuRepository.java
+1
-0
SysUserController.java
...va/org/rcisoft/sys/user/controller/SysUserController.java
+4
-3
SysUserMapper.java
src/main/java/org/rcisoft/sys/user/dao/SysUserMapper.java
+9
-0
SysUserService.java
...ain/java/org/rcisoft/sys/user/service/SysUserService.java
+1
-1
SysUserServiceImpl.java
...org/rcisoft/sys/user/service/impl/SysUserServiceImpl.java
+11
-1
BReleaseValueMapper.xml
...per/business/breleasevalue/mapper/BReleaseValueMapper.xml
+11
-0
No files found.
src/main/java/org/rcisoft/business/bexternallink/dto/MenuDTO.java
0 → 100644
View file @
c5eec4d0
package
org
.
rcisoft
.
business
.
bexternallink
.
dto
;
import
lombok.Data
;
@Data
public
class
MenuDTO
{
public
String
menuName
;
public
String
href
;
public
String
url
;
public
String
logo
;
}
src/main/java/org/rcisoft/business/bpersonvalue/controller/BPersonValueController.java
View file @
c5eec4d0
...
...
@@ -5,8 +5,10 @@ package org.rcisoft.business.bpersonvalue.controller;
import
io.swagger.annotations.ApiImplicitParam
;
import
io.swagger.annotations.ApiImplicitParams
;
import
io.swagger.annotations.ApiOperation
;
import
org.rcisoft.business.bbanner.entity.BBanner
;
import
org.rcisoft.common.controller.PaginationController
;
import
org.rcisoft.common.model.GridModel
;
import
org.rcisoft.sys.user.bean.CurUser
;
import
org.springframework.validation.BindingResult
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.*
;
...
...
@@ -36,16 +38,15 @@ public class BPersonValueController extends PaginationController<BPersonValue> {
private
BPersonValueService
bPersonValueServiceImpl
;
@ApiOperation
(
value
=
"添加"
,
notes
=
"添加"
)
//@ApiImplicitParams({@ApiImplicitParam(name = "businessId", value = "businessId", required = false, dataType = "varchar")})
@PostMapping
(
value
=
"/add"
)
public
Result
add
(
@Valid
BPersonValue
bPersonValue
,
BindingResult
bindingResult
)
{
PersistModel
data
=
bPersonValueServiceImpl
.
save
(
bPersonValue
);
return
Result
.
builder
(
data
,
MessageConstant
.
MESSAGE_ALERT_SUCCESS
,
MessageConstant
.
MESSAGE_ALERT_ERROR
,
bPersonValue
);
@ApiOperation
(
value
=
"1601 明细"
,
notes
=
"明细"
,
response
=
BBanner
.
class
)
@GetMapping
(
value
=
"/queryByPagination"
)
public
Result
queryByPagination
(
CurUser
curUser
,
String
businessId
)
{
bPersonValueServiceImpl
.
queryByPagination
(
getPaginationUtility
(),
curUser
.
getCorpId
(),
businessId
);
GridModel
gridModel
=
getGridModelResponse
();
return
Result
.
builder
(
new
PersistModel
(
1
),
MessageConstant
.
MESSAGE_ALERT_SUCCESS
,
MessageConstant
.
MESSAGE_ALERT_ERROR
,
gridModel
);
}
}
src/main/java/org/rcisoft/business/bpersonvalue/entity/BPersonValue.java
View file @
c5eec4d0
...
...
@@ -21,6 +21,7 @@ import java.util.List;
public
class
BPersonValue
extends
IdEntity
<
BPersonValue
>
{
private
String
userId
;
private
String
event
;
...
...
@@ -28,6 +29,5 @@ public class BPersonValue extends IdEntity<BPersonValue> {
private
String
type
;
}
src/main/java/org/rcisoft/business/bpersonvalue/service/BPersonValueService.java
View file @
c5eec4d0
...
...
@@ -11,12 +11,6 @@ import java.util.List;
*/
public
interface
BPersonValueService
{
/**
* 保存
* @param bPersonValue
* @return
*/
PersistModel
save
(
BPersonValue
bPersonValue
);
List
<
BPersonValue
>
queryByPagination
(
PageUtil
pageUtil
,
String
corpId
,
String
businessId
);
}
src/main/java/org/rcisoft/business/bpersonvalue/service/impl/BPersonValueServiceImpl.java
View file @
c5eec4d0
...
...
@@ -31,7 +31,7 @@ public class BPersonValueServiceImpl implements BPersonValueService {
@Override
public
PersistModel
save
(
BPersonValue
bPersonValue
)
{
public
List
<
BPersonValue
>
queryByPagination
(
PageUtil
pageUtil
,
String
corpId
,
String
businessId
)
{
return
null
;
}
}
src/main/java/org/rcisoft/business/breleasevalue/controller/BReleaseValueController.java
View file @
c5eec4d0
...
...
@@ -34,7 +34,7 @@ import java.util.List;
/**
* Created by on 2019-11-13 13:28:39.
*/
@Api
(
tags
=
"发布积分"
)
@Api
(
tags
=
"
15
发布积分"
)
@RestController
@RequestMapping
(
"breleasevalue"
)
@Slf4j
...
...
@@ -43,7 +43,7 @@ public class BReleaseValueController extends PaginationController<BReleaseValue>
@Autowired
private
BReleaseValueService
bReleaseValueServiceImpl
;
@ApiOperation
(
value
=
"分页查询"
,
notes
=
"根据条件分页查询"
,
response
=
BBanner
.
class
)
@ApiOperation
(
value
=
"
1501
分页查询"
,
notes
=
"根据条件分页查询"
,
response
=
BBanner
.
class
)
@GetMapping
(
value
=
"/queryByPagination"
)
public
Result
queryByPagination
(
CurUser
curUser
)
{
bReleaseValueServiceImpl
.
queryByPagination
(
getPaginationUtility
(),
curUser
.
getCorpId
());
...
...
@@ -54,9 +54,9 @@ public class BReleaseValueController extends PaginationController<BReleaseValue>
gridModel
);
}
@ApiOperation
(
value
=
"
添加"
,
notes
=
"添加
"
)
@ApiOperation
(
value
=
"
1502 添加、编辑"
,
notes
=
"添加编辑接口(businessId为空是添加)
"
)
@PostMapping
(
value
=
"/add"
)
public
Result
add
(
CurUser
u
ser
,
@Valid
BReleaseValueDto
bReleaseValueDto
,
BindingResult
bindingResult
)
{
public
Result
add
(
CurUser
curU
ser
,
@Valid
BReleaseValueDto
bReleaseValueDto
,
BindingResult
bindingResult
)
{
PersistModel
data
=
bReleaseValueServiceImpl
.
save
(
bReleaseValueDto
);
return
Result
.
builder
(
data
,
MessageConstant
.
MESSAGE_ALERT_SUCCESS
,
...
...
@@ -64,7 +64,7 @@ public class BReleaseValueController extends PaginationController<BReleaseValue>
bReleaseValueDto
);
}
@ApiOperation
(
value
=
"删除"
,
notes
=
"删除"
)
@ApiOperation
(
value
=
"
1503
删除"
,
notes
=
"删除"
)
@ApiImplicitParam
(
name
=
"businessId"
,
value
=
"主键id"
,
required
=
true
,
dataType
=
"varchar"
)
@PostMapping
(
value
=
"/delete"
)
public
Result
delete
(
CurUser
curUser
,
String
businessId
)
{
...
...
@@ -74,4 +74,44 @@ public class BReleaseValueController extends PaginationController<BReleaseValue>
MessageConstant
.
MESSAGE_ALERT_ERROR
,
businessId
);
}
@ApiOperation
(
value
=
"1504 分页查询课程、培训积分设置页面"
,
notes
=
"分页查询课程、培训积分设置页面"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"keyWord"
,
value
=
"模糊查询关键字"
,
required
=
true
,
dataType
=
"varchar"
),
@ApiImplicitParam
(
name
=
"type"
,
value
=
"0课程 1培训"
,
required
=
true
,
dataType
=
"varchar"
)})
@GetMapping
(
value
=
"/queryLessonValue"
)
public
Result
queryLessonValue
(
CurUser
curUser
,
String
keyWord
,
String
type
)
{
bReleaseValueServiceImpl
.
queryLessonValueByPagination
(
getPaginationUtility
(),
keyWord
,
curUser
.
getCorpId
(),
type
);
GridModel
gridModel
=
getGridModelResponse
();
return
Result
.
builder
(
new
PersistModel
(
1
),
MessageConstant
.
MESSAGE_ALERT_SUCCESS
,
MessageConstant
.
MESSAGE_ALERT_ERROR
,
gridModel
);
}
@ApiOperation
(
value
=
"1505 编辑课程、培训积分"
,
notes
=
"编辑课程、培训积分"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"businessId"
,
value
=
"主键id"
,
required
=
true
,
dataType
=
"varchar"
),
@ApiImplicitParam
(
name
=
"valueConsume"
,
value
=
"课程、培训 消耗积分"
,
required
=
true
,
dataType
=
"varchar"
),
@ApiImplicitParam
(
name
=
"valueGain"
,
value
=
"课程、培训 获得积分"
,
required
=
true
,
dataType
=
"varchar"
)})
@PostMapping
(
value
=
"/updateLessonValue"
)
public
Result
updateLessonValue
(
CurUser
curUser
,
String
businessId
,
String
valueConsume
,
String
valueGain
)
{
PersistModel
data
=
bReleaseValueServiceImpl
.
updateLessonValue
(
businessId
,
valueConsume
,
valueGain
);
return
Result
.
builder
(
data
,
MessageConstant
.
MESSAGE_ALERT_SUCCESS
,
MessageConstant
.
MESSAGE_ALERT_ERROR
,
businessId
);
}
@ApiOperation
(
value
=
"1504 分页查询 用户积分设置页面"
,
notes
=
"分页查询 用户积分设置页面"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"name"
,
value
=
"模糊查询关键字"
,
required
=
true
,
dataType
=
"varchar"
),
@ApiImplicitParam
(
name
=
"dept"
,
value
=
"部门id"
,
required
=
true
,
dataType
=
"varchar"
)})
@GetMapping
(
value
=
"/queryUserValue"
)
public
Result
queryUserValue
(
CurUser
curUser
,
String
name
,
String
dept
)
{
bReleaseValueServiceImpl
.
queryUserValueByPagination
(
getPaginationUtility
(),
name
,
curUser
.
getCorpId
(),
dept
);
GridModel
gridModel
=
getGridModelResponse
();
return
Result
.
builder
(
new
PersistModel
(
1
),
MessageConstant
.
MESSAGE_ALERT_SUCCESS
,
MessageConstant
.
MESSAGE_ALERT_ERROR
,
gridModel
);
}
}
src/main/java/org/rcisoft/business/breleasevalue/dao/BReleaseValueRepository.java
View file @
c5eec4d0
package
org
.
rcisoft
.
business
.
breleasevalue
.
dao
;
import
org.apache.ibatis.annotations.*
;
import
org.rcisoft.business.breleasevalue.dto.LessonValueDto
;
import
org.rcisoft.business.breleasevalue.dto.UserValueDto
;
import
org.rcisoft.business.breleasevalue.entity.BReleaseValueSon
;
import
org.rcisoft.core.base.BaseMapper
;
import
org.rcisoft.business.breleasevalue.entity.BReleaseValue
;
...
...
@@ -23,7 +25,11 @@ public interface BReleaseValueRepository extends BaseMapper<BReleaseValue> {
@ResultMap
(
value
=
"BaseResultMap"
)
List
<
BReleaseValue
>
queryBReleaseValues
(
String
corpId
);
/**
* 插入子表
* @param list
* @return
*/
@Insert
(
"<script>"
+
"insert into b_release_value_son (business_id,release_id,user_id) VALUES "
+
"<foreach collection=\"list\" item=\"item\" separator=\",\">"
+
...
...
@@ -34,15 +40,89 @@ public interface BReleaseValueRepository extends BaseMapper<BReleaseValue> {
@Update
(
"update b_release_value set del_flag= 1 where business_id = #{releaseId} and corp_id = #{corpId}"
)
int
remove
(
@Param
(
"releaseId"
)
String
releaseId
,
@Param
(
"corpId"
)
String
corpId
);
@Delete
(
"delete from b_release_value_son where user_id = #{userId}"
)
int
deleteSonForUserId
(
@Param
(
"userId"
)
String
userId
);
/**
* 根据用户名删除子表中相关数据
* @param userId
* @return
*/
@Delete
(
"<script><foreach collection=\"userId\" item=\"item\" separator=\";\">"
+
" delete from b_release_value_son where user_id = #{item}"
+
"</foreach></script>"
)
int
deleteSonForUserId
(
@Param
(
"userId"
)
String
[]
userId
);
/**
* 根据releaseId删除子表中相关数据
* @param releaseId
* @return
*/
@Delete
(
"delete from b_release_value_son where release_id = #{releaseId}"
)
int
deleteSonForReleaseId
(
@Param
(
"releaseId"
)
String
releaseId
);
/**
* xml中查询关联用
* @param releaseId
* @return
*/
@Select
(
" select su.name "
+
" from b_release_value_son rvs "
+
" left join s_user su on su.business_id = rvs.user_id "
+
" where rvs.release_id = #{releaseId} "
)
List
<
String
>
getNameforReleaseId
(
@Param
(
"releaseId"
)
String
releaseId
);
/**
* 查询课程或培训积分设置
* @param keyWord
* @param corpId
* @param type
* @return
*/
@Select
(
"<script> select bl.business_id businessId,bl.lesson_name lessonName,su.name name,bl.value_consume valueConsume,bl.value_gain valueGain "
+
" from b_lesson bl "
+
" left join s_user su on su.business_id = bl.lecturer_id "
+
" where bl.del_flag !=1 and bl.flag = 1 "
+
"<if test=\"keyWord!=null and keyWord != ''\"> "
+
" and bl.lesson_name like concat('%',#{keyWord},'%') or su.name like concat('%',#{keyWord},'%') </if>"
+
" and bl.corp_id = #{corpId} "
+
"and bl.lesson_type = #{type}</script>"
)
List
<
LessonValueDto
>
getLessonValue
(
@Param
(
"keyWord"
)
String
keyWord
,
@Param
(
"corpId"
)
String
corpId
,
@Param
(
"type"
)
String
type
);
/**
* 设置课程或培训 积分
* @param businessId
* @param valueConsume
* @param valueGain
* @return
*/
@Update
(
"update b_lesson set value_consume = #{valueConsume} ,value_gain = #{valueGain} where business_id = #{businessId}"
)
int
updateLessonValue
(
@Param
(
"businessId"
)
String
businessId
,
@Param
(
"valueConsume"
)
String
valueConsume
,
@Param
(
"valueGain"
)
String
valueGain
);
/**
* 查询用户积分信息
* @param name
* @param corpId
* @param userList
* @return
*/
@Select
(
"<script>select business_id, name , `value` "
+
" from s_user "
+
" where 1=1 "
+
" and del_flag !=1 "
+
" and flag = 1 "
+
" and corp_id = #{corpId} "
+
"<if test=\"name!=null and name != ''\"> and name like concat('%',#{name},'%')</if>"
+
"<if test=\"userList!=null and userList.size() > 0 \"> "
+
" and business_id in <foreach item='item' index='index' collection='userList' open='(' separator=',' close=')'> #{item} </foreach>"
+
"</if>"
+
" </script>"
)
@ResultMap
(
value
=
"UserValueDtoMap"
)
List
<
UserValueDto
>
getUserValue
(
@Param
(
"name"
)
String
name
,
@Param
(
"corpId"
)
String
corpId
,
@Param
(
"userList"
)
List
<
String
>
userList
);
/**
* xml中引用
* @param businessId
* @return
*/
@Select
(
"select sum(value) valueConsume from b_person_value where type = 1 and del_flag !=1 and flag = 1 and user_id = #{businessId}"
)
String
getValueConsume
(
@Param
(
"businessId"
)
String
businessId
);
}
src/main/java/org/rcisoft/business/breleasevalue/dto/LessonValueDto.java
0 → 100644
View file @
c5eec4d0
package
org
.
rcisoft
.
business
.
breleasevalue
.
dto
;
import
lombok.Data
;
@Data
public
class
LessonValueDto
{
public
String
businessId
;
public
String
lessonName
;
public
String
name
;
public
String
valueConsume
;
public
String
valueGain
;
}
src/main/java/org/rcisoft/business/breleasevalue/dto/UserValueDto.java
0 → 100644
View file @
c5eec4d0
package
org
.
rcisoft
.
business
.
breleasevalue
.
dto
;
import
lombok.Data
;
@Data
public
class
UserValueDto
{
public
String
businessId
;
public
String
dept
;
public
String
name
;
public
String
value
;
public
String
valueConsume
;
}
src/main/java/org/rcisoft/business/breleasevalue/service/BReleaseValueService.java
View file @
c5eec4d0
...
...
@@ -3,6 +3,8 @@ package org.rcisoft.business.breleasevalue.service;
import
org.rcisoft.business.bbanner.dto.FindBannerPaginDTO
;
import
org.rcisoft.business.bbanner.entity.BBanner
;
import
org.rcisoft.business.breleasevalue.dto.BReleaseValueDto
;
import
org.rcisoft.business.breleasevalue.dto.LessonValueDto
;
import
org.rcisoft.business.breleasevalue.dto.UserValueDto
;
import
org.rcisoft.business.breleasevalue.entity.BReleaseValue
;
import
org.rcisoft.core.model.PersistModel
;
import
org.rcisoft.core.aop.PageUtil
;
...
...
@@ -20,4 +22,9 @@ public interface BReleaseValueService {
PersistModel
delete
(
String
businessId
,
String
corpId
);
List
<
LessonValueDto
>
queryLessonValueByPagination
(
PageUtil
pageUtil
,
String
keyWord
,
String
corpId
,
String
LessonType
);
PersistModel
updateLessonValue
(
String
businessId
,
String
valueConsume
,
String
valueGain
);
List
<
UserValueDto
>
queryUserValueByPagination
(
PageUtil
pageUtil
,
String
name
,
String
corpId
,
String
dept
);
}
src/main/java/org/rcisoft/business/breleasevalue/service/impl/BReleaseValueServiceImpl.java
View file @
c5eec4d0
package
org
.
rcisoft
.
business
.
breleasevalue
.
service
.
impl
;
import
org.rcisoft.business.breleasevalue.dto.BReleaseValueDto
;
import
org.rcisoft.business.breleasevalue.dto.LessonValueDto
;
import
org.rcisoft.business.breleasevalue.dto.UserValueDto
;
import
org.rcisoft.business.breleasevalue.entity.BReleaseValueSon
;
import
org.rcisoft.common.util.feignDto.MTUserGetsReqDTO
;
import
org.rcisoft.common.util.feignDto.MTUserInfoRspDTO
;
import
org.rcisoft.common.util.outClient.MTCotactApiRequestClient
;
import
org.rcisoft.core.util.IdGen
;
import
org.rcisoft.core.util.UserUtil
;
import
org.rcisoft.core.aop.PageUtil
;
...
...
@@ -11,6 +16,7 @@ import org.rcisoft.business.breleasevalue.entity.BReleaseValue;
import
org.rcisoft.business.breleasevalue.service.BReleaseValueService
;
import
org.rcisoft.sys.user.entity.SysUser
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
...
...
@@ -20,7 +26,10 @@ import org.springframework.transaction.annotation.Transactional;
import
java.util.ArrayList
;
import
java.util.HashSet
;
import
java.util.List
;
import
java.util.Set
;
import
lombok.extern.slf4j.Slf4j
;
/**
...
...
@@ -34,37 +43,29 @@ public class BReleaseValueServiceImpl implements BReleaseValueService {
@Autowired
private
BReleaseValueRepository
bReleaseValueRepository
;
@Autowired
MTCotactApiRequestClient
mtCotactApiRequestClient
;
@Override
public
PersistModel
save
(
BReleaseValueDto
bReleaseValueDto
)
{
if
(
bReleaseValueDto
.
getBusinessId
()
!=
null
){
//
编辑
// 编辑
BReleaseValue
bReleaseValue
=
new
BReleaseValue
();
BeanUtils
.
copyProperties
(
bReleaseValueDto
,
bReleaseValue
);
UserUtil
.
setCurrentMergeOperation
(
bReleaseValue
);
int
line
=
bReleaseValueRepository
.
updateByPrimaryKeySelective
(
bReleaseValue
);
// 删除子表中的相关记录
bReleaseValueRepository
.
deleteSonForReleaseId
(
bReleaseValueDto
.
getBusinessId
());
this
.
splitUser
(
bReleaseValueDto
.
getUserIds
(),
bReleaseValueDto
.
getBusinessId
());
return
new
PersistModel
(
line
);
}
//新增
//新增
BReleaseValue
bReleaseValue
=
new
BReleaseValue
();
BeanUtils
.
copyProperties
(
bReleaseValueDto
,
bReleaseValue
);
UserUtil
.
setCurrentPersistOperation
(
bReleaseValue
);
String
[]
ids
=
bReleaseValueDto
.
getUserIds
().
split
(
","
);
List
<
BReleaseValueSon
>
list
=
new
ArrayList
<>();
if
(
ids
.
length
>
0
){
for
(
String
id
:
ids
){
BReleaseValueSon
bReleaseValueSon
=
new
BReleaseValueSon
();
bReleaseValueSon
.
setBusinessId
(
IdGen
.
uuid
());
bReleaseValueSon
.
setReleaseId
(
bReleaseValue
.
getBusinessId
());
bReleaseValueSon
.
setUserId
(
id
);
list
.
add
(
bReleaseValueSon
);
}
bReleaseValueRepository
.
insertIntoSon
(
list
);
}
this
.
splitUser
(
bReleaseValueDto
.
getUserIds
(),
bReleaseValue
.
getBusinessId
());
int
line
=
bReleaseValueRepository
.
insert
(
bReleaseValue
);
return
new
PersistModel
(
line
);
}
...
...
@@ -83,4 +84,86 @@ public class BReleaseValueServiceImpl implements BReleaseValueService {
bReleaseValueRepository
.
deleteSonForReleaseId
(
businessId
);
return
new
PersistModel
(
line
);
}
@Override
public
List
<
LessonValueDto
>
queryLessonValueByPagination
(
PageUtil
pageUtil
,
String
keyWord
,
String
corpId
,
String
LessonType
)
{
return
bReleaseValueRepository
.
getLessonValue
(
keyWord
,
corpId
,
LessonType
);
}
@Override
public
PersistModel
updateLessonValue
(
String
businessId
,
String
valueConsume
,
String
valueGain
)
{
int
line
=
bReleaseValueRepository
.
updateLessonValue
(
businessId
,
valueConsume
,
valueGain
);
return
new
PersistModel
(
line
);
}
@Override
public
List
<
UserValueDto
>
queryUserValueByPagination
(
PageUtil
pageUtil
,
String
name
,
String
corpId
,
String
dept
)
{
List
<
String
>
deptList
=
new
ArrayList
<>();
if
(
dept
!=
null
){
Set
<
String
>
deptSets
=
new
HashSet
<>();
deptSets
.
add
(
dept
);
deptList
=
mtCotactApiRequestClient
.
getSubUserIdsByDeptIds
(
corpId
,
deptSets
);
}
List
<
UserValueDto
>
users
=
bReleaseValueRepository
.
getUserValue
(
name
,
corpId
,
deptList
);
List
<
String
>
list
=
new
ArrayList
<>();
for
(
UserValueDto
user
:
users
)
{
list
.
add
(
user
.
getBusinessId
());
}
MTUserGetsReqDTO
mtUserGetsReqDTO
=
new
MTUserGetsReqDTO
();
mtUserGetsReqDTO
.
setCorpId
(
corpId
);
mtUserGetsReqDTO
.
setIds
(
list
);
List
<
MTUserInfoRspDTO
>
depart
=
mtCotactApiRequestClient
.
userGets
(
mtUserGetsReqDTO
);
if
(
depart
!=
null
)
{
StringBuffer
sb
=
new
StringBuffer
();
for
(
UserValueDto
dto
:
users
)
{
for
(
MTUserInfoRspDTO
mtUserInfoRspDTO
:
depart
)
{
if
(
dto
.
getBusinessId
().
equals
(
mtUserInfoRspDTO
.
getId
()))
{
if
(
mtUserInfoRspDTO
.
getDepts
()
!=
null
)
{
for
(
MTUserInfoRspDTO
.
DeptsBean
deptsBean
:
mtUserInfoRspDTO
.
getDepts
())
{
for
(
MTUserInfoRspDTO
.
DeptsBean
.
PathBean
pathBean
:
deptsBean
.
getPath
())
{
if
(
null
!=
pathBean
)
sb
.
append
(
pathBean
.
getName
()
+
"-"
);
}
}
}
if
(!
sb
.
toString
().
equals
(
""
))
{
String
string
=
sb
.
toString
().
substring
(
0
,
sb
.
toString
().
length
()
-
1
);
if
(
string
.
indexOf
(
"-"
)
!=
-
1
){
string
=
string
.
substring
(
string
.
indexOf
(
"-"
)+
1
);
}
dto
.
setDept
(
string
);
}
sb
=
new
StringBuffer
();
}
}
}
}
return
users
;
}
/**
* 去掉子表中已有用户信息,插入新的数据
* @param userIds
* @param businessId
*/
public
void
splitUser
(
String
userIds
,
String
businessId
){
String
[]
ids
=
userIds
.
split
(
","
);
// 删除子表中与当前选中用户相关的信息
bReleaseValueRepository
.
deleteSonForUserId
(
ids
);
//将关联信息插入子表
List
<
BReleaseValueSon
>
list
=
new
ArrayList
<>();
if
(
ids
.
length
>
0
){
for
(
String
id
:
ids
){
BReleaseValueSon
bReleaseValueSon
=
new
BReleaseValueSon
();
bReleaseValueSon
.
setBusinessId
(
IdGen
.
uuid
());
bReleaseValueSon
.
setReleaseId
(
businessId
);
bReleaseValueSon
.
setUserId
(
id
);
list
.
add
(
bReleaseValueSon
);
}
bReleaseValueRepository
.
insertIntoSon
(
list
);
}
}
}
src/main/java/org/rcisoft/sys/menu/dao/SysMenuRepository.java
View file @
c5eec4d0
...
...
@@ -2,6 +2,7 @@ package org.rcisoft.sys.menu.dao;
import
org.apache.ibatis.annotations.*
;
import
org.rcisoft.business.bexternallink.dto.MenuDTO
;
import
org.rcisoft.core.base.BaseMapper
;
import
org.rcisoft.sys.menu.entity.MenuDto
;
import
org.rcisoft.sys.menu.entity.SysMenu
;
...
...
src/main/java/org/rcisoft/sys/user/controller/SysUserController.java
View file @
c5eec4d0
...
...
@@ -138,13 +138,14 @@ public class SysUserController extends PaginationController<SysUser> {
}
@ApiOperation
(
value
=
"706 根据userId 查询菜单"
,
notes
=
"userId 和 modelId查询 menu"
)
@ApiImplicitParam
(
name
=
"modelId"
,
value
=
"前台菜单10 后台菜单20"
,
required
=
true
,
dataType
=
"varchar"
,
paramType
=
"path"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"modelId"
,
value
=
"前台菜单10 后台菜单20"
,
required
=
true
,
dataType
=
"varchar"
,
paramType
=
"path"
),
@ApiImplicitParam
(
name
=
"type"
,
value
=
"查总裁读书会菜单 客户端传2 手机端传0 不传查全部(modelId传 10) "
,
required
=
true
,
dataType
=
"varchar"
,
paramType
=
"path"
)})
@GetMapping
(
"/queryMenuById"
)
public
Result
queryMenu
(
CurUser
curUser
,
String
modelId
)
{
public
Result
queryMenu
(
CurUser
curUser
,
String
modelId
,
String
type
)
{
return
Result
.
builder
(
new
PersistModel
(
1
),
MessageConstant
.
MESSAGE_ALERT_SUCCESS
,
MessageConstant
.
MESSAGE_ALERT_ERROR
,
userServiceImpl
.
queryMenusById
(
curUser
,
modelId
));
userServiceImpl
.
queryMenusById
(
curUser
,
modelId
,
type
));
}
/**
...
...
src/main/java/org/rcisoft/sys/user/dao/SysUserMapper.java
View file @
c5eec4d0
...
...
@@ -3,6 +3,7 @@ package org.rcisoft.sys.user.dao;
import
org.apache.ibatis.annotations.*
;
import
org.rcisoft.business.bdictionary.entity.BDictionary
;
import
org.rcisoft.business.bexternallink.dto.MenuDTO
;
import
org.rcisoft.business.blesson.dto.RoleTypeDepartDTO
;
import
org.rcisoft.core.base.BaseMapper
;
import
org.rcisoft.sys.user.bean.CurUser
;
...
...
@@ -296,4 +297,12 @@ public interface SysUserMapper extends BaseMapper<SysUser> {
@Select
(
"select count(0) from s_user where del_flag != 1 and flag = 1 and corp_id = #{corpId} and business_id = #{userId}"
)
int
getUserflag
(
CurUser
curUser
);
@Select
(
"<script>select title menuName,external_url url,logo from b_external_link where 1=1 "
+
"<if test=\"type !=null \"> and type in ('1',${type}) </if>"
+
" and corp_id = #{corpId} "
+
" and del_flag !=1 and flag = 1 ORDER BY sort </script>"
)
List
<
MenuDTO
>
getReadingMenu
(
@Param
(
"type"
)
String
type
,
@Param
(
"corpId"
)
String
corpId
);
}
src/main/java/org/rcisoft/sys/user/service/SysUserService.java
View file @
c5eec4d0
...
...
@@ -36,7 +36,7 @@ public interface SysUserService {
List
<
SysMenu
>
queryUserMenus
(
CurUser
user
);
Object
queryMenusById
(
CurUser
curUser
,
String
modelId
);
Object
queryMenusById
(
CurUser
curUser
,
String
modelId
,
String
type
);
SysUser
getUserState
(
String
id
);
...
...
src/main/java/org/rcisoft/sys/user/service/impl/SysUserServiceImpl.java
View file @
c5eec4d0
...
...
@@ -4,6 +4,7 @@ import com.alibaba.fastjson.JSON;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.collections.map.HashedMap
;
import
org.apache.commons.lang.StringUtils
;
import
org.rcisoft.business.bexternallink.dto.MenuDTO
;
import
org.rcisoft.business.synchronizationtime.entity.SynchronizationTime
;
import
org.rcisoft.business.synchronizationtime.service.SynchronizationTimeService
;
import
org.rcisoft.common.component.Global
;
...
...
@@ -58,6 +59,8 @@ public class SysUserServiceImpl implements SysUserService {
@Autowired
MTCotactApiRequestClient
mtCotactApiRequestClient
;
@Autowired
private
Global
global
;
...
...
@@ -225,7 +228,7 @@ public class SysUserServiceImpl implements SysUserService {
}
@Override
public
Object
queryMenusById
(
CurUser
curUser
,
String
modelId
)
{
public
Object
queryMenusById
(
CurUser
curUser
,
String
modelId
,
String
type
)
{
//查询登录人启用状态
int
x
=
sysUserMapper
.
getUserflag
(
curUser
);
if
(
x
<
1
){
...
...
@@ -234,6 +237,13 @@ public class SysUserServiceImpl implements SysUserService {
map
.
put
(
"code"
,
400
);
return
map
;
}
if
(
"10"
.
equals
(
modelId
)){
List
<
MenuDTO
>
list
=
sysUserMapper
.
getReadingMenu
(
type
,
curUser
.
getCorpId
());
for
(
int
i
=
0
;
i
<
list
.
size
();
i
++){
list
.
get
(
i
).
setHref
(
"a"
+(
i
+
1
));
}
return
list
;
}
List
<
QueryMenuResDTO
>
menus
=
sysUserMapper
.
queryMenus
(
curUser
.
getCorpId
(),
curUser
.
getUserId
(),
modelId
);
String
[]
strings
=
new
String
[]{
"题库管理"
,
"试卷管理"
,
"统计分析"
};
...
...
src/main/resources/mapper/business/breleasevalue/mapper/BReleaseValueMapper.xml
View file @
c5eec4d0
...
...
@@ -20,5 +20,16 @@
</collection>
</resultMap>
<resultMap
id=
"UserValueDtoMap"
type=
"org.rcisoft.business.breleasevalue.dto.UserValueDto"
>
<id
column=
"business_id"
jdbcType=
"VARCHAR"
property=
"businessId"
/>
<result
column=
"dept"
jdbcType=
"INTEGER"
property=
"dept"
/>
<result
column=
"name"
jdbcType=
"INTEGER"
property=
"name"
/>
<result
column=
"value"
jdbcType=
"VARCHAR"
property=
"value"
/>
<collection
property=
"valueConsume"
ofType=
"org.rcisoft.business.breleasevalue.dto.UserValueDto"
javaType=
"String"
select=
"org.rcisoft.business.breleasevalue.dao.BReleaseValueRepository.getValueConsume"
column=
"business_id"
>
</collection>
</resultMap>
<!--<cache type="${corePackag!}.util.RedisCache"/>-->
</mapper>
\ No newline at end of file
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