Commit c18196a5 by songyinghui

feat: 对话框分享

parent f4b25af9
......@@ -55,6 +55,11 @@ public class ClerkShareMaterialLogDTO implements Serializable {
*/
private String storeId;
/**
* 外部联系人id
*/
private String externalUserId;
public String getEnterpriseId() {
return enterpriseId;
}
......@@ -118,4 +123,12 @@ public class ClerkShareMaterialLogDTO implements Serializable {
public void setStoreId(String storeId) {
this.storeId = storeId;
}
public String getExternalUserId() {
return externalUserId;
}
public void setExternalUserId(String externalUserId) {
this.externalUserId = externalUserId;
}
}
......@@ -3,18 +3,25 @@ package com.gic.haoban.manage.service.service.out.impl.content;
import com.alibaba.fastjson.JSON;
import com.gic.api.base.commons.ServiceResponse;
import com.gic.commons.util.GICMQClientUtil;
import com.gic.commons.util.UniqueIdUtils;
import com.gic.haoban.manage.api.dto.content.log.ClerkShareMaterialLogDTO;
import com.gic.haoban.manage.api.dto.content.log.TriggerCustomerDetailLogDTO;
import com.gic.haoban.manage.api.enums.content.ClerkShareMaterialType;
import com.gic.haoban.manage.api.service.content.MaterialShareLogApiService;
import com.gic.haoban.manage.service.pojo.bo.content.ClerkShareLogBO;
import com.gic.haoban.manage.service.pojo.bo.content.TriggerCustomerDetailBO;
import com.gic.haoban.manage.service.service.content.ClerkShareLogService;
import com.gic.haoban.manage.service.service.content.TriggerCustomerDetailService;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import java.util.Collections;
import java.util.Date;
/**
* @Author MUSI
* @Date 2023/3/18 8:34 PM
......@@ -33,10 +40,35 @@ public class MaterialShareLogApiServiceImpl implements MaterialShareLogApiServic
private static final String SHARE_MATERIAL_DETAIL_LOG = "handlerTriggerCustomerDetailLog";
@Autowired
private ClerkShareLogService clerkShareLogService;
@Autowired
TriggerCustomerDetailService triggerCustomerDetailService;
@Override
public ServiceResponse<Long> saveClerkShareMaterialLog(ClerkShareMaterialLogDTO clerkShareMaterialLogDTO) {
log.info("saveClerkShareMaterialLog 保存导购分享日志 clerkId:{}, bizId:{}", clerkShareMaterialLogDTO.getClerkId(), clerkShareMaterialLogDTO.getBizId());
log.info("saveClerkShareMaterialLog 保存导购分享日志 clerkId:{}, bizId:{} {}", clerkShareMaterialLogDTO.getClerkId(),
clerkShareMaterialLogDTO.getBizId(), JSON.toJSONString(clerkShareMaterialLogDTO));
if (StringUtils.isNotBlank(clerkShareMaterialLogDTO.getExternalUserId())) {
// 通过对话框发送
TriggerCustomerDetailBO temp = new TriggerCustomerDetailBO();
temp.setId(UniqueIdUtils.uniqueLong());
temp.setEnterpriseId(clerkShareMaterialLogDTO.getEnterpriseId());
temp.setWxEnterpriseId(clerkShareMaterialLogDTO.getWxEnterpriseId());
temp.setBizId(clerkShareMaterialLogDTO.getBizId());
temp.setBizType(clerkShareMaterialLogDTO.getBizType());
temp.setClerkId(clerkShareMaterialLogDTO.getClerkId());
temp.setStaffId(clerkShareMaterialLogDTO.getStaffId());
temp.setStoreId(clerkShareMaterialLogDTO.getStoreId());
temp.setChannelType(clerkShareMaterialLogDTO.getShareType());
temp.setCustomerId(clerkShareMaterialLogDTO.getExternalUserId());
temp.setCreateTime(new Date());
temp.setUpdateTime(new Date());
temp.setDeleteFlag(0);
triggerCustomerDetailService.batchSave(Collections.singletonList(temp));
return ServiceResponse.success(temp.getId());
}
ClerkShareLogBO clerkShareLogBO = new ClerkShareLogBO();
BeanUtils.copyProperties(clerkShareMaterialLogDTO, clerkShareLogBO);
Long logId = clerkShareLogService.saveClerkShareLog(clerkShareLogBO);
......
......@@ -65,7 +65,7 @@ public class ClerkMaterialShareController {
temp.setBizId(materialShareLogQo.getContentMaterialId() + "");
temp.setBizType(ShareBizType.MATERIAL.getCode());
temp.setStoreId(materialShareLogQo.getStoreId());
temp.setExternalUserId(materialShareLogQo.getExternalUserId());
ServiceResponse<Long> serviceResponse = materialShareLogApiService.saveClerkShareMaterialLog(temp);
if (serviceResponse.isSuccess()) {
return RestResponse.successResult(serviceResponse.getResult());
......
......@@ -19,6 +19,11 @@ public class MaterialShareLogQO extends ContentMaterialBaseQO {
*/
private Integer shareType;
/**
* 外部联系人id
*/
private String externalUserId;
public Integer getShareType() {
return shareType;
}
......@@ -26,4 +31,12 @@ public class MaterialShareLogQO extends ContentMaterialBaseQO {
public void setShareType(Integer shareType) {
this.shareType = shareType;
}
public String getExternalUserId() {
return externalUserId;
}
public void setExternalUserId(String externalUserId) {
this.externalUserId = externalUserId;
}
}
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