Browse Source

党建声音 人工发布功能相关接口

dev_shibei_match
jianjun 5 years ago
parent
commit
8d76f18e54
  1. 5
      epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/DraftDetailFormDTO.java
  2. 5
      epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/DraftDetailResultDTO.java
  3. 5
      epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/DraftListResultDTO.java
  4. 5
      epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/GovDraftContentDTO.java
  5. 10
      epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/constant/ArticleConstant.java
  6. 626
      epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/ArticleController.java
  7. 16
      epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/DraftController.java
  8. 5
      epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/entity/ArticleEntity.java
  9. 8
      epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/ArticleService.java
  10. 54
      epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/ArticleServiceImpl.java
  11. 14
      epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/DraftServiceImpl.java
  12. 2
      epmet-module/gov-voice/gov-voice-server/src/main/resources/db/migration/V0.0.2__addAutoPublish.sql
  13. 8
      epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/DraftDao.xml

5
epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/DraftDetailFormDTO.java

@ -22,4 +22,9 @@ public class DraftDetailFormDTO implements Serializable {
*/ */
@NotBlank(message = "草稿id不能为空", groups = {DraftDetailFormDTO.AddUserInternalGroup.class}) @NotBlank(message = "草稿id不能为空", groups = {DraftDetailFormDTO.AddUserInternalGroup.class})
private String draftId; private String draftId;
/**
* 是否展示封面
*/
private boolean showCover;
} }

5
epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/DraftDetailResultDTO.java

@ -59,4 +59,9 @@ public class DraftDetailResultDTO implements Serializable {
* 标签名称数组 * 标签名称数组
*/ */
private String[] tagNameList; private String[] tagNameList;
/**
* 封面信息
*/
private CoverImgDTO coverInfo;
} }

5
epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/DraftListResultDTO.java

@ -31,4 +31,9 @@ public class DraftListResultDTO implements Serializable {
* 创建时间 * 创建时间
*/ */
private Long createdTime; private Long createdTime;
/**
* 审核状态
*/
private String auditStatus;
} }

5
epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/GovDraftContentDTO.java

@ -24,4 +24,9 @@ public class GovDraftContentDTO implements Serializable {
*/ */
private String content; private String content;
/**
* 审核状态
*/
private String auditStatus;
} }

10
epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/constant/ArticleConstant.java

@ -56,4 +56,14 @@ public interface ArticleConstant {
* 操作权限异常-自己发表的文章只有自己才能下线 * 操作权限异常-自己发表的文章只有自己才能下线
*/ */
String SHIRO_EXCEPTION = "当前人员不是文章发布者,不能下线文章"; String SHIRO_EXCEPTION = "当前人员不是文章发布者,不能下线文章";
/**
* 发布方式 人工强制发布 不审核
*/
String PUBLISH_WAY_MANUAL = "manualNoAudit";
/**
* 发布方式 api审核后自动发布
*/
String PUBLISH_WAY_AUTO_AUDIT = "autoAudit";
} }

626
epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/ArticleController.java

@ -53,307 +53,329 @@ import java.util.List;
@RequestMapping("article") @RequestMapping("article")
public class ArticleController { public class ArticleController {
@Autowired @Autowired
private ArticleService articleService; private ArticleService articleService;
@Autowired @Autowired
private ArticleOperateRecordService articleOperateRecordService; private ArticleOperateRecordService articleOperateRecordService;
@Autowired @Autowired
private DraftService draftService; private DraftService draftService;
/** /**
* @param tokenDTO * @param tokenDTO
* @return * @return
* @Author sun * @Author sun
* @Description 党建声音-政府端-可选发布范围 * @Description 党建声音-政府端-可选发布范围
**/ **/
@PostMapping("agencygridlist") @PostMapping("agencygridlist")
public Result<ArticleAgencyGridListResultDTO> agencyGridList(@LoginUser TokenDto tokenDTO) { public Result<ArticleAgencyGridListResultDTO> agencyGridList(@LoginUser TokenDto tokenDTO) {
ArticleAgencyGridListResultDTO agencyGridList = new ArticleAgencyGridListResultDTO(); ArticleAgencyGridListResultDTO agencyGridList = new ArticleAgencyGridListResultDTO();
agencyGridList.setAgencyGridList(articleService.agencyGridList(tokenDTO)); agencyGridList.setAgencyGridList(articleService.agencyGridList(tokenDTO));
return new Result<ArticleAgencyGridListResultDTO>().ok(agencyGridList); return new Result<ArticleAgencyGridListResultDTO>().ok(agencyGridList);
} }
/** /**
* desc:政府端-点击返回按钮时点击保存草稿 无需校验参数 * desc:政府端-点击返回按钮时点击保存草稿 无需校验参数
* @param fromDTO *
* @throws Exception * @param fromDTO
*/ * @throws Exception
@PostMapping("savedraft") */
@RequirePermission(requirePermission = RequirePermissionEnum.WORK_PARTY_VOICE_PUBLISH) @PostMapping("savedraft")
public Result<DraftContentSaveResultDTO> savedraft(@LoginUser TokenDto tokenDto,@RequestBody DraftContentFromDTO fromDTO) throws Exception { @RequirePermission(requirePermission = RequirePermissionEnum.WORK_PARTY_VOICE_PUBLISH)
DraftContentSaveResultDTO draftDTO = articleService.saveDraft(tokenDto, fromDTO); public Result<DraftContentSaveResultDTO> savedraft(@LoginUser TokenDto tokenDto, @RequestBody DraftContentFromDTO fromDTO) throws Exception {
return new Result<DraftContentSaveResultDTO>().ok(draftDTO); DraftContentSaveResultDTO draftDTO = articleService.saveDraft(tokenDto, fromDTO);
} return new Result<DraftContentSaveResultDTO>().ok(draftDTO);
}
/**
* desc:保存或修改草稿内容 /**
* @param fromDTO * desc:保存或修改草稿内容
* @throws Exception *
*/ * @param fromDTO
@PostMapping("savecontent") * @throws Exception
@RequirePermission(requirePermission = RequirePermissionEnum.WORK_PARTY_VOICE_PUBLISH) */
public Result<DraftContentSaveResultDTO> saveOrUpdateContent(@LoginUser TokenDto tokenDto,@RequestBody DraftContentFromDTO fromDTO) throws Exception { @PostMapping("savecontent")
DraftContentSaveResultDTO resultDTO = articleService.saveOrUpdateContent(tokenDto, fromDTO, true); @RequirePermission(requirePermission = RequirePermissionEnum.WORK_PARTY_VOICE_PUBLISH)
return new Result<DraftContentSaveResultDTO>().ok(resultDTO); public Result<DraftContentSaveResultDTO> saveOrUpdateContent(@LoginUser TokenDto tokenDto, @RequestBody DraftContentFromDTO fromDTO) throws Exception {
} DraftContentSaveResultDTO resultDTO = articleService.saveOrUpdateContent(tokenDto, fromDTO, true);
return new Result<DraftContentSaveResultDTO>().ok(resultDTO);
/** }
* @param formDTO
* @return com.epmet.commons.tools.utils.Result<java.util.List<com.epmet.dto.form.ArticleOperationResultDTO>> /**
* @author yinzuomei@elink-cn.com * @param formDTO
* @description 政府端查询文章操作记录 * @return com.epmet.commons.tools.utils.Result<java.util.List < com.epmet.dto.form.ArticleOperationResultDTO>>
* @date 2020/6/2 16:50 * @author yinzuomei@elink-cn.com
**/ * @description 政府端查询文章操作记录
@PostMapping("oprationlist") * @date 2020/6/2 16:50
public Result<List<ArticleOperationResultDTO>> operationList(@RequestBody ArticleOperationFormDTO formDTO) { **/
ValidatorUtils.validateEntity(formDTO, ArticleOperationFormDTO.AddUserInternalGroup.class); @PostMapping("oprationlist")
List<ArticleOperationResultDTO> list = public Result<List<ArticleOperationResultDTO>> operationList(@RequestBody ArticleOperationFormDTO formDTO) {
articleOperateRecordService.listOfArticleOperation(formDTO.getArticleId()); ValidatorUtils.validateEntity(formDTO, ArticleOperationFormDTO.AddUserInternalGroup.class);
return new Result<List<ArticleOperationResultDTO>>().ok(list); List<ArticleOperationResultDTO> list =
} articleOperateRecordService.listOfArticleOperation(formDTO.getArticleId());
return new Result<List<ArticleOperationResultDTO>>().ok(list);
/** }
* @param formDTO
* @return com.epmet.commons.tools.utils.Result<com.epmet.dto.result.GovArticleDetailResultDTO> /**
* @author yinzuomei@elink-cn.com * @param formDTO
* @description 政府端已发布已下线文章详情 * @return com.epmet.commons.tools.utils.Result<com.epmet.dto.result.GovArticleDetailResultDTO>
* @date 2020/6/3 9:44 * @author yinzuomei@elink-cn.com
**/ * @description 政府端已发布已下线文章详情
@PostMapping("articledetail") * @date 2020/6/3 9:44
public Result<GovArticleDetailResultDTO> articleDetail(@RequestBody GovArticleDetailFormDTO formDTO) { **/
ValidatorUtils.validateEntity(formDTO, GovArticleDetailFormDTO.AddUserInternalGroup.class); @PostMapping("articledetail")
GovArticleDetailResultDTO articleDetail = articleService.queryGovArticleDetail(formDTO.getArticleId()); public Result<GovArticleDetailResultDTO> articleDetail(@RequestBody GovArticleDetailFormDTO formDTO) {
return new Result<GovArticleDetailResultDTO>().ok(articleDetail); ValidatorUtils.validateEntity(formDTO, GovArticleDetailFormDTO.AddUserInternalGroup.class);
} GovArticleDetailResultDTO articleDetail = articleService.queryGovArticleDetail(formDTO.getArticleId());
return new Result<GovArticleDetailResultDTO>().ok(articleDetail);
/** }
* @param formDTO 草稿id
* @return com.epmet.commons.tools.utils.Result<com.epmet.dto.result.DraftContentResultDTO> /**
* @author yinzuomei@elink-cn.com * @param formDTO 草稿id
* @description 政府端选中草稿编辑获取草稿内容 * @return com.epmet.commons.tools.utils.Result<com.epmet.dto.result.DraftContentResultDTO>
* @date 2020/6/3 13:18 * @author yinzuomei@elink-cn.com
**/ * @description 政府端选中草稿编辑获取草稿内容
@PostMapping("getcontent") * @date 2020/6/3 13:18
@RequirePermission(requirePermission = RequirePermissionEnum.WORK_PARTY_VOICE_DRAFT_EDIT) **/
public Result<DraftContentResultDTO> getContent(@RequestBody DraftDetailFormDTO formDTO){ @PostMapping("getcontent")
ValidatorUtils.validateEntity(formDTO, GovArticleDetailFormDTO.AddUserInternalGroup.class); @RequirePermission(requirePermission = RequirePermissionEnum.WORK_PARTY_VOICE_DRAFT_EDIT)
DraftContentResultDTO draftContent=draftService.queryDraftContent(formDTO); public Result<DraftContentResultDTO> getContent(@RequestBody DraftDetailFormDTO formDTO) {
return new Result<DraftContentResultDTO>().ok(draftContent); ValidatorUtils.validateEntity(formDTO, GovArticleDetailFormDTO.AddUserInternalGroup.class);
} DraftContentResultDTO draftContent = draftService.queryDraftContent(formDTO);
return new Result<DraftContentResultDTO>().ok(draftContent);
/** }
* @param formDTO
* @return com.epmet.commons.tools.utils.Result /**
* @author yinzuomei@elink-cn.com * @param formDTO
* @description 政府端选中草稿编辑获取草稿属性 * @return com.epmet.commons.tools.utils.Result
* @date 2020/6/3 13:51 * @author yinzuomei@elink-cn.com
**/ * @description 政府端选中草稿编辑获取草稿属性
@PostMapping("getattr") * @date 2020/6/3 13:51
@RequirePermission(requirePermission = RequirePermissionEnum.WORK_PARTY_VOICE_DRAFT_EDIT) **/
public Result<DraftAttrResultDTO> getAttr(@RequestBody DraftDetailFormDTO formDTO) { @PostMapping("getattr")
ValidatorUtils.validateEntity(formDTO, GovArticleDetailFormDTO.AddUserInternalGroup.class); @RequirePermission(requirePermission = RequirePermissionEnum.WORK_PARTY_VOICE_DRAFT_EDIT)
DraftAttrResultDTO draftAttrResultDTO=draftService.getDraftAttr(formDTO); public Result<DraftAttrResultDTO> getAttr(@RequestBody DraftDetailFormDTO formDTO) {
return new Result<DraftAttrResultDTO>().ok(draftAttrResultDTO); ValidatorUtils.validateEntity(formDTO, GovArticleDetailFormDTO.AddUserInternalGroup.class);
} DraftAttrResultDTO draftAttrResultDTO = draftService.getDraftAttr(formDTO);
/** return new Result<DraftAttrResultDTO>().ok(draftAttrResultDTO);
* @param tokenDTO }
* @return
* @Author sun /**
* @Description 党建声音-政府端-可选发布单位 * @param tokenDTO
**/ * @return
@PostMapping("publishagencylist") * @Author sun
public Result<PublishAgencyListResultDTO> publishAgencyList(@LoginUser TokenDto tokenDTO) { * @Description 党建声音-政府端-可选发布单位
return new Result<PublishAgencyListResultDTO>().ok(articleService.publishAgencyList(tokenDTO)); **/
} @PostMapping("publishagencylist")
public Result<PublishAgencyListResultDTO> publishAgencyList(@LoginUser TokenDto tokenDTO) {
/** return new Result<PublishAgencyListResultDTO>().ok(articleService.publishAgencyList(tokenDTO));
* @param tokenDTO formDTO }
* @return
* @Author sun /**
* @Description 党建声音-政府端-下线文章 * @param tokenDTO formDTO
**/ * @return
@PostMapping("offlinearticle") * @Author sun
@RequirePermission(requirePermission = RequirePermissionEnum.WORK_PARTY_VOICE_OFFLINE) * @Description 党建声音-政府端-下线文章
public Result offLineArticle(@LoginUser TokenDto tokenDTO, @RequestBody OffLineArticleFormDTO formDTO) { **/
formDTO.setStaffId(tokenDTO.getUserId()); @PostMapping("offlinearticle")
ValidatorUtils.validateEntity(formDTO, OffLineArticleFormDTO.AddUserInternalGroup.class); @RequirePermission(requirePermission = RequirePermissionEnum.WORK_PARTY_VOICE_OFFLINE)
articleService.offLineArticle(formDTO); public Result offLineArticle(@LoginUser TokenDto tokenDTO, @RequestBody OffLineArticleFormDTO formDTO) {
return new Result(); formDTO.setStaffId(tokenDTO.getUserId());
} ValidatorUtils.validateEntity(formDTO, OffLineArticleFormDTO.AddUserInternalGroup.class);
articleService.offLineArticle(formDTO);
/** return new Result();
* desc:保存草稿属性 }
* @param fromDTO
* @throws Exception /**
*/ * desc:保存草稿属性
@PostMapping("saveattr") *
@RequirePermission(requirePermission = RequirePermissionEnum.WORK_PARTY_VOICE_PUBLISH) * @param fromDTO
public Result<Boolean> saveDraftAttr(@LoginUser TokenDto tokenDto,@RequestBody DraftAttrFromDTO fromDTO) throws Exception { * @throws Exception
ValidatorUtils.validateEntity(fromDTO, DefaultGroup.class); */
Boolean isSuccess = articleService.saveDraftAttr(tokenDto, fromDTO); @PostMapping("saveattr")
return new Result<Boolean>().ok(isSuccess); @RequirePermission(requirePermission = RequirePermissionEnum.WORK_PARTY_VOICE_PUBLISH)
} public Result<Boolean> saveDraftAttr(@LoginUser TokenDto tokenDto, @RequestBody DraftAttrFromDTO fromDTO) throws Exception {
ValidatorUtils.validateEntity(fromDTO, DefaultGroup.class);
/** Boolean isSuccess = articleService.saveDraftAttr(tokenDto, fromDTO);
* desc:预览保存草稿属性 return new Result<Boolean>().ok(isSuccess);
* @param fromDTO }
* @throws Exception
*/ /**
@PostMapping("previewsaveattr") * desc:预览保存草稿属性
@RequirePermission(requirePermission = RequirePermissionEnum.WORK_PARTY_VOICE_PUBLISH) *
public Result<Boolean> previewSaveDraftAttr(@LoginUser TokenDto tokenDto,@RequestBody DraftAttrFromDTO fromDTO) throws Exception { * @param fromDTO
ValidatorUtils.validateEntity(fromDTO, DefaultGroup.class); * @throws Exception
Boolean isSuccess = articleService.previewSaveDraftAttr(tokenDto, fromDTO); */
return new Result<Boolean>().ok(isSuccess); @PostMapping("previewsaveattr")
} @RequirePermission(requirePermission = RequirePermissionEnum.WORK_PARTY_VOICE_PUBLISH)
public Result<Boolean> previewSaveDraftAttr(@LoginUser TokenDto tokenDto, @RequestBody DraftAttrFromDTO fromDTO) throws Exception {
/** ValidatorUtils.validateEntity(fromDTO, DefaultGroup.class);
* desc:发布文章 Boolean isSuccess = articleService.previewSaveDraftAttr(tokenDto, fromDTO);
* @param formDTO return new Result<Boolean>().ok(isSuccess);
* @throws Exception }
*/
@PostMapping("publish") /**
@RequirePermission(requirePermission = RequirePermissionEnum.WORK_PARTY_VOICE_PUBLISH) * desc:发布文章
public Result<Boolean> publishArticle(@LoginUser TokenDto tokenDto, @RequestBody PublishArticleFormDTO formDTO) throws Exception { *
Boolean isSuccess = articleService.publish(tokenDto, formDTO.getDraftId()); * @param formDTO
if (isSuccess) { * @throws Exception
scanContent(tokenDto, formDTO.getDraftId()); */
} @PostMapping("publish")
return new Result<Boolean>().ok(isSuccess); @RequirePermission(requirePermission = RequirePermissionEnum.WORK_PARTY_VOICE_PUBLISH)
} public Result<Boolean> publishArticle(@LoginUser TokenDto tokenDto, @RequestBody PublishArticleFormDTO formDTO) throws Exception {
Boolean isSuccess = articleService.publish(tokenDto, formDTO.getDraftId());
@Async if (isSuccess) {
public void scanContent(TokenDto tokenDto,String draftId){ scanContent(tokenDto, formDTO.getDraftId());
try { }
SyncScanResult syncScanResult = articleService.scanContent(tokenDto, draftId); return new Result<Boolean>().ok(isSuccess);
if (syncScanResult == null) { }
log.error("scanContent draftId:{} return result null", draftId);
} /**
* desc:人工确认无误后发布文章不走审核接口
if (syncScanResult.isAllPass()) { *
articleService.scanAllPassPublishArticle(tokenDto, draftId, syncScanResult); * @param formDTO
} else { * @throws Exception
articleService.updateAuditStatusFailById(draftId, syncScanResult); */
} @PostMapping("manualpublish")
} catch (Exception e) { @RequirePermission(requirePermission = RequirePermissionEnum.WORK_PARTY_VOICE_PUBLISH)
articleService.updateDraftPublishStatus(draftId, DraftConstant.AUDITFAIL); public Result<Boolean> manualPublish(@LoginUser TokenDto tokenDto, @RequestBody PublishArticleFormDTO formDTO) throws Exception {
log.error("scanContent exception draftId:{} return result null", e); articleService.manualPublish(tokenDto, formDTO.getDraftId());
} return new Result<Boolean>().ok(true);
} }
@Async
/** public void scanContent(TokenDto tokenDto, String draftId) {
* 已发布文章列表 try {
* @author zhaoqifeng SyncScanResult syncScanResult = articleService.scanContent(tokenDto, draftId);
* @date 2020/6/3 16:19 if (syncScanResult == null) {
* @param tokenDto log.error("scanContent draftId:{} return result null", draftId);
* @param formDTO }
* @return com.epmet.commons.tools.utils.Result<com.epmet.commons.tools.page.PageData>
*/ if (syncScanResult.isAllPass()) {
@PostMapping("publishedarticlelist") articleService.scanAllPassPublishArticle(tokenDto, draftId, syncScanResult);
@RequirePermission(requirePermission = RequirePermissionEnum.WORK_PARTY_VOICE_PUBLISHED_LIST) } else {
public Result<List<PublishedListResultDTO>> publishedArticleList(@LoginUser TokenDto tokenDto, @RequestBody PublishedListFormDTO formDTO) { articleService.updateAuditStatusFailById(draftId, syncScanResult);
ValidatorUtils.validateEntity(formDTO); }
List<PublishedListResultDTO> list = articleService.publishedArticleList(tokenDto, formDTO).getList(); } catch (Exception e) {
return new Result<List<PublishedListResultDTO>>().ok(list); articleService.updateDraftPublishStatus(draftId, DraftConstant.AUDITFAIL);
} log.error("scanContent exception draftId:{} return result null", e);
}
}
/**
* 已下线文章列表
* @author zhaoqifeng /**
* @date 2020/6/3 16:19 * 已发布文章列表
* @param tokenDto *
* @param formDTO * @param tokenDto
* @return com.epmet.commons.tools.utils.Result<com.epmet.commons.tools.page.PageData> * @param formDTO
*/ * @return com.epmet.commons.tools.utils.Result<com.epmet.commons.tools.page.PageData>
@PostMapping("offlinearticlelist") * @author zhaoqifeng
@RequirePermission(requirePermission = RequirePermissionEnum.WORK_PARTY_VOICE_OFFLINE_LIST) * @date 2020/6/3 16:19
public Result<List<OfflineListResultDTO> > offLineList(@LoginUser TokenDto tokenDto, @RequestBody OfflineListFormDTO formDTO) { */
ValidatorUtils.validateEntity(formDTO); @PostMapping("publishedarticlelist")
List<OfflineListResultDTO> list = articleService.offlineList(tokenDto, formDTO).getList(); @RequirePermission(requirePermission = RequirePermissionEnum.WORK_PARTY_VOICE_PUBLISHED_LIST)
return new Result<List<OfflineListResultDTO> >().ok(list); public Result<List<PublishedListResultDTO>> publishedArticleList(@LoginUser TokenDto tokenDto, @RequestBody PublishedListFormDTO formDTO) {
} ValidatorUtils.validateEntity(formDTO);
/** List<PublishedListResultDTO> list = articleService.publishedArticleList(tokenDto, formDTO).getList();
* @Description 根据网格Id查找置顶文章的相关信息列表 用处:居民端首页轮播 return new Result<List<PublishedListResultDTO>>().ok(list);
* @param commonArticleListFormDTO :: getGridId :: getNum }
* @return List<ArticleBannerResultDTO>
* @author wangc
* @date 2020.06.02 16:13 /**
**/ * 已下线文章列表
@PostMapping("resitoparticlelist") *
public Result<List<ArticleBannerResultDTO>> resiTopArticleList(@RequestBody CommonArticleListFormDTO commonArticleListFormDTO){ * @param tokenDto
ValidatorUtils.validateEntity(commonArticleListFormDTO, CommonArticleListFormDTO.ArticleBannerInternalGroup.class); * @param formDTO
return new Result<List<ArticleBannerResultDTO>>().ok(articleService.getTopArticleList(commonArticleListFormDTO)); * @return com.epmet.commons.tools.utils.Result<com.epmet.commons.tools.page.PageData>
} * @author zhaoqifeng
* @date 2020/6/3 16:19
/** */
* @Description 根据网格Id查找最新文章的相关信息列表 用处:居民端首页最新文章列表 @PostMapping("offlinearticlelist")
* @param commonArticleListFormDTO :: getGridId :: getNum @RequirePermission(requirePermission = RequirePermissionEnum.WORK_PARTY_VOICE_OFFLINE_LIST)
* @return List<ArticleLatestResultDTO> public Result<List<OfflineListResultDTO>> offLineList(@LoginUser TokenDto tokenDto, @RequestBody OfflineListFormDTO formDTO) {
* @author wangc ValidatorUtils.validateEntity(formDTO);
* @date 2020.06.03 09:53 List<OfflineListResultDTO> list = articleService.offlineList(tokenDto, formDTO).getList();
**/ return new Result<List<OfflineListResultDTO>>().ok(list);
@PostMapping("resilatestarticlelist") }
public Result<List<ArticleLatestResultDTO>> resiLatestArticleList(@RequestBody CommonArticleListFormDTO commonArticleListFormDTO){
ValidatorUtils.validateEntity(commonArticleListFormDTO, CommonArticleListFormDTO.ArticleBannerInternalGroup.class); /**
return new Result<List<ArticleLatestResultDTO>>().ok(articleService.getLatestArticleList(commonArticleListFormDTO)); * @param commonArticleListFormDTO :: getGridId :: getNum
} * @return List<ArticleBannerResultDTO>
* @Description 根据网格Id查找置顶文章的相关信息列表 用处:居民端首页轮播
/** * @author wangc
* @Description 根据网格Id和标签列表查找文章的相关信息列表 用处:居民端党建声音列表 * @date 2020.06.02 16:13
* @param articlePageFormDTO **/
* @return List<ArticleListResultDTO> @PostMapping("resitoparticlelist")
* @author wangc public Result<List<ArticleBannerResultDTO>> resiTopArticleList(@RequestBody CommonArticleListFormDTO commonArticleListFormDTO) {
* @date 2020.06.03 14:19 ValidatorUtils.validateEntity(commonArticleListFormDTO, CommonArticleListFormDTO.ArticleBannerInternalGroup.class);
**/ return new Result<List<ArticleBannerResultDTO>>().ok(articleService.getTopArticleList(commonArticleListFormDTO));
@PostMapping("resiarticlelist") }
public Result<List<ArticleListResultDTO>> resiArticleList(@RequestBody ArticlePageFormDTO articlePageFormDTO){
ValidatorUtils.validateEntity(articlePageFormDTO,ArticlePageFormDTO.ArticlePageInternalGroup.class); /**
return new Result<List<ArticleListResultDTO>>().ok(articleService.getArticleList(articlePageFormDTO)); * @param commonArticleListFormDTO :: getGridId :: getNum
} * @return List<ArticleLatestResultDTO>
* @Description 根据网格Id查找最新文章的相关信息列表 用处:居民端首页最新文章列表
/** * @author wangc
* @param tokenDTO formDTO * @date 2020.06.03 09:53
* @return **/
* @Author sun @PostMapping("resilatestarticlelist")
* @Description 党建声音-政府端-可下线网格列表 public Result<List<ArticleLatestResultDTO>> resiLatestArticleList(@RequestBody CommonArticleListFormDTO commonArticleListFormDTO) {
**/ ValidatorUtils.validateEntity(commonArticleListFormDTO, CommonArticleListFormDTO.ArticleBannerInternalGroup.class);
@PostMapping("publishgridlist") return new Result<List<ArticleLatestResultDTO>>().ok(articleService.getLatestArticleList(commonArticleListFormDTO));
public Result<ArticleAgencyGridListResultDTO> publishGridList(@LoginUser TokenDto tokenDTO, @RequestBody PublishGridListFormDTO formDTO) { }
formDTO.setStaffId(tokenDTO.getUserId());
ValidatorUtils.validateEntity(formDTO, PublishGridListFormDTO.AddUserInternalGroup.class); /**
ArticleAgencyGridListResultDTO agencyGridList = new ArticleAgencyGridListResultDTO(); * @param articlePageFormDTO
agencyGridList.setAgencyGridList(articleService.publishGridList(formDTO)); * @return List<ArticleListResultDTO>
return new Result<ArticleAgencyGridListResultDTO>().ok(agencyGridList); * @Description 根据网格Id和标签列表查找文章的相关信息列表 用处:居民端党建声音列表
} * @author wangc
* @date 2020.06.03 14:19
**/
/** @PostMapping("resiarticlelist")
* @Description 根绝文章Id查询出文章的内容封面等相关信息如果居民端传入的网格Id不在该文章的发布范围内则返回NULL public Result<List<ArticleListResultDTO>> resiArticleList(@RequestBody ArticlePageFormDTO articlePageFormDTO) {
* @param articleDetailFormDTO ValidatorUtils.validateEntity(articlePageFormDTO, ArticlePageFormDTO.ArticlePageInternalGroup.class);
* @return ArticleDetailResultDTO return new Result<List<ArticleListResultDTO>>().ok(articleService.getArticleList(articlePageFormDTO));
* @author wangc }
* @date 2020.06.03 18:28
**/ /**
@PostMapping("resiarticledetail") * @param tokenDTO formDTO
public Result<ArticleDetailResultDTO> resiArticleDetail(@RequestBody ResiArticleDetailFormDTO articleDetailFormDTO){ * @return
ValidatorUtils.validateEntity(articleDetailFormDTO,ResiArticleDetailFormDTO.ResiArticleDetailInternalGroup.class); * @Author sun
return new Result<ArticleDetailResultDTO>().ok(articleService.getArticleDetail(articleDetailFormDTO)); * @Description 党建声音-政府端-可下线网格列表
} **/
@PostMapping("publishgridlist")
/** public Result<ArticleAgencyGridListResultDTO> publishGridList(@LoginUser TokenDto tokenDTO, @RequestBody PublishGridListFormDTO formDTO) {
* @param formDTO formDTO.setStaffId(tokenDTO.getUserId());
* @return com.epmet.commons.tools.utils.Result<com.epmet.dto.result.DraftDetailResultDTO> ValidatorUtils.validateEntity(formDTO, PublishGridListFormDTO.AddUserInternalGroup.class);
* @author yinzuomei@elink-cn.com ArticleAgencyGridListResultDTO agencyGridList = new ArticleAgencyGridListResultDTO();
* @description 政府端文章预览 agencyGridList.setAgencyGridList(articleService.publishGridList(formDTO));
* @date 2020/6/5 10:56 return new Result<ArticleAgencyGridListResultDTO>().ok(agencyGridList);
**/ }
@PostMapping("draftdetail")
public Result<DraftDetailResultDTO> queryDraftDetail(@RequestBody DraftDetailFormDTO formDTO) {
ValidatorUtils.validateEntity(formDTO, GovArticleDetailFormDTO.AddUserInternalGroup.class); /**
DraftDetailResultDTO draftDetailResultDTO = draftService.queryDraftDetail(formDTO); * @param articleDetailFormDTO
return new Result<DraftDetailResultDTO>().ok(draftDetailResultDTO); * @return ArticleDetailResultDTO
} * @Description 根绝文章Id查询出文章的内容封面等相关信息如果居民端传入的网格Id不在该文章的发布范围内则返回NULL
* @author wangc
* @date 2020.06.03 18:28
**/
@PostMapping("resiarticledetail")
public Result<ArticleDetailResultDTO> resiArticleDetail(@RequestBody ResiArticleDetailFormDTO articleDetailFormDTO) {
ValidatorUtils.validateEntity(articleDetailFormDTO, ResiArticleDetailFormDTO.ResiArticleDetailInternalGroup.class);
return new Result<ArticleDetailResultDTO>().ok(articleService.getArticleDetail(articleDetailFormDTO));
}
/**
* @param formDTO
* @return com.epmet.commons.tools.utils.Result<com.epmet.dto.result.DraftDetailResultDTO>
* @author yinzuomei@elink-cn.com
* @description 政府端文章预览
* @date 2020/6/5 10:56
**/
@PostMapping("draftdetail")
public Result<DraftDetailResultDTO> queryDraftDetail(@RequestBody DraftDetailFormDTO formDTO) {
ValidatorUtils.validateEntity(formDTO, GovArticleDetailFormDTO.AddUserInternalGroup.class);
DraftDetailResultDTO draftDetailResultDTO = draftService.queryDraftDetail(formDTO);
return new Result<DraftDetailResultDTO>().ok(draftDetailResultDTO);
}
} }

16
epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/DraftController.java

@ -24,7 +24,10 @@ import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.validator.ValidatorUtils; import com.epmet.commons.tools.validator.ValidatorUtils;
import com.epmet.dto.form.DeleteDraftFormDTO; import com.epmet.dto.form.DeleteDraftFormDTO;
import com.epmet.dto.form.DraftDetailFormDTO;
import com.epmet.dto.form.DraftListFormDTO; import com.epmet.dto.form.DraftListFormDTO;
import com.epmet.dto.form.GovArticleDetailFormDTO;
import com.epmet.dto.result.DraftDetailResultDTO;
import com.epmet.dto.result.DraftListResultDTO; import com.epmet.dto.result.DraftListResultDTO;
import com.epmet.service.DraftService; import com.epmet.service.DraftService;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
@ -70,4 +73,17 @@ public class DraftController {
ValidatorUtils.validateEntity(formDTO); ValidatorUtils.validateEntity(formDTO);
return new Result<List<DraftListResultDTO>>().ok(draftService.draftList(tokenDto, formDTO).getList()); return new Result<List<DraftListResultDTO>>().ok(draftService.draftList(tokenDto, formDTO).getList());
} }
/**
* desc:政府端带封面的预览
* @param formDTO
* @return
*/
@PostMapping("detailwithcover")
public Result<DraftDetailResultDTO> detailWithCover(@RequestBody DraftDetailFormDTO formDTO) {
ValidatorUtils.validateEntity(formDTO, GovArticleDetailFormDTO.AddUserInternalGroup.class);
formDTO.setShowCover(true);
DraftDetailResultDTO draftDetailResultDTO = draftService.queryDraftDetail(formDTO);
return new Result<DraftDetailResultDTO>().ok(draftDetailResultDTO);
}
} }

5
epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/entity/ArticleEntity.java

@ -103,6 +103,11 @@ public class ArticleEntity extends BaseEpmetEntity {
*/ */
private String tags; private String tags;
/**
* 发布方式 自动审核后发布autoAudit;人工确认无误发布(不审核)manualNoAudit
*/
private String publishWay;
/** /**
* 组织ID * 组织ID
*/ */

8
epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/ArticleService.java

@ -206,4 +206,12 @@ public interface ArticleService extends BaseService<ArticleEntity> {
* @return * @return
*/ */
void updateDraftPublishStatus(String draftId,String statusFlag); void updateDraftPublishStatus(String draftId,String statusFlag);
/**
* desc:人工发布文章 不走审核接口
* @param tokenDto
* @param draftId
* @return
*/
void manualPublish(TokenDto tokenDto, String draftId);
} }

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

@ -63,7 +63,6 @@ import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils; import org.springframework.util.CollectionUtils;
@ -322,7 +321,7 @@ public class ArticleServiceImpl extends BaseServiceImpl<ArticleDao, ArticleEntit
@Override @Override
public Boolean previewSaveDraftAttr(TokenDto tokenDto, DraftAttrFromDTO fromDTO) { public Boolean previewSaveDraftAttr(TokenDto tokenDto, DraftAttrFromDTO fromDTO) {
log.debug("previewSaveDraftAttr param:{}",JSON.toJSONString(fromDTO)); log.debug("previewSaveDraftAttr param:{}", JSON.toJSONString(fromDTO));
//校验参数 //校验参数
ValidatorUtils.validateEntity(fromDTO); ValidatorUtils.validateEntity(fromDTO);
if (DraftConstant.TOP.equals(fromDTO.getIsTop()) && StringUtils.isBlank(fromDTO.getCoverImg())) { if (DraftConstant.TOP.equals(fromDTO.getIsTop()) && StringUtils.isBlank(fromDTO.getCoverImg())) {
@ -566,7 +565,7 @@ public class ArticleServiceImpl extends BaseServiceImpl<ArticleDao, ArticleEntit
offLineList.forEach(off -> { offLineList.forEach(off -> {
offLineGridId.append(StrConstant.COLON).append(off.getGridId()); offLineGridId.append(StrConstant.COLON).append(off.getGridId());
}); });
recordEntity.setGridIds(offLineGridId.toString().replaceFirst(StrConstant.COLON,"")); recordEntity.setGridIds(offLineGridId.toString().replaceFirst(StrConstant.COLON, ""));
recordEntity.setContent(content); recordEntity.setContent(content);
recordEntity.setOpType(ArticleConstant.OFFLINE); recordEntity.setOpType(ArticleConstant.OFFLINE);
recordEntity.setOpTime(date); recordEntity.setOpTime(date);
@ -641,7 +640,7 @@ public class ArticleServiceImpl extends BaseServiceImpl<ArticleDao, ArticleEntit
if (RoleKeyConstants.ROLE_KEY_PARTY_PRINCIPALS.equals(role.getRoleKey())) { if (RoleKeyConstants.ROLE_KEY_PARTY_PRINCIPALS.equals(role.getRoleKey())) {
staffLevel = AGENCY; staffLevel = AGENCY;
break; break;
} else if (RoleKeyConstants.ROLE_KEY_GRID_PARTY_DIRECTOR.equals(role.getRoleKey())){ } else if (RoleKeyConstants.ROLE_KEY_GRID_PARTY_DIRECTOR.equals(role.getRoleKey())) {
staffLevel = GRID; staffLevel = GRID;
} }
} }
@ -888,7 +887,7 @@ public class ArticleServiceImpl extends BaseServiceImpl<ArticleDao, ArticleEntit
* @date 2020.06.05 09:10 * @date 2020.06.05 09:10
**/ **/
public ArticleEntity publishDraftToArticle(DraftEntity draft) { public ArticleEntity publishDraftToArticle(DraftEntity draft, String publishWay) {
//1.查找草稿内容 //1.查找草稿内容
if (null != draft) { if (null != draft) {
@ -904,6 +903,9 @@ public class ArticleServiceImpl extends BaseServiceImpl<ArticleDao, ArticleEntit
article.setId(null); article.setId(null);
article.setDraftId(draftId); article.setDraftId(draftId);
article.setStatusFlag(DraftConstant.PUBLISHED); article.setStatusFlag(DraftConstant.PUBLISHED);
if (StringUtils.isNotBlank(publishWay)) {
article.setPublishWay(publishWay);
}
baseDao.insert(article); baseDao.insert(article);
if (null != draftContents && draftContents.size() > NumConstant.ZERO) { if (null != draftContents && draftContents.size() > NumConstant.ZERO) {
draftContents.forEach(content -> { draftContents.forEach(content -> {
@ -1006,16 +1008,16 @@ public class ArticleServiceImpl extends BaseServiceImpl<ArticleDao, ArticleEntit
log.info("scanContent imgScanParamDTO:{}", JSON.toJSONString(imgScanParamDTO)); log.info("scanContent imgScanParamDTO:{}", JSON.toJSONString(imgScanParamDTO));
imgSyncScanResult = ScanContentUtils.imgSyncScan(scanApiUrl.concat(imgSyncScanMethod), imgScanParamDTO); imgSyncScanResult = ScanContentUtils.imgSyncScan(scanApiUrl.concat(imgSyncScanMethod), imgScanParamDTO);
log.info("scanContent imgSyncScanResult:{}", JSON.toJSONString(imgSyncScanResult)); log.info("scanContent imgSyncScanResult:{}", JSON.toJSONString(imgSyncScanResult));
if (!imgSyncScanResult.success()){ if (!imgSyncScanResult.success()) {
throw new RenException(EpmetErrorCode.SERVER_ERROR.getCode(),imgSyncScanResult.getMsg()); throw new RenException(EpmetErrorCode.SERVER_ERROR.getCode(), imgSyncScanResult.getMsg());
} }
} }
if (!CollectionUtils.isEmpty(textScanParamDTO.getTasks())) { if (!CollectionUtils.isEmpty(textScanParamDTO.getTasks())) {
log.info("scanContent textScanParamDTO:{}", JSON.toJSONString(textScanParamDTO)); log.info("scanContent textScanParamDTO:{}", JSON.toJSONString(textScanParamDTO));
textSyncScanResult = ScanContentUtils.textSyncScan(scanApiUrl.concat(textSyncScanMethod), textScanParamDTO); textSyncScanResult = ScanContentUtils.textSyncScan(scanApiUrl.concat(textSyncScanMethod), textScanParamDTO);
log.info("scanContent textSyncScanResult:{}", JSON.toJSONString(textSyncScanResult)); log.info("scanContent textSyncScanResult:{}", JSON.toJSONString(textSyncScanResult));
if (!textSyncScanResult.success()){ if (!textSyncScanResult.success()) {
throw new RenException(EpmetErrorCode.SERVER_ERROR.getCode(),textSyncScanResult.getMsg()); throw new RenException(EpmetErrorCode.SERVER_ERROR.getCode(), textSyncScanResult.getMsg());
} }
} }
@ -1047,7 +1049,7 @@ public class ArticleServiceImpl extends BaseServiceImpl<ArticleDao, ArticleEntit
} }
@Override @Override
@Transactional(rollbackFor = Exception.class, propagation = Propagation.REQUIRED) @Transactional(rollbackFor = Exception.class)
public void scanAllPassPublishArticle(TokenDto tokenDto, String draftId, SyncScanResult syncScanResult) { public void scanAllPassPublishArticle(TokenDto tokenDto, String draftId, SyncScanResult syncScanResult) {
DraftEntity draft = draftDao.selectById(draftId); DraftEntity draft = draftDao.selectById(draftId);
@ -1058,7 +1060,7 @@ public class ArticleServiceImpl extends BaseServiceImpl<ArticleDao, ArticleEntit
try { try {
//审核通过 //审核通过
this.updateAuditStatusFailById(draftId, syncScanResult); this.updateAuditStatusFailById(draftId, syncScanResult);
ArticleEntity articleEntity = this.publishDraftToArticle(draft); ArticleEntity articleEntity = this.publishDraftToArticle(draft, ArticleConstant.PUBLISH_WAY_AUTO_AUDIT);
UpdateCustomerTagCacheDTO updateCustomerTagCacheDTO = this.updateCustomerTag(tokenDto, draftId); UpdateCustomerTagCacheDTO updateCustomerTagCacheDTO = this.updateCustomerTag(tokenDto, draftId);
if (updateCustomerTagCacheDTO == null) { if (updateCustomerTagCacheDTO == null) {
return; return;
@ -1123,7 +1125,6 @@ public class ArticleServiceImpl extends BaseServiceImpl<ArticleDao, ArticleEntit
auditMsg = ModuleConstant.DRAFT_CONTENT; auditMsg = ModuleConstant.DRAFT_CONTENT;
} else if (coverFail) { } else if (coverFail) {
auditMsg = ModuleConstant.DRAFT_COVER; auditMsg = ModuleConstant.DRAFT_COVER;
;
} }
this.sendMsg(draft.getCustomerId(), draft.getTitle(), String.format(ModuleConstant.MSG_AUDIT_CONTENT, draft.getTitle(), auditMsg)); this.sendMsg(draft.getCustomerId(), draft.getTitle(), String.format(ModuleConstant.MSG_AUDIT_CONTENT, draft.getTitle(), auditMsg));
} }
@ -1157,6 +1158,35 @@ public class ArticleServiceImpl extends BaseServiceImpl<ArticleDao, ArticleEntit
draftDao.updateAuditStatusById(draftId, statusFlag); draftDao.updateAuditStatusById(draftId, statusFlag);
} }
@Override
@Transactional(rollbackFor = Exception.class)
public void manualPublish(TokenDto tokenDto, String draftId) {
try {
//校验草稿状态 并更新为已发布
DraftEntity draftEntity = checkDraftStatus(draftId);
this.updateDraftPublishStatus(draftId, DraftConstant.PUBLISHED);
//复制 草稿到文章(草稿内容,封面,属性)
ArticleEntity articleEntity = this.publishDraftToArticle(draftEntity, ArticleConstant.PUBLISH_WAY_MANUAL);
UpdateCustomerTagCacheDTO updateCustomerTagCacheDTO = this.updateCustomerTag(tokenDto, draftId);
if (updateCustomerTagCacheDTO == null) {
return;
}
List<UpdateGridTagCacheDTO> updateGridTagCacheDTOS = this.updateGridTag(tokenDto, draftId, updateCustomerTagCacheDTO);
this.addArticleTags(updateCustomerTagCacheDTO, draftId, tokenDto, articleEntity.getCreatedTime());
//更新redis
try {
this.updateCacheCustomerTag(updateCustomerTagCacheDTO);
this.updateCacheGridTag(updateGridTagCacheDTOS);
} catch (Exception e) {
log.error("manualPublish update redis exception", e);
throw new RenException(EpmetErrorCode.SERVER_ERROR.getCode(), EpmetErrorCode.SERVER_ERROR.getMsg());
}
} catch (RenException e) {
log.error("manualPublish exception", e);
}
}
/** /**
* @param draftId * @param draftId

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

@ -26,12 +26,14 @@ import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.constant.DraftConstant; import com.epmet.constant.DraftConstant;
import com.epmet.dao.DraftCoverDao;
import com.epmet.dao.DraftDao; import com.epmet.dao.DraftDao;
import com.epmet.dto.DraftDTO; import com.epmet.dto.DraftDTO;
import com.epmet.dto.form.DeleteDraftFormDTO; import com.epmet.dto.form.DeleteDraftFormDTO;
import com.epmet.dto.form.DraftDetailFormDTO; import com.epmet.dto.form.DraftDetailFormDTO;
import com.epmet.dto.form.DraftListFormDTO; import com.epmet.dto.form.DraftListFormDTO;
import com.epmet.dto.result.*; import com.epmet.dto.result.*;
import com.epmet.entity.DraftCoverEntity;
import com.epmet.entity.DraftEntity; import com.epmet.entity.DraftEntity;
import com.epmet.service.DraftService; import com.epmet.service.DraftService;
import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageHelper;
@ -39,6 +41,7 @@ import com.github.pagehelper.PageInfo;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
@ -57,6 +60,8 @@ import java.util.Map;
public class DraftServiceImpl extends BaseServiceImpl<DraftDao, DraftEntity> implements DraftService { public class DraftServiceImpl extends BaseServiceImpl<DraftDao, DraftEntity> implements DraftService {
private Logger logger = LoggerFactory.getLogger(getClass()); private Logger logger = LoggerFactory.getLogger(getClass());
@Autowired
private DraftCoverDao draftCoverDao;
@Override @Override
public PageData<DraftDTO> page(Map<String, Object> params) { public PageData<DraftDTO> page(Map<String, Object> params) {
IPage<DraftEntity> page = baseDao.selectPage( IPage<DraftEntity> page = baseDao.selectPage(
@ -179,6 +184,15 @@ public class DraftServiceImpl extends BaseServiceImpl<DraftDao, DraftEntity> imp
}else{ }else{
draftDetailResultDTO.setTagNameList(new String[0]); draftDetailResultDTO.setTagNameList(new String[0]);
} }
if (formDTO.isShowCover()){
DraftCoverEntity coverEntity = draftCoverDao.selectByDraftId(formDTO.getDraftId(), null);
if (coverEntity != null){
CoverImgDTO coverImgDTO = ConvertUtils.sourceToTarget(coverEntity, CoverImgDTO.class);
draftDetailResultDTO.setCoverInfo(coverImgDTO);
}else{
draftDetailResultDTO.setCoverInfo(new CoverImgDTO());
}
}
} }
return draftDetailResultDTO; return draftDetailResultDTO;
} }

2
epmet-module/gov-voice/gov-voice-server/src/main/resources/db/migration/V0.0.2__addAutoPublish.sql

@ -0,0 +1,2 @@
ALTER TABLE `epmet_gov_voice`.`article`
ADD COLUMN `PUBLISH_WAY` varchar(16) NOT NULL DEFAULT 'autoAudit' COMMENT '发布方式 自动审核后发布:autoAudit;人工确认无误发布(不审核):manualNoAudit' AFTER `TAGS`;

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

@ -142,7 +142,9 @@
ID AS "draftId", ID AS "draftId",
TITLE AS "title", TITLE AS "title",
IFNULL(PREVIEW_CONTENT, "") AS "content", IFNULL(PREVIEW_CONTENT, "") AS "content",
UNIX_TIMESTAMP(CREATED_TIME) AS "createdTime" UNIX_TIMESTAMP(CREATED_TIME) AS "createdTime",
AUDIT_STATUS,
AUDIT_REASON
FROM draft FROM draft
WHERE DEL_FLAG = '0' WHERE DEL_FLAG = '0'
AND (STATUS_FLAG = 'unpublish' OR STATUS_FLAG = 'auditfail') AND (STATUS_FLAG = 'unpublish' OR STATUS_FLAG = 'auditfail')
@ -169,7 +171,9 @@
<select id="selectDraftContentList" parameterType="java.lang.String" resultType="com.epmet.dto.result.GovDraftContentDTO"> <select id="selectDraftContentList" parameterType="java.lang.String" resultType="com.epmet.dto.result.GovDraftContentDTO">
SELECT SELECT
dc.CONTENT_TYPE, dc.CONTENT_TYPE,
dc.CONTENT dc.CONTENT,
dc.AUDIT_STATUS,
dc.AUDIT_REASON
FROM FROM
draft_content dc draft_content dc
WHERE WHERE

Loading…
Cancel
Save