修改bug

1 parent 156a5af1
......@@ -58,6 +58,24 @@ public class WeCustomerController extends BaseController
/**
* 查询企业微信客户列表
*/
// @PreAuthorize("@ss.hasPermi('customerManage:customer:list')")
@GetMapping("/findWeCustomerList")
@ApiOperation("查询企业微信客户列表(重构版)")
public TableDataInfo findWeCustomerList(WeCustomerList weCustomerList)
{
startPage();
List<WeCustomerList> list = weCustomerService.findWeCustomerList(weCustomerList);
return getDataTable(list);
}
/**
* 根据员工ID获取客户
* @return
*/
......@@ -70,19 +88,7 @@ public class WeCustomerController extends BaseController
}
/**
* 查询企业微信客户列表(重构版)
*/
// @PreAuthorize("@ss.hasPermi('customerManage:customer:list')")
@GetMapping("/findWeCustomerList")
@ApiOperation("查询企业微信客户列表(重构版)")
public TableDataInfo findWeCustomerList(WeCustomerList weCustomerList)
{
startPage();
List<WeCustomerList> list = weCustomerService.findWeCustomerList(weCustomerList);
return getDataTable(list);
}
// /**
......
......@@ -12,7 +12,7 @@ import com.linkwechat.wecom.retry.WeCommonRetryWhen;
* @author: HaoN
* @create: 2020-08-27 16:42
**/
@BaseRequest(baseURL = "${weComServerUrl}${weComePrefix}", interceptor = WeCommonAccessTokenInterceptor.class)
@BaseRequest(baseURL = "${weComServerUrl}${weComePrefix}", interceptor = WeAccessTokenInterceptor.class)
@Retry(maxRetryCount = "3", maxRetryInterval = "1000", condition = WeCommonRetryWhen.class)
public interface WeUserClient {
......
......@@ -8,21 +8,56 @@ import java.util.List;
@Data
public class WeCustomerList {
//客户唯一id
private String externalUserid;
//首位添加人id
private String firstUserId;
//头像
private String avatar;
//客户名称
private String customerName;
//首位添加人姓名
//客户类型
private Integer customerType;
//查询标签id
private String tagIds;
//标签名称,使用逗号隔开
private String tagNames;
//跟进人名称
private String userName;
//客户id
private String externalUserid;
//跟进人id
private String firstUserId;
//跟踪状态
private Integer trackState;
//首位添加人时间
//添加方式
private Integer addMethod;
//添加时间
@JsonFormat(pattern = "yyyy-MM-dd")
private Date firstAddTime;
//标签名称,使用逗号隔开
private String tagNames;
//是否可以被继承 1:是;0:否
private Boolean isTransfer;
//0-未知 1-男性 2-女性
private Integer gender;
//所属部门
private String departmentName;
@JsonFormat(pattern = "yyyy-MM-dd")
private Date birthday;
......@@ -38,8 +73,7 @@ public class WeCustomerList {
private String beginTime;
//查询结束时间
private String endTime;
//查询标签id
private String tagIds;
//0正常;1:删除;
private Integer delFlag=new Integer(0);
......
......@@ -87,6 +87,7 @@ public class WeUser extends BaseEntity
@ApiModelProperty("用户所属部门")
private String department;
/** 职务 */
@ApiModelProperty("职务")
private String position;
......
......@@ -25,7 +25,7 @@ public interface WeCustomerMapper extends BaseMapper<WeCustomer>
/**
* 查询企业微信客户列表
*
*
* @param weCustomer 企业微信客户
* @return 企业微信客户集合
*/
......
......@@ -37,10 +37,10 @@ public interface IWeCustomerService extends IService<WeCustomer>
// */
// @Override
// public boolean saveOrUpdate(WeCustomer weCustomer);
//
/**
* 查询企业微信客户列表
*
*
* @param weCustomer 企业微信客户
* @return 企业微信客户集合
*/
......
......@@ -231,7 +231,7 @@ public class WeCustomerServiceImpl extends ServiceImpl<WeCustomerMapper, WeCusto
* @param weLeaveUserInfoAllocateVo
*/
@Override
@Transactional
@Transactional(rollbackFor = Exception.class)
public void allocateWeCustomer(WeLeaveUserInfoAllocateVo weLeaveUserInfoAllocateVo) {
//所需分配的客户
......
......@@ -75,6 +75,9 @@ public class WeTagGroupServiceImpl extends ServiceImpl<WeTagGroupMapper, WeTagGr
//个人标签同步,企业微信
if(weTagGroup.getGroupTagType().equals(new Integer(1))){
weTagGroup.setAddWeTags(
weTags
);
WeCropGropTagDtlDto weCropGropTagDtlDto = weCropTagClient.addCorpTag(WeCropGroupTagDto.transformAddTag(weTagGroup));
if (weCropGropTagDtlDto.getErrcode().equals(WeConstans.WE_SUCCESS_CODE)) {
this.batchSaveOrUpdateTagGroupAndTag(ListUtil.toList(weCropGropTagDtlDto.getTag_group()), false);
......
......@@ -268,20 +268,29 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="findWeCustomerList" resultType="com.linkwechat.wecom.domain.WeCustomerList">
SELECT
wc.external_userid,
wc.`name` as customerName,
wc.first_user_id,
wu.user_name,
wc.first_add_time,
GROUP_CONCAT(wt.`name`) as tagNames,
GROUP_CONCAT(wt.`tag_id`) as tagIds,
wc.birthday
wc.avatar,
wc.`name` as customerName,
wc.customer_type,
GROUP_CONCAT(wt.`tag_id`) as tagIds,
GROUP_CONCAT(wt.`name`) as tagNames,
wu.user_name,
wc.external_userid,
wc.first_user_id,
wc.track_state,
wc.add_method,
wc.first_add_time,
wc.birthday,
wc.gender,
(SELECT GROUP_CONCAT(wd.`name`) FROM we_department wd WHERE wd.id in (wu.department)) as departmentName
FROM
we_customer wc
LEFT JOIN we_user wu ON wc.first_user_id=wu.user_id
LEFT JOIN we_flower_customer_tag_rel wfctr ON wfctr.del_flag=0 AND wfctr.external_userid=wc.external_userid AND wfctr.user_id=wc.first_user_id
LEFT JOIN we_tag wt ON wt.tag_id=wfctr.tag_id
<where>
<if test="gender !=null">
wc.gender=#{gender}
</if>
<if test="delFlag != null">
wc.del_flag = #{delFlag}
</if>
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!