Commit c18196a5 by songyinghui

feat: 对话框分享

parent f4b25af9
...@@ -55,6 +55,11 @@ public class ClerkShareMaterialLogDTO implements Serializable { ...@@ -55,6 +55,11 @@ public class ClerkShareMaterialLogDTO implements Serializable {
*/ */
private String storeId; private String storeId;
/**
* 外部联系人id
*/
private String externalUserId;
public String getEnterpriseId() { public String getEnterpriseId() {
return enterpriseId; return enterpriseId;
} }
...@@ -118,4 +123,12 @@ public class ClerkShareMaterialLogDTO implements Serializable { ...@@ -118,4 +123,12 @@ public class ClerkShareMaterialLogDTO implements Serializable {
public void setStoreId(String storeId) { public void setStoreId(String storeId) {
this.storeId = 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; ...@@ -3,18 +3,25 @@ package com.gic.haoban.manage.service.service.out.impl.content;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.gic.api.base.commons.ServiceResponse; import com.gic.api.base.commons.ServiceResponse;
import com.gic.commons.util.GICMQClientUtil; 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.ClerkShareMaterialLogDTO;
import com.gic.haoban.manage.api.dto.content.log.TriggerCustomerDetailLogDTO; 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.enums.content.ClerkShareMaterialType;
import com.gic.haoban.manage.api.service.content.MaterialShareLogApiService; 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.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.ClerkShareLogService;
import com.gic.haoban.manage.service.service.content.TriggerCustomerDetailService;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import java.util.Collections;
import java.util.Date;
/** /**
* @Author MUSI * @Author MUSI
* @Date 2023/3/18 8:34 PM * @Date 2023/3/18 8:34 PM
...@@ -33,10 +40,35 @@ public class MaterialShareLogApiServiceImpl implements MaterialShareLogApiServic ...@@ -33,10 +40,35 @@ public class MaterialShareLogApiServiceImpl implements MaterialShareLogApiServic
private static final String SHARE_MATERIAL_DETAIL_LOG = "handlerTriggerCustomerDetailLog"; private static final String SHARE_MATERIAL_DETAIL_LOG = "handlerTriggerCustomerDetailLog";
@Autowired @Autowired
private ClerkShareLogService clerkShareLogService; private ClerkShareLogService clerkShareLogService;
@Autowired
TriggerCustomerDetailService triggerCustomerDetailService;
@Override @Override
public ServiceResponse<Long> saveClerkShareMaterialLog(ClerkShareMaterialLogDTO clerkShareMaterialLogDTO) { 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(); ClerkShareLogBO clerkShareLogBO = new ClerkShareLogBO();
BeanUtils.copyProperties(clerkShareMaterialLogDTO, clerkShareLogBO); BeanUtils.copyProperties(clerkShareMaterialLogDTO, clerkShareLogBO);
Long logId = clerkShareLogService.saveClerkShareLog(clerkShareLogBO); Long logId = clerkShareLogService.saveClerkShareLog(clerkShareLogBO);
......
...@@ -65,7 +65,7 @@ public class ClerkMaterialShareController { ...@@ -65,7 +65,7 @@ public class ClerkMaterialShareController {
temp.setBizId(materialShareLogQo.getContentMaterialId() + ""); temp.setBizId(materialShareLogQo.getContentMaterialId() + "");
temp.setBizType(ShareBizType.MATERIAL.getCode()); temp.setBizType(ShareBizType.MATERIAL.getCode());
temp.setStoreId(materialShareLogQo.getStoreId()); temp.setStoreId(materialShareLogQo.getStoreId());
temp.setExternalUserId(materialShareLogQo.getExternalUserId());
ServiceResponse<Long> serviceResponse = materialShareLogApiService.saveClerkShareMaterialLog(temp); ServiceResponse<Long> serviceResponse = materialShareLogApiService.saveClerkShareMaterialLog(temp);
if (serviceResponse.isSuccess()) { if (serviceResponse.isSuccess()) {
return RestResponse.successResult(serviceResponse.getResult()); return RestResponse.successResult(serviceResponse.getResult());
......
...@@ -19,6 +19,11 @@ public class MaterialShareLogQO extends ContentMaterialBaseQO { ...@@ -19,6 +19,11 @@ public class MaterialShareLogQO extends ContentMaterialBaseQO {
*/ */
private Integer shareType; private Integer shareType;
/**
* 外部联系人id
*/
private String externalUserId;
public Integer getShareType() { public Integer getShareType() {
return shareType; return shareType;
} }
...@@ -26,4 +31,12 @@ public class MaterialShareLogQO extends ContentMaterialBaseQO { ...@@ -26,4 +31,12 @@ public class MaterialShareLogQO extends ContentMaterialBaseQO {
public void setShareType(Integer shareType) { public void setShareType(Integer shareType) {
this.shareType = 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