Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
amos-boot-biz
Project
Project
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
项目统一框架
amos-boot-biz
Commits
58bef5fe
Commit
58bef5fe
authored
Dec 17, 2021
by
高建强
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
item:视频监控新增所属机构树,函数脚本维护。
parent
8a0a5b00
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
251 additions
and
55 deletions
+251
-55
ReginParams.java
...java/com/yeejoin/amos/boot/biz/common/bo/ReginParams.java
+1
-0
OrgUsrMapper.java
...join/amos/boot/module/common/api/mapper/OrgUsrMapper.java
+4
-0
IOrgUsrService.java
...n/amos/boot/module/common/api/service/IOrgUsrService.java
+11
-0
OrgUsrMapper.xml
...ule-common-api/src/main/resources/mapper/OrgUsrMapper.xml
+20
-0
OrgUsrController.java
...s/boot/module/common/biz/controller/OrgUsrController.java
+36
-28
OrgUsrServiceImpl.java
...oot/module/common/biz/service/impl/OrgUsrServiceImpl.java
+30
-1
VideoController.java
...a/com/yeejoin/equipmanage/controller/VideoController.java
+25
-24
PersonIdentify.java
...om/yeejoin/equipmanage/core/framework/PersonIdentify.java
+18
-0
PersonIdentifyAspect.java
...join/equipmanage/core/framework/PersonIdentifyAspect.java
+58
-0
PermissionException.java
...om/yeejoin/equipmanage/exception/PermissionException.java
+20
-0
wl-3.0.1.xml
...ot-system-equip/src/main/resources/changelog/wl-3.0.1.xml
+26
-0
Building.xml
...-boot-system-equip/src/main/resources/mapper/Building.xml
+2
-2
No files found.
amos-boot-biz-common/src/main/java/com/yeejoin/amos/boot/biz/common/bo/ReginParams.java
View file @
58bef5fe
...
...
@@ -26,6 +26,7 @@ public class ReginParams implements Serializable {
private
String
personName
;
private
String
companyId
;
private
String
companyName
;
private
String
bizOrgCode
;
}
public
PersonIdentity
getPersonIdentity
()
{
...
...
amos-boot-module/amos-boot-module-api/amos-boot-module-common-api/src/main/java/com/yeejoin/amos/boot/module/common/api/mapper/OrgUsrMapper.java
View file @
58bef5fe
...
...
@@ -97,4 +97,8 @@ public interface OrgUsrMapper extends BaseMapper<OrgUsr> {
List
<
Map
<
String
,
Object
>>
queryCompanyIdNew
(
String
bizOrgName
);
OrgUsr
queryByUserId
(
@Param
(
"userId"
)
Long
userId
);
List
<
OrgUsr
>
companyTreeByUserAndType
(
@Param
(
"userId"
)
String
userId
,
@Param
(
"type"
)
String
type
);
OrgUsr
queryBySequenceNbr
(
@Param
(
"parentId"
)
String
parentId
);
}
amos-boot-module/amos-boot-module-api/amos-boot-module-common-api/src/main/java/com/yeejoin/amos/boot/module/common/api/service/IOrgUsrService.java
View file @
58bef5fe
...
...
@@ -201,6 +201,15 @@ public interface IOrgUsrService {
*/
List
<
OrgMenuDto
>
companyTreeByUser
(
AgencyUserModel
user
);
/**
* 根据登录人及类型获取公司部门树
* @param user
* @param type 默认查询公司及部门,公司:COMPANY,部门:DEPARTMENT
* @return
*/
List
<
OrgMenuDto
>
companyTreeByUserAndType
(
AgencyUserModel
user
,
String
type
);
/**
* 根据登陆人获取公司列表(关联重点部位)
*/
...
...
@@ -283,4 +292,6 @@ public interface IOrgUsrService {
void
updateByIdOrgPersonFlc
(
OrgPersonDto
OrgPersonVo
,
Long
id
)
throws
Exception
;
JSONObject
selectPersonByUserId
(
Long
userId
)
throws
Exception
;
UserDto
getUserParentInfo
(
String
userId
);
}
amos-boot-module/amos-boot-module-api/amos-boot-module-common-api/src/main/resources/mapper/OrgUsrMapper.xml
View file @
58bef5fe
...
...
@@ -737,4 +737,24 @@ LEFT JOIN (
AND amos_org_id = #{userId}
</if>
</select>
<select
id=
"queryBySequenceNbr"
resultType=
"com.yeejoin.amos.boot.module.common.api.entity.OrgUsr"
>
SELECT *
FROM cb_org_usr
WHERE is_delete = 0
<if
test=
"parentId != null and parentId != ''"
>
AND sequence_nbr = #{parentId}
</if>
</select>
<select
id=
"companyTreeByUserAndType"
resultType=
"com.yeejoin.amos.boot.module.common.api.entity.OrgUsr"
>
SELECT
*
FROM
cb_org_usr usr
<where>
usr.sequence_nbr IN ( SELECT getOrgUsrTreeById ( ( SELECT parent_id FROM cb_org_usr WHERE amos_org_id = #{userId} ) ) )
<if
test=
"type != null and type != ''"
>
AND usr.biz_org_type = #{type}
</if>
</where>
</select>
</mapper>
amos-boot-module/amos-boot-module-biz/amos-boot-module-common-biz/src/main/java/com/yeejoin/amos/boot/module/common/biz/controller/OrgUsrController.java
View file @
58bef5fe
...
...
@@ -11,35 +11,21 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import
com.yeejoin.amos.boot.biz.common.constants.CommonConstant
;
import
com.yeejoin.amos.boot.biz.common.controller.BaseController
;
import
com.yeejoin.amos.boot.biz.common.utils.NameUtils
;
import
com.yeejoin.amos.boot.module.common.api.dto.CheckObjectDto
;
import
com.yeejoin.amos.boot.module.common.api.dto.CompanyPerson
;
import
com.yeejoin.amos.boot.module.common.api.dto.ESOrgUsrDto
;
import
com.yeejoin.amos.boot.module.common.api.dto.OrgDepartmentDto
;
import
com.yeejoin.amos.boot.module.common.api.dto.OrgMenuDto
;
import
com.yeejoin.amos.boot.module.common.api.dto.OrgUsrDto
;
import
com.yeejoin.amos.boot.module.common.api.dto.OrgUsrFormDto
;
import
com.yeejoin.amos.boot.module.common.api.dto.UserDto
;
import
com.yeejoin.amos.boot.module.common.api.dto.UserUnitDto
;
import
com.yeejoin.amos.boot.module.common.api.dto.*
;
import
com.yeejoin.amos.boot.module.common.api.entity.FireTeam
;
import
com.yeejoin.amos.boot.module.common.api.entity.OrgUsr
;
import
com.yeejoin.amos.boot.module.common.api.feign.EquipFeignClient
;
import
com.yeejoin.amos.boot.module.common.api.mapper.FireTeamMapper
;
import
com.yeejoin.amos.boot.module.common.api.service.IOrgUsrService
;
import
com.yeejoin.amos.boot.module.common.biz.service.impl.ESOrgUsrService
;
import
com.yeejoin.amos.boot.module.common.biz.service.impl.OrgUsrServiceImpl
;
import
com.yeejoin.amos.feign.privilege.model.AgencyUserModel
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.ibatis.annotations.Param
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.PathVariable
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMethod
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
org.springframework.web.bind.annotation.RestController
;
import
org.springframework.web.bind.annotation.*
;
import
org.typroject.tyboot.component.emq.EmqKeeper
;
import
org.typroject.tyboot.core.foundation.enumeration.UserType
;
import
org.typroject.tyboot.core.restful.doc.TycloudOperation
;
...
...
@@ -66,6 +52,10 @@ public class OrgUsrController extends BaseController {
@Autowired
OrgUsrServiceImpl
iOrgUsrService
;
@Autowired
private
IOrgUsrService
orgUsrService
;
@Autowired
ESOrgUsrService
eSOrgUsrService
;
...
...
@@ -108,11 +98,11 @@ public class OrgUsrController extends BaseController {
// BUG 2741 首先判断是否为公司 如果公司底下有人员不可直接删除 bykongfm
//bug 2882 判断是否为部门 如果部门底下有人员不可直接删除 chenzhao 2021-09-27 start
OrgUsr
tempOrg
=
iOrgUsrService
.
getById
(
id
.
toString
());
if
(
tempOrg
.
getBizOrgType
().
equals
(
"COMPANY"
)
||
tempOrg
.
getBizOrgType
().
equals
(
"DEPARTMENT"
))
{
List
<
OrgUsr
>
tempList
=
iOrgUsrService
.
list
(
new
LambdaQueryWrapper
<
OrgUsr
>().
eq
(
OrgUsr:
:
getParentId
,
id
).
eq
(
OrgUsr:
:
getIsDelete
,
false
));
if
(
tempOrg
.
getBizOrgType
().
equals
(
"COMPANY"
)
||
tempOrg
.
getBizOrgType
().
equals
(
"DEPARTMENT"
))
{
List
<
OrgUsr
>
tempList
=
iOrgUsrService
.
list
(
new
LambdaQueryWrapper
<
OrgUsr
>().
eq
(
OrgUsr:
:
getParentId
,
id
).
eq
(
OrgUsr:
:
getIsDelete
,
false
));
/*bug3031 删除机场单位后,队伍所属单位字段数据未清空 2021-10-13 start*/
List
<
FireTeam
>
fireTeams
=
fireTeamMapper
.
byTeamId
(
id
);
if
(
tempList
.
size
()
>
0
||
fireTeams
.
size
()
>
0
)
{
if
(
tempList
.
size
()
>
0
||
fireTeams
.
size
()
>
0
)
{
return
ResponseHelper
.
buildResponse
(
"-1"
);
}
/*bug3031 删除机场单位后,队伍所属单位字段数据未清空 2021-10-13 end*/
...
...
@@ -120,7 +110,7 @@ public class OrgUsrController extends BaseController {
//bug 2882 判断是否为部门 如果部门底下有人员不可直接删除 chenzhao 2021-09-27 end
// iOrgUsrService.update(new UpdateWrapper<OrgUsr>().eq("sequence_nbr", id).set("is_delete", CommonConstant.IS_DELETE_01));
/*bug 2812 一次删除多条数据 传入类型修改为string 问题解决 2021-09-09 陈召 开始*/
iOrgUsrService
.
update
(
new
UpdateWrapper
<
OrgUsr
>().
eq
(
"sequence_nbr"
,
String
.
valueOf
(
id
)).
set
(
"is_delete"
,
CommonConstant
.
IS_DELETE_01
));
iOrgUsrService
.
update
(
new
UpdateWrapper
<
OrgUsr
>().
eq
(
"sequence_nbr"
,
String
.
valueOf
(
id
)).
set
(
"is_delete"
,
CommonConstant
.
IS_DELETE_01
));
/*bug 2812 一次删除多条数据 传入类型修改为string 问题解决 2021-09-09 陈召 结束*/
try
{
eSOrgUsrService
.
deleteById
(
id
);
...
...
@@ -144,7 +134,7 @@ public class OrgUsrController extends BaseController {
public
ResponseModel
<?>
updateByIdOrgUsr
(
HttpServletRequest
request
,
@RequestBody
OrgUsrDto
OrgUsrVo
,
@PathVariable
Long
id
)
throws
Exception
{
OrgUsrVo
.
setBizOrgType
(
CommonConstant
.
BIZ_ORG_TYPE_COMPANY
);
// iOrgUsrService.updateByIdOrgUsr(OrgUsrVo, id);
return
ResponseHelper
.
buildResponse
(
iOrgUsrService
.
updateByIdOrgUsr
(
OrgUsrVo
,
id
));
return
ResponseHelper
.
buildResponse
(
iOrgUsrService
.
updateByIdOrgUsr
(
OrgUsrVo
,
id
));
}
...
...
@@ -382,6 +372,16 @@ public class OrgUsrController extends BaseController {
return
ResponseHelper
.
buildResponse
(
menus
);
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@RequestMapping
(
value
=
"/companyTreeByUserAndType"
,
method
=
RequestMethod
.
GET
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"根据登录人及类型获取公司部门树"
,
notes
=
"根据登录人及类型获取公司部门树"
)
public
ResponseModel
<
List
<
OrgMenuDto
>>
companyTreeByUserAndType
(
@RequestParam
(
required
=
false
)
String
type
)
throws
Exception
{
// 获取登陆人角色
AgencyUserModel
user
=
getUserInfo
();
List
<
OrgMenuDto
>
menus
=
iOrgUsrService
.
companyTreeByUserAndType
(
user
,
type
);
return
ResponseHelper
.
buildResponse
(
menus
);
}
/**
* 获取单位部门树
*
...
...
@@ -441,6 +441,13 @@ public class OrgUsrController extends BaseController {
return
ResponseHelper
.
buildResponse
(
iOrgUsrService
.
getUserInfo
(
userId
));
}
@TycloudOperation
(
needAuth
=
false
,
ApiLevel
=
UserType
.
AGENCY
)
@RequestMapping
(
value
=
"/{userId}/getUserParentInfo"
,
method
=
RequestMethod
.
GET
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"获取用户本级及父级信息"
,
notes
=
"获取用户本级及父级信息"
)
public
UserDto
getUserParentInfo
(
@PathVariable
String
userId
)
{
return
orgUsrService
.
getUserParentInfo
(
userId
);
}
/**
* 获取登陆人绑定的人员关系
*
...
...
@@ -450,11 +457,11 @@ public class OrgUsrController extends BaseController {
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@RequestMapping
(
value
=
{
"/getLoginUserDetails/{userId}"
,
"/getLoginUserDetails"
},
method
=
RequestMethod
.
GET
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"获取登陆人绑定的人员关系"
,
notes
=
"获取登陆人绑定的人员关系"
)
public
ResponseModel
<
List
<
Map
<
String
,
Object
>>>
getLoginUserDetails
(
@PathVariable
(
required
=
false
)
String
userId
)
{
public
ResponseModel
<
List
<
Map
<
String
,
Object
>>>
getLoginUserDetails
(
@PathVariable
(
required
=
false
)
String
userId
)
{
AgencyUserModel
user
=
getUserInfo
();
String
userIds
=
userId
;
if
(
StringUtils
.
isEmpty
(
userIds
))
{
userIds
=
user
.
getUserId
();
userIds
=
user
.
getUserId
();
}
List
<
Map
<
String
,
Object
>>
loginUserDetails
=
iOrgUsrService
.
getLoginUserDetails
(
userIds
,
user
);
return
ResponseHelper
.
buildResponse
(
loginUserDetails
);
...
...
@@ -465,7 +472,7 @@ public class OrgUsrController extends BaseController {
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"获取最上级station"
,
notes
=
"获取最上级建筑信息"
)
public
ResponseModel
<
JSONObject
>
getBuliding
(
@PathVariable
Long
id
)
{
JSONObject
equipjSONObject
=
this
.
getBulid
(
id
);
return
ResponseHelper
.
buildResponse
(
equipjSONObject
);
return
ResponseHelper
.
buildResponse
(
equipjSONObject
);
}
public
JSONObject
getBulid
(
Long
id
)
{
...
...
@@ -477,11 +484,12 @@ public class OrgUsrController extends BaseController {
if
(!
"0"
.
equals
(
equipjSONObject
.
getString
(
"parentId"
)))
{
String
parentId
=
equipjSONObject
.
getString
(
"parentId"
);
if
(
StringUtils
.
isNotBlank
(
parentId
))
{
return
getBulid
(
Long
.
parseLong
(
parentId
));
return
getBulid
(
Long
.
parseLong
(
parentId
));
}
}
return
equipjSONObject
;
}
/**
* 判断关联账户是否已关联
*
...
...
@@ -491,7 +499,7 @@ public class OrgUsrController extends BaseController {
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@RequestMapping
(
value
=
"/getAmosId/{amosId}"
,
method
=
RequestMethod
.
GET
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"判断关联账户是否已关联"
,
notes
=
"判断关联账户是否已关联"
)
public
ResponseModel
<
Object
>
getAmosId
(
@PathVariable
String
amosId
)
{
public
ResponseModel
<
Object
>
getAmosId
(
@PathVariable
String
amosId
)
{
return
ResponseHelper
.
buildResponse
(
iOrgUsrService
.
amosIdExist
(
amosId
));
}
...
...
@@ -572,7 +580,7 @@ public class OrgUsrController extends BaseController {
public
ResponseModel
<
List
<
OrgUsr
>>
getPersonListByCompanyId
(
@PathVariable
String
companyId
)
{
return
ResponseHelper
.
buildResponse
(
iOrgUsrService
.
getPersonListByCompanyId
(
companyId
));
}
/**
* 根据id获取单位人员列表
*
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-common-biz/src/main/java/com/yeejoin/amos/boot/module/common/biz/service/impl/OrgUsrServiceImpl.java
View file @
58bef5fe
...
...
@@ -1387,7 +1387,15 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp
return
gettTreeByUser
(
user
,
companyDepartmentMsgList
);
}
;
@Override
public
List
<
OrgMenuDto
>
companyTreeByUserAndType
(
AgencyUserModel
user
,
String
type
)
{
String
userId
=
user
.
getUserId
();
if
(
StringUtils
.
isNotBlank
(
userId
))
{
List
<
OrgUsr
>
list
=
orgUsrMapper
.
companyTreeByUserAndType
(
userId
,
type
);
return
buildTreeParallel
(
list
);
}
return
Lists
.
newArrayList
();
}
@Override
public
List
<
CheckObjectDto
>
companyListByUser
(
AgencyUserModel
user
)
{
...
...
@@ -2062,6 +2070,27 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp
return
jsonObject
;
}
@Override
public
UserDto
getUserParentInfo
(
String
userId
)
{
UserDto
userDto
=
new
UserDto
();
if
(
StringUtils
.
isNotEmpty
(
userId
))
{
OrgUsr
orgUsr
=
orgUsrMapper
.
queryByUserId
(
Long
.
parseLong
(
userId
));
if
(!
ObjectUtils
.
isEmpty
(
orgUsr
))
{
String
parentId
=
orgUsr
.
getParentId
();
userDto
.
setPersonSeq
(
String
.
valueOf
(
orgUsr
.
getSequenceNbr
()));
userDto
.
setPersonName
(
orgUsr
.
getBizOrgName
());
OrgUsr
bizOrg
=
orgUsrMapper
.
queryBySequenceNbr
(
parentId
);
if
(!
ObjectUtils
.
isEmpty
(
bizOrg
))
{
userDto
.
setBizOrgType
(
bizOrg
.
getBizOrgType
());
userDto
.
setBizOrgCode
(
bizOrg
.
getBizOrgCode
());
userDto
.
setCompanyId
(
String
.
valueOf
(
bizOrg
.
getSequenceNbr
()));
userDto
.
setCompanyName
(
bizOrg
.
getBizOrgName
());
}
}
}
return
userDto
;
}
public
Object
getOrgUserByAmosUserId
(
String
amosUserId
)
throws
Exception
{
LambdaQueryWrapper
<
OrgUsr
>
wrapper
=
new
LambdaQueryWrapper
<
OrgUsr
>();
wrapper
.
eq
(
OrgUsr:
:
getIsDelete
,
false
);
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/controller/VideoController.java
View file @
58bef5fe
package
com
.
yeejoin
.
equipmanage
.
controller
;
import
java.util.List
;
import
javax.servlet.http.HttpServletResponse
;
import
org.apache.commons.lang.StringUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.http.MediaType
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.PathVariable
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMethod
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
org.springframework.web.bind.annotation.RestController
;
import
org.typroject.tyboot.core.foundation.enumeration.UserType
;
import
org.typroject.tyboot.core.restful.doc.TycloudOperation
;
import
org.springframework.web.multipart.MultipartFile
;
import
org.typroject.tyboot.core.restful.exception.instance.BadRequest
;
import
org.typroject.tyboot.core.foundation.enumeration.UserType
;
import
org.typroject.tyboot.core.restful.doc.TycloudOperation
;
import
org.typroject.tyboot.core.restful.utils.ResponseModel
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONObject
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.yeejoin.amos.boot.module.common.api.dto.OrgMenuDto
;
import
com.yeejoin.amos.boot.module.common.api.service.IOrgUsrService
;
import
com.yeejoin.equipmanage.common.entity.Video
;
import
com.yeejoin.equipmanage.common.entity.dto.VideoDTO
;
import
com.yeejoin.equipmanage.common.entity.dto.VideoSaveDto
;
...
...
@@ -33,14 +12,26 @@ import com.yeejoin.equipmanage.common.entity.vo.PageVideoVO;
import
com.yeejoin.equipmanage.common.entity.vo.VideoListVo
;
import
com.yeejoin.equipmanage.common.enums.ExcelEnums
;
import
com.yeejoin.equipmanage.common.utils.CommonResponseUtil
;
import
com.yeejoin.equipmanage.core.framework.PersonIdentify
;
import
com.yeejoin.equipmanage.dto.ExcelDto
;
import
com.yeejoin.equipmanage.service.IExcelService
;
import
com.yeejoin.equipmanage.service.IVideoService
;
import
com.yeejoin.equipmanage.utils.ExcelUtil
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.lang.StringUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.http.MediaType
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.multipart.MultipartFile
;
import
org.typroject.tyboot.core.foundation.enumeration.UserType
;
import
org.typroject.tyboot.core.restful.doc.TycloudOperation
;
import
org.typroject.tyboot.core.restful.exception.instance.BadRequest
;
import
org.typroject.tyboot.core.restful.utils.ResponseModel
;
import
javax.servlet.http.HttpServletResponse
;
import
java.util.List
;
/**
* @author ZeHua Li
...
...
@@ -58,6 +49,9 @@ public class VideoController extends AbstractBaseController {
@Autowired
private
IExcelService
excelService
;
@Autowired
private
IOrgUsrService
orgUsrService
;
/**
* 新增
*
...
...
@@ -284,4 +278,11 @@ public class VideoController extends AbstractBaseController {
return
flvUrl
;
}
@PersonIdentify
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@RequestMapping
(
value
=
"/companyTreeByUserAndType"
,
method
=
RequestMethod
.
GET
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"根据登录人及类型获取公司部门树"
,
notes
=
"根据登录人及类型获取公司部门树"
)
public
List
<
OrgMenuDto
>
companyTreeByUserAndType
(
@RequestParam
(
required
=
false
)
String
type
)
{
return
orgUsrService
.
companyTreeByUserAndType
(
getUserInfo
(),
type
);
}
}
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/core/framework/PersonIdentify.java
0 → 100644
View file @
58bef5fe
package
com
.
yeejoin
.
equipmanage
.
core
.
framework
;
import
java.lang.annotation.*
;
/**
* @author DELL
*/
@Target
(
ElementType
.
METHOD
)
@Retention
(
RetentionPolicy
.
RUNTIME
)
@Documented
public
@interface
PersonIdentify
{
/**
* 是否进行人员校验
* @return boolean
*/
boolean
isNeedIdentity
()
default
true
;
}
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/core/framework/PersonIdentifyAspect.java
0 → 100644
View file @
58bef5fe
package
com
.
yeejoin
.
equipmanage
.
core
.
framework
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONObject
;
import
com.yeejoin.amos.boot.biz.common.bo.ReginParams
;
import
com.yeejoin.amos.boot.biz.common.utils.RedisKey
;
import
com.yeejoin.amos.boot.biz.common.utils.RedisUtils
;
import
com.yeejoin.amos.boot.module.common.api.dto.UserDto
;
import
com.yeejoin.amos.boot.module.common.api.service.IOrgUsrService
;
import
com.yeejoin.equipmanage.exception.PermissionException
;
import
org.aspectj.lang.JoinPoint
;
import
org.aspectj.lang.annotation.Aspect
;
import
org.aspectj.lang.annotation.Before
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.core.annotation.Order
;
import
org.springframework.stereotype.Component
;
import
org.springframework.util.ObjectUtils
;
import
org.springframework.web.bind.annotation.ResponseBody
;
import
org.typroject.tyboot.core.foundation.context.RequestContext
;
/**
* @author DELL
*/
@Aspect
@Component
@ResponseBody
@Order
(
value
=
1
)
public
class
PersonIdentifyAspect
{
@Autowired
RedisUtils
redisUtils
;
@Autowired
private
IOrgUsrService
orgUsrService
;
@Before
(
value
=
"@annotation(com.yeejoin.equipmanage.core.framework.PersonIdentify) && @annotation(permission)"
)
public
void
personIdentity
(
JoinPoint
joinPoint
,
PersonIdentify
permission
)
throws
PermissionException
{
ReginParams
reginParam
=
JSON
.
parseObject
(
redisUtils
.
get
(
RedisKey
.
buildReginKey
(
RequestContext
.
getExeUserId
(),
RequestContext
.
getToken
())).
toString
(),
ReginParams
.
class
);
if
(
permission
.
isNeedIdentity
()
&&
reginParam
!=
null
)
{
String
userId
=
reginParam
.
getUserModel
().
getUserId
();
UserDto
userDto
=
orgUsrService
.
getUserParentInfo
(
userId
);
if
(!
ObjectUtils
.
isEmpty
(
userDto
))
{
ReginParams
.
PersonIdentity
personIdentity
=
new
ReginParams
.
PersonIdentity
();
personIdentity
.
setBizOrgCode
(
userDto
.
getBizOrgCode
());
personIdentity
.
setCompanyId
(
userDto
.
getCompanyId
());
personIdentity
.
setCompanyName
(
userDto
.
getCompanyName
());
personIdentity
.
setPersonSeq
(
userDto
.
getPersonSeq
());
personIdentity
.
setPersonName
(
userDto
.
getPersonName
());
personIdentity
.
setIdentityType
(
userDto
.
getIdentityType
());
reginParam
.
setPersonIdentity
(
personIdentity
);
redisUtils
.
set
(
RedisKey
.
buildReginKey
(
RequestContext
.
getExeUserId
(),
RequestContext
.
getToken
()),
JSONObject
.
toJSONString
(
reginParam
));
}
else
{
throw
new
RuntimeException
(
"人员未绑定!"
);
}
}
}
}
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/exception/PermissionException.java
0 → 100644
View file @
58bef5fe
package
com
.
yeejoin
.
equipmanage
.
exception
;
import
org.springframework.http.HttpStatus
;
public
class
PermissionException
extends
RuntimeException
{
private
static
final
long
serialVersionUID
=
-
6126611364667754200L
;
public
PermissionException
(
String
message
)
{
super
(
message
);
}
public
PermissionException
(
String
message
,
Throwable
cause
)
{
super
(
message
,
cause
);
}
public
HttpStatus
getStatus
()
{
return
HttpStatus
.
FORBIDDEN
;
// 403
}
}
amos-boot-system-equip/src/main/resources/changelog/wl-3.0.1.xml
View file @
58bef5fe
...
...
@@ -2068,4 +2068,29 @@
INSERT INTO `wl_form_group_column`(`id`, `field_name`, `field_label`, `data_type`, `group_id`, `query_strategy`, `not_null`, `group_code`, `creator_id`, `create_date`) VALUES (133000000252, 'bizOrgName', '机构/部门名称', 'String', 132828674810, 'eq', b'0', 'building', 2581805, '2021-12-15 17:34:04');
</sql>
</changeSet>
<changeSet
author=
"gaojianqiang"
id=
"1639540630-20211217-01"
>
<comment>
`getOrgUsrTreeById`
</comment>
<sql
endDelimiter=
"#"
>
DROP FUNCTION IF EXISTS `getOrgUsrTreeById`#
CREATE DEFINER = `root` @`%` FUNCTION `getOrgUsrTreeById` ( `rootId` BIGINT ) RETURNS VARCHAR ( 1000 ) CHARSET utf8 BEGIN
DECLARE
sTemp TEXT;
DECLARE
sTempChd VARCHAR ( 4000 );
SET sTemp = '$';
SET sTempChd = CAST( rootId AS CHAR );
WHILE
sTempChd IS NOT NULL DO
SET sTemp = CONCAT( sTemp, ',', sTempChd );
SELECT
GROUP_CONCAT( DISTINCT sequence_nbr ) INTO sTempChd
FROM
cb_org_usr
WHERE
FIND_IN_SET( parent_id, sTempChd ) > 0;
END WHILE;
RETURN substring( sTemp, 3 );
END#
</sql>
</changeSet>
</databaseChangeLog>
\ No newline at end of file
amos-boot-system-equip/src/main/resources/mapper/Building.xml
View file @
58bef5fe
...
...
@@ -231,8 +231,8 @@
AND par.field_name = 'parentId'
LEFT JOIN wl_form_instance AS cd ON cd.instance_id = ins.instance_id
AND cd.field_name = 'code'
LEFT JOIN wl_form_instance AS bzc ON
cd
.instance_id = ins.instance_id
AND
cd
.field_name = 'bizOrgCode'
LEFT JOIN wl_form_instance AS bzc ON
bzc
.instance_id = ins.instance_id
AND
bzc
.field_name = 'bizOrgCode'
GROUP BY
ins.instance_id
ORDER BY
...
...
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