Browse Source

党建声音-政府端-接口自测问题修改

dev_shibei_match
sunyuchao 5 years ago
parent
commit
fec58f8484
  1. 40
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/feign/GovOrgSelfFeignClient.java
  2. 29
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/feign/fallback/GovOrgSelfFeignClientFallBack.java
  3. 21
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/GovOrgOpenFeignClient.java
  4. 13
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/fallback/GovOrgOpenFeignClientFallback.java
  5. 16
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerAgencyServiceImpl.java
  6. 1
      epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/ArticleController.java
  7. 17
      epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/ArticleServiceImpl.java

40
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/feign/GovOrgSelfFeignClient.java

@ -1,40 +0,0 @@
package com.epmet.dto.feign;
import com.epmet.commons.tools.constant.ServiceConstant;
import com.epmet.commons.tools.utils.Result;
import com.epmet.dto.feign.fallback.GovOrgSelfFeignClientFallBack;
import com.epmet.dto.form.PublishGridListFormDTO;
import com.epmet.dto.result.ArticleGridResultDTO;
import com.epmet.dto.result.PublishAgencyListResultDTO;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
/**
* @Description gov-org服务
* @Author sun
*/
@FeignClient(name = ServiceConstant.GOV_ORG_SERVER, fallback = GovOrgSelfFeignClientFallBack.class)
public interface GovOrgSelfFeignClient {
/**
* @param staffId
* @return
* @Author sun
* @Description 党建声音-政府端-可选发布范围接口调用
**/
@PostMapping(value = "gov/org/customeragency/getagencygridlist/{staffId}", consumes = MediaType.APPLICATION_JSON_UTF8_VALUE)
Result<ArticleGridResultDTO> getAgencyGridList(@PathVariable("staffId") String staffId);
/**
* @param staffId
* @return
* @Author sun
* @Description 党建声音-政府端-可选发布单位接口调用
**/
@PostMapping(value = "gov/org/customeragency/getpublishagencylist/{staffId}", consumes = MediaType.APPLICATION_JSON_UTF8_VALUE)
Result<PublishAgencyListResultDTO> getPublishAgencyList(@PathVariable("staffId") String staffId);
}

29
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/feign/fallback/GovOrgSelfFeignClientFallBack.java

@ -1,29 +0,0 @@
package com.epmet.dto.feign.fallback;
import com.epmet.commons.tools.constant.ServiceConstant;
import com.epmet.commons.tools.utils.ModuleUtils;
import com.epmet.commons.tools.utils.Result;
import com.epmet.dto.feign.GovOrgSelfFeignClient;
import com.epmet.dto.form.PublishGridListFormDTO;
import com.epmet.dto.result.ArticleGridResultDTO;
import com.epmet.dto.result.PublishAgencyListResultDTO;
import org.springframework.stereotype.Component;
/**
* @Description gov-org服务
* @Author sun
*/
@Component
public class GovOrgSelfFeignClientFallBack implements GovOrgSelfFeignClient {
@Override
public Result<ArticleGridResultDTO> getAgencyGridList(String staffId) {
return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "getAgencyGridList", staffId);
}
@Override
public Result<PublishAgencyListResultDTO> getPublishAgencyList(String staffId) {
return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "getPublishAgencyList", staffId);
}
}

21
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/GovOrgOpenFeignClient.java

@ -1,6 +1,9 @@
package com.epmet.feign;
import com.epmet.dto.result.ArticleGridResultDTO;
import com.epmet.dto.result.PublishAgencyListResultDTO;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
@ -37,4 +40,22 @@ public interface GovOrgOpenFeignClient {
*/
@PostMapping("/gov/org/agency/agencybystaff/{staffId}")
Result<CustomerAgencyDTO> getAgencyByStaff(@PathVariable("staffId") String staffId);
/**
* @param staffId
* @return
* @Author sun
* @Description 党建声音-政府端-可选发布范围接口调用
**/
@PostMapping(value = "gov/org/customeragency/getagencygridlist/{staffId}", consumes = MediaType.APPLICATION_JSON_UTF8_VALUE)
Result<ArticleGridResultDTO> getAgencyGridList(@PathVariable("staffId") String staffId);
/**
* @param staffId
* @return
* @Author sun
* @Description 党建声音-政府端-可选发布单位接口调用
**/
@PostMapping(value = "gov/org/customeragency/getpublishagencylist/{staffId}", consumes = MediaType.APPLICATION_JSON_UTF8_VALUE)
Result<PublishAgencyListResultDTO> getPublishAgencyList(@PathVariable("staffId") String staffId);
}

13
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/fallback/GovOrgOpenFeignClientFallback.java

@ -4,6 +4,8 @@ import com.epmet.commons.tools.constant.ServiceConstant;
import com.epmet.commons.tools.utils.ModuleUtils;
import com.epmet.commons.tools.utils.Result;
import com.epmet.dto.CustomerAgencyDTO;
import com.epmet.dto.result.ArticleGridResultDTO;
import com.epmet.dto.result.PublishAgencyListResultDTO;
import com.epmet.feign.GovOrgOpenFeignClient;
import org.springframework.stereotype.Component;
@ -24,4 +26,15 @@ public class GovOrgOpenFeignClientFallback implements GovOrgOpenFeignClient {
public Result<CustomerAgencyDTO> getAgencyByStaff(String staffId) {
return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "getAgencyByStaff", staffId);
}
@Override
public Result<ArticleGridResultDTO> getAgencyGridList(String staffId) {
return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "getAgencyGridList", staffId);
}
@Override
public Result<PublishAgencyListResultDTO> getPublishAgencyList(String staffId) {
return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "getPublishAgencyList", staffId);
}
}

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

@ -644,7 +644,7 @@ public class CustomerAgencyServiceImpl extends BaseServiceImpl<CustomerAgencyDao
CustomerStaffAgencyDTO staffAgencyDTO = new CustomerStaffAgencyDTO();
staffAgencyDTO.setUserId(staffId);
staffAgencyDTO = customerStaffAgencyDao.selectByStaffId(staffAgencyDTO);
if (null == staffAgencyDTO.getId()) {
if (null == staffAgencyDTO || null == staffAgencyDTO.getId()) {
throw new RenException(CustomerAgencyConstant.SELECT_AGENCY_STAFF_EXCEPTION);
}
@ -677,11 +677,11 @@ public class CustomerAgencyServiceImpl extends BaseServiceImpl<CustomerAgencyDao
//4:根据不同角色查询不同数据
CustomerAgencyEntity agencyEntity = baseDao.selectById(staffAgencyDTO.getAgencyId());
//当前机关信息
returnDTO.setAgencyId(agencyEntity.getId());
returnDTO.setAgencyName(agencyEntity.getOrganizationName());
if (party) {
//4.1:查询当前机关的网格列表以及所有下级机关的网格列表
//当前机关信息
returnDTO.setAgencyId(agencyEntity.getId());
returnDTO.setAgencyName(agencyEntity.getOrganizationName());
//当前机关下网格列表
List<AgencyGridListResultDTO> gridList = customerGridDao.selectAgencyGridList(agencyEntity.getId());
returnDTO.setGridList(gridList);
@ -738,7 +738,7 @@ public class CustomerAgencyServiceImpl extends BaseServiceImpl<CustomerAgencyDao
CustomerStaffAgencyDTO staffAgencyDTO = new CustomerStaffAgencyDTO();
staffAgencyDTO.setUserId(staffId);
staffAgencyDTO = customerStaffAgencyDao.selectByStaffId(staffAgencyDTO);
if (null == staffAgencyDTO.getId()) {
if (null == staffAgencyDTO || null == staffAgencyDTO.getId()) {
throw new RenException(CustomerAgencyConstant.SELECT_AGENCY_STAFF_EXCEPTION);
}
@ -771,11 +771,11 @@ public class CustomerAgencyServiceImpl extends BaseServiceImpl<CustomerAgencyDao
//4:根据不同角色查询不同数据
CustomerAgencyEntity agencyEntity = baseDao.selectById(staffAgencyDTO.getAgencyId());
//当前机关信息
returnDTO.setAgencyId(agencyEntity.getId());
returnDTO.setAgencyName(agencyEntity.getOrganizationName());
if (party) {
//4.1:查询当前机关的网格列表以及所有下级机关的网格列表
//当前机关信息
returnDTO.setAgencyId(agencyEntity.getId());
returnDTO.setAgencyName(agencyEntity.getOrganizationName());
//当前机关下部门列表信息
List<AgencyDeptList> agencyDeptList = customerDepartmentDao.selectAgencyDeptMsgList(agencyEntity.getId());
returnDTO.setAgencyDeptList(agencyDeptList);

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

@ -204,6 +204,7 @@ public class ArticleController {
* @Description 党建声音-政府端-下线文章
**/
@PostMapping("offlinearticle")
@RequirePermission(requirePermission = RequirePermissionEnum.WORK_PARTY_VOICE_OFFLINE)
public Result offLineArticle(@LoginUser TokenDto tokenDTO, @RequestBody OffLineArticleFormDTO formDTO) {
formDTO.setStaffId(tokenDTO.getUserId());
ValidatorUtils.validateEntity(formDTO, OffLineArticleFormDTO.AddUserInternalGroup.class);

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

@ -18,7 +18,6 @@
package com.epmet.service.impl;
import com.alibaba.fastjson.JSON;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
@ -40,11 +39,11 @@ import com.epmet.constant.DraftConstant;
import com.epmet.constant.RoleKeyConstants;
import com.epmet.dao.*;
import com.epmet.dto.*;
import com.epmet.dto.feign.GovOrgSelfFeignClient;
import com.epmet.dto.form.*;
import com.epmet.dto.result.*;
import com.epmet.entity.*;
import com.epmet.feign.EpmetUserOpenFeignClient;
import com.epmet.feign.GovOrgOpenFeignClient;
import com.epmet.redis.ArticleRedis;
import com.epmet.service.ArticleOperateRecordService;
import com.epmet.service.ArticlePublishRangeService;
@ -77,7 +76,7 @@ public class ArticleServiceImpl extends BaseServiceImpl<ArticleDao, ArticleEntit
@Autowired
private ArticleRedis articleRedis;
@Autowired
private GovOrgSelfFeignClient govOrgSelfFeignClient;
private GovOrgOpenFeignClient govOrgOpenFeignClient;
@Autowired
private DraftDao draftDao;
@Autowired
@ -168,7 +167,10 @@ public class ArticleServiceImpl extends BaseServiceImpl<ArticleDao, ArticleEntit
**/
@Override
public ArticleGridResultDTO agencyGridList(TokenDto tokenDTO) {
Result<ArticleGridResultDTO> result = govOrgSelfFeignClient.getAgencyGridList(tokenDTO.getUserId());
Result<ArticleGridResultDTO> result = govOrgOpenFeignClient.getAgencyGridList(tokenDTO.getUserId());
if(!result.success()){
throw new RenException(result.getInternalMsg());
}
return result.getData();
}
@ -180,7 +182,10 @@ public class ArticleServiceImpl extends BaseServiceImpl<ArticleDao, ArticleEntit
**/
@Override
public PublishAgencyListResultDTO publishAgencyList(TokenDto tokenDTO) {
Result<PublishAgencyListResultDTO> result = govOrgSelfFeignClient.getPublishAgencyList(tokenDTO.getUserId());
Result<PublishAgencyListResultDTO> result = govOrgOpenFeignClient.getPublishAgencyList(tokenDTO.getUserId());
if(!result.success()){
throw new RenException(result.getInternalMsg());
}
return result.getData();
}
@ -538,7 +543,7 @@ public class ArticleServiceImpl extends BaseServiceImpl<ArticleDao, ArticleEntit
//4:文章操作记录表新增数据
//4.1:调用epmet-user服务,查询工作人员信息
Result<CustomerStaffDTO> resultStaff = epmetUserOpenFeignClient.getCustomerStaff(formDTO.getStaffId());
if (null == resultStaff.getData()) {
if (!resultStaff.success() || null == resultStaff.getData()) {
throw new RenException(ArticleConstant.SELECT_STAFF_EXCEPTION);
}
CustomerStaffDTO staffDTO = resultStaff.getData();

Loading…
Cancel
Save