招商经理等
This commit is contained in:
@@ -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);
|
||||
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
|
||||
/**
|
||||
* 员工端 修改加盟商意向信息
|
||||
|
||||
@@ -61,6 +61,12 @@ public interface ZoneService {
|
||||
*/
|
||||
List<ZoneCheckVO> checkZone(IntentAreaSettingRequest intentAreaSettingRequest);
|
||||
|
||||
/**
|
||||
* 查询所有绑定战区的组织机构
|
||||
* @return
|
||||
*/
|
||||
List<String> queryAllBingZoneRegionList(String type);
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user