待处理 我的数据

This commit is contained in:
苏竹红
2024-05-07 15:21:56 +08:00
parent f3d5a3eb99
commit 34fa4b5a4e
11 changed files with 326 additions and 3 deletions

View File

@@ -1,5 +1,6 @@
package com.cool.store.dao;
import com.cool.store.dto.InvestmentCountDTO;
import com.cool.store.dto.PendingCountDTO;
import com.cool.store.dto.openPreparation.PlanLineDTO;
import com.cool.store.entity.LineInfoDO;
@@ -144,6 +145,16 @@ public class LineInfoDAO {
PendingCountDTO pendingCount = lineInfoMapper.pendingCount(userId);
return pendingCount;
}
public InvestmentCountDTO investmentData(String userId) {
if (StringUtils.isBlank(userId)){
return null;
}
InvestmentCountDTO investmentData = lineInfoMapper.investmentData(userId);
return investmentData;
}
public List<PlanLineDTO> getLines(List<Long> lineIdList){
return lineInfoMapper.getLines(lineIdList);
}

View File

@@ -224,4 +224,10 @@ public class ShopStageInfoDAO {
return shopStageInfoMapper.getShopContractIncompletion();
}
public List<ShopStageInfoDO> getSpecialShopStageInfo(List<Long> shopIds, Integer shopSubStage,
List<Integer> shopSubStageStatusList,String investmentUserId,Integer queryUserType){
return shopStageInfoMapper.getSpecialShopStageInfo( shopIds, shopSubStage, shopSubStageStatusList,investmentUserId,queryUserType);
}
}

View File

@@ -1,5 +1,6 @@
package com.cool.store.mapper;
import com.cool.store.dto.InvestmentCountDTO;
import com.cool.store.dto.PendingCountDTO;
import com.cool.store.dto.openPreparation.PlanLineDTO;
import com.cool.store.entity.LineInfoDO;
@@ -73,7 +74,7 @@ public interface LineInfoMapper extends Mapper<LineInfoDO> {
*/
PendingCountDTO pendingCount(@Param("userId") String userId);
InvestmentCountDTO investmentData(@Param("userId") String userId);

View File

@@ -124,4 +124,11 @@ public interface ShopStageInfoMapper extends Mapper<ShopStageInfoDO> {
*/
List<Long> getShopContractIncompletion();
List<ShopStageInfoDO> getSpecialShopStageInfo(@Param("shopIds") List<Long> shopIds,
@Param("shopSubStage") Integer shopSubStage,
@Param("shopSubStageStatusList") List<Integer> shopSubStageStatusList,
@Param("investmentUserId") String investmentUserId,
@Param("queryUserType") Integer queryUserType);
}

View File

@@ -357,6 +357,20 @@
xfsg_line_info where deleted = 0 and line_status = 1
</select>
<select id="investmentData" resultType="com.cool.store.dto.InvestmentCountDTO">
SELECT
sum( IF ( investment_manager = #{userId} AND workflow_sub_stage = 1, 1, 0 ) ) AS intendCount,
sum( IF ( investment_manager = #{userId} AND workflow_sub_stage = 5, 1, 0 ) ) AS interviewCount,
sum( IF ( investment_manager = #{userId} AND workflow_sub_stage = 10, 1, 0 ) ) AS firstInterviewCount,
sum( IF ( investment_manager = #{userId} AND workflow_sub_stage = 15, 1, 0 ) ) AS payStageCount,
sum( IF ( investment_manager = #{userId} AND workflow_sub_stage = 20, 1, 0 ) ) AS signingCount,
sum( IF ( investment_manager = #{userId} AND workflow_sub_stage = 25, 1, 0 ) ) AS storeExperienceCount,
sum( IF ( investment_manager = #{userId} AND workflow_sub_stage = 30, 1, 0 ) ) AS secondInterviewCount
FROM
xfsg_line_info where deleted = 0 and line_status = 1 and investment_manager = #{userId}
</select>
<select id="lineList" resultMap="BaseResultMap">
select * from xfsg_line_info a
<if test="wantShopAreaName!=null">
@@ -485,7 +499,7 @@
join enterprise_user_${enterpriseId} eu on xli.investment_manager = eu.user_id
where deleted = 0 and join_status = 1 and line_status = 1
<if test=" lineIdList != null and lineIdList.size>0">
and id in
and xli.id in
<foreach collection="lineIdList" item="lineId" open="(" separator="," close=")">
#{lineId}
</foreach>

View File

@@ -217,4 +217,39 @@
</select>
<select id="getSpecialShopStageInfo" resultMap="BaseResultMap">
select
*
from xfsg_shop_stage_info a
<if test="investmentUserId!=null and investmentUserId!='' and queryUserType == 0 ">
left join xfsg_line_info b on a.line_id = b.id
</if>
<if test="investmentUserId!=null and investmentUserId!='' and queryUserType == 1 ">
left join xfsg_system_building_shop c on a.id = c.shop_id
</if>
<where>
<if test="shopIds != null and shopIds.size() > 0">
and a.id in
<foreach collection="shopIds" item="shopId" index="index" open="(" separator="," close=")">
#{shopId}
</foreach>
</if>
<if test="shopSubStage!=null">
and a.shop_sub_stage = #{shopSubStage}
</if>
<if test="shopSubStageStatusList != null and shopSubStageStatusList.size() > 0">
and a.shop_sub_stage_status in
<foreach collection="shopSubStageStatusList" item="stageStatus" index="index" open="(" separator="," close=")">
#{stageStatus}
</foreach>
</if>
<if test="investmentUserId!=null and investmentUserId!='' and queryUserType == 0">
and b.investment_manager = #{investmentUserId}
</if>
<if test="investmentUserId!=null and investmentUserId!='' and queryUserType == 1">
and c.supervisor_id = #{investmentUserId}
</if>
</where>
</select>
</mapper>

View File

@@ -0,0 +1,29 @@
package com.cool.store.dto;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* @Author suzhuhong
* @Date 2024/5/7 15:08
* @Version 1.0
*/
@Data
public class InvestmentCountDTO {
@ApiModelProperty("意向加盟数量")
private Integer intendCount;
@ApiModelProperty("邀约面谈数据")
private Integer interviewCount;
@ApiModelProperty("一审面试数据")
private Integer firstInterviewCount;
@ApiModelProperty("缴纳意向金数据")
private Integer payStageCount;
@ApiModelProperty("意向签约数据")
private Integer signingCount;
@ApiModelProperty("门店体验数量")
private Integer storeExperienceCount;
@ApiModelProperty("二审面试数据")
private Integer secondInterviewCount;
}

View File

@@ -0,0 +1,33 @@
package com.cool.store.vo.desk;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* @Author suzhuhong
* @Date 2024/5/7 10:48
* @Version 1.0
*/
@Data
public class PreparationCommonPendingVO {
@ApiModelProperty("门店名称")
private String storeName;
@ApiModelProperty("门店负责人名称")
private String shopManagerUserName;
@ApiModelProperty("招商经理名称")
private String partnerName;
@ApiModelProperty("手机号")
private String partnerPhone;
@ApiModelProperty("所属战区")
private String regionNodeName;
@ApiModelProperty("阶段状态")
private Integer subStageStatus;
@ApiModelProperty("线索ID")
private Long lineId;
@ApiModelProperty("店铺ID")
private Long shopId;
@ApiModelProperty("提交时间")
private String submitTime;
}

View File

@@ -1,6 +1,7 @@
package com.cool.store.service;
import com.cool.store.context.LoginUserInfo;
import com.cool.store.dto.InvestmentCountDTO;
import com.cool.store.dto.PendingCountDTO;
import com.cool.store.entity.HyPartnerLabelDO;
import com.cool.store.entity.LineInfoDO;
@@ -106,4 +107,48 @@ public interface DeskService {
*/
PendingCountDTO getPendingCount(LoginUserInfo user);
InvestmentCountDTO getInvestmentCount(LoginUserInfo user);
/**
* 系统建店待处理数据
* @param pageNum
* @param pageSize
* @param user
* @return
*/
PageInfo<PreparationCommonPendingVO> systemBuildStorePendingList(Integer pageNum, Integer pageSize, LoginUserInfo user);
/**
* 缴纳加盟费待处理数据
* @param pageNum
* @param pageSize
* @param user
* @return
*/
PageInfo<PreparationCommonPendingVO> payFranchiseFeesPendingList(Integer pageNum, Integer pageSize, LoginUserInfo user);
/**
* 加盟合同签约待处理数据
* @param pageNum
* @param pageSize
* @param user
* @return
*/
PageInfo<PreparationCommonPendingVO> signingOfFranchiseContractPendingList(Integer pageNum, Integer pageSize, LoginUserInfo user);
/**
* 开业运营方案待处理数据
* @param pageNum
* @param pageSize
* @param user
* @return
*/
PageInfo<PreparationCommonPendingVO> openingAndOperationPlanPendingList(Integer pageNum, Integer pageSize, LoginUserInfo user);
/**
* 首批订货清单待处理数据
* @param pageNum
* @param pageSize
* @param user
* @return
*/
PageInfo<PreparationCommonPendingVO> firstOrderListPendingList(Integer pageNum, Integer pageSize, LoginUserInfo user);
}

View File

@@ -3,16 +3,21 @@ 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.InvestmentCountDTO;
import com.cool.store.dto.PendingCountDTO;
import com.cool.store.dto.openPreparation.PlanLineDTO;
import com.cool.store.entity.*;
import com.cool.store.enums.InterviewTypeEnum;
import com.cool.store.enums.WorkflowSubStageStatusEnum;
import com.cool.store.enums.point.ShopSubStageEnum;
import com.cool.store.enums.point.ShopSubStageStatusEnum;
import com.cool.store.mapper.IntentAgreementMapper;
import com.cool.store.mapper.LineInterviewMapper;
import com.cool.store.mapper.TrainingExperienceMapper;
import com.cool.store.service.DeskService;
import com.cool.store.service.RegionService;
import com.cool.store.utils.StringUtil;
import com.cool.store.utils.poi.DateUtils;
import com.cool.store.utils.poi.constant.Constants;
import com.cool.store.vo.BaseInfoVO;
import com.cool.store.vo.LabelBaseInfoVO;
import com.cool.store.vo.desk.*;
@@ -47,6 +52,14 @@ public class DeskServiceImpl implements DeskService {
IntentAgreementMapper intentAgreementMapper;
@Resource
TrainingExperienceMapper trainingExperienceMapper;
@Resource
ShopStageInfoDAO shopStageInfoDAO;
@Resource
ShopInfoDAO shopInfoDAO;
@Resource
EnterpriseUserDAO enterpriseUserDAO;
@Resource
RegionService regionService;
@Override
public PageInfo<IntendPendingVO> intendPendingList(Integer pageNum, Integer pageSize,String userId) {
@@ -300,4 +313,87 @@ public class DeskServiceImpl implements DeskService {
return pendingCount;
}
@Override
public InvestmentCountDTO getInvestmentCount(LoginUserInfo user) {
return lineInfoDAO.investmentData(user.getUserId());
}
@Override
public PageInfo<PreparationCommonPendingVO> systemBuildStorePendingList(Integer pageNum, Integer pageSize, LoginUserInfo user) {
return commonPendingVOPageInfo(pageNum, pageSize, user, ShopSubStageEnum.SHOP_STAGE_3, Arrays.asList(ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_30.getShopSubStageStatus()), Constants.ZERO_INTEGER);
}
@Override
public PageInfo<PreparationCommonPendingVO> payFranchiseFeesPendingList(Integer pageNum, Integer pageSize, LoginUserInfo user) {
return commonPendingVOPageInfo(pageNum, pageSize, user, ShopSubStageEnum.SHOP_STAGE_7,
Arrays.asList(ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_70.getShopSubStageStatus(),ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_72.getShopSubStageStatus()), Constants.ZERO_INTEGER);
}
@Override
public PageInfo<PreparationCommonPendingVO> signingOfFranchiseContractPendingList(Integer pageNum, Integer pageSize, LoginUserInfo user) {
return commonPendingVOPageInfo(pageNum, pageSize, user, ShopSubStageEnum.SHOP_STAGE_8,
Arrays.asList(ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_80.getShopSubStageStatus(),ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_85.getShopSubStageStatus()), Constants.ZERO_INTEGER);
}
@Override
public PageInfo<PreparationCommonPendingVO> openingAndOperationPlanPendingList(Integer pageNum, Integer pageSize, LoginUserInfo user) {
return commonPendingVOPageInfo(pageNum, pageSize, user, ShopSubStageEnum.SHOP_STAGE_14, Arrays.asList(ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_140.getShopSubStageStatus()), Constants.ONE_INTEGER);
}
@Override
public PageInfo<PreparationCommonPendingVO> firstOrderListPendingList(Integer pageNum, Integer pageSize, LoginUserInfo user) {
return commonPendingVOPageInfo(pageNum, pageSize, user, ShopSubStageEnum.SHOP_STAGE_15, Arrays.asList(ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_150.getShopSubStageStatus()), Constants.ONE_INTEGER);
}
/**
* 通用查询
* @param pageNum
* @param pageSize
* @param user
* @param shopSubStageEnum
* @param subStageStatusList
* @return
*/
private PageInfo<PreparationCommonPendingVO> commonPendingVOPageInfo(Integer pageNum, Integer pageSize, LoginUserInfo user,ShopSubStageEnum shopSubStageEnum,List<Integer> subStageStatusList,Integer type){
PageHelper.startPage(pageNum, pageSize);
List<ShopStageInfoDO> specialShopStageInfo = shopStageInfoDAO.getSpecialShopStageInfo(null, shopSubStageEnum.getShopSubStage(),
subStageStatusList, user.getUserId(),type);
PageInfo result = new PageInfo<>(specialShopStageInfo);
List<Long> shopIds = specialShopStageInfo.stream().map(ShopStageInfoDO::getShopId).collect(Collectors.toList());
List<Long> lineIds = specialShopStageInfo.stream().map(ShopStageInfoDO::getLineId).collect(Collectors.toList());
List<ShopInfoDO> shopInfoList = shopInfoDAO.getShopListByIds(shopIds);
List<PlanLineDTO> lines = lineInfoDAO.getLines(lineIds);
//将shopInfoList 转为map
Map<Long, ShopInfoDO> shopInfoMap = shopInfoList.stream().collect(Collectors.toMap(ShopInfoDO::getId, shop -> shop));
//将lines 转为map
Map<Long, PlanLineDTO> lineMap = lines.stream().collect(Collectors.toMap(PlanLineDTO::getLineId, line -> line));
List<Long> regionIds = shopInfoList.stream().map(ShopInfoDO::getRegionId).distinct().collect(Collectors.toList());
List<String> developmentManagers = shopInfoList.stream().filter(x->StringUtil.isNotEmpty(x.getShopManagerUserId())).map(ShopInfoDO::getShopManagerUserId).distinct().collect(Collectors.toList());
Map<String, String> userNameMap = enterpriseUserDAO.getUserNameMap(developmentManagers);
Map<Long, String> regionNameMap = regionService.getBelongWarRegionNameMap(regionIds);
List<PreparationCommonPendingVO> list = new ArrayList<>();
specialShopStageInfo.forEach(x->{
PreparationCommonPendingVO preparationCommonPendingVO = new PreparationCommonPendingVO();
preparationCommonPendingVO.setLineId(x.getLineId());
preparationCommonPendingVO.setShopId(x.getShopId());
preparationCommonPendingVO.setSubStageStatus(x.getShopSubStageStatus());
ShopInfoDO shopInfoDO = shopInfoMap.getOrDefault(x.getShopId(),new ShopInfoDO());
preparationCommonPendingVO.setStoreName(shopInfoDO.getShopName());
PlanLineDTO planLineDTO = lineMap.getOrDefault(x.getLineId(), new PlanLineDTO());
preparationCommonPendingVO.setPartnerName(planLineDTO.getUsername());
preparationCommonPendingVO.setPartnerPhone(planLineDTO.getMobile());
preparationCommonPendingVO.setShopManagerUserName(userNameMap.getOrDefault(shopInfoDO.getShopManagerUserId(),""));
preparationCommonPendingVO.setRegionNodeName(regionNameMap.getOrDefault(shopInfoDO.getRegionId(),""));
list.add(preparationCommonPendingVO);
});
result.setList(list);
return result;
}
}

View File

@@ -2,6 +2,7 @@ package com.cool.store.controller.webb;
import com.cool.store.context.CurrentUserHolder;
import com.cool.store.context.LoginUserInfo;
import com.cool.store.dto.InvestmentCountDTO;
import com.cool.store.dto.PendingCountDTO;
import com.cool.store.response.ResponseResult;
import com.cool.store.service.DeskService;
@@ -97,4 +98,49 @@ public class DeskController {
}
@ApiOperation("招商经理-我的数据")
@GetMapping("/getInvestmentCount")
public ResponseResult<InvestmentCountDTO> getInvestmentCount(@RequestParam(value = "pageNumber",required = true,defaultValue = "1")Integer pageNumber,
@RequestParam(value = "pageSize",required = true,defaultValue = "10")Integer pageSize) {
LoginUserInfo userInfo = CurrentUserHolder.getUser();
return ResponseResult.success(deskService.getInvestmentCount(userInfo));
}
@ApiOperation("待处理-系统建店")
@GetMapping("/systemBuildStorePendingList")
public ResponseResult<PageInfo<PreparationCommonPendingVO>> systemBuildStorePendingList(@RequestParam(value = "pageNumber",required = true,defaultValue = "1")Integer pageNumber,
@RequestParam(value = "pageSize",required = true,defaultValue = "10")Integer pageSize) {
LoginUserInfo userInfo = CurrentUserHolder.getUser();
return ResponseResult.success(deskService.systemBuildStorePendingList(pageNumber,pageSize,userInfo));
}
@ApiOperation("待处理-支付加盟费保证金")
@GetMapping("/payFranchiseFeesPendingList")
public ResponseResult<PageInfo<PreparationCommonPendingVO>> payFranchiseFeesPendingList(@RequestParam(value = "pageNumber",required = true,defaultValue = "1")Integer pageNumber,
@RequestParam(value = "pageSize",required = true,defaultValue = "10")Integer pageSize) {
LoginUserInfo userInfo = CurrentUserHolder.getUser();
return ResponseResult.success(deskService.payFranchiseFeesPendingList(pageNumber,pageSize,userInfo));
}
@ApiOperation("待处理-签约加盟合同")
@GetMapping("/signingOfFranchiseContractPendingList")
public ResponseResult<PageInfo<PreparationCommonPendingVO>> signingOfFranchiseContractPendingList(@RequestParam(value = "pageNumber",required = true,defaultValue = "1")Integer pageNumber,
@RequestParam(value = "pageSize",required = true,defaultValue = "10")Integer pageSize) {
LoginUserInfo userInfo = CurrentUserHolder.getUser();
return ResponseResult.success(deskService.signingOfFranchiseContractPendingList(pageNumber,pageSize,userInfo));
}
@ApiOperation("待处理-开店运营方案")
@GetMapping("/openingAndOperationPlanPendingList")
public ResponseResult<PageInfo<PreparationCommonPendingVO>> openingAndOperationPlanPendingList(@RequestParam(value = "pageNumber",required = true,defaultValue = "1")Integer pageNumber,
@RequestParam(value = "pageSize",required = true,defaultValue = "10")Integer pageSize) {
LoginUserInfo userInfo = CurrentUserHolder.getUser();
return ResponseResult.success(deskService.openingAndOperationPlanPendingList(pageNumber,pageSize,userInfo));
}
@ApiOperation("待处理-首批订货清单")
@GetMapping("/firstOrderListPendingList")
public ResponseResult<PageInfo<PreparationCommonPendingVO>> firstOrderListPendingList(@RequestParam(value = "pageNumber",required = true,defaultValue = "1")Integer pageNumber,
@RequestParam(value = "pageSize",required = true,defaultValue = "10")Integer pageSize) {
LoginUserInfo userInfo = CurrentUserHolder.getUser();
return ResponseResult.success(deskService.firstOrderListPendingList(pageNumber,pageSize,userInfo));
}
}