Commit 31a61f94 by 墨竹

fix:增加查询条件

parent dc5e996b
......@@ -105,6 +105,7 @@ public interface HmQrcodeApiService {
/**
* 检查员工开启联系我
* 定时任务
*
* @param param 参数
* @author mozhu
* @date 2022-07-07 14:25:54
......@@ -118,7 +119,7 @@ public interface HmQrcodeApiService {
* @author mozhu
* @date 2022-07-19 15:53:37
*/
void checkStaffOpenContactByWxEnterpriseId(String wxEnterpriseId);
void checkStaffOpenContactByWxEnterpriseId(String wxEnterpriseId, String enterpriseId);
/**
......@@ -129,22 +130,22 @@ public interface HmQrcodeApiService {
* @author mozhu
* @date 2022-07-08 15:07:15
*/
List<HmQrcodeStoreDTO> getHmStoreByEnterpriseId(String wxEnterpriseId , String enterpriseId);
List<HmQrcodeStoreDTO> getHmStoreByEnterpriseId(String wxEnterpriseId, String enterpriseId);
/**
*
* @Title: getHmStoreForWxa
* @Description: 返回小程序有活码的门店列表
* @author xugh
* @param enterpriseId
* @return
* @throws
* @param enterpriseId
* @return
* @throws
* @Title: getHmStoreForWxa
* @Description: 返回小程序有活码的门店列表
* @author xugh
*/
List<String> getHmStoreForWxa(String wxEnterpriseId ,String enterpriseId) ;
List<String> getHmStoreForWxa(String wxEnterpriseId, String enterpriseId);
/**
* 批量修改活码分组
*
* @param hmIds
* @param groupId
* @return
......@@ -153,16 +154,15 @@ public interface HmQrcodeApiService {
/**
*
* @Title: listHmIdForIndex
* @Description: 返回活码id列表,用于首页列表查询
* @author xugh
* @param qdto
* @return
* @throws
* @param qdto
* @return
* @throws
* @Title: listHmIdForIndex
* @Description: 返回活码id列表, 用于首页列表查询
* @author xugh
*/
ServiceResponse<List<String>> listHmIdForIndex(HmQrcodeListQDTO qdto) ;
ServiceResponse<List<String>> listHasQrcodeClerk(String enterpriseId , List<String> clerkIdList) ;
ServiceResponse<List<String>> listHmIdForIndex(HmQrcodeListQDTO qdto);
ServiceResponse<List<String>> listHasQrcodeClerk(String enterpriseId, List<String> clerkIdList);
}
......@@ -18,9 +18,9 @@ public interface TabHaobanStaffClerkRelationMapper {
int updateByPrimaryKeySelective(TabHaobanStaffClerkRelation record);
List<TabHaobanStaffClerkRelation> listBindCode(@Param("enterpriseId")String enterpriseId, @Param("clerkCodeList")Set<String> clerkCodeList);
List<TabHaobanStaffClerkRelation> listBindCode(@Param("enterpriseId") String enterpriseId, @Param("clerkCodeList") Set<String> clerkCodeList);
List<TabHaobanStaffClerkRelation> listBindCodeByStaffId(@Param("enterpriseIdList")List<String> enterpriseIdList, @Param("staffId")String staffId);
List<TabHaobanStaffClerkRelation> listBindCodeByStaffId(@Param("enterpriseIdList") List<String> enterpriseIdList, @Param("staffId") String staffId);
TabHaobanStaffClerkRelation getOneByClerkId(@Param("clerkId") String clerkId);
......@@ -35,6 +35,7 @@ public interface TabHaobanStaffClerkRelationMapper {
/**
* 更新信息
*
* @param record
* @return
*/
......@@ -47,13 +48,14 @@ public interface TabHaobanStaffClerkRelationMapper {
* @param wxEnterpriseId
* @return
*/
TabHaobanStaffClerkRelation getBindByClerkId(@Param("clerkId") String clerkId,@Param("wxEnterpriseId") String wxEnterpriseId);
TabHaobanStaffClerkRelation getByCodeAndEnterpriseId(@Param("clerkCode")String clerkCode, @Param("enterpriseId")String enterpriseId);
TabHaobanStaffClerkRelation getBindByClerkId(@Param("clerkId") String clerkId, @Param("wxEnterpriseId") String wxEnterpriseId);
TabHaobanStaffClerkRelation getByCodeAndEnterpriseId(@Param("clerkCode") String clerkCode, @Param("enterpriseId") String enterpriseId);
/**
* 解绑
*/
void delByStoreIdAndCode( @Param("storeId")String storeId,@Param("clerkCode")String clerkCode);
void delByStoreIdAndCode(@Param("storeId") String storeId, @Param("clerkCode") String clerkCode);
/**
......@@ -66,36 +68,36 @@ public interface TabHaobanStaffClerkRelationMapper {
*/
List<StaffClerkRelationDTO> listByClerkIds(@Param("clerkIds") List<String> clerkIds);
List<TabHaobanStaffClerkRelation> listByStoreId(@Param("storeId")String storeId);
TabHaobanStaffClerkRelation getOneByStoreIdAndStaffId(@Param("storeId")String storeId,@Param("staffId")String staffId);
List<TabHaobanStaffClerkRelation> listByStoreId(@Param("storeId") String storeId);
TabHaobanStaffClerkRelation getOneByStoreIdAndStaffId(@Param("storeId") String storeId, @Param("staffId") String staffId);
/**
* 解绑
*/
int cleanStaffDepart( @Param("wxEnterpriseId")String wxEnterpriseId,@Param("staffIds")List<String> staffIds);
int cleanStaffDepart(@Param("wxEnterpriseId") String wxEnterpriseId, @Param("staffIds") List<String> staffIds);
TabHaobanStaffClerkRelation getOneBindCodeNoStatus(@Param("enterpriseId") String enterpriseId, @Param("clerkCode") String clerkCode);
TabHaobanStaffClerkRelation getOneBindStoreId(@Param("staffId") String staffId, @Param("storeId") String storeId);
TabHaobanStaffClerkRelation getByClerkId(@Param("clerkId") String clerkId);
TabHaobanStaffClerkRelation getOneBindCodeNoStatus(@Param("enterpriseId")String enterpriseId, @Param("clerkCode")String clerkCode);
TabHaobanStaffClerkRelation getByClerkIdNoStatus(@Param("clerkId") String clerkId);
TabHaobanStaffClerkRelation getOneBindStoreId(@Param("staffId")String staffId, @Param("storeId")String storeId);
int delByPrimaryKey(@Param("staffClerkRelationId") String staffClerkRelationId);
TabHaobanStaffClerkRelation getByClerkId(@Param("clerkId")String clerkId);
void delByClerkId(@Param("clerkId") String clerkId);
TabHaobanStaffClerkRelation getByClerkIdNoStatus(@Param("clerkId")String clerkId);
List<TabHaobanStaffClerkRelation> listByEnterpriseIdAndWxUserId(@Param("enterpriseId") String enterpriseId, @Param("wxUserId") String wxUserId);
int delByPrimaryKey(@Param("staffClerkRelationId")String staffClerkRelationId);
void delByClerkId(@Param("clerkId")String clerkId);
List<TabHaobanStaffClerkRelation>listByEnterpriseIdAndWxUserId(@Param("enterpriseId")String enterpriseId,@Param("wxUserId")String wxUserId);
List<TabHaobanStaffClerkRelation> lisByStaffId(@Param("wxEnterpriseId") String wxEnterpriseId, @Param("staffId") String staffId, @Param("storeIdList") List<String> storeIdList);
List<TabHaobanStaffClerkRelation> lisByStaffId(@Param("wxEnterpriseId")String wxEnterpriseId, @Param("staffId")String staffId , @Param("storeIdList") List<String> storeIdList);
TabHaobanStaffClerkRelation getByCodeAndStoreId(@Param("clerkCode") String clerkCode, @Param("storeId") String storeId);
TabHaobanStaffClerkRelation getByCodeAndStoreId(@Param("clerkCode")String clerkCode, @Param("storeId")String storeId);
List<TabHaobanStaffClerkRelation> listByWxEnterpriseId(@Param("wxEnterpriseId")String wxEnterpriseId);
List<TabHaobanStaffClerkRelation> listByWxEnterpriseId(@Param("wxEnterpriseId") String wxEnterpriseId);
List<TabHaobanStaffClerkRelation> pageByWxEnterpriseId(@Param("wxEnterpriseId")String wxEnterpriseId);
List<TabHaobanStaffClerkRelation> pageByWxEnterpriseId(@Param("wxEnterpriseId") String wxEnterpriseId);
List<TabHaobanStaffClerkRelation> listBindByStoreId(@Param("wxEnterpriseId") String wxEnterpriseId, @Param("storeId") String storeId);
......@@ -145,8 +147,8 @@ public interface TabHaobanStaffClerkRelationMapper {
* 查询有关联的员工id列表
*
* @param staffIdList 员工id列表
* @author: YongEn
* @return {@link List<String>}
* @author: YongEn
*/
List<String> listRelationsStaffId(@Param("staffIdList") Set<String> staffIdList);
......@@ -154,7 +156,7 @@ public interface TabHaobanStaffClerkRelationMapper {
* 批量查询会员与导购关系并且返回关联信息
*
* @param memberIdList 会员id列表
* @param clerkIdList 导购id列表
* @param clerkIdList 导购id列表
* @param enterpriseId 企业id
* @return {@link MemberStaffRelExtDO}
*/
......@@ -208,12 +210,14 @@ public interface TabHaobanStaffClerkRelationMapper {
*
* @param wxOpenUserIds wx开放用户id
* @param wxEnterpriseId wx企业标识
* @return {@link List }<{@link String }>
* @param enterpriseId 企业标识
* @return {@link List }<{@link StaffClerkRelationDTO }>
* @author mozhu
* @date 2022-07-07 15:26:32
* @date 2022-08-08 21:51:22
*/
List<StaffClerkRelationDTO> listIdsByWxOpenUserIds(@Param("wxOpenUserIds") List<String> wxOpenUserIds,
@Param("wxEnterpriseId") String wxEnterpriseId);
@Param("wxEnterpriseId") String wxEnterpriseId,
@Param("enterpriseId") String enterpriseId);
/**
* 更新联系我状态
......@@ -235,7 +239,9 @@ public interface TabHaobanStaffClerkRelationMapper {
* @author mozhu
* @date 2022-07-07 16:12:05
*/
List<StaffClerkRelationDTO> listIdsByNotInWxOpenUserIds(List<String> wxOpenUserIds, String wxEnterpriseId);
List<StaffClerkRelationDTO> listIdsByNotInWxOpenUserIds(@Param("wxOpenUserIds") List<String> wxOpenUserIds,
@Param("wxEnterpriseId") String wxEnterpriseId,
@Param("enterpriseId") String enterpriseId);
/**
* 通过职员id 查询职员id列表
......@@ -247,5 +253,5 @@ public interface TabHaobanStaffClerkRelationMapper {
* @date 2022-07-07 16:30:32
*/
List<StaffClerkRelationDTO> listClerkIdConcatFlagByClerkIds(@Param("clerkIds") List<String> clerkIds,
@Param("wxEnterpriseId") String wxEnterpriseId);
@Param("wxEnterpriseId") String wxEnterpriseId);
}
\ No newline at end of file
......@@ -175,7 +175,7 @@ public interface StaffClerkRelationService {
* @author mozhu
* @date 2022-07-07 15:25:57
*/
List<StaffClerkRelationDTO> listIdsByWxOpenUserIds(List<String> wxOpenUserIds,String wxEnterpriseId);
List<StaffClerkRelationDTO> listIdsByWxOpenUserIds(List<String> wxOpenUserIds,String wxEnterpriseId,String enterpriseId);
/**
......@@ -183,11 +183,12 @@ public interface StaffClerkRelationService {
*
* @param wxOpenUserIds wx开放用户id
* @param wxEnterpriseId wx企业标识
* @param enterpriseId 企业标识
* @return {@link List }<{@link StaffClerkRelationDTO }>
* @author mozhu
* @date 2022-07-07 16:11:25
* @date 2022-08-08 21:51:52
*/
List<StaffClerkRelationDTO> listIdsByNotInWxOpenUserIds(List<String> wxOpenUserIds,String wxEnterpriseId);
List<StaffClerkRelationDTO> listIdsByNotInWxOpenUserIds(List<String> wxOpenUserIds,String wxEnterpriseId,String enterpriseId);
/**
......
......@@ -326,13 +326,13 @@ public class StaffClerkRelationServiceImpl implements StaffClerkRelationService
}
@Override
public List<StaffClerkRelationDTO> listIdsByWxOpenUserIds(List<String> wxOpenUserIds, String wxEnterpriseId) {
return mapper.listIdsByWxOpenUserIds(wxOpenUserIds, wxEnterpriseId);
public List<StaffClerkRelationDTO> listIdsByWxOpenUserIds(List<String> wxOpenUserIds, String wxEnterpriseId,String enterpriseId) {
return mapper.listIdsByWxOpenUserIds(wxOpenUserIds, wxEnterpriseId, enterpriseId);
}
@Override
public List<StaffClerkRelationDTO> listIdsByNotInWxOpenUserIds(List<String> wxOpenUserIds, String wxEnterpriseId) {
return mapper.listIdsByNotInWxOpenUserIds(wxOpenUserIds, wxEnterpriseId);
public List<StaffClerkRelationDTO> listIdsByNotInWxOpenUserIds(List<String> wxOpenUserIds, String wxEnterpriseId,String enterpriseId) {
return mapper.listIdsByNotInWxOpenUserIds(wxOpenUserIds, wxEnterpriseId,enterpriseId);
}
@Override
......
......@@ -728,7 +728,7 @@ public class HmQrcodeApiServiceImpl implements HmQrcodeApiService {
}
//企微已经开启联系我
List<String> wxUserIdsList = qywxUserApiService.listCorpExternalUser(wxEnterpriseDTO.getCorpid(), config.getWxSuiteid());
List<StaffClerkRelationDTO> staffClerkRelationDTOS = staffClerkRelationService.listIdsByWxOpenUserIds(wxUserIdsList, wxEnterpriseId);
List<StaffClerkRelationDTO> staffClerkRelationDTOS = staffClerkRelationService.listIdsByWxOpenUserIds(wxUserIdsList, wxEnterpriseId,enterpriseId);
if (CollectionUtils.isEmpty(staffClerkRelationDTOS)) {
logger.error("无导购关联数据");
continue;
......@@ -748,7 +748,7 @@ public class HmQrcodeApiServiceImpl implements HmQrcodeApiService {
add(hmQrcodeQDTO);
}
List<StaffClerkRelationDTO> relationDTOS = staffClerkRelationService.listIdsByNotInWxOpenUserIds(wxUserIdsList, wxEnterpriseId);
List<StaffClerkRelationDTO> relationDTOS = staffClerkRelationService.listIdsByNotInWxOpenUserIds(wxUserIdsList, wxEnterpriseId,enterpriseId);
if (CollectionUtils.isEmpty(relationDTOS)) {
logger.error("无导购不包含关联数据");
continue;
......@@ -769,12 +769,12 @@ public class HmQrcodeApiServiceImpl implements HmQrcodeApiService {
}
@Override
public void checkStaffOpenContactByWxEnterpriseId(String wxEnterpriseId) {
public void checkStaffOpenContactByWxEnterpriseId(String wxEnterpriseId,String enterpriseId) {
WxEnterpriseDTO wxEnterpriseDTO = wxEnterpriseService.selectById(wxEnterpriseId);
//查询出所有正常的导购
//企微已经开启联系我
List<String> wxUserIdsList = qywxUserApiService.listCorpExternalUser(wxEnterpriseDTO.getCorpid(), config.getWxSuiteid());
List<StaffClerkRelationDTO> staffClerkRelationDTOS = staffClerkRelationService.listIdsByWxOpenUserIds(wxUserIdsList, wxEnterpriseId);
List<StaffClerkRelationDTO> staffClerkRelationDTOS = staffClerkRelationService.listIdsByWxOpenUserIds(wxUserIdsList, wxEnterpriseId,enterpriseId);
if (CollectionUtils.isEmpty(staffClerkRelationDTOS)) {
logger.error("无导购关联数据");
return;
......@@ -794,7 +794,7 @@ public class HmQrcodeApiServiceImpl implements HmQrcodeApiService {
add(hmQrcodeQDTO);
}
List<StaffClerkRelationDTO> relationDTOS = staffClerkRelationService.listIdsByNotInWxOpenUserIds(wxUserIdsList, wxEnterpriseId);
List<StaffClerkRelationDTO> relationDTOS = staffClerkRelationService.listIdsByNotInWxOpenUserIds(wxUserIdsList, wxEnterpriseId,enterpriseId);
if (CollectionUtils.isEmpty(relationDTOS)) {
logger.error("无导购不包含关联数据");
return;
......
......@@ -491,6 +491,7 @@
left join tab_haoban_staff b on b.staff_id = a.staff_id
where a.status_flag=1 and b.status_flag = 1
and a.wx_enterprise_id = #{wxEnterpriseId}
and a.enterprise_id = #{enterpriseId}
and b.wx_open_user_id in
<foreach collection="wxOpenUserIds" item="id" index="index" open="(" close=")" separator=",">
#{id,jdbcType=VARCHAR}
......@@ -522,6 +523,7 @@
left join tab_haoban_staff b on b.staff_id = a.staff_id
where a.status_flag=1 and b.status_flag = 1
and a.wx_enterprise_id = #{wxEnterpriseId}
and a.enterprise_id = #{enterpriseId}
and b.wx_open_user_id not in
<foreach collection="wxOpenUserIds" item="id" index="index" open="(" close=")" separator=",">
#{id,jdbcType=VARCHAR}
......
......@@ -54,6 +54,6 @@ public class ServiceTest {
@Test
public void test2() {
hmQrcodeApiService.checkStaffOpenContactByWxEnterpriseId("5bd929fd3b2c49deaa1184bcb0d669b3");
hmQrcodeApiService.checkStaffOpenContactByWxEnterpriseId("5bd929fd3b2c49deaa1184bcb0d669b3","ff8080815dacd3a2015dacd3ef5c0000");
}
}
package com.gic.haoban.manage.web.controller;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.TimeUnit;
import java.util.stream.Collectors;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.redisson.api.RRateLimiter;
import org.redisson.api.RateIntervalUnit;
import org.redisson.api.RateType;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import com.alibaba.fastjson.JSON;
import com.ctrip.framework.apollo.ConfigService;
import com.gic.api.base.commons.Page;
......@@ -29,18 +7,8 @@ import com.gic.commons.util.HttpClient;
import com.gic.haoban.base.api.common.BasePageInfo;
import com.gic.haoban.common.utils.EntityUtil;
import com.gic.haoban.common.utils.HaobanResponse;
import com.gic.haoban.manage.api.dto.MaidianLogDTO;
import com.gic.haoban.manage.api.dto.QywxCorpInfoSimpleDTO;
import com.gic.haoban.manage.api.dto.StaffDTO;
import com.gic.haoban.manage.api.dto.WxApplicationDTO;
import com.gic.haoban.manage.api.dto.WxEnterpriseDTO;
import com.gic.haoban.manage.api.service.MaidianLogApiService;
import com.gic.haoban.manage.api.service.MemberUnionidRelatedApiService;
import com.gic.haoban.manage.api.service.StaffApiService;
import com.gic.haoban.manage.api.service.TestApiService;
import com.gic.haoban.manage.api.service.WxApplicationApiService;
import com.gic.haoban.manage.api.service.WxEnterpriseApiService;
import com.gic.haoban.manage.api.service.WxEnterpriseRelatedApiService;
import com.gic.haoban.manage.api.dto.*;
import com.gic.haoban.manage.api.service.*;
import com.gic.haoban.manage.api.service.hm.HmQrcodeApiService;
import com.gic.haoban.manage.web.config.Config;
import com.gic.haoban.manage.web.errCode.HaoBanErrCode;
......@@ -52,6 +20,23 @@ import com.gic.wechat.api.dto.qywx.QywxXcxSendMessageDTO;
import com.gic.wechat.api.service.qywx.QywxCorpApiService;
import com.gic.wechat.api.service.qywx.QywxSuiteApiService;
import com.gic.wechat.api.service.qywx.QywxUserApiService;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.redisson.api.RRateLimiter;
import org.redisson.api.RateIntervalUnit;
import org.redisson.api.RateType;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import java.util.*;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.TimeUnit;
import java.util.stream.Collectors;
/**
* Created 2020/4/9.
......@@ -336,8 +321,8 @@ public class TestController extends WebBaseController {
@RequestMapping("/checkStaffOpenContactByWxEnterpriseId")
public HaobanResponse checkStaffOpenContact(String wxEnterpriseId) {
hmQrcodeApiService.checkStaffOpenContactByWxEnterpriseId(wxEnterpriseId);
public HaobanResponse checkStaffOpenContact(String wxEnterpriseId,String enterpriseId) {
hmQrcodeApiService.checkStaffOpenContactByWxEnterpriseId(wxEnterpriseId,enterpriseId);
return resultResponse(HaoBanErrCode.ERR_1);
}
......
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