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
0ee7796e
Commit
0ee7796e
authored
Sep 02, 2019
by
陶光胜
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
联合商户
parent
8245ffec
Hide whitespace changes
Inline
Side-by-side
Showing
19 changed files
with
603 additions
and
2 deletions
+603
-2
AuthorizationStatusEnum.java
...n/java/com/gic/auth/constant/AuthorizationStatusEnum.java
+30
-0
ResourceTypeEnum.java
...src/main/java/com/gic/auth/constant/ResourceTypeEnum.java
+32
-0
UnionEnterpriseDTO.java
...pi/src/main/java/com/gic/auth/dto/UnionEnterpriseDTO.java
+144
-0
AuthCodeApiService.java
...rc/main/java/com/gic/auth/service/AuthCodeApiService.java
+2
-0
UnionEnterpriseApiService.java
.../java/com/gic/auth/service/UnionEnterpriseApiService.java
+14
-0
TabSysUnionEnterpriseMapper.java
.../com/gic/auth/dao/mapper/TabSysUnionEnterpriseMapper.java
+6
-0
TabSysUnionEnterpriseResourceMapper.java
.../auth/dao/mapper/TabSysUnionEnterpriseResourceMapper.java
+6
-0
AuthCodeService.java
...e/src/main/java/com/gic/auth/service/AuthCodeService.java
+2
-0
UnionEnterpriseResourceService.java
.../com/gic/auth/service/UnionEnterpriseResourceService.java
+9
-0
UnionEnterpriseService.java
...ain/java/com/gic/auth/service/UnionEnterpriseService.java
+15
-0
AuthCodeServiceImpl.java
...n/java/com/gic/auth/service/impl/AuthCodeServiceImpl.java
+5
-0
UnionEnterpriseServiceImpl.java
...com/gic/auth/service/impl/UnionEnterpriseServiceImpl.java
+49
-0
UnionEnterrpiseResourceServiceImpl.java
...auth/service/impl/UnionEnterrpiseResourceServiceImpl.java
+47
-0
AuthCodeApiServiceImpl.java
...m/gic/auth/service/outer/impl/AuthCodeApiServiceImpl.java
+6
-0
UnionEnterpriseApiServiceImpl.java
...uth/service/outer/impl/UnionEnterpriseApiServiceImpl.java
+114
-0
TabSysUnionEnterpriseMapper.xml
...src/main/resources/mapper/TabSysUnionEnterpriseMapper.xml
+10
-2
TabSysUnionEnterpriseResourceMapper.xml
.../resources/mapper/TabSysUnionEnterpriseResourceMapper.xml
+9
-0
UnionEnterpriseController.java
...om/gic/auth/web/controller/UnionEnterpriseController.java
+16
-0
UnionEnterpriseQO.java
.../src/main/java/com/gic/auth/web/qo/UnionEnterpriseQO.java
+87
-0
No files found.
gic-platform-auth-api/src/main/java/com/gic/auth/constant/AuthorizationStatusEnum.java
0 → 100644
View file @
0ee7796e
package
com
.
gic
.
auth
.
constant
;
public
enum
AuthorizationStatusEnum
{
NORMAL
(
1
,
"授权中"
),
SUCCESS
(
2
,
"授权成功"
),
FAIL
(
3
,
"授权失败"
);
private
Integer
code
;
private
String
message
;
AuthorizationStatusEnum
(
Integer
code
,
String
message
){
this
.
code
=
code
;
this
.
message
=
message
;
}
public
Integer
getCode
()
{
return
code
;
}
public
void
setCode
(
Integer
code
)
{
this
.
code
=
code
;
}
public
String
getMessage
()
{
return
message
;
}
public
void
setMessage
(
String
message
)
{
this
.
message
=
message
;
}
}
gic-platform-auth-api/src/main/java/com/gic/auth/constant/ResourceTypeEnum.java
0 → 100644
View file @
0ee7796e
package
com
.
gic
.
auth
.
constant
;
public
enum
ResourceTypeEnum
{
MEMBER_CARD_RESOURCE
(
1
,
"会员卡资源"
),
FWH_RESOURCE
(
2
,
"服务号资源"
),
APPLET_RESOURCE
(
3
,
"小程序资源"
),
STORE_RESOURCE
(
4
,
"门店资源"
),
GOODS_RESOURCE
(
5
,
"商品资源"
);
private
Integer
code
;
private
String
message
;
ResourceTypeEnum
(
Integer
code
,
String
message
){
this
.
code
=
code
;
this
.
message
=
message
;
}
public
Integer
getCode
()
{
return
code
;
}
public
void
setCode
(
Integer
code
)
{
this
.
code
=
code
;
}
public
String
getMessage
()
{
return
message
;
}
public
void
setMessage
(
String
message
)
{
this
.
message
=
message
;
}
}
gic-platform-auth-api/src/main/java/com/gic/auth/dto/UnionEnterpriseDTO.java
0 → 100644
View file @
0ee7796e
package
com
.
gic
.
auth
.
dto
;
import
java.io.Serializable
;
import
java.util.Date
;
/**
* tab_sys_union_enterprise
*/
public
class
UnionEnterpriseDTO
implements
Serializable
{
/**
*
*/
private
Integer
unionId
;
/**
*
*/
private
Integer
unionEnterpriseId
;
/**
*
*/
private
String
unionEnterpriseName
;
/**
*
*/
private
Integer
status
;
/**
* 授权状态,1授权中 2授权成功 3授权失败
*/
private
Integer
authorizationStatus
;
/**
*
*/
private
Date
authorizationTime
;
private
Integer
enterpriseId
;
private
Long
memberCardResourceId
;
private
Long
fwhResourceId
;
private
Long
appletResourceId
;
private
Long
storeResourceId
;
private
Long
goodsResourceId
;
public
Integer
getUnionId
()
{
return
unionId
;
}
public
void
setUnionId
(
Integer
unionId
)
{
this
.
unionId
=
unionId
;
}
public
Integer
getUnionEnterpriseId
()
{
return
unionEnterpriseId
;
}
public
void
setUnionEnterpriseId
(
Integer
unionEnterpriseId
)
{
this
.
unionEnterpriseId
=
unionEnterpriseId
;
}
public
String
getUnionEnterpriseName
()
{
return
unionEnterpriseName
;
}
public
void
setUnionEnterpriseName
(
String
unionEnterpriseName
)
{
this
.
unionEnterpriseName
=
unionEnterpriseName
;
}
public
Integer
getStatus
()
{
return
status
;
}
public
void
setStatus
(
Integer
status
)
{
this
.
status
=
status
;
}
public
Integer
getAuthorizationStatus
()
{
return
authorizationStatus
;
}
public
void
setAuthorizationStatus
(
Integer
authorizationStatus
)
{
this
.
authorizationStatus
=
authorizationStatus
;
}
public
Date
getAuthorizationTime
()
{
return
authorizationTime
;
}
public
void
setAuthorizationTime
(
Date
authorizationTime
)
{
this
.
authorizationTime
=
authorizationTime
;
}
public
Integer
getEnterpriseId
()
{
return
enterpriseId
;
}
public
void
setEnterpriseId
(
Integer
enterpriseId
)
{
this
.
enterpriseId
=
enterpriseId
;
}
public
Long
getMemberCardResourceId
()
{
return
memberCardResourceId
;
}
public
void
setMemberCardResourceId
(
Long
memberCardResourceId
)
{
this
.
memberCardResourceId
=
memberCardResourceId
;
}
public
Long
getFwhResourceId
()
{
return
fwhResourceId
;
}
public
void
setFwhResourceId
(
Long
fwhResourceId
)
{
this
.
fwhResourceId
=
fwhResourceId
;
}
public
Long
getAppletResourceId
()
{
return
appletResourceId
;
}
public
void
setAppletResourceId
(
Long
appletResourceId
)
{
this
.
appletResourceId
=
appletResourceId
;
}
public
Long
getStoreResourceId
()
{
return
storeResourceId
;
}
public
void
setStoreResourceId
(
Long
storeResourceId
)
{
this
.
storeResourceId
=
storeResourceId
;
}
public
Long
getGoodsResourceId
()
{
return
goodsResourceId
;
}
public
void
setGoodsResourceId
(
Long
goodsResourceId
)
{
this
.
goodsResourceId
=
goodsResourceId
;
}
}
\ No newline at end of file
gic-platform-auth-api/src/main/java/com/gic/auth/service/AuthCodeApiService.java
View file @
0ee7796e
...
...
@@ -28,4 +28,6 @@ public interface AuthCodeApiService {
* @return
*/
ServiceResponse
<
AuthCodeDTO
>
getAuthCode
(
Integer
enterpriseId
,
Integer
relationId
);
ServiceResponse
<
AuthCodeDTO
>
getAuthCode
(
Integer
authCodeId
);
}
gic-platform-auth-api/src/main/java/com/gic/auth/service/UnionEnterpriseApiService.java
0 → 100644
View file @
0ee7796e
package
com
.
gic
.
auth
.
service
;
import
com.gic.api.base.commons.ServiceResponse
;
import
com.gic.auth.dto.UnionEnterpriseDTO
;
public
interface
UnionEnterpriseApiService
{
ServiceResponse
<
Integer
>
saveUnionEnterprise
(
UnionEnterpriseDTO
enterpriseDTO
);
ServiceResponse
<
UnionEnterpriseDTO
>
getUnionEnterpriseByUnionEnterpriseId
(
Integer
unionEnterrpiseId
);
ServiceResponse
<
Integer
>
delUnionEnterprise
(
Integer
unionId
);
ServiceResponse
<
UnionEnterpriseDTO
>
getUnionEnterpriseById
(
Integer
unionId
);
}
gic-platform-auth-service/src/main/java/com/gic/auth/dao/mapper/TabSysUnionEnterpriseMapper.java
View file @
0ee7796e
package
com
.
gic
.
auth
.
dao
.
mapper
;
import
com.gic.auth.entity.TabSysUnionEnterprise
;
import
org.apache.ibatis.annotations.Param
;
import
java.util.List
;
public
interface
TabSysUnionEnterpriseMapper
{
/**
...
...
@@ -50,4 +53,6 @@ public interface TabSysUnionEnterpriseMapper {
* @return 更新条目数
*/
int
updateByPrimaryKey
(
TabSysUnionEnterprise
record
);
List
<
TabSysUnionEnterprise
>
getEnterpriseByUnionEnterpriseId
(
@Param
(
"unionEnterpriseId"
)
Integer
unionEnterpriseId
);
}
\ No newline at end of file
gic-platform-auth-service/src/main/java/com/gic/auth/dao/mapper/TabSysUnionEnterpriseResourceMapper.java
View file @
0ee7796e
package
com
.
gic
.
auth
.
dao
.
mapper
;
import
com.gic.auth.entity.TabSysUnionEnterpriseResource
;
import
org.apache.ibatis.annotations.Param
;
import
java.util.List
;
public
interface
TabSysUnionEnterpriseResourceMapper
{
/**
...
...
@@ -50,4 +53,6 @@ public interface TabSysUnionEnterpriseResourceMapper {
* @return 更新条目数
*/
int
updateByPrimaryKey
(
TabSysUnionEnterpriseResource
record
);
List
<
TabSysUnionEnterpriseResource
>
getResource
(
@Param
(
"unionId"
)
Integer
unionId
,
@Param
(
"type"
)
int
type
);
}
\ No newline at end of file
gic-platform-auth-service/src/main/java/com/gic/auth/service/AuthCodeService.java
View file @
0ee7796e
...
...
@@ -8,4 +8,6 @@ public interface AuthCodeService {
int
expireAuthCode
(
Integer
authCodeId
);
TabSysAuthCode
getAuthCode
(
Integer
enterpriseId
,
Integer
relationId
);
TabSysAuthCode
getAuthCode
(
Integer
authCodeId
);
}
gic-platform-auth-service/src/main/java/com/gic/auth/service/UnionEnterpriseResourceService.java
0 → 100644
View file @
0ee7796e
package
com
.
gic
.
auth
.
service
;
import
com.gic.auth.entity.TabSysUnionEnterpriseResource
;
public
interface
UnionEnterpriseResourceService
{
int
saveResource
(
Integer
unionId
,
Long
resourceId
,
int
type
);
TabSysUnionEnterpriseResource
getByUnionIdAndType
(
Integer
unionId
,
int
type
);
}
gic-platform-auth-service/src/main/java/com/gic/auth/service/UnionEnterpriseService.java
0 → 100644
View file @
0ee7796e
package
com
.
gic
.
auth
.
service
;
import
com.gic.auth.entity.TabSysUnionEnterprise
;
public
interface
UnionEnterpriseService
{
int
saveUnionEnterprise
(
TabSysUnionEnterprise
tabSysUnionEnterprise
);
int
updateUnionEnterprise
(
TabSysUnionEnterprise
tabSysUnionEnterprise
);
TabSysUnionEnterprise
getUnionEnterpriseByUnionEnterpriseId
(
Integer
unionEnterpriseId
);
int
delUnionEnterprise
(
Integer
id
);
TabSysUnionEnterprise
getUnionEnterpriseById
(
Integer
unionId
);
}
gic-platform-auth-service/src/main/java/com/gic/auth/service/impl/AuthCodeServiceImpl.java
View file @
0ee7796e
...
...
@@ -35,4 +35,9 @@ public class AuthCodeServiceImpl implements AuthCodeService {
}
return
null
;
}
@Override
public
TabSysAuthCode
getAuthCode
(
Integer
authCodeId
)
{
return
this
.
tabSysAuthCodeMapper
.
selectByPrimaryKey
(
authCodeId
);
}
}
gic-platform-auth-service/src/main/java/com/gic/auth/service/impl/UnionEnterpriseServiceImpl.java
0 → 100644
View file @
0ee7796e
package
com
.
gic
.
auth
.
service
.
impl
;
import
com.gic.auth.dao.mapper.TabSysUnionEnterpriseMapper
;
import
com.gic.auth.entity.TabSysUnionEnterprise
;
import
com.gic.auth.service.UnionEnterpriseService
;
import
com.gic.enterprise.constants.Constants
;
import
org.apache.commons.collections.CollectionUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
java.util.List
;
@Service
(
"unionEnterpriseService"
)
public
class
UnionEnterpriseServiceImpl
implements
UnionEnterpriseService
{
@Autowired
private
TabSysUnionEnterpriseMapper
tabSysUnionEnterpriseMapper
;
@Override
public
int
saveUnionEnterprise
(
TabSysUnionEnterprise
tabSysUnionEnterprise
)
{
return
this
.
tabSysUnionEnterpriseMapper
.
insert
(
tabSysUnionEnterprise
);
}
@Override
public
int
updateUnionEnterprise
(
TabSysUnionEnterprise
tabSysUnionEnterprise
)
{
return
this
.
tabSysUnionEnterpriseMapper
.
updateByPrimaryKeySelective
(
tabSysUnionEnterprise
);
}
@Override
public
TabSysUnionEnterprise
getUnionEnterpriseByUnionEnterpriseId
(
Integer
unionEnterpriseId
)
{
List
<
TabSysUnionEnterprise
>
list
=
this
.
tabSysUnionEnterpriseMapper
.
getEnterpriseByUnionEnterpriseId
(
unionEnterpriseId
);
if
(
CollectionUtils
.
isNotEmpty
(
list
)){
return
list
.
get
(
0
);
}
return
null
;
}
@Override
public
int
delUnionEnterprise
(
Integer
id
)
{
TabSysUnionEnterprise
enterprise
=
new
TabSysUnionEnterprise
();
enterprise
.
setUnionId
(
id
);
enterprise
.
setStatus
(
Constants
.
DEL_STATUS
);
return
this
.
tabSysUnionEnterpriseMapper
.
updateByPrimaryKeySelective
(
enterprise
);
}
@Override
public
TabSysUnionEnterprise
getUnionEnterpriseById
(
Integer
unionId
)
{
return
this
.
tabSysUnionEnterpriseMapper
.
selectByPrimaryKey
(
unionId
);
}
}
gic-platform-auth-service/src/main/java/com/gic/auth/service/impl/UnionEnterrpiseResourceServiceImpl.java
0 → 100644
View file @
0ee7796e
package
com
.
gic
.
auth
.
service
.
impl
;
import
com.gic.auth.constant.AuthorizationStatusEnum
;
import
com.gic.auth.dao.mapper.TabSysUnionEnterpriseResourceMapper
;
import
com.gic.auth.entity.TabSysUnionEnterpriseResource
;
import
com.gic.auth.service.UnionEnterpriseResourceService
;
import
com.gic.enterprise.constants.Constants
;
import
org.apache.commons.collections.CollectionUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
java.util.Date
;
import
java.util.List
;
@Service
(
"unionEnterpriseResourceService"
)
public
class
UnionEnterrpiseResourceServiceImpl
implements
UnionEnterpriseResourceService
{
@Autowired
private
TabSysUnionEnterpriseResourceMapper
tabSysUnionEnterpriseResourceMapper
;
@Override
public
int
saveResource
(
Integer
unionId
,
Long
resourceId
,
int
type
)
{
TabSysUnionEnterpriseResource
resource
=
new
TabSysUnionEnterpriseResource
();
resource
.
setResource
(
resourceId
);
TabSysUnionEnterpriseResource
tabSysUnionEnterpriseResource
=
this
.
getByUnionIdAndType
(
unionId
,
type
);
if
(
tabSysUnionEnterpriseResource
!=
null
){
resource
.
setUnionResourceId
(
tabSysUnionEnterpriseResource
.
getUnionResourceId
());
return
this
.
tabSysUnionEnterpriseResourceMapper
.
updateByPrimaryKeySelective
(
resource
);
}
else
{
resource
.
setAuthorizationStatus
(
AuthorizationStatusEnum
.
NORMAL
.
getCode
());
resource
.
setStatus
(
Constants
.
NORMAL_STATUS
);
resource
.
setUpdateTime
(
new
Date
());
resource
.
setCreateTime
(
new
Date
());
resource
.
setUnionId
(
unionId
);
resource
.
setResourceType
(
type
);
return
this
.
tabSysUnionEnterpriseResourceMapper
.
insert
(
resource
);
}
}
@Override
public
TabSysUnionEnterpriseResource
getByUnionIdAndType
(
Integer
unionId
,
int
type
)
{
List
<
TabSysUnionEnterpriseResource
>
list
=
this
.
tabSysUnionEnterpriseResourceMapper
.
getResource
(
unionId
,
type
);
if
(
CollectionUtils
.
isNotEmpty
(
list
)){
return
list
.
get
(
0
);
}
return
null
;
}
}
gic-platform-auth-service/src/main/java/com/gic/auth/service/outer/impl/AuthCodeApiServiceImpl.java
View file @
0ee7796e
...
...
@@ -36,4 +36,10 @@ public class AuthCodeApiServiceImpl implements AuthCodeApiService {
TabSysAuthCode
sysAuthCode
=
this
.
authCodeService
.
getAuthCode
(
enterpriseId
,
relationId
);
return
ServiceResponse
.
success
(
EntityUtil
.
changeEntityByJSON
(
AuthCodeDTO
.
class
,
sysAuthCode
));
}
@Override
public
ServiceResponse
<
AuthCodeDTO
>
getAuthCode
(
Integer
authCodeId
)
{
TabSysAuthCode
sysAuthCode
=
this
.
authCodeService
.
getAuthCode
(
authCodeId
);
return
ServiceResponse
.
success
(
EntityUtil
.
changeEntityByJSON
(
AuthCodeDTO
.
class
,
sysAuthCode
));
}
}
gic-platform-auth-service/src/main/java/com/gic/auth/service/outer/impl/UnionEnterpriseApiServiceImpl.java
0 → 100644
View file @
0ee7796e
package
com
.
gic
.
auth
.
service
.
outer
.
impl
;
import
com.gic.api.base.commons.ServiceResponse
;
import
com.gic.auth.constant.ResourceTypeEnum
;
import
com.gic.auth.dto.UnionEnterpriseDTO
;
import
com.gic.auth.entity.TabSysUnionEnterprise
;
import
com.gic.auth.entity.TabSysUnionEnterpriseResource
;
import
com.gic.auth.service.UnionEnterpriseApiService
;
import
com.gic.auth.service.UnionEnterpriseResourceService
;
import
com.gic.auth.service.UnionEnterpriseService
;
import
com.gic.commons.util.EntityUtil
;
import
com.gic.enterprise.constants.Constants
;
import
com.gic.enterprise.dto.EnterpriseDTO
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
java.util.Date
;
@Service
(
"unionEnterpriseApiService"
)
public
class
UnionEnterpriseApiServiceImpl
implements
UnionEnterpriseApiService
{
@Autowired
private
UnionEnterpriseService
unionEnterpriseService
;
@Autowired
private
UnionEnterpriseResourceService
unionEnterpriseResourceService
;
@Override
@Transactional
public
ServiceResponse
<
Integer
>
saveUnionEnterprise
(
UnionEnterpriseDTO
enterpriseDTO
)
{
TabSysUnionEnterprise
unionEnterprise
=
EntityUtil
.
changeEntityByJSON
(
TabSysUnionEnterprise
.
class
,
enterpriseDTO
);
if
(
enterpriseDTO
.
getUnionId
()
==
null
)
{
unionEnterprise
.
setCreateTime
(
new
Date
());
unionEnterprise
.
setStatus
(
Constants
.
NORMAL_STATUS
);
unionEnterprise
.
setAuthorizationStatus
(
Constants
.
NORMAL_STATUS
);
unionEnterprise
.
setUpdateTime
(
new
Date
());
int
i
=
this
.
unionEnterpriseService
.
updateUnionEnterprise
(
unionEnterprise
);
if
(
i
>
0
)
{
this
.
saveResource
(
unionEnterprise
.
getUnionId
(),
enterpriseDTO
);
return
ServiceResponse
.
success
(
i
);
}
}
return
ServiceResponse
.
success
();
}
@Override
public
ServiceResponse
<
UnionEnterpriseDTO
>
getUnionEnterpriseByUnionEnterpriseId
(
Integer
unionEnterrpiseId
)
{
TabSysUnionEnterprise
enterprise
=
this
.
unionEnterpriseService
.
getUnionEnterpriseByUnionEnterpriseId
(
unionEnterrpiseId
);
UnionEnterpriseDTO
enterpriseDTO
=
EntityUtil
.
changeEntityByJSON
(
UnionEnterpriseDTO
.
class
,
enterprise
);
this
.
getResource
(
enterprise
.
getUnionId
(),
enterpriseDTO
);
return
ServiceResponse
.
success
(
enterpriseDTO
);
}
@Override
public
ServiceResponse
<
Integer
>
delUnionEnterprise
(
Integer
unionId
)
{
int
i
=
this
.
unionEnterpriseService
.
delUnionEnterprise
(
unionId
);
return
ServiceResponse
.
success
(
i
);
}
@Override
public
ServiceResponse
<
UnionEnterpriseDTO
>
getUnionEnterpriseById
(
Integer
unionId
)
{
TabSysUnionEnterprise
enterprise
=
this
.
unionEnterpriseService
.
getUnionEnterpriseById
(
unionId
);
UnionEnterpriseDTO
enterpriseDTO
=
EntityUtil
.
changeEntityByJSON
(
UnionEnterpriseDTO
.
class
,
enterprise
);
this
.
getResource
(
unionId
,
enterpriseDTO
);
return
ServiceResponse
.
success
(
enterpriseDTO
);
}
private
int
saveResource
(
Integer
unionId
,
UnionEnterpriseDTO
enterpriseDTO
){
int
i
=
0
;
i
=
this
.
unionEnterpriseResourceService
.
saveResource
(
unionId
,
enterpriseDTO
.
getMemberCardResourceId
(),
ResourceTypeEnum
.
MEMBER_CARD_RESOURCE
.
getCode
());
if
(
i
==
0
){
throw
new
RuntimeException
();
}
i
=
this
.
unionEnterpriseResourceService
.
saveResource
(
unionId
,
enterpriseDTO
.
getFwhResourceId
(),
ResourceTypeEnum
.
FWH_RESOURCE
.
getCode
());
if
(
i
==
0
){
throw
new
RuntimeException
();
}
i
=
this
.
unionEnterpriseResourceService
.
saveResource
(
unionId
,
enterpriseDTO
.
getAppletResourceId
(),
ResourceTypeEnum
.
APPLET_RESOURCE
.
getCode
());
if
(
i
==
0
){
throw
new
RuntimeException
();
}
i
=
this
.
unionEnterpriseResourceService
.
saveResource
(
unionId
,
enterpriseDTO
.
getStoreResourceId
(),
ResourceTypeEnum
.
STORE_RESOURCE
.
getCode
());
if
(
i
==
0
){
throw
new
RuntimeException
();
}
i
=
this
.
unionEnterpriseResourceService
.
saveResource
(
unionId
,
enterpriseDTO
.
getGoodsResourceId
(),
ResourceTypeEnum
.
GOODS_RESOURCE
.
getCode
());
if
(
i
==
0
){
throw
new
RuntimeException
();
}
return
i
;
}
private
void
getResource
(
Integer
unionId
,
UnionEnterpriseDTO
enterpriseDTO
){
TabSysUnionEnterpriseResource
resource
=
this
.
unionEnterpriseResourceService
.
getByUnionIdAndType
(
unionId
,
ResourceTypeEnum
.
MEMBER_CARD_RESOURCE
.
getCode
());
if
(
resource
!=
null
){
enterpriseDTO
.
setMemberCardResourceId
(
resource
.
getResource
());
}
resource
=
this
.
unionEnterpriseResourceService
.
getByUnionIdAndType
(
unionId
,
ResourceTypeEnum
.
FWH_RESOURCE
.
getCode
());
if
(
resource
!=
null
){
enterpriseDTO
.
setFwhResourceId
(
resource
.
getResource
());
}
resource
=
this
.
unionEnterpriseResourceService
.
getByUnionIdAndType
(
unionId
,
ResourceTypeEnum
.
APPLET_RESOURCE
.
getCode
());
if
(
resource
!=
null
){
enterpriseDTO
.
setAppletResourceId
(
resource
.
getResource
());
}
resource
=
this
.
unionEnterpriseResourceService
.
getByUnionIdAndType
(
unionId
,
ResourceTypeEnum
.
STORE_RESOURCE
.
getCode
());
if
(
resource
!=
null
){
enterpriseDTO
.
setStoreResourceId
(
resource
.
getResource
());
}
resource
=
this
.
unionEnterpriseResourceService
.
getByUnionIdAndType
(
unionId
,
ResourceTypeEnum
.
GOODS_RESOURCE
.
getCode
());
if
(
resource
!=
null
){
enterpriseDTO
.
setGoodsResourceId
(
resource
.
getResource
());
}
}
}
gic-platform-auth-service/src/main/resources/mapper/TabSysUnionEnterpriseMapper.xml
View file @
0ee7796e
...
...
@@ -26,7 +26,7 @@
delete from tab_sys_union_enterprise
where union_id = #{unionId,jdbcType=INTEGER}
</delete>
<insert
id=
"insert"
parameterType=
"com.gic.auth.entity.TabSysUnionEnterprise"
>
<insert
id=
"insert"
parameterType=
"com.gic.auth.entity.TabSysUnionEnterprise"
useGeneratedKeys=
"true"
keyProperty=
"union_id"
>
insert into tab_sys_union_enterprise (union_id, union_enterprise_id, union_enterprise_name,
status, authorization_status, authorization_time,
create_time, update_time, enterprise_id
...
...
@@ -36,7 +36,7 @@
#{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}, #{enterpriseId,jdbcType=INTEGER}
)
</insert>
<insert
id=
"insertSelective"
parameterType=
"com.gic.auth.entity.TabSysUnionEnterprise"
>
<insert
id=
"insertSelective"
parameterType=
"com.gic.auth.entity.TabSysUnionEnterprise"
useGeneratedKeys=
"true"
keyProperty=
"union_id"
>
insert into tab_sys_union_enterprise
<trim
prefix=
"("
suffix=
")"
suffixOverrides=
","
>
<if
test=
"unionId != null"
>
...
...
@@ -139,4 +139,11 @@
enterprise_id = #{enterpriseId,jdbcType=INTEGER}
where union_id = #{unionId,jdbcType=INTEGER}
</update>
<select
id=
"getEnterpriseByUnionEnterpriseId"
resultMap=
"BaseResultMap"
>
select
<include
refid=
"Base_Column_List"
/>
from tab_sys_union_enterprise
where union_enterprise_id = #{unionId,jdbcType=INTEGER}
and status=1
</select>
</mapper>
\ No newline at end of file
gic-platform-auth-service/src/main/resources/mapper/TabSysUnionEnterpriseResourceMapper.xml
View file @
0ee7796e
...
...
@@ -163,4 +163,12 @@
status = #{status,jdbcType=INTEGER}
where union_resource_id = #{unionResourceId,jdbcType=INTEGER}
</update>
<select
id=
"getResource"
resultMap=
"BaseResultMap"
>
select
<include
refid=
"Base_Column_List"
/>
from tab_sys_union_enterprise_resource
where union_id = #{unionResourceId,jdbcType=INTEGER}
and resource_type = #{type}
and status = 1
</select>
</mapper>
\ No newline at end of file
gic-platform-auth-web/src/main/java/com/gic/auth/web/controller/UnionEnterpriseController.java
0 → 100644
View file @
0ee7796e
package
com
.
gic
.
auth
.
web
.
controller
;
import
com.gic.auth.web.qo.UnionEnterpriseQO
;
import
com.gic.commons.webapi.reponse.RestResponse
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
@RestController
public
class
UnionEnterpriseController
{
@RequestMapping
(
"save-union-enterprise"
)
public
RestResponse
saveUnionEnterprise
(
UnionEnterpriseQO
unionEnterpriseQO
){
return
null
;
}
}
gic-platform-auth-web/src/main/java/com/gic/auth/web/qo/UnionEnterpriseQO.java
0 → 100644
View file @
0ee7796e
package
com
.
gic
.
auth
.
web
.
qo
;
import
java.io.Serializable
;
public
class
UnionEnterpriseQO
implements
Serializable
{
private
Integer
unionEnterpriseId
;
private
String
unionEnterpriseName
;
private
String
authCode
;
private
Long
memberCardResource
;
private
Long
fwhResource
;
private
Long
appletResource
;
private
Long
storeResource
;
private
Long
goodsResource
;
private
Integer
authCodeId
;
public
Integer
getUnionEnterpriseId
()
{
return
unionEnterpriseId
;
}
public
void
setUnionEnterpriseId
(
Integer
unionEnterpriseId
)
{
this
.
unionEnterpriseId
=
unionEnterpriseId
;
}
public
String
getUnionEnterpriseName
()
{
return
unionEnterpriseName
;
}
public
void
setUnionEnterpriseName
(
String
unionEnterpriseName
)
{
this
.
unionEnterpriseName
=
unionEnterpriseName
;
}
public
String
getAuthCode
()
{
return
authCode
;
}
public
void
setAuthCode
(
String
authCode
)
{
this
.
authCode
=
authCode
;
}
public
Long
getMemberCardResource
()
{
return
memberCardResource
;
}
public
void
setMemberCardResource
(
Long
memberCardResource
)
{
this
.
memberCardResource
=
memberCardResource
;
}
public
Long
getFwhResource
()
{
return
fwhResource
;
}
public
void
setFwhResource
(
Long
fwhResource
)
{
this
.
fwhResource
=
fwhResource
;
}
public
Long
getAppletResource
()
{
return
appletResource
;
}
public
void
setAppletResource
(
Long
appletResource
)
{
this
.
appletResource
=
appletResource
;
}
public
Long
getStoreResource
()
{
return
storeResource
;
}
public
void
setStoreResource
(
Long
storeResource
)
{
this
.
storeResource
=
storeResource
;
}
public
Long
getGoodsResource
()
{
return
goodsResource
;
}
public
void
setGoodsResource
(
Long
goodsResource
)
{
this
.
goodsResource
=
goodsResource
;
}
public
Integer
getAuthCodeId
()
{
return
authCodeId
;
}
public
void
setAuthCodeId
(
Integer
authCodeId
)
{
this
.
authCodeId
=
authCodeId
;
}
}
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