Merge #19 into master from cc_20251223_orgChange
组织架构迁移
* cc_20251223_orgChange: (32 commits squashed)
- fix:角色枚举值变更
- fix:待办-缴纳加盟费/保证金中,删除企微督导查询权限,督导查询权限改为招商经理;待办-建店资料中,删除企微督导查询权限
- fix:开店管理-查询我负责的招商经理或运营顾问为当前用户的;查询我管辖的如果当前用户是招商经理则查招商区域
- feat:组织架构切换调整
- Merge remote-tracking branch 'origin/cc_20251223_orgChange' into cc_20251223_orgChange
- feat:门店详情新增招商所属大区 运营顾问
- fix:获取可选择的大区新增type字段
- Merge remote-tracking branch 'origin/cc_20251223_orgChange' into cc_20251223_orgChange
- feat:修改招商所属大区
- Merge remote-tracking branch 'origin/cc_20251223_orgChange' into cc_20251223_orgChange
- feat:新增分店 修改分店
- feat:operations_consultant
- fix:获取平台建店左侧小窗详情接口新增招商区域名称字段
- feat:合同开始之后需要分配才能触发后续阶段
- Merge remote-tracking branch 'origin/cc_20251223_orgChange' into cc_20251223_orgChange
- fix:新增招商区域名称字段
- Merge remote-tracking branch 'origin/cc_20251223_orgChange' into cc_20251223_orgChange
- fix:大区查询添加enableFlag字段
- Merge remote-tracking branch 'origin/cc_20251223_orgChange' into cc_20251223_orgChange
- fix:代办查询bug修改
- fix:字段缺失补充
- Merge branch 'master' into cc_20251223_orgChange
# Conflicts:
#	coolstore-partner-common/src/main/java/com/cool/store/enums/UserRoleEnum.java
#	coolstore-partner-service/src/main/java/com/cool/store/service/impl/ShopServiceImpl.java
#	coolstore-partner-web/src/main/java/com/cool/store/controller/webb/DeskController.java
- fix:修改基本资料bug
- fix:线索列表接口新增招商所属区域名称字段
- fix:加盟商资质审核通过自动建店时带出招商所属区域
- fix:补充提交
- fix:修改开店详情接口修改招商所属区域
- fix:工作台待办返回招商区域名称字段
- fix:开店详情接口招商所属区域id为0的数据返回null
- fix:字段补充
- fix:招商所属大区字段补充
- fix:字段补充
Signed-off-by: 王非凡 <accounts_67eba0c5fee9c49c80c8e2b4@mail.teambition.com>
Reviewed-by: 苏竹红 <570057076@qq.com>
Merged-by: 苏竹红 <570057076@qq.com>
CR-link: https://codeup.aliyun.com/692ea314dec569489f6f167c/hangzhou/java/custom_zxjp/change/19
This commit is contained in:
@@ -21,11 +21,11 @@ public interface BigRegionService {
|
||||
* @param keyword 关键字
|
||||
* @return
|
||||
*/
|
||||
List<BigRegionDTO> queryAllBigRegion(String keyword, Integer joinBrand);
|
||||
List<BigRegionDTO> queryAllBigRegion(String keyword, Integer joinBrand,Integer type);
|
||||
|
||||
/**
|
||||
* 根据门店所属大区和加盟模式查询新管家对应组织信息
|
||||
* 注意 加盟模式费门店加盟模式 而是针对加盟自有店 如果是加盟自有店 则传1 其他店传1
|
||||
* 注意 加盟模式费门店加盟模式 而是针对加盟自有店 如果是加盟自有店 则传1 其他店传0
|
||||
* @param regionId
|
||||
* @param joinMode
|
||||
* @return
|
||||
|
||||
@@ -5,6 +5,7 @@ import com.cool.store.dto.InvestmentCountDTO;
|
||||
import com.cool.store.dto.PendingCountDTO;
|
||||
import com.cool.store.entity.HyPartnerLabelDO;
|
||||
import com.cool.store.entity.LineInfoDO;
|
||||
import com.cool.store.request.AssignPendingRequest;
|
||||
import com.cool.store.request.BusinessRemarkRequest;
|
||||
import com.cool.store.request.DeskRequest;
|
||||
import com.cool.store.vo.BaseInfoVO;
|
||||
@@ -209,4 +210,12 @@ public interface DeskService {
|
||||
*/
|
||||
PageInfo<PreparationCommonPendingVO> posEntryListPendingList(DeskRequest deskRequest, LoginUserInfo user );
|
||||
|
||||
/**
|
||||
* 查询运营顾问待分配门店信息
|
||||
* @param request
|
||||
* @param user
|
||||
* @return
|
||||
*/
|
||||
PageInfo<OperationsConsultantAssignVO> assignPendingList(AssignPendingRequest request,LoginUserInfo user);
|
||||
|
||||
}
|
||||
|
||||
@@ -1,10 +1,7 @@
|
||||
package com.cool.store.service;
|
||||
|
||||
import com.cool.store.context.LoginUserInfo;
|
||||
import com.cool.store.request.AddSignFranchiseRequest;
|
||||
import com.cool.store.request.AuditApproveRequest;
|
||||
import com.cool.store.request.AuditResultRequest;
|
||||
import com.cool.store.request.HqtBuildRequest;
|
||||
import com.cool.store.request.*;
|
||||
import com.cool.store.response.AddSignFranchiseResponse;
|
||||
import com.cool.store.response.ResponseResult;
|
||||
|
||||
@@ -54,4 +51,11 @@ public interface SignFranchiseService {
|
||||
Integer dateHandle();
|
||||
|
||||
HqtBuildRequest getHqtBuildRequest(Long shopId);
|
||||
|
||||
/**
|
||||
* 分配运营顾问
|
||||
* @param request
|
||||
* @return
|
||||
*/
|
||||
Boolean assignOperationConsultant(AssignOperationConsultantRequest request);
|
||||
}
|
||||
|
||||
@@ -34,6 +34,13 @@ public interface UserAuthMappingService {
|
||||
*/
|
||||
List<String> getAuthRegionIdAndSubRegionIdByUserId(String userId);
|
||||
|
||||
/**
|
||||
* 获取所有管辖下的区域ID 不包含门店
|
||||
* @param userId
|
||||
* @return
|
||||
*/
|
||||
List<String> getAuthRegionIdByUserId(String userId);
|
||||
|
||||
/**
|
||||
* 获取用户授权的所有门店id
|
||||
*
|
||||
|
||||
@@ -25,8 +25,8 @@ public class BigRegionServiceImpl implements BigRegionService {
|
||||
BigRegionDAO bigRegionDAO;
|
||||
|
||||
@Override
|
||||
public List<BigRegionDTO> queryAllBigRegion(String keyword, Integer joinBrand){
|
||||
return bigRegionDAO.queryAllBigRegion(keyword, joinBrand);
|
||||
public List<BigRegionDTO> queryAllBigRegion(String keyword, Integer joinBrand,Integer type) {
|
||||
return bigRegionDAO.queryAllBigRegion(keyword, joinBrand,type);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -1170,7 +1170,7 @@ public class DataHandlerServerImpl implements DataHandlerServer {
|
||||
shopInfoDO.setManagerRegionId(isCreateStoreDTO.getPid());
|
||||
updateList.add(shopInfoDO);
|
||||
}
|
||||
List<BigRegionDTO> bigRegionDTOS = bigRegionDAO.queryAllBigRegion(null, null);
|
||||
List<BigRegionDTO> bigRegionDTOS = bigRegionDAO.queryAllBigRegion(null, null,null);
|
||||
Map<Long, BigRegionDTO> bigRegionDTOMap = bigRegionDTOS.stream().collect(Collectors.toMap(BigRegionDTO::getRegionId, x -> x));
|
||||
//XX大区 正烧鸡
|
||||
List<Long> storeManageIds = bigRegionDTOS.stream().filter(x -> x.getStoreManageRegionId() != null).map(BigRegionDTO::getStoreManageRegionId).collect(Collectors.toList());
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
package com.cool.store.service.impl;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import com.cool.store.context.LoginUserInfo;
|
||||
import com.cool.store.dao.*;
|
||||
import com.cool.store.dto.DeskStageDTO;
|
||||
@@ -19,20 +18,19 @@ import com.cool.store.exception.ServiceException;
|
||||
import com.cool.store.mapper.EnterpriseUserRoleMapper;
|
||||
import com.cool.store.mapper.IntentAgreementMapper;
|
||||
import com.cool.store.mapper.TrainingExperienceMapper;
|
||||
import com.cool.store.request.AssignPendingRequest;
|
||||
import com.cool.store.request.BusinessRemarkRequest;
|
||||
import com.cool.store.request.DeskRequest;
|
||||
import com.cool.store.service.DeskService;
|
||||
import com.cool.store.service.RegionService;
|
||||
import com.cool.store.service.SysRoleService;
|
||||
import com.cool.store.service.UserAuthMappingService;
|
||||
import com.cool.store.utils.BeanUtil;
|
||||
import com.cool.store.utils.StringUtil;
|
||||
import com.cool.store.utils.poi.DateUtils;
|
||||
import com.cool.store.vo.BaseInfoVO;
|
||||
import com.cool.store.vo.LabelBaseInfoVO;
|
||||
import com.cool.store.vo.desk.IntendPendingVO;
|
||||
import com.cool.store.vo.desk.PayStagePendingVO;
|
||||
import com.cool.store.vo.desk.PreparationCommonPendingVO;
|
||||
import com.cool.store.vo.desk.SigningPendingVO;
|
||||
import com.cool.store.vo.desk.*;
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
@@ -43,6 +41,7 @@ import javax.annotation.Resource;
|
||||
import java.util.*;
|
||||
import java.util.function.Function;
|
||||
import java.util.stream.Collectors;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
import static com.cool.store.enums.WorkflowSubStageStatusEnum.INTENT_5;
|
||||
import static com.cool.store.enums.point.ShopSubStageStatusEnum.*;
|
||||
@@ -101,6 +100,10 @@ public class DeskServiceImpl implements DeskService {
|
||||
private ShopStageRemarkInfoDAO shopStageRemarkInfoDAO;
|
||||
@Resource
|
||||
ShopAccountDAO shopAccountDAO;
|
||||
@Resource
|
||||
OperationsConsultantAssignDAO operationsConsultantAssignDAO;
|
||||
@Resource
|
||||
private RegionDao regionDao;
|
||||
|
||||
@Override
|
||||
public PageInfo<IntendPendingVO> intendPendingList(Integer pageNum, Integer pageSize, String userId, String keyword) {
|
||||
@@ -263,8 +266,8 @@ public class DeskServiceImpl implements DeskService {
|
||||
PageInfo<PreparationCommonPendingVO> pageInfo = new PageInfo<>();
|
||||
List<Integer> subStageStatusList = new ArrayList<>();
|
||||
if (CollectionUtils.isNotEmpty(userRoleIds)) {
|
||||
//督导代填
|
||||
if (userRoleIds.contains(UserRoleEnum.QW_SUPERVISION.getCode()) || userRoleIds.contains(UserRoleEnum.SUPERVISION.getCode())) {
|
||||
// 招商经理代填
|
||||
if (userRoleIds.contains(UserRoleEnum.INVESTMENT_MANGER.getCode())) {
|
||||
pageInfo = commonPendingVOPageInfo(deskRequest, user, ShopSubStageEnum.SHOP_STAGE_7,
|
||||
Arrays.asList(SHOP_SUB_STAGE_STATUS_71.getShopSubStageStatus(), SHOP_SUB_STAGE_STATUS_72.getShopSubStageStatus()), Boolean.FALSE);
|
||||
} else {
|
||||
@@ -499,7 +502,7 @@ public class DeskServiceImpl implements DeskService {
|
||||
@Override
|
||||
public PageInfo<PreparationCommonPendingVO> buildInformationPendingList(DeskRequest deskRequest, LoginUserInfo user) {
|
||||
List<Long> userRoleIds = enterpriseUserRoleMapper.getUserRoleIds(user.getUserId());
|
||||
if (userRoleIds.contains(UserRoleEnum.QW_SUPERVISION.getCode()) || userRoleIds.contains(UserRoleEnum.SUPERVISION.getCode())) {
|
||||
if (userRoleIds.contains(UserRoleEnum.SUPERVISION.getCode())) {
|
||||
return commonPendingVOPageInfo(deskRequest, user, ShopSubStageEnum.SHOP_STAGE_15,
|
||||
Collections.singletonList(SHOP_SUB_STAGE_STATUS_150.getShopSubStageStatus()), Boolean.FALSE);
|
||||
}
|
||||
@@ -678,7 +681,7 @@ public class DeskServiceImpl implements DeskService {
|
||||
Set<String> investmentUserIds = shopInfoList.stream().map(ShopInfoDO::getInvestmentManager).collect(Collectors.toSet());
|
||||
List<PointInfoDO> pointListByIds = pointInfoDAO.getPointListByIds(pointId);
|
||||
Map<Long, PointInfoDO> pointMap = pointListByIds.stream().collect(Collectors.toMap(PointInfoDO::getId, Function.identity()));
|
||||
List<Long> regionIds = shopInfoList.stream().map(ShopInfoDO::getRegionId).distinct().collect(Collectors.toList());
|
||||
List<Long> regionIds = shopInfoList.stream().flatMap(v -> Stream.of(v.getRegionId(), v.getInvestRegionId())).distinct().collect(Collectors.toList());
|
||||
List<String> developmentManagers = shopInfoList.stream().filter(x -> StringUtil.isNotEmpty(x.getShopManagerUserId())).map(ShopInfoDO::getShopManagerUserId).distinct().collect(Collectors.toList());
|
||||
Set< String> userIds=new HashSet<>();
|
||||
userIds.addAll(investmentUserIds);
|
||||
@@ -717,12 +720,76 @@ public class DeskServiceImpl implements DeskService {
|
||||
preparationCommonPendingVO.setShopManagerUserName(userNameMap.getOrDefault(shopInfoDO.getShopManagerUserId(), ""));
|
||||
preparationCommonPendingVO.setRegionNodeName(regionNameMap.getOrDefault(shopInfoDO.getRegionId(), ""));
|
||||
preparationCommonPendingVO.setFranchiseBrand(shopInfoDO.getFranchiseBrand());
|
||||
preparationCommonPendingVO.setInvestRegionId(shopInfoDO.getInvestRegionId());
|
||||
preparationCommonPendingVO.setInvestRegionName(regionNameMap.get(shopInfoDO.getInvestRegionId()));
|
||||
list.add(preparationCommonPendingVO);
|
||||
});
|
||||
result.setList(list);
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageInfo<OperationsConsultantAssignVO> assignPendingList(AssignPendingRequest request,LoginUserInfo user) {
|
||||
//查询管辖范围内的数据
|
||||
List<String> authRegionIds = new ArrayList<>();
|
||||
if (!sysRoleService.checkIsAdmin(user.getUserId())) {
|
||||
authRegionIds = userAuthMappingService.getAuthRegionIdByUserId(user.getUserId());
|
||||
}
|
||||
PageHelper.startPage(request.getPageNum(), request.getPageSize());
|
||||
List<OperationsConsultantAssignDO> noAssignList = operationsConsultantAssignDAO.getNoAssign(request.getKeyword(), authRegionIds);
|
||||
if (CollectionUtils.isEmpty(noAssignList)) {
|
||||
return new PageInfo<>();
|
||||
}
|
||||
PageInfo<OperationsConsultantAssignDO> operationsConsultantAssignDOPageInfo = new PageInfo<>(noAssignList);
|
||||
PageInfo<OperationsConsultantAssignVO> page = BeanUtil.toPage(operationsConsultantAssignDOPageInfo, OperationsConsultantAssignVO.class);
|
||||
List<Long> shopIdList = noAssignList.stream().map(OperationsConsultantAssignDO::getShopId).collect(Collectors.toList());
|
||||
List<ShopInfoDO> shopList = shopInfoDAO.getShopListByIds(shopIdList);
|
||||
Map<Long, ShopInfoDO> shopInfoDOMap = shopList.stream().collect(Collectors.toMap(ShopInfoDO::getId, data -> data));
|
||||
Set<Long> regionIdList = shopList.stream().map(ShopInfoDO::getRegionId).collect(Collectors.toSet());
|
||||
regionIdList.addAll(shopList.stream().map(ShopInfoDO::getInvestRegionId).collect(Collectors.toSet()));
|
||||
|
||||
Map<Long, String> regionNameMap = regionDao.getRegionNameMap(new ArrayList<>(regionIdList));
|
||||
|
||||
Set<String> userIds = shopList.stream().map(ShopInfoDO::getInvestmentManager).collect(Collectors.toSet());
|
||||
|
||||
Map<String, String> userNameMap = enterpriseUserDAO.getUserNameMap(new ArrayList<>(userIds));
|
||||
|
||||
List<Long> lineIds = shopList.stream().map(ShopInfoDO::getLineId).collect(Collectors.toList());
|
||||
List<PlanLineDTO> lines = lineInfoDAO.getLines(lineIds);
|
||||
Map<Long, PlanLineDTO> lineMap = lines.stream().collect(Collectors.toMap(PlanLineDTO::getLineId, line -> line));
|
||||
|
||||
List<SignFranchiseDO> signTypeList = signFranchiseDAO.getSignType(shopIdList);
|
||||
Map<Long, Integer> signTypoMap = signTypeList.stream().collect(Collectors.toMap(SignFranchiseDO::getShopId, SignFranchiseDO::getSignType));
|
||||
|
||||
List<OperationsConsultantAssignVO> list = new ArrayList<>();
|
||||
|
||||
noAssignList.forEach(x -> {
|
||||
OperationsConsultantAssignVO operationsConsultantAssignVO = new OperationsConsultantAssignVO();
|
||||
operationsConsultantAssignVO.setShopId(x.getShopId());
|
||||
operationsConsultantAssignVO.setId(x.getId());
|
||||
ShopInfoDO shopInfoDO = shopInfoDOMap.get(x.getShopId());
|
||||
operationsConsultantAssignVO.setShopId(x.getShopId());
|
||||
operationsConsultantAssignVO.setShopName(shopInfoDO.getShopName());
|
||||
operationsConsultantAssignVO.setShopCode(shopInfoDO.getShopCode());
|
||||
operationsConsultantAssignVO.setJoinMode(shopInfoDO.getJoinMode());
|
||||
operationsConsultantAssignVO.setStoreType(shopInfoDO.getStoreType());
|
||||
operationsConsultantAssignVO.setSignType(signTypoMap.get(x.getShopId()));
|
||||
operationsConsultantAssignVO.setRegionId(shopInfoDO.getRegionId());
|
||||
operationsConsultantAssignVO.setRegionName(regionNameMap.get(shopInfoDO.getRegionId()));
|
||||
operationsConsultantAssignVO.setInvestmentManager(shopInfoDO.getInvestmentManager());
|
||||
operationsConsultantAssignVO.setInvestmentManagerName(userNameMap.get(shopInfoDO.getInvestmentManager()));
|
||||
operationsConsultantAssignVO.setInvestRegionId(shopInfoDO.getInvestRegionId());
|
||||
operationsConsultantAssignVO.setInvestRegionName(regionNameMap.get(shopInfoDO.getInvestRegionId()));
|
||||
PlanLineDTO lineDTO = lineMap.getOrDefault(shopInfoDO.getLineId(), new PlanLineDTO());
|
||||
operationsConsultantAssignVO.setPartnerName(lineDTO.getUsername());
|
||||
operationsConsultantAssignVO.setPartnerPhone(lineDTO.getMobile());
|
||||
operationsConsultantAssignVO.setShopAddress(shopInfoDO.getDetailAddress());
|
||||
list.add(operationsConsultantAssignVO);
|
||||
});
|
||||
page.setList(list);
|
||||
return page;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 通用查询
|
||||
@@ -772,7 +839,7 @@ public class DeskServiceImpl implements DeskService {
|
||||
Set<String> investmentUserIds = shopInfoList.stream().map(ShopInfoDO::getInvestmentManager).collect(Collectors.toSet());
|
||||
List<PointInfoDO> pointListByIds = pointInfoDAO.getPointListByIds(pointId);
|
||||
Map<Long, PointInfoDO> pointMap = pointListByIds.stream().collect(Collectors.toMap(PointInfoDO::getId, Function.identity()));
|
||||
List<Long> regionIds = shopInfoList.stream().map(ShopInfoDO::getRegionId).distinct().collect(Collectors.toList());
|
||||
List<Long> regionIds = shopInfoList.stream().flatMap(v -> Stream.of(v.getRegionId(), v.getInvestRegionId())).distinct().collect(Collectors.toList());
|
||||
List<String> developmentManagers = shopInfoList.stream().filter(x -> StringUtil.isNotEmpty(x.getShopManagerUserId())).map(ShopInfoDO::getShopManagerUserId).distinct().collect(Collectors.toList());
|
||||
Set< String> userIds=new HashSet<>();
|
||||
userIds.addAll(investmentUserIds);
|
||||
@@ -819,6 +886,8 @@ public class DeskServiceImpl implements DeskService {
|
||||
preparationCommonPendingVO.setRegionNodeName(regionNameMap.getOrDefault(shopInfoDO.getRegionId(), ""));
|
||||
preparationCommonPendingVO.setUpdateTime(x.getUpdateTime());
|
||||
preparationCommonPendingVO.setFranchiseBrand(shopInfoDO.getFranchiseBrand());
|
||||
preparationCommonPendingVO.setInvestRegionId(shopInfoDO.getInvestRegionId());
|
||||
preparationCommonPendingVO.setInvestRegionName(regionNameMap.get(shopInfoDO.getInvestRegionId()));
|
||||
list.add(preparationCommonPendingVO);
|
||||
});
|
||||
result.setList(list);
|
||||
|
||||
@@ -32,6 +32,7 @@ import javax.annotation.Resource;
|
||||
import java.text.MessageFormat;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
/**
|
||||
* @Author suzhuhong
|
||||
@@ -148,9 +149,11 @@ public class LineServiceImpl implements LineService {
|
||||
// }
|
||||
if (lineInfo.getRegionId() != null && lineInfo.getRegionId() != 0) {
|
||||
Long bigRegionIdByAreaId = regionService.getBigRegionIdByAreaId(lineInfo.getWantShopAreaId());
|
||||
Map<Long, String> regionNameMap = regionDao.getRegionNameMap(Arrays.asList(bigRegionIdByAreaId, lineInfo.getRegionId()));
|
||||
Map<Long, String> regionNameMap = regionDao.getRegionNameMap(Arrays.asList(bigRegionIdByAreaId, lineInfo.getRegionId(),lineInfo.getInvestRegionId()));
|
||||
result.setRegionId(lineInfo.getRegionId());
|
||||
result.setRegionName(regionNameMap.get(lineInfo.getRegionId()));
|
||||
result.setInvestRegionId(lineInfo.getInvestRegionId());
|
||||
result.setInvestRegionName(regionNameMap.get(lineInfo.getInvestRegionId()));
|
||||
}
|
||||
LineAuditInfoDO lineAuditInfoDO = lineAuditInfoDAO.getAuditInfoByLineId(lineInfo.getId());
|
||||
if (lineAuditInfoDO != null) {
|
||||
@@ -221,7 +224,7 @@ public class LineServiceImpl implements LineService {
|
||||
List<String> userIds = lineInfoDOS.stream().filter(lineInfoDO -> lineInfoDO.getInvestmentManager() != null).map(LineInfoDO::getInvestmentManager).collect(Collectors.toList());
|
||||
userIds.addAll(lineInfoDOS.stream().filter(lineInfoDO -> lineInfoDO.getUpdateUserId() != null).map(LineInfoDO::getUpdateUserId).collect(Collectors.toList()));
|
||||
Map<String, String> userNameMap = enterpriseUserDAO.getUserNameMap(userIds);
|
||||
List<Long> regionIds = lineInfoDOS.stream().filter(x -> x.getRegionId() != null).map(LineInfoDO::getRegionId).collect(Collectors.toList());
|
||||
List<Long> regionIds = lineInfoDOS.stream().filter(x -> x.getRegionId() != null).flatMap(x -> Stream.of(x.getRegionId(), x.getInvestRegionId())).collect(Collectors.toList());
|
||||
Map<Long, String> regionNameMap = regionDao.getRegionNameMap(regionIds);
|
||||
List<LineListVO> result = new ArrayList<>();
|
||||
lineInfoDOS.forEach(x -> {
|
||||
@@ -229,6 +232,7 @@ public class LineServiceImpl implements LineService {
|
||||
LineListVO lineListVO = new LineListVO(baseInfoVO);
|
||||
if (regionNameMap != null) {
|
||||
lineListVO.setRegionName(regionNameMap.get(x.getRegionId()));
|
||||
lineListVO.setInvestRegionName(regionNameMap.get(x.getInvestRegionId()));
|
||||
}
|
||||
lineListVO.setCreateTime(DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD_HH_MM_SS, x.getCreateTime()));
|
||||
lineListVO.setUpdateTime(DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD_HH_MM_SS, x.getUpdateTime()));
|
||||
@@ -438,6 +442,7 @@ public class LineServiceImpl implements LineService {
|
||||
lineInfo.setJoinMode(updateLineRequest.getJoinMode());
|
||||
lineInfo.setRegionId(updateLineRequest.getRegionId());
|
||||
lineInfo.setWantShopAreaId(updateLineRequest.getWantShopAreaId());
|
||||
lineInfo.setInvestRegionId(updateLineRequest.getInvestRegionId());
|
||||
lineInfo.setUsername(updateLineRequest.getLineName());
|
||||
lineInfo.setUpdateTime(new Date());
|
||||
lineInfo.setUpdateUserId(userInfo.getUserId());
|
||||
@@ -452,7 +457,7 @@ public class LineServiceImpl implements LineService {
|
||||
throw new ServiceException(ErrorCodeEnum.PARAMS_REQUIRED);
|
||||
}
|
||||
//批量更新线索
|
||||
lineInfoDAO.batchUpdateInvestmentManager(request.getLineIds(), LineStatusEnum.PRIVATE_SEAS.getCode(), request.getInvestmentManagerId(), request.getRegionId());
|
||||
lineInfoDAO.batchUpdateInvestmentManager(request.getLineIds(), LineStatusEnum.PRIVATE_SEAS.getCode(), request.getInvestmentManagerId(), request.getRegionId(),request.getInvestRegionId());
|
||||
return Boolean.TRUE;
|
||||
}
|
||||
|
||||
@@ -542,10 +547,7 @@ public class LineServiceImpl implements LineService {
|
||||
lineInfoDO.setUsername(addLineRequest.getUserName());
|
||||
lineInfoDO.setLineSource(Integer.valueOf(UserChannelEnum.ADD.getCode()));
|
||||
lineInfoDO.setPartnerId(hyPartnerUserInfoDO.getPartnerId());
|
||||
// if (addLineRequest.getJoinMode()==1){
|
||||
// Long regionId = regionAreaConfigDao.getByWantShopAreaId(addLineRequest.getWantShopAreaId());
|
||||
// lineInfoDO.setRegionId(regionId);
|
||||
// }
|
||||
lineInfoDO.setInvestRegionId(addLineRequest.getInvestRegionId());
|
||||
lineInfoDO.setRegionId(addLineRequest.getRegionId());
|
||||
lineInfoDO.setInvestmentManager(getInvestmentManagerUserId(addLineRequest, userInfo));
|
||||
lineInfoDO.setCreateUserId(userInfo.getUserId());
|
||||
|
||||
@@ -276,7 +276,7 @@ public class PlatformBuildServiceImpl implements PlatformBuildService {
|
||||
LineInfoDO lineInfo = lineInfoDAO.getLineInfo(shopInfo.getLineId());
|
||||
List<ScheduleDTO> shopContractActualCompletionTime = shopStageInfoDAO.getPlatformBuildList(Collections.singletonList(shopId));
|
||||
PlatformBuildInfoVO platformBuildInfoVO = new PlatformBuildInfoVO();
|
||||
Map<Long, String> regionNameMap = regionService.getBelongWarRegionNameMap(Collections.singletonList(shopInfo.getRegionId()));
|
||||
Map<Long, String> regionNameMap = regionService.getBelongWarRegionNameMap(Arrays.asList(shopInfo.getRegionId(), shopInfo.getInvestRegionId()));
|
||||
String investmentManager = enterpriseUserDAO.getUserName(lineInfo.getInvestmentManager());
|
||||
PointInfoDO pointInfoDO = pointInfoDAO.getPointInfoById(shopInfo.getPointId());
|
||||
platformBuildInfoVO.setShopId(shopId);
|
||||
@@ -299,6 +299,7 @@ public class PlatformBuildServiceImpl implements PlatformBuildService {
|
||||
|
||||
}
|
||||
platformBuildInfoVO.setInvestmentManagerName(investmentManager);
|
||||
platformBuildInfoVO.setInvestRegionName(regionNameMap.get(shopInfo.getInvestRegionId()));
|
||||
return platformBuildInfoVO;
|
||||
}
|
||||
|
||||
|
||||
@@ -5,15 +5,14 @@ import com.cool.store.constants.CommonConstants;
|
||||
import com.cool.store.dao.*;
|
||||
import com.cool.store.dto.Preparation.PreparationDTO;
|
||||
import com.cool.store.dto.Preparation.ScheduleDTO;
|
||||
import com.cool.store.dto.RegionNode;
|
||||
import com.cool.store.dto.ShopNameAndCodeDTO;
|
||||
import com.cool.store.dto.UserDTO;
|
||||
import com.cool.store.dto.openPreparation.PlanLineDTO;
|
||||
import com.cool.store.entity.*;
|
||||
import com.cool.store.enums.*;
|
||||
import com.cool.store.enums.point.*;
|
||||
import com.cool.store.enums.point.ShopStatusEnum;
|
||||
import com.cool.store.exception.ServiceException;
|
||||
import com.cool.store.mapper.EnterpriseUserRoleMapper;
|
||||
import com.cool.store.mapper.RegionMapper;
|
||||
import com.cool.store.request.*;
|
||||
import com.cool.store.response.BranchShopDetailResponse;
|
||||
@@ -25,13 +24,11 @@ import com.cool.store.utils.NumberConverter;
|
||||
import com.cool.store.utils.RandomEightCharCodeUtils;
|
||||
import com.cool.store.utils.poi.DateUtils;
|
||||
import com.cool.store.utils.poi.StringUtils;
|
||||
import com.cool.store.vo.BaseInfoVO;
|
||||
import com.cool.store.vo.shop.MiniShopPageVO;
|
||||
import com.cool.store.vo.shop.ShopStageInfoVO;
|
||||
import com.cool.store.vo.shop.StageShopCountVO;
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import com.google.common.collect.Lists;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.apache.commons.collections4.ListUtils;
|
||||
@@ -41,10 +38,10 @@ import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.time.LocalDate;
|
||||
import java.util.*;
|
||||
import java.util.function.Function;
|
||||
import java.util.stream.Collectors;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
import static com.cool.store.enums.ErrorCodeEnum.*;
|
||||
import static com.cool.store.enums.UserRoleEnum.*;
|
||||
@@ -113,6 +110,8 @@ public class ShopServiceImpl implements ShopService {
|
||||
@Resource
|
||||
EnterpriseService enterpriseService;
|
||||
@Resource
|
||||
EnterpriseUserRoleMapper enterpriseUserRoleMapper;
|
||||
@Resource
|
||||
ShopAccountService shopAccountService;
|
||||
@Resource
|
||||
PushService pushService;
|
||||
@@ -146,6 +145,7 @@ public class ShopServiceImpl implements ShopService {
|
||||
shopInfo.setShopName("店铺" + NumberConverter.convertArabicToChinese(i + 1));
|
||||
shopInfo.setCreateTime(new Date());
|
||||
shopInfo.setInvestmentManager(lineInfo.getInvestmentManager());
|
||||
shopInfo.setInvestRegionId(lineInfo.getInvestRegionId());
|
||||
addShopList.add(shopInfo);
|
||||
}
|
||||
shopInfoDAO.batchAddShop(addShopList);
|
||||
@@ -201,7 +201,7 @@ public class ShopServiceImpl implements ShopService {
|
||||
Map<Long, ScheduleDTO> scheduleMap = scheduleList.stream().collect(Collectors.toMap(ScheduleDTO::getShopId, x -> x));
|
||||
List<ShopStageInfoDO> subStageList = shopStageInfoDAO.getSubStageList(shopIds, ShopSubStageEnum.SHOP_STAGE_8.getShopSubStage());
|
||||
Map<Long, ShopStageInfoDO> stageMap = subStageList.stream().collect(Collectors.toMap(ShopStageInfoDO::getShopId, Function.identity()));
|
||||
List<Long> regionIds = shopList.stream().map(ShopInfoDO::getRegionId).collect(Collectors.toList());
|
||||
List<Long> regionIds = shopList.stream().flatMap(v -> Stream.of(v.getRegionId(), v.getInvestRegionId())).collect(Collectors.toList());
|
||||
regionIds.addAll(Optional.of(shopList).orElse(Collections.emptyList()).stream().map(ShopInfoDO::getManagerRegionId).collect(Collectors.toList()));
|
||||
Map<Long, String> regionNameMap = regionDao.getRegionNameMap(regionIds);
|
||||
List<String> investmentManagerIds = shopList.stream().map(ShopInfoDO::getInvestmentManager).collect(Collectors.toList());
|
||||
@@ -400,16 +400,15 @@ public class ShopServiceImpl implements ShopService {
|
||||
if (Objects.isNull(lineInfo)) {
|
||||
throw new ServiceException(ErrorCodeEnum.LINE_ID_IS_NOT_EXIST);
|
||||
}
|
||||
EnterpriseUserDO invest = enterpriseUserDAO.getUserInfoById(shopInfo.getInvestmentManager());
|
||||
Map<String, String> userNameMap = enterpriseUserDAO.getUserNameMap(Arrays.asList(shopInfo.getInvestmentManager(), shopInfo.getOperationsConsultant()));
|
||||
List<ScheduleDTO> shopContractActualCompletionTime = shopStageInfoDAO.getScheduleList(Collections.singletonList(shopId));
|
||||
RegionDO shopRegion = regionDao.getRegionById(shopInfo.getRegionId());
|
||||
RegionDO mapperRegionByRegionId = regionDao.getRegionById(shopInfo.getManagerRegionId());
|
||||
String wantShopArea = hyOpenAreaInfoDAO.selectNameMapById(shopInfo.getWantShopAreaId());
|
||||
List<RegionDO> allRegionByRegionIds = regionDao.getAllRegionByRegionIds(Arrays.asList(shopInfo.getRegionId(), shopInfo.getManagerRegionId(), shopInfo.getInvestRegionId()));
|
||||
Map<Long, RegionDO> regionMap = allRegionByRegionIds.stream().collect(Collectors.toMap(RegionDO::getId, data -> data));
|
||||
HyOpenAreaInfoDO hyOpenAreaInfoDO = hyOpenAreaInfoDAO.selectById(shopInfo.getWantShopAreaId());
|
||||
BranchShopDetailResponse response = new BranchShopDetailResponse();
|
||||
response.setManagerRegionId(shopInfo.getManagerRegionId());
|
||||
if (Objects.nonNull(mapperRegionByRegionId)) {
|
||||
response.setManagerRegionName(mapperRegionByRegionId.getName());
|
||||
if (shopInfo.getManagerRegionId()!=null) {
|
||||
response.setManagerRegionName(regionMap.getOrDefault(shopInfo.getManagerRegionId(),new RegionDO()).getName());
|
||||
}
|
||||
response.setUsername(lineInfo.getUsername());
|
||||
response.setMobile(lineInfo.getMobile());
|
||||
@@ -428,12 +427,22 @@ public class ShopServiceImpl implements ShopService {
|
||||
response.setPlanCompletionTime(scheduleDTO.getPlanCompleteTime());
|
||||
}
|
||||
response.setInvestmentManagerId(shopInfo.getInvestmentManager());
|
||||
response.setInvestmentManagerName(invest.getName());
|
||||
response.setInvestmentManagerName(userNameMap.get(shopInfo.getInvestmentManager()));
|
||||
response.setOperationsConsultant(shopInfo.getOperationsConsultant());
|
||||
response.setOperationsConsultantName(userNameMap.get(shopInfo.getOperationsConsultant()));
|
||||
response.setInvestRegionId(Long.valueOf(0).equals(shopInfo.getInvestRegionId()) ? null : shopInfo.getInvestRegionId());
|
||||
if (shopInfo.getInvestRegionId() != null) {
|
||||
response.setInvestRegionName(regionMap.getOrDefault(shopInfo.getInvestRegionId(),new RegionDO()).getName());
|
||||
}
|
||||
response.setRegionId(shopInfo.getRegionId());
|
||||
if (shopInfo.getRegionId()!=null){
|
||||
response.setRegionName(regionMap.getOrDefault(shopInfo.getRegionId(),new RegionDO()).getName());
|
||||
}
|
||||
response.setWantRegionId(shopInfo.getWantShopAreaId());
|
||||
response.setRegionName(shopRegion.getName());
|
||||
response.setWantRegionName(wantShopArea);
|
||||
response.setWantRegionParentId(hyOpenAreaInfoDO.getParentId());
|
||||
if (hyOpenAreaInfoDO != null) {
|
||||
response.setWantRegionName(hyOpenAreaInfoDO.getAreaName());
|
||||
response.setWantRegionParentId(hyOpenAreaInfoDO.getParentId());
|
||||
}
|
||||
response.setPointId(shopInfo.getPointId());
|
||||
return response;
|
||||
}
|
||||
@@ -467,8 +476,9 @@ public class ShopServiceImpl implements ShopService {
|
||||
shopInfo.setFranchiseBrand(request.getFranchiseBrand());
|
||||
shopInfo.setStoreType(request.getStoreType());
|
||||
shopInfo.setManagerRegionId(request.getManagerRegionId());
|
||||
shopInfo.setInvestRegionId(request.getInvestRegionId());
|
||||
Integer f = shopInfoDAO.updateShopInfo(shopInfo);
|
||||
if (StringUtils.compare(request.getShopCode().trim(), oldShopCode) != 0) {
|
||||
if (StringUtils.isNotBlank(request.getShopCode()) && StringUtils.compare(request.getShopCode().trim(), oldShopCode) != 0) {
|
||||
try {
|
||||
log.info("门店编码发生修改,推送新管家");
|
||||
ZxjpApiRequest data = shopAccountService.getData(request.getShopId(), DownSystemTypeEnum.XGJ);
|
||||
@@ -530,12 +540,20 @@ public class ShopServiceImpl implements ShopService {
|
||||
|
||||
@Override
|
||||
public PageInfo<BranchShopResponse> getBranchShopList(BranchShopRequest request, String userId) {
|
||||
// 2为我管辖的
|
||||
if (request.getFlag().equals(CommonConstants.TWO)) {
|
||||
if (!sysRoleService.checkIsAdmin(userId)) {
|
||||
request.setAuthRegionIds(userAuthMappingService.getAuthRegionIdAndSubRegionIdByUserId(userId));
|
||||
if (CollectionUtils.isEmpty(request.getAuthRegionIds())) {
|
||||
List<String> authRegionIds = userAuthMappingService.getAuthRegionIdAndSubRegionIdByUserId(userId);
|
||||
if (CollectionUtils.isEmpty(authRegionIds)) {
|
||||
return new PageInfo<>();
|
||||
}
|
||||
List<Long> userRoleIds = enterpriseUserRoleMapper.getUserRoleIds(userId);
|
||||
// 招商经理查询招商区域invest_region_id,否则查询运营区域region_id
|
||||
if (userRoleIds.contains(UserRoleEnum.INVESTMENT_MANGER.getCode())) {
|
||||
request.setAuthInvestRegionIds(authRegionIds);
|
||||
} else {
|
||||
request.setAuthRegionIds(authRegionIds);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (CollectionUtils.isNotEmpty(request.getRegionIds())) {
|
||||
@@ -557,7 +575,9 @@ public class ShopServiceImpl implements ShopService {
|
||||
if (CollectionUtils.isEmpty(preparations)) {
|
||||
return new PageInfo<>();
|
||||
}
|
||||
List<Long> regionIds = preparations.stream().map(PreparationDTO::getRegionId).collect(Collectors.toList());
|
||||
List<Long> regionIds = preparations.stream()
|
||||
.flatMap(v -> Stream.of(v.getRegionId(), v.getInvestRegionId()))
|
||||
.collect(Collectors.toList());
|
||||
regionIds.addAll(Optional.of(preparations).orElse(Collections.emptyList()).stream().map(PreparationDTO::getManagerRegionId).collect(Collectors.toList()));
|
||||
List<Long> wantShopAreaIds = preparations.stream().map(PreparationDTO::getWantShopAreaId).collect(Collectors.toList());
|
||||
List<String> investmentManagerIds = preparations.stream().map(PreparationDTO::getInvestmentManager).collect(Collectors.toList());
|
||||
@@ -596,6 +616,8 @@ public class ShopServiceImpl implements ShopService {
|
||||
response.setDays();
|
||||
response.setManagerRegionId(dto.getManagerRegionId());
|
||||
response.setManagerRegionName(regionNameMap.getOrDefault(dto.getManagerRegionId(), ""));
|
||||
response.setInvestRegionId(dto.getInvestRegionId());
|
||||
response.setInvestRegionName(regionNameMap.getOrDefault(dto.getInvestRegionId(), ""));
|
||||
responses.add(response);
|
||||
}
|
||||
pageInfo.setList(responses);
|
||||
|
||||
@@ -149,6 +149,8 @@ public class SignFranchiseServiceImpl implements SignFranchiseService, AuditResu
|
||||
ShopDecorationAssignDAO shopDecorationAssignDAO;
|
||||
@Resource
|
||||
private SimpleMessageService simpleMessageService;
|
||||
@Resource
|
||||
private OperationsConsultantAssignDAO operationsConsultantAssignDAO;
|
||||
|
||||
|
||||
@Override
|
||||
@@ -518,8 +520,21 @@ public class SignFranchiseServiceImpl implements SignFranchiseService, AuditResu
|
||||
lineInfoDO.setJoinStatus(CommonConstants.TWO);
|
||||
lineInfoMapper.insertOrUpdate(lineInfoDO);
|
||||
shopStageInfoDAO.updateShopStageInfo(shopId, SHOP_SUB_STAGE_STATUS_84);
|
||||
//初始化数据
|
||||
preparationService.contractAndBuildStoreCompletion(request.getShopId());
|
||||
//初始化数据 如果是正新鸡排 需要手动分配 其他品牌直接开始 且将招商经理给到运营经理
|
||||
if (FranchiseBrandEnum.ZXJP.getCode()==Integer.valueOf(shopInfoDO.getFranchiseBrand())){
|
||||
log.info("zxjp_assign shopId:{}",shopId);
|
||||
//新增分配信息
|
||||
OperationsConsultantAssignDO operationsConsultantAssignDO = new OperationsConsultantAssignDO();
|
||||
operationsConsultantAssignDO.setShopId(shopId);
|
||||
operationsConsultantAssignDO.setAssignStatus(0);
|
||||
operationsConsultantAssignDO.setRegionId(shopInfoDO.getRegionId());
|
||||
operationsConsultantAssignDAO.addOperationsConsultantAssign(operationsConsultantAssignDO);
|
||||
}else {
|
||||
//其他品牌直接开始 且将招商经理给到运营经理
|
||||
shopInfoDO.setOperationsConsultant(shopInfoDO.getInvestmentManager());
|
||||
shopInfoDAO.updateShopInfo(shopInfoDO);
|
||||
preparationService.contractAndBuildStoreCompletion(request.getShopId());
|
||||
}
|
||||
|
||||
//推送数据
|
||||
contractCallbackDTO = pushContractRequest(shopInfoDO, request.getShopId());
|
||||
@@ -684,6 +699,25 @@ public class SignFranchiseServiceImpl implements SignFranchiseService, AuditResu
|
||||
return request;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public Boolean assignOperationConsultant(AssignOperationConsultantRequest request) {
|
||||
//查询分配信息
|
||||
OperationsConsultantAssignDO operationsConsultantAssignDO = operationsConsultantAssignDAO.selectByShopId(request.getShopId());
|
||||
if (operationsConsultantAssignDO == null){
|
||||
throw new ServiceException(ErrorCodeEnum.PARAMS_VALIDATE_ERROR);
|
||||
}
|
||||
if (operationsConsultantAssignDO.getAssignStatus()==1){
|
||||
throw new ServiceException(ErrorCodeEnum.OPERATIONS_CONSULTANT_ASSIGNED);
|
||||
}
|
||||
//已分配
|
||||
operationsConsultantAssignDO.setAssignStatus(1);
|
||||
operationsConsultantAssignDAO.updateById(operationsConsultantAssignDO);
|
||||
//分配之后 开始以下阶段
|
||||
preparationService.contractAndBuildStoreCompletion(request.getShopId());
|
||||
return Boolean.TRUE;
|
||||
}
|
||||
|
||||
public AddSignFranchiseResponse from(SignFranchiseDO signFranchiseDO,
|
||||
Long shopId) {
|
||||
AddSignFranchiseResponse addSignFranchiseResponse = new AddSignFranchiseResponse();
|
||||
|
||||
@@ -8,6 +8,7 @@ import com.cool.store.context.LoginUserInfo;
|
||||
import com.cool.store.dao.EnterpriseUserDAO;
|
||||
import com.cool.store.dao.EnterpriseUserRoleDao;
|
||||
import com.cool.store.dao.RegionAreaConfigDao;
|
||||
import com.cool.store.dao.RegionDao;
|
||||
import com.cool.store.dto.UserDTO;
|
||||
import com.cool.store.entity.*;
|
||||
import com.cool.store.enums.*;
|
||||
@@ -78,6 +79,8 @@ public class UserAuthMappingServiceImpl implements UserAuthMappingService {
|
||||
|
||||
@Resource
|
||||
private EnterpriseUserRoleDao enterpriseUserRoleDao;
|
||||
@Autowired
|
||||
private RegionDao regionDao;
|
||||
|
||||
|
||||
@Override
|
||||
@@ -102,6 +105,20 @@ public class UserAuthMappingServiceImpl implements UserAuthMappingService {
|
||||
return regionIds;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getAuthRegionIdByUserId(String userId) {
|
||||
List<UserAuthMappingDO> userAuthMapping = listUserAuthMappingByUserId(userId);
|
||||
if (CollectionUtils.isEmpty(userAuthMapping)) {
|
||||
return Lists.newArrayList();
|
||||
}
|
||||
List<String> regionIds = userAuthMapping.stream().map(UserAuthMappingDO::getMappingId).collect(Collectors.toList());
|
||||
List<String> subRegionIds = regionDao.getSubIdsByRegionIdsAndType(regionIds, "path");
|
||||
if (CollectionUtils.isNotEmpty(subRegionIds)) {
|
||||
regionIds.addAll(subRegionIds);
|
||||
}
|
||||
return regionIds;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getAuthStoreIdAndSubRegionIdByUserId(String userId) {
|
||||
List<UserAuthMappingDO> userAuthMapping = listUserAuthMappingByUserId(userId);
|
||||
|
||||
Reference in New Issue
Block a user