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
13af41f4
Commit
13af41f4
authored
Jan 15, 2022
by
墨竹
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat:登录修改
parent
f84fafa9
Show whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
138 additions
and
213 deletions
+138
-213
AuthRequestUtil.java
.../java/com/gic/haoban/manage/web/auth/AuthRequestUtil.java
+2
-2
AdminController.java
...com/gic/haoban/manage/web/controller/AdminController.java
+7
-3
ApplicationController.java
...c/haoban/manage/web/controller/ApplicationController.java
+6
-5
AuditController.java
...com/gic/haoban/manage/web/controller/AuditController.java
+7
-6
DepartmentContoller.java
...gic/haoban/manage/web/controller/DepartmentContoller.java
+14
-125
LoginController.java
...com/gic/haoban/manage/web/controller/LoginController.java
+31
-16
MaterialController.java
.../gic/haoban/manage/web/controller/MaterialController.java
+14
-10
StaffController.java
...com/gic/haoban/manage/web/controller/StaffController.java
+18
-14
SyncDealContoller.java
...m/gic/haoban/manage/web/controller/SyncDealContoller.java
+15
-11
WxEnterpriseController.java
.../haoban/manage/web/controller/WxEnterpriseController.java
+24
-21
No files found.
haoban-manage3-web/src/main/java/com/gic/haoban/manage/web/auth/AuthRequestUtil.java
View file @
13af41f4
...
@@ -20,7 +20,7 @@ import java.util.concurrent.TimeUnit;
...
@@ -20,7 +20,7 @@ import java.util.concurrent.TimeUnit;
/**
/**
* Created 2018/7/26.
* Created 2018/7/26.
*
*
新方法 AuthWebRequestUtil
* @author hua
* @author hua
*/
*/
@Deprecated
@Deprecated
...
@@ -138,7 +138,7 @@ public class AuthRequestUtil {
...
@@ -138,7 +138,7 @@ public class AuthRequestUtil {
}
}
public
static
LoginDTO
getLoginUser
()
{
public
static
LoginDTO
getLoginUser
()
{
Cookie
[]
cookies
=
AuthRequestUtil
.
getRequest
().
getCookies
();
Cookie
[]
cookies
=
getRequest
().
getCookies
();
String
token
=
""
;
String
token
=
""
;
if
(
cookies
!=
null
)
{
if
(
cookies
!=
null
)
{
for
(
Cookie
cookie
:
cookies
)
{
for
(
Cookie
cookie
:
cookies
)
{
...
...
haoban-manage3-web/src/main/java/com/gic/haoban/manage/web/controller/AdminController.java
View file @
13af41f4
...
@@ -3,12 +3,16 @@ package com.gic.haoban.manage.web.controller;
...
@@ -3,12 +3,16 @@ package com.gic.haoban.manage.web.controller;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONArray
;
import
com.alibaba.fastjson.JSONArray
;
import
com.alibaba.fastjson.JSONObject
;
import
com.alibaba.fastjson.JSONObject
;
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.*
;
import
com.gic.haoban.manage.api.dto.DepartmentDTO
;
import
com.gic.haoban.manage.api.dto.StaffDTO
;
import
com.gic.haoban.manage.api.dto.WxApplicationDTO
;
import
com.gic.haoban.manage.api.dto.WxEnterpriseDTO
;
import
com.gic.haoban.manage.api.service.StaffApiService
;
import
com.gic.haoban.manage.api.service.StaffApiService
;
import
com.gic.haoban.manage.api.service.WxApplicationApiService
;
import
com.gic.haoban.manage.api.service.WxApplicationApiService
;
import
com.gic.haoban.manage.api.service.WxEnterpriseApiService
;
import
com.gic.haoban.manage.api.service.WxEnterpriseApiService
;
import
com.gic.haoban.manage.web.auth.AuthRequestUtil
;
import
com.gic.haoban.manage.web.errCode.HaoBanErrCode
;
import
com.gic.haoban.manage.web.errCode.HaoBanErrCode
;
import
com.gic.haoban.manage.web.vo.AdminRoleVO
;
import
com.gic.haoban.manage.web.vo.AdminRoleVO
;
import
com.gic.haoban.manage.web.vo.AdminVO
;
import
com.gic.haoban.manage.web.vo.AdminVO
;
...
@@ -40,7 +44,7 @@ public class AdminController extends WebBaseController {
...
@@ -40,7 +44,7 @@ public class AdminController extends WebBaseController {
@RequestMapping
(
"admin-list"
)
@RequestMapping
(
"admin-list"
)
public
HaobanResponse
adminList
()
{
public
HaobanResponse
adminList
()
{
LoginDTO
login
=
Auth
RequestUtil
.
getLoginUser
();
WebLoginDTO
login
=
AuthWeb
RequestUtil
.
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 @
13af41f4
...
@@ -3,12 +3,13 @@ package com.gic.haoban.manage.web.controller;
...
@@ -3,12 +3,13 @@ package com.gic.haoban.manage.web.controller;
import
cn.hutool.core.collection.CollectionUtil
;
import
cn.hutool.core.collection.CollectionUtil
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONObject
;
import
com.alibaba.fastjson.JSONObject
;
import
com.gic.haoban.base.api.common.pojo.dto.WebLoginDTO
;
import
com.gic.haoban.common.anno.IgnoreLogin
;
import
com.gic.haoban.common.anno.IgnoreLogin
;
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.*
;
import
com.gic.haoban.manage.api.dto.*
;
import
com.gic.haoban.manage.api.enums.SecretTypeEnum
;
import
com.gic.haoban.manage.api.enums.SecretTypeEnum
;
import
com.gic.haoban.manage.api.service.*
;
import
com.gic.haoban.manage.api.service.*
;
import
com.gic.haoban.manage.web.auth.AuthRequestUtil
;
import
com.gic.haoban.manage.web.config.Config
;
import
com.gic.haoban.manage.web.config.Config
;
import
com.gic.haoban.manage.web.errCode.HaoBanErrCode
;
import
com.gic.haoban.manage.web.errCode.HaoBanErrCode
;
import
com.gic.redis.data.util.RedisUtil
;
import
com.gic.redis.data.util.RedisUtil
;
...
@@ -52,7 +53,7 @@ public class ApplicationController extends WebBaseController {
...
@@ -52,7 +53,7 @@ public class ApplicationController extends WebBaseController {
@RequestMapping
(
"application-list"
)
@RequestMapping
(
"application-list"
)
public
HaobanResponse
applicationList
()
{
public
HaobanResponse
applicationList
()
{
LoginDTO
login
=
Auth
RequestUtil
.
getLoginUser
();
WebLoginDTO
login
=
AuthWeb
RequestUtil
.
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 +121,7 @@ public class ApplicationController extends WebBaseController {
...
@@ -120,7 +121,7 @@ public class ApplicationController extends WebBaseController {
@RequestMapping
(
"has-bind-contract"
)
@RequestMapping
(
"has-bind-contract"
)
public
HaobanResponse
hasBindContract
()
{
public
HaobanResponse
hasBindContract
()
{
LoginDTO
login
=
Auth
RequestUtil
.
getLoginUser
();
WebLoginDTO
login
=
AuthWeb
RequestUtil
.
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 +154,7 @@ public class ApplicationController extends WebBaseController {
...
@@ -153,7 +154,7 @@ public class ApplicationController extends WebBaseController {
*/
*/
@RequestMapping
(
"init-wx-department"
)
@RequestMapping
(
"init-wx-department"
)
public
HaobanResponse
initWxDepartment
()
{
public
HaobanResponse
initWxDepartment
()
{
LoginDTO
login
=
Auth
RequestUtil
.
getLoginUser
();
WebLoginDTO
login
=
AuthWeb
RequestUtil
.
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 +257,7 @@ public class ApplicationController extends WebBaseController {
...
@@ -256,7 +257,7 @@ public class ApplicationController extends WebBaseController {
*/
*/
@RequestMapping
(
"sync-qywx"
)
@RequestMapping
(
"sync-qywx"
)
public
Object
syncQywx
()
{
public
Object
syncQywx
()
{
LoginDTO
login
=
Auth
RequestUtil
.
getLoginUser
();
WebLoginDTO
login
=
AuthWeb
RequestUtil
.
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 @
13af41f4
...
@@ -5,7 +5,10 @@ import com.gic.api.base.commons.Page;
...
@@ -5,7 +5,10 @@ import com.gic.api.base.commons.Page;
import
com.gic.enterprise.api.dto.StoreDTO
;
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.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.HaobanResponse
;
import
com.gic.haoban.common.utils.HaobanResponse
;
import
com.gic.haoban.common.utils.UuidUtil
;
import
com.gic.haoban.common.utils.UuidUtil
;
import
com.gic.haoban.manage.api.dto.*
;
import
com.gic.haoban.manage.api.dto.*
;
...
@@ -13,7 +16,6 @@ import com.gic.haoban.manage.api.enums.StoreFieldEnum;
...
@@ -13,7 +16,6 @@ import com.gic.haoban.manage.api.enums.StoreFieldEnum;
import
com.gic.haoban.manage.api.service.AuditApiService
;
import
com.gic.haoban.manage.api.service.AuditApiService
;
import
com.gic.haoban.manage.api.service.AuditSettingApiService
;
import
com.gic.haoban.manage.api.service.AuditSettingApiService
;
import
com.gic.haoban.manage.api.service.StaffApiService
;
import
com.gic.haoban.manage.api.service.StaffApiService
;
import
com.gic.haoban.manage.web.auth.AuthRequestUtil
;
import
com.gic.haoban.manage.web.errCode.HaoBanErrCode
;
import
com.gic.haoban.manage.web.errCode.HaoBanErrCode
;
import
com.gic.haoban.manage.web.vo.BatchApproveVO
;
import
com.gic.haoban.manage.web.vo.BatchApproveVO
;
import
com.gic.redis.data.util.RedisUtil
;
import
com.gic.redis.data.util.RedisUtil
;
...
@@ -162,7 +164,7 @@ public class AuditController extends WebBaseController{
...
@@ -162,7 +164,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
=
Auth
RequestUtil
.
getLoginUser
();
WebLoginDTO
login
=
AuthWeb
RequestUtil
.
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
(
","
);
...
@@ -171,7 +173,6 @@ public class AuditController extends WebBaseController{
...
@@ -171,7 +173,6 @@ public class AuditController extends WebBaseController{
String
batchId
=
UuidUtil
.
randomUUID
();
String
batchId
=
UuidUtil
.
randomUUID
();
for
(
String
auditId
:
s
){
for
(
String
auditId
:
s
){
String
result
=
auditApiService
.
audit
(
batchId
,
auditId
,
staffName
,
staffId
);
String
result
=
auditApiService
.
audit
(
batchId
,
auditId
,
staffName
,
staffId
);
// String result = auditApiService.audit(batchId,auditId,auditName,loginStaffDTO.getStaffId());
if
(
StringUtils
.
isEmpty
(
result
)){
if
(
StringUtils
.
isEmpty
(
result
)){
successCount
=
successCount
+
1
;
successCount
=
successCount
+
1
;
}
else
{
}
else
{
...
@@ -192,7 +193,7 @@ public class AuditController extends WebBaseController{
...
@@ -192,7 +193,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
=
Auth
RequestUtil
.
getLoginUser
();
WebLoginDTO
login
=
AuthWeb
RequestUtil
.
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,8 +203,8 @@ public class AuditController extends WebBaseController{
...
@@ -202,8 +203,8 @@ 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
=
Auth
RequestUtil
.
getLoginUser
();
WebLoginDTO
login
=
AuthWeb
RequestUtil
.
getLoginUser
();
StaffDTO
loginStaffDTO
=
login
.
getStaffDTO
();
Web
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 @
13af41f4
...
@@ -17,13 +17,17 @@ import com.gic.haoban.base.api.common.BasePageInfo;
...
@@ -17,13 +17,17 @@ import com.gic.haoban.base.api.common.BasePageInfo;
import
com.gic.haoban.base.api.common.Constant
;
import
com.gic.haoban.base.api.common.Constant
;
import
com.gic.haoban.base.api.common.PageResult
;
import
com.gic.haoban.base.api.common.PageResult
;
import
com.gic.haoban.base.api.common.ServiceResponse
;
import
com.gic.haoban.base.api.common.ServiceResponse
;
import
com.gic.haoban.base.api.common.pojo.dto.WebLoginDTO
;
import
com.gic.haoban.common.utils.AuthWebRequestUtil
;
import
com.gic.haoban.common.utils.EntityUtil
;
import
com.gic.haoban.common.utils.EntityUtil
;
import
com.gic.haoban.common.utils.HaobanResponse
;
import
com.gic.haoban.common.utils.HaobanResponse
;
import
com.gic.haoban.manage.api.dto.*
;
import
com.gic.haoban.manage.api.dto.DepartmentDTO
;
import
com.gic.haoban.manage.api.dto.DepartmentShortDTO
;
import
com.gic.haoban.manage.api.dto.StaffDTO
;
import
com.gic.haoban.manage.api.dto.StaffDepartmentRelatedDTO
;
import
com.gic.haoban.manage.api.service.DepartmentApiService
;
import
com.gic.haoban.manage.api.service.DepartmentApiService
;
import
com.gic.haoban.manage.api.service.StaffApiService
;
import
com.gic.haoban.manage.api.service.StaffApiService
;
import
com.gic.haoban.manage.api.service.StaffDepartmentRelatedApiService
;
import
com.gic.haoban.manage.api.service.StaffDepartmentRelatedApiService
;
import
com.gic.haoban.manage.web.auth.AuthRequestUtil
;
import
com.gic.haoban.manage.web.errCode.HaoBanErrCode
;
import
com.gic.haoban.manage.web.errCode.HaoBanErrCode
;
import
com.gic.haoban.manage.web.qo.DepartmentAddQO
;
import
com.gic.haoban.manage.web.qo.DepartmentAddQO
;
import
com.gic.haoban.manage.web.qo.DepartmentEditQO
;
import
com.gic.haoban.manage.web.qo.DepartmentEditQO
;
...
@@ -31,7 +35,6 @@ import com.gic.haoban.manage.web.qo.SyncDepartmentQO;
...
@@ -31,7 +35,6 @@ import com.gic.haoban.manage.web.qo.SyncDepartmentQO;
import
com.gic.haoban.manage.web.thread.SyncDepartmentThread
;
import
com.gic.haoban.manage.web.thread.SyncDepartmentThread
;
import
com.gic.haoban.manage.web.vo.DepartmentChainVO
;
import
com.gic.haoban.manage.web.vo.DepartmentChainVO
;
import
com.gic.haoban.manage.web.vo.DepartmentVO
;
import
com.gic.haoban.manage.web.vo.DepartmentVO
;
import
com.gic.redis.data.util.RedisUtil
;
import
com.gic.redis.data.util.RedisUtil
;
import
org.apache.commons.lang.StringUtils
;
import
org.apache.commons.lang.StringUtils
;
import
org.slf4j.Logger
;
import
org.slf4j.Logger
;
...
@@ -67,7 +70,7 @@ public class DepartmentContoller extends WebBaseController{
...
@@ -67,7 +70,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
=
Auth
RequestUtil
.
getLoginUser
();
WebLoginDTO
login
=
AuthWeb
RequestUtil
.
getLoginUser
();
String
wxEnterpriseId
=
login
.
getWxEnterpriseId
();
String
wxEnterpriseId
=
login
.
getWxEnterpriseId
();
logger
.
info
(
"【部门列表】wxEnterpriseId={}"
,
wxEnterpriseId
);
logger
.
info
(
"【部门列表】wxEnterpriseId={}"
,
wxEnterpriseId
);
...
@@ -108,7 +111,7 @@ public class DepartmentContoller extends WebBaseController{
...
@@ -108,7 +111,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
=
Auth
RequestUtil
.
getLoginUser
();
WebLoginDTO
login
=
AuthWeb
RequestUtil
.
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
>();
...
@@ -141,14 +144,6 @@ public class DepartmentContoller extends WebBaseController{
...
@@ -141,14 +144,6 @@ public class DepartmentContoller extends WebBaseController{
enterpriseMap
.
put
(
enterprise
.
getEnterpriseId
(),
enterprise
);
enterpriseMap
.
put
(
enterprise
.
getEnterpriseId
(),
enterprise
);
}
}
}
}
//先注释调
// for (String enterpriseId : enterpriseSet) {
// EnterpriseDTO enterprise = enterpriseService.getEnterpriseById(enterpriseId);
// if(enterprise != null){
// enterpriseMap.put(enterpriseId, enterprise);
// }
// }
for
(
DepartmentDTO
departmentDTO
:
list
)
{
for
(
DepartmentDTO
departmentDTO
:
list
)
{
String
enterpriseId
=
departmentDTO
.
getEnterpriseId
();
String
enterpriseId
=
departmentDTO
.
getEnterpriseId
();
if
(
StringUtils
.
isNotBlank
(
enterpriseId
)){
if
(
StringUtils
.
isNotBlank
(
enterpriseId
)){
...
@@ -217,7 +212,7 @@ public class DepartmentContoller extends WebBaseController{
...
@@ -217,7 +212,7 @@ public class DepartmentContoller extends WebBaseController{
@RequestMapping
(
"department-recycle-count"
)
@RequestMapping
(
"department-recycle-count"
)
public
HaobanResponse
departmentRecycleCount
()
{
public
HaobanResponse
departmentRecycleCount
()
{
LoginDTO
login
=
Auth
RequestUtil
.
getLoginUser
();
WebLoginDTO
login
=
AuthWeb
RequestUtil
.
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 +248,7 @@ public class DepartmentContoller extends WebBaseController{
...
@@ -253,7 +248,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
=
Auth
RequestUtil
.
getLoginUser
();
WebLoginDTO
login
=
AuthWeb
RequestUtil
.
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
){
...
@@ -271,115 +266,9 @@ public class DepartmentContoller extends WebBaseController{
...
@@ -271,115 +266,9 @@ public class DepartmentContoller extends WebBaseController{
editDepartment
=
JSON
.
toJSONString
(
editDepartmentObject
);
editDepartment
=
JSON
.
toJSONString
(
editDepartmentObject
);
addDepartment
=
JSON
.
toJSONString
(
addDepartmentObject
);
addDepartment
=
JSON
.
toJSONString
(
addDepartmentObject
);
}
}
RedisUtil
.
setCache
(
key
,
1
,
3600
l
);
RedisUtil
.
setCache
(
key
,
1
,
3600
L
);
new
SyncDepartmentThread
(
this
,
editDepartment
,
delDepartmentIds
,
addDepartment
,
key
).
start
();
new
SyncDepartmentThread
(
this
,
editDepartment
,
delDepartmentIds
,
addDepartment
,
key
).
start
();
// if(StringUtils.isNotBlank(addDepartment)) {
// List<DepartmentAddQO> list = JSONArray.parseArray(addDepartment, DepartmentAddQO.class);
// int sort = 0;
// int maxSort = list.size();
// for (DepartmentAddQO departmentAddQO : list) {
// String parentId = departmentAddQO.getParentId();
// DepartmentDTO dto = departmentApiService.selectById(parentId);
// if(dto == null || dto.getStatusFlag() == 0) {
// continue;
// }
// if(dto.getIsStore() == 1) {
// continue;
// }
// Integer type = departmentAddQO.getType();
// Integer isStore = 0;
// String storeCode = "";
// if(type != null && type == 3){
// isStore = 1;
// StoreDTO store = storeService.getStore(departmentAddQO.getRelatedId());
// if(store != null){
// storeCode = store.getStoreCode();
// }
// }
// DepartmentDTO department = new DepartmentDTO();
// department.setParentDepartmentId(parentId);
// //department.setWxDepartmentId(dto.getWxDepartmentId());
// department.setWxEnterpriseId(dto.getWxEnterpriseId());
// department.setDepartmentName(departmentAddQO.getDepartmentName());
// department.setChainId(dto.getChainId() + Constant.ID_SEPARATOR + dto.getDepartmentId());
// department.setChainName(dto.getChainName() + Constant.NAME_SEPARATOR + dto.getDepartmentName());
// if(departmentAddQO.getStoreFlag() != null){
// department.setIsStore(departmentAddQO.getStoreFlag());
// }else{
// department.setIsStore(isStore);
// }
// //department.setSort(departmentAddQO.getSort());
// department.setLevel(dto.getLevel() + 1);
// department.setRelatedId(departmentAddQO.getRelatedId());
// department.setRelatedCode(storeCode);
// department.setSort(maxSort - sort);
// HaobanResponse hr = departmentApiService.add(department);
// if(hr.getErrorCode() != 1) {
// continue;
// }
// DepartmentDTO departmentAdd = (DepartmentDTO) hr.getResult();
// String departmentId = departmentAdd.getDepartmentId();
//
// String sonDepartment = departmentAddQO.getChildren();
// handler(sonDepartment,departmentId);
// if(isStore == 1){
// handerStoreClerk(departmentId, departmentAddQO.getRelatedId());
// }
// }
// }
// logger.info("【部门修改】editDepartment={}",editDepartment);
// if(StringUtils.isNotBlank(editDepartment)) {
// List<DepartmentEditQO> list = JSONArray.parseArray(editDepartment, DepartmentEditQO.class);
// int sort = 0;
// int maxSort = list.size();
// logger.info("【部门修改】list={}",JSON.toJSONString(list));
// for (DepartmentEditQO departmentQO : list) {
// String parentId = departmentQO.getParentId();
// DepartmentDTO parent = departmentApiService.selectById(parentId);
// if(parent == null || parent.getStatusFlag() == 0) {
// continue;
// }
// DepartmentDTO department = departmentApiService.selectById(departmentQO.getDepartmentId());
// if(department == null){
// continue;
// }
// department.setParentDepartmentId(parentId);
// department.setWxEnterpriseId(department.getWxEnterpriseId());
// department.setDepartmentName(departmentQO.getDepartmentName());
// department.setChainId(parent.getChainId() + Constant.ID_SEPARATOR + parent.getDepartmentId());
// department.setChainName(parent.getChainName() + Constant.NAME_SEPARATOR + parent.getDepartmentName());
// department.setLevel(parent.getLevel() + 1);
// //department.setSort(departmentQO.getSort());
// department.setSort(maxSort - sort);
// logger.info("【部门修改】department={}",JSON.toJSONString(department));
//
// handerSonDepartment(departmentQO.getCurrDepartment());
// HaobanResponse hr = departmentApiService.edit(department);
//
// String sonDepartment = departmentQO.getChildren();
// handler(sonDepartment,department.getDepartmentId());
//
// }
//
// }
//
// if(StringUtils.isNotBlank(delDepartmentIds)) {
// String[] delIds = delDepartmentIds.split(",");
// for (String string : delIds) {
// DepartmentDTO dto = departmentApiService.selectById(string);
// if(dto == null || dto.getStatusFlag() == 0) {
// continue;
// }
// if(StringUtils.isBlank(dto.getRelatedId())) {
// departmentApiService.del(string);
// }else {
// departmentApiService.recycle(string);
// }
// }
// }
//
return
resultResponse
(
HaoBanErrCode
.
ERR_1
,
key
);
return
resultResponse
(
HaoBanErrCode
.
ERR_1
,
key
);
}
}
@RequestMapping
(
"department-chain"
)
@RequestMapping
(
"department-chain"
)
...
@@ -580,7 +469,7 @@ public class DepartmentContoller extends WebBaseController{
...
@@ -580,7 +469,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
=
Auth
RequestUtil
.
getLoginUser
();
WebLoginDTO
login
=
AuthWeb
RequestUtil
.
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 +723,7 @@ public class DepartmentContoller extends WebBaseController{
...
@@ -834,7 +723,7 @@ public class DepartmentContoller extends WebBaseController{
@RequestMapping
(
"department-search"
)
@RequestMapping
(
"department-search"
)
public
HaobanResponse
departmentSearch
(
String
search
)
{
public
HaobanResponse
departmentSearch
(
String
search
)
{
LoginDTO
login
=
Auth
RequestUtil
.
getLoginUser
();
WebLoginDTO
login
=
AuthWeb
RequestUtil
.
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 +739,7 @@ public class DepartmentContoller extends WebBaseController{
...
@@ -850,7 +739,7 @@ public class DepartmentContoller extends WebBaseController{
*/
*/
@RequestMapping
(
"department-list-cache"
)
@RequestMapping
(
"department-list-cache"
)
public
HaobanResponse
departmentCachelist
()
{
public
HaobanResponse
departmentCachelist
()
{
LoginDTO
login
=
Auth
RequestUtil
.
getLoginUser
();
WebLoginDTO
login
=
AuthWeb
RequestUtil
.
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 @
13af41f4
...
@@ -7,7 +7,10 @@ import com.alibaba.fastjson.JSON;
...
@@ -7,7 +7,10 @@ import com.alibaba.fastjson.JSON;
import
com.alibaba.fastjson.JSONArray
;
import
com.alibaba.fastjson.JSONArray
;
import
com.alibaba.fastjson.JSONObject
;
import
com.alibaba.fastjson.JSONObject
;
import
com.gic.commons.util.ToolUtil
;
import
com.gic.commons.util.ToolUtil
;
import
com.gic.haoban.base.api.common.pojo.dto.WebLoginDTO
;
import
com.gic.haoban.common.anno.IgnoreLogin
;
import
com.gic.haoban.common.anno.IgnoreLogin
;
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.api.dto.LoginDTO
;
import
com.gic.haoban.manage.api.dto.StaffDTO
;
import
com.gic.haoban.manage.api.dto.StaffDTO
;
...
@@ -17,7 +20,6 @@ import com.gic.haoban.manage.api.service.StaffApiService;
...
@@ -17,7 +20,6 @@ import com.gic.haoban.manage.api.service.StaffApiService;
import
com.gic.haoban.manage.api.service.WxApplicationApiService
;
import
com.gic.haoban.manage.api.service.WxApplicationApiService
;
import
com.gic.haoban.manage.api.service.WxEnterpriseApiService
;
import
com.gic.haoban.manage.api.service.WxEnterpriseApiService
;
import
com.gic.haoban.manage.api.service.WxEnterpriseRelatedApiService
;
import
com.gic.haoban.manage.api.service.WxEnterpriseRelatedApiService
;
import
com.gic.haoban.manage.web.auth.AuthRequestUtil
;
import
com.gic.haoban.manage.web.config.Config
;
import
com.gic.haoban.manage.web.config.Config
;
import
com.gic.haoban.manage.web.errCode.HaoBanErrCode
;
import
com.gic.haoban.manage.web.errCode.HaoBanErrCode
;
import
com.gic.redis.data.util.RedisUtil
;
import
com.gic.redis.data.util.RedisUtil
;
...
@@ -104,12 +106,13 @@ public class LoginController extends WebBaseController {
...
@@ -104,12 +106,13 @@ public class LoginController extends WebBaseController {
}
}
loginVO
.
setWxEnterpriseId
(
loginStaff
.
getWxEnterpriseId
());
loginVO
.
setWxEnterpriseId
(
loginStaff
.
getWxEnterpriseId
());
loginVO
.
setStaffDTO
(
loginStaff
);
loginVO
.
setStaffDTO
(
loginStaff
);
AuthRequestUtil
.
setSessionUser
(
loginVO
);
WebLoginDTO
webLoginDTO
=
EntityUtil
.
changeEntityByOrika
(
WebLoginDTO
.
class
,
loginVO
);
AuthWebRequestUtil
.
setSessionUser
(
webLoginDTO
);
String
redirectUri
=
config
.
getHost
()
+
"index"
;
String
redirectUri
=
config
.
getHost
()
+
"index"
;
redirectUri
=
redirectUri
.
replace
(
"haoban-manage3-web"
,
"haoban-3/#"
);
redirectUri
=
redirectUri
.
replace
(
"haoban-manage3-web"
,
"haoban-3/#"
);
String
token
=
ToolUtil
.
randomUUID
()
+
"-"
+
ToolUtil
.
randomStringByTime
();
String
token
=
ToolUtil
.
randomUUID
()
+
"-"
+
ToolUtil
.
randomStringByTime
();
Auth
RequestUtil
.
setAppLoginUser
(
token
,
loginV
O
);
Auth
WebRequestUtil
.
setAppLoginUser
(
token
,
webLoginDT
O
);
try
{
try
{
Cookie
cookie
=
new
Cookie
(
"token"
,
token
);
Cookie
cookie
=
new
Cookie
(
"token"
,
token
);
cookie
.
setPath
(
"/"
);
cookie
.
setPath
(
"/"
);
...
@@ -130,7 +133,7 @@ public class LoginController extends WebBaseController {
...
@@ -130,7 +133,7 @@ public class LoginController extends WebBaseController {
logger
.
info
(
"【好办登录】staff={}"
,
JSON
.
toJSONString
(
staff
));
logger
.
info
(
"【好办登录】staff={}"
,
JSON
.
toJSONString
(
staff
));
loginVO
.
setWxEnterpriseId
(
staff
.
getWxEnterpriseId
());
loginVO
.
setWxEnterpriseId
(
staff
.
getWxEnterpriseId
());
loginVO
.
setStaffDTO
(
staff
);
loginVO
.
setStaffDTO
(
staff
);
Auth
RequestUtil
.
setAppLoginUser
(
token
,
loginVO
);
Auth
WebRequestUtil
.
setAppLoginUser
(
token
,
EntityUtil
.
changeEntityByOrika
(
WebLoginDTO
.
class
,
loginVO
)
);
Cookie
cookie
=
new
Cookie
(
"token"
,
token
);
Cookie
cookie
=
new
Cookie
(
"token"
,
token
);
cookie
.
setPath
(
"/"
);
cookie
.
setPath
(
"/"
);
return
resultResponse
(
HaoBanErrCode
.
ERR_1
,
loginVO
);
return
resultResponse
(
HaoBanErrCode
.
ERR_1
,
loginVO
);
...
@@ -142,11 +145,15 @@ public class LoginController extends WebBaseController {
...
@@ -142,11 +145,15 @@ public class LoginController extends WebBaseController {
* @return res
* @return res
*/
*/
@RequestMapping
(
"get-login-info"
)
@RequestMapping
(
"get-login-info"
)
@Deprecated
public
HaobanResponse
getLoginInfo
()
{
public
HaobanResponse
getLoginInfo
()
{
return
resultResponse
(
HaoBanErrCode
.
ERR_1
,
AuthRequestUtil
.
getLoginUser
());
return
resultResponse
(
HaoBanErrCode
.
ERR_1
,
Auth
Web
RequestUtil
.
getLoginUser
());
}
}
/**
* 好办-扫码登录
* @return
* @throws UnsupportedEncodingException
*/
@RequestMapping
(
"get-login-qrcode"
)
@RequestMapping
(
"get-login-qrcode"
)
public
HaobanResponse
getLoginQrcode
()
throws
UnsupportedEncodingException
{
public
HaobanResponse
getLoginQrcode
()
throws
UnsupportedEncodingException
{
String
corpid
=
config
.
getCorpid
();
String
corpid
=
config
.
getCorpid
();
...
@@ -179,11 +186,12 @@ public class LoginController extends WebBaseController {
...
@@ -179,11 +186,12 @@ public class LoginController extends WebBaseController {
LoginDTO
loginVO
=
new
LoginDTO
();
LoginDTO
loginVO
=
new
LoginDTO
();
loginVO
.
setWxEnterpriseId
(
wxEnterpriseId
);
loginVO
.
setWxEnterpriseId
(
wxEnterpriseId
);
loginVO
.
setStaffDTO
(
staff
);
loginVO
.
setStaffDTO
(
staff
);
AuthRequestUtil
.
setSessionUser
(
loginVO
);
WebLoginDTO
webLoginDTO
=
EntityUtil
.
changeEntityByOrika
(
WebLoginDTO
.
class
,
loginVO
);
AuthWebRequestUtil
.
setSessionUser
(
webLoginDTO
);
String
redirectUri
=
config
.
getHost
()
+
"index"
;
String
redirectUri
=
config
.
getHost
()
+
"index"
;
redirectUri
=
redirectUri
.
replace
(
"haoban-manage3-web"
,
"haoban-3/#"
);
redirectUri
=
redirectUri
.
replace
(
"haoban-manage3-web"
,
"haoban-3/#"
);
String
token
=
ToolUtil
.
randomUUID
()
+
"-"
+
ToolUtil
.
randomStringByTime
();
String
token
=
ToolUtil
.
randomUUID
()
+
"-"
+
ToolUtil
.
randomStringByTime
();
Auth
RequestUtil
.
setAppLoginUser
(
token
,
loginV
O
);
Auth
WebRequestUtil
.
setAppLoginUser
(
token
,
webLoginDT
O
);
try
{
try
{
Cookie
cookie
=
new
Cookie
(
"token"
,
token
);
Cookie
cookie
=
new
Cookie
(
"token"
,
token
);
cookie
.
setPath
(
"/"
);
cookie
.
setPath
(
"/"
);
...
@@ -191,8 +199,7 @@ public class LoginController extends WebBaseController {
...
@@ -191,8 +199,7 @@ public class LoginController extends WebBaseController {
response
.
sendRedirect
(
redirectUri
);
response
.
sendRedirect
(
redirectUri
);
response
.
setHeader
(
"token"
,
token
);
response
.
setHeader
(
"token"
,
token
);
}
catch
(
IOException
e
)
{
}
catch
(
IOException
e
)
{
// TODO Auto-generated catch block
logger
.
error
(
"好办登录失败"
,
e
);
e
.
printStackTrace
();
}
}
return
resultResponse
(
HaoBanErrCode
.
ERR_1
);
return
resultResponse
(
HaoBanErrCode
.
ERR_1
);
}
}
...
@@ -284,8 +291,9 @@ public class LoginController extends WebBaseController {
...
@@ -284,8 +291,9 @@ public class LoginController extends WebBaseController {
String
redirectUri
=
config
.
getHost
()
+
"index"
;
String
redirectUri
=
config
.
getHost
()
+
"index"
;
redirectUri
=
redirectUri
.
replace
(
"haoban-manage3-web"
,
"haoban-3/#"
);
redirectUri
=
redirectUri
.
replace
(
"haoban-manage3-web"
,
"haoban-3/#"
);
String
token
=
ToolUtil
.
randomUUID
()
+
"-"
+
ToolUtil
.
randomStringByTime
();
String
token
=
ToolUtil
.
randomUUID
()
+
"-"
+
ToolUtil
.
randomStringByTime
();
AuthRequestUtil
.
setSessionUser
(
loginDTO
);
WebLoginDTO
webLoginDTO
=
EntityUtil
.
changeEntityByOrika
(
WebLoginDTO
.
class
,
loginDTO
);
AuthRequestUtil
.
setAppLoginUser
(
token
,
loginDTO
);
AuthWebRequestUtil
.
setSessionUser
(
webLoginDTO
);
AuthWebRequestUtil
.
setAppLoginUser
(
token
,
webLoginDTO
);
try
{
try
{
Cookie
cookie
=
new
Cookie
(
"token"
,
token
);
Cookie
cookie
=
new
Cookie
(
"token"
,
token
);
cookie
.
setPath
(
"/"
);
cookie
.
setPath
(
"/"
);
...
@@ -298,8 +306,13 @@ public class LoginController extends WebBaseController {
...
@@ -298,8 +306,13 @@ public class LoginController extends WebBaseController {
return
null
;
return
null
;
}
}
/**
* 登录微信企业列表
* @param random
* @return
*/
@RequestMapping
(
"login-wx-enterprise-list"
)
@RequestMapping
(
"login-wx-enterprise-list"
)
public
HaobanResponse
login
Ou
t
(
String
random
)
{
public
HaobanResponse
login
WxEnterpriseLis
t
(
String
random
)
{
//判断是否存在random
//判断是否存在random
AES
aes
=
SecureUtil
.
aes
(
LOGIN_KEY
.
getBytes
());
AES
aes
=
SecureUtil
.
aes
(
LOGIN_KEY
.
getBytes
());
String
o
=
aes
.
decryptStr
(
random
);
String
o
=
aes
.
decryptStr
(
random
);
...
@@ -321,14 +334,16 @@ public class LoginController extends WebBaseController {
...
@@ -321,14 +334,16 @@ public class LoginController extends WebBaseController {
return
resultResponse
(
HaoBanErrCode
.
ERR_1
,
collect
);
return
resultResponse
(
HaoBanErrCode
.
ERR_1
,
collect
);
}
}
return
resultResponse
(
HaoBanErrCode
.
ERR_1
,
enterpriseDTOList
);
return
resultResponse
(
HaoBanErrCode
.
ERR_1
,
enterpriseDTOList
);
}
}
/**
* 登出
* @return
*/
@RequestMapping
(
"login-out"
)
@RequestMapping
(
"login-out"
)
public
HaobanResponse
loginOut
()
{
public
HaobanResponse
loginOut
()
{
String
token
=
""
;
String
token
=
""
;
Cookie
[]
cookies
=
AuthRequestUtil
.
getRequest
().
getCookies
();
Cookie
[]
cookies
=
Auth
Web
RequestUtil
.
getRequest
().
getCookies
();
if
(
cookies
!=
null
)
{
if
(
cookies
!=
null
)
{
for
(
Cookie
cookie
:
cookies
)
{
for
(
Cookie
cookie
:
cookies
)
{
if
(
cookie
.
getName
().
equals
(
"token"
))
{
if
(
cookie
.
getName
().
equals
(
"token"
))
{
...
...
haoban-manage3-web/src/main/java/com/gic/haoban/manage/web/controller/MaterialController.java
View file @
13af41f4
...
@@ -4,10 +4,14 @@ package com.gic.haoban.manage.web.controller;
...
@@ -4,10 +4,14 @@ package com.gic.haoban.manage.web.controller;
import
com.gic.api.base.commons.Page
;
import
com.gic.api.base.commons.Page
;
import
com.gic.haoban.base.api.common.BasePageInfo
;
import
com.gic.haoban.base.api.common.BasePageInfo
;
import
com.gic.haoban.base.api.common.ServiceResponse
;
import
com.gic.haoban.base.api.common.ServiceResponse
;
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.utils.AuthWebRequestUtil
;
import
com.gic.haoban.common.utils.HaobanResponse
;
import
com.gic.haoban.common.utils.HaobanResponse
;
import
com.gic.haoban.manage.api.dto.*
;
import
com.gic.haoban.manage.api.dto.BatchAddMaterialDTO
;
import
com.gic.haoban.manage.api.dto.MaterialCategoryDTO
;
import
com.gic.haoban.manage.api.dto.MaterialDTO
;
import
com.gic.haoban.manage.api.service.MaterialApiService
;
import
com.gic.haoban.manage.api.service.MaterialApiService
;
import
com.gic.haoban.manage.web.auth.AuthRequestUtil
;
import
com.gic.haoban.manage.web.errCode.HaoBanErrCode
;
import
com.gic.haoban.manage.web.errCode.HaoBanErrCode
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
@@ -32,7 +36,7 @@ public class MaterialController extends WebBaseController {
...
@@ -32,7 +36,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
=
Auth
RequestUtil
.
getLoginUser
();
WebLoginDTO
login
=
AuthWeb
RequestUtil
.
getLoginUser
();
String
wxEnterpriseId
=
login
.
getWxEnterpriseId
();
String
wxEnterpriseId
=
login
.
getWxEnterpriseId
();
materialCategoryDTO
.
setWxEnterpriseId
(
wxEnterpriseId
);
materialCategoryDTO
.
setWxEnterpriseId
(
wxEnterpriseId
);
String
categoryName
=
materialCategoryDTO
.
getCategoryName
();
String
categoryName
=
materialCategoryDTO
.
getCategoryName
();
...
@@ -117,11 +121,11 @@ public class MaterialController extends WebBaseController {
...
@@ -117,11 +121,11 @@ public class MaterialController extends WebBaseController {
*/
*/
@RequestMapping
(
"/material-add"
)
@RequestMapping
(
"/material-add"
)
public
HaobanResponse
materialAdd
(
MaterialDTO
materialDTO
)
{
public
HaobanResponse
materialAdd
(
MaterialDTO
materialDTO
)
{
LoginDTO
login
=
Auth
RequestUtil
.
getLoginUser
();
WebLoginDTO
login
=
AuthWeb
RequestUtil
.
getLoginUser
();
String
wxEnterpriseId
=
login
.
getWxEnterpriseId
();
String
wxEnterpriseId
=
login
.
getWxEnterpriseId
();
materialDTO
.
setWxEnterpriseId
(
wxEnterpriseId
);
materialDTO
.
setWxEnterpriseId
(
wxEnterpriseId
);
StaffDTO
staff
=
login
.
getStaffDTO
();
Web
StaffDTO
staff
=
login
.
getStaffDTO
();
materialDTO
.
setStaffId
(
staff
.
getStaffId
());
materialDTO
.
setStaffId
(
staff
.
getStaffId
());
materialDTO
.
setStaffName
(
staff
.
getStaffName
());
materialDTO
.
setStaffName
(
staff
.
getStaffName
());
String
materialTitle
=
materialDTO
.
getMaterialTitle
();
String
materialTitle
=
materialDTO
.
getMaterialTitle
();
...
@@ -149,9 +153,9 @@ public class MaterialController extends WebBaseController {
...
@@ -149,9 +153,9 @@ 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
=
Auth
RequestUtil
.
getLoginUser
();
WebLoginDTO
login
=
AuthWeb
RequestUtil
.
getLoginUser
();
material
.
setWxEnterpriseId
(
login
.
getWxEnterpriseId
());
material
.
setWxEnterpriseId
(
login
.
getWxEnterpriseId
());
StaffDTO
staff
=
login
.
getStaffDTO
();
Web
StaffDTO
staff
=
login
.
getStaffDTO
();
material
.
setStaffId
(
staff
.
getStaffId
());
material
.
setStaffId
(
staff
.
getStaffId
());
material
.
setStaffName
(
staff
.
getStaffName
());
material
.
setStaffName
(
staff
.
getStaffName
());
if
(
StringUtils
.
isAnyBlank
(
material
.
getCategoryId
(),
material
.
getMaterialTitle
())
if
(
StringUtils
.
isAnyBlank
(
material
.
getCategoryId
(),
material
.
getMaterialTitle
())
...
@@ -180,9 +184,9 @@ public class MaterialController extends WebBaseController {
...
@@ -180,9 +184,9 @@ public class MaterialController extends WebBaseController {
*/
*/
@RequestMapping
(
"/material-edit"
)
@RequestMapping
(
"/material-edit"
)
public
HaobanResponse
materialEdit
(
MaterialDTO
materialDTO
)
{
public
HaobanResponse
materialEdit
(
MaterialDTO
materialDTO
)
{
LoginDTO
login
=
Auth
RequestUtil
.
getLoginUser
();
WebLoginDTO
login
=
AuthWeb
RequestUtil
.
getLoginUser
();
StaffDTO
staff
=
login
.
getStaffDTO
();
Web
StaffDTO
staff
=
login
.
getStaffDTO
();
materialDTO
.
setStaffId
(
staff
.
getStaffId
());
materialDTO
.
setStaffId
(
staff
.
getStaffId
());
materialDTO
.
setStaffName
(
staff
.
getStaffName
());
materialDTO
.
setStaffName
(
staff
.
getStaffName
());
String
materialId
=
materialDTO
.
getMaterialId
();
String
materialId
=
materialDTO
.
getMaterialId
();
...
@@ -248,7 +252,7 @@ public class MaterialController extends WebBaseController {
...
@@ -248,7 +252,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
=
Auth
RequestUtil
.
getLoginUser
();
WebLoginDTO
login
=
AuthWeb
RequestUtil
.
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 @
13af41f4
...
@@ -14,13 +14,15 @@ import com.gic.enterprise.api.service.EnterpriseService;
...
@@ -14,13 +14,15 @@ import com.gic.enterprise.api.service.EnterpriseService;
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.ServiceResponse
;
import
com.gic.haoban.base.api.common.ServiceResponse
;
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.utils.AuthWebRequestUtil
;
import
com.gic.haoban.common.utils.EntityUtil
;
import
com.gic.haoban.common.utils.EntityUtil
;
import
com.gic.haoban.common.utils.HaobanResponse
;
import
com.gic.haoban.common.utils.HaobanResponse
;
import
com.gic.haoban.common.utils.PageUtil
;
import
com.gic.haoban.common.utils.PageUtil
;
import
com.gic.haoban.manage.api.dto.*
;
import
com.gic.haoban.manage.api.dto.*
;
import
com.gic.haoban.manage.api.enums.ChannelCodeEnum
;
import
com.gic.haoban.manage.api.enums.ChannelCodeEnum
;
import
com.gic.haoban.manage.api.service.*
;
import
com.gic.haoban.manage.api.service.*
;
import
com.gic.haoban.manage.web.auth.AuthRequestUtil
;
import
com.gic.haoban.manage.web.errCode.HaoBanErrCode
;
import
com.gic.haoban.manage.web.errCode.HaoBanErrCode
;
import
com.gic.haoban.manage.web.qo.StaffEditJsonQO
;
import
com.gic.haoban.manage.web.qo.StaffEditJsonQO
;
import
com.gic.haoban.manage.web.vo.ClerkInfoVo
;
import
com.gic.haoban.manage.web.vo.ClerkInfoVo
;
...
@@ -82,7 +84,7 @@ public class StaffController extends WebBaseController {
...
@@ -82,7 +84,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
=
Auth
RequestUtil
.
getLoginUser
();
WebLoginDTO
login
=
AuthWeb
RequestUtil
.
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 +134,7 @@ public class StaffController extends WebBaseController {
...
@@ -132,7 +134,7 @@ public class StaffController extends WebBaseController {
Integer
relationFlag
,
Integer
relationFlag
,
String
keyWord
,
String
keyWord
,
BasePageInfo
pageInfo
)
{
BasePageInfo
pageInfo
)
{
LoginDTO
login
=
Auth
RequestUtil
.
getLoginUser
();
WebLoginDTO
login
=
AuthWeb
RequestUtil
.
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,8 +323,8 @@ public class StaffController extends WebBaseController {
...
@@ -321,8 +323,8 @@ 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
=
Auth
RequestUtil
.
getLoginUser
();
WebLoginDTO
login
=
AuthWeb
RequestUtil
.
getLoginUser
();
StaffDTO
staffDTO
=
login
.
getStaffDTO
();
Web
StaffDTO
staffDTO
=
login
.
getStaffDTO
();
if
(
staffDTO
==
null
)
{
if
(
staffDTO
==
null
)
{
logger
.
info
(
"登录异常"
);
logger
.
info
(
"登录异常"
);
return
resultResponse
(
HaoBanErrCode
.
ERR_4
);
return
resultResponse
(
HaoBanErrCode
.
ERR_4
);
...
@@ -337,7 +339,6 @@ public class StaffController extends WebBaseController {
...
@@ -337,7 +339,6 @@ public class StaffController extends WebBaseController {
//获取门店详情
//获取门店详情
public
boolean
isEnterpriseOver
(
String
eid
)
{
public
boolean
isEnterpriseOver
(
String
eid
)
{
com
.
gic
.
enterprise
.
api
.
dto
.
EnterpriseDTO
enterprise
=
enterpriseService
.
getEnterpriseByEid
(
eid
);
com
.
gic
.
enterprise
.
api
.
dto
.
EnterpriseDTO
enterprise
=
enterpriseService
.
getEnterpriseByEid
(
eid
);
if
(
enterprise
==
null
)
{
if
(
enterprise
==
null
)
{
return
true
;
return
true
;
...
@@ -345,9 +346,12 @@ public class StaffController extends WebBaseController {
...
@@ -345,9 +346,12 @@ public class StaffController extends WebBaseController {
if
(
enterprise
.
getExpireTime
()
==
null
)
{
if
(
enterprise
.
getExpireTime
()
==
null
)
{
if
(
enterprise
.
getEnabledState
()
==
null
)
{
if
(
enterprise
.
getEnabledState
()
==
null
)
{
return
false
;
return
false
;
}
else
return
enterprise
.
getEnabledState
()
!=
1
;
}
else
{
}
else
return
enterprise
.
getEnabledState
()
!=
1
;
}
}
else
{
return
enterprise
.
getExpireTime
().
getTime
()
<=
System
.
currentTimeMillis
()
||
enterprise
.
getEnabledState
()
!=
1
;
return
enterprise
.
getExpireTime
().
getTime
()
<=
System
.
currentTimeMillis
()
||
enterprise
.
getEnabledState
()
!=
1
;
}
}
}
...
@@ -359,7 +363,7 @@ public class StaffController extends WebBaseController {
...
@@ -359,7 +363,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
=
Auth
RequestUtil
.
getLoginUser
();
WebLoginDTO
login
=
AuthWeb
RequestUtil
.
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,8 +419,8 @@ public class StaffController extends WebBaseController {
...
@@ -415,8 +419,8 @@ 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
=
Auth
RequestUtil
.
getLoginUser
();
WebLoginDTO
login
=
AuthWeb
RequestUtil
.
getLoginUser
();
StaffDTO
loginStaffDTO
=
login
.
getStaffDTO
();
Web
StaffDTO
loginStaffDTO
=
login
.
getStaffDTO
();
if
(
null
==
loginStaffDTO
)
{
if
(
null
==
loginStaffDTO
)
{
return
resultResponse
(
HaoBanErrCode
.
ERR_4
);
return
resultResponse
(
HaoBanErrCode
.
ERR_4
);
}
}
...
@@ -459,8 +463,8 @@ public class StaffController extends WebBaseController {
...
@@ -459,8 +463,8 @@ 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
=
Auth
RequestUtil
.
getLoginUser
();
WebLoginDTO
login
=
AuthWeb
RequestUtil
.
getLoginUser
();
StaffDTO
loginStaffDTO
=
login
.
getStaffDTO
();
Web
StaffDTO
loginStaffDTO
=
login
.
getStaffDTO
();
if
(
null
==
loginStaffDTO
)
{
if
(
null
==
loginStaffDTO
)
{
return
resultResponse
(
HaoBanErrCode
.
ERR_4
);
return
resultResponse
(
HaoBanErrCode
.
ERR_4
);
}
}
...
@@ -478,7 +482,7 @@ public class StaffController extends WebBaseController {
...
@@ -478,7 +482,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
=
Auth
RequestUtil
.
getLoginUser
();
WebLoginDTO
login
=
AuthWeb
RequestUtil
.
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 @
13af41f4
...
@@ -3,10 +3,14 @@ package com.gic.haoban.manage.web.controller;
...
@@ -3,10 +3,14 @@ package com.gic.haoban.manage.web.controller;
import
com.alibaba.fastjson.JSONObject
;
import
com.alibaba.fastjson.JSONObject
;
import
com.gic.api.base.commons.Page
;
import
com.gic.api.base.commons.Page
;
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.WebStaffDTO
;
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.*
;
import
com.gic.haoban.manage.api.dto.PreDealLogInfoDTO
;
import
com.gic.haoban.manage.api.dto.SyncCheckDTO
;
import
com.gic.haoban.manage.api.dto.SyncTaskDTO
;
import
com.gic.haoban.manage.api.service.DealSyncOperationApiService
;
import
com.gic.haoban.manage.api.service.DealSyncOperationApiService
;
import
com.gic.haoban.manage.web.auth.AuthRequestUtil
;
import
com.gic.haoban.manage.web.errCode.HaoBanErrCode
;
import
com.gic.haoban.manage.web.errCode.HaoBanErrCode
;
import
com.gic.haoban.manage.web.qo.SyncDealQO
;
import
com.gic.haoban.manage.web.qo.SyncDealQO
;
import
com.gic.redis.data.util.RedisUtil
;
import
com.gic.redis.data.util.RedisUtil
;
...
@@ -39,7 +43,7 @@ public class SyncDealContoller extends WebBaseController {
...
@@ -39,7 +43,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
=
Auth
RequestUtil
.
getLoginUser
();
WebLoginDTO
login
=
AuthWeb
RequestUtil
.
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 +62,7 @@ public class SyncDealContoller extends WebBaseController {
...
@@ -58,7 +62,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
=
Auth
RequestUtil
.
getLoginUser
();
WebLoginDTO
login
=
AuthWeb
RequestUtil
.
getLoginUser
();
String
wxEnterpriseId
=
login
.
getWxEnterpriseId
();
String
wxEnterpriseId
=
login
.
getWxEnterpriseId
();
logger
.
info
(
"login:{}"
,
JSONObject
.
toJSONString
(
login
));
logger
.
info
(
"login:{}"
,
JSONObject
.
toJSONString
(
login
));
...
@@ -68,7 +72,7 @@ public class SyncDealContoller extends WebBaseController {
...
@@ -68,7 +72,7 @@ public class SyncDealContoller extends WebBaseController {
if
(
null
!=
taskLock
)
{
if
(
null
!=
taskLock
)
{
return
resultResponse
(
HaoBanErrCode
.
ERR_10011
);
return
resultResponse
(
HaoBanErrCode
.
ERR_10011
);
}
}
StaffDTO
staffDTO
=
login
.
getStaffDTO
();
Web
StaffDTO
staffDTO
=
login
.
getStaffDTO
();
String
staffId
=
"admin"
;
String
staffId
=
"admin"
;
if
(
null
!=
staffDTO
)
{
if
(
null
!=
staffDTO
)
{
staffId
=
staffDTO
.
getStaffId
();
staffId
=
staffDTO
.
getStaffId
();
...
@@ -93,7 +97,7 @@ public class SyncDealContoller extends WebBaseController {
...
@@ -93,7 +97,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
=
Auth
RequestUtil
.
getLoginUser
();
WebLoginDTO
login
=
AuthWeb
RequestUtil
.
getLoginUser
();
wxEnterpriseId
=
login
.
getWxEnterpriseId
();
wxEnterpriseId
=
login
.
getWxEnterpriseId
();
}
}
SyncCheckDTO
taskCheck
=
dealSyncOperationApiService
.
getTaskCheck
(
wxEnterpriseId
);
SyncCheckDTO
taskCheck
=
dealSyncOperationApiService
.
getTaskCheck
(
wxEnterpriseId
);
...
@@ -109,7 +113,7 @@ public class SyncDealContoller extends WebBaseController {
...
@@ -109,7 +113,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
=
Auth
RequestUtil
.
getLoginUser
();
WebLoginDTO
login
=
AuthWeb
RequestUtil
.
getLoginUser
();
wxEnterpriseId
=
login
.
getWxEnterpriseId
();
wxEnterpriseId
=
login
.
getWxEnterpriseId
();
}
}
SyncCheckDTO
taskCheck
=
dealSyncOperationApiService
.
getTaskCheck
(
wxEnterpriseId
);
SyncCheckDTO
taskCheck
=
dealSyncOperationApiService
.
getTaskCheck
(
wxEnterpriseId
);
...
@@ -120,7 +124,7 @@ public class SyncDealContoller extends WebBaseController {
...
@@ -120,7 +124,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
=
Auth
RequestUtil
.
getLoginUser
();
WebLoginDTO
login
=
AuthWeb
RequestUtil
.
getLoginUser
();
String
wxEnterpriseId
=
login
.
getWxEnterpriseId
();
String
wxEnterpriseId
=
login
.
getWxEnterpriseId
();
taskId
=
dealSyncOperationApiService
.
getTaskLock
(
wxEnterpriseId
);
taskId
=
dealSyncOperationApiService
.
getTaskLock
(
wxEnterpriseId
);
}
}
...
@@ -133,7 +137,7 @@ public class SyncDealContoller extends WebBaseController {
...
@@ -133,7 +137,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
=
Auth
RequestUtil
.
getLoginUser
();
WebLoginDTO
login
=
AuthWeb
RequestUtil
.
getLoginUser
();
wxEnterpriseId
=
login
.
getWxEnterpriseId
();
wxEnterpriseId
=
login
.
getWxEnterpriseId
();
}
}
dealSyncOperationApiService
.
closeTask
(
wxEnterpriseId
);
dealSyncOperationApiService
.
closeTask
(
wxEnterpriseId
);
...
@@ -152,7 +156,7 @@ public class SyncDealContoller extends WebBaseController {
...
@@ -152,7 +156,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
=
Auth
RequestUtil
.
getLoginUser
();
WebLoginDTO
login
=
AuthWeb
RequestUtil
.
getLoginUser
();
wxEnterpriseId
=
login
.
getWxEnterpriseId
();
wxEnterpriseId
=
login
.
getWxEnterpriseId
();
}
}
Page
<
SyncTaskDTO
>
retPage
=
dealSyncOperationApiService
.
listSyncTask
(
wxEnterpriseId
,
pageInfo
);
Page
<
SyncTaskDTO
>
retPage
=
dealSyncOperationApiService
.
listSyncTask
(
wxEnterpriseId
,
pageInfo
);
...
@@ -171,7 +175,7 @@ public class SyncDealContoller extends WebBaseController {
...
@@ -171,7 +175,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
=
Auth
RequestUtil
.
getLoginUser
();
WebLoginDTO
login
=
AuthWeb
RequestUtil
.
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/WxEnterpriseController.java
View file @
13af41f4
...
@@ -12,7 +12,10 @@ import com.gic.enterprise.api.service.EnterpriseService;
...
@@ -12,7 +12,10 @@ import com.gic.enterprise.api.service.EnterpriseService;
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.ServiceResponse
;
import
com.gic.haoban.base.api.common.ServiceResponse
;
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.IgnoreLogin
;
import
com.gic.haoban.common.anno.IgnoreLogin
;
import
com.gic.haoban.common.utils.AuthWebRequestUtil
;
import
com.gic.haoban.common.utils.EntityUtil
;
import
com.gic.haoban.common.utils.EntityUtil
;
import
com.gic.haoban.common.utils.HaobanResponse
;
import
com.gic.haoban.common.utils.HaobanResponse
;
import
com.gic.haoban.manage.api.dto.DepartmentDTO
;
import
com.gic.haoban.manage.api.dto.DepartmentDTO
;
...
@@ -20,7 +23,6 @@ import com.gic.haoban.manage.api.dto.*;
...
@@ -20,7 +23,6 @@ import com.gic.haoban.manage.api.dto.*;
import
com.gic.haoban.manage.api.enums.ChannelCodeEnum
;
import
com.gic.haoban.manage.api.enums.ChannelCodeEnum
;
import
com.gic.haoban.manage.api.enums.SecretTypeEnum
;
import
com.gic.haoban.manage.api.enums.SecretTypeEnum
;
import
com.gic.haoban.manage.api.service.*
;
import
com.gic.haoban.manage.api.service.*
;
import
com.gic.haoban.manage.web.auth.AuthRequestUtil
;
import
com.gic.haoban.manage.web.config.Config
;
import
com.gic.haoban.manage.web.config.Config
;
import
com.gic.haoban.manage.web.errCode.HaoBanErrCode
;
import
com.gic.haoban.manage.web.errCode.HaoBanErrCode
;
import
com.gic.haoban.manage.web.qo.MiniprogramSettingQo
;
import
com.gic.haoban.manage.web.qo.MiniprogramSettingQo
;
...
@@ -78,7 +80,7 @@ public class WxEnterpriseController extends WebBaseController {
...
@@ -78,7 +80,7 @@ public class WxEnterpriseController extends WebBaseController {
//授权企业列表
//授权企业列表
@RequestMapping
(
"wxa-enterprise-list"
)
@RequestMapping
(
"wxa-enterprise-list"
)
public
HaobanResponse
wxEnterpriseList
()
{
public
HaobanResponse
wxEnterpriseList
()
{
LoginDTO
login
=
Auth
RequestUtil
.
getLoginUser
();
WebLoginDTO
login
=
AuthWeb
RequestUtil
.
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 +108,7 @@ public class WxEnterpriseController extends WebBaseController {
...
@@ -106,7 +108,7 @@ public class WxEnterpriseController extends WebBaseController {
//授权企业列表
//授权企业列表
@RequestMapping
(
"wx-enterprise-list"
)
@RequestMapping
(
"wx-enterprise-list"
)
public
HaobanResponse
wxaEnterpriseList
()
{
public
HaobanResponse
wxaEnterpriseList
()
{
LoginDTO
login
=
Auth
RequestUtil
.
getLoginUser
();
WebLoginDTO
login
=
AuthWeb
RequestUtil
.
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,9 +200,9 @@ public class WxEnterpriseController extends WebBaseController {
...
@@ -198,9 +200,9 @@ 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
=
Auth
RequestUtil
.
getLoginUser
();
WebLoginDTO
login
=
AuthWeb
RequestUtil
.
getLoginUser
();
String
wxEnterpriseId
=
login
.
getWxEnterpriseId
();
String
wxEnterpriseId
=
login
.
getWxEnterpriseId
();
StaffDTO
staff
=
login
.
getStaffDTO
();
Web
StaffDTO
staff
=
login
.
getStaffDTO
();
String
staffId
=
staff
.
getStaffId
();
String
staffId
=
staff
.
getStaffId
();
String
staffName
=
staff
.
getStaffName
();
String
staffName
=
staff
.
getStaffName
();
...
@@ -226,7 +228,7 @@ public class WxEnterpriseController extends WebBaseController {
...
@@ -226,7 +228,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
=
Auth
RequestUtil
.
getLoginUser
();
WebLoginDTO
login
=
AuthWeb
RequestUtil
.
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 +281,7 @@ public class WxEnterpriseController extends WebBaseController {
...
@@ -279,7 +281,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
=
Auth
RequestUtil
.
getLoginUser
();
WebLoginDTO
login
=
AuthWeb
RequestUtil
.
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,13 +306,14 @@ public class WxEnterpriseController extends WebBaseController {
...
@@ -304,13 +306,14 @@ public class WxEnterpriseController extends WebBaseController {
return
resultResponse
(
HaoBanErrCode
.
ERR_2
);
return
resultResponse
(
HaoBanErrCode
.
ERR_2
);
}
}
String
wxEnterpriseId
=
""
;
String
wxEnterpriseId
=
""
;
LoginDTO
login
=
Auth
RequestUtil
.
getLoginUser
();
WebLoginDTO
login
=
AuthWeb
RequestUtil
.
getLoginUser
();
wxEnterpriseId
=
login
.
getWxEnterpriseId
();
wxEnterpriseId
=
login
.
getWxEnterpriseId
();
WxEnterpriseDTO
wxEnterprise
=
wxEnterpriseApiService
.
getOne
(
wxEnterpriseId
);
WxEnterpriseDTO
wxEnterprise
=
wxEnterpriseApiService
.
getOne
(
wxEnterpriseId
);
if
(
wxEnterprise
==
null
)
{
if
(
wxEnterprise
==
null
)
{
return
resultResponse
(
HaoBanErrCode
.
ERR_10012
);
return
resultResponse
(
HaoBanErrCode
.
ERR_10012
);
}
}
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
.
getStaffDTO
()));
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
);
...
@@ -341,7 +344,7 @@ public class WxEnterpriseController extends WebBaseController {
...
@@ -341,7 +344,7 @@ public class WxEnterpriseController extends WebBaseController {
return
resultResponse
(
HaoBanErrCode
.
ERR_2
);
return
resultResponse
(
HaoBanErrCode
.
ERR_2
);
}
}
String
wxEnterpriseId
=
""
;
String
wxEnterpriseId
=
""
;
LoginDTO
login
=
Auth
RequestUtil
.
getLoginUser
();
WebLoginDTO
login
=
AuthWeb
RequestUtil
.
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 +376,7 @@ public class WxEnterpriseController extends WebBaseController {
...
@@ -373,7 +376,7 @@ public class WxEnterpriseController extends WebBaseController {
return
resultResponse
(
HaoBanErrCode
.
ERR_2
);
return
resultResponse
(
HaoBanErrCode
.
ERR_2
);
}
}
String
wxEnterpriseId
=
""
;
String
wxEnterpriseId
=
""
;
LoginDTO
login
=
Auth
RequestUtil
.
getLoginUser
();
WebLoginDTO
login
=
AuthWeb
RequestUtil
.
getLoginUser
();
wxEnterpriseId
=
login
.
getWxEnterpriseId
();
wxEnterpriseId
=
login
.
getWxEnterpriseId
();
WxEnterpriseDTO
wxEnterprise
=
wxEnterpriseApiService
.
getOne
(
wxEnterpriseId
);
WxEnterpriseDTO
wxEnterprise
=
wxEnterpriseApiService
.
getOne
(
wxEnterpriseId
);
if
(
wxEnterprise
==
null
)
{
if
(
wxEnterprise
==
null
)
{
...
@@ -408,7 +411,7 @@ public class WxEnterpriseController extends WebBaseController {
...
@@ -408,7 +411,7 @@ public class WxEnterpriseController extends WebBaseController {
}
}
}
}
private
String
getWxUserId
(
String
wxEnterpriseId
,
StaffDTO
loginStaffDTO
)
{
private
String
getWxUserId
(
String
wxEnterpriseId
,
Web
StaffDTO
loginStaffDTO
)
{
if
(
loginStaffDTO
!=
null
&&
(!
StringUtils
.
isEmpty
(
loginStaffDTO
.
getWxUserId
())))
{
if
(
loginStaffDTO
!=
null
&&
(!
StringUtils
.
isEmpty
(
loginStaffDTO
.
getWxUserId
())))
{
return
loginStaffDTO
.
getWxUserId
();
return
loginStaffDTO
.
getWxUserId
();
}
}
...
@@ -426,7 +429,7 @@ public class WxEnterpriseController extends WebBaseController {
...
@@ -426,7 +429,7 @@ public class WxEnterpriseController extends WebBaseController {
return
resultResponse
(
HaoBanErrCode
.
ERR_2
);
return
resultResponse
(
HaoBanErrCode
.
ERR_2
);
}
}
String
wxEnterpriseId
=
""
;
String
wxEnterpriseId
=
""
;
LoginDTO
login
=
Auth
RequestUtil
.
getLoginUser
();
WebLoginDTO
login
=
AuthWeb
RequestUtil
.
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 +465,7 @@ public class WxEnterpriseController extends WebBaseController {
...
@@ -462,7 +465,7 @@ public class WxEnterpriseController extends WebBaseController {
@RequestMapping
(
"secret-list"
)
@RequestMapping
(
"secret-list"
)
public
HaobanResponse
secretList
()
{
public
HaobanResponse
secretList
()
{
String
wxEnterpriseId
=
""
;
String
wxEnterpriseId
=
""
;
LoginDTO
login
=
Auth
RequestUtil
.
getLoginUser
();
WebLoginDTO
login
=
AuthWeb
RequestUtil
.
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 +521,7 @@ public class WxEnterpriseController extends WebBaseController {
...
@@ -518,7 +521,7 @@ public class WxEnterpriseController extends WebBaseController {
*/
*/
@RequestMapping
(
"/fresh-wx-friend"
)
@RequestMapping
(
"/fresh-wx-friend"
)
public
HaobanResponse
freshWxFriend
()
{
public
HaobanResponse
freshWxFriend
()
{
LoginDTO
login
=
Auth
RequestUtil
.
getLoginUser
();
WebLoginDTO
login
=
AuthWeb
RequestUtil
.
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 +560,7 @@ public class WxEnterpriseController extends WebBaseController {
...
@@ -557,7 +560,7 @@ public class WxEnterpriseController extends WebBaseController {
*/
*/
@RequestMapping
(
"/get-fresh-detail"
)
@RequestMapping
(
"/get-fresh-detail"
)
public
HaobanResponse
getFreshDetail
()
{
public
HaobanResponse
getFreshDetail
()
{
LoginDTO
login
=
Auth
RequestUtil
.
getLoginUser
();
WebLoginDTO
login
=
AuthWeb
RequestUtil
.
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 +578,7 @@ public class WxEnterpriseController extends WebBaseController {
...
@@ -575,7 +578,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
=
Auth
RequestUtil
.
getLoginUser
();
WebLoginDTO
login
=
AuthWeb
RequestUtil
.
getLoginUser
();
String
wxEnterpriseId
=
login
.
getWxEnterpriseId
();
String
wxEnterpriseId
=
login
.
getWxEnterpriseId
();
WxEnterpriseRelationDetailDTO
bindInfo
=
wxEnterpriseRelatedApiService
.
getEnterpriseBindInfo
(
wxEnterpriseId
,
enterpriseId
);
WxEnterpriseRelationDetailDTO
bindInfo
=
wxEnterpriseRelatedApiService
.
getEnterpriseBindInfo
(
wxEnterpriseId
,
enterpriseId
);
...
@@ -591,7 +594,7 @@ public class WxEnterpriseController extends WebBaseController {
...
@@ -591,7 +594,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
=
Auth
RequestUtil
.
getLoginUser
();
WebLoginDTO
login
=
AuthWeb
RequestUtil
.
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 +608,7 @@ public class WxEnterpriseController extends WebBaseController {
...
@@ -605,7 +608,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
=
Auth
RequestUtil
.
getLoginUser
();
WebLoginDTO
login
=
AuthWeb
RequestUtil
.
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 +626,7 @@ public class WxEnterpriseController extends WebBaseController {
...
@@ -623,7 +626,7 @@ public class WxEnterpriseController extends WebBaseController {
*/
*/
@RequestMapping
(
"list-miniprogram-setting"
)
@RequestMapping
(
"list-miniprogram-setting"
)
public
HaobanResponse
miniprogramList
()
{
public
HaobanResponse
miniprogramList
()
{
LoginDTO
login
=
Auth
RequestUtil
.
getLoginUser
();
WebLoginDTO
login
=
AuthWeb
RequestUtil
.
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 +643,7 @@ public class WxEnterpriseController extends WebBaseController {
...
@@ -640,7 +643,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
=
Auth
RequestUtil
.
getLoginUser
();
WebLoginDTO
login
=
AuthWeb
RequestUtil
.
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 +665,7 @@ public class WxEnterpriseController extends WebBaseController {
...
@@ -662,7 +665,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
=
Auth
RequestUtil
.
getLoginUser
();
WebLoginDTO
login
=
AuthWeb
RequestUtil
.
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