修改bug

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