Commit c2b65cf0 by songyinghui

feat: 销售线索sql

parent 490de2af
...@@ -312,7 +312,7 @@ ...@@ -312,7 +312,7 @@
<if test="starFlag != null"> <if test="starFlag != null">
and customer.star_flag = #{starFlag} and customer.star_flag = #{starFlag}
</if> </if>
<if test="hasMemberRelation = null"> <if test="hasMemberRelation != null">
<!-- 企微好友 --> <!-- 企微好友 -->
and related.clerk_id is not null and related.clerk_id is not null
</if> </if>
......
...@@ -4,16 +4,18 @@ import com.alibaba.fastjson.JSON; ...@@ -4,16 +4,18 @@ import com.alibaba.fastjson.JSON;
import com.gic.api.base.commons.ServiceResponse; import com.gic.api.base.commons.ServiceResponse;
import com.gic.commons.util.EntityUtil; import com.gic.commons.util.EntityUtil;
import com.gic.commons.webapi.reponse.RestResponse; import com.gic.commons.webapi.reponse.RestResponse;
import com.gic.content.api.dto.material.ContentGoodsDTO;
import com.gic.content.api.dto.material.ContentMaterialLandingPageInfoDTO; import com.gic.content.api.dto.material.ContentMaterialLandingPageInfoDTO;
import com.gic.content.api.qdto.material.ContentMaterialLandingPageQDTO; import com.gic.content.api.qdto.material.ContentMaterialLandingPageQDTO;
import com.gic.content.api.service.ContentMaterialShareApiService; import com.gic.content.api.service.ContentMaterialShareApiService;
import com.gic.haoban.common.utils.StringUtil;
import com.gic.haoban.manage.api.dto.content.log.ClerkShareMaterialLogDTO; import com.gic.haoban.manage.api.dto.content.log.ClerkShareMaterialLogDTO;
import com.gic.haoban.manage.api.enums.content.ShareBizType; import com.gic.haoban.manage.api.enums.content.ShareBizType;
import com.gic.haoban.manage.api.service.content.MaterialShareLogApiService; import com.gic.haoban.manage.api.service.content.MaterialShareLogApiService;
import com.gic.haoban.manage.web.qo.content.ContentMaterialBaseQO; import com.gic.haoban.manage.web.qo.content.ContentMaterialBaseQO;
import com.gic.haoban.manage.web.qo.content.log.MaterialShareLogQO; import com.gic.haoban.manage.web.qo.content.log.MaterialShareLogQO;
import com.gic.haoban.manage.web.vo.content.SimpleGoodsInfoVO;
import com.gic.haoban.manage.web.vo.content.share.ContentMaterialLandingPageVO; import com.gic.haoban.manage.web.vo.content.share.ContentMaterialLandingPageVO;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
...@@ -24,6 +26,9 @@ import org.springframework.web.bind.annotation.RequestMapping; ...@@ -24,6 +26,9 @@ import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import java.util.List;
import java.util.stream.Collectors;
/** /**
* 导购分享素材 与素材落地页 * 导购分享素材 与素材落地页
*/ */
...@@ -83,6 +88,18 @@ public class ClerkMaterialShareController { ...@@ -83,6 +88,18 @@ public class ClerkMaterialShareController {
return RestResponse.failure(serviceResponse.getCode(), serviceResponse.getMessage()); return RestResponse.failure(serviceResponse.getCode(), serviceResponse.getMessage());
} }
ContentMaterialLandingPageVO materialLandingPageVO = EntityUtil.changeEntityByJSON(ContentMaterialLandingPageVO.class, serviceResponse.getResult()); ContentMaterialLandingPageVO materialLandingPageVO = EntityUtil.changeEntityByJSON(ContentMaterialLandingPageVO.class, serviceResponse.getResult());
List<ContentGoodsDTO> goodsInfos = serviceResponse.getResult().getGoodsInfos();
if (CollectionUtils.isNotEmpty(goodsInfos)) {
List<SimpleGoodsInfoVO> goodsInfoVOS = goodsInfos.stream()
.map(item -> {
SimpleGoodsInfoVO temp = new SimpleGoodsInfoVO();
BeanUtils.copyProperties(item, temp);
temp.setGoodsImg(item.getGoodsImageUrl());
return temp;
})
.collect(Collectors.toList());
materialLandingPageVO.setGoodsInfos(goodsInfoVOS);
}
return RestResponse.successResult(materialLandingPageVO); return RestResponse.successResult(materialLandingPageVO);
} }
} }
...@@ -121,7 +121,13 @@ public class ContentMaterialController { ...@@ -121,7 +121,13 @@ public class ContentMaterialController {
} }
if (contentMaterialQO.getSearchType() != null && contentMaterialQO.getSearchType().equals(1)) { if (contentMaterialQO.getSearchType() != null && contentMaterialQO.getSearchType().equals(1)) {
if (StringUtils.isNotBlank(contentMaterialQO.getSearch())) { if (StringUtils.isNotBlank(contentMaterialQO.getSearch())) {
// 搜索条件需要置为空
contentMaterialPageFrontQDTO.setKeyWord(null);
List<String> goodsIds = goodsInfoAdaptor.queryGoodsIdWithSearch(contentMaterialQO.getEnterpriseId(), contentMaterialQO.getSearch()); List<String> goodsIds = goodsInfoAdaptor.queryGoodsIdWithSearch(contentMaterialQO.getEnterpriseId(), contentMaterialQO.getSearch());
if (CollectionUtils.isEmpty(goodsIds)) {
log.info("搜索商品不存在 {}", contentMaterialQO.getSearch());
return RestResponse.successResult(new Page<>());
}
contentMaterialPageFrontQDTO.setGoodsIdList(goodsIds); contentMaterialPageFrontQDTO.setGoodsIdList(goodsIds);
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment