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;
import java.io.Serializable;
/**
*
* @ClassName: QwFrientNoticeDTO
* @Description: 企微加好友通知
* @author xugh
* @date 2022年8月18日 上午10:31:14
*
* @author xugh
* @ClassName: QwFrientNoticeDTO
* @Description: 企微加好友通知
* @date 2022年8月18日 上午10:31:14
*/
public class QwFrientNoticeDTO implements Serializable{
public class QwFrientNoticeDTO implements Serializable {
private static final long serialVersionUID = 1L;
......@@ -48,7 +46,8 @@ public class QwFrientNoticeDTO implements Serializable{
*/
private String state;
private String staffId ;
private String staffId;
private String changeType;
public String getStaffId() {
return staffId;
......@@ -185,4 +184,12 @@ public class QwFrientNoticeDTO implements Serializable{
public void setState(String state) {
this.state = state;
}
public String getChangeType() {
return changeType;
}
public void setChangeType(String changeType) {
this.changeType = changeType;
}
}
package com.gic.haoban.manage.api.service;
import java.util.List;
import com.gic.api.base.commons.JSONResponse;
import com.gic.haoban.base.api.common.ServiceResponse;
import com.gic.haoban.manage.api.dto.ExternalClerkRelatedDTO;
import com.gic.haoban.manage.api.dto.ExternalUserDTO;
import com.gic.haoban.manage.api.dto.FriendStoreInfoDTO;
import com.gic.haoban.manage.api.dto.MemberStoreDTO;
import com.gic.haoban.manage.api.dto.MemberUnionidRelatedDTO;
import com.gic.haoban.manage.api.dto.QwFrientNoticeDTO;
import com.gic.haoban.manage.api.dto.*;
import java.util.List;
public interface MemberUnionidRelatedApiService {
......@@ -257,4 +252,14 @@ public interface MemberUnionidRelatedApiService {
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 {
/**
* 审核绑定
*
* @param staffClerkRelation
* @param optStaffId
* @param channelCode
*/
void delAndInsert(StaffClerkRelationDTO staffClerkRelation, String optStaffId, int channelCode);
/**
* 解绑
*
* @param storeId
* @param clerkCode
* 解绑导购
* @param staffId
* @param clerkId
* @param channelCode
* @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);
......@@ -70,15 +81,6 @@ public interface StaffClerkRelationApiService {
List<StaffClerkRelationDTO> listByStoreId(String storeId);
/**
* 解绑
*
* @param staffId 操作人
* @param clerkId
* @return
*/
boolean unbindByStaffAndClerkId(String staffId, String clerkId);
/**
* 查询导购信息
*
* @param clerkId
......@@ -104,13 +106,6 @@ public interface StaffClerkRelationApiService {
List<StaffClerkRelationDTO> listByEnterpriseIdAndStaffid(String enterpriseId, String staffid);
/**
* 删除关联关系
*
* @param clerkId
*/
void delByClerkId(String clerkId);
/**
* 搜索查询列表
*
* @param wxEnterpriseId
......@@ -171,7 +166,7 @@ public interface StaffClerkRelationApiService {
* @author mozhu
* @date 2022-06-20 22:46:46
*/
List<StaffClerkRelationDTO> listByStaffId(String wxEnterpriseId,String staffId);
List<StaffClerkRelationDTO> listByStaffId(String wxEnterpriseId, String staffId);
/**
* 通过职员id 查询职员id列表
......@@ -182,7 +177,7 @@ public interface StaffClerkRelationApiService {
* @author mozhu
* @date 2022-07-07 17:28:01
*/
List<StaffClerkRelationDTO> listClerkIdConcatFlagByClerkIds(List<String> clerkIds,String wxEnterpriseId);
List<StaffClerkRelationDTO> listClerkIdConcatFlagByClerkIds(List<String> clerkIds, String wxEnterpriseId);
/**
......@@ -196,16 +191,15 @@ public interface StaffClerkRelationApiService {
void clerkStoreMoveDel(String param);
/**
*
* @Title: getCanAddHmCount
* @Description: 获取能创建活码的导购数量
* @author xugh
* @param enterpriseId
* @param wxEnterpriseId
* @return
* @throws
* @Title: getCanAddHmCount
* @Description: 获取能创建活码的导购数量
* @author xugh
*/
int getCanAddHmCount(String enterpriseId , String wxEnterpriseId , String clerkId) ;
int getCanAddHmCount(String enterpriseId, String wxEnterpriseId, String clerkId);
List<String> listStaffIdByWxEnterpriseId(String wxEnterpriseId);
......
......@@ -26,6 +26,8 @@ public class Config {
private String hmLinkUrl;
@Value("${qywx_hbzs_suite}")
private String qywxHbzsSuite;
@Value("${addDelFriendEvent}")
private String addDelFriendEvent;
public String getHmLinkUrl() {
return hmLinkUrl;
......@@ -90,4 +92,12 @@ public class Config {
public void setQywxHbzsSuite(String 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;
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.service.entity.TabHaobanExternalClerkRelated;
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 {
......@@ -158,6 +157,7 @@ public interface TabHaobanExternalClerkRelatedMapper {
List<ExternalClerkRelatedDTO> listByMemberIdList(@Param("memberIdList") List<String> memberIdList,
@Param("wxEnterpriseId") String wxEnterpriseId,
@Param("enterpriseId") String enterpriseId);
/**
* 获取最新的最近的外部联系人
*
......@@ -270,7 +270,7 @@ public interface TabHaobanExternalClerkRelatedMapper {
* 根据企业id分页
*
* @param wxEnterpriseId 企业标识
* @return {@link List<TabHaobanWxEnterprise> }
* @return {@link List<TabHaobanExternalClerkRelated> }
* @author mozhu
* @date 2021-12-13 14:59:03
*/
......@@ -318,7 +318,8 @@ public interface TabHaobanExternalClerkRelatedMapper {
* @param staffId wx用户id
* @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);
/**
......@@ -356,5 +357,16 @@ public interface TabHaobanExternalClerkRelatedMapper {
@Param("enterpriseId") String enterpriseId);
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 {
*/
void delByUserIdAndExternalUserIdBatch(String wxEnterpriseId, String staffId, List<String> externalUserids);
void delByClerkIdAndStaffId(String clerkId, String staffId);
void delByStoreIdAndStaffId(String storeId, String staffId);
void delByStoreIds(Collection<String> storeIds);
......@@ -38,7 +36,7 @@ public interface ExternalClerkRelatedService {
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);
......@@ -73,4 +71,13 @@ public interface ExternalClerkRelatedService {
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 {
List<StaffClerkRelationDTO> listBindCodeByStaffId(List<String> enterpriseIdList, String staffId);
/**
* 删除绑定
* 解绑-删除绑定(导购级别)
*
* @param clerkId
* @return
......@@ -23,7 +23,7 @@ public interface StaffClerkRelationService {
boolean delBind(String clerkId, String optStaffId, int channelCode);
/**
* 删除绑定
* 解绑-删除绑定(门店级别)
*
* @param wxEnterpriseId 可以不传
* @param storeIds
......
......@@ -66,6 +66,10 @@ public class ClerkMainStoreRelatedServiceImpl implements ClerkMainStoreRelatedSe
logger.info("切换主门店-刷新企业微信好友:{},{}", staffId, storeId);
//主门店切换需要刷新企业微信好友
TabHaobanStaff staff = staffService.selectById(staffId);
if (staff == null) {
logger.info("员工不存在:{}",staffId);
return;
}
String taskName = "自动刷新企业微信好友(" + staff.getStaffName() + ")";
String taskId = dealSyncOperationApiService.createWxFriendTaskSingle(wxEnterpriseId, taskName, staffId, staff.getStaffName(), SyncTaskTypeEnum.FRIEND_SINGLE.getType());
if (StringUtils.isBlank(taskId)) {
......
......@@ -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.TabHaobanStaffClerkRelation;
import com.gic.haoban.manage.service.service.*;
import com.gic.member.api.service.MemberApiService;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.apache.commons.collections.CollectionUtils;
......@@ -60,6 +61,8 @@ public class StaffClerkRelationServiceImpl implements StaffClerkRelationService
private HmClerkRelationApiService hmClerkRelationApiService;
@Autowired
private WxEnterpriseService wxEnterpriseService;
@Autowired
private MemberApiService memberApiService;
@Override
public List<StaffClerkRelationDTO> listBindCode(String enterpriseId, Set<String> clerkCodeList) {
......@@ -80,17 +83,20 @@ public class StaffClerkRelationServiceImpl implements StaffClerkRelationService
}
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());
boolean b = i >= 0;
if (b) {
//推入日志
staffClerkBindLogService.pushToMq(clerkRelation.getStaffId(), optStaffId, BindTypeEnum.UNBIND.getVal(), channelCode, clerkRelation.getStaffClerkRelationId());
//废弃活码
hmClerkRelationApiService.delByClerkId(clerkId, clerkRelation.getEnterpriseId(), clerkRelation.getWxEnterpriseId(), channelCode);
}
return b;
hmClerkRelationApiService.delByClerkId(clerkId, enterpriseId, clerkRelation.getWxEnterpriseId(), channelCode);
return i > 0;
}
@Override
......@@ -102,21 +108,27 @@ public class StaffClerkRelationServiceImpl implements StaffClerkRelationService
List<TabHaobanStaffClerkRelation> needUnbind = mapper.listBindByStoreIds(wxEnterpriseId, storeIds);
if (CollectionUtils.isEmpty(needUnbind)) {
logger.info("没有门店绑定了需要解绑的:{}", wxEnterpriseId);
return true;
}
//清除绑定
mapper.delByStoreIds(storeIds);
//删除主门店
clerkMainStoreRelatedService.delMainStoreByStoreIds(storeIds);
List<String> need = needUnbind.stream().map(tab -> tab.getStaffClerkRelationId()).collect(Collectors.toList());
//放入队列
staffClerkBindLogService.pushToMqBatch(optStaffId, BindTypeEnum.UNBIND.getVal(), channelCode, need);
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;
}
......
......@@ -171,12 +171,6 @@ public class StoreRangeServiceImpl implements StoreRangeService {
* @param addStoreIds
*/
private void dealStoreRelation(List<TabStoreRelation> storeRelations, String enterpriseId, Set<String> delStoreIds, Set<String> addStoreIds) {
// //先删除 后新增
// tabHaobanStoreRelationMapper.deleteAllStoreRalation(enterpriseId);
// //批量插入
// insertStoreRelationBatch(storeRelations);
//先删除 后新增
if (CollectionUtils.isNotEmpty(delStoreIds)) {
logger.info("批量删除门店:{}", JSONObject.toJSONString(delStoreIds));
......
......@@ -202,15 +202,11 @@ public class AuditApiServiceImpl implements AuditApiService {
if (StringUtils.isNotBlank(batchId)) {
insertBatchLog(batchId, AuditRsultType.success.getCode(), tab);
}
//解绑日志
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());
staffClerkRelationApiService.unbindByStaffAndClerkId(optStaffId,obj.getClerkId(),ChannelCodeEnum.AUDIT_UNBIND.getCode());
staffDepartmentRelatedApiService.sendClerkDel(obj.getClerkName(), obj.getClerkCode(), tab.getCommitStoreId(), 1, "");
} else if (auditType == AuditType.CLERK_UNBIND.getCode()) {
//解绑申请,无需审核,直接通过
logger.info("解绑申请,无需审核,直接通过");
}
tab.setAuditStatus(1);
auditMapper.updateByPrimaryKeySelective(tab);
......
......@@ -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.ServiceResponse;
import com.gic.haoban.manage.api.dto.*;
import com.gic.haoban.manage.api.enums.AppPageType;
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.enums.*;
import com.gic.haoban.manage.api.service.MessageApiService;
import com.gic.haoban.manage.api.service.StaffApiService;
import com.gic.haoban.manage.api.service.StaffClerkRelationApiService;
......@@ -316,7 +313,7 @@ public class MessageApiServiceImpl implements MessageApiService {
List<StaffClerkRelationDTO> staffClerkRelationDTOS = staffClerkRelationApiService.listByStaffId(wxEnterpriseId, staffId);
if (CollectionUtils.isNotEmpty(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 {
if(qwDTO.getWxSecurityType()==4) {
list = qywxUserApiService.useridToOpenuserid(qwDTO.getThirdCorpid(), config.getWxSuiteid(), Collections.singletonList(userId));
}else {
TabHaobanWxApplication app = wxApplicationService.selectByCorpId(corpid);
list = qywxUserApiService.useridToOpenuserid(qwDTO.getDkCorpid(), app.getSiteId() , Collections.singletonList(userId));
SecretSettingDTO set = this.secretSettingService.getSecretSetting(qwDTO.getWxEnterpriseId(), SecretTypeEnum.CUSTOMIZED_APP.getVal()) ;
list = qywxUserApiService.getSelfUseridToOpenuserid(qwDTO.getDkCorpid(), set.getSecretVal() , Collections.singletonList(userId));
}
logger.info("明文userId转密文={},{}",userId , JSON.toJSONString(list));
if (CollectionUtils.isEmpty(list)) {
......
......@@ -209,12 +209,10 @@ public class StaffClerkRelationApiServiceImpl implements StaffClerkRelationApiSe
@Override
public void delByStoreIdAndCode(String storeId, String clerkCode) {
TabHaobanStaffClerkRelation staffClerkRelation = tabHaobanStaffClerkRelationMapper.getByCodeAndStoreId(clerkCode, storeId);
//删除绑定关系
tabHaobanStaffClerkRelationMapper.delByStoreIdAndCode(storeId, clerkCode);
//删除主门店
delSetMainStore(staffClerkRelation, ChannelCodeEnum.SELF_UNBIND.getCode());
public void delBindByStoreId(String wxEnterpriseId,String storeId, String staffId,int channelCode) {
Set<String> needUnBindStoreIds = new HashSet<>();
needUnBindStoreIds.add(storeId);
staffClerkRelationService.delBindByStoreIds(wxEnterpriseId, needUnBindStoreIds, staffId, ChannelCodeEnum.SELF_UNBIND.getCode());
}
@Override
......@@ -236,8 +234,8 @@ public class StaffClerkRelationApiServiceImpl implements StaffClerkRelationApiSe
}
@Override
public boolean unbindByStaffAndClerkId(String staffId, String clerkId) {
return staffClerkRelationService.delBind(clerkId, staffId, ChannelCodeEnum.ADMIN_UNBIND.getCode());
public boolean unbindByStaffAndClerkId(String staffId, String clerkId,int channelCode) {
return staffClerkRelationService.delBind(clerkId, staffId, channelCode);
}
@Override
......@@ -280,28 +278,6 @@ public class StaffClerkRelationApiServiceImpl implements StaffClerkRelationApiSe
}
@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) {
List<TabHaobanStaffClerkRelation> list = tabHaobanStaffClerkRelationMapper.listByEnterpriseIdAndStaffid(enterpriseId, staffid);
return EntityUtil.changeEntityListByJSON(StaffClerkRelationDTO.class, list);
......
......@@ -316,6 +316,9 @@ public class HmQrcodeApiServiceImpl implements HmQrcodeApiService {
return ServiceResponse.failure(Convert.toStr(HaoBanErrCodeCommon.ERR_8.getCode()), "该活码不存在");
}
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);
if (CollectionUtils.isEmpty(clerkIdList)) {
return ServiceResponse.failure(Convert.toStr(HaoBanErrCodeCommon.ERR_8.getCode()), "该导购已经生成过活码或未关联过好办");
......
......@@ -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.CommunicationService" id="communicationService" timeout="10000" retries="0"/>
<dubbo:reference interface="com.gic.member.api.service.MemberEntranceApiService" id="memberEntranceApiService" timeout="10000" retries="0"/>
</beans>
\ No newline at end of file
......@@ -281,6 +281,9 @@
<select id="pageStaff" resultMap="BaseResultMap">
select
a.*
<if test="departmentIds != null and departmentIds.size() > 0">
, b.department_id departmentIds
</if>
from tab_haoban_staff a
<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
......
......@@ -426,7 +426,6 @@
<foreach collection="statusFlags" item="item" separator="," open="(" close=")">
#{item}
</foreach>
order by update_time desc
</select>
<update id="pushExternalByRelationKey">
......@@ -653,6 +652,8 @@
</if>
order by create_time desc limit 1
</select>
<select id="countByMemberId" resultType="int">
select count(*)
from tab_haoban_external_clerk_related
......@@ -667,4 +668,13 @@
limit ${startItem},${pageSize}
</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>
\ No newline at end of file
......@@ -196,7 +196,8 @@
</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
a.staff_clerk_relation_id staffClerkRelationId,
a.staff_id staffId,
......
......@@ -275,7 +275,7 @@ public class StaffController extends WebBaseController {
@RequestMapping("del-clerk-relation")
public HaobanResponse delStaffClerkList(String clerkId) {
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);
}
......
......@@ -110,7 +110,7 @@ public class ClerkController extends WebBaseController {
if (clerk != null) {
long memberCount = distributeApiService.getClerkMemberCount(staffClerkRelationDTO.getEnterpriseId(), clerk.getClerkId(), storeId);
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.setClerkCode(clerk.getClerkCode());
resultList.add(EntityUtil.changeEntityNew(StaffVO.class, staffDTO));
......@@ -281,9 +281,9 @@ public class ClerkController extends WebBaseController {
return resultResponse(HaoBanErrCode.ERR_10012);
}
// 导购code校验-字母和数字
if (!clerkCode.matches("[a-zA-Z0-9]+")) {
return resultResponse(HaoBanErrCode.ERR_10023);
}
//if (!clerkCode.matches("[a-zA-Z0-9]+")) {
// return resultResponse(HaoBanErrCode.ERR_10023);
//}
if (version == null) {
StaffDTO staff = staffApiService.selectByNationcodeAndPhoneNumber(wxEnterpriseId, nationcode, phoneNumber);
if (staff != null) {
......@@ -646,10 +646,10 @@ public class ClerkController extends WebBaseController {
return !over;
}).map(EnterpriseDetailDTO::getEnterpriseId).collect(Collectors.toList());
List<String> storeIds = wxEnterpriseRelatedApiService.listStoreIdByWxEnterpriseId(wxEnterpriseId);
if(CollectionUtils.isEmpty(storeIds)) {
if (CollectionUtils.isEmpty(storeIds)) {
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<ClerkStoreVO> clerkStoreList = buildClerkRelation(clerkList, enterpriseIdList);
return resultResponse(HaoBanErrCode.ERR_1, clerkStoreList);
......@@ -919,9 +919,7 @@ public class ClerkController extends WebBaseController {
return resultResponse(HaoBanErrCode.ERR_111145);
}
staffClerkRelationApiService.delByStoreIdAndCode(storeId, clerkCode);
//加入日志
staffClerkRelationApiService.pushToBindLog(staffClerkRelation.getStaffId(), clerkId, BindTypeEnum.UNBIND.getVal(), ChannelCodeEnum.SELF_UNBIND.getCode(), staffClerkRelation.getStaffClerkRelationId());
staffClerkRelationApiService.unbindByStaffAndClerkId(staffId, clerkId, ChannelCodeEnum.SELF_UNBIND.getCode());
return resultResponse(HaoBanErrCode.ERR_1);
}
......@@ -1217,14 +1215,14 @@ public class ClerkController extends WebBaseController {
if (StringUtils.isNotBlank(wxOpenId)) {
return RestResponse.successResult(wxOpenId);
}
WxEnterpriseQwDTO qwDTO = this.wxEnterpriseApiService.getQwInfo(wxEnterpriseId) ;
WxEnterpriseQwDTO qwDTO = this.wxEnterpriseApiService.getQwInfo(wxEnterpriseId);
if (qwDTO == null) {
int code = HaoBanErrCode.ERR_400002.getCode();
return RestResponse.failure(String.valueOf(code), HaoBanErrCode.ERR_400002.getMsg());
}
String wxUserId = staffDTO.getWxUserId();
if(qwDTO.needOpenUserId3th()) {
wxUserId = staffDTO.getWxOpenUseId() ;
if (qwDTO.needOpenUserId3th()) {
wxUserId = staffDTO.getWxOpenUseId();
}
String openid = qywxUserApiService.getSelfOpenIdByUserId(qwDTO.getThirdCorpid(), config.getWxSuiteid(), wxUserId);
if (StringUtils.isBlank(openid)) {
......
......@@ -387,7 +387,7 @@ public class WxEnterpriseInfoController extends WebBaseController {
WxEnterpriseQwDTO qwDTO = this.wxEnterpriseApiService.getQwInfo(wxEnterpriseId) ;
MemberLoginQo user = new MemberLoginQo();
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) {
logger.info("登录失败,从微信获取用户信息失败");
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