评论增加头像和时间
continuous-integration/drone/push Build is passing Details

支持图片预览
飞书小程序
YXY 1 year ago
parent 37c4294055
commit 99edffd9e8

@ -15,4 +15,5 @@ public class LarkInviteVo {
private String text; private String text;
private String type; private String type;
private String badge = "0"; private String badge = "0";
private String total;
} }

@ -1,6 +1,7 @@
package com.ruoyi.flyingbook.mapper; package com.ruoyi.flyingbook.mapper;
import com.ruoyi.flyingbook.domain.LarkUserActiveInviteRelatoin; import com.ruoyi.flyingbook.domain.LarkUserActiveInviteRelatoin;
import com.ruoyi.flyingbook.domain.larkactive.LarkInviteVo;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import java.util.List; import java.util.List;
@ -29,7 +30,7 @@ public interface LarkUserActiveInviteRelatoinMapper {
public List<LarkUserActiveInviteRelatoin> selectLarkUserActiveInviteRelatoinList(LarkUserActiveInviteRelatoin larkUserActiveInviteRelatoin); public List<LarkUserActiveInviteRelatoin> selectLarkUserActiveInviteRelatoinList(LarkUserActiveInviteRelatoin larkUserActiveInviteRelatoin);
public List<LarkUserActiveInviteRelatoin> queryByInviteList(@Param("inviteList") List<String> inviteList,@Param("flag") Long flag,@Param("inviteStage") String inviteStage); public List<LarkUserActiveInviteRelatoin> queryByInviteList(@Param("inviteList") List<String> inviteList,@Param("flag") Long flag,@Param("inviteStage") String inviteStage);
public int updateStage(@Param("idList") List<Long> idList,@Param("inviteStage") String inviteStage); public int updateStage(@Param("idList") List<Long> idList,@Param("inviteStage") String inviteStage);
public List<LarkUserActiveInviteRelatoin> queryTopTen(LarkUserActiveInviteRelatoin larkUserActiveInviteRelatoin); public List<LarkInviteVo> queryTopTen(LarkUserActiveInviteRelatoin larkUserActiveInviteRelatoin);
/** /**
* *

@ -57,18 +57,18 @@ public class LarkUserActiveInviteRelatoinServiceImpl implements ILarkUserActiveI
public List<LarkInviteVo> queryTopTen(LarkUserActiveInviteRelatoin larkUserActiveInviteRelatoin) { public List<LarkInviteVo> queryTopTen(LarkUserActiveInviteRelatoin larkUserActiveInviteRelatoin) {
larkUserActiveInviteRelatoin.setFlag(FlagStatus.OK.getCode()); larkUserActiveInviteRelatoin.setFlag(FlagStatus.OK.getCode());
larkUserActiveInviteRelatoin.setInviteStage(LarkActiveInviteStageEnum.ACTIVE.getCode()); larkUserActiveInviteRelatoin.setInviteStage(LarkActiveInviteStageEnum.ACTIVE.getCode());
List<LarkUserActiveInviteRelatoin> larkUserActiveInviteRelatoins = larkUserActiveInviteRelatoinMapper.queryTopTen(larkUserActiveInviteRelatoin); List<LarkInviteVo> larkUserActiveInviteRelatoins = larkUserActiveInviteRelatoinMapper.queryTopTen(larkUserActiveInviteRelatoin);
Map<String, LarkLoginLog> userInfoMap = queryUserInfoMap(larkUserActiveInviteRelatoins); Map<String, LarkLoginLog> userInfoMap = queryUserInfoMap(larkUserActiveInviteRelatoins);
List<LarkInviteVo> result = larkUserActiveInviteRelatoins.stream() List<LarkInviteVo> result = larkUserActiveInviteRelatoins.stream()
.filter(r -> { .filter(r -> {
return userInfoMap.containsKey(r.getUserName()); return userInfoMap.containsKey(r.getText());
}) })
.map(r -> { .map(r -> {
LarkInviteVo larkInviteVo = new LarkInviteVo(); LarkInviteVo larkInviteVo = new LarkInviteVo();
String userName = r.getUserName(); LarkLoginLog larkLoginLog = userInfoMap.get(r.getText());
LarkLoginLog larkLoginLog = userInfoMap.get(userName);
larkInviteVo.setUrl(larkLoginLog.getImageUrl()); larkInviteVo.setUrl(larkLoginLog.getImageUrl());
larkInviteVo.setText(larkLoginLog.getUserName()); larkInviteVo.setText(larkLoginLog.getUserName());
larkInviteVo.setTotal(r.getTotal());
return larkInviteVo; return larkInviteVo;
}).collect(Collectors.toList()); }).collect(Collectors.toList());
return result; return result;
@ -92,7 +92,7 @@ public class LarkUserActiveInviteRelatoinServiceImpl implements ILarkUserActiveI
public List<LarkInviteVo> queryMyInviteList(LarkUserActiveInviteRelatoin larkUserActiveInviteRelatoin) { public List<LarkInviteVo> queryMyInviteList(LarkUserActiveInviteRelatoin larkUserActiveInviteRelatoin) {
larkUserActiveInviteRelatoin.setFlag(FlagStatus.OK.getCode()); larkUserActiveInviteRelatoin.setFlag(FlagStatus.OK.getCode());
List<LarkUserActiveInviteRelatoin> larkUserActiveInviteRelatoins = larkUserActiveInviteRelatoinMapper.selectLarkUserActiveInviteRelatoinList(larkUserActiveInviteRelatoin); List<LarkUserActiveInviteRelatoin> larkUserActiveInviteRelatoins = larkUserActiveInviteRelatoinMapper.selectLarkUserActiveInviteRelatoinList(larkUserActiveInviteRelatoin);
Map<String, LarkLoginLog> userInfoMap = queryUserInfoMap(larkUserActiveInviteRelatoins); Map<String, LarkLoginLog> userInfoMap = queryInviteUserInfoMap(larkUserActiveInviteRelatoins);
List<LarkInviteVo> result = larkUserActiveInviteRelatoins.stream().map(r -> { List<LarkInviteVo> result = larkUserActiveInviteRelatoins.stream().map(r -> {
LarkInviteVo larkInviteVo = new LarkInviteVo(); LarkInviteVo larkInviteVo = new LarkInviteVo();
String inviteUserName = r.getInviteUserName(); String inviteUserName = r.getInviteUserName();
@ -110,7 +110,20 @@ public class LarkUserActiveInviteRelatoinServiceImpl implements ILarkUserActiveI
return result; return result;
} }
private Map<String, LarkLoginLog> queryUserInfoMap(List<LarkUserActiveInviteRelatoin> larkUserActiveInviteRelatoins) { private Map<String, LarkLoginLog> queryUserInfoMap(List<LarkInviteVo> larkUserActiveInviteRelatoins) {
if (CollectionUtils.isEmpty(larkUserActiveInviteRelatoins)) {
return new HashMap<>();
}
List<String> openIdList = larkUserActiveInviteRelatoins.stream()
.filter(r -> {
return StringUtils.isNotBlank(r.getText());
})
.map(LarkInviteVo::getText)
.distinct().collect(Collectors.toList());
return larkLoginLogService.queryByOpenId(openIdList);
}
private Map<String, LarkLoginLog> queryInviteUserInfoMap(List<LarkUserActiveInviteRelatoin> larkUserActiveInviteRelatoins) {
if (CollectionUtils.isEmpty(larkUserActiveInviteRelatoins)) { if (CollectionUtils.isEmpty(larkUserActiveInviteRelatoins)) {
return new HashMap<>(); return new HashMap<>();
} }

@ -35,14 +35,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</where> </where>
</select> </select>
<select id="queryTopTen" parameterType="com.ruoyi.flyingbook.domain.LarkUserActiveInviteRelatoin" resultMap="LarkUserActiveInviteRelatoinResult"> <resultMap type="com.ruoyi.flyingbook.domain.larkactive.LarkInviteVo" id="queryTopTen">
<result property="text" column="user_name" />
<result property="total" column="total" />
</resultMap>
<select id="queryTopTen" parameterType="com.ruoyi.flyingbook.domain.LarkUserActiveInviteRelatoin" resultMap="queryTopTen">
SELECT SELECT
id,
company_id,
company_name,
user_name, user_name,
invite_user_name,
invite_stage,
COUNT(id) as total COUNT(id) as total
FROM FROM
lark_user_active_invite_relatoin lark_user_active_invite_relatoin

Loading…
Cancel
Save