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
269abff9
Commit
269abff9
authored
Oct 21, 2022
by
墨竹
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix:员工列表超时接口优化
parent
30083c62
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
91 additions
and
21 deletions
+91
-21
StaffDTO.java
...src/main/java/com/gic/haoban/manage/api/dto/StaffDTO.java
+18
-0
StaffApiService.java
...va/com/gic/haoban/manage/api/service/StaffApiService.java
+11
-0
StaffMapper.java
...com/gic/haoban/manage/service/dao/mapper/StaffMapper.java
+14
-0
StaffApiServiceImpl.java
.../manage/service/service/out/impl/StaffApiServiceImpl.java
+5
-0
StaffMapper.xml
...manage3-service/src/main/resources/mapper/StaffMapper.xml
+32
-4
WxStaffController.java
...m/gic/haoban/manage/web/controller/WxStaffController.java
+11
-17
No files found.
haoban-manage3-api/src/main/java/com/gic/haoban/manage/api/dto/StaffDTO.java
View file @
269abff9
...
@@ -100,6 +100,8 @@ public class StaffDTO implements Serializable {
...
@@ -100,6 +100,8 @@ public class StaffDTO implements Serializable {
private
String
defaultGicEid
;
private
String
defaultGicEid
;
private
Integer
addNum
;
private
Integer
addNum
;
private
Integer
activeStatus
;
private
Integer
activeStatus
;
private
String
enterpriseId
;
private
String
storeId
;
public
String
getDefaultGicEid
()
{
public
String
getDefaultGicEid
()
{
return
defaultGicEid
;
return
defaultGicEid
;
...
@@ -382,4 +384,20 @@ public class StaffDTO implements Serializable {
...
@@ -382,4 +384,20 @@ public class StaffDTO implements Serializable {
public
void
setActiveStatus
(
Integer
activeStatus
)
{
public
void
setActiveStatus
(
Integer
activeStatus
)
{
this
.
activeStatus
=
activeStatus
;
this
.
activeStatus
=
activeStatus
;
}
}
public
String
getEnterpriseId
()
{
return
enterpriseId
;
}
public
void
setEnterpriseId
(
String
enterpriseId
)
{
this
.
enterpriseId
=
enterpriseId
;
}
public
String
getStoreId
()
{
return
storeId
;
}
public
void
setStoreId
(
String
storeId
)
{
this
.
storeId
=
storeId
;
}
}
}
haoban-manage3-api/src/main/java/com/gic/haoban/manage/api/service/StaffApiService.java
View file @
269abff9
...
@@ -279,4 +279,15 @@ public interface StaffApiService {
...
@@ -279,4 +279,15 @@ public interface StaffApiService {
*/
*/
boolean
isManager
(
String
clerkId
);
boolean
isManager
(
String
clerkId
);
/**
* 绑定的员工列表
*
* @param storeIds 存储id
* @param wxEnterpriseId wx企业标识
* @return {@link List }<{@link StaffDTO }>
* @author mozhu
* @date 2022-10-21 00:25:46
*/
List
<
StaffDTO
>
listBindStoreIds
(
List
<
String
>
storeIds
,
String
wxEnterpriseId
);
}
}
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/dao/mapper/StaffMapper.java
View file @
269abff9
package
com
.
gic
.
haoban
.
manage
.
service
.
dao
.
mapper
;
package
com
.
gic
.
haoban
.
manage
.
service
.
dao
.
mapper
;
import
com.gic.haoban.manage.api.dto.StaffDTO
;
import
com.gic.haoban.manage.service.entity.TabHaobanStaff
;
import
com.gic.haoban.manage.service.entity.TabHaobanStaff
;
import
com.github.pagehelper.Page
;
import
com.github.pagehelper.Page
;
import
org.apache.ibatis.annotations.Param
;
import
org.apache.ibatis.annotations.Param
;
...
@@ -133,4 +134,16 @@ public interface StaffMapper {
...
@@ -133,4 +134,16 @@ public interface StaffMapper {
* @date 2022-07-25 16:36:07
* @date 2022-07-25 16:36:07
*/
*/
int
resetAddNum
();
int
resetAddNum
();
/**
* 绑定的员工列表(暂时取100条,后续和前端一起改为分页接口)
*
* @param storeIds 存储id
* @param wxEnterpriseId wx企业标识
* @return {@link List }<{@link StaffDTO }>
* @author mozhu
* @date 2022-10-21 00:26:47
*/
List
<
StaffDTO
>
listBindStoreIds
(
@Param
(
"storeIds"
)
List
<
String
>
storeIds
,
@Param
(
"wxEnterpriseId"
)
String
wxEnterpriseId
);
}
}
\ No newline at end of file
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/out/impl/StaffApiServiceImpl.java
View file @
269abff9
...
@@ -1018,4 +1018,9 @@ public class StaffApiServiceImpl implements StaffApiService {
...
@@ -1018,4 +1018,9 @@ public class StaffApiServiceImpl implements StaffApiService {
}
}
return
false
;
return
false
;
}
}
@Override
public
List
<
StaffDTO
>
listBindStoreIds
(
List
<
String
>
storeIds
,
String
wxEnterpriseId
)
{
return
staffMapper
.
listBindStoreIds
(
storeIds
,
wxEnterpriseId
);
}
}
}
haoban-manage3-service/src/main/resources/mapper/StaffMapper.xml
View file @
269abff9
...
@@ -28,7 +28,8 @@
...
@@ -28,7 +28,8 @@
</resultMap>
</resultMap>
<sql
id=
"Base_Column_List"
>
<sql
id=
"Base_Column_List"
>
staff_id, wx_user_id, phone_number, staff_name, nation_code, nick_name, sex, postion,
staff_id
, wx_user_id, phone_number, staff_name, nation_code, nick_name, sex, postion,
active_flag, extend_postion, status_flag, create_time, update_time,wx_enterprise_id,head_img,
active_flag, extend_postion, status_flag, create_time, update_time,wx_enterprise_id,head_img,
sort,sync_postion_flag,super_manager_flag,wx_open_user_id,wx_open_id,qr_code,add_num,active_status
sort,sync_postion_flag,super_manager_flag,wx_open_user_id,wx_open_id,qr_code,add_num,active_status
</sql>
</sql>
...
@@ -467,13 +468,14 @@
...
@@ -467,13 +468,14 @@
<update
id=
"updateAddNumById"
parameterType=
"java.lang.String"
>
<update
id=
"updateAddNumById"
parameterType=
"java.lang.String"
>
update tab_haoban_staff
update tab_haoban_staff
set add_num
= add_num +
1,
set add_num
= add_num +
1,
update_time = now()
update_time = now()
where staff_id = #{staffId} and status_flag = 1
where staff_id = #{staffId}
and status_flag = 1
</update>
</update>
<update
id=
"updateActiveStatusById"
>
<update
id=
"updateActiveStatusById"
>
update tab_haoban_staff
update tab_haoban_staff
set active_status = #{activeStatus},
set active_status = #{activeStatus},
update_time = now()
update_time = now()
...
@@ -489,4 +491,29 @@
...
@@ -489,4 +491,29 @@
where status_flag = 1
where status_flag = 1
</update>
</update>
<select
id=
"listBindStoreIds"
resultType=
"com.gic.haoban.manage.api.dto.StaffDTO"
>
select
a.staff_id staffId,
a.phone_number phoneNumber,
a.staff_name staffName,
a.head_img headImg,
a.wx_enterprise_id wxEnterpriseId,
b.clerk_id clerkId,
b.clerk_code clerkCode,
b.enterprise_id enterpriseId,
b.store_id storeId
from tab_haoban_staff a
left join tab_haoban_staff_clerk_relation b on a.staff_id = b.staff_id
where a.wx_enterprise_id = #{wxEnterpriseId}
and a.status_flag = 1 and b.status_flag = 1
<if
test=
"null != storeIds and storeIds.size gt 0"
>
and b.store_id in
<foreach
collection=
"storeIds"
index=
"index"
item=
"item"
open=
"("
separator=
","
close=
")"
>
#{item}
</foreach>
</if>
limit 100
</select>
</mapper>
</mapper>
\ No newline at end of file
haoban-manage3-wx/src/main/java/com/gic/haoban/manage/web/controller/WxStaffController.java
View file @
269abff9
...
@@ -119,27 +119,21 @@ public class WxStaffController extends WebBaseController {
...
@@ -119,27 +119,21 @@ public class WxStaffController extends WebBaseController {
if
(
storeIds
.
contains
(
"-1"
))
{
if
(
storeIds
.
contains
(
"-1"
))
{
storeIds
=
null
;
storeIds
=
null
;
}
}
List
<
StaffClerkRelationDTO
>
list
=
staffClerkRelationApiService
.
listByStoreIds
(
storeIds
);
List
<
StaffDTO
>
resultlist
=
staffApiService
.
listBindStoreIds
(
storeIds
,
wxEnterpriseId
);
List
<
String
>
staffIds
=
list
.
stream
().
map
(
StaffClerkRelationDTO:
:
getStaffId
).
collect
(
Collectors
.
toList
());
List
<
StaffDTO
>
resultlist
=
staffApiService
.
listByIds
(
staffIds
);
Map
<
String
,
StaffDTO
>
map
=
com
.
gic
.
commons
.
util
.
CollectionUtil
.
toMap
(
resultlist
,
"staffId"
);
List
<
StaffVO
>
resultList
=
new
ArrayList
<>();
List
<
StaffVO
>
resultList
=
new
ArrayList
<>();
for
(
StaffClerkRelationDTO
staffClerkRelationDTO
:
list
)
{
for
(
StaffDTO
staffDTO
:
resultlist
)
{
String
staffId
=
staffClerkRelationDTO
.
getStaffId
();
String
enterpriseId
=
staffDTO
.
getEnterpriseId
();
logger
.
info
(
"员工id为:{}"
,
staffId
);
String
clerkCode
=
staffDTO
.
getClerkCode
();
StaffDTO
staffDTO
=
map
.
get
(
staffId
);
ClerkDTO
clerk
=
clerkService
.
getClerkByClerkCode
(
enterpriseId
,
clerkCode
);
if
(
staffDTO
!=
null
)
{
ClerkDTO
clerk
=
clerkService
.
getClerkByClerkCode
(
staffClerkRelationDTO
.
getEnterpriseId
(),
staffClerkRelationDTO
.
getClerkCode
());
if
(
clerk
!=
null
)
{
if
(
clerk
!=
null
)
{
long
memberCount
=
distributeApiService
.
getClerkMemberCount
(
staffClerkRelationDTO
.
getEnterpriseId
()
,
clerk
.
getClerkId
(),
storeId
);
long
memberCount
=
distributeApiService
.
getClerkMemberCount
(
enterpriseId
,
clerk
.
getClerkId
(),
storeId
);
logger
.
info
(
"【获取会员数】enterpriseId={},clerkId={},storeId={},memberCount={}"
,
staffClerkRelationDTO
.
getEnterpriseId
()
,
clerk
.
getClerkId
(),
storeId
,
memberCount
);
logger
.
info
(
"【获取会员数】enterpriseId={},clerkId={},storeId={},memberCount={}"
,
enterpriseId
,
clerk
.
getClerkId
(),
storeId
,
memberCount
);
staffDTO
.
setMemberCount
(
Convert
.
toInt
(
memberCount
,
0
));
staffDTO
.
setMemberCount
(
Convert
.
toInt
(
memberCount
,
0
));
staffDTO
.
setClerkId
(
clerk
.
getClerkId
());
staffDTO
.
setClerkId
(
clerk
.
getClerkId
());
staffDTO
.
setClerkCode
(
clerk
.
getClerkCode
());
staffDTO
.
setClerkCode
(
clerk
.
getClerkCode
());
resultList
.
add
(
EntityUtil
.
changeEntityNew
(
StaffVO
.
class
,
staffDTO
));
resultList
.
add
(
EntityUtil
.
changeEntityNew
(
StaffVO
.
class
,
staffDTO
));
}
}
}
}
}
return
resultResponse
(
HaoBanErrCode
.
ERR_1
,
resultList
);
return
resultResponse
(
HaoBanErrCode
.
ERR_1
,
resultList
);
}
}
...
@@ -335,7 +329,7 @@ public class WxStaffController extends WebBaseController {
...
@@ -335,7 +329,7 @@ public class WxStaffController extends WebBaseController {
return
resultResponse
(
HaoBanErrCode
.
ERR_10009
);
return
resultResponse
(
HaoBanErrCode
.
ERR_10009
);
}
}
String
enterpriseId
=
store
.
getEnterpriseId
();
String
enterpriseId
=
store
.
getEnterpriseId
();
boolean
b
=
auditApiService
.
judgeHavePhoneNumberOrCode
(
enterpriseId
,
clerkCode
,
phoneNumber
,
wxEnterpriseId
);
boolean
b
=
auditApiService
.
judgeHavePhoneNumberOrCode
(
enterpriseId
,
clerkCode
,
phoneNumber
,
wxEnterpriseId
);
if
(
b
)
{
if
(
b
)
{
//待审核中存在code或该手机号
//待审核中存在code或该手机号
return
resultResponse
(
HaoBanErrCode
.
ERR_10021
);
return
resultResponse
(
HaoBanErrCode
.
ERR_10021
);
...
@@ -347,7 +341,7 @@ public class WxStaffController extends WebBaseController {
...
@@ -347,7 +341,7 @@ public class WxStaffController extends WebBaseController {
}
}
AuditSettingDTO
dto
=
auditSettingApiService
.
findSettingByWxEnterpriseId
(
wxEnterpriseId
);
AuditSettingDTO
dto
=
auditSettingApiService
.
findSettingByWxEnterpriseId
(
wxEnterpriseId
);
if
(
dto
.
getAuditFlag
()
==
1
&&
dto
.
getClerkChangeFlag
()
==
1
)
{
if
(
dto
.
getAuditFlag
()
==
1
&&
dto
.
getClerkChangeFlag
()
==
1
)
{
AuditDTO
auditDTO
=
auditApiService
.
findByBindRelatedIdAndAuditType
(
clerkCode
,
AuditType
.
CLERK_ADD
.
getCode
(),
wxEnterpriseId
,
enterpriseId
);
AuditDTO
auditDTO
=
auditApiService
.
findByBindRelatedIdAndAuditType
(
clerkCode
,
AuditType
.
CLERK_ADD
.
getCode
(),
wxEnterpriseId
,
enterpriseId
);
if
(
auditDTO
!=
null
)
{
if
(
auditDTO
!=
null
)
{
logger
.
info
(
"已经存在了审核记录,待审核{}"
,
clerkCode
);
logger
.
info
(
"已经存在了审核记录,待审核{}"
,
clerkCode
);
return
resultResponse
(
HaoBanErrCode
.
ERR_10018
);
return
resultResponse
(
HaoBanErrCode
.
ERR_10018
);
...
@@ -435,7 +429,7 @@ public class WxStaffController extends WebBaseController {
...
@@ -435,7 +429,7 @@ public class WxStaffController extends WebBaseController {
//需要审核
//需要审核
String
[]
clerkIdArr
=
clerkIds
.
split
(
","
);
String
[]
clerkIdArr
=
clerkIds
.
split
(
","
);
for
(
String
clerkId
:
clerkIdArr
)
{
for
(
String
clerkId
:
clerkIdArr
)
{
AuditDTO
auditDTO
=
auditApiService
.
findByBindRelatedIdAndAuditType
(
clerkId
,
AuditType
.
CLERK_DEL
.
getCode
(),
wxEnterpriseId
,
store
.
getEnterpriseId
());
AuditDTO
auditDTO
=
auditApiService
.
findByBindRelatedIdAndAuditType
(
clerkId
,
AuditType
.
CLERK_DEL
.
getCode
(),
wxEnterpriseId
,
store
.
getEnterpriseId
());
if
(
auditDTO
!=
null
)
{
if
(
auditDTO
!=
null
)
{
logger
.
info
(
"已经存在了审核记录,待审核{}"
,
clerkId
);
logger
.
info
(
"已经存在了审核记录,待审核{}"
,
clerkId
);
continue
;
continue
;
...
@@ -859,7 +853,7 @@ public class WxStaffController extends WebBaseController {
...
@@ -859,7 +853,7 @@ public class WxStaffController extends WebBaseController {
if
(
staff
==
null
)
{
if
(
staff
==
null
)
{
return
resultResponse
(
HaoBanErrCode
.
ERR_10006
);
return
resultResponse
(
HaoBanErrCode
.
ERR_10006
);
}
}
AuditDTO
auditDTO
=
auditApiService
.
findByBindRelatedIdAndAuditType
(
clerkId
,
AuditType
.
CLERK_BIND
.
getCode
(),
wxEnterpriseId
,
clerk
.
getEnterpriseId
());
AuditDTO
auditDTO
=
auditApiService
.
findByBindRelatedIdAndAuditType
(
clerkId
,
AuditType
.
CLERK_BIND
.
getCode
(),
wxEnterpriseId
,
clerk
.
getEnterpriseId
());
if
(
auditDTO
!=
null
)
{
if
(
auditDTO
!=
null
)
{
return
resultResponse
(
HaoBanErrCode
.
ERR_10018
);
return
resultResponse
(
HaoBanErrCode
.
ERR_10018
);
}
}
...
...
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