feat(task): 添加租户10584分销订单结算定时任务
- 实现每20秒执行一次的定时任务,处理已付款且未结算的订单 - 添加直推和简推佣金计算逻辑,按10%比例发放 - 实现shop角色推荐人佣金分配,支持最多两级推荐 - 添加订单认领机制防止重复结算,并使用事务模板确保数据一致性 - 实现分销商账户余额累加和资金流水记录功能 - 添加缓存机制减少重复角色查询,提升性能
This commit is contained in:
@@ -3,7 +3,7 @@
|
|||||||
<mapper namespace="com.gxwebsoft.common.system.mapper.UserRoleMapper">
|
<mapper namespace="com.gxwebsoft.common.system.mapper.UserRoleMapper">
|
||||||
|
|
||||||
<insert id="insertBatch">
|
<insert id="insertBatch">
|
||||||
INSERT INTO sys_user_role(user_id, role_id) VALUES
|
INSERT INTO gxwebsoft_core.sys_user_role(user_id, role_id) VALUES
|
||||||
<foreach collection="roleIds" item="roleId" separator=",">
|
<foreach collection="roleIds" item="roleId" separator=",">
|
||||||
(#{userId}, #{roleId})
|
(#{userId}, #{roleId})
|
||||||
</foreach>
|
</foreach>
|
||||||
@@ -11,10 +11,10 @@
|
|||||||
|
|
||||||
<select id="selectByUserId" resultType="com.gxwebsoft.common.system.entity.Role">
|
<select id="selectByUserId" resultType="com.gxwebsoft.common.system.entity.Role">
|
||||||
SELECT *
|
SELECT *
|
||||||
FROM sys_role
|
FROM gxwebsoft_core.sys_role
|
||||||
WHERE role_id IN (
|
WHERE role_id IN (
|
||||||
SELECT role_id
|
SELECT role_id
|
||||||
FROM sys_user_role
|
FROM gxwebsoft_core.sys_user_role
|
||||||
WHERE user_id = #{userId}
|
WHERE user_id = #{userId}
|
||||||
)
|
)
|
||||||
AND deleted = 0
|
AND deleted = 0
|
||||||
@@ -23,7 +23,7 @@
|
|||||||
|
|
||||||
<select id="selectByUserIds" resultType="com.gxwebsoft.common.system.entity.Role">
|
<select id="selectByUserIds" resultType="com.gxwebsoft.common.system.entity.Role">
|
||||||
SELECT a.user_id, b.*
|
SELECT a.user_id, b.*
|
||||||
FROM sys_user_role a
|
FROM gxwebsoft_core.sys_user_role a
|
||||||
LEFT JOIN gxwebsoft_core.sys_role b ON a.role_id = b.role_id
|
LEFT JOIN gxwebsoft_core.sys_role b ON a.role_id = b.role_id
|
||||||
WHERE a.user_id IN
|
WHERE a.user_id IN
|
||||||
<foreach collection="userIds" open="(" close=")" separator="," item="userId">
|
<foreach collection="userIds" open="(" close=")" separator="," item="userId">
|
||||||
|
|||||||
Reference in New Issue
Block a user