Browse Source

Merge branch 'dev' of http://git.elinkit.com.cn:7070/r/epmet-cloud into dev

dev_shibei_match
wxz 5 years ago
parent
commit
638bf72c84
  1. 2
      epmet-module/gov-org/gov-org-server/deploy/docker-compose-dev.yml
  2. 2
      epmet-module/gov-org/gov-org-server/pom.xml
  3. 3
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerAgencyServiceImpl.java
  4. 2
      epmet-module/gov-voice/gov-voice-server/deploy/docker-compose-dev.yml
  5. 2
      epmet-module/gov-voice/gov-voice-server/pom.xml
  6. 8
      epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/constant/ArticleConstant.java
  7. 54
      epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/ArticleServiceImpl.java
  8. 4
      epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/DraftServiceImpl.java
  9. 36
      epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/ArticleDao.xml
  10. 3
      epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/DraftDao.xml

2
epmet-module/gov-org/gov-org-server/deploy/docker-compose-dev.yml

@ -2,7 +2,7 @@ version: "3.7"
services:
gov-org-server:
container_name: gov-org-server-dev
image: 192.168.1.130:10080/epmet-cloud-dev/gov-org-server:0.3.64
image: 192.168.1.130:10080/epmet-cloud-dev/gov-org-server:0.3.65
ports:
- "8092:8092"
network_mode: host # 使用现有网络

2
epmet-module/gov-org/gov-org-server/pom.xml

@ -2,7 +2,7 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<version>0.3.64</version>
<version>0.3.65</version>
<parent>
<groupId>com.epmet</groupId>
<artifactId>gov-org</artifactId>

3
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerAgencyServiceImpl.java

@ -680,6 +680,9 @@ public class CustomerAgencyServiceImpl extends BaseServiceImpl<CustomerAgencyDao
//当前机关信息
returnDTO.setAgencyId(agencyEntity.getId());
returnDTO.setAgencyName(agencyEntity.getOrganizationName());
returnDTO.setPid(agencyEntity.getPid());
returnDTO.setPids(agencyEntity.getPids());
returnDTO.setAllParentName(agencyEntity.getAllParentName());
if (party) {
//4.1:查询当前机关的网格列表以及所有下级机关的网格列表
//当前机关下网格列表

2
epmet-module/gov-voice/gov-voice-server/deploy/docker-compose-dev.yml

@ -2,7 +2,7 @@ version: "3.7"
services:
gov-voice-server:
container_name: gov-voice-server-dev
image: 192.168.1.130:10080/epmet-cloud-dev/gov-voice-server:0.3.27
image: 192.168.1.130:10080/epmet-cloud-dev/gov-voice-server:0.3.31
ports:
- "8105:8105"
network_mode: host # 使用现有网络

2
epmet-module/gov-voice/gov-voice-server/pom.xml

@ -3,7 +3,7 @@
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<version>0.3.27</version>
<version>0.3.31</version>
<parent>
<artifactId>gov-voice</artifactId>
<groupId>com.epmet</groupId>

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

@ -44,4 +44,12 @@ public interface ArticleConstant {
* 发布文章操作记录表文案
*/
String PUBLISH_ARTICLE_MSG = "%s-%s发布文章【%s】";
/**
* 查询文章基本信息失败
*/
String SELECT_ARTICLE_EXCEPTION = "获取文章信息失败";
/**
* 操作权限异常-自己发表的文章只有自己才能下线
*/
String SHIRO_EXCEPTION = "当前人员不是文章发布者,不能下线文章";
}

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

@ -177,7 +177,7 @@ public class ArticleServiceImpl extends BaseServiceImpl<ArticleDao, ArticleEntit
List<DraftContentEntity> draftContentList = null;
if (StringUtils.isNotBlank(fromDTO.getDraftId())) {
draftEntity = this.checkDraftStatus(fromDTO.getDraftId());
draftEntity.setTitle(StringUtils.isBlank(draftEntity.getTitle()) ? "" : draftEntity.getTitle());
draftEntity.setTitle(StringUtils.isBlank(fromDTO.getTitle()) ? "" : fromDTO.getTitle());
buildPreviewContent(fromDTO, draftEntity);
draftDao.updateById(draftEntity);
} else {
@ -195,7 +195,9 @@ public class ArticleServiceImpl extends BaseServiceImpl<ArticleDao, ArticleEntit
draftEntity.setCustomerId(tokenDto.getCustomerId());
draftEntity.setIsTop(DraftConstant.UN_TOP);
draftEntity.setStatusFlag(DraftConstant.UNPUBLISH);
draftEntity.setOrgId(loginUserDetails.getData().getAgencyId());
String[] orgIdPath = loginUserDetails.getData().getOrgIdPath().split(":");
String agencyId = orgIdPath[orgIdPath.length - 1];
draftEntity.setOrgId(agencyId);
draftEntity.setOrgIdPath(loginUserDetails.getData().getOrgIdPath());
draftEntity.setGridId("");
draftEntity.setDepartmentId(loginUserDetails.getData().getCustomerId());
@ -378,7 +380,7 @@ public class ArticleServiceImpl extends BaseServiceImpl<ArticleDao, ArticleEntit
}
buildName(tokenDto,agencyGridNameList,publishRangeEntityList, fromDTO, articleGridResultDTO);
buildAgencyGridNames(tokenDto,agencyGridNameList,publishRangeEntityList, fromDTO, articleGridResultDTO);
draftEntity.setPublishRangeDesc(StringUtils.join(agencyGridNameList,"|"));
draftEntity.setPublishRangeDesc(StringUtils.join(agencyGridNameList,""));
return publishRangeEntityList;
}
@ -475,6 +477,15 @@ public class ArticleServiceImpl extends BaseServiceImpl<ArticleDao, ArticleEntit
@Override
@Transactional(rollbackFor = Exception.class)
public void offLineArticle(OffLineArticleFormDTO formDTO) {
//0:查询文章表数据,判断当前操作人是否是当初发表文章的人(谁发布的文章水才能下线)
ArticleEntity articleEntity = baseDao.selectById(formDTO.getArticleId());
if (null == articleEntity) {
throw new RenException(ArticleConstant.SELECT_ARTICLE_EXCEPTION);
}
if(!formDTO.getStaffId().equals(articleEntity.getCreatedBy())){
throw new RenException(ArticleConstant.SHIRO_EXCEPTION);
}
//1:根据文章Id查询全部(已发布、已下线)发布范围数据
ArticlePublishRangeEntity rangeEntity = new ArticlePublishRangeEntity();
rangeEntity.setArticleId(formDTO.getArticleId());
@ -532,9 +543,7 @@ public class ArticleServiceImpl extends BaseServiceImpl<ArticleDao, ArticleEntit
//4:文章操作记录表新增数据
//4.1:调用epmet-user服务,查询工作人员信息
CustomerStaffDTO staffDTO = getCustomerStaff(formDTO.getStaffId());
//4.2:查询文章表数据
ArticleEntity articleEntity = baseDao.selectById(formDTO.getArticleId());
//4.3:新增操作表数据
//4.2:新增操作表数据
ArticleOperateRecordEntity recordEntity = new ArticleOperateRecordEntity();
recordEntity.setCustomerId(articleEntity.getCustomerId());
recordEntity.setArticleId(formDTO.getArticleId());
@ -669,7 +678,7 @@ public class ArticleServiceImpl extends BaseServiceImpl<ArticleDao, ArticleEntit
loginUserDetailsFormDTO.setClient("wxmp");
loginUserDetailsFormDTO.setUserId(formDTO.getStaffId());
Result<LoginUserDetailsResultDTO> resultDTOResult = epmetUserOpenFeignClient.getLoginUserDetails(loginUserDetailsFormDTO);
String agencyId = resultDTOResult.getData().getOrgIdPath();
String agencyId = resultDTOResult.getData().getOrgIdPath().substring(resultDTOResult.getData().getOrgIdPath().lastIndexOf(":")+NumConstant.ONE);
//存放树的每一个节点对象,用于将同一节点下的网格列表合并(主键:agencyId 值:节点对象)
Map<String, ArticleGridResultDTO> map = new HashMap<>();
//3:循环可下线网格列表,根据pids组织每一个树节点对象信息
@ -920,7 +929,7 @@ public class ArticleServiceImpl extends BaseServiceImpl<ArticleDao, ArticleEntit
}
if (!isOk) {
this.sendMsg(draftEntity.getTitle(), String.format(ModuleConstant.MSG_ARTICLE_PUBLISH_ERROR, draftEntity.getTitle()));
this.sendMsg(draftEntity.getCustomerId(),draftEntity.getTitle(), String.format(ModuleConstant.MSG_ARTICLE_PUBLISH_ERROR, draftEntity.getTitle()));
this.updateDraftPublishStatus(draftId, DraftConstant.AUDITFAIL);
return null;
}
@ -987,7 +996,7 @@ public class ArticleServiceImpl extends BaseServiceImpl<ArticleDao, ArticleEntit
}
} catch (Exception e) {
log.error("scanContent exception", e);
this.sendMsg(draftEntity.getTitle(), String.format(ModuleConstant.MSG_ARTICLE_PUBLISH_ERROR, draftEntity.getTitle()));
this.sendMsg(draftEntity.getCustomerId(),draftEntity.getTitle(), String.format(ModuleConstant.MSG_ARTICLE_PUBLISH_ERROR, draftEntity.getTitle()));
this.updateDraftPublishStatus(draftId, DraftConstant.AUDITFAIL);
}
log.debug("scanContent result:{}", JSON.toJSONString(result));
@ -1023,7 +1032,7 @@ public class ArticleServiceImpl extends BaseServiceImpl<ArticleDao, ArticleEntit
}
} catch (Exception e) {
log.error("scanAllPassPublishArticle update db exception", e);
this.sendMsg(draft.getTitle(), String.format(ModuleConstant.MSG_ARTICLE_PUBLISH_ERROR, draft.getTitle()));
this.sendMsg(draft.getCustomerId(),draft.getTitle(), String.format(ModuleConstant.MSG_ARTICLE_PUBLISH_ERROR, draft.getTitle()));
this.updateDraftPublishStatus(draftId, DraftConstant.AUDITFAIL);
throw new RenException(EpmetErrorCode.SERVER_ERROR.getCode(), EpmetErrorCode.SERVER_ERROR.getMsg());
}
@ -1037,15 +1046,18 @@ public class ArticleServiceImpl extends BaseServiceImpl<ArticleDao, ArticleEntit
log.error("updateAuditStatusFailById draftId:{} is not exist in db", draftId);
throw new RenException(EpmetErrorCode.INTERNAL_VALIDATE_ERROR.getCode(), EpmetErrorCode.INTERNAL_VALIDATE_ERROR.getMsg());
}
boolean coverFail = false,contentFail = false;
try {
List<String> failDataIds = syncScanResult.getFailDataIds();
failDataIds.forEach(id -> {
for(String id:failDataIds) {
if (id.indexOf(ModuleConstant.SCAN_COVER_PREFIX) >= NumConstant.ZERO) {
draftCoverDao.updateAuditStatusById(id, ModuleConstant.AUDIT_STATUS_FAIL);
coverFail = true;
} else {
draftContentDao.updateAuditStatusById(id, ModuleConstant.AUDIT_STATUS_FAIL);
contentFail = true;
}
});
}
List<String> successDataIds = syncScanResult.getSuccessDataIds();
successDataIds.forEach(id -> {
if (id.indexOf(ModuleConstant.SCAN_COVER_PREFIX) >= 0) {
@ -1054,9 +1066,21 @@ public class ArticleServiceImpl extends BaseServiceImpl<ArticleDao, ArticleEntit
draftContentDao.updateAuditStatusById(id, ModuleConstant.AUDIT_STATUS_PASS);
}
});
if (coverFail || contentFail){
String auditMsg = "";
if (coverFail&&contentFail){
auditMsg = "内容和封面";
}else if (contentFail){
auditMsg = "内容";
}else if (coverFail){
auditMsg = "封面";
}
this.sendMsg(draft.getCustomerId(), draft.getTitle(), String.format(ModuleConstant.MSG_ARTICLE_PUBLISH_ERROR, draft.getTitle(),auditMsg));
this.updateDraftPublishStatus(draftId, DraftConstant.AUDITFAIL);
}
} catch (Exception e) {
log.error("scanAllPassPublishArticle update db exception", e);
this.sendMsg(draft.getTitle(), String.format(ModuleConstant.MSG_ARTICLE_PUBLISH_ERROR, draft.getTitle()));
this.sendMsg(draft.getCustomerId(), draft.getTitle(), String.format(ModuleConstant.MSG_ARTICLE_PUBLISH_ERROR, draft.getTitle()));
this.updateDraftPublishStatus(draftId, DraftConstant.AUDITFAIL);
throw new RenException(EpmetErrorCode.SERVER_ERROR.getCode(), EpmetErrorCode.SERVER_ERROR.getMsg());
}
@ -1067,9 +1091,9 @@ public class ArticleServiceImpl extends BaseServiceImpl<ArticleDao, ArticleEntit
return this.saveOrUpdateContent(tokenDto, fromDTO, false);
}
public Result sendMsg(String title,String content) {
public Result sendMsg(String customerId, String title,String content) {
UserMessageFormDTO formDTO = new UserMessageFormDTO();
formDTO.setCustomerId(loginUserUtil.getLoginUserApp());
formDTO.setCustomerId(customerId);
formDTO.setGridId("");
formDTO.setUserId(loginUserUtil.getLoginUserId());
formDTO.setApp(AppClientConstant.APP_GOV);

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

@ -139,7 +139,7 @@ public class DraftServiceImpl extends BaseServiceImpl<DraftDao, DraftEntity> imp
List<String> gridIdList = baseDao.selectDraftGrids(formDTO.getDraftId());
draftAttrResultDTO.setCoverImg(coverImgDTO);
draftAttrResultDTO.setGridIdList(gridIdList);
if (StringUtils.isNoneBlank(draftAttrResultDTO.getTags())) {
if (StringUtils.isNotBlank(draftAttrResultDTO.getTags())) {
String[] tagNames = draftAttrResultDTO.getTags().split("\\|");
draftAttrResultDTO.setTagNameList(tagNames);
}
@ -167,7 +167,7 @@ public class DraftServiceImpl extends BaseServiceImpl<DraftDao, DraftEntity> imp
} else {
draftDetailResultDTO.setArticleContentList(new ArrayList<>());
}
if (StringUtils.isNoneBlank(draftDetailResultDTO.getTags())) {
if (StringUtils.isNotBlank(draftDetailResultDTO.getTags())) {
String[] tagNames = draftDetailResultDTO.getTags().split("\\|");
draftDetailResultDTO.setTagNameList(tagNames);
}else{

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

@ -60,19 +60,16 @@
AND a.STATUS_FLAG = 'published'
AND a.CUSTOMER_ID = #{customerId}
<if test="tagIdList !=null and tagIdList.size() > 0">
AND EXISTS (
SELECT DISTINCT
at.ARTICLE_ID
FROM article_tags at
WHERE at.DEL_FLAG = '0'
AND at.ARTICLE_ID = a.ID
<foreach item="tagId" collection="tagIdList" open="AND (" separator="or" close=")" index="">
at.TAG_ID = #{tagId}
<foreach collection="tagIdList" item="tagId" separator=" ">
AND EXISTS(
SELECT 1
FROM ARTICLE_TAGS
WHERE DEL_FLAG = '0'
AND ARTICLE_ID = a.ID
AND TAG_ID=#{tagId}
)
</foreach>
)
</if>
ORDER BY PUBLISH_DATE DESC, UPDATED_TIME DESC
</select>
<select id="selectArticleListForGrid" resultType="com.epmet.dto.result.PublishedListResultDTO">
@ -118,16 +115,15 @@
</foreach>
) t
<if test="tagIdList !=null and tagIdList.size() > 0">
AND EXISTS (
SELECT DISTINCT
at.ARTICLE_ID
FROM article_tags at
WHERE at.DEL_FLAG = '0'
AND at.ARTICLE_ID = t.articleId
<foreach item="tagId" collection="tagIdList" open="AND (" separator="or" close=")" index="">
at.TAG_ID = #{tagId}
<foreach collection="tagIdList" item="tagId" separator=" ">
AND EXISTS(
SELECT 1
FROM ARTICLE_TAGS
WHERE DEL_FLAG = '0'
AND ARTICLE_ID = a.ID
AND TAG_ID=#{tagId}
)
</foreach>
)
</if>
ORDER BY publishDate DESC, UPDATED_TIME DESC
</select>

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

@ -50,7 +50,8 @@
PUBLISH_DATE,
TITLE,
PUBLISH_RANGE_DESC,
PUBLISHER_TYPE
PUBLISHER_TYPE,
TAGS
FROM
draft
WHERE

Loading…
Cancel
Save