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
61cf4885
Commit
61cf4885
authored
Jul 25, 2022
by
墨竹
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
加好友上限修改
parent
66bd2256
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
107 additions
and
10 deletions
+107
-10
StaffDTO.java
...src/main/java/com/gic/haoban/manage/api/dto/StaffDTO.java
+0
-0
StaffMapper.java
...com/gic/haoban/manage/service/dao/mapper/StaffMapper.java
+20
-0
TabHaobanStaff.java
.../com/gic/haoban/manage/service/entity/TabHaobanStaff.java
+10
-0
StaffService.java
...a/com/gic/haoban/manage/service/service/StaffService.java
+17
-0
StaffServiceImpl.java
.../haoban/manage/service/service/impl/StaffServiceImpl.java
+11
-0
MemberUnionidRelatedApiServiceImpl.java
.../service/out/impl/MemberUnionidRelatedApiServiceImpl.java
+12
-5
HmQrcodeApiServiceImpl.java
...e/service/service/out/impl/hm/HmQrcodeApiServiceImpl.java
+8
-2
StaffMapper.xml
...manage3-service/src/main/resources/mapper/StaffMapper.xml
+29
-3
No files found.
haoban-manage3-api/src/main/java/com/gic/haoban/manage/api/dto/StaffDTO.java
View file @
61cf4885
This diff is collapsed.
Click to expand it.
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/dao/mapper/StaffMapper.java
View file @
61cf4885
...
...
@@ -186,4 +186,23 @@ public interface StaffMapper {
int
updateWxUserIdsByWxOpenUserId
(
@Param
(
"wxEnterpriseId"
)
String
wxEnterpriseId
,
@Param
(
"wxOpenUseId"
)
String
wxOpenUseId
,
@Param
(
"wxUserId"
)
String
wxUserId
);
/**
* 更新添加num通过id
*
* @param staffId 员工id
* @return int
* @author mozhu
* @date 2022-07-25 16:33:30
*/
int
updateAddNumById
(
@Param
(
"staffId"
)
String
staffId
);
/**
* 重置添加num
*
* @return int
* @author mozhu
* @date 2022-07-25 16:36:07
*/
int
resetAddNum
();
}
\ No newline at end of file
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/entity/TabHaobanStaff.java
View file @
61cf4885
...
...
@@ -48,6 +48,7 @@ public class TabHaobanStaff implements Serializable {
private
String
wxOpenId
;
private
String
qrCode
;
private
Integer
addNum
;
@Transient
private
String
departmentIds
;
...
...
@@ -227,4 +228,12 @@ public class TabHaobanStaff implements Serializable {
public
void
setDepartmentIds
(
String
departmentIds
)
{
this
.
departmentIds
=
departmentIds
;
}
public
Integer
getAddNum
()
{
return
addNum
;
}
public
void
setAddNum
(
Integer
addNum
)
{
this
.
addNum
=
addNum
;
}
}
\ No newline at end of file
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/StaffService.java
View file @
61cf4885
...
...
@@ -144,5 +144,22 @@ public interface StaffService {
int
updateUserIdByUserId
(
String
wxEnterpriseId
,
String
newWxUserId
,
String
oldWxUserId
);
/**
* 更新添加num通过id
*
* @param staffId 员工id
* @return int
* @author mozhu
* @date 2022-07-25 16:36:38
*/
int
updateAddNumById
(
String
staffId
);
/**
* 重置添加num
*
* @return int
* @author mozhu
* @date 2022-07-25 16:36:53
*/
int
resetAddNum
();
}
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/impl/StaffServiceImpl.java
View file @
61cf4885
...
...
@@ -64,6 +64,7 @@ public class StaffServiceImpl implements StaffService {
tab
.
setStaffId
(
StringUtil
.
randomUUID
());
}
tab
.
setStatusFlag
(
1
);
tab
.
setAddNum
(
0
);
mapper
.
insertSelective
(
tab
);
return
tab
.
getStaffId
();
}
...
...
@@ -180,4 +181,14 @@ public class StaffServiceImpl implements StaffService {
public
int
updateUserIdByUserId
(
String
wxEnterpriseId
,
String
newWxUserId
,
String
oldWxUserId
)
{
return
mapper
.
updateUserIdByUserId
(
wxEnterpriseId
,
newWxUserId
,
oldWxUserId
);
}
@Override
public
int
updateAddNumById
(
String
staffId
)
{
return
mapper
.
updateAddNumById
(
staffId
);
}
@Override
public
int
resetAddNum
()
{
return
mapper
.
resetAddNum
();
}
}
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/out/impl/MemberUnionidRelatedApiServiceImpl.java
View file @
61cf4885
...
...
@@ -350,17 +350,18 @@ public class MemberUnionidRelatedApiServiceImpl implements MemberUnionidRelatedA
String
memberLabelId
=
""
;
if
(
StringUtils
.
isNotBlank
(
state
))
{
String
id
=
state
.
substring
(
2
);
Long
hmId
=
null
;
HmQrcodeDTO
hmQrcodeDTO
=
null
;
if
(
state
.
contains
(
Manage3Constants
.
HM
))
{
Long
hmId
=
Convert
.
toLong
(
id
);
hmId
=
Convert
.
toLong
(
id
);
log
.
info
(
"普通活码={}"
,
hmId
);
HmQrcodeDTO
hmQrcodeDTO
=
hmQrcodeApiService
.
getSimpleById
(
hmId
);
hmQrcodeDTO
=
hmQrcodeApiService
.
getSimpleById
(
hmId
);
if
(
hmQrcodeDTO
==
null
)
{
log
.
error
(
"活码为空:{}"
,
hmId
);
return
;
}
memberLabelId
=
hmQrcodeDTO
.
getMemberLabelId
();
wxUserAddLogQDTO
.
setHmId
(
hmId
);
hmQrcodeApiService
.
updateAddNumById
(
hmId
,
hmQrcodeDTO
.
getClerkId
());
//处理活码导购
if
(
hmQrcodeDTO
.
getHmType
()
==
1
)
{
staffClerkRelationDTO
=
staffClerkRelationService
.
getBindByClerkId
(
hmQrcodeDTO
.
getClerkId
(),
wxEnterpriseId
);
...
...
@@ -385,14 +386,14 @@ public class MemberUnionidRelatedApiServiceImpl implements MemberUnionidRelatedA
}
else
if
(
state
.
contains
(
Manage3Constants
.
DT
))
{
KeyDataLinkBO
dataForHmLink
=
keyDataService
.
getDataForHmLink
(
id
);
Long
linkId
=
dataForHmLink
.
getLinkId
();
Long
hmId
=
dataForHmLink
.
getHmId
();
hmId
=
dataForHmLink
.
getHmId
();
mobile
=
dataForHmLink
.
getMobile
();
unionid
=
dataForHmLink
.
getUnionid
();
log
.
info
(
"动态活码hmId={},linkId={},unionid={}"
,
hmId
,
linkId
,
unionid
);
isHmUnionid
=
true
;
wxUserAddLogQDTO
.
setLinkId
(
linkId
);
wxUserAddLogQDTO
.
setHmId
(
hmId
);
HmQrcodeDTO
hmQrcodeDTO
=
hmQrcodeApiService
.
getSimpleById
(
hmId
);
hmQrcodeDTO
=
hmQrcodeApiService
.
getSimpleById
(
hmId
);
if
(
hmQrcodeDTO
==
null
)
{
log
.
error
(
"活码动态为空,hmId:{}"
,
hmId
);
return
;
...
...
@@ -403,6 +404,10 @@ public class MemberUnionidRelatedApiServiceImpl implements MemberUnionidRelatedA
memberLabelId
=
hmLinkBO
.
getMemberLabelId
();
}
}
if
(
hmId
!=
null
&&
hmQrcodeDTO
!=
null
)
{
log
.
info
(
"计算活码的上限和加好友数量:{}"
,
hmId
);
hmQrcodeApiService
.
updateAddNumById
(
hmId
,
hmQrcodeDTO
.
getClerkId
());
}
}
else
{
TabHaobanClerkMainStoreRelated
mainStoreRelated
=
clerkMainStoreRelatedService
.
getMainStoreByStaffId
(
staffId
,
wxEnterpriseId
);
if
(
mainStoreRelated
==
null
)
{
...
...
@@ -439,6 +444,8 @@ public class MemberUnionidRelatedApiServiceImpl implements MemberUnionidRelatedA
setMemberTag
(
staffClerkRelationDTO
,
memberLabelId
,
memberId
);
}
//加好友增加数量
staffService
.
updateAddNumById
(
staffId
);
log
.
info
(
"插入加好友日志"
);
wxUserAddLogQDTO
.
setWxEnterpriseId
(
wxEnterpriseId
);
wxUserAddLogQDTO
.
setEnterpriseId
(
enterpriseId
);
...
...
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/out/impl/hm/HmQrcodeApiServiceImpl.java
View file @
61cf4885
...
...
@@ -636,15 +636,20 @@ public class HmQrcodeApiServiceImpl implements HmQrcodeApiService {
@Override
public
int
updateAddNumById
(
Long
hmId
,
String
clerkId
)
{
StaffClerkRelationDTO
staffClerkRelationDTO
=
staffClerkRelationService
.
getByClerkId
(
clerkId
);
if
(
staffClerkRelationDTO
==
null
)
{
logger
.
error
(
"未绑定好办:{}"
,
clerkId
);
return
0
;
}
HmQrcodeBO
hmQrcodeBO
=
hmQrcodeService
.
queryById
(
hmId
);
if
(
hmQrcodeBO
==
null
)
{
logger
.
error
(
"无活码数据"
);
return
0
;
}
TabHaobanStaff
tabHaobanStaff
=
staffService
.
selectById
(
staffClerkRelationDTO
.
getStaffId
());
Integer
addNum
=
tabHaobanStaff
.
getAddNum
();
Integer
hmType
=
hmQrcodeBO
.
getHmType
();
int
limit
=
QwFriendLimitCountUtil
.
getLimit
(
true
);
Integer
addNum
=
hmQrcodeBO
.
getAddNum
();
if
(
hmType
==
1
)
{
//单人活码
Integer
overFlag
=
0
;
...
...
@@ -674,6 +679,7 @@ public class HmQrcodeApiServiceImpl implements HmQrcodeApiService {
logger
.
info
(
"重置上限时间定时任务 start"
);
hmQrcodeService
.
resetAddNumAndOverFlag
();
hmClerkRelationService
.
resetAddNumAndOverFlag
();
staffService
.
resetAddNum
();
logger
.
info
(
"重置上限时间定时任务 end"
);
}
...
...
haoban-manage3-service/src/main/resources/mapper/StaffMapper.xml
View file @
61cf4885
...
...
@@ -23,14 +23,14 @@
<result
column=
"wx_open_user_id"
property=
"wxOpenUseId"
jdbcType=
"VARCHAR"
/>
<result
column=
"wx_open_id"
property=
"wxOpenId"
jdbcType=
"VARCHAR"
/>
<result
column=
"qr_code"
property=
"qrCode"
jdbcType=
"VARCHAR"
/>
<result
column=
"add_num"
property=
"addNum"
jdbcType=
"INTEGER"
/>
</resultMap>
<sql
id=
"Base_Column_List"
>
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,
sort,sync_postion_flag,super_manager_flag,wx_open_user_id,wx_open_id,qr_code
sort,sync_postion_flag,super_manager_flag,wx_open_user_id,wx_open_id,qr_code
,add_num
</sql>
<select
id=
"selectByPrimaryKey"
resultMap=
"BaseResultMap"
parameterType=
"java.lang.String"
>
select
...
...
@@ -120,6 +120,9 @@
<if
test=
"qrCode != null"
>
qr_code,
</if>
<if
test=
"addNum != null"
>
add_num,
</if>
</trim>
<trim
prefix=
"values ("
suffix=
")"
suffixOverrides=
","
>
<if
test=
"staffId != null"
>
...
...
@@ -183,7 +186,10 @@
#{wxOpenId},
</if>
<if
test=
"qrCode != null"
>
#{qrCode}
#{qrCode},
</if>
<if
test=
"addNum != null"
>
#{addNum}
</if>
</trim>
</insert>
...
...
@@ -250,6 +256,9 @@
<if
test=
"qrCode != null"
>
qr_code = #{qrCode}
</if>
<if
test=
"addNum != null"
>
add_num = #{addNum}
</if>
</set>
where staff_id = #{staffId,jdbcType=VARCHAR}
</update>
...
...
@@ -532,4 +541,20 @@
and wx_open_user_id = #{wxOpenUseId}
</update>
<update
id=
"updateAddNumById"
parameterType=
"java.lang.String"
>
update tab_haoban_staff
set add_num = add_num +1,
update_time = now()
where staff_id = #{staffId}
</update>
<update
id=
"resetAddNum"
>
update tab_haoban_staff
<set>
add_num = 0,update_time = now()
</set>
</update>
</mapper>
\ No newline at end of file
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