Commit 76b5253b by 墨竹

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

parent 81720f74
......@@ -173,18 +173,6 @@ public interface StaffClerkRelationApiService {
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
*
......
......@@ -64,7 +64,7 @@ public interface TabHaobanStaffClerkRelationMapper {
* @author mozhu
* @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);
List<TabHaobanStaffClerkRelation> listByStoreId(@Param("storeId") String storeId);
......@@ -238,19 +238,6 @@ public interface TabHaobanStaffClerkRelationMapper {
@Param("wxEnterpriseId") String wxEnterpriseId,
@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);
/**
......
......@@ -167,18 +167,6 @@ public interface StaffClerkRelationService {
*/
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
if (CollectionUtils.isEmpty(clerkList)) {
return Collections.EMPTY_LIST;
}
return mapper.listByClerkIds(clerkList, null);
return EntityUtil.changeEntityListNew(StaffClerkRelationDTO.class,mapper.listByClerkIds(clerkList, null));
}
@Override
......@@ -363,11 +363,6 @@ public class StaffClerkRelationServiceImpl implements StaffClerkRelationService
}
@Override
public List<StaffClerkRelationDTO> listClerkIdConcatFlagByClerkIds(List<String> clerkIds, String wxEnterpriseId) {
return mapper.listClerkIdConcatFlagByClerkIds(clerkIds, wxEnterpriseId);
}
@Override
public boolean getBindByManage(String enterpriseId) {
return mapper.getBindByManage(enterpriseId) > 0;
}
......
......@@ -217,7 +217,7 @@ public class StaffClerkRelationApiServiceImpl implements StaffClerkRelationApiSe
if (CollectionUtil.isEmpty(clerkIds)) {
return Collections.emptyList();
}
return tabHaobanStaffClerkRelationMapper.listByClerkIds(clerkIds, null);
return EntityUtil.changeEntityListNew(StaffClerkRelationDTO.class,tabHaobanStaffClerkRelationMapper.listByClerkIds(clerkIds, null));
}
@Override
......@@ -225,7 +225,7 @@ public class StaffClerkRelationApiServiceImpl implements StaffClerkRelationApiSe
if (CollectionUtil.isEmpty(clerkIds)) {
return Collections.emptyList();
}
return tabHaobanStaffClerkRelationMapper.listByClerkIds(clerkIds, wxEnterpriseId);
return EntityUtil.changeEntityListNew(StaffClerkRelationDTO.class,tabHaobanStaffClerkRelationMapper.listByClerkIds(clerkIds, wxEnterpriseId));
}
@Override
......@@ -454,11 +454,6 @@ public class StaffClerkRelationApiServiceImpl implements StaffClerkRelationApiSe
}
@Override
public List<StaffClerkRelationDTO> listClerkIdConcatFlagByClerkIds(List<String> clerkIds, String wxEnterpriseId) {
return staffClerkRelationService.listClerkIdConcatFlagByClerkIds(clerkIds, wxEnterpriseId);
}
@Override
public void clerkStoreMoveDel(String param) {
logger.info("导购转移删除修改通知:{}", param);
if (StringUtils.isBlank(param)) {
......
......@@ -18,8 +18,19 @@
</resultMap>
<sql id="Base_Column_List">
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>
<select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.String">
select
......@@ -121,27 +132,19 @@
and status_flag = 1
</update>
<select id="listByClerkIds" resultType="com.gic.haoban.manage.api.dto.StaffClerkRelationDTO"
<select id="listByClerkIds" resultMap="BaseResultMap"
parameterType="java.lang.String">
select
a.staff_clerk_relation_id staffClerkRelationId,
a.staff_id staffId,
a.wx_enterprise_id wxEnterpriseId,
a.enterprise_id enterpriseId,
a.store_id storeId,
a.clerk_id clerkId,
a.clerk_code clerkCode,
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
<include refid="Base_Column_List"></include>
from tab_haoban_staff_clerk_relation
where status_flag=1
<if test="wxEnterpriseId != null and wxEnterpriseId != ''">
and wx_enterprise_id = #{wxEnterpriseId}
</if>
and clerk_id in
<foreach collection="clerkIds" item="id" index="index" open="(" close=")" separator=",">
#{id,jdbcType=VARCHAR}
</foreach>
<if test="wxEnterpriseId != null and wxEnterpriseId != ''">
and a.wx_enterprise_id = #{wxEnterpriseId}
</if>
</select>
<select id="listByStoreId" resultMap="BaseResultMap" parameterType="java.lang.String">
......@@ -498,18 +501,6 @@
group by a.staff_clerk_relation_id
</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 tab_haoban_staff_clerk_relation
set status_flag = 0,
......
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.gic.api.base.commons.BasePageInfo;
import com.gic.api.base.commons.Page;
......@@ -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.StoreVO;
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
@RequestMapping("hm")
......@@ -163,7 +157,7 @@ public class HmStoreController {
List<String> statusList = new ArrayList<>();
if (CollectionUtils.isNotEmpty(clerkIdList)) {
List<StaffClerkRelationDTO> clerkRelationList = this.staffClerkRelationApiService
.listClerkIdConcatFlagByClerkIds(clerkIdList, wxEnterpriseId);
.listByClerkIdsWxEnterpriseId(clerkIdList, wxEnterpriseId);
if (CollectionUtils.isNotEmpty(clerkRelationList)) {
status2List.addAll(clerkRelationList.stream().filter(dto -> dto.getOpenConcatFlag() == 0)
.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