Commit 3993f6df by 徐高华

Merge branch 'master' into 'master-xgh-好办停用'

# Conflicts:
#   haoban-manage3-service/src/main/resources/dubbo-haoban-manage-service.xml
parents 01765116 cf09d549
...@@ -3,14 +3,12 @@ package com.gic.haoban.manage.api.dto; ...@@ -3,14 +3,12 @@ package com.gic.haoban.manage.api.dto;
import java.io.Serializable; import java.io.Serializable;
/** /**
* * @author xugh
* @ClassName: QwFrientNoticeDTO * @ClassName: QwFrientNoticeDTO
* @Description: 企微加好友通知 * @Description: 企微加好友通知
* @author xugh * @date 2022年8月18日 上午10:31:14
* @date 2022年8月18日 上午10:31:14
*
*/ */
public class QwFrientNoticeDTO implements Serializable{ public class QwFrientNoticeDTO implements Serializable {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
...@@ -18,14 +16,14 @@ public class QwFrientNoticeDTO implements Serializable{ ...@@ -18,14 +16,14 @@ public class QwFrientNoticeDTO implements Serializable{
private String suiteid; private String suiteid;
private String memberUnionidRelatedId; private String memberUnionidRelatedId;
private String memberId; private String memberId;
private String unionid; private String unionid;
private String wxEnterpriseId; private String wxEnterpriseId;
private String enterpriseId; private String enterpriseId;
private Integer statusFlag; private Integer statusFlag;
...@@ -33,13 +31,13 @@ public class QwFrientNoticeDTO implements Serializable{ ...@@ -33,13 +31,13 @@ public class QwFrientNoticeDTO implements Serializable{
private String externalUserid; private String externalUserid;
private String wxUserId; private String wxUserId;
private String selfExternalUserid; private String selfExternalUserid;
private String externalName; private String externalName;
private String addCreateTime; private String addCreateTime;
private String avatar; private String avatar;
private String welcomeCode; private String welcomeCode;
...@@ -47,8 +45,9 @@ public class QwFrientNoticeDTO implements Serializable{ ...@@ -47,8 +45,9 @@ public class QwFrientNoticeDTO implements Serializable{
* 自定义的state参数 * 自定义的state参数
*/ */
private String state; private String state;
private String staffId ; private String staffId;
private String changeType;
public String getStaffId() { public String getStaffId() {
return staffId; return staffId;
...@@ -138,45 +137,45 @@ public class QwFrientNoticeDTO implements Serializable{ ...@@ -138,45 +137,45 @@ public class QwFrientNoticeDTO implements Serializable{
this.suiteid = suiteid; this.suiteid = suiteid;
} }
public String getSelfExternalUserid() { public String getSelfExternalUserid() {
return selfExternalUserid; return selfExternalUserid;
} }
public void setSelfExternalUserid(String selfExternalUserid) { public void setSelfExternalUserid(String selfExternalUserid) {
this.selfExternalUserid = selfExternalUserid; this.selfExternalUserid = selfExternalUserid;
} }
public String getExternalName() { public String getExternalName() {
return externalName; return externalName;
} }
public void setExternalName(String externalName) { public void setExternalName(String externalName) {
this.externalName = externalName; this.externalName = externalName;
} }
public String getAddCreateTime() { public String getAddCreateTime() {
return addCreateTime; return addCreateTime;
} }
public void setAddCreateTime(String addCreateTime) { public void setAddCreateTime(String addCreateTime) {
this.addCreateTime = addCreateTime; this.addCreateTime = addCreateTime;
} }
public String getEnterpriseId() { public String getEnterpriseId() {
return enterpriseId; return enterpriseId;
} }
public void setEnterpriseId(String enterpriseId) { public void setEnterpriseId(String enterpriseId) {
this.enterpriseId = enterpriseId; this.enterpriseId = enterpriseId;
} }
public String getAvatar() { public String getAvatar() {
return avatar; return avatar;
} }
public void setAvatar(String avatar) { public void setAvatar(String avatar) {
this.avatar = avatar; this.avatar = avatar;
} }
public String getState() { public String getState() {
return state; return state;
...@@ -185,4 +184,12 @@ public class QwFrientNoticeDTO implements Serializable{ ...@@ -185,4 +184,12 @@ public class QwFrientNoticeDTO implements Serializable{
public void setState(String state) { public void setState(String state) {
this.state = state; this.state = state;
} }
public String getChangeType() {
return changeType;
}
public void setChangeType(String changeType) {
this.changeType = changeType;
}
} }
package com.gic.haoban.manage.api.service; package com.gic.haoban.manage.api.service;
import java.util.List;
import com.gic.api.base.commons.JSONResponse; import com.gic.api.base.commons.JSONResponse;
import com.gic.haoban.base.api.common.ServiceResponse; import com.gic.haoban.base.api.common.ServiceResponse;
import com.gic.haoban.manage.api.dto.ExternalClerkRelatedDTO; import com.gic.haoban.manage.api.dto.*;
import com.gic.haoban.manage.api.dto.ExternalUserDTO;
import com.gic.haoban.manage.api.dto.FriendStoreInfoDTO; import java.util.List;
import com.gic.haoban.manage.api.dto.MemberStoreDTO;
import com.gic.haoban.manage.api.dto.MemberUnionidRelatedDTO;
import com.gic.haoban.manage.api.dto.QwFrientNoticeDTO;
public interface MemberUnionidRelatedApiService { public interface MemberUnionidRelatedApiService {
...@@ -257,4 +252,14 @@ public interface MemberUnionidRelatedApiService { ...@@ -257,4 +252,14 @@ public interface MemberUnionidRelatedApiService {
void updateSelfExternalUseridById(String selfExternalUserid, String memberUnionidRelatedId); void updateSelfExternalUseridById(String selfExternalUserid, String memberUnionidRelatedId);
/**
* 事件订阅test
*
* @param param 参数
* @author mozhu
* @date 2022-09-09 14:18:34
*/
void addDelFriendEventTest(String param);
} }
...@@ -41,20 +41,31 @@ public interface StaffClerkRelationApiService { ...@@ -41,20 +41,31 @@ public interface StaffClerkRelationApiService {
/** /**
* 审核绑定 * 审核绑定
*
* @param staffClerkRelation * @param staffClerkRelation
* @param optStaffId * @param optStaffId
* @param channelCode * @param channelCode
*/ */
void delAndInsert(StaffClerkRelationDTO staffClerkRelation, String optStaffId, int channelCode); void delAndInsert(StaffClerkRelationDTO staffClerkRelation, String optStaffId, int channelCode);
/** /**
* 解绑 * 解绑导购
* * @param staffId
* @param storeId * @param clerkId
* @param clerkCode * @param channelCode
* @return * @return
*/ */
void delByStoreIdAndCode(String storeId, String clerkCode); boolean unbindByStaffAndClerkId(String staffId, String clerkId, int channelCode);
/**
* 解绑门店
* @param wxEnterpriseId
* @param storeId
* @param staffId
* @param channelCode
*/
void delBindByStoreId(String wxEnterpriseId,String storeId, String staffId,int channelCode);
StaffClerkRelationDTO getOneByClerkId(String clerkId); StaffClerkRelationDTO getOneByClerkId(String clerkId);
...@@ -70,15 +81,6 @@ public interface StaffClerkRelationApiService { ...@@ -70,15 +81,6 @@ public interface StaffClerkRelationApiService {
List<StaffClerkRelationDTO> listByStoreId(String storeId); List<StaffClerkRelationDTO> listByStoreId(String storeId);
/** /**
* 解绑
*
* @param staffId 操作人
* @param clerkId
* @return
*/
boolean unbindByStaffAndClerkId(String staffId, String clerkId);
/**
* 查询导购信息 * 查询导购信息
* *
* @param clerkId * @param clerkId
...@@ -93,7 +95,7 @@ public interface StaffClerkRelationApiService { ...@@ -93,7 +95,7 @@ public interface StaffClerkRelationApiService {
* @return * @return
*/ */
StaffClerkRelationDTO getByClerkId(String clerkId); StaffClerkRelationDTO getByClerkId(String clerkId);
StaffClerkRelationDTO getByClerkIdForWxUserId(String clerkId); StaffClerkRelationDTO getByClerkIdForWxUserId(String clerkId);
/** /**
...@@ -104,13 +106,6 @@ public interface StaffClerkRelationApiService { ...@@ -104,13 +106,6 @@ public interface StaffClerkRelationApiService {
List<StaffClerkRelationDTO> listByEnterpriseIdAndStaffid(String enterpriseId, String staffid); List<StaffClerkRelationDTO> listByEnterpriseIdAndStaffid(String enterpriseId, String staffid);
/** /**
* 删除关联关系
*
* @param clerkId
*/
void delByClerkId(String clerkId);
/**
* 搜索查询列表 * 搜索查询列表
* *
* @param wxEnterpriseId * @param wxEnterpriseId
...@@ -171,7 +166,7 @@ public interface StaffClerkRelationApiService { ...@@ -171,7 +166,7 @@ public interface StaffClerkRelationApiService {
* @author mozhu * @author mozhu
* @date 2022-06-20 22:46:46 * @date 2022-06-20 22:46:46
*/ */
List<StaffClerkRelationDTO> listByStaffId(String wxEnterpriseId,String staffId); List<StaffClerkRelationDTO> listByStaffId(String wxEnterpriseId, String staffId);
/** /**
* 通过职员id 查询职员id列表 * 通过职员id 查询职员id列表
...@@ -182,7 +177,7 @@ public interface StaffClerkRelationApiService { ...@@ -182,7 +177,7 @@ public interface StaffClerkRelationApiService {
* @author mozhu * @author mozhu
* @date 2022-07-07 17:28:01 * @date 2022-07-07 17:28:01
*/ */
List<StaffClerkRelationDTO> listClerkIdConcatFlagByClerkIds(List<String> clerkIds,String wxEnterpriseId); List<StaffClerkRelationDTO> listClerkIdConcatFlagByClerkIds(List<String> clerkIds, String wxEnterpriseId);
/** /**
...@@ -194,19 +189,18 @@ public interface StaffClerkRelationApiService { ...@@ -194,19 +189,18 @@ public interface StaffClerkRelationApiService {
* @date 2022-07-12 18:57:15 * @date 2022-07-12 18:57:15
*/ */
void clerkStoreMoveDel(String param); void clerkStoreMoveDel(String param);
/** /**
* * @param enterpriseId
* @Title: getCanAddHmCount * @param wxEnterpriseId
* @Description: 获取能创建活码的导购数量 * @return
* @author xugh * @throws
* @param enterpriseId * @Title: getCanAddHmCount
* @param wxEnterpriseId * @Description: 获取能创建活码的导购数量
* @return * @author xugh
* @throws */
*/ int getCanAddHmCount(String enterpriseId, String wxEnterpriseId, String clerkId);
int getCanAddHmCount(String enterpriseId , String wxEnterpriseId , String clerkId) ;
List<String> listStaffIdByWxEnterpriseId(String wxEnterpriseId); List<String> listStaffIdByWxEnterpriseId(String wxEnterpriseId);
} }
...@@ -26,6 +26,8 @@ public class Config { ...@@ -26,6 +26,8 @@ public class Config {
private String hmLinkUrl; private String hmLinkUrl;
@Value("${qywx_hbzs_suite}") @Value("${qywx_hbzs_suite}")
private String qywxHbzsSuite; private String qywxHbzsSuite;
@Value("${addDelFriendEvent}")
private String addDelFriendEvent;
public String getHmLinkUrl() { public String getHmLinkUrl() {
return hmLinkUrl; return hmLinkUrl;
...@@ -90,4 +92,12 @@ public class Config { ...@@ -90,4 +92,12 @@ public class Config {
public void setQywxHbzsSuite(String qywxHbzsSuite) { public void setQywxHbzsSuite(String qywxHbzsSuite) {
this.qywxHbzsSuite = qywxHbzsSuite; this.qywxHbzsSuite = qywxHbzsSuite;
} }
public String getAddDelFriendEvent() {
return addDelFriendEvent;
}
public void setAddDelFriendEvent(String addDelFriendEvent) {
this.addDelFriendEvent = addDelFriendEvent;
}
} }
package com.gic.haoban.manage.service.dao.mapper; package com.gic.haoban.manage.service.dao.mapper;
import java.util.Collection;
import java.util.Date;
import java.util.List;
import org.apache.ibatis.annotations.Param;
import com.gic.haoban.manage.api.dto.ExternalClerkRelatedDTO; import com.gic.haoban.manage.api.dto.ExternalClerkRelatedDTO;
import com.gic.haoban.manage.service.entity.TabHaobanExternalClerkRelated; import com.gic.haoban.manage.service.entity.TabHaobanExternalClerkRelated;
import com.github.pagehelper.Page; import com.github.pagehelper.Page;
import org.apache.ibatis.annotations.Param;
import java.util.Collection;
import java.util.Date;
import java.util.List;
public interface TabHaobanExternalClerkRelatedMapper { public interface TabHaobanExternalClerkRelatedMapper {
...@@ -146,7 +145,7 @@ public interface TabHaobanExternalClerkRelatedMapper { ...@@ -146,7 +145,7 @@ public interface TabHaobanExternalClerkRelatedMapper {
List<TabHaobanExternalClerkRelated> listByMemberIdAndWxEnterpriseId(@Param("memberId") String memberId, List<TabHaobanExternalClerkRelated> listByMemberIdAndWxEnterpriseId(@Param("memberId") String memberId,
@Param("wxEnterpriseId") String wxEnterpriseId, @Param("wxEnterpriseId") String wxEnterpriseId,
@Param("enterpriseId") String enterpriseId); @Param("enterpriseId") String enterpriseId);
/** /**
* 查询会员在企业下的好友关系 * 查询会员在企业下的好友关系
* *
...@@ -156,8 +155,9 @@ public interface TabHaobanExternalClerkRelatedMapper { ...@@ -156,8 +155,9 @@ public interface TabHaobanExternalClerkRelatedMapper {
* @return * @return
*/ */
List<ExternalClerkRelatedDTO> listByMemberIdList(@Param("memberIdList") List<String> memberIdList, List<ExternalClerkRelatedDTO> listByMemberIdList(@Param("memberIdList") List<String> memberIdList,
@Param("wxEnterpriseId") String wxEnterpriseId, @Param("wxEnterpriseId") String wxEnterpriseId,
@Param("enterpriseId") String enterpriseId); @Param("enterpriseId") String enterpriseId);
/** /**
* 获取最新的最近的外部联系人 * 获取最新的最近的外部联系人
* *
...@@ -270,7 +270,7 @@ public interface TabHaobanExternalClerkRelatedMapper { ...@@ -270,7 +270,7 @@ public interface TabHaobanExternalClerkRelatedMapper {
* 根据企业id分页 * 根据企业id分页
* *
* @param wxEnterpriseId 企业标识 * @param wxEnterpriseId 企业标识
* @return {@link List<TabHaobanWxEnterprise> } * @return {@link List<TabHaobanExternalClerkRelated> }
* @author mozhu * @author mozhu
* @date 2021-12-13 14:59:03 * @date 2021-12-13 14:59:03
*/ */
...@@ -295,7 +295,7 @@ public interface TabHaobanExternalClerkRelatedMapper { ...@@ -295,7 +295,7 @@ public interface TabHaobanExternalClerkRelatedMapper {
* *
* @param wxEnterpriseId 企业id * @param wxEnterpriseId 企业id
* @param enterpriseId 商户id * @param enterpriseId 商户id
* @param staffId 企业微信导购账号 * @param staffId 企业微信导购账号
* @param clerkId 导购id * @param clerkId 导购id
* @return * @return
*/ */
...@@ -315,10 +315,11 @@ public interface TabHaobanExternalClerkRelatedMapper { ...@@ -315,10 +315,11 @@ public interface TabHaobanExternalClerkRelatedMapper {
* 查询所有好友关系 * 查询所有好友关系
* *
* @param wxEnterpriseId wx企业标识 * @param wxEnterpriseId wx企业标识
* @param staffId wx用户id * @param staffId wx用户id
* @return {@link List}<{@link TabHaobanExternalClerkRelated}> * @return {@link List}<{@link TabHaobanExternalClerkRelated}>
*/ */
List<TabHaobanExternalClerkRelated> getByWxUserIdAndWxEnterpriseId(@Param("wxEnterpriseId") String wxEnterpriseId, @Param("staffId") String staffId); List<TabHaobanExternalClerkRelated> getByWxUserIdAndWxEnterpriseId(@Param("wxEnterpriseId") String wxEnterpriseId,
@Param("staffId") String staffId);
/** /**
...@@ -354,7 +355,18 @@ public interface TabHaobanExternalClerkRelatedMapper { ...@@ -354,7 +355,18 @@ public interface TabHaobanExternalClerkRelatedMapper {
*/ */
int countByMemberId(@Param("memberId") String memberId, int countByMemberId(@Param("memberId") String memberId,
@Param("enterpriseId") String enterpriseId); @Param("enterpriseId") String enterpriseId);
List<TabHaobanExternalClerkRelated> listPageByWxenterpriseId(@Param("wxEnterpriseId") String wxEnterpriseId, List<TabHaobanExternalClerkRelated> listPageByWxenterpriseId(@Param("wxEnterpriseId") String wxEnterpriseId,
@Param("startItem") int startItem , @Param("pageSize") int pageSize ); @Param("startItem") int startItem, @Param("pageSize") int pageSize);
/**
* 获取所有的好友会员id
*
* @param storeId 存储id
* @param staffId 员工id
* @return {@link List}<{@link String}>
*/
List<String> getByStoreIdAndStaffId(@Param("storeId") String storeId,
@Param("staffId") String staffId);
} }
\ No newline at end of file
...@@ -26,8 +26,6 @@ public interface ExternalClerkRelatedService { ...@@ -26,8 +26,6 @@ public interface ExternalClerkRelatedService {
*/ */
void delByUserIdAndExternalUserIdBatch(String wxEnterpriseId, String staffId, List<String> externalUserids); void delByUserIdAndExternalUserIdBatch(String wxEnterpriseId, String staffId, List<String> externalUserids);
void delByClerkIdAndStaffId(String clerkId, String staffId);
void delByStoreIdAndStaffId(String storeId, String staffId); void delByStoreIdAndStaffId(String storeId, String staffId);
void delByStoreIds(Collection<String> storeIds); void delByStoreIds(Collection<String> storeIds);
...@@ -38,7 +36,7 @@ public interface ExternalClerkRelatedService { ...@@ -38,7 +36,7 @@ public interface ExternalClerkRelatedService {
TabHaobanExternalClerkRelated getByParams(String staffId, String wxEnterpriseId, String name, String createTime); TabHaobanExternalClerkRelated getByParams(String staffId, String wxEnterpriseId, String name, String createTime);
List<TabHaobanExternalClerkRelated> listByExTernalUseridAndWxUserId(String externalUserid, String staffId); List<TabHaobanExternalClerkRelated> listByExternalUseridAndWxUserId(String externalUserid, String staffId);
List<TabHaobanExternalClerkRelated> listByExTernalUseridAndWxUserIdAllStatus(String wxEnterpriseId, String externalUserid, String wxUserId); List<TabHaobanExternalClerkRelated> listByExTernalUseridAndWxUserIdAllStatus(String wxEnterpriseId, String externalUserid, String wxUserId);
...@@ -73,4 +71,13 @@ public interface ExternalClerkRelatedService { ...@@ -73,4 +71,13 @@ public interface ExternalClerkRelatedService {
void repairExternalUserId(String wxEnterpriseId); void repairExternalUserId(String wxEnterpriseId);
/**
* 获取所有的好友会员id
*
* @param storeId 存储id
* @param staffId 员工id
* @return {@link List}<{@link String}>
*/
List<String> getByStoreIdAndStaffId(String storeId,String staffId);
} }
...@@ -15,7 +15,7 @@ public interface StaffClerkRelationService { ...@@ -15,7 +15,7 @@ public interface StaffClerkRelationService {
List<StaffClerkRelationDTO> listBindCodeByStaffId(List<String> enterpriseIdList, String staffId); List<StaffClerkRelationDTO> listBindCodeByStaffId(List<String> enterpriseIdList, String staffId);
/** /**
* 删除绑定 * 解绑-删除绑定(导购级别)
* *
* @param clerkId * @param clerkId
* @return * @return
...@@ -23,7 +23,7 @@ public interface StaffClerkRelationService { ...@@ -23,7 +23,7 @@ public interface StaffClerkRelationService {
boolean delBind(String clerkId, String optStaffId, int channelCode); boolean delBind(String clerkId, String optStaffId, int channelCode);
/** /**
* 删除绑定 * 解绑-删除绑定(门店级别)
* *
* @param wxEnterpriseId 可以不传 * @param wxEnterpriseId 可以不传
* @param storeIds * @param storeIds
......
...@@ -66,6 +66,10 @@ public class ClerkMainStoreRelatedServiceImpl implements ClerkMainStoreRelatedSe ...@@ -66,6 +66,10 @@ public class ClerkMainStoreRelatedServiceImpl implements ClerkMainStoreRelatedSe
logger.info("切换主门店-刷新企业微信好友:{},{}", staffId, storeId); logger.info("切换主门店-刷新企业微信好友:{},{}", staffId, storeId);
//主门店切换需要刷新企业微信好友 //主门店切换需要刷新企业微信好友
TabHaobanStaff staff = staffService.selectById(staffId); TabHaobanStaff staff = staffService.selectById(staffId);
if (staff == null) {
logger.info("员工不存在:{}",staffId);
return;
}
String taskName = "自动刷新企业微信好友(" + staff.getStaffName() + ")"; String taskName = "自动刷新企业微信好友(" + staff.getStaffName() + ")";
String taskId = dealSyncOperationApiService.createWxFriendTaskSingle(wxEnterpriseId, taskName, staffId, staff.getStaffName(), SyncTaskTypeEnum.FRIEND_SINGLE.getType()); String taskId = dealSyncOperationApiService.createWxFriendTaskSingle(wxEnterpriseId, taskName, staffId, staff.getStaffName(), SyncTaskTypeEnum.FRIEND_SINGLE.getType());
if (StringUtils.isBlank(taskId)) { if (StringUtils.isBlank(taskId)) {
......
...@@ -20,6 +20,7 @@ import com.gic.haoban.manage.service.entity.MemberClerkChatConfig; ...@@ -20,6 +20,7 @@ import com.gic.haoban.manage.service.entity.MemberClerkChatConfig;
import com.gic.haoban.manage.service.entity.TabHaobanStaff; import com.gic.haoban.manage.service.entity.TabHaobanStaff;
import com.gic.haoban.manage.service.entity.TabHaobanStaffClerkRelation; import com.gic.haoban.manage.service.entity.TabHaobanStaffClerkRelation;
import com.gic.haoban.manage.service.service.*; import com.gic.haoban.manage.service.service.*;
import com.gic.member.api.service.MemberApiService;
import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo; import com.github.pagehelper.PageInfo;
import org.apache.commons.collections.CollectionUtils; import org.apache.commons.collections.CollectionUtils;
...@@ -60,6 +61,8 @@ public class StaffClerkRelationServiceImpl implements StaffClerkRelationService ...@@ -60,6 +61,8 @@ public class StaffClerkRelationServiceImpl implements StaffClerkRelationService
private HmClerkRelationApiService hmClerkRelationApiService; private HmClerkRelationApiService hmClerkRelationApiService;
@Autowired @Autowired
private WxEnterpriseService wxEnterpriseService; private WxEnterpriseService wxEnterpriseService;
@Autowired
private MemberApiService memberApiService;
@Override @Override
public List<StaffClerkRelationDTO> listBindCode(String enterpriseId, Set<String> clerkCodeList) { public List<StaffClerkRelationDTO> listBindCode(String enterpriseId, Set<String> clerkCodeList) {
...@@ -80,17 +83,20 @@ public class StaffClerkRelationServiceImpl implements StaffClerkRelationService ...@@ -80,17 +83,20 @@ public class StaffClerkRelationServiceImpl implements StaffClerkRelationService
} }
int i = mapper.changeStatusByClerkId(clerkId, 0); int i = mapper.changeStatusByClerkId(clerkId, 0);
String enterpriseId = clerkRelation.getEnterpriseId();
List<String> memberIds = externalClerkRelatedService.getByStoreIdAndStaffId(clerkRelation.getStoreId(), clerkRelation.getStaffId());
for (String memberId : memberIds) {
//解绑通知会员
memberApiService.updateMemberQywxFlag(enterpriseId, memberId, 0);
memberApiService.updateMemberQywxEveryOccasion(enterpriseId, memberId, 0, new Date());
}
//删除 并设置主门店 //删除 并设置主门店
clerkMainStoreRelatedService.delMainStore(clerkRelation.getStaffId(), clerkRelation.getStoreId(), clerkRelation.getWxEnterpriseId()); clerkMainStoreRelatedService.delMainStore(clerkRelation.getStaffId(), clerkRelation.getStoreId(), clerkRelation.getWxEnterpriseId());
boolean b = i >= 0; //推入日志
if (b) { staffClerkBindLogService.pushToMq(clerkRelation.getStaffId(), optStaffId, BindTypeEnum.UNBIND.getVal(), channelCode, clerkRelation.getStaffClerkRelationId());
//推入日志 //废弃活码
staffClerkBindLogService.pushToMq(clerkRelation.getStaffId(), optStaffId, BindTypeEnum.UNBIND.getVal(), channelCode, clerkRelation.getStaffClerkRelationId()); hmClerkRelationApiService.delByClerkId(clerkId, enterpriseId, clerkRelation.getWxEnterpriseId(), channelCode);
return i > 0;
//废弃活码
hmClerkRelationApiService.delByClerkId(clerkId, clerkRelation.getEnterpriseId(), clerkRelation.getWxEnterpriseId(), channelCode);
}
return b;
} }
@Override @Override
...@@ -102,21 +108,27 @@ public class StaffClerkRelationServiceImpl implements StaffClerkRelationService ...@@ -102,21 +108,27 @@ public class StaffClerkRelationServiceImpl implements StaffClerkRelationService
List<TabHaobanStaffClerkRelation> needUnbind = mapper.listBindByStoreIds(wxEnterpriseId, storeIds); List<TabHaobanStaffClerkRelation> needUnbind = mapper.listBindByStoreIds(wxEnterpriseId, storeIds);
if (CollectionUtils.isEmpty(needUnbind)) { if (CollectionUtils.isEmpty(needUnbind)) {
logger.info("没有门店绑定了需要解绑的:{}", wxEnterpriseId); logger.info("没有门店绑定了需要解绑的:{}", wxEnterpriseId);
return true;
} }
//清除绑定 //清除绑定
mapper.delByStoreIds(storeIds); mapper.delByStoreIds(storeIds);
//删除主门店 //删除主门店
clerkMainStoreRelatedService.delMainStoreByStoreIds(storeIds); clerkMainStoreRelatedService.delMainStoreByStoreIds(storeIds);
List<String> need = needUnbind.stream().map(tab -> tab.getStaffClerkRelationId()).collect(Collectors.toList()); List<String> need = needUnbind.stream().map(tab -> tab.getStaffClerkRelationId()).collect(Collectors.toList());
//放入队列 //放入队列
staffClerkBindLogService.pushToMqBatch(optStaffId, BindTypeEnum.UNBIND.getVal(), channelCode, need); staffClerkBindLogService.pushToMqBatch(optStaffId, BindTypeEnum.UNBIND.getVal(), channelCode, need);
for (TabHaobanStaffClerkRelation clerkRelation : needUnbind) { for (TabHaobanStaffClerkRelation clerkRelation : needUnbind) {
//废弃活码 //废弃活码
hmClerkRelationApiService.delByClerkId(clerkRelation.getClerkId(), clerkRelation.getEnterpriseId(), wxEnterpriseId, channelCode); String enterpriseId = clerkRelation.getEnterpriseId();
hmClerkRelationApiService.delByClerkId(clerkRelation.getClerkId(), enterpriseId, wxEnterpriseId, channelCode);
//删除好友通知会员
List<String> memberIds = externalClerkRelatedService.getByStoreIdAndStaffId(clerkRelation.getStoreId(), clerkRelation.getStaffId());
for (String memberId : memberIds) {
//解绑通知会员
memberApiService.updateMemberQywxFlag(enterpriseId, memberId, 0);
memberApiService.updateMemberQywxEveryOccasion(enterpriseId, memberId, 0, new Date());
}
} }
return true; return true;
} }
......
...@@ -171,12 +171,6 @@ public class StoreRangeServiceImpl implements StoreRangeService { ...@@ -171,12 +171,6 @@ public class StoreRangeServiceImpl implements StoreRangeService {
* @param addStoreIds * @param addStoreIds
*/ */
private void dealStoreRelation(List<TabStoreRelation> storeRelations, String enterpriseId, Set<String> delStoreIds, Set<String> addStoreIds) { private void dealStoreRelation(List<TabStoreRelation> storeRelations, String enterpriseId, Set<String> delStoreIds, Set<String> addStoreIds) {
// //先删除 后新增
// tabHaobanStoreRelationMapper.deleteAllStoreRalation(enterpriseId);
// //批量插入
// insertStoreRelationBatch(storeRelations);
//先删除 后新增 //先删除 后新增
if (CollectionUtils.isNotEmpty(delStoreIds)) { if (CollectionUtils.isNotEmpty(delStoreIds)) {
logger.info("批量删除门店:{}", JSONObject.toJSONString(delStoreIds)); logger.info("批量删除门店:{}", JSONObject.toJSONString(delStoreIds));
......
...@@ -202,15 +202,11 @@ public class AuditApiServiceImpl implements AuditApiService { ...@@ -202,15 +202,11 @@ public class AuditApiServiceImpl implements AuditApiService {
if (StringUtils.isNotBlank(batchId)) { if (StringUtils.isNotBlank(batchId)) {
insertBatchLog(batchId, AuditRsultType.success.getCode(), tab); insertBatchLog(batchId, AuditRsultType.success.getCode(), tab);
} }
//解绑日志 staffClerkRelationApiService.unbindByStaffAndClerkId(optStaffId,obj.getClerkId(),ChannelCodeEnum.AUDIT_UNBIND.getCode());
StaffClerkRelationDTO relationDTO = staffClerkRelationApiService.getByClerkId(obj.getClerkId());
if (null != relationDTO) {
staffClerkRelationApiService.pushToBindLog(relationDTO.getStaffId(), optStaffId, BindTypeEnum.UNBIND.getVal(), ChannelCodeEnum.SELF_UNBIND.getCode(), relationDTO.getStaffClerkRelationId());
}
staffClerkRelationApiService.delByClerkId(obj.getClerkId());
staffDepartmentRelatedApiService.sendClerkDel(obj.getClerkName(), obj.getClerkCode(), tab.getCommitStoreId(), 1, ""); staffDepartmentRelatedApiService.sendClerkDel(obj.getClerkName(), obj.getClerkCode(), tab.getCommitStoreId(), 1, "");
} else if (auditType == AuditType.CLERK_UNBIND.getCode()) { } else if (auditType == AuditType.CLERK_UNBIND.getCode()) {
//解绑申请,无需审核,直接通过 //解绑申请,无需审核,直接通过
logger.info("解绑申请,无需审核,直接通过");
} }
tab.setAuditStatus(1); tab.setAuditStatus(1);
auditMapper.updateByPrimaryKeySelective(tab); auditMapper.updateByPrimaryKeySelective(tab);
......
...@@ -10,10 +10,7 @@ import com.gic.haoban.app.customer.service.api.service.InnerApiService; ...@@ -10,10 +10,7 @@ import com.gic.haoban.app.customer.service.api.service.InnerApiService;
import com.gic.haoban.base.api.common.Constant; import com.gic.haoban.base.api.common.Constant;
import com.gic.haoban.base.api.common.ServiceResponse; import com.gic.haoban.base.api.common.ServiceResponse;
import com.gic.haoban.manage.api.dto.*; import com.gic.haoban.manage.api.dto.*;
import com.gic.haoban.manage.api.enums.AppPageType; import com.gic.haoban.manage.api.enums.*;
import com.gic.haoban.manage.api.enums.NoticeMessageTypeEnum;
import com.gic.haoban.manage.api.enums.SecretTypeEnum;
import com.gic.haoban.manage.api.enums.WxEditType;
import com.gic.haoban.manage.api.service.MessageApiService; import com.gic.haoban.manage.api.service.MessageApiService;
import com.gic.haoban.manage.api.service.StaffApiService; import com.gic.haoban.manage.api.service.StaffApiService;
import com.gic.haoban.manage.api.service.StaffClerkRelationApiService; import com.gic.haoban.manage.api.service.StaffClerkRelationApiService;
...@@ -316,7 +313,7 @@ public class MessageApiServiceImpl implements MessageApiService { ...@@ -316,7 +313,7 @@ public class MessageApiServiceImpl implements MessageApiService {
List<StaffClerkRelationDTO> staffClerkRelationDTOS = staffClerkRelationApiService.listByStaffId(wxEnterpriseId, staffId); List<StaffClerkRelationDTO> staffClerkRelationDTOS = staffClerkRelationApiService.listByStaffId(wxEnterpriseId, staffId);
if (CollectionUtils.isNotEmpty(staffClerkRelationDTOS)) { if (CollectionUtils.isNotEmpty(staffClerkRelationDTOS)) {
for (StaffClerkRelationDTO staffClerkRelationDTO : staffClerkRelationDTOS) { for (StaffClerkRelationDTO staffClerkRelationDTO : staffClerkRelationDTOS) {
staffClerkRelationApiService.unbindByStaffAndClerkId(staffId, staffClerkRelationDTO.getClerkId()); staffClerkRelationApiService.unbindByStaffAndClerkId(staffId, staffClerkRelationDTO.getClerkId(), ChannelCodeEnum.ADMIN_UNBIND.getCode());
} }
} }
} }
......
...@@ -298,8 +298,8 @@ public class StaffApiServiceImpl implements StaffApiService { ...@@ -298,8 +298,8 @@ public class StaffApiServiceImpl implements StaffApiService {
if(qwDTO.getWxSecurityType()==4) { if(qwDTO.getWxSecurityType()==4) {
list = qywxUserApiService.useridToOpenuserid(qwDTO.getThirdCorpid(), config.getWxSuiteid(), Collections.singletonList(userId)); list = qywxUserApiService.useridToOpenuserid(qwDTO.getThirdCorpid(), config.getWxSuiteid(), Collections.singletonList(userId));
}else { }else {
TabHaobanWxApplication app = wxApplicationService.selectByCorpId(corpid); SecretSettingDTO set = this.secretSettingService.getSecretSetting(qwDTO.getWxEnterpriseId(), SecretTypeEnum.CUSTOMIZED_APP.getVal()) ;
list = qywxUserApiService.useridToOpenuserid(qwDTO.getDkCorpid(), app.getSiteId() , Collections.singletonList(userId)); list = qywxUserApiService.getSelfUseridToOpenuserid(qwDTO.getDkCorpid(), set.getSecretVal() , Collections.singletonList(userId));
} }
logger.info("明文userId转密文={},{}",userId , JSON.toJSONString(list)); logger.info("明文userId转密文={},{}",userId , JSON.toJSONString(list));
if (CollectionUtils.isEmpty(list)) { if (CollectionUtils.isEmpty(list)) {
......
...@@ -209,12 +209,10 @@ public class StaffClerkRelationApiServiceImpl implements StaffClerkRelationApiSe ...@@ -209,12 +209,10 @@ public class StaffClerkRelationApiServiceImpl implements StaffClerkRelationApiSe
@Override @Override
public void delByStoreIdAndCode(String storeId, String clerkCode) { public void delBindByStoreId(String wxEnterpriseId,String storeId, String staffId,int channelCode) {
TabHaobanStaffClerkRelation staffClerkRelation = tabHaobanStaffClerkRelationMapper.getByCodeAndStoreId(clerkCode, storeId); Set<String> needUnBindStoreIds = new HashSet<>();
//删除绑定关系 needUnBindStoreIds.add(storeId);
tabHaobanStaffClerkRelationMapper.delByStoreIdAndCode(storeId, clerkCode); staffClerkRelationService.delBindByStoreIds(wxEnterpriseId, needUnBindStoreIds, staffId, ChannelCodeEnum.SELF_UNBIND.getCode());
//删除主门店
delSetMainStore(staffClerkRelation, ChannelCodeEnum.SELF_UNBIND.getCode());
} }
@Override @Override
...@@ -236,8 +234,8 @@ public class StaffClerkRelationApiServiceImpl implements StaffClerkRelationApiSe ...@@ -236,8 +234,8 @@ public class StaffClerkRelationApiServiceImpl implements StaffClerkRelationApiSe
} }
@Override @Override
public boolean unbindByStaffAndClerkId(String staffId, String clerkId) { public boolean unbindByStaffAndClerkId(String staffId, String clerkId,int channelCode) {
return staffClerkRelationService.delBind(clerkId, staffId, ChannelCodeEnum.ADMIN_UNBIND.getCode()); return staffClerkRelationService.delBind(clerkId, staffId, channelCode);
} }
@Override @Override
...@@ -280,28 +278,6 @@ public class StaffClerkRelationApiServiceImpl implements StaffClerkRelationApiSe ...@@ -280,28 +278,6 @@ public class StaffClerkRelationApiServiceImpl implements StaffClerkRelationApiSe
} }
@Override @Override
public void delByClerkId(String clerkId) {
TabHaobanStaffClerkRelation staffClerkRelation = tabHaobanStaffClerkRelationMapper.getOneByClerkId(clerkId);
tabHaobanStaffClerkRelationMapper.delByClerkId(clerkId);
delSetMainStore(staffClerkRelation, ChannelCodeEnum.AUDIT_UNBIND.getCode());
}
private void delSetMainStore(TabHaobanStaffClerkRelation staffClerkRelation, Integer channelCode) {
if (staffClerkRelation == null) {
logger.info("staffClerkRelation为空");
return;
}
String staffId = staffClerkRelation.getStaffId();
String wxEnterpriseId = staffClerkRelation.getWxEnterpriseId();
String clerkId = staffClerkRelation.getClerkId();
externalClerkRelatedService.delByClerkIdAndStaffId(clerkId, staffId);
//删除主门店
clerkMainStoreRelatedService.delMainStore(staffId, staffClerkRelation.getStoreId(), wxEnterpriseId);
//废弃活码
hmClerkRelationApiService.delByClerkId(clerkId, staffClerkRelation.getEnterpriseId(), wxEnterpriseId, channelCode);
}
@Override
public List<StaffClerkRelationDTO> listByEnterpriseIdAndStaffid(String enterpriseId, String staffid) { public List<StaffClerkRelationDTO> listByEnterpriseIdAndStaffid(String enterpriseId, String staffid) {
List<TabHaobanStaffClerkRelation> list = tabHaobanStaffClerkRelationMapper.listByEnterpriseIdAndStaffid(enterpriseId, staffid); List<TabHaobanStaffClerkRelation> list = tabHaobanStaffClerkRelationMapper.listByEnterpriseIdAndStaffid(enterpriseId, staffid);
return EntityUtil.changeEntityListByJSON(StaffClerkRelationDTO.class, list); return EntityUtil.changeEntityListByJSON(StaffClerkRelationDTO.class, list);
......
...@@ -316,6 +316,9 @@ public class HmQrcodeApiServiceImpl implements HmQrcodeApiService { ...@@ -316,6 +316,9 @@ public class HmQrcodeApiServiceImpl implements HmQrcodeApiService {
return ServiceResponse.failure(Convert.toStr(HaoBanErrCodeCommon.ERR_8.getCode()), "该活码不存在"); return ServiceResponse.failure(Convert.toStr(HaoBanErrCodeCommon.ERR_8.getCode()), "该活码不存在");
} }
Integer hmType = hmQrcodeQDTO.getHmType(); Integer hmType = hmQrcodeQDTO.getHmType();
if (hmType == null) {
return ServiceResponse.failure(Convert.toStr(HaoBanErrCodeCommon.ERR_8.getCode()), "活码类型为空");
}
List<String> clerkIdList = setStoreClerk(hmQrcodeQDTO, wxEnterpriseId, hmId, hmType, false); List<String> clerkIdList = setStoreClerk(hmQrcodeQDTO, wxEnterpriseId, hmId, hmType, false);
if (CollectionUtils.isEmpty(clerkIdList)) { if (CollectionUtils.isEmpty(clerkIdList)) {
return ServiceResponse.failure(Convert.toStr(HaoBanErrCodeCommon.ERR_8.getCode()), "该导购已经生成过活码或未关联过好办"); return ServiceResponse.failure(Convert.toStr(HaoBanErrCodeCommon.ERR_8.getCode()), "该导购已经生成过活码或未关联过好办");
......
...@@ -193,4 +193,7 @@ ...@@ -193,4 +193,7 @@
<dubbo:reference interface="com.gic.thirdparty.api.service.VoiceService" id="voiceService" timeout="10000" retries="0"/> <dubbo:reference interface="com.gic.thirdparty.api.service.VoiceService" id="voiceService" timeout="10000" retries="0"/>
<dubbo:reference interface="com.gic.thirdparty.api.service.CommunicationService" id="communicationService" timeout="10000" retries="0"/> <dubbo:reference interface="com.gic.thirdparty.api.service.CommunicationService" id="communicationService" timeout="10000" retries="0"/>
<dubbo:reference interface="com.gic.member.api.service.MemberEntranceApiService" id="memberEntranceApiService" timeout="10000" retries="0"/>
</beans> </beans>
\ No newline at end of file
...@@ -281,6 +281,9 @@ ...@@ -281,6 +281,9 @@
<select id="pageStaff" resultMap="BaseResultMap"> <select id="pageStaff" resultMap="BaseResultMap">
select select
a.* a.*
<if test="departmentIds != null and departmentIds.size() > 0">
, b.department_id departmentIds
</if>
from tab_haoban_staff a from tab_haoban_staff a
<if test="departmentIds != null and departmentIds.size() > 0"> <if test="departmentIds != null and departmentIds.size() > 0">
left join tab_haoban_staff_department_related b on a.staff_id = b.staff_id and b.status_flag = 1 left join tab_haoban_staff_department_related b on a.staff_id = b.staff_id and b.status_flag = 1
......
...@@ -426,7 +426,6 @@ ...@@ -426,7 +426,6 @@
<foreach collection="statusFlags" item="item" separator="," open="(" close=")"> <foreach collection="statusFlags" item="item" separator="," open="(" close=")">
#{item} #{item}
</foreach> </foreach>
order by update_time desc
</select> </select>
<update id="pushExternalByRelationKey"> <update id="pushExternalByRelationKey">
...@@ -653,6 +652,8 @@ ...@@ -653,6 +652,8 @@
</if> </if>
order by create_time desc limit 1 order by create_time desc limit 1
</select> </select>
<select id="countByMemberId" resultType="int"> <select id="countByMemberId" resultType="int">
select count(*) select count(*)
from tab_haoban_external_clerk_related from tab_haoban_external_clerk_related
...@@ -667,4 +668,13 @@ ...@@ -667,4 +668,13 @@
limit ${startItem},${pageSize} limit ${startItem},${pageSize}
</select> </select>
<select id="getByStoreIdAndStaffId" resultType="java.lang.String">
select member_id
from tab_haoban_external_clerk_related
where store_id = #{storeId,jdbcType=VARCHAR}
and staff_id = #{staffId}
and status_flag in (1, 3, 4)
</select>
</mapper> </mapper>
\ No newline at end of file
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
from tab_haoban_staff_clerk_relation from tab_haoban_staff_clerk_relation
where staff_clerk_relation_id = #{staffClerkRelationId,jdbcType=VARCHAR} where staff_clerk_relation_id = #{staffClerkRelationId,jdbcType=VARCHAR}
</select> </select>
<insert id="insert" parameterType="com.gic.haoban.manage.service.entity.TabHaobanStaffClerkRelation"> <insert id="insert" parameterType="com.gic.haoban.manage.service.entity.TabHaobanStaffClerkRelation">
insert into tab_haoban_staff_clerk_relation (staff_clerk_relation_id, staff_id, wx_enterprise_id, insert into tab_haoban_staff_clerk_relation (staff_clerk_relation_id, staff_id, wx_enterprise_id,
enterprise_id, store_id, enterprise_id, store_id,
...@@ -194,9 +194,10 @@ ...@@ -194,9 +194,10 @@
where clerk_id = #{clerkId,jdbcType=VARCHAR} where clerk_id = #{clerkId,jdbcType=VARCHAR}
and status_flag=1 order by create_time desc limit 1 and status_flag=1 order by create_time desc limit 1
</select> </select>
<select id="getByClerkIdForWxUserId" resultType="com.gic.haoban.manage.api.dto.StaffClerkRelationDTO" parameterType="java.lang.String"> <select id="getByClerkIdForWxUserId" resultType="com.gic.haoban.manage.api.dto.StaffClerkRelationDTO"
parameterType="java.lang.String">
select select
a.staff_clerk_relation_id staffClerkRelationId, a.staff_clerk_relation_id staffClerkRelationId,
a.staff_id staffId, a.staff_id staffId,
...@@ -212,7 +213,7 @@ ...@@ -212,7 +213,7 @@
left join tab_haoban_staff b on b.staff_id = a.staff_id left join tab_haoban_staff b on b.staff_id = a.staff_id
where a.clerk_id = #{clerkId,jdbcType=VARCHAR} and a.status_flag=1 where a.clerk_id = #{clerkId,jdbcType=VARCHAR} and a.status_flag=1
</select> </select>
<select id="getByClerkIdNoStatus" resultMap="BaseResultMap" parameterType="java.lang.String"> <select id="getByClerkIdNoStatus" resultMap="BaseResultMap" parameterType="java.lang.String">
select select
...@@ -262,8 +263,8 @@ ...@@ -262,8 +263,8 @@
where wx_enterprise_id = #{wxEnterpriseId,jdbcType=VARCHAR} where wx_enterprise_id = #{wxEnterpriseId,jdbcType=VARCHAR}
and status_flag =1 and status_flag =1
</select> </select>
<select id="lisByStaffId" resultMap="BaseResultMap"> <select id="lisByStaffId" resultMap="BaseResultMap">
select select
<include refid="Base_Column_List"/> <include refid="Base_Column_List"/>
from tab_haoban_staff_clerk_relation from tab_haoban_staff_clerk_relation
...@@ -271,15 +272,15 @@ ...@@ -271,15 +272,15 @@
wx_enterprise_id = #{wxEnterpriseId,jdbcType=VARCHAR} wx_enterprise_id = #{wxEnterpriseId,jdbcType=VARCHAR}
and staff_id = #{staffId} and staff_id = #{staffId}
and status_flag = 1 and status_flag = 1
<if test="null != storeIdList"> <if test="null != storeIdList">
and store_id in and store_id in
<foreach collection="storeIdList" item="item" separator="," open="(" close=")"> <foreach collection="storeIdList" item="item" separator="," open="(" close=")">
#{item} #{item}
</foreach> </foreach>
</if> </if>
order by create_time desc order by create_time desc
</select> </select>
<select id="pageByWxEnterpriseId" resultMap="BaseResultMap"> <select id="pageByWxEnterpriseId" resultMap="BaseResultMap">
select select
<include refid="Base_Column_List"/> <include refid="Base_Column_List"/>
...@@ -287,7 +288,7 @@ ...@@ -287,7 +288,7 @@
where wx_enterprise_id = #{wxEnterpriseId,jdbcType=VARCHAR} where wx_enterprise_id = #{wxEnterpriseId,jdbcType=VARCHAR}
and status_flag =1 and status_flag =1
</select> </select>
<select id="listBindByStoreId" resultType="com.gic.haoban.manage.api.dto.StaffClerkRelationDTO"> <select id="listBindByStoreId" resultType="com.gic.haoban.manage.api.dto.StaffClerkRelationDTO">
select select
a.staff_clerk_relation_id staffClerkRelationId, a.staff_clerk_relation_id staffClerkRelationId,
...@@ -369,31 +370,31 @@ ...@@ -369,31 +370,31 @@
</select> </select>
<select id="listMemberStaffRelNew" resultType="com.gic.haoban.manage.service.entity.ext.MemberStaffRelExtDO"> <select id="listMemberStaffRelNew" resultType="com.gic.haoban.manage.service.entity.ext.MemberStaffRelExtDO">
select * from ( select * from (
select ecr.member_id as memberId, select ecr.member_id as memberId,
ecr.external_user_id as memberExternalUserId, ecr.external_user_id as memberExternalUserId,
scr.staff_id as staffId, scr.staff_id as staffId,
scr.clerk_id as staffClerkId scr.clerk_id as staffClerkId
from tab_haoban_external_clerk_related as ecr from tab_haoban_external_clerk_related as ecr
left join left join
(select b.staff_id, (select b.staff_id,
a.clerk_id a.clerk_id
from tab_haoban_staff_clerk_relation a from tab_haoban_staff_clerk_relation a
left join tab_haoban_staff b on a.staff_id = b.staff_id and b.status_flag = 1 left join tab_haoban_staff b on a.staff_id = b.staff_id and b.status_flag = 1
where a.clerk_id in where a.clerk_id in
<foreach collection="clerkIdList" item="item" separator="," open="(" close=")"> <foreach collection="clerkIdList" item="item" separator="," open="(" close=")">
#{item} #{item}
</foreach> </foreach>
and a.status_flag = 1 and a.status_flag = 1
group by a.staff_id, a.clerk_id) as scr on scr.staff_id = ecr.staff_id group by a.staff_id, a.clerk_id) as scr on scr.staff_id = ecr.staff_id
where ecr.status_flag = 1 where ecr.status_flag = 1
and ecr.enterprise_id = #{enterpriseId,jdbcType=VARCHAR} and ecr.enterprise_id = #{enterpriseId,jdbcType=VARCHAR}
and ecr.wx_enterprise_id=#{wxEnterpriseId} and ecr.wx_enterprise_id=#{wxEnterpriseId}
and ecr.member_id in and ecr.member_id in
<foreach collection="memberIdList" item="item" separator="," open="(" close=")"> <foreach collection="memberIdList" item="item" separator="," open="(" close=")">
#{item} #{item}
</foreach> </foreach>
) t where t.staffId is not null ) t where t.staffId is not null
</select> </select>
...@@ -535,9 +536,9 @@ ...@@ -535,9 +536,9 @@
#{id,jdbcType=VARCHAR} #{id,jdbcType=VARCHAR}
</foreach> </foreach>
</select> </select>
<update id="deleteByEnterpriseId"> <update id="deleteByEnterpriseId">
update tab_haoban_staff_clerk_relation set status_flag = 0 , update_time=now() where enterprise_id = #{enterpriseId} update tab_haoban_staff_clerk_relation set status_flag = 0 , update_time=now() where enterprise_id = #{enterpriseId}
</update> </update>
</mapper> </mapper>
\ No newline at end of file
...@@ -275,7 +275,7 @@ public class StaffController extends WebBaseController { ...@@ -275,7 +275,7 @@ public class StaffController extends WebBaseController {
@RequestMapping("del-clerk-relation") @RequestMapping("del-clerk-relation")
public HaobanResponse delStaffClerkList(String clerkId) { public HaobanResponse delStaffClerkList(String clerkId) {
WebLoginDTO login = AuthWebRequestUtil.getLoginUser(); WebLoginDTO login = AuthWebRequestUtil.getLoginUser();
boolean b = staffClerkRelationApiService.unbindByStaffAndClerkId(login.getClerkId(), clerkId); boolean b = staffClerkRelationApiService.unbindByStaffAndClerkId(login.getClerkId(), clerkId,ChannelCodeEnum.ADMIN_UNBIND.getCode());
return resultResponse(HaoBanErrCode.ERR_1, b); return resultResponse(HaoBanErrCode.ERR_1, b);
} }
......
...@@ -110,7 +110,7 @@ public class ClerkController extends WebBaseController { ...@@ -110,7 +110,7 @@ public class ClerkController extends WebBaseController {
if (clerk != null) { if (clerk != null) {
long memberCount = distributeApiService.getClerkMemberCount(staffClerkRelationDTO.getEnterpriseId(), clerk.getClerkId(), storeId); long memberCount = distributeApiService.getClerkMemberCount(staffClerkRelationDTO.getEnterpriseId(), clerk.getClerkId(), storeId);
logger.info("【获取会员数】enterpriseId={},clerkId={},storeId={},memberCount={}", staffClerkRelationDTO.getEnterpriseId(), clerk.getClerkId(), storeId, memberCount); logger.info("【获取会员数】enterpriseId={},clerkId={},storeId={},memberCount={}", staffClerkRelationDTO.getEnterpriseId(), clerk.getClerkId(), storeId, memberCount);
staffDTO.setMemberCount(Convert.toInt(memberCount,0)); staffDTO.setMemberCount(Convert.toInt(memberCount, 0));
staffDTO.setClerkId(clerk.getClerkId()); staffDTO.setClerkId(clerk.getClerkId());
staffDTO.setClerkCode(clerk.getClerkCode()); staffDTO.setClerkCode(clerk.getClerkCode());
resultList.add(EntityUtil.changeEntityNew(StaffVO.class, staffDTO)); resultList.add(EntityUtil.changeEntityNew(StaffVO.class, staffDTO));
...@@ -281,9 +281,9 @@ public class ClerkController extends WebBaseController { ...@@ -281,9 +281,9 @@ public class ClerkController extends WebBaseController {
return resultResponse(HaoBanErrCode.ERR_10012); return resultResponse(HaoBanErrCode.ERR_10012);
} }
// 导购code校验-字母和数字 // 导购code校验-字母和数字
if (!clerkCode.matches("[a-zA-Z0-9]+")) { //if (!clerkCode.matches("[a-zA-Z0-9]+")) {
return resultResponse(HaoBanErrCode.ERR_10023); // return resultResponse(HaoBanErrCode.ERR_10023);
} //}
if (version == null) { if (version == null) {
StaffDTO staff = staffApiService.selectByNationcodeAndPhoneNumber(wxEnterpriseId, nationcode, phoneNumber); StaffDTO staff = staffApiService.selectByNationcodeAndPhoneNumber(wxEnterpriseId, nationcode, phoneNumber);
if (staff != null) { if (staff != null) {
...@@ -646,10 +646,10 @@ public class ClerkController extends WebBaseController { ...@@ -646,10 +646,10 @@ public class ClerkController extends WebBaseController {
return !over; return !over;
}).map(EnterpriseDetailDTO::getEnterpriseId).collect(Collectors.toList()); }).map(EnterpriseDetailDTO::getEnterpriseId).collect(Collectors.toList());
List<String> storeIds = wxEnterpriseRelatedApiService.listStoreIdByWxEnterpriseId(wxEnterpriseId); List<String> storeIds = wxEnterpriseRelatedApiService.listStoreIdByWxEnterpriseId(wxEnterpriseId);
if(CollectionUtils.isEmpty(storeIds)) { if (CollectionUtils.isEmpty(storeIds)) {
return resultResponse(HaoBanErrCode.ERR_1, new ArrayList<>()); return resultResponse(HaoBanErrCode.ERR_1, new ArrayList<>());
} }
logger.info("查询到企微门店数={},{}",storeIds.size(),storeIds); logger.info("查询到企微门店数={},{}", storeIds.size(), storeIds);
List<ClerkDTO> clerkList = clerkNewService.listClerkByEnterpriseIdAndSearchAndClerkType(enterpriseIdList, storeIds, keyword); List<ClerkDTO> clerkList = clerkNewService.listClerkByEnterpriseIdAndSearchAndClerkType(enterpriseIdList, storeIds, keyword);
List<ClerkStoreVO> clerkStoreList = buildClerkRelation(clerkList, enterpriseIdList); List<ClerkStoreVO> clerkStoreList = buildClerkRelation(clerkList, enterpriseIdList);
return resultResponse(HaoBanErrCode.ERR_1, clerkStoreList); return resultResponse(HaoBanErrCode.ERR_1, clerkStoreList);
...@@ -919,9 +919,7 @@ public class ClerkController extends WebBaseController { ...@@ -919,9 +919,7 @@ public class ClerkController extends WebBaseController {
return resultResponse(HaoBanErrCode.ERR_111145); return resultResponse(HaoBanErrCode.ERR_111145);
} }
staffClerkRelationApiService.delByStoreIdAndCode(storeId, clerkCode); staffClerkRelationApiService.unbindByStaffAndClerkId(staffId, clerkId, ChannelCodeEnum.SELF_UNBIND.getCode());
//加入日志
staffClerkRelationApiService.pushToBindLog(staffClerkRelation.getStaffId(), clerkId, BindTypeEnum.UNBIND.getVal(), ChannelCodeEnum.SELF_UNBIND.getCode(), staffClerkRelation.getStaffClerkRelationId());
return resultResponse(HaoBanErrCode.ERR_1); return resultResponse(HaoBanErrCode.ERR_1);
} }
...@@ -1014,7 +1012,7 @@ public class ClerkController extends WebBaseController { ...@@ -1014,7 +1012,7 @@ public class ClerkController extends WebBaseController {
if (staffRelation == null) { if (staffRelation == null) {
return resultResponse(HaoBanErrCode.ERR_10006); return resultResponse(HaoBanErrCode.ERR_10006);
} }
// staffApiService.wxGetAdd(staffRelation.getWxUserId(), wxEnterpriseId); // staffApiService.wxGetAdd(staffRelation.getWxUserId(), wxEnterpriseId);
String staffId = staffRelation.getStaffId(); String staffId = staffRelation.getStaffId();
StaffDTO staff = staffApiService.selectById(staffId); StaffDTO staff = staffApiService.selectById(staffId);
if (staff == null) { if (staff == null) {
...@@ -1217,14 +1215,14 @@ public class ClerkController extends WebBaseController { ...@@ -1217,14 +1215,14 @@ public class ClerkController extends WebBaseController {
if (StringUtils.isNotBlank(wxOpenId)) { if (StringUtils.isNotBlank(wxOpenId)) {
return RestResponse.successResult(wxOpenId); return RestResponse.successResult(wxOpenId);
} }
WxEnterpriseQwDTO qwDTO = this.wxEnterpriseApiService.getQwInfo(wxEnterpriseId) ; WxEnterpriseQwDTO qwDTO = this.wxEnterpriseApiService.getQwInfo(wxEnterpriseId);
if (qwDTO == null) { if (qwDTO == null) {
int code = HaoBanErrCode.ERR_400002.getCode(); int code = HaoBanErrCode.ERR_400002.getCode();
return RestResponse.failure(String.valueOf(code), HaoBanErrCode.ERR_400002.getMsg()); return RestResponse.failure(String.valueOf(code), HaoBanErrCode.ERR_400002.getMsg());
} }
String wxUserId = staffDTO.getWxUserId(); String wxUserId = staffDTO.getWxUserId();
if(qwDTO.needOpenUserId3th()) { if (qwDTO.needOpenUserId3th()) {
wxUserId = staffDTO.getWxOpenUseId() ; wxUserId = staffDTO.getWxOpenUseId();
} }
String openid = qywxUserApiService.getSelfOpenIdByUserId(qwDTO.getThirdCorpid(), config.getWxSuiteid(), wxUserId); String openid = qywxUserApiService.getSelfOpenIdByUserId(qwDTO.getThirdCorpid(), config.getWxSuiteid(), wxUserId);
if (StringUtils.isBlank(openid)) { if (StringUtils.isBlank(openid)) {
......
...@@ -387,7 +387,7 @@ public class WxEnterpriseInfoController extends WebBaseController { ...@@ -387,7 +387,7 @@ public class WxEnterpriseInfoController extends WebBaseController {
WxEnterpriseQwDTO qwDTO = this.wxEnterpriseApiService.getQwInfo(wxEnterpriseId) ; WxEnterpriseQwDTO qwDTO = this.wxEnterpriseApiService.getQwInfo(wxEnterpriseId) ;
MemberLoginQo user = new MemberLoginQo(); MemberLoginQo user = new MemberLoginQo();
if (StringUtils.isBlank(qo.getUserId())) { if (StringUtils.isBlank(qo.getUserId())) {
user = getUserByCode(wxEnterpriseId , qwDTO.getThirdCorpid() , qo.getCode(), qo.getGicEnterpriseId()); user = getUserByCode(wxEnterpriseId , qwDTO.getMemberCorpid() , qo.getCode(), qo.getGicEnterpriseId());
if (user == null) { if (user == null) {
logger.info("登录失败,从微信获取用户信息失败"); logger.info("登录失败,从微信获取用户信息失败");
return resultResponse(HaoBanErrCode.ERR_6); return resultResponse(HaoBanErrCode.ERR_6);
......
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