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
d453edfd
Commit
d453edfd
authored
Aug 20, 2021
by
高建强
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
item:优化获取用户单位归属接口
parent
6939f2cd
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
16 additions
and
10 deletions
+16
-10
IOrgUsrService.java
...n/amos/boot/module/common/api/service/IOrgUsrService.java
+1
-1
OrgUsrController.java
...s/boot/module/common/biz/controller/OrgUsrController.java
+5
-4
OrgUsrServiceImpl.java
...oot/module/common/biz/service/impl/OrgUsrServiceImpl.java
+10
-5
No files found.
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 @
d453edfd
...
...
@@ -181,7 +181,7 @@ public interface IOrgUsrService {
List
<
OrgUsrExcelDto
>
exportToExcel
();
UserUnitDto
getUserUnit
(
String
id
,
String
type
,
String
code
);
UserUnitDto
getUserUnit
(
String
userId
);
/**
* 根据登陆人获取公司部门人员树
...
...
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 @
d453edfd
...
...
@@ -360,14 +360,14 @@ public class OrgUsrController extends BaseController {
/**
* 获取用户单位归属
*
* @param
i
d
* @param
userI
d
* @return
*/
@TycloudOperation
(
needAuth
=
false
,
ApiLevel
=
UserType
.
AGENCY
)
@RequestMapping
(
value
=
"/
getU
serUnit"
,
method
=
RequestMethod
.
GET
)
@RequestMapping
(
value
=
"/
{userId}/u
serUnit"
,
method
=
RequestMethod
.
GET
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"获取用户单位归属"
,
notes
=
"获取用户单位归属"
)
public
ResponseModel
<
UserUnitDto
>
getUserUnit
(
@
RequestParam
String
id
,
@RequestParam
String
type
,
@RequestParam
String
code
)
{
return
ResponseHelper
.
buildResponse
(
iOrgUsrService
.
getUserUnit
(
id
,
type
,
code
));
public
ResponseModel
<
UserUnitDto
>
getUserUnit
(
@
PathVariable
String
userId
)
{
return
ResponseHelper
.
buildResponse
(
iOrgUsrService
.
getUserUnit
(
userId
));
}
}
\ No newline at end of file
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 @
d453edfd
...
...
@@ -46,6 +46,11 @@ import java.util.stream.Collectors;
@Service
public
class
OrgUsrServiceImpl
extends
BaseService
<
OrgUsrDto
,
OrgUsr
,
OrgUsrMapper
>
implements
IOrgUsrService
{
private
static
final
String
TYPE
=
"PERSON,COMPANY"
;
private
static
final
String
CODE
=
"amosAccount"
;
@Autowired
DynamicFormInstanceServiceImpl
alertFormValueServiceImpl
;
@Autowired
...
...
@@ -1003,13 +1008,13 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp
}
@Override
public
UserUnitDto
getUserUnit
(
String
id
,
String
type
,
String
code
)
{
if
(
StringUtils
.
isNotBlank
(
id
)
&&
StringUtils
.
isNotBlank
(
type
)
&&
StringUtils
.
isNotBlank
(
code
))
{
String
[]
typeArr
=
type
.
split
(
","
);
public
UserUnitDto
getUserUnit
(
String
userId
)
{
if
(
StringUtils
.
isNotBlank
(
userId
))
{
String
[]
typeArr
=
TYPE
.
split
(
","
);
// 业主单位
List
<
UserUnitDto
>
list
=
orgUsrMapper
.
getUserUnit
(
i
d
,
typeArr
[
0
],
null
);
List
<
UserUnitDto
>
list
=
orgUsrMapper
.
getUserUnit
(
userI
d
,
typeArr
[
0
],
null
);
// 维保单位
List
<
DynamicFormInstance
>
instanceList
=
alertFormValueServiceImpl
.
getInstanceByCodeAndValue
(
code
,
i
d
);
List
<
DynamicFormInstance
>
instanceList
=
alertFormValueServiceImpl
.
getInstanceByCodeAndValue
(
CODE
,
userI
d
);
if
(!
CollectionUtils
.
isEmpty
(
list
)
&&
!
CollectionUtils
.
isEmpty
(
instanceList
))
{
throw
new
RuntimeException
(
"人员绑定单位重复!"
);
}
else
{
...
...
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