Commit 6447d09d by 王祖波

Merge remote-tracking branch 'origin/feature-content4' into feature-content4

parents afa2fe90 3776a4c8
...@@ -31,6 +31,7 @@ public class InteractRecordMessageListener implements MessageListener<String, St ...@@ -31,6 +31,7 @@ public class InteractRecordMessageListener implements MessageListener<String, St
static { static {
dealEventType.add(MaterialInteractRecordEventType.VISIT_PRODUCT.getCode()); dealEventType.add(MaterialInteractRecordEventType.VISIT_PRODUCT.getCode());
dealEventType.add(MaterialInteractRecordEventType.VISIT_MATERIAL.getCode()); dealEventType.add(MaterialInteractRecordEventType.VISIT_MATERIAL.getCode());
dealEventType.add(MaterialInteractRecordEventType.ADD_SHOPPING_CART.getCode());
} }
@Override @Override
...@@ -45,7 +46,7 @@ public class InteractRecordMessageListener implements MessageListener<String, St ...@@ -45,7 +46,7 @@ public class InteractRecordMessageListener implements MessageListener<String, St
return; return;
} }
if (recordMessageBO.getEventType() == null || !dealEventType.contains(recordMessageBO.getEventType())) { if (recordMessageBO.getEventType() == null || !dealEventType.contains(recordMessageBO.getEventType())) {
log.info("素材埋点事件类型非素材相关类型 {}", recordMessageBO.getEventType()); log.info("埋点事件类型非相关类型 {}", recordMessageBO.getEventType());
return; return;
} }
dataConvert(recordMessageBO); dataConvert(recordMessageBO);
......
...@@ -146,9 +146,9 @@ public class InteractRecordMessageService { ...@@ -146,9 +146,9 @@ public class InteractRecordMessageService {
potentialCustomerBO.setSeeFlag(0); potentialCustomerBO.setSeeFlag(0);
potentialCustomerBO.setStoreId(interactRecordBO.getStoreId()); potentialCustomerBO.setStoreId(interactRecordBO.getStoreId());
potentialCustomerBO.setBizId(interactRecordBO.getBizId()); potentialCustomerBO.setBizId(interactRecordBO.getBizId());
potentialCustomerBO.setBizType(interactRecordBO.getBizType());
potentialCustomerBO.setEventType(interactRecordBO.getEventType()); potentialCustomerBO.setEventType(interactRecordBO.getEventType());
potentialCustomerBO.setChannelSource(interactRecordBO.getChannelSource()); potentialCustomerBO.setChannelSource(interactRecordBO.getChannelSource());
potentialCustomerBO.setEventType(interactRecordBO.getEventType());
potentialCustomerBO.setDurationTime(interactRecordBO.getDurationTime()); potentialCustomerBO.setDurationTime(interactRecordBO.getDurationTime());
potentialCustomerBO.setTimes(interactRecordBO.getTimes()); potentialCustomerBO.setTimes(interactRecordBO.getTimes());
potentialCustomerService.saveOrUpdatePotentialCustomer(potentialCustomerBO); potentialCustomerService.saveOrUpdatePotentialCustomer(potentialCustomerBO);
......
import com.alibaba.fastjson.JSONObject;
import com.gic.api.base.commons.Page;
import com.gic.api.base.commons.ServiceResponse;
import com.gic.haoban.manage.api.dto.content.PotentialCustomerDTO;
import com.gic.haoban.manage.api.dto.qdto.content.PotentialCustomerQDTO;
import com.gic.haoban.manage.api.service.content.MallOrderStatusChangeApiService; import com.gic.haoban.manage.api.service.content.MallOrderStatusChangeApiService;
import com.gic.haoban.manage.api.service.content.PotentialCustomerApiService;
import com.gic.haoban.manage.service.pojo.bo.content.message.InteractRecordMessageBO; import com.gic.haoban.manage.service.pojo.bo.content.message.InteractRecordMessageBO;
import com.gic.haoban.manage.service.service.content.PotentialCustomerService;
import com.gic.haoban.manage.service.service.content.message.InteractRecordMessageService; import com.gic.haoban.manage.service.service.content.message.InteractRecordMessageService;
import com.sun.org.apache.bcel.internal.generic.DADD; import com.sun.org.apache.bcel.internal.generic.DADD;
import org.junit.Test; import org.junit.Test;
...@@ -26,6 +33,8 @@ public class InteractRecordMessageServiceTest { ...@@ -26,6 +33,8 @@ public class InteractRecordMessageServiceTest {
InteractRecordMessageService interactRecordMessageService; InteractRecordMessageService interactRecordMessageService;
@Autowired @Autowired
MallOrderStatusChangeApiService mallOrderStatusChangeApiService; MallOrderStatusChangeApiService mallOrderStatusChangeApiService;
@Autowired
private PotentialCustomerApiService potentialCustomerApiService;
String eid = "ff8080815dacd3a2015dacd3ef5c0000"; String eid = "ff8080815dacd3a2015dacd3ef5c0000";
String wxEid = "ca66a01b79474c40b3e7c7f93daf1a3b"; String wxEid = "ca66a01b79474c40b3e7c7f93daf1a3b";
...@@ -60,4 +69,24 @@ public class InteractRecordMessageServiceTest { ...@@ -60,4 +69,24 @@ public class InteractRecordMessageServiceTest {
String params ="{\"orderNumber\":\"6230408781099580\",\"toStatus\":2,\"fromStatus\":1,\"orderId\":\"c08691af8297480db3d25ef5ef19e863\",\"enterpriseId\":\"ff8080815dacd3a2015dacd3ef5c0000\",\"mqTraceId\":\"244806167-1-1680932807.425-/gic-thirdparty/wxmall_payment_result_notice\",\"memberId\":\"ff8080818147efc8018148d1759903c8\"}"; String params ="{\"orderNumber\":\"6230408781099580\",\"toStatus\":2,\"fromStatus\":1,\"orderId\":\"c08691af8297480db3d25ef5ef19e863\",\"enterpriseId\":\"ff8080815dacd3a2015dacd3ef5c0000\",\"mqTraceId\":\"244806167-1-1680932807.425-/gic-thirdparty/wxmall_payment_result_notice\",\"memberId\":\"ff8080818147efc8018148d1759903c8\"}";
mallOrderStatusChangeApiService.mallOrderStatusChange(params); mallOrderStatusChangeApiService.mallOrderStatusChange(params);
} }
@Test
public void dealGoodsRecord(){
String json = "{\"businessUUId\":\"IcB5ZMEvmzir1uvjgc6ohJFMmexraBak\",\"durationTime\":21990,\"enterpriseId\":\"ff8080815dacd3a2015dacd3ef5c0000\",\"eventType\":2,\"goodsId\":\"ff808081890a1b4201890a54b479001d\",\"lastAccessTime\":1692580759467,\"memberId\":\"ff80808189fd5ba6018a01ea3e070673\",\"refUrl\":\"pages/authorize/authorize\",\"unionId\":\"orXl9tyHOI4qP1QxwVcA7A3sB7zg\"}";
InteractRecordMessageBO interactRecordMessageBO = JSONObject.parseObject(json, InteractRecordMessageBO.class);
interactRecordMessageBO.setChannelSource(3);
interactRecordMessageBO.setClerkId("415b123576674913b365005b81037551");
interactRecordMessageService.dealRecord(interactRecordMessageBO);
}
@Test
public void queryPotentialCustomer() {
PotentialCustomerQDTO potentialCustomerQDTO = new PotentialCustomerQDTO();
potentialCustomerQDTO.setEnterpriseId("ff8080815dacd3a2015dacd3ef5c0000");
potentialCustomerQDTO.setClerkId("415b123576674913b365005b81037551");
potentialCustomerQDTO.setWxEnterpriseId("ca66a01b79474c40b3e7c7f93daf1a3b");
ServiceResponse<Page<PotentialCustomerDTO>> pageServiceResponse = potentialCustomerApiService.queryPotentialCustomer(potentialCustomerQDTO);
System.out.println(JSONObject.toJSONString(pageServiceResponse));
}
} }
...@@ -243,6 +243,9 @@ public class WxStaffController extends WebBaseController { ...@@ -243,6 +243,9 @@ public class WxStaffController extends WebBaseController {
vo.setClerkId(dto.getClerkId()); vo.setClerkId(dto.getClerkId());
vo.setClerkType(dto.getClerkType()); vo.setClerkType(dto.getClerkType());
vo.setClerkImg(dto.getImageUrl()); vo.setClerkImg(dto.getImageUrl());
if (StringUtils.isBlank(vo.getClerkImg())) {
vo.setClerkImg(dto.getHeadImgUrl());
}
vo.setClerkName(dto.getClerkName()); vo.setClerkName(dto.getClerkName());
StaffClerkRelationDTO related = bindCodeMap.get(dto.getClerkId()); StaffClerkRelationDTO related = bindCodeMap.get(dto.getClerkId());
if (related != null) { if (related != null) {
......
...@@ -9,6 +9,7 @@ import com.gic.content.api.dto.material.ContentMaterialBaseDTO; ...@@ -9,6 +9,7 @@ import com.gic.content.api.dto.material.ContentMaterialBaseDTO;
import com.gic.haoban.manage.api.dto.qdto.content.InteractRecordQDTO; import com.gic.haoban.manage.api.dto.qdto.content.InteractRecordQDTO;
import com.gic.haoban.manage.api.enums.content.InteractRecordExtendInfoDTO; import com.gic.haoban.manage.api.enums.content.InteractRecordExtendInfoDTO;
import com.gic.haoban.manage.api.enums.content.InteractRecordInfoDTO; import com.gic.haoban.manage.api.enums.content.InteractRecordInfoDTO;
import com.gic.haoban.manage.api.enums.content.ShareBizType;
import com.gic.haoban.manage.api.service.content.InteractRecordApiService; import com.gic.haoban.manage.api.service.content.InteractRecordApiService;
import com.gic.haoban.manage.web.controller.content.adaptor.ContentMaterialAdaptor; import com.gic.haoban.manage.web.controller.content.adaptor.ContentMaterialAdaptor;
import com.gic.haoban.manage.web.qo.content.InteractRecordQO; import com.gic.haoban.manage.web.qo.content.InteractRecordQO;
...@@ -59,6 +60,7 @@ public class InteractRecordController { ...@@ -59,6 +60,7 @@ public class InteractRecordController {
List<Long> materialIds = serviceResponse.getResult() List<Long> materialIds = serviceResponse.getResult()
.getResult() .getResult()
.stream() .stream()
.filter(item -> ShareBizType.MATERIAL.getCode().equals(item.getBizType()))
.map(item -> Long.parseLong(item.getBizId())) .map(item -> Long.parseLong(item.getBizId()))
.distinct() .distinct()
.collect(Collectors.toList()); .collect(Collectors.toList());
...@@ -74,17 +76,19 @@ public class InteractRecordController { ...@@ -74,17 +76,19 @@ public class InteractRecordController {
InteractRecordExtendInfoVO extendInfoVO = EntityUtil.changeEntityByJSON(InteractRecordExtendInfoVO.class, item.getExtendInfo()); InteractRecordExtendInfoVO extendInfoVO = EntityUtil.changeEntityByJSON(InteractRecordExtendInfoVO.class, item.getExtendInfo());
interactRecordVO.setExtendInfo(extendInfoVO); interactRecordVO.setExtendInfo(extendInfoVO);
} }
ContentMaterialBaseDTO materialBaseInfo = materialBaseMap.get(Long.parseLong(item.getBizId())); if (ShareBizType.MATERIAL.getCode().equals(item.getBizType())) {
if (materialBaseInfo != null) { ContentMaterialBaseDTO materialBaseInfo = materialBaseMap.get(Long.parseLong(item.getBizId()));
ContentMaterialInfoVO temp = new ContentMaterialInfoVO(); if (materialBaseInfo != null) {
BeanUtils.copyProperties(materialBaseInfo, temp); ContentMaterialInfoVO temp = new ContentMaterialInfoVO();
if (StringUtils.isNotBlank(materialBaseInfo.getMaterialThumbnailImageUrls())) { BeanUtils.copyProperties(materialBaseInfo, temp);
temp.setMaterialThumbnailImageUrls(StrSpliter.split(materialBaseInfo.getMaterialThumbnailImageUrls(), ",", true, true)); if (StringUtils.isNotBlank(materialBaseInfo.getMaterialThumbnailImageUrls())) {
temp.setMaterialThumbnailImageUrls(StrSpliter.split(materialBaseInfo.getMaterialThumbnailImageUrls(), ",", true, true));
}
if (StringUtils.isNotBlank(materialBaseInfo.getMaterialImageUrls())) {
temp.setMaterialImageUrls(StrSpliter.split(materialBaseInfo.getMaterialImageUrls(), ",", true, true));
}
interactRecordVO.setContentMaterialInfoVO(temp);
} }
if (StringUtils.isNotBlank(materialBaseInfo.getMaterialImageUrls())) {
temp.setMaterialImageUrls(StrSpliter.split(materialBaseInfo.getMaterialImageUrls(), ",", true, true));
}
interactRecordVO.setContentMaterialInfoVO(temp);
} }
return interactRecordVO; return interactRecordVO;
}) })
......
...@@ -108,24 +108,26 @@ public class PotentialCustomerController { ...@@ -108,24 +108,26 @@ public class PotentialCustomerController {
PotentialCustomerVO temp = new PotentialCustomerVO(); PotentialCustomerVO temp = new PotentialCustomerVO();
BeanUtils.copyProperties(item, temp); BeanUtils.copyProperties(item, temp);
temp.setPotentialCustomerId(item.getPotentialCustomerId()); temp.setPotentialCustomerId(item.getPotentialCustomerId());
ContentMaterialBaseDTO contentMaterialBaseDTO = materialInfoMap.get(Long.parseLong(item.getBizId())); if (ShareBizType.MATERIAL.getCode().equals(item.getBizType())) {
if (contentMaterialBaseDTO != null) { ContentMaterialBaseDTO contentMaterialBaseDTO = materialInfoMap.get(Long.parseLong(item.getBizId()));
ContentMaterialInfoVO contentMaterialInfoVO = new ContentMaterialInfoVO(); if (contentMaterialBaseDTO != null) {
BeanUtils.copyProperties(contentMaterialBaseDTO, contentMaterialInfoVO); ContentMaterialInfoVO contentMaterialInfoVO = new ContentMaterialInfoVO();
if (StringUtils.isNotBlank(contentMaterialBaseDTO.getMaterialImageUrls())) { BeanUtils.copyProperties(contentMaterialBaseDTO, contentMaterialInfoVO);
String[] split = StringUtils.split(contentMaterialBaseDTO.getMaterialImageUrls(), ","); if (StringUtils.isNotBlank(contentMaterialBaseDTO.getMaterialImageUrls())) {
List<String> imageUrls = Arrays.stream(split).collect(Collectors.toList()); String[] split = StringUtils.split(contentMaterialBaseDTO.getMaterialImageUrls(), ",");
contentMaterialInfoVO.setMaterialImageUrls(imageUrls); List<String> imageUrls = Arrays.stream(split).collect(Collectors.toList());
contentMaterialInfoVO.setMaterialImageUrls(imageUrls);
}
if (StringUtils.isNotBlank(contentMaterialBaseDTO.getMaterialThumbnailImageUrls())) {
String[] split = StringUtils.split(contentMaterialBaseDTO.getMaterialThumbnailImageUrls(), ",");
List<String> imageUrls = Arrays.stream(split).collect(Collectors.toList());
contentMaterialInfoVO.setMaterialThumbnailImageUrls(imageUrls);
}
temp.setContentMaterialInfoVO(contentMaterialInfoVO);
} }
if (StringUtils.isNotBlank(contentMaterialBaseDTO.getMaterialThumbnailImageUrls())) { Integer visitNum = memberVisitMap.get(item.getMemberId());
String[] split = StringUtils.split(contentMaterialBaseDTO.getMaterialThumbnailImageUrls(), ","); temp.setVisitNum(Optional.ofNullable(visitNum).orElse(0));
List<String> imageUrls = Arrays.stream(split).collect(Collectors.toList());
contentMaterialInfoVO.setMaterialThumbnailImageUrls(imageUrls);
}
temp.setContentMaterialInfoVO(contentMaterialInfoVO);
} }
Integer visitNum = memberVisitMap.get(item.getMemberId());
temp.setVisitNum(Optional.ofNullable(visitNum).orElse(0));
return temp; return temp;
}) })
.collect(Collectors.toList()); .collect(Collectors.toList());
......
...@@ -35,6 +35,9 @@ public class ContentMaterialAdaptor { ...@@ -35,6 +35,9 @@ public class ContentMaterialAdaptor {
* @return * @return
*/ */
public Map<Long, ContentMaterialBaseDTO> queryMaterialInfoMap(String enterpriseId, List<Long> materialIds) { public Map<Long, ContentMaterialBaseDTO> queryMaterialInfoMap(String enterpriseId, List<Long> materialIds) {
if (CollectionUtils.isEmpty(materialIds)) {
return Collections.emptyMap();
}
ServiceResponse<List<ContentMaterialBaseDTO>> serviceResponse = contentMaterialApiService.listMaterialIdByMaterialIdList(enterpriseId, materialIds, null); ServiceResponse<List<ContentMaterialBaseDTO>> serviceResponse = contentMaterialApiService.listMaterialIdByMaterialIdList(enterpriseId, materialIds, null);
if (!serviceResponse.isSuccess()) { if (!serviceResponse.isSuccess()) {
return Collections.emptyMap(); return Collections.emptyMap();
......
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