Browse Source

Merge branch 'dev_guidance' into develop

dev_shibei_match
zhaoqifeng 4 years ago
parent
commit
b870de930e
  1. 2
      epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/GuideController.java
  2. 10
      epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/GuideCollectionService.java
  3. 3
      epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/GuideService.java
  4. 22
      epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/GuideCollectionServiceImpl.java
  5. 15
      epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/GuideServiceImpl.java

2
epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/GuideController.java

@ -164,7 +164,7 @@ public class GuideController {
public Result<GuideDetailResultDTO> guideDetail(@LoginUser TokenDto tokenDto, @RequestBody GuideFormDTO formDTO) {
ValidatorUtils.validateEntity(formDTO);
formDTO.setCustomerId(tokenDto.getCustomerId());
GuideDetailResultDTO result = guideService.guideDetail(formDTO);
GuideDetailResultDTO result = guideService.guideDetail(tokenDto, formDTO);
return new Result<GuideDetailResultDTO>().ok(result);
}

10
epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/GuideCollectionService.java

@ -104,4 +104,14 @@ public interface GuideCollectionService extends BaseService<GuideCollectionEntit
* @Date 2021/9/9 9:46
*/
void collection(TokenDto tokenDto, GuideFormDTO formDTO);
/**
* @Description 获取收藏信息
* @Param tokenDto
* @Param guideId
* @Return {@link GuideCollectionDTO}
* @Author zhaoqifeng
* @Date 2021/9/10 9:52
*/
GuideCollectionDTO getCollection(TokenDto tokenDto, String guideId);
}

3
epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/GuideService.java

@ -145,12 +145,13 @@ public interface GuideService extends BaseService<GuideEntity> {
/**
* 指南详情
*
* @Param tokenDto
* @Param formDTO
* @Return {@link GuideDetailResultDTO}
* @Author zhaoqifeng
* @Date 2021/9/7 14:12
*/
GuideDetailResultDTO guideDetail(GuideFormDTO formDTO);
GuideDetailResultDTO guideDetail(TokenDto tokenDto, GuideFormDTO formDTO);
/**
* @Description 收藏列表

22
epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/GuideCollectionServiceImpl.java

@ -132,4 +132,26 @@ public class GuideCollectionServiceImpl extends BaseServiceImpl<GuideCollectionD
}
}
/**
* @param tokenDto
* @param guideId
* @Description 获取收藏信息
* @Param tokenDto
* @Param guideId
* @Return {@link GuideCollectionDTO}
* @Author zhaoqifeng
* @Date 2021/9/10 9:52
*/
@Override
public GuideCollectionDTO getCollection(TokenDto tokenDto, String guideId) {
//获取指南收藏信息
LambdaQueryWrapper<GuideCollectionEntity> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(GuideCollectionEntity::getGuideId, guideId);
wrapper.eq(GuideCollectionEntity::getUserId, tokenDto.getUserId());
wrapper.eq(GuideCollectionEntity::getApp, tokenDto.getApp());
wrapper.eq(GuideCollectionEntity::getCustomerId, tokenDto.getCustomerId());
GuideCollectionEntity entity = baseDao.selectOne(wrapper);
return ConvertUtils.sourceToTarget(entity, GuideCollectionDTO.class);
}
}

15
epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/GuideServiceImpl.java

@ -21,6 +21,7 @@ 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.dto.form.PageFormDTO;
import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult;
import com.epmet.commons.tools.exception.EpmetErrorCode;
@ -42,10 +43,7 @@ import com.epmet.entity.GuideEntity;
import com.epmet.entity.GuideExternalLinkEntity;
import com.epmet.entity.GuideModuleEntity;
import com.epmet.feign.GovOrgOpenFeignClient;
import com.epmet.service.GuideAttachmentService;
import com.epmet.service.GuideExternalLinkService;
import com.epmet.service.GuideModuleService;
import com.epmet.service.GuideService;
import com.epmet.service.*;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.apache.commons.collections4.CollectionUtils;
@ -77,6 +75,8 @@ public class GuideServiceImpl extends BaseServiceImpl<GuideDao, GuideEntity> imp
private GuideAttachmentService guideAttachmentService;
@Resource
private GuideExternalLinkService guideExternalLinkService;
@Resource
private GuideCollectionService guideCollectionService;
@Override
public PageData<GuideDTO> page(Map<String, Object> params) {
@ -373,7 +373,7 @@ public class GuideServiceImpl extends BaseServiceImpl<GuideDao, GuideEntity> imp
* @Date 2021/9/7 14:12
*/
@Override
public GuideDetailResultDTO guideDetail(GuideFormDTO formDTO) {
public GuideDetailResultDTO guideDetail(TokenDto tokenDto, GuideFormDTO formDTO) {
//获取指南详情
GuideDetailResultDTO result = baseDao.getGuideDetail(formDTO.getCustomerId(), formDTO.getGuideId());
if (null == result) {
@ -385,6 +385,11 @@ public class GuideServiceImpl extends BaseServiceImpl<GuideDao, GuideEntity> imp
result.setAttachmentList(guideAttachmentService.getByGuideId(formDTO.getGuideId()));
//获取指南外链地址
result.setExternalLinks(guideExternalLinkService.getByGuideId(formDTO.getGuideId()));
//是否收藏
result.setCollectionFlag(NumConstant.ZERO_STR);
if (null != guideCollectionService.getCollection(tokenDto, formDTO.getGuideId())) {
result.setCollectionFlag(NumConstant.ONE_STR);
}
return result;
}

Loading…
Cancel
Save