Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gic-platform-auth
Overview
Overview
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
base_platform_enterprise
gic-platform-auth
Commits
39074881
Commit
39074881
authored
Feb 12, 2020
by
guojuxing
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
协作人对外新增、查询、删除接口
parent
5a8d2d28
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
84 additions
and
0 deletions
+84
-0
CollaboratorApiService.java
...ain/java/com/gic/auth/service/CollaboratorApiService.java
+18
-0
TabSysCollaboratorMapper.java
...ava/com/gic/auth/dao/mapper/TabSysCollaboratorMapper.java
+7
-0
CollaboratorService.java
...c/main/java/com/gic/auth/service/CollaboratorService.java
+4
-0
CollaboratorServiceImpl.java
...va/com/gic/auth/service/impl/CollaboratorServiceImpl.java
+11
-0
CollaboratorApiServiceImpl.java
...c/auth/service/outer/impl/CollaboratorApiServiceImpl.java
+24
-0
TabSysCollaboratorMapper.xml
...ce/src/main/resources/mapper/TabSysCollaboratorMapper.xml
+20
-0
No files found.
gic-platform-auth-api/src/main/java/com/gic/auth/service/CollaboratorApiService.java
View file @
39074881
...
...
@@ -91,4 +91,22 @@ public interface CollaboratorApiService {
* @return com.gic.api.base.commons.ServiceResponse<java.lang.Void>
*/
ServiceResponse
<
Void
>
cancel
(
Integer
collaboratorId
);
/**
* 查询主键ID,协作人那边授权跳转,需要主键ID
* @param enterpriseId
* @param phone
* @param appId
* @return
*/
ServiceResponse
<
Integer
>
getIdByPhoneAndAppId
(
Integer
enterpriseId
,
String
phone
,
String
appId
);
/**
* 删除
* @param enterpriseId
* @param phone
* @param appId
* @return
*/
ServiceResponse
<
Void
>
deleteByPhoneAndAppId
(
Integer
enterpriseId
,
String
phone
,
String
appId
);
}
gic-platform-auth-service/src/main/java/com/gic/auth/dao/mapper/TabSysCollaboratorMapper.java
View file @
39074881
...
...
@@ -88,4 +88,10 @@ public interface TabSysCollaboratorMapper {
*/
List
<
TabSysCollaborator
>
listNotInCollaboratorIdList
(
@Param
(
"list"
)
List
<
Integer
>
collaboratorIdList
,
@Param
(
"search"
)
String
search
,
@Param
(
"enterpriseId"
)
Integer
enterpriseId
);
TabSysCollaborator
getByPhoneAndAppId
(
@Param
(
"enterpriseId"
)
Integer
enterpriseId
,
@Param
(
"phone"
)
String
phone
,
@Param
(
"appId"
)
String
appId
);
void
deleteByPhoneAndAppId
(
@Param
(
"enterpriseId"
)
Integer
enterpriseId
,
@Param
(
"phone"
)
String
phone
,
@Param
(
"appId"
)
String
appId
);
}
\ No newline at end of file
gic-platform-auth-service/src/main/java/com/gic/auth/service/CollaboratorService.java
View file @
39074881
...
...
@@ -63,4 +63,8 @@ public interface CollaboratorService {
TabSysCollaborator
getById
(
Integer
id
);
void
update
(
CollaboratorDTO
dto
);
TabSysCollaborator
getByPhoneAndAppId
(
Integer
enterpriseId
,
String
phone
,
String
appId
);
void
deleteByPhoneAndAppId
(
Integer
enterpriseId
,
String
phone
,
String
appId
);
}
gic-platform-auth-service/src/main/java/com/gic/auth/service/impl/CollaboratorServiceImpl.java
View file @
39074881
...
...
@@ -58,4 +58,15 @@ public class CollaboratorServiceImpl implements CollaboratorService {
TabSysCollaborator
record
=
EntityUtil
.
changeEntityNew
(
TabSysCollaborator
.
class
,
dto
);
tabSysCollaboratorMapper
.
updateByPrimaryKeySelective
(
record
);
}
@Override
public
TabSysCollaborator
getByPhoneAndAppId
(
Integer
enterpriseId
,
String
phone
,
String
appId
)
{
TabSysCollaborator
record
=
tabSysCollaboratorMapper
.
getByPhoneAndAppId
(
enterpriseId
,
phone
,
appId
);
return
record
;
}
@Override
public
void
deleteByPhoneAndAppId
(
Integer
enterpriseId
,
String
phone
,
String
appId
)
{
tabSysCollaboratorMapper
.
deleteByPhoneAndAppId
(
enterpriseId
,
phone
,
appId
);
}
}
gic-platform-auth-service/src/main/java/com/gic/auth/service/outer/impl/CollaboratorApiServiceImpl.java
View file @
39074881
...
...
@@ -11,6 +11,8 @@ import com.gic.enterprise.dto.EnterpriseDTO;
import
com.gic.enterprise.service.EnterpriseApiService
;
import
org.apache.commons.collections.CollectionUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.logging.log4j.LogManager
;
import
org.apache.logging.log4j.Logger
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
...
...
@@ -38,6 +40,7 @@ import com.gic.open.api.service.ApplicationSubApiService;
@Service
(
"collaboratorApiService"
)
public
class
CollaboratorApiServiceImpl
implements
CollaboratorApiService
{
private
static
final
Logger
LOGGER
=
LogManager
.
getLogger
(
CollaboratorApiServiceImpl
.
class
);
@Autowired
private
CollaboratorService
collaboratorService
;
@Autowired
...
...
@@ -206,6 +209,27 @@ public class CollaboratorApiServiceImpl implements CollaboratorApiService {
return
ServiceResponse
.
success
();
}
@Override
public
ServiceResponse
<
Integer
>
getIdByPhoneAndAppId
(
Integer
enterpriseId
,
String
phone
,
String
appId
)
{
TabSysCollaborator
record
=
collaboratorService
.
getByPhoneAndAppId
(
enterpriseId
,
phone
,
appId
);
if
(
record
==
null
)
{
LOGGER
.
info
(
"协作人接口getIdByPhoneAndAppId入参数据:{}, {}, {}"
,
enterpriseId
,
phone
,
appId
);
return
ServiceResponse
.
failure
(
ErrorCode
.
PARAMETER_ERROR
.
getCode
(),
"参数有误,查无数据"
);
}
return
ServiceResponse
.
success
(
record
.
getCollaboratorId
());
}
@Override
public
ServiceResponse
<
Void
>
deleteByPhoneAndAppId
(
Integer
enterpriseId
,
String
phone
,
String
appId
)
{
TabSysCollaborator
record
=
collaboratorService
.
getByPhoneAndAppId
(
enterpriseId
,
phone
,
appId
);
if
(
record
==
null
)
{
LOGGER
.
info
(
"协作人接口getIdByPhoneAndAppId入参数据:{}, {}, {}"
,
enterpriseId
,
phone
,
appId
);
return
ServiceResponse
.
failure
(
ErrorCode
.
PARAMETER_ERROR
.
getCode
(),
"参数有误,查无数据"
);
}
collaboratorService
.
deleteByPhoneAndAppId
(
enterpriseId
,
phone
,
appId
);
return
ServiceResponse
.
success
();
}
/**
* 英文逗号隔开的字符串转为下划线隔开
* @param string
...
...
gic-platform-auth-service/src/main/resources/mapper/TabSysCollaboratorMapper.xml
View file @
39074881
...
...
@@ -246,4 +246,23 @@
and ( collaborator_name like concat('%', #{search}, '%') or phone like concat('%', #{search}, '%') )
</if>
</select>
<select
id=
"getByPhoneAndAppId"
resultMap=
"BaseResultMap"
>
select
<include
refid=
"Base_Column_List"
></include>
from
tab_sys_collaborator
where enterprise_id = #{enterpriseId}
and phone = #{phone}
and app_id = #{appId}
and status != 0
limit 1
</select>
<update
id=
"deleteByPhoneAndAppId"
>
update tab_sys_collaborator set status = 0
where enterprise_id = #{enterpriseId}
and phone = #{phone}
and app_id = #{appId}
and status != 0
</update>
</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