Commit 80eb1207 by 墨竹

Merge branch 'master' into developer

# Conflicts:
#	haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/impl/StaffClerkRelationServiceImpl.java
#	haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/out/impl/hm/HmQrcodeApiServiceImpl.java
parents c59b15dd 06b76b30
......@@ -195,7 +195,7 @@ public interface TabHaobanStaffClerkRelationMapper {
/**
* 通过userId 查询id
* 通过open userId 查询id
*
* @param wxOpenUserIds wx开放用户id
* @param wxEnterpriseId wx企业标识
......@@ -209,6 +209,20 @@ public interface TabHaobanStaffClerkRelationMapper {
@Param("enterpriseId") String enterpriseId);
/**
* id wx用户id列表
*
* @param wxUserIds wx用户id
* @param wxEnterpriseId wx企业标识
* @param enterpriseId 企业标识
* @return {@link List }<{@link StaffClerkRelationDTO }>
* @author mozhu
* @date 2022-08-16 14:35:28
*/
List<StaffClerkRelationDTO> listIdsByWxUserIds(@Param("wxUserIds") List<String> wxUserIds,
@Param("wxEnterpriseId") String wxEnterpriseId,
@Param("enterpriseId") String enterpriseId);
/**
* 更新联系我状态
*
* @param openConcatFlag 打开concat国旗
......@@ -220,7 +234,7 @@ public interface TabHaobanStaffClerkRelationMapper {
int updateOpenConcatFlagById(@Param("openConcatFlag") Integer openConcatFlag, @Param("staffClerkRelationId") String staffClerkRelationId);
/**
* 通过userid 不在范围内 查询id
* 通过openuserid 不在范围内 查询id
*
* @param wxOpenUserIds wx开放用户id
* @param wxEnterpriseId wx企业标识
......@@ -233,6 +247,21 @@ public interface TabHaobanStaffClerkRelationMapper {
@Param("wxEnterpriseId") String wxEnterpriseId,
@Param("enterpriseId") String enterpriseId);
/**
* 通过userid 不在范围内 查询id
*
* @param wxUserIds wx用户id
* @param wxEnterpriseId wx企业标识
* @param enterpriseId 企业标识
* @return {@link List }<{@link StaffClerkRelationDTO }>
* @author mozhu
* @date 2022-08-16 14:45:57
*/
List<StaffClerkRelationDTO> listIdsByNotInWxUserIds(@Param("wxUserIds") List<String> wxUserIds,
@Param("wxEnterpriseId") String wxEnterpriseId,
@Param("enterpriseId") String enterpriseId);
/**
* 通过职员id 查询职员id列表
*
......
......@@ -151,27 +151,27 @@ public interface StaffClerkRelationService {
/**
* 通过userid 查询id
*
* @param wxOpenUserIds wx开放用户id
* @param wxUserIds wx开放用户id
* @param wxEnterpriseId wx企业标识
* @param enterpriseId 企业标识
* @return {@link List }<{@link StaffClerkRelationDTO }>
* @author mozhu
* @date 2022-08-08 22:01:59
*/
List<StaffClerkRelationDTO> listIdsByWxOpenUserIds(List<String> wxOpenUserIds,String wxEnterpriseId,String enterpriseId);
List<StaffClerkRelationDTO> listIdsByWxUserIds(List<String> wxUserIds, String wxEnterpriseId, String enterpriseId);
/**
* 通过userid 不在范围内 查询id
*
* @param wxOpenUserIds wx开放用户id
* @param wxUserIds wx开放用户id
* @param wxEnterpriseId wx企业标识
* @param enterpriseId 企业标识
* @return {@link List }<{@link StaffClerkRelationDTO }>
* @author mozhu
* @date 2022-08-08 21:51:52
*/
List<StaffClerkRelationDTO> listIdsByNotInWxOpenUserIds(List<String> wxOpenUserIds,String wxEnterpriseId,String enterpriseId);
List<StaffClerkRelationDTO> listIdsByNotInWxUserIds(List<String> wxUserIds, String wxEnterpriseId, String enterpriseId);
/**
......
package com.gic.haoban.manage.service.service.impl;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Date;
import java.util.List;
import java.util.Set;
import java.util.stream.Collectors;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.alibaba.fastjson.JSONObject;
import com.gic.api.base.commons.Page;
import com.gic.commons.util.EntityUtil;
......@@ -22,7 +8,7 @@ import com.gic.haoban.base.api.common.BasePageInfo;
import com.gic.haoban.common.utils.PageUtil;
import com.gic.haoban.common.utils.StringUtil;
import com.gic.haoban.manage.api.dto.StaffClerkRelationDTO;
import com.gic.haoban.manage.api.dto.WxEnterpriseQwDTO;
import com.gic.haoban.manage.api.dto.WxEnterpriseDTO;
import com.gic.haoban.manage.api.dto.qdto.hm.HmQrcodeQDTO;
import com.gic.haoban.manage.api.enums.BindTypeEnum;
import com.gic.haoban.manage.api.enums.ChannelCodeEnum;
......@@ -33,14 +19,18 @@ import com.gic.haoban.manage.service.dao.mapper.TabHaobanStaffClerkRelationMappe
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.ClerkMainStoreRelatedService;
import com.gic.haoban.manage.service.service.ExternalClerkRelatedService;
import com.gic.haoban.manage.service.service.StaffClerkBindLogService;
import com.gic.haoban.manage.service.service.StaffClerkRelationService;
import com.gic.haoban.manage.service.service.StaffService;
import com.gic.haoban.manage.service.service.WxEnterpriseService;
import com.gic.haoban.manage.service.service.*;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.*;
import java.util.stream.Collectors;
@Service
public class StaffClerkRelationServiceImpl implements StaffClerkRelationService {
......@@ -249,7 +239,7 @@ public class StaffClerkRelationServiceImpl implements StaffClerkRelationService
public StaffClerkRelationDTO getByClerkId(String clerkId) {
return EntityUtil.changeEntityByJSON(StaffClerkRelationDTO.class, mapper.getByClerkId(clerkId));
}
@Override
public StaffClerkRelationDTO getByClerkIdForWxUserId(String clerkId) {
return this.mapper.getByClerkIdForWxUserId(clerkId);
......@@ -337,13 +327,29 @@ public class StaffClerkRelationServiceImpl implements StaffClerkRelationService
}
@Override
public List<StaffClerkRelationDTO> listIdsByWxOpenUserIds(List<String> wxOpenUserIds, String wxEnterpriseId,String enterpriseId) {
return mapper.listIdsByWxOpenUserIds(wxOpenUserIds, wxEnterpriseId, enterpriseId);
public List<StaffClerkRelationDTO> listIdsByWxUserIds(List<String> wxUserIds, String wxEnterpriseId, String enterpriseId) {
if (CollectionUtils.isEmpty(wxUserIds)) {
return null;
}
WxEnterpriseDTO wxEnterpriseDTO = wxEnterpriseService.selectById(wxEnterpriseId);
String corpid = wxEnterpriseDTO.getCorpid();
if (corpid.length() > 20) {
return mapper.listIdsByWxOpenUserIds(wxUserIds, wxEnterpriseId, enterpriseId);
}
return mapper.listIdsByWxUserIds(wxUserIds, wxEnterpriseId, enterpriseId);
}
@Override
public List<StaffClerkRelationDTO> listIdsByNotInWxOpenUserIds(List<String> wxOpenUserIds, String wxEnterpriseId,String enterpriseId) {
return mapper.listIdsByNotInWxOpenUserIds(wxOpenUserIds, wxEnterpriseId,enterpriseId);
public List<StaffClerkRelationDTO> listIdsByNotInWxUserIds(List<String> wxUserIds, String wxEnterpriseId, String enterpriseId) {
if (CollectionUtils.isEmpty(wxUserIds)) {
return null;
}
WxEnterpriseDTO wxEnterpriseDTO = wxEnterpriseService.selectById(wxEnterpriseId);
String corpid = wxEnterpriseDTO.getCorpid();
if (corpid.length() > 20) {
return mapper.listIdsByNotInWxOpenUserIds(wxUserIds, wxEnterpriseId, enterpriseId);
}
return mapper.listIdsByNotInWxUserIds(wxUserIds, wxEnterpriseId, enterpriseId);
}
@Override
......
......@@ -472,6 +472,29 @@
</select>
<select id="listIdsByWxUserIds" resultType="com.gic.haoban.manage.api.dto.StaffClerkRelationDTO">
select
a.staff_clerk_relation_id staffClerkRelationId,
a.store_id storeId,
a.wx_enterprise_id wxEnterpriseId,
a.enterprise_id enterpriseId,
a.wx_user_id wxUserId,
a.staff_id staffId,
a.clerk_id clerkId,
b.staff_name staffName,
b.wx_open_user_id wxOpenUserId
from tab_haoban_staff_clerk_relation a
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_user_id in
<foreach collection="wxUserIds" item="id" index="index" open="(" close=")" separator=",">
#{id,jdbcType=VARCHAR}
</foreach>
group by a.staff_clerk_relation_id
</select>
<update id="updateOpenConcatFlagById">
UPDATE tab_haoban_staff_clerk_relation
SET open_concat_flag = #{openConcatFlag},
......@@ -503,6 +526,30 @@
group by a.staff_clerk_relation_id
</select>
<select id="listIdsByNotInWxUserIds" resultType="com.gic.haoban.manage.api.dto.StaffClerkRelationDTO">
select
a.staff_clerk_relation_id staffClerkRelationId,
a.store_id storeId,
a.wx_enterprise_id wxEnterpriseId,
a.enterprise_id enterpriseId,
a.wx_user_id wxUserId,
a.staff_id staffId,
a.clerk_id clerkId,
b.staff_name staffName,
b.wx_open_user_id wxOpenUserId
from tab_haoban_staff_clerk_relation a
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_user_id not in
<foreach collection="wxUserIds" item="id" index="index" open="(" close=")" separator=",">
#{id,jdbcType=VARCHAR}
</foreach>
group by a.staff_clerk_relation_id
</select>
<select id="listClerkIdConcatFlagByClerkIds" resultType="com.gic.haoban.manage.api.dto.StaffClerkRelationDTO">
select
clerk_id clerkId,
......
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