Commit 8a9a4955 by 阳浪

咨询管理优化

parent 5f971663
......@@ -103,11 +103,29 @@ public class InformationVo{
@ApiModelProperty(value = "图片来源")
private String imgSource;
@ApiModelProperty(value = "信息来源")
private String source;
private String typeThreeName;
@ApiModelProperty(value = "资讯分类")
private List<InformationClassify> informationClassify;
@ApiModelProperty(value = "阅读数量")
private Integer readNum = 0;
@ApiModelProperty(value = "点赞数量")
private Integer admireNum = 0;
@ApiModelProperty(value = "收藏数量")
private Integer favoriteNum = 0;
@ApiModelProperty(value = "转发数量")
private Integer relayNum = 0;
@ApiModelProperty(value = "专题")
private String topic;
protected Serializable pkVal() {
return this.id;
}
......
......@@ -137,6 +137,30 @@ public class Information extends Model<Information> {
@TableField(exist = false)
private List<InformationClassify> informationClassify;
@ApiModelProperty(value = "阅读数量")
@TableField(exist = false)
private Integer readNum = 0;
@ApiModelProperty(value = "点赞数量")
@TableField(exist = false)
private Integer admireNum = 0;
@ApiModelProperty(value = "收藏数量")
@TableField(exist = false)
private Integer favoriteNum = 0;
@ApiModelProperty(value = "转发数量")
@TableField(exist = false)
private Integer relayNum = 0;
@ApiModelProperty(value = "信息来源")
@TableField("source")
private String source;
@ApiModelProperty(value = "专题")
@TableField("topic")
private String topic;
@Override
protected Serializable pkVal() {
return this.id;
......
......@@ -26,4 +26,6 @@ public interface EventTrackMapper extends BaseMapper<EventTrack> {
List<EventTrackTypeNumVo> queryNumByType(@Param("deptId") Long deptId,@Param("date") String date,@Param("dateString") String dateString,@Param("types")List<Integer> types);
List<EventTrackDeptNumVo> queryDeptByType(@Param("date") String date,@Param("dateString") String dateString, @Param("types")List<Integer> types);
Integer getNum(@Param("type")Integer type, @Param("businessId")Long businessId);
}
......@@ -21,6 +21,8 @@ public interface EventTrackService extends IService<EventTrack> {
EventTrackDayNumVo getTodayNum(String date);
Integer getNum(String typeStr,Long businessId);
DayNumVo getNumByType(String date,List<Integer> types);
List<EventTrackTypeNumVo> queryNumByType(String date,List<Integer> types);
......
......@@ -86,7 +86,7 @@ public class EventTrackServiceImpl extends ServiceImpl<EventTrackMapper, EventTr
if(optional!=null&&optional.isPresent()){
Dictionary dictionary = optional.get();
eventTrack.setSubType(dictionary.getCnName());
eventTrack.setType(Integer.valueOf(dictionary.getDescription()));
eventTrack.setType(Integer.valueOf(dictionary.getValue()));
}
}
if(Objects.equals(type,"event_login")){
......@@ -111,6 +111,26 @@ public class EventTrackServiceImpl extends ServiceImpl<EventTrackMapper, EventTr
return this.baseMapper.getTodayNum(date);
}
@Override
public Integer getNum(String typeStr,Long businessId){
String key = "event_track_type";
Integer type = 0;
List<Dictionary> dictionaryList = dictionaryFeignClients.listChildDictionary(key,false,1);
if(CollUtil.isNotEmpty(dictionaryList)){
Optional<Dictionary> optional = dictionaryList.stream().filter(d-> Objects.equals(d.getCode(),typeStr)).findFirst();
if(optional!=null&&optional.isPresent()){
Dictionary dictionary = optional.get();
type =Integer.valueOf(dictionary.getValue());
}
}
if(type==0){
return 0;
}
return this.baseMapper.getNum(type,businessId);
}
@Override
public DayNumVo getNumByType(String date,List<Integer> types) {
if(ObjectUtils.isEmpty(date)){
......
......@@ -61,6 +61,8 @@ public class InformationServiceImpl extends ServiceImpl<InformationMapper, Infor
@Autowired
private InformationMapper informationMapper;
@Autowired
private EventTrackService eventTrackService;
@Autowired
private PortalBannerService portalBannerService;
@Autowired
private DataClassificationService dataClassificationService;
......@@ -1020,6 +1022,10 @@ public class InformationServiceImpl extends ServiceImpl<InformationMapper, Infor
if (info.getTypeThree() != null && info.getTypeThree() != 0) {
info.setTypeThreeName(findNameById(info.getTypeThree()));
}
info.setAdmireNum(eventTrackService.getNum("event_admire_"+info.getTypeOne(),info.getId()));
info.setFavoriteNum(eventTrackService.getNum("event_favorite_"+info.getTypeOne(),info.getId()));
info.setRelayNum(eventTrackService.getNum("event_relay_"+info.getTypeOne(),info.getId()));
info.setReadNum(eventTrackService.getNum(String.valueOf(info.getTypeOne()),info.getId()));
}
}
page.setRecords(list);
......
......@@ -107,4 +107,8 @@
</if>
) a
</select>
<select id="getNum" resultType="java.lang.Integer">
select count(1) from event_track e where e.deleted =0
and e.type=#{type} and e.business_id = #{businessId}
</select>
</mapper>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment