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
Expand all
Hide 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;
/**
* Created 2018/7/26.
*
*
新方法 AuthWebRequestUtil
* @author hua
*/
@Deprecated
...
...
@@ -138,7 +138,7 @@ public class AuthRequestUtil {
}
public
static
LoginDTO
getLoginUser
()
{
Cookie
[]
cookies
=
AuthRequestUtil
.
getRequest
().
getCookies
();
Cookie
[]
cookies
=
getRequest
().
getCookies
();
String
token
=
""
;
if
(
cookies
!=
null
)
{
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;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONArray
;
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.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.WxApplicationApiService
;
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.vo.AdminRoleVO
;
import
com.gic.haoban.manage.web.vo.AdminVO
;
...
...
@@ -40,7 +44,7 @@ public class AdminController extends WebBaseController {
@RequestMapping
(
"admin-list"
)
public
HaobanResponse
adminList
()
{
LoginDTO
login
=
Auth
RequestUtil
.
getLoginUser
();
WebLoginDTO
login
=
AuthWeb
RequestUtil
.
getLoginUser
();
String
wxEnterpriseId
=
login
.
getWxEnterpriseId
();
WxApplicationDTO
application
=
wxApplicationApiService
.
selectByWxEnterpriseIdAndApplicationType
(
wxEnterpriseId
,
2
);
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;
import
cn.hutool.core.collection.CollectionUtil
;
import
com.alibaba.fastjson.JSON
;
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.utils.AuthWebRequestUtil
;
import
com.gic.haoban.common.utils.HaobanResponse
;
import
com.gic.haoban.manage.api.dto.*
;
import
com.gic.haoban.manage.api.enums.SecretTypeEnum
;
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.errCode.HaoBanErrCode
;
import
com.gic.redis.data.util.RedisUtil
;
...
...
@@ -52,7 +53,7 @@ public class ApplicationController extends WebBaseController {
@RequestMapping
(
"application-list"
)
public
HaobanResponse
applicationList
()
{
LoginDTO
login
=
Auth
RequestUtil
.
getLoginUser
();
WebLoginDTO
login
=
AuthWeb
RequestUtil
.
getLoginUser
();
String
wxEnterpriseId
=
login
.
getWxEnterpriseId
();
List
<
ApplicationDTO
>
list
=
applicationApiService
.
listApplicationByWxEnterpriseId
(
wxEnterpriseId
);
return
resultResponse
(
HaoBanErrCode
.
ERR_1
,
list
);
...
...
@@ -120,7 +121,7 @@ public class ApplicationController extends WebBaseController {
@RequestMapping
(
"has-bind-contract"
)
public
HaobanResponse
hasBindContract
()
{
LoginDTO
login
=
Auth
RequestUtil
.
getLoginUser
();
WebLoginDTO
login
=
AuthWeb
RequestUtil
.
getLoginUser
();
String
wxEnterpriseId
=
login
.
getWxEnterpriseId
();
WxEnterpriseDTO
enterpriseDTO
=
this
.
wxEnterpriseApiService
.
getOne
(
wxEnterpriseId
);
if
(
enterpriseDTO
!=
null
)
{
...
...
@@ -153,7 +154,7 @@ public class ApplicationController extends WebBaseController {
*/
@RequestMapping
(
"init-wx-department"
)
public
HaobanResponse
initWxDepartment
()
{
LoginDTO
login
=
Auth
RequestUtil
.
getLoginUser
();
WebLoginDTO
login
=
AuthWeb
RequestUtil
.
getLoginUser
();
String
wxEnterpriseId
=
login
.
getWxEnterpriseId
();
WxEnterpriseDTO
enterpriseDTO
=
this
.
wxEnterpriseApiService
.
getOne
(
wxEnterpriseId
);
if
(
enterpriseDTO
!=
null
)
{
...
...
@@ -256,7 +257,7 @@ public class ApplicationController extends WebBaseController {
*/
@RequestMapping
(
"sync-qywx"
)
public
Object
syncQywx
()
{
LoginDTO
login
=
Auth
RequestUtil
.
getLoginUser
();
WebLoginDTO
login
=
AuthWeb
RequestUtil
.
getLoginUser
();
String
wxEnterpriseId
=
login
.
getWxEnterpriseId
();
WxEnterpriseDTO
enterpriseDTO
=
this
.
wxEnterpriseApiService
.
getOne
(
wxEnterpriseId
);
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;
import
com.gic.enterprise.api.dto.StoreDTO
;
import
com.gic.enterprise.api.service.StoreService
;
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.utils.AuthWebRequestUtil
;
import
com.gic.haoban.common.utils.HaobanResponse
;
import
com.gic.haoban.common.utils.UuidUtil
;
import
com.gic.haoban.manage.api.dto.*
;
...
...
@@ -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.AuditSettingApiService
;
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.vo.BatchApproveVO
;
import
com.gic.redis.data.util.RedisUtil
;
...
...
@@ -162,7 +164,7 @@ public class AuditController extends WebBaseController{
if
(
StringUtils
.
isAnyBlank
(
auditIds
,
auditName
)){
return
resultResponse
(
HaoBanErrCode
.
ERR_2
);
}
LoginDTO
login
=
Auth
RequestUtil
.
getLoginUser
();
WebLoginDTO
login
=
AuthWeb
RequestUtil
.
getLoginUser
();
String
staffId
=
login
.
getStaffDTO
().
getStaffId
();
String
staffName
=
login
.
getStaffDTO
().
getStaffName
();
String
[]
s
=
auditIds
.
split
(
","
);
...
...
@@ -171,7 +173,6 @@ public class AuditController extends WebBaseController{
String
batchId
=
UuidUtil
.
randomUUID
();
for
(
String
auditId
:
s
){
String
result
=
auditApiService
.
audit
(
batchId
,
auditId
,
staffName
,
staffId
);
// String result = auditApiService.audit(batchId,auditId,auditName,loginStaffDTO.getStaffId());
if
(
StringUtils
.
isEmpty
(
result
)){
successCount
=
successCount
+
1
;
}
else
{
...
...
@@ -192,7 +193,7 @@ public class AuditController extends WebBaseController{
if
(
StringUtils
.
isAnyBlank
(
auditId
,
auditReason
,
auditName
)){
return
resultResponse
(
HaoBanErrCode
.
ERR_2
);
}
LoginDTO
login
=
Auth
RequestUtil
.
getLoginUser
();
WebLoginDTO
login
=
AuthWeb
RequestUtil
.
getLoginUser
();
String
staffId
=
login
.
getStaffDTO
().
getStaffId
();
String
staffName
=
login
.
getStaffDTO
().
getStaffName
();
auditApiService
.
refuse
(
auditId
,
auditReason
,
staffId
,
staffName
);
...
...
@@ -202,8 +203,8 @@ public class AuditController extends WebBaseController{
@HttpLimit
@RequestMapping
(
"audit"
)
public
HaobanResponse
audit
(
String
auditId
,
String
auditName
)
{
LoginDTO
login
=
Auth
RequestUtil
.
getLoginUser
();
StaffDTO
loginStaffDTO
=
login
.
getStaffDTO
();
WebLoginDTO
login
=
AuthWeb
RequestUtil
.
getLoginUser
();
Web
StaffDTO
loginStaffDTO
=
login
.
getStaffDTO
();
if
(
null
==
loginStaffDTO
)
{
return
resultResponse
(
HaoBanErrCode
.
ERR_4
);
}
...
...
haoban-manage3-web/src/main/java/com/gic/haoban/manage/web/controller/DepartmentContoller.java
View file @
13af41f4
This diff is collapsed.
Click to expand it.
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;
import
com.alibaba.fastjson.JSONArray
;
import
com.alibaba.fastjson.JSONObject
;
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.utils.AuthWebRequestUtil
;
import
com.gic.haoban.common.utils.EntityUtil
;
import
com.gic.haoban.common.utils.HaobanResponse
;
import
com.gic.haoban.manage.api.dto.LoginDTO
;
import
com.gic.haoban.manage.api.dto.StaffDTO
;
...
...
@@ -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.WxEnterpriseApiService
;
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.errCode.HaoBanErrCode
;
import
com.gic.redis.data.util.RedisUtil
;
...
...
@@ -104,12 +106,13 @@ public class LoginController extends WebBaseController {
}
loginVO
.
setWxEnterpriseId
(
loginStaff
.
getWxEnterpriseId
());
loginVO
.
setStaffDTO
(
loginStaff
);
AuthRequestUtil
.
setSessionUser
(
loginVO
);
WebLoginDTO
webLoginDTO
=
EntityUtil
.
changeEntityByOrika
(
WebLoginDTO
.
class
,
loginVO
);
AuthWebRequestUtil
.
setSessionUser
(
webLoginDTO
);
String
redirectUri
=
config
.
getHost
()
+
"index"
;
redirectUri
=
redirectUri
.
replace
(
"haoban-manage3-web"
,
"haoban-3/#"
);
String
token
=
ToolUtil
.
randomUUID
()
+
"-"
+
ToolUtil
.
randomStringByTime
();
Auth
RequestUtil
.
setAppLoginUser
(
token
,
loginV
O
);
Auth
WebRequestUtil
.
setAppLoginUser
(
token
,
webLoginDT
O
);
try
{
Cookie
cookie
=
new
Cookie
(
"token"
,
token
);
cookie
.
setPath
(
"/"
);
...
...
@@ -130,7 +133,7 @@ public class LoginController extends WebBaseController {
logger
.
info
(
"【好办登录】staff={}"
,
JSON
.
toJSONString
(
staff
));
loginVO
.
setWxEnterpriseId
(
staff
.
getWxEnterpriseId
());
loginVO
.
setStaffDTO
(
staff
);
Auth
RequestUtil
.
setAppLoginUser
(
token
,
loginVO
);
Auth
WebRequestUtil
.
setAppLoginUser
(
token
,
EntityUtil
.
changeEntityByOrika
(
WebLoginDTO
.
class
,
loginVO
)
);
Cookie
cookie
=
new
Cookie
(
"token"
,
token
);
cookie
.
setPath
(
"/"
);
return
resultResponse
(
HaoBanErrCode
.
ERR_1
,
loginVO
);
...
...
@@ -142,11 +145,15 @@ public class LoginController extends WebBaseController {
* @return res
*/
@RequestMapping
(
"get-login-info"
)
@Deprecated
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"
)
public
HaobanResponse
getLoginQrcode
()
throws
UnsupportedEncodingException
{
String
corpid
=
config
.
getCorpid
();
...
...
@@ -179,11 +186,12 @@ public class LoginController extends WebBaseController {
LoginDTO
loginVO
=
new
LoginDTO
();
loginVO
.
setWxEnterpriseId
(
wxEnterpriseId
);
loginVO
.
setStaffDTO
(
staff
);
AuthRequestUtil
.
setSessionUser
(
loginVO
);
WebLoginDTO
webLoginDTO
=
EntityUtil
.
changeEntityByOrika
(
WebLoginDTO
.
class
,
loginVO
);
AuthWebRequestUtil
.
setSessionUser
(
webLoginDTO
);
String
redirectUri
=
config
.
getHost
()
+
"index"
;
redirectUri
=
redirectUri
.
replace
(
"haoban-manage3-web"
,
"haoban-3/#"
);
String
token
=
ToolUtil
.
randomUUID
()
+
"-"
+
ToolUtil
.
randomStringByTime
();
Auth
RequestUtil
.
setAppLoginUser
(
token
,
loginV
O
);
Auth
WebRequestUtil
.
setAppLoginUser
(
token
,
webLoginDT
O
);
try
{
Cookie
cookie
=
new
Cookie
(
"token"
,
token
);
cookie
.
setPath
(
"/"
);
...
...
@@ -191,8 +199,7 @@ public class LoginController extends WebBaseController {
response
.
sendRedirect
(
redirectUri
);
response
.
setHeader
(
"token"
,
token
);
}
catch
(
IOException
e
)
{
// TODO Auto-generated catch block
e
.
printStackTrace
();
logger
.
error
(
"好办登录失败"
,
e
);
}
return
resultResponse
(
HaoBanErrCode
.
ERR_1
);
}
...
...
@@ -284,8 +291,9 @@ public class LoginController extends WebBaseController {
String
redirectUri
=
config
.
getHost
()
+
"index"
;
redirectUri
=
redirectUri
.
replace
(
"haoban-manage3-web"
,
"haoban-3/#"
);
String
token
=
ToolUtil
.
randomUUID
()
+
"-"
+
ToolUtil
.
randomStringByTime
();
AuthRequestUtil
.
setSessionUser
(
loginDTO
);
AuthRequestUtil
.
setAppLoginUser
(
token
,
loginDTO
);
WebLoginDTO
webLoginDTO
=
EntityUtil
.
changeEntityByOrika
(
WebLoginDTO
.
class
,
loginDTO
);
AuthWebRequestUtil
.
setSessionUser
(
webLoginDTO
);
AuthWebRequestUtil
.
setAppLoginUser
(
token
,
webLoginDTO
);
try
{
Cookie
cookie
=
new
Cookie
(
"token"
,
token
);
cookie
.
setPath
(
"/"
);
...
...
@@ -298,8 +306,13 @@ public class LoginController extends WebBaseController {
return
null
;
}
/**
* 登录微信企业列表
* @param random
* @return
*/
@RequestMapping
(
"login-wx-enterprise-list"
)
public
HaobanResponse
login
Ou
t
(
String
random
)
{
public
HaobanResponse
login
WxEnterpriseLis
t
(
String
random
)
{
//判断是否存在random
AES
aes
=
SecureUtil
.
aes
(
LOGIN_KEY
.
getBytes
());
String
o
=
aes
.
decryptStr
(
random
);
...
...
@@ -321,14 +334,16 @@ public class LoginController extends WebBaseController {
return
resultResponse
(
HaoBanErrCode
.
ERR_1
,
collect
);
}
return
resultResponse
(
HaoBanErrCode
.
ERR_1
,
enterpriseDTOList
);
}
/**
* 登出
* @return
*/
@RequestMapping
(
"login-out"
)
public
HaobanResponse
loginOut
()
{
String
token
=
""
;
Cookie
[]
cookies
=
AuthRequestUtil
.
getRequest
().
getCookies
();
Cookie
[]
cookies
=
Auth
Web
RequestUtil
.
getRequest
().
getCookies
();
if
(
cookies
!=
null
)
{
for
(
Cookie
cookie
:
cookies
)
{
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;
import
com.gic.api.base.commons.Page
;
import
com.gic.haoban.base.api.common.BasePageInfo
;
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.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.web.auth.AuthRequestUtil
;
import
com.gic.haoban.manage.web.errCode.HaoBanErrCode
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
...
@@ -32,7 +36,7 @@ public class MaterialController extends WebBaseController {
*/
@RequestMapping
(
"/mateial-add-category"
)
public
HaobanResponse
materialAddCategory
(
MaterialCategoryDTO
materialCategoryDTO
)
{
LoginDTO
login
=
Auth
RequestUtil
.
getLoginUser
();
WebLoginDTO
login
=
AuthWeb
RequestUtil
.
getLoginUser
();
String
wxEnterpriseId
=
login
.
getWxEnterpriseId
();
materialCategoryDTO
.
setWxEnterpriseId
(
wxEnterpriseId
);
String
categoryName
=
materialCategoryDTO
.
getCategoryName
();
...
...
@@ -117,11 +121,11 @@ public class MaterialController extends WebBaseController {
*/
@RequestMapping
(
"/material-add"
)
public
HaobanResponse
materialAdd
(
MaterialDTO
materialDTO
)
{
LoginDTO
login
=
Auth
RequestUtil
.
getLoginUser
();
WebLoginDTO
login
=
AuthWeb
RequestUtil
.
getLoginUser
();
String
wxEnterpriseId
=
login
.
getWxEnterpriseId
();
materialDTO
.
setWxEnterpriseId
(
wxEnterpriseId
);
StaffDTO
staff
=
login
.
getStaffDTO
();
Web
StaffDTO
staff
=
login
.
getStaffDTO
();
materialDTO
.
setStaffId
(
staff
.
getStaffId
());
materialDTO
.
setStaffName
(
staff
.
getStaffName
());
String
materialTitle
=
materialDTO
.
getMaterialTitle
();
...
...
@@ -149,9 +153,9 @@ public class MaterialController extends WebBaseController {
return
resultResponse
(
HaoBanErrCode
.
ERR_2
);
}
BatchAddMaterialDTO
.
Material
material
=
dto
.
getMaterial
();
LoginDTO
login
=
Auth
RequestUtil
.
getLoginUser
();
WebLoginDTO
login
=
AuthWeb
RequestUtil
.
getLoginUser
();
material
.
setWxEnterpriseId
(
login
.
getWxEnterpriseId
());
StaffDTO
staff
=
login
.
getStaffDTO
();
Web
StaffDTO
staff
=
login
.
getStaffDTO
();
material
.
setStaffId
(
staff
.
getStaffId
());
material
.
setStaffName
(
staff
.
getStaffName
());
if
(
StringUtils
.
isAnyBlank
(
material
.
getCategoryId
(),
material
.
getMaterialTitle
())
...
...
@@ -180,9 +184,9 @@ public class MaterialController extends WebBaseController {
*/
@RequestMapping
(
"/material-edit"
)
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
.
setStaffName
(
staff
.
getStaffName
());
String
materialId
=
materialDTO
.
getMaterialId
();
...
...
@@ -248,7 +252,7 @@ public class MaterialController extends WebBaseController {
*/
@RequestMapping
(
"/material-share"
)
public
HaobanResponse
materialShare
(
String
materialIds
,
String
toWxEnterpriseIds
)
{
LoginDTO
login
=
Auth
RequestUtil
.
getLoginUser
();
WebLoginDTO
login
=
AuthWeb
RequestUtil
.
getLoginUser
();
String
[]
wxEids
=
toWxEnterpriseIds
.
split
(
","
);
String
[]
maIds
=
materialIds
.
split
(
","
);
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;
import
com.gic.enterprise.api.service.StoreService
;
import
com.gic.haoban.base.api.common.BasePageInfo
;
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.HaobanResponse
;
import
com.gic.haoban.common.utils.PageUtil
;
import
com.gic.haoban.manage.api.dto.*
;
import
com.gic.haoban.manage.api.enums.ChannelCodeEnum
;
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.qo.StaffEditJsonQO
;
import
com.gic.haoban.manage.web.vo.ClerkInfoVo
;
...
...
@@ -82,7 +84,7 @@ public class StaffController extends WebBaseController {
@RequestMapping
(
"staff-add"
)
public
HaobanResponse
staffAdd
(
StaffDTO
staffDTO
,
String
departmentIds
)
{
LoginDTO
login
=
Auth
RequestUtil
.
getLoginUser
();
WebLoginDTO
login
=
AuthWeb
RequestUtil
.
getLoginUser
();
String
wxEnterpriseId
=
login
.
getWxEnterpriseId
();
String
staffName
=
staffDTO
.
getStaffName
();
String
phoneNumber
=
staffDTO
.
getPhoneNumber
();
...
...
@@ -132,7 +134,7 @@ public class StaffController extends WebBaseController {
Integer
relationFlag
,
String
keyWord
,
BasePageInfo
pageInfo
)
{
LoginDTO
login
=
Auth
RequestUtil
.
getLoginUser
();
WebLoginDTO
login
=
AuthWeb
RequestUtil
.
getLoginUser
();
// 部门
List
<
DepartmentDTO
>
sonDepartmentList
=
departmentApiService
.
listSonByDepartmentIds
(
Lists
.
newArrayList
(
departmentId
),
login
.
getWxEnterpriseId
());
List
<
String
>
departmentIds
=
sonDepartmentList
.
stream
().
map
(
DepartmentDTO:
:
getDepartmentId
).
collect
(
Collectors
.
toList
());
...
...
@@ -321,8 +323,8 @@ public class StaffController extends WebBaseController {
*/
@RequestMapping
(
"del-clerk-relation"
)
public
HaobanResponse
delStaffClerkList
(
String
staffId
,
String
clerkId
)
{
LoginDTO
login
=
Auth
RequestUtil
.
getLoginUser
();
StaffDTO
staffDTO
=
login
.
getStaffDTO
();
WebLoginDTO
login
=
AuthWeb
RequestUtil
.
getLoginUser
();
Web
StaffDTO
staffDTO
=
login
.
getStaffDTO
();
if
(
staffDTO
==
null
)
{
logger
.
info
(
"登录异常"
);
return
resultResponse
(
HaoBanErrCode
.
ERR_4
);
...
...
@@ -337,7 +339,6 @@ public class StaffController extends WebBaseController {
//获取门店详情
public
boolean
isEnterpriseOver
(
String
eid
)
{
com
.
gic
.
enterprise
.
api
.
dto
.
EnterpriseDTO
enterprise
=
enterpriseService
.
getEnterpriseByEid
(
eid
);
if
(
enterprise
==
null
)
{
return
true
;
...
...
@@ -345,9 +346,12 @@ public class StaffController extends WebBaseController {
if
(
enterprise
.
getExpireTime
()
==
null
)
{
if
(
enterprise
.
getEnabledState
()
==
null
)
{
return
false
;
}
else
return
enterprise
.
getEnabledState
()
!=
1
;
}
else
}
else
{
return
enterprise
.
getEnabledState
()
!=
1
;
}
}
else
{
return
enterprise
.
getExpireTime
().
getTime
()
<=
System
.
currentTimeMillis
()
||
enterprise
.
getEnabledState
()
!=
1
;
}
}
...
...
@@ -359,7 +363,7 @@ public class StaffController extends WebBaseController {
*/
@RequestMapping
(
"search-clerk-relation"
)
public
HaobanResponse
staffClerkSearch
(
String
search
)
{
LoginDTO
login
=
Auth
RequestUtil
.
getLoginUser
();
WebLoginDTO
login
=
AuthWeb
RequestUtil
.
getLoginUser
();
String
wxEnterpriseId
=
login
.
getWxEnterpriseId
();
if
(
null
==
wxEnterpriseId
)
{
return
resultResponse
(
HaoBanErrCode
.
ERR_4
);
...
...
@@ -415,8 +419,8 @@ public class StaffController extends WebBaseController {
*/
@RequestMapping
(
"add-clerk-relation"
)
public
HaobanResponse
staffClerkSearch
(
String
staffId
,
String
clerkId
)
{
LoginDTO
login
=
Auth
RequestUtil
.
getLoginUser
();
StaffDTO
loginStaffDTO
=
login
.
getStaffDTO
();
WebLoginDTO
login
=
AuthWeb
RequestUtil
.
getLoginUser
();
Web
StaffDTO
loginStaffDTO
=
login
.
getStaffDTO
();
if
(
null
==
loginStaffDTO
)
{
return
resultResponse
(
HaoBanErrCode
.
ERR_4
);
}
...
...
@@ -459,8 +463,8 @@ public class StaffController extends WebBaseController {
*/
@RequestMapping
(
"staff-clerk-bind-log"
)
public
HaobanResponse
bindLogs
(
String
search
,
String
enterpriseId
,
@RequestParam
(
defaultValue
=
"-1"
)
Integer
optType
,
BasePageInfo
qo
)
{
LoginDTO
login
=
Auth
RequestUtil
.
getLoginUser
();
StaffDTO
loginStaffDTO
=
login
.
getStaffDTO
();
WebLoginDTO
login
=
AuthWeb
RequestUtil
.
getLoginUser
();
Web
StaffDTO
loginStaffDTO
=
login
.
getStaffDTO
();
if
(
null
==
loginStaffDTO
)
{
return
resultResponse
(
HaoBanErrCode
.
ERR_4
);
}
...
...
@@ -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
)
{
List
<
String
>
departmentIdSet
=
new
ArrayList
<>();
departmentIdSet
.
add
(
departmentId
);
LoginDTO
login
=
Auth
RequestUtil
.
getLoginUser
();
WebLoginDTO
login
=
AuthWeb
RequestUtil
.
getLoginUser
();
String
wxEnterpriseId
=
login
.
getWxEnterpriseId
();
List
<
DepartmentDTO
>
relationList
=
departmentApiService
.
listSonByDepartmentIds
(
departmentIdSet
,
wxEnterpriseId
);
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;
import
com.alibaba.fastjson.JSONObject
;
import
com.gic.api.base.commons.Page
;
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.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.web.auth.AuthRequestUtil
;
import
com.gic.haoban.manage.web.errCode.HaoBanErrCode
;
import
com.gic.haoban.manage.web.qo.SyncDealQO
;
import
com.gic.redis.data.util.RedisUtil
;
...
...
@@ -39,7 +43,7 @@ public class SyncDealContoller extends WebBaseController {
task
=
dealSyncOperationApiService
.
createTask
(
wxEid
,
"门店同步"
,
"11111"
,
"部门同步"
);
dealSyncOperationApiService
.
dealDepartment
(
task
,
wxEid
,
qo
.
getAddDepartment
(),
qo
.
getEditDepartment
());
}
else
{
LoginDTO
login
=
Auth
RequestUtil
.
getLoginUser
();
WebLoginDTO
login
=
AuthWeb
RequestUtil
.
getLoginUser
();
String
wxEnterpriseId
=
login
.
getWxEnterpriseId
();
String
key
=
"haoban-sync-department-"
+
wxEnterpriseId
;
if
(
RedisUtil
.
getCache
(
key
)
!=
null
)
{
...
...
@@ -58,7 +62,7 @@ public class SyncDealContoller extends WebBaseController {
public
HaobanResponse
departmentBatchSync
(
@RequestBody
SyncDealQO
qo
)
{
String
task
=
null
;
LoginDTO
login
=
Auth
RequestUtil
.
getLoginUser
();
WebLoginDTO
login
=
AuthWeb
RequestUtil
.
getLoginUser
();
String
wxEnterpriseId
=
login
.
getWxEnterpriseId
();
logger
.
info
(
"login:{}"
,
JSONObject
.
toJSONString
(
login
));
...
...
@@ -68,7 +72,7 @@ public class SyncDealContoller extends WebBaseController {
if
(
null
!=
taskLock
)
{
return
resultResponse
(
HaoBanErrCode
.
ERR_10011
);
}
StaffDTO
staffDTO
=
login
.
getStaffDTO
();
Web
StaffDTO
staffDTO
=
login
.
getStaffDTO
();
String
staffId
=
"admin"
;
if
(
null
!=
staffDTO
)
{
staffId
=
staffDTO
.
getStaffId
();
...
...
@@ -93,7 +97,7 @@ public class SyncDealContoller extends WebBaseController {
@RequestMapping
(
"department-sync-check"
)
public
HaobanResponse
syncSuccess
(
String
wxEnterpriseId
)
{
if
(
StringUtils
.
isBlank
(
wxEnterpriseId
))
{
LoginDTO
login
=
Auth
RequestUtil
.
getLoginUser
();
WebLoginDTO
login
=
AuthWeb
RequestUtil
.
getLoginUser
();
wxEnterpriseId
=
login
.
getWxEnterpriseId
();
}
SyncCheckDTO
taskCheck
=
dealSyncOperationApiService
.
getTaskCheck
(
wxEnterpriseId
);
...
...
@@ -109,7 +113,7 @@ public class SyncDealContoller extends WebBaseController {
@RequestMapping
(
"/test/department-sync-check"
)
public
HaobanResponse
testSyncSuccess
(
String
wxEnterpriseId
)
{
if
(
StringUtils
.
isBlank
(
wxEnterpriseId
))
{
LoginDTO
login
=
Auth
RequestUtil
.
getLoginUser
();
WebLoginDTO
login
=
AuthWeb
RequestUtil
.
getLoginUser
();
wxEnterpriseId
=
login
.
getWxEnterpriseId
();
}
SyncCheckDTO
taskCheck
=
dealSyncOperationApiService
.
getTaskCheck
(
wxEnterpriseId
);
...
...
@@ -120,7 +124,7 @@ public class SyncDealContoller extends WebBaseController {
@ResponseBody
public
HaobanResponse
clerkReSync
(
String
taskId
)
{
if
(
StringUtils
.
isBlank
(
taskId
))
{
LoginDTO
login
=
Auth
RequestUtil
.
getLoginUser
();
WebLoginDTO
login
=
AuthWeb
RequestUtil
.
getLoginUser
();
String
wxEnterpriseId
=
login
.
getWxEnterpriseId
();
taskId
=
dealSyncOperationApiService
.
getTaskLock
(
wxEnterpriseId
);
}
...
...
@@ -133,7 +137,7 @@ public class SyncDealContoller extends WebBaseController {
@ResponseBody
public
HaobanResponse
closeReSync
(
String
wxEnterpriseId
)
{
if
(
StringUtils
.
isBlank
(
wxEnterpriseId
))
{
LoginDTO
login
=
Auth
RequestUtil
.
getLoginUser
();
WebLoginDTO
login
=
AuthWeb
RequestUtil
.
getLoginUser
();
wxEnterpriseId
=
login
.
getWxEnterpriseId
();
}
dealSyncOperationApiService
.
closeTask
(
wxEnterpriseId
);
...
...
@@ -152,7 +156,7 @@ public class SyncDealContoller extends WebBaseController {
@ResponseBody
public
HaobanResponse
syncTask
(
String
wxEnterpriseId
,
BasePageInfo
pageInfo
)
{
if
(
StringUtils
.
isBlank
(
wxEnterpriseId
))
{
LoginDTO
login
=
Auth
RequestUtil
.
getLoginUser
();
WebLoginDTO
login
=
AuthWeb
RequestUtil
.
getLoginUser
();
wxEnterpriseId
=
login
.
getWxEnterpriseId
();
}
Page
<
SyncTaskDTO
>
retPage
=
dealSyncOperationApiService
.
listSyncTask
(
wxEnterpriseId
,
pageInfo
);
...
...
@@ -171,7 +175,7 @@ public class SyncDealContoller extends WebBaseController {
@ResponseBody
public
HaobanResponse
syncTaskDetail
(
String
wxEnterpriseId
,
String
taskId
,
BasePageInfo
pageInfo
)
{
if
(
StringUtils
.
isBlank
(
wxEnterpriseId
))
{
LoginDTO
login
=
Auth
RequestUtil
.
getLoginUser
();
WebLoginDTO
login
=
AuthWeb
RequestUtil
.
getLoginUser
();
wxEnterpriseId
=
login
.
getWxEnterpriseId
();
}
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
This diff is collapsed.
Click to expand it.
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