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
46dfe5d6
Commit
46dfe5d6
authored
Feb 26, 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
6bdb8c42
f08c2a3b
Hide whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
154 additions
and
35 deletions
+154
-35
StaffApiService.java
...va/com/gic/haoban/manage/api/service/StaffApiService.java
+2
-0
EnterpriseController.java
...ic/haoban/manage/web/controller/EnterpriseController.java
+8
-1
DepartmentMapper.java
...ic/haoban/manage/service/dao/mapper/DepartmentMapper.java
+2
-0
StaffMapper.java
...com/gic/haoban/manage/service/dao/mapper/StaffMapper.java
+3
-0
DepartmentServiceImpl.java
...an/manage/service/service/impl/DepartmentServiceImpl.java
+5
-0
DepartmentApiServiceImpl.java
...ge/service/service/out/impl/DepartmentApiServiceImpl.java
+6
-0
StaffApiServiceImpl.java
.../manage/service/service/out/impl/StaffApiServiceImpl.java
+33
-7
dubbo-haoban-manage-service.xml
...ervice/src/main/resources/dubbo-haoban-manage-service.xml
+2
-0
DepartmentMapper.xml
...e3-service/src/main/resources/mapper/DepartmentMapper.xml
+27
-5
StaffMapper.xml
...manage3-service/src/main/resources/mapper/StaffMapper.xml
+11
-0
DepartmentContoller.java
...gic/haoban/manage/web/controller/DepartmentContoller.java
+30
-11
LoginController.java
...com/gic/haoban/manage/web/controller/LoginController.java
+6
-6
WxEnterpriseController.java
.../haoban/manage/web/controller/WxEnterpriseController.java
+3
-0
DepartmentAddQO.java
...in/java/com/gic/haoban/manage/web/qo/DepartmentAddQO.java
+16
-5
No files found.
haoban-manage3-api/src/main/java/com/gic/haoban/manage/api/service/StaffApiService.java
View file @
46dfe5d6
...
...
@@ -12,6 +12,8 @@ public interface StaffApiService {
public
StaffDTO
selectById
(
String
staffId
);
public
StaffDTO
selectSuperByWxEnterpriseId
(
String
wxEnterpriseId
);
public
List
<
StaffDTO
>
listByIds
(
List
<
String
>
staffIds
);
...
...
haoban-manage3-operation-web/src/main/java/com/gic/haoban/manage/web/controller/EnterpriseController.java
View file @
46dfe5d6
package
com
.
gic
.
haoban
.
manage
.
web
.
controller
;
import
java.io.IOException
;
import
java.util.Date
;
import
java.util.List
;
import
javax.servlet.http.HttpServletResponse
;
...
...
@@ -34,7 +35,13 @@ public class EnterpriseController extends WebBaseController{
public
HaobanResponse
wxEnterpriseList
(
BasePageInfo
pageInfo
,
String
keyword
,
Integer
contactFlag
,
String
version
)
{
Page
<
YwWxEnterpriseDTO
>
page
=
wxEnterpriseApiService
.
list
(
pageInfo
,
keyword
,
contactFlag
,
version
);
PageResult
<
YwWxEnterpriseDTO
>
pageVo
=
new
PageResult
<>();
pageVo
.
setList
(
EntityUtil
.
changeEntityListByJSON
(
YwWxEnterpriseDTO
.
class
,
page
.
getResult
()));
List
<
YwWxEnterpriseDTO
>
list
=
EntityUtil
.
changeEntityListByJSON
(
YwWxEnterpriseDTO
.
class
,
page
.
getResult
());
for
(
YwWxEnterpriseDTO
dto
:
list
){
dto
.
setVersion
(
"3.0"
);
dto
.
setBuyDate
(
new
Date
());
dto
.
setBuyStatus
(
"1"
);
}
pageVo
.
setList
(
list
);
pageVo
.
setPageNum
(
page
.
getCurrentPage
());
pageVo
.
setPages
(
page
.
getPages
());
pageVo
.
setPageSize
(
page
.
getPageSize
());
...
...
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/dao/mapper/DepartmentMapper.java
View file @
46dfe5d6
...
...
@@ -39,6 +39,8 @@ public interface DepartmentMapper {
TabHaobanDepartment
getRootByEnterpriseId
(
@Param
(
"wxEnterpriseId"
)
String
wxEnterpriseId
);
Page
<
TabHaobanDepartment
>
pageFullStoreByWxEnterpriseId
(
@Param
(
"wxEnterpriseId"
)
String
wxEnterpriseId
,
@Param
(
"search"
)
String
search
,
@Param
(
"storeIds"
)
List
<
String
>
storeIds
,
@Param
(
"minCount"
)
int
minCount
);
Page
<
TabHaobanDepartment
>
pageFullStoreByWxEnterpriseId2
(
@Param
(
"wxEnterpriseId"
)
String
wxEnterpriseId
,
@Param
(
"search"
)
String
search
,
@Param
(
"storeIds"
)
List
<
String
>
storeIds
,
@Param
(
"minCount"
)
int
minCount
);
TabHaobanDepartment
getByRelatedId
(
@Param
(
"relatedId"
)
String
relatedId
);
...
...
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/dao/mapper/StaffMapper.java
View file @
46dfe5d6
...
...
@@ -28,4 +28,6 @@ public interface StaffMapper {
Page
<
TabHaobanStaff
>
pageStaff
(
@Param
(
"staffIds"
)
Set
<
String
>
staffIds
,
@Param
(
"activeFlag"
)
Integer
activeFlag
,
@Param
(
"keyword"
)
String
keyword
);
TabHaobanStaff
selectByUserId
(
@Param
(
"userId"
)
String
userId
);
TabHaobanStaff
selectSuperByWxEnterpriseId
(
@Param
(
"wxEnterpriseId"
)
String
wxEnterpriseId
);
}
\ No newline at end of file
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/impl/DepartmentServiceImpl.java
View file @
46dfe5d6
...
...
@@ -43,9 +43,14 @@ public class DepartmentServiceImpl implements DepartmentService {
int
maxSort
=
mapper
.
selectMaxSort
(
department
.
getParentDepartmentId
());
tab
.
setSort
(
maxSort
+
1
);
}
Integer
isStore
=
department
.
getIsStore
();
if
(
isStore
==
null
){
department
.
setIsStore
(
0
);
}
tab
.
setCreateTime
(
now
);
tab
.
setUpdateTime
(
now
);
tab
.
setStatusFlag
(
1
);
tab
.
setRecycleFlag
(
0
);
tab
.
setDepartmentId
(
StringUtil
.
randomUUID
());
mapper
.
insert
(
tab
);
return
tab
.
getDepartmentId
();
...
...
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/out/impl/DepartmentApiServiceImpl.java
View file @
46dfe5d6
...
...
@@ -5,7 +5,10 @@ import java.util.Date;
import
java.util.List
;
import
java.util.Map
;
import
cn.hutool.core.collection.CollectionUtil
;
import
com.gic.haoban.base.api.common.Constant
;
import
org.apache.commons.collections.CollectionUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.slf4j.Logger
;
...
...
@@ -241,6 +244,9 @@ public class DepartmentApiServiceImpl implements DepartmentApiService {
public
Page
<
DepartmentDTO
>
pageFullStoreByWxEnterpriseId
(
String
wxEnterpriseId
,
String
search
,
List
<
String
>
storeIds
,
int
count
,
BasePageInfo
pageInfo
)
{
PageHelper
.
startPage
(
pageInfo
.
getPageNum
(),
pageInfo
.
getPageSize
());
if
(
CollectionUtil
.
isNotEmpty
(
storeIds
)&&
StringUtils
.
isNotEmpty
(
search
)){
return
PageUtil
.
changePageHelperToCurrentPage
(
departmentMapper
.
pageFullStoreByWxEnterpriseId2
(
wxEnterpriseId
,
search
,
storeIds
,
count
),
DepartmentDTO
.
class
);
}
return
PageUtil
.
changePageHelperToCurrentPage
(
departmentMapper
.
pageFullStoreByWxEnterpriseId
(
wxEnterpriseId
,
search
,
storeIds
,
count
),
DepartmentDTO
.
class
);
}
...
...
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/out/impl/StaffApiServiceImpl.java
View file @
46dfe5d6
...
...
@@ -21,6 +21,8 @@ import com.gic.api.base.commons.Page;
import
com.gic.clerk.api.dto.ClerkDTO
;
import
com.gic.clerk.api.service.ClerkService
;
import
com.gic.commons.util.EntityUtil
;
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.common.utils.HaobanResponse
;
import
com.gic.haoban.common.utils.PageUtil
;
...
...
@@ -70,6 +72,8 @@ public class StaffApiServiceImpl implements StaffApiService {
private
ClerkService
clerkService
;
@Autowired
private
com
.
gic
.
enterprise
.
api
.
service
.
DepartmentService
gicDepartmentService
;
@Autowired
private
StoreService
storeService
;
@Override
public
StaffDTO
selectById
(
String
staffId
)
{
...
...
@@ -230,6 +234,7 @@ public class StaffApiServiceImpl implements StaffApiService {
if
(
application
!=
null
)
{
Date
now
=
new
Date
();
UserDTO
user
=
qywxUserApiService
.
getWorkWxUser
(
enterpriseDTO
.
getCorpid
(),
application
.
getSiteId
(),
userId
);
logger
.
info
(
"【新增用户】user={}"
,
JSON
.
toJSONString
(
user
));
TabHaobanStaff
tab
=
new
TabHaobanStaff
();
tab
.
setWxUserId
(
userId
);
tab
.
setCreateTime
(
now
);
...
...
@@ -237,21 +242,26 @@ public class StaffApiServiceImpl implements StaffApiService {
tab
.
setStatusFlag
(
1
);
tab
.
setWxEnterpriseId
(
wxEnterpriseId
);
tab
.
setPhoneNumber
(
user
.
getMobile
());
//tab.setSex(user.getGender());
staffService
.
add
(
tab
);
tab
.
setStaffName
(
user
.
getName
());
tab
.
setNickName
(
user
.
getName
());
tab
.
setNationCode
(
"86"
);
tab
.
setSex
(
Integer
.
parseInt
(
user
.
getGender
()));
String
staffId
=
staffService
.
add
(
tab
);
Integer
[]
departmentId
=
user
.
getDepartment
();
for
(
Integer
integer
:
departmentId
)
{
TabHaobanDepartment
tabDepartment
=
departmentService
.
getByWxId
(
integer
.
toString
(),
wxEnterpriseId
);
if
(
tabDepartment
!=
null
){
TabHaobanStaffDepartmentRelated
tabStaff
=
staffDepartmentRelatedService
.
getDepartmentIdAndStaffId
(
tabDepartment
.
getDepartmentId
(),
tab
.
getStaffId
());
if
(
tabStaff
!
=
null
){
if
(
tabStaff
=
=
null
){
StaffDepartmentRelatedDTO
dto
=
new
StaffDepartmentRelatedDTO
();
dto
.
setPhoneNumber
(
user
.
getMobile
());
dto
.
setWxUserId
(
userId
);
dto
.
setStaffId
(
staffId
);
dto
.
setWxEnterpriseId
(
wxEnterpriseId
);
dto
.
setStatusFlag
(
1
);
dto
.
setDepartmentId
(
tabDepartment
.
getDepartmentId
());
dto
.
setNationCode
(
"86"
);
staffDepartmentRelatedService
.
add
(
dto
);
}
}
...
...
@@ -267,6 +277,7 @@ public class StaffApiServiceImpl implements StaffApiService {
@Override
public
void
staffEdit
(
StaffDTO
staffDTO
,
String
departmentIds
)
{
TabHaobanStaff
oldStaff
=
staffMapper
.
selectByPrimaryKey
(
staffDTO
.
getStaffId
());
logger
.
info
(
"【员工修改】oldStaff={}"
,
JSON
.
toJSONString
(
oldStaff
));
//1、先更新staff
TabHaobanStaff
tab
=
EntityUtil
.
changeEntityByJSON
(
TabHaobanStaff
.
class
,
staffDTO
);
staffService
.
updateByPrimaryKey
(
tab
);
...
...
@@ -302,12 +313,21 @@ public class StaffApiServiceImpl implements StaffApiService {
staffDepartmentRelatedMapper
.
updateByPrimaryKeySelective
(
related
);
}
if
(
org
.
apache
.
commons
.
lang3
.
StringUtils
.
isNoneBlank
(
related
.
getClerkCode
())){
logger
.
info
(
"【员工修改】related={}"
,
JSON
.
toJSONString
(
related
));
if
(
org
.
apache
.
commons
.
lang3
.
StringUtils
.
isNotBlank
(
related
.
getClerkCode
())){
logger
.
info
(
"【员工修改】oldName={},name={}"
,
oldStaff
.
getStaffName
(),
staffDTO
.
getStaffName
());
if
(!
staffDTO
.
getPhoneNumber
().
equals
(
related
.
getPhoneNumber
())||!
staffDTO
.
getStaffName
().
equals
(
oldStaff
.
getStaffName
())){
TabHaobanDepartment
department
=
departmentService
.
selectById
(
addId
);
com
.
gic
.
enterprise
.
api
.
dto
.
DepartmentDTO
dto
=
gicDepartmentService
.
getDeptment
(
department
.
getRelatedId
());
ClerkDTO
clerkDTO
=
clerkService
.
getClerkByCodeNoStatus
(
dto
.
getEnterpriseId
(),
related
.
getClerkCode
());
String
enterpriseId
=
""
;
if
(
department
.
getIsStore
()
==
0
){
com
.
gic
.
enterprise
.
api
.
dto
.
DepartmentDTO
dto
=
gicDepartmentService
.
getDeptment
(
department
.
getRelatedId
());
enterpriseId
=
dto
.
getEnterpriseId
();
}
else
{
StoreDTO
store
=
storeService
.
getStore
(
department
.
getRelatedId
());
enterpriseId
=
store
.
getEnterpriseId
();
}
ClerkDTO
clerkDTO
=
clerkService
.
getClerkByCodeNoStatus
(
enterpriseId
,
related
.
getClerkCode
());
logger
.
info
(
"【员工修改】clerkDTO={}"
,
JSON
.
toJSONString
(
clerkDTO
));
clerkDTO
.
setClerkName
(
staffDTO
.
getStaffName
());
clerkDTO
.
setPhoneNumber
(
staffDTO
.
getPhoneNumber
());
clerkService
.
updateClerk
(
clerkDTO
);
...
...
@@ -382,4 +402,10 @@ public class StaffApiServiceImpl implements StaffApiService {
return
staffDepartmentRelatedService
.
countByDepartmentId
(
departmentId
);
}
@Override
public
StaffDTO
selectSuperByWxEnterpriseId
(
String
wxEnterpriseId
)
{
TabHaobanStaff
tab
=
staffMapper
.
selectSuperByWxEnterpriseId
(
wxEnterpriseId
);
return
EntityUtil
.
changeEntityByJSON
(
StaffDTO
.
class
,
tab
);
}
}
haoban-manage3-service/src/main/resources/dubbo-haoban-manage-service.xml
View file @
46dfe5d6
...
...
@@ -41,6 +41,7 @@
<dubbo:reference
interface=
"com.gic.member.api.service.MemberService"
id=
"memberService"
/>
<dubbo:reference
interface=
"com.gic.enterprise.api.service.StoreService"
id=
"storeService"
/>
</beans>
\ No newline at end of file
haoban-manage3-service/src/main/resources/mapper/DepartmentMapper.xml
View file @
46dfe5d6
...
...
@@ -207,7 +207,7 @@
from tab_haoban_department
where parent_department_id = #{parentId,jdbcType=VARCHAR}
and status_flag = 1
and recycle_flag !=
null
and recycle_flag !=
1
order by sort asc
</select>
...
...
@@ -250,9 +250,9 @@
<if
test=
"recycleFlag != null"
>
and recycle_flag = #{recycleFlag}
</if>
<if
test=
"departmentId != null and departmentId != ''"
>
and department_id = #{departmentId}
</if
>
<!-- <if test="departmentId != null and departmentId != ''"> --
>
<!-- and department_id = #{departmentId} -->
<!-- </if> --
>
</select>
<select
id=
"listByDepartmentIds"
resultMap=
"BaseResultMap"
>
...
...
@@ -313,6 +313,28 @@
order by create_time
) t WHERE t.rownum > #{minCount}
</select>
<select
id=
"pageFullStoreByWxEnterpriseId2"
resultMap=
"BaseResultMap"
>
SELECT
t.*
FROM
(
select
@rownum := @rownum + 1 AS rownum,
<include
refid=
"Base_Column_List"
/>
from tab_haoban_department,
(SELECT(@rowNum := 0)) b
where status_flag = 1
and is_store = 1
and wx_enterprise_id = #{wxEnterpriseId}
and ( wx_department_id like CONCAT('%',#{search},'%')
or related_id IN
<foreach
collection=
"storeIds"
item=
"id"
index=
"index"
open=
"("
close=
")"
separator=
","
>
#{id,jdbcType=VARCHAR}
</foreach>
)
order by create_time
) t WHERE t.rownum > #{minCount}
</select>
<select
id=
"getByRelatedId"
resultMap=
"BaseResultMap"
parameterType=
"java.lang.String"
>
select
...
...
@@ -350,7 +372,7 @@
<select
id=
"departmentRecycleCount"
resultType=
"java.lang.Integer"
parameterType=
"java.lang.String"
>
select
<include
refid=
"Base_Column_List"
/>
count(1)
from tab_haoban_department
where wx_enterprise_id = #{wxEnterpriseId}
and status_flag = 1
...
...
haoban-manage3-service/src/main/resources/mapper/StaffMapper.xml
View file @
46dfe5d6
...
...
@@ -290,4 +290,14 @@
where wx_user_id = #{userId,jdbcType=VARCHAR}
and status_flag = 1
</select>
<select
id=
"selectSuperByWxEnterpriseId"
resultMap=
"BaseResultMap"
parameterType=
"java.lang.String"
>
select
<include
refid=
"Base_Column_List"
/>
from tab_haoban_staff
where status_flag = 1
and wx_enterprise_id = #{wxEnterpriseId}
and super_manager_flag = 1
</select>
</mapper>
\ No newline at end of file
haoban-manage3-web/src/main/java/com/gic/haoban/manage/web/controller/DepartmentContoller.java
View file @
46dfe5d6
...
...
@@ -158,7 +158,7 @@ public class DepartmentContoller extends WebBaseController{
Map
<
String
,
Object
>
map
=
new
HashMap
<
String
,
Object
>();
map
.
put
(
"count"
,
count
);
map
.
put
(
"syncDate"
,
RedisUtil
.
getCache
(
"haoban-sync-department-"
+
wxEnterpriseId
));
return
resultResponse
(
HaoBanErrCode
.
ERR_1
,
count
);
return
resultResponse
(
HaoBanErrCode
.
ERR_1
,
map
);
}
...
...
@@ -198,6 +198,11 @@ public class DepartmentContoller extends WebBaseController{
if
(
dto
.
getIsStore
()
==
1
)
{
continue
;
}
Integer
type
=
departmentAddQO
.
getType
();
Integer
isStore
=
0
;
if
(
type
!=
null
&&
type
==
3
){
isStore
=
1
;
}
DepartmentDTO
department
=
new
DepartmentDTO
();
department
.
setParentDepartmentId
(
parentId
);
//department.setWxDepartmentId(dto.getWxDepartmentId());
...
...
@@ -205,7 +210,11 @@ public class DepartmentContoller extends WebBaseController{
department
.
setDepartmentName
(
departmentAddQO
.
getDepartmentName
());
department
.
setChainId
(
dto
.
getChainId
()
+
Constant
.
ID_SEPARATOR
+
dto
.
getDepartmentId
());
department
.
setChainName
(
dto
.
getChainName
()
+
Constant
.
NAME_SEPARATOR
+
dto
.
getDepartmentName
());
department
.
setIsStore
(
departmentAddQO
.
getStoreFlag
());
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
());
...
...
@@ -216,7 +225,7 @@ public class DepartmentContoller extends WebBaseController{
DepartmentDTO
departmentAdd
=
(
DepartmentDTO
)
hr
.
getResult
();
String
departmentId
=
departmentAdd
.
getDepartmentId
();
String
sonDepartment
=
departmentAddQO
.
get
SonDepartment
();
String
sonDepartment
=
departmentAddQO
.
get
Children
();
handler
(
sonDepartment
,
departmentId
);
}
}
...
...
@@ -314,11 +323,11 @@ public class DepartmentContoller extends WebBaseController{
@RequestMapping
(
"department-recycle-list"
)
public
HaobanResponse
departmentRecycleList
(
String
key
w
ord
,
Integer
storeFlag
,
BasePageInfo
pageInfo
)
{
LoginVO
login
=
(
LoginVO
)
AuthRequestUtil
.
get
AppLogi
nUser
();
public
HaobanResponse
departmentRecycleList
(
String
key
W
ord
,
Integer
storeFlag
,
BasePageInfo
pageInfo
)
{
LoginVO
login
=
(
LoginVO
)
AuthRequestUtil
.
get
Sessio
nUser
();
String
wxEnterpriseId
=
login
.
getWxEnterpriseId
();
Integer
recycleFlag
=
1
;
Page
<
DepartmentDTO
>
page
=
departmentApiService
.
pageDepartmentByParams
(
pageInfo
,
wxEnterpriseId
,
key
w
ord
,
storeFlag
,
recycleFlag
);
Page
<
DepartmentDTO
>
page
=
departmentApiService
.
pageDepartmentByParams
(
pageInfo
,
wxEnterpriseId
,
key
W
ord
,
storeFlag
,
recycleFlag
);
PageResult
<
DepartmentDTO
>
pageVo
=
new
PageResult
<>();
pageVo
.
setList
(
page
.
getResult
());
pageVo
.
setPageNum
(
page
.
getCurrentPage
());
...
...
@@ -347,31 +356,41 @@ public class DepartmentContoller extends WebBaseController{
* @param parentId
*/
private
void
handler
(
String
sonDepartment
,
String
parentId
)
{
logger
.
info
(
"【处理子节点】sonDepartment={},parentId={}"
,
sonDepartment
,
parentId
);
if
(
StringUtils
.
isNotBlank
(
sonDepartment
))
{
List
<
DepartmentAddQO
>
list
=
JSONArray
.
parseArray
(
sonDepartment
,
DepartmentAddQO
.
class
);
for
(
DepartmentAddQO
departmentAddQO
:
list
)
{
Integer
type
=
departmentAddQO
.
getType
();
Integer
isStore
=
0
;
if
(
type
!=
null
&&
type
==
3
){
isStore
=
1
;
}
String
sonParentId
=
""
;
DepartmentDTO
dto
=
departmentApiService
.
selectById
(
parentId
);
if
(
dto
==
null
||
dto
.
getStatusFlag
()
==
0
)
{
continue
;
}
if
(
dto
.
getIsStore
()
==
1
)
{
if
(
dto
.
getIsStore
()
!=
null
&&
dto
.
getIsStore
()
==
1
)
{
continue
;
}
String
departmentId
=
departmentAddQO
.
getDepartmentId
();
Boolean
addFlag
=
departmentAddQO
.
getAddFlag
();
//在部门下新增部门
if
(
addFlag
)
{
if
(
addFlag
==
null
||
addFlag
)
{
DepartmentDTO
department
=
new
DepartmentDTO
();
department
.
setParentDepartmentId
(
parentId
);
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
());
department
.
set
IsStore
(
0
);
department
.
set
Sort
(
departmentAddQO
.
getSort
()
);
department
.
setIsStore
(
departmentAddQO
.
getStoreFlag
());
department
.
setLevel
(
dto
.
getLevel
()
+
1
);
if
(
departmentAddQO
.
getStoreFlag
()
!=
null
){
department
.
setIsStore
(
departmentAddQO
.
getStoreFlag
());
}
else
{
department
.
setIsStore
(
isStore
);
}
department
.
setRelatedId
(
departmentAddQO
.
getRelatedId
());
HaobanResponse
hr
=
departmentApiService
.
add
(
department
);
if
(
hr
.
getErrorCode
()
!=
1
)
{
...
...
@@ -398,7 +417,7 @@ public class DepartmentContoller extends WebBaseController{
sonParentId
=
departmentEdit
.
getDepartmentId
();
}
sonDepartment
=
departmentAddQO
.
get
SonDepartment
();
sonDepartment
=
departmentAddQO
.
get
Children
();
handler
(
sonDepartment
,
sonParentId
);
}
...
...
haoban-manage3-web/src/main/java/com/gic/haoban/manage/web/controller/LoginController.java
View file @
46dfe5d6
...
...
@@ -69,10 +69,10 @@ public class LoginController extends WebBaseController{
}
LoginVO
loginVO
=
new
LoginVO
();
StaffDTO
staff
=
staffApiService
.
selectById
(
"1"
);
logger
.
info
(
"【好办登录】staff={}"
,
JSON
.
toJSONString
(
s
taff
));
loginVO
.
setWxEnterpriseId
(
s
taff
.
getWxEnterpriseId
());
loginVO
.
setStaffDTO
(
s
taff
);
//
StaffDTO staff = staffApiService.selectById("1");
logger
.
info
(
"【好办登录】staff={}"
,
JSON
.
toJSONString
(
loginS
taff
));
loginVO
.
setWxEnterpriseId
(
loginS
taff
.
getWxEnterpriseId
());
loginVO
.
setStaffDTO
(
loginS
taff
);
AuthRequestUtil
.
setSessionUser
(
loginVO
);
String
redirectUri
=
config
.
getHost
()
+
"index"
;
...
...
@@ -106,8 +106,8 @@ public class LoginController extends WebBaseController{
@RequestMapping
(
"yw-login"
)
public
void
ywLogin
(
String
wxEnterpriseId
,
HttpServletResponse
response
)
{
//TODO 获取超级管理员账号接口
StaffDTO
staff
=
staffApiService
.
selectById
(
"1"
);
StaffDTO
staff
=
staffApiService
.
selectSuperByWxEnterpriseId
(
wxEnterpriseId
);
//
StaffDTO staff = staffApiService.selectById("1");
LoginVO
loginVO
=
new
LoginVO
();
loginVO
.
setWxEnterpriseId
(
wxEnterpriseId
);
loginVO
.
setStaffDTO
(
staff
);
...
...
haoban-manage3-web/src/main/java/com/gic/haoban/manage/web/controller/WxEnterpriseController.java
View file @
46dfe5d6
...
...
@@ -128,6 +128,9 @@ public class WxEnterpriseController extends WebBaseController{
}
List
<
StoreDTO
>
t_list
=
storePage
.
getResult
();
List
<
String
>
storeIds
=
t_list
.
stream
().
map
(
s
->
s
.
getStoreId
()).
collect
(
Collectors
.
toList
());
if
(
StringUtils
.
isEmpty
(
keyWord
)){
storeIds
=
null
;
}
Page
<
DepartmentDTO
>
page
=
departmentApiService
.
pageFullStoreByWxEnterpriseId
(
wxEnterpriseId
,
keyWord
,
storeIds
,
maxVersionCount
,
basePageInfo
);
List
<
DepartmentDTO
>
list
=
page
.
getResult
();
List
<
StoreVo
>
resultList
=
EntityUtil
.
changeEntityListByJSON
(
StoreVo
.
class
,
list
);
...
...
haoban-manage3-web/src/main/java/com/gic/haoban/manage/web/qo/DepartmentAddQO.java
View file @
46dfe5d6
...
...
@@ -12,7 +12,7 @@ public class DepartmentAddQO implements Serializable {
private
String
parentDepartmentId
;
private
String
sonDepartment
;
private
String
children
;
private
Integer
storeFlag
;
...
...
@@ -21,6 +21,8 @@ public class DepartmentAddQO implements Serializable {
private
Boolean
addFlag
;
private
Integer
sort
;
private
Integer
type
;
public
String
getDepartmentName
()
{
return
departmentName
;
...
...
@@ -38,12 +40,13 @@ public class DepartmentAddQO implements Serializable {
this
.
parentId
=
parentId
;
}
public
String
getSonDepartment
()
{
return
sonDepartment
;
public
String
getChildren
()
{
return
children
;
}
public
void
set
SonDepartment
(
String
sonDepartment
)
{
this
.
sonDepartment
=
sonDepartment
;
public
void
set
Children
(
String
children
)
{
this
.
children
=
children
;
}
public
String
getDepartmentId
()
{
...
...
@@ -95,6 +98,14 @@ public class DepartmentAddQO implements Serializable {
public
void
setAddFlag
(
Boolean
addFlag
)
{
this
.
addFlag
=
addFlag
;
}
public
Integer
getType
()
{
return
type
;
}
public
void
setType
(
Integer
type
)
{
this
.
type
=
type
;
}
...
...
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