Commit 4694e47c by 王祖波

Merge branch 'feature-recommend3' into developer

parents 7082562c 5c1ca007
package com.gic.haoban.manage.api.qdto.contact;
import java.io.Serializable;
public class ContactLogCheckQDTO implements Serializable {
private static final long serialVersionUID = 973688857967269973L;
/**
* 会员id
*/
private String memberId;
/**
* 导购id
*/
private String clerkId;
/**
* 企业id
*/
private String enterpriseId;
public String getMemberId() {
return memberId;
}
public void setMemberId(String memberId) {
this.memberId = memberId;
}
public String getClerkId() {
return clerkId;
}
public void setClerkId(String clerkId) {
this.clerkId = clerkId;
}
public String getEnterpriseId() {
return enterpriseId;
}
public void setEnterpriseId(String enterpriseId) {
this.enterpriseId = enterpriseId;
}
}
\ No newline at end of file
......@@ -2,6 +2,7 @@ package com.gic.haoban.manage.api.service.contact;
import com.gic.api.base.commons.ServiceResponse;
import com.gic.haoban.manage.api.dto.contact.ContactLogDTO;
import com.gic.haoban.manage.api.qdto.contact.ContactLogCheckQDTO;
import com.gic.haoban.manage.api.qdto.contact.ContactLogQDTO;
public interface ContactLogApiService {
......@@ -27,5 +28,13 @@ public interface ContactLogApiService {
*/
ServiceResponse<Void> autoContactLogForMQ(String message);
/**
* 是否可以建联校验
* @param checkQDTO
* @return
*/
ServiceResponse<Boolean> contactCheck(ContactLogCheckQDTO checkQDTO) ;
}
package com.gic.haoban.manage.service.service.contact;
import com.gic.api.base.commons.BusinessException;
import com.gic.clerk.api.dto.ClerkDTO;
import com.gic.haoban.manage.api.qdto.contact.ContactLogQDTO;
import com.gic.haoban.manage.service.entity.contact.TabContactLog;
......@@ -8,6 +9,14 @@ import java.util.Date;
public interface ContactLogService {
/**
* 是否可以建联判断
* @param enterpriseId
* @param memberId
* @param clerkDTO
* @return
*/
boolean contactCheck(String enterpriseId, String memberId, ClerkDTO clerkDTO) ;
/**
* 保存建联记录
......
......@@ -74,6 +74,7 @@ public class ContactLogServiceImpl implements ContactLogService {
@Autowired
private EnterpriseAdaptor enterpriseAdaptor;
@Override
public boolean contactCheck(String enterpriseId,String memberId,ClerkDTO clerkDTO) {
if (clerkDTO == null) {
return false;
......
......@@ -3,8 +3,11 @@ package com.gic.haoban.manage.service.service.out.impl.contact;
import com.alibaba.fastjson.JSONObject;
import com.gic.api.base.commons.BusinessException;
import com.gic.api.base.commons.ServiceResponse;
import com.gic.clerk.api.dto.ClerkDTO;
import com.gic.clerk.api.service.ClerkService;
import com.gic.commons.util.EntityUtil;
import com.gic.haoban.manage.api.dto.contact.ContactLogDTO;
import com.gic.haoban.manage.api.qdto.contact.ContactLogCheckQDTO;
import com.gic.haoban.manage.api.qdto.contact.ContactLogQDTO;
import com.gic.haoban.manage.api.service.contact.ContactLogApiService;
import com.gic.haoban.manage.service.entity.contact.TabContactLog;
......@@ -21,6 +24,8 @@ public class ContactLogApiServiceImpl implements ContactLogApiService {
@Autowired
private ContactLogService contactLogService;
@Autowired
private ClerkService clerkService;
@Override
public ServiceResponse<ContactLogDTO> getClerkContactTime(String memberId) {
......@@ -48,4 +53,14 @@ public class ContactLogApiServiceImpl implements ContactLogApiService {
contactLogService.autoContactLog(contactLogQDTO);
return ServiceResponse.success();
}
@Override
public ServiceResponse<Boolean> contactCheck(ContactLogCheckQDTO checkQDTO) {
ClerkDTO clerkDTO = clerkService.getclerkById(checkQDTO.getClerkId());
if (clerkDTO == null) {
return ServiceResponse.success(Boolean.FALSE);
}
boolean check = contactLogService.contactCheck(checkQDTO.getEnterpriseId(), checkQDTO.getMemberId(), clerkDTO);
return ServiceResponse.success(check);
}
}
......@@ -11,14 +11,13 @@ import com.gic.haoban.manage.api.dto.contact.ContactConfigDTO;
import com.gic.haoban.manage.api.dto.contact.ContactFollowDTO;
import com.gic.haoban.manage.api.qdto.contact.ContactFollowQDTO;
import com.gic.haoban.manage.api.qdto.contact.ContactFollowSearchQDTO;
import com.gic.haoban.manage.api.qdto.contact.ContactLogCheckQDTO;
import com.gic.haoban.manage.api.qdto.contact.ContactLogQDTO;
import com.gic.haoban.manage.api.service.contact.ContactConfigApiService;
import com.gic.haoban.manage.api.service.contact.ContactFollowApiService;
import com.gic.haoban.manage.api.service.contact.ContactLogApiService;
import com.gic.haoban.manage.web.qo.contact.ContactFollowPageQO;
import com.gic.haoban.manage.web.qo.contact.ContactFollowQO;
import com.gic.haoban.manage.web.qo.contact.ContactLastFollowQO;
import com.gic.haoban.manage.web.qo.contact.ContactLogQO;
import com.gic.haoban.manage.web.qo.contact.*;
import com.gic.haoban.manage.web.vo.contact.ContactLogCheckVO;
import com.google.common.collect.Lists;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
......@@ -129,6 +128,21 @@ public class ContactController {
}
/**
* 是否可以建联校验
* @param contactLogCheckQO
* @return
*/
@RequestMapping(path = "/check")
public RestResponse<ContactLogCheckVO> check(@RequestBody ContactLogCheckQO contactLogCheckQO) {
ContactLogCheckQDTO logCheckQDTO = EntityUtil.changeEntityNew(ContactLogCheckQDTO.class, contactLogCheckQO);
ServiceResponse<Boolean> serviceResponse = contactLogApiService.contactCheck(logCheckQDTO);
if (!serviceResponse.isSuccess()) {
return RestResponse.failure(serviceResponse.getCode(), serviceResponse.getMessage());
}
return RestResponse.successResult(new ContactLogCheckVO(serviceResponse.getResult()));
}
/**
* 建联配置
* @param enterpriseId
* @return
......
package com.gic.haoban.manage.web.qo.contact;
import java.io.Serializable;
public class ContactLogCheckQO implements Serializable {
private static final long serialVersionUID = 973688857967269973L;
/**
* 会员id
*/
private String memberId;
/**
* 导购id
*/
private String clerkId;
/**
* 企业id
*/
private String enterpriseId;
public String getMemberId() {
return memberId;
}
public void setMemberId(String memberId) {
this.memberId = memberId;
}
public String getClerkId() {
return clerkId;
}
public void setClerkId(String clerkId) {
this.clerkId = clerkId;
}
public String getEnterpriseId() {
return enterpriseId;
}
public void setEnterpriseId(String enterpriseId) {
this.enterpriseId = enterpriseId;
}
}
\ No newline at end of file
package com.gic.haoban.manage.web.vo.contact;
import lombok.Data;
import java.io.Serializable;
@Data
public class ContactLogCheckVO implements Serializable {
private static final long serialVersionUID = 973688857967269973L;
/**
* 是否可以建联
*/
private Boolean check;
public ContactLogCheckVO() {
}
public ContactLogCheckVO(Boolean check) {
this.check = check;
}
}
\ No newline at end of file
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