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
ab7e5560
Commit
ab7e5560
authored
Jan 14, 2022
by
墨竹
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat:登录兼容
parent
e13759a1
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
60 additions
and
64 deletions
+60
-64
AuthRequestUtil.java
.../java/com/gic/haoban/manage/web/auth/AuthRequestUtil.java
+3
-4
AdminController.java
...com/gic/haoban/manage/web/controller/AdminController.java
+1
-1
ApplicationController.java
...c/haoban/manage/web/controller/ApplicationController.java
+4
-4
AuditController.java
...com/gic/haoban/manage/web/controller/AuditController.java
+3
-3
DepartmentContoller.java
...gic/haoban/manage/web/controller/DepartmentContoller.java
+8
-8
LoginController.java
...com/gic/haoban/manage/web/controller/LoginController.java
+1
-1
MaterialController.java
.../gic/haoban/manage/web/controller/MaterialController.java
+5
-6
StaffController.java
...com/gic/haoban/manage/web/controller/StaffController.java
+7
-7
SyncDealContoller.java
...m/gic/haoban/manage/web/controller/SyncDealContoller.java
+9
-9
WebBaseController.java
...m/gic/haoban/manage/web/controller/WebBaseController.java
+1
-3
WxEnterpriseController.java
.../haoban/manage/web/controller/WxEnterpriseController.java
+18
-18
No files found.
haoban-manage3-web/src/main/java/com/gic/haoban/manage/web/auth/AuthRequestUtil.java
View file @
ab7e5560
...
@@ -93,7 +93,6 @@ public class AuthRequestUtil {
...
@@ -93,7 +93,6 @@ public class AuthRequestUtil {
public
static
void
setAppLoginUser
(
String
token
,
Object
obj
)
{
public
static
void
setAppLoginUser
(
String
token
,
Object
obj
)
{
RedisUtil
.
setCache
(
token
,
obj
,
30L
,
TimeUnit
.
DAYS
);
RedisUtil
.
setCache
(
token
,
obj
,
30L
,
TimeUnit
.
DAYS
);
getResponse
().
setHeader
(
"token"
,
token
);
getResponse
().
setHeader
(
"token"
,
token
);
//setLoginUserLastToken(token, obj);
}
}
public
static
void
setAppFakeLoginUser
(
String
token
,
Object
obj
)
{
public
static
void
setAppFakeLoginUser
(
String
token
,
Object
obj
)
{
...
@@ -110,7 +109,6 @@ public class AuthRequestUtil {
...
@@ -110,7 +109,6 @@ public class AuthRequestUtil {
public
static
void
setAppLoginUser
(
Object
obj
,
String
token
)
{
public
static
void
setAppLoginUser
(
Object
obj
,
String
token
)
{
RedisUtil
.
setCache
(
token
,
obj
,
30L
,
TimeUnit
.
DAYS
);
RedisUtil
.
setCache
(
token
,
obj
,
30L
,
TimeUnit
.
DAYS
);
getResponse
().
setHeader
(
"token"
,
token
);
getResponse
().
setHeader
(
"token"
,
token
);
//setLoginUserLastToken(token, obj);
}
}
public
static
void
setAppFakeLoginUser
(
Object
obj
)
{
public
static
void
setAppFakeLoginUser
(
Object
obj
)
{
...
@@ -140,7 +138,7 @@ public class AuthRequestUtil {
...
@@ -140,7 +138,7 @@ public class AuthRequestUtil {
return
attrs
.
getResponse
();
return
attrs
.
getResponse
();
}
}
public
static
Object
getLoginUser
()
{
public
static
LoginDTO
getLoginUser
()
{
Cookie
[]
cookies
=
AuthRequestUtil
.
getRequest
().
getCookies
();
Cookie
[]
cookies
=
AuthRequestUtil
.
getRequest
().
getCookies
();
String
token
=
""
;
String
token
=
""
;
if
(
cookies
!=
null
)
{
if
(
cookies
!=
null
)
{
...
@@ -150,6 +148,7 @@ public class AuthRequestUtil {
...
@@ -150,6 +148,7 @@ public class AuthRequestUtil {
}
}
}
}
}
}
return
getAppLoginUser
(
token
);
Object
appLoginUser
=
getAppLoginUser
(
token
);
return
EntityUtil
.
changeEntityByJSON
(
LoginDTO
.
class
,
appLoginUser
);
}
}
}
}
haoban-manage3-web/src/main/java/com/gic/haoban/manage/web/controller/AdminController.java
View file @
ab7e5560
...
@@ -40,7 +40,7 @@ public class AdminController extends WebBaseController {
...
@@ -40,7 +40,7 @@ public class AdminController extends WebBaseController {
@RequestMapping
(
"admin-list"
)
@RequestMapping
(
"admin-list"
)
public
HaobanResponse
adminList
()
{
public
HaobanResponse
adminList
()
{
LoginDTO
login
=
(
LoginDTO
)
AuthRequestUtil
.
getLoginUser
();
LoginDTO
login
=
AuthRequestUtil
.
getLoginUser
();
String
wxEnterpriseId
=
login
.
getWxEnterpriseId
();
String
wxEnterpriseId
=
login
.
getWxEnterpriseId
();
WxApplicationDTO
application
=
wxApplicationApiService
.
selectByWxEnterpriseIdAndApplicationType
(
wxEnterpriseId
,
2
);
WxApplicationDTO
application
=
wxApplicationApiService
.
selectByWxEnterpriseIdAndApplicationType
(
wxEnterpriseId
,
2
);
WxEnterpriseDTO
enterprise
=
wxEnterpriseApiService
.
getOne
(
wxEnterpriseId
);
WxEnterpriseDTO
enterprise
=
wxEnterpriseApiService
.
getOne
(
wxEnterpriseId
);
...
...
haoban-manage3-web/src/main/java/com/gic/haoban/manage/web/controller/ApplicationController.java
View file @
ab7e5560
...
@@ -52,7 +52,7 @@ public class ApplicationController extends WebBaseController {
...
@@ -52,7 +52,7 @@ public class ApplicationController extends WebBaseController {
@RequestMapping
(
"application-list"
)
@RequestMapping
(
"application-list"
)
public
HaobanResponse
applicationList
()
{
public
HaobanResponse
applicationList
()
{
LoginDTO
login
=
(
LoginDTO
)
AuthRequestUtil
.
getLoginUser
();
LoginDTO
login
=
AuthRequestUtil
.
getLoginUser
();
String
wxEnterpriseId
=
login
.
getWxEnterpriseId
();
String
wxEnterpriseId
=
login
.
getWxEnterpriseId
();
List
<
ApplicationDTO
>
list
=
applicationApiService
.
listApplicationByWxEnterpriseId
(
wxEnterpriseId
);
List
<
ApplicationDTO
>
list
=
applicationApiService
.
listApplicationByWxEnterpriseId
(
wxEnterpriseId
);
return
resultResponse
(
HaoBanErrCode
.
ERR_1
,
list
);
return
resultResponse
(
HaoBanErrCode
.
ERR_1
,
list
);
...
@@ -120,7 +120,7 @@ public class ApplicationController extends WebBaseController {
...
@@ -120,7 +120,7 @@ public class ApplicationController extends WebBaseController {
@RequestMapping
(
"has-bind-contract"
)
@RequestMapping
(
"has-bind-contract"
)
public
HaobanResponse
hasBindContract
()
{
public
HaobanResponse
hasBindContract
()
{
LoginDTO
login
=
(
LoginDTO
)
AuthRequestUtil
.
getLoginUser
();
LoginDTO
login
=
AuthRequestUtil
.
getLoginUser
();
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
)
{
...
@@ -153,7 +153,7 @@ public class ApplicationController extends WebBaseController {
...
@@ -153,7 +153,7 @@ public class ApplicationController extends WebBaseController {
*/
*/
@RequestMapping
(
"init-wx-department"
)
@RequestMapping
(
"init-wx-department"
)
public
HaobanResponse
initWxDepartment
()
{
public
HaobanResponse
initWxDepartment
()
{
LoginDTO
login
=
(
LoginDTO
)
AuthRequestUtil
.
getLoginUser
();
LoginDTO
login
=
AuthRequestUtil
.
getLoginUser
();
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
)
{
...
@@ -256,7 +256,7 @@ public class ApplicationController extends WebBaseController {
...
@@ -256,7 +256,7 @@ public class ApplicationController extends WebBaseController {
*/
*/
@RequestMapping
(
"sync-qywx"
)
@RequestMapping
(
"sync-qywx"
)
public
Object
syncQywx
()
{
public
Object
syncQywx
()
{
LoginDTO
login
=
(
LoginDTO
)
AuthRequestUtil
.
getLoginUser
();
LoginDTO
login
=
AuthRequestUtil
.
getLoginUser
();
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
)
{
...
...
haoban-manage3-web/src/main/java/com/gic/haoban/manage/web/controller/AuditController.java
View file @
ab7e5560
...
@@ -162,7 +162,7 @@ public class AuditController extends WebBaseController{
...
@@ -162,7 +162,7 @@ public class AuditController extends WebBaseController{
if
(
StringUtils
.
isAnyBlank
(
auditIds
,
auditName
)){
if
(
StringUtils
.
isAnyBlank
(
auditIds
,
auditName
)){
return
resultResponse
(
HaoBanErrCode
.
ERR_2
);
return
resultResponse
(
HaoBanErrCode
.
ERR_2
);
}
}
LoginDTO
login
=
(
LoginDTO
)
AuthRequestUtil
.
getLoginUser
();
LoginDTO
login
=
AuthRequestUtil
.
getLoginUser
();
String
staffId
=
login
.
getStaffDTO
().
getStaffId
();
String
staffId
=
login
.
getStaffDTO
().
getStaffId
();
String
staffName
=
login
.
getStaffDTO
().
getStaffName
();
String
staffName
=
login
.
getStaffDTO
().
getStaffName
();
String
[]
s
=
auditIds
.
split
(
","
);
String
[]
s
=
auditIds
.
split
(
","
);
...
@@ -192,7 +192,7 @@ public class AuditController extends WebBaseController{
...
@@ -192,7 +192,7 @@ public class AuditController extends WebBaseController{
if
(
StringUtils
.
isAnyBlank
(
auditId
,
auditReason
,
auditName
)){
if
(
StringUtils
.
isAnyBlank
(
auditId
,
auditReason
,
auditName
)){
return
resultResponse
(
HaoBanErrCode
.
ERR_2
);
return
resultResponse
(
HaoBanErrCode
.
ERR_2
);
}
}
LoginDTO
login
=
(
LoginDTO
)
AuthRequestUtil
.
getLoginUser
();
LoginDTO
login
=
AuthRequestUtil
.
getLoginUser
();
String
staffId
=
login
.
getStaffDTO
().
getStaffId
();
String
staffId
=
login
.
getStaffDTO
().
getStaffId
();
String
staffName
=
login
.
getStaffDTO
().
getStaffName
();
String
staffName
=
login
.
getStaffDTO
().
getStaffName
();
auditApiService
.
refuse
(
auditId
,
auditReason
,
staffId
,
staffName
);
auditApiService
.
refuse
(
auditId
,
auditReason
,
staffId
,
staffName
);
...
@@ -202,7 +202,7 @@ public class AuditController extends WebBaseController{
...
@@ -202,7 +202,7 @@ public class AuditController extends WebBaseController{
@HttpLimit
@HttpLimit
@RequestMapping
(
"audit"
)
@RequestMapping
(
"audit"
)
public
HaobanResponse
audit
(
String
auditId
,
String
auditName
)
{
public
HaobanResponse
audit
(
String
auditId
,
String
auditName
)
{
LoginDTO
login
=
(
LoginDTO
)
AuthRequestUtil
.
getLoginUser
();
LoginDTO
login
=
AuthRequestUtil
.
getLoginUser
();
StaffDTO
loginStaffDTO
=
login
.
getStaffDTO
();
StaffDTO
loginStaffDTO
=
login
.
getStaffDTO
();
if
(
null
==
loginStaffDTO
)
{
if
(
null
==
loginStaffDTO
)
{
return
resultResponse
(
HaoBanErrCode
.
ERR_4
);
return
resultResponse
(
HaoBanErrCode
.
ERR_4
);
...
...
haoban-manage3-web/src/main/java/com/gic/haoban/manage/web/controller/DepartmentContoller.java
View file @
ab7e5560
...
@@ -47,7 +47,7 @@ import java.util.*;
...
@@ -47,7 +47,7 @@ import java.util.*;
@RestController
@RestController
public
class
DepartmentContoller
extends
WebBaseController
{
public
class
DepartmentContoller
extends
WebBaseController
{
private
static
Logger
logger
=
LoggerFactory
.
getLogger
(
DepartmentContoller
.
class
);
private
static
final
Logger
logger
=
LoggerFactory
.
getLogger
(
DepartmentContoller
.
class
);
@Autowired
@Autowired
private
DepartmentApiService
departmentApiService
;
private
DepartmentApiService
departmentApiService
;
...
@@ -67,7 +67,7 @@ public class DepartmentContoller extends WebBaseController{
...
@@ -67,7 +67,7 @@ public class DepartmentContoller extends WebBaseController{
private
StaffDepartmentRelatedApiService
staffDepartmentRelatedApiService
;
private
StaffDepartmentRelatedApiService
staffDepartmentRelatedApiService
;
@RequestMapping
(
"department-list"
)
@RequestMapping
(
"department-list"
)
public
HaobanResponse
departmentList
(
String
parentId
,
BasePageInfo
pageInfo
,
String
keyWord
)
{
public
HaobanResponse
departmentList
(
String
parentId
,
BasePageInfo
pageInfo
,
String
keyWord
)
{
LoginDTO
login
=
(
LoginDTO
)
AuthRequestUtil
.
getLoginUser
();
LoginDTO
login
=
AuthRequestUtil
.
getLoginUser
();
String
wxEnterpriseId
=
login
.
getWxEnterpriseId
();
String
wxEnterpriseId
=
login
.
getWxEnterpriseId
();
logger
.
info
(
"【部门列表】wxEnterpriseId={}"
,
wxEnterpriseId
);
logger
.
info
(
"【部门列表】wxEnterpriseId={}"
,
wxEnterpriseId
);
...
@@ -108,7 +108,7 @@ public class DepartmentContoller extends WebBaseController{
...
@@ -108,7 +108,7 @@ public class DepartmentContoller extends WebBaseController{
@RequestMapping
(
"department-list-level"
)
@RequestMapping
(
"department-list-level"
)
public
HaobanResponse
departmentLevelList
(
String
parentId
)
{
public
HaobanResponse
departmentLevelList
(
String
parentId
)
{
LoginDTO
login
=
(
LoginDTO
)
AuthRequestUtil
.
getLoginUser
();
LoginDTO
login
=
AuthRequestUtil
.
getLoginUser
();
String
wxEnterpriseId
=
login
.
getWxEnterpriseId
();
String
wxEnterpriseId
=
login
.
getWxEnterpriseId
();
logger
.
info
(
"【部门层级列表】wxEnterpriseId={}"
,
wxEnterpriseId
);
logger
.
info
(
"【部门层级列表】wxEnterpriseId={}"
,
wxEnterpriseId
);
List
<
DepartmentDTO
>
list
=
new
ArrayList
<
DepartmentDTO
>();
List
<
DepartmentDTO
>
list
=
new
ArrayList
<
DepartmentDTO
>();
...
@@ -217,7 +217,7 @@ public class DepartmentContoller extends WebBaseController{
...
@@ -217,7 +217,7 @@ public class DepartmentContoller extends WebBaseController{
@RequestMapping
(
"department-recycle-count"
)
@RequestMapping
(
"department-recycle-count"
)
public
HaobanResponse
departmentRecycleCount
()
{
public
HaobanResponse
departmentRecycleCount
()
{
LoginDTO
login
=
(
LoginDTO
)
AuthRequestUtil
.
getLoginUser
();
LoginDTO
login
=
AuthRequestUtil
.
getLoginUser
();
String
wxEnterpriseId
=
login
.
getWxEnterpriseId
();
String
wxEnterpriseId
=
login
.
getWxEnterpriseId
();
Integer
count
=
departmentApiService
.
departmentRecycleCount
(
wxEnterpriseId
);
Integer
count
=
departmentApiService
.
departmentRecycleCount
(
wxEnterpriseId
);
Map
<
String
,
Object
>
map
=
new
HashMap
<
String
,
Object
>();
Map
<
String
,
Object
>
map
=
new
HashMap
<
String
,
Object
>();
...
@@ -253,7 +253,7 @@ public class DepartmentContoller extends WebBaseController{
...
@@ -253,7 +253,7 @@ public class DepartmentContoller extends WebBaseController{
@RequestMapping
(
"department-batch-sync"
)
@RequestMapping
(
"department-batch-sync"
)
@ResponseBody
@ResponseBody
public
HaobanResponse
departmentBatchSync
(
@RequestBody
SyncDepartmentQO
args
)
{
public
HaobanResponse
departmentBatchSync
(
@RequestBody
SyncDepartmentQO
args
)
{
LoginDTO
login
=
(
LoginDTO
)
AuthRequestUtil
.
getLoginUser
();
LoginDTO
login
=
AuthRequestUtil
.
getLoginUser
();
String
wxEnterpriseId
=
login
.
getWxEnterpriseId
();
String
wxEnterpriseId
=
login
.
getWxEnterpriseId
();
String
key
=
"haoban-sync-department-"
+
wxEnterpriseId
;
String
key
=
"haoban-sync-department-"
+
wxEnterpriseId
;
if
(
RedisUtil
.
getCache
(
key
)
!=
null
){
if
(
RedisUtil
.
getCache
(
key
)
!=
null
){
...
@@ -580,7 +580,7 @@ public class DepartmentContoller extends WebBaseController{
...
@@ -580,7 +580,7 @@ public class DepartmentContoller extends WebBaseController{
@RequestMapping
(
"department-recycle-list"
)
@RequestMapping
(
"department-recycle-list"
)
public
HaobanResponse
departmentRecycleList
(
String
keyWord
,
Integer
storeFlag
,
BasePageInfo
pageInfo
)
{
public
HaobanResponse
departmentRecycleList
(
String
keyWord
,
Integer
storeFlag
,
BasePageInfo
pageInfo
)
{
LoginDTO
login
=
(
LoginDTO
)
AuthRequestUtil
.
getLoginUser
();
LoginDTO
login
=
AuthRequestUtil
.
getLoginUser
();
String
wxEnterpriseId
=
login
.
getWxEnterpriseId
();
String
wxEnterpriseId
=
login
.
getWxEnterpriseId
();
Integer
recycleFlag
=
1
;
Integer
recycleFlag
=
1
;
Page
<
DepartmentDTO
>
page
=
departmentApiService
.
pageDepartmentByParams
(
pageInfo
,
wxEnterpriseId
,
keyWord
,
storeFlag
,
recycleFlag
);
Page
<
DepartmentDTO
>
page
=
departmentApiService
.
pageDepartmentByParams
(
pageInfo
,
wxEnterpriseId
,
keyWord
,
storeFlag
,
recycleFlag
);
...
@@ -834,7 +834,7 @@ public class DepartmentContoller extends WebBaseController{
...
@@ -834,7 +834,7 @@ public class DepartmentContoller extends WebBaseController{
@RequestMapping
(
"department-search"
)
@RequestMapping
(
"department-search"
)
public
HaobanResponse
departmentSearch
(
String
search
)
{
public
HaobanResponse
departmentSearch
(
String
search
)
{
LoginDTO
login
=
(
LoginDTO
)
AuthRequestUtil
.
getLoginUser
();
LoginDTO
login
=
AuthRequestUtil
.
getLoginUser
();
String
wxEnterpriseId
=
login
.
getWxEnterpriseId
();
String
wxEnterpriseId
=
login
.
getWxEnterpriseId
();
if
(
StringUtils
.
isBlank
(
wxEnterpriseId
))
{
if
(
StringUtils
.
isBlank
(
wxEnterpriseId
))
{
return
resultResponse
(
HaoBanErrCode
.
ERR_6
);
return
resultResponse
(
HaoBanErrCode
.
ERR_6
);
...
@@ -850,7 +850,7 @@ public class DepartmentContoller extends WebBaseController{
...
@@ -850,7 +850,7 @@ public class DepartmentContoller extends WebBaseController{
*/
*/
@RequestMapping
(
"department-list-cache"
)
@RequestMapping
(
"department-list-cache"
)
public
HaobanResponse
departmentCachelist
()
{
public
HaobanResponse
departmentCachelist
()
{
LoginDTO
login
=
(
LoginDTO
)
AuthRequestUtil
.
getLoginUser
();
LoginDTO
login
=
AuthRequestUtil
.
getLoginUser
();
String
wxEnterpriseId
=
login
.
getWxEnterpriseId
();
String
wxEnterpriseId
=
login
.
getWxEnterpriseId
();
if
(
StringUtils
.
isBlank
(
wxEnterpriseId
))
{
if
(
StringUtils
.
isBlank
(
wxEnterpriseId
))
{
return
resultResponse
(
HaoBanErrCode
.
ERR_6
);
return
resultResponse
(
HaoBanErrCode
.
ERR_6
);
...
...
haoban-manage3-web/src/main/java/com/gic/haoban/manage/web/controller/LoginController.java
View file @
ab7e5560
...
@@ -144,7 +144,7 @@ public class LoginController extends WebBaseController {
...
@@ -144,7 +144,7 @@ public class LoginController extends WebBaseController {
@RequestMapping
(
"get-login-info"
)
@RequestMapping
(
"get-login-info"
)
@Deprecated
@Deprecated
public
HaobanResponse
getLoginInfo
()
{
public
HaobanResponse
getLoginInfo
()
{
LoginDTO
loginVO
=
(
LoginDTO
)
AuthRequestUtil
.
getLoginUser
();
LoginDTO
loginVO
=
AuthRequestUtil
.
getLoginUser
();
return
resultResponse
(
HaoBanErrCode
.
ERR_1
,
loginVO
);
return
resultResponse
(
HaoBanErrCode
.
ERR_1
,
loginVO
);
}
}
...
...
haoban-manage3-web/src/main/java/com/gic/haoban/manage/web/controller/MaterialController.java
View file @
ab7e5560
...
@@ -32,7 +32,7 @@ public class MaterialController extends WebBaseController {
...
@@ -32,7 +32,7 @@ public class MaterialController extends WebBaseController {
*/
*/
@RequestMapping
(
"/mateial-add-category"
)
@RequestMapping
(
"/mateial-add-category"
)
public
HaobanResponse
materialAddCategory
(
MaterialCategoryDTO
materialCategoryDTO
)
{
public
HaobanResponse
materialAddCategory
(
MaterialCategoryDTO
materialCategoryDTO
)
{
LoginDTO
login
=
(
LoginDTO
)
AuthRequestUtil
.
getLoginUser
();
LoginDTO
login
=
AuthRequestUtil
.
getLoginUser
();
String
wxEnterpriseId
=
login
.
getWxEnterpriseId
();
String
wxEnterpriseId
=
login
.
getWxEnterpriseId
();
materialCategoryDTO
.
setWxEnterpriseId
(
wxEnterpriseId
);
materialCategoryDTO
.
setWxEnterpriseId
(
wxEnterpriseId
);
String
categoryName
=
materialCategoryDTO
.
getCategoryName
();
String
categoryName
=
materialCategoryDTO
.
getCategoryName
();
...
@@ -117,7 +117,7 @@ public class MaterialController extends WebBaseController {
...
@@ -117,7 +117,7 @@ public class MaterialController extends WebBaseController {
*/
*/
@RequestMapping
(
"/material-add"
)
@RequestMapping
(
"/material-add"
)
public
HaobanResponse
materialAdd
(
MaterialDTO
materialDTO
)
{
public
HaobanResponse
materialAdd
(
MaterialDTO
materialDTO
)
{
LoginDTO
login
=
(
LoginDTO
)
AuthRequestUtil
.
getLoginUser
();
LoginDTO
login
=
AuthRequestUtil
.
getLoginUser
();
String
wxEnterpriseId
=
login
.
getWxEnterpriseId
();
String
wxEnterpriseId
=
login
.
getWxEnterpriseId
();
materialDTO
.
setWxEnterpriseId
(
wxEnterpriseId
);
materialDTO
.
setWxEnterpriseId
(
wxEnterpriseId
);
...
@@ -149,7 +149,7 @@ public class MaterialController extends WebBaseController {
...
@@ -149,7 +149,7 @@ public class MaterialController extends WebBaseController {
return
resultResponse
(
HaoBanErrCode
.
ERR_2
);
return
resultResponse
(
HaoBanErrCode
.
ERR_2
);
}
}
BatchAddMaterialDTO
.
Material
material
=
dto
.
getMaterial
();
BatchAddMaterialDTO
.
Material
material
=
dto
.
getMaterial
();
LoginDTO
login
=
(
LoginDTO
)
AuthRequestUtil
.
getLoginUser
();
LoginDTO
login
=
AuthRequestUtil
.
getLoginUser
();
material
.
setWxEnterpriseId
(
login
.
getWxEnterpriseId
());
material
.
setWxEnterpriseId
(
login
.
getWxEnterpriseId
());
StaffDTO
staff
=
login
.
getStaffDTO
();
StaffDTO
staff
=
login
.
getStaffDTO
();
material
.
setStaffId
(
staff
.
getStaffId
());
material
.
setStaffId
(
staff
.
getStaffId
());
...
@@ -180,7 +180,7 @@ public class MaterialController extends WebBaseController {
...
@@ -180,7 +180,7 @@ public class MaterialController extends WebBaseController {
*/
*/
@RequestMapping
(
"/material-edit"
)
@RequestMapping
(
"/material-edit"
)
public
HaobanResponse
materialEdit
(
MaterialDTO
materialDTO
)
{
public
HaobanResponse
materialEdit
(
MaterialDTO
materialDTO
)
{
LoginDTO
login
=
(
LoginDTO
)
AuthRequestUtil
.
getLoginUser
();
LoginDTO
login
=
AuthRequestUtil
.
getLoginUser
();
StaffDTO
staff
=
login
.
getStaffDTO
();
StaffDTO
staff
=
login
.
getStaffDTO
();
materialDTO
.
setStaffId
(
staff
.
getStaffId
());
materialDTO
.
setStaffId
(
staff
.
getStaffId
());
...
@@ -236,7 +236,6 @@ public class MaterialController extends WebBaseController {
...
@@ -236,7 +236,6 @@ public class MaterialController extends WebBaseController {
continue
;
continue
;
}
}
dto
.
setCategoryId
(
categoryId
);
dto
.
setCategoryId
(
categoryId
);
;
materialApiService
.
editMaterial
(
dto
);
materialApiService
.
editMaterial
(
dto
);
}
}
return
resultResponse
(
HaoBanErrCode
.
ERR_1
);
return
resultResponse
(
HaoBanErrCode
.
ERR_1
);
...
@@ -249,7 +248,7 @@ public class MaterialController extends WebBaseController {
...
@@ -249,7 +248,7 @@ public class MaterialController extends WebBaseController {
*/
*/
@RequestMapping
(
"/material-share"
)
@RequestMapping
(
"/material-share"
)
public
HaobanResponse
materialShare
(
String
materialIds
,
String
toWxEnterpriseIds
)
{
public
HaobanResponse
materialShare
(
String
materialIds
,
String
toWxEnterpriseIds
)
{
LoginDTO
login
=
(
LoginDTO
)
AuthRequestUtil
.
getLoginUser
();
LoginDTO
login
=
AuthRequestUtil
.
getLoginUser
();
String
[]
wxEids
=
toWxEnterpriseIds
.
split
(
","
);
String
[]
wxEids
=
toWxEnterpriseIds
.
split
(
","
);
String
[]
maIds
=
materialIds
.
split
(
","
);
String
[]
maIds
=
materialIds
.
split
(
","
);
for
(
String
maId
:
maIds
)
{
for
(
String
maId
:
maIds
)
{
...
...
haoban-manage3-web/src/main/java/com/gic/haoban/manage/web/controller/StaffController.java
View file @
ab7e5560
...
@@ -82,7 +82,7 @@ public class StaffController extends WebBaseController {
...
@@ -82,7 +82,7 @@ public class StaffController extends WebBaseController {
@RequestMapping
(
"staff-add"
)
@RequestMapping
(
"staff-add"
)
public
HaobanResponse
staffAdd
(
StaffDTO
staffDTO
,
String
departmentIds
)
{
public
HaobanResponse
staffAdd
(
StaffDTO
staffDTO
,
String
departmentIds
)
{
LoginDTO
login
=
(
LoginDTO
)
AuthRequestUtil
.
getLoginUser
();
LoginDTO
login
=
AuthRequestUtil
.
getLoginUser
();
String
wxEnterpriseId
=
login
.
getWxEnterpriseId
();
String
wxEnterpriseId
=
login
.
getWxEnterpriseId
();
String
staffName
=
staffDTO
.
getStaffName
();
String
staffName
=
staffDTO
.
getStaffName
();
String
phoneNumber
=
staffDTO
.
getPhoneNumber
();
String
phoneNumber
=
staffDTO
.
getPhoneNumber
();
...
@@ -132,7 +132,7 @@ public class StaffController extends WebBaseController {
...
@@ -132,7 +132,7 @@ public class StaffController extends WebBaseController {
Integer
relationFlag
,
Integer
relationFlag
,
String
keyWord
,
String
keyWord
,
BasePageInfo
pageInfo
)
{
BasePageInfo
pageInfo
)
{
LoginDTO
login
=
(
LoginDTO
)
AuthRequestUtil
.
getLoginUser
();
LoginDTO
login
=
AuthRequestUtil
.
getLoginUser
();
// 部门
// 部门
List
<
DepartmentDTO
>
sonDepartmentList
=
departmentApiService
.
listSonByDepartmentIds
(
Lists
.
newArrayList
(
departmentId
),
login
.
getWxEnterpriseId
());
List
<
DepartmentDTO
>
sonDepartmentList
=
departmentApiService
.
listSonByDepartmentIds
(
Lists
.
newArrayList
(
departmentId
),
login
.
getWxEnterpriseId
());
List
<
String
>
departmentIds
=
sonDepartmentList
.
stream
().
map
(
DepartmentDTO:
:
getDepartmentId
).
collect
(
Collectors
.
toList
());
List
<
String
>
departmentIds
=
sonDepartmentList
.
stream
().
map
(
DepartmentDTO:
:
getDepartmentId
).
collect
(
Collectors
.
toList
());
...
@@ -321,7 +321,7 @@ public class StaffController extends WebBaseController {
...
@@ -321,7 +321,7 @@ 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
)
{
LoginDTO
login
=
(
LoginDTO
)
AuthRequestUtil
.
getLoginUser
();
LoginDTO
login
=
AuthRequestUtil
.
getLoginUser
();
StaffDTO
staffDTO
=
login
.
getStaffDTO
();
StaffDTO
staffDTO
=
login
.
getStaffDTO
();
if
(
staffDTO
==
null
)
{
if
(
staffDTO
==
null
)
{
logger
.
info
(
"登录异常"
);
logger
.
info
(
"登录异常"
);
...
@@ -359,7 +359,7 @@ public class StaffController extends WebBaseController {
...
@@ -359,7 +359,7 @@ public class StaffController extends WebBaseController {
*/
*/
@RequestMapping
(
"search-clerk-relation"
)
@RequestMapping
(
"search-clerk-relation"
)
public
HaobanResponse
staffClerkSearch
(
String
search
)
{
public
HaobanResponse
staffClerkSearch
(
String
search
)
{
LoginDTO
login
=
(
LoginDTO
)
AuthRequestUtil
.
getLoginUser
();
LoginDTO
login
=
AuthRequestUtil
.
getLoginUser
();
String
wxEnterpriseId
=
login
.
getWxEnterpriseId
();
String
wxEnterpriseId
=
login
.
getWxEnterpriseId
();
if
(
null
==
wxEnterpriseId
)
{
if
(
null
==
wxEnterpriseId
)
{
return
resultResponse
(
HaoBanErrCode
.
ERR_4
);
return
resultResponse
(
HaoBanErrCode
.
ERR_4
);
...
@@ -415,7 +415,7 @@ public class StaffController extends WebBaseController {
...
@@ -415,7 +415,7 @@ 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
)
{
LoginDTO
login
=
(
LoginDTO
)
AuthRequestUtil
.
getLoginUser
();
LoginDTO
login
=
AuthRequestUtil
.
getLoginUser
();
StaffDTO
loginStaffDTO
=
login
.
getStaffDTO
();
StaffDTO
loginStaffDTO
=
login
.
getStaffDTO
();
if
(
null
==
loginStaffDTO
)
{
if
(
null
==
loginStaffDTO
)
{
return
resultResponse
(
HaoBanErrCode
.
ERR_4
);
return
resultResponse
(
HaoBanErrCode
.
ERR_4
);
...
@@ -459,7 +459,7 @@ public class StaffController extends WebBaseController {
...
@@ -459,7 +459,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
)
{
LoginDTO
login
=
(
LoginDTO
)
AuthRequestUtil
.
getLoginUser
();
LoginDTO
login
=
AuthRequestUtil
.
getLoginUser
();
StaffDTO
loginStaffDTO
=
login
.
getStaffDTO
();
StaffDTO
loginStaffDTO
=
login
.
getStaffDTO
();
if
(
null
==
loginStaffDTO
)
{
if
(
null
==
loginStaffDTO
)
{
return
resultResponse
(
HaoBanErrCode
.
ERR_4
);
return
resultResponse
(
HaoBanErrCode
.
ERR_4
);
...
@@ -478,7 +478,7 @@ public class StaffController extends WebBaseController {
...
@@ -478,7 +478,7 @@ public class StaffController extends WebBaseController {
public
HaobanResponse
staffExport
(
HttpServletRequest
request
,
HttpServletResponse
response
,
String
departmentId
,
Integer
activeFlag
,
Integer
relationFlag
,
String
keyWord
,
BasePageInfo
pageInfo
)
{
public
HaobanResponse
staffExport
(
HttpServletRequest
request
,
HttpServletResponse
response
,
String
departmentId
,
Integer
activeFlag
,
Integer
relationFlag
,
String
keyWord
,
BasePageInfo
pageInfo
)
{
List
<
String
>
departmentIdSet
=
new
ArrayList
<>();
List
<
String
>
departmentIdSet
=
new
ArrayList
<>();
departmentIdSet
.
add
(
departmentId
);
departmentIdSet
.
add
(
departmentId
);
LoginDTO
login
=
(
LoginDTO
)
AuthRequestUtil
.
getLoginUser
();
LoginDTO
login
=
AuthRequestUtil
.
getLoginUser
();
String
wxEnterpriseId
=
login
.
getWxEnterpriseId
();
String
wxEnterpriseId
=
login
.
getWxEnterpriseId
();
List
<
DepartmentDTO
>
relationList
=
departmentApiService
.
listSonByDepartmentIds
(
departmentIdSet
,
wxEnterpriseId
);
List
<
DepartmentDTO
>
relationList
=
departmentApiService
.
listSonByDepartmentIds
(
departmentIdSet
,
wxEnterpriseId
);
Map
<
String
,
DepartmentDTO
>
departmentMap
=
relationList
.
stream
().
collect
(
Collectors
.
toMap
(
DepartmentDTO:
:
getDepartmentId
,
s
->
s
));
Map
<
String
,
DepartmentDTO
>
departmentMap
=
relationList
.
stream
().
collect
(
Collectors
.
toMap
(
DepartmentDTO:
:
getDepartmentId
,
s
->
s
));
...
...
haoban-manage3-web/src/main/java/com/gic/haoban/manage/web/controller/SyncDealContoller.java
View file @
ab7e5560
...
@@ -25,7 +25,7 @@ import java.util.Date;
...
@@ -25,7 +25,7 @@ import java.util.Date;
@RestController
@RestController
public
class
SyncDealContoller
extends
WebBaseController
{
public
class
SyncDealContoller
extends
WebBaseController
{
private
static
Logger
logger
=
LoggerFactory
.
getLogger
(
SyncDealContoller
.
class
);
private
static
final
Logger
logger
=
LoggerFactory
.
getLogger
(
SyncDealContoller
.
class
);
@Autowired
@Autowired
private
DealSyncOperationApiService
dealSyncOperationApiService
;
private
DealSyncOperationApiService
dealSyncOperationApiService
;
...
@@ -39,7 +39,7 @@ public class SyncDealContoller extends WebBaseController {
...
@@ -39,7 +39,7 @@ public class SyncDealContoller extends WebBaseController {
task
=
dealSyncOperationApiService
.
createTask
(
wxEid
,
"门店同步"
,
"11111"
,
"部门同步"
);
task
=
dealSyncOperationApiService
.
createTask
(
wxEid
,
"门店同步"
,
"11111"
,
"部门同步"
);
dealSyncOperationApiService
.
dealDepartment
(
task
,
wxEid
,
qo
.
getAddDepartment
(),
qo
.
getEditDepartment
());
dealSyncOperationApiService
.
dealDepartment
(
task
,
wxEid
,
qo
.
getAddDepartment
(),
qo
.
getEditDepartment
());
}
else
{
}
else
{
LoginDTO
login
=
(
LoginDTO
)
AuthRequestUtil
.
getLoginUser
();
LoginDTO
login
=
AuthRequestUtil
.
getLoginUser
();
String
wxEnterpriseId
=
login
.
getWxEnterpriseId
();
String
wxEnterpriseId
=
login
.
getWxEnterpriseId
();
String
key
=
"haoban-sync-department-"
+
wxEnterpriseId
;
String
key
=
"haoban-sync-department-"
+
wxEnterpriseId
;
if
(
RedisUtil
.
getCache
(
key
)
!=
null
)
{
if
(
RedisUtil
.
getCache
(
key
)
!=
null
)
{
...
@@ -58,7 +58,7 @@ public class SyncDealContoller extends WebBaseController {
...
@@ -58,7 +58,7 @@ public class SyncDealContoller extends WebBaseController {
public
HaobanResponse
departmentBatchSync
(
@RequestBody
SyncDealQO
qo
)
{
public
HaobanResponse
departmentBatchSync
(
@RequestBody
SyncDealQO
qo
)
{
String
task
=
null
;
String
task
=
null
;
LoginDTO
login
=
(
LoginDTO
)
AuthRequestUtil
.
getLoginUser
();
LoginDTO
login
=
AuthRequestUtil
.
getLoginUser
();
String
wxEnterpriseId
=
login
.
getWxEnterpriseId
();
String
wxEnterpriseId
=
login
.
getWxEnterpriseId
();
logger
.
info
(
"login:{}"
,
JSONObject
.
toJSONString
(
login
));
logger
.
info
(
"login:{}"
,
JSONObject
.
toJSONString
(
login
));
...
@@ -93,7 +93,7 @@ public class SyncDealContoller extends WebBaseController {
...
@@ -93,7 +93,7 @@ public class SyncDealContoller extends WebBaseController {
@RequestMapping
(
"department-sync-check"
)
@RequestMapping
(
"department-sync-check"
)
public
HaobanResponse
syncSuccess
(
String
wxEnterpriseId
)
{
public
HaobanResponse
syncSuccess
(
String
wxEnterpriseId
)
{
if
(
StringUtils
.
isBlank
(
wxEnterpriseId
))
{
if
(
StringUtils
.
isBlank
(
wxEnterpriseId
))
{
LoginDTO
login
=
(
LoginDTO
)
AuthRequestUtil
.
getLoginUser
();
LoginDTO
login
=
AuthRequestUtil
.
getLoginUser
();
wxEnterpriseId
=
login
.
getWxEnterpriseId
();
wxEnterpriseId
=
login
.
getWxEnterpriseId
();
}
}
SyncCheckDTO
taskCheck
=
dealSyncOperationApiService
.
getTaskCheck
(
wxEnterpriseId
);
SyncCheckDTO
taskCheck
=
dealSyncOperationApiService
.
getTaskCheck
(
wxEnterpriseId
);
...
@@ -109,7 +109,7 @@ public class SyncDealContoller extends WebBaseController {
...
@@ -109,7 +109,7 @@ public class SyncDealContoller extends WebBaseController {
@RequestMapping
(
"/test/department-sync-check"
)
@RequestMapping
(
"/test/department-sync-check"
)
public
HaobanResponse
testSyncSuccess
(
String
wxEnterpriseId
)
{
public
HaobanResponse
testSyncSuccess
(
String
wxEnterpriseId
)
{
if
(
StringUtils
.
isBlank
(
wxEnterpriseId
))
{
if
(
StringUtils
.
isBlank
(
wxEnterpriseId
))
{
LoginDTO
login
=
(
LoginDTO
)
AuthRequestUtil
.
getLoginUser
();
LoginDTO
login
=
AuthRequestUtil
.
getLoginUser
();
wxEnterpriseId
=
login
.
getWxEnterpriseId
();
wxEnterpriseId
=
login
.
getWxEnterpriseId
();
}
}
SyncCheckDTO
taskCheck
=
dealSyncOperationApiService
.
getTaskCheck
(
wxEnterpriseId
);
SyncCheckDTO
taskCheck
=
dealSyncOperationApiService
.
getTaskCheck
(
wxEnterpriseId
);
...
@@ -120,7 +120,7 @@ public class SyncDealContoller extends WebBaseController {
...
@@ -120,7 +120,7 @@ public class SyncDealContoller extends WebBaseController {
@ResponseBody
@ResponseBody
public
HaobanResponse
clerkReSync
(
String
taskId
)
{
public
HaobanResponse
clerkReSync
(
String
taskId
)
{
if
(
StringUtils
.
isBlank
(
taskId
))
{
if
(
StringUtils
.
isBlank
(
taskId
))
{
LoginDTO
login
=
(
LoginDTO
)
AuthRequestUtil
.
getLoginUser
();
LoginDTO
login
=
AuthRequestUtil
.
getLoginUser
();
String
wxEnterpriseId
=
login
.
getWxEnterpriseId
();
String
wxEnterpriseId
=
login
.
getWxEnterpriseId
();
taskId
=
dealSyncOperationApiService
.
getTaskLock
(
wxEnterpriseId
);
taskId
=
dealSyncOperationApiService
.
getTaskLock
(
wxEnterpriseId
);
}
}
...
@@ -133,7 +133,7 @@ public class SyncDealContoller extends WebBaseController {
...
@@ -133,7 +133,7 @@ public class SyncDealContoller extends WebBaseController {
@ResponseBody
@ResponseBody
public
HaobanResponse
closeReSync
(
String
wxEnterpriseId
)
{
public
HaobanResponse
closeReSync
(
String
wxEnterpriseId
)
{
if
(
StringUtils
.
isBlank
(
wxEnterpriseId
))
{
if
(
StringUtils
.
isBlank
(
wxEnterpriseId
))
{
LoginDTO
login
=
(
LoginDTO
)
AuthRequestUtil
.
getLoginUser
();
LoginDTO
login
=
AuthRequestUtil
.
getLoginUser
();
wxEnterpriseId
=
login
.
getWxEnterpriseId
();
wxEnterpriseId
=
login
.
getWxEnterpriseId
();
}
}
dealSyncOperationApiService
.
closeTask
(
wxEnterpriseId
);
dealSyncOperationApiService
.
closeTask
(
wxEnterpriseId
);
...
@@ -152,7 +152,7 @@ public class SyncDealContoller extends WebBaseController {
...
@@ -152,7 +152,7 @@ public class SyncDealContoller extends WebBaseController {
@ResponseBody
@ResponseBody
public
HaobanResponse
syncTask
(
String
wxEnterpriseId
,
BasePageInfo
pageInfo
)
{
public
HaobanResponse
syncTask
(
String
wxEnterpriseId
,
BasePageInfo
pageInfo
)
{
if
(
StringUtils
.
isBlank
(
wxEnterpriseId
))
{
if
(
StringUtils
.
isBlank
(
wxEnterpriseId
))
{
LoginDTO
login
=
(
LoginDTO
)
AuthRequestUtil
.
getLoginUser
();
LoginDTO
login
=
AuthRequestUtil
.
getLoginUser
();
wxEnterpriseId
=
login
.
getWxEnterpriseId
();
wxEnterpriseId
=
login
.
getWxEnterpriseId
();
}
}
Page
<
SyncTaskDTO
>
retPage
=
dealSyncOperationApiService
.
listSyncTask
(
wxEnterpriseId
,
pageInfo
);
Page
<
SyncTaskDTO
>
retPage
=
dealSyncOperationApiService
.
listSyncTask
(
wxEnterpriseId
,
pageInfo
);
...
@@ -171,7 +171,7 @@ public class SyncDealContoller extends WebBaseController {
...
@@ -171,7 +171,7 @@ public class SyncDealContoller extends WebBaseController {
@ResponseBody
@ResponseBody
public
HaobanResponse
syncTaskDetail
(
String
wxEnterpriseId
,
String
taskId
,
BasePageInfo
pageInfo
)
{
public
HaobanResponse
syncTaskDetail
(
String
wxEnterpriseId
,
String
taskId
,
BasePageInfo
pageInfo
)
{
if
(
StringUtils
.
isBlank
(
wxEnterpriseId
))
{
if
(
StringUtils
.
isBlank
(
wxEnterpriseId
))
{
LoginDTO
login
=
(
LoginDTO
)
AuthRequestUtil
.
getLoginUser
();
LoginDTO
login
=
AuthRequestUtil
.
getLoginUser
();
wxEnterpriseId
=
login
.
getWxEnterpriseId
();
wxEnterpriseId
=
login
.
getWxEnterpriseId
();
}
}
Page
<
PreDealLogInfoDTO
>
retPage
=
dealSyncOperationApiService
.
listSyncTaskDetail
(
wxEnterpriseId
,
taskId
,
pageInfo
);
Page
<
PreDealLogInfoDTO
>
retPage
=
dealSyncOperationApiService
.
listSyncTaskDetail
(
wxEnterpriseId
,
taskId
,
pageInfo
);
...
...
haoban-manage3-web/src/main/java/com/gic/haoban/manage/web/controller/WebBaseController.java
View file @
ab7e5560
...
@@ -51,9 +51,7 @@ public class WebBaseController {
...
@@ -51,9 +51,7 @@ public class WebBaseController {
* @return
* @return
*/
*/
protected
LoginDTO
getLoginUser
()
{
protected
LoginDTO
getLoginUser
()
{
//为了做兼容
return
EntityUtil
.
changeEntityByJSON
(
LoginDTO
.
class
,
AuthWebRequestUtil
.
getLoginUser
());
Object
loginUser
=
AuthWebRequestUtil
.
getLoginUser
();
return
EntityUtil
.
changeEntityByJSON
(
LoginDTO
.
class
,
loginUser
);
}
}
public
boolean
haveRight
(
List
<
DisplayRelationShortInfoDTO
>
list
)
{
public
boolean
haveRight
(
List
<
DisplayRelationShortInfoDTO
>
list
)
{
...
...
haoban-manage3-web/src/main/java/com/gic/haoban/manage/web/controller/WxEnterpriseController.java
View file @
ab7e5560
...
@@ -78,7 +78,7 @@ public class WxEnterpriseController extends WebBaseController {
...
@@ -78,7 +78,7 @@ public class WxEnterpriseController extends WebBaseController {
//授权企业列表
//授权企业列表
@RequestMapping
(
"wxa-enterprise-list"
)
@RequestMapping
(
"wxa-enterprise-list"
)
public
HaobanResponse
wxEnterpriseList
()
{
public
HaobanResponse
wxEnterpriseList
()
{
LoginDTO
login
=
(
LoginDTO
)
AuthRequestUtil
.
getLoginUser
();
LoginDTO
login
=
AuthRequestUtil
.
getLoginUser
();
String
wxEnterpriseId
=
login
.
getWxEnterpriseId
();
String
wxEnterpriseId
=
login
.
getWxEnterpriseId
();
List
<
EnterpriseDetailDTO
>
list
=
wxEnterpriseRelatedApiService
.
listEnterpriseByWxEnterpriseId
(
wxEnterpriseId
);
List
<
EnterpriseDetailDTO
>
list
=
wxEnterpriseRelatedApiService
.
listEnterpriseByWxEnterpriseId
(
wxEnterpriseId
);
List
<
EnterpriseDetailVO
>
detailVOS
=
EntityUtil
.
changeEntityListByOrika
(
EnterpriseDetailVO
.
class
,
list
);
List
<
EnterpriseDetailVO
>
detailVOS
=
EntityUtil
.
changeEntityListByOrika
(
EnterpriseDetailVO
.
class
,
list
);
...
@@ -106,7 +106,7 @@ public class WxEnterpriseController extends WebBaseController {
...
@@ -106,7 +106,7 @@ public class WxEnterpriseController extends WebBaseController {
//授权企业列表
//授权企业列表
@RequestMapping
(
"wx-enterprise-list"
)
@RequestMapping
(
"wx-enterprise-list"
)
public
HaobanResponse
wxaEnterpriseList
()
{
public
HaobanResponse
wxaEnterpriseList
()
{
LoginDTO
login
=
(
LoginDTO
)
AuthRequestUtil
.
getLoginUser
();
LoginDTO
login
=
AuthRequestUtil
.
getLoginUser
();
String
wxEnterpriseId
=
login
.
getWxEnterpriseId
();
String
wxEnterpriseId
=
login
.
getWxEnterpriseId
();
List
<
EnterpriseDetailDTO
>
list
=
wxEnterpriseRelatedApiService
.
listEnterpriseByWxEnterpriseId
(
wxEnterpriseId
);
List
<
EnterpriseDetailDTO
>
list
=
wxEnterpriseRelatedApiService
.
listEnterpriseByWxEnterpriseId
(
wxEnterpriseId
);
if
(
CollectionUtil
.
isNotEmpty
(
list
))
{
if
(
CollectionUtil
.
isNotEmpty
(
list
))
{
...
@@ -198,7 +198,7 @@ public class WxEnterpriseController extends WebBaseController {
...
@@ -198,7 +198,7 @@ public class WxEnterpriseController extends WebBaseController {
if
(
StringUtils
.
isAnyBlank
(
bindQo
.
getEnterpriseId
(),
bindQo
.
getVersion
()))
{
if
(
StringUtils
.
isAnyBlank
(
bindQo
.
getEnterpriseId
(),
bindQo
.
getVersion
()))
{
return
resultResponse
(
HaoBanErrCode
.
ERR_2
);
return
resultResponse
(
HaoBanErrCode
.
ERR_2
);
}
}
LoginDTO
login
=
(
LoginDTO
)
AuthRequestUtil
.
getLoginUser
();
LoginDTO
login
=
AuthRequestUtil
.
getLoginUser
();
String
wxEnterpriseId
=
login
.
getWxEnterpriseId
();
String
wxEnterpriseId
=
login
.
getWxEnterpriseId
();
StaffDTO
staff
=
login
.
getStaffDTO
();
StaffDTO
staff
=
login
.
getStaffDTO
();
String
staffId
=
staff
.
getStaffId
();
String
staffId
=
staff
.
getStaffId
();
...
@@ -226,7 +226,7 @@ public class WxEnterpriseController extends WebBaseController {
...
@@ -226,7 +226,7 @@ public class WxEnterpriseController extends WebBaseController {
//溢出门店列表
//溢出门店列表
@RequestMapping
(
"store-full-list"
)
@RequestMapping
(
"store-full-list"
)
public
HaobanResponse
storeFullList
(
BasePageInfo
basePageInfo
,
String
keyWord
)
{
public
HaobanResponse
storeFullList
(
BasePageInfo
basePageInfo
,
String
keyWord
)
{
LoginDTO
login
=
(
LoginDTO
)
AuthRequestUtil
.
getLoginUser
();
LoginDTO
login
=
AuthRequestUtil
.
getLoginUser
();
String
wxEnterpriseId
=
login
.
getWxEnterpriseId
();
String
wxEnterpriseId
=
login
.
getWxEnterpriseId
();
int
maxVersionCount
=
0
;
int
maxVersionCount
=
0
;
List
<
EnterpriseDetailDTO
>
enterpriseList
=
wxEnterpriseRelatedApiService
.
listEnterpriseByWxEnterpriseId
(
wxEnterpriseId
);
List
<
EnterpriseDetailDTO
>
enterpriseList
=
wxEnterpriseRelatedApiService
.
listEnterpriseByWxEnterpriseId
(
wxEnterpriseId
);
...
@@ -279,7 +279,7 @@ public class WxEnterpriseController extends WebBaseController {
...
@@ -279,7 +279,7 @@ public class WxEnterpriseController extends WebBaseController {
@RequestMapping
(
"is-wx-enterprise-secret-set"
)
@RequestMapping
(
"is-wx-enterprise-secret-set"
)
public
HaobanResponse
isWxEnterpriseSecretSet
()
{
public
HaobanResponse
isWxEnterpriseSecretSet
()
{
String
wxEnterpriseId
=
""
;
String
wxEnterpriseId
=
""
;
LoginDTO
login
=
(
LoginDTO
)
AuthRequestUtil
.
getLoginUser
();
LoginDTO
login
=
AuthRequestUtil
.
getLoginUser
();
wxEnterpriseId
=
login
.
getWxEnterpriseId
();
wxEnterpriseId
=
login
.
getWxEnterpriseId
();
List
<
SecretSettingDTO
>
listSecret
=
wxEnterpriseApiService
.
listSecret
(
wxEnterpriseId
);
List
<
SecretSettingDTO
>
listSecret
=
wxEnterpriseApiService
.
listSecret
(
wxEnterpriseId
);
if
(
CollectionUtils
.
isEmpty
(
listSecret
))
{
if
(
CollectionUtils
.
isEmpty
(
listSecret
))
{
...
@@ -304,7 +304,7 @@ public class WxEnterpriseController extends WebBaseController {
...
@@ -304,7 +304,7 @@ public class WxEnterpriseController extends WebBaseController {
return
resultResponse
(
HaoBanErrCode
.
ERR_2
);
return
resultResponse
(
HaoBanErrCode
.
ERR_2
);
}
}
String
wxEnterpriseId
=
""
;
String
wxEnterpriseId
=
""
;
LoginDTO
login
=
(
LoginDTO
)
AuthRequestUtil
.
getLoginUser
();
LoginDTO
login
=
AuthRequestUtil
.
getLoginUser
();
wxEnterpriseId
=
login
.
getWxEnterpriseId
();
wxEnterpriseId
=
login
.
getWxEnterpriseId
();
WxEnterpriseDTO
wxEnterprise
=
wxEnterpriseApiService
.
getOne
(
wxEnterpriseId
);
WxEnterpriseDTO
wxEnterprise
=
wxEnterpriseApiService
.
getOne
(
wxEnterpriseId
);
if
(
wxEnterprise
==
null
)
{
if
(
wxEnterprise
==
null
)
{
...
@@ -341,7 +341,7 @@ public class WxEnterpriseController extends WebBaseController {
...
@@ -341,7 +341,7 @@ public class WxEnterpriseController extends WebBaseController {
return
resultResponse
(
HaoBanErrCode
.
ERR_2
);
return
resultResponse
(
HaoBanErrCode
.
ERR_2
);
}
}
String
wxEnterpriseId
=
""
;
String
wxEnterpriseId
=
""
;
LoginDTO
login
=
(
LoginDTO
)
AuthRequestUtil
.
getLoginUser
();
LoginDTO
login
=
AuthRequestUtil
.
getLoginUser
();
wxEnterpriseId
=
login
.
getWxEnterpriseId
();
wxEnterpriseId
=
login
.
getWxEnterpriseId
();
WxEnterpriseDTO
wxEnterprise
=
wxEnterpriseApiService
.
getOne
(
wxEnterpriseId
);
WxEnterpriseDTO
wxEnterprise
=
wxEnterpriseApiService
.
getOne
(
wxEnterpriseId
);
if
(
wxEnterprise
==
null
)
{
if
(
wxEnterprise
==
null
)
{
...
@@ -373,7 +373,7 @@ public class WxEnterpriseController extends WebBaseController {
...
@@ -373,7 +373,7 @@ public class WxEnterpriseController extends WebBaseController {
return
resultResponse
(
HaoBanErrCode
.
ERR_2
);
return
resultResponse
(
HaoBanErrCode
.
ERR_2
);
}
}
String
wxEnterpriseId
=
""
;
String
wxEnterpriseId
=
""
;
LoginDTO
login
=
(
LoginDTO
)
AuthRequestUtil
.
getLoginUser
();
LoginDTO
login
=
AuthRequestUtil
.
getLoginUser
();
wxEnterpriseId
=
login
.
getWxEnterpriseId
();
wxEnterpriseId
=
login
.
getWxEnterpriseId
();
WxEnterpriseDTO
wxEnterprise
=
wxEnterpriseApiService
.
getOne
(
wxEnterpriseId
);
WxEnterpriseDTO
wxEnterprise
=
wxEnterpriseApiService
.
getOne
(
wxEnterpriseId
);
if
(
wxEnterprise
==
null
)
{
if
(
wxEnterprise
==
null
)
{
...
@@ -426,7 +426,7 @@ public class WxEnterpriseController extends WebBaseController {
...
@@ -426,7 +426,7 @@ public class WxEnterpriseController extends WebBaseController {
return
resultResponse
(
HaoBanErrCode
.
ERR_2
);
return
resultResponse
(
HaoBanErrCode
.
ERR_2
);
}
}
String
wxEnterpriseId
=
""
;
String
wxEnterpriseId
=
""
;
LoginDTO
login
=
(
LoginDTO
)
AuthRequestUtil
.
getLoginUser
();
LoginDTO
login
=
AuthRequestUtil
.
getLoginUser
();
wxEnterpriseId
=
login
.
getWxEnterpriseId
();
wxEnterpriseId
=
login
.
getWxEnterpriseId
();
WxEnterpriseDTO
wxEnterprise
=
wxEnterpriseApiService
.
getOne
(
wxEnterpriseId
);
WxEnterpriseDTO
wxEnterprise
=
wxEnterpriseApiService
.
getOne
(
wxEnterpriseId
);
if
(
wxEnterprise
==
null
)
{
if
(
wxEnterprise
==
null
)
{
...
@@ -462,7 +462,7 @@ public class WxEnterpriseController extends WebBaseController {
...
@@ -462,7 +462,7 @@ public class WxEnterpriseController extends WebBaseController {
@RequestMapping
(
"secret-list"
)
@RequestMapping
(
"secret-list"
)
public
HaobanResponse
secretList
()
{
public
HaobanResponse
secretList
()
{
String
wxEnterpriseId
=
""
;
String
wxEnterpriseId
=
""
;
LoginDTO
login
=
(
LoginDTO
)
AuthRequestUtil
.
getLoginUser
();
LoginDTO
login
=
AuthRequestUtil
.
getLoginUser
();
wxEnterpriseId
=
login
.
getWxEnterpriseId
();
wxEnterpriseId
=
login
.
getWxEnterpriseId
();
WxEnterpriseDTO
wxEnterprise
=
wxEnterpriseApiService
.
getOne
(
wxEnterpriseId
);
WxEnterpriseDTO
wxEnterprise
=
wxEnterpriseApiService
.
getOne
(
wxEnterpriseId
);
if
(
wxEnterprise
==
null
)
{
if
(
wxEnterprise
==
null
)
{
...
@@ -518,7 +518,7 @@ public class WxEnterpriseController extends WebBaseController {
...
@@ -518,7 +518,7 @@ public class WxEnterpriseController extends WebBaseController {
*/
*/
@RequestMapping
(
"/fresh-wx-friend"
)
@RequestMapping
(
"/fresh-wx-friend"
)
public
HaobanResponse
freshWxFriend
()
{
public
HaobanResponse
freshWxFriend
()
{
LoginDTO
login
=
(
LoginDTO
)
AuthRequestUtil
.
getLoginUser
();
LoginDTO
login
=
AuthRequestUtil
.
getLoginUser
();
String
wxEnterpriseId
=
login
.
getWxEnterpriseId
();
String
wxEnterpriseId
=
login
.
getWxEnterpriseId
();
String
dayKey
=
"haoban_fresh-wx-friend-day"
+
wxEnterpriseId
+
DateUtil
.
dateToStr
(
new
Date
(),
"yyyy-MM-dd"
);
String
dayKey
=
"haoban_fresh-wx-friend-day"
+
wxEnterpriseId
+
DateUtil
.
dateToStr
(
new
Date
(),
"yyyy-MM-dd"
);
String
monthKey
=
"haoban_fresh-wx-friend-month"
+
wxEnterpriseId
+
DateUtil
.
dateToStr
(
new
Date
(),
"yyyy-MM"
);
String
monthKey
=
"haoban_fresh-wx-friend-month"
+
wxEnterpriseId
+
DateUtil
.
dateToStr
(
new
Date
(),
"yyyy-MM"
);
...
@@ -557,7 +557,7 @@ public class WxEnterpriseController extends WebBaseController {
...
@@ -557,7 +557,7 @@ public class WxEnterpriseController extends WebBaseController {
*/
*/
@RequestMapping
(
"/get-fresh-detail"
)
@RequestMapping
(
"/get-fresh-detail"
)
public
HaobanResponse
getFreshDetail
()
{
public
HaobanResponse
getFreshDetail
()
{
LoginDTO
login
=
(
LoginDTO
)
AuthRequestUtil
.
getLoginUser
();
LoginDTO
login
=
AuthRequestUtil
.
getLoginUser
();
String
wxEnterpriseId
=
login
.
getWxEnterpriseId
();
String
wxEnterpriseId
=
login
.
getWxEnterpriseId
();
String
dateKey
=
"haoban_fresh-wx-friend-date"
+
wxEnterpriseId
;
String
dateKey
=
"haoban_fresh-wx-friend-date"
+
wxEnterpriseId
;
RedisUtil
.
getCache
(
dateKey
);
RedisUtil
.
getCache
(
dateKey
);
...
@@ -575,7 +575,7 @@ public class WxEnterpriseController extends WebBaseController {
...
@@ -575,7 +575,7 @@ public class WxEnterpriseController extends WebBaseController {
if
(
StringUtils
.
isAnyBlank
(
enterpriseId
))
{
if
(
StringUtils
.
isAnyBlank
(
enterpriseId
))
{
return
resultResponse
(
HaoBanErrCode
.
ERR_2
);
return
resultResponse
(
HaoBanErrCode
.
ERR_2
);
}
}
LoginDTO
login
=
(
LoginDTO
)
AuthRequestUtil
.
getLoginUser
();
LoginDTO
login
=
AuthRequestUtil
.
getLoginUser
();
String
wxEnterpriseId
=
login
.
getWxEnterpriseId
();
String
wxEnterpriseId
=
login
.
getWxEnterpriseId
();
WxEnterpriseRelationDetailDTO
bindInfo
=
wxEnterpriseRelatedApiService
.
getEnterpriseBindInfo
(
wxEnterpriseId
,
enterpriseId
);
WxEnterpriseRelationDetailDTO
bindInfo
=
wxEnterpriseRelatedApiService
.
getEnterpriseBindInfo
(
wxEnterpriseId
,
enterpriseId
);
...
@@ -591,7 +591,7 @@ public class WxEnterpriseController extends WebBaseController {
...
@@ -591,7 +591,7 @@ public class WxEnterpriseController extends WebBaseController {
*/
*/
@RequestMapping
(
"bind-store-list"
)
@RequestMapping
(
"bind-store-list"
)
public
HaobanResponse
bindStoreList
(
String
enterpriseId
,
String
search
,
BasePageInfo
basePageInfo
)
{
public
HaobanResponse
bindStoreList
(
String
enterpriseId
,
String
search
,
BasePageInfo
basePageInfo
)
{
LoginDTO
login
=
(
LoginDTO
)
AuthRequestUtil
.
getLoginUser
();
LoginDTO
login
=
AuthRequestUtil
.
getLoginUser
();
String
wxEnterpriseId
=
login
.
getWxEnterpriseId
();
String
wxEnterpriseId
=
login
.
getWxEnterpriseId
();
Page
<
BindStoreInfoDTO
>
retPage
=
wxEnterpriseRelatedApiService
.
pageBindStoreByEnterpriseId
(
wxEnterpriseId
,
enterpriseId
,
search
,
basePageInfo
);
Page
<
BindStoreInfoDTO
>
retPage
=
wxEnterpriseRelatedApiService
.
pageBindStoreByEnterpriseId
(
wxEnterpriseId
,
enterpriseId
,
search
,
basePageInfo
);
return
resultResponse
(
HaoBanErrCode
.
ERR_1
,
retPage
);
return
resultResponse
(
HaoBanErrCode
.
ERR_1
,
retPage
);
...
@@ -605,7 +605,7 @@ public class WxEnterpriseController extends WebBaseController {
...
@@ -605,7 +605,7 @@ public class WxEnterpriseController extends WebBaseController {
*/
*/
@RequestMapping
(
"flush-bind-store-list"
)
@RequestMapping
(
"flush-bind-store-list"
)
public
HaobanResponse
flushBindStoreList
(
String
enterpriseId
)
{
public
HaobanResponse
flushBindStoreList
(
String
enterpriseId
)
{
LoginDTO
login
=
(
LoginDTO
)
AuthRequestUtil
.
getLoginUser
();
LoginDTO
login
=
AuthRequestUtil
.
getLoginUser
();
String
wxEnterpriseId
=
login
.
getWxEnterpriseId
();
String
wxEnterpriseId
=
login
.
getWxEnterpriseId
();
ServiceResponse
response
=
wxEnterpriseRelatedApiService
.
flushBindStoreByEnterpriseId
(
enterpriseId
,
wxEnterpriseId
,
login
.
getStaffDTO
().
getStaffId
(),
ChannelCodeEnum
.
SYNC_UNBIND
.
getCode
());
ServiceResponse
response
=
wxEnterpriseRelatedApiService
.
flushBindStoreByEnterpriseId
(
enterpriseId
,
wxEnterpriseId
,
login
.
getStaffDTO
().
getStaffId
(),
ChannelCodeEnum
.
SYNC_UNBIND
.
getCode
());
logger
.
info
(
"返回信息:{}"
,
JSONObject
.
toJSONString
(
response
));
logger
.
info
(
"返回信息:{}"
,
JSONObject
.
toJSONString
(
response
));
...
@@ -623,7 +623,7 @@ public class WxEnterpriseController extends WebBaseController {
...
@@ -623,7 +623,7 @@ public class WxEnterpriseController extends WebBaseController {
*/
*/
@RequestMapping
(
"list-miniprogram-setting"
)
@RequestMapping
(
"list-miniprogram-setting"
)
public
HaobanResponse
miniprogramList
()
{
public
HaobanResponse
miniprogramList
()
{
LoginDTO
login
=
(
LoginDTO
)
AuthRequestUtil
.
getLoginUser
();
LoginDTO
login
=
AuthRequestUtil
.
getLoginUser
();
String
wxEnterpriseId
=
login
.
getWxEnterpriseId
();
String
wxEnterpriseId
=
login
.
getWxEnterpriseId
();
List
<
MiniprogramSettingDTO
>
settingDTOS
=
wxEnterpriseApiService
.
listMiniprogramSetting
(
wxEnterpriseId
);
List
<
MiniprogramSettingDTO
>
settingDTOS
=
wxEnterpriseApiService
.
listMiniprogramSetting
(
wxEnterpriseId
);
return
resultResponse
(
HaoBanErrCode
.
ERR_1
,
settingDTOS
);
return
resultResponse
(
HaoBanErrCode
.
ERR_1
,
settingDTOS
);
...
@@ -640,7 +640,7 @@ public class WxEnterpriseController extends WebBaseController {
...
@@ -640,7 +640,7 @@ public class WxEnterpriseController extends WebBaseController {
settingDTO
.
getImageUrl
(),
settingDTO
.
getMiniprogramName
(),
settingDTO
.
getTitle
()))
{
settingDTO
.
getImageUrl
(),
settingDTO
.
getMiniprogramName
(),
settingDTO
.
getTitle
()))
{
return
resultResponse
(
HaoBanErrCode
.
ERR_2
);
return
resultResponse
(
HaoBanErrCode
.
ERR_2
);
}
}
LoginDTO
login
=
(
LoginDTO
)
AuthRequestUtil
.
getLoginUser
();
LoginDTO
login
=
AuthRequestUtil
.
getLoginUser
();
String
wxEnterpriseId
=
login
.
getWxEnterpriseId
();
String
wxEnterpriseId
=
login
.
getWxEnterpriseId
();
settingDTO
.
setWxEnterpriseId
(
wxEnterpriseId
);
settingDTO
.
setWxEnterpriseId
(
wxEnterpriseId
);
MiniprogramSettingDTO
miniprogramSettingDTO
=
wxEnterpriseApiService
.
getMiniprogramSettingByAppId
(
wxEnterpriseId
,
settingDTO
.
getAppId
());
MiniprogramSettingDTO
miniprogramSettingDTO
=
wxEnterpriseApiService
.
getMiniprogramSettingByAppId
(
wxEnterpriseId
,
settingDTO
.
getAppId
());
...
@@ -662,7 +662,7 @@ public class WxEnterpriseController extends WebBaseController {
...
@@ -662,7 +662,7 @@ public class WxEnterpriseController extends WebBaseController {
if
(
StringUtils
.
isEmpty
(
enterpriseId
))
{
if
(
StringUtils
.
isEmpty
(
enterpriseId
))
{
return
resultResponse
(
HaoBanErrCode
.
ERR_2
);
return
resultResponse
(
HaoBanErrCode
.
ERR_2
);
}
}
LoginDTO
login
=
(
LoginDTO
)
AuthRequestUtil
.
getLoginUser
();
LoginDTO
login
=
AuthRequestUtil
.
getLoginUser
();
String
wxEnterpriseId
=
login
.
getWxEnterpriseId
();
String
wxEnterpriseId
=
login
.
getWxEnterpriseId
();
MiniprogramSettingDTO
settingDTO
=
wxEnterpriseApiService
.
getMiniprogramSettingByEid
(
wxEnterpriseId
,
enterpriseId
);
MiniprogramSettingDTO
settingDTO
=
wxEnterpriseApiService
.
getMiniprogramSettingByEid
(
wxEnterpriseId
,
enterpriseId
);
return
resultResponse
(
HaoBanErrCode
.
ERR_1
,
settingDTO
);
return
resultResponse
(
HaoBanErrCode
.
ERR_1
,
settingDTO
);
...
...
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