Browse Source

达人解綁,添加記錄角色

zhaoxian 2 years ago
parent
commit
2910f941d5

+ 6 - 0
ruixuan-live/src/main/java/com/ruixuan/isc/service/impl/KuaishouPromoterServiceImpl.java

@@ -425,6 +425,12 @@ public class KuaishouPromoterServiceImpl implements IKuaishouPromoterService {
             record.put("promoterId", promoter.getPromoterId());
             record.put("userId", promoter.getUserId());
             record.put("operatorId", userId);
+            List<JSONObject> roles = sysUserService.getUserRoleByUserId(userId);
+            if (Check.isNotNull(roles)) {
+                record.put("roleName", roles.get(0).getString("role_name"));
+                record.put("roleKey", roles.get(0).getString("role_key"));
+            }
+
             kuaishouPromoterMapper.insertKuaishouPromoterRecord(record);
         }
         kuaishouPromoterMapper.deleteKuaishouPromoterById(id);

+ 4 - 0
ruixuan-live/src/main/resources/mapper/isc/KuaishouPromoterMapper.xml

@@ -419,11 +419,15 @@
             <if test="promoterId != null">promoter_id,</if>
             <if test="userId != null">user_id,</if>
             <if test="operatorId != null">operator_id,</if>
+            <if test="roleName != null">role_name,</if>
+            <if test="roleKey != null">role_key,</if>
         </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
             <if test="promoterId != null">#{promoterId},</if>
             <if test="userId != null">#{userId},</if>
             <if test="operatorId != null">#{operatorId},</if>
+            <if test="roleName != null">#{roleName},</if>
+            <if test="roleKey != null">#{roleKey},</if>
         </trim>
     </insert>