Commit 76b5253b by 墨竹

fix:合并根据导购和企业id查询绑定关联关系代码

parent 81720f74
...@@ -173,18 +173,6 @@ public interface StaffClerkRelationApiService { ...@@ -173,18 +173,6 @@ public interface StaffClerkRelationApiService {
List<StaffClerkRelationDTO> listByStaffId(String wxEnterpriseId, String staffId); List<StaffClerkRelationDTO> listByStaffId(String wxEnterpriseId, String staffId);
/** /**
* 通过职员id 查询职员id列表
*
* @param clerkIds 职员id
* @param wxEnterpriseId wx企业标识
* @return {@link List }<{@link StaffClerkRelationDTO }>
* @author mozhu
* @date 2022-07-07 17:28:01
*/
List<StaffClerkRelationDTO> listClerkIdConcatFlagByClerkIds(List<String> clerkIds, String wxEnterpriseId);
/**
* 导购门店转移或者删除 * 导购门店转移或者删除
* clerkStoreMoveDelMq * clerkStoreMoveDelMq
* *
......
...@@ -64,7 +64,7 @@ public interface TabHaobanStaffClerkRelationMapper { ...@@ -64,7 +64,7 @@ public interface TabHaobanStaffClerkRelationMapper {
* @author mozhu * @author mozhu
* @date 2022-01-13 11:36:11 * @date 2022-01-13 11:36:11
*/ */
List<StaffClerkRelationDTO> listByClerkIds(@Param("clerkIds") List<String> clerkIds, List<TabHaobanStaffClerkRelation> listByClerkIds(@Param("clerkIds") List<String> clerkIds,
@Param("wxEnterpriseId") String wxEnterpriseId); @Param("wxEnterpriseId") String wxEnterpriseId);
List<TabHaobanStaffClerkRelation> listByStoreId(@Param("storeId") String storeId); List<TabHaobanStaffClerkRelation> listByStoreId(@Param("storeId") String storeId);
...@@ -238,19 +238,6 @@ public interface TabHaobanStaffClerkRelationMapper { ...@@ -238,19 +238,6 @@ public interface TabHaobanStaffClerkRelationMapper {
@Param("wxEnterpriseId") String wxEnterpriseId, @Param("wxEnterpriseId") String wxEnterpriseId,
@Param("enterpriseId") String enterpriseId); @Param("enterpriseId") String enterpriseId);
/**
* 通过职员id 查询职员id列表
*
* @param clerkIds 职员id
* @param wxEnterpriseId wx企业标识
* @return {@link List }<{@link String }>
* @author mozhu
* @date 2022-07-07 16:30:32
*/
List<StaffClerkRelationDTO> listClerkIdConcatFlagByClerkIds(@Param("clerkIds") List<String> clerkIds,
@Param("wxEnterpriseId") String wxEnterpriseId);
void deleteByEnterpriseId(@Param("enterpriseId") String enterpriseId); void deleteByEnterpriseId(@Param("enterpriseId") String enterpriseId);
/** /**
......
...@@ -167,18 +167,6 @@ public interface StaffClerkRelationService { ...@@ -167,18 +167,6 @@ public interface StaffClerkRelationService {
*/ */
int updateOpenConcatFlagById(Integer openConcatFlag, String staffClerkRelationId); int updateOpenConcatFlagById(Integer openConcatFlag, String staffClerkRelationId);
/**
* 通过职员id 查询职员id列表
*
* @param clerkIds 职员id
* @param wxEnterpriseId wx企业标识
* @return {@link List }<{@link StaffClerkRelationDTO }>
* @author mozhu
* @date 2022-07-07 16:41:35
*/
List<StaffClerkRelationDTO> listClerkIdConcatFlagByClerkIds(List<String> clerkIds, String wxEnterpriseId);
/** /**
* 是否有区经 * 是否有区经
* *
......
...@@ -262,7 +262,7 @@ public class StaffClerkRelationServiceImpl implements StaffClerkRelationService ...@@ -262,7 +262,7 @@ public class StaffClerkRelationServiceImpl implements StaffClerkRelationService
if (CollectionUtils.isEmpty(clerkList)) { if (CollectionUtils.isEmpty(clerkList)) {
return Collections.EMPTY_LIST; return Collections.EMPTY_LIST;
} }
return mapper.listByClerkIds(clerkList, null); return EntityUtil.changeEntityListNew(StaffClerkRelationDTO.class,mapper.listByClerkIds(clerkList, null));
} }
@Override @Override
...@@ -363,11 +363,6 @@ public class StaffClerkRelationServiceImpl implements StaffClerkRelationService ...@@ -363,11 +363,6 @@ public class StaffClerkRelationServiceImpl implements StaffClerkRelationService
} }
@Override @Override
public List<StaffClerkRelationDTO> listClerkIdConcatFlagByClerkIds(List<String> clerkIds, String wxEnterpriseId) {
return mapper.listClerkIdConcatFlagByClerkIds(clerkIds, wxEnterpriseId);
}
@Override
public boolean getBindByManage(String enterpriseId) { public boolean getBindByManage(String enterpriseId) {
return mapper.getBindByManage(enterpriseId) > 0; return mapper.getBindByManage(enterpriseId) > 0;
} }
......
...@@ -217,7 +217,7 @@ public class StaffClerkRelationApiServiceImpl implements StaffClerkRelationApiSe ...@@ -217,7 +217,7 @@ public class StaffClerkRelationApiServiceImpl implements StaffClerkRelationApiSe
if (CollectionUtil.isEmpty(clerkIds)) { if (CollectionUtil.isEmpty(clerkIds)) {
return Collections.emptyList(); return Collections.emptyList();
} }
return tabHaobanStaffClerkRelationMapper.listByClerkIds(clerkIds, null); return EntityUtil.changeEntityListNew(StaffClerkRelationDTO.class,tabHaobanStaffClerkRelationMapper.listByClerkIds(clerkIds, null));
} }
@Override @Override
...@@ -225,7 +225,7 @@ public class StaffClerkRelationApiServiceImpl implements StaffClerkRelationApiSe ...@@ -225,7 +225,7 @@ public class StaffClerkRelationApiServiceImpl implements StaffClerkRelationApiSe
if (CollectionUtil.isEmpty(clerkIds)) { if (CollectionUtil.isEmpty(clerkIds)) {
return Collections.emptyList(); return Collections.emptyList();
} }
return tabHaobanStaffClerkRelationMapper.listByClerkIds(clerkIds, wxEnterpriseId); return EntityUtil.changeEntityListNew(StaffClerkRelationDTO.class,tabHaobanStaffClerkRelationMapper.listByClerkIds(clerkIds, wxEnterpriseId));
} }
@Override @Override
...@@ -454,11 +454,6 @@ public class StaffClerkRelationApiServiceImpl implements StaffClerkRelationApiSe ...@@ -454,11 +454,6 @@ public class StaffClerkRelationApiServiceImpl implements StaffClerkRelationApiSe
} }
@Override @Override
public List<StaffClerkRelationDTO> listClerkIdConcatFlagByClerkIds(List<String> clerkIds, String wxEnterpriseId) {
return staffClerkRelationService.listClerkIdConcatFlagByClerkIds(clerkIds, wxEnterpriseId);
}
@Override
public void clerkStoreMoveDel(String param) { public void clerkStoreMoveDel(String param) {
logger.info("导购转移删除修改通知:{}", param); logger.info("导购转移删除修改通知:{}", param);
if (StringUtils.isBlank(param)) { if (StringUtils.isBlank(param)) {
......
...@@ -18,8 +18,19 @@ ...@@ -18,8 +18,19 @@
</resultMap> </resultMap>
<sql id="Base_Column_List"> <sql id="Base_Column_List">
staff_clerk_relation_id staff_clerk_relation_id
, staff_id, wx_enterprise_id, enterprise_id, store_id, ,
clerk_id, clerk_code, status_flag, create_time, update_time,open_concat_flag,manage_flag,clerk_type staff_id,
wx_enterprise_id,
enterprise_id,
store_id,
clerk_id,
clerk_code,
status_flag,
create_time,
update_time,
open_concat_flag,
manage_flag,
clerk_type
</sql> </sql>
<select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.String"> <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.String">
select select
...@@ -121,27 +132,19 @@ ...@@ -121,27 +132,19 @@
and status_flag = 1 and status_flag = 1
</update> </update>
<select id="listByClerkIds" resultType="com.gic.haoban.manage.api.dto.StaffClerkRelationDTO" <select id="listByClerkIds" resultMap="BaseResultMap"
parameterType="java.lang.String"> parameterType="java.lang.String">
select select
a.staff_clerk_relation_id staffClerkRelationId, <include refid="Base_Column_List"></include>
a.staff_id staffId, from tab_haoban_staff_clerk_relation
a.wx_enterprise_id wxEnterpriseId, where status_flag=1
a.enterprise_id enterpriseId, <if test="wxEnterpriseId != null and wxEnterpriseId != ''">
a.store_id storeId, and wx_enterprise_id = #{wxEnterpriseId}
a.clerk_id clerkId, </if>
a.clerk_code clerkCode, and clerk_id in
a.status_flag statusFlag,
a.manage_flag manageFlag
from tab_haoban_staff_clerk_relation a
where a.status_flag=1
and a.clerk_id in
<foreach collection="clerkIds" item="id" index="index" open="(" close=")" separator=","> <foreach collection="clerkIds" item="id" index="index" open="(" close=")" separator=",">
#{id,jdbcType=VARCHAR} #{id,jdbcType=VARCHAR}
</foreach> </foreach>
<if test="wxEnterpriseId != null and wxEnterpriseId != ''">
and a.wx_enterprise_id = #{wxEnterpriseId}
</if>
</select> </select>
<select id="listByStoreId" resultMap="BaseResultMap" parameterType="java.lang.String"> <select id="listByStoreId" resultMap="BaseResultMap" parameterType="java.lang.String">
...@@ -498,18 +501,6 @@ ...@@ -498,18 +501,6 @@
group by a.staff_clerk_relation_id group by a.staff_clerk_relation_id
</select> </select>
<select id="listClerkIdConcatFlagByClerkIds" resultType="com.gic.haoban.manage.api.dto.StaffClerkRelationDTO">
select
clerk_id clerkId,
open_concat_flag openConcatFlag
from tab_haoban_staff_clerk_relation
where status_flag=1 and wx_enterprise_id = #{wxEnterpriseId}
and clerk_id in
<foreach collection="clerkIds" item="id" index="index" open="(" close=")" separator=",">
#{id,jdbcType=VARCHAR}
</foreach>
</select>
<update id="deleteByEnterpriseId"> <update id="deleteByEnterpriseId">
update tab_haoban_staff_clerk_relation update tab_haoban_staff_clerk_relation
set status_flag = 0, set status_flag = 0,
......
package com.gic.haoban.manage.web.controller.hm; package com.gic.haoban.manage.web.controller.hm;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
import javax.servlet.http.HttpServletRequest;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang.StringUtils;
import org.apache.logging.log4j.LogManager;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.gic.api.base.commons.BasePageInfo; import com.gic.api.base.commons.BasePageInfo;
import com.gic.api.base.commons.Page; import com.gic.api.base.commons.Page;
...@@ -41,6 +24,17 @@ import com.gic.haoban.manage.web.vo.hm.ClerkListVO; ...@@ -41,6 +24,17 @@ import com.gic.haoban.manage.web.vo.hm.ClerkListVO;
import com.gic.haoban.manage.web.vo.hm.ClerkStoreListVO; import com.gic.haoban.manage.web.vo.hm.ClerkStoreListVO;
import com.gic.haoban.manage.web.vo.hm.StoreVO; import com.gic.haoban.manage.web.vo.hm.StoreVO;
import com.google.common.collect.Sets; import com.google.common.collect.Sets;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang.StringUtils;
import org.apache.logging.log4j.LogManager;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;
import javax.servlet.http.HttpServletRequest;
import java.util.*;
import java.util.stream.Collectors;
@RestController @RestController
@RequestMapping("hm") @RequestMapping("hm")
...@@ -163,7 +157,7 @@ public class HmStoreController { ...@@ -163,7 +157,7 @@ public class HmStoreController {
List<String> statusList = new ArrayList<>(); List<String> statusList = new ArrayList<>();
if (CollectionUtils.isNotEmpty(clerkIdList)) { if (CollectionUtils.isNotEmpty(clerkIdList)) {
List<StaffClerkRelationDTO> clerkRelationList = this.staffClerkRelationApiService List<StaffClerkRelationDTO> clerkRelationList = this.staffClerkRelationApiService
.listClerkIdConcatFlagByClerkIds(clerkIdList, wxEnterpriseId); .listByClerkIdsWxEnterpriseId(clerkIdList, wxEnterpriseId);
if (CollectionUtils.isNotEmpty(clerkRelationList)) { if (CollectionUtils.isNotEmpty(clerkRelationList)) {
status2List.addAll(clerkRelationList.stream().filter(dto -> dto.getOpenConcatFlag() == 0) status2List.addAll(clerkRelationList.stream().filter(dto -> dto.getOpenConcatFlag() == 0)
.map(dto -> dto.getClerkId()).collect(Collectors.toList())); .map(dto -> dto.getClerkId()).collect(Collectors.toList()));
......
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