Commit 38f3e579 authored by zhangsen's avatar zhangsen

改bug

parent 9c6f1d95
...@@ -1141,6 +1141,11 @@ public class ExcelServiceImpl { ...@@ -1141,6 +1141,11 @@ public class ExcelServiceImpl {
List<FireTeam> excelEntityList = new ArrayList<>(); List<FireTeam> excelEntityList = new ArrayList<>();
excelDtoList.forEach(item -> { excelDtoList.forEach(item -> {
if (StringUtils.isEmpty(item.getCompanyCode()) || StringUtils.isEmpty(item.getName()) ||
StringUtils.isEmpty(item.getTypeCode()) || StringUtils.isEmpty(item.getAddress()) ||
StringUtils.isEmpty(item.getLatitude()) || StringUtils.isEmpty(item.getLongitude())) {
throw new BadRequest("请检查必填项是否为空");
}
FireTeam fireTeam = new FireTeam(); FireTeam fireTeam = new FireTeam();
fireTeam = Bean.toPo(item, fireTeam); fireTeam = Bean.toPo(item, fireTeam);
fireTeam = Bean.toPo(getCurrentInfo(), fireTeam); fireTeam = Bean.toPo(getCurrentInfo(), fireTeam);
......
...@@ -2,6 +2,7 @@ package com.yeejoin.amos.knowledgebase.face.orm.dao; ...@@ -2,6 +2,7 @@ package com.yeejoin.amos.knowledgebase.face.orm.dao;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yeejoin.amos.knowledgebase.face.orm.entity.KnowledgeTag; import com.yeejoin.amos.knowledgebase.face.orm.entity.KnowledgeTag;
import org.apache.ibatis.annotations.Param;
import java.util.List; import java.util.List;
...@@ -17,4 +18,11 @@ public interface TagMapper extends BaseMapper<KnowledgeTag> { ...@@ -17,4 +18,11 @@ public interface TagMapper extends BaseMapper<KnowledgeTag> {
List<KnowledgeTag> queryTagByNameInPublishedDoc(String tagName); List<KnowledgeTag> queryTagByNameInPublishedDoc(String tagName);
/**
* 统计标签被引用数量
* @param sequenceNbr
* @param quoteType
* @return
*/
Integer queryCountByTagSeq(@Param("sequenceNbr") Long sequenceNbr, @Param("quoteType") String quoteType);
} }
\ No newline at end of file
...@@ -57,7 +57,13 @@ public class TagService extends BaseService<KnowledgeTagModel, KnowledgeTag, Tag ...@@ -57,7 +57,13 @@ public class TagService extends BaseService<KnowledgeTagModel, KnowledgeTag, Tag
private DocContentService docContentService; private DocContentService docContentService;
@Autowired @Autowired
private ConfigLoader configLoader; private ConfigLoader configLoader;
@Autowired
private TagMapper tagMapper;
/**
* 统计方式-文档是否发布
*/
public static final String QUOTE_TYPE_PUBLISHED = "PUBLISHED";
/** /**
* 创建标签 * 创建标签
...@@ -169,7 +175,10 @@ public class TagService extends BaseService<KnowledgeTagModel, KnowledgeTag, Tag ...@@ -169,7 +175,10 @@ public class TagService extends BaseService<KnowledgeTagModel, KnowledgeTag, Tag
for (KnowledgeTag tag : tagList) { for (KnowledgeTag tag : tagList) {
KnowledgeTagModel tagModel = Bean.toModel(tag, new KnowledgeTagModel()); KnowledgeTagModel tagModel = Bean.toModel(tag, new KnowledgeTagModel());
//加入引用数量 //加入引用数量
tagModel.setReferenceNumber(getAllReference(tagModel.getSequenceNbr())); // tagModel.setReferenceNumber(getAllReference(tagModel.getSequenceNbr()));
//被引用且已发布数量
Integer num = tagMapper.queryCountByTagSeq(tagModel.getSequenceNbr(), QUOTE_TYPE_PUBLISHED);
tagModel.setReferenceNumber(num);
//获取拼音首字母 //获取拼音首字母
String pinyin; String pinyin;
try { try {
......
...@@ -18,4 +18,15 @@ ...@@ -18,4 +18,15 @@
WHERE DOC_STATUS = "PUBLISHED")) WHERE DOC_STATUS = "PUBLISHED"))
AND TAG_NAME LIKE CONCAT('%', #{tagName},'%') AND TAG_NAME LIKE CONCAT('%', #{tagName},'%')
</select> </select>
<select id="queryCountByTagSeq" resultType="java.lang.Integer">
SELECT
count( ti.SEQUENCE_NBR )
FROM
knowledge_tag_instance ti
LEFT JOIN knowledge_doc_content dc ON dc.SEQUENCE_NBR = ti.TARGET_SEQ
WHERE
ti.TAG_SEQ = #{sequenceNbr}
AND dc.DOC_STATUS = #{quoteType}
</select>
</mapper> </mapper>
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