Commit fc81388b by 阳浪

今日登党务直通收藏量(人)

parent 8a9a4955
......@@ -28,7 +28,8 @@ public interface EventTrackApiClients {
DayNumVo getNumByType(@RequestParam(value = "date",required = false) String date, @RequestParam("types")List<Integer> types);
@GetMapping("/api/eventTrack/queryNumByType")
List<EventTrackTypeNumVo> queryNumByType(@RequestParam(value = "date",required = false) String date, @RequestParam("types")List<Integer> types);
List<EventTrackTypeNumVo> queryNumByType(@RequestParam(value = "date",required = false) String date, @RequestParam("types")List<Integer> types,
@RequestParam(value = "subName",required = false) String subName);
@GetMapping("/api/eventTrack/queryDeptByType")
List<EventTrackDeptNumVo> queryDeptByType(@RequestParam(value = "date",required = false) String date, @RequestParam("types")List<Integer> types);
......
......@@ -43,8 +43,9 @@ public class EventTrackController {
}
@GetMapping("/api/eventTrack/queryNumByType")
public List<EventTrackTypeNumVo> queryNumByType(@RequestParam(value = "date",required = false) String date, @RequestParam("types")List<Integer> types){
return eventTrackService.queryNumByType(date,types);
public List<EventTrackTypeNumVo> queryNumByType(@RequestParam(value = "date",required = false) String date, @RequestParam("types")List<Integer> types
,@RequestParam(value = "subName",required = false) String subName){
return eventTrackService.queryNumByType(date,types,subName);
}
@GetMapping("/api/eventTrack/queryDeptByType")
......
......@@ -23,7 +23,7 @@ public interface EventTrackMapper extends BaseMapper<EventTrack> {
DayNumVo getNumByType(@Param("date") String date,@Param("dateString") String dateString,@Param("types")List<Integer> types);
List<EventTrackTypeNumVo> queryNumByType(@Param("deptId") Long deptId,@Param("date") String date,@Param("dateString") String dateString,@Param("types")List<Integer> types);
List<EventTrackTypeNumVo> queryNumByType(@Param("deptId") Long deptId,@Param("date") String date,@Param("dateString") String dateString,@Param("types")List<Integer> types,@Param("subNameList")List<String> subNameList);
List<EventTrackDeptNumVo> queryDeptByType(@Param("date") String date,@Param("dateString") String dateString, @Param("types")List<Integer> types);
......
......@@ -25,7 +25,7 @@ public interface EventTrackService extends IService<EventTrack> {
DayNumVo getNumByType(String date,List<Integer> types);
List<EventTrackTypeNumVo> queryNumByType(String date,List<Integer> types);
List<EventTrackTypeNumVo> queryNumByType(String date,List<Integer> types,String subName);
List<EventTrackDeptNumVo> queryDeptByType(String date, List<Integer> types);
}
package com.yizhi.site.application.service.impl;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.collection.CollectionUtil;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import com.yizhi.application.orm.id.IdGenerator;
......@@ -27,6 +28,7 @@ import org.springframework.stereotype.Service;
import org.springframework.util.ObjectUtils;
import java.util.*;
import java.util.stream.Collectors;
/**
* com.yizhi.site.application.service.impl
......@@ -141,12 +143,48 @@ public class EventTrackServiceImpl extends ServiceImpl<EventTrackMapper, EventTr
}
@Override
public List<EventTrackTypeNumVo> queryNumByType(String date,List<Integer> types) {
public List<EventTrackTypeNumVo> queryNumByType(String date,List<Integer> types,String subName) {
if(ObjectUtils.isEmpty(date)){
date = "3";
}
String dateString =getDateString(date);
return this.baseMapper.queryNumByType(null,date,dateString,types);
Long id = null;
if(!ObjectUtils.isEmpty(subName)) {
String key = "event_track_type";
List<Dictionary> dictionaryList = dictionaryFeignClients.listChildDictionary(key, false, 1);
if (CollUtil.isNotEmpty(dictionaryList)) {
Optional<Dictionary> optional = dictionaryList.stream().filter(d -> Objects.equals(d.getValue(), "6")&&Objects.equals(d.getCnName(), subName)).findFirst();
if (optional != null && optional.isPresent()) {
Dictionary dictionary = optional.get();
id = Long.valueOf(dictionary.getCode());
}
}
}
List<String> subNameList = null;
if(id!=null) {
List<DataClassification> classificationList = dataClassificationService.getSon(id);
if(CollectionUtil.isNotEmpty(classificationList)){
subNameList = classificationList.stream().map(DataClassification::getName).collect(Collectors.toList());
}
}
List<EventTrackTypeNumVo> eventTrackTypeNumVoList = this.baseMapper.queryNumByType(null,date,dateString,types,subNameList);
if(CollectionUtil.isNotEmpty(subNameList)){
subNameList.stream().forEach(name->{
EventTrackTypeNumVo eventTrackTypeNumVo = new EventTrackTypeNumVo();
eventTrackTypeNumVo.setNum(0);
eventTrackTypeNumVo.setSubType(name);
if(CollectionUtil.isNotEmpty(eventTrackTypeNumVoList)){
Optional optional = eventTrackTypeNumVoList.stream().filter(e->Objects.equals(e.getSubType(),name)).findFirst();
if(optional==null||!optional.isPresent()){
eventTrackTypeNumVoList.add(eventTrackTypeNumVo);
}
}else{
eventTrackTypeNumVoList.add(eventTrackTypeNumVo);
}
});
}
return eventTrackTypeNumVoList;
}
@Override
......@@ -160,7 +198,7 @@ public class EventTrackServiceImpl extends ServiceImpl<EventTrackMapper, EventTr
if(CollUtil.isNotEmpty(eventTrackDeptNumVoList)){
String finalDate = date;
eventTrackDeptNumVoList.stream().forEach(eventTrackDeptNumVo -> {
eventTrackDeptNumVo.setEventTrackTypeNumVoList(this.baseMapper.queryNumByType(eventTrackDeptNumVo.getDeptId(),finalDate, dateString,types));
eventTrackDeptNumVo.setEventTrackTypeNumVoList(this.baseMapper.queryNumByType(eventTrackDeptNumVo.getDeptId(),finalDate, dateString,types,null));
});
}
return eventTrackDeptNumVoList;
......
......@@ -178,6 +178,15 @@ public class PublicationServiceImpl extends ServiceImpl<PublicationMapper, Publi
if(jsonArray.size()>0){
information.setLogoPath(jsonArray.getString(0));
information.setPdfOssUrl(selectById.getOssUrl());
String imgDiv = "<p></p><div class=\"media-wrap image-wrap\"><img id=\"%s\" title=\"%s\" alt=\"image\" src=\"%s\"/></div><p></p>\n";
String content = selectById.getContent();
if(content==null){
content ="";
}
for(int i = 0;i<jsonArray.size();i++){
content+=String.format(imgDiv,i,i,jsonArray.getString(i));
}
information.setContent(content);
}
}catch (Exception e){
}
......
......@@ -70,6 +70,7 @@
AND b.state = 2
GROUP BY
a.id
order by sort
</select>
<select id="selectClassification" resultType="com.yizhi.site.application.vo.domain.DataClassificationVo">
......
......@@ -37,6 +37,12 @@
#{item}
</foreach>
</if>
<if test="subNameList!=null and subNameList.size()>0">
AND e.sub_type IN
<foreach collection="subNameList" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<if test="deptId!=null">
and e.dept_id = #{deptId}
</if>
......
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