Browse Source

获取草稿属性、获取草稿内容接口bug修改

dev_shibei_match
yinzuomei 5 years ago
parent
commit
64cbf028ce
  1. 10
      epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/DraftServiceImpl.java
  2. 95
      epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/DraftDao.xml

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

@ -128,6 +128,14 @@ public class DraftServiceImpl extends BaseServiceImpl<DraftDao, DraftEntity> imp
@Override
public DraftContentResultDTO queryDraftContent(DraftDetailFormDTO formDTO) {
DraftContentResultDTO draftContentResultDTO = baseDao.selectDraftContent(formDTO.getDraftId());
/*for(DraftContentDetailDTO contentDetailDTO:draftContentResultDTO.getContentList()){
if(StringUtils.isBlank(contentDetailDTO.getAuditReason())){
contentDetailDTO.setAuditReason("");
}
if(StringUtils.isBlank(contentDetailDTO.getAuditStatus())){
contentDetailDTO.setAuditStatus("");
}
}*/
return draftContentResultDTO;
}
@ -142,6 +150,8 @@ public class DraftServiceImpl extends BaseServiceImpl<DraftDao, DraftEntity> imp
if (StringUtils.isNotBlank(draftAttrResultDTO.getTags())) {
String[] tagNames = draftAttrResultDTO.getTags().split("\\|");
draftAttrResultDTO.setTagNameList(tagNames);
}else{
draftAttrResultDTO.setTagNameList(new String[0]);
}
} else {
logger.error(String.format("查询草稿属性失败,草稿id=%s", formDTO.getDraftId()));

95
epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/DraftDao.xml

@ -25,17 +25,30 @@
<!-- 政府端查询草稿内容详情 -->
<select id="selectDraftContentDetail" parameterType="java.lang.String" resultType="com.epmet.dto.result.DraftContentDetailDTO">
SELECT
dc.ID,
dc.CONTENT,
dc.CONTENT_TYPE,
dc.ORDER_NUM,
dc.AUDIT_STATUS,
dc.AUDIT_REASON
dc.ID,
dc.CONTENT,
dc.CONTENT_TYPE,
dc.ORDER_NUM,
(case
when dc.AUDIT_STATUS is null then ""
when LENGTH(dc.AUDIT_STATUS)&lt;=1 THEN ""
WHEN DC.AUDIT_STATUS="null" then ""
else dc.AUDIT_STATUS
end ) as AUDIT_STATUS,
dc.AUDIT_STATUS as "AUDIT_STATUS原来的值",
(
CASE WHEN dc.AUDIT_REASON IS NULL THEN ""
WHEN dc.AUDIT_REASON&lt;=1 THEN ""
WHEN dc.AUDIT_REASON="null" then ""
else dc.AUDIT_REASON
end
)as AUDIT_REASON,
dc.AUDIT_REASON as "AUDIT_REASON原来的值"
FROM
draft_content dc
draft_content dc
WHERE
dc.DEL_FLAG = '0'
AND dc.DRAFT_ID = #{draftId}
dc.DEL_FLAG = '0'
AND dc.DRAFT_ID = #{draftId}
ORDER BY
dc.ORDER_NUM ASC
</select>
@ -43,21 +56,59 @@
<!-- 政府端:选中草稿编辑,获取草稿属性 -->
<select id="selectDraftAttr" parameterType="java.lang.String" resultType="com.epmet.dto.result.DraftAttrResultDTO">
SELECT
id AS DRAFT_ID,
IS_TOP,
PUBLISHER_ID AS PUBLISHER,
PUBLISHER_NAME,
PUBLISH_DATE,
TITLE,
PUBLISH_RANGE_DESC,
PUBLISHER_TYPE,
TAGS
id AS DRAFT_ID,
IS_TOP,
(
CASE WHEN PUBLISHER_ID IS NULL THEN ""
WHEN LENGTH(PUBLISHER_ID)&lt;=1 THEN ""
when PUBLISHER_ID="null" then ""
ELSE PUBLISHER_ID
END
) AS PUBLISHER,
PUBLISHER_ID as "PUBLISHER_ID原来的值",
(
case when PUBLISHER_NAME is NULL THEN ""
when LENGTH(PUBLISHER_NAME)&lt;=1 THEN ""
when PUBLISHER_NAME="null" then ""
ELSE PUBLISHER_NAME
END
)as PUBLISHER_NAME,
PUBLISHER_NAME as "PUBLISHER_NAME原来的值",
(CASE
WHEN PUBLISH_DATE IS NULL THEN CURDATE()
ELSE PUBLISH_DATE
END )AS PUBLISH_DATE,
TITLE,
(
CASE WHEN PUBLISH_RANGE_DESC IS NULL THEN ""
WHEN LENGTH(PUBLISH_RANGE_DESC)&lt;=1 THEN ""
when PUBLISH_RANGE_DESC="null" then ""
ELSE PUBLISH_RANGE_DESC
END
)AS PUBLISH_RANGE_DESC,
PUBLISH_RANGE_DESC as "PUBLISH_RANGE_DESC原来的值",
(
CASE WHEN PUBLISHER_TYPE IS NULL THEN ""
WHEN LENGTH(PUBLISHER_TYPE) &lt;=1 THEN ""
when PUBLISHER_TYPE="null" then ""
ELSE PUBLISHER_TYPE
END
)AS PUBLISHER_TYPE,
PUBLISHER_TYPE as "PUBLISHER_TYPE原来的值",
(
CASE when TAGS IS NULL THEN ""
WHEN LENGTH(TAGS)&lt;=1 THEN ""
when TAGS="null" then ""
ELSE TAGS
END
)TAGS,
TAGS as "TAGS原来的值"
FROM
draft
draft
WHERE
DEL_FLAG = '0'
and STATUS_FLAG!='published'
and id=#{draftId}
DEL_FLAG = '0'
and STATUS_FLAG!='published'
and id=#{draftId}
</select>
<!-- 政府端:选中草稿编辑,获取草稿属性-封面信息 -->

Loading…
Cancel
Save