Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
H
haoban-manage3.0
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
haoban3.0
haoban-manage3.0
Commits
ed317973
Commit
ed317973
authored
Jun 04, 2020
by
fudahua
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
pay支付接口
parent
ea811b1d
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
207 additions
and
13 deletions
+207
-13
PayController.java
...a/com/gic/haoban/manage/web/controller/PayController.java
+86
-12
HaoBanErrCode.java
...java/com/gic/haoban/manage/web/errCode/HaoBanErrCode.java
+2
-1
EnterpriseVo.java
.../main/java/com/gic/haoban/manage/web/vo/EnterpriseVo.java
+51
-0
WxClerkInfoVO.java
...main/java/com/gic/haoban/manage/web/vo/WxClerkInfoVO.java
+66
-0
dubbo-haoban-manage3-operation-web.xml
...ain/webapp/WEB-INF/dubbo-haoban-manage3-operation-web.xml
+1
-0
spring-interceptor.xml
...ration-web/src/main/webapp/WEB-INF/spring-interceptor.xml
+1
-0
No files found.
haoban-manage3-operation-web/src/main/java/com/gic/haoban/manage/web/controller/PayController.java
View file @
ed317973
package
com
.
gic
.
haoban
.
manage
.
web
.
controller
;
import
com.gic.clerk.api.dto.ClerkListDTO
;
import
com.gic.clerk.api.service.ClerkService
;
import
com.gic.enterprise.api.dto.*
;
import
com.gic.enterprise.api.dto.EnterpriseDTO
;
import
com.gic.enterprise.api.service.EnterpriseService
;
import
com.gic.enterprise.api.service.StoreService
;
import
com.gic.haoban.common.utils.EntityUtil
;
import
com.gic.haoban.common.utils.HaobanResponse
;
import
com.gic.haoban.manage.api.dto.StaffClerkInfoDTO
;
import
com.gic.haoban.manage.api.dto.StaffDTO
;
import
com.gic.haoban.manage.api.dto.WxEnterpriseDTO
;
import
com.gic.haoban.manage.api.dto.*
;
import
com.gic.haoban.manage.api.service.StaffApiService
;
import
com.gic.haoban.manage.api.service.StaffClerkRelationApiService
;
import
com.gic.haoban.manage.api.service.WxEnterpriseApiService
;
import
com.gic.haoban.manage.api.service.WxEnterpriseRelatedApiService
;
import
com.gic.haoban.manage.web.errCode.HaoBanErrCode
;
import
com.gic.haoban.manage.web.vo.EnterpriseVo
;
import
com.gic.haoban.manage.web.vo.WxClerkInfoVO
;
import
org.apache.commons.collections.CollectionUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
...
...
@@ -16,6 +25,9 @@ import org.springframework.web.bind.annotation.RequestMapping;
import
org.springframework.web.bind.annotation.RestController
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Set
;
import
java.util.stream.Collectors
;
/**
* Created 2020/6/3.
...
...
@@ -34,8 +46,21 @@ public class PayController extends WebBaseController {
@Autowired
private
WxEnterpriseApiService
wxEnterpriseApiService
;
@Autowired
private
StaffClerkRelationApiService
staffClerkRelationApiService
;
@Autowired
private
ClerkService
clerkService
;
@Autowired
private
StoreService
storeService
;
@Autowired
private
WxEnterpriseRelatedApiService
wxEnterpriseRelatedApiService
;
@Autowired
private
EnterpriseService
enterpriseService
;
/**
* 微信成员列表
* @param userId
...
...
@@ -43,7 +68,7 @@ public class PayController extends WebBaseController {
* @return
*/
@RequestMapping
(
"/wx-user-list"
)
public
HaobanResponse
enterprise
List
(
String
userId
,
String
corpId
)
{
public
HaobanResponse
user
List
(
String
userId
,
String
corpId
)
{
if
(
StringUtils
.
isAnyBlank
(
userId
,
corpId
))
{
logger
.
info
(
"参数异常"
);
return
resultResponse
(
HaoBanErrCode
.
ERR_2
);
...
...
@@ -68,20 +93,69 @@ public class PayController extends WebBaseController {
* @param storeId
* @return
*/
@RequestMapping
(
"/store-list"
)
public
HaobanResponse
enterpriseList
(
String
store
Id
)
{
@RequestMapping
(
"/store-
clerk-
list"
)
public
HaobanResponse
storeList
(
String
storeId
,
String
corp
Id
)
{
WxEnterpriseDTO
enterpriseDTO
=
wxEnterpriseApiService
.
getEnterpriseBycorpId
(
corpId
);
if
(
enterpriseDTO
==
null
)
{
logger
.
info
(
"不存在商户"
);
return
resultResponse
(
HaoBanErrCode
.
ERR_20001
);
}
StaffDTO
staffDTO
=
staffApiService
.
selectByUserIdAndEnterpriseId
(
userId
,
enterpriseDTO
.
getWxEnterpriseId
());
if
(
staffDTO
==
null
)
{
logger
.
info
(
"不存在成员"
);
return
resultResponse
(
HaoBanErrCode
.
ERR_6
);
StoreDTO
store
=
storeService
.
getStore
(
storeId
);
if
(
store
==
null
)
{
logger
.
info
(
"不存在门店"
);
return
resultResponse
(
HaoBanErrCode
.
ERR_20002
);
}
List
<
ClerkListDTO
>
list
=
clerkService
.
getClerkByStoreId
(
store
.
getEnterpriseId
(),
storeId
);
List
<
WxClerkInfoVO
>
retList
=
EntityUtil
.
changeEntityListByJSON
(
WxClerkInfoVO
.
class
,
list
);
if
(
CollectionUtils
.
isNotEmpty
(
retList
))
{
List
<
StaffClerkRelationDTO
>
relationDTOS
=
staffClerkRelationApiService
.
listByStoreId
(
storeId
);
Map
<
String
,
StaffClerkRelationDTO
>
maps
=
relationDTOS
.
stream
().
collect
(
Collectors
.
toMap
(
StaffClerkRelationDTO:
:
getClerkId
,
mid
->
mid
));
retList
.
stream
().
forEach
(
wxClerkInfoVO
->
{
StaffClerkRelationDTO
relationDTO
=
maps
.
get
(
wxClerkInfoVO
.
getClerkId
());
if
(
null
!=
relationDTO
)
{
wxClerkInfoVO
.
setStaffId
(
relationDTO
.
getStaffId
());
wxClerkInfoVO
.
setWxUserId
(
relationDTO
.
getWxUserId
());
}
});
}
return
resultResponse
(
HaoBanErrCode
.
ERR_1
,
retList
);
}
List
<
StaffClerkInfoDTO
>
list
=
staffClerkRelationApiService
.
listBindDetailByStaffId
(
staffDTO
.
getStaffId
());
return
resultResponse
(
HaoBanErrCode
.
ERR_1
,
list
);
/**
* 微信企业列表
* @return
*/
@RequestMapping
(
"/enterprise-list"
)
public
HaobanResponse
enterpriseList
()
{
List
<
EnterpriseDetailDTO
>
list
=
wxEnterpriseRelatedApiService
.
queryAllHasGicEnterpriseId
();
Set
<
String
>
wxEnterpriseIds
=
list
.
stream
().
map
(
enterpriseDetailDTO
->
{
return
enterpriseDetailDTO
.
getWxEnterpriseId
();
}).
collect
(
Collectors
.
toSet
());
List
<
String
>
enterpriseIds
=
list
.
stream
().
map
(
enterpriseDetailDTO
->
{
return
enterpriseDetailDTO
.
getEnterpriseId
();
}).
collect
(
Collectors
.
toList
());
List
<
EnterpriseDTO
>
enterpriseDTOS
=
enterpriseService
.
listEnterpriseByIds
(
enterpriseIds
);
Map
<
String
,
EnterpriseDTO
>
gicEntMap
=
enterpriseDTOS
.
stream
().
collect
(
Collectors
.
toMap
(
EnterpriseDTO:
:
getEnterpriseId
,
_t
->
_t
));
List
<
EnterpriseVo
>
enterpriseVos
=
EntityUtil
.
changeEntityListByJSON
(
EnterpriseVo
.
class
,
list
);
List
<
YwWxEnterpriseDTO
>
ywWxEnterpriseDTOS
=
wxEnterpriseApiService
.
listByIds
(
wxEnterpriseIds
);
Map
<
String
,
YwWxEnterpriseDTO
>
map
=
ywWxEnterpriseDTOS
.
stream
().
collect
(
Collectors
.
toMap
(
YwWxEnterpriseDTO:
:
getWxEnterpriseId
,
_t
->
_t
));
enterpriseVos
.
forEach
(
enterpriseVo
->
{
YwWxEnterpriseDTO
enterpriseDTO
=
map
.
get
(
enterpriseVo
.
getWxEnterpiseId
());
EnterpriseDTO
gicEnt
=
gicEntMap
.
get
(
enterpriseVo
.
getEnterpriseId
());
if
(
null
!=
enterpriseDTO
)
{
enterpriseVo
.
setWxEnterpiseName
(
enterpriseDTO
.
getCorpName
());
}
if
(
null
!=
gicEnt
)
{
enterpriseVo
.
setEnterpriseName
(
gicEnt
.
getEnterpriseName
());
}
});
return
resultResponse
(
HaoBanErrCode
.
ERR_1
,
enterpriseVos
);
}
}
haoban-manage3-operation-web/src/main/java/com/gic/haoban/manage/web/errCode/HaoBanErrCode.java
View file @
ed317973
...
...
@@ -70,7 +70,8 @@ public enum HaoBanErrCode {
ERR_10006
(
10006
,
"字典key已存在"
),
ERR_10007
(
10007
,
"字典名称已存在"
),
ERR_10008
(
10008
,
"title已存在"
),
ERR_20001
(
20001
,
"企业微信商户不存在"
),
ERR_20002
(
20002
,
"门店不存在"
),
ERR_DEFINE
(-
888
,
"自定义错误"
),
ERR_OTHER
(-
999
,
"未知错误code"
);
private
int
code
;
...
...
haoban-manage3-operation-web/src/main/java/com/gic/haoban/manage/web/vo/EnterpriseVo.java
0 → 100644
View file @
ed317973
package
com
.
gic
.
haoban
.
manage
.
web
.
vo
;
import
java.io.Serializable
;
/**
* Created 2018/10/22.
*
* @author hua
*/
public
class
EnterpriseVo
implements
Serializable
{
/**
*
*/
private
static
final
long
serialVersionUID
=
1L
;
private
String
wxEnterpiseId
;
private
String
enterpriseId
;
private
String
enterpriseName
;
private
String
wxEnterpiseName
;
public
String
getWxEnterpiseId
()
{
return
wxEnterpiseId
;
}
public
void
setWxEnterpiseId
(
String
wxEnterpiseId
)
{
this
.
wxEnterpiseId
=
wxEnterpiseId
;
}
public
String
getEnterpriseId
()
{
return
enterpriseId
;
}
public
void
setEnterpriseId
(
String
enterpriseId
)
{
this
.
enterpriseId
=
enterpriseId
;
}
public
String
getEnterpriseName
()
{
return
enterpriseName
;
}
public
void
setEnterpriseName
(
String
enterpriseName
)
{
this
.
enterpriseName
=
enterpriseName
;
}
public
String
getWxEnterpiseName
()
{
return
wxEnterpiseName
;
}
public
void
setWxEnterpiseName
(
String
wxEnterpiseName
)
{
this
.
wxEnterpiseName
=
wxEnterpiseName
;
}
}
haoban-manage3-operation-web/src/main/java/com/gic/haoban/manage/web/vo/WxClerkInfoVO.java
0 → 100644
View file @
ed317973
package
com
.
gic
.
haoban
.
manage
.
web
.
vo
;
import
java.io.Serializable
;
/**
* Created 2020/6/4.
*
* @author hua
*/
public
class
WxClerkInfoVO
implements
Serializable
{
private
String
enterpriseId
;
private
String
clerkId
;
private
String
staffId
;
private
String
wxUserId
;
private
String
clerkName
;
private
int
clerkType
;
public
String
getEnterpriseId
()
{
return
enterpriseId
;
}
public
void
setEnterpriseId
(
String
enterpriseId
)
{
this
.
enterpriseId
=
enterpriseId
;
}
public
String
getClerkId
()
{
return
clerkId
;
}
public
void
setClerkId
(
String
clerkId
)
{
this
.
clerkId
=
clerkId
;
}
public
String
getStaffId
()
{
return
staffId
;
}
public
void
setStaffId
(
String
staffId
)
{
this
.
staffId
=
staffId
;
}
public
String
getWxUserId
()
{
return
wxUserId
;
}
public
void
setWxUserId
(
String
wxUserId
)
{
this
.
wxUserId
=
wxUserId
;
}
public
String
getClerkName
()
{
return
clerkName
;
}
public
void
setClerkName
(
String
clerkName
)
{
this
.
clerkName
=
clerkName
;
}
public
int
getClerkType
()
{
return
clerkType
;
}
public
void
setClerkType
(
int
clerkType
)
{
this
.
clerkType
=
clerkType
;
}
}
haoban-manage3-operation-web/src/main/webapp/WEB-INF/dubbo-haoban-manage3-operation-web.xml
View file @
ed317973
...
...
@@ -20,6 +20,7 @@
<!--<dubbo:registry address="zookeeper://localhost:2181|zookeeper://115.159.182.172:2199" protocol="dubbo"/>-->
<dubbo:reference
interface=
"com.gic.haoban.manage.api.service.StaffApiService"
id=
"staffApiService"
/>
<dubbo:reference
interface=
"com.gic.haoban.manage.api.service.StaffClerkRelationApiService"
id=
"staffClerkRelationApiService"
/>
<dubbo:reference
interface=
"com.gic.haoban.manage.api.service.WxEnterpriseRelatedApiService"
id=
"wxEnterpriseRelatedApiService"
/>
<dubbo:reference
interface=
"com.gic.haoban.manage.api.service.ApplicationApiService"
id=
"applicationApiService"
/>
<dubbo:reference
interface=
"com.gic.haoban.manage.api.service.WxEnterpriseApiService"
id=
"wxEnterpriseApiService"
/>
...
...
haoban-manage3-operation-web/src/main/webapp/WEB-INF/spring-interceptor.xml
View file @
ed317973
...
...
@@ -13,6 +13,7 @@
<mvc:exclude-mapping
path=
"/gic-login*"
/>
<mvc:exclude-mapping
path=
"/*test.json"
/>
<mvc:exclude-mapping
path=
"/test/*"
/>
<mvc:exclude-mapping
path=
"/pay/*"
/>
<mvc:exclude-mapping
path=
"/login"
/>
<mvc:exclude-mapping
path=
"/nationcode/get-nationcode-list"
/>
<mvc:exclude-mapping
path=
"/get-pic-code"
/>
...
...
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