Commit 1b5bbdeb by xuwenqian

feat:新增查询所有与好办相关导购

parent d71be61e
......@@ -3,10 +3,11 @@ package com.gic.haoban.manage.api.dto;
import java.io.Serializable;
import java.util.Date;
public class StaffClerkInfoDTO implements Serializable{
private String staffClerkRelationId;
public class StaffClerkInfoDTO implements Serializable {
private static final long serialVersionUID = 1L;
private String staffClerkRelationId;
private String staffId;
......@@ -48,8 +49,6 @@ public class StaffClerkInfoDTO implements Serializable{
this.mainStoreFlag = mainStoreFlag;
}
private static final long serialVersionUID = 1L;
public String getEnterpriseName() {
return enterpriseName;
}
......
......@@ -3,10 +3,11 @@ package com.gic.haoban.manage.api.dto;
import java.io.Serializable;
import java.util.Date;
public class StaffClerkRelationDTO implements Serializable{
private String staffClerkRelationId;
public class StaffClerkRelationDTO implements Serializable {
private static final long serialVersionUID = 1L;
private String staffClerkRelationId;
private String staffId;
......@@ -28,7 +29,8 @@ public class StaffClerkRelationDTO implements Serializable{
private Date updateTime;
private static final long serialVersionUID = 1L;
private String storeName;
private String staffName;
public String getStaffClerkRelationId() {
return staffClerkRelationId;
......@@ -118,4 +120,19 @@ public class StaffClerkRelationDTO implements Serializable{
this.updateTime = updateTime;
}
public String getStoreName() {
return storeName;
}
public void setStoreName(String storeName) {
this.storeName = storeName;
}
public String getStaffName() {
return staffName;
}
public void setStaffName(String staffName) {
this.staffName = staffName;
}
}
package com.gic.haoban.manage.api.service;
import java.util.List;
import java.util.Set;
import com.gic.api.base.commons.Page;
import com.gic.haoban.base.api.common.BasePageInfo;
import com.gic.haoban.base.api.common.ServiceResponse;
......@@ -10,12 +7,16 @@ import com.gic.haoban.manage.api.dto.StaffClerkBindLogDetailDTO;
import com.gic.haoban.manage.api.dto.StaffClerkInfoDTO;
import com.gic.haoban.manage.api.dto.StaffClerkRelationDTO;
import java.util.List;
import java.util.Set;
public interface StaffClerkRelationApiService {
/**
* 绑定日志
*
* @param params
*/
public void bindLogMq(String params);
void bindLogMq(String params);
List<StaffClerkRelationDTO> listBindCode(String enterpriseId, Set<String> clerkCodeList);
......@@ -30,9 +31,10 @@ public interface StaffClerkRelationApiService {
/**
* 绑定
*
* @return
*/
public ServiceResponse bindStaffClerk(StaffClerkRelationDTO staffClerkRelationDTO,String optStaffId,int chanelCode);
ServiceResponse bindStaffClerk(StaffClerkRelationDTO staffClerkRelationDTO, String optStaffId, int chanelCode);
StaffClerkRelationDTO getByCodeAndEnterpriseId(String clerkCode, String enterpriseId);
......@@ -96,40 +98,49 @@ public interface StaffClerkRelationApiService {
/**
* 搜索查询列表
*
* @param wxEnterpriseId
* @param search
* @param enterpriseId
* @param optType
* @return
*/
public Page<StaffClerkBindLogDetailDTO> pageStaffClerkBindLog(String wxEnterpriseId, String search, String enterpriseId, int optType, BasePageInfo pageInfo);
Page<StaffClerkBindLogDetailDTO> pageStaffClerkBindLog(String wxEnterpriseId, String search, String enterpriseId, int optType, BasePageInfo pageInfo);
/**
* 追加到绑定日志
*
* @param staffId
* @param optStaffId
* @param optType
* @param channelCode
* @param relationId
*/
public void pushToBindLog(String staffId,String optStaffId,int optType,int channelCode,String relationId);
void pushToBindLog(String staffId, String optStaffId, int optType, int channelCode, String relationId);
/**
* 获取config
*
* @param clerkId
* @param memberId
* @return
*/
ServiceResponse<String> getClerkMemberChatConfig(String clerkId);
/**
*
* @Description 方法描述:
* @return 返回值类型: <pre>
* @author 作者: WQ <pre>
* @date 时间: 2020年12月24日 上午11:21:38 <pre>
* @param wxEnterpriseId: <pre>
* @param pageInfo: <pre>
* @return 返回值类型: <pre>
* @author 作者: WQ <pre>
* @date 时间: 2020年12月24日 上午11:21:38 <pre>
* @param wxEnterpriseId: <pre>
* @param pageInfo: <pre>
* @Description 方法描述:
*/
Page<StaffClerkRelationDTO> pageByWxEnterpriseId(String wxEnterpriseId, BasePageInfo pageInfo);
/**
* 查询状态正常导购
* @return
*/
public Page<StaffClerkRelationDTO> pageByWxEnterpriseId(String wxEnterpriseId, BasePageInfo pageInfo);
List<StaffClerkRelationDTO> listAll();
}
package com.gic.haoban.manage.service.dao.mapper;
import java.util.List;
import java.util.Set;
import org.apache.ibatis.annotations.Param;
import com.gic.haoban.manage.api.dto.StaffClerkRelationDTO;
import com.gic.haoban.manage.service.entity.TabHaobanStaffClerkRelation;
import org.apache.ibatis.annotations.Param;
import java.util.List;
import java.util.Set;
public interface TabHaobanStaffClerkRelationMapper {
int deleteByPrimaryKey(String staffClerkRelationId);
......@@ -24,15 +23,17 @@ public interface TabHaobanStaffClerkRelationMapper {
List<TabHaobanStaffClerkRelation> listBindCode(@Param("enterpriseId")String enterpriseId, @Param("clerkCodeList")Set<String> clerkCodeList);
List<TabHaobanStaffClerkRelation> listBindCodeByStaffId(@Param("enterpriseIdList")List<String> enterpriseIdList, @Param("staffId")String staffId);
TabHaobanStaffClerkRelation getOneByClerkId(@Param("clerkId")String clerkId);
TabHaobanStaffClerkRelation getOneByClerkId(@Param("clerkId") String clerkId);
/**
* 改变状态 格局clerkId
*
* @param clerkId
* @param status
* @return
*/
public int changeStatusByClerkId(@Param("clerkId") String clerkId,@Param("status") Integer status);
int changeStatusByClerkId(@Param("clerkId") String clerkId, @Param("status") Integer status);
/**
* 更新信息
......@@ -117,7 +118,18 @@ public interface TabHaobanStaffClerkRelationMapper {
/**
* 已使用的门店id列表
*
* @param enterpriseId
*/
List<TabHaobanStaffClerkRelation> listBindStoreIdByEnterpriseId(String enterpriseId);
/**
* 列出所有
*
* @return {@link List<TabHaobanStaffClerkRelation> }
* @author xuwenqian
* @date 2021-07-15 16:24:27
*/
List<StaffClerkRelationDTO> listAll();
}
\ No newline at end of file
package com.gic.haoban.manage.service.service;
import java.util.List;
import java.util.Set;
import com.gic.api.base.commons.Page;
import com.gic.haoban.base.api.common.BasePageInfo;
import com.gic.haoban.base.api.common.ServiceResponse;
import com.gic.haoban.manage.api.dto.StaffClerkRelationDTO;
import com.gic.haoban.manage.service.entity.MemberClerkChatConfig;
import com.gic.haoban.manage.service.entity.TabHaobanStaffClerkRelation;
import org.apache.ibatis.annotations.Param;
import java.util.List;
import java.util.Set;
public interface StaffClerkRelationService {
......@@ -20,10 +17,11 @@ public interface StaffClerkRelationService {
/**
* 删除绑定
*
* @param clerkId
* @return
*/
public boolean delBind(String clerkId,String optStaffId,int chanelCode);
boolean delBind(String clerkId, String optStaffId, int chanelCode);
/**
* 删除绑定
......@@ -32,7 +30,7 @@ public interface StaffClerkRelationService {
* @param storeIds
* @return
*/
public boolean delBindByStoreIds(String wxEnterpriseId, Set<String> storeIds, String optStaffId, int chanelCode);
boolean delBindByStoreIds(String wxEnterpriseId, Set<String> storeIds, String optStaffId, int chanelCode);
/**
* 删除绑定
......@@ -42,35 +40,37 @@ public interface StaffClerkRelationService {
* @param storeIds 解除除了这些门店之外的绑定的门店
* @return
*/
public boolean delBindNotInStoreIds(String wxEnterpriseId, String enterpriseId, Set<String> storeIds, String optStaffId, int chanelCode);
boolean delBindNotInStoreIds(String wxEnterpriseId, String enterpriseId, Set<String> storeIds, String optStaffId, int chanelCode);
/**
* 绑定
*
* @param dto
* @return
*/
public String bind(StaffClerkRelationDTO dto,String optStaffId,int chanelCode);
String bind(StaffClerkRelationDTO dto, String optStaffId, int chanelCode);
/**
* 根据clerkId 更新数据
* @param dto
* @return
*/
public boolean updateByClerkId(StaffClerkRelationDTO dto);
boolean updateByClerkId(StaffClerkRelationDTO dto);
/**
* 查询绑定根据clerkId
*
* @param clerkId
* @param wxEnterpriseId
* @return
*/
public StaffClerkRelationDTO getBindByClerkId(String clerkId,String wxEnterpriseId);
StaffClerkRelationDTO getBindByClerkId(String clerkId, String wxEnterpriseId);
StaffClerkRelationDTO getByCodeAndEnterpriseId(String clerkCode, String enterpriseId);
String insert(StaffClerkRelationDTO staffClerkRelation);
public int cleanStaffClerk( String wxEnterpriseId, List<String> staffIds);
int cleanStaffClerk(String wxEnterpriseId, List<String> staffIds);
StaffClerkRelationDTO getOneBindCodeNoStatus(String enterpriseId, String clerkCode);
......@@ -86,15 +86,15 @@ public interface StaffClerkRelationService {
* 保存
* @param memberClerkChatConfig
*/
public void saveChatConfig(MemberClerkChatConfig memberClerkChatConfig);
void saveChatConfig(MemberClerkChatConfig memberClerkChatConfig);
/**
*
* @param staffId
* @param memberId
* @return
*/
public MemberClerkChatConfig getChatConfig(String staffId,String memberId);
MemberClerkChatConfig getChatConfig(String staffId, String memberId);
/**
* 根据企业查询
* @param wxEnterpriseId
......@@ -121,5 +121,14 @@ public interface StaffClerkRelationService {
*/
List<StaffClerkRelationDTO> listBindStoreIdByEnterpriseId(String enterpriseId);
/**
* 查询所有正常导购
*
* @return {@link List<StaffClerkRelationDTO> }
* @author xuwenqian
* @date 2021-07-15 16:26:17
*/
List<StaffClerkRelationDTO> listAll();
}
package com.gic.haoban.manage.service.service.impl;
import java.util.*;
import java.util.stream.Collectors;
import com.alibaba.fastjson.JSONObject;
import com.gic.api.base.commons.Page;
import com.gic.commons.util.EntityUtil;
import com.gic.commons.util.ToolUtil;
import com.gic.haoban.base.api.common.BasePageInfo;
import com.gic.haoban.base.api.common.ServiceResponse;
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.enums.BindTypeEnum;
import com.gic.haoban.manage.api.enums.ChannelCodeEnum;
import com.gic.haoban.manage.service.dao.mapper.TabHaobanMemberClerkChatConfigMapper;
import com.gic.haoban.manage.service.dao.mapper.TabHaobanStaffClerkRelationMapper;
import com.gic.haoban.manage.service.entity.MemberClerkChatConfig;
import com.gic.haoban.manage.service.entity.TabHaobanClerkMainStoreRelated;
import com.gic.haoban.manage.service.entity.TabHaobanStaffClerkBindLog;
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.StaffService;
import com.gic.wechat.api.dto.qywx.QywxExternalcontactDTO;
import com.gic.haoban.manage.service.service.*;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import javafx.scene.control.Tab;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
......@@ -31,14 +24,8 @@ import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.gic.api.base.commons.Page;
import com.gic.commons.util.EntityUtil;
import com.gic.haoban.common.utils.PageUtil;
import com.gic.haoban.common.utils.StringUtil;
import com.gic.haoban.manage.api.dto.StaffClerkBindLogDetailDTO;
import com.gic.haoban.manage.api.dto.StaffClerkRelationDTO;
import com.gic.haoban.manage.service.dao.mapper.TabHaobanStaffClerkRelationMapper;
import com.gic.haoban.manage.service.service.StaffClerkRelationService;
import java.util.*;
import java.util.stream.Collectors;
@Service
public class StaffClerkRelationServiceImpl implements StaffClerkRelationService {
......@@ -293,4 +280,9 @@ public class StaffClerkRelationServiceImpl implements StaffClerkRelationService
}
return EntityUtil.changeEntityListNew(StaffClerkRelationDTO.class, clerkRelations);
}
@Override
public List<StaffClerkRelationDTO> listAll() {
return mapper.listAll();
}
}
......@@ -15,11 +15,11 @@
<result column="update_time" property="updateTime" jdbcType="TIMESTAMP" />
</resultMap>
<sql id="Base_Column_List" >
staff_clerk_relation_id, staff_id, wx_enterprise_id, wx_user_id, enterprise_id, store_id,
staff_clerk_relation_id, staff_id, wx_enterprise_id, wx_user_id, enterprise_id, store_id,
clerk_id, clerk_code, status_flag, create_time, update_time
</sql>
<select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.String" >
select
select
<include refid="Base_Column_List" />
from tab_haoban_staff_clerk_relation
where staff_clerk_relation_id = #{staffClerkRelationId,jdbcType=VARCHAR}
......@@ -29,14 +29,14 @@
where staff_clerk_relation_id = #{staffClerkRelationId,jdbcType=VARCHAR}
</delete>
<insert id="insert" parameterType="com.gic.haoban.manage.service.entity.TabHaobanStaffClerkRelation" >
insert into tab_haoban_staff_clerk_relation (staff_clerk_relation_id, staff_id, wx_enterprise_id,
wx_user_id, enterprise_id, store_id,
clerk_id, clerk_code, status_flag,
create_time, update_time)
values (#{staffClerkRelationId,jdbcType=VARCHAR}, #{staffId,jdbcType=VARCHAR}, #{wxEnterpriseId,jdbcType=VARCHAR},
#{wxUserId,jdbcType=VARCHAR}, #{enterpriseId,jdbcType=VARCHAR}, #{storeId,jdbcType=VARCHAR},
#{clerkId,jdbcType=VARCHAR}, #{clerkCode,jdbcType=VARCHAR}, #{statusFlag,jdbcType=INTEGER},
#{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP})
insert into tab_haoban_staff_clerk_relation (staff_clerk_relation_id, staff_id, wx_enterprise_id,
wx_user_id, enterprise_id, store_id,
clerk_id, clerk_code, status_flag,
create_time, update_time)
values (#{staffClerkRelationId,jdbcType=VARCHAR}, #{staffId,jdbcType=VARCHAR}, #{wxEnterpriseId,jdbcType=VARCHAR},
#{wxUserId,jdbcType=VARCHAR}, #{enterpriseId,jdbcType=VARCHAR}, #{storeId,jdbcType=VARCHAR},
#{clerkId,jdbcType=VARCHAR}, #{clerkCode,jdbcType=VARCHAR}, #{statusFlag,jdbcType=INTEGER},
#{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP})
</insert>
<insert id="insertSelective" parameterType="com.gic.haoban.manage.service.entity.TabHaobanStaffClerkRelation" >
insert into tab_haoban_staff_clerk_relation
......@@ -162,37 +162,37 @@
where staff_clerk_relation_id = #{staffClerkRelationId,jdbcType=VARCHAR}
</update>
<select id="listBindCode" resultMap="BaseResultMap" parameterType="java.lang.String" >
select
select
<include refid="Base_Column_List" />
from tab_haoban_staff_clerk_relation
where enterprise_id = #{enterpriseId,jdbcType=VARCHAR}
and status_flag = 1
and clerk_code in
and clerk_code in
<foreach collection="clerkCodeList" item="id" index="index" open="(" close=")" separator=",">
#{id,jdbcType=VARCHAR}
</foreach>
</select>
<select id="listBindCodeByStaffId" resultMap="BaseResultMap" parameterType="java.lang.String" >
select
select
<include refid="Base_Column_List" />
from tab_haoban_staff_clerk_relation
where staff_id = #{staffId,jdbcType=VARCHAR}
and status_flag = 1
<if test="enterpriseIdList!=null and enterpriseIdList.size &gt; 0">
and enterprise_id in
<foreach collection="enterpriseIdList" item="id" index="index" open="(" close=")" separator=",">
and enterprise_id in
<foreach collection="enterpriseIdList" item="id" index="index" open="(" close=")" separator=",">
#{id,jdbcType=VARCHAR}
</foreach>
</if>
</select>
<select id="getOneByClerkId" resultMap="BaseResultMap" parameterType="java.lang.String" >
select
select
<include refid="Base_Column_List" />
from tab_haoban_staff_clerk_relation
where
status_flag = 1
where
status_flag = 1
and clerk_id = #{clerkId}
</select>
......@@ -220,34 +220,33 @@
from tab_haoban_staff_clerk_relation
where clerk_id = #{clerkId,jdbcType=VARCHAR} and wx_enterprise_id=#{wxEnterpriseId} and status_flag=1
</select>
<select id="getByCodeAndEnterpriseId" resultMap="BaseResultMap" parameterType="java.lang.String" >
select
select
<include refid="Base_Column_List" />
from tab_haoban_staff_clerk_relation
where
status_flag = 1
where
status_flag = 1
and enterprise_id = #{enterpriseId}
and clerk_code = #{clerkCode}
</select>
<update id="delByStoreIdAndCode" >
update tab_haoban_staff_clerk_relation
set
status_flag = 0,
update_time = now()
where clerk_code = #{clerkCode,jdbcType=VARCHAR}
and store_id = #{storeId,jdbcType=VARCHAR}
and status_flag =1
</update>
update tab_haoban_staff_clerk_relation
set status_flag = 0,
update_time = now()
where clerk_code = #{clerkCode,jdbcType=VARCHAR}
and store_id = #{storeId,jdbcType=VARCHAR}
and status_flag = 1
</update>
<select id="listByClerkIds" resultMap="BaseResultMap" parameterType="java.lang.String" >
select
<include refid="Base_Column_List" />
from tab_haoban_staff_clerk_relation
where status_flag=1
and clerk_id in
<foreach collection="clerkIds" item="id" index="index" open="(" close=")" separator=",">
from tab_haoban_staff_clerk_relation
where status_flag=1
and clerk_id in
<foreach collection="clerkIds" item="id" index="index" open="(" close=")" separator=",">
#{id,jdbcType=VARCHAR}
</foreach>
</select>
......@@ -259,7 +258,7 @@
where status_flag=1
and store_id = #{storeId,jdbcType=VARCHAR}
</select>
<select id="getOneByStoreIdAndStaffId" resultMap="BaseResultMap" parameterType="java.lang.String" >
select
<include refid="Base_Column_List" />
......@@ -302,7 +301,7 @@
and status_flag=1
order by update_time desc limit 1
</select>
<select id="getByClerkId" resultMap="BaseResultMap" parameterType="java.lang.String" >
select
<include refid="Base_Column_List" />
......@@ -310,8 +309,8 @@
where clerk_id = #{clerkId,jdbcType=VARCHAR}
and status_flag=1
</select>
<update id="delByPrimaryKey" >
<update id="delByPrimaryKey" >
update tab_haoban_staff_clerk_relation
set
status_flag = 0,
......@@ -319,7 +318,7 @@
where staff_clerk_relation_id = #{staffClerkRelationId,jdbcType=VARCHAR}
and status_flag =1
</update>
<update id="delByClerkId" >
update tab_haoban_staff_clerk_relation
set
......@@ -328,38 +327,38 @@
where clerk_id = #{clerkId,jdbcType=VARCHAR}
and status_flag =1
</update>
<select id="listByEnterpriseIdAndWxUserId" resultMap="BaseResultMap" parameterType="java.lang.String" >
<select id="listByEnterpriseIdAndWxUserId" resultMap="BaseResultMap" parameterType="java.lang.String" >
select
<include refid="Base_Column_List" />
from tab_haoban_staff_clerk_relation
where
where
enterprise_id = #{enterpriseId,jdbcType=VARCHAR}
and wx_user_id = #{wxUserId}
</select>
<select id="lisByStaffId" resultMap="BaseResultMap" parameterType="java.lang.String" >
select
<include refid="Base_Column_List" />
from tab_haoban_staff_clerk_relation
where
where
wx_enterprise_id = #{wxEnterpriseId,jdbcType=VARCHAR}
and staff_id = #{staffId}
and status_flag = 1
order by create_time desc
</select>
<select id="getByCodeAndStoreId" resultMap="BaseResultMap" parameterType="java.lang.String" >
select
<include refid="Base_Column_List" />
from tab_haoban_staff_clerk_relation
where
where
clerk_code = #{clerkCode}
and store_id = #{storeId}
and status_flag = 1
</select>
<select id="listByWxEnterpriseId" resultMap="BaseResultMap">
<select id="listByWxEnterpriseId" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from tab_haoban_staff_clerk_relation
......@@ -367,7 +366,7 @@
and status_flag =1
group by wx_user_id
</select>
<select id="pageByWxEnterpriseId" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
......@@ -426,13 +425,24 @@
</update>
<select id="listBindStoreIdByEnterpriseId" resultMap="BaseResultMap">
select
store_id,
wx_enterprise_id
select store_id,
wx_enterprise_id
from tab_haoban_staff_clerk_relation
where
enterprise_id = #{wxEnterpriseId,jdbcType=VARCHAR}
and status_flag =1
where enterprise_id = #{wxEnterpriseId,jdbcType=VARCHAR}
and status_flag = 1
group by store_id
</select>
<select id="listAll" resultType="com.gic.haoban.manage.api.dto.StaffClerkRelationDTO">
SELECT a.store_id,
a.staff_id,
a.clerk_id,
b.staff_name,
c.store_name
FROM tab_haoban_staff_clerk_relation a
LEFT JOIN tab_haoban_staff b ON b.staff_id = a.staff_id
LEFT JOIN tab_gic_clerk c ON c.clerk_id = a.clerk_id
WHERE a.status_flag = 1
GROUP BY a.staff_id
</select>
</mapper>
\ No newline at end of file
......@@ -303,19 +303,22 @@ public class StoreController extends WebBaseController{
//获取门店详情
public boolean isEnterpriseOver(String storeId) {
StoreDTO store = storeService.getStore(storeId);
if(store == null){
if (store == null) {
return true;
}
EnterpriseDTO enterprise = enterpriseService.getEnterpriseByEid(store.getEnterpriseId());
EnterpriseDTO enterprise = enterpriseService.getEnterpriseById(store.getEnterpriseId());
if (enterprise == null || enterprise.getStatus() != 1) {
return true;
}
if (enterprise.getExpireTime() == null) {
if (enterprise.getEnabledState() == null) {
return false;
} else return enterprise.getEnabledState() != 1;
} else
} else {
return enterprise.getEnabledState() != 1;
}
} else {
return enterprise.getExpireTime().getTime() <= System.currentTimeMillis() || enterprise.getEnabledState() != 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