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
fd55454e
Commit
fd55454e
authored
May 10, 2022
by
徐高华
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
登录调整
parent
d6097a4e
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
16 changed files
with
320 additions
and
320 deletions
+320
-320
LoginDTO.java
...src/main/java/com/gic/haoban/manage/api/dto/LoginDTO.java
+0
-48
TabHaobanAuditMapper.java
...aoban/manage/service/dao/mapper/TabHaobanAuditMapper.java
+3
-0
TabHaobanAuditMapper.xml
...ervice/src/main/resources/mapper/TabHaobanAuditMapper.xml
+5
-0
AuthRequestUtil.java
.../java/com/gic/haoban/manage/web/auth/AuthRequestUtil.java
+0
-152
ApplicationController.java
...c/haoban/manage/web/controller/ApplicationController.java
+3
-3
AuditController.java
...com/gic/haoban/manage/web/controller/AuditController.java
+6
-12
GicDepartmentController.java
...haoban/manage/web/controller/GicDepartmentController.java
+15
-13
LoginController.java
...com/gic/haoban/manage/web/controller/LoginController.java
+0
-0
MaterialController.java
.../gic/haoban/manage/web/controller/MaterialController.java
+6
-10
RightController.java
...com/gic/haoban/manage/web/controller/RightController.java
+2
-2
StaffController.java
...com/gic/haoban/manage/web/controller/StaffController.java
+3
-16
SyncDealContoller.java
...m/gic/haoban/manage/web/controller/SyncDealContoller.java
+1
-5
WebBaseController.java
...m/gic/haoban/manage/web/controller/WebBaseController.java
+6
-10
WelcomeController.java
...m/gic/haoban/manage/web/controller/WelcomeController.java
+6
-6
WxEnterpriseController.java
.../haoban/manage/web/controller/WxEnterpriseController.java
+15
-41
StaffVO.java
...b/src/main/java/com/gic/haoban/manage/web/vo/StaffVO.java
+249
-2
No files found.
haoban-manage3-api/src/main/java/com/gic/haoban/manage/api/dto/LoginDTO.java
deleted
100644 → 0
View file @
d6097a4e
package
com
.
gic
.
haoban
.
manage
.
api
.
dto
;
import
java.io.Serializable
;
public
class
LoginDTO
implements
Serializable
{
private
static
final
long
serialVersionUID
=
1L
;
private
StaffDTO
staffDTO
;
private
String
wxEnterpriseId
;
private
String
enterpriseId
;
private
Integer
wxEnterpriseType
;
public
Integer
getWxEnterpriseType
()
{
return
wxEnterpriseType
;
}
public
void
setWxEnterpriseType
(
Integer
wxEnterpriseType
)
{
this
.
wxEnterpriseType
=
wxEnterpriseType
;
}
public
StaffDTO
getStaffDTO
()
{
return
staffDTO
;
}
public
void
setStaffDTO
(
StaffDTO
staffDTO
)
{
this
.
staffDTO
=
staffDTO
;
}
public
String
getWxEnterpriseId
()
{
return
wxEnterpriseId
;
}
public
void
setWxEnterpriseId
(
String
wxEnterpriseId
)
{
this
.
wxEnterpriseId
=
wxEnterpriseId
;
}
public
String
getEnterpriseId
()
{
return
enterpriseId
;
}
public
void
setEnterpriseId
(
String
enterpriseId
)
{
this
.
enterpriseId
=
enterpriseId
;
}
}
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/dao/mapper/TabHaobanAuditMapper.java
View file @
fd55454e
...
@@ -36,4 +36,6 @@ public interface TabHaobanAuditMapper {
...
@@ -36,4 +36,6 @@ public interface TabHaobanAuditMapper {
TabHaobanAudit
findByBindRelatedIdAndAuditType
(
@Param
(
"relatedId"
)
String
relatedId
,
@Param
(
"auditType"
)
int
auditType
);
TabHaobanAudit
findByBindRelatedIdAndAuditType
(
@Param
(
"relatedId"
)
String
relatedId
,
@Param
(
"auditType"
)
int
auditType
);
List
<
TabHaobanAudit
>
judgeHavePhoneNumberOrCode
(
@Param
(
"enterpriseId"
)
String
enterpriseId
,
@Param
(
"clerkCode"
)
String
clerkCode
,
@Param
(
"phoneNumber"
)
String
phoneNumber
);
List
<
TabHaobanAudit
>
judgeHavePhoneNumberOrCode
(
@Param
(
"enterpriseId"
)
String
enterpriseId
,
@Param
(
"clerkCode"
)
String
clerkCode
,
@Param
(
"phoneNumber"
)
String
phoneNumber
);
int
getAuditCount
(
String
enterpriseId
,
@Param
(
"storeIds"
)
List
<
String
>
storeIds
)
;
}
}
\ No newline at end of file
haoban-manage3-service/src/main/resources/mapper/TabHaobanAuditMapper.xml
View file @
fd55454e
...
@@ -444,4 +444,8 @@
...
@@ -444,4 +444,8 @@
)
)
</select>
</select>
<select
id=
"getAuditCount"
>
</select>
</mapper>
</mapper>
\ No newline at end of file
haoban-manage3-web/src/main/java/com/gic/haoban/manage/web/auth/AuthRequestUtil.java
deleted
100644 → 0
View file @
d6097a4e
package
com
.
gic
.
haoban
.
manage
.
web
.
auth
;
import
com.alibaba.fastjson.JSON
;
import
com.gic.haoban.common.utils.EntityUtil
;
import
com.gic.haoban.manage.api.dto.LoginDTO
;
import
com.gic.redis.data.util.RedisUtil
;
import
org.apache.commons.beanutils.BeanUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.web.context.request.RequestContextHolder
;
import
org.springframework.web.context.request.ServletRequestAttributes
;
import
javax.servlet.http.Cookie
;
import
javax.servlet.http.HttpServletRequest
;
import
javax.servlet.http.HttpServletResponse
;
import
javax.servlet.http.HttpSession
;
import
java.util.Date
;
import
java.util.concurrent.TimeUnit
;
/**
* Created 2018/7/26.
* 新方法 AuthWebRequestUtil
* @author hua
*/
@Deprecated
public
class
AuthRequestUtil
{
private
static
final
Logger
logger
=
LoggerFactory
.
getLogger
(
AuthRequestUtil
.
class
);
public
static
final
String
REDIS_LOGIN_USER_TOKEN_PREFIX
=
"GIC:HAOBAN:HAOBAN_MOBILE_APP:LOGIN_USER:"
;
public
static
final
String
REDIS_FAKE_LOGIN_FLAG_PREFIX
=
"GIC:HAOBAN:HAOBAN_MOBILE_APP:FAKE_LOGIN_TOKEN:"
;
public
static
String
LOGIN_SESSION_KEY
=
"HAOBAN:LOGINUSER"
;
public
static
void
setSessionUser
(
Object
obj
)
{
String
userJson
=
JSON
.
toJSONString
(
obj
);
getSession
().
setAttribute
(
LOGIN_SESSION_KEY
,
userJson
);
}
public
static
void
delSessionUser
()
{
getSession
().
removeAttribute
(
LOGIN_SESSION_KEY
);
}
public
static
LoginDTO
getAppLoginUser
(
String
token
)
{
logger
.
info
(
"token-web="
+
token
);
if
(
StringUtils
.
isBlank
(
token
))
{
return
null
;
}
return
EntityUtil
.
changeEntityByJSON
(
LoginDTO
.
class
,
RedisUtil
.
getCache
(
token
));
}
private
static
void
setLoginUserLastToken
(
String
token
,
Object
obj
)
{
try
{
String
userId
=
BeanUtils
.
getProperty
(
obj
,
"user.userId"
);
if
(
StringUtils
.
isNotBlank
(
userId
)
&&
StringUtils
.
isNotBlank
(
token
))
{
RedisUtil
.
setCache
(
REDIS_LOGIN_USER_TOKEN_PREFIX
+
userId
,
token
,
31L
,
TimeUnit
.
DAYS
);
}
}
catch
(
Exception
e
)
{
logger
.
error
(
e
.
getMessage
());
}
}
/**
* 是否为用户最后一次登录token
*
* @param token
* @param userId
* @return
*/
public
static
boolean
isLoginUserLastToken
(
String
token
,
String
userId
)
{
Object
lastUserLoginToken
=
RedisUtil
.
getCache
(
REDIS_LOGIN_USER_TOKEN_PREFIX
+
userId
);
// 如果用户最后一次登录token不符则返回false
return
!(
lastUserLoginToken
instanceof
CharSequence
)
||
StringUtils
.
equals
(
token
,
(
CharSequence
)
lastUserLoginToken
);
}
private
static
void
setFakeLoginFlag
(
String
token
)
{
if
(
StringUtils
.
isNotBlank
(
token
))
{
RedisUtil
.
setCache
(
REDIS_FAKE_LOGIN_FLAG_PREFIX
+
token
,
new
Date
(),
30L
,
TimeUnit
.
DAYS
);
}
}
/**
* 是否为伪登录token
*
* @param token
* @return
*/
public
static
boolean
isFakeLoginToken
(
String
token
)
{
return
StringUtils
.
isNotBlank
(
token
)
&&
RedisUtil
.
getCache
(
REDIS_FAKE_LOGIN_FLAG_PREFIX
+
token
)
!=
null
;
}
public
static
void
setAppLoginUser
(
String
token
,
Object
obj
)
{
RedisUtil
.
setCache
(
token
,
obj
,
30L
,
TimeUnit
.
DAYS
);
getResponse
().
setHeader
(
"token"
,
token
);
}
public
static
void
setAppFakeLoginUser
(
String
token
,
Object
obj
)
{
RedisUtil
.
setCache
(
token
,
obj
,
30L
,
TimeUnit
.
DAYS
);
getResponse
().
setHeader
(
"token"
,
token
);
setFakeLoginFlag
(
token
);
}
public
static
void
delToken
()
{
String
token
=
getRequest
().
getHeader
(
"token"
);
RedisUtil
.
delCache
(
token
);
}
public
static
void
setAppLoginUser
(
Object
obj
,
String
token
)
{
RedisUtil
.
setCache
(
token
,
obj
,
30L
,
TimeUnit
.
DAYS
);
getResponse
().
setHeader
(
"token"
,
token
);
}
public
static
void
setAppFakeLoginUser
(
Object
obj
)
{
String
token
=
getRequest
().
getHeader
(
"token"
);
RedisUtil
.
setCache
(
token
,
obj
,
30L
,
TimeUnit
.
DAYS
);
getResponse
().
setHeader
(
"token"
,
token
);
}
public
static
HttpSession
getSession
()
{
HttpSession
session
=
null
;
try
{
session
=
getRequest
().
getSession
();
}
catch
(
Exception
e
)
{
}
return
session
;
}
public
static
HttpServletRequest
getRequest
()
{
ServletRequestAttributes
attrs
=
(
ServletRequestAttributes
)
RequestContextHolder
.
getRequestAttributes
();
return
attrs
.
getRequest
();
}
public
static
HttpServletResponse
getResponse
()
{
ServletRequestAttributes
attrs
=
(
ServletRequestAttributes
)
RequestContextHolder
.
getRequestAttributes
();
return
attrs
.
getResponse
();
}
public
static
LoginDTO
getLoginUser
()
{
Cookie
[]
cookies
=
getRequest
().
getCookies
();
String
token
=
""
;
if
(
cookies
!=
null
)
{
for
(
Cookie
cookie
:
cookies
)
{
if
(
cookie
.
getName
().
equals
(
"token"
))
{
token
=
cookie
.
getValue
();
}
}
}
return
getAppLoginUser
(
token
);
}
}
haoban-manage3-web/src/main/java/com/gic/haoban/manage/web/controller/ApplicationController.java
View file @
fd55454e
...
@@ -131,7 +131,7 @@ public class ApplicationController extends WebBaseController {
...
@@ -131,7 +131,7 @@ public class ApplicationController extends WebBaseController {
return
resultResponse
(
HaoBanErrCode
.
ERR_1
,
true
);
return
resultResponse
(
HaoBanErrCode
.
ERR_1
,
true
);
}
}
if
(
enterpriseDTO
.
getContactFlag
()
!=
null
&&
enterpriseDTO
.
getContactFlag
()
==
0
)
{
if
(
enterpriseDTO
.
getContactFlag
()
!=
null
&&
enterpriseDTO
.
getContactFlag
()
==
0
)
{
String
taskId
=
dealSyncOperationApiService
.
createQywxTask
(
wxEnterpriseId
,
"同步企业微信架构"
,
login
.
getStaff
DTO
().
getStaffId
(),
"首次同步企业微信架构"
);
String
taskId
=
dealSyncOperationApiService
.
createQywxTask
(
wxEnterpriseId
,
"同步企业微信架构"
,
login
.
getStaff
Id
(),
"首次同步企业微信架构"
);
if
(
StringUtils
.
isBlank
(
taskId
))
{
if
(
StringUtils
.
isBlank
(
taskId
))
{
log
.
info
(
"【是否绑定】taskId={}"
,
taskId
);
log
.
info
(
"【是否绑定】taskId={}"
,
taskId
);
return
resultResponse
(
HaoBanErrCode
.
ERR_1
,
true
);
return
resultResponse
(
HaoBanErrCode
.
ERR_1
,
true
);
...
@@ -164,7 +164,7 @@ public class ApplicationController extends WebBaseController {
...
@@ -164,7 +164,7 @@ public class ApplicationController extends WebBaseController {
return
resultResponse
(
HaoBanErrCode
.
ERR_1
,
false
);
return
resultResponse
(
HaoBanErrCode
.
ERR_1
,
false
);
}
}
if
(
StringUtils
.
isNotBlank
(
secretSetting
.
getSecretVal
())
&&
enterpriseDTO
.
getContactFlag
()
!=
null
)
{
if
(
StringUtils
.
isNotBlank
(
secretSetting
.
getSecretVal
())
&&
enterpriseDTO
.
getContactFlag
()
!=
null
)
{
String
taskId
=
dealSyncOperationApiService
.
createQywxTask
(
wxEnterpriseId
,
"后门同步企业微信架构"
,
login
.
getStaff
DTO
().
getStaffId
(),
"后门同步企业微信架构"
);
String
taskId
=
dealSyncOperationApiService
.
createQywxTask
(
wxEnterpriseId
,
"后门同步企业微信架构"
,
login
.
getStaff
Id
(),
"后门同步企业微信架构"
);
if
(
StringUtils
.
isBlank
(
taskId
))
{
if
(
StringUtils
.
isBlank
(
taskId
))
{
return
resultResponse
(
HaoBanErrCode
.
ERR_1
,
false
);
return
resultResponse
(
HaoBanErrCode
.
ERR_1
,
false
);
}
}
...
@@ -261,7 +261,7 @@ public class ApplicationController extends WebBaseController {
...
@@ -261,7 +261,7 @@ public class ApplicationController extends WebBaseController {
String
wxEnterpriseId
=
login
.
getWxEnterpriseId
();
String
wxEnterpriseId
=
login
.
getWxEnterpriseId
();
WxEnterpriseDTO
enterpriseDTO
=
this
.
wxEnterpriseApiService
.
getOne
(
wxEnterpriseId
);
WxEnterpriseDTO
enterpriseDTO
=
this
.
wxEnterpriseApiService
.
getOne
(
wxEnterpriseId
);
if
(
enterpriseDTO
!=
null
)
{
if
(
enterpriseDTO
!=
null
)
{
String
taskId
=
dealSyncOperationApiService
.
createQywxTask
(
wxEnterpriseId
,
"后门同步企业微信架构"
,
login
.
getStaff
DTO
().
getStaffId
(),
"后门同步企业微信架构"
);
String
taskId
=
dealSyncOperationApiService
.
createQywxTask
(
wxEnterpriseId
,
"后门同步企业微信架构"
,
login
.
getStaff
Id
(),
"后门同步企业微信架构"
);
if
(
StringUtils
.
isBlank
(
taskId
))
{
if
(
StringUtils
.
isBlank
(
taskId
))
{
return
resultResponse
(
HaoBanErrCode
.
ERR_0
,
false
);
return
resultResponse
(
HaoBanErrCode
.
ERR_0
,
false
);
}
}
...
...
haoban-manage3-web/src/main/java/com/gic/haoban/manage/web/controller/AuditController.java
View file @
fd55454e
...
@@ -6,7 +6,6 @@ import com.gic.enterprise.api.dto.StoreDTO;
...
@@ -6,7 +6,6 @@ import com.gic.enterprise.api.dto.StoreDTO;
import
com.gic.enterprise.api.service.StoreService
;
import
com.gic.enterprise.api.service.StoreService
;
import
com.gic.haoban.base.api.common.BasePageInfo
;
import
com.gic.haoban.base.api.common.BasePageInfo
;
import
com.gic.haoban.base.api.common.pojo.dto.WebLoginDTO
;
import
com.gic.haoban.base.api.common.pojo.dto.WebLoginDTO
;
import
com.gic.haoban.base.api.common.pojo.dto.WebStaffDTO
;
import
com.gic.haoban.common.anno.HttpLimit
;
import
com.gic.haoban.common.anno.HttpLimit
;
import
com.gic.haoban.common.utils.AuthWebRequestUtil
;
import
com.gic.haoban.common.utils.AuthWebRequestUtil
;
import
com.gic.haoban.common.utils.HaobanResponse
;
import
com.gic.haoban.common.utils.HaobanResponse
;
...
@@ -165,8 +164,8 @@ public class AuditController extends WebBaseController{
...
@@ -165,8 +164,8 @@ public class AuditController extends WebBaseController{
return
resultResponse
(
HaoBanErrCode
.
ERR_2
);
return
resultResponse
(
HaoBanErrCode
.
ERR_2
);
}
}
WebLoginDTO
login
=
AuthWebRequestUtil
.
getLoginUser
();
WebLoginDTO
login
=
AuthWebRequestUtil
.
getLoginUser
();
String
staffId
=
login
.
getStaff
DTO
().
getStaffId
();
String
staffId
=
login
.
getStaff
Id
();
String
staffName
=
login
.
getStaff
DTO
().
getStaffName
();
String
staffName
=
login
.
getStaff
Name
();
String
[]
s
=
auditIds
.
split
(
","
);
String
[]
s
=
auditIds
.
split
(
","
);
int
successCount
=
0
;
int
successCount
=
0
;
int
failCount
=
0
;
int
failCount
=
0
;
...
@@ -194,8 +193,8 @@ public class AuditController extends WebBaseController{
...
@@ -194,8 +193,8 @@ public class AuditController extends WebBaseController{
return
resultResponse
(
HaoBanErrCode
.
ERR_2
);
return
resultResponse
(
HaoBanErrCode
.
ERR_2
);
}
}
WebLoginDTO
login
=
AuthWebRequestUtil
.
getLoginUser
();
WebLoginDTO
login
=
AuthWebRequestUtil
.
getLoginUser
();
String
staffId
=
login
.
getStaff
DTO
().
getStaffId
();
String
staffId
=
login
.
getStaff
Id
();
String
staffName
=
login
.
getStaff
DTO
().
getStaffName
();
String
staffName
=
login
.
getStaff
Name
();
auditApiService
.
refuse
(
auditId
,
auditReason
,
staffId
,
staffName
);
auditApiService
.
refuse
(
auditId
,
auditReason
,
staffId
,
staffName
);
return
resultResponse
(
HaoBanErrCode
.
ERR_1
);
return
resultResponse
(
HaoBanErrCode
.
ERR_1
);
}
}
...
@@ -204,13 +203,8 @@ public class AuditController extends WebBaseController{
...
@@ -204,13 +203,8 @@ public class AuditController extends WebBaseController{
@RequestMapping
(
"audit"
)
@RequestMapping
(
"audit"
)
public
HaobanResponse
audit
(
String
auditId
,
String
auditName
)
{
public
HaobanResponse
audit
(
String
auditId
,
String
auditName
)
{
WebLoginDTO
login
=
AuthWebRequestUtil
.
getLoginUser
();
WebLoginDTO
login
=
AuthWebRequestUtil
.
getLoginUser
();
WebStaffDTO
loginStaffDTO
=
login
.
getStaffDTO
();
String
staffId
=
login
.
getStaffId
();
if
(
null
==
loginStaffDTO
)
{
String
staffName
=
login
.
getStaffName
();
return
resultResponse
(
HaoBanErrCode
.
ERR_4
);
}
String
staffId
=
login
.
getStaffDTO
().
getStaffId
();
String
staffName
=
login
.
getStaffDTO
().
getStaffName
();
if
(
StringUtils
.
isAnyBlank
(
auditId
)){
if
(
StringUtils
.
isAnyBlank
(
auditId
)){
return
resultResponse
(
HaoBanErrCode
.
ERR_2
);
return
resultResponse
(
HaoBanErrCode
.
ERR_2
);
}
}
...
...
haoban-manage3-web/src/main/java/com/gic/haoban/manage/web/controller/GicDepartmentController.java
View file @
fd55454e
package
com
.
gic
.
haoban
.
manage
.
web
.
controller
;
package
com
.
gic
.
haoban
.
manage
.
web
.
controller
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.stream.Collectors
;
import
org.apache.commons.collections.CollectionUtils
;
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
com.gic.enterprise.api.dto.PowerStoreGroupDTO
;
import
com.gic.enterprise.api.dto.PowerStoreGroupDTO
;
import
com.gic.enterprise.api.service.StoreGroupService
;
import
com.gic.enterprise.api.service.StoreGroupService
;
import
com.gic.haoban.base.api.common.pojo.dto.WebLoginDTO
;
import
com.gic.haoban.common.utils.AuthWebRequestUtil
;
import
com.gic.haoban.common.utils.HaobanResponse
;
import
com.gic.haoban.common.utils.HaobanResponse
;
import
com.gic.haoban.manage.api.dto.LoginDTO
;
import
com.gic.haoban.manage.api.dto.StoreRangeInfoDTO
;
import
com.gic.haoban.manage.api.dto.StoreRangeInfoDTO
;
import
com.gic.haoban.manage.api.dto.WxEnterpriseDTO
;
import
com.gic.haoban.manage.api.dto.WxEnterpriseDTO
;
import
com.gic.haoban.manage.api.service.WxEnterpriseRelatedApiService
;
import
com.gic.haoban.manage.api.service.WxEnterpriseRelatedApiService
;
import
com.gic.haoban.manage.web.errCode.HaoBanErrCode
;
import
com.gic.haoban.manage.web.errCode.HaoBanErrCode
;
import
com.gic.haoban.manage.web.vo.StoreGroupVo
;
import
com.gic.haoban.manage.web.vo.StoreGroupVo
;
import
org.apache.commons.collections.CollectionUtils
;
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.HashMap
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.stream.Collectors
;
@RestController
@RestController
public
class
GicDepartmentController
extends
WebBaseController
{
public
class
GicDepartmentController
extends
WebBaseController
{
...
@@ -42,7 +44,7 @@ public class GicDepartmentController extends WebBaseController{
...
@@ -42,7 +44,7 @@ public class GicDepartmentController extends WebBaseController{
@RequestMapping
(
"gic-store-group-list"
)
@RequestMapping
(
"gic-store-group-list"
)
public
HaobanResponse
storeGroupList
(
String
enterpriseId
,
String
keyWord
)
{
public
HaobanResponse
storeGroupList
(
String
enterpriseId
,
String
keyWord
)
{
LoginDTO
loginUser
=
this
.
getLoginUser
();
WebLoginDTO
loginUser
=
AuthWebRequestUtil
.
getLoginUser
();
String
wxEnterpriseId
=
loginUser
.
getWxEnterpriseId
();
String
wxEnterpriseId
=
loginUser
.
getWxEnterpriseId
();
List
<
PowerStoreGroupDTO
>
departmentList
=
storeGroupService
.
getStoreGroupList
(
enterpriseId
,
keyWord
);
List
<
PowerStoreGroupDTO
>
departmentList
=
storeGroupService
.
getStoreGroupList
(
enterpriseId
,
keyWord
);
List
<
StoreRangeInfoDTO
>
rangeInfoDTOList
=
wxEnterpriseRelatedApiService
.
listAllBindStoreOrGroup
(
enterpriseId
);
List
<
StoreRangeInfoDTO
>
rangeInfoDTOList
=
wxEnterpriseRelatedApiService
.
listAllBindStoreOrGroup
(
enterpriseId
);
...
...
haoban-manage3-web/src/main/java/com/gic/haoban/manage/web/controller/LoginController.java
View file @
fd55454e
This diff is collapsed.
Click to expand it.
haoban-manage3-web/src/main/java/com/gic/haoban/manage/web/controller/MaterialController.java
View file @
fd55454e
...
@@ -125,9 +125,8 @@ public class MaterialController extends WebBaseController {
...
@@ -125,9 +125,8 @@ public class MaterialController extends WebBaseController {
String
wxEnterpriseId
=
login
.
getWxEnterpriseId
();
String
wxEnterpriseId
=
login
.
getWxEnterpriseId
();
materialDTO
.
setWxEnterpriseId
(
wxEnterpriseId
);
materialDTO
.
setWxEnterpriseId
(
wxEnterpriseId
);
WebStaffDTO
staff
=
login
.
getStaffDTO
();
materialDTO
.
setStaffId
(
login
.
getStaffId
());
materialDTO
.
setStaffId
(
staff
.
getStaffId
());
materialDTO
.
setStaffName
(
login
.
getStaffName
());
materialDTO
.
setStaffName
(
staff
.
getStaffName
());
String
materialTitle
=
materialDTO
.
getMaterialTitle
();
String
materialTitle
=
materialDTO
.
getMaterialTitle
();
String
categoryId
=
materialDTO
.
getCategoryId
();
String
categoryId
=
materialDTO
.
getCategoryId
();
Integer
categoryType
=
materialDTO
.
getMaterialType
();
Integer
categoryType
=
materialDTO
.
getMaterialType
();
...
@@ -155,9 +154,8 @@ public class MaterialController extends WebBaseController {
...
@@ -155,9 +154,8 @@ public class MaterialController extends WebBaseController {
BatchAddMaterialDTO
.
Material
material
=
dto
.
getMaterial
();
BatchAddMaterialDTO
.
Material
material
=
dto
.
getMaterial
();
WebLoginDTO
login
=
AuthWebRequestUtil
.
getLoginUser
();
WebLoginDTO
login
=
AuthWebRequestUtil
.
getLoginUser
();
material
.
setWxEnterpriseId
(
login
.
getWxEnterpriseId
());
material
.
setWxEnterpriseId
(
login
.
getWxEnterpriseId
());
WebStaffDTO
staff
=
login
.
getStaffDTO
();
material
.
setStaffId
(
login
.
getStaffId
());
material
.
setStaffId
(
staff
.
getStaffId
());
material
.
setStaffName
(
login
.
getStaffName
());
material
.
setStaffName
(
staff
.
getStaffName
());
if
(
StringUtils
.
isAnyBlank
(
material
.
getCategoryId
(),
material
.
getMaterialTitle
())
if
(
StringUtils
.
isAnyBlank
(
material
.
getCategoryId
(),
material
.
getMaterialTitle
())
||
Objects
.
isNull
(
material
.
getMaterialType
()))
{
||
Objects
.
isNull
(
material
.
getMaterialType
()))
{
return
resultResponse
(
HaoBanErrCode
.
ERR_2
);
return
resultResponse
(
HaoBanErrCode
.
ERR_2
);
...
@@ -185,10 +183,8 @@ public class MaterialController extends WebBaseController {
...
@@ -185,10 +183,8 @@ public class MaterialController extends WebBaseController {
@RequestMapping
(
"/material-edit"
)
@RequestMapping
(
"/material-edit"
)
public
HaobanResponse
materialEdit
(
MaterialDTO
materialDTO
)
{
public
HaobanResponse
materialEdit
(
MaterialDTO
materialDTO
)
{
WebLoginDTO
login
=
AuthWebRequestUtil
.
getLoginUser
();
WebLoginDTO
login
=
AuthWebRequestUtil
.
getLoginUser
();
materialDTO
.
setStaffId
(
login
.
getStaffId
());
WebStaffDTO
staff
=
login
.
getStaffDTO
();
materialDTO
.
setStaffName
(
login
.
getStaffName
());
materialDTO
.
setStaffId
(
staff
.
getStaffId
());
materialDTO
.
setStaffName
(
staff
.
getStaffName
());
String
materialId
=
materialDTO
.
getMaterialId
();
String
materialId
=
materialDTO
.
getMaterialId
();
MaterialDTO
dto
=
materialApiService
.
selectMaterialById
(
materialId
);
MaterialDTO
dto
=
materialApiService
.
selectMaterialById
(
materialId
);
if
(
dto
==
null
)
{
if
(
dto
==
null
)
{
...
...
haoban-manage3-web/src/main/java/com/gic/haoban/manage/web/controller/RightController.java
View file @
fd55454e
...
@@ -40,7 +40,7 @@ public class RightController extends WebBaseController {
...
@@ -40,7 +40,7 @@ public class RightController extends WebBaseController {
@RequestMapping
(
"get-haoban-menu"
)
@RequestMapping
(
"get-haoban-menu"
)
public
HaobanResponse
getHaobanMenu
(
HttpServletRequest
request
,
String
enterpriseId
)
{
public
HaobanResponse
getHaobanMenu
(
HttpServletRequest
request
,
String
enterpriseId
)
{
WebLoginDTO
login
=
AuthWebRequestUtil
.
getLoginUser
();
WebLoginDTO
login
=
AuthWebRequestUtil
.
getLoginUser
();
String
phoneNumber
=
login
.
get
StaffDTO
().
get
PhoneNumber
();
String
phoneNumber
=
login
.
getPhoneNumber
();
Enumeration
<
String
>
e
=
request
.
getHeaderNames
()
;
Enumeration
<
String
>
e
=
request
.
getHeaderNames
()
;
while
(
e
.
hasMoreElements
())
{
while
(
e
.
hasMoreElements
())
{
String
name
=
e
.
nextElement
()
;
String
name
=
e
.
nextElement
()
;
...
@@ -67,7 +67,7 @@ public class RightController extends WebBaseController {
...
@@ -67,7 +67,7 @@ public class RightController extends WebBaseController {
@RequestMapping
(
"get-haoban-right"
)
@RequestMapping
(
"get-haoban-right"
)
public
HaobanResponse
listHaobanAllMenu
(
HttpServletRequest
request
,
String
enterpriseId
)
{
public
HaobanResponse
listHaobanAllMenu
(
HttpServletRequest
request
,
String
enterpriseId
)
{
WebLoginDTO
login
=
AuthWebRequestUtil
.
getLoginUser
();
WebLoginDTO
login
=
AuthWebRequestUtil
.
getLoginUser
();
String
phoneNumber
=
login
.
get
StaffDTO
().
get
PhoneNumber
();
String
phoneNumber
=
login
.
getPhoneNumber
();
if
(
StringUtils
.
isBlank
(
enterpriseId
))
{
if
(
StringUtils
.
isBlank
(
enterpriseId
))
{
enterpriseId
=
request
.
getHeader
(
"enterpriseid"
)
;
enterpriseId
=
request
.
getHeader
(
"enterpriseid"
)
;
}
}
...
...
haoban-manage3-web/src/main/java/com/gic/haoban/manage/web/controller/StaffController.java
View file @
fd55454e
...
@@ -324,16 +324,11 @@ public class StaffController extends WebBaseController {
...
@@ -324,16 +324,11 @@ public class StaffController extends WebBaseController {
@RequestMapping
(
"del-clerk-relation"
)
@RequestMapping
(
"del-clerk-relation"
)
public
HaobanResponse
delStaffClerkList
(
String
staffId
,
String
clerkId
)
{
public
HaobanResponse
delStaffClerkList
(
String
staffId
,
String
clerkId
)
{
WebLoginDTO
login
=
AuthWebRequestUtil
.
getLoginUser
();
WebLoginDTO
login
=
AuthWebRequestUtil
.
getLoginUser
();
WebStaffDTO
staffDTO
=
login
.
getStaffDTO
();
if
(
staffDTO
==
null
)
{
logger
.
info
(
"登录异常"
);
return
resultResponse
(
HaoBanErrCode
.
ERR_4
);
}
StaffDTO
staff
=
staffApiService
.
selectById
(
staffId
);
StaffDTO
staff
=
staffApiService
.
selectById
(
staffId
);
if
(
staff
==
null
)
{
if
(
staff
==
null
)
{
return
resultResponse
(
HaoBanErrCode
.
ERR_10007
);
return
resultResponse
(
HaoBanErrCode
.
ERR_10007
);
}
}
boolean
b
=
staffClerkRelationApiService
.
unbindByStaffAndClerkId
(
staffDTO
.
getStaffId
(),
clerkId
);
boolean
b
=
staffClerkRelationApiService
.
unbindByStaffAndClerkId
(
login
.
getStaffId
(),
clerkId
);
return
resultResponse
(
HaoBanErrCode
.
ERR_1
,
b
);
return
resultResponse
(
HaoBanErrCode
.
ERR_1
,
b
);
}
}
...
@@ -400,10 +395,6 @@ public class StaffController extends WebBaseController {
...
@@ -400,10 +395,6 @@ public class StaffController extends WebBaseController {
@RequestMapping
(
"add-clerk-relation"
)
@RequestMapping
(
"add-clerk-relation"
)
public
HaobanResponse
staffClerkSearch
(
String
staffId
,
String
clerkId
)
{
public
HaobanResponse
staffClerkSearch
(
String
staffId
,
String
clerkId
)
{
WebLoginDTO
login
=
AuthWebRequestUtil
.
getLoginUser
();
WebLoginDTO
login
=
AuthWebRequestUtil
.
getLoginUser
();
WebStaffDTO
loginStaffDTO
=
login
.
getStaffDTO
();
if
(
null
==
loginStaffDTO
)
{
return
resultResponse
(
HaoBanErrCode
.
ERR_4
);
}
if
(
StringUtils
.
isAnyBlank
(
staffId
,
clerkId
))
{
if
(
StringUtils
.
isAnyBlank
(
staffId
,
clerkId
))
{
return
resultResponse
(
HaoBanErrCode
.
ERR_2
);
return
resultResponse
(
HaoBanErrCode
.
ERR_2
);
}
}
...
@@ -425,7 +416,7 @@ public class StaffController extends WebBaseController {
...
@@ -425,7 +416,7 @@ public class StaffController extends WebBaseController {
relationDTO
.
setWxUserId
(
staffDTO
.
getWxUserId
());
relationDTO
.
setWxUserId
(
staffDTO
.
getWxUserId
());
ServiceResponse
response
=
staffClerkRelationApiService
.
bindStaffClerk
(
relationDTO
,
login
StaffDTO
.
getStaffId
(),
ChannelCodeEnum
.
ADMIN_BIND
.
getCode
());
ServiceResponse
response
=
staffClerkRelationApiService
.
bindStaffClerk
(
relationDTO
,
login
.
getStaffId
(),
ChannelCodeEnum
.
ADMIN_BIND
.
getCode
());
logger
.
info
(
"返回信息:{}"
,
JSONObject
.
toJSONString
(
response
));
logger
.
info
(
"返回信息:{}"
,
JSONObject
.
toJSONString
(
response
));
if
(
response
.
getCode
()
==
1
)
{
if
(
response
.
getCode
()
==
1
)
{
return
resultResponse
(
HaoBanErrCode
.
ERR_1
);
return
resultResponse
(
HaoBanErrCode
.
ERR_1
);
...
@@ -444,11 +435,7 @@ public class StaffController extends WebBaseController {
...
@@ -444,11 +435,7 @@ public class StaffController extends WebBaseController {
@RequestMapping
(
"staff-clerk-bind-log"
)
@RequestMapping
(
"staff-clerk-bind-log"
)
public
HaobanResponse
bindLogs
(
String
search
,
String
enterpriseId
,
@RequestParam
(
defaultValue
=
"-1"
)
Integer
optType
,
BasePageInfo
qo
)
{
public
HaobanResponse
bindLogs
(
String
search
,
String
enterpriseId
,
@RequestParam
(
defaultValue
=
"-1"
)
Integer
optType
,
BasePageInfo
qo
)
{
WebLoginDTO
login
=
AuthWebRequestUtil
.
getLoginUser
();
WebLoginDTO
login
=
AuthWebRequestUtil
.
getLoginUser
();
WebStaffDTO
loginStaffDTO
=
login
.
getStaffDTO
();
Page
<
StaffClerkBindLogDetailDTO
>
page
=
staffClerkRelationApiService
.
pageStaffClerkBindLog
(
login
.
getWxEnterpriseId
(),
search
,
enterpriseId
,
optType
,
qo
);
if
(
null
==
loginStaffDTO
)
{
return
resultResponse
(
HaoBanErrCode
.
ERR_4
);
}
Page
<
StaffClerkBindLogDetailDTO
>
page
=
staffClerkRelationApiService
.
pageStaffClerkBindLog
(
loginStaffDTO
.
getWxEnterpriseId
(),
search
,
enterpriseId
,
optType
,
qo
);
return
resultResponse
(
HaoBanErrCode
.
ERR_1
,
page
);
return
resultResponse
(
HaoBanErrCode
.
ERR_1
,
page
);
}
}
...
...
haoban-manage3-web/src/main/java/com/gic/haoban/manage/web/controller/SyncDealContoller.java
View file @
fd55454e
...
@@ -49,7 +49,7 @@ public class SyncDealContoller extends WebBaseController {
...
@@ -49,7 +49,7 @@ public class SyncDealContoller extends WebBaseController {
if
(
RedisUtil
.
getCache
(
key
)
!=
null
)
{
if
(
RedisUtil
.
getCache
(
key
)
!=
null
)
{
return
resultResponse
(
HaoBanErrCode
.
ERR_10011
);
return
resultResponse
(
HaoBanErrCode
.
ERR_10011
);
}
}
task
=
dealSyncOperationApiService
.
createTask
(
wxEnterpriseId
,
"门店同步"
,
login
.
getStaff
DTO
().
getStaffId
(),
"部门同步"
);
task
=
dealSyncOperationApiService
.
createTask
(
wxEnterpriseId
,
"门店同步"
,
login
.
getStaff
Id
(),
"部门同步"
);
dealSyncOperationApiService
.
dealDepartment
(
task
,
login
.
getWxEnterpriseId
(),
qo
.
getAddDepartment
(),
qo
.
getEditDepartment
());
dealSyncOperationApiService
.
dealDepartment
(
task
,
login
.
getWxEnterpriseId
(),
qo
.
getAddDepartment
(),
qo
.
getEditDepartment
());
}
}
...
@@ -72,11 +72,7 @@ public class SyncDealContoller extends WebBaseController {
...
@@ -72,11 +72,7 @@ public class SyncDealContoller extends WebBaseController {
if
(
null
!=
taskLock
)
{
if
(
null
!=
taskLock
)
{
return
resultResponse
(
HaoBanErrCode
.
ERR_10011
);
return
resultResponse
(
HaoBanErrCode
.
ERR_10011
);
}
}
WebStaffDTO
staffDTO
=
login
.
getStaffDTO
();
String
staffId
=
"admin"
;
String
staffId
=
"admin"
;
if
(
null
!=
staffDTO
)
{
staffId
=
staffDTO
.
getStaffId
();
}
String
format
=
DateFormatUtils
.
format
(
new
Date
(),
"yyyy-MM-dd HH:mm:ss"
);
String
format
=
DateFormatUtils
.
format
(
new
Date
(),
"yyyy-MM-dd HH:mm:ss"
);
task
=
dealSyncOperationApiService
.
createTask
(
wxEnterpriseId
,
"门店同步-"
+
format
,
staffId
,
"部门同步"
);
task
=
dealSyncOperationApiService
.
createTask
(
wxEnterpriseId
,
"门店同步-"
+
format
,
staffId
,
"部门同步"
);
if
(
task
==
null
)
{
if
(
task
==
null
)
{
...
...
haoban-manage3-web/src/main/java/com/gic/haoban/manage/web/controller/WebBaseController.java
View file @
fd55454e
package
com
.
gic
.
haoban
.
manage
.
web
.
controller
;
package
com
.
gic
.
haoban
.
manage
.
web
.
controller
;
import
com.gic.haoban.common.utils.AuthWebRequestUtil
;
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.LoginDTO
;
import
com.gic.haoban.manage.web.errCode.HaoBanErrCode
;
import
com.gic.haoban.manage.web.errCode.HaoBanErrCode
;
/**
/**
...
@@ -40,13 +37,12 @@ public class WebBaseController {
...
@@ -40,13 +37,12 @@ public class WebBaseController {
return
response
;
return
response
;
}
}
/**
public
HaobanResponse
success
(
Object
obj
)
{
* 获取登陆信息
return
resultResponse
(
HaoBanErrCode
.
ERR_1
,
obj
,
null
);
*
}
* @return
*/
public
HaobanResponse
fail
(
String
message
)
{
protected
LoginDTO
getLoginUser
()
{
return
resultResponse
(
HaoBanErrCode
.
ERR_OTHER
,
null
,
message
);
return
EntityUtil
.
changeEntityByJSON
(
LoginDTO
.
class
,
AuthWebRequestUtil
.
getLoginUser
());
}
}
}
}
haoban-manage3-web/src/main/java/com/gic/haoban/manage/web/controller/WelcomeController.java
View file @
fd55454e
...
@@ -67,15 +67,15 @@ public class WelcomeController extends WebBaseController {
...
@@ -67,15 +67,15 @@ public class WelcomeController extends WebBaseController {
qdto
.
setWxEnterpriseId
(
qo
.
getWxEnterpriseId
());
qdto
.
setWxEnterpriseId
(
qo
.
getWxEnterpriseId
());
qdto
.
setTitle
(
qo
.
getTitle
());
qdto
.
setTitle
(
qo
.
getTitle
());
qdto
.
setWelcomeContent
(
qo
.
getWelcomeContent
());
qdto
.
setWelcomeContent
(
qo
.
getWelcomeContent
());
qdto
.
setOperatorId
(
login
.
getStaff
DTO
().
getStaff
Id
());
qdto
.
setOperatorId
(
login
.
getStaffId
());
qdto
.
setOperatorName
(
login
.
getStaff
DTO
().
getStaff
Name
());
qdto
.
setOperatorName
(
login
.
getStaffName
());
qdto
.
setDefaultWelcomeFlag
(
qo
.
getDefaultWelcomeFlag
());
qdto
.
setDefaultWelcomeFlag
(
qo
.
getDefaultWelcomeFlag
());
qdto
.
setWelcomeMediaList
(
EntityUtil
.
changeEntityListNew
(
SaveWelcomeMediaQDTO
.
class
,
qo
.
getWelcomeMediaList
()));
qdto
.
setWelcomeMediaList
(
EntityUtil
.
changeEntityListNew
(
SaveWelcomeMediaQDTO
.
class
,
qo
.
getWelcomeMediaList
()));
qdto
.
setSuitDepartmentAddList
(
qo
.
getSuitDepartmentAddList
());
qdto
.
setSuitDepartmentAddList
(
qo
.
getSuitDepartmentAddList
());
qdto
.
setSuitDepartmentDeleteList
(
qo
.
getSuitDepartmentDeleteList
());
qdto
.
setSuitDepartmentDeleteList
(
qo
.
getSuitDepartmentDeleteList
());
// 员工暂时不传
// 员工暂时不传
qdto
.
setCreatorId
(
login
.
getStaff
DTO
().
getStaff
Id
());
qdto
.
setCreatorId
(
login
.
getStaffId
());
qdto
.
setCreatorName
(
login
.
getStaff
DTO
().
getStaff
Name
());
qdto
.
setCreatorName
(
login
.
getStaffName
());
ServiceResponse
<
Boolean
>
response
=
welcomeApiService
.
saveWelcome
(
qdto
);
ServiceResponse
<
Boolean
>
response
=
welcomeApiService
.
saveWelcome
(
qdto
);
return
RestResponse
.
successResult
(
response
.
getResult
());
return
RestResponse
.
successResult
(
response
.
getResult
());
}
}
...
@@ -142,8 +142,8 @@ public class WelcomeController extends WebBaseController {
...
@@ -142,8 +142,8 @@ public class WelcomeController extends WebBaseController {
public
RestResponse
<
Boolean
>
saveFriendSetting
(
@RequestBody
@Valid
SaveFriendSettingQO
qo
)
{
public
RestResponse
<
Boolean
>
saveFriendSetting
(
@RequestBody
@Valid
SaveFriendSettingQO
qo
)
{
WebLoginDTO
login
=
AuthWebRequestUtil
.
getLoginUser
();
WebLoginDTO
login
=
AuthWebRequestUtil
.
getLoginUser
();
SaveFriendSettingQDTO
qdto
=
EntityUtil
.
changeEntityNew
(
SaveFriendSettingQDTO
.
class
,
qo
);
SaveFriendSettingQDTO
qdto
=
EntityUtil
.
changeEntityNew
(
SaveFriendSettingQDTO
.
class
,
qo
);
qdto
.
setUpdateId
(
login
.
getStaff
DTO
().
getStaff
Id
());
qdto
.
setUpdateId
(
login
.
getStaffId
());
qdto
.
setUpdateName
(
login
.
getStaff
DTO
().
getStaff
Name
());
qdto
.
setUpdateName
(
login
.
getStaffName
());
ServiceResponse
<
Boolean
>
response
=
welcomeApiService
.
saveFriendSetting
(
qdto
);
ServiceResponse
<
Boolean
>
response
=
welcomeApiService
.
saveFriendSetting
(
qdto
);
return
RestResponse
.
successResult
(
response
.
getResult
());
return
RestResponse
.
successResult
(
response
.
getResult
());
}
}
...
...
haoban-manage3-web/src/main/java/com/gic/haoban/manage/web/controller/WxEnterpriseController.java
View file @
fd55454e
...
@@ -201,9 +201,8 @@ public class WxEnterpriseController extends WebBaseController {
...
@@ -201,9 +201,8 @@ public class WxEnterpriseController extends WebBaseController {
}
}
WebLoginDTO
login
=
AuthWebRequestUtil
.
getLoginUser
();
WebLoginDTO
login
=
AuthWebRequestUtil
.
getLoginUser
();
String
wxEnterpriseId
=
login
.
getWxEnterpriseId
();
String
wxEnterpriseId
=
login
.
getWxEnterpriseId
();
WebStaffDTO
staff
=
login
.
getStaffDTO
();
String
staffId
=
login
.
getStaffId
();
String
staffId
=
staff
.
getStaffId
();
String
staffName
=
login
.
getStaffName
();
String
staffName
=
staff
.
getStaffName
();
WxEnterpriseRelationDetailDTO
detailDTO
=
new
WxEnterpriseRelationDetailDTO
();
WxEnterpriseRelationDetailDTO
detailDTO
=
new
WxEnterpriseRelationDetailDTO
();
detailDTO
.
setWxEnterpriseRelatedId
(
bindQo
.
getWxEnterpriseRelatedId
());
detailDTO
.
setWxEnterpriseRelatedId
(
bindQo
.
getWxEnterpriseRelatedId
());
...
@@ -316,7 +315,7 @@ public class WxEnterpriseController extends WebBaseController {
...
@@ -316,7 +315,7 @@ public class WxEnterpriseController extends WebBaseController {
}
}
contactSecret
=
contactSecret
.
trim
();
contactSecret
=
contactSecret
.
trim
();
UserDTO
user
=
qywxUserApiService
.
getSelfWorkWxUser
(
wxEnterprise
.
getCorpid
(),
contactSecret
,
getWxUserId
(
wxEnterpriseId
,
login
.
getStaffDTO
()
));
UserDTO
user
=
qywxUserApiService
.
getSelfWorkWxUser
(
wxEnterprise
.
getCorpid
(),
contactSecret
,
getWxUserId
(
wxEnterpriseId
,
login
));
logger
.
info
(
"【保存联系人key】user={}"
,
JSON
.
toJSONString
(
user
));
logger
.
info
(
"【保存联系人key】user={}"
,
JSON
.
toJSONString
(
user
));
SecretSettingDTO
secretSetting
=
wxEnterpriseApiService
.
getSecretSetting
(
wxEnterpriseId
,
SecretTypeEnum
.
CONTACT_SECRET
.
getVal
(),
null
);
SecretSettingDTO
secretSetting
=
wxEnterpriseApiService
.
getSecretSetting
(
wxEnterpriseId
,
SecretTypeEnum
.
CONTACT_SECRET
.
getVal
(),
null
);
if
(
null
==
secretSetting
)
{
if
(
null
==
secretSetting
)
{
...
@@ -356,7 +355,7 @@ public class WxEnterpriseController extends WebBaseController {
...
@@ -356,7 +355,7 @@ public class WxEnterpriseController extends WebBaseController {
return
resultResponse
(
HaoBanErrCode
.
ERR_10012
);
return
resultResponse
(
HaoBanErrCode
.
ERR_10012
);
}
}
wxSecretKey
=
wxSecretKey
.
trim
();
wxSecretKey
=
wxSecretKey
.
trim
();
String
res
=
qywxUserApiService
.
listSelfExternalUserid
(
wxEnterprise
.
getCorpid
(),
wxSecretKey
,
getWxUserId
(
wxEnterpriseId
,
login
.
getStaffDTO
()
));
String
res
=
qywxUserApiService
.
listSelfExternalUserid
(
wxEnterprise
.
getCorpid
(),
wxSecretKey
,
getWxUserId
(
wxEnterpriseId
,
login
));
logger
.
info
(
"【保存联系人key】res={}"
,
res
);
logger
.
info
(
"【保存联系人key】res={}"
,
res
);
SecretSettingDTO
secretSetting
=
wxEnterpriseApiService
.
getSecretSetting
(
wxEnterpriseId
,
SecretTypeEnum
.
CONTACT_CUSTOMER
.
getVal
(),
null
);
SecretSettingDTO
secretSetting
=
wxEnterpriseApiService
.
getSecretSetting
(
wxEnterpriseId
,
SecretTypeEnum
.
CONTACT_CUSTOMER
.
getVal
(),
null
);
if
(
null
==
secretSetting
)
{
if
(
null
==
secretSetting
)
{
...
@@ -403,7 +402,7 @@ public class WxEnterpriseController extends WebBaseController {
...
@@ -403,7 +402,7 @@ public class WxEnterpriseController extends WebBaseController {
return
resultResponse
(
HaoBanErrCode
.
ERR_100017
);
return
resultResponse
(
HaoBanErrCode
.
ERR_100017
);
}
}
}
}
UserDTO
user
=
qywxUserApiService
.
getSelfWorkWxUser
(
wxEnterprise
.
getCorpid
(),
memberSecret
,
getWxUserId
(
wxEnterpriseId
,
login
.
getStaffDTO
()
));
UserDTO
user
=
qywxUserApiService
.
getSelfWorkWxUser
(
wxEnterprise
.
getCorpid
(),
memberSecret
,
getWxUserId
(
wxEnterpriseId
,
login
));
secretSetting
.
setSecretType
(
SecretTypeEnum
.
MEMBER_WAPP
.
getVal
());
secretSetting
.
setSecretType
(
SecretTypeEnum
.
MEMBER_WAPP
.
getVal
());
secretSetting
.
setSecretName
(
secretName
);
secretSetting
.
setSecretName
(
secretName
);
secretSetting
.
setEnterpriseId
(
enterpriseId
);
secretSetting
.
setEnterpriseId
(
enterpriseId
);
...
@@ -421,7 +420,7 @@ public class WxEnterpriseController extends WebBaseController {
...
@@ -421,7 +420,7 @@ public class WxEnterpriseController extends WebBaseController {
}
}
}
}
private
String
getWxUserId
(
String
wxEnterpriseId
,
Web
Staff
DTO
loginStaffDTO
)
{
private
String
getWxUserId
(
String
wxEnterpriseId
,
Web
Login
DTO
loginStaffDTO
)
{
if
(
loginStaffDTO
!=
null
&&
(!
StringUtils
.
isEmpty
(
loginStaffDTO
.
getWxUserId
())))
{
if
(
loginStaffDTO
!=
null
&&
(!
StringUtils
.
isEmpty
(
loginStaffDTO
.
getWxUserId
())))
{
return
loginStaffDTO
.
getWxUserId
();
return
loginStaffDTO
.
getWxUserId
();
}
}
...
@@ -453,7 +452,7 @@ public class WxEnterpriseController extends WebBaseController {
...
@@ -453,7 +452,7 @@ public class WxEnterpriseController extends WebBaseController {
}
}
contactSecret
=
contactSecret
.
trim
();
contactSecret
=
contactSecret
.
trim
();
UserDTO
user
=
qywxUserApiService
.
getSelfWorkWxUser
(
wxEnterprise
.
getCorpid
(),
contactSecret
,
getWxUserId
(
wxEnterpriseId
,
login
.
getStaffDTO
()
));
UserDTO
user
=
qywxUserApiService
.
getSelfWorkWxUser
(
wxEnterprise
.
getCorpid
(),
contactSecret
,
getWxUserId
(
wxEnterpriseId
,
login
));
logger
.
info
(
"【保存联系人key】user={}"
,
JSON
.
toJSONString
(
user
));
logger
.
info
(
"【保存联系人key】user={}"
,
JSON
.
toJSONString
(
user
));
SecretSettingDTO
secretSetting
=
wxEnterpriseApiService
.
getSecretSetting
(
wxEnterpriseId
,
SecretTypeEnum
.
HAOBAN_HELP
.
getVal
(),
null
);
SecretSettingDTO
secretSetting
=
wxEnterpriseApiService
.
getSecretSetting
(
wxEnterpriseId
,
SecretTypeEnum
.
HAOBAN_HELP
.
getVal
(),
null
);
if
(
null
==
secretSetting
)
{
if
(
null
==
secretSetting
)
{
...
@@ -516,31 +515,6 @@ public class WxEnterpriseController extends WebBaseController {
...
@@ -516,31 +515,6 @@ public class WxEnterpriseController extends WebBaseController {
}
}
/**
/**
* 判断企业是否过期
*
* @param enterpriseId
* @return
*/
@RequestMapping
(
"enterprise-is-over"
)
public
HaobanResponse
enterpriseIsOver
(
String
enterpriseId
)
{
if
(
StringUtils
.
isEmpty
(
enterpriseId
))
{
return
resultResponse
(
HaoBanErrCode
.
ERR_2
);
}
boolean
flag
=
wxEnterpriseApiService
.
enterpriseIsOver
(
enterpriseId
);
//切换企业 更新token中的企业id
if
(!
flag
)
{
String
token
=
AuthWebRequestUtil
.
getToken
();
WebLoginDTO
loginUser
=
AuthWebRequestUtil
.
getLoginUser
();
if
(
loginUser
!=
null
)
{
loginUser
.
setEnterpriseId
(
enterpriseId
);
AuthWebRequestUtil
.
setSessionUser
(
loginUser
);
AuthWebRequestUtil
.
setAppLoginUser
(
token
,
loginUser
);
}
}
return
resultResponse
(
HaoBanErrCode
.
ERR_1
,
flag
);
}
/**
* 刷新企业微信好友
* 刷新企业微信好友
*
*
* @return
* @return
...
@@ -560,7 +534,7 @@ public class WxEnterpriseController extends WebBaseController {
...
@@ -560,7 +534,7 @@ public class WxEnterpriseController extends WebBaseController {
if
(
monthCount
>=
3
)
{
if
(
monthCount
>=
3
)
{
return
resultResponse
(
HaoBanErrCode
.
ERR_100020
);
return
resultResponse
(
HaoBanErrCode
.
ERR_100020
);
}
}
String
taskId
=
dealSyncOperationApiService
.
createWxFriendTask
(
wxEnterpriseId
,
"刷新企微好友"
,
login
.
getStaff
DTO
().
getStaff
Id
(),
"刷新企微好友"
);
String
taskId
=
dealSyncOperationApiService
.
createWxFriendTask
(
wxEnterpriseId
,
"刷新企微好友"
,
login
.
getStaffId
(),
"刷新企微好友"
);
if
(
StringUtils
.
isEmpty
(
taskId
))
{
if
(
StringUtils
.
isEmpty
(
taskId
))
{
return
resultResponse
(
HaoBanErrCode
.
ERR_100021
);
return
resultResponse
(
HaoBanErrCode
.
ERR_100021
);
}
}
...
@@ -627,7 +601,7 @@ public class WxEnterpriseController extends WebBaseController {
...
@@ -627,7 +601,7 @@ public class WxEnterpriseController extends WebBaseController {
public
HaobanResponse
flushBindStoreList
(
String
enterpriseId
)
{
public
HaobanResponse
flushBindStoreList
(
String
enterpriseId
)
{
WebLoginDTO
login
=
AuthWebRequestUtil
.
getLoginUser
();
WebLoginDTO
login
=
AuthWebRequestUtil
.
getLoginUser
();
String
wxEnterpriseId
=
login
.
getWxEnterpriseId
();
String
wxEnterpriseId
=
login
.
getWxEnterpriseId
();
ServiceResponse
response
=
wxEnterpriseRelatedApiService
.
flushBindStoreByEnterpriseId
(
enterpriseId
,
wxEnterpriseId
,
login
.
getStaff
DTO
().
getStaff
Id
(),
ChannelCodeEnum
.
SYNC_UNBIND
.
getCode
());
ServiceResponse
response
=
wxEnterpriseRelatedApiService
.
flushBindStoreByEnterpriseId
(
enterpriseId
,
wxEnterpriseId
,
login
.
getStaffId
(),
ChannelCodeEnum
.
SYNC_UNBIND
.
getCode
());
logger
.
info
(
"返回信息:{}"
,
JSONObject
.
toJSONString
(
response
));
logger
.
info
(
"返回信息:{}"
,
JSONObject
.
toJSONString
(
response
));
if
(
response
.
getCode
()
!=
1
)
{
if
(
response
.
getCode
()
!=
1
)
{
HaoBanErrCode
.
ERR_DEFINE
.
setMsg
(
response
.
getMessage
());
HaoBanErrCode
.
ERR_DEFINE
.
setMsg
(
response
.
getMessage
());
...
@@ -709,7 +683,7 @@ public class WxEnterpriseController extends WebBaseController {
...
@@ -709,7 +683,7 @@ public class WxEnterpriseController extends WebBaseController {
*/
*/
@RequestMapping
(
"/agent-wx-enterprise-list"
)
@RequestMapping
(
"/agent-wx-enterprise-list"
)
public
HaobanResponse
materialShare
(
String
materialId
)
{
public
HaobanResponse
materialShare
(
String
materialId
)
{
LoginDTO
loginUser
=
this
.
getLoginUser
();
WebLoginDTO
loginUser
=
AuthWebRequestUtil
.
getLoginUser
();
String
wxEnterpriseId
=
loginUser
.
getWxEnterpriseId
();
String
wxEnterpriseId
=
loginUser
.
getWxEnterpriseId
();
List
<
EnterpriseDetailDTO
>
detailDTOS
=
wxEnterpriseRelatedApiService
.
listEnterpriseByWxEnterpriseId
(
wxEnterpriseId
);
List
<
EnterpriseDetailDTO
>
detailDTOS
=
wxEnterpriseRelatedApiService
.
listEnterpriseByWxEnterpriseId
(
wxEnterpriseId
);
List
<
String
>
enterpriseIds
=
detailDTOS
.
stream
().
filter
(
dto
->
dto
.
getWxEnterpriseType
()
==
0
).
map
(
dto
->
dto
.
getEnterpriseId
()).
collect
(
Collectors
.
toList
());
List
<
String
>
enterpriseIds
=
detailDTOS
.
stream
().
filter
(
dto
->
dto
.
getWxEnterpriseType
()
==
0
).
map
(
dto
->
dto
.
getEnterpriseId
()).
collect
(
Collectors
.
toList
());
...
@@ -748,7 +722,7 @@ public class WxEnterpriseController extends WebBaseController {
...
@@ -748,7 +722,7 @@ public class WxEnterpriseController extends WebBaseController {
*/
*/
@RequestMapping
(
"save-welcome"
)
@RequestMapping
(
"save-welcome"
)
public
HaobanResponse
savewelcome
(
String
title
,
String
welcomeContent
,
String
welcomeImg
)
{
public
HaobanResponse
savewelcome
(
String
title
,
String
welcomeContent
,
String
welcomeImg
)
{
LoginDTO
loginUser
=
this
.
getLoginUser
();
WebLoginDTO
loginUser
=
AuthWebRequestUtil
.
getLoginUser
();
String
wxEnterpriseId
=
loginUser
.
getWxEnterpriseId
();
String
wxEnterpriseId
=
loginUser
.
getWxEnterpriseId
();
if
(
StringUtils
.
isAnyBlank
(
title
,
welcomeContent
))
{
if
(
StringUtils
.
isAnyBlank
(
title
,
welcomeContent
))
{
return
resultResponse
(
HaoBanErrCode
.
ERR_2
);
return
resultResponse
(
HaoBanErrCode
.
ERR_2
);
...
@@ -771,7 +745,7 @@ public class WxEnterpriseController extends WebBaseController {
...
@@ -771,7 +745,7 @@ public class WxEnterpriseController extends WebBaseController {
*/
*/
@RequestMapping
(
"get-welcome"
)
@RequestMapping
(
"get-welcome"
)
public
HaobanResponse
getWelcome
()
{
public
HaobanResponse
getWelcome
()
{
LoginDTO
loginUser
=
this
.
getLoginUser
();
WebLoginDTO
loginUser
=
AuthWebRequestUtil
.
getLoginUser
();
String
wxEnterpriseId
=
loginUser
.
getWxEnterpriseId
();
String
wxEnterpriseId
=
loginUser
.
getWxEnterpriseId
();
WelcomeDTO
welcome
=
wxEnterpriseApiService
.
getWelcome
(
wxEnterpriseId
);
WelcomeDTO
welcome
=
wxEnterpriseApiService
.
getWelcome
(
wxEnterpriseId
);
return
resultResponse
(
HaoBanErrCode
.
ERR_1
,
welcome
);
return
resultResponse
(
HaoBanErrCode
.
ERR_1
,
welcome
);
...
@@ -784,7 +758,7 @@ public class WxEnterpriseController extends WebBaseController {
...
@@ -784,7 +758,7 @@ public class WxEnterpriseController extends WebBaseController {
*/
*/
@RequestMapping
(
"del-welcome"
)
@RequestMapping
(
"del-welcome"
)
public
HaobanResponse
delWelcome
()
{
public
HaobanResponse
delWelcome
()
{
LoginDTO
loginUser
=
this
.
getLoginUser
();
WebLoginDTO
loginUser
=
AuthWebRequestUtil
.
getLoginUser
();
String
wxEnterpriseId
=
loginUser
.
getWxEnterpriseId
();
String
wxEnterpriseId
=
loginUser
.
getWxEnterpriseId
();
wxEnterpriseApiService
.
delWelcome
(
wxEnterpriseId
);
wxEnterpriseApiService
.
delWelcome
(
wxEnterpriseId
);
return
resultResponse
(
HaoBanErrCode
.
ERR_1
);
return
resultResponse
(
HaoBanErrCode
.
ERR_1
);
...
@@ -797,7 +771,7 @@ public class WxEnterpriseController extends WebBaseController {
...
@@ -797,7 +771,7 @@ public class WxEnterpriseController extends WebBaseController {
*/
*/
@RequestMapping
(
"set-welcome"
)
@RequestMapping
(
"set-welcome"
)
public
HaobanResponse
setWelcome
(
int
openFlag
)
{
public
HaobanResponse
setWelcome
(
int
openFlag
)
{
LoginDTO
loginUser
=
this
.
getLoginUser
();
WebLoginDTO
loginUser
=
AuthWebRequestUtil
.
getLoginUser
();
String
wxEnterpriseId
=
loginUser
.
getWxEnterpriseId
();
String
wxEnterpriseId
=
loginUser
.
getWxEnterpriseId
();
wxEnterpriseApiService
.
setWelcome
(
wxEnterpriseId
,
openFlag
);
wxEnterpriseApiService
.
setWelcome
(
wxEnterpriseId
,
openFlag
);
return
resultResponse
(
HaoBanErrCode
.
ERR_1
);
return
resultResponse
(
HaoBanErrCode
.
ERR_1
);
...
@@ -831,7 +805,7 @@ public class WxEnterpriseController extends WebBaseController {
...
@@ -831,7 +805,7 @@ public class WxEnterpriseController extends WebBaseController {
*/
*/
@RequestMapping
(
"agree_external_userid_flag"
)
@RequestMapping
(
"agree_external_userid_flag"
)
public
HaobanResponse
agreeExternalUseridFlag
(
Integer
openFlag
)
{
public
HaobanResponse
agreeExternalUseridFlag
(
Integer
openFlag
)
{
LoginDTO
loginUser
=
this
.
getLoginUser
();
WebLoginDTO
loginUser
=
AuthWebRequestUtil
.
getLoginUser
();
String
wxEnterpriseId
=
loginUser
.
getWxEnterpriseId
();
String
wxEnterpriseId
=
loginUser
.
getWxEnterpriseId
();
wxEnterpriseApiService
.
agreeExternalUseridFlag
(
wxEnterpriseId
,
openFlag
);
wxEnterpriseApiService
.
agreeExternalUseridFlag
(
wxEnterpriseId
,
openFlag
);
return
resultResponse
(
HaoBanErrCode
.
ERR_1
);
return
resultResponse
(
HaoBanErrCode
.
ERR_1
);
...
...
haoban-manage3-web/src/main/java/com/gic/haoban/manage/web/vo/StaffVO.java
View file @
fd55454e
package
com
.
gic
.
haoban
.
manage
.
web
.
vo
;
package
com
.
gic
.
haoban
.
manage
.
web
.
vo
;
import
java.io.Serializable
;
import
java.io.Serializable
;
import
java.util.Date
;
import
com.gic.haoban.manage.api.dto.StaffDTO
;
public
class
StaffVO
implements
Serializable
{
public
class
StaffVO
implements
Serializable
{
...
@@ -23,6 +22,254 @@ public class StaffVO implements Serializable{
...
@@ -23,6 +22,254 @@ public class StaffVO implements Serializable{
private
String
headImg
;
private
String
headImg
;
/**
* 员工id
*/
private
String
staffId
;
/**
* 企业微信id
*/
private
String
wxEnterpriseId
;
/**
* 微信用户id
*/
private
String
wxUserId
;
/**
* 昵称
*/
private
String
nickName
;
/**
* 性别
*/
private
Integer
sex
;
/**
* 职位
*/
private
String
postion
;
/**
* 激活状态
*/
private
Integer
activeFlag
;
/**
* 对外职务
*/
private
String
extendPostion
;
private
Date
updateTime
;
private
int
bindFlag
;
private
String
clerkCode
;
private
String
staffDepartmentRelatedId
;
private
int
clerkType
;
private
Integer
syncPostionFlag
;
private
Integer
superManagerFlag
;
private
Boolean
weixinPush
;
private
Integer
memberCount
;
private
String
clerkId
;
/**
* 关联状态 1 已关联 0 未关联
* 关联状态为 员工是否关联某门店导购
*/
private
Integer
relationFlag
;
private
String
wxOpenUseId
;
private
String
wxOpenId
;
private
String
qrCode
;
private
String
clerkName
;
public
String
getStaffId
()
{
return
staffId
;
}
public
String
getWxEnterpriseId
()
{
return
wxEnterpriseId
;
}
public
String
getWxUserId
()
{
return
wxUserId
;
}
public
String
getNickName
()
{
return
nickName
;
}
public
Integer
getSex
()
{
return
sex
;
}
public
String
getPostion
()
{
return
postion
;
}
public
Integer
getActiveFlag
()
{
return
activeFlag
;
}
public
String
getExtendPostion
()
{
return
extendPostion
;
}
public
Date
getUpdateTime
()
{
return
updateTime
;
}
public
int
getBindFlag
()
{
return
bindFlag
;
}
public
String
getClerkCode
()
{
return
clerkCode
;
}
public
String
getStaffDepartmentRelatedId
()
{
return
staffDepartmentRelatedId
;
}
public
int
getClerkType
()
{
return
clerkType
;
}
public
Integer
getSyncPostionFlag
()
{
return
syncPostionFlag
;
}
public
Integer
getSuperManagerFlag
()
{
return
superManagerFlag
;
}
public
Boolean
getWeixinPush
()
{
return
weixinPush
;
}
public
Integer
getMemberCount
()
{
return
memberCount
;
}
public
String
getClerkId
()
{
return
clerkId
;
}
public
Integer
getRelationFlag
()
{
return
relationFlag
;
}
public
String
getWxOpenUseId
()
{
return
wxOpenUseId
;
}
public
String
getWxOpenId
()
{
return
wxOpenId
;
}
public
String
getQrCode
()
{
return
qrCode
;
}
public
String
getClerkName
()
{
return
clerkName
;
}
public
void
setStaffId
(
String
staffId
)
{
this
.
staffId
=
staffId
;
}
public
void
setWxEnterpriseId
(
String
wxEnterpriseId
)
{
this
.
wxEnterpriseId
=
wxEnterpriseId
;
}
public
void
setWxUserId
(
String
wxUserId
)
{
this
.
wxUserId
=
wxUserId
;
}
public
void
setNickName
(
String
nickName
)
{
this
.
nickName
=
nickName
;
}
public
void
setSex
(
Integer
sex
)
{
this
.
sex
=
sex
;
}
public
void
setPostion
(
String
postion
)
{
this
.
postion
=
postion
;
}
public
void
setActiveFlag
(
Integer
activeFlag
)
{
this
.
activeFlag
=
activeFlag
;
}
public
void
setExtendPostion
(
String
extendPostion
)
{
this
.
extendPostion
=
extendPostion
;
}
public
void
setUpdateTime
(
Date
updateTime
)
{
this
.
updateTime
=
updateTime
;
}
public
void
setBindFlag
(
int
bindFlag
)
{
this
.
bindFlag
=
bindFlag
;
}
public
void
setClerkCode
(
String
clerkCode
)
{
this
.
clerkCode
=
clerkCode
;
}
public
void
setStaffDepartmentRelatedId
(
String
staffDepartmentRelatedId
)
{
this
.
staffDepartmentRelatedId
=
staffDepartmentRelatedId
;
}
public
void
setClerkType
(
int
clerkType
)
{
this
.
clerkType
=
clerkType
;
}
public
void
setSyncPostionFlag
(
Integer
syncPostionFlag
)
{
this
.
syncPostionFlag
=
syncPostionFlag
;
}
public
void
setSuperManagerFlag
(
Integer
superManagerFlag
)
{
this
.
superManagerFlag
=
superManagerFlag
;
}
public
void
setWeixinPush
(
Boolean
weixinPush
)
{
this
.
weixinPush
=
weixinPush
;
}
public
void
setMemberCount
(
Integer
memberCount
)
{
this
.
memberCount
=
memberCount
;
}
public
void
setClerkId
(
String
clerkId
)
{
this
.
clerkId
=
clerkId
;
}
public
void
setRelationFlag
(
Integer
relationFlag
)
{
this
.
relationFlag
=
relationFlag
;
}
public
void
setWxOpenUseId
(
String
wxOpenUseId
)
{
this
.
wxOpenUseId
=
wxOpenUseId
;
}
public
void
setWxOpenId
(
String
wxOpenId
)
{
this
.
wxOpenId
=
wxOpenId
;
}
public
void
setQrCode
(
String
qrCode
)
{
this
.
qrCode
=
qrCode
;
}
public
void
setClerkName
(
String
clerkName
)
{
this
.
clerkName
=
clerkName
;
}
public
String
getHeadImg
()
{
public
String
getHeadImg
()
{
return
headImg
;
return
headImg
;
}
}
...
...
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