Browse Source

程序调整

feature/evaluate
sunyuchao 3 years ago
parent
commit
1c3f48d7fa
  1. 4
      epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/ArticleListFormDTO.java
  2. 4
      epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/DraftListFormDTO.java
  3. 3
      epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/DraftPcListResultDTO.java
  4. 3
      epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/PublishedListResultDTO.java
  5. 17
      epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/ArticleServiceImpl.java
  6. 37
      epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/DraftServiceImpl.java
  7. 28
      epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/ArticleDao.xml

4
epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/ArticleListFormDTO.java

@ -35,11 +35,11 @@ public class ArticleListFormDTO implements Serializable {
*/
private String publishRangeId;
/**
* 开始日期 yyyy-MM-dd HH:mm:ss
* 开始日期 yyyy-MM-dd
*/
private String startDate;
/**
* 结束日期 yyyy-MM-dd HH:mm:ss
* 结束日期 yyyy-MM-dd
*/
private String endDate;
/**

4
epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/DraftListFormDTO.java

@ -18,11 +18,11 @@ public class DraftListFormDTO implements Serializable {
*/
private String title;
/**
* 开始日期 yyyy-MM-dd HH:mm:ss
* 开始日期 yyyy-MM-dd
*/
private String startDate;
/**
* 结束日期 yyyy-MM-dd HH:mm:ss
* 结束日期 yyyy-MM-dd
*/
private String endDate;
/**

3
epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/DraftPcListResultDTO.java

@ -5,7 +5,6 @@ import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
import java.util.LinkedList;
import java.util.List;
/**
@ -96,6 +95,6 @@ public class DraftPcListResultDTO implements Serializable {
/**
* 文章内容
*/
private LinkedList<String> contentList;
private List<String> contentList;
}

3
epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/PublishedListResultDTO.java

@ -5,7 +5,6 @@ import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
import java.util.LinkedList;
import java.util.List;
/**
@ -98,5 +97,5 @@ public class PublishedListResultDTO implements Serializable {
/**
* 文章内容
*/
private LinkedList<String> contentList;
private List<String> contentList;
}

17
epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/ArticleServiceImpl.java

@ -34,7 +34,6 @@ import com.epmet.commons.tools.redis.common.CustomerOrgRedis;
import com.epmet.commons.tools.redis.common.CustomerStaffRedis;
import com.epmet.commons.tools.redis.common.bean.AgencyInfoCache;
import com.epmet.commons.tools.redis.common.bean.GridInfoCache;
import com.epmet.commons.tools.redis.common.CustomerStaffRedis;
import com.epmet.commons.tools.scan.param.ImgScanParamDTO;
import com.epmet.commons.tools.scan.param.ImgTaskDTO;
import com.epmet.commons.tools.scan.param.TextScanParamDTO;
@ -1701,7 +1700,7 @@ public class ArticleServiceImpl extends BaseServiceImpl<ArticleDao, ArticleEntit
if (!CollectionUtils.isEmpty(list)) {
list.forEach(l->{
l.setTagNameList(StringUtils.isNotBlank(l.getTags())?Arrays.asList(l.getTags().split("[|]")):new ArrayList<>());
l.setIsMePublished(l.getCreatedBy().equals(loginUserUtil.getLoginUserId())?true:false);
l.setIsMePublished(l.getCreatedBy().equals(formDTO.getStaffId())?true:false);
});
}
@ -1716,6 +1715,8 @@ public class ArticleServiceImpl extends BaseServiceImpl<ArticleDao, ArticleEntit
if (!CollectionUtils.isEmpty(list)) {
resultDTO = list.get(NumConstant.ZERO);
resultDTO.setTagNameList(StringUtils.isNotBlank(resultDTO.getTags())?Arrays.asList(resultDTO.getTags().split("[|]")):new ArrayList<>());
resultDTO.setIsMePublished(resultDTO.getCreatedBy().equals(formDTO.getStaffId())?true:false);
//查询文章涉及的发布范围网络Id列表
LambdaQueryWrapper<ArticlePublishRangeEntity> tWrapper = new LambdaQueryWrapper<>();
tWrapper.eq(ArticlePublishRangeEntity::getArticleId, formDTO.getArticleId());
@ -1739,9 +1740,19 @@ public class ArticleServiceImpl extends BaseServiceImpl<ArticleDao, ArticleEntit
tWrapper1.orderByDesc(ArticleContentEntity::getOrderNum);
List<ArticleContentEntity> contentEntityList = articleContentDao.selectList(tWrapper1);
if (!CollectionUtils.isEmpty(entityList)) {
LinkedList<String> contentList = (LinkedList)contentEntityList.stream().map(ArticleContentEntity::getContent).collect(Collectors.toList());
List<String> contentList = contentEntityList.stream().map(ArticleContentEntity::getContent).collect(Collectors.toList());
resultDTO.setContentList(contentList);
}
//标签列表
LambdaQueryWrapper<ArticleTagsEntity> tWrapper2 = new LambdaQueryWrapper<>();
tWrapper2.eq(ArticleTagsEntity::getArticleId, formDTO.getArticleId());
tWrapper2.eq(ArticleTagsEntity::getDelFlag, NumConstant.ZERO_STR);
List<ArticleTagsEntity> tagsEntityList = articleTagsDao.selectList(tWrapper2);
if (!CollectionUtils.isEmpty(tagsEntityList)) {
List<String> contentList = tagsEntityList.stream().map(ArticleTagsEntity::getTagId).collect(Collectors.toList());
resultDTO.setTagIdList(contentList);
}
}
return resultDTO;

37
epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/DraftServiceImpl.java

@ -28,13 +28,9 @@ import com.epmet.commons.tools.exception.EpmetException;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.redis.common.CustomerStaffRedis;
import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.security.user.LoginUserUtil;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.constant.DraftConstant;
import com.epmet.dao.DraftContentDao;
import com.epmet.dao.DraftCoverDao;
import com.epmet.dao.DraftDao;
import com.epmet.dao.DraftPublishRangeDao;
import com.epmet.dao.*;
import com.epmet.dto.DraftDTO;
import com.epmet.dto.form.DeleteDraftFormDTO;
import com.epmet.dto.form.DraftDetailFormDTO;
@ -52,7 +48,10 @@ import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils;
import java.util.*;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
/**
@ -68,11 +67,11 @@ public class DraftServiceImpl extends BaseServiceImpl<DraftDao, DraftEntity> imp
@Autowired
private DraftCoverDao draftCoverDao;
@Autowired
private LoginUserUtil loginUserUtil;
@Autowired
private DraftPublishRangeDao draftPublishRangeDao;
@Autowired
private DraftContentDao draftContentDao;
@Autowired
private TagCustomerDao tagCustomerDao;
@Override
public PageData<DraftDTO> page(Map<String, Object> params) {
@ -231,7 +230,7 @@ public class DraftServiceImpl extends BaseServiceImpl<DraftDao, DraftEntity> imp
if (!CollectionUtils.isEmpty(list)) {
list.forEach(l->{
l.setTagNameList(StringUtils.isNotBlank(l.getTags())?Arrays.asList(l.getTags().split("[|]")):new ArrayList<>());
l.setIsMePublished(l.getCreatedBy().equals(loginUserUtil.getLoginUserId())?true:false);
l.setIsMePublished(l.getCreatedBy().equals(formDTO.getStaffId())?true:false);
});
}
@ -246,6 +245,8 @@ public class DraftServiceImpl extends BaseServiceImpl<DraftDao, DraftEntity> imp
if (!CollectionUtils.isEmpty(list)) {
resultDTO = list.get(NumConstant.ZERO);
resultDTO.setTagNameList(StringUtils.isNotBlank(resultDTO.getTags())?Arrays.asList(resultDTO.getTags().split("[|]")):new ArrayList<>());
resultDTO.setIsMePublished(resultDTO.getCreatedBy().equals(formDTO.getStaffId())?true:false);
//查询文章涉及的发布范围网络Id列表
LambdaQueryWrapper<DraftPublishRangeEntity> tWrapper = new LambdaQueryWrapper<>();
tWrapper.eq(DraftPublishRangeEntity::getDraftId, formDTO.getDraftId());
@ -268,10 +269,24 @@ public class DraftServiceImpl extends BaseServiceImpl<DraftDao, DraftEntity> imp
tWrapper1.eq(DraftContentEntity::getDelFlag, NumConstant.ZERO_STR);
tWrapper1.orderByDesc(DraftContentEntity::getOrderNum);
List<DraftContentEntity> contentEntityList = draftContentDao.selectList(tWrapper1);
if (!CollectionUtils.isEmpty(entityList)) {
LinkedList<String> contentList = (LinkedList)contentEntityList.stream().map(DraftContentEntity::getContent).collect(Collectors.toList());
if (!CollectionUtils.isEmpty(contentEntityList)) {
List<String> contentList = contentEntityList.stream().map(DraftContentEntity::getContent).collect(Collectors.toList());
resultDTO.setContentList(contentList);
}
//标签列表
if(!CollectionUtils.isEmpty(resultDTO.getTagNameList())){
LambdaQueryWrapper<TagCustomerEntity> tWrapper2 = new LambdaQueryWrapper<>();
tWrapper2.eq(TagCustomerEntity::getCustomerId, formDTO.getCustomerId());
tWrapper2.in(TagCustomerEntity::getTagName, resultDTO.getTagNameList());
tWrapper2.eq(TagCustomerEntity::getDelFlag, NumConstant.ZERO_STR);
List<TagCustomerEntity> tagEntityList = tagCustomerDao.selectList(tWrapper2);
if (!CollectionUtils.isEmpty(tagEntityList)) {
List<String> contentList = tagEntityList.stream().map(TagCustomerEntity::getId).collect(Collectors.toList());
resultDTO.setTagIdList(contentList);
}
}
}
return resultDTO;

28
epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/ArticleDao.xml

@ -469,14 +469,26 @@
<if test="endDate != null and endDate.trim() != ''">
<![CDATA[AND a.publish_date <= #{endDate}]]>
</if>
<choose>
<when test='publishRangeType == "agency"'>
AND a.org_id_path like concat('%', #{publishRangeId}, '%')
</when>
<otherwise>
AND a.publisher_id = #{publishRangeId}
</otherwise>
</choose>
<if test="publishRangeType != null and publishRangeType.trim() != '' and publishRangeId != null and publishRangeId.trim() != ''">
<choose>
<when test='publishRangeType == "agency"'>
AND EXISTS(
SELECT 1 FROM article_publish_range
WHERE del_flag = '0'
AND article_id = a.id
AND agency_id = #{publishRangeId}
)
</when>
<otherwise>
AND EXISTS(
SELECT 1 FROM article_publish_range
WHERE del_flag = '0'
AND article_id = a.id
AND grid_id = #{publishRangeId}
)
</otherwise>
</choose>
</if>
<if test="tagIds !=null and tagIds.size() > 0">
<foreach collection="tagIds" item="tagId" separator=" ">
AND EXISTS(

Loading…
Cancel
Save