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
957f43c0
Commit
957f43c0
authored
Apr 01, 2020
by
qwmqiuwenmin
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'developer' of
http://115.159.76.241/haoban3.0/haoban-manage3.0.git
into developer
parents
72b272a4
0db99233
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
133 additions
and
74 deletions
+133
-74
WxEnterpriseDTO.java
...n/java/com/gic/haoban/manage/api/dto/WxEnterpriseDTO.java
+10
-0
TabHaobanWxEnterprise.java
...c/haoban/manage/service/entity/TabHaobanWxEnterprise.java
+10
-0
AuditApiServiceImpl.java
.../manage/service/service/out/impl/AuditApiServiceImpl.java
+21
-17
WxEnterpriseMapper.xml
...-service/src/main/resources/mapper/WxEnterpriseMapper.xml
+2
-0
InfoController.java
.../com/gic/haoban/manage/web/controller/InfoController.java
+89
-57
dubbo-haoban-manage-wx.xml
...ge3-wx/src/main/webapp/WEB-INF/dubbo-haoban-manage-wx.xml
+1
-0
No files found.
haoban-manage3-api/src/main/java/com/gic/haoban/manage/api/dto/WxEnterpriseDTO.java
View file @
957f43c0
...
@@ -59,12 +59,22 @@ public class WxEnterpriseDTO implements Serializable {
...
@@ -59,12 +59,22 @@ public class WxEnterpriseDTO implements Serializable {
private
String
wxSecretKey
;
private
String
wxSecretKey
;
private
String
memberSecret
;
private
Date
createTime
;
private
Date
createTime
;
private
Date
updateTime
;
private
Date
updateTime
;
//小程序版本
//小程序版本
private
String
smallVersion
;
private
String
smallVersion
;
public
String
getMemberSecret
()
{
return
memberSecret
;
}
public
void
setMemberSecret
(
String
memberSecret
)
{
this
.
memberSecret
=
memberSecret
;
}
private
static
final
long
serialVersionUID
=
1L
;
private
static
final
long
serialVersionUID
=
1L
;
public
String
getSmallVersion
()
{
public
String
getSmallVersion
()
{
...
...
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/entity/TabHaobanWxEnterprise.java
View file @
957f43c0
...
@@ -58,12 +58,22 @@ public class TabHaobanWxEnterprise implements Serializable {
...
@@ -58,12 +58,22 @@ public class TabHaobanWxEnterprise implements Serializable {
private
String
wxSecretKey
;
private
String
wxSecretKey
;
private
String
memberSecret
;
private
Date
createTime
;
private
Date
createTime
;
private
Date
updateTime
;
private
Date
updateTime
;
private
static
final
long
serialVersionUID
=
1L
;
private
static
final
long
serialVersionUID
=
1L
;
public
String
getMemberSecret
()
{
return
memberSecret
;
}
public
void
setMemberSecret
(
String
memberSecret
)
{
this
.
memberSecret
=
memberSecret
;
}
public
String
getWxEnterpriseId
()
{
public
String
getWxEnterpriseId
()
{
return
wxEnterpriseId
;
return
wxEnterpriseId
;
}
}
...
...
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/out/impl/AuditApiServiceImpl.java
View file @
957f43c0
...
@@ -154,8 +154,12 @@ public class AuditApiServiceImpl implements AuditApiService{
...
@@ -154,8 +154,12 @@ public class AuditApiServiceImpl implements AuditApiService{
if
(!
StoreFieldEnum
.
STORE_IMAG
.
getValue
().
equals
(
changeField
)){
if
(!
StoreFieldEnum
.
STORE_IMAG
.
getValue
().
equals
(
changeField
)){
//非门店图片修改
//非门店图片修改
logger
.
info
(
"===================进222"
);
logger
.
info
(
"===================进222"
);
getStoreDTO
(
store
,
changeField
,
oldValue
,
newValue
);
StoreDetailDTO
detailDTO
=
new
StoreDetailDTO
();
StoreDetailDTO
detailDTO
=
EntityUtil
.
changeEntityByJSON
(
StoreDetailDTO
.
class
,
store
);
detailDTO
.
setStoreId
(
storeId
);
detailDTO
.
setEnterpriseId
(
store
.
getEnterpriseId
());
getStoreDTO
(
detailDTO
,
changeField
,
oldValue
,
newValue
);
logger
.
info
(
"detailDTO====================>为{}"
,
JSONObject
.
toJSONString
(
detailDTO
));
storeService
.
saveStore
(
detailDTO
);
storeService
.
saveStore
(
detailDTO
);
// storeService.saveOrUpdateStore(store);
// storeService.saveOrUpdateStore(store);
}
else
{
}
else
{
...
@@ -164,7 +168,7 @@ public class AuditApiServiceImpl implements AuditApiService{
...
@@ -164,7 +168,7 @@ public class AuditApiServiceImpl implements AuditApiService{
storeService
.
updateStorePhotos
(
storeId
,
newValue
);
storeService
.
updateStorePhotos
(
storeId
,
newValue
);
}
}
}
}
void
getStoreDTO
(
StoreDTO
store
,
String
changeField
,
String
oldValue
,
String
newValue
){
void
getStoreDTO
(
StoreD
etailD
TO
store
,
String
changeField
,
String
oldValue
,
String
newValue
){
logger
.
info
(
"==========================>changeField={}"
,
changeField
);
logger
.
info
(
"==========================>changeField={}"
,
changeField
);
if
(
StoreFieldEnum
.
BUSINESS_TIME_STRING
.
getValue
().
equals
(
changeField
)){
if
(
StoreFieldEnum
.
BUSINESS_TIME_STRING
.
getValue
().
equals
(
changeField
)){
SimpleDateFormat
sdf
=
new
SimpleDateFormat
(
"HH:mm"
);
SimpleDateFormat
sdf
=
new
SimpleDateFormat
(
"HH:mm"
);
...
@@ -172,20 +176,20 @@ public class AuditApiServiceImpl implements AuditApiService{
...
@@ -172,20 +176,20 @@ public class AuditApiServiceImpl implements AuditApiService{
String
[]
newValues
=
newValue
.
split
(
"-"
);
String
[]
newValues
=
newValue
.
split
(
"-"
);
String
openTime
=
newValues
[
0
];
String
openTime
=
newValues
[
0
];
String
closeTime
=
newValues
[
1
];
String
closeTime
=
newValues
[
1
];
Date
date1
=
null
;
//
Date date1 = null;
Date
date2
=
null
;
//
Date date2 = null;
try
{
//
try {
date1
=
sdf
.
parse
(
openTime
);
//
date1 = sdf.parse(openTime);
}
catch
(
ParseException
e
)
{
//
} catch (ParseException e) {
e
.
printStackTrace
();
//
e.printStackTrace();
}
//
}
try
{
//
try {
date2
=
sdf
.
parse
(
closeTime
);
//
date2 = sdf.parse(closeTime);
}
catch
(
ParseException
e
)
{
//
} catch (ParseException e) {
e
.
printStackTrace
();
//
e.printStackTrace();
}
//
}
store
.
setOpenTime
(
date1
);
store
.
setOpenTime
(
openTime
);
store
.
setCloseTime
(
date2
);
store
.
setCloseTime
(
closeTime
);
}
else
if
(
StoreFieldEnum
.
CONACTS_PHONE
.
getValue
().
equals
(
changeField
)){
}
else
if
(
StoreFieldEnum
.
CONACTS_PHONE
.
getValue
().
equals
(
changeField
)){
//联系电话
//联系电话
store
.
setConactsPhone
(
newValue
);
store
.
setConactsPhone
(
newValue
);
...
...
haoban-manage3-service/src/main/resources/mapper/WxEnterpriseMapper.xml
View file @
957f43c0
...
@@ -25,6 +25,7 @@
...
@@ -25,6 +25,7 @@
<result
column=
"square_logo_url"
property=
"squareLogoUrl"
jdbcType=
"VARCHAR"
/>
<result
column=
"square_logo_url"
property=
"squareLogoUrl"
jdbcType=
"VARCHAR"
/>
<result
column=
"round_logo_url"
property=
"roundLogoUrl"
jdbcType=
"VARCHAR"
/>
<result
column=
"round_logo_url"
property=
"roundLogoUrl"
jdbcType=
"VARCHAR"
/>
<result
column=
"wx_secret_key"
property=
"wxSecretKey"
jdbcType=
"VARCHAR"
/>
<result
column=
"wx_secret_key"
property=
"wxSecretKey"
jdbcType=
"VARCHAR"
/>
<result
column=
"member_secret"
property=
"memberSecret"
jdbcType=
"VARCHAR"
/>
<result
column=
"level"
property=
"level"
jdbcType=
"INTEGER"
/>
<result
column=
"level"
property=
"level"
jdbcType=
"INTEGER"
/>
<result
column=
"contact_flag"
property=
"contactFlag"
jdbcType=
"INTEGER"
/>
<result
column=
"contact_flag"
property=
"contactFlag"
jdbcType=
"INTEGER"
/>
<result
column=
"bind_flag"
property=
"bindFlag"
jdbcType=
"INTEGER"
/>
<result
column=
"bind_flag"
property=
"bindFlag"
jdbcType=
"INTEGER"
/>
...
@@ -37,6 +38,7 @@
...
@@ -37,6 +38,7 @@
corp_user_max, corp_full_name, subject_type, verified_end_time, corp_wxqrcode, corp_scale,
corp_user_max, corp_full_name, subject_type, verified_end_time, corp_wxqrcode, corp_scale,
corp_industry, corp_sub_industry, location, auth_info, agent, agentid, appid, name,
corp_industry, corp_sub_industry, location, auth_info, agent, agentid, appid, name,
square_logo_url, round_logo_url, level, bind_flag, status_flag, create_time, update_time,contact_flag,wx_secret_key
square_logo_url, round_logo_url, level, bind_flag, status_flag, create_time, update_time,contact_flag,wx_secret_key
,member_secret
</sql>
</sql>
<select
id=
"selectByPrimaryKey"
resultMap=
"BaseResultMap"
parameterType=
"java.lang.String"
>
<select
id=
"selectByPrimaryKey"
resultMap=
"BaseResultMap"
parameterType=
"java.lang.String"
>
select
select
...
...
haoban-manage3-wx/src/main/java/com/gic/haoban/manage/web/controller/InfoController.java
View file @
957f43c0
package
com
.
gic
.
haoban
.
manage
.
web
.
controller
;
package
com
.
gic
.
haoban
.
manage
.
web
.
controller
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Set
;
import
java.util.stream.Collectors
;
import
org.apache.commons.lang3.StringUtils
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
import
cn.hutool.core.collection.CollectionUtil
;
import
cn.hutool.core.collection.CollectionUtil
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSON
;
import
com.gic.haoban.common.utils.EntityUtil
;
import
com.gic.haoban.common.utils.EntityUtil
;
import
com.gic.haoban.common.utils.HaobanResponse
;
import
com.gic.haoban.common.utils.HaobanResponse
;
import
com.gic.haoban.manage.api.dto.StaffDTO
;
import
com.gic.haoban.manage.api.dto.*
;
import
com.gic.haoban.manage.api.dto.UserLoginLogDTO
;
import
com.gic.haoban.manage.api.dto.WxEnterpriseDTO
;
import
com.gic.haoban.manage.api.dto.YwWxEnterpriseDTO
;
import
com.gic.haoban.manage.api.service.StaffApiService
;
import
com.gic.haoban.manage.api.service.StaffApiService
;
import
com.gic.haoban.manage.api.service.WxEnterpriseApiService
;
import
com.gic.haoban.manage.api.service.WxEnterpriseApiService
;
import
com.gic.haoban.manage.api.service.WxEnterpriseRelatedApiService
;
import
com.gic.haoban.manage.web.config.Config
;
import
com.gic.haoban.manage.web.config.Config
;
import
com.gic.haoban.manage.web.errCode.HaoBanErrCode
;
import
com.gic.haoban.manage.web.errCode.HaoBanErrCode
;
import
com.gic.haoban.manage.web.interceptor.WebInterceptor
;
import
com.gic.haoban.manage.web.vo.AppStaffVo
;
import
com.gic.haoban.manage.web.vo.AppStaffVo
;
import
com.gic.haoban.manage.web.vo.InfoVo
;
import
com.gic.haoban.manage.web.vo.InfoVo
;
import
com.gic.wechat.api.dto.qywx.UserDTO
;
import
com.gic.wechat.api.dto.qywx.UserDTO
;
import
com.gic.wechat.api.service.qywx.QywxCorpApiService
;
import
com.gic.wechat.api.service.qywx.QywxCorpApiService
;
import
com.gic.wechat.api.service.qywx.QywxUserApiService
;
import
org.apache.commons.lang3.StringUtils
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
import
java.util.*
;
import
java.util.stream.Collectors
;
@RestController
@RestController
public
class
InfoController
extends
WebBaseController
{
public
class
InfoController
extends
WebBaseController
{
...
@@ -42,49 +35,88 @@ public class InfoController extends WebBaseController{
...
@@ -42,49 +35,88 @@ public class InfoController extends WebBaseController{
private
StaffApiService
staffApiService
;
private
StaffApiService
staffApiService
;
@Autowired
@Autowired
private
WxEnterpriseApiService
wxEnterpriseApiService
;
private
WxEnterpriseApiService
wxEnterpriseApiService
;
@Autowired
private
WxEnterpriseRelatedApiService
wxEnterpriseRelatedApiService
;
@Autowired
private
QywxUserApiService
qywxUserApiService
;
private
static
Logger
logger
=
LoggerFactory
.
getLogger
(
InfoController
.
class
);
private
static
Logger
logger
=
LoggerFactory
.
getLogger
(
InfoController
.
class
);
@Autowired
@Autowired
private
Config
config
;
private
Config
config
;
@RequestMapping
(
"get-info-by-code"
)
@RequestMapping
(
"get-info-by-code"
)
public
HaobanResponse
getInfoByCode
(
String
code
)
{
public
HaobanResponse
getInfoByCode
(
String
code
)
{
String
userDTOJson
=
qywxCorpApiService
.
getCodeSession
(
config
.
getWxSuiteid
(),
code
);
String
userDTOJson
=
qywxCorpApiService
.
getCodeSession
(
config
.
getWxSuiteid
(),
code
);
logger
.
info
(
"userDTOJson=============>{}"
,
userDTOJson
);
logger
.
info
(
"userDTOJson=============>{}"
,
userDTOJson
);
UserDTO
user
=
JSON
.
parseObject
(
userDTOJson
,
UserDTO
.
class
);
UserDTO
user
=
JSON
.
parseObject
(
userDTOJson
,
UserDTO
.
class
);
if
(
user
==
null
)
{
if
(
user
==
null
)
{
return
resultResponse
(
HaoBanErrCode
.
ERR_6
);
return
resultResponse
(
HaoBanErrCode
.
ERR_6
);
}
}
String
userId
=
user
.
getUserid
();
String
userId
=
user
.
getUserid
();
String
corpId
=
user
.
getCorpid
();
String
corpId
=
user
.
getCorpid
();
WxEnterpriseDTO
enterprise
=
wxEnterpriseApiService
.
getEnterpriseBycorpId
(
corpId
);
WxEnterpriseDTO
enterprise
=
wxEnterpriseApiService
.
getEnterpriseBycorpId
(
corpId
);
StaffDTO
loginStaff
=
null
;
StaffDTO
loginStaff
=
null
;
if
(
enterprise
!=
null
){
if
(
enterprise
!=
null
){
loginStaff
=
staffApiService
.
selectByUserIdAndEnterpriseId
(
userId
,
enterprise
.
getWxEnterpriseId
());
loginStaff
=
staffApiService
.
selectByUserIdAndEnterpriseId
(
userId
,
enterprise
.
getWxEnterpriseId
());
}
}
if
(
loginStaff
==
null
){
if
(
loginStaff
==
null
){
if
(
enterprise
!=
null
){
if
(
enterprise
!=
null
){
staffApiService
.
wxGetAdd
(
userId
,
enterprise
.
getWxEnterpriseId
());
staffApiService
.
wxGetAdd
(
userId
,
enterprise
.
getWxEnterpriseId
());
loginStaff
=
staffApiService
.
selectByUserIdAndEnterpriseId
(
userId
,
enterprise
.
getWxEnterpriseId
());
loginStaff
=
staffApiService
.
selectByUserIdAndEnterpriseId
(
userId
,
enterprise
.
getWxEnterpriseId
());
}
}
}
}
if
(
loginStaff
==
null
){
if
(
loginStaff
==
null
){
return
resultResponse
(
HaoBanErrCode
.
ERR_600001
);
return
resultResponse
(
HaoBanErrCode
.
ERR_600001
);
}
}
String
wxEnterpriseId
=
loginStaff
.
getWxEnterpriseId
();
String
wxEnterpriseId
=
loginStaff
.
getWxEnterpriseId
();
WxEnterpriseDTO
wxEnterpriseDTO
=
wxEnterpriseApiService
.
getOne
(
wxEnterpriseId
);
WxEnterpriseDTO
wxEnterpriseDTO
=
wxEnterpriseApiService
.
getOne
(
wxEnterpriseId
);
String
accesstoken
=
qywxCorpApiService
.
getCorpAccessToken
(
wxEnterpriseDTO
.
getCorpid
(),
config
.
getWxSuiteid
());
String
accesstoken
=
qywxCorpApiService
.
getCorpAccessToken
(
wxEnterpriseDTO
.
getCorpid
(),
config
.
getWxSuiteid
());
InfoVo
infoVo
=
new
InfoVo
();
InfoVo
infoVo
=
new
InfoVo
();
infoVo
.
setAccessToken
(
accesstoken
);
infoVo
.
setAccessToken
(
accesstoken
);
infoVo
.
setStaffId
(
loginStaff
.
getStaffId
());
infoVo
.
setStaffId
(
loginStaff
.
getStaffId
());
infoVo
.
setWxEnterpriseId
(
wxEnterpriseId
);
infoVo
.
setWxEnterpriseId
(
wxEnterpriseId
);
infoVo
.
setStaffName
(
loginStaff
.
getStaffName
());
infoVo
.
setStaffName
(
loginStaff
.
getStaffName
());
infoVo
.
setPhoneNumber
(
loginStaff
.
getPhoneNumber
());
infoVo
.
setPhoneNumber
(
loginStaff
.
getPhoneNumber
());
infoVo
.
setNationcode
(
loginStaff
.
getNationCode
());
infoVo
.
setNationcode
(
loginStaff
.
getNationCode
());
return
resultResponse
(
HaoBanErrCode
.
ERR_1
,
infoVo
);
return
resultResponse
(
HaoBanErrCode
.
ERR_1
,
infoVo
);
}
}
@RequestMapping
(
"get-user-by-member-code"
)
public
HaobanResponse
getInfoByMemberCode
(
String
code
,
String
gicEnterpriseId
)
{
EnterpriseDetailDTO
enterpriseDetailDTO
=
wxEnterpriseRelatedApiService
.
getByEnterpriseId
(
gicEnterpriseId
);
if
(
enterpriseDetailDTO
==
null
)
{
logger
.
info
(
"改企业没有关系好办:{}"
,
gicEnterpriseId
);
return
resultResponse
(
HaoBanErrCode
.
ERR_500001
);
}
WxEnterpriseDTO
enterpriseDTO
=
wxEnterpriseApiService
.
getOne
(
enterpriseDetailDTO
.
getWxEnterpriseId
());
if
(
enterpriseDetailDTO
==
null
)
{
logger
.
info
(
"改企业不存在:{}"
,
gicEnterpriseId
);
return
resultResponse
(
HaoBanErrCode
.
ERR_400002
);
}
String
userDTOJson
=
qywxUserApiService
.
getUserByCode
(
enterpriseDTO
.
getCorpid
(),
enterpriseDTO
.
getMemberSecret
(),
code
);
logger
.
info
(
"会员微信登录信息=============>{}"
,
userDTOJson
);
UserDTO
user
=
JSON
.
parseObject
(
userDTOJson
,
UserDTO
.
class
);
if
(
user
==
null
)
{
return
resultResponse
(
HaoBanErrCode
.
ERR_6
);
}
String
userId
=
user
.
getUserid
();
String
corpId
=
user
.
getCorpid
();
Map
<
String
,
String
>
ret
=
new
HashMap
<>();
ret
.
put
(
"userId"
,
userId
);
ret
.
put
(
"corpId"
,
corpId
);
return
resultResponse
(
HaoBanErrCode
.
ERR_1
,
ret
);
}
@RequestMapping
(
"save-user-login-log"
)
@RequestMapping
(
"save-user-login-log"
)
public
HaobanResponse
saveUserLoginLog
(
UserLoginLogDTO
userLoginLogDTO
)
{
public
HaobanResponse
saveUserLoginLog
(
UserLoginLogDTO
userLoginLogDTO
)
{
...
...
haoban-manage3-wx/src/main/webapp/WEB-INF/dubbo-haoban-manage-wx.xml
View file @
957f43c0
...
@@ -28,6 +28,7 @@
...
@@ -28,6 +28,7 @@
<dubbo:reference
interface=
"com.gic.haoban.manage.api.service.WxEnterpriseApiService"
id=
"wxEnterpriseApiService"
/>
<dubbo:reference
interface=
"com.gic.haoban.manage.api.service.WxEnterpriseApiService"
id=
"wxEnterpriseApiService"
/>
<dubbo:reference
interface=
"com.gic.enterprise.api.service.StoreService"
id=
"storeService"
/>
<dubbo:reference
interface=
"com.gic.enterprise.api.service.StoreService"
id=
"storeService"
/>
<dubbo:reference
interface=
"com.gic.wechat.api.service.qywx.QywxCorpApiService"
id=
"qywxCorpApiService"
/>
<dubbo:reference
interface=
"com.gic.wechat.api.service.qywx.QywxCorpApiService"
id=
"qywxCorpApiService"
/>
<dubbo:reference
interface=
"com.gic.wechat.api.service.qywx.QywxUserApiService"
id=
"qywxUserApiService"
/>
<dubbo:reference
interface=
"com.gic.haoban.manage.api.service.BindApiService"
id=
"bindApiService"
/>
<dubbo:reference
interface=
"com.gic.haoban.manage.api.service.BindApiService"
id=
"bindApiService"
/>
<dubbo:reference
interface=
"com.gic.haoban.manage.api.service.AuditApiService"
id=
"auditApiService"
/>
<dubbo:reference
interface=
"com.gic.haoban.manage.api.service.AuditApiService"
id=
"auditApiService"
/>
<dubbo:reference
interface=
"com.gic.haoban.manage.api.service.AuditSettingApiService"
id=
"auditSettingApiService"
/>
<dubbo:reference
interface=
"com.gic.haoban.manage.api.service.AuditSettingApiService"
id=
"auditSettingApiService"
/>
...
...
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