Commit 1b5bbdeb by xuwenqian

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

parent d71be61e
...@@ -3,8 +3,9 @@ package com.gic.haoban.manage.api.dto; ...@@ -3,8 +3,9 @@ package com.gic.haoban.manage.api.dto;
import java.io.Serializable; import java.io.Serializable;
import java.util.Date; import java.util.Date;
public class StaffClerkInfoDTO implements Serializable{ public class StaffClerkInfoDTO implements Serializable {
private static final long serialVersionUID = 1L;
private String staffClerkRelationId; private String staffClerkRelationId;
...@@ -48,8 +49,6 @@ public class StaffClerkInfoDTO implements Serializable{ ...@@ -48,8 +49,6 @@ public class StaffClerkInfoDTO implements Serializable{
this.mainStoreFlag = mainStoreFlag; this.mainStoreFlag = mainStoreFlag;
} }
private static final long serialVersionUID = 1L;
public String getEnterpriseName() { public String getEnterpriseName() {
return enterpriseName; return enterpriseName;
} }
......
...@@ -3,8 +3,9 @@ package com.gic.haoban.manage.api.dto; ...@@ -3,8 +3,9 @@ package com.gic.haoban.manage.api.dto;
import java.io.Serializable; import java.io.Serializable;
import java.util.Date; import java.util.Date;
public class StaffClerkRelationDTO implements Serializable{ public class StaffClerkRelationDTO implements Serializable {
private static final long serialVersionUID = 1L;
private String staffClerkRelationId; private String staffClerkRelationId;
...@@ -28,7 +29,8 @@ public class StaffClerkRelationDTO implements Serializable{ ...@@ -28,7 +29,8 @@ public class StaffClerkRelationDTO implements Serializable{
private Date updateTime; private Date updateTime;
private static final long serialVersionUID = 1L; private String storeName;
private String staffName;
public String getStaffClerkRelationId() { public String getStaffClerkRelationId() {
return staffClerkRelationId; return staffClerkRelationId;
...@@ -118,4 +120,19 @@ public class StaffClerkRelationDTO implements Serializable{ ...@@ -118,4 +120,19 @@ public class StaffClerkRelationDTO implements Serializable{
this.updateTime = updateTime; 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; 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.api.base.commons.Page;
import com.gic.haoban.base.api.common.BasePageInfo; import com.gic.haoban.base.api.common.BasePageInfo;
import com.gic.haoban.base.api.common.ServiceResponse; import com.gic.haoban.base.api.common.ServiceResponse;
...@@ -10,12 +7,16 @@ import com.gic.haoban.manage.api.dto.StaffClerkBindLogDetailDTO; ...@@ -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.StaffClerkInfoDTO;
import com.gic.haoban.manage.api.dto.StaffClerkRelationDTO; import com.gic.haoban.manage.api.dto.StaffClerkRelationDTO;
import java.util.List;
import java.util.Set;
public interface StaffClerkRelationApiService { public interface StaffClerkRelationApiService {
/** /**
* 绑定日志 * 绑定日志
*
* @param params * @param params
*/ */
public void bindLogMq(String params); void bindLogMq(String params);
List<StaffClerkRelationDTO> listBindCode(String enterpriseId, Set<String> clerkCodeList); List<StaffClerkRelationDTO> listBindCode(String enterpriseId, Set<String> clerkCodeList);
...@@ -30,9 +31,10 @@ public interface StaffClerkRelationApiService { ...@@ -30,9 +31,10 @@ public interface StaffClerkRelationApiService {
/** /**
* 绑定 * 绑定
*
* @return * @return
*/ */
public ServiceResponse bindStaffClerk(StaffClerkRelationDTO staffClerkRelationDTO,String optStaffId,int chanelCode); ServiceResponse bindStaffClerk(StaffClerkRelationDTO staffClerkRelationDTO, String optStaffId, int chanelCode);
StaffClerkRelationDTO getByCodeAndEnterpriseId(String clerkCode, String enterpriseId); StaffClerkRelationDTO getByCodeAndEnterpriseId(String clerkCode, String enterpriseId);
...@@ -96,40 +98,49 @@ public interface StaffClerkRelationApiService { ...@@ -96,40 +98,49 @@ public interface StaffClerkRelationApiService {
/** /**
* 搜索查询列表 * 搜索查询列表
*
* @param wxEnterpriseId * @param wxEnterpriseId
* @param search * @param search
* @param enterpriseId * @param enterpriseId
* @param optType * @param optType
* @return * @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 staffId
* @param optStaffId * @param optStaffId
* @param optType * @param optType
* @param channelCode * @param channelCode
* @param relationId * @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 * 获取config
*
* @param clerkId * @param clerkId
* @param memberId * @param memberId
* @return * @return
*/ */
ServiceResponse<String> getClerkMemberChatConfig(String clerkId); ServiceResponse<String> getClerkMemberChatConfig(String clerkId);
/** /**
*
* @Description 方法描述:
* @return 返回值类型: <pre> * @return 返回值类型: <pre>
* @author 作者: WQ <pre> * @author 作者: WQ <pre>
* @date 时间: 2020年12月24日 上午11:21:38 <pre> * @date 时间: 2020年12月24日 上午11:21:38 <pre>
* @param wxEnterpriseId: <pre> * @param wxEnterpriseId: <pre>
* @param pageInfo: <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; 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.api.dto.StaffClerkRelationDTO;
import com.gic.haoban.manage.service.entity.TabHaobanStaffClerkRelation; 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 { public interface TabHaobanStaffClerkRelationMapper {
int deleteByPrimaryKey(String staffClerkRelationId); int deleteByPrimaryKey(String staffClerkRelationId);
...@@ -25,14 +24,16 @@ public interface TabHaobanStaffClerkRelationMapper { ...@@ -25,14 +24,16 @@ public interface TabHaobanStaffClerkRelationMapper {
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); TabHaobanStaffClerkRelation getOneByClerkId(@Param("clerkId") String clerkId);
/** /**
* 改变状态 格局clerkId * 改变状态 格局clerkId
*
* @param clerkId * @param clerkId
* @param status * @param status
* @return * @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 { ...@@ -117,7 +118,18 @@ public interface TabHaobanStaffClerkRelationMapper {
/** /**
* 已使用的门店id列表 * 已使用的门店id列表
*
* @param enterpriseId * @param enterpriseId
*/ */
List<TabHaobanStaffClerkRelation> listBindStoreIdByEnterpriseId(String 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; 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.api.base.commons.Page;
import com.gic.haoban.base.api.common.BasePageInfo; 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.api.dto.StaffClerkRelationDTO;
import com.gic.haoban.manage.service.entity.MemberClerkChatConfig; import com.gic.haoban.manage.service.entity.MemberClerkChatConfig;
import com.gic.haoban.manage.service.entity.TabHaobanStaffClerkRelation; 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 { public interface StaffClerkRelationService {
...@@ -20,10 +17,11 @@ public interface StaffClerkRelationService { ...@@ -20,10 +17,11 @@ public interface StaffClerkRelationService {
/** /**
* 删除绑定 * 删除绑定
*
* @param clerkId * @param clerkId
* @return * @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 { ...@@ -32,7 +30,7 @@ public interface StaffClerkRelationService {
* @param storeIds * @param storeIds
* @return * @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 { ...@@ -42,35 +40,37 @@ public interface StaffClerkRelationService {
* @param storeIds 解除除了这些门店之外的绑定的门店 * @param storeIds 解除除了这些门店之外的绑定的门店
* @return * @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 * @param dto
* @return * @return
*/ */
public String bind(StaffClerkRelationDTO dto,String optStaffId,int chanelCode); String bind(StaffClerkRelationDTO dto, String optStaffId, int chanelCode);
/** /**
* 根据clerkId 更新数据 * 根据clerkId 更新数据
* @param dto * @param dto
* @return * @return
*/ */
public boolean updateByClerkId(StaffClerkRelationDTO dto); boolean updateByClerkId(StaffClerkRelationDTO dto);
/** /**
* 查询绑定根据clerkId * 查询绑定根据clerkId
*
* @param clerkId * @param clerkId
* @param wxEnterpriseId * @param wxEnterpriseId
* @return * @return
*/ */
public StaffClerkRelationDTO getBindByClerkId(String clerkId,String wxEnterpriseId); StaffClerkRelationDTO getBindByClerkId(String clerkId, String wxEnterpriseId);
StaffClerkRelationDTO getByCodeAndEnterpriseId(String clerkCode, String enterpriseId); StaffClerkRelationDTO getByCodeAndEnterpriseId(String clerkCode, String enterpriseId);
String insert(StaffClerkRelationDTO staffClerkRelation); 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); StaffClerkRelationDTO getOneBindCodeNoStatus(String enterpriseId, String clerkCode);
...@@ -86,15 +86,15 @@ public interface StaffClerkRelationService { ...@@ -86,15 +86,15 @@ public interface StaffClerkRelationService {
* 保存 * 保存
* @param memberClerkChatConfig * @param memberClerkChatConfig
*/ */
public void saveChatConfig(MemberClerkChatConfig memberClerkChatConfig); void saveChatConfig(MemberClerkChatConfig memberClerkChatConfig);
/** /**
*
* @param staffId * @param staffId
* @param memberId * @param memberId
* @return * @return
*/ */
public MemberClerkChatConfig getChatConfig(String staffId,String memberId); MemberClerkChatConfig getChatConfig(String staffId, String memberId);
/** /**
* 根据企业查询 * 根据企业查询
* @param wxEnterpriseId * @param wxEnterpriseId
...@@ -121,5 +121,14 @@ public interface StaffClerkRelationService { ...@@ -121,5 +121,14 @@ public interface StaffClerkRelationService {
*/ */
List<StaffClerkRelationDTO> listBindStoreIdByEnterpriseId(String enterpriseId); 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; package com.gic.haoban.manage.service.service.impl;
import java.util.*;
import java.util.stream.Collectors;
import com.alibaba.fastjson.JSONObject; 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.commons.util.ToolUtil;
import com.gic.haoban.base.api.common.BasePageInfo; 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.BindTypeEnum;
import com.gic.haoban.manage.api.enums.ChannelCodeEnum; 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.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.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.entity.TabHaobanStaffClerkRelation;
import com.gic.haoban.manage.service.service.ClerkMainStoreRelatedService; import com.gic.haoban.manage.service.service.*;
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.github.pagehelper.PageHelper; import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo; import com.github.pagehelper.PageInfo;
import javafx.scene.control.Tab;
import org.apache.commons.collections.CollectionUtils; import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger; import org.slf4j.Logger;
...@@ -31,14 +24,8 @@ import org.slf4j.LoggerFactory; ...@@ -31,14 +24,8 @@ import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import com.gic.api.base.commons.Page; import java.util.*;
import com.gic.commons.util.EntityUtil; import java.util.stream.Collectors;
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;
@Service @Service
public class StaffClerkRelationServiceImpl implements StaffClerkRelationService { public class StaffClerkRelationServiceImpl implements StaffClerkRelationService {
...@@ -293,4 +280,9 @@ public class StaffClerkRelationServiceImpl implements StaffClerkRelationService ...@@ -293,4 +280,9 @@ public class StaffClerkRelationServiceImpl implements StaffClerkRelationService
} }
return EntityUtil.changeEntityListNew(StaffClerkRelationDTO.class, clerkRelations); return EntityUtil.changeEntityListNew(StaffClerkRelationDTO.class, clerkRelations);
} }
@Override
public List<StaffClerkRelationDTO> listAll() {
return mapper.listAll();
}
} }
...@@ -38,7 +38,7 @@ import java.util.stream.Collectors; ...@@ -38,7 +38,7 @@ import java.util.stream.Collectors;
@Service @Service
public class StaffClerkRelationApiServiceImpl implements StaffClerkRelationApiService { public class StaffClerkRelationApiServiceImpl implements StaffClerkRelationApiService {
private static final Logger logger= LoggerFactory.getLogger(StaffClerkRelationApiServiceImpl.class); private static final Logger logger = LoggerFactory.getLogger(StaffClerkRelationApiServiceImpl.class);
@Autowired @Autowired
private StaffClerkRelationService staffClerkRelatinService; private StaffClerkRelationService staffClerkRelatinService;
...@@ -86,9 +86,9 @@ public class StaffClerkRelationApiServiceImpl implements StaffClerkRelationApiSe ...@@ -86,9 +86,9 @@ public class StaffClerkRelationApiServiceImpl implements StaffClerkRelationApiSe
@Override @Override
public void bindLogMq(String params) { public void bindLogMq(String params) {
logger.info("绑定日志mq:{}",params); logger.info("绑定日志mq:{}", params);
StaffClerkBindLogInfoDTO infoDTO = JSONObject.parseObject(params, StaffClerkBindLogInfoDTO.class); StaffClerkBindLogInfoDTO infoDTO = JSONObject.parseObject(params, StaffClerkBindLogInfoDTO.class);
if (null == infoDTO){ if (null == infoDTO) {
logger.info("数据不存在"); logger.info("数据不存在");
return; return;
} }
...@@ -98,11 +98,11 @@ public class StaffClerkRelationApiServiceImpl implements StaffClerkRelationApiSe ...@@ -98,11 +98,11 @@ public class StaffClerkRelationApiServiceImpl implements StaffClerkRelationApiSe
return; return;
} }
ClerkDTO clerkDTO = clerkService.getClerkByClerkIdNoStatus(clerkRelation.getClerkId()); ClerkDTO clerkDTO = clerkService.getClerkByClerkIdNoStatus(clerkRelation.getClerkId());
String phoneNumber=""; String phoneNumber = "";
if (null != clerkDTO) { if (null != clerkDTO) {
phoneNumber=clerkDTO.getPhoneNumber(); phoneNumber = clerkDTO.getPhoneNumber();
} }
TabHaobanStaffClerkBindLog staffClerkRelation=new TabHaobanStaffClerkBindLog(); TabHaobanStaffClerkBindLog staffClerkRelation = new TabHaobanStaffClerkBindLog();
staffClerkRelation.setClerkId(clerkRelation.getClerkId()); staffClerkRelation.setClerkId(clerkRelation.getClerkId());
staffClerkRelation.setChannelCode(infoDTO.getChannelCode()); staffClerkRelation.setChannelCode(infoDTO.getChannelCode());
staffClerkRelation.setClerkCode(clerkRelation.getClerkCode()); staffClerkRelation.setClerkCode(clerkRelation.getClerkCode());
...@@ -123,11 +123,12 @@ public class StaffClerkRelationApiServiceImpl implements StaffClerkRelationApiSe ...@@ -123,11 +123,12 @@ public class StaffClerkRelationApiServiceImpl implements StaffClerkRelationApiSe
@Override @Override
public List<StaffClerkRelationDTO> listBindCode(String enterpriseId, Set<String> clerkCodeList) { public List<StaffClerkRelationDTO> listBindCode(String enterpriseId, Set<String> clerkCodeList) {
return staffClerkRelatinService.listBindCode(enterpriseId,clerkCodeList); return staffClerkRelatinService.listBindCode(enterpriseId, clerkCodeList);
} }
@Override @Override
public List<StaffClerkRelationDTO> listBindCodeByStaffId(List<String> enterpriseIdList, String staffId) { public List<StaffClerkRelationDTO> listBindCodeByStaffId(List<String> enterpriseIdList, String staffId) {
return staffClerkRelatinService.listBindCodeByStaffId(enterpriseIdList,staffId); return staffClerkRelatinService.listBindCodeByStaffId(enterpriseIdList, staffId);
} }
@Override @Override
...@@ -137,26 +138,26 @@ public class StaffClerkRelationApiServiceImpl implements StaffClerkRelationApiSe ...@@ -137,26 +138,26 @@ public class StaffClerkRelationApiServiceImpl implements StaffClerkRelationApiSe
return null; return null;
} }
List<StaffClerkInfoDTO> infoDTOS = EntityUtil.changeEntityListByJSON(StaffClerkInfoDTO.class, list); List<StaffClerkInfoDTO> infoDTOS = EntityUtil.changeEntityListByJSON(StaffClerkInfoDTO.class, list);
Map<String,String> nameMap=new HashMap<>(); Map<String, String> nameMap = new HashMap<>();
infoDTOS.forEach(infoDTO->{ infoDTOS.forEach(infoDTO -> {
//企业 //企业
if (!nameMap.containsKey(infoDTO.getEnterpriseId())) { if (!nameMap.containsKey(infoDTO.getEnterpriseId())) {
EnterpriseDTO enterpriseDTO = enterpriseService.getEnterpriseById(infoDTO.getEnterpriseId()); EnterpriseDTO enterpriseDTO = enterpriseService.getEnterpriseById(infoDTO.getEnterpriseId());
if (null != enterpriseDTO) { if (null != enterpriseDTO) {
nameMap.put(infoDTO.getEnterpriseId(),enterpriseDTO.getEnterpriseName()); nameMap.put(infoDTO.getEnterpriseId(), enterpriseDTO.getEnterpriseName());
}else{ } else {
nameMap.put(infoDTO.getEnterpriseId(),"未知商户"); nameMap.put(infoDTO.getEnterpriseId(), "未知商户");
} }
} }
//门店店员名称 //门店店员名称
if (!nameMap.containsKey(infoDTO.getClerkId())) { if (!nameMap.containsKey(infoDTO.getClerkId())) {
ClerkDTO clerkDTO = clerkService.getClerkByClerkId(infoDTO.getClerkId()); ClerkDTO clerkDTO = clerkService.getClerkByClerkId(infoDTO.getClerkId());
if (null != clerkDTO) { if (null != clerkDTO) {
nameMap.put(infoDTO.getClerkId(),clerkDTO.getClerkName()); nameMap.put(infoDTO.getClerkId(), clerkDTO.getClerkName());
nameMap.put(infoDTO.getStoreId(),clerkDTO.getStoreName()); nameMap.put(infoDTO.getStoreId(), clerkDTO.getStoreName());
infoDTO.setClerkPhoneNumber(clerkDTO.getPhoneNumber()); infoDTO.setClerkPhoneNumber(clerkDTO.getPhoneNumber());
}else{ } else {
nameMap.put(infoDTO.getEnterpriseId(),"未知店员"); nameMap.put(infoDTO.getEnterpriseId(), "未知店员");
} }
} }
...@@ -164,9 +165,9 @@ public class StaffClerkRelationApiServiceImpl implements StaffClerkRelationApiSe ...@@ -164,9 +165,9 @@ public class StaffClerkRelationApiServiceImpl implements StaffClerkRelationApiSe
if (!nameMap.containsKey(infoDTO.getStoreId())) { if (!nameMap.containsKey(infoDTO.getStoreId())) {
StoreDTO storeDTO = storeService.getStore(infoDTO.getStoreId()); StoreDTO storeDTO = storeService.getStore(infoDTO.getStoreId());
if (null != storeDTO) { if (null != storeDTO) {
nameMap.put(infoDTO.getStoreId(),storeDTO.getStoreName()); nameMap.put(infoDTO.getStoreId(), storeDTO.getStoreName());
}else{ } else {
nameMap.put(infoDTO.getStoreId(),"未知门店"); nameMap.put(infoDTO.getStoreId(), "未知门店");
} }
} }
...@@ -178,11 +179,11 @@ public class StaffClerkRelationApiServiceImpl implements StaffClerkRelationApiSe ...@@ -178,11 +179,11 @@ public class StaffClerkRelationApiServiceImpl implements StaffClerkRelationApiSe
} }
@Override @Override
public ServiceResponse bindStaffClerk(StaffClerkRelationDTO staffClerkRelationDTO,String optStaffId,int chanelCode) { public ServiceResponse bindStaffClerk(StaffClerkRelationDTO staffClerkRelationDTO, String optStaffId, int chanelCode) {
logger.info("绑定clerk:{}", JSONObject.toJSONString(staffClerkRelationDTO)); logger.info("绑定clerk:{}", JSONObject.toJSONString(staffClerkRelationDTO));
ServiceResponse<Object> response = new ServiceResponse<>(); ServiceResponse<Object> response = new ServiceResponse<>();
StaffClerkRelationDTO relationDTO = staffClerkRelatinService.getBindByClerkId(staffClerkRelationDTO.getClerkId(), staffClerkRelationDTO.getWxEnterpriseId()); StaffClerkRelationDTO relationDTO = staffClerkRelatinService.getBindByClerkId(staffClerkRelationDTO.getClerkId(), staffClerkRelationDTO.getWxEnterpriseId());
if (null!=relationDTO) { if (null != relationDTO) {
response.setCode(2); response.setCode(2);
response.setMessage("已经被绑定,不能绑定"); response.setMessage("已经被绑定,不能绑定");
return response; return response;
...@@ -203,46 +204,48 @@ public class StaffClerkRelationApiServiceImpl implements StaffClerkRelationApiSe ...@@ -203,46 +204,48 @@ public class StaffClerkRelationApiServiceImpl implements StaffClerkRelationApiSe
} }
} }
StaffClerkRelationDTO storeHasBind = staffClerkRelatinService.getOneBindByStoreId(staffClerkRelationDTO.getStaffId(), staffClerkRelationDTO.getStoreId()); StaffClerkRelationDTO storeHasBind = staffClerkRelatinService.getOneBindByStoreId(staffClerkRelationDTO.getStaffId(), staffClerkRelationDTO.getStoreId());
if (storeHasBind!=null) { if (storeHasBind != null) {
response.setCode(3); response.setCode(3);
response.setMessage("该导购已在该门店下有其它成员绑定"); response.setMessage("该导购已在该门店下有其它成员绑定");
return response; return response;
} }
String relationId = staffClerkRelatinService.bind(staffClerkRelationDTO,optStaffId,chanelCode); String relationId = staffClerkRelatinService.bind(staffClerkRelationDTO, optStaffId, chanelCode);
response.setResult(relationId); response.setResult(relationId);
return response; return response;
} }
@Override @Override
public StaffClerkRelationDTO getByCodeAndEnterpriseId(String clerkCode, String enterpriseId) { public StaffClerkRelationDTO getByCodeAndEnterpriseId(String clerkCode, String enterpriseId) {
return staffClerkRelatinService.getByCodeAndEnterpriseId(clerkCode,enterpriseId); return staffClerkRelatinService.getByCodeAndEnterpriseId(clerkCode, enterpriseId);
} }
@Override @Override
public String delByStoreIdAndCode(String storeId, String clerkCode) { public String delByStoreIdAndCode(String storeId, String clerkCode) {
TabHaobanStaffClerkRelation staffClerkRelation = tabHaobanStaffClerkRelationMapper.getByCodeAndStoreId(clerkCode, storeId); TabHaobanStaffClerkRelation staffClerkRelation = tabHaobanStaffClerkRelationMapper.getByCodeAndStoreId(clerkCode, storeId);
tabHaobanStaffClerkRelationMapper.delByStoreIdAndCode(storeId,clerkCode); tabHaobanStaffClerkRelationMapper.delByStoreIdAndCode(storeId, clerkCode);
delSetMainStore(staffClerkRelation); delSetMainStore(staffClerkRelation);
return null; return null;
} }
@Override @Override
public List<StaffClerkRelationDTO> listByClerkIds(List<String> clerkIds) { public List<StaffClerkRelationDTO> listByClerkIds(List<String> clerkIds) {
if(clerkIds == null || clerkIds.isEmpty()){ if (clerkIds == null || clerkIds.isEmpty()) {
return Collections.EMPTY_LIST; return Collections.EMPTY_LIST;
} }
List<TabHaobanStaffClerkRelation> list = tabHaobanStaffClerkRelationMapper.listByClerkIds(clerkIds); List<TabHaobanStaffClerkRelation> list = tabHaobanStaffClerkRelationMapper.listByClerkIds(clerkIds);
if(CollectionUtil.isEmpty(list)){ if (CollectionUtil.isEmpty(list)) {
return new ArrayList<StaffClerkRelationDTO>(); return new ArrayList<StaffClerkRelationDTO>();
} }
List<StaffClerkRelationDTO> result = EntityUtil.changeEntityListByJSON(StaffClerkRelationDTO.class, list); List<StaffClerkRelationDTO> result = EntityUtil.changeEntityListByJSON(StaffClerkRelationDTO.class, list);
return result; return result;
} }
@Override @Override
public List<StaffClerkRelationDTO> listByStoreId(String storeId) { public List<StaffClerkRelationDTO> listByStoreId(String storeId) {
List<TabHaobanStaffClerkRelation> list = tabHaobanStaffClerkRelationMapper.listByStoreId(storeId); List<TabHaobanStaffClerkRelation> list = tabHaobanStaffClerkRelationMapper.listByStoreId(storeId);
if(CollectionUtil.isEmpty(list)){ if (CollectionUtil.isEmpty(list)) {
return new ArrayList<StaffClerkRelationDTO>(); return new ArrayList<StaffClerkRelationDTO>();
} }
List<StaffClerkRelationDTO> result = EntityUtil.changeEntityListByJSON(StaffClerkRelationDTO.class, list); List<StaffClerkRelationDTO> result = EntityUtil.changeEntityListByJSON(StaffClerkRelationDTO.class, list);
...@@ -251,98 +254,92 @@ public class StaffClerkRelationApiServiceImpl implements StaffClerkRelationApiSe ...@@ -251,98 +254,92 @@ public class StaffClerkRelationApiServiceImpl implements StaffClerkRelationApiSe
@Override @Override
public boolean unbindByStaffAndClerkId(String staffId, String clerkId) { public boolean unbindByStaffAndClerkId(String staffId, String clerkId) {
boolean b = staffClerkRelatinService.delBind(clerkId,staffId, ChannelCodeEnum.ADMIN_UNBIND.getCode()); return staffClerkRelatinService.delBind(clerkId, staffId, ChannelCodeEnum.ADMIN_UNBIND.getCode());
return b;
} }
@Override @Override
public StaffClerkRelationDTO getOneByClerkId(String clerkId) { public StaffClerkRelationDTO getOneByClerkId(String clerkId) {
TabHaobanStaffClerkRelation tab = tabHaobanStaffClerkRelationMapper.getOneByClerkId(clerkId); TabHaobanStaffClerkRelation tab = tabHaobanStaffClerkRelationMapper.getOneByClerkId(clerkId);
StaffClerkRelationDTO result = EntityUtil.changeEntityByJSON(StaffClerkRelationDTO.class, tab); StaffClerkRelationDTO result = EntityUtil.changeEntityByJSON(StaffClerkRelationDTO.class, tab);
return result; return result;
} }
@Override
public StaffClerkRelationDTO getByClerkId(String clerkId) { public StaffClerkRelationDTO getByClerkId(String clerkId) {
StaffClerkRelationDTO staffRelation = staffClerkRelatinService.getByClerkId(clerkId); StaffClerkRelationDTO staffRelation = staffClerkRelatinService.getByClerkId(clerkId);
return staffRelation; return staffRelation;
} }
@Override @Override
public StaffClerkRelationDTO getOneByStoreIdAndStaffId(String storeId, public StaffClerkRelationDTO getOneByStoreIdAndStaffId(String storeId,
String staffId) { String staffId) {
TabHaobanStaffClerkRelation tab = tabHaobanStaffClerkRelationMapper.getOneByStoreIdAndStaffId(storeId,staffId); TabHaobanStaffClerkRelation tab = tabHaobanStaffClerkRelationMapper.getOneByStoreIdAndStaffId(storeId, staffId);
if(tab == null){ if (tab == null) {
return null; return null;
} }
StaffClerkRelationDTO dto = EntityUtil.changeEntity(StaffClerkRelationDTO.class, tab); return EntityUtil.changeEntity(StaffClerkRelationDTO.class, tab);
return dto;
} }
@Override @Override
public void delAndInsert(StaffClerkRelationDTO staffClerkRelation,String optStaffId,int chanelCode) { public void delAndInsert(StaffClerkRelationDTO staffClerkRelation, String optStaffId, int chanelCode) {
if(StringUtils.isNotBlank(staffClerkRelation.getStaffClerkRelationId())){ if (StringUtils.isNotBlank(staffClerkRelation.getStaffClerkRelationId())) {
TabHaobanStaffClerkRelation oldStaffClerkRelation = tabHaobanStaffClerkRelationMapper.selectByPrimaryKey(staffClerkRelation.getStaffClerkRelationId()); TabHaobanStaffClerkRelation oldStaffClerkRelation = tabHaobanStaffClerkRelationMapper.selectByPrimaryKey(staffClerkRelation.getStaffClerkRelationId());
tabHaobanStaffClerkRelationMapper.delByPrimaryKey(staffClerkRelation.getStaffClerkRelationId()); tabHaobanStaffClerkRelationMapper.delByPrimaryKey(staffClerkRelation.getStaffClerkRelationId());
staffClerkBindLogService.pushToMq(oldStaffClerkRelation.getStaffId(),optStaffId, BindTypeEnum.UNBIND.getVal(),chanelCode,staffClerkRelation.getStaffClerkRelationId()); staffClerkBindLogService.pushToMq(oldStaffClerkRelation.getStaffId(), optStaffId, BindTypeEnum.UNBIND.getVal(), chanelCode, staffClerkRelation.getStaffClerkRelationId());
clerkMainStoreRelatedService.delMainStore(oldStaffClerkRelation.getStaffId(), oldStaffClerkRelation.getStoreId(), oldStaffClerkRelation.getWxEnterpriseId()); clerkMainStoreRelatedService.delMainStore(oldStaffClerkRelation.getStaffId(), oldStaffClerkRelation.getStoreId(), oldStaffClerkRelation.getWxEnterpriseId());
} }
String relationId = staffClerkRelatinService.insert(staffClerkRelation); String relationId = staffClerkRelatinService.insert(staffClerkRelation);
staffClerkBindLogService.pushToMq(staffClerkRelation.getStaffId(),optStaffId, BindTypeEnum.BIND.getVal(),chanelCode,relationId); staffClerkBindLogService.pushToMq(staffClerkRelation.getStaffId(), optStaffId, BindTypeEnum.BIND.getVal(), chanelCode, relationId);
//设置主门店 //设置主门店
clerkMainStoreRelatedService.getMainStoreByStaffId(staffClerkRelation.getStaffId(), staffClerkRelation.getWxEnterpriseId()); clerkMainStoreRelatedService.getMainStoreByStaffId(staffClerkRelation.getStaffId(), staffClerkRelation.getWxEnterpriseId());
} }
@Override @Override
public void delByClerkId(String clerkId) { public void delByClerkId(String clerkId) {
TabHaobanStaffClerkRelation staffClerkRelation = tabHaobanStaffClerkRelationMapper.getOneByClerkId(clerkId); TabHaobanStaffClerkRelation staffClerkRelation = tabHaobanStaffClerkRelationMapper.getOneByClerkId(clerkId);
tabHaobanStaffClerkRelationMapper.delByClerkId(clerkId); tabHaobanStaffClerkRelationMapper.delByClerkId(clerkId);
delSetMainStore(staffClerkRelation); delSetMainStore(staffClerkRelation);
} }
@Override @Override
public List<StaffClerkRelationDTO> listByEnterpriseIdAndWxUserId(String enterpriseId,String wxUserId) { public List<StaffClerkRelationDTO> listByEnterpriseIdAndWxUserId(String enterpriseId, String wxUserId) {
List<TabHaobanStaffClerkRelation> list = tabHaobanStaffClerkRelationMapper.listByEnterpriseIdAndWxUserId(enterpriseId,wxUserId); List<TabHaobanStaffClerkRelation> list = tabHaobanStaffClerkRelationMapper.listByEnterpriseIdAndWxUserId(enterpriseId, wxUserId);
return EntityUtil.changeEntityListByJSON(StaffClerkRelationDTO.class, list); return EntityUtil.changeEntityListByJSON(StaffClerkRelationDTO.class, list);
} }
@Override @Override
public Page<StaffClerkBindLogDetailDTO> pageStaffClerkBindLog(String wxEnterpriseId, String search, String enterpriseId, int optType, BasePageInfo pageInfo) { public Page<StaffClerkBindLogDetailDTO> pageStaffClerkBindLog(String wxEnterpriseId, String search, String enterpriseId, int optType, BasePageInfo pageInfo) {
List<TabHaobanWxEnterpriseRelated> wxEnterpriseRelateds = wxEnterpriseRelatedService.getByWxEnterpriseId(wxEnterpriseId); List<TabHaobanWxEnterpriseRelated> wxEnterpriseRelateds = wxEnterpriseRelatedService.getByWxEnterpriseId(wxEnterpriseId);
if (CollectionUtils.isEmpty(wxEnterpriseRelateds)) { if (CollectionUtils.isEmpty(wxEnterpriseRelateds)) {
logger.info("没有关联企业"); logger.info("没有关联企业");
return null; return null;
} }
List<String> enterpriseList = wxEnterpriseRelateds.stream().map(TabHaobanWxEnterpriseRelated::getEnterpriseId) List<String> enterpriseList = wxEnterpriseRelateds.stream().map(TabHaobanWxEnterpriseRelated::getEnterpriseId)
.filter(eid->{ .filter(eid -> {
if (StringUtils.isBlank(enterpriseId)) { if (StringUtils.isBlank(enterpriseId)) {
return true; return true;
}else if (enterpriseId.equals(eid)) { } else {
return true; return enterpriseId.equals(eid);
}else{
return false;
} }
}).collect(Collectors.toList()); }).collect(Collectors.toList());
if (CollectionUtils.isEmpty(enterpriseList)) { if (CollectionUtils.isEmpty(enterpriseList)) {
logger.info("没有有效的企业"); logger.info("没有有效的企业");
return null; return null;
} }
List<String> clerkIds=null; List<String> clerkIds = null;
// if (StringUtils.isNotBlank(search)) { Page<StaffClerkBindLogDetailDTO> retList = staffClerkBindLogService.pageBindLog(wxEnterpriseId, clerkIds, null, enterpriseList, optType, search, pageInfo);
// List<ClerkDTO> clerk = clerkNewService.listClerkByEnterpriseIdAndSearch(enterpriseList, search);
// if (CollectionUtils.isEmpty(clerk)) {
// logger.info("没有搜索到相应信息");
// return new Page<StaffClerkBindLogDetailDTO>();
// }
// clerkIds = clerk.stream().map(ClerkDTO::getClerkId).collect(Collectors.toList());
// }
Page<StaffClerkBindLogDetailDTO> retList = staffClerkBindLogService.pageBindLog(wxEnterpriseId, clerkIds, null, enterpriseList, optType,search, pageInfo);
if (CollectionUtils.isNotEmpty(retList.getResult())) { if (CollectionUtils.isNotEmpty(retList.getResult())) {
retList.getResult().forEach(staffClerkBindLogDetailDTO -> { retList.getResult().forEach(staffClerkBindLogDetailDTO -> {
TabHaobanStaff haobanStaff = staffService.selectById(staffClerkBindLogDetailDTO.getStaffId()); TabHaobanStaff haobanStaff = staffService.selectById(staffClerkBindLogDetailDTO.getStaffId());
if (null !=haobanStaff) { if (null != haobanStaff) {
staffClerkBindLogDetailDTO.setStaffName(haobanStaff.getStaffName()); staffClerkBindLogDetailDTO.setStaffName(haobanStaff.getStaffName());
staffClerkBindLogDetailDTO.setWxUserId(haobanStaff.getWxUserId()); staffClerkBindLogDetailDTO.setWxUserId(haobanStaff.getWxUserId());
}else{ } else {
staffClerkBindLogDetailDTO.setStaffName("未知成员"); staffClerkBindLogDetailDTO.setStaffName("未知成员");
} }
if ("-1".equals(staffClerkBindLogDetailDTO.getOptStaffId())) { if ("-1".equals(staffClerkBindLogDetailDTO.getOptStaffId())) {
staffClerkBindLogDetailDTO.setOptStaffName("系统"); staffClerkBindLogDetailDTO.setOptStaffName("系统");
}else { } else {
haobanStaff = staffService.selectById(staffClerkBindLogDetailDTO.getOptStaffId()); haobanStaff = staffService.selectById(staffClerkBindLogDetailDTO.getOptStaffId());
if (null != haobanStaff) { if (null != haobanStaff) {
staffClerkBindLogDetailDTO.setOptStaffName(haobanStaff.getStaffName()); staffClerkBindLogDetailDTO.setOptStaffName(haobanStaff.getStaffName());
...@@ -363,24 +360,24 @@ public class StaffClerkRelationApiServiceImpl implements StaffClerkRelationApiSe ...@@ -363,24 +360,24 @@ public class StaffClerkRelationApiServiceImpl implements StaffClerkRelationApiSe
@Override @Override
public void pushToBindLog(String staffId, String optStaffId, int optType, int channelCode, String relationId) { public void pushToBindLog(String staffId, String optStaffId, int optType, int channelCode, String relationId) {
staffClerkBindLogService.pushToMq(staffId,optStaffId,optType,channelCode,relationId); staffClerkBindLogService.pushToMq(staffId, optStaffId, optType, channelCode, relationId);
} }
private void setMainStore(StaffClerkRelationDTO staffClerkRelation){ private void setMainStore(StaffClerkRelationDTO staffClerkRelation) {
if(staffClerkRelation == null){ if (staffClerkRelation == null) {
logger.info("staffClerkRelation为空"); logger.info("staffClerkRelation为空");
return; return;
} }
String staffId = staffClerkRelation.getStaffId(); String staffId = staffClerkRelation.getStaffId();
String wxEnterpriseId = staffClerkRelation.getWxEnterpriseId(); String wxEnterpriseId = staffClerkRelation.getWxEnterpriseId();
List<StaffClerkRelationDTO> list = staffClerkRelatinService.lisByStaffId(wxEnterpriseId, staffId); List<StaffClerkRelationDTO> list = staffClerkRelatinService.lisByStaffId(wxEnterpriseId, staffId);
if(list != null && list.size() == 1){ if (list != null && list.size() == 1) {
clerkMainStoreRelatedService.setMainStore(staffId, staffClerkRelation.getStoreId(), wxEnterpriseId); clerkMainStoreRelatedService.setMainStore(staffId, staffClerkRelation.getStoreId(), wxEnterpriseId);
} }
} }
private void delSetMainStore(TabHaobanStaffClerkRelation staffClerkRelation){ private void delSetMainStore(TabHaobanStaffClerkRelation staffClerkRelation) {
if(staffClerkRelation == null){ if (staffClerkRelation == null) {
logger.info("staffClerkRelation为空"); logger.info("staffClerkRelation为空");
return; return;
} }
...@@ -389,29 +386,21 @@ public class StaffClerkRelationApiServiceImpl implements StaffClerkRelationApiSe ...@@ -389,29 +386,21 @@ public class StaffClerkRelationApiServiceImpl implements StaffClerkRelationApiSe
externalClerkRelatedService.delByClerkIdAndStaffId(staffClerkRelation.getClerkId(), staffId); externalClerkRelatedService.delByClerkIdAndStaffId(staffClerkRelation.getClerkId(), staffId);
//删除主门店 //删除主门店
clerkMainStoreRelatedService.delMainStore(staffId, staffClerkRelation.getStoreId(), wxEnterpriseId); clerkMainStoreRelatedService.delMainStore(staffId, staffClerkRelation.getStoreId(), wxEnterpriseId);
// TabHaobanClerkMainStoreRelated r = clerkMainStoreRelatedService.selectByWxEnterpriseIdAndStoreId(staffId, wxEnterpriseId);
// r.setStatusFlag(0);
// clerkMainStoreRelatedService.update(r);
// List<StaffClerkRelationDTO> list = staffClerkRelatinService.lisByStaffId(wxEnterpriseId, staffId);
// if(list != null && list.size() >= 1){
// clerkMainStoreRelatedService.setMainStore(staffId, list.get(list.size()-1).getStoreId(), wxEnterpriseId);
// }
} }
@Override @Override
public ServiceResponse<String> getClerkMemberChatConfig(String clerkId) { public ServiceResponse<String> getClerkMemberChatConfig(String clerkId) {
ServiceResponse response = new ServiceResponse();
ServiceResponse response=new ServiceResponse();
StaffClerkRelationDTO relationDTO = staffClerkRelatinService.getByClerkId(clerkId); StaffClerkRelationDTO relationDTO = staffClerkRelatinService.getByClerkId(clerkId);
if (null == relationDTO) { if (null == relationDTO) {
logger.info("导购没有关联企业微信:{}",clerkId); logger.info("导购没有关联企业微信:{}", clerkId);
response.setCode(2); response.setCode(2);
response.setMessage("导购没有关联企业微信"); response.setMessage("导购没有关联企业微信");
return response; return response;
} }
MemberClerkChatConfig chatConfig = staffClerkRelatinService.getChatConfig(relationDTO.getStaffId(), "-1"); MemberClerkChatConfig chatConfig = staffClerkRelatinService.getChatConfig(relationDTO.getStaffId(), "-1");
if (chatConfig!=null) { if (chatConfig != null) {
response.setResult(chatConfig.getConfigId()); response.setResult(chatConfig.getConfigId());
return response; return response;
} }
...@@ -426,15 +415,15 @@ public class StaffClerkRelationApiServiceImpl implements StaffClerkRelationApiSe ...@@ -426,15 +415,15 @@ public class StaffClerkRelationApiServiceImpl implements StaffClerkRelationApiSe
SecretSettingDTO secretSetting = secretSettingService.getSecretSetting(relationDTO.getWxEnterpriseId(), SecretTypeEnum.HAOBAN_HELP.getVal()); SecretSettingDTO secretSetting = secretSettingService.getSecretSetting(relationDTO.getWxEnterpriseId(), SecretTypeEnum.HAOBAN_HELP.getVal());
if (null == secretSetting||secretSetting.getCheckFlag()==0) { if (null == secretSetting || secretSetting.getCheckFlag() == 0) {
logger.info("没有配置secret:{}",relationDTO.getWxEnterpriseId()); logger.info("没有配置secret:{}", relationDTO.getWxEnterpriseId());
response.setCode(3); response.setCode(3);
response.setMessage("企业微信配置异常"); response.setMessage("企业微信配置异常");
return response; return response;
} }
WxEnterpriseDTO enterpriseDTO = wxEnterpriseService.selectById(relationDTO.getWxEnterpriseId()); WxEnterpriseDTO enterpriseDTO = wxEnterpriseService.selectById(relationDTO.getWxEnterpriseId());
String configId = qywxUserApiService.getExternalcontactByUserId(enterpriseDTO.getCorpid(), secretSetting.getSecretVal(), send); String configId = qywxUserApiService.getExternalcontactByUserId(enterpriseDTO.getCorpid(), secretSetting.getSecretVal(), send);
logger.info("configId:{}",configId); logger.info("configId:{}", configId);
if (StringUtils.isBlank(configId)) { if (StringUtils.isBlank(configId)) {
logger.info("staff:{}", configId, JSONObject.toJSONString(relationDTO)); logger.info("staff:{}", configId, JSONObject.toJSONString(relationDTO));
response.setCode(4); response.setCode(4);
...@@ -454,6 +443,11 @@ public class StaffClerkRelationApiServiceImpl implements StaffClerkRelationApiSe ...@@ -454,6 +443,11 @@ public class StaffClerkRelationApiServiceImpl implements StaffClerkRelationApiSe
@Override @Override
public Page<StaffClerkRelationDTO> pageByWxEnterpriseId(String wxEnterpriseId, BasePageInfo pageInfo) { public Page<StaffClerkRelationDTO> pageByWxEnterpriseId(String wxEnterpriseId, BasePageInfo pageInfo) {
return staffClerkRelatinService.pageByWxEnterpriseId(wxEnterpriseId,pageInfo); return staffClerkRelatinService.pageByWxEnterpriseId(wxEnterpriseId, pageInfo);
}
@Override
public List<StaffClerkRelationDTO> listAll() {
return staffClerkRelatinService.listAll();
} }
} }
...@@ -233,12 +233,11 @@ ...@@ -233,12 +233,11 @@
<update id="delByStoreIdAndCode" > <update id="delByStoreIdAndCode" >
update tab_haoban_staff_clerk_relation update tab_haoban_staff_clerk_relation
set set status_flag = 0,
status_flag = 0,
update_time = now() update_time = now()
where clerk_code = #{clerkCode,jdbcType=VARCHAR} where clerk_code = #{clerkCode,jdbcType=VARCHAR}
and store_id = #{storeId,jdbcType=VARCHAR} and store_id = #{storeId,jdbcType=VARCHAR}
and status_flag =1 and status_flag = 1
</update> </update>
<select id="listByClerkIds" resultMap="BaseResultMap" parameterType="java.lang.String" > <select id="listByClerkIds" resultMap="BaseResultMap" parameterType="java.lang.String" >
...@@ -426,13 +425,24 @@ ...@@ -426,13 +425,24 @@
</update> </update>
<select id="listBindStoreIdByEnterpriseId" resultMap="BaseResultMap"> <select id="listBindStoreIdByEnterpriseId" resultMap="BaseResultMap">
select select store_id,
store_id,
wx_enterprise_id wx_enterprise_id
from tab_haoban_staff_clerk_relation from tab_haoban_staff_clerk_relation
where where enterprise_id = #{wxEnterpriseId,jdbcType=VARCHAR}
enterprise_id = #{wxEnterpriseId,jdbcType=VARCHAR} and status_flag = 1
and status_flag =1
group by store_id group by store_id
</select> </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> </mapper>
\ No newline at end of file
...@@ -303,20 +303,23 @@ public class StoreController extends WebBaseController{ ...@@ -303,20 +303,23 @@ public class StoreController extends WebBaseController{
//获取门店详情 //获取门店详情
public boolean isEnterpriseOver(String storeId) { public boolean isEnterpriseOver(String storeId) {
StoreDTO store = storeService.getStore(storeId); StoreDTO store = storeService.getStore(storeId);
if(store == null){ if (store == null) {
return true; return true;
} }
EnterpriseDTO enterprise = enterpriseService.getEnterpriseByEid(store.getEnterpriseId()); EnterpriseDTO enterprise = enterpriseService.getEnterpriseById(store.getEnterpriseId());
if (enterprise == null || enterprise.getStatus() != 1) { if (enterprise == null || enterprise.getStatus() != 1) {
return true; return true;
} }
if (enterprise.getExpireTime() == null) { if (enterprise.getExpireTime() == null) {
if (enterprise.getEnabledState() == null) { if (enterprise.getEnabledState() == null) {
return false; return false;
} else return enterprise.getEnabledState() != 1; } else {
} else return enterprise.getEnabledState() != 1;
}
} else {
return enterprise.getExpireTime().getTime() <= System.currentTimeMillis() || enterprise.getEnabledState() != 1; 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