Merge remote-tracking branch 'origin/cc_20230520_partner' into cc_20230520_partner
# Conflicts: # coolstore-partner-common/src/main/java/com/cool/store/enums/ErrorCodeEnum.java
This commit is contained in:
@@ -22,6 +22,8 @@ public class CommonConstants {
|
||||
|
||||
public static final int THREE_DAY_SECONDS = 60*60*24*3;
|
||||
|
||||
public static final int NORMAL_LOCK_TIMES = 60 * 1000;
|
||||
|
||||
/**
|
||||
* 企业开通锁存活时间
|
||||
*/
|
||||
@@ -109,4 +111,7 @@ public class CommonConstants {
|
||||
public static final String NINE_STR = "9";
|
||||
public static final String TEN_STR = "10";
|
||||
|
||||
public static final String FOLLOW = "follow";
|
||||
public static final String PENDING = "pending";
|
||||
|
||||
}
|
||||
|
||||
@@ -45,6 +45,14 @@ public enum ErrorCodeEnum {
|
||||
USER_GROUP_NOT_EXIST(1021077, "用户分组不存在", null),
|
||||
GET_INFO_ERROR(1021078, "获取信息异常", null),
|
||||
|
||||
|
||||
|
||||
|
||||
PARAMS_REQUIRED(400002, "参数缺失!", null),
|
||||
|
||||
|
||||
LINE_ID_IS_NOT_EXIST(500001, "线索ID不存在!", null),
|
||||
|
||||
INTERVIEW_ENTER_FAIL(1021101, "进入面试间失败", null),
|
||||
;
|
||||
|
||||
|
||||
@@ -0,0 +1,59 @@
|
||||
package com.cool.store.enums;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.Map;
|
||||
import java.util.function.Function;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* @author Admin
|
||||
* @ClassName FsEventTypeEnum
|
||||
* @Description fs的事件类型
|
||||
*/
|
||||
public enum FSEventTypeEnum {
|
||||
|
||||
//
|
||||
USER_CREATED("contact.user.created_v3","员工入职"),
|
||||
USER_DELETED("contact.user.deleted_v3", "员工离职"),
|
||||
USER_UPDATED("contact.user.updated_v3", "员工信息被修改"),
|
||||
|
||||
DEPARTMENT_CREATED("contact.department.created_v3", "部门被创建"),
|
||||
DEPARTMENT_UPDATED("contact.department.updated_v3", "部门信息被修改"),
|
||||
DEPARTMENT_DELETED("contact.department.deleted_v3", "部门被删除"),
|
||||
|
||||
APP_OPEN("app_open", "首次启用应用"),
|
||||
APP_STATUS_CHANGE("app_status_change", "应用停启用"),
|
||||
APP_TICKET("app_ticket", "app_ticket 事件"),
|
||||
APP_UNINSTALLED("app_uninstalled", "应用卸载"),
|
||||
|
||||
CONTACT_SCOPE_UPDATE("contact.scope.updated_v3", "通讯录范围权限被更新"),
|
||||
ORDER_PAID("order_paid", "应用商店应用购买"),
|
||||
;
|
||||
|
||||
|
||||
private final String value;
|
||||
private final String remark;
|
||||
|
||||
private static final Map<String, FSEventTypeEnum> map = Arrays.stream(values()).collect(Collectors.toMap(FSEventTypeEnum::getValue, Function.identity()));
|
||||
|
||||
FSEventTypeEnum(String value, String remark) {
|
||||
this.value = value;
|
||||
this.remark = remark;
|
||||
}
|
||||
|
||||
public String getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
public static FSEventTypeEnum parseValue(String value) {
|
||||
return map.get(value);
|
||||
}
|
||||
|
||||
public static boolean isUserEvent(String eventType){
|
||||
return FSEventTypeEnum.USER_CREATED.getValue().equals(eventType) || FSEventTypeEnum.USER_UPDATED.getValue().equals(eventType) || FSEventTypeEnum.USER_DELETED.getValue().equals(eventType);
|
||||
}
|
||||
|
||||
public static boolean isDepartmentEvent(String eventType){
|
||||
return FSEventTypeEnum.DEPARTMENT_CREATED.getValue().equals(eventType) || FSEventTypeEnum.DEPARTMENT_UPDATED.getValue().equals(eventType) || FSEventTypeEnum.DEPARTMENT_DELETED.getValue().equals(eventType);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
package com.cool.store.enums;
|
||||
|
||||
/**
|
||||
* @Author suzhuhong
|
||||
* @Date 2023/6/13 11:45
|
||||
* @Version 1.0
|
||||
*/
|
||||
public enum LineStatusEnum {
|
||||
|
||||
PUBLIC_SEAS(0,"公海线索"),
|
||||
PRIVATE_SEAS(1,"私海线索"),
|
||||
COOPERATION(2,"合作"),
|
||||
BLACKLIST(3,"黑名单"),
|
||||
;
|
||||
|
||||
private Integer code;
|
||||
|
||||
private String message;
|
||||
|
||||
LineStatusEnum(Integer code, String message) {
|
||||
this.code = code;
|
||||
this.message = message;
|
||||
}
|
||||
|
||||
|
||||
public Integer getCode() {
|
||||
return code;
|
||||
}
|
||||
|
||||
public String getMessage() {
|
||||
return message;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
package com.cool.store.enums;
|
||||
|
||||
/**
|
||||
* @Author suzhuhong
|
||||
* @Date 2023/6/9 16:17
|
||||
* @Version 1.0
|
||||
*/
|
||||
public enum WorkflowStageEnum {
|
||||
|
||||
INTENT("1","意向申请阶段"),
|
||||
RESERVATION("2","预约面试阶段"),
|
||||
INTERVIEW("3","合格资格面试"),
|
||||
;
|
||||
|
||||
private String code;
|
||||
|
||||
private String message;
|
||||
|
||||
WorkflowStageEnum(String code, String message) {
|
||||
this.code = code;
|
||||
this.message = message;
|
||||
}
|
||||
|
||||
|
||||
public String getCode() {
|
||||
return code;
|
||||
}
|
||||
|
||||
public String getMessage() {
|
||||
return message;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
package com.cool.store.enums;
|
||||
|
||||
/**
|
||||
* @Author suzhuhong
|
||||
* @Date 2023/6/9 16:35
|
||||
* @Version 1.0
|
||||
*/
|
||||
public enum WorkflowStatusEnum {
|
||||
//意向申请阶段
|
||||
INTENT_0("0","待提交"),
|
||||
INTENT_1("1","待审核"),
|
||||
INTENT_2("2","已通过"),
|
||||
INTENT_3("3","未通过"),
|
||||
|
||||
//预约面试阶段
|
||||
RESERVATION_0("0","待预约"),
|
||||
RESERVATION_6("6","到期未预约"),
|
||||
|
||||
|
||||
//合格资格面试
|
||||
INTERVIEW_1("1","待面试"),
|
||||
INTERVIEW_2("2","已开始"),
|
||||
INTERVIEW_3("3","待审核"),
|
||||
INTERVIEW_4("4","审核中"),
|
||||
INTERVIEW_5("5","审核通过"),
|
||||
INTERVIEW_6("6","拒绝"),
|
||||
|
||||
|
||||
;
|
||||
|
||||
private String code;
|
||||
|
||||
private String message;
|
||||
|
||||
WorkflowStatusEnum(String code, String message) {
|
||||
this.code = code;
|
||||
this.message = message;
|
||||
}
|
||||
|
||||
|
||||
public String getCode() {
|
||||
return code;
|
||||
}
|
||||
|
||||
public String getMessage() {
|
||||
return message;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
package com.cool.store.utils;
|
||||
|
||||
import java.util.Calendar;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* @Author suzhuhong
|
||||
* @Date 2023/6/8 17:17
|
||||
* @Version 1.0
|
||||
*/
|
||||
public class CoolDateUtils {
|
||||
|
||||
public static final String DATE_FORMAT_DAY = "yyyy-MM-dd";
|
||||
public static final String DATE_FORMAT_DAY_2 = "yyyy/MM/dd";
|
||||
public static final String TIME_FORMAT_SEC = "HH:mm:ss";
|
||||
public static final String TIME_FORMAT_SEC2 = "HH:mm";
|
||||
public static final String DATE_FORMAT_SEC = "yyyy-MM-dd HH:mm:ss";
|
||||
public static final String DATE_FORMAT_SEC_2 = "yyyy/MM/dd HH:mm:ss";
|
||||
public static final String DATE_FORMAT_SEC_3 = "yyyy.MM.dd HH:mm:ss";
|
||||
public static final String DATE_FORMAT_SEC_4 = "yyyy.MM.dd HH:mm";
|
||||
public static final String DATE_FORMAT_SEC_5 = "yyyy.MM.dd HH:mm";
|
||||
public static final String DATE_FORMAT_SEC_6 = "yyyy.MM.dd";
|
||||
/**
|
||||
* 几天后的当前
|
||||
* @param d
|
||||
* @param day
|
||||
* @return
|
||||
*/
|
||||
public static Date getDateBefore(Date d, int day) {
|
||||
Calendar now = Calendar.getInstance();
|
||||
now.setTime(d);
|
||||
now.set(Calendar.DATE, now.get(Calendar.DATE) + day);
|
||||
return now.getTime();
|
||||
}
|
||||
}
|
||||
@@ -39,6 +39,9 @@ public class EnterpriseUserDAO {
|
||||
* @param excludeUserIds
|
||||
*/
|
||||
public void deleteUser(List<String> excludeUserIds){
|
||||
if(CollectionUtils.isEmpty(excludeUserIds)){
|
||||
return;
|
||||
}
|
||||
enterpriseUserMapper.deleteUser(excludeUserIds);
|
||||
}
|
||||
}
|
||||
@@ -29,11 +29,18 @@ public class EnterpriseUserRoleDAO {
|
||||
return enterpriseUserRoleMapper.batchInsertOrUpdate(recordList);
|
||||
}
|
||||
|
||||
public Integer deleteUserRole(String roleId, DataSourceEnum dataSourceEnum, List<String> userIds){
|
||||
if(StringUtils.isBlank(roleId) || Objects.isNull(dataSourceEnum)){
|
||||
public Integer deleteRoleInUser(String roleId, DataSourceEnum dataSourceEnum, List<String> excludeUserIds){
|
||||
if(StringUtils.isBlank(roleId) || Objects.isNull(dataSourceEnum) || CollectionUtils.isEmpty(excludeUserIds)){
|
||||
return null;
|
||||
}
|
||||
return enterpriseUserRoleMapper.deleteUserRole(roleId, dataSourceEnum.getCode(), userIds);
|
||||
return enterpriseUserRoleMapper.deleteRoleInUser(roleId, dataSourceEnum.getCode(), excludeUserIds);
|
||||
}
|
||||
|
||||
public Integer deleteUserInRole(String userId, DataSourceEnum dataSourceEnum, String excludeRoleId){
|
||||
if(StringUtils.isAnyBlank(userId, excludeRoleId) || Objects.isNull(dataSourceEnum)){
|
||||
return null;
|
||||
}
|
||||
return enterpriseUserRoleMapper.deleteUserInRole(userId, dataSourceEnum.getCode(), excludeRoleId);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,59 @@
|
||||
package com.cool.store.dao;
|
||||
|
||||
import com.cool.store.dto.partner.PartnerIntentApplyInfoDTO;
|
||||
import com.cool.store.entity.HyPartnerIntentInfoDO;
|
||||
import com.cool.store.mapper.HyPartnerIntentInfoMapper;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import com.google.common.collect.Lists;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author suzhuhong
|
||||
* @Date 2023/6/9 15:02
|
||||
* @Version 1.0
|
||||
*/
|
||||
@Repository
|
||||
public class HyPartnerIntentInfoDAO {
|
||||
|
||||
|
||||
@Resource
|
||||
HyPartnerIntentInfoMapper hyPartnerIntentInfoMapper;
|
||||
|
||||
public int insertSelective( HyPartnerIntentInfoDO record){
|
||||
return hyPartnerIntentInfoMapper.insertSelective(record);
|
||||
}
|
||||
|
||||
public int updateByPrimaryKeySelective(HyPartnerIntentInfoDO record){
|
||||
return hyPartnerIntentInfoMapper.updateByPrimaryKeySelective(record);
|
||||
}
|
||||
|
||||
public HyPartnerIntentInfoDO selectByPrimaryKeySelective(Long id){
|
||||
if (id==null){
|
||||
return null;
|
||||
}
|
||||
return hyPartnerIntentInfoMapper.selectByPrimaryKeySelective(id);
|
||||
}
|
||||
|
||||
|
||||
public PageInfo<PartnerIntentApplyInfoDTO> selectPartnerIntentApplyInfoList(String userId, String workflowStage, String workflowStatus){
|
||||
if (StringUtils.isEmpty(userId)){
|
||||
return new PageInfo<>();
|
||||
}
|
||||
return hyPartnerIntentInfoMapper.selectPartnerIntentApplyInfoList(userId,workflowStage,workflowStatus);
|
||||
}
|
||||
|
||||
|
||||
public PartnerIntentApplyInfoDTO selectByLineId(Long lineId){
|
||||
if (lineId==null){
|
||||
return null;
|
||||
}
|
||||
return hyPartnerIntentInfoMapper.selectByLineId(lineId);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,85 @@
|
||||
package com.cool.store.dao;
|
||||
|
||||
import com.cool.store.dto.partner.PartnerInterviewInfoDTO;
|
||||
import com.cool.store.dto.partner.SpecialDateRangeInterviewCountDTO;
|
||||
import com.cool.store.entity.HyPartnerInterviewPlanDO;
|
||||
import com.cool.store.mapper.HyPartnerInterviewPlanMapper;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author suzhuhong
|
||||
* @Date 2023/6/8 14:54
|
||||
* @Version 1.0
|
||||
*/
|
||||
@Repository
|
||||
public class HyPartnerInterviewPlanDAO {
|
||||
|
||||
@Resource
|
||||
HyPartnerInterviewPlanMapper hyPartnerInterviewPlanMapper;
|
||||
|
||||
|
||||
/**
|
||||
* 查询当前用户当天是否有面试
|
||||
* @param userId
|
||||
* @param currentDate
|
||||
* @return
|
||||
*/
|
||||
public Integer getCurrentDateInterviewCount(String userId,String currentDate){
|
||||
if (StringUtils.isEmpty(userId)){
|
||||
return 0;
|
||||
}
|
||||
return hyPartnerInterviewPlanMapper.getCurrentDateInterviewCount(userId,currentDate);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询指定日期面试数量 与未来7天面试数量
|
||||
* @param userId
|
||||
* @param currentDate
|
||||
* @param startTime
|
||||
* @param endTime
|
||||
* @return
|
||||
*/
|
||||
public SpecialDateRangeInterviewCountDTO getInterviewCount(String userId, String currentDate, String startTime, String endTime){
|
||||
if (StringUtils.isEmpty(userId)){
|
||||
return new SpecialDateRangeInterviewCountDTO();
|
||||
}
|
||||
return hyPartnerInterviewPlanMapper.getInterviewCount(userId,currentDate,startTime,endTime);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 当天还有几场面试
|
||||
* @param userId
|
||||
* @param currentDate
|
||||
* @return
|
||||
*/
|
||||
public List<HyPartnerInterviewPlanDO> getInterviewPlanList(String userId, String currentDate){
|
||||
if (StringUtils.isEmpty(userId)){
|
||||
return new ArrayList<>();
|
||||
}
|
||||
return hyPartnerInterviewPlanMapper.getInterviewPlanList(userId,currentDate);
|
||||
}
|
||||
|
||||
/**
|
||||
* 工作台 招商经理 预约面试时间 合格资格面试 列表
|
||||
* @param userId
|
||||
* @param workflowStage
|
||||
* @param workflowStatus
|
||||
* @return
|
||||
*/
|
||||
public PageInfo<PartnerInterviewInfoDTO> getPartnerInterviewInfoList(String userId, String workflowStage,String workflowStatus){
|
||||
if (StringUtils.isEmpty(userId)){
|
||||
return new PageInfo();
|
||||
}
|
||||
return hyPartnerInterviewPlanMapper.getPartnerInterviewInfoList(userId,workflowStage,workflowStatus);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,128 @@
|
||||
package com.cool.store.dao;
|
||||
|
||||
import com.cool.store.dto.partner.PartnerBlackListDTO;
|
||||
import com.cool.store.dto.partner.PartnerIntentApplyInfoDTO;
|
||||
import com.cool.store.dto.partner.PartnerLineInfoAndBaseInfoDTO;
|
||||
import com.cool.store.dto.partner.StageCountDTO;
|
||||
import com.cool.store.entity.HyPartnerLineInfoDO;
|
||||
import com.cool.store.mapper.HyPartnerLineInfoMapper;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import com.google.common.collect.Lists;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author suzhuhong
|
||||
* @Date 2023/6/8 15:10
|
||||
* @Version 1.0
|
||||
*/
|
||||
@Repository
|
||||
public class HyPartnerLineInfoDAO {
|
||||
|
||||
|
||||
@Resource
|
||||
HyPartnerLineInfoMapper hyPartnerLineInfoMapper;
|
||||
|
||||
|
||||
public int insertSelective(HyPartnerLineInfoDO hyPartnerLineInfoDO){
|
||||
return hyPartnerLineInfoMapper.insertSelective(hyPartnerLineInfoDO);
|
||||
}
|
||||
|
||||
public int batchInsert(List<HyPartnerLineInfoDO> hyPartnerLineInfoDOS){
|
||||
if (CollectionUtils.isEmpty(hyPartnerLineInfoDOS)){
|
||||
return -1;
|
||||
}
|
||||
return hyPartnerLineInfoMapper.batchInsert(hyPartnerLineInfoDOS);
|
||||
}
|
||||
|
||||
|
||||
public int batchDeleted(List<Long> lineIdList){
|
||||
if (CollectionUtils.isEmpty(lineIdList)){
|
||||
return -1;
|
||||
}
|
||||
return hyPartnerLineInfoMapper.batchDeleted(lineIdList);
|
||||
}
|
||||
|
||||
public HyPartnerLineInfoDO selectByPrimaryKeySelective(Long id){
|
||||
if (id==null){
|
||||
return null;
|
||||
}
|
||||
return hyPartnerLineInfoMapper.selectByPrimaryKeySelective(id);
|
||||
}
|
||||
|
||||
public int updateByPrimaryKeySelective(HyPartnerLineInfoDO hyPartnerLineInfoDO){
|
||||
return hyPartnerLineInfoMapper.updateByPrimaryKeySelective(hyPartnerLineInfoDO);
|
||||
}
|
||||
|
||||
|
||||
public Integer getAdventLineCount( String userId, String currentDate){
|
||||
if (StringUtils.isEmpty(userId)){
|
||||
return 0;
|
||||
}
|
||||
return hyPartnerLineInfoMapper.getAdventLineCount(userId,currentDate);
|
||||
}
|
||||
|
||||
public StageCountDTO selectStagePendingCount(String userId){
|
||||
if (StringUtils.isEmpty(userId)){
|
||||
return new StageCountDTO(0,0);
|
||||
}
|
||||
return hyPartnerLineInfoMapper.selectStagePendingCount(userId);
|
||||
}
|
||||
|
||||
public StageCountDTO selectStageFollowCount(String userId){
|
||||
if (StringUtils.isEmpty(userId)){
|
||||
return new StageCountDTO(0,0,0);
|
||||
}
|
||||
return hyPartnerLineInfoMapper.selectStageFollowCount(userId);
|
||||
}
|
||||
|
||||
|
||||
public PartnerLineInfoAndBaseInfoDTO selectPartnerLineInfoAndBaseInfo(Long lineId){
|
||||
if (lineId==null){
|
||||
return null;
|
||||
}
|
||||
return hyPartnerLineInfoMapper.selectPartnerLineInfoAndBaseInfo(lineId);
|
||||
}
|
||||
|
||||
public PageInfo<HyPartnerLineInfoDO> lastMonthCloseLine(String userId, String lastMonthTodayDate){
|
||||
if (userId==null){
|
||||
return new PageInfo<>();
|
||||
}
|
||||
return hyPartnerLineInfoMapper.lastMonthCloseLine(userId,lastMonthTodayDate);
|
||||
}
|
||||
|
||||
public int updateInvestmentManager(String userId, List<Long> lineIdList){
|
||||
if (StringUtils.isEmpty(userId)||CollectionUtils.isEmpty(lineIdList)){
|
||||
return -1;
|
||||
}
|
||||
return hyPartnerLineInfoMapper.updateInvestmentManager(lineIdList,userId);
|
||||
}
|
||||
|
||||
|
||||
|
||||
public List<HyPartnerLineInfoDO> getLineListByLineIds( List<Long> lineIdList){
|
||||
if (CollectionUtils.isEmpty(lineIdList)){
|
||||
return Lists.newArrayList();
|
||||
}
|
||||
return hyPartnerLineInfoMapper.getLineListByLineIds(lineIdList);
|
||||
}
|
||||
|
||||
|
||||
public PageInfo<PartnerBlackListDTO> getBlackList( String keyWord, String intentArea , Integer acceptAdjustType){
|
||||
return hyPartnerLineInfoMapper.getBlackList(keyWord,intentArea,acceptAdjustType);
|
||||
}
|
||||
|
||||
|
||||
public Boolean joinAndRemoveBlack( Long lineId, Integer status, String joinReason, String removeReason){
|
||||
if (lineId==null){
|
||||
return Boolean.FALSE;
|
||||
}
|
||||
return hyPartnerLineInfoMapper.joinAndRemoveBlack(lineId,status,joinReason,removeReason);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,51 @@
|
||||
package com.cool.store.dao;
|
||||
|
||||
import com.cool.store.entity.HyPartnerUserInfoDO;
|
||||
import com.cool.store.mapper.HyPartnerUserInfoMapper;
|
||||
import com.google.common.collect.Lists;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author suzhuhong
|
||||
* @Date 2023/6/8 19:41
|
||||
* @Version 1.0
|
||||
*/
|
||||
@Repository
|
||||
public class HyPartnerUserInfoDAO {
|
||||
|
||||
|
||||
@Resource
|
||||
HyPartnerUserInfoMapper hyPartnerUserInfoMapper;
|
||||
|
||||
|
||||
/**
|
||||
* 根据PartnerId查询用户
|
||||
* @param partnerId
|
||||
* @return
|
||||
*/
|
||||
public HyPartnerUserInfoDO selectByPartnerId(String partnerId){
|
||||
if (StringUtils.isEmpty(partnerId)){
|
||||
return null;
|
||||
}
|
||||
return hyPartnerUserInfoMapper.selectByPartnerId(partnerId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据PartnerIds批量查询用户
|
||||
* @param partnerIds
|
||||
* @return
|
||||
*/
|
||||
public List<HyPartnerUserInfoDO> selectByPartnerIds(List<String> partnerIds){
|
||||
if (CollectionUtils.isEmpty(partnerIds)){
|
||||
return Lists.newArrayList();
|
||||
}
|
||||
return hyPartnerUserInfoMapper.selectByPartnerIds(partnerIds);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -3,6 +3,7 @@ package com.cool.store.dao;
|
||||
import com.cool.store.constants.CommonConstants;
|
||||
import com.cool.store.entity.RegionDO;
|
||||
import com.cool.store.mapper.RegionMapper;
|
||||
import com.google.common.collect.Lists;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
@@ -37,4 +38,15 @@ public class RegionDAO {
|
||||
return regionMapper.deleteNotExistRegion(regionIds);
|
||||
}
|
||||
|
||||
public List<RegionDO> getRegionByRegionIds(List<String> regionIds){
|
||||
if(CollectionUtils.isEmpty(regionIds)){
|
||||
return Lists.newArrayList();
|
||||
}
|
||||
return regionMapper.getRegionByRegionIds(regionIds);
|
||||
}
|
||||
|
||||
public List<RegionDO> getRegionBaseInfoList(){
|
||||
return regionMapper.getRegionBaseInfoList();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -43,4 +43,11 @@ public class SysRoleDAO {
|
||||
}
|
||||
return sysRoleMapper.getHighestPriorityRoleByUserId(userId);
|
||||
}
|
||||
|
||||
public SysRoleDO getRoleByName(String roleName, DataSourceEnum dataSource){
|
||||
if(StringUtils.isBlank(roleName) || Objects.isNull(dataSource)){
|
||||
return null;
|
||||
}
|
||||
return sysRoleMapper.getRoleByName(roleName, dataSource.getCode());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -37,4 +37,18 @@ public class UserRegionMappingDAO {
|
||||
return userRegionMappingMapper.deleteUserRegion(regionId, dataSourceEnum.getCode(), excludeUserIds);
|
||||
}
|
||||
|
||||
public Integer deleteRegionUserByExcludeRegionIds(List<String> excludeRegionIds){
|
||||
if(CollectionUtils.isEmpty(excludeRegionIds)){
|
||||
return null;
|
||||
}
|
||||
return userRegionMappingMapper.deleteRegionUserByExcludeRegionIds(excludeRegionIds);
|
||||
}
|
||||
|
||||
public Integer deleteRegionUserByExcludeUserIds(List<String> excludeUserIds){
|
||||
if(CollectionUtils.isEmpty(excludeUserIds)){
|
||||
return null;
|
||||
}
|
||||
return userRegionMappingMapper.deleteRegionUserByExcludeUserIds(excludeUserIds);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -32,5 +32,7 @@ public interface EnterpriseUserRoleMapper {
|
||||
* @param userIds
|
||||
* @return
|
||||
*/
|
||||
int deleteUserRole(@Param("roleId") String roleId, @Param("type") Integer type, @Param("userIds") List<String> userIds);
|
||||
int deleteRoleInUser(@Param("roleId") String roleId, @Param("type") Integer type, @Param("excludeUserIds") List<String> excludeUserIds);
|
||||
|
||||
int deleteUserInRole(@Param("userId") String userId, @Param("type") Integer type, @Param("excludeRoleId") String excludeRoleId);
|
||||
}
|
||||
@@ -1,8 +1,12 @@
|
||||
package com.cool.store.mapper;
|
||||
|
||||
import com.cool.store.dto.partner.PartnerIntentApplyInfoDTO;
|
||||
import com.cool.store.entity.HyPartnerIntentInfoDO;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author zhangchenbiao
|
||||
* @date 2023-05-29 03:52
|
||||
@@ -16,10 +20,31 @@ public interface HyPartnerIntentInfoMapper {
|
||||
*/
|
||||
int insertSelective(@Param("record") HyPartnerIntentInfoDO record);
|
||||
|
||||
HyPartnerIntentInfoDO selectByPrimaryKeySelective(@Param("id") Long id);
|
||||
|
||||
/**
|
||||
*
|
||||
* 默认更新方法,根据主键更新,不会把null值更新到数据库,避免覆盖之前有值的
|
||||
* dateTime:2023-05-29 03:52
|
||||
*/
|
||||
int updateByPrimaryKeySelective(@Param("record") HyPartnerIntentInfoDO record);
|
||||
|
||||
|
||||
/**
|
||||
* 工作台 招商经理 意向申请阶段 待处理 待跟进 列表
|
||||
* @param userId
|
||||
* @param workflowStage
|
||||
* @param workflowStatus
|
||||
* @return
|
||||
*/
|
||||
PageInfo<PartnerIntentApplyInfoDTO> selectPartnerIntentApplyInfoList(@Param("userId") String userId,
|
||||
@Param("workflowStage") String workflowStage ,
|
||||
@Param("workflowStatus") String workflowStatus);
|
||||
|
||||
/**
|
||||
* 根据线索ID查询数据
|
||||
* @param lineId
|
||||
* @return
|
||||
*/
|
||||
PartnerIntentApplyInfoDTO selectByLineId(@Param("lineId") Long lineId);
|
||||
}
|
||||
@@ -1,8 +1,14 @@
|
||||
package com.cool.store.mapper;
|
||||
|
||||
import com.cool.store.dto.partner.PartnerInterviewInfoDTO;
|
||||
import com.cool.store.dto.partner.SpecialDateRangeInterviewCountDTO;
|
||||
import com.cool.store.entity.HyPartnerInterviewPlanDO;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author zhangchenbiao
|
||||
* @date 2023-05-29 03:52
|
||||
@@ -22,4 +28,46 @@ public interface HyPartnerInterviewPlanMapper {
|
||||
* dateTime:2023-05-29 03:52
|
||||
*/
|
||||
int updateByPrimaryKeySelective(@Param("record") HyPartnerInterviewPlanDO record);
|
||||
|
||||
/**
|
||||
* 查询当天面试数量
|
||||
* @param userId
|
||||
* @param currentDate
|
||||
* @return
|
||||
*/
|
||||
Integer getCurrentDateInterviewCount(@Param("userId") String userId, @Param("currentDate") String currentDate);
|
||||
|
||||
/**
|
||||
* todo 当天面试数据需要修改
|
||||
* 查询指定日期面试数量 与未来7天面试数量
|
||||
* @param userId
|
||||
* @param currentDate
|
||||
* @param startTime
|
||||
* @param endTime
|
||||
* @return
|
||||
*/
|
||||
SpecialDateRangeInterviewCountDTO getInterviewCount(@Param("userId") String userId,
|
||||
@Param("currentDate") String currentDate,
|
||||
@Param("startTime") String startTime,
|
||||
@Param("endTime") String endTime);
|
||||
|
||||
/**
|
||||
* 查询面试列表
|
||||
* @param userId
|
||||
* @param currentDate
|
||||
* @return
|
||||
*/
|
||||
List<HyPartnerInterviewPlanDO> getInterviewPlanList(@Param("userId") String userId,
|
||||
@Param("currentDate") String currentDate);
|
||||
|
||||
/**
|
||||
* 工作台 招商经理 预约面试时间 合格资格面试 列表
|
||||
* @param userId
|
||||
* @param workflowStage
|
||||
* @param workflowStatus
|
||||
* @return
|
||||
*/
|
||||
PageInfo<PartnerInterviewInfoDTO> getPartnerInterviewInfoList(@Param("userId") String userId,
|
||||
@Param("workflowStage") String workflowStage ,
|
||||
@Param("workflowStatus") String workflowStatus);
|
||||
}
|
||||
@@ -1,9 +1,16 @@
|
||||
package com.cool.store.mapper;
|
||||
|
||||
import com.cool.store.dto.partner.PartnerBlackListDTO;
|
||||
import com.cool.store.dto.partner.PartnerIntentApplyInfoDTO;
|
||||
import com.cool.store.dto.partner.PartnerLineInfoAndBaseInfoDTO;
|
||||
import com.cool.store.dto.partner.StageCountDTO;
|
||||
import com.cool.store.entity.HyPartnerLineInfoDO;
|
||||
import com.cool.store.entity.HyPartnerLineInfoDO;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author zhangchenbiao
|
||||
* @date 2023-05-29 03:52
|
||||
@@ -17,10 +24,112 @@ public interface HyPartnerLineInfoMapper {
|
||||
*/
|
||||
int insertSelective(@Param("record") HyPartnerLineInfoDO record);
|
||||
|
||||
/**
|
||||
* 批量新增线索
|
||||
* @param recordList
|
||||
* @return
|
||||
*/
|
||||
int batchInsert(@Param("recordList") List<HyPartnerLineInfoDO> recordList);
|
||||
|
||||
/**
|
||||
* 批量将线索置为删除状态
|
||||
* @param lineIdList
|
||||
* @return
|
||||
*/
|
||||
int batchDeleted(@Param("lineIdList") List<Long> lineIdList);
|
||||
|
||||
/**
|
||||
* 根据ID查询数据
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
HyPartnerLineInfoDO selectByPrimaryKeySelective(Long id);
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* 默认更新方法,根据主键更新,不会把null值更新到数据库,避免覆盖之前有值的
|
||||
* dateTime:2023-05-29 03:52
|
||||
*/
|
||||
int updateByPrimaryKeySelective(@Param("record") HyPartnerLineInfoDO record);
|
||||
|
||||
/**
|
||||
* 当前用户指定时间 临期线索
|
||||
* @param userId
|
||||
* @param currentDate
|
||||
* @return
|
||||
*/
|
||||
Integer getAdventLineCount(@Param("userId") String userId, @Param("currentDate") String currentDate);
|
||||
|
||||
/**
|
||||
* 招商经理 对应各阶段待处理数据
|
||||
* @param userId
|
||||
* @return
|
||||
*/
|
||||
StageCountDTO selectStagePendingCount(@Param("userId") String userId);
|
||||
|
||||
/**
|
||||
* 招商经理 对应各个阶段 待跟进数据
|
||||
* @param userId
|
||||
* @return
|
||||
*/
|
||||
StageCountDTO selectStageFollowCount(@Param("userId") String userId);
|
||||
|
||||
|
||||
/**
|
||||
* 查询线索信息与加盟商基本信息
|
||||
* @param lineId
|
||||
* @return
|
||||
*/
|
||||
PartnerLineInfoAndBaseInfoDTO selectPartnerLineInfoAndBaseInfo(@Param("lineId") Long lineId);
|
||||
|
||||
/**
|
||||
* 最近30天结束的线索
|
||||
* @param userId
|
||||
* @param lastMonthTodayDate
|
||||
* @return
|
||||
*/
|
||||
PageInfo<HyPartnerLineInfoDO> lastMonthCloseLine(@Param("userId") String userId,
|
||||
@Param("lastMonthTodayDate") String lastMonthTodayDate);
|
||||
|
||||
/**
|
||||
* 修改招商经理
|
||||
* @param lineIdList
|
||||
* @param userId
|
||||
* @return
|
||||
*/
|
||||
int updateInvestmentManager(@Param("lineIdList") List<Long> lineIdList, @Param("userId") String userId);
|
||||
|
||||
/**
|
||||
* 根据线索ID查询线索
|
||||
* @param lineIdList
|
||||
* @return
|
||||
*/
|
||||
List<HyPartnerLineInfoDO> getLineListByLineIds(List<Long> lineIdList);
|
||||
|
||||
/**
|
||||
* 查询黑名单列表
|
||||
* @param keyWord
|
||||
* @param intentArea
|
||||
* @param acceptAdjustType
|
||||
* @return
|
||||
*/
|
||||
PageInfo<PartnerBlackListDTO> getBlackList(@Param("keyWord") String keyWord,
|
||||
@Param("intentArea") String intentArea ,
|
||||
@Param("acceptAdjustType") Integer acceptAdjustType);
|
||||
|
||||
|
||||
/**
|
||||
* 加入/移除 黑名单
|
||||
* @param lineId
|
||||
* @param status
|
||||
* @param joinReason
|
||||
* @param removeReason
|
||||
* @return
|
||||
*/
|
||||
Boolean joinAndRemoveBlack(@Param("lineId") Long lineId,
|
||||
@Param("status") Integer status,
|
||||
@Param("joinReason") String joinReason,
|
||||
@Param("removeReason") String removeReason);
|
||||
|
||||
}
|
||||
@@ -3,6 +3,8 @@ package com.cool.store.mapper;
|
||||
import com.cool.store.entity.HyPartnerUserInfoDO;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author zhangchenbiao
|
||||
* @date 2023-05-29 03:53
|
||||
@@ -22,4 +24,18 @@ public interface HyPartnerUserInfoMapper {
|
||||
* dateTime:2023-05-29 03:53
|
||||
*/
|
||||
int updateByPrimaryKeySelective(@Param("record") HyPartnerUserInfoDO record);
|
||||
|
||||
/**
|
||||
* 根据partnerID查询用户信息
|
||||
* @param partnerId
|
||||
* @return
|
||||
*/
|
||||
HyPartnerUserInfoDO selectByPartnerId(@Param("partnerId") String partnerId);
|
||||
|
||||
/**
|
||||
* 根据partnerIDs批量查询用户信息
|
||||
* @param partnerIdList
|
||||
* @return
|
||||
*/
|
||||
List<HyPartnerUserInfoDO> selectByPartnerIds(@Param("partnerIdList") List<String> partnerIdList);
|
||||
}
|
||||
@@ -31,4 +31,17 @@ public interface RegionMapper {
|
||||
* @return
|
||||
*/
|
||||
int deleteNotExistRegion(@Param("regionIds")List<String> regionIds);
|
||||
|
||||
/**
|
||||
* 根据regionIds获取region
|
||||
* @param regionIds
|
||||
* @return
|
||||
*/
|
||||
List<RegionDO> getRegionByRegionIds(@Param("regionIds")List<String> regionIds);
|
||||
|
||||
/**
|
||||
* 获取区域基本信息
|
||||
* @return
|
||||
*/
|
||||
List<RegionDO> getRegionBaseInfoList();
|
||||
}
|
||||
@@ -33,4 +33,11 @@ public interface SysRoleMapper {
|
||||
* @return
|
||||
*/
|
||||
SysRoleDO getHighestPriorityRoleByUserId(@Param("userId") String userId);
|
||||
|
||||
/**
|
||||
* 获取角色
|
||||
* @param roleName
|
||||
* @return
|
||||
*/
|
||||
SysRoleDO getRoleByName(@Param("roleName") String roleName, @Param("roleType")Integer roleType);
|
||||
}
|
||||
@@ -33,4 +33,18 @@ public interface UserRegionMappingMapper {
|
||||
* @return
|
||||
*/
|
||||
int deleteUserRegion(@Param("regionId") String regionId, @Param("type")Integer type, @Param("excludeUserIds") List<String> excludeUserIds);
|
||||
|
||||
/**
|
||||
* 删除没有的部门映射关系
|
||||
* @param excludeRegionIds
|
||||
* @return
|
||||
*/
|
||||
Integer deleteRegionUserByExcludeRegionIds(@Param("excludeRegionIds") List<String> excludeRegionIds);
|
||||
|
||||
/**
|
||||
* 删除用户不在的区域
|
||||
* @param excludeUserIds
|
||||
* @return
|
||||
*/
|
||||
Integer deleteRegionUserByExcludeUserIds(@Param("excludeUserIds") List<String> excludeUserIds);
|
||||
}
|
||||
@@ -5,12 +5,13 @@
|
||||
<id column="id" jdbcType="INTEGER" property="id"/>
|
||||
<result column="role_id" jdbcType="VARCHAR" property="roleId"/>
|
||||
<result column="user_id" jdbcType="VARCHAR" property="userId"/>
|
||||
<result column="type" jdbcType="INTEGER" property="type"/>
|
||||
<result column="deleted" jdbcType="BIT" property="deleted"/>
|
||||
<result column="create_time" jdbcType="TIMESTAMP" property="createTime"/>
|
||||
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime"/>
|
||||
</resultMap>
|
||||
<sql id="Base_Column_List">
|
||||
id, role_id, user_id, deleted, create_time, update_time
|
||||
id, role_id, user_id, type, deleted, create_time, update_time
|
||||
</sql>
|
||||
<insert id="batchInsertOrUpdate">
|
||||
<foreach collection="recordList" separator=";" item="record">
|
||||
@@ -22,6 +23,9 @@
|
||||
<if test="record.userId != null">
|
||||
user_id,
|
||||
</if>
|
||||
<if test="record.type != null">
|
||||
type,
|
||||
</if>
|
||||
<if test="record.deleted != null">
|
||||
deleted,
|
||||
</if>
|
||||
@@ -39,6 +43,9 @@
|
||||
<if test="record.userId != null">
|
||||
#{record.userId},
|
||||
</if>
|
||||
<if test="record.type != null">
|
||||
#{record.type},
|
||||
</if>
|
||||
<if test="record.deleted != null">
|
||||
#{record.deleted},
|
||||
</if>
|
||||
@@ -61,6 +68,9 @@
|
||||
<if test="userId != null">
|
||||
user_id = #{userId},
|
||||
</if>
|
||||
<if test="type != null">
|
||||
type = #{type},
|
||||
</if>
|
||||
<if test="deleted != null">
|
||||
deleted = #{deleted},
|
||||
</if>
|
||||
@@ -74,7 +84,11 @@
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<update id="deleteUserRole">
|
||||
update enterprise_user_role set deleted = 1 where role_id = #{roleId} and user_id not in <foreach collection="userIds" item="userId" separator="," open="(" close=")">#{userId}</foreach>
|
||||
<update id="deleteRoleInUser">
|
||||
update enterprise_user_role set deleted = 1 where role_id = #{roleId} and type = #{type} and user_id not in <foreach collection="excludeUserIds" item="userId" separator="," open="(" close=")">#{userId}</foreach>
|
||||
</update>
|
||||
|
||||
<update id="deleteUserInRole">
|
||||
update enterprise_user_role set deleted = 1 where role_id != #{excludeRoleId} and user_id = #{userId} and type = #{type}
|
||||
</update>
|
||||
</mapper>
|
||||
@@ -32,6 +32,14 @@
|
||||
work_exp, is_consumer, other_band, brand_strength, need_improve, strength, weakness,
|
||||
create_time, update_time
|
||||
</sql>
|
||||
<select id="selectByPrimaryKeySelective" resultMap="BaseResultMap">
|
||||
select
|
||||
<include refid="Base_Column_List"></include>
|
||||
from hy_partner_intent_info
|
||||
<where>
|
||||
and id = #{id}
|
||||
</where>
|
||||
</select>
|
||||
<insert id="insertSelective" keyColumn="id" keyProperty="record.id" useGeneratedKeys="true">
|
||||
insert into hy_partner_intent_info
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
@@ -243,4 +251,41 @@
|
||||
</set>
|
||||
where id = #{record.id}
|
||||
</update>
|
||||
|
||||
<select id="selectPartnerIntentApplyInfoList" resultType="com.cool.store.dto.partner.PartnerIntentApplyInfoDTO">
|
||||
select
|
||||
a.id as partnerLineId,
|
||||
a.partner_id as partnerId,
|
||||
a.workflow_stage as workflowStage,
|
||||
a.workflow_status as workflowStatus,
|
||||
b.id as id,
|
||||
b.create_time as partnerSubmitTime,
|
||||
b.live_area as liveArea,
|
||||
b.want_shop_area as wantShopArea,
|
||||
b.accept_adjust_type as acceptAdjustType,
|
||||
b.deadline as deadline
|
||||
from hy_partner_intent_info b left join hy_partner_line_info a on a.id = b.partner_line_id
|
||||
<where>
|
||||
<if test="userId!=null and userId!=''">
|
||||
and a.investment_manager = #{userId}
|
||||
</if>
|
||||
<if test="workflowStage!=null and workflowStage!=''">
|
||||
and a.workflow_stage= #{workflowStage}
|
||||
</if>
|
||||
<if test="workflowStatus!=null and workflowStatus!=''">
|
||||
and a.workflow_status = #{workflowStatus}
|
||||
</if>
|
||||
</where>
|
||||
order by b.create_time
|
||||
</select>
|
||||
|
||||
<select id="selectByLineId" resultType="com.cool.store.dto.partner.PartnerIntentApplyInfoDTO">
|
||||
select
|
||||
<include refid="Base_Column_List"></include>
|
||||
from hy_partner_intent_info
|
||||
<where>
|
||||
and partner_line_id = #{lineId}
|
||||
</where>
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
@@ -172,4 +172,69 @@
|
||||
</set>
|
||||
where id = #{record.id}
|
||||
</update>
|
||||
|
||||
<select id="getCurrentDateInterviewCount" resultType="java.lang.Integer">
|
||||
select count(1) from hy_partner_interview_plan
|
||||
<where>
|
||||
<if test="userId!=null and userId!=''">
|
||||
and interviewer = #{userId}
|
||||
</if>
|
||||
<if test="currentDate!=null and currentDate!=''">
|
||||
and interview_date = #{currentDate}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
|
||||
<select id="getInterviewCount" resultType="com.cool.store.dto.partner.SpecialDateRangeInterviewCountDTO">
|
||||
select
|
||||
sum(if(interview_date=#{currentDate},1,0)) as currentDayInterviewCount,
|
||||
sum(if(start_time>#{startTime} and #{endTime},1,0)) as lastSevenDayInterviewCount
|
||||
FROM hy_partner_interview_plan
|
||||
where interviewer = #{userId}
|
||||
</select>
|
||||
|
||||
<select id="getInterviewPlanList" resultMap="BaseResultMap">
|
||||
select * from hy_partner_interview_plan
|
||||
<where>
|
||||
<if test="userId!=null and userId!=''">
|
||||
and interviewer = #{userId}
|
||||
</if>
|
||||
<if test="currentDate!=null and currentDate!=''">
|
||||
and interview_date = #{currentDate}
|
||||
</if>
|
||||
and (start_time>now() or (start_time<![CDATA[<]]>now() and room_status!=2))
|
||||
order by start_time
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="getPartnerInterviewInfoList" resultType="com.cool.store.dto.partner.PartnerInterviewInfoDTO">
|
||||
select
|
||||
a.id as id,
|
||||
a.deadline as deadline,
|
||||
a.status as status,
|
||||
a.auth_code as authCode,
|
||||
a.approve_time as approveTime,
|
||||
a.process_info as processInfo,
|
||||
b.id as interviewId,
|
||||
b.partner_line_id as partnerLineId,
|
||||
b.partner_id as partnerId,
|
||||
b.start_time as startTime,
|
||||
b.end_time as endTime,
|
||||
b.interviewer as interviewer,
|
||||
b.create_time as createTime,
|
||||
b.room_id as roomId
|
||||
from hy_partner_interview a inner join hy_partner_interview_plan b on a.interview_plan_id = b.id
|
||||
<where>
|
||||
<if test="userId!=null and userId!=''">
|
||||
and a.interviewer = #{userId}
|
||||
</if>
|
||||
<if test="workflowStage!=null and workflowStage!=''">
|
||||
and a.workflow_stage= #{workflowStage}
|
||||
</if>
|
||||
<if test="workflowStatus!=null and workflowStatus!=''">
|
||||
and a.workflow_status = #{workflowStatus}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
</mapper>
|
||||
@@ -27,6 +27,49 @@
|
||||
reject_real_reason, certify_file, deleted, create_time, update_time, close_time,
|
||||
close_user_id
|
||||
</sql>
|
||||
|
||||
<select id="selectByPrimaryKeySelective" resultMap="BaseResultMap">
|
||||
select
|
||||
<include refid="Base_Column_List"></include>
|
||||
from hy_partner_line_info
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
|
||||
<insert id="batchInsert">
|
||||
insert into
|
||||
hy_partner_line_info
|
||||
(
|
||||
partner_id,
|
||||
workflow_stage,
|
||||
workflow_status,
|
||||
line_status,
|
||||
investment_manager
|
||||
)
|
||||
values
|
||||
<foreach collection="recordList" item="record" separator=",">
|
||||
(#{record.partnerId},
|
||||
#{record.workflowStage},
|
||||
#{record.workflowStatus},
|
||||
#{record.lineStatus},
|
||||
#{record.investmentManager})
|
||||
</foreach>
|
||||
</insert>
|
||||
|
||||
<update id="batchDeleted">
|
||||
update hy_partner_line_info
|
||||
set deleted = 1
|
||||
<where>
|
||||
<if test="lineIdList!=null and lineIdList.size>0">
|
||||
<foreach collection="lineIdList" open="and id in (" close=")" separator="," item="lineId">
|
||||
#{lineId}
|
||||
</foreach>
|
||||
</if>
|
||||
</where>
|
||||
</update>
|
||||
|
||||
|
||||
|
||||
<insert id="insertSelective" keyColumn="id" keyProperty="record.id" useGeneratedKeys="true">
|
||||
insert into hy_partner_line_info
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
@@ -190,7 +233,154 @@
|
||||
<if test="record.closeUserId != null">
|
||||
close_user_id = #{record.closeUserId},
|
||||
</if>
|
||||
<if test="record.joinBlackReason != null">
|
||||
join_black_reason = #{record.joinBlackReason},
|
||||
</if>
|
||||
<if test="record.removeBlackReason != null">
|
||||
remove_black_reason = #{record.removeBlackReason},
|
||||
</if>
|
||||
</set>
|
||||
where id = #{record.id}
|
||||
</update>
|
||||
|
||||
<select id="getAdventLineCount" resultType="java.lang.Integer">
|
||||
select count(1) from hy_partner_line_info
|
||||
<where>
|
||||
<if test="userId!=null and userId!=''">
|
||||
and investment_manager = #{userId}
|
||||
</if>
|
||||
<if test="currentDate!=null and currentDate!=''">
|
||||
and deadline = #{currentDate}
|
||||
</if>
|
||||
and
|
||||
(
|
||||
(workflow_stage = 1 and workflow_status = 0) or
|
||||
(workflow_stage = 2 and workflow_status = 0) or
|
||||
(workflow_stage = 3 and workflow_status = 4)
|
||||
)
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectStagePendingCount" resultType="com.cool.store.dto.partner.StageCountDTO">
|
||||
select
|
||||
IFNULL(sum(if(workflow_stage=1 and workflow_status = 1,1,0)),0) as intentApplyApproveCount,
|
||||
IFNULL(sum(if(workflow_stage=3 and workflow_status = 3,1,0)),0) as qualifiedInterviewCount
|
||||
from hy_partner_line_info
|
||||
<where>
|
||||
<if test="userId!=null and userId!=''">
|
||||
and investment_manager = #{userId}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
|
||||
<select id="selectStageFollowCount" resultType="com.cool.store.dto.partner.StageCountDTO">
|
||||
select
|
||||
IFNULL(sum(if(workflow_stage=1 and workflow_status = 1,1,0)),0) as intentApplyApproveCount,
|
||||
IFNULL(sum(if(workflow_stage=2 and workflow_status = 0,1,0)),0) as reservationInterviewCount,
|
||||
IFNULL(sum(if(workflow_stage=3 and workflow_status = 4,1,0)),0) as qualifiedInterviewCount
|
||||
from hy_partner_line_info
|
||||
<where>
|
||||
<if test="userId!=null and userId!=''">
|
||||
and investment_manager = #{userId}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectPartnerLineInfoAndBaseInfo" resultType="com.cool.store.dto.partner.PartnerLineInfoAndBaseInfoDTO">
|
||||
select
|
||||
a.id as id,
|
||||
a.partner_id as partnerId,
|
||||
a.workflow_stage as workflowStage,
|
||||
a.workflow_status as workflowStatus,
|
||||
a.partner_id as partnerUserId,
|
||||
a.investment_manager as investmentManager,
|
||||
b.user_portrait as user_portrait
|
||||
from hy_partner_line_info a inner join hy_partner_base_info b
|
||||
on a.id = b.partner_line_id
|
||||
<where>
|
||||
<if test="lineId!=null">
|
||||
and a.id = #{id}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="lastMonthCloseLine" resultMap="BaseResultMap">
|
||||
select
|
||||
<include refid="Base_Column_List"></include>
|
||||
from hy_partner_line_info
|
||||
<where>
|
||||
<if test="userId">
|
||||
and investment_manager = #{userId}
|
||||
</if>
|
||||
<if test="lastMonthTodayDate!=null">
|
||||
and close_time > #{lastMonthTodayDate} and close_time <![CDATA[<]]> now
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<update id="updateInvestmentManager">
|
||||
update hy_partner_line_info
|
||||
set investment_manager = #{userId}
|
||||
<if test="lineIdList!=null and lineIdList.size>0">
|
||||
<foreach collection="lineIdList" open="where id in (" close=")" separator="," item="lineId">
|
||||
#{lineId}
|
||||
</foreach>
|
||||
</if>
|
||||
</update>
|
||||
|
||||
|
||||
<select id="getLineListByLineIds" resultMap="BaseResultMap" >
|
||||
select
|
||||
<include refid="Base_Column_List"></include>
|
||||
from hy_partner_line_info
|
||||
where deleted = 0
|
||||
<if test="lineIdList!=null and lineIdList.size>0">
|
||||
<foreach collection="lineIdList" open="and id in (" close=")" separator="," item="lineId">
|
||||
#{lineId}
|
||||
</foreach>
|
||||
</if>
|
||||
</select>
|
||||
|
||||
|
||||
<select id="getBlackList" resultType="com.cool.store.dto.partner.PartnerBlackListDTO" >
|
||||
select
|
||||
b.partner_id as partnerId,
|
||||
b.mobile as mobile,
|
||||
b.username as partnerUserName,
|
||||
a.id as lineId,
|
||||
a.create_time as createTime,
|
||||
a.close_user_id as closeUserId,
|
||||
a.close_time as closeTime,
|
||||
a.join_black_reason as joinBlackReason
|
||||
from hy_partner_line_info a inner join hy_partner_user_info b where a.partner_id = b.partner_id
|
||||
where deleted = 0
|
||||
and line_status = 3
|
||||
<if test="keyWord!=null and keyWord !=''">
|
||||
and (b.username like concat('%', #{keyWord}, '%') or b.mobile like concat('%', #{keyWord}, '%'))
|
||||
</if>
|
||||
<if test="intentArea!=null and intentArea!=''">
|
||||
and b.want_shop_area = #{intentArea}
|
||||
</if>
|
||||
<if test="acceptAdjustType!=null">
|
||||
and b.accept_adjust_type =#{acceptAdjustType}
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<update id="joinAndRemoveBlack">
|
||||
update hy_partner_line_info
|
||||
<set>
|
||||
<if test="line_status != null">
|
||||
line_status = #{status},
|
||||
</if>
|
||||
<if test="joinCause != null and joinCause!=''">
|
||||
join_black_reason = #{joinCause},
|
||||
</if>
|
||||
<if test="removeReason != null and removeReason!=''">
|
||||
remove_black_reason = #{removeReason},
|
||||
</if>
|
||||
</set>
|
||||
where id = #{lineId}
|
||||
</update>
|
||||
|
||||
</mapper>
|
||||
@@ -18,6 +18,25 @@
|
||||
id, partner_id, mobile, username, live_area, want_shop_area, accept_adjust_type,
|
||||
invite_code, is_write_partner_know, create_time, update_time
|
||||
</sql>
|
||||
<select id="selectByPartnerId" resultMap="BaseResultMap" >
|
||||
select
|
||||
<include refid="Base_Column_List"></include>
|
||||
from hy_partner_user_info
|
||||
where partner_id = #{partnerId}
|
||||
</select>
|
||||
|
||||
|
||||
<select id="selectByPartnerIds" resultMap="BaseResultMap" >
|
||||
select
|
||||
<include refid="Base_Column_List"></include>
|
||||
from hy_partner_user_info
|
||||
<if test="partnerIdList!=null and partnerIdList.size>0">
|
||||
<foreach collection="partnerIdList" open="and partner_id in (" close=")" separator="," item="partnerId">
|
||||
#{partnerId}
|
||||
</foreach>
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<insert id="insertSelective" keyColumn="id" keyProperty="record.id" useGeneratedKeys="true">
|
||||
insert into hy_partner_user_info
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
|
||||
@@ -158,4 +158,23 @@
|
||||
<update id="deleteNotExistRegion">
|
||||
update region set deleted = 1 , update_time = UNIX_TIMESTAMP() where region_id not in <foreach collection="regionIds" separator="," item="regionId" open="(" close=")"> #{regionId}</foreach>
|
||||
</update>
|
||||
|
||||
<select id="getRegionByRegionIds" resultMap="BaseResultMap">
|
||||
select
|
||||
<include refid="Base_Column_List"/>
|
||||
from
|
||||
region
|
||||
where
|
||||
region_id in <foreach collection="regionIds" item="regionId" separator="," open="(" close=")">#{regionId}</foreach>
|
||||
|
||||
</select>
|
||||
|
||||
<select id="getRegionBaseInfoList" resultMap="BaseResultMap">
|
||||
select
|
||||
region_id, name, parent_id
|
||||
from
|
||||
region
|
||||
where
|
||||
deleted = 0
|
||||
</select>
|
||||
</mapper>
|
||||
@@ -126,7 +126,16 @@
|
||||
from
|
||||
sys_role r inner join enterprise_user_role e on r.role_id = e.role_id
|
||||
where
|
||||
e.user_id = #{userId}
|
||||
e.user_id = #{userId} and r.deleted = 0
|
||||
limit 1
|
||||
</select>
|
||||
|
||||
<select id="getRoleByName" resultMap="BaseResultMap">
|
||||
select
|
||||
<include refid="Base_Column_List"/>
|
||||
from
|
||||
sys_role
|
||||
where
|
||||
role_name = #{roleName} and role_type = #{roleType} and deleted = 0 limit 1
|
||||
</select>
|
||||
</mapper>
|
||||
@@ -104,10 +104,19 @@
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteUserRegion">
|
||||
<update id="deleteUserRegion">
|
||||
update user_region_mapping set deleted = 1 where region_id = #{regionId} and type = #{type}
|
||||
<if test="excludeUserIds != null and excludeUserIds.size() > 0">
|
||||
and user_id not in <foreach collection="excludeUserIds" separator="," open="(" close=")" item="userId" >#{userId}</foreach>
|
||||
</if>
|
||||
</delete>
|
||||
</update>
|
||||
|
||||
<update id="deleteRegionUserByExcludeRegionIds">
|
||||
update user_region_mapping set deleted = 1 where region_id not in <foreach collection="excludeRegionIds" open="(" close=")" separator="," item="regionId">#{regionId}</foreach>
|
||||
</update>
|
||||
|
||||
<update id="deleteRegionUserByExcludeUserIds">
|
||||
update user_region_mapping set deleted = 1 where user_id not in <foreach collection="excludeUserIds" open="(" close=")" separator="," item="userId">#{userId}</foreach>
|
||||
</update>
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,24 @@
|
||||
package com.cool.store.dto.buser;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @author zhangchenbiao
|
||||
* @FileName: UserEventDTO
|
||||
* @Description:
|
||||
* @date 2023-06-09 13:53
|
||||
*/
|
||||
@Data
|
||||
public class UserEventDTO {
|
||||
|
||||
private String corpId;
|
||||
|
||||
private String eventType;
|
||||
|
||||
private String userId;
|
||||
|
||||
private String openId;
|
||||
|
||||
private String unionId;
|
||||
|
||||
}
|
||||
@@ -93,7 +93,7 @@ public class EnterpriseUserDTO implements Serializable {
|
||||
|
||||
private String openUserid;
|
||||
|
||||
@ApiModelProperty("")
|
||||
@ApiModelProperty("用户所属部门")
|
||||
private List<String> departmentLists;
|
||||
|
||||
|
||||
@@ -141,4 +141,39 @@ public class EnterpriseUserDTO implements Serializable {
|
||||
return resultList;
|
||||
}
|
||||
|
||||
|
||||
public static EnterpriseUserDO transUserDtoToDo(EnterpriseUserDTO user, Map<String, String> regionPathMap, Multimap<String, String> leaderDeptMap) {
|
||||
EnterpriseUserDO enterpriseUserDO = new EnterpriseUserDO();
|
||||
enterpriseUserDO.setId(UUIDUtils.get32UUID());
|
||||
enterpriseUserDO.setUserId(user.getUserId());
|
||||
enterpriseUserDO.setName(user.getName());
|
||||
enterpriseUserDO.setRemark(user.getRemark());
|
||||
enterpriseUserDO.setMobile(user.getMobile());
|
||||
enterpriseUserDO.setEmail(user.getEmail());
|
||||
enterpriseUserDO.setOrgEmail(user.getOrgEmail());
|
||||
enterpriseUserDO.setMainAdmin(user.getMainAdmin());
|
||||
enterpriseUserDO.setIsAdmin(user.getIsAdmin());
|
||||
enterpriseUserDO.setUnionid(user.getUnionid());
|
||||
enterpriseUserDO.setAvatar(user.getAvatar());
|
||||
enterpriseUserDO.setJobnumber(user.getJobnumber());
|
||||
enterpriseUserDO.setUserStatus(UserStatusEnum.NORMAL.getCode());
|
||||
enterpriseUserDO.setIsLeader(Boolean.FALSE);
|
||||
List<String> departmentLists = user.getDepartmentLists();
|
||||
List<String> regionPaths = new ArrayList<>();
|
||||
if(CollectionUtils.isNotEmpty(departmentLists)){
|
||||
for (String departmentId : departmentLists) {
|
||||
regionPaths.add(regionPathMap.get(departmentId));
|
||||
}
|
||||
}
|
||||
Collection<String> deptIds = leaderDeptMap.get(user.getUserId());
|
||||
if(CollectionUtils.isNotEmpty(deptIds)){
|
||||
enterpriseUserDO.setIsLeader(Boolean.TRUE);
|
||||
enterpriseUserDO.setLeaderDeptIds(JSONObject.toJSONString(deptIds));
|
||||
}
|
||||
enterpriseUserDO.setUserRegionIds(JSONObject.toJSONString(regionPaths));
|
||||
enterpriseUserDO.setDeleted(Boolean.FALSE);
|
||||
enterpriseUserDO.setCreateTime(new Date());
|
||||
return enterpriseUserDO;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -217,7 +217,7 @@ public class SysDepartmentDTO {
|
||||
Collections.reverse(pathIds);
|
||||
String regionPath = CommonConstants.PATH_SPILT + String.join(CommonConstants.PATH_SPILT, pathIds) + CommonConstants.PATH_SPILT;
|
||||
region.setRegionPath(regionPath);
|
||||
region.setDeleted(Boolean.TRUE);
|
||||
region.setDeleted(Boolean.FALSE);
|
||||
if(CollectionUtils.isNotEmpty(dept.getDeptManagerUseridList())){
|
||||
for (String leader : dept.getDeptManagerUseridList()) {
|
||||
leaderDeptMap.put(leader, dept.getId());
|
||||
|
||||
@@ -0,0 +1,31 @@
|
||||
package com.cool.store.dto.partner;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* @Author suzhuhong
|
||||
* @Date 2023/6/13 10:26
|
||||
* @Version 1.0
|
||||
*/
|
||||
@Data
|
||||
public class PartnerBlackListDTO {
|
||||
|
||||
private Long lineId;
|
||||
|
||||
private String partnerId;
|
||||
|
||||
private String mobile;
|
||||
|
||||
private String partnerUserName;
|
||||
|
||||
private Date createTime;
|
||||
|
||||
private String closeUserId;
|
||||
|
||||
private Date closeTime;
|
||||
|
||||
private String joinBlackReason;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
package com.cool.store.dto.partner;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* @Author suzhuhong
|
||||
* @Date 2023/6/9 15:37
|
||||
* @Version 1.0
|
||||
*/
|
||||
@Data
|
||||
public class PartnerIntentApplyInfoDTO {
|
||||
|
||||
@ApiModelProperty("")
|
||||
private Long id;
|
||||
|
||||
@ApiModelProperty("加盟商用户名称")
|
||||
private String partnerUserName;
|
||||
|
||||
@ApiModelProperty("hy_partner_user_info.partner_id")
|
||||
private String partnerId;
|
||||
|
||||
@ApiModelProperty("hy_partner_line_info.id")
|
||||
private Long partnerLineId;
|
||||
|
||||
@ApiModelProperty("常驻区域")
|
||||
private String liveArea;
|
||||
|
||||
@ApiModelProperty("意向开店区域")
|
||||
private String wantShopArea;
|
||||
|
||||
@ApiModelProperty("0不接受调剂、1全国调剂、2省内调剂、3市内调剂")
|
||||
private Integer acceptAdjustType;
|
||||
|
||||
@ApiModelProperty("截止时间")
|
||||
private Date deadline;
|
||||
|
||||
@ApiModelProperty("阶段提交时间")
|
||||
private Date partnerSubmitTime;
|
||||
|
||||
@ApiModelProperty("所属阶段")
|
||||
private String workflowStage;
|
||||
|
||||
@ApiModelProperty("子流程状态")
|
||||
private String workflowStatus;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,64 @@
|
||||
package com.cool.store.dto.partner;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* @Author suzhuhong
|
||||
* @Date 2023/6/9 19:40
|
||||
* @Version 1.0
|
||||
*/
|
||||
@Data
|
||||
public class PartnerInterviewInfoDTO {
|
||||
|
||||
@ApiModelProperty("hy_partner_interview.id")
|
||||
private Long interviewId;
|
||||
|
||||
@ApiModelProperty("hy_partner_interview_plan.id")
|
||||
private Long id;
|
||||
|
||||
@ApiModelProperty("加盟商用户名称")
|
||||
private String partnerUserName;
|
||||
|
||||
@ApiModelProperty("预约状态 0 待预约;1待面试;2已开始;3待审核;4审批中;5审批通过;6拒绝")
|
||||
private Integer status;
|
||||
|
||||
@ApiModelProperty("hy_partner_line_info.id")
|
||||
private Long partnerLineId;
|
||||
|
||||
@ApiModelProperty("加盟商用户ID")
|
||||
private String partnerId;
|
||||
|
||||
@ApiModelProperty("截止时间")
|
||||
private Date deadline;
|
||||
|
||||
@ApiModelProperty("审批发起时间")
|
||||
private Date approveTime;
|
||||
|
||||
@ApiModelProperty("意向合同号")
|
||||
private String authCode;
|
||||
|
||||
@ApiModelProperty("面试开始时间")
|
||||
private Date startTime;
|
||||
|
||||
@ApiModelProperty("面试结束时间")
|
||||
private Date endTime;
|
||||
|
||||
@ApiModelProperty("面试官ID")
|
||||
private String interviewer;
|
||||
|
||||
@ApiModelProperty("面试官名称")
|
||||
private String interviewerName;
|
||||
|
||||
@ApiModelProperty("预约时间")
|
||||
private Date createTime;
|
||||
|
||||
@ApiModelProperty("房间号")
|
||||
private String roomId;
|
||||
|
||||
@ApiModelProperty("过程信息")
|
||||
private String processInfo;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
package com.cool.store.dto.partner;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @Author suzhuhong
|
||||
* @Date 2023/6/12 16:05
|
||||
* @Version 1.0
|
||||
*/
|
||||
@Data
|
||||
public class PartnerLineInfoAndBaseInfoDTO {
|
||||
@ApiModelProperty("线索ID")
|
||||
private Long id;
|
||||
|
||||
@ApiModelProperty("hy_partner_user_info.partner_id")
|
||||
private String partnerId;
|
||||
|
||||
@ApiModelProperty("流程阶段:1意向申请审核;2预约面试时间;3加盟资格面试;4分配选址开发经理;5商圈点位评估;6上传店铺租赁信息;7完善加盟签约信息;8支付加盟费用;9签订加盟合同")
|
||||
private String workflowStage;
|
||||
|
||||
@ApiModelProperty("流程子状态")
|
||||
private String workflowStatus;
|
||||
|
||||
@ApiModelProperty("加盟商用户ID")
|
||||
private String partnerUserId;
|
||||
|
||||
@ApiModelProperty("加盟商用户名称")
|
||||
private String partnerUserName;
|
||||
|
||||
@ApiModelProperty("加盟商用户手机号")
|
||||
private String partnerUserPhone;
|
||||
|
||||
@ApiModelProperty("手机号归属地")
|
||||
private String phoneAddress;
|
||||
|
||||
@ApiModelProperty("招商经理")
|
||||
private String investmentManager;
|
||||
|
||||
@ApiModelProperty("招商经理手机号")
|
||||
private String investmentManagerPhone;
|
||||
@ApiModelProperty("用户画像")
|
||||
private String userPortrait;
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
package com.cool.store.dto.partner;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @Author suzhuhong
|
||||
* @Date 2023/6/8 16:38
|
||||
* @Version 1.0
|
||||
*/
|
||||
@Data
|
||||
public class SpecialDateRangeInterviewCountDTO {
|
||||
|
||||
private Integer currentDayInterviewCount;
|
||||
|
||||
private Integer lastSevenDayInterviewCount;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
package com.cool.store.dto.partner;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @Author suzhuhong
|
||||
* @Date 2023/6/9 10:16
|
||||
* @Version 1.0
|
||||
*/
|
||||
@Data
|
||||
public class StageCountDTO {
|
||||
/**
|
||||
* 意向申请待处理或者待跟进数量
|
||||
*/
|
||||
private Integer intentApplyApproveCount;
|
||||
/**
|
||||
* 预约面试阶段 待跟进数量
|
||||
*/
|
||||
private Integer reservationInterviewCount;
|
||||
/**
|
||||
* 合格资格面试 待处理或者待跟进数量
|
||||
*/
|
||||
private Integer qualifiedInterviewCount;
|
||||
|
||||
public StageCountDTO(Integer intentApplyApproveCount, Integer reservationInterviewCount, Integer qualifiedInterviewCount) {
|
||||
this.intentApplyApproveCount = intentApplyApproveCount;
|
||||
this.reservationInterviewCount = reservationInterviewCount;
|
||||
this.qualifiedInterviewCount = qualifiedInterviewCount;
|
||||
}
|
||||
|
||||
public StageCountDTO(Integer intentApplyApproveCount, Integer qualifiedInterviewCount) {
|
||||
this.intentApplyApproveCount = intentApplyApproveCount;
|
||||
this.qualifiedInterviewCount = qualifiedInterviewCount;
|
||||
}
|
||||
|
||||
public StageCountDTO() {
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.cool.store.entity;
|
||||
|
||||
import com.cool.store.enums.DataSourceEnum;
|
||||
import com.google.common.collect.Lists;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import java.io.Serializable;
|
||||
@@ -32,6 +33,9 @@ public class EnterpriseUserRoleDO implements Serializable {
|
||||
@ApiModelProperty("用户id")
|
||||
private String userId;
|
||||
|
||||
@ApiModelProperty("type")
|
||||
private Integer type;
|
||||
|
||||
@ApiModelProperty("删除标识")
|
||||
private Boolean deleted;
|
||||
|
||||
@@ -41,7 +45,7 @@ public class EnterpriseUserRoleDO implements Serializable {
|
||||
@ApiModelProperty("更新时间")
|
||||
private Date updateTime;
|
||||
|
||||
public static List<EnterpriseUserRoleDO> convertDO(String roleId, List<String> userIds){
|
||||
public static List<EnterpriseUserRoleDO> convertSyncDO(String roleId, List<String> userIds){
|
||||
if(CollectionUtils.isEmpty(userIds)){
|
||||
return Lists.newArrayList();
|
||||
}
|
||||
@@ -50,6 +54,7 @@ public class EnterpriseUserRoleDO implements Serializable {
|
||||
EnterpriseUserRoleDO userRole = new EnterpriseUserRoleDO();
|
||||
userRole.setRoleId(roleId);
|
||||
userRole.setUserId(userId);
|
||||
userRole.setType(DataSourceEnum.SYNC.getCode());
|
||||
userRole.setDeleted(Boolean.FALSE);
|
||||
userRole.setCreateTime(new Date());
|
||||
userRole.setUpdateTime(new Date());
|
||||
|
||||
@@ -71,4 +71,10 @@ public class HyPartnerLineInfoDO implements Serializable {
|
||||
|
||||
@ApiModelProperty("结束跟进人员ID")
|
||||
private String closeUserId;
|
||||
|
||||
@ApiModelProperty("加入黑名单原因")
|
||||
private String joinBlackReason;
|
||||
|
||||
@ApiModelProperty("移除黑名单原因")
|
||||
private String removeBlackReason;
|
||||
}
|
||||
@@ -14,6 +14,7 @@ import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -69,4 +70,22 @@ public class UserRegionMappingDO implements Serializable {
|
||||
}
|
||||
return resultList;
|
||||
}
|
||||
|
||||
public static List<UserRegionMappingDO> convertSyncDO(List<String> regionIds, String userId){
|
||||
if(CollectionUtils.isEmpty(regionIds) || StringUtils.isBlank(userId)){
|
||||
return Lists.newArrayList();
|
||||
}
|
||||
List<UserRegionMappingDO> resultList = new ArrayList<>();
|
||||
for (String regionId : regionIds) {
|
||||
UserRegionMappingDO userRegion = new UserRegionMappingDO();
|
||||
userRegion.setRegionId(regionId);
|
||||
userRegion.setUserId(userId);
|
||||
userRegion.setType(DataSourceEnum.SYNC.getCode());
|
||||
userRegion.setCreateTime(System.currentTimeMillis());
|
||||
userRegion.setUpdateTime(System.currentTimeMillis());
|
||||
userRegion.setDeleted(Boolean.FALSE);
|
||||
resultList.add(userRegion);
|
||||
}
|
||||
return resultList;
|
||||
}
|
||||
}
|
||||
@@ -14,7 +14,7 @@ import java.util.Date;
|
||||
*/
|
||||
@Data
|
||||
@ApiModel
|
||||
public class LineRequest {
|
||||
public class LineRequest extends PageInfoRequest{
|
||||
|
||||
|
||||
@ApiModelProperty("关键字")
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
package com.cool.store.request;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author suzhuhong
|
||||
* @Date 2023/5/30 21:22
|
||||
* @Version 1.0
|
||||
*/
|
||||
@Data
|
||||
@ApiModel
|
||||
public class TransferInvestmentManagerRequest {
|
||||
|
||||
private Long lineId;
|
||||
|
||||
private String userId;
|
||||
|
||||
}
|
||||
@@ -18,15 +18,6 @@ public class BlackListVO {
|
||||
@ApiModelProperty("线索ID")
|
||||
private Long id;
|
||||
|
||||
@ApiModelProperty("hy_partner_user_info.partner_id")
|
||||
private String partnerId;
|
||||
|
||||
@ApiModelProperty("流程阶段:1意向申请审核;2预约面试时间;3加盟资格面试;4分配选址开发经理;5商圈点位评估;6上传店铺租赁信息;7完善加盟签约信息;8支付加盟费用;9签订加盟合同")
|
||||
private String workflowStage;
|
||||
|
||||
@ApiModelProperty("流程子状态")
|
||||
private String workflowStatus;
|
||||
|
||||
@ApiModelProperty("加盟商用户ID")
|
||||
private String partnerUserId;
|
||||
|
||||
@@ -54,14 +45,8 @@ public class BlackListVO {
|
||||
@ApiModelProperty("结束人员手机号")
|
||||
private String closeUserPhone;
|
||||
|
||||
@ApiModelProperty("结束人员手机号归属地")
|
||||
private String closeUserPhoneAddress;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@ApiModelProperty("加入黑名单原因")
|
||||
private String joinBlackReason;
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -19,7 +19,7 @@ public class IntentAreaSettingVO {
|
||||
|
||||
private String zoneName;
|
||||
|
||||
private List<orgVO> orgVOS;
|
||||
private List<OrganizationVO> orgVOS;
|
||||
|
||||
private Date updateTime;
|
||||
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
package com.cool.store.vo;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* @Author suzhuhong
|
||||
* @Date 2023/6/8 16:12
|
||||
* @Version 1.0
|
||||
*/
|
||||
@Data
|
||||
@ApiModel
|
||||
public class InterviewDetailInfoVO {
|
||||
@ApiModelProperty("面试者ID")
|
||||
private String userId;
|
||||
@ApiModelProperty("面试者名称")
|
||||
private String userName;
|
||||
@ApiModelProperty("面试者手机号")
|
||||
private String userPhone;
|
||||
@ApiModelProperty("线索ID")
|
||||
private Long lineId;
|
||||
@ApiModelProperty("面试开始时间")
|
||||
private Date startTime;
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
package com.cool.store.vo;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @Author suzhuhong
|
||||
* @Date 2023/6/8 14:39
|
||||
* @Version 1.0
|
||||
*/
|
||||
@Data
|
||||
@ApiModel
|
||||
public class InterviewPlanVO {
|
||||
|
||||
private Boolean hasInterview;
|
||||
|
||||
private Boolean hasAdventLine;
|
||||
|
||||
|
||||
}
|
||||
@@ -5,6 +5,7 @@ import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author suzhuhong
|
||||
@@ -19,15 +20,7 @@ public class InterviewScheduleInfoVO {
|
||||
private Integer currentDayInterviewCount;
|
||||
@ApiModelProperty("当前日期后七天面试数量")
|
||||
private Integer lastSevenDayInterviewCount;
|
||||
@ApiModelProperty("面试者ID")
|
||||
private String userId;
|
||||
@ApiModelProperty("面试者名称")
|
||||
private String userName;
|
||||
@ApiModelProperty("面试者手机号")
|
||||
private String userPhone;
|
||||
@ApiModelProperty("线索ID")
|
||||
private Long lineId;
|
||||
@ApiModelProperty("面试开始时间")
|
||||
private Date startTime;
|
||||
@ApiModelProperty("面试日程列表")
|
||||
private List<InterviewDetailInfoVO> interviewDetailInfoVOS;
|
||||
|
||||
}
|
||||
|
||||
@@ -11,7 +11,7 @@ import lombok.Data;
|
||||
*/
|
||||
@Data
|
||||
@ApiModel
|
||||
public class orgVO {
|
||||
public class OrganizationVO {
|
||||
|
||||
@ApiModelProperty("id")
|
||||
private Long id;
|
||||
@@ -6,6 +6,7 @@ import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
|
||||
/**
|
||||
* @Author suzhuhong
|
||||
* @Date 2023/5/30 20:11
|
||||
@@ -22,6 +23,9 @@ public class PartnerIntentApplyInfoVO {
|
||||
@ApiModelProperty("加盟商用户名称")
|
||||
private String partnerUserName;
|
||||
|
||||
@ApiModelProperty("加盟商手机号码")
|
||||
private String partnerUserPhone;
|
||||
|
||||
@ApiModelProperty("hy_partner_user_info.partner_id")
|
||||
private String partnerId;
|
||||
|
||||
@@ -34,6 +38,9 @@ public class PartnerIntentApplyInfoVO {
|
||||
@ApiModelProperty("意向开店区域")
|
||||
private String wantShopArea;
|
||||
|
||||
@ApiModelProperty("意向开店区域")
|
||||
private String wantShopAreaName;
|
||||
|
||||
@ApiModelProperty("0不接受调剂、1全国调剂、2省内调剂、3市内调剂")
|
||||
private Integer acceptAdjustType;
|
||||
|
||||
@@ -43,7 +50,4 @@ public class PartnerIntentApplyInfoVO {
|
||||
@ApiModelProperty("阶段提交时间")
|
||||
private Date partnerSubmitTime;
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -4,6 +4,8 @@ import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* @Author suzhuhong
|
||||
* @Date 2023/5/30 20:28
|
||||
@@ -14,7 +16,7 @@ import lombok.Data;
|
||||
public class PartnerInterviewInfoVO {
|
||||
|
||||
@ApiModelProperty("会议id")
|
||||
private String interviewId;
|
||||
private Long interviewId;
|
||||
|
||||
@ApiModelProperty("预约状态 0 待预约;1待面试;2已开始;3待审核;4审批中;5审批通过;6拒绝")
|
||||
private Integer status;
|
||||
@@ -40,4 +42,9 @@ public class PartnerInterviewInfoVO {
|
||||
@ApiModelProperty("面试官名称")
|
||||
private String interviewerName;
|
||||
|
||||
@ApiModelProperty("预约时间")
|
||||
private String createTime;
|
||||
|
||||
@ApiModelProperty("过程信息")
|
||||
private String processInfo;
|
||||
}
|
||||
|
||||
@@ -13,14 +13,11 @@ import java.util.List;
|
||||
*/
|
||||
@Data
|
||||
@ApiModel
|
||||
public class PartnerLineDetailVO {
|
||||
public class PartnerLineInfoAndBaseInfoVO {
|
||||
|
||||
@ApiModelProperty("线索ID")
|
||||
private Long id;
|
||||
|
||||
@ApiModelProperty("hy_partner_user_info.partner_id")
|
||||
private String partnerId;
|
||||
|
||||
@ApiModelProperty("流程阶段:1意向申请审核;2预约面试时间;3加盟资格面试;4分配选址开发经理;5商圈点位评估;6上传店铺租赁信息;7完善加盟签约信息;8支付加盟费用;9签订加盟合同")
|
||||
private String workflowStage;
|
||||
|
||||
@@ -42,13 +39,11 @@ public class PartnerLineDetailVO {
|
||||
@ApiModelProperty("招商经理")
|
||||
private String investmentManager;
|
||||
|
||||
@ApiModelProperty("招商经理")
|
||||
private String investmentManagerName;
|
||||
|
||||
@ApiModelProperty("招商经理手机号")
|
||||
private String investmentManagerPhone;
|
||||
@ApiModelProperty("用户画像")
|
||||
private String userPortrait;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
package com.cool.store.vo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author suzhuhong
|
||||
* @Date 2023/6/13 15:27
|
||||
* @Version 1.0
|
||||
*/
|
||||
@Data
|
||||
public class ZoneVO {
|
||||
|
||||
private Long id;
|
||||
|
||||
private String zoneName;
|
||||
|
||||
private String updateTime;
|
||||
|
||||
private String updateUserId;
|
||||
|
||||
private String updateUserName;
|
||||
|
||||
private List<OrganizationVO> orgVos;
|
||||
|
||||
private List<OpenAreaVO> openAreaVOS;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,75 @@
|
||||
package com.cool.store.vo.region;
|
||||
|
||||
import com.cool.store.constants.CommonConstants;
|
||||
import com.cool.store.entity.RegionDO;
|
||||
import com.google.common.collect.Lists;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* @author zhangchenbiao
|
||||
* @FileName: RegionBaseInfoVO
|
||||
* @Description:
|
||||
* @date 2023-06-12 16:08
|
||||
*/
|
||||
@Data
|
||||
public class RegionBaseInfoVO {
|
||||
|
||||
@ApiModelProperty("区域id")
|
||||
private String regionId;
|
||||
|
||||
@ApiModelProperty("区域名称")
|
||||
private String name;
|
||||
|
||||
@ApiModelProperty("子区域")
|
||||
private List<RegionBaseInfoVO> subRegionList;
|
||||
|
||||
public RegionBaseInfoVO(String regionId, String name) {
|
||||
this.regionId = regionId;
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
/**
|
||||
* 转换成树
|
||||
* @param regionList
|
||||
* @return
|
||||
*/
|
||||
public static RegionBaseInfoVO convertTree(List<RegionDO> regionList){
|
||||
Map<String, List<RegionDO>> parentMap = regionList.stream().collect(Collectors.groupingBy(k -> k.getParentId()));
|
||||
RegionDO rootRegion = regionList.stream().filter(o -> CommonConstants.ZERO_STR.equals(o.getParentId())).findFirst().get();
|
||||
RegionBaseInfoVO result = new RegionBaseInfoVO(rootRegion.getRegionId(), rootRegion.getName());
|
||||
result.setSubRegionList(getSubRegion(rootRegion.getRegionId(), parentMap));
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取子区域
|
||||
* @param regionId
|
||||
* @param parentMap
|
||||
* @return
|
||||
*/
|
||||
public static List<RegionBaseInfoVO> getSubRegion(String regionId, Map<String, List<RegionDO>> parentMap){
|
||||
List<RegionBaseInfoVO> resultList = new ArrayList<>();
|
||||
if(Objects.isNull(parentMap) || StringUtils.isBlank(regionId)){
|
||||
return resultList;
|
||||
}
|
||||
List<RegionDO> subRegion = parentMap.get(regionId);
|
||||
if(CollectionUtils.isNotEmpty(subRegion)){
|
||||
for (RegionDO region : subRegion) {
|
||||
RegionBaseInfoVO regionBaseInfo = new RegionBaseInfoVO(region.getRegionId(), region.getName());
|
||||
regionBaseInfo.setSubRegionList(getSubRegion(region.getRegionId(), parentMap));
|
||||
resultList.add(regionBaseInfo);
|
||||
}
|
||||
}
|
||||
return resultList;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -8,7 +8,7 @@ import com.aliyun.openservices.ons.api.bean.Subscription;
|
||||
import com.cool.store.constants.CommonConstants;
|
||||
import com.cool.store.enums.RocketMqGroupEnum;
|
||||
import com.cool.store.mq.RocketMqConfig;
|
||||
import com.cool.store.mq.consumer.listener.TestListener;
|
||||
import com.cool.store.mq.consumer.listener.UserEventDealListener;
|
||||
import com.google.common.collect.Maps;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
@@ -29,7 +29,7 @@ public class ConsumerClient {
|
||||
@Resource
|
||||
private RocketMqConfig rocketMqConfig;
|
||||
@Resource
|
||||
private TestListener testListener;
|
||||
private UserEventDealListener userEventDealListener;
|
||||
|
||||
/**
|
||||
* 获取通用配置
|
||||
@@ -71,12 +71,12 @@ public class ConsumerClient {
|
||||
*/
|
||||
@Bean(initMethod = "start", destroyMethod = "shutdown")
|
||||
public ConsumerBean test() {
|
||||
RocketMqGroupEnum groupEnum = RocketMqGroupEnum.TEST;
|
||||
RocketMqGroupEnum groupEnum = RocketMqGroupEnum.DING_MSG_DEAL;
|
||||
ConsumerBean consumerBean = new ConsumerBean();
|
||||
//配置文件
|
||||
Properties properties = getCommonProperties(groupEnum);
|
||||
consumerBean.setProperties(properties);
|
||||
Map<Subscription, MessageListener> commonSubscriptionTable = getCommonSubscriptionTable(groupEnum, testListener);
|
||||
Map<Subscription, MessageListener> commonSubscriptionTable = getCommonSubscriptionTable(groupEnum, userEventDealListener);
|
||||
//订阅多个topic如上面设置
|
||||
consumerBean.setSubscriptionTable(commonSubscriptionTable);
|
||||
return consumerBean;
|
||||
|
||||
@@ -0,0 +1,58 @@
|
||||
package com.cool.store.mq.consumer.listener;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.aliyun.openservices.ons.api.Action;
|
||||
import com.aliyun.openservices.ons.api.ConsumeContext;
|
||||
import com.aliyun.openservices.ons.api.Message;
|
||||
import com.aliyun.openservices.ons.api.MessageListener;
|
||||
import com.cool.store.constants.CommonConstants;
|
||||
import com.cool.store.dto.buser.UserEventDTO;
|
||||
import com.cool.store.service.EnterpriseSyncService;
|
||||
import com.cool.store.utils.RedisUtilPool;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* @author zhangchenbiao
|
||||
* @FileName: EnterpriseInitService
|
||||
* @Description: 消息监听
|
||||
* @date 2023-06-09 16:28
|
||||
*/
|
||||
@Slf4j
|
||||
@Service
|
||||
public class UserEventDealListener implements MessageListener {
|
||||
|
||||
@Autowired
|
||||
private RedisUtilPool redisUtilPool;
|
||||
@Autowired
|
||||
private EnterpriseSyncService enterpriseSyncService;
|
||||
|
||||
@Override
|
||||
public Action consume(Message message, ConsumeContext context) {
|
||||
String text = new String(message.getBody());
|
||||
if(StringUtils.isBlank(text)){
|
||||
log.info("消息体为空,tag:{},messageId:{}",message.getTag(),message.getMsgID());
|
||||
return Action.CommitMessage;
|
||||
}
|
||||
log.info("重试消费次数 messageId:{},try times:{}", message.getMsgID(), message.getReconsumeTimes());
|
||||
|
||||
String lockKey = "DingMsgDealListener:" + message.getMsgID();
|
||||
boolean lock = redisUtilPool.setNxExpire(lockKey, message.getMsgID(), CommonConstants.NORMAL_LOCK_TIMES);
|
||||
if(lock){
|
||||
try {
|
||||
UserEventDTO reqBody = JSONObject.parseObject(text, UserEventDTO.class);
|
||||
enterpriseSyncService.userUpdateEvent(reqBody);
|
||||
}catch (Exception e){
|
||||
log.error("DingMsgDealListener consume dealAddressBookChange error",e);
|
||||
return Action.ReconsumeLater;
|
||||
} finally {
|
||||
redisUtilPool.delKey(lockKey);
|
||||
}
|
||||
log.info("消费成功,tag:{},messageId:{}",message.getTag(),message.getMsgID());
|
||||
return Action.CommitMessage;
|
||||
}
|
||||
return Action.ReconsumeLater;
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,7 @@
|
||||
package com.cool.store.service;
|
||||
|
||||
import com.cool.store.dto.buser.UserEventDTO;
|
||||
|
||||
/**
|
||||
* @author zhangchenbiao
|
||||
* @FileName: EnterpriseInitService
|
||||
@@ -9,4 +11,10 @@ package com.cool.store.service;
|
||||
public interface EnterpriseSyncService {
|
||||
|
||||
void syncAll();
|
||||
|
||||
/**
|
||||
* 飞书人员事件
|
||||
* @param param
|
||||
*/
|
||||
void userUpdateEvent(UserEventDTO param);
|
||||
}
|
||||
|
||||
@@ -1,5 +1,9 @@
|
||||
package com.cool.store.service;
|
||||
|
||||
import com.cool.store.vo.region.RegionBaseInfoVO;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author zhangchenbiao
|
||||
* @FileName: RegionService
|
||||
@@ -8,4 +12,10 @@ package com.cool.store.service;
|
||||
*/
|
||||
public interface RegionService {
|
||||
|
||||
/**
|
||||
* 获取组织架构基本信息列表
|
||||
* @return
|
||||
*/
|
||||
RegionBaseInfoVO getRegionBaseInfoList();
|
||||
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@ package com.cool.store.service.impl;
|
||||
|
||||
import com.cool.store.constants.CommonConstants;
|
||||
import com.cool.store.dao.*;
|
||||
import com.cool.store.dto.buser.UserEventDTO;
|
||||
import com.cool.store.dto.enterprise.*;
|
||||
import com.cool.store.entity.*;
|
||||
import com.cool.store.enums.DataSourceEnum;
|
||||
@@ -9,6 +10,7 @@ import com.cool.store.http.ISVHttpRequest;
|
||||
import com.cool.store.service.EnterpriseSyncService;
|
||||
import com.google.common.collect.ArrayListMultimap;
|
||||
import com.google.common.collect.Multimap;
|
||||
import javafx.util.Pair;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.apache.commons.collections4.ListUtils;
|
||||
@@ -19,6 +21,8 @@ import javax.annotation.Resource;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import static com.cool.store.enums.FSEventTypeEnum.*;
|
||||
|
||||
/**
|
||||
* @author zhangchenbiao
|
||||
* @FileName: EnterpriseInitService
|
||||
@@ -46,19 +50,9 @@ public class EnterpriseSyncServiceImpl implements EnterpriseSyncService {
|
||||
@Override
|
||||
public void syncAll() {
|
||||
//同步部门
|
||||
List<SysDepartmentDTO> departments = isvHttpRequest.getSubDepartments(CommonConstants.ROOT_DEPT_ID_STR, true);
|
||||
//获取企业信息
|
||||
AuthInfoDTO authInfo = isvHttpRequest.getAuthInfo();
|
||||
Multimap<String, String> leaderDeptMap = ArrayListMultimap.create();
|
||||
//组织架构中增加根节点,处理部门上下级关系
|
||||
List<RegionDO> regionList = SysDepartmentDTO.convertRegionDO(departments, leaderDeptMap);
|
||||
List<String> regionIds = regionList.stream().map(RegionDO::getRegionId).distinct().collect(Collectors.toList());
|
||||
//添加根节点
|
||||
regionList.add(getRootRegion(authInfo));
|
||||
//批量插入
|
||||
regionDAO.batchInsertOrUpdate(regionList);
|
||||
//删除不存在的区域
|
||||
regionDAO.deleteNotExistRegion(regionIds);
|
||||
Pair<List<RegionDO>, Multimap<String, String>> listMultimapPair = syncRegion();
|
||||
List<RegionDO> regionList = listMultimapPair.getKey();
|
||||
Multimap<String, String> leaderDeptMap = listMultimapPair.getValue();
|
||||
Multimap<String, String> roleUserMap = ArrayListMultimap.create();
|
||||
//同步用户及部门
|
||||
syncUserAndUserRegion(regionList, roleUserMap, leaderDeptMap);
|
||||
@@ -72,9 +66,9 @@ public class EnterpriseSyncServiceImpl implements EnterpriseSyncService {
|
||||
roleIds.add(sysRole.getRoleId());
|
||||
Collection<String> userIds = roleUserMap.get(roleName);
|
||||
insertOrUpdateList.add(sysRole);
|
||||
userRoleInsertOrUpdateList.addAll(EnterpriseUserRoleDO.convertDO(sysRole.getRoleId(), new ArrayList<>(userIds)));
|
||||
userRoleInsertOrUpdateList.addAll(EnterpriseUserRoleDO.convertSyncDO(sysRole.getRoleId(), new ArrayList<>(userIds)));
|
||||
//删除角色下不存在的用户
|
||||
enterpriseUserRoleDAO.deleteUserRole(sysRole.getRoleId(), DataSourceEnum.SYNC, new ArrayList<>(userIds));
|
||||
enterpriseUserRoleDAO.deleteRoleInUser(sysRole.getRoleId(), DataSourceEnum.SYNC, new ArrayList<>(userIds));
|
||||
}
|
||||
sysRoleDAO.batchInsertSelective(insertOrUpdateList);
|
||||
enterpriseUserRoleDAO.batchInsertOrUpdate(userRoleInsertOrUpdateList);
|
||||
@@ -86,6 +80,32 @@ public class EnterpriseSyncServiceImpl implements EnterpriseSyncService {
|
||||
}
|
||||
|
||||
|
||||
private Pair<List<RegionDO>, Multimap<String, String>> syncRegion(){
|
||||
//同步部门
|
||||
List<SysDepartmentDTO> departments = isvHttpRequest.getSubDepartments(CommonConstants.ROOT_DEPT_ID_STR, true);
|
||||
//获取企业信息
|
||||
AuthInfoDTO authInfo = isvHttpRequest.getAuthInfo();
|
||||
Multimap<String, String> leaderDeptMap = ArrayListMultimap.create();
|
||||
//组织架构中增加根节点,处理部门上下级关系
|
||||
List<RegionDO> regionList = SysDepartmentDTO.convertRegionDO(departments, leaderDeptMap);
|
||||
//添加根节点
|
||||
regionList.add(getRootRegion(authInfo));
|
||||
List<String> regionIds = regionList.stream().map(RegionDO::getRegionId).distinct().collect(Collectors.toList());
|
||||
//批量插入
|
||||
regionDAO.batchInsertOrUpdate(regionList);
|
||||
//删除不存在的区域
|
||||
regionDAO.deleteNotExistRegion(regionIds);
|
||||
//删除区域管理的人员
|
||||
userRegionMappingDAO.deleteRegionUserByExcludeRegionIds(regionIds);
|
||||
return new Pair<>(regionList, leaderDeptMap);
|
||||
}
|
||||
|
||||
/**
|
||||
* 处理用户及部门之间的关系
|
||||
* @param regionList
|
||||
* @param roleUserMap
|
||||
* @param leaderDeptMap
|
||||
*/
|
||||
private void syncUserAndUserRegion(List<RegionDO> regionList, Multimap<String, String> roleUserMap, Multimap<String, String> leaderDeptMap){
|
||||
Map<String, String> regionPathMap = regionList.stream().collect(Collectors.toMap(RegionDO::getRegionId, RegionDO::getRegionPath));
|
||||
List<EnterpriseUserDO> userList = new ArrayList<>();
|
||||
@@ -117,6 +137,7 @@ public class EnterpriseSyncServiceImpl implements EnterpriseSyncService {
|
||||
userRegionMappingDAO.batchInsertOrUpdateUserRegion(userRegionList);
|
||||
//删除不存在的用户
|
||||
enterpriseUserDAO.deleteUser(userIds);
|
||||
userRegionMappingDAO.deleteRegionUserByExcludeUserIds(userIds);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -132,6 +153,51 @@ public class EnterpriseSyncServiceImpl implements EnterpriseSyncService {
|
||||
rootRegion.setThirdDeptId(CommonConstants.ROOT_DEPT_ID_STR);
|
||||
rootRegion.setOrderNum(CommonConstants.ZERO);
|
||||
rootRegion.setRegionPath(CommonConstants.PATH_SPILT + rootRegion.getRegionId() + CommonConstants.PATH_SPILT);
|
||||
rootRegion.setDeleted(Boolean.FALSE);
|
||||
return rootRegion;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void userUpdateEvent(UserEventDTO param) {
|
||||
switch (parseValue(param.getEventType())){
|
||||
case USER_CREATED:
|
||||
case USER_UPDATED:
|
||||
EnterpriseUserDTO userDetail = isvHttpRequest.getUserDetailByUserId(param.getOpenId());
|
||||
List<String> departmentLists = userDetail.getDepartmentLists();
|
||||
Multimap<String, String> leaderDeptMap = ArrayListMultimap.create();
|
||||
Map<String, String> regionPathMap = new HashMap<>();
|
||||
if(CollectionUtils.isNotEmpty(departmentLists)){
|
||||
List<RegionDO> regionList = regionDAO.getRegionByRegionIds(departmentLists);
|
||||
List<String> regionIds = ListUtils.emptyIfNull(regionList).stream().map(RegionDO::getRegionId).collect(Collectors.toList());
|
||||
//判断两个集合是否都是包含关系,不包含的情况下 说明组织架构数据不全 重新同步
|
||||
if(!(regionIds.containsAll(departmentLists) && departmentLists.containsAll(regionIds))){
|
||||
Pair<List<RegionDO>, Multimap<String, String>> regionPair = syncRegion();
|
||||
regionList = regionPair.getKey();
|
||||
leaderDeptMap = regionPair.getValue();
|
||||
}
|
||||
regionPathMap = regionList.stream().collect(Collectors.toMap(k->k.getRegionId(), v->v.getRegionPath()));
|
||||
userRegionMappingDAO.batchInsertOrUpdateUserRegion(UserRegionMappingDO.convertSyncDO(departmentLists, userDetail.getUserId()));
|
||||
}
|
||||
String jobTitle = userDetail.getJobTitle();
|
||||
if(StringUtils.isNotBlank(jobTitle)){
|
||||
SysRoleDO role = sysRoleDAO.getRoleByName(jobTitle, DataSourceEnum.SYNC);
|
||||
if(Objects.isNull(role)){
|
||||
//新增角色
|
||||
role = SysRoleDO.convertSyncDO(jobTitle);
|
||||
sysRoleDAO.batchInsertSelective(new ArrayList<>(Arrays.asList(role)));
|
||||
}
|
||||
List<EnterpriseUserRoleDO> enterpriseUserRole = EnterpriseUserRoleDO.convertSyncDO(role.getRoleId(), new ArrayList<>(Arrays.asList(userDetail.getUserId())));
|
||||
enterpriseUserRoleDAO.batchInsertOrUpdate(enterpriseUserRole);
|
||||
enterpriseUserRoleDAO.deleteUserInRole(userDetail.getUserId(), DataSourceEnum.SYNC, role.getRoleId());
|
||||
}
|
||||
EnterpriseUserDO enterpriseUser = EnterpriseUserDTO.transUserDtoToDo(userDetail, regionPathMap, leaderDeptMap);
|
||||
enterpriseUserDAO.batchInsertOrUpdate(new ArrayList<>(Arrays.asList(enterpriseUser)));
|
||||
break;
|
||||
case USER_DELETED:
|
||||
//人员职位删除状态,角色职位删除状态,人员从部门去除
|
||||
break;
|
||||
default:
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,12 +1,16 @@
|
||||
package com.cool.store.service.impl;
|
||||
|
||||
import com.cool.store.dao.RegionDAO;
|
||||
import com.cool.store.entity.RegionDO;
|
||||
import com.cool.store.mq.producer.SimpleMessageService;
|
||||
import com.cool.store.service.RegionService;
|
||||
import com.cool.store.utils.RedisConstantUtil;
|
||||
import com.cool.store.utils.RedisUtil;
|
||||
import com.cool.store.vo.region.RegionBaseInfoVO;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author zhangchenbiao
|
||||
@@ -20,9 +24,12 @@ public class RegionServiceImpl implements RegionService {
|
||||
@Resource
|
||||
private RedisUtil redisUtil;
|
||||
@Resource
|
||||
private RedisConstantUtil redisConstantUtil;
|
||||
@Resource
|
||||
private SimpleMessageService simpleMessageService;
|
||||
private RegionDAO regionDAO;
|
||||
|
||||
|
||||
@Override
|
||||
public RegionBaseInfoVO getRegionBaseInfoList() {
|
||||
List<RegionDO> regionBaseInfoList = regionDAO.getRegionBaseInfoList();
|
||||
return RegionBaseInfoVO.convertTree(regionBaseInfoList);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,49 @@
|
||||
package com.cool.store.Service;
|
||||
|
||||
import com.cool.store.vo.InterviewPlanVO;
|
||||
import com.cool.store.vo.InterviewScheduleInfoVO;
|
||||
import com.cool.store.vo.StageCountVO;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* @Author suzhuhong
|
||||
* @Date 2023/6/8 14:45
|
||||
* @Version 1.0
|
||||
*/
|
||||
public interface DeskService {
|
||||
|
||||
|
||||
/**
|
||||
* 是否有临期线索与面试
|
||||
* @param userId
|
||||
* @return
|
||||
*/
|
||||
InterviewPlanVO getInterviewPlan(String userId);
|
||||
|
||||
|
||||
/**
|
||||
* 面试日程
|
||||
* @param userId
|
||||
* @param selectedData
|
||||
* @return
|
||||
*/
|
||||
InterviewScheduleInfoVO interviewSchedule(String userId,Date selectedData);
|
||||
|
||||
/**
|
||||
* 招商经理 各阶段 待处理 待跟进数量
|
||||
* @param userId
|
||||
* @param type
|
||||
* @return
|
||||
*/
|
||||
StageCountVO getStageCountByType(String userId,String type);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
package com.cool.store.Service;
|
||||
|
||||
import com.cool.store.vo.PartnerIntentApplyInfoVO;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
|
||||
/**
|
||||
* @Author suzhuhong
|
||||
* @Date 2023/6/9 14:54
|
||||
* @Version 1.0
|
||||
*/
|
||||
public interface HyPartnerIntentInfoService {
|
||||
|
||||
|
||||
/**
|
||||
* 招商经理 意向申请阶段 待处理 待跟进列表
|
||||
* @param userId
|
||||
* @param type
|
||||
* @param pageSize
|
||||
* @param pageNumber
|
||||
* @return
|
||||
*/
|
||||
PageInfo<PartnerIntentApplyInfoVO> getPartnerIntentApplyList(String userId, String type, Integer pageSize, Integer pageNumber);
|
||||
|
||||
/**
|
||||
* 根据线索查询加盟商意向申请信息
|
||||
* @param lineId
|
||||
* @return
|
||||
*/
|
||||
PartnerIntentApplyInfoVO getPartnerIntentApplyInfo(Long lineId);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,45 @@
|
||||
package com.cool.store.Service;
|
||||
|
||||
import com.cool.store.entity.HyPartnerInterviewPlanDO;
|
||||
import com.cool.store.vo.InterviewDetailInfoVO;
|
||||
import com.cool.store.vo.PartnerInterviewInfoVO;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author suzhuhong
|
||||
* @Date 2023/6/8 19:32
|
||||
* @Version 1.0
|
||||
*/
|
||||
public interface HyPartnerInterviewPlanService {
|
||||
|
||||
/**
|
||||
* 招商经理今日面试列表
|
||||
* @param userId
|
||||
* @return
|
||||
*/
|
||||
List<InterviewDetailInfoVO> getInterviewPlanList(String userId);
|
||||
|
||||
/**
|
||||
* getPartnerInterviewInfoList
|
||||
* @param userId
|
||||
* @param pageSize
|
||||
* @param pageNumber
|
||||
* @return
|
||||
*/
|
||||
PageInfo<PartnerInterviewInfoVO> getPartnerInterviewInfoList(String userId,Integer pageSize,Integer pageNumber);
|
||||
|
||||
|
||||
/**
|
||||
* getQualifiedInterviewList
|
||||
* @param userId
|
||||
* @param type
|
||||
* @param pageSize
|
||||
* @param pageNumber
|
||||
* @return
|
||||
*/
|
||||
PageInfo<PartnerInterviewInfoVO> getQualifiedInterviewList(String userId,String type,Integer pageSize,Integer pageNumber);
|
||||
}
|
||||
@@ -0,0 +1,94 @@
|
||||
package com.cool.store.Service;
|
||||
|
||||
import com.cool.store.request.LineRequest;
|
||||
import com.cool.store.vo.BlackListVO;
|
||||
import com.cool.store.vo.PartnerLineInfoAndBaseInfoVO;
|
||||
import com.cool.store.vo.PartnerLineInfoVO;
|
||||
import com.cool.store.vo.StageCountVO;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author suzhuhong
|
||||
* @Date 2023/6/9 10:30
|
||||
* @Version 1.0
|
||||
*/
|
||||
public interface HyPartnerLineInfoService {
|
||||
|
||||
|
||||
/**
|
||||
* 查询招商经理 待处理
|
||||
* @param userId
|
||||
* @return
|
||||
*/
|
||||
StageCountVO selectStagePendingCount(String userId);
|
||||
|
||||
/**
|
||||
* 查询招商经理 待跟进
|
||||
* @param userId
|
||||
* @return
|
||||
*/
|
||||
StageCountVO selectStageFollowCount(String userId);
|
||||
|
||||
|
||||
/**
|
||||
* 查询加盟商线索详情之一 线索信息与基本信息
|
||||
* @param lineId
|
||||
* @return
|
||||
*/
|
||||
PartnerLineInfoAndBaseInfoVO selectPartnerLineInfoAndBaseInfo(Long lineId);
|
||||
|
||||
/**
|
||||
* 最近30天结束的线索
|
||||
* @param userId
|
||||
* @param pageSize
|
||||
* @param pageNumber
|
||||
* @return
|
||||
*/
|
||||
PageInfo<PartnerLineInfoVO> lastMonthCloseLine(String userId,Integer pageSize,Integer pageNumber);
|
||||
|
||||
/**
|
||||
* 转让招商经理
|
||||
* @param userId
|
||||
* @param lineId
|
||||
* @return
|
||||
*/
|
||||
Boolean transferInvestmentManager(String userId,Long lineId);
|
||||
|
||||
/**
|
||||
* 分配招商经理
|
||||
* @param userId
|
||||
* @param lineIdList
|
||||
* @return
|
||||
*/
|
||||
Boolean allocationInvestmentManager(String userId, List<Long> lineIdList);
|
||||
|
||||
|
||||
/**
|
||||
* 黑名单列表
|
||||
* @param LineRequest LineRequest
|
||||
* @return
|
||||
*/
|
||||
PageInfo<BlackListVO> getBlackList(LineRequest LineRequest);
|
||||
|
||||
/**
|
||||
* 加入或者移除 黑名单
|
||||
* @param lineId
|
||||
* @param status
|
||||
* @param joinReason
|
||||
* @return
|
||||
*/
|
||||
Boolean joinBlackList( Long lineId, Integer status, String joinReason);
|
||||
|
||||
/**
|
||||
* 移除黑名单
|
||||
* @param lineId
|
||||
* @param status
|
||||
* @param removeReason
|
||||
* @return
|
||||
*/
|
||||
Boolean removeBlackList( Long lineId, Integer status, String removeReason);
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,92 @@
|
||||
package com.cool.store.Service.impl;
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import com.cool.store.Service.DeskService;
|
||||
import com.cool.store.Service.HyPartnerInterviewPlanService;
|
||||
import com.cool.store.Service.HyPartnerLineInfoService;
|
||||
import com.cool.store.constants.CommonConstants;
|
||||
import com.cool.store.dao.HyPartnerInterviewPlanDAO;
|
||||
import com.cool.store.dao.HyPartnerLineInfoDAO;
|
||||
import com.cool.store.dto.partner.SpecialDateRangeInterviewCountDTO;
|
||||
import com.cool.store.entity.HyPartnerInterviewPlanDO;
|
||||
import com.cool.store.enums.ErrorCodeEnum;
|
||||
import com.cool.store.exception.ServiceException;
|
||||
import com.cool.store.utils.CoolDateUtils;
|
||||
import com.cool.store.vo.InterviewDetailInfoVO;
|
||||
import com.cool.store.vo.InterviewPlanVO;
|
||||
import com.cool.store.vo.InterviewScheduleInfoVO;
|
||||
import com.cool.store.vo.StageCountVO;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.http.client.utils.DateUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author suzhuhong
|
||||
* @Date 2023/6/8 14:45
|
||||
* @Version 1.0
|
||||
*/
|
||||
@Service
|
||||
public class DeskServiceImpl implements DeskService {
|
||||
|
||||
@Resource
|
||||
HyPartnerInterviewPlanDAO hyPartnerInterviewPlanDAO;
|
||||
@Resource
|
||||
HyPartnerLineInfoDAO hyPartnerLineInfoDAO;
|
||||
@Resource
|
||||
HyPartnerInterviewPlanService hyPartnerInterviewPlanService;
|
||||
@Resource
|
||||
HyPartnerLineInfoService hyPartnerLineInfoService;
|
||||
|
||||
@Override
|
||||
public InterviewPlanVO getInterviewPlan(String userId) {
|
||||
InterviewPlanVO interviewPlanVO = new InterviewPlanVO();
|
||||
|
||||
String currentDate = DateUtil.format(new Date(), CoolDateUtils.DATE_FORMAT_DAY);
|
||||
Integer currentDateInterviewCount = hyPartnerInterviewPlanDAO.getCurrentDateInterviewCount(userId, currentDate);
|
||||
interviewPlanVO.setHasInterview(currentDateInterviewCount>0);
|
||||
//临期数量
|
||||
Integer adventLineCount = hyPartnerLineInfoDAO.getAdventLineCount(userId, currentDate);
|
||||
interviewPlanVO.setHasAdventLine(adventLineCount>0);
|
||||
return interviewPlanVO;
|
||||
}
|
||||
|
||||
@Override
|
||||
public InterviewScheduleInfoVO interviewSchedule(String userId,Date selectedData) {
|
||||
if (StringUtils.isEmpty(userId)||selectedData==null){
|
||||
throw new ServiceException(ErrorCodeEnum.PARAMS_REQUIRED);
|
||||
}
|
||||
InterviewScheduleInfoVO interviewScheduleInfoVO = new InterviewScheduleInfoVO();
|
||||
//查询面试数量
|
||||
String currentDate = DateUtil.format(selectedData, CoolDateUtils.DATE_FORMAT_DAY);
|
||||
String startTime = DateUtil.format(selectedData, CoolDateUtils.DATE_FORMAT_SEC);
|
||||
String endTime = DateUtil.format(CoolDateUtils.getDateBefore(selectedData, 7), CoolDateUtils.DATE_FORMAT_SEC);
|
||||
SpecialDateRangeInterviewCountDTO interviewCount = hyPartnerInterviewPlanDAO.getInterviewCount(userId, currentDate, startTime, endTime);
|
||||
|
||||
interviewScheduleInfoVO.setCurrentDayInterviewCount(interviewCount.getCurrentDayInterviewCount());
|
||||
interviewScheduleInfoVO.setLastSevenDayInterviewCount(interviewCount.getLastSevenDayInterviewCount());
|
||||
|
||||
//查询面试列表
|
||||
//当天时间 与入参无关
|
||||
List<InterviewDetailInfoVO> interviewPlanList = hyPartnerInterviewPlanService.getInterviewPlanList(userId);
|
||||
interviewScheduleInfoVO.setInterviewDetailInfoVOS(interviewPlanList);
|
||||
|
||||
return interviewScheduleInfoVO;
|
||||
}
|
||||
|
||||
@Override
|
||||
public StageCountVO getStageCountByType(String userId, String type) {
|
||||
if (CommonConstants.PENDING.equals(type)){
|
||||
return hyPartnerLineInfoService.selectStagePendingCount(userId);
|
||||
}
|
||||
if (CommonConstants.FOLLOW.equals(type)){
|
||||
return hyPartnerLineInfoService.selectStageFollowCount(userId);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,104 @@
|
||||
package com.cool.store.Service.impl;
|
||||
|
||||
import com.cool.store.Service.HyPartnerIntentInfoService;
|
||||
import com.cool.store.constants.CommonConstants;
|
||||
import com.cool.store.dao.HyPartnerIntentInfoDAO;
|
||||
import com.cool.store.dao.HyPartnerLineInfoDAO;
|
||||
import com.cool.store.dao.HyPartnerUserInfoDAO;
|
||||
import com.cool.store.dto.partner.PartnerIntentApplyInfoDTO;
|
||||
import com.cool.store.entity.HyPartnerIntentInfoDO;
|
||||
import com.cool.store.entity.HyPartnerLineInfoDO;
|
||||
import com.cool.store.entity.HyPartnerUserInfoDO;
|
||||
import com.cool.store.enums.ErrorCodeEnum;
|
||||
import com.cool.store.enums.WorkflowStageEnum;
|
||||
import com.cool.store.enums.WorkflowStatusEnum;
|
||||
import com.cool.store.exception.ServiceException;
|
||||
import com.cool.store.vo.PartnerIntentApplyInfoVO;
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* @Author suzhuhong
|
||||
* @Date 2023/6/9 15:00
|
||||
* @Version 1.0
|
||||
*/
|
||||
@Service
|
||||
public class HyPartnerIntentInfoServiceImpl implements HyPartnerIntentInfoService {
|
||||
|
||||
|
||||
@Resource
|
||||
HyPartnerIntentInfoDAO hyPartnerIntentInfoDAO;
|
||||
@Resource
|
||||
HyPartnerUserInfoDAO hyPartnerUserInfoDAO;
|
||||
@Resource
|
||||
HyPartnerLineInfoDAO hyPartnerLineInfoDAO;
|
||||
|
||||
@Override
|
||||
public PageInfo<PartnerIntentApplyInfoVO> getPartnerIntentApplyList(String userId, String type, Integer pageSize, Integer pageNumber) {
|
||||
PartnerIntentApplyInfoVO partnerIntentApplyInfoVO = new PartnerIntentApplyInfoVO();
|
||||
String workflowStatus = "";
|
||||
if (CommonConstants.PENDING.equals(type)) {
|
||||
workflowStatus = WorkflowStatusEnum.RESERVATION_0.getCode();
|
||||
}
|
||||
if (CommonConstants.FOLLOW.equals(type)) {
|
||||
workflowStatus = WorkflowStatusEnum.INTERVIEW_4.getCode();
|
||||
}
|
||||
PageHelper.startPage(pageNumber,pageSize);
|
||||
PageInfo partnerIntentApplyInfo = hyPartnerIntentInfoDAO.selectPartnerIntentApplyInfoList(userId, WorkflowStageEnum.INTENT.getCode(), workflowStatus);
|
||||
if (partnerIntentApplyInfo==null){
|
||||
return new PageInfo<>();
|
||||
}
|
||||
List<PartnerIntentApplyInfoDTO> list = partnerIntentApplyInfo.getList();
|
||||
List<String> partnerIds = list.stream().map(PartnerIntentApplyInfoDTO::getPartnerId).collect(Collectors.toList());
|
||||
List<HyPartnerUserInfoDO> hyPartnerUserInfoDOS = hyPartnerUserInfoDAO.selectByPartnerIds(partnerIds);
|
||||
Map<String, HyPartnerUserInfoDO> infoDOMap = hyPartnerUserInfoDOS.stream().collect(Collectors.toMap(HyPartnerUserInfoDO::getPartnerId, data -> data));
|
||||
List<PartnerIntentApplyInfoVO> result = new ArrayList<>();
|
||||
list.stream().forEach(x->{
|
||||
PartnerIntentApplyInfoVO pat = partnerIntentApplyInfoDTOToVo(x);
|
||||
HyPartnerUserInfoDO infoDOMapOrDefault = infoDOMap.getOrDefault(x.getPartnerId(), new HyPartnerUserInfoDO());
|
||||
pat.setPartnerUserName(infoDOMapOrDefault.getUsername());
|
||||
pat.setPartnerUserPhone(infoDOMapOrDefault.getMobile());
|
||||
result.add(pat);
|
||||
});
|
||||
partnerIntentApplyInfo.setList(result);
|
||||
return partnerIntentApplyInfo;
|
||||
}
|
||||
|
||||
@Override
|
||||
public PartnerIntentApplyInfoVO getPartnerIntentApplyInfo(Long lineId) {
|
||||
PartnerIntentApplyInfoDTO partnerIntentApplyInfoDTO= hyPartnerIntentInfoDAO.selectByLineId(lineId);
|
||||
PartnerIntentApplyInfoVO partnerIntentApplyInfoVO = partnerIntentApplyInfoDTOToVo(partnerIntentApplyInfoDTO);
|
||||
HyPartnerUserInfoDO hyPartnerUserInfoDO = hyPartnerUserInfoDAO.selectByPartnerId(partnerIntentApplyInfoDTO.getPartnerId());
|
||||
partnerIntentApplyInfoVO.setPartnerUserName(hyPartnerUserInfoDO.getUsername());
|
||||
partnerIntentApplyInfoVO.setPartnerUserPhone(hyPartnerUserInfoDO.getMobile());
|
||||
//todo su 手机号归属地 意向申请区域名称
|
||||
return partnerIntentApplyInfoVO;
|
||||
}
|
||||
|
||||
/**
|
||||
* partnerIntentApplyInfoDTOToVo
|
||||
* @param partnerIntentApplyInfoDTO
|
||||
* @return
|
||||
*/
|
||||
private PartnerIntentApplyInfoVO partnerIntentApplyInfoDTOToVo(PartnerIntentApplyInfoDTO partnerIntentApplyInfoDTO){
|
||||
PartnerIntentApplyInfoVO partnerIntentApplyInfoVO = new PartnerIntentApplyInfoVO();
|
||||
partnerIntentApplyInfoVO.setId(partnerIntentApplyInfoDTO.getId());
|
||||
partnerIntentApplyInfoVO.setPartnerId(partnerIntentApplyInfoDTO.getPartnerId());
|
||||
partnerIntentApplyInfoVO.setPartnerLineId(partnerIntentApplyInfoDTO.getPartnerLineId());
|
||||
partnerIntentApplyInfoVO.setPartnerSubmitTime(partnerIntentApplyInfoDTO.getPartnerSubmitTime());
|
||||
partnerIntentApplyInfoVO.setAcceptAdjustType(partnerIntentApplyInfoDTO.getAcceptAdjustType());
|
||||
partnerIntentApplyInfoVO.setLiveArea(partnerIntentApplyInfoDTO.getLiveArea());
|
||||
partnerIntentApplyInfoVO.setWantShopArea(partnerIntentApplyInfoDTO.getWantShopArea());
|
||||
partnerIntentApplyInfoVO.setDeadline(partnerIntentApplyInfoDTO.getDeadline());
|
||||
return partnerIntentApplyInfoVO;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,141 @@
|
||||
package com.cool.store.Service.impl;
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import com.cool.store.Service.HyPartnerInterviewPlanService;
|
||||
import com.cool.store.constants.CommonConstants;
|
||||
import com.cool.store.dao.HyPartnerInterviewPlanDAO;
|
||||
import com.cool.store.dao.HyPartnerUserInfoDAO;
|
||||
import com.cool.store.dto.partner.PartnerInterviewInfoDTO;
|
||||
import com.cool.store.entity.HyPartnerInterviewPlanDO;
|
||||
import com.cool.store.entity.HyPartnerUserInfoDO;
|
||||
import com.cool.store.enums.WorkflowStageEnum;
|
||||
import com.cool.store.enums.WorkflowStatusEnum;
|
||||
import com.cool.store.utils.CoolDateUtils;
|
||||
import com.cool.store.vo.InterviewDetailInfoVO;
|
||||
import com.cool.store.vo.PartnerInterviewInfoVO;
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import com.google.common.collect.Lists;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* @Author suzhuhong
|
||||
* @Date 2023/6/8 19:32
|
||||
* @Version 1.0
|
||||
*/
|
||||
@Service
|
||||
public class HyPartnerInterviewPlanServiceImpl implements HyPartnerInterviewPlanService {
|
||||
|
||||
@Resource
|
||||
HyPartnerInterviewPlanDAO hyPartnerInterviewPlanDAO;
|
||||
@Resource
|
||||
HyPartnerUserInfoDAO hyPartnerUserInfoDAO;
|
||||
|
||||
|
||||
@Override
|
||||
public List<InterviewDetailInfoVO> getInterviewPlanList(String userId) {
|
||||
String currentTime = DateUtil.format(new Date(), CoolDateUtils.DATE_FORMAT_DAY);
|
||||
List<HyPartnerInterviewPlanDO> interviewPlanList = hyPartnerInterviewPlanDAO.getInterviewPlanList(userId, currentTime);
|
||||
if (CollectionUtils.isEmpty(interviewPlanList)){
|
||||
return Lists.newArrayList();
|
||||
}
|
||||
List<String> partnerIdList = interviewPlanList.stream().map(HyPartnerInterviewPlanDO::getPartnerId).collect(Collectors.toList());
|
||||
List<HyPartnerUserInfoDO> hyPartnerUserInfoDOS = hyPartnerUserInfoDAO.selectByPartnerIds(partnerIdList);
|
||||
Map<String, HyPartnerUserInfoDO> hyPartnerUserInfoDOMap = hyPartnerUserInfoDOS.stream().collect(Collectors.toMap(HyPartnerUserInfoDO::getPartnerId, data -> data));
|
||||
List<InterviewDetailInfoVO> result = new ArrayList<>();
|
||||
interviewPlanList.stream().forEach(x->{
|
||||
InterviewDetailInfoVO interviewDetailInfoVO = convertDoToInterviewDetailInfoVO(x);
|
||||
HyPartnerUserInfoDO userInfoDO = hyPartnerUserInfoDOMap.getOrDefault(x.getPartnerId(), new HyPartnerUserInfoDO());
|
||||
interviewDetailInfoVO.setUserId(userInfoDO.getPartnerId());
|
||||
interviewDetailInfoVO.setUserName(userInfoDO.getUsername());
|
||||
interviewDetailInfoVO.setUserPhone(userInfoDO.getMobile());
|
||||
result.add(interviewDetailInfoVO);
|
||||
});
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageInfo<PartnerInterviewInfoVO> getPartnerInterviewInfoList(String userId ,Integer pageSize,Integer pageNumber) {
|
||||
PageHelper.startPage(pageNumber,pageSize);
|
||||
//查询预约面试列表
|
||||
PageInfo partnerInterviewInfoList = hyPartnerInterviewPlanDAO.getPartnerInterviewInfoList(userId, WorkflowStageEnum.RESERVATION.getCode(), WorkflowStatusEnum.RESERVATION_0.getCode());
|
||||
List<PartnerInterviewInfoDTO> list = partnerInterviewInfoList.getList();
|
||||
if (CollectionUtils.isEmpty(list)){
|
||||
return partnerInterviewInfoList;
|
||||
}
|
||||
List<PartnerInterviewInfoVO> result = new ArrayList<>();
|
||||
list.stream().forEach(x->{
|
||||
PartnerInterviewInfoVO partnerInterviewInfoVO = convertPartnerInterviewInfoDTOToVo(x);
|
||||
result.add(partnerInterviewInfoVO);
|
||||
});
|
||||
partnerInterviewInfoList.setList(result);
|
||||
return partnerInterviewInfoList;
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageInfo<PartnerInterviewInfoVO> getQualifiedInterviewList(String userId, String type, Integer pageSize, Integer pageNumber) {
|
||||
String workflowStatus = "";
|
||||
if (CommonConstants.PENDING.equals(type)) {
|
||||
workflowStatus = WorkflowStatusEnum.INTERVIEW_3.getCode();
|
||||
}
|
||||
if (CommonConstants.FOLLOW.equals(type)) {
|
||||
workflowStatus = WorkflowStatusEnum.INTERVIEW_4.getCode();
|
||||
}
|
||||
|
||||
PageHelper.startPage(pageNumber,pageSize);
|
||||
//查询预约面试列表
|
||||
PageInfo partnerInterviewInfoList = hyPartnerInterviewPlanDAO.getPartnerInterviewInfoList(userId, WorkflowStageEnum.INTERVIEW.getCode(),workflowStatus);
|
||||
List<PartnerInterviewInfoDTO> list = partnerInterviewInfoList.getList();
|
||||
if (CollectionUtils.isEmpty(list)){
|
||||
return partnerInterviewInfoList;
|
||||
}
|
||||
List<PartnerInterviewInfoVO> result = new ArrayList<>();
|
||||
list.stream().forEach(x->{
|
||||
PartnerInterviewInfoVO partnerInterviewInfoVO = convertPartnerInterviewInfoDTOToVo(x);
|
||||
result.add(partnerInterviewInfoVO);
|
||||
});
|
||||
partnerInterviewInfoList.setList(result);
|
||||
return partnerInterviewInfoList;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* convertDoToInterviewDetailInfoVO
|
||||
* @param hyPartnerInterviewPlanDO
|
||||
* @return
|
||||
*/
|
||||
private InterviewDetailInfoVO convertDoToInterviewDetailInfoVO(HyPartnerInterviewPlanDO hyPartnerInterviewPlanDO){
|
||||
InterviewDetailInfoVO interviewDetailInfoVO = new InterviewDetailInfoVO();
|
||||
if (hyPartnerInterviewPlanDO==null){
|
||||
return interviewDetailInfoVO;
|
||||
}
|
||||
interviewDetailInfoVO.setLineId(hyPartnerInterviewPlanDO.getPartnerLineId());
|
||||
interviewDetailInfoVO.setStartTime(hyPartnerInterviewPlanDO.getStartTime());
|
||||
return interviewDetailInfoVO;
|
||||
}
|
||||
|
||||
/**
|
||||
* PartnerInterviewInfoDTOToVo
|
||||
* @param partnerInterviewInfoDTO
|
||||
* @return
|
||||
*/
|
||||
private PartnerInterviewInfoVO convertPartnerInterviewInfoDTOToVo(PartnerInterviewInfoDTO partnerInterviewInfoDTO){
|
||||
PartnerInterviewInfoVO partnerInterviewInfoVO = new PartnerInterviewInfoVO();
|
||||
partnerInterviewInfoVO.setInterviewId(partnerInterviewInfoDTO.getInterviewId());
|
||||
partnerInterviewInfoVO.setPartnerId(partnerInterviewInfoDTO.getPartnerId());
|
||||
partnerInterviewInfoVO.setInterviewerId(partnerInterviewInfoDTO.getInterviewer());
|
||||
partnerInterviewInfoVO.setProcessInfo(partnerInterviewInfoDTO.getProcessInfo());
|
||||
partnerInterviewInfoVO.setCreateTime(DateUtil.format(partnerInterviewInfoDTO.getCreateTime(),CoolDateUtils.DATE_FORMAT_SEC));
|
||||
partnerInterviewInfoVO.setRoomId(partnerInterviewInfoDTO.getRoomId());
|
||||
partnerInterviewInfoVO.setStartTime(DateUtil.format(partnerInterviewInfoDTO.getStartTime(),CoolDateUtils.DATE_FORMAT_SEC));
|
||||
partnerInterviewInfoVO.setStatus(partnerInterviewInfoDTO.getStatus());
|
||||
partnerInterviewInfoVO.setEndTime(DateUtil.format(partnerInterviewInfoDTO.getEndTime(),CoolDateUtils.DATE_FORMAT_SEC));
|
||||
return partnerInterviewInfoVO;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,243 @@
|
||||
package com.cool.store.Service.impl;
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import com.cool.store.Service.HyPartnerLineInfoService;
|
||||
import com.cool.store.dao.HyPartnerLineInfoDAO;
|
||||
import com.cool.store.dao.HyPartnerUserInfoDAO;
|
||||
import com.cool.store.dto.partner.PartnerBlackListDTO;
|
||||
import com.cool.store.dto.partner.PartnerLineInfoAndBaseInfoDTO;
|
||||
import com.cool.store.dto.partner.StageCountDTO;
|
||||
import com.cool.store.entity.HyPartnerLineInfoDO;
|
||||
import com.cool.store.entity.HyPartnerUserInfoDO;
|
||||
import com.cool.store.enums.ErrorCodeEnum;
|
||||
import com.cool.store.enums.LineStatusEnum;
|
||||
import com.cool.store.enums.WorkflowStageEnum;
|
||||
import com.cool.store.enums.WorkflowStatusEnum;
|
||||
import com.cool.store.exception.ServiceException;
|
||||
import com.cool.store.request.LineRequest;
|
||||
import com.cool.store.utils.CoolDateUtils;
|
||||
import com.cool.store.utils.StringUtil;
|
||||
import com.cool.store.vo.BlackListVO;
|
||||
import com.cool.store.vo.PartnerLineInfoAndBaseInfoVO;
|
||||
import com.cool.store.vo.PartnerLineInfoVO;
|
||||
import com.cool.store.vo.StageCountVO;
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* @Author suzhuhong
|
||||
* @Date 2023/6/9 10:30
|
||||
* @Version 1.0
|
||||
*/
|
||||
@Service
|
||||
public class HyPartnerLineInfoServiceImpl implements HyPartnerLineInfoService {
|
||||
|
||||
@Resource
|
||||
HyPartnerLineInfoDAO hyPartnerLineInfoDAO;
|
||||
@Resource
|
||||
HyPartnerUserInfoDAO hyPartnerUserInfoDAO;
|
||||
|
||||
@Override
|
||||
public StageCountVO selectStagePendingCount(String userId) {
|
||||
StageCountDTO stageCountDTO = hyPartnerLineInfoDAO.selectStagePendingCount(userId);
|
||||
return stageCountDTOToVo(stageCountDTO);
|
||||
}
|
||||
|
||||
@Override
|
||||
public StageCountVO selectStageFollowCount(String userId) {
|
||||
StageCountDTO stageCountDTO = hyPartnerLineInfoDAO.selectStageFollowCount(userId);
|
||||
return stageCountDTOToVo(stageCountDTO);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PartnerLineInfoAndBaseInfoVO selectPartnerLineInfoAndBaseInfo(Long lineId) {
|
||||
PartnerLineInfoAndBaseInfoDTO partnerLineInfoAndBaseInfoDTO = hyPartnerLineInfoDAO.selectPartnerLineInfoAndBaseInfo(lineId);
|
||||
if (partnerLineInfoAndBaseInfoDTO==null){
|
||||
throw new ServiceException(ErrorCodeEnum.LINE_ID_IS_NOT_EXIST);
|
||||
}
|
||||
PartnerLineInfoAndBaseInfoVO partnerLineInfoAndBaseInfoVO = convertPartnerLineInfoAndBaseInfoDTOToVo(partnerLineInfoAndBaseInfoDTO);
|
||||
HyPartnerUserInfoDO hyPartnerUserInfoDO = hyPartnerUserInfoDAO.selectByPartnerId(partnerLineInfoAndBaseInfoVO.getPartnerUserId());
|
||||
if (hyPartnerUserInfoDO!=null){
|
||||
partnerLineInfoAndBaseInfoVO.setPartnerUserName(hyPartnerUserInfoDO.getUsername());
|
||||
partnerLineInfoAndBaseInfoVO.setPartnerUserPhone(hyPartnerUserInfoDO.getMobile());
|
||||
}
|
||||
//todo su 1、招商经理名称 手机号归属地 2、加盟商手机号归属地
|
||||
return partnerLineInfoAndBaseInfoVO;
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageInfo<PartnerLineInfoVO> lastMonthCloseLine(String userId, Integer pageSize, Integer pageNumber) {
|
||||
PageHelper.startPage(pageNumber,pageSize);
|
||||
String lastMonthTodayDate = DateUtil.format(CoolDateUtils.getDateBefore(new Date(),-30), CoolDateUtils.DATE_FORMAT_SEC);
|
||||
PageInfo hyPartnerLineInfoDOPageInfo = hyPartnerLineInfoDAO.lastMonthCloseLine(userId, lastMonthTodayDate);
|
||||
|
||||
List<HyPartnerLineInfoDO> list = hyPartnerLineInfoDOPageInfo.getList();
|
||||
List<PartnerLineInfoVO> result = new ArrayList<>();
|
||||
list.stream().forEach(x->{
|
||||
PartnerLineInfoVO partnerLineInfoVO = new PartnerLineInfoVO();
|
||||
BeanUtils.copyProperties(x,partnerLineInfoVO);
|
||||
result.add(partnerLineInfoVO);
|
||||
});
|
||||
hyPartnerLineInfoDOPageInfo.setList(result);
|
||||
return hyPartnerLineInfoDOPageInfo;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean transferInvestmentManager(String userId, Long lineId) {
|
||||
if (StringUtil.isBlank(userId)||lineId==null){
|
||||
throw new ServiceException(ErrorCodeEnum.PARAMS_REQUIRED);
|
||||
}
|
||||
hyPartnerLineInfoDAO.updateInvestmentManager(userId, Arrays.asList(lineId));
|
||||
return Boolean.TRUE;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean allocationInvestmentManager(String userId, List<Long> lineIdList) {
|
||||
if (StringUtil.isBlank(userId)|| CollectionUtils.isEmpty(lineIdList)){
|
||||
throw new ServiceException(ErrorCodeEnum.PARAMS_REQUIRED);
|
||||
}
|
||||
//加盟上线索集合
|
||||
List<HyPartnerLineInfoDO> partnerLineInfoList= hyPartnerLineInfoDAO.getLineListByLineIds(lineIdList);
|
||||
//过滤出已结束的线索 这块线索需要重新生成新的线索
|
||||
List<HyPartnerLineInfoDO> closeLineList = partnerLineInfoList.stream().filter(x -> x.getCloseTime() != null).collect(Collectors.toList());
|
||||
List<Long> closeLineIdList = closeLineList.stream().map(HyPartnerLineInfoDO::getId).collect(Collectors.toList());
|
||||
//已结束的线索 需要重新生成一条新的线索
|
||||
List<HyPartnerLineInfoDO> list = new ArrayList<>();
|
||||
closeLineList.stream().forEach(x->{
|
||||
HyPartnerLineInfoDO hyPartnerLineInfoDO = new HyPartnerLineInfoDO();
|
||||
hyPartnerLineInfoDO.setPartnerId(x.getPartnerId());
|
||||
hyPartnerLineInfoDO.setInvestmentManager(userId);
|
||||
hyPartnerLineInfoDO.setWorkflowStage(WorkflowStageEnum.INTENT.getCode());
|
||||
hyPartnerLineInfoDO.setWorkflowStatus(WorkflowStatusEnum.INTENT_0.getCode());
|
||||
hyPartnerLineInfoDO.setLineStatus(1);
|
||||
list.add(hyPartnerLineInfoDO);
|
||||
});
|
||||
hyPartnerLineInfoDAO.batchInsert(list);
|
||||
//将老的线索置为删除状态
|
||||
hyPartnerLineInfoDAO.batchDeleted(closeLineIdList);
|
||||
//没有结束的线索直接分配招商经理
|
||||
List<HyPartnerLineInfoDO> otherLineList = partnerLineInfoList.stream().filter(x -> x.getCloseTime() == null).collect(Collectors.toList());
|
||||
List<Long> otherLineIdList = otherLineList.stream().map(HyPartnerLineInfoDO::getId).collect(Collectors.toList());
|
||||
hyPartnerLineInfoDAO.updateInvestmentManager(userId, otherLineIdList);
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageInfo<BlackListVO> getBlackList(LineRequest LineRequest) {
|
||||
PageHelper.startPage(LineRequest.getPageNum(),LineRequest.getPageSize());
|
||||
PageInfo blackListDTOPageInfo = hyPartnerLineInfoDAO.getBlackList(LineRequest.getKeyWord(), LineRequest.getIntentArea(), LineRequest.getAcceptAdjustType());
|
||||
List<PartnerBlackListDTO> list = blackListDTOPageInfo.getList();
|
||||
List<BlackListVO> result = new ArrayList<>();
|
||||
list.stream().forEach(x->{
|
||||
BlackListVO blackListVO = convertPartnerBlackListDTOToVo(x);
|
||||
//todo su 员工名称手机号 手机号归属地
|
||||
result.add(blackListVO);
|
||||
});
|
||||
blackListDTOPageInfo.setList(result);
|
||||
return blackListDTOPageInfo;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean joinBlackList(Long lineId, Integer status, String joinReason) {
|
||||
if (lineId==null){
|
||||
throw new ServiceException(ErrorCodeEnum.PARAMS_REQUIRED);
|
||||
}
|
||||
//加入黑名单 阶段回到第一步待提交状态
|
||||
HyPartnerLineInfoDO hyPartnerLineInfoDO = new HyPartnerLineInfoDO();
|
||||
hyPartnerLineInfoDO.setId(lineId);
|
||||
hyPartnerLineInfoDO.setLineStatus(status);
|
||||
hyPartnerLineInfoDO.setJoinBlackReason(joinReason);
|
||||
hyPartnerLineInfoDO.setWorkflowStage(WorkflowStageEnum.INTENT.getCode());
|
||||
hyPartnerLineInfoDO.setWorkflowStatus(WorkflowStatusEnum.INTENT_0.getCode());
|
||||
|
||||
hyPartnerLineInfoDAO.updateByPrimaryKeySelective(hyPartnerLineInfoDO);
|
||||
return Boolean.TRUE;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean removeBlackList(Long lineId, Integer status, String removeReason) {
|
||||
//移除黑名单 黑名单线索置为删除状态 新增一条线索
|
||||
if (lineId==null){
|
||||
throw new ServiceException(ErrorCodeEnum.PARAMS_REQUIRED);
|
||||
}
|
||||
HyPartnerLineInfoDO hyPartnerLineInfoDO = new HyPartnerLineInfoDO();
|
||||
hyPartnerLineInfoDO.setId(lineId);
|
||||
hyPartnerLineInfoDO.setLineStatus(status);
|
||||
hyPartnerLineInfoDO.setRemoveBlackReason(removeReason);
|
||||
hyPartnerLineInfoDO.setDeleted(Boolean.TRUE);
|
||||
hyPartnerLineInfoDAO.updateByPrimaryKeySelective(hyPartnerLineInfoDO);
|
||||
|
||||
|
||||
HyPartnerLineInfoDO newHyPartnerLineInfoDO = new HyPartnerLineInfoDO();
|
||||
hyPartnerLineInfoDO.setPartnerId(hyPartnerLineInfoDO.getPartnerId());
|
||||
hyPartnerLineInfoDO.setWorkflowStage(WorkflowStageEnum.INTENT.getCode());
|
||||
hyPartnerLineInfoDO.setWorkflowStatus(WorkflowStatusEnum.INTENT_0.getCode());
|
||||
hyPartnerLineInfoDO.setLineStatus(0);
|
||||
hyPartnerLineInfoDAO.batchInsert(Arrays.asList(newHyPartnerLineInfoDO));
|
||||
return Boolean.TRUE;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* convertPartnerBlackListDTOToVo
|
||||
* @param partnerBlackListDTO
|
||||
* @return
|
||||
*/
|
||||
public BlackListVO convertPartnerBlackListDTOToVo(PartnerBlackListDTO partnerBlackListDTO){
|
||||
BlackListVO blackListVO = new BlackListVO();
|
||||
blackListVO.setId(partnerBlackListDTO.getLineId());
|
||||
blackListVO.setPartnerUserId(partnerBlackListDTO.getPartnerId());
|
||||
blackListVO.setPartnerUserName(partnerBlackListDTO.getPartnerUserName());
|
||||
blackListVO.setPartnerUserPhone(partnerBlackListDTO.getMobile());
|
||||
blackListVO.setCreateTime(partnerBlackListDTO.getCreateTime());
|
||||
blackListVO.setCloseTime(partnerBlackListDTO.getCloseTime());
|
||||
blackListVO.setJoinBlackReason(partnerBlackListDTO.getJoinBlackReason());
|
||||
blackListVO.setCloseUserId(partnerBlackListDTO.getCloseUserId());
|
||||
return blackListVO;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* convertPartnerLineInfoAndBaseInfoDTOToVo
|
||||
* @param partnerLineInfoAndBaseInfoDTO
|
||||
* @return
|
||||
*/
|
||||
private PartnerLineInfoAndBaseInfoVO convertPartnerLineInfoAndBaseInfoDTOToVo(PartnerLineInfoAndBaseInfoDTO partnerLineInfoAndBaseInfoDTO){
|
||||
PartnerLineInfoAndBaseInfoVO partnerLineInfoAndBaseInfoVO = new PartnerLineInfoAndBaseInfoVO();
|
||||
partnerLineInfoAndBaseInfoVO.setId(partnerLineInfoAndBaseInfoDTO.getId());
|
||||
partnerLineInfoAndBaseInfoVO.setPartnerUserId(partnerLineInfoAndBaseInfoDTO.getPartnerId());
|
||||
partnerLineInfoAndBaseInfoVO.setInvestmentManager(partnerLineInfoAndBaseInfoDTO.getInvestmentManager());
|
||||
partnerLineInfoAndBaseInfoVO.setUserPortrait(partnerLineInfoAndBaseInfoDTO.getUserPortrait());
|
||||
partnerLineInfoAndBaseInfoVO.setWorkflowStage(partnerLineInfoAndBaseInfoDTO.getWorkflowStage());
|
||||
partnerLineInfoAndBaseInfoVO.setWorkflowStatus(partnerLineInfoAndBaseInfoDTO.getWorkflowStatus());
|
||||
return partnerLineInfoAndBaseInfoVO;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* stageCountDTOToVo
|
||||
* @param stageCountDTO
|
||||
* @return
|
||||
*/
|
||||
private StageCountVO stageCountDTOToVo(StageCountDTO stageCountDTO){
|
||||
StageCountVO stageCountVO = new StageCountVO();
|
||||
stageCountVO.setQualifiedInterviewCount(stageCountDTO.getQualifiedInterviewCount());
|
||||
stageCountVO.setIntentApplyApproveCount(stageCountDTO.getIntentApplyApproveCount());
|
||||
stageCountVO.setReservationInterviewCount(stageCountDTO.getReservationInterviewCount());
|
||||
return stageCountVO;
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,10 @@
|
||||
package com.cool.store.controller;
|
||||
|
||||
import com.cool.store.Service.DeskService;
|
||||
import com.cool.store.Service.HyPartnerIntentInfoService;
|
||||
import com.cool.store.Service.HyPartnerInterviewPlanService;
|
||||
import com.cool.store.Service.HyPartnerLineInfoService;
|
||||
import com.cool.store.enums.LineStatusEnum;
|
||||
import com.cool.store.request.*;
|
||||
import com.cool.store.response.ResponseResult;
|
||||
import com.cool.store.vo.*;
|
||||
@@ -10,6 +15,7 @@ import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
@@ -22,12 +28,22 @@ import java.util.List;
|
||||
@Slf4j
|
||||
public class DeskController {
|
||||
|
||||
@Resource
|
||||
DeskService deskService;
|
||||
@Resource
|
||||
HyPartnerIntentInfoService hyPartnerIntentInfoService;
|
||||
@Resource
|
||||
HyPartnerInterviewPlanService hyPartnerInterviewPlanService;
|
||||
@Resource
|
||||
HyPartnerLineInfoService hyPartnerLineInfoService;
|
||||
|
||||
|
||||
@GetMapping(path = "/interviewSchedule")
|
||||
@ApiOperation("面试日程信息 面试信息有限 不做分页")
|
||||
public ResponseResult<InterviewScheduleInfoVO> interviewSchedule(@RequestParam(value = "selectedData",required = false) Date selectedData){
|
||||
public ResponseResult<InterviewScheduleInfoVO> interviewSchedule(@RequestParam(value = "userId",required = false) String userId,
|
||||
@RequestParam(value = "selectedData",required = false) Date selectedData){
|
||||
|
||||
return ResponseResult.success();
|
||||
return ResponseResult.success(deskService.interviewSchedule(userId,selectedData));
|
||||
}
|
||||
|
||||
|
||||
@@ -36,9 +52,18 @@ public class DeskController {
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "type", value = "类型 待处理-Pending 待跟进-follow", required = false),
|
||||
})
|
||||
public ResponseResult<StageCountVO> queryStageCount(@RequestParam(value = "type",required = false)Integer type){
|
||||
public ResponseResult<StageCountVO> queryStageCount(@RequestParam(value = "type",required = false)String type){
|
||||
String userId = "";
|
||||
return ResponseResult.success(deskService.getStageCountByType(userId,type));
|
||||
}
|
||||
|
||||
return ResponseResult.success();
|
||||
@GetMapping(path = "/queryInterviewPlan")
|
||||
@ApiOperation("是否有面试与临期线索")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "userId", value = "招商经理ID", required = false),
|
||||
})
|
||||
public ResponseResult<InterviewPlanVO> queryInterviewPlanVO(@RequestParam(value = "userId",required = false)String userId){
|
||||
return ResponseResult.success(deskService.getInterviewPlan(userId));
|
||||
}
|
||||
|
||||
|
||||
@@ -46,32 +71,46 @@ public class DeskController {
|
||||
@ApiOperation("招商经理视角===意向申请审核列表")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "type", value = "类型 待处理-Pending 待跟进-follow", required = false),
|
||||
@ApiImplicitParam(name = "pageNumber", value = "1", required = false),
|
||||
@ApiImplicitParam(name = "pageSize", value = "10", required = false),
|
||||
})
|
||||
public ResponseResult<PageInfo<PartnerIntentApplyInfoVO>> queryIntentApplyList(@RequestParam(value = "type",required = false)Integer type){
|
||||
|
||||
return ResponseResult.success();
|
||||
public ResponseResult<PageInfo<PartnerIntentApplyInfoVO>> queryIntentApplyList(@RequestParam(value = "type",required = false)String type,
|
||||
@RequestParam(value = "pageNumber",required = false,defaultValue = "1")Integer pageNumber,
|
||||
@RequestParam(value = "pageSize",required = false,defaultValue = "10")Integer pageSize){
|
||||
String userId = "";
|
||||
return ResponseResult.success(hyPartnerIntentInfoService.getPartnerIntentApplyList(userId,type,pageSize,pageNumber));
|
||||
}
|
||||
|
||||
|
||||
@PostMapping(path = "/querySubscribeInterviewTimeList")
|
||||
@ApiOperation("招商经理视角===预约面试时间/合格资格面试 列表")
|
||||
@ApiOperation("招商经理视角===预约面试时间 列表")
|
||||
public ResponseResult<PageInfo<PartnerInterviewInfoVO>> querySubscribeInterviewTimeList(@RequestParam(value = "pageNumber",required = false,defaultValue = "1")Integer pageNumber,
|
||||
@RequestParam(value = "pageSize",required = false,defaultValue = "10")Integer pageSize){
|
||||
|
||||
String userId = "";
|
||||
return ResponseResult.success(hyPartnerInterviewPlanService.getPartnerInterviewInfoList(userId,pageSize,pageNumber));
|
||||
}
|
||||
|
||||
@PostMapping(path = "/queryQualifiedInterviewList")
|
||||
@ApiOperation("招商经理视角===合格资格面试 列表")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "type", value = "类型 待处理-Pending 待跟进-follow", required = false),
|
||||
})
|
||||
public ResponseResult<PageInfo<PartnerInterviewInfoVO>> querySubscribeInterviewTimeList(@RequestParam(value = "type",required = false)Integer type){
|
||||
|
||||
return ResponseResult.success();
|
||||
public ResponseResult<PageInfo<PartnerInterviewInfoVO>> queryQualifiedInterviewList(@RequestParam(value = "type",required = false)String type,
|
||||
@RequestParam(value = "pageNumber",required = false,defaultValue = "1")Integer pageNumber,
|
||||
@RequestParam(value = "pageSize",required = false,defaultValue = "10")Integer pageSize){
|
||||
String userId = "";
|
||||
return ResponseResult.success(hyPartnerInterviewPlanService.getQualifiedInterviewList(userId,type,pageSize,pageNumber));
|
||||
}
|
||||
|
||||
|
||||
@GetMapping(path = "/getPartnerLineDetail")
|
||||
@ApiOperation("查询加盟商线索详情 线索信息与基本信息")
|
||||
@GetMapping(path = "/getPartnerLineInfoAndBaseInfo")
|
||||
@ApiOperation("查询加盟商线索详情之一 线索信息与基本信息")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "lineId", value = "线索ID", required = false),
|
||||
})
|
||||
public ResponseResult<PartnerLineDetailVO> getPartnerLineDetail(@RequestParam(value = "lineId",required = false)Long lineId){
|
||||
|
||||
return ResponseResult.success();
|
||||
public ResponseResult<PartnerLineInfoAndBaseInfoVO> getPartnerLineInfoAndBaseInfo(@RequestParam(value = "lineId",required = false)Long lineId){
|
||||
return ResponseResult.success(hyPartnerLineInfoService.selectPartnerLineInfoAndBaseInfo(lineId));
|
||||
}
|
||||
|
||||
|
||||
@@ -81,9 +120,7 @@ public class DeskController {
|
||||
@ApiImplicitParam(name = "lineId", value = "线索ID", required = false),
|
||||
})
|
||||
public ResponseResult<PartnerIntentApplyInfoVO> getPartnerIntentInfo(@RequestParam(value = "lineId",required = false)Long lineId){
|
||||
|
||||
|
||||
return ResponseResult.success();
|
||||
return ResponseResult.success(hyPartnerIntentInfoService.getPartnerIntentApplyInfo(lineId));
|
||||
}
|
||||
|
||||
|
||||
@@ -120,16 +157,23 @@ public class DeskController {
|
||||
public ResponseResult<PageInfo<PartnerLineInfoVO>> lastMonthCloseLine(@RequestParam(value = "pageNumber",required = false,defaultValue = "1")Integer pageNumber,
|
||||
@RequestParam(value = "pageSize",required = false,defaultValue = "10")Integer pageSize){
|
||||
|
||||
|
||||
return ResponseResult.success();
|
||||
String userId = "";
|
||||
return ResponseResult.success(hyPartnerLineInfoService.lastMonthCloseLine(userId,pageSize,pageNumber));
|
||||
}
|
||||
|
||||
|
||||
@PostMapping(path = "/allocationInvestmentManager")
|
||||
@ApiOperation("分配招商经理/转让招商经理")
|
||||
public ResponseResult<Boolean> allocationInvestmentManager(@RequestBody AllocationInvestmentManagerRequest allocationInvestmentManagerRequest){
|
||||
@ApiOperation("分配招商经理/批量分配招商经理")
|
||||
public ResponseResult<Boolean> allocationInvestmentManager(@RequestBody AllocationInvestmentManagerRequest request){
|
||||
|
||||
return ResponseResult.success();
|
||||
return ResponseResult.success(hyPartnerLineInfoService.allocationInvestmentManager(request.getUserId(),request.getLineIdList()));
|
||||
}
|
||||
|
||||
|
||||
@PostMapping(path = "/transferInvestmentManager")
|
||||
@ApiOperation("转让招商经理")
|
||||
public ResponseResult<Boolean> transferInvestmentManager(@RequestBody TransferInvestmentManagerRequest request){
|
||||
return ResponseResult.success(hyPartnerLineInfoService.transferInvestmentManager(request.getUserId(),request.getLineId()));
|
||||
}
|
||||
|
||||
|
||||
@@ -157,7 +201,7 @@ public class DeskController {
|
||||
@ApiOperation("黑名单列表")
|
||||
public ResponseResult<PageInfo<BlackListVO>> queryBlackList(@RequestBody LineRequest LineRequest){
|
||||
|
||||
return ResponseResult.success();
|
||||
return ResponseResult.success(hyPartnerLineInfoService.getBlackList(LineRequest));
|
||||
}
|
||||
|
||||
|
||||
@@ -165,16 +209,14 @@ public class DeskController {
|
||||
@ApiOperation("移出黑名单")
|
||||
public ResponseResult<Boolean> removeBlackList(@RequestBody LineBlackListRequest lineBlackListRequest){
|
||||
|
||||
|
||||
return ResponseResult.success();
|
||||
return ResponseResult.success(hyPartnerLineInfoService.removeBlackList(lineBlackListRequest.getLineId(), LineStatusEnum.PUBLIC_SEAS.getCode(),lineBlackListRequest.getCause()));
|
||||
}
|
||||
|
||||
@PostMapping(path = "/joinBlackList")
|
||||
@ApiOperation("加入黑名单")
|
||||
public ResponseResult<Boolean> joinBlackList(@RequestBody LineBlackListRequest lineBlackListRequest){
|
||||
|
||||
|
||||
return ResponseResult.success();
|
||||
return ResponseResult.success(hyPartnerLineInfoService.joinBlackList(lineBlackListRequest.getLineId(),LineStatusEnum.BLACKLIST.getCode(),lineBlackListRequest.getCause()));
|
||||
}
|
||||
|
||||
|
||||
@@ -201,15 +243,17 @@ public class DeskController {
|
||||
return ResponseResult.success();
|
||||
}
|
||||
|
||||
@GetMapping(path = "/queryPartnerIntentApplyInfo")
|
||||
@ApiOperation("查看意向审核信息")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "lineId", value = "线索ID", required = false),
|
||||
})
|
||||
public ResponseResult<PartnerSummaryInfoVO> queryPartnerIntentApplyInfo(@RequestParam(value = "lineId",required = false)Long lineId){
|
||||
|
||||
return ResponseResult.success();
|
||||
}
|
||||
// TODO: 2023/6/13 添加根据线索查询店员接口列表接口
|
||||
// @GetMapping(path = "/queryPartnerIntentApplyInfo")
|
||||
// @ApiOperation("查看意向审核信息")
|
||||
// @ApiImplicitParams({
|
||||
// @ApiImplicitParam(name = "lineId", value = "线索ID", required = false),
|
||||
// })
|
||||
// public ResponseResult<PartnerSummaryInfoVO> queryPartnerIntentApplyInfo(@RequestParam(value = "lineId",required = false)Long lineId){
|
||||
//
|
||||
// return ResponseResult.success();
|
||||
// }
|
||||
|
||||
|
||||
|
||||
@@ -250,14 +294,12 @@ public class DeskController {
|
||||
return ResponseResult.success();
|
||||
}
|
||||
|
||||
|
||||
|
||||
@GetMapping(path = "/getZoneList")
|
||||
@ApiOperation("战区列表")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "type", value = "意向区域-intent 开发区域=dev", required = false),
|
||||
})
|
||||
public ResponseResult<List<OpenAreaVO>> getZoneList(@RequestParam(value = "type",required = false)String type,
|
||||
public ResponseResult<PageInfo<ZoneVO>> getZoneList(@RequestParam(value = "type",required = false)String type,
|
||||
@RequestParam(value = "pageNumber",required = false,defaultValue = "1")Integer pageNumber,
|
||||
@RequestParam(value = "pageSize",required = false,defaultValue = "10")Integer pageSize){
|
||||
return ResponseResult.success();
|
||||
@@ -269,7 +311,7 @@ public class DeskController {
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "type", value = "意向区域-intent 开发区域=dev", required = false),
|
||||
})
|
||||
public ResponseResult<List<OpenAreaVO>> deletedZoneList(@RequestParam(value = "id",required = false)Long id){
|
||||
public ResponseResult<Boolean> deletedZoneList(@RequestParam(value = "id",required = false)Long id){
|
||||
return ResponseResult.success();
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,39 @@
|
||||
package com.cool.store.controller;
|
||||
|
||||
import com.cool.store.response.ResponseResult;
|
||||
import com.cool.store.service.RegionService;
|
||||
import com.cool.store.vo.region.RegionBaseInfoVO;
|
||||
import io.swagger.annotations.Api;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author zhangchenbiao
|
||||
* @FileName: RegionController
|
||||
* @Description:
|
||||
* @date 2023-06-12 15:53
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping({"/v1/region" })
|
||||
@Slf4j
|
||||
@Api(tags = "组织架构")
|
||||
public class RegionController {
|
||||
|
||||
@Resource
|
||||
private RegionService regionService;
|
||||
|
||||
@GetMapping("/getRegionList")
|
||||
public ResponseResult<List<RegionBaseInfoVO>> getRegionBaseInfoList(){
|
||||
List<RegionBaseInfoVO> resultList = new ArrayList<>(Arrays.asList(regionService.getRegionBaseInfoList()));
|
||||
return ResponseResult.success(resultList);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user