Commit 774deefe by 王祖波

批量添加跟进记录

parent 5200ae6f
......@@ -15,11 +15,15 @@ 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.ContactLogQO;
import org.apache.commons.collections.CollectionUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
import java.util.stream.Collectors;
/**
* 潜客雷达-跟进记录
*/
......@@ -39,9 +43,16 @@ public class ContactController {
*/
@RequestMapping(path = "/follow")
public RestResponse<Void> saveFollow(@RequestBody ContactFollowQO contactFollowQO) {
ContactFollowQDTO followQDTO = EntityUtil.changeEntityNew(ContactFollowQDTO.class, contactFollowQO);
followQDTO.setFollowTime(DateUtil.date());
ServiceResponse<Void> serviceResponse = contactFollowApiService.saveFollow(followQDTO);
List<String> memberIdList = contactFollowQO.getMemberIdList();
if (CollectionUtils.isEmpty(memberIdList)) {
return RestResponse.successResult();
}
List<ContactFollowQDTO> list = memberIdList.stream().map(x -> {
ContactFollowQDTO followQDTO = EntityUtil.changeEntityNew(ContactFollowQDTO.class, contactFollowQO);
followQDTO.setMemberId(x);
return followQDTO;
}).collect(Collectors.toList());
ServiceResponse<Void> serviceResponse = contactFollowApiService.saveBatchFollow(list);
if (!serviceResponse.isSuccess()) {
return RestResponse.failure(serviceResponse.getCode(), serviceResponse.getMessage());
}
......
......@@ -8,9 +8,10 @@ import java.util.List;
public class ContactFollowQO {
/**
* 会员id
* 会员id列表
*/
private String memberId;
private List<String> memberIdList;
/**
* 导购id
*/
......@@ -33,12 +34,12 @@ public class ContactFollowQO {
*/
private String enterpriseId;
public String getMemberId() {
return memberId;
public List<String> getMemberIdList() {
return memberIdList;
}
public void setMemberId(String memberId) {
this.memberId = memberId;
public void setMemberIdList(List<String> memberIdList) {
this.memberIdList = memberIdList;
}
public String getClerkId() {
......
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