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
468c0aff
Commit
468c0aff
authored
Feb 27, 2020
by
陶光胜
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'developer' of
http://115.159.76.241/haoban3.0/haoban-manage3.0
into developer
parents
36c4e672
3b82a729
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
101 additions
and
20 deletions
+101
-20
DepartmentDTO.java
...ain/java/com/gic/haoban/manage/api/dto/DepartmentDTO.java
+10
-0
DepartmentApiService.java
...m/gic/haoban/manage/api/service/DepartmentApiService.java
+1
-1
DepartmentService.java
.../gic/haoban/manage/service/service/DepartmentService.java
+1
-1
DepartmentServiceImpl.java
...an/manage/service/service/impl/DepartmentServiceImpl.java
+1
-2
StaffServiceImpl.java
.../haoban/manage/service/service/impl/StaffServiceImpl.java
+4
-0
DepartmentApiServiceImpl.java
...ge/service/service/out/impl/DepartmentApiServiceImpl.java
+46
-3
DepartmentMapper.xml
...e3-service/src/main/resources/mapper/DepartmentMapper.xml
+4
-4
AuthRequestUtil.java
.../java/com/gic/haoban/manage/web/auth/AuthRequestUtil.java
+10
-3
DepartmentContoller.java
...gic/haoban/manage/web/controller/DepartmentContoller.java
+18
-6
HttpLimitInterceptor.java
...c/haoban/manage/web/interceptor/HttpLimitInterceptor.java
+3
-0
WebInterceptor.java
...com/gic/haoban/manage/web/interceptor/WebInterceptor.java
+3
-0
No files found.
haoban-manage3-api/src/main/java/com/gic/haoban/manage/api/dto/DepartmentDTO.java
View file @
468c0aff
...
...
@@ -38,6 +38,8 @@ public class DepartmentDTO implements Serializable {
private
String
wxEnterpriseId
;
private
Integer
type
;
private
String
storeCode
;
private
static
final
long
serialVersionUID
=
1L
;
...
...
@@ -176,6 +178,14 @@ public class DepartmentDTO implements Serializable {
public
void
setType
(
Integer
type
)
{
this
.
type
=
type
;
}
public
String
getStoreCode
()
{
return
storeCode
;
}
public
void
setStoreCode
(
String
storeCode
)
{
this
.
storeCode
=
storeCode
;
}
...
...
haoban-manage3-api/src/main/java/com/gic/haoban/manage/api/service/DepartmentApiService.java
View file @
468c0aff
...
...
@@ -82,7 +82,7 @@ public interface DepartmentApiService {
* 回收站恢复
* @param departmentId
*/
HaobanResponse
repairRecycle
(
String
departmentId
);
HaobanResponse
repairRecycle
(
String
departmentId
,
String
parentId
);
/**
* 获取根节点
* @param wxEnterpriseId
...
...
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/DepartmentService.java
View file @
468c0aff
...
...
@@ -26,7 +26,7 @@ public interface DepartmentService {
Page
<
TabHaobanDepartment
>
pageDepartmentByParams
(
String
wxEnterpriseId
,
String
keyword
,
Integer
storeFlag
,
Integer
recycleFlag
);
void
repairRecycle
(
String
departmentId
);
void
repairRecycle
(
TabHaobanDepartment
tab
);
DepartmentDTO
getRootByEnterpriseId
(
String
wxEnterpriseId
);
...
...
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/impl/DepartmentServiceImpl.java
View file @
468c0aff
...
...
@@ -112,8 +112,7 @@ public class DepartmentServiceImpl implements DepartmentService {
}
@Override
public
void
repairRecycle
(
String
departmentId
)
{
TabHaobanDepartment
tab
=
mapper
.
selectByPrimaryKey
(
departmentId
);
public
void
repairRecycle
(
TabHaobanDepartment
tab
)
{
if
(
tab
!=
null
)
{
tab
.
setRecycleFlag
(
0
);
tab
.
setUpdateTime
(
new
Date
());
...
...
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/impl/StaffServiceImpl.java
View file @
468c0aff
...
...
@@ -3,6 +3,7 @@ package com.gic.haoban.manage.service.service.impl;
import
java.util.Date
;
import
java.util.Set
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
...
...
@@ -36,6 +37,9 @@ public class StaffServiceImpl implements StaffService {
tab
.
setUpdateTime
(
now
);
tab
.
setStaffId
(
StringUtil
.
randomUUID
());
tab
.
setStatusFlag
(
1
);
if
(
StringUtils
.
isBlank
(
tab
.
getStaffId
())){
tab
.
setWxUserId
(
tab
.
getStaffId
());
}
mapper
.
insertSelective
(
tab
);
return
tab
.
getStaffId
();
}
...
...
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/out/impl/DepartmentApiServiceImpl.java
View file @
468c0aff
...
...
@@ -89,7 +89,6 @@ public class DepartmentApiServiceImpl implements DepartmentApiService {
WxEnterpriseDTO
enterpriseDTO
=
wxEnterpriseService
.
selectById
(
department
.
getWxEnterpriseId
());
TabHaobanWxApplication
application
=
wxApplicationService
.
selectByWxEnterpriseIdAndApplicationType
(
department
.
getWxEnterpriseId
(),
1
);
logger
.
info
(
"【部门新增】enterpriseDTO = {}"
,
JSON
.
toJSONString
(
enterpriseDTO
));
logger
.
info
(
"【部门新增】application = {}"
,
JSON
.
toJSONString
(
application
));
if
(
enterpriseDTO
!=
null
)
{
if
(
application
!=
null
)
{
com
.
gic
.
wechat
.
api
.
dto
.
qywx
.
DepartmentDTO
dto
=
new
com
.
gic
.
wechat
.
api
.
dto
.
qywx
.
DepartmentDTO
();
...
...
@@ -198,6 +197,21 @@ public class DepartmentApiServiceImpl implements DepartmentApiService {
public
HaobanResponse
recycle
(
String
departmentId
)
{
HaobanResponse
hr
=
new
HaobanResponse
();
hr
.
setErrorCode
(
1
);
//调微信的新增接口
TabHaobanDepartment
department
=
departmentService
.
selectById
(
departmentId
);
WxEnterpriseDTO
enterpriseDTO
=
wxEnterpriseService
.
selectById
(
department
.
getWxEnterpriseId
());
TabHaobanWxApplication
application
=
wxApplicationService
.
selectByWxEnterpriseIdAndApplicationType
(
department
.
getWxEnterpriseId
(),
1
);
if
(
enterpriseDTO
!=
null
)
{
if
(
application
!=
null
)
{
JSONResponse
jp
=
qywxDepartmentApiService
.
deleteDepartment
(
enterpriseDTO
.
getCorpid
(),
application
.
getSiteId
(),
Integer
.
parseInt
(
department
.
getWxDepartmentId
()));
if
(
jp
.
getErrorCode
()
!=
0
)
{
hr
.
setErrorCode
(
0
);
hr
.
setMessage
(
"微信删除部门失败"
);
return
hr
;
}
}
}
departmentService
.
recycle
(
departmentId
);
return
hr
;
}
...
...
@@ -210,10 +224,39 @@ public class DepartmentApiServiceImpl implements DepartmentApiService {
}
@Override
public
HaobanResponse
repairRecycle
(
String
departmentId
)
{
public
HaobanResponse
repairRecycle
(
String
departmentId
,
String
parentId
)
{
HaobanResponse
hr
=
new
HaobanResponse
();
hr
.
setErrorCode
(
0
);
departmentService
.
repairRecycle
(
departmentId
);
TabHaobanDepartment
tab
=
departmentService
.
selectById
(
departmentId
);
//调微信的新增接口
String
wxDepartmentId
=
""
;
WxEnterpriseDTO
enterpriseDTO
=
wxEnterpriseService
.
selectById
(
tab
.
getWxEnterpriseId
());
TabHaobanWxApplication
application
=
wxApplicationService
.
selectByWxEnterpriseIdAndApplicationType
(
tab
.
getWxEnterpriseId
(),
1
);
logger
.
info
(
"【部门新增】enterpriseDTO = {}"
,
JSON
.
toJSONString
(
enterpriseDTO
));
if
(
enterpriseDTO
!=
null
)
{
if
(
application
!=
null
)
{
com
.
gic
.
wechat
.
api
.
dto
.
qywx
.
DepartmentDTO
dto
=
new
com
.
gic
.
wechat
.
api
.
dto
.
qywx
.
DepartmentDTO
();
dto
.
setCorpid
(
enterpriseDTO
.
getCorpid
());
dto
.
setName
(
tab
.
getDepartmentName
());
dto
.
setOrder
(
tab
.
getSort
());
TabHaobanDepartment
parent
=
departmentService
.
selectById
(
parentId
);
dto
.
setParentid
(
Integer
.
valueOf
(
parent
.
getWxDepartmentId
()));
logger
.
info
(
"【部门新增】corpid() = {},siteId={},dto={}"
,
enterpriseDTO
.
getCorpid
(),
application
.
getSiteId
(),
JSON
.
toJSONString
(
dto
));
JSONResponse
jp
=
qywxDepartmentApiService
.
createDepartment
(
enterpriseDTO
.
getCorpid
(),
application
.
getSiteId
(),
dto
);
logger
.
info
(
"【部门新增】jp = {}"
,
JSON
.
toJSONString
(
jp
));
if
(
jp
.
getErrorCode
()
!=
0
)
{
hr
.
setErrorCode
(
0
);
hr
.
setMessage
(
"微信新增部门失败"
);
return
hr
;
}
wxDepartmentId
=
jp
.
getResult
().
toString
();
tab
.
setWxDepartmentId
(
wxDepartmentId
);
tab
.
setParentDepartmentId
(
parentId
);
logger
.
info
(
"【部门新增】wxDepartmentId = {}"
,
wxDepartmentId
);
}
}
departmentService
.
repairRecycle
(
tab
);
return
hr
;
}
...
...
haoban-manage3-service/src/main/resources/mapper/DepartmentMapper.xml
View file @
468c0aff
...
...
@@ -245,14 +245,14 @@
and wx_enterprise_id = #{wxEnterpriseId}
</if>
<if
test=
"keyword != null and keyword != ''"
>
and department_name like CONCAT('%',#{key
W
ord},'%')
and department_name like CONCAT('%',#{key
w
ord},'%')
</if>
<if
test=
"recycleFlag != null"
>
and recycle_flag = #{recycleFlag}
</if>
<!-- <if test="departmentId != null and departmentId != ''"> --
>
<!-- and department_id = #{departmentId} -->
<!-- </if> --
>
<if
test=
"storeFlag != null"
>
and is_store = #{storeFlag}
</if
>
</select>
<select
id=
"listByDepartmentIds"
resultMap=
"BaseResultMap"
>
...
...
haoban-manage3-web/src/main/java/com/gic/haoban/manage/web/auth/AuthRequestUtil.java
View file @
468c0aff
package
com
.
gic
.
haoban
.
manage
.
web
.
auth
;
import
com.alibaba.fastjson.JSON
;
import
com.gic.haoban.manage.web.vo.LoginVO
;
import
com.gic.redis.data.util.RedisUtil
;
import
org.apache.commons.beanutils.BeanUtils
;
import
org.apache.commons.lang3.StringUtils
;
...
...
@@ -27,12 +29,17 @@ public class AuthRequestUtil {
public
static
final
String
REDIS_FAKE_LOGIN_FLAG_PREFIX
=
"GIC:HAOBAN:HAOBAN_MOBILE_APP:FAKE_LOGIN_TOKEN:"
;
public
static
String
LOGIN_SESSION_KEY
=
"HAOBAN:LOGINUSER"
;
public
static
Object
getSessionUser
()
{
return
getSession
().
getAttribute
(
LOGIN_SESSION_KEY
);
public
static
LoginVO
getSessionUser
()
{
String
json
=
(
String
)
getSession
().
getAttribute
(
LOGIN_SESSION_KEY
);
if
(
StringUtils
.
isBlank
(
json
)){
return
null
;
}
return
JSON
.
parseObject
(
json
,
LoginVO
.
class
);
}
public
static
void
setSessionUser
(
Object
obj
)
{
getSession
().
setAttribute
(
LOGIN_SESSION_KEY
,
obj
);
String
userJson
=
JSON
.
toJSONString
(
obj
);
getSession
().
setAttribute
(
LOGIN_SESSION_KEY
,
userJson
);
}
public
static
void
delSessionUser
()
{
...
...
haoban-manage3-web/src/main/java/com/gic/haoban/manage/web/controller/DepartmentContoller.java
View file @
468c0aff
...
...
@@ -69,7 +69,7 @@ public class DepartmentContoller extends WebBaseController{
}
List
<
DepartmentDTO
>
result
=
page
.
getResult
();
for
(
DepartmentDTO
departmentDTO
:
result
)
{
String
chainId
=
departmentDTO
.
getChainId
();
String
chainId
=
departmentDTO
.
getChainId
()
+
Constant
.
ID_SEPARATOR
+
departmentDTO
.
getDepartmentId
()
;
List
<
DepartmentDTO
>
sonList
=
departmentApiService
.
listByChainId
(
chainId
,
wxEnterpriseId
);
int
staffCount
=
0
;
for
(
DepartmentDTO
departmentDTO2
:
sonList
)
{
...
...
@@ -240,6 +240,9 @@ public class DepartmentContoller extends WebBaseController{
continue
;
}
DepartmentDTO
department
=
departmentApiService
.
selectById
(
departmentQO
.
getDepartmentId
());
if
(
department
==
null
){
continue
;
}
department
.
setParentDepartmentId
(
parentId
);
department
.
setWxEnterpriseId
(
department
.
getWxEnterpriseId
());
department
.
setDepartmentName
(
departmentQO
.
getDepartmentName
());
...
...
@@ -328,8 +331,17 @@ public class DepartmentContoller extends WebBaseController{
String
wxEnterpriseId
=
login
.
getWxEnterpriseId
();
Integer
recycleFlag
=
1
;
Page
<
DepartmentDTO
>
page
=
departmentApiService
.
pageDepartmentByParams
(
pageInfo
,
wxEnterpriseId
,
keyWord
,
storeFlag
,
recycleFlag
);
List
<
DepartmentDTO
>
list
=
page
.
getResult
();
for
(
DepartmentDTO
departmentDTO
:
list
)
{
if
(
departmentDTO
.
getIsStore
()
!=
null
&&
departmentDTO
.
getIsStore
()
==
1
){
StoreDTO
store
=
storeService
.
getStore
(
departmentDTO
.
getRelatedId
());
if
(
store
!=
null
){
departmentDTO
.
setStoreCode
(
store
.
getStoreCode
());
}
}
}
PageResult
<
DepartmentDTO
>
pageVo
=
new
PageResult
<>();
pageVo
.
setList
(
page
.
getResult
()
);
pageVo
.
setList
(
list
);
pageVo
.
setPageNum
(
page
.
getCurrentPage
());
pageVo
.
setPages
(
page
.
getPages
());
pageVo
.
setPageSize
(
page
.
getPageSize
());
...
...
@@ -339,12 +351,12 @@ public class DepartmentContoller extends WebBaseController{
}
@RequestMapping
(
"department-repair"
)
public
HaobanResponse
departmentRepair
(
String
departmentId
)
{
public
HaobanResponse
departmentRepair
(
String
departmentId
,
String
parentId
)
{
DepartmentDTO
dto
=
departmentApiService
.
selectById
(
departmentId
);
if
(
dto
==
null
||
dto
.
getStatusFlag
()
==
0
)
{
return
resultResponse
(
HaoBanErrCode
.
ERR_10003
);
}
departmentApiService
.
repairRecycle
(
departmentId
);
departmentApiService
.
repairRecycle
(
departmentId
,
parentId
);
return
resultResponse
(
HaoBanErrCode
.
ERR_1
);
}
...
...
@@ -376,7 +388,7 @@ public class DepartmentContoller extends WebBaseController{
String
departmentId
=
departmentAddQO
.
getDepartmentId
();
Boolean
addFlag
=
departmentAddQO
.
getAddFlag
();
//在部门下新增部门
if
(
addFlag
==
null
||
addFlag
)
{
if
(
addFlag
!=
null
&&
addFlag
)
{
DepartmentDTO
department
=
new
DepartmentDTO
();
department
.
setParentDepartmentId
(
parentId
);
department
.
setWxEnterpriseId
(
dto
.
getWxEnterpriseId
());
...
...
@@ -405,10 +417,10 @@ public class DepartmentContoller extends WebBaseController{
continue
;
}
department
.
setParentDepartmentId
(
parentId
);
department
.
setParentDepartmentId
(
parentId
);
department
.
setDepartmentName
(
departmentAddQO
.
getDepartmentName
());
department
.
setChainId
(
dto
.
getChainId
()
+
Constant
.
ID_SEPARATOR
+
dto
.
getDepartmentId
());
department
.
setChainName
(
dto
.
getChainName
()
+
Constant
.
NAME_SEPARATOR
+
dto
.
getDepartmentName
());
department
.
setSort
(
departmentAddQO
.
getSort
());
HaobanResponse
hr
=
departmentApiService
.
edit
(
department
);
if
(
hr
.
getErrorCode
()
!=
1
)
{
continue
;
...
...
haoban-manage3-web/src/main/java/com/gic/haoban/manage/web/interceptor/HttpLimitInterceptor.java
View file @
468c0aff
...
...
@@ -46,6 +46,9 @@ public class HttpLimitInterceptor extends HandlerInterceptorAdapter {
logger
.
info
(
"post-url:{}"
,
requestURI
);
Map
<
String
,
String
[]>
parameterMap
=
httpServletRequest
.
getParameterMap
();
logger
.
info
(
"post-params:{}"
,
JSONObject
.
toJSONString
(
parameterMap
));
if
(!(
o
instanceof
HandlerMethod
))
{
return
true
;
}
HandlerMethod
handler
=
(
HandlerMethod
)
o
;
HttpLimit
httpLimit
=
handler
.
getMethodAnnotation
(
HttpLimit
.
class
);
if
(
httpLimit
!=
null
)
{
...
...
haoban-manage3-web/src/main/java/com/gic/haoban/manage/web/interceptor/WebInterceptor.java
View file @
468c0aff
...
...
@@ -58,6 +58,9 @@ public class WebInterceptor extends HandlerInterceptorAdapter {
logger
.
info
(
"post-url:{}"
,
requestURI
);
Map
<
String
,
String
[]>
parameterMap
=
httpServletRequest
.
getParameterMap
();
logger
.
info
(
"post-params:{}"
,
JSONObject
.
toJSONString
(
parameterMap
));
if
(!(
o
instanceof
HandlerMethod
))
{
return
true
;
}
HandlerMethod
handler
=
(
HandlerMethod
)
o
;
IgnoreLogin
ignoreLogin
=
handler
.
getMethodAnnotation
(
IgnoreLogin
.
class
);
if
(
null
!=
ignoreLogin
)
{
...
...
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