招商经理等

This commit is contained in:
苏竹红
2023-06-15 19:26:51 +08:00
parent d80c70deb7
commit 8a67417998
16 changed files with 226 additions and 21 deletions

View File

@@ -114,4 +114,8 @@ public class CommonConstants {
public static final String FOLLOW = "follow";
public static final String PENDING = "pending";
public static final String ALLOCATION = "allocation";
public static final String TRANSFER = "transfer";
}

View File

@@ -46,5 +46,4 @@ public class HyIntendDevZoneInfoDAO {
}

View File

@@ -48,7 +48,7 @@ public class HyPartnerIntentInfoDAO {
}
public PartnerIntentApplyInfoDTO selectByLineId(Long lineId){
public HyPartnerIntentInfoDO selectByLineId(Long lineId){
if (lineId==null){
return null;
}

View File

@@ -46,5 +46,5 @@ public interface HyPartnerIntentInfoMapper {
* @param lineId
* @return
*/
PartnerIntentApplyInfoDTO selectByLineId(@Param("lineId") Long lineId);
HyPartnerIntentInfoDO selectByLineId(@Param("lineId") Long lineId);
}

View File

@@ -279,7 +279,7 @@
order by b.create_time
</select>
<select id="selectByLineId" resultType="com.cool.store.dto.partner.PartnerIntentApplyInfoDTO">
<select id="selectByLineId" resultMap="BaseResultMap">
select
<include refid="Base_Column_List"></include>
from hy_partner_intent_info

View File

@@ -0,0 +1,18 @@
package com.cool.store.vo;
import lombok.Data;
/**
* @Author suzhuhong
* @Date 2023/6/15 14:31
* @Version 1.0
*/
@Data
public class EnterpriseUserSingleInfoVO {
private String userId;
private String userName;
private String mobile;
}

View File

@@ -22,6 +22,12 @@ public class PartnerIntentInfoVO {
@ApiModelProperty("hy_partner_user_info.partner_id")
private String partnerId;
@ApiModelProperty("加盟商姓名")
private String partnerUserName;
@ApiModelProperty("加盟商手机号")
private String partnerUserPhone;
@ApiModelProperty("hy_partner_line_info.id")
private Long partnerLineId;

View File

@@ -1,6 +1,7 @@
package com.cool.store.service;
import com.cool.store.entity.EnterpriseUserDO;
import com.cool.store.request.EnterpriseUserRequest;
import com.cool.store.vo.EnterpriseUserSingleInfoVO;
import com.cool.store.vo.buser.EnterpriseUserPageVO;
import java.util.List;
@@ -16,4 +17,12 @@ public interface EnterpriseUserService {
EnterpriseUserDO getUserInfoByUserId(String userId);
/**
*
* @param userId
* @return
*/
List<EnterpriseUserSingleInfoVO> getInvestmentManagerList(String type,String userId,String keyword);
}

View File

@@ -2,6 +2,7 @@ package com.cool.store.service;
import com.cool.store.request.BaseUserInfoRequest;
import com.cool.store.vo.PartnerIntentApplyInfoVO;
import com.cool.store.vo.PartnerIntentInfoVO;
import com.github.pagehelper.PageInfo;
/**
@@ -27,7 +28,7 @@ public interface HyPartnerIntentInfoService {
* @param lineId
* @return
*/
PartnerIntentApplyInfoVO getPartnerIntentApplyInfo(Long lineId);
PartnerIntentInfoVO getPartnerIntentApplyDetail(Long lineId);
/**
* 员工端 修改加盟商意向信息

View File

@@ -61,6 +61,12 @@ public interface ZoneService {
*/
List<ZoneCheckVO> checkZone(IntentAreaSettingRequest intentAreaSettingRequest);
/**
* 查询所有绑定战区的组织机构
* @return
*/
List<String> queryAllBingZoneRegionList(String type);
}

View File

@@ -1,11 +1,19 @@
package com.cool.store.service.impl;
import com.cool.store.constants.CommonConstants;
import com.cool.store.dao.*;
import com.cool.store.entity.*;
import com.cool.store.service.EnterpriseUserService;
import com.cool.store.service.ZoneService;
import com.cool.store.vo.EnterpriseUserSingleInfoVO;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.CollectionUtils;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.Collection;
import java.util.HashSet;
import java.util.List;
/**
* @author zhangchenbiao
@@ -22,10 +30,61 @@ public class EnterpriseUserServiceImpl implements EnterpriseUserService {
private EnterpriseUserDAO enterpriseUserDAO;
@Resource
private EnterpriseUserRoleDAO enterpriseUserRoleDAO;
@Resource
ZoneService zoneService;
@Resource
RegionDAO regionDAO;
@Resource
UserRegionMappingDAO userRegionMappingDAO;
@Override
public EnterpriseUserDO getUserInfoByUserId(String userId) {
return enterpriseUserDAO.getUserInfoById(userId);
}
@Override
public List<EnterpriseUserSingleInfoVO> getInvestmentManagerList(String type,String userId, String keyword) {
//查询当前人员信息
EnterpriseUserDO userInfo = enterpriseUserDAO.getUserInfoById(userId);
//当前登录人所在组织机构
List<String> regionIds = userRegionMappingDAO.getRegionIdsByUserId(userId);
//所有绑定了战区的组织机构
List<String> list = zoneService.queryAllBingZoneRegionList("intend");
HashSet<String> regionList = new HashSet<>();
regionIds.forEach(x->{
if (list.contains(x)){
regionList.add(x);
}
});
//分配
//如果是招商经理 只能分配给自己
//如果是负责人 分配给负责人所在战区人员
List<EnterpriseUserDO> enterpriseUserDOS = new ArrayList<>();
if (CommonConstants.ALLOCATION.equals(type)){
if (userInfo.getIsLeader()){
enterpriseUserDOS = enterpriseUserDAO.searchUserByRegionIdsAndKeyword(new ArrayList<>(regionList), keyword, Boolean.TRUE);
}
if (CollectionUtils.isNotEmpty(regionList)){
//只有招商经理本人
enterpriseUserDOS.add(userInfo);
}
}
//转交 所有的招商经理
if (CommonConstants.TRANSFER.equals(type)){
enterpriseUserDOS = enterpriseUserDAO.searchUserByRegionIdsAndKeyword(new ArrayList<>(regionList), keyword, Boolean.TRUE);
}
List<EnterpriseUserSingleInfoVO> enterpriseUserSingleInfoVOS = new ArrayList<>();
enterpriseUserDOS.forEach(x->{
EnterpriseUserSingleInfoVO enterpriseUserSingleInfoVO = new EnterpriseUserSingleInfoVO();
enterpriseUserSingleInfoVO.setUserId(x.getUserId());
enterpriseUserSingleInfoVO.setUserName(x.getName());
enterpriseUserSingleInfoVO.setMobile(x.getMobile());
enterpriseUserSingleInfoVOS.add(enterpriseUserSingleInfoVO);
});
return enterpriseUserSingleInfoVOS;
}
}

View File

@@ -1,11 +1,13 @@
package com.cool.store.service.impl;
import com.alibaba.fastjson.JSONObject;
import com.cool.store.constants.CommonConstants;
import com.cool.store.dao.HyPartnerBaseInfoDAO;
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.HyPartnerUserInfoDO;
import com.cool.store.enums.ErrorCodeEnum;
import com.cool.store.enums.WorkflowStageEnum;
@@ -13,9 +15,12 @@ import com.cool.store.enums.WorkflowStatusEnum;
import com.cool.store.exception.ServiceException;
import com.cool.store.request.BaseUserInfoRequest;
import com.cool.store.service.HyPartnerIntentInfoService;
import com.cool.store.utils.StringUtil;
import com.cool.store.vo.PartnerIntentApplyInfoVO;
import com.cool.store.vo.PartnerIntentInfoVO;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.google.common.collect.Lists;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
@@ -73,17 +78,6 @@ public class HyPartnerIntentInfoServiceImpl implements HyPartnerIntentInfoServic
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;
}
@Override
public Boolean updatePartnerIntentInfo(BaseUserInfoRequest baseUserInfoRequest) {
HyPartnerUserInfoDO hyPartnerUserInfoDO = hyPartnerUserInfoDAO.selectByPartnerId(String.valueOf(baseUserInfoRequest.getPartnerId()));
@@ -102,6 +96,17 @@ public class HyPartnerIntentInfoServiceImpl implements HyPartnerIntentInfoServic
return Boolean.TRUE;
}
@Override
public PartnerIntentInfoVO getPartnerIntentApplyDetail(Long lineId) {
HyPartnerIntentInfoDO hyPartnerIntentInfoDO= hyPartnerIntentInfoDAO.selectByLineId(lineId);
PartnerIntentInfoVO partnerIntentInfoVO = convertPartnerIntentApplyInfoDOToVO(hyPartnerIntentInfoDO);
HyPartnerUserInfoDO hyPartnerUserInfoDO = hyPartnerUserInfoDAO.selectByPartnerId(hyPartnerIntentInfoDO.getPartnerId());
partnerIntentInfoVO.setPartnerUserName(hyPartnerUserInfoDO.getUsername());
partnerIntentInfoVO.setPartnerUserPhone(hyPartnerUserInfoDO.getMobile());
//todo su 手机号归属地 意向申请区域名称
return partnerIntentInfoVO;
}
/**
* partnerIntentApplyInfoDTOToVo
* @param partnerIntentApplyInfoDTO
@@ -121,4 +126,37 @@ public class HyPartnerIntentInfoServiceImpl implements HyPartnerIntentInfoServic
}
/**
*
* @param hyPartnerIntentInfoDO
* @return
*/
private PartnerIntentInfoVO convertPartnerIntentApplyInfoDOToVO(HyPartnerIntentInfoDO hyPartnerIntentInfoDO){
PartnerIntentInfoVO partnerIntentInfoVO = new PartnerIntentInfoVO();
partnerIntentInfoVO.setId(hyPartnerIntentInfoDO.getId());
partnerIntentInfoVO.setPartnerId(hyPartnerIntentInfoDO.getPartnerId());
partnerIntentInfoVO.setPartnerLineId(hyPartnerIntentInfoDO.getPartnerLineId());
partnerIntentInfoVO.setAcceptAdjustType(hyPartnerIntentInfoDO.getAcceptAdjustType());
partnerIntentInfoVO.setLiveArea(hyPartnerIntentInfoDO.getLiveArea());
partnerIntentInfoVO.setWantShopArea(hyPartnerIntentInfoDO.getWantShopArea());
partnerIntentInfoVO.setEducation(hyPartnerIntentInfoDO.getEducation());
partnerIntentInfoVO.setMaxBudget(hyPartnerIntentInfoDO.getMaxBudget());
partnerIntentInfoVO.setBrandStrength(hyPartnerIntentInfoDO.getBrandStrength());
partnerIntentInfoVO.setIsConsumer(hyPartnerIntentInfoDO.getIsConsumer());
partnerIntentInfoVO.setIsHaveWantShop(hyPartnerIntentInfoDO.getIsHaveWantShop());
partnerIntentInfoVO.setIsHaveWorkExp(hyPartnerIntentInfoDO.getIsHaveWorkExp());
partnerIntentInfoVO.setMoneyProve(StringUtil.isEmpty(hyPartnerIntentInfoDO.getMoneyProve())?
Lists.newArrayList(): JSONObject.parseArray(hyPartnerIntentInfoDO.getMoneyProve(),String.class));
partnerIntentInfoVO.setMoneySource(hyPartnerIntentInfoDO.getMoneySource());
partnerIntentInfoVO.setWorkYear(hyPartnerIntentInfoDO.getWorkYear());
partnerIntentInfoVO.setWeakness(hyPartnerIntentInfoDO.getWeakness());
partnerIntentInfoVO.setCreateTime(hyPartnerIntentInfoDO.getCreateTime());
partnerIntentInfoVO.setOtherBand(hyPartnerIntentInfoDO.getOtherBand());
partnerIntentInfoVO.setStrength(hyPartnerIntentInfoDO.getStrength());
partnerIntentInfoVO.setNeedImprove(hyPartnerIntentInfoDO.getNeedImprove());
return partnerIntentInfoVO;
}
}

View File

@@ -201,13 +201,26 @@ public class ZoneServiceImpl implements ZoneService {
List<Long> openAreaIdList = list.stream().map(ZoneCheckDTO::getOpenAreaMappingId).collect(Collectors.toList());
List<HyOpenAreaInfoDO> hyOpenAreaInfoDOList = openAreaInfoDAO.selectByIds(openAreaIdList);
Map<Long, String> areaNameMap = hyOpenAreaInfoDOList.stream().collect(Collectors.toMap(HyOpenAreaInfoDO::getId, HyOpenAreaInfoDO::getAreaName));
List<ZoneCheckVO> reslut = new ArrayList<>();
List<ZoneCheckVO> result = new ArrayList<>();
list.forEach(x->{
ZoneCheckVO zoneCheckVO = new ZoneCheckVO();
zoneCheckVO.setZoneName(x.getZoneName());
String areaName = areaNameMap.get(x.getOpenAreaMappingId());
zoneCheckVO.setAreaName(areaName);
result.add(zoneCheckVO);
});
return reslut;
return result;
}
@Override
public List<String> queryAllBingZoneRegionList(String type) {
PageInfo<HyIntendDevZoneInfoDO> intend = hyIntendDevZoneInfoDAO.getHyIntendDevZoneInfoList(type);
List<HyIntendDevZoneInfoDO> list = intend.getList();
List<String> resultList = list.stream().filter(x->StringUtil.isNotEmpty(x.getAssociatedRegionId()))
.flatMap(HyIntendDevZoneInfoDO -> JSONObject.parseArray(HyIntendDevZoneInfoDO.getAssociatedRegionId(), String.class).stream())
.collect(Collectors.toList());
return resultList;
}
}

View File

@@ -1,7 +1,10 @@
package com.cool.store.controller;
import com.cool.store.context.CurrentUserHolder;
import com.cool.store.dto.calendar.UserCalendarsEventDTO;
import com.cool.store.enums.LineStatusEnum;
import com.cool.store.exception.ApiException;
import com.cool.store.http.ISVHttpRequest;
import com.cool.store.request.*;
import com.cool.store.response.ResponseResult;
import com.cool.store.service.*;
@@ -36,7 +39,10 @@ public class DeskController {
HyPartnerLineInfoService hyPartnerLineInfoService;
@Resource
HyPartnerBaseInfoService hyPartnerBaseInfoService;
@Resource
private ISVHttpRequest isvHttpRequest;
@Resource
EnterpriseUserService enterpriseUserService;
@GetMapping(path = "/interviewSchedule")
@@ -48,6 +54,28 @@ public class DeskController {
}
@GetMapping(path = "/getInvestmentManagerList")
@ApiOperation("招商经理")
@ApiImplicitParams({
@ApiImplicitParam(name = "type", value = "allocation-招商经理 transfer", required = false),
@ApiImplicitParam(name = "keyword", value = "keyword", required = false),
})
public ResponseResult<List<EnterpriseUserSingleInfoVO>> getInvestmentManagerList(String type,String keyword){
return ResponseResult.success(enterpriseUserService.getInvestmentManagerList(type,CurrentUserHolder.getUserId(),keyword));
}
@GetMapping(path = "/interviewSchedule")
@ApiOperation("飞书日程信息")
public ResponseResult<List<UserCalendarsEventDTO>> interviewSchedule(@RequestParam(value = "startTime",required = true) Long startTime,
@RequestParam(value = "endTime",required = true) Long endTime) throws ApiException {
String userId = CurrentUserHolder.getUserId();
return ResponseResult.success(isvHttpRequest.getUserCalendarsEvents(userId,startTime,endTime));
}
@GetMapping(path = "/queryStageCount")
@ApiOperation("招商经理视角====各阶段待处理待跟进数量")
@ApiImplicitParams({
@@ -118,8 +146,8 @@ public class DeskController {
@ApiImplicitParams({
@ApiImplicitParam(name = "lineId", value = "线索ID", required = false),
})
public ResponseResult<PartnerIntentApplyInfoVO> getPartnerIntentInfo(@RequestParam(value = "lineId",required = false)Long lineId){
return ResponseResult.success(hyPartnerIntentInfoService.getPartnerIntentApplyInfo(lineId));
public ResponseResult<PartnerIntentInfoVO> getPartnerIntentInfo(@RequestParam(value = "lineId",required = false)Long lineId){
return ResponseResult.success(hyPartnerIntentInfoService.getPartnerIntentApplyDetail(lineId));
}

View File

@@ -2,11 +2,16 @@ package com.cool.store.controller;
import com.cool.store.response.ResponseResult;
import com.cool.store.service.RegionService;
import com.cool.store.service.ZoneService;
import com.cool.store.vo.region.RegionBaseInfoVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
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.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
@@ -28,6 +33,8 @@ public class RegionController {
@Resource
private RegionService regionService;
@Resource
ZoneService zoneService;
@GetMapping("/getRegionList")
public ResponseResult<List<RegionBaseInfoVO>> getRegionBaseInfoList(){
@@ -36,4 +43,13 @@ public class RegionController {
}
@ApiOperation("查询所有被绑定战区的组织机构")
@ApiImplicitParams({
@ApiImplicitParam(name = "type", value = "intent-意向区域 development 开发区域", required = false)
})
@GetMapping("/queryAllBingZoneRegionList")
public ResponseResult<List<String>> queryAllBingZoneRegionList(@RequestParam(value = "type",required = false)String type){
return ResponseResult.success(zoneService.queryAllBingZoneRegionList(type));
}
}

View File

@@ -4,6 +4,7 @@ import com.cool.store.context.CurrentUserHolder;
import com.cool.store.request.IntentAreaSettingRequest;
import com.cool.store.response.ResponseResult;
import com.cool.store.service.ZoneService;
import com.cool.store.vo.ZoneCheckVO;
import com.cool.store.vo.ZoneVO;
import com.github.pagehelper.PageInfo;
import io.swagger.annotations.ApiImplicitParam;
@@ -13,6 +14,7 @@ import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import java.util.List;
/**
* @Author suzhuhong
@@ -32,6 +34,12 @@ public class ZoneController {
return ResponseResult.success(zoneService.addZone( CurrentUserHolder.getUserId(),intentAreaSettingRequest));
}
@PostMapping(path = "/checkZone")
@ApiOperation("校验战区")
public ResponseResult<List<ZoneCheckVO>> checkZone(@RequestBody IntentAreaSettingRequest intentAreaSettingRequest){
return ResponseResult.success(zoneService.checkZone(intentAreaSettingRequest));
}
@PostMapping(path = "/updateZone")
@ApiOperation("编辑意向战区/开发战区")
public ResponseResult<Boolean> updateZone(@RequestBody IntentAreaSettingRequest intentAreaSettingRequest){