Commit 17ebedbf by 1539136324@qq.com

提交客户画像资料更新接口

1 parent 5f30d342
......@@ -2,11 +2,10 @@ package com.linkwechat.web.controller.wecom;
import com.linkwechat.common.core.controller.BaseController;
import com.linkwechat.common.core.domain.AjaxResult;
import com.linkwechat.wecom.domain.WeCustomerPortrait;
import com.linkwechat.wecom.service.IWeCustomerService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
/**
* @description: 客户画像相关controller
......@@ -31,12 +30,29 @@ public class WeCustomerPortraitController extends BaseController {
@GetMapping(value = "/findWeCustomerInfo")
public AjaxResult findWeCustomerInfo(String externalUserid, String operUserid){
return AjaxResult.success(
iWeCustomerService.findCustomerByOperUseridAndCustomerId(externalUserid,operUserid)
);
}
/**
* 客户画像资料更新
* @param weCustomerPortrait
* @return
*/
@PostMapping(value = "/updateWeCustomerInfo")
public AjaxResult updateWeCustomerInfo(@RequestBody WeCustomerPortrait weCustomerPortrait){
iWeCustomerService.updateWeCustomerPortrait(weCustomerPortrait);
return AjaxResult.success();
}
}
......@@ -12,6 +12,10 @@ import java.util.List;
**/
@Data
public class WeCustomerPortrait {
//外部联系人id
private String externalUserid;
//企业员工id
private String operUserid;
//客户昵称
private String name;
//客户备注
......
......@@ -89,4 +89,23 @@ public class WeFlowerCustomerRel
@TableField(exist = false)
private String endTime;
/** 备注 */
private String remark;
/** 邮件 */
private String email;
/** qq */
private String qq;
/**地址*/
private String address;
}
......@@ -122,4 +122,11 @@ public interface IWeCustomerService extends IService<WeCustomer>
*/
WeCustomerPortrait findCustomerByOperUseridAndCustomerId(@Param("externalUserid") String externalUserid, @Param("operUserid") String operUserid);
/**
* 跟新客户画像
* @param weCustomerPortrait
*/
void updateWeCustomerPortrait(WeCustomerPortrait weCustomerPortrait);
}
......@@ -632,5 +632,26 @@ public class WeCustomerServiceImpl extends ServiceImpl<WeCustomerMapper, WeCusto
return weCustomerMapper.findCustomerByOperUseridAndCustomerId(externalUserid,operUserid);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void updateWeCustomerPortrait(WeCustomerPortrait weCustomerPortrait) {
WeCustomer weCustomer
= WeCustomer.builder().build();
BeanUtils.copyBeanProp(weCustomer,weCustomerPortrait);
//更新用户基本信息表
this.updateById(
weCustomer
);
WeFlowerCustomerRel weFlowerCustomerRel = WeFlowerCustomerRel.builder().build();
BeanUtils.copyBeanProp(weFlowerCustomerRel,weCustomerPortrait);
//更新企业添加人表
iWeFlowerCustomerRelService.update(weFlowerCustomerRel,new LambdaQueryWrapper<WeFlowerCustomerRel>()
.eq(WeFlowerCustomerRel::getExternalUserid,weCustomerPortrait.getExternalUserid())
.eq(WeFlowerCustomerRel::getOperUserid,weCustomerPortrait.getOperUserid()));
}
}
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!