Commit c3cc38cf by QianQiXiang

解绑记录接口

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