Commit 41d7a0a0 by songyinghui

feat: 销售线索 文案描述拼接

parent 7f79ddd6
...@@ -42,20 +42,31 @@ public class InteractRecordBuilder { ...@@ -42,20 +42,31 @@ public class InteractRecordBuilder {
* @return * @return
*/ */
public String buildDesc(TabHaobanInteractRecord interactRecord) { public String buildDesc(TabHaobanInteractRecord interactRecord) {
return this.buildDesc(interactRecord.getChannelSource(), interactRecord.getEventType());
}
/**
* 基于渠道和事件类型拼接信息
* @param channelSource
* @param eventType
* @return
*/
public String buildDesc(Integer channelSource, Integer eventType) {
StringBuilder stringBuilder = new StringBuilder(); StringBuilder stringBuilder = new StringBuilder();
if (TriggerCustomerChannelType.showDescChannel().contains(interactRecord.getChannelSource())) { if (TriggerCustomerChannelType.showDescChannel().contains(channelSource)) {
TriggerCustomerChannelType channelType = TriggerCustomerChannelType.getInstance(interactRecord.getChannelSource()); TriggerCustomerChannelType channelType = TriggerCustomerChannelType.getInstance(channelSource);
if (channelType != null) { if (channelType != null) {
stringBuilder.append(String.format("通过[%s]", channelType.getDesc())); stringBuilder.append(String.format("通过[%s]", channelType.getDesc()));
} }
} }
MaterialInteractRecordEventType instance = MaterialInteractRecordEventType.getInstance(interactRecord.getEventType()); MaterialInteractRecordEventType instance = MaterialInteractRecordEventType.getInstance(eventType);
if (instance != null) { if (instance != null) {
stringBuilder.append(instance.getDesc()); stringBuilder.append(instance.getDesc());
} }
return stringBuilder.toString(); return stringBuilder.toString();
} }
/** /**
* 互动记录转换扩展信息 * 互动记录转换扩展信息
* *
...@@ -110,8 +121,7 @@ public class InteractRecordBuilder { ...@@ -110,8 +121,7 @@ public class InteractRecordBuilder {
extendGoodsInfo.setGoodsName(item.getGoodsName()); extendGoodsInfo.setGoodsName(item.getGoodsName());
extendGoodsInfo.setGoodsCode(item.getGoodsCode()); extendGoodsInfo.setGoodsCode(item.getGoodsCode());
extendGoodsInfo.setGoodsImageUrl(item.getGoodsImageUrl()); extendGoodsInfo.setGoodsImageUrl(item.getGoodsImageUrl());
// todo 商品价格 待订单迭代上线后再调整 extendGoodsInfo.setSalePrice(item.getSalePrice());
// extendGoodsInfo.setSalePrice(item.getStatus());
return extendGoodsInfo; return extendGoodsInfo;
}) })
.collect(Collectors.toList()); .collect(Collectors.toList());
......
...@@ -9,6 +9,7 @@ import com.gic.haoban.manage.api.service.content.PotentialCustomerApiService; ...@@ -9,6 +9,7 @@ import com.gic.haoban.manage.api.service.content.PotentialCustomerApiService;
import com.gic.haoban.manage.service.pojo.bo.content.PotentialCustomerBO; import com.gic.haoban.manage.service.pojo.bo.content.PotentialCustomerBO;
import com.gic.haoban.manage.service.pojo.qo.content.PotentialCustomerQO; import com.gic.haoban.manage.service.pojo.qo.content.PotentialCustomerQO;
import com.gic.haoban.manage.service.service.content.PotentialCustomerService; import com.gic.haoban.manage.service.service.content.PotentialCustomerService;
import com.gic.haoban.manage.service.service.content.adaptor.InteractRecordBuilder;
import org.apache.commons.collections.CollectionUtils; import org.apache.commons.collections.CollectionUtils;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
...@@ -28,6 +29,8 @@ public class PotentialCustomerApiServiceImpl implements PotentialCustomerApiServ ...@@ -28,6 +29,8 @@ public class PotentialCustomerApiServiceImpl implements PotentialCustomerApiServ
@Autowired @Autowired
PotentialCustomerService potentialCustomerService; PotentialCustomerService potentialCustomerService;
@Autowired
InteractRecordBuilder interactRecordBuilder;
/** /**
* 查询销售线索记录 * 查询销售线索记录
...@@ -50,6 +53,7 @@ public class PotentialCustomerApiServiceImpl implements PotentialCustomerApiServ ...@@ -50,6 +53,7 @@ public class PotentialCustomerApiServiceImpl implements PotentialCustomerApiServ
.map(item -> { .map(item -> {
PotentialCustomerDTO temp = new PotentialCustomerDTO(); PotentialCustomerDTO temp = new PotentialCustomerDTO();
BeanUtils.copyProperties(item, temp); BeanUtils.copyProperties(item, temp);
temp.setDesc(interactRecordBuilder.buildDesc(item.getChannelSource(), item.getEventType()));
return temp; return temp;
}) })
.collect(Collectors.toList()); .collect(Collectors.toList());
......
...@@ -81,14 +81,4 @@ public class InteractRecordController { ...@@ -81,14 +81,4 @@ public class InteractRecordController {
return RestResponse.successResult(result); return RestResponse.successResult(result);
} }
// /**
// * 查询互动记录扩展信息
// * @param interactRecordQO
// * @return
// */
// @RequestMapping(path = "/relation/extend/info")
// public RestResponse<InteractRecordExtendInfoVO> queryInteractRecordRelationGoods(InteractRecordQO interactRecordQO) {
// return RestResponse.successResult();
// }
} }
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