Commit f41a0755 by fudahua

企业微信同步

parent cc483551
package com.gic.haoban.manage.api.dto;
import java.io.Serializable;
import java.util.Date;
/**
* Created By MBG-GUI-EXTENSION https://github.com/spawpaw/mybatis-generator-gui-extension
* Description:
* 企业微信标签
*
* @author fdh
*/
public class QywxTagInfoDTO implements Serializable {
/**
*
*/
private String qywxTagId;
/**
* 企业微信id
*/
private String wxEnterpriseId;
/**
* 企业微信对应的标签组id
*/
private String qywxGroupKey;
/**
* 标签组名称
*/
private String qywxGroupName;
/**
* 排序
*/
private Long order;
/**
* 0删除 1正常
*/
private Integer statusFlag;
/**
*
*/
private Date createTime;
/**
*
*/
private Date updateTime;
/**
*/
private static final long serialVersionUID = 1L;
/**
* This method returns the value of the database column tab_haoban_qywx_tag.qywx_tag_id
*
* @return the value of tab_haoban_qywx_tag.qywx_tag_id
*/
public String getQywxTagId() {
return qywxTagId;
}
/**
* This method sets the value of the database column tab_haoban_qywx_tag.qywx_tag_id
*
* @param qywxTagId the value for tab_haoban_qywx_tag.qywx_tag_id
*/
public void setQywxTagId(String qywxTagId) {
this.qywxTagId = qywxTagId;
}
/**
* This method returns the value of the database column tab_haoban_qywx_tag.wx_enterprise_id
*
* @return the value of tab_haoban_qywx_tag.wx_enterprise_id
*/
public String getWxEnterpriseId() {
return wxEnterpriseId;
}
/**
* This method sets the value of the database column tab_haoban_qywx_tag.wx_enterprise_id
*
* @param wxEnterpriseId the value for tab_haoban_qywx_tag.wx_enterprise_id
*/
public void setWxEnterpriseId(String wxEnterpriseId) {
this.wxEnterpriseId = wxEnterpriseId;
}
/**
* This method returns the value of the database column tab_haoban_qywx_tag.qywx_group_key
*
* @return the value of tab_haoban_qywx_tag.qywx_group_key
*/
public String getQywxGroupKey() {
return qywxGroupKey;
}
/**
* This method sets the value of the database column tab_haoban_qywx_tag.qywx_group_key
*
* @param qywxGroupKey the value for tab_haoban_qywx_tag.qywx_group_key
*/
public void setQywxGroupKey(String qywxGroupKey) {
this.qywxGroupKey = qywxGroupKey;
}
/**
* This method returns the value of the database column tab_haoban_qywx_tag.qywx_group_name
*
* @return the value of tab_haoban_qywx_tag.qywx_group_name
*/
public String getQywxGroupName() {
return qywxGroupName;
}
/**
* This method sets the value of the database column tab_haoban_qywx_tag.qywx_group_name
*
* @param qywxGroupName the value for tab_haoban_qywx_tag.qywx_group_name
*/
public void setQywxGroupName(String qywxGroupName) {
this.qywxGroupName = qywxGroupName;
}
/**
* This method returns the value of the database column tab_haoban_qywx_tag.order
*
* @return the value of tab_haoban_qywx_tag.order
*/
public Long getOrder() {
return order;
}
/**
* This method sets the value of the database column tab_haoban_qywx_tag.order
*
* @param order the value for tab_haoban_qywx_tag.order
*/
public void setOrder(Long order) {
this.order = order;
}
/**
* This method returns the value of the database column tab_haoban_qywx_tag.status_flag
*
* @return the value of tab_haoban_qywx_tag.status_flag
*/
public Integer getStatusFlag() {
return statusFlag;
}
/**
* This method sets the value of the database column tab_haoban_qywx_tag.status_flag
*
* @param statusFlag the value for tab_haoban_qywx_tag.status_flag
*/
public void setStatusFlag(Integer statusFlag) {
this.statusFlag = statusFlag;
}
/**
* This method returns the value of the database column tab_haoban_qywx_tag.create_time
*
* @return the value of tab_haoban_qywx_tag.create_time
*/
public Date getCreateTime() {
return createTime;
}
/**
* This method sets the value of the database column tab_haoban_qywx_tag.create_time
*
* @param createTime the value for tab_haoban_qywx_tag.create_time
*/
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
/**
* This method returns the value of the database column tab_haoban_qywx_tag.update_time
*
* @return the value of tab_haoban_qywx_tag.update_time
*/
public Date getUpdateTime() {
return updateTime;
}
/**
* This method sets the value of the database column tab_haoban_qywx_tag.update_time
*
* @param updateTime the value for tab_haoban_qywx_tag.update_time
*/
public void setUpdateTime(Date updateTime) {
this.updateTime = updateTime;
}
}
\ No newline at end of file
package com.gic.haoban.manage.api.dto;
import java.io.Serializable;
import java.util.Date;
/**
* Created By MBG-GUI-EXTENSION https://github.com/spawpaw/mybatis-generator-gui-extension
* Description:
* 企业微信标签项
*
* @author fdh
*/
public class QywxTagItemDTO implements Serializable {
/**
*
*/
private String qywxTagItemId;
/**
*
*/
private String wxEnterpriseId;
/**
* 关联的企业微信标签id
*/
private String qywxTagId;
/**
* 企业微信标签组对应的id
*/
private String qywxGroupKey;
/**
* 企业微信标签项对应的id
*/
private String qywxTagKey;
/**
* 名称
*/
private String qywxTagName;
/**
* 排序
*/
private Long order;
/**
* 状态
*/
private Integer statusFlag;
/**
*
*/
private Date createTime;
/**
*
*/
private Date updateTime;
/**
*/
private static final long serialVersionUID = 1L;
/**
* This method returns the value of the database column tab_haoban_qywx_tag_item.qywx_tag_item_id
*
* @return the value of tab_haoban_qywx_tag_item.qywx_tag_item_id
*/
public String getQywxTagItemId() {
return qywxTagItemId;
}
/**
* This method sets the value of the database column tab_haoban_qywx_tag_item.qywx_tag_item_id
*
* @param qywxTagItemId the value for tab_haoban_qywx_tag_item.qywx_tag_item_id
*/
public void setQywxTagItemId(String qywxTagItemId) {
this.qywxTagItemId = qywxTagItemId;
}
/**
* This method returns the value of the database column tab_haoban_qywx_tag_item.wx_enterprise_id
*
* @return the value of tab_haoban_qywx_tag_item.wx_enterprise_id
*/
public String getWxEnterpriseId() {
return wxEnterpriseId;
}
/**
* This method sets the value of the database column tab_haoban_qywx_tag_item.wx_enterprise_id
*
* @param wxEnterpriseId the value for tab_haoban_qywx_tag_item.wx_enterprise_id
*/
public void setWxEnterpriseId(String wxEnterpriseId) {
this.wxEnterpriseId = wxEnterpriseId;
}
/**
* This method returns the value of the database column tab_haoban_qywx_tag_item.qywx_tag_id
*
* @return the value of tab_haoban_qywx_tag_item.qywx_tag_id
*/
public String getQywxTagId() {
return qywxTagId;
}
/**
* This method sets the value of the database column tab_haoban_qywx_tag_item.qywx_tag_id
*
* @param qywxTagId the value for tab_haoban_qywx_tag_item.qywx_tag_id
*/
public void setQywxTagId(String qywxTagId) {
this.qywxTagId = qywxTagId;
}
/**
* This method returns the value of the database column tab_haoban_qywx_tag_item.qywx_group_key
*
* @return the value of tab_haoban_qywx_tag_item.qywx_group_key
*/
public String getQywxGroupKey() {
return qywxGroupKey;
}
/**
* This method sets the value of the database column tab_haoban_qywx_tag_item.qywx_group_key
*
* @param qywxGroupKey the value for tab_haoban_qywx_tag_item.qywx_group_key
*/
public void setQywxGroupKey(String qywxGroupKey) {
this.qywxGroupKey = qywxGroupKey;
}
/**
* This method returns the value of the database column tab_haoban_qywx_tag_item.qywx_tag_key
*
* @return the value of tab_haoban_qywx_tag_item.qywx_tag_key
*/
public String getQywxTagKey() {
return qywxTagKey;
}
/**
* This method sets the value of the database column tab_haoban_qywx_tag_item.qywx_tag_key
*
* @param qywxTagKey the value for tab_haoban_qywx_tag_item.qywx_tag_key
*/
public void setQywxTagKey(String qywxTagKey) {
this.qywxTagKey = qywxTagKey;
}
/**
* This method returns the value of the database column tab_haoban_qywx_tag_item.qywx_tag_name
*
* @return the value of tab_haoban_qywx_tag_item.qywx_tag_name
*/
public String getQywxTagName() {
return qywxTagName;
}
/**
* This method sets the value of the database column tab_haoban_qywx_tag_item.qywx_tag_name
*
* @param qywxTagName the value for tab_haoban_qywx_tag_item.qywx_tag_name
*/
public void setQywxTagName(String qywxTagName) {
this.qywxTagName = qywxTagName;
}
/**
* This method returns the value of the database column tab_haoban_qywx_tag_item.order
*
* @return the value of tab_haoban_qywx_tag_item.order
*/
public Long getOrder() {
return order;
}
/**
* This method sets the value of the database column tab_haoban_qywx_tag_item.order
*
* @param order the value for tab_haoban_qywx_tag_item.order
*/
public void setOrder(Long order) {
this.order = order;
}
/**
* This method returns the value of the database column tab_haoban_qywx_tag_item.status_flag
*
* @return the value of tab_haoban_qywx_tag_item.status_flag
*/
public Integer getStatusFlag() {
return statusFlag;
}
/**
* This method sets the value of the database column tab_haoban_qywx_tag_item.status_flag
*
* @param statusFlag the value for tab_haoban_qywx_tag_item.status_flag
*/
public void setStatusFlag(Integer statusFlag) {
this.statusFlag = statusFlag;
}
/**
* This method returns the value of the database column tab_haoban_qywx_tag_item.create_time
*
* @return the value of tab_haoban_qywx_tag_item.create_time
*/
public Date getCreateTime() {
return createTime;
}
/**
* This method sets the value of the database column tab_haoban_qywx_tag_item.create_time
*
* @param createTime the value for tab_haoban_qywx_tag_item.create_time
*/
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
/**
* This method returns the value of the database column tab_haoban_qywx_tag_item.update_time
*
* @return the value of tab_haoban_qywx_tag_item.update_time
*/
public Date getUpdateTime() {
return updateTime;
}
/**
* This method sets the value of the database column tab_haoban_qywx_tag_item.update_time
*
* @param updateTime the value for tab_haoban_qywx_tag_item.update_time
*/
public void setUpdateTime(Date updateTime) {
this.updateTime = updateTime;
}
}
\ No newline at end of file
package com.gic.haoban.manage.api.dto;
import java.io.Serializable;
import java.util.Date;
/**
* Created By MBG-GUI-EXTENSION https://github.com/spawpaw/mybatis-generator-gui-extension
* Description:
*
* @author fdh
*/
public class QywxTagRelationDTO implements Serializable {
/**
*
*/
private String qywxTagRelationId;
/**
*
*/
private String wxEnterpriseId;
/**
*
*/
private String enterpriseId;
/**
* 标签id
*/
private String memberTagId;
/**
* 导购标签项id
*/
private String tagItemId;
/**
* 0 标签 1标签项
*/
private Integer relationType;
/**
* 同步状态 0 不同步 1同步
*/
private Integer syncFlag;
/**
* 排序
*/
private Long order;
/**
* 企业微信标签id
*/
private String qywxTagId;
/**
* 企业微信标签项id
*/
private String qywxTagItemId;
/**
* 0删除 1正常
*/
private Integer statusFlag;
/**
*
*/
private Date createTime;
/**
*
*/
private Date updateTime;
/**
*/
private static final long serialVersionUID = 1L;
/**
* This method returns the value of the database column tab_haoban_qywx_tag_relation.qywx_tag_relation_id
*
* @return the value of tab_haoban_qywx_tag_relation.qywx_tag_relation_id
*/
public String getQywxTagRelationId() {
return qywxTagRelationId;
}
/**
* This method sets the value of the database column tab_haoban_qywx_tag_relation.qywx_tag_relation_id
*
* @param qywxTagRelationId the value for tab_haoban_qywx_tag_relation.qywx_tag_relation_id
*/
public void setQywxTagRelationId(String qywxTagRelationId) {
this.qywxTagRelationId = qywxTagRelationId;
}
/**
* This method returns the value of the database column tab_haoban_qywx_tag_relation.wx_enterprise_id
*
* @return the value of tab_haoban_qywx_tag_relation.wx_enterprise_id
*/
public String getWxEnterpriseId() {
return wxEnterpriseId;
}
/**
* This method sets the value of the database column tab_haoban_qywx_tag_relation.wx_enterprise_id
*
* @param wxEnterpriseId the value for tab_haoban_qywx_tag_relation.wx_enterprise_id
*/
public void setWxEnterpriseId(String wxEnterpriseId) {
this.wxEnterpriseId = wxEnterpriseId;
}
/**
* This method returns the value of the database column tab_haoban_qywx_tag_relation.enterprise_id
*
* @return the value of tab_haoban_qywx_tag_relation.enterprise_id
*/
public String getEnterpriseId() {
return enterpriseId;
}
/**
* This method sets the value of the database column tab_haoban_qywx_tag_relation.enterprise_id
*
* @param enterpriseId the value for tab_haoban_qywx_tag_relation.enterprise_id
*/
public void setEnterpriseId(String enterpriseId) {
this.enterpriseId = enterpriseId;
}
/**
* This method returns the value of the database column tab_haoban_qywx_tag_relation.member_tag_id
*
* @return the value of tab_haoban_qywx_tag_relation.member_tag_id
*/
public String getMemberTagId() {
return memberTagId;
}
/**
* This method sets the value of the database column tab_haoban_qywx_tag_relation.member_tag_id
*
* @param memberTagId the value for tab_haoban_qywx_tag_relation.member_tag_id
*/
public void setMemberTagId(String memberTagId) {
this.memberTagId = memberTagId;
}
/**
* This method returns the value of the database column tab_haoban_qywx_tag_relation.tag_item_id
*
* @return the value of tab_haoban_qywx_tag_relation.tag_item_id
*/
public String getTagItemId() {
return tagItemId;
}
/**
* This method sets the value of the database column tab_haoban_qywx_tag_relation.tag_item_id
*
* @param tagItemId the value for tab_haoban_qywx_tag_relation.tag_item_id
*/
public void setTagItemId(String tagItemId) {
this.tagItemId = tagItemId;
}
/**
* This method returns the value of the database column tab_haoban_qywx_tag_relation.relation_type
*
* @return the value of tab_haoban_qywx_tag_relation.relation_type
*/
public Integer getRelationType() {
return relationType;
}
/**
* This method sets the value of the database column tab_haoban_qywx_tag_relation.relation_type
*
* @param relationType the value for tab_haoban_qywx_tag_relation.relation_type
*/
public void setRelationType(Integer relationType) {
this.relationType = relationType;
}
/**
* This method returns the value of the database column tab_haoban_qywx_tag_relation.sync_flag
*
* @return the value of tab_haoban_qywx_tag_relation.sync_flag
*/
public Integer getSyncFlag() {
return syncFlag;
}
/**
* This method sets the value of the database column tab_haoban_qywx_tag_relation.sync_flag
*
* @param syncFlag the value for tab_haoban_qywx_tag_relation.sync_flag
*/
public void setSyncFlag(Integer syncFlag) {
this.syncFlag = syncFlag;
}
/**
* This method returns the value of the database column tab_haoban_qywx_tag_relation.order
*
* @return the value of tab_haoban_qywx_tag_relation.order
*/
public Long getOrder() {
return order;
}
/**
* This method sets the value of the database column tab_haoban_qywx_tag_relation.order
*
* @param order the value for tab_haoban_qywx_tag_relation.order
*/
public void setOrder(Long order) {
this.order = order;
}
/**
* This method returns the value of the database column tab_haoban_qywx_tag_relation.qywx_tag_id
*
* @return the value of tab_haoban_qywx_tag_relation.qywx_tag_id
*/
public String getQywxTagId() {
return qywxTagId;
}
/**
* This method sets the value of the database column tab_haoban_qywx_tag_relation.qywx_tag_id
*
* @param qywxTagId the value for tab_haoban_qywx_tag_relation.qywx_tag_id
*/
public void setQywxTagId(String qywxTagId) {
this.qywxTagId = qywxTagId;
}
/**
* This method returns the value of the database column tab_haoban_qywx_tag_relation.qywx_tag_item_id
*
* @return the value of tab_haoban_qywx_tag_relation.qywx_tag_item_id
*/
public String getQywxTagItemId() {
return qywxTagItemId;
}
/**
* This method sets the value of the database column tab_haoban_qywx_tag_relation.qywx_tag_item_id
*
* @param qywxTagItemId the value for tab_haoban_qywx_tag_relation.qywx_tag_item_id
*/
public void setQywxTagItemId(String qywxTagItemId) {
this.qywxTagItemId = qywxTagItemId;
}
/**
* This method returns the value of the database column tab_haoban_qywx_tag_relation.status_flag
*
* @return the value of tab_haoban_qywx_tag_relation.status_flag
*/
public Integer getStatusFlag() {
return statusFlag;
}
/**
* This method sets the value of the database column tab_haoban_qywx_tag_relation.status_flag
*
* @param statusFlag the value for tab_haoban_qywx_tag_relation.status_flag
*/
public void setStatusFlag(Integer statusFlag) {
this.statusFlag = statusFlag;
}
/**
* This method returns the value of the database column tab_haoban_qywx_tag_relation.create_time
*
* @return the value of tab_haoban_qywx_tag_relation.create_time
*/
public Date getCreateTime() {
return createTime;
}
/**
* This method sets the value of the database column tab_haoban_qywx_tag_relation.create_time
*
* @param createTime the value for tab_haoban_qywx_tag_relation.create_time
*/
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
/**
* This method returns the value of the database column tab_haoban_qywx_tag_relation.update_time
*
* @return the value of tab_haoban_qywx_tag_relation.update_time
*/
public Date getUpdateTime() {
return updateTime;
}
/**
* This method sets the value of the database column tab_haoban_qywx_tag_relation.update_time
*
* @param updateTime the value for tab_haoban_qywx_tag_relation.update_time
*/
public void setUpdateTime(Date updateTime) {
this.updateTime = updateTime;
}
}
\ No newline at end of file
package com.gic.haoban.manage.api.enums;
/**
* Created by hua on 2021/6/21.
*/
public enum QywxTagRelationTypeEnum {
TAG_GROUP(0, "标签组"),
TAG_ITEM(1, "标签项");
private int type;
private String name;
QywxTagRelationTypeEnum(int type, String name) {
this.type = type;
this.name = name;
}
public int getType() {
return type;
}
public void setType(int type) {
this.type = type;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
}
package com.gic.haoban.manage.api.service;
import com.gic.haoban.manage.api.dto.QywxTagInfoDTO;
import com.gic.haoban.manage.api.dto.QywxTagItemDTO;
import com.gic.haoban.manage.api.dto.QywxTagRelationDTO;
import java.util.List;
/**
* Created 2021/6/21.
*
* @author hua
*/
public interface QywxTagApiService {
/**
* 拉取企业微信标签
*
* @param wxEnterpriseId
*/
public void pullQywxTag(String wxEnterpriseId);
/**
* 同步会员导购标签到qywx
*
* @param infoDTO 标签
* @param items 标签项
*/
public void syncTagToQywx(String wxEnterpriseId, String enterpriseId, QywxTagInfoDTO infoDTO, List<QywxTagItemDTO> items);
/**
* 关闭同步
*
* @param wxEnterpriseId
* @param tagRelationId
*/
public void closeSync(String wxEnterpriseId, String tagRelationId);
/**
* 查询所有同步的标签
*
* @param wxEnterpriseId
* @return
*/
public List<QywxTagRelationDTO> listAllByWxEnterpriseId(String wxEnterpriseId);
}
...@@ -2,6 +2,9 @@ package com.gic.haoban.manage.service.dao.mapper; ...@@ -2,6 +2,9 @@ package com.gic.haoban.manage.service.dao.mapper;
import com.gic.haoban.manage.service.entity.TabQywxTagItem; import com.gic.haoban.manage.service.entity.TabQywxTagItem;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
@Mapper @Mapper
public interface QywxTagItemMapper { public interface QywxTagItemMapper {
...@@ -28,4 +31,31 @@ public interface QywxTagItemMapper { ...@@ -28,4 +31,31 @@ public interface QywxTagItemMapper {
/** /**
*/ */
int updateByPrimaryKey(TabQywxTagItem record); int updateByPrimaryKey(TabQywxTagItem record);
/**
* 根据id 获取标签项信息
*
* @param wxEnterpriseId
* @param qywxTagId
* @return
*/
List<TabQywxTagItem> listByQywxTagId(@Param("wxEnterpriseId") String wxEnterpriseId, @Param("qywxTagId") String qywxTagId);
/**
* 根据企业微信标签组key 获取标签项信息
*
* @param wxEnterpriseId
* @param qywxTagGroupKey
* @return
*/
List<TabQywxTagItem> listByQywxTagGroupKey(@Param("wxEnterpriseId") String wxEnterpriseId, @Param("qywxTagGroupKey") String qywxTagGroupKey);
/**
* 根据企业微信标签组key 获取标签项信息
*
* @param wxEnterpriseId
* @param qywxTagGroupKey
* @return
*/
int delByQywxTagGroupKey(@Param("wxEnterpriseId") String wxEnterpriseId, @Param("qywxTagGroupKey") String qywxTagGroupKey);
} }
\ No newline at end of file
...@@ -2,6 +2,9 @@ package com.gic.haoban.manage.service.dao.mapper; ...@@ -2,6 +2,9 @@ package com.gic.haoban.manage.service.dao.mapper;
import com.gic.haoban.manage.service.entity.TabQywxTag; import com.gic.haoban.manage.service.entity.TabQywxTag;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
@Mapper @Mapper
public interface QywxTagMapper { public interface QywxTagMapper {
...@@ -28,4 +31,22 @@ public interface QywxTagMapper { ...@@ -28,4 +31,22 @@ public interface QywxTagMapper {
/** /**
*/ */
int updateByPrimaryKey(TabQywxTag record); int updateByPrimaryKey(TabQywxTag record);
/**
* 查询企业微信的标签组 根据key
*
* @param wxEnterpriseId
* @param qywxTagGroupKey
* @return
*/
TabQywxTag getByQywxGroupKey(@Param("wxEnterpriseId") String wxEnterpriseId, @Param("qywxTagGroupKey") String qywxTagGroupKey);
/**
* 删除企业微信标签
*
* @param wxEnterpriseId
* @param qywxTagGroupKey
* @return
*/
int delByGroupKey(@Param("wxEnterpriseId") String wxEnterpriseId, @Param("qywxTagGroupKey") String qywxTagGroupKey);
} }
\ No newline at end of file
...@@ -2,6 +2,9 @@ package com.gic.haoban.manage.service.dao.mapper; ...@@ -2,6 +2,9 @@ package com.gic.haoban.manage.service.dao.mapper;
import com.gic.haoban.manage.service.entity.TabQywxTagRelation; import com.gic.haoban.manage.service.entity.TabQywxTagRelation;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
@Mapper @Mapper
public interface QywxTagRelationMapper { public interface QywxTagRelationMapper {
...@@ -28,4 +31,30 @@ public interface QywxTagRelationMapper { ...@@ -28,4 +31,30 @@ public interface QywxTagRelationMapper {
/** /**
*/ */
int updateByPrimaryKey(TabQywxTagRelation record); int updateByPrimaryKey(TabQywxTagRelation record);
/**
* 查询企业下所有同步的
*
* @param wxEnterpriseId
* @return
*/
List<TabQywxTagRelation> listBySyncStatus(String wxEnterpriseId);
/**
* 查询企业下所有同步的
*
* @param wxEnterpriseId
* @param memberTagId
* @return
*/
List<TabQywxTagRelation> listByTagId(@Param("wxEnterpriseId") String wxEnterpriseId, @Param("memberTagId") String memberTagId);
/**
* 删除同步信息
*
* @param wxEnterpriseId
* @param memberTagId
* @return
*/
int delByMemberTagId(@Param("wxEnterpriseId") String wxEnterpriseId, @Param("memberTagId") String memberTagId);
} }
\ No newline at end of file
...@@ -7,7 +7,6 @@ import java.util.Date; ...@@ -7,7 +7,6 @@ import java.util.Date;
* Created By MBG-GUI-EXTENSION https://github.com/spawpaw/mybatis-generator-gui-extension * Created By MBG-GUI-EXTENSION https://github.com/spawpaw/mybatis-generator-gui-extension
* Description: * Description:
* 企业微信标签 * 企业微信标签
*
* @author fdh * @author fdh
*/ */
public class TabQywxTag implements Serializable { public class TabQywxTag implements Serializable {
...@@ -17,27 +16,32 @@ public class TabQywxTag implements Serializable { ...@@ -17,27 +16,32 @@ public class TabQywxTag implements Serializable {
private String qywxTagId; private String qywxTagId;
/** /**
* 企业微信id * 企业微信id
*
*/ */
private String wxEnterpriseId; private String wxEnterpriseId;
/** /**
* 企业微信对应的标签组id * 企业微信对应的标签组id
*
*/ */
private String qywxGroupKey; private String qywxGroupKey;
/** /**
* 标签组名称 * 标签组名称
*
*/ */
private String qywxGroupName; private String qywxGroupName;
/** /**
* 排序 * 排序
*
*/ */
private Long order; private Long order;
/** /**
* 0删除 1正常 * 0删除 1正常
*
*/ */
private Integer statusFlag; private Integer statusFlag;
......
...@@ -7,7 +7,6 @@ import java.util.Date; ...@@ -7,7 +7,6 @@ import java.util.Date;
* Created By MBG-GUI-EXTENSION https://github.com/spawpaw/mybatis-generator-gui-extension * Created By MBG-GUI-EXTENSION https://github.com/spawpaw/mybatis-generator-gui-extension
* Description: * Description:
* 企业微信标签项 * 企业微信标签项
*
* @author fdh * @author fdh
*/ */
public class TabQywxTagItem implements Serializable { public class TabQywxTagItem implements Serializable {
...@@ -22,27 +21,37 @@ public class TabQywxTagItem implements Serializable { ...@@ -22,27 +21,37 @@ public class TabQywxTagItem implements Serializable {
private String wxEnterpriseId; private String wxEnterpriseId;
/** /**
* 企业微信标签组对应的id * 关联的企业微信标签id
*/
private String qywxTagId;
/**
* 企业微信标签组对应的id
*
*/ */
private String qywxGroupKey; private String qywxGroupKey;
/** /**
* 企业微信标签项对应的id * 企业微信标签项对应的id
*
*/ */
private String qywxTagKey; private String qywxTagKey;
/** /**
* 名称 * 名称
*
*/ */
private String qywxTagName; private String qywxTagName;
/** /**
* 排序 * 排序
*
*/ */
private Long order; private Long order;
/** /**
* 状态 * 状态
*
*/ */
private Integer statusFlag; private Integer statusFlag;
...@@ -97,6 +106,24 @@ public class TabQywxTagItem implements Serializable { ...@@ -97,6 +106,24 @@ public class TabQywxTagItem implements Serializable {
} }
/** /**
* This method returns the value of the database column tab_haoban_qywx_tag_item.qywx_tag_id
*
* @return the value of tab_haoban_qywx_tag_item.qywx_tag_id
*/
public String getQywxTagId() {
return qywxTagId;
}
/**
* This method sets the value of the database column tab_haoban_qywx_tag_item.qywx_tag_id
*
* @param qywxTagId the value for tab_haoban_qywx_tag_item.qywx_tag_id
*/
public void setQywxTagId(String qywxTagId) {
this.qywxTagId = qywxTagId;
}
/**
* This method returns the value of the database column tab_haoban_qywx_tag_item.qywx_group_key * This method returns the value of the database column tab_haoban_qywx_tag_item.qywx_group_key
* *
* @return the value of tab_haoban_qywx_tag_item.qywx_group_key * @return the value of tab_haoban_qywx_tag_item.qywx_group_key
......
...@@ -6,7 +6,7 @@ import java.util.Date; ...@@ -6,7 +6,7 @@ import java.util.Date;
/** /**
* Created By MBG-GUI-EXTENSION https://github.com/spawpaw/mybatis-generator-gui-extension * Created By MBG-GUI-EXTENSION https://github.com/spawpaw/mybatis-generator-gui-extension
* Description: * Description:
* *
* @author fdh * @author fdh
*/ */
public class TabQywxTagRelation implements Serializable { public class TabQywxTagRelation implements Serializable {
...@@ -26,27 +26,48 @@ public class TabQywxTagRelation implements Serializable { ...@@ -26,27 +26,48 @@ public class TabQywxTagRelation implements Serializable {
private String enterpriseId; private String enterpriseId;
/** /**
* 标签id * 标签id
*
*/ */
private String memberTagId; private String memberTagId;
/** /**
* 同步状态 0 不同步 1同步 * 导购标签项id
*/
private String tagItemId;
/**
* 0 标签 1标签项
*/
private Integer relationType;
/**
* 同步状态 0 不同步 1同步
*
*/ */
private Integer syncFlag; private Integer syncFlag;
/** /**
* 排序 * 排序
*
*/ */
private Long order; private Long order;
/** /**
* 企业微信标签id * 企业微信标签id
*
*/ */
private String qywxTagId; private String qywxTagId;
/** /**
* 0删除 1正常 * 企业微信标签项id
*
*/
private String qywxTagItemId;
/**
* 0删除 1正常
*
*/ */
private Integer statusFlag; private Integer statusFlag;
...@@ -137,6 +158,42 @@ public class TabQywxTagRelation implements Serializable { ...@@ -137,6 +158,42 @@ public class TabQywxTagRelation implements Serializable {
} }
/** /**
* This method returns the value of the database column tab_haoban_qywx_tag_relation.tag_item_id
*
* @return the value of tab_haoban_qywx_tag_relation.tag_item_id
*/
public String getTagItemId() {
return tagItemId;
}
/**
* This method sets the value of the database column tab_haoban_qywx_tag_relation.tag_item_id
*
* @param tagItemId the value for tab_haoban_qywx_tag_relation.tag_item_id
*/
public void setTagItemId(String tagItemId) {
this.tagItemId = tagItemId;
}
/**
* This method returns the value of the database column tab_haoban_qywx_tag_relation.relation_type
*
* @return the value of tab_haoban_qywx_tag_relation.relation_type
*/
public Integer getRelationType() {
return relationType;
}
/**
* This method sets the value of the database column tab_haoban_qywx_tag_relation.relation_type
*
* @param relationType the value for tab_haoban_qywx_tag_relation.relation_type
*/
public void setRelationType(Integer relationType) {
this.relationType = relationType;
}
/**
* This method returns the value of the database column tab_haoban_qywx_tag_relation.sync_flag * This method returns the value of the database column tab_haoban_qywx_tag_relation.sync_flag
* *
* @return the value of tab_haoban_qywx_tag_relation.sync_flag * @return the value of tab_haoban_qywx_tag_relation.sync_flag
...@@ -191,6 +248,24 @@ public class TabQywxTagRelation implements Serializable { ...@@ -191,6 +248,24 @@ public class TabQywxTagRelation implements Serializable {
} }
/** /**
* This method returns the value of the database column tab_haoban_qywx_tag_relation.qywx_tag_item_id
*
* @return the value of tab_haoban_qywx_tag_relation.qywx_tag_item_id
*/
public String getQywxTagItemId() {
return qywxTagItemId;
}
/**
* This method sets the value of the database column tab_haoban_qywx_tag_relation.qywx_tag_item_id
*
* @param qywxTagItemId the value for tab_haoban_qywx_tag_relation.qywx_tag_item_id
*/
public void setQywxTagItemId(String qywxTagItemId) {
this.qywxTagItemId = qywxTagItemId;
}
/**
* This method returns the value of the database column tab_haoban_qywx_tag_relation.status_flag * This method returns the value of the database column tab_haoban_qywx_tag_relation.status_flag
* *
* @return the value of tab_haoban_qywx_tag_relation.status_flag * @return the value of tab_haoban_qywx_tag_relation.status_flag
......
package com.gic.haoban.manage.service.service;
import com.gic.haoban.manage.api.dto.QywxTagInfoDTO;
import com.gic.haoban.manage.api.dto.QywxTagItemDTO;
import com.gic.haoban.manage.api.dto.QywxTagRelationDTO;
import com.gic.haoban.manage.service.entity.TabQywxTag;
import com.gic.haoban.manage.service.entity.TabQywxTagItem;
import com.gic.haoban.manage.service.entity.TabQywxTagRelation;
import com.gic.wechat.api.dto.qywx.QywxTagGroupDTO;
import java.util.List;
/**
* Created 2021/6/21.
*
* @author hua
*/
public interface QywxTagService {
/**
* 根据标签组key 查询详情
*
* @param wxEnterpriseId
* @param groupKey
* @return
*/
public TabQywxTag getQywxTagByQywxGroupKey(String wxEnterpriseId, String groupKey);
/**
* 根据id 查询列表
*
* @param wxEnterpriseId
* @param qywxTagId
* @return
*/
public List<TabQywxTagItem> listByQywxTagId(String wxEnterpriseId, String qywxTagId);
/**
* 查询所有同步的企业微信标签
*
* @param wxEnterpriseId
* @return
*/
public List<TabQywxTagRelation> listAllQywxRelation(String wxEnterpriseId);
/**
* 保存企业微信的标签
*
* @param wxEnterpriseId
* @param groupDTO
* @return
*/
public void saveQywxTagByQywxGroupKey(String wxEnterpriseId, QywxTagGroupDTO groupDTO);
/**
* 保存企业微信的标签
*
* @param wxEnterpriseId
* @return
*/
public void saveQywxTagByQywxGroupKey(String wxEnterpriseId, QywxTagInfoDTO infoDTO, List<QywxTagItemDTO> items);
/**
* @param wxEnterpriseId
* @param tagId
* @return
*/
public boolean sync(String wxEnterpriseId, String tagId);
/**
* 关闭同步
*
* @param wxEnterpriseId
* @param memberTagId
* @return
*/
public boolean closeSync(String wxEnterpriseId, String memberTagId);
/**
* 保存标签
*
* @param list
* @return
*/
public boolean saveQywxRelation(List<TabQywxTagRelation> list);
/**
* 根据id 查询
*
* @param relationId
* @return
*/
public TabQywxTagRelation getQywxTagRelationById(String relationId);
/**
* 根据id 查询
*
* @param memberTagId
* @return
*/
public TabQywxTagRelation getQywxTagRelationByMemberTagId(String memberTagId);
/**
* 删除企业微信的标签
*
* @param groupKey
* @param wxEnterpriseId
* @return
*/
public boolean delQywxTag(String groupKey, String wxEnterpriseId);
}
package com.gic.haoban.manage.service.service.impl;
import com.gic.commons.util.ToolUtil;
import com.gic.haoban.manage.api.dto.QywxTagInfoDTO;
import com.gic.haoban.manage.api.dto.QywxTagItemDTO;
import com.gic.haoban.manage.service.dao.mapper.QywxTagItemMapper;
import com.gic.haoban.manage.service.dao.mapper.QywxTagMapper;
import com.gic.haoban.manage.service.dao.mapper.QywxTagRelationMapper;
import com.gic.haoban.manage.service.entity.TabQywxTag;
import com.gic.haoban.manage.service.entity.TabQywxTagItem;
import com.gic.haoban.manage.service.entity.TabQywxTagRelation;
import com.gic.haoban.manage.service.service.QywxTagService;
import com.gic.wechat.api.dto.qywx.QywxTagDTO;
import com.gic.wechat.api.dto.qywx.QywxTagGroupDTO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
import java.util.*;
import java.util.stream.Collectors;
/**
* Created 2021/6/21.
*
* @author hua
*/
@Service
public class QywxTagServiceImpl implements QywxTagService {
@Autowired
private QywxTagMapper qywxTagMapper;
@Autowired
private QywxTagItemMapper qywxTagItemMapper;
@Autowired
private QywxTagRelationMapper qywxTagRelationMapper;
@Override
public TabQywxTag getQywxTagByQywxGroupKey(String wxEnterpriseId, String groupKey) {
return qywxTagMapper.getByQywxGroupKey(wxEnterpriseId, groupKey);
}
@Override
public List<TabQywxTagItem> listByQywxTagId(String wxEnterpriseId, String qywxTagId) {
return qywxTagItemMapper.listByQywxTagId(wxEnterpriseId, qywxTagId);
}
@Override
public List<TabQywxTagRelation> listAllQywxRelation(String wxEnterpriseId) {
return qywxTagRelationMapper.listBySyncStatus(wxEnterpriseId);
}
@Override
public void saveQywxTagByQywxGroupKey(String wxEnterpriseId, QywxTagGroupDTO groupDTO) {
//判断保存 分组
TabQywxTag qywxTag = this.getQywxTagByQywxGroupKey(wxEnterpriseId, groupDTO.getGroupId());
if (null == qywxTag) {
qywxTag = new TabQywxTag();
qywxTag.setOrder(groupDTO.getOrder());
qywxTag.setCreateTime(new Date());
qywxTag.setUpdateTime(new Date());
qywxTag.setQywxGroupKey(groupDTO.getGroupId());
qywxTag.setQywxGroupName(groupDTO.getGroupName());
qywxTag.setQywxTagId(ToolUtil.randomUUID());
qywxTag.setStatusFlag(1);
qywxTag.setWxEnterpriseId(wxEnterpriseId);
qywxTagMapper.insert(qywxTag);
} else {
qywxTag.setQywxGroupName(groupDTO.getGroupName());
qywxTag.setOrder(groupDTO.getOrder());
qywxTag.setUpdateTime(new Date());
qywxTagMapper.updateByPrimaryKeySelective(qywxTag);
}
List<QywxTagDTO> dtos = groupDTO.getTag();
if (CollectionUtils.isEmpty(dtos)) {
return;
}
Map<String, TabQywxTagItem> itemMap = new HashMap<>();
List<TabQywxTagItem> orgItems = this.listByQywxTagId(wxEnterpriseId, qywxTag.getQywxTagId());
if (!CollectionUtils.isEmpty(orgItems)) {
itemMap = orgItems.stream().collect(Collectors.toMap(tab -> tab.getQywxTagKey(), dto -> dto));
}
List<TabQywxTagItem> items = new ArrayList<>();
//判断保存标签项
for (QywxTagDTO tagItem : dtos) {
TabQywxTagItem qywxTagItem = itemMap.get(tagItem.getId());
if (qywxTagItem == null) {
qywxTagItem = new TabQywxTagItem();
qywxTagItem.setQywxGroupKey(qywxTag.getQywxGroupKey());
qywxTagItem.setCreateTime(new Date());
qywxTagItem.setOrder(tagItem.getOrder());
qywxTagItem.setQywxTagId(qywxTag.getQywxTagId());
qywxTagItem.setQywxTagItemId(ToolUtil.randomUUID());
qywxTagItem.setQywxTagKey(tagItem.getId());
qywxTagItem.setQywxTagName(tagItem.getName());
qywxTagItem.setStatusFlag(1);
qywxTagItem.setUpdateTime(new Date());
qywxTagItem.setWxEnterpriseId(wxEnterpriseId);
qywxTagItemMapper.insert(qywxTagItem);
} else {
qywxTagItem.setQywxTagName(tagItem.getName());
qywxTagItem.setOrder(tagItem.getOrder());
qywxTagItem.setUpdateTime(new Date());
qywxTagItemMapper.updateByPrimaryKeySelective(qywxTagItem);
}
items.add(qywxTagItem);
}
}
@Override
public void saveQywxTagByQywxGroupKey(String wxEnterpriseId, QywxTagInfoDTO infoDTO, List<QywxTagItemDTO> items) {
infoDTO.setQywxTagId(ToolUtil.randomUUID());
infoDTO.setCreateTime(new Date());
infoDTO.setStatusFlag(1);
infoDTO.setWxEnterpriseId(wxEnterpriseId);
infoDTO.setUpdateTime(new Date());
infoDTO.setStatusFlag(1);
}
@Override
public boolean sync(String wxEnterpriseId, String tagId) {
return false;
}
@Override
public boolean closeSync(String wxEnterpriseId, String memberTagId) {
qywxTagRelationMapper.delByMemberTagId(wxEnterpriseId, memberTagId);
return true;
}
@Override
public boolean saveQywxRelation(List<TabQywxTagRelation> list) {
list.forEach(dto -> {
dto.setCreateTime(new Date());
dto.setUpdateTime(new Date());
qywxTagRelationMapper.insert(dto);
});
return true;
}
@Override
public TabQywxTagRelation getQywxTagRelationById(String relationId) {
return qywxTagRelationMapper.selectByPrimaryKey(relationId);
}
@Override
public boolean delQywxTag(String groupKey, String wxEnterpriseId) {
qywxTagMapper.delByGroupKey(wxEnterpriseId, groupKey);
qywxTagItemMapper.delByQywxTagGroupKey(wxEnterpriseId, groupKey);
return true;
}
@Override
public TabQywxTagRelation getQywxTagRelationByMemberTagId(String memberTagId) {
return null;
}
}
package com.gic.haoban.manage.service.service.out.impl;
import com.alibaba.fastjson.JSONObject;
import com.gic.commons.util.ToolUtil;
import com.gic.haoban.common.utils.EntityUtil;
import com.gic.haoban.manage.api.dto.QywxTagInfoDTO;
import com.gic.haoban.manage.api.dto.QywxTagItemDTO;
import com.gic.haoban.manage.api.dto.QywxTagRelationDTO;
import com.gic.haoban.manage.api.dto.WxEnterpriseDTO;
import com.gic.haoban.manage.api.enums.QywxTagRelationTypeEnum;
import com.gic.haoban.manage.api.service.QywxTagApiService;
import com.gic.haoban.manage.service.config.Config;
import com.gic.haoban.manage.service.entity.TabQywxTag;
import com.gic.haoban.manage.service.entity.TabQywxTagItem;
import com.gic.haoban.manage.service.entity.TabQywxTagRelation;
import com.gic.haoban.manage.service.service.QywxTagService;
import com.gic.haoban.manage.service.service.WxEnterpriseService;
import com.gic.wechat.api.dto.qywx.QywxTagDTO;
import com.gic.wechat.api.dto.qywx.QywxTagGroupDTO;
import com.gic.wechat.api.dto.qywx.response.QywxGetCorpTagListDTO;
import com.gic.wechat.api.dto.qywx.response.QywxResponseDTO;
import com.gic.wechat.api.service.qywx.QywxSuiteApiService;
import com.gic.wechat.api.service.qywx.QywxUserApiService;
import org.slf4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
import java.util.ArrayList;
import java.util.List;
import java.util.stream.Collectors;
import static org.slf4j.LoggerFactory.getLogger;
/**
* Created 2021/6/21.
*
* @author hua
*/
@Service
public class QywxTagApiServiceImpl implements QywxTagApiService {
private static final Logger logger = getLogger(QywxTagApiServiceImpl.class);
@Autowired
private QywxUserApiService qywxUserApiService;
@Autowired
private QywxSuiteApiService qywxSuiteApiService;
@Autowired
private Config config;
@Autowired
private WxEnterpriseService wxEnterpriseService;
@Autowired
private QywxTagService qywxTagService;
@Override
public void pullQywxTag(String wxEnterpriseId) {
WxEnterpriseDTO wxEnterpriseDTO = wxEnterpriseService.selectById(wxEnterpriseId);
if (null == wxEnterpriseDTO) {
logger.info("企业标签所在企业不存在");
return;
}
QywxGetCorpTagListDTO corpTagListResp = qywxSuiteApiService.getCorpTagList(wxEnterpriseDTO.getCorpid(), config.getWxSuiteid(), null, -1);
if (corpTagListResp.getErrorcode() != 0) {
logger.info("企业微信标签有问题:{}", wxEnterpriseId);
return;
}
//拉取保存所有标签
List<QywxTagGroupDTO> tagGroup = corpTagListResp.getTagGroup();
for (QywxTagGroupDTO groupDTO : tagGroup) {
qywxTagService.saveQywxTagByQywxGroupKey(wxEnterpriseId, groupDTO);
}
}
@Override
public void syncTagToQywx(String wxEnterpriseId, String enterpriseId, QywxTagInfoDTO infoDTO, List<QywxTagItemDTO> items) {
WxEnterpriseDTO wxEnterpriseDTO = wxEnterpriseService.selectById(wxEnterpriseId);
//调用企业微信接口保存
QywxGetCorpTagListDTO resp = this.saveQywxTag(wxEnterpriseDTO, infoDTO, items);
if (resp.getErrorcode() != 0) {
logger.info("同步失败:{}", JSONObject.toJSONString(resp));
return;
}
//拉取保存所有标签
List<QywxTagGroupDTO> tagGroup = resp.getTagGroup();
QywxTagGroupDTO groupDTO = tagGroup.get(0);
//保存企业微信标签信息
qywxTagService.saveQywxTagByQywxGroupKey(wxEnterpriseId, groupDTO);
//保存关联关系
saveRelation(wxEnterpriseId, enterpriseId, infoDTO);
//todo 后续处理 比如同步会员标签等
}
/**
* 保存标签的关联关系
*
* @param wxEnterpriseId
* @param enterpriseId
* @param infoDTO
*/
private void saveRelation(String wxEnterpriseId, String enterpriseId, QywxTagInfoDTO infoDTO) {
//设置关联关系
TabQywxTag groupKey = qywxTagService.getQywxTagByQywxGroupKey(wxEnterpriseId, infoDTO.getQywxGroupKey());
List<TabQywxTagItem> tabQywxTagItems = qywxTagService.listByQywxTagId(wxEnterpriseId, groupKey.getQywxTagId());
List<TabQywxTagRelation> saveRelationList = new ArrayList<>();
TabQywxTagRelation groupRelation = new TabQywxTagRelation();
groupRelation.setEnterpriseId(enterpriseId);
groupRelation.setMemberTagId(infoDTO.getQywxGroupKey());
groupRelation.setQywxTagId(groupKey.getQywxTagId());
groupRelation.setRelationType(QywxTagRelationTypeEnum.TAG_GROUP.getType());
groupRelation.setStatusFlag(1);
groupRelation.setSyncFlag(1);
groupRelation.setQywxTagRelationId(ToolUtil.randomUUID());
groupRelation.setWxEnterpriseId(wxEnterpriseId);
saveRelationList.add(groupRelation);
List<TabQywxTagRelation> itemList = tabQywxTagItems.stream().map(tab -> {
TabQywxTagRelation itemRelation = new TabQywxTagRelation();
itemRelation.setWxEnterpriseId(wxEnterpriseId);
itemRelation.setQywxTagRelationId(ToolUtil.randomUUID());
itemRelation.setSyncFlag(1);
itemRelation.setStatusFlag(1);
itemRelation.setRelationType(QywxTagRelationTypeEnum.TAG_ITEM.getType());
itemRelation.setQywxTagId(groupKey.getQywxTagId());
itemRelation.setMemberTagId(groupKey.getQywxGroupKey());
itemRelation.setEnterpriseId(enterpriseId);
itemRelation.setQywxTagItemId(tab.getQywxTagItemId());
itemRelation.setTagItemId(tab.getQywxTagKey());
return itemRelation;
}).collect(Collectors.toList());
saveRelationList.addAll(itemList);
qywxTagService.saveQywxRelation(saveRelationList);
}
/**
* 调用企业微信接口 保存标签
*
* @param wxEnterpriseDTO
* @param infoDTO
* @param items
* @return
*/
private QywxGetCorpTagListDTO saveQywxTag(WxEnterpriseDTO wxEnterpriseDTO, QywxTagInfoDTO infoDTO, List<QywxTagItemDTO> items) {
QywxTagGroupDTO qywxTagGroupDTO = new QywxTagGroupDTO();
qywxTagGroupDTO.setGroupId(infoDTO.getQywxGroupKey());
qywxTagGroupDTO.setGroupName("GIC" + infoDTO.getQywxGroupName());
qywxTagGroupDTO.setOrder(infoDTO.getOrder());
List<QywxTagDTO> tagItems = items.stream().map(item -> {
QywxTagDTO qywxTagDTO = new QywxTagDTO();
qywxTagDTO.setId(item.getQywxTagKey());
qywxTagDTO.setName(item.getQywxTagName());
qywxTagDTO.setOrder(item.getOrder());
return qywxTagDTO;
}).collect(Collectors.toList());
qywxTagGroupDTO.setTag(tagItems);
return qywxSuiteApiService.saveCorpTag(wxEnterpriseDTO.getCorpid(), config.getWxSuiteid(), qywxTagGroupDTO);
}
@Override
public void closeSync(String wxEnterpriseId, String memberTagId) {
WxEnterpriseDTO wxEnterpriseDTO = wxEnterpriseService.selectById(wxEnterpriseId);
//关闭同步
qywxTagService.closeSync(wxEnterpriseId, memberTagId);
List<String> delIds = new ArrayList<>();
delIds.add(memberTagId);
QywxResponseDTO responseDTO = qywxSuiteApiService.delCorpTag(wxEnterpriseDTO.getCorpid(), config.getWxSuiteid(), delIds, 0);
if (responseDTO.getErrorcode() == 0) {
qywxTagService.delQywxTag(memberTagId, wxEnterpriseId);
}
}
@Override
public List<QywxTagRelationDTO> listAllByWxEnterpriseId(String wxEnterpriseId) {
List<TabQywxTagRelation> ret = qywxTagService.listAllQywxRelation(wxEnterpriseId);
return EntityUtil.changeEntityListByJSON(QywxTagRelationDTO.class, ret);
}
}
...@@ -52,7 +52,8 @@ ...@@ -52,7 +52,8 @@
<dubbo:service interface="com.gic.haoban.manage.api.service.HandoverOperationApiService" <dubbo:service interface="com.gic.haoban.manage.api.service.HandoverOperationApiService"
ref="handoverOperationApiServiceImpl" timeout="10000"/> ref="handoverOperationApiServiceImpl" timeout="10000"/>
<dubbo:service interface="com.gic.haoban.manage.api.service.QywxTagApiService" ref="qywxTagApiService"
timeout="10000"/>
<dubbo:reference interface="com.gic.enterprise.api.service.DepartmentService" id="gicDepartmentService"/> <dubbo:reference interface="com.gic.enterprise.api.service.DepartmentService" id="gicDepartmentService"/>
<dubbo:reference interface="com.gic.wechat.api.service.qywx.QywxDepartmentApiService" id="qywxDepartmentApiService"/> <dubbo:reference interface="com.gic.wechat.api.service.qywx.QywxDepartmentApiService" id="qywxDepartmentApiService"/>
......
import com.alibaba.fastjson.JSONObject;
import com.gic.api.base.commons.Page;
import com.gic.commons.util.GICMQClientUtil;
import com.gic.haoban.base.api.common.BasePageInfo;
import com.gic.haoban.manage.api.dto.HandoverExternalDTO;
import com.gic.haoban.manage.api.service.HandoverOperationApiService;
import com.gic.haoban.manage.api.service.QywxTagApiService;
import com.gic.mq.sdk.GicMQClient;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import java.util.ArrayList;
import java.util.List;
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(locations = {"classpath:applicationContext-conf.xml"})
public class QywxTagTest {
private static Logger logger = LoggerFactory.getLogger(QywxTagTest.class);
@Autowired
private QywxTagApiService qywxTagApiService;
@Test
public void test() {
String wxEnterpriseId = "ca66a01b79474c40b3e7c7f93daf1a3b";
qywxTagApiService.pullQywxTag(wxEnterpriseId);
}
}
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