Commit c3cc38cf by QianQiXiang

解绑记录接口

parent c547ea4e
......@@ -11,136 +11,155 @@ import java.util.List;
import java.util.Set;
public interface StaffClerkRelationApiService {
/**
* 绑定日志
*
* @param params
*/
void bindLogMq(String params);
List<StaffClerkRelationDTO> listBindCode(String enterpriseId, Set<String> clerkCodeList);
List<StaffClerkRelationDTO> listBindCodeByStaffId(List<String> enterpriseIdList, String staffId);
/**
* 根据staffid 获取列表
* @param staffId
* @return
*/
List<StaffClerkInfoDTO> listBindDetailByStaffId(String staffId);
/**
* 绑定
*
* @return
*/
ServiceResponse bindStaffClerk(StaffClerkRelationDTO staffClerkRelationDTO, String optStaffId, int chanelCode);
StaffClerkRelationDTO getByCodeAndEnterpriseId(String clerkCode, String enterpriseId);
void delAndInsert(StaffClerkRelationDTO staffClerkRelation,String optStaffId,int chanelCode);
/**
* 解绑
* @param storeId
* @param clerkCode
* @return
*/
String delByStoreIdAndCode(String storeId,String clerkCode);
StaffClerkRelationDTO getOneByClerkId(String clerkId);
List<StaffClerkRelationDTO> listByClerkIds(List<String> clerkIds);
/**
* 导购列表
* @param storeId
* @return
*/
List<StaffClerkRelationDTO>listByStoreId(String storeId);
/**
* 解绑
* @param staffId 操作人
* @param clerkId
* @return
*/
boolean unbindByStaffAndClerkId(String staffId,String clerkId);
/**
* 查询导购信息
* @param clerkId
* @return
*/
StaffClerkRelationDTO getOneByStoreIdAndStaffId(String storeId,String staffId);
/**
* 查询导购信息
* @param clerkId
* @return
*/
StaffClerkRelationDTO getByClerkId(String clerkId);
/**
*
* @param enterpriseId
* @param wxUserId
* @return
*/
List<StaffClerkRelationDTO> listByEnterpriseIdAndWxUserId(String enterpriseId,String wxUserId);
/**
* 删除关联关系
* @param clerkId
*/
void delByClerkId(String clerkId);
/**
* 搜索查询列表
*
* @param wxEnterpriseId
* @param search
* @param enterpriseId
* @param optType
* @return
*/
Page<StaffClerkBindLogDetailDTO> pageStaffClerkBindLog(String wxEnterpriseId, String search, String enterpriseId, int optType, BasePageInfo pageInfo);
/**
* 追加到绑定日志
*
* @param staffId
* @param optStaffId
* @param optType
* @param channelCode
* @param relationId
*/
void pushToBindLog(String staffId, String optStaffId, int optType, int channelCode, String relationId);
/**
* 获取config
*
* @param clerkId
* @param memberId
* @return
*/
ServiceResponse<String> getClerkMemberChatConfig(String clerkId);
/**
* @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
*/
List<StaffClerkRelationDTO> listAll();
/**
* 绑定日志
*
* @param params
*/
void bindLogMq(String params);
List<StaffClerkRelationDTO> listBindCode(String enterpriseId, Set<String> clerkCodeList);
List<StaffClerkRelationDTO> listBindCodeByStaffId(List<String> enterpriseIdList, String staffId);
/**
* 根据staffid 获取列表
*
* @param staffId
* @return
*/
List<StaffClerkInfoDTO> listBindDetailByStaffId(String staffId);
/**
* 绑定
*
* @return
*/
ServiceResponse bindStaffClerk(StaffClerkRelationDTO staffClerkRelationDTO, String optStaffId, int chanelCode);
StaffClerkRelationDTO getByCodeAndEnterpriseId(String clerkCode, String enterpriseId);
void delAndInsert(StaffClerkRelationDTO staffClerkRelation, String optStaffId, int chanelCode);
/**
* 解绑
*
* @param storeId
* @param clerkCode
* @return
*/
String delByStoreIdAndCode(String storeId, String clerkCode);
StaffClerkRelationDTO getOneByClerkId(String clerkId);
List<StaffClerkRelationDTO> listByClerkIds(List<String> clerkIds);
/**
* 导购列表
*
* @param storeId
* @return
*/
List<StaffClerkRelationDTO> listByStoreId(String storeId);
/**
* 解绑
*
* @param staffId 操作人
* @param clerkId
* @return
*/
boolean unbindByStaffAndClerkId(String staffId, String clerkId);
/**
* 查询导购信息
*
* @param clerkId
* @return
*/
StaffClerkRelationDTO getOneByStoreIdAndStaffId(String storeId, String staffId);
/**
* 查询导购信息
*
* @param clerkId
* @return
*/
StaffClerkRelationDTO getByClerkId(String clerkId);
/**
* @param enterpriseId
* @param wxUserId
* @return
*/
List<StaffClerkRelationDTO> listByEnterpriseIdAndWxUserId(String enterpriseId, String wxUserId);
/**
* 删除关联关系
*
* @param clerkId
*/
void delByClerkId(String clerkId);
/**
* 搜索查询列表
*
* @param wxEnterpriseId
* @param search
* @param enterpriseId
* @param optType
* @return
*/
Page<StaffClerkBindLogDetailDTO> pageStaffClerkBindLog(String wxEnterpriseId, String search, String enterpriseId, int optType, BasePageInfo pageInfo);
/**
* 搜索解绑列表
*
* @param wxEnterpriseId
* @param clerkId
* @param enterpriseId
* @param pageInfo
* @return
*/
Page<StaffClerkBindLogDetailDTO> pageStaffClerkUnBindLog(String wxEnterpriseId, String clerkId, String enterpriseId, int optType, BasePageInfo pageInfo);
/**
* 追加到绑定日志
*
* @param staffId
* @param optStaffId
* @param optType
* @param channelCode
* @param relationId
*/
void pushToBindLog(String staffId, String optStaffId, int optType, int channelCode, String relationId);
/**
* 获取config
*
* @param clerkId
* @param memberId
* @return
*/
ServiceResponse<String> getClerkMemberChatConfig(String clerkId);
/**
* @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
*/
List<StaffClerkRelationDTO> listAll();
}
......@@ -10,31 +10,38 @@ import java.util.List;
@Mapper
public interface StaffClerkBindLogMapper {
/**
*
*/
int deleteByPrimaryKey(Integer logId);
/**
*
*/
int insert(TabHaobanStaffClerkBindLog record);
/**
*
*/
int insertSelective(TabHaobanStaffClerkBindLog record);
/**
*
*/
TabHaobanStaffClerkBindLog selectByPrimaryKey(Integer logId);
/**
*
*/
int updateByPrimaryKeySelective(TabHaobanStaffClerkBindLog record);
/**
*
*/
int updateByPrimaryKey(TabHaobanStaffClerkBindLog record);
/**
* 列表
*
* @param clerkIds
* @param staffIds
* @param enterpriseIds
......@@ -42,5 +49,8 @@ public interface StaffClerkBindLogMapper {
* @return
*/
public List<TabHaobanStaffClerkBindLog> listStaffClerkBindLog(@Param("wxEnterpriseId") String wxEnterpriseId, @Param("clerkIds") List<String> clerkIds
, @Param("staffIds") List<String> staffIds, @Param("enterpriseIds") List<String> enterpriseIds, @Param("optType") int optType,@Param("search") String search);
, @Param("staffIds") List<String> staffIds, @Param("enterpriseIds") List<String> enterpriseIds, @Param("optType") int optType, @Param("search") String search);
public List<TabHaobanStaffClerkBindLog> StaffClerkUnBindLog(@Param("wxEnterpriseId") String wxEnterpriseId, @Param("clerkId") String clerkIds
, @Param("enterpriseId") String enterpriseIds, @Param("optType") int optType);
}
\ No newline at end of file
......@@ -15,19 +15,21 @@ import java.util.List;
public interface StaffClerkBindLogService {
/**
* 绑定日志
*
* @param bindLog
*/
public void insert(TabHaobanStaffClerkBindLog bindLog);
/**
* 插入日志到mq
*
* @param staffId
* @param optStaffId
* @param optType
* @param channelCode
* @param relationId
*/
public void pushToMq(String staffId,String optStaffId,int optType,int channelCode,String relationId);
public void pushToMq(String staffId, String optStaffId, int optType, int channelCode, String relationId);
/**
* 插入日志到mq
......@@ -40,8 +42,9 @@ public interface StaffClerkBindLogService {
public void pushToMqBatch(String optStaffId, int optType, int channelCode, List<String> relationIds);
/**
*
* @return
*/
public Page<StaffClerkBindLogDetailDTO> pageBindLog(String wxEnterpriseId,List<String> clerkIds, List<String> staffIds,List<String> enterpriseIds,int optType,String search, BasePageInfo pageInfo);
public Page<StaffClerkBindLogDetailDTO> pageBindLog(String wxEnterpriseId, List<String> clerkIds, List<String> staffIds, List<String> enterpriseIds, int optType, String search, BasePageInfo pageInfo);
public Page<StaffClerkBindLogDetailDTO> pageUnBindLog(String wxEnterpriseId, String clerkId, String enterpriseId, int optType, BasePageInfo pageInfo);
}
......@@ -129,6 +129,4 @@ public interface StaffClerkRelationService {
* @date 2021-07-15 16:26:17
*/
List<StaffClerkRelationDTO> listAll();
}
......@@ -30,12 +30,12 @@ import java.util.stream.Collectors;
@Service
public class StaffClerkBindLogServiceImpl implements StaffClerkBindLogService {
private static final Logger logger= LoggerFactory.getLogger(StaffClerkBindLogServiceImpl.class);
private static final Logger logger = LoggerFactory.getLogger(StaffClerkBindLogServiceImpl.class);
@Autowired
private StaffClerkBindLogMapper staffClerkBindLogMapper;
private static final String STAFF_LOG_MQ="haobanStaffClerkBindLogMq";
private static final String STAFF_LOG_MQ = "haobanStaffClerkBindLogMq";
@Override
public void insert(TabHaobanStaffClerkBindLog bindLog) {
......@@ -54,7 +54,7 @@ public class StaffClerkBindLogServiceImpl implements StaffClerkBindLogService {
GicMQClient clientInstance = GICMQClientUtil.getClientInstance();
try {
String ret = JSONObject.toJSONString(infoDTO);
logger.info("绑定的mq日志:{}",ret);
logger.info("绑定的mq日志:{}", ret);
clientInstance.sendMessage(STAFF_LOG_MQ, ret);
} catch (Exception e) {
e.printStackTrace();
......@@ -85,9 +85,17 @@ public class StaffClerkBindLogServiceImpl implements StaffClerkBindLogService {
}
@Override
public Page<StaffClerkBindLogDetailDTO> pageBindLog(String wxEnterpriseId,List<String> clerkIds, List<String> staffIds, List<String> enterpriseIds, int optType,String search, BasePageInfo pageInfo) {
public Page<StaffClerkBindLogDetailDTO> pageBindLog(String wxEnterpriseId, List<String> clerkIds, List<String> staffIds, List<String> enterpriseIds, int optType, String search, BasePageInfo pageInfo) {
PageHelper.startPage(pageInfo);
List<TabHaobanStaffClerkBindLog> clerkBindLogList = staffClerkBindLogMapper.listStaffClerkBindLog(wxEnterpriseId, clerkIds, staffIds, enterpriseIds, optType,search);
List<TabHaobanStaffClerkBindLog> clerkBindLogList = staffClerkBindLogMapper.listStaffClerkBindLog(wxEnterpriseId, clerkIds, staffIds, enterpriseIds, optType, search);
Page<StaffClerkBindLogDetailDTO> retPage = PageUtil.changePageHelperToCurrentPage(new PageInfo<>(clerkBindLogList), StaffClerkBindLogDetailDTO.class);
return retPage;
}
@Override
public Page<StaffClerkBindLogDetailDTO> pageUnBindLog(String wxEnterpriseId, String clerkId, String enterpriseId, int optType, BasePageInfo pageInfo) {
PageHelper.startPage(pageInfo);
List<TabHaobanStaffClerkBindLog> clerkBindLogList = staffClerkBindLogMapper.StaffClerkUnBindLog(wxEnterpriseId, clerkId, enterpriseId, optType);
Page<StaffClerkBindLogDetailDTO> retPage = PageUtil.changePageHelperToCurrentPage(new PageInfo<>(clerkBindLogList), StaffClerkBindLogDetailDTO.class);
return retPage;
}
......
......@@ -184,6 +184,8 @@ public class StaffClerkRelationServiceImpl implements StaffClerkRelationService
return EntityUtil.changeEntityByJSON(StaffClerkRelationDTO.class, mapper.getByCodeAndEnterpriseId(clerkCode, enterpriseId));
}
@Override
public String insert(StaffClerkRelationDTO staffClerkRelation) {
String uuid = StringUtil.randomUUID();
......
......@@ -144,7 +144,7 @@ public class StaffClerkRelationApiServiceImpl implements StaffClerkRelationApiSe
if (!nameMap.containsKey(infoDTO.getEnterpriseId())) {
EnterpriseDTO enterpriseDTO = enterpriseService.getEnterpriseById(infoDTO.getEnterpriseId());
if (null != enterpriseDTO) {
nameMap.put(infoDTO.getEnterpriseId(), enterpriseDTO.getEnterpriseName()+"_"+enterpriseDTO.getBrandName());
nameMap.put(infoDTO.getEnterpriseId(), enterpriseDTO.getEnterpriseName() + "_" + enterpriseDTO.getBrandName());
} else {
nameMap.put(infoDTO.getEnterpriseId(), "未知商户");
}
......@@ -173,11 +173,11 @@ public class StaffClerkRelationApiServiceImpl implements StaffClerkRelationApiSe
infoDTO.setClerkName(nameMap.get(infoDTO.getClerkId()));
infoDTO.setStoreName(nameMap.get(infoDTO.getStoreId()));
if ((nameMap.get(infoDTO.getEnterpriseId()))!=null){
String EnterpriseandBrandName= nameMap.get(infoDTO.getEnterpriseId());
String split[]=EnterpriseandBrandName.split("_");
if ((nameMap.get(infoDTO.getEnterpriseId())) != null) {
String EnterpriseandBrandName = nameMap.get(infoDTO.getEnterpriseId());
String split[] = EnterpriseandBrandName.split("_");
infoDTO.setEnterpriseName(split[0]);
if (split[1]!=null){
if (split[1] != null) {
infoDTO.setBrandName(split[1]);
}
}
......@@ -367,6 +367,27 @@ public class StaffClerkRelationApiServiceImpl implements StaffClerkRelationApiSe
}
@Override
public Page<StaffClerkBindLogDetailDTO> pageStaffClerkUnBindLog(String wxEnterpriseId, String clerkId, String enterpriseId, int optType, BasePageInfo pageInfo) {
if (wxEnterpriseId == null) {
logger.info("没有关联企业");
return null;
}
ClerkDTO clerkDTO = clerkService.getClerkByClerkId(clerkId);
if (clerkDTO == null) {
logger.info("没有这个导购");
return null;
}
String clerkCode = clerkDTO.getClerkCode();
StaffClerkRelationDTO relationDTO = staffClerkRelatinService.getByCodeAndEnterpriseId(clerkCode, enterpriseId);
if (null == relationDTO) {
logger.info("没有解绑信息");
return null;
}
Page<StaffClerkBindLogDetailDTO> retList = staffClerkBindLogService.pageUnBindLog(wxEnterpriseId, clerkId, enterpriseId, optType, pageInfo);
return retList;
}
@Override
public void pushToBindLog(String staffId, String optStaffId, int optType, int channelCode, String relationId) {
staffClerkBindLogService.pushToMq(staffId, optStaffId, optType, channelCode, relationId);
}
......
......@@ -57,7 +57,6 @@ public class AuditController extends WebBaseController {
@Autowired
private ClerkService clerkService;
//关联记录列表
@RequestMapping("clerk-apply-list")
public HaobanResponse staffStoreList(String staffId, Integer auditType, Integer auditStatus, String wxEnterpriseId, BasePageInfo pageInfo) {
......@@ -97,17 +96,16 @@ public class AuditController extends WebBaseController {
}
/**
*
* @param wxEnterpriseId 微信企业Id
* @param clerkCode 导购Id
* @param enterpriseId 企业Id
* @param optType 操作类型 0 绑定 1解绑 默认传 1
* @param pageInfo 页面
* @param clerkId 导购Id
* @param enterpriseId 企业Id
* @param optType 操作类型 0 绑定 1解绑 默认传 1
* @param pageInfo 页面
* @return
*/
@RequestMapping("clerk-unbind-list")
public HaobanResponse staffUnbindList(String wxEnterpriseId, String clerkCode, String enterpriseId, @RequestParam(defaultValue = "1") Integer optType, BasePageInfo pageInfo) {
Page<StaffClerkBindLogDetailDTO> page = staffClerkRelationApiService.pageStaffClerkBindLog(wxEnterpriseId, clerkCode, enterpriseId, optType, pageInfo);
public HaobanResponse staffUnbindList(String wxEnterpriseId, String clerkId, String enterpriseId, @RequestParam(defaultValue = "1") Integer optType, BasePageInfo pageInfo) {
Page<StaffClerkBindLogDetailDTO> page = staffClerkRelationApiService.pageStaffClerkUnBindLog(wxEnterpriseId, clerkId, enterpriseId, optType, pageInfo);
if (page == null) {
return resultResponse(HaoBanErrCode.ERR_8);
}
......
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