|
@ -43,9 +43,7 @@ import com.epmet.dto.feign.GovOrgSelfFeignClient; |
|
|
import com.epmet.dto.form.*; |
|
|
import com.epmet.dto.form.*; |
|
|
import com.epmet.dto.result.*; |
|
|
import com.epmet.dto.result.*; |
|
|
import com.epmet.entity.*; |
|
|
import com.epmet.entity.*; |
|
|
import com.epmet.feign.EpmetUserFeignClient; |
|
|
|
|
|
import com.epmet.feign.EpmetUserSelfFeignClient; |
|
|
import com.epmet.feign.EpmetUserSelfFeignClient; |
|
|
import com.epmet.feign.GovOrgFeignClient; |
|
|
|
|
|
import com.epmet.redis.ArticleRedis; |
|
|
import com.epmet.redis.ArticleRedis; |
|
|
import com.epmet.service.ArticleOperateRecordService; |
|
|
import com.epmet.service.ArticleOperateRecordService; |
|
|
import com.epmet.service.ArticlePublishRangeService; |
|
|
import com.epmet.service.ArticlePublishRangeService; |
|
@ -92,10 +90,6 @@ public class ArticleServiceImpl extends BaseServiceImpl<ArticleDao, ArticleEntit |
|
|
private DraftCoverDao draftCoverDao; |
|
|
private DraftCoverDao draftCoverDao; |
|
|
@Autowired |
|
|
@Autowired |
|
|
private DraftPublishRangeDao draftPublishRangeDao; |
|
|
private DraftPublishRangeDao draftPublishRangeDao; |
|
|
@Autowired |
|
|
|
|
|
private GovOrgFeignClient govOrgFeignClient; |
|
|
|
|
|
@Autowired |
|
|
|
|
|
private EpmetUserFeignClient epmetUserFeignClient; |
|
|
|
|
|
|
|
|
|
|
|
private static final String AGENCY = "agency"; |
|
|
private static final String AGENCY = "agency"; |
|
|
private static final String GRID = "grid"; |
|
|
private static final String GRID = "grid"; |
|
@ -526,11 +520,12 @@ public class ArticleServiceImpl extends BaseServiceImpl<ArticleDao, ArticleEntit |
|
|
public PageData publishedArticleList(TokenDto tokenDto, PublishedListFormDTO formDTO) { |
|
|
public PageData publishedArticleList(TokenDto tokenDto, PublishedListFormDTO formDTO) { |
|
|
PageHelper.startPage(formDTO.getPageNo(),formDTO.getPageSize()); |
|
|
PageHelper.startPage(formDTO.getPageNo(),formDTO.getPageSize()); |
|
|
List<PublishedListResultDTO> resultList; |
|
|
List<PublishedListResultDTO> resultList; |
|
|
Result<CustomerAgencyDTO> customerAgencyResult = govOrgFeignClient.getAgencyByStaff(tokenDto.getUserId()); |
|
|
List<CustomerStaffRoleResultDTO> roles = epmetUserSelfFeignClient.getStaffRoles(tokenDto.getUserId()).getData(); |
|
|
if (!customerAgencyResult.success()) { |
|
|
LoginUserDetailsFormDTO loginUserDetailsFormDTO = new LoginUserDetailsFormDTO(); |
|
|
throw new RenException(customerAgencyResult.getCode(), customerAgencyResult.getMsg()); |
|
|
loginUserDetailsFormDTO.setApp(tokenDto.getApp()); |
|
|
} |
|
|
loginUserDetailsFormDTO.setClient(tokenDto.getClient()); |
|
|
List<CustomerStaffRoleResultDTO> roles = epmetUserFeignClient.getStaffRoles(tokenDto.getUserId()).getData(); |
|
|
loginUserDetailsFormDTO.setUserId(tokenDto.getUserId()); |
|
|
|
|
|
LoginUserDetailsResultDTO userInfo = epmetUserSelfFeignClient.getLoginUserDetails(loginUserDetailsFormDTO).getData(); |
|
|
String staffLevel = ""; |
|
|
String staffLevel = ""; |
|
|
for (CustomerStaffRoleResultDTO role : roles) { |
|
|
for (CustomerStaffRoleResultDTO role : roles) { |
|
|
//党建负责人
|
|
|
//党建负责人
|
|
@ -548,9 +543,7 @@ public class ArticleServiceImpl extends BaseServiceImpl<ArticleDao, ArticleEntit |
|
|
if (AGENCY.equals(staffLevel)) { |
|
|
if (AGENCY.equals(staffLevel)) { |
|
|
resultList = baseDao.selectArticleListForAgency(tokenDto.getCustomerId()); |
|
|
resultList = baseDao.selectArticleListForAgency(tokenDto.getCustomerId()); |
|
|
} else { |
|
|
} else { |
|
|
//TODO
|
|
|
resultList = baseDao.selectArticleListForGrid(tokenDto.getCustomerId(), userInfo.getGridIdList()); |
|
|
List<String> gridList = new ArrayList<>(); |
|
|
|
|
|
resultList = baseDao.selectArticleListForGrid(tokenDto.getCustomerId(), gridList); |
|
|
|
|
|
} |
|
|
} |
|
|
PageInfo<PublishedListResultDTO> pageInfo = new PageInfo<>(resultList); |
|
|
PageInfo<PublishedListResultDTO> pageInfo = new PageInfo<>(resultList); |
|
|
return new PageData<>(resultList, pageInfo.getTotal()); |
|
|
return new PageData<>(resultList, pageInfo.getTotal()); |
|
@ -559,8 +552,13 @@ public class ArticleServiceImpl extends BaseServiceImpl<ArticleDao, ArticleEntit |
|
|
@Override |
|
|
@Override |
|
|
public PageData offlineList(TokenDto tokenDto, OfflineListFormDTO formDTO) { |
|
|
public PageData offlineList(TokenDto tokenDto, OfflineListFormDTO formDTO) { |
|
|
PageHelper.startPage(formDTO.getPageNo(),formDTO.getPageSize()); |
|
|
PageHelper.startPage(formDTO.getPageNo(),formDTO.getPageSize()); |
|
|
List<String> gridList = new ArrayList<>(); |
|
|
|
|
|
List<OfflineListResultDTO> resultList = baseDao.selectOfflineList(gridList); |
|
|
LoginUserDetailsFormDTO loginUserDetailsFormDTO = new LoginUserDetailsFormDTO(); |
|
|
|
|
|
loginUserDetailsFormDTO.setApp(tokenDto.getApp()); |
|
|
|
|
|
loginUserDetailsFormDTO.setClient(tokenDto.getClient()); |
|
|
|
|
|
loginUserDetailsFormDTO.setUserId(tokenDto.getUserId()); |
|
|
|
|
|
LoginUserDetailsResultDTO userInfo = epmetUserSelfFeignClient.getLoginUserDetails(loginUserDetailsFormDTO).getData(); |
|
|
|
|
|
List<OfflineListResultDTO> resultList = baseDao.selectOfflineList(userInfo.getGridIdList()); |
|
|
PageInfo<OfflineListResultDTO> pageInfo = new PageInfo<>(resultList); |
|
|
PageInfo<OfflineListResultDTO> pageInfo = new PageInfo<>(resultList); |
|
|
return new PageData<>(resultList, pageInfo.getTotal()); |
|
|
return new PageData<>(resultList, pageInfo.getTotal()); |
|
|
} |
|
|
} |
|
|