From f620060f0be736c38e9250dca185901edfcd244d Mon Sep 17 00:00:00 2001 From: wxz Date: Tue, 2 Jun 2020 17:28:07 +0800 Subject: [PATCH 01/10] =?UTF-8?q?1.=E5=B0=86=E6=9F=A5=E8=AF=A2LoginUserDet?= =?UTF-8?q?ails=E6=8E=A5=E5=8F=A3=E4=BB=8Egov-access=E7=A7=BB=E5=88=B0?= =?UTF-8?q?=E4=BA=86epmet-user=E6=9C=8D=E5=8A=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/epmet/dto/form/LoginUserDetailsFormDTO.java | 10 ++++++++++ .../java/com/epmet/controller/UserController.java | 13 ++++++++++++- .../main/java/com/epmet/service/UserService.java | 11 +++++++---- .../com/epmet/service/impl/UserServiceImpl.java | 8 ++++++++ 4 files changed, 37 insertions(+), 5 deletions(-) create mode 100644 epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/LoginUserDetailsFormDTO.java diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/LoginUserDetailsFormDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/LoginUserDetailsFormDTO.java new file mode 100644 index 0000000000..7c1af89a00 --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/LoginUserDetailsFormDTO.java @@ -0,0 +1,10 @@ +package com.epmet.dto.form; + +import lombok.Data; + +@Data +public class LoginUserDetailsFormDTO { + private String app; + private String client; + private String userId; +} diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/UserController.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/UserController.java index d7f0f28dde..a02a38b24a 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/UserController.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/UserController.java @@ -10,11 +10,11 @@ import com.epmet.dto.UserDTO; import com.epmet.dto.UserWechatDTO; import com.epmet.dto.form.*; import com.epmet.dto.result.CreatedTimeByUserIdResultDTO; +import com.epmet.dto.result.LoginUserDetailsResultDTO; import com.epmet.dto.result.MyResiUserInfoResultDTO; import com.epmet.dto.result.PasswordLoginUserInfoResultDTO; import com.epmet.service.UserService; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.context.annotation.PropertySource; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; @@ -111,4 +111,15 @@ public class UserController { return new Result().ok(userService.resiMyselfMsg(myResiUserInfoFormDTO)); } + /** + * 从缓存中查询已登录用户的基本信息以及角色等相关信息 + * @return + */ + @PostMapping("loginuserdetails") + public Result getLoginUserDetails(@RequestBody LoginUserDetailsFormDTO dto) { + ValidatorUtils.validateEntity(dto, StaffPermCacheFormDTO.GetStaffCurrPermissions.class); + LoginUserDetailsResultDTO govTokenDto = userService.getLoginUserDetails(dto.getApp(), dto.getClient(), dto.getUserId()); + return new Result().ok(govTokenDto); + } + } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/UserService.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/UserService.java index a7bafa437e..1df8d94607 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/UserService.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/UserService.java @@ -1,19 +1,16 @@ package com.epmet.service; import com.epmet.commons.mybatis.service.BaseService; -import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.utils.Result; import com.epmet.dto.UserDTO; import com.epmet.dto.UserWechatDTO; import com.epmet.dto.form.*; import com.epmet.dto.result.CreatedTimeByUserIdResultDTO; +import com.epmet.dto.result.LoginUserDetailsResultDTO; import com.epmet.dto.result.MyResiUserInfoResultDTO; import com.epmet.dto.result.PasswordLoginUserInfoResultDTO; import com.epmet.entity.UserEntity; -import java.util.List; -import java.util.Map; - /** * @Description * @IntefaceName UserService @@ -73,4 +70,10 @@ public interface UserService extends BaseService { * @date 2020.05.22 19:24 **/ MyResiUserInfoResultDTO resiMyselfMsg(MyResiUserInfoFormDTO myResiUserInfoFormDTO); + + /** + * 查询登陆用户信息 + * @return + */ + LoginUserDetailsResultDTO getLoginUserDetails(String app, String client, String staffId); } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserServiceImpl.java index 3909ab2c2a..621259be47 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserServiceImpl.java @@ -2,6 +2,7 @@ package com.epmet.service.impl; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.utils.CpUserDetailRedis; import com.epmet.commons.tools.utils.Result; import com.epmet.constant.UserConstant; import com.epmet.dao.UserDao; @@ -42,6 +43,8 @@ public class UserServiceImpl extends BaseServiceImpl implem private GovOrgFeignClient govOrgFeignClient; @Autowired private UserRoleDao userRoleDao; + @Autowired + private CpUserDetailRedis cpUserDetailRedis; private static final Logger log = LoggerFactory.getLogger(UserServiceImpl.class); @@ -174,4 +177,9 @@ public class UserServiceImpl extends BaseServiceImpl implem return null; } + + @Override + public LoginUserDetailsResultDTO getLoginUserDetails(String app, String client, String userId) { + return cpUserDetailRedis.get(app, client, userId, LoginUserDetailsResultDTO.class); + } } From f9af919f2290501291419f04672c73aabdf0082e Mon Sep 17 00:00:00 2001 From: wxz Date: Tue, 2 Jun 2020 17:29:04 +0800 Subject: [PATCH 02/10] =?UTF-8?q?1.=E7=89=88=E6=9C=AC=E5=8D=87=E7=BA=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- epmet-user/epmet-user-server/deploy/docker-compose-dev.yml | 2 +- epmet-user/epmet-user-server/pom.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/epmet-user/epmet-user-server/deploy/docker-compose-dev.yml b/epmet-user/epmet-user-server/deploy/docker-compose-dev.yml index 8a1d84ff15..4d0c51854b 100644 --- a/epmet-user/epmet-user-server/deploy/docker-compose-dev.yml +++ b/epmet-user/epmet-user-server/deploy/docker-compose-dev.yml @@ -2,7 +2,7 @@ version: "3.7" services: epmet-user-server: container_name: epmet-user-server-dev - image: 192.168.1.130:10080/epmet-cloud-dev/epmet-user-server:0.3.53 + image: 192.168.1.130:10080/epmet-cloud-dev/epmet-user-server:0.3.54 ports: - "8087:8087" network_mode: host # 不会创建新的网络 diff --git a/epmet-user/epmet-user-server/pom.xml b/epmet-user/epmet-user-server/pom.xml index 37dfbcf945..61df77a965 100644 --- a/epmet-user/epmet-user-server/pom.xml +++ b/epmet-user/epmet-user-server/pom.xml @@ -2,7 +2,7 @@ 4.0.0 - 0.3.53 + 0.3.54 com.epmet epmet-user From 14da6aa70372857b0d6ec92b004ab9b238c3cc12 Mon Sep 17 00:00:00 2001 From: wxz Date: Tue, 2 Jun 2020 17:31:19 +0800 Subject: [PATCH 03/10] =?UTF-8?q?1.=E8=A1=A5=E5=85=85=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...TO.java => LoginUserDetailsResultDTO.java} | 29 +++++++++++++------ 1 file changed, 20 insertions(+), 9 deletions(-) rename epmet-module/gov-access/gov-access-client/src/main/java/com/epmet/dto/result/{LoginUserInfoResultDTO.java => LoginUserDetailsResultDTO.java} (56%) diff --git a/epmet-module/gov-access/gov-access-client/src/main/java/com/epmet/dto/result/LoginUserInfoResultDTO.java b/epmet-module/gov-access/gov-access-client/src/main/java/com/epmet/dto/result/LoginUserDetailsResultDTO.java similarity index 56% rename from epmet-module/gov-access/gov-access-client/src/main/java/com/epmet/dto/result/LoginUserInfoResultDTO.java rename to epmet-module/gov-access/gov-access-client/src/main/java/com/epmet/dto/result/LoginUserDetailsResultDTO.java index 440e5eb307..aba19d20a8 100644 --- a/epmet-module/gov-access/gov-access-client/src/main/java/com/epmet/dto/result/LoginUserInfoResultDTO.java +++ b/epmet-module/gov-access/gov-access-client/src/main/java/com/epmet/dto/result/LoginUserDetailsResultDTO.java @@ -5,17 +5,22 @@ import lombok.Data; import java.util.Set; @Data -public class LoginUserInfoResultDTO { +public class LoginUserDetailsResultDTO { /** - * 用户ID + * 政府端:gov、居民端:resi、运营端:oper */ - private String userId; + private String app; + + /** + * PC端:web、微信小程序:wxmp + */ + private String client; /** - * 权限列表 + * 用户ID */ - private Set permissions; + private String userId; /** * 角色列表 @@ -28,18 +33,24 @@ public class LoginUserInfoResultDTO { private Set deptIdList; /** - * 组织ID + * 当前登录的组织id(顶级) */ - private String orgIdPath; + private String agencyId; /** - * 网格ID + * 组织ID */ - private String gridId; + private String orgIdPath; /** * 网格ID列表 */ private Set gridIdList; + /** + * 当前工作人员进入的客户id + */ + private String customerId; + + } From 880c67067f5049e2783321f1460be09ca99e30f3 Mon Sep 17 00:00:00 2001 From: jianjun Date: Wed, 3 Jun 2020 09:44:53 +0800 Subject: [PATCH 04/10] =?UTF-8?q?=E6=96=87=E7=AB=A0=E5=8F=91=E5=B8=83?= =?UTF-8?q?=E8=8C=83=E5=9B=B4=E5=85=B3=E7=B3=BB=E8=A1=A8=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=20=E7=BD=91=E6=A0=BC=E5=90=8D=E7=A7=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/epmet/dto/ArticlePublishRangeDTO.java | 8 +- .../com/epmet/dto/DraftPublishRangeDTO.java | 8 +- .../epmet/dto/form/DraftContentFromDTO.java | 20 +---- .../epmet/controller/ArticleController.java | 8 +- .../entity/ArticlePublishRangeEntity.java | 5 ++ .../epmet/entity/DraftPublishRangeEntity.java | 5 ++ .../com/epmet/service/ArticleService.java | 4 +- .../service/impl/ArticleServiceImpl.java | 84 ++++++++----------- .../resources/migration/epmet_gov_voice.sql | 50 ++++++----- .../java/com/epmet/ArticleServiceTest.java | 45 ++++++++++ 10 files changed, 142 insertions(+), 95 deletions(-) create mode 100644 epmet-module/gov-voice/gov-voice-server/src/test/java/com/epmet/ArticleServiceTest.java diff --git a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/ArticlePublishRangeDTO.java b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/ArticlePublishRangeDTO.java index 84a24f947b..02106d920b 100644 --- a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/ArticlePublishRangeDTO.java +++ b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/ArticlePublishRangeDTO.java @@ -17,9 +17,10 @@ package com.epmet.dto; +import lombok.Data; + import java.io.Serializable; import java.util.Date; -import lombok.Data; /** @@ -53,6 +54,11 @@ public class ArticlePublishRangeDTO implements Serializable { */ private String gridId; + /** + * 组织-网格名称 + */ + private String agencyGridName; + /** * 下线时间 */ diff --git a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/DraftPublishRangeDTO.java b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/DraftPublishRangeDTO.java index b0c57bb112..8457b400ea 100644 --- a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/DraftPublishRangeDTO.java +++ b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/DraftPublishRangeDTO.java @@ -17,9 +17,10 @@ package com.epmet.dto; +import lombok.Data; + import java.io.Serializable; import java.util.Date; -import lombok.Data; /** @@ -53,6 +54,11 @@ public class DraftPublishRangeDTO implements Serializable { */ private String gridId; + /** + * 组织-网格名称 + */ + private String agencyGridName; + /** * 下线时间 */ diff --git a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/DraftContentFromDTO.java b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/DraftContentFromDTO.java index 81d39fa698..5d933697d7 100644 --- a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/DraftContentFromDTO.java +++ b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/DraftContentFromDTO.java @@ -35,15 +35,7 @@ public class DraftContentFromDTO implements Serializable { private static final long serialVersionUID = -4206020151361420221L; - /** - * 文章ID 重新编辑时必填 - */ - private String articleId; - /** - * 客户ID - */ - private String customerId; /** * 草稿ID @@ -69,7 +61,7 @@ public class DraftContentFromDTO implements Serializable { /** * 内容Id */ - private String draftId; + private String draftContentId; /** * 内容 */ @@ -80,16 +72,6 @@ public class DraftContentFromDTO implements Serializable { */ private String contentType; - /** - * 审核状态 通过:pass;失败:fail; - */ - private String auditStatus; - - /** - * 审核理由 - */ - private String auditReason; - /** * 内容顺序 从1开始 */ diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/ArticleController.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/ArticleController.java index e72213a34d..48b7096595 100644 --- a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/ArticleController.java +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/ArticleController.java @@ -28,10 +28,8 @@ import com.epmet.commons.tools.validator.group.AddGroup; import com.epmet.commons.tools.validator.group.DefaultGroup; import com.epmet.commons.tools.validator.group.UpdateGroup; import com.epmet.dto.ArticleDTO; -import com.epmet.dto.form.LatestListFormDTO; -import com.epmet.dto.result.ArticleGridResultDTO; -import com.epmet.dto.result.LatestListResultDTO; import com.epmet.dto.form.DraftContentFromDTO; +import com.epmet.dto.result.ArticleGridResultDTO; import com.epmet.excel.ArticleExcel; import com.epmet.service.ArticleService; import org.springframework.beans.factory.annotation.Autowired; @@ -114,8 +112,8 @@ public class ArticleController { * @throws Exception */ @GetMapping("savecontent") - public Result savecontent(@RequestBody DraftContentFromDTO fromDTO) throws Exception { - String draftId = articleService.saveOrUpdateContent(fromDTO); + public Result saveOrUpdateContent(@LoginUser TokenDto tokenDto,@RequestBody DraftContentFromDTO fromDTO) throws Exception { + String draftId = articleService.saveOrUpdateContent(tokenDto, fromDTO); return new Result().ok(draftId); } diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/entity/ArticlePublishRangeEntity.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/entity/ArticlePublishRangeEntity.java index 9ee3aa1afa..de4911067c 100644 --- a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/entity/ArticlePublishRangeEntity.java +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/entity/ArticlePublishRangeEntity.java @@ -53,6 +53,11 @@ public class ArticlePublishRangeEntity extends BaseEpmetEntity { */ private String gridId; + /** + * 组织-网格名称 + */ + private String agencyGridName; + /** * 下线时间 */ diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/entity/DraftPublishRangeEntity.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/entity/DraftPublishRangeEntity.java index 93833228cf..fb3233cbb1 100644 --- a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/entity/DraftPublishRangeEntity.java +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/entity/DraftPublishRangeEntity.java @@ -53,6 +53,11 @@ public class DraftPublishRangeEntity extends BaseEpmetEntity { */ private String gridId; + /** + * 组织-网格名称 + */ + private String agencyGridName; + /** * 下线时间 */ diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/ArticleService.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/ArticleService.java index 9cae7ed196..dd166a0b51 100644 --- a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/ArticleService.java +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/ArticleService.java @@ -106,8 +106,10 @@ public interface ArticleService extends BaseService { /** * desc:保存或修改文章内容 + * + * @param tokenDto * @param fromDTO * @return */ - String saveOrUpdateContent(DraftContentFromDTO fromDTO); + String saveOrUpdateContent(TokenDto tokenDto, DraftContentFromDTO fromDTO); } \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/ArticleServiceImpl.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/ArticleServiceImpl.java index 3b082d2776..778a08b7b4 100644 --- a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/ArticleServiceImpl.java +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/ArticleServiceImpl.java @@ -16,17 +16,16 @@ */ package com.epmet.service.impl; - import com.alibaba.fastjson.JSON; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.exception.RenException; import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.ConvertUtils; -import com.epmet.commons.tools.constant.FieldConstant; import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.ValidatorUtils; import com.epmet.commons.tools.validator.group.AddGroup; @@ -36,8 +35,8 @@ import com.epmet.dao.DraftContentDao; import com.epmet.dao.DraftDao; import com.epmet.dto.ArticleDTO; import com.epmet.dto.feign.GovOrgSelfFeignClient; -import com.epmet.dto.result.ArticleGridResultDTO; import com.epmet.dto.form.DraftContentFromDTO; +import com.epmet.dto.result.ArticleGridResultDTO; import com.epmet.entity.ArticleEntity; import com.epmet.entity.DraftContentEntity; import com.epmet.entity.DraftEntity; @@ -49,11 +48,9 @@ import org.apache.commons.logging.LogFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; -import org.springframework.web.bind.annotation.PathVariable; import org.springframework.util.CollectionUtils; import java.util.*; -import java.util.stream.Collectors; /** * 文章表 @@ -63,14 +60,12 @@ import java.util.stream.Collectors; */ @Service public class ArticleServiceImpl extends BaseServiceImpl implements ArticleService { - + private final Log logger = LogFactory.getLog(getClass()); @Autowired private ArticleRedis articleRedis; @Autowired private GovOrgSelfFeignClient govOrgSelfFeignClient; - private final Log logger = LogFactory.getLog(getClass()); - @Autowired - private ArticleRedis articleRedis; + @Autowired private DraftDao draftDao; @@ -145,25 +140,13 @@ public class ArticleServiceImpl extends BaseServiceImpl articleParamMap = new HashMap<>(); - articleParamMap.put("ARTICLE_ID", fromDTO.getArticleId()); - articleParamMap.put("ARTICLE_ID", fromDTO.getArticleId()); - articleDao.selectByMap(articleParamMap); - } DraftEntity draftEntity = null; List draftContentList = null; if (StringUtils.isNotBlank(fromDTO.getDraftId())) { - //TODO - draftEntity = draftDao.selectById(fromDTO.getDraftId()); if (draftEntity == null) { logger.warn("saveOrUpdateContent draftId is not exist in db"); @@ -176,56 +159,63 @@ public class ArticleServiceImpl extends BaseServiceImpl draftIdMap = new HashMap<>(); + draftIdMap.put("DRAFT_ID", fromDTO.getDraftId()); + draftContentDao.deleteByMap(draftIdMap); //TODO 改为批量插入 draftContentList.forEach(content -> draftContentDao.insert(content)); - String draftId = draftEntity.getId(); - - - return null; + return draftId; } /** * desc:构建 内容对象 * + * + * @param tokenDto * @param fromDTO - * @param havePublished * @return */ - private List buildDraftContent(DraftContentFromDTO fromDTO, boolean havePublished) { + private List buildDraftContent(TokenDto tokenDto, DraftContentFromDTO fromDTO) { //如果已发布 则需要校验内容是否更改过 没有更改则 不对审核状态进行重置 List newContentList = new ArrayList<>(); - Map oldContentMap = null; - Map draftIdMap = new HashMap<>(); - draftIdMap.put("DRAFT_ID", fromDTO.getDraftId()); - if (havePublished) { - List oldContentEntities = draftContentDao.selectByMap(draftIdMap); - oldContentMap = oldContentEntities.stream().collect(Collectors.toMap(DraftContentEntity::getId, content -> content)); - //删掉所有 - draftContentDao.deleteByMap(draftIdMap); - } + List contentList = fromDTO.getContentList(); - Map finalOldContentMap = oldContentMap; Set orderNumSet = new HashSet<>(); contentList.forEach(content -> { - if (finalOldContentMap != null && finalOldContentMap.get(content.getDraftId()) != null) { - DraftContentEntity oldContent = finalOldContentMap.get(content.getDraftId()); - if (oldContent.getContent().equals(content.getContent())) { - content.setAuditReason(oldContent.getAuditReason()); - content.setAuditStatus(oldContent.getAuditStatus()); - } - } DraftContentEntity entity = ConvertUtils.sourceToTarget(content, DraftContentEntity.class); - entity.setId(content.getDraftId()); + entity.setId(content.getDraftContentId()); + entity.setCustomerId(tokenDto.getCustomerId()); + entity.setDraftId(fromDTO.getDraftId()); orderNumSet.add(content.getOrderNum()); newContentList.add(entity); }); diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/resources/migration/epmet_gov_voice.sql b/epmet-module/gov-voice/gov-voice-server/src/main/resources/migration/epmet_gov_voice.sql index d616dd51e2..3a38eaa980 100644 --- a/epmet-module/gov-voice/gov-voice-server/src/main/resources/migration/epmet_gov_voice.sql +++ b/epmet-module/gov-voice/gov-voice-server/src/main/resources/migration/epmet_gov_voice.sql @@ -1,11 +1,4 @@ -/* - Date: 2/06/2020 16:13:38 -*/ - --- SET NAMES utf8mb4; --- #SET FOREIGN_KEY_CHECKS = 0; - -CREATE DATABASE `epmet_gov_access` DEFAULT CHARACTER SET utf8mb4; +DROP TABLE tag_default;/*SkipError*/ CREATE TABLE tag_default( ID VARCHAR(64) NOT NULL COMMENT '主键ID' , TAG_NAME VARCHAR(32) NOT NULL COMMENT '标签名称' , @@ -19,6 +12,7 @@ CREATE TABLE tag_default( ) COMMENT = '默认标签表 默认标签表'; ALTER TABLE tag_default COMMENT '默认标签表'; +DROP TABLE tag_customer;/*SkipError*/ CREATE TABLE tag_customer( ID VARCHAR(64) NOT NULL COMMENT '主键ID' , CUSTOMER_ID VARCHAR(64) NOT NULL COMMENT '客户ID' , @@ -35,6 +29,7 @@ CREATE TABLE tag_customer( ALTER TABLE tag_customer ADD INDEX INX_TAG_NAME(TAG_NAME); ALTER TABLE tag_customer COMMENT '客户标签表'; +DROP TABLE tag_grid;/*SkipError*/ CREATE TABLE tag_grid( ID VARCHAR(64) NOT NULL COMMENT '主键ID' , CUSTOMER_ID VARCHAR(64) NOT NULL COMMENT '客户ID' , @@ -52,6 +47,7 @@ CREATE TABLE tag_grid( ) COMMENT = '网格标签表 网格标签表'; ALTER TABLE tag_grid COMMENT '网格标签表'; +DROP TABLE article_tags;/*SkipError*/ CREATE TABLE article_tags( ID VARCHAR(64) NOT NULL COMMENT '主键ID' , CUSTOMER_ID VARCHAR(64) NOT NULL COMMENT '客户ID' , @@ -69,18 +65,19 @@ CREATE TABLE article_tags( ALTER TABLE article_tags ADD INDEX IDX_ARTICLE_ID(ARTICLE_ID); ALTER TABLE article_tags COMMENT '文章标签表'; +DROP TABLE draft;/*SkipError*/ CREATE TABLE draft( ID VARCHAR(64) NOT NULL COMMENT '主键ID' , CUSTOMER_ID VARCHAR(64) NOT NULL COMMENT '客户ID' , TITLE VARCHAR(128) NOT NULL COMMENT '文章标题' , PREVIEW_CONTENT VARCHAR(512) NOT NULL COMMENT '文章内容 精简内容' , - IS_TOP INT NOT NULL COMMENT '是否置顶' , + IS_TOP INT NOT NULL COMMENT '是否置顶 1是;0否;' , PUBLISH_RANGE_DESC VARCHAR(512) NOT NULL COMMENT '发布范围描述 所有发布范围集合' , PUBLISHER_ID VARCHAR(64) NOT NULL COMMENT '发布单位ID' , PUBLISHER_NAME VARCHAR(128) NOT NULL COMMENT '发布单位名称' , PUBLISHER_TYPE VARCHAR(32) NOT NULL COMMENT '发布单位类型 机关:agency;部门:department;网格:grid' , PUBLISH_DATE DATE NOT NULL COMMENT '发布时间' , - STATUS_FLAG VARCHAR(32) NOT NULL COMMENT '发布状态 未发布:unpublish ;已发布:published,审核中:auditing,审核失败:auditfail' , + STATUS_FLAG VARCHAR(32) NOT NULL COMMENT '发布状态 未发布:unpublish ;已发布:published,审核中:auditing;审核失败:auditfail' , TAGS VARCHAR(512) NOT NULL COMMENT '文章标签串 竖杠分割的标签名称' , ORG_ID VARCHAR(64) COMMENT '组织ID' , ORG_ID_PATH VARCHAR(512) COMMENT '组织ID路径 eg:字段为def:abc' , @@ -96,14 +93,15 @@ CREATE TABLE draft( ) COMMENT = '草稿表 草稿表'; ALTER TABLE draft COMMENT '草稿表'; +DROP TABLE draft_content;/*SkipError*/ CREATE TABLE draft_content( ID VARCHAR(64) NOT NULL COMMENT '主键ID 主键ID' , CUSTOMER_ID VARCHAR(64) NOT NULL COMMENT '客户ID' , DRAFT_ID VARCHAR(64) NOT NULL COMMENT '草稿ID' , CONTENT VARCHAR(1024) NOT NULL COMMENT '内容' , CONTENT_TYPE VARCHAR(32) NOT NULL COMMENT '内容类型 图片:img;文字:text' , - AUDIT_STATUS VARCHAR(32) NOT NULL COMMENT '审核状态 通过:pass;失败:fail;' , - AUDIT_REASON VARCHAR(128) NOT NULL COMMENT '审核理由' , + AUDIT_STATUS VARCHAR(32) COMMENT '审核状态 通过:pass;失败:fail;审核中:auditing;' , + AUDIT_REASON VARCHAR(128) COMMENT '审核理由' , ORDER_NUM INT NOT NULL COMMENT '内容顺序 从1开始' , DEL_FLAG INT NOT NULL DEFAULT 0 COMMENT '删除标识 0.未删除 1.已删除' , REVISION INT NOT NULL COMMENT '乐观锁' , @@ -115,11 +113,13 @@ CREATE TABLE draft_content( ) COMMENT = '草稿内容表 草稿内容表'; ALTER TABLE draft_content COMMENT '草稿内容表'; +DROP TABLE draft_publish_range;/*SkipError*/ CREATE TABLE draft_publish_range( ID VARCHAR(64) NOT NULL COMMENT '主键ID' , CUSTOMER_ID VARCHAR(64) NOT NULL COMMENT '客户ID' , DRAFT_ID VARCHAR(64) NOT NULL COMMENT 'ID草稿' , GRID_ID VARCHAR(64) NOT NULL COMMENT '网格ID' , + AGENCY_GRID_NAME VARCHAR(64) NOT NULL COMMENT '组织-网格名称' , OFF_LINE_TIME DATETIME COMMENT '下线时间' , PUBLISH_STATUS VARCHAR(32) NOT NULL COMMENT '发布状态 未发布:unpublish ;已发布:published' , DEL_FLAG INT NOT NULL DEFAULT 0 COMMENT '删除标识 0.未删除 1.已删除' , @@ -132,13 +132,14 @@ CREATE TABLE draft_publish_range( ) COMMENT = '草稿发布范围表 草稿发布范围表'; ALTER TABLE draft_publish_range COMMENT '草稿发布范围表'; +DROP TABLE draft_cover;/*SkipError*/ CREATE TABLE draft_cover( ID VARCHAR(64) NOT NULL COMMENT '主键ID' , CUSTOMER_ID VARCHAR(64) NOT NULL COMMENT '客户ID' , DRAFT_ID VARCHAR(64) NOT NULL COMMENT '草稿ID' , IMG_URL VARCHAR(512) NOT NULL COMMENT '封面图片地址 url地址' , - AUDIT_STATUS VARCHAR(32) NOT NULL COMMENT '审核状态 通过:pass;失败:fail;' , - AUDIT_REASON VARCHAR(128) NOT NULL COMMENT '审核理由' , + AUDIT_STATUS VARCHAR(32) COMMENT '审核状态 通过:pass;失败:fail;审核中:auditing;' , + AUDIT_REASON VARCHAR(128) COMMENT '审核理由' , DEL_FLAG INT NOT NULL DEFAULT 0 COMMENT '删除标识 0.未删除 1.已删除' , REVISION INT NOT NULL COMMENT '乐观锁' , CREATED_BY VARCHAR(32) NOT NULL COMMENT '创建人' , @@ -149,14 +150,15 @@ CREATE TABLE draft_cover( ) COMMENT = '草稿封面表 草稿封面表'; ALTER TABLE draft_cover COMMENT '草稿封面表'; +DROP TABLE article;/*SkipError*/ CREATE TABLE article( ID VARCHAR(64) NOT NULL COMMENT '主键ID' , CUSTOMER_ID VARCHAR(64) NOT NULL COMMENT '客户ID' , DRAFT_ID VARCHAR(64) NOT NULL COMMENT '草稿ID' , TITLE VARCHAR(128) NOT NULL COMMENT '文章标题' , PREVIEW_CONTENT VARCHAR(512) NOT NULL COMMENT '文章内容 精简内容' , - IS_TOP INT NOT NULL COMMENT '是否置顶' , - PUBLISH_RANGE_DESC VARCHAR(512) NOT NULL COMMENT '发布范围描述 所有发布范围集合' , + IS_TOP INT NOT NULL COMMENT '是否置顶 1是;0否;' , + PUBLISH_RANGE_DESC VARCHAR(512) NOT NULL COMMENT '发布范围描述 所有发布范围集合,顿号隔开' , PUBLISHER_ID VARCHAR(64) NOT NULL COMMENT '发布单位ID' , PUBLISHER_NAME VARCHAR(128) NOT NULL COMMENT '发布单位名称' , PUBLISHER_TYPE VARCHAR(32) NOT NULL COMMENT '发布单位类型 机关:agency;部门:department;网格:grid' , @@ -178,14 +180,15 @@ CREATE TABLE article( ) COMMENT = '文章表 正式文章表'; ALTER TABLE article COMMENT '文章表'; +DROP TABLE article_content;/*SkipError*/ CREATE TABLE article_content( ID VARCHAR(64) NOT NULL COMMENT '主键ID 主键ID' , CUSTOMER_ID VARCHAR(64) NOT NULL COMMENT '客户ID' , ARTICLE_ID VARCHAR(64) NOT NULL COMMENT '文章ID' , CONTENT VARCHAR(1024) NOT NULL COMMENT '内容' , CONTENT_TYPE VARCHAR(32) NOT NULL COMMENT '内容类型 图片:img;文字:text' , - AUDIT_STATUS VARCHAR(32) NOT NULL COMMENT '审核状态 通过:pass;失败:fail;审核中:auditing' , - AUDIT_REASON VARCHAR(128) NOT NULL COMMENT '审核理由' , + AUDIT_STATUS VARCHAR(32) COMMENT '审核状态 通过:pass;失败:fail;审核中:auditing;' , + AUDIT_REASON VARCHAR(128) COMMENT '审核理由' , ORDER_NUM INT NOT NULL COMMENT '内容顺序 从1开始' , DEL_FLAG INT NOT NULL DEFAULT 0 COMMENT '删除标识 0.未删除 1.已删除' , REVISION INT NOT NULL COMMENT '乐观锁' , @@ -197,13 +200,14 @@ CREATE TABLE article_content( ) COMMENT = '文章内容表 文章内容表'; ALTER TABLE article_content COMMENT '文章内容表'; +DROP TABLE article_cover;/*SkipError*/ CREATE TABLE article_cover( ID VARCHAR(64) NOT NULL COMMENT '主键ID' , CUSTOMER_ID VARCHAR(64) NOT NULL COMMENT '客户ID' , ARTICLE_ID VARCHAR(64) NOT NULL COMMENT '文章ID' , IMG_URL VARCHAR(512) NOT NULL COMMENT '封面图片地址 url地址' , - AUDIT_STATUS VARCHAR(32) NOT NULL COMMENT '审核状态 通过:pass;失败:fail;审核中:auditing' , - AUDIT_REASON VARCHAR(128) NOT NULL COMMENT '审核理由' , + AUDIT_STATUS VARCHAR(32) COMMENT '审核状态 通过:pass;失败:fail;审核中:auditing' , + AUDIT_REASON VARCHAR(128) COMMENT '审核理由' , DEL_FLAG INT NOT NULL DEFAULT 0 COMMENT '删除标识 0.未删除 1.已删除' , REVISION INT NOT NULL COMMENT '乐观锁' , CREATED_BY VARCHAR(32) NOT NULL COMMENT '创建人' , @@ -214,13 +218,15 @@ CREATE TABLE article_cover( ) COMMENT = '文章封面表 文章封面表'; ALTER TABLE article_cover COMMENT '文章封面表'; +DROP TABLE article_publish_range;/*SkipError*/ CREATE TABLE article_publish_range( ID VARCHAR(64) NOT NULL COMMENT '主键ID' , CUSTOMER_ID VARCHAR(64) NOT NULL COMMENT '客户ID' , ARTICLE_ID VARCHAR(64) NOT NULL COMMENT '文章ID' , GRID_ID VARCHAR(64) NOT NULL COMMENT '网格ID' , + AGENCY_GRID_NAME VARCHAR(64) NOT NULL COMMENT '组织-网格名称' , OFF_LINE_TIME DATETIME COMMENT '下线时间' , - PUBLISH_STATUS VARCHAR(32) NOT NULL COMMENT '发布状态' , + PUBLISH_STATUS VARCHAR(32) NOT NULL COMMENT '发布状态 未发布:unpublish ;已发布:published' , DEL_FLAG INT NOT NULL DEFAULT 0 COMMENT '删除标识 0.未删除 1.已删除' , REVISION INT NOT NULL COMMENT '乐观锁' , CREATED_BY VARCHAR(32) NOT NULL COMMENT '创建人' , @@ -232,6 +238,7 @@ CREATE TABLE article_publish_range( ALTER TABLE article_publish_range ADD INDEX IDX_ARTICLE_ID(ARTICLE_ID); ALTER TABLE article_publish_range COMMENT '文章发布范围表'; +DROP TABLE article_operate_record;/*SkipError*/ CREATE TABLE article_operate_record( ID VARCHAR(64) NOT NULL COMMENT '主键ID 主键ID' , CUSTOMER_ID VARCHAR(64) NOT NULL COMMENT '客户ID' , @@ -250,6 +257,7 @@ CREATE TABLE article_operate_record( ) COMMENT = '文章操作记录表 文章操作记录表'; ALTER TABLE article_operate_record COMMENT '文章操作记录表'; +DROP TABLE article_visit_record;/*SkipError*/ CREATE TABLE article_visit_record( ID VARCHAR(64) NOT NULL COMMENT '主键ID' , CUSTOMER_ID VARCHAR(64) NOT NULL COMMENT '客户ID' , diff --git a/epmet-module/gov-voice/gov-voice-server/src/test/java/com/epmet/ArticleServiceTest.java b/epmet-module/gov-voice/gov-voice-server/src/test/java/com/epmet/ArticleServiceTest.java new file mode 100644 index 0000000000..6d0903be34 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/test/java/com/epmet/ArticleServiceTest.java @@ -0,0 +1,45 @@ +package com.epmet; + +import com.epmet.commons.tools.security.dto.TokenDto; +import com.epmet.dto.form.DraftContentFromDTO; +import com.epmet.service.ArticleService; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.test.context.junit4.SpringRunner; + +import java.util.ArrayList; +import java.util.List; + +@RunWith(SpringRunner.class) +@SpringBootTest +public class ArticleServiceTest { + + + + @Autowired + private ArticleService articleService; + + @Test + public void genToken() { + TokenDto tokenDto = new TokenDto(); + tokenDto.setCustomerId("1"); + tokenDto.setUserId("1"); + DraftContentFromDTO draftContentFromDTO = new DraftContentFromDTO(); + //draftContentFromDTO.setDraftId("1"); + draftContentFromDTO.setTitle("testTitle"); + List list = new ArrayList<>(); + for (int i = 0; i <2 ; i++) { + DraftContentFromDTO.DraftContentDTO contentDTO = new DraftContentFromDTO.DraftContentDTO(); + contentDTO.setDraftContentId(""); + contentDTO.setContent("内容"+i); + contentDTO.setContentType("text"); + contentDTO.setOrderNum(1+i); + list.add(contentDTO); + } + draftContentFromDTO.setContentList(list); + String s = articleService.saveOrUpdateContent(tokenDto, draftContentFromDTO); + System.out.println(s); + } +} From 5f7215306b160d8654308e25d48777d2fcbf4b58 Mon Sep 17 00:00:00 2001 From: jianjun Date: Wed, 3 Jun 2020 10:08:29 +0800 Subject: [PATCH 05/10] =?UTF-8?q?=E4=BF=9D=E5=AD=98=E6=96=87=E7=AB=A0?= =?UTF-8?q?=E5=86=85=E5=AE=B9=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/ArticleServiceImpl.java | 46 +++++++++---------- 1 file changed, 21 insertions(+), 25 deletions(-) diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/ArticleServiceImpl.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/ArticleServiceImpl.java index 778a08b7b4..d8ca414445 100644 --- a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/ArticleServiceImpl.java +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/ArticleServiceImpl.java @@ -16,6 +16,7 @@ */ package com.epmet.service.impl; + import com.alibaba.fastjson.JSON; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; @@ -61,10 +62,10 @@ import java.util.*; @Service public class ArticleServiceImpl extends BaseServiceImpl implements ArticleService { private final Log logger = LogFactory.getLog(getClass()); - @Autowired - private ArticleRedis articleRedis; - @Autowired - private GovOrgSelfFeignClient govOrgSelfFeignClient; + @Autowired + private ArticleRedis articleRedis; + @Autowired + private GovOrgSelfFeignClient govOrgSelfFeignClient; @Autowired @@ -126,17 +127,17 @@ public class ArticleServiceImpl extends BaseServiceImpl result = govOrgSelfFeignClient.getAgencyGridList(tokenDTO.getUserId()); - return result.getData(); - } + /** + * @param tokenDTO + * @return + * @Author sun + * @Description 党建声音-政府端-可选发布范围 + **/ + @Override + public ArticleGridResultDTO agencyGridList(TokenDto tokenDTO) { + Result result = govOrgSelfFeignClient.getAgencyGridList(tokenDTO.getUserId()); + return result.getData(); + } @Override @Transactional(rollbackFor = Exception.class) @@ -181,7 +182,7 @@ public class ArticleServiceImpl extends BaseServiceImpl buildDraftContent(TokenDto tokenDto, DraftContentFromDTO fromDTO) { - //如果已发布 则需要校验内容是否更改过 没有更改则 不对审核状态进行重置 List newContentList = new ArrayList<>(); List contentList = fromDTO.getContentList(); - Set orderNumSet = new HashSet<>(); - contentList.forEach(content -> { + for (int i = 0; i < contentList.size(); i++) { + DraftContentFromDTO.DraftContentDTO content = contentList.get(i); DraftContentEntity entity = ConvertUtils.sourceToTarget(content, DraftContentEntity.class); entity.setId(content.getDraftContentId()); entity.setCustomerId(tokenDto.getCustomerId()); entity.setDraftId(fromDTO.getDraftId()); - orderNumSet.add(content.getOrderNum()); + entity.setOrderNum(i + 1); newContentList.add(entity); - }); - if (orderNumSet.size() != newContentList.size()) { - logger.warn("saveOrUpdateContent contentList orderNum is repeat"); - throw new RenException("参数错误"); } + return newContentList; } From 62226f7b8b147a47f0351c6894957802e17fc6c7 Mon Sep 17 00:00:00 2001 From: wxz Date: Wed, 3 Jun 2020 10:10:23 +0800 Subject: [PATCH 06/10] =?UTF-8?q?1.gov-access=E5=88=A0=E9=99=A4=E6=97=A0?= =?UTF-8?q?=E6=95=88=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../epmet/controller/AccessController.java | 43 +++++++++---------- 1 file changed, 20 insertions(+), 23 deletions(-) diff --git a/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/controller/AccessController.java b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/controller/AccessController.java index 8a68bec452..487c854dd9 100644 --- a/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/controller/AccessController.java +++ b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/controller/AccessController.java @@ -1,16 +1,13 @@ package com.epmet.controller; -import com.epmet.commons.tools.security.dto.GovTokenDto; import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.ValidatorUtils; import com.epmet.dto.form.*; -import com.epmet.dto.result.LoginUserInfoResultDTO; import com.epmet.dto.result.RoleOpeScopeResultDTO; import com.epmet.service.AccessService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; -import javax.validation.constraints.NotBlank; import java.util.List; import java.util.Set; @@ -46,26 +43,26 @@ public class AccessController { return new Result(); } - /** - * 从缓存中查询用户信息(DataFilterAspect中用到) - * @return - */ - @PostMapping("loginuserinfo") - public Result getLoginUserInfo(@RequestBody StaffPermCacheFormDTO dto) { - ValidatorUtils.validateEntity(dto, StaffPermCacheFormDTO.GetStaffCurrPermissions.class); - GovTokenDto govTokenDto = accessService.getUserDetails(dto.getApp(), dto.getClient(), dto.getStaffId()); - LoginUserInfoResultDTO resultDTO = null; - if (govTokenDto != null) { - resultDTO = new LoginUserInfoResultDTO(); - resultDTO.setRoleIdList(govTokenDto.getRoleIdList()); - //resultDTO.setGridId(govTokenDto.getGridId()); - resultDTO.setOrgIdPath(govTokenDto.getOrgIdPath()); - resultDTO.setGridIdList(govTokenDto.getGridIdList()); - resultDTO.setDeptIdList(govTokenDto.getDeptIdList()); - resultDTO.setUserId(govTokenDto.getUserId()); - } - return new Result().ok(resultDTO); - } + ///** + // * 从缓存中查询用户信息(DataFilterAspect中用到) + // * @return + // */ + //@PostMapping("loginuserinfo") + //public Result getLoginUserInfo(@RequestBody StaffPermCacheFormDTO dto) { + // ValidatorUtils.validateEntity(dto, StaffPermCacheFormDTO.GetStaffCurrPermissions.class); + // GovTokenDto govTokenDto = accessService.getUserDetails(dto.getApp(), dto.getClient(), dto.getStaffId()); + // LoginUserInfoResultDTO resultDTO = null; + // if (govTokenDto != null) { + // resultDTO = new LoginUserInfoResultDTO(); + // resultDTO.setRoleIdList(govTokenDto.getRoleIdList()); + // //resultDTO.setGridId(govTokenDto.getGridId()); + // resultDTO.setOrgIdPath(govTokenDto.getOrgIdPath()); + // resultDTO.setGridIdList(govTokenDto.getGridIdList()); + // resultDTO.setDeptIdList(govTokenDto.getDeptIdList()); + // resultDTO.setUserId(govTokenDto.getUserId()); + // } + // return new Result().ok(resultDTO); + //} /** * 查询角色的操作key对应操作范围列表(缓存) From d0ff40e6998a04ca8ce19d2854e3e2fd065f73df Mon Sep 17 00:00:00 2001 From: wxz Date: Wed, 3 Jun 2020 10:11:42 +0800 Subject: [PATCH 07/10] =?UTF-8?q?1.=E7=89=88=E6=9C=AC=E5=8D=87=E7=BA=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- epmet-user/epmet-user-server/deploy/docker-compose-dev.yml | 2 +- epmet-user/epmet-user-server/pom.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/epmet-user/epmet-user-server/deploy/docker-compose-dev.yml b/epmet-user/epmet-user-server/deploy/docker-compose-dev.yml index 4d0c51854b..6d258a8771 100644 --- a/epmet-user/epmet-user-server/deploy/docker-compose-dev.yml +++ b/epmet-user/epmet-user-server/deploy/docker-compose-dev.yml @@ -2,7 +2,7 @@ version: "3.7" services: epmet-user-server: container_name: epmet-user-server-dev - image: 192.168.1.130:10080/epmet-cloud-dev/epmet-user-server:0.3.54 + image: 192.168.1.130:10080/epmet-cloud-dev/epmet-user-server:0.3.55 ports: - "8087:8087" network_mode: host # 不会创建新的网络 diff --git a/epmet-user/epmet-user-server/pom.xml b/epmet-user/epmet-user-server/pom.xml index 61df77a965..482d837c19 100644 --- a/epmet-user/epmet-user-server/pom.xml +++ b/epmet-user/epmet-user-server/pom.xml @@ -2,7 +2,7 @@ 4.0.0 - 0.3.54 + 0.3.55 com.epmet epmet-user From 927c9431c0188f00668d8d2e2accb4099f4033d2 Mon Sep 17 00:00:00 2001 From: wxz Date: Wed, 3 Jun 2020 10:30:41 +0800 Subject: [PATCH 08/10] =?UTF-8?q?1.=E6=9D=83=E9=99=90=E6=A8=A1=E5=9D=97?= =?UTF-8?q?=E8=8E=B7=E5=8F=96=E7=99=BB=E9=99=86=E7=94=A8=E6=88=B7=E4=BF=A1?= =?UTF-8?q?=E6=81=AF=E9=80=BB=E8=BE=91=E6=94=B9=E5=8A=A8=202.commons?= =?UTF-8?q?=E6=A8=A1=E5=9D=97=E6=B8=85=E7=90=86=E9=83=A8=E5=88=86=E5=AF=B9?= =?UTF-8?q?gov-access=E7=9A=84=E5=BC=95=E7=94=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../feign/CommonGovAccessFeignClient.java | 21 +-------- .../CommonGovAccessFeignClientFallback.java | 16 ------- .../epmet/controller/AccessController.java | 43 +++++++++---------- .../java/com/epmet/service/AccessService.java | 5 ++- .../epmet/service/impl/AccessServiceImpl.java | 11 ++--- 5 files changed, 30 insertions(+), 66 deletions(-) diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/feign/CommonGovAccessFeignClient.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/feign/CommonGovAccessFeignClient.java index 180cef4025..4d04ce783d 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/feign/CommonGovAccessFeignClient.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/feign/CommonGovAccessFeignClient.java @@ -2,40 +2,21 @@ package com.epmet.commons.tools.feign; import com.epmet.commons.tools.constant.ServiceConstant; import com.epmet.commons.tools.dto.form.HasSpecifiedPermissionFormDTO; -import com.epmet.commons.tools.dto.form.LoginUserInfoFormDTO; -import com.epmet.commons.tools.dto.form.LoginUserInfoResultDTO; -import com.epmet.commons.tools.dto.form.RoleOpeScopeResultDTO; import com.epmet.commons.tools.feign.fallback.CommonGovAccessFeignClientFallback; import com.epmet.commons.tools.utils.Result; import org.springframework.cloud.openfeign.FeignClient; -import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; -import java.util.List; /** * @Description * @Author sun */ -//, url = "localhost:8099" +//@FeignClient(name = ServiceConstant.GOV_ACCESS_SERVER, fallback = CommonGovAccessFeignClientFallback.class, url = "localhost:8099") @FeignClient(name = ServiceConstant.GOV_ACCESS_SERVER, fallback = CommonGovAccessFeignClientFallback.class) public interface CommonGovAccessFeignClient { - /** - * 查询登陆用户信息 - * @return - */ - @PostMapping("/gov/access/access/loginuserinfo") - Result getLoginUserInfo(@RequestBody LoginUserInfoFormDTO dto); - - /** - * 查询角色所有operation及其范围(缓存) - * @return - */ - @PostMapping("/gov/access/access/roleallopesandscopes/{roleId}") - Result> listRoleAllOperationScopesByRoleId(@PathVariable("roleId") String roleId); - /** * 用户是否具有指定权限 * @param form diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/feign/fallback/CommonGovAccessFeignClientFallback.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/feign/fallback/CommonGovAccessFeignClientFallback.java index feb8af499f..bc564fe148 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/feign/fallback/CommonGovAccessFeignClientFallback.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/feign/fallback/CommonGovAccessFeignClientFallback.java @@ -2,16 +2,10 @@ package com.epmet.commons.tools.feign.fallback; import com.epmet.commons.tools.constant.ServiceConstant; import com.epmet.commons.tools.dto.form.HasSpecifiedPermissionFormDTO; -import com.epmet.commons.tools.dto.form.LoginUserInfoFormDTO; -import com.epmet.commons.tools.dto.form.LoginUserInfoResultDTO; -import com.epmet.commons.tools.dto.form.RoleOpeScopeResultDTO; import com.epmet.commons.tools.feign.CommonGovAccessFeignClient; import com.epmet.commons.tools.utils.ModuleUtils; import com.epmet.commons.tools.utils.Result; import org.springframework.stereotype.Component; -import org.springframework.web.bind.annotation.PathVariable; - -import java.util.List; /** * 调用政府端权限 @@ -22,16 +16,6 @@ import java.util.List; @Component public class CommonGovAccessFeignClientFallback implements CommonGovAccessFeignClient { - @Override - public Result getLoginUserInfo(LoginUserInfoFormDTO dto) { - return ModuleUtils.feignConError(ServiceConstant.GOV_ACCESS_SERVER, "getLoginUserInfo", dto); - } - - @Override - public Result> listRoleAllOperationScopesByRoleId(@PathVariable("roleId") String roleId){ - return ModuleUtils.feignConError(ServiceConstant.GOV_ACCESS_SERVER, "listRoleAllOperationScopesByRoleId", roleId); - } - @Override public Result hasSpecifiedPermission(HasSpecifiedPermissionFormDTO form) { return ModuleUtils.feignConError(ServiceConstant.GOV_ACCESS_SERVER, "hasSpecifiedPermission", form); diff --git a/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/controller/AccessController.java b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/controller/AccessController.java index 8a68bec452..487c854dd9 100644 --- a/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/controller/AccessController.java +++ b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/controller/AccessController.java @@ -1,16 +1,13 @@ package com.epmet.controller; -import com.epmet.commons.tools.security.dto.GovTokenDto; import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.ValidatorUtils; import com.epmet.dto.form.*; -import com.epmet.dto.result.LoginUserInfoResultDTO; import com.epmet.dto.result.RoleOpeScopeResultDTO; import com.epmet.service.AccessService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; -import javax.validation.constraints.NotBlank; import java.util.List; import java.util.Set; @@ -46,26 +43,26 @@ public class AccessController { return new Result(); } - /** - * 从缓存中查询用户信息(DataFilterAspect中用到) - * @return - */ - @PostMapping("loginuserinfo") - public Result getLoginUserInfo(@RequestBody StaffPermCacheFormDTO dto) { - ValidatorUtils.validateEntity(dto, StaffPermCacheFormDTO.GetStaffCurrPermissions.class); - GovTokenDto govTokenDto = accessService.getUserDetails(dto.getApp(), dto.getClient(), dto.getStaffId()); - LoginUserInfoResultDTO resultDTO = null; - if (govTokenDto != null) { - resultDTO = new LoginUserInfoResultDTO(); - resultDTO.setRoleIdList(govTokenDto.getRoleIdList()); - //resultDTO.setGridId(govTokenDto.getGridId()); - resultDTO.setOrgIdPath(govTokenDto.getOrgIdPath()); - resultDTO.setGridIdList(govTokenDto.getGridIdList()); - resultDTO.setDeptIdList(govTokenDto.getDeptIdList()); - resultDTO.setUserId(govTokenDto.getUserId()); - } - return new Result().ok(resultDTO); - } + ///** + // * 从缓存中查询用户信息(DataFilterAspect中用到) + // * @return + // */ + //@PostMapping("loginuserinfo") + //public Result getLoginUserInfo(@RequestBody StaffPermCacheFormDTO dto) { + // ValidatorUtils.validateEntity(dto, StaffPermCacheFormDTO.GetStaffCurrPermissions.class); + // GovTokenDto govTokenDto = accessService.getUserDetails(dto.getApp(), dto.getClient(), dto.getStaffId()); + // LoginUserInfoResultDTO resultDTO = null; + // if (govTokenDto != null) { + // resultDTO = new LoginUserInfoResultDTO(); + // resultDTO.setRoleIdList(govTokenDto.getRoleIdList()); + // //resultDTO.setGridId(govTokenDto.getGridId()); + // resultDTO.setOrgIdPath(govTokenDto.getOrgIdPath()); + // resultDTO.setGridIdList(govTokenDto.getGridIdList()); + // resultDTO.setDeptIdList(govTokenDto.getDeptIdList()); + // resultDTO.setUserId(govTokenDto.getUserId()); + // } + // return new Result().ok(resultDTO); + //} /** * 查询角色的操作key对应操作范围列表(缓存) diff --git a/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/AccessService.java b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/AccessService.java index 831126f6bf..de151c9eed 100644 --- a/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/AccessService.java +++ b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/AccessService.java @@ -2,6 +2,7 @@ package com.epmet.service; import com.epmet.commons.tools.security.dto.GovTokenDto; import com.epmet.dto.form.GetSQLFilterFormDTO; +import com.epmet.dto.result.LoginUserDetailsResultDTO; import com.epmet.dto.result.RoleOpeScopeResultDTO; import java.util.List; @@ -17,10 +18,10 @@ public interface AccessService { void updatePermissionCache(String staffId, String app, String client, Set permissions, Set roleIdList, String orgIdPath, String gridId); /** - * 查询用户当前权限列表 + * 查询登陆用户登陆信息 * @return */ - GovTokenDto getUserDetails(String app, String client, String staffId); + LoginUserDetailsResultDTO getLoginUserDetails(String app, String client, String staffId); /** * 查询角色的操作key对应操作范围列表 diff --git a/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/impl/AccessServiceImpl.java b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/impl/AccessServiceImpl.java index 8c7e448f64..8adcf8c301 100644 --- a/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/impl/AccessServiceImpl.java +++ b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/impl/AccessServiceImpl.java @@ -16,6 +16,7 @@ import com.epmet.dto.CustomerAgencyDTO; import com.epmet.dto.GovStaffRoleDTO; import com.epmet.dto.form.GetSQLFilterFormDTO; import com.epmet.dto.form.StaffRoleFormDTO; +import com.epmet.dto.result.LoginUserDetailsResultDTO; import com.epmet.dto.result.RoleOpeScopeResultDTO; import com.epmet.feign.EpmetUserFeignClient; import com.epmet.feign.GovOrgFeignClient; @@ -90,8 +91,8 @@ public class AccessServiceImpl implements AccessService { } @Override - public GovTokenDto getUserDetails(String app, String client, String staffId) { - return cpUserDetailRedis.get(app, client, staffId, GovTokenDto.class); + public LoginUserDetailsResultDTO getLoginUserDetails(String app, String client, String staffId) { + return cpUserDetailRedis.get(app, client, staffId, LoginUserDetailsResultDTO.class); } /** @@ -132,7 +133,7 @@ public class AccessServiceImpl implements AccessService { return true; } - GovTokenDto userDetails = getUserDetails(app, client, userId); + LoginUserDetailsResultDTO userDetails = getLoginUserDetails(app, client, userId); if (userDetails == null) { return false; } @@ -157,7 +158,7 @@ public class AccessServiceImpl implements AccessService { @Override public String getSqlFilterSegment(GetSQLFilterFormDTO form) { hasConditions.set(false); - GovTokenDto userDetails = getUserDetails(form.getApp(), form.getClient(), form.getUserId()); + LoginUserDetailsResultDTO userDetails = getLoginUserDetails(form.getApp(), form.getClient(), form.getUserId()); if (userDetails == null) { logger.error("查询SQL过滤脚本:没有找到用户的登陆信息:app: {}, client: {}, userId:{}", form.getApp(), form.getClient(), form.getUserId()); throw new RenException(EpmetErrorCode.ERR10006.getCode()); @@ -453,7 +454,7 @@ public class AccessServiceImpl implements AccessService { @Override public Set listOperationPermissions(String staffId, String currAgencyId) { - GovTokenDto userDetails = getUserDetails(loginUserUtil.getLoginUserApp(), loginUserUtil.getLoginUserClient(), loginUserUtil.getLoginUserId()); + LoginUserDetailsResultDTO userDetails = getLoginUserDetails(loginUserUtil.getLoginUserApp(), loginUserUtil.getLoginUserClient(), loginUserUtil.getLoginUserId()); if (userDetails == null) { throw new RenException(EpmetErrorCode.ERR10006.getCode(), EpmetErrorCode.ERR10006.getMsg()); } From 186572a69f8752a1964ce4a16f45e0b313e78f3e Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Wed, 3 Jun 2020 10:34:42 +0800 Subject: [PATCH 09/10] =?UTF-8?q?=E5=88=A0=E9=99=A4=E8=8D=89=E7=A8=BF?= =?UTF-8?q?=E3=80=81=E6=96=87=E7=AB=A0=E6=93=8D=E4=BD=9C=E8=AE=B0=E5=BD=95?= =?UTF-8?q?=E5=88=97=E8=A1=A8=E3=80=81=E6=94=BF=E5=BA=9C=E7=AB=AF=E6=9F=A5?= =?UTF-8?q?=E7=9C=8B=E5=B7=B2=E4=B8=8B=E7=BA=BF=E3=80=81=E5=B7=B2=E5=8F=91?= =?UTF-8?q?=E5=B8=83=E6=96=87=E7=AB=A0=E8=AF=A6=E6=83=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../tools/enums/RequirePermissionEnum.java | 4 +- .../dto/form/ArticleOperationFormDTO.java | 25 +++++++ .../epmet/dto/form/DeleteDraftFormDTO.java | 25 +++++++ .../dto/form/GovArticleDetailFormDTO.java | 24 +++++++ .../dto/result/ArticleOperationResultDTO.java | 19 +++++ .../dto/result/GovArticleContentDTO.java | 25 +++++++ .../dto/result/GovArticleDetailResultDTO.java | 69 +++++++++++++++++++ .../com/epmet/constant/DraftConstant.java | 16 +++++ .../epmet/controller/ArticleController.java | 44 +++++++++++- .../com/epmet/controller/DraftController.java | 17 +++++ .../main/java/com/epmet/dao/ArticleDao.java | 38 +++++++--- .../epmet/dao/ArticleOperateRecordDao.java | 11 ++- .../service/ArticleOperateRecordService.java | 11 +++ .../com/epmet/service/ArticleService.java | 11 +++ .../java/com/epmet/service/DraftService.java | 10 +++ .../impl/ArticleOperateRecordServiceImpl.java | 13 +++- .../service/impl/ArticleServiceImpl.java | 26 ++++--- .../epmet/service/impl/DraftServiceImpl.java | 19 ++++- .../src/main/resources/mapper/ArticleDao.xml | 31 +++++++++ .../mapper/ArticleOperateRecordDao.xml | 15 +++- 20 files changed, 422 insertions(+), 31 deletions(-) create mode 100644 epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/ArticleOperationFormDTO.java create mode 100644 epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/DeleteDraftFormDTO.java create mode 100644 epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/GovArticleDetailFormDTO.java create mode 100644 epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/ArticleOperationResultDTO.java create mode 100644 epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/GovArticleContentDTO.java create mode 100644 epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/GovArticleDetailResultDTO.java diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/RequirePermissionEnum.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/RequirePermissionEnum.java index 5be4136e4b..61f64d7168 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/RequirePermissionEnum.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/RequirePermissionEnum.java @@ -104,8 +104,8 @@ public enum RequirePermissionEnum { WORK_PARTY_VOICE_OFFLINE_LIST("work_party_voice_offline_list", "党建声音:已下线列表", "已下线文章列表"), WORK_PARTY_VOICE_PUBLISH("work_party_voice_publish", "党建声音:创建文章", ""), WORK_PARTY_VOICE_EDIT("work_party_voice_edit", "党建声音:重新编辑", ""), - WORK_PARTY_VOICE_OFFLINE("work_party_voice_offline", "党建声音:下线文章", ""); - + WORK_PARTY_VOICE_OFFLINE("work_party_voice_offline", "党建声音:下线文章", ""), + WORK_PARTY_VOICE_OPERATION_LIST("work_party_voice_operation_list","党建声音:查看文章操作记录",""); private String key; diff --git a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/ArticleOperationFormDTO.java b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/ArticleOperationFormDTO.java new file mode 100644 index 0000000000..600a3913ad --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/ArticleOperationFormDTO.java @@ -0,0 +1,25 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * 查询文章操作记录 + * + * @author yinzuomei@elink-cn.com + * @date 2020/6/2 16:42 + */ +@Data +public class ArticleOperationFormDTO implements Serializable { + private static final long serialVersionUID = -6659391832410565077L; + + public interface AddUserInternalGroup {} + + /** + * 文章id + */ + @NotBlank(message = "文章id不能为空", groups = {ArticleOperationFormDTO.AddUserInternalGroup.class}) + private String articleId; +} diff --git a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/DeleteDraftFormDTO.java b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/DeleteDraftFormDTO.java new file mode 100644 index 0000000000..761b844b0e --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/DeleteDraftFormDTO.java @@ -0,0 +1,25 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * 政府端工作人员,删除草稿入参DTO + * + * @author yinzuomei@elink-cn.com + * @date 2020/6/2 15:25 + */ +@Data +public class DeleteDraftFormDTO implements Serializable { + private static final long serialVersionUID = -2424432724401298206L; + + public interface AddUserInternalGroup {} + + /** + * 草稿id + */ + @NotBlank(message = "草稿id不能为空", groups = {AddUserInternalGroup.class}) + private String draftId; +} diff --git a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/GovArticleDetailFormDTO.java b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/GovArticleDetailFormDTO.java new file mode 100644 index 0000000000..a2a629059e --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/GovArticleDetailFormDTO.java @@ -0,0 +1,24 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * 政府端:(已发布、已下线)文章详情 入参DTO + * + * @author yinzuomei@elink-cn.com + * @date 2020/6/2 17:21 + */ +@Data +public class GovArticleDetailFormDTO implements Serializable { + private static final long serialVersionUID = 2149876964249893025L; + public interface AddUserInternalGroup {} + + /** + * 文章id + */ + @NotBlank(message = "文章id不能为空", groups = {GovArticleDetailFormDTO.AddUserInternalGroup.class}) + private String articleId; +} diff --git a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/ArticleOperationResultDTO.java b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/ArticleOperationResultDTO.java new file mode 100644 index 0000000000..899c7273ec --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/ArticleOperationResultDTO.java @@ -0,0 +1,19 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * 描述一下 + * + * @author yinzuomei@elink-cn.com + * @date 2020/6/2 16:44 + */ +@Data +public class ArticleOperationResultDTO implements Serializable { + private static final long serialVersionUID = -436748500797911121L; + private String id; + private String content; + private Long createdTime; +} diff --git a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/GovArticleContentDTO.java b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/GovArticleContentDTO.java new file mode 100644 index 0000000000..dbb98d9d3d --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/GovArticleContentDTO.java @@ -0,0 +1,25 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * 政府端:(已发布、已下线)文章内容详情 + * + * @author yinzuomei@elink-cn.com + * @date 2020/6/3 9:39 + */ +@Data +public class GovArticleContentDTO implements Serializable { + private static final long serialVersionUID = 1519014754254863006L; + /** + * 内容类型,图片:img;文字:text + */ + private String contentType; + + /** + * 内容 + */ + private String content; +} diff --git a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/GovArticleDetailResultDTO.java b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/GovArticleDetailResultDTO.java new file mode 100644 index 0000000000..51ed6bc69b --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/GovArticleDetailResultDTO.java @@ -0,0 +1,69 @@ +package com.epmet.dto.result; + +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; +import java.util.List; + +/** + * 政府端:(已发布、已下线)文章详情 返参DTO + * + * @author yinzuomei@elink-cn.com + * @date 2020/6/3 9:29 + */ +@Data +public class GovArticleDetailResultDTO implements Serializable { + private static final long serialVersionUID = -8328304788721564622L; + /** + * 文章id + */ + private String articleId; + + /** + * 标题 + */ + private String title; + + /** + * 发布单位名称 + */ + private String publisherName; + + /** + * 发布日期 + */ + @JsonFormat(pattern="yyyy-MM-dd") + private Date publishDate; + + /** + * 访问量 + */ + private Integer visitRecordCount; + + /** + * 发布范围字符串 + */ + private String publishRangeDesc; + + /** + * 标签字符串 + */ + private String tags; + + /** + * 发布状态 已发布:published;已下线:offline + */ + private String statusFlag; + + /** + * 草稿Id,重新编辑时使用 + */ + private String draftId; + + /** + * 内容列表 + */ + private List articleContentList; +} diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/constant/DraftConstant.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/constant/DraftConstant.java index 915a4eef57..dfab2106a0 100644 --- a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/constant/DraftConstant.java +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/constant/DraftConstant.java @@ -10,8 +10,24 @@ package com.epmet.constant; /** * 常量 + * * @author sun * @since 1.0.0 */ public interface DraftConstant { + // 发布状态 + /** + * 未发布:unpublish + */ + String UNPUBLISH = "unpublish"; + + /** + * 已发布:published + */ + String PUBLISHED = "published"; + + /** + * 审核中:auditing + */ + String AUDITING = "auditing"; } diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/ArticleController.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/ArticleController.java index e72213a34d..1be7ef624d 100644 --- a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/ArticleController.java +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/ArticleController.java @@ -18,6 +18,8 @@ package com.epmet.controller; import com.epmet.commons.tools.annotation.LoginUser; +import com.epmet.commons.tools.annotation.RequirePermission; +import com.epmet.commons.tools.enums.RequirePermissionEnum; import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.ExcelUtils; @@ -28,11 +30,14 @@ import com.epmet.commons.tools.validator.group.AddGroup; import com.epmet.commons.tools.validator.group.DefaultGroup; import com.epmet.commons.tools.validator.group.UpdateGroup; import com.epmet.dto.ArticleDTO; -import com.epmet.dto.form.LatestListFormDTO; -import com.epmet.dto.result.ArticleGridResultDTO; -import com.epmet.dto.result.LatestListResultDTO; +import com.epmet.dto.form.ArticleOperationFormDTO; import com.epmet.dto.form.DraftContentFromDTO; +import com.epmet.dto.form.GovArticleDetailFormDTO; +import com.epmet.dto.result.ArticleGridResultDTO; +import com.epmet.dto.result.ArticleOperationResultDTO; +import com.epmet.dto.result.GovArticleDetailResultDTO; import com.epmet.excel.ArticleExcel; +import com.epmet.service.ArticleOperateRecordService; import com.epmet.service.ArticleService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; @@ -54,6 +59,8 @@ public class ArticleController { @Autowired private ArticleService articleService; + @Autowired + private ArticleOperateRecordService articleOperateRecordService; @GetMapping("page") public Result> page(@RequestParam Map params){ @@ -119,4 +126,35 @@ public class ArticleController { return new Result().ok(draftId); } + /** + * @param formDTO + * @return com.epmet.commons.tools.utils.Result> + * @author yinzuomei@elink-cn.com + * @description 政府端:查询文章操作记录 + * @date 2020/6/2 16:50 + **/ + @PostMapping("oprationlist") + @RequirePermission(requirePermission = RequirePermissionEnum.WORK_PARTY_VOICE_OPERATION_LIST) + public Result> operationList(@RequestBody ArticleOperationFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO, ArticleOperationFormDTO.AddUserInternalGroup.class); + List list = + articleOperateRecordService.listOfArticleOperation(formDTO.getArticleId()); + return new Result>().ok(list); + } + + /** + * @param formDTO + * @return com.epmet.commons.tools.utils.Result + * @author yinzuomei@elink-cn.com + * @description 政府端:(已发布、已下线)文章详情 + * @date 2020/6/3 9:44 + **/ + @PostMapping("articledetail") + @RequirePermission(requirePermission = RequirePermissionEnum.WORK_PARTY_VOICE_DETAIL) + public Result articleDetail(@RequestBody GovArticleDetailFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO, GovArticleDetailFormDTO.AddUserInternalGroup.class); + GovArticleDetailResultDTO articleDetail = articleService.queryGovArticleDetail(formDTO.getArticleId()); + return new Result().ok(articleDetail); + } + } \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/DraftController.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/DraftController.java index 9b69445888..1fc03f1d9c 100644 --- a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/DraftController.java +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/DraftController.java @@ -17,6 +17,8 @@ package com.epmet.controller; +import com.epmet.commons.tools.annotation.RequirePermission; +import com.epmet.commons.tools.enums.RequirePermissionEnum; import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.utils.ExcelUtils; import com.epmet.commons.tools.utils.Result; @@ -26,6 +28,7 @@ import com.epmet.commons.tools.validator.group.AddGroup; import com.epmet.commons.tools.validator.group.UpdateGroup; import com.epmet.commons.tools.validator.group.DefaultGroup; import com.epmet.dto.DraftDTO; +import com.epmet.dto.form.DeleteDraftFormDTO; import com.epmet.excel.DraftExcel; import com.epmet.service.DraftService; import org.springframework.beans.factory.annotation.Autowired; @@ -91,4 +94,18 @@ public class DraftController { ExcelUtils.exportExcelToTarget(response, null, list, DraftExcel.class); } + /** + * @param formDTO + * @return com.epmet.commons.tools.utils.Result + * @author yinzuomei@elink-cn.com + * @description 政府端:工作人员,删除草稿 + * @date 2020/6/2 16:00 + **/ + @PostMapping("deletedraft") + @RequirePermission(requirePermission = RequirePermissionEnum.WORK_PARTY_VOICE_DRAFT_DELETE) + public Result deleteDraft(@RequestBody DeleteDraftFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO, DeleteDraftFormDTO.AddUserInternalGroup.class); + draftService.deleteDraft(formDTO); + return new Result(); + } } \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/dao/ArticleDao.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/dao/ArticleDao.java index d9c4204004..2f176db48a 100644 --- a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/dao/ArticleDao.java +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/dao/ArticleDao.java @@ -1,26 +1,27 @@ /** * Copyright 2018 人人开源 https://www.renren.io *

- * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. + * This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public + * License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later + * version. *

- * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. *

- * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * You should have received a copy of the GNU General Public License along with this program. If not, see + * . */ package com.epmet.dao; import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.result.GovArticleContentDTO; +import com.epmet.dto.result.GovArticleDetailResultDTO; import com.epmet.entity.ArticleEntity; import org.apache.ibatis.annotations.Mapper; +import java.util.List; + /** * 文章表 * @@ -29,5 +30,20 @@ import org.apache.ibatis.annotations.Mapper; */ @Mapper public interface ArticleDao extends BaseDao { - + + /** + * 政府端查询文章详情 + * + * @param articleId + * 文章id + */ + GovArticleDetailResultDTO queryGovArticleDetail(String articleId); + + /** + * 政府端查询文章详情-内容 + * + * @param articleId + * 文章id + */ + List queryGovArticleContent(String articleId); } \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/dao/ArticleOperateRecordDao.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/dao/ArticleOperateRecordDao.java index 1b60fdd5d6..f186193252 100644 --- a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/dao/ArticleOperateRecordDao.java +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/dao/ArticleOperateRecordDao.java @@ -18,9 +18,12 @@ package com.epmet.dao; import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.result.ArticleOperationResultDTO; import com.epmet.entity.ArticleOperateRecordEntity; import org.apache.ibatis.annotations.Mapper; +import java.util.List; + /** * 文章操作记录表 * @@ -29,5 +32,11 @@ import org.apache.ibatis.annotations.Mapper; */ @Mapper public interface ArticleOperateRecordDao extends BaseDao { - + + /** + * 根据文章id查询操作记录 + * + * @param articleId + */ + List selectListByArticleId(String articleId); } \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/ArticleOperateRecordService.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/ArticleOperateRecordService.java index c8cd715443..368ecfcef7 100644 --- a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/ArticleOperateRecordService.java +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/ArticleOperateRecordService.java @@ -20,6 +20,7 @@ package com.epmet.service; import com.epmet.commons.mybatis.service.BaseService; import com.epmet.commons.tools.page.PageData; import com.epmet.dto.ArticleOperateRecordDTO; +import com.epmet.dto.result.ArticleOperationResultDTO; import com.epmet.entity.ArticleOperateRecordEntity; import java.util.List; @@ -92,4 +93,14 @@ public interface ArticleOperateRecordService extends BaseService listOfArticleOperation(String articleId); } \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/ArticleService.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/ArticleService.java index 9cae7ed196..93a664e006 100644 --- a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/ArticleService.java +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/ArticleService.java @@ -23,6 +23,7 @@ import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.dto.ArticleDTO; import com.epmet.dto.result.ArticleGridResultDTO; import com.epmet.dto.form.DraftContentFromDTO; +import com.epmet.dto.result.GovArticleDetailResultDTO; import com.epmet.entity.ArticleEntity; import java.util.List; @@ -110,4 +111,14 @@ public interface ArticleService extends BaseService { * @return */ String saveOrUpdateContent(DraftContentFromDTO fromDTO); + + /** + * 政府端:(已发布、已下线)文章详情 + * + * @param articleId + * @return com.epmet.dto.result.GovArticleDetailResultDTO + * @author yinzuomei@elink-cn.com + * @date 2020-06-03 + */ + GovArticleDetailResultDTO queryGovArticleDetail(String articleId); } \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/DraftService.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/DraftService.java index 12446f2e2d..36a9fc1b57 100644 --- a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/DraftService.java +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/DraftService.java @@ -20,6 +20,7 @@ package com.epmet.service; import com.epmet.commons.mybatis.service.BaseService; import com.epmet.commons.tools.page.PageData; import com.epmet.dto.DraftDTO; +import com.epmet.dto.form.DeleteDraftFormDTO; import com.epmet.entity.DraftEntity; import java.util.List; @@ -92,4 +93,13 @@ public interface DraftService extends BaseService { * @date 2020-06-02 */ void delete(String[] ids); + + /** + * @param formDTO + * @return void + * @author yinzuomei@elink-cn.com + * @description 政府端工作人员,删除草稿 + * @date 2020/6/2 16:09 + **/ + void deleteDraft(DeleteDraftFormDTO formDTO); } \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/ArticleOperateRecordServiceImpl.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/ArticleOperateRecordServiceImpl.java index ca6fe17651..a237638d2b 100644 --- a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/ArticleOperateRecordServiceImpl.java +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/ArticleOperateRecordServiceImpl.java @@ -20,11 +20,12 @@ package com.epmet.service.impl; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.constant.FieldConstant; import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.utils.ConvertUtils; -import com.epmet.commons.tools.constant.FieldConstant; import com.epmet.dao.ArticleOperateRecordDao; import com.epmet.dto.ArticleOperateRecordDTO; +import com.epmet.dto.result.ArticleOperationResultDTO; import com.epmet.entity.ArticleOperateRecordEntity; import com.epmet.redis.ArticleOperateRecordRedis; import com.epmet.service.ArticleOperateRecordService; @@ -33,6 +34,7 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; +import java.util.ArrayList; import java.util.Arrays; import java.util.List; import java.util.Map; @@ -101,4 +103,13 @@ public class ArticleOperateRecordServiceImpl extends BaseServiceImpl listOfArticleOperation(String articleId) { + List list = baseDao.selectListByArticleId(articleId); + if (null == list) { + return new ArrayList<>(); + } + return list; + } + } \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/ArticleServiceImpl.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/ArticleServiceImpl.java index 3b082d2776..09c91ad94c 100644 --- a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/ArticleServiceImpl.java +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/ArticleServiceImpl.java @@ -26,7 +26,6 @@ import com.epmet.commons.tools.exception.RenException; import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.ConvertUtils; -import com.epmet.commons.tools.constant.FieldConstant; import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.ValidatorUtils; import com.epmet.commons.tools.validator.group.AddGroup; @@ -36,8 +35,10 @@ import com.epmet.dao.DraftContentDao; import com.epmet.dao.DraftDao; import com.epmet.dto.ArticleDTO; import com.epmet.dto.feign.GovOrgSelfFeignClient; -import com.epmet.dto.result.ArticleGridResultDTO; import com.epmet.dto.form.DraftContentFromDTO; +import com.epmet.dto.result.ArticleGridResultDTO; +import com.epmet.dto.result.GovArticleContentDTO; +import com.epmet.dto.result.GovArticleDetailResultDTO; import com.epmet.entity.ArticleEntity; import com.epmet.entity.DraftContentEntity; import com.epmet.entity.DraftEntity; @@ -49,7 +50,6 @@ import org.apache.commons.logging.LogFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; -import org.springframework.web.bind.annotation.PathVariable; import org.springframework.util.CollectionUtils; import java.util.*; @@ -63,21 +63,15 @@ import java.util.stream.Collectors; */ @Service public class ArticleServiceImpl extends BaseServiceImpl implements ArticleService { - + private final Log logger = LogFactory.getLog(getClass()); @Autowired private ArticleRedis articleRedis; @Autowired private GovOrgSelfFeignClient govOrgSelfFeignClient; - private final Log logger = LogFactory.getLog(getClass()); - @Autowired - private ArticleRedis articleRedis; - @Autowired private DraftDao draftDao; @Autowired private DraftContentDao draftContentDao; - @Autowired - private ArticleDao articleDao; @Override public PageData page(Map params) { @@ -156,7 +150,7 @@ public class ArticleServiceImpl extends BaseServiceImpl articleParamMap = new HashMap<>(); articleParamMap.put("ARTICLE_ID", fromDTO.getArticleId()); articleParamMap.put("ARTICLE_ID", fromDTO.getArticleId()); - articleDao.selectByMap(articleParamMap); + baseDao.selectByMap(articleParamMap); } DraftEntity draftEntity = null; @@ -193,6 +187,16 @@ public class ArticleServiceImpl extends BaseServiceImpl articleContentList = baseDao.queryGovArticleContent(articleId); + articleDetail.setArticleContentList(articleContentList); + } + return articleDetail; + } + /** * desc:构建 内容对象 * diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/DraftServiceImpl.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/DraftServiceImpl.java index 21402cb7a2..000a4d9b83 100644 --- a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/DraftServiceImpl.java +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/DraftServiceImpl.java @@ -20,15 +20,20 @@ package com.epmet.service.impl; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.constant.DraftConstant; import com.epmet.dao.DraftDao; import com.epmet.dto.DraftDTO; +import com.epmet.dto.form.DeleteDraftFormDTO; import com.epmet.entity.DraftEntity; import com.epmet.redis.DraftRedis; import com.epmet.service.DraftService; import org.apache.commons.lang3.StringUtils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; @@ -45,7 +50,7 @@ import java.util.Map; */ @Service public class DraftServiceImpl extends BaseServiceImpl implements DraftService { - + private Logger logger = LoggerFactory.getLogger(getClass()); @Autowired private DraftRedis draftRedis; @@ -101,4 +106,16 @@ public class DraftServiceImpl extends BaseServiceImpl imp baseDao.deleteBatchIds(Arrays.asList(ids)); } + @Override + public void deleteDraft(DeleteDraftFormDTO formDTO) { + DraftDTO draftDTO = this.get(formDTO.getDraftId()); + // 已发布的草稿不能删除 + if (null == draftDTO || DraftConstant.PUBLISHED.equals(draftDTO.getStatusFlag())) { + logger.error(String.format("删除草稿错误,已发布的草稿不能删除。草稿id%s", formDTO.getDraftId())); + return; + } + draftDTO.setDelFlag(NumConstant.ONE); + this.update(draftDTO); + } + } \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/ArticleDao.xml b/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/ArticleDao.xml index 488e2fe7cd..5f3473a3b7 100644 --- a/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/ArticleDao.xml +++ b/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/ArticleDao.xml @@ -2,5 +2,36 @@ + + + + \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/ArticleOperateRecordDao.xml b/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/ArticleOperateRecordDao.xml index 7b47ccdac5..2b80096293 100644 --- a/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/ArticleOperateRecordDao.xml +++ b/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/ArticleOperateRecordDao.xml @@ -3,5 +3,18 @@ - + + \ No newline at end of file From 962c235ba833c6568358e809c0d77ca09c429cbc Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Wed, 3 Jun 2020 11:00:58 +0800 Subject: [PATCH 10/10] =?UTF-8?q?=E5=86=B2=E7=AA=81=E8=A7=A3=E5=86=B3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/epmet/controller/ArticleController.java | 6 +++++- .../src/main/java/com/epmet/service/ArticleService.java | 2 +- .../java/com/epmet/service/impl/ArticleServiceImpl.java | 3 +-- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/ArticleController.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/ArticleController.java index 97923ebebd..91d8def2a4 100644 --- a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/ArticleController.java +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/ArticleController.java @@ -30,11 +30,15 @@ import com.epmet.commons.tools.validator.group.AddGroup; import com.epmet.commons.tools.validator.group.DefaultGroup; import com.epmet.commons.tools.validator.group.UpdateGroup; import com.epmet.dto.ArticleDTO; +import com.epmet.dto.form.ArticleOperationFormDTO; import com.epmet.dto.form.DraftContentFromDTO; +import com.epmet.dto.form.GovArticleDetailFormDTO; import com.epmet.dto.result.ArticleGridResultDTO; +import com.epmet.dto.result.ArticleOperationResultDTO; +import com.epmet.dto.result.GovArticleDetailResultDTO; import com.epmet.excel.ArticleExcel; -import com.epmet.service.ArticleService; import com.epmet.service.ArticleOperateRecordService; +import com.epmet.service.ArticleService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/ArticleService.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/ArticleService.java index f25628422f..fa4482b97d 100644 --- a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/ArticleService.java +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/ArticleService.java @@ -23,6 +23,7 @@ import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.dto.ArticleDTO; import com.epmet.dto.form.DraftContentFromDTO; import com.epmet.dto.result.ArticleGridResultDTO; +import com.epmet.dto.result.GovArticleDetailResultDTO; import com.epmet.entity.ArticleEntity; import java.util.List; @@ -112,7 +113,6 @@ public interface ArticleService extends BaseService { * @return */ String saveOrUpdateContent(TokenDto tokenDto, DraftContentFromDTO fromDTO); - String saveOrUpdateContent(DraftContentFromDTO fromDTO); /** * 政府端:(已发布、已下线)文章详情 diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/ArticleServiceImpl.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/ArticleServiceImpl.java index b3185e8d76..ae8f83582d 100644 --- a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/ArticleServiceImpl.java +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/ArticleServiceImpl.java @@ -38,7 +38,6 @@ import com.epmet.dto.ArticleDTO; import com.epmet.dto.feign.GovOrgSelfFeignClient; import com.epmet.dto.form.DraftContentFromDTO; import com.epmet.dto.result.ArticleGridResultDTO; -import com.epmet.dto.result.ArticleGridResultDTO; import com.epmet.dto.result.GovArticleContentDTO; import com.epmet.dto.result.GovArticleDetailResultDTO; import com.epmet.entity.ArticleEntity; @@ -196,7 +195,7 @@ public class ArticleServiceImpl extends BaseServiceImpl