Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
D
dm_project
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
姚本章
dm_project
Commits
2475bce1
Commit
2475bce1
authored
Jan 20, 2021
by
zhangc
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改字段返回类型
parent
537c0aa0
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
10 additions
and
36 deletions
+10
-36
api_gateway.sql
database/zc/api_gateway.sql
+1
-1
ApiOrg.java
...gateway/src/main/java/com/jz/dm/models/domian/ApiOrg.java
+2
-2
AuthServiceImpl.java
...src/main/java/com/jz/dm/service/impl/AuthServiceImpl.java
+2
-1
OrganizationManageImpl.java
...n/java/com/jz/dm/service/impl/OrganizationManageImpl.java
+5
-32
No files found.
database/zc/api_gateway.sql
View file @
2475bce1
...
@@ -89,7 +89,7 @@ CREATE TABLE `t_api_org` (
...
@@ -89,7 +89,7 @@ CREATE TABLE `t_api_org` (
`org_phone`
varchar
(
20
)
NULL
DEFAULT
NULL
COMMENT
'组织电话'
,
`org_phone`
varchar
(
20
)
NULL
DEFAULT
NULL
COMMENT
'组织电话'
,
`linkman`
varchar
(
50
)
NULL
DEFAULT
NULL
COMMENT
'组织联系人'
`linkman`
varchar
(
50
)
NULL
DEFAULT
NULL
COMMENT
'组织联系人'
`org_type`
varchar
(
20
)
NULL
DEFAULT
NULL
COMMENT
'组织类型:OUT 外部组织, IN 内部组织'
,
`org_type`
varchar
(
20
)
NULL
DEFAULT
NULL
COMMENT
'组织类型:OUT 外部组织, IN 内部组织'
,
`status`
varchar
(
100
)
NOT
NULL
COMMENT
'状态(NORMAL-正常 FREEZE-冻结 CANCEL-注销)
'
,
`status`
tinyint
(
2
)
DEFAULT
'1'
COMMENT
'状态: 0- 注销 1- 正常
'
,
`org_mail`
varchar
(
100
)
DEFAULT
NULL
COMMENT
'组织邮箱'
,
`org_mail`
varchar
(
100
)
DEFAULT
NULL
COMMENT
'组织邮箱'
,
`org_sort`
int
(
10
)
DEFAULT
'999'
COMMENT
'组织排序'
,
`org_sort`
int
(
10
)
DEFAULT
'999'
COMMENT
'组织排序'
,
`parent_id`
varchar
(
100
)
DEFAULT
NULL
COMMENT
'父类组织编码'
,
`parent_id`
varchar
(
100
)
DEFAULT
NULL
COMMENT
'父类组织编码'
,
...
...
jz-dm-apigateway/src/main/java/com/jz/dm/models/domian/ApiOrg.java
View file @
2475bce1
...
@@ -62,10 +62,10 @@ public class ApiOrg extends BaseObject implements Serializable {
...
@@ -62,10 +62,10 @@ public class ApiOrg extends BaseObject implements Serializable {
private
String
orgType
;
private
String
orgType
;
/**
/**
* 状态(NORMAL-正常
FREEZE-冻结 CANCEL-注销
)
* 状态(NORMAL-正常
(true) FREEZE-冻结 CANCEL-注销(false)
)
*/
*/
@TableField
(
"status"
)
@TableField
(
"status"
)
private
String
status
;
private
Boolean
status
;
/**
/**
* 组织邮箱
* 组织邮箱
...
...
jz-dm-apigateway/src/main/java/com/jz/dm/service/impl/AuthServiceImpl.java
View file @
2475bce1
...
@@ -356,7 +356,8 @@ public class AuthServiceImpl implements AuthService {
...
@@ -356,7 +356,8 @@ public class AuthServiceImpl implements AuthService {
QueryWrapper
<
ApiOrg
>
query
=
new
QueryWrapper
<>();
QueryWrapper
<
ApiOrg
>
query
=
new
QueryWrapper
<>();
if
(
StringUtils
.
isNotBlank
(
key
)){
if
(
StringUtils
.
isNotBlank
(
key
)){
query
.
and
(
wrapper
->
wrapper
.
like
(
"org_name"
,
key
)
query
.
and
(
wrapper
->
wrapper
.
like
(
"org_name"
,
key
)
.
or
().
like
(
"org_code"
,
key
));
.
or
().
like
(
"org_code"
,
key
)
.
or
().
like
(
"linkman"
,
key
));
}
}
return
Result
.
of_success
(
apiOrgMapper
.
selectList
(
query
));
return
Result
.
of_success
(
apiOrgMapper
.
selectList
(
query
));
}
}
...
...
jz-dm-apigateway/src/main/java/com/jz/dm/service/impl/OrganizationManageImpl.java
View file @
2475bce1
...
@@ -19,7 +19,6 @@ import lombok.extern.slf4j.Slf4j;
...
@@ -19,7 +19,6 @@ import lombok.extern.slf4j.Slf4j;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
org.springframework.util.CollectionUtils
;
import
javax.annotation.Resource
;
import
javax.annotation.Resource
;
import
java.util.Date
;
import
java.util.Date
;
...
@@ -61,17 +60,7 @@ public class OrganizationManageImpl implements OrganizationManageService {
...
@@ -61,17 +60,7 @@ public class OrganizationManageImpl implements OrganizationManageService {
query
.
eq
(
"is_deleted"
,
0
);
query
.
eq
(
"is_deleted"
,
0
);
query
.
ne
(
"status"
,
OrgStatusEnum
.
CANCEL
);
query
.
ne
(
"status"
,
OrgStatusEnum
.
CANCEL
);
query
.
orderByDesc
(
"create_date"
);
query
.
orderByDesc
(
"create_date"
);
IPage
<
ApiOrg
>
orgIPage
=
apiOrgMapper
.
selectPage
(
page
,
query
);
return
apiOrgMapper
.
selectPage
(
page
,
query
);
if
(!
CollectionUtils
.
isEmpty
(
orgIPage
.
getRecords
())){
orgIPage
.
getRecords
().
forEach
(
x
->{
if
(
OrgStatusEnum
.
CANCEL
.
name
().
equals
(
x
.
getStatus
())){
x
.
setStatus
(
"false"
);
}
else
{
x
.
setStatus
(
"true"
);
}
});
}
return
orgIPage
;
}
}
/**
/**
...
@@ -85,16 +74,8 @@ public class OrganizationManageImpl implements OrganizationManageService {
...
@@ -85,16 +74,8 @@ public class OrganizationManageImpl implements OrganizationManageService {
QueryWrapper
<
ApiOrg
>
query
=
new
QueryWrapper
<>();
QueryWrapper
<
ApiOrg
>
query
=
new
QueryWrapper
<>();
query
.
eq
(
"is_deleted"
,
0
);
query
.
eq
(
"is_deleted"
,
0
);
query
.
eq
(
"id"
,
req
.
getId
());
query
.
eq
(
"id"
,
req
.
getId
());
query
.
ne
(
"status"
,
OrgStatusEnum
.
CANCEL
);
query
.
ne
(
"status"
,
0
);
ApiOrg
apiOrg
=
apiOrgMapper
.
selectOne
(
query
);
return
Result
.
of_success
(
apiOrgMapper
.
selectOne
(
query
));
if
(
null
!=
apiOrg
)
{
if
(
OrgStatusEnum
.
CANCEL
.
name
().
equals
(
apiOrg
.
getStatus
()))
{
apiOrg
.
setStatus
(
"false"
);
}
else
{
apiOrg
.
setStatus
(
"true"
);
}
}
return
Result
.
of_success
(
apiOrg
);
}
}
/**
/**
...
@@ -119,23 +100,16 @@ public class OrganizationManageImpl implements OrganizationManageService {
...
@@ -119,23 +100,16 @@ public class OrganizationManageImpl implements OrganizationManageService {
String
coding
=
""
;
String
coding
=
""
;
ApiOrg
apiOrg
=
new
ApiOrg
();
ApiOrg
apiOrg
=
new
ApiOrg
();
BeanUtils
.
copyProperties
(
req
,
apiOrg
);
BeanUtils
.
copyProperties
(
req
,
apiOrg
);
//更新
if
(
null
!=
req
.
getId
()){
//更新
if
(
null
!=
req
.
getId
()){
ApiOrg
org
=
apiOrgMapper
.
selectById
(
req
.
getId
());
ApiOrg
org
=
apiOrgMapper
.
selectById
(
req
.
getId
());
if
(
null
==
org
){
if
(
null
==
org
){
return
Result
.
of_error
(
ResultMsg
.
DATA_NOT_EXIST
);
return
Result
.
of_error
(
ResultMsg
.
DATA_NOT_EXIST
);
}
if
(
req
.
getStatus
()){
org
.
setStatus
(
OrgStatusEnum
.
NORMAL
.
name
());
}
else
{
org
.
setStatus
(
OrgStatusEnum
.
CANCEL
.
name
());
}
}
org
.
setUpdateDate
(
new
Date
());
org
.
setUpdateDate
(
new
Date
());
if
(
apiOrgMapper
.
updateById
(
apiOrg
)
>
0
){
if
(
apiOrgMapper
.
updateById
(
apiOrg
)
>
0
){
return
Result
.
of_success
(
ResultMsg
.
UPDATE_SUCCESS
);
return
Result
.
of_success
(
ResultMsg
.
UPDATE_SUCCESS
);
}
}
//添加
}
else
{
//添加
}
else
{
if
(
StringUtils
.
isNotBlank
(
req
.
getOrgType
())
//内部组织
if
(
StringUtils
.
isNotBlank
(
req
.
getOrgType
())
//内部组织
&&
Constants
.
AUTH_INT
.
equals
(
req
.
getOrgType
()))
{
&&
Constants
.
AUTH_INT
.
equals
(
req
.
getOrgType
()))
{
coding
=
generateCode
(
req
.
getOrgName
(),
Constants
.
AUTH_INT
);
coding
=
generateCode
(
req
.
getOrgName
(),
Constants
.
AUTH_INT
);
...
@@ -146,7 +120,6 @@ public class OrganizationManageImpl implements OrganizationManageService {
...
@@ -146,7 +120,6 @@ public class OrganizationManageImpl implements OrganizationManageService {
return
Result
.
of_error
(
"生成组织编码异常!"
);
return
Result
.
of_error
(
"生成组织编码异常!"
);
}
}
apiOrg
.
setOrgCode
(
coding
);
//组织编码
apiOrg
.
setOrgCode
(
coding
);
//组织编码
apiOrg
.
setStatus
(
OrgStatusEnum
.
NORMAL
.
name
());
//正常
if
(
apiOrgMapper
.
insert
(
apiOrg
)
>
0
)
{
if
(
apiOrgMapper
.
insert
(
apiOrg
)
>
0
)
{
return
Result
.
of_success
(
ResultMsg
.
INSERT_SUCCESS
);
return
Result
.
of_success
(
ResultMsg
.
INSERT_SUCCESS
);
}
}
...
...
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