修改运营方案列表bug
This commit is contained in:
@@ -494,7 +494,7 @@
|
|||||||
</if>
|
</if>
|
||||||
</select>
|
</select>
|
||||||
<select id="getLines" resultType="com.cool.store.dto.openPreparation.PlanLineDTO">
|
<select id="getLines" resultType="com.cool.store.dto.openPreparation.PlanLineDTO">
|
||||||
select xli.id as lineId, xli.mobile as mobile, xli.username as username, eu.name as name
|
select xli.id as lineId, xli.mobile as mobile, xli.username as username,xli.investment_manager as investmentManagerId ,eu.name as name
|
||||||
from xfsg_line_info xli
|
from xfsg_line_info xli
|
||||||
join enterprise_user_${enterpriseId} eu on xli.investment_manager = eu.user_id
|
join enterprise_user_${enterpriseId} eu on xli.investment_manager = eu.user_id
|
||||||
where deleted = 0 and join_status = 1 and line_status = 1
|
where deleted = 0 and join_status = 1 and line_status = 1
|
||||||
|
|||||||
@@ -47,12 +47,10 @@
|
|||||||
<select id="getOpenPlanShopListByCondition"
|
<select id="getOpenPlanShopListByCondition"
|
||||||
resultType="com.cool.store.dto.openPreparation.OpenPlanShopInfoDTO">
|
resultType="com.cool.store.dto.openPreparation.OpenPlanShopInfoDTO">
|
||||||
select si.id as shopId, si.region_id AS regionId,si.line_id as lineId, si.shop_name as shopName,
|
select si.id as shopId, si.region_id AS regionId,si.line_id as lineId, si.shop_name as shopName,
|
||||||
si.store_num as storeNum, si.shop_manager_user_id as shopManagerUserId,li.investment_manager AS investmentManagerId,
|
si.store_num as storeNum, si.shop_manager_user_id as shopManagerUserId,op.submission_time AS submissionTime ,
|
||||||
li.username as partnerName, li.mobile as mobile ,
|
op.result_type AS resultType
|
||||||
op.submission_time AS submissionTime , op.result_type AS resultType
|
|
||||||
from xfsg_opening_operation_plan op
|
from xfsg_opening_operation_plan op
|
||||||
join xfsg_shop_info si on si.id = op.shop_id
|
join xfsg_shop_info si on si.id = op.shop_id
|
||||||
join xfsg_line_info li on si.line_id = li.id
|
|
||||||
where 1=1
|
where 1=1
|
||||||
<if test="request.shopName != null and request.shopName != '' ">
|
<if test="request.shopName != null and request.shopName != '' ">
|
||||||
AND si.shop_name like concat('%', #{request.shopName}, '%')
|
AND si.shop_name like concat('%', #{request.shopName}, '%')
|
||||||
@@ -60,10 +58,13 @@
|
|||||||
<if test="request.resultType != null and request.resultType != ''">
|
<if test="request.resultType != null and request.resultType != ''">
|
||||||
AND op.result_type = #{request.resultType}
|
AND op.result_type = #{request.resultType}
|
||||||
</if>
|
</if>
|
||||||
<if test="request.planStartDate != null and request.planStartDate != ''">
|
<if test="request.planStartDate == null and request.planEndDate == null">
|
||||||
|
and op.create_time >= DATE_SUB(CURDATE(), INTERVAL 3 MONTH)
|
||||||
|
</if>
|
||||||
|
<if test="request.planStartDate != null">
|
||||||
and op.create_time >= #{request.planStartDate}
|
and op.create_time >= #{request.planStartDate}
|
||||||
</if>
|
</if>
|
||||||
<if test="request.planEndDate != null and request.planEndDate != ''">
|
<if test="request.planEndDate != null">
|
||||||
AND op.create_time <= #{request.planEndDate}
|
AND op.create_time <= #{request.planEndDate}
|
||||||
</if>
|
</if>
|
||||||
<if test="request.regionIds != null and request.regionIds.size() > 0">
|
<if test="request.regionIds != null and request.regionIds.size() > 0">
|
||||||
|
|||||||
@@ -17,7 +17,8 @@ public class PlanLineDTO {
|
|||||||
private String mobile;
|
private String mobile;
|
||||||
@ApiModelProperty("加盟商姓名")
|
@ApiModelProperty("加盟商姓名")
|
||||||
private String username;
|
private String username;
|
||||||
|
@ApiModelProperty("招商经理Id")
|
||||||
|
private String investmentManagerId;
|
||||||
@ApiModelProperty("招商经理姓名")
|
@ApiModelProperty("招商经理姓名")
|
||||||
private String investmentManagerName;
|
private String investmentManagerName;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -19,9 +19,9 @@ public class PlanListRequest {
|
|||||||
@ApiModelProperty("店铺名称")
|
@ApiModelProperty("店铺名称")
|
||||||
private String shopName;
|
private String shopName;
|
||||||
@ApiModelProperty("起始日期")
|
@ApiModelProperty("起始日期")
|
||||||
private String planStartDate;
|
private Date planStartDate;
|
||||||
@ApiModelProperty("结束日期")
|
@ApiModelProperty("结束日期")
|
||||||
private String planEndDate;
|
private Date planEndDate;
|
||||||
@ApiModelProperty("选择区域")
|
@ApiModelProperty("选择区域")
|
||||||
private List<String> regionIds;
|
private List<String> regionIds;
|
||||||
@ApiModelProperty("审核状态")
|
@ApiModelProperty("审核状态")
|
||||||
|
|||||||
@@ -27,23 +27,18 @@ public class OpeningOperationPlanListVO {
|
|||||||
@ApiModelProperty("开店负责人")
|
@ApiModelProperty("开店负责人")
|
||||||
private String shopManagerName;
|
private String shopManagerName;
|
||||||
|
|
||||||
|
|
||||||
@ApiModelProperty("加盟商姓名")
|
@ApiModelProperty("加盟商姓名")
|
||||||
private String partnerName;
|
private String partnerName;
|
||||||
|
|
||||||
@ApiModelProperty("手机号码")
|
@ApiModelProperty("手机号码")
|
||||||
private String mobile;
|
private String mobile;
|
||||||
|
|
||||||
@ApiModelProperty("所属大区")
|
@ApiModelProperty("所属区域")
|
||||||
private String bigName;
|
private String region;
|
||||||
|
|
||||||
@ApiModelProperty("所属战区")
|
|
||||||
private String fightName;
|
|
||||||
|
|
||||||
@ApiModelProperty("招商经理名字")
|
@ApiModelProperty("招商经理名字")
|
||||||
private String investmentManagerName;
|
private String investmentManagerName;
|
||||||
|
|
||||||
|
|
||||||
@ApiModelProperty("督导")
|
@ApiModelProperty("督导")
|
||||||
private String supervisorName;
|
private String supervisorName;
|
||||||
|
|
||||||
|
|||||||
@@ -113,6 +113,12 @@ public class FirstOrderServiceImp implements FirstOrderService {
|
|||||||
throw new ServiceException(ErrorCodeEnum.FIRST_ORDER_PARAM_NULL);
|
throw new ServiceException(ErrorCodeEnum.FIRST_ORDER_PARAM_NULL);
|
||||||
}
|
}
|
||||||
FirstOrderDTO order = firstOrderDAO.selectFirstOrderByShopId(shopId);
|
FirstOrderDTO order = firstOrderDAO.selectFirstOrderByShopId(shopId);
|
||||||
|
ShopStageInfoDO shopSubStageInfo = shopStageInfoDAO.getShopSubStageInfo(shopId, ShopSubStageEnum.SHOP_STAGE_15);
|
||||||
|
if (ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_151.getShopSubStageStatus().equals(shopSubStageInfo.getShopSubStageStatus()))
|
||||||
|
{
|
||||||
|
order.setFirstOrderSubStage( ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_151.getShopSubStageStatus());
|
||||||
|
return order;
|
||||||
|
}
|
||||||
if (Objects.nonNull(order)) {
|
if (Objects.nonNull(order)) {
|
||||||
try {
|
try {
|
||||||
ShopInfoDO shopInfo = shopService.getShopInfo(order.getShopId());
|
ShopInfoDO shopInfo = shopService.getShopInfo(order.getShopId());
|
||||||
|
|||||||
@@ -64,6 +64,8 @@ public class OpeningOperationPlanImpl implements OpeningOperationPlanService {
|
|||||||
private ShopInfoDAO shopInfoDAO;
|
private ShopInfoDAO shopInfoDAO;
|
||||||
@Resource
|
@Resource
|
||||||
private CoolStoreStartFlowService coolStoreStartFlowService;
|
private CoolStoreStartFlowService coolStoreStartFlowService;
|
||||||
|
@Resource
|
||||||
|
private LineInfoDAO lineInfoDAO;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
@@ -134,26 +136,41 @@ public class OpeningOperationPlanImpl implements OpeningOperationPlanService {
|
|||||||
public PageInfo<OpeningOperationPlanListVO> getPlanListPage(PlanListRequest request) {
|
public PageInfo<OpeningOperationPlanListVO> getPlanListPage(PlanListRequest request) {
|
||||||
log.info("getPlanListPage request:{}", JSONObject.toJSONString(request));
|
log.info("getPlanListPage request:{}", JSONObject.toJSONString(request));
|
||||||
PageHelper.startPage(request.getPageNumber(), request.getPageSize());
|
PageHelper.startPage(request.getPageNumber(), request.getPageSize());
|
||||||
//去shop_info表查询店铺名字,店铺code,开店负责人id,督导id,区域id,lineinfo 加盟商name,手机号,招商经理id,open_plan,提交时间,审核状态
|
//不指定时间为3个月数据 去shop_info表查询店铺名字,店铺code,开店负责人id,督导id,区域id,open_plan,提交时间,审核状态
|
||||||
//TODO 拆表 产品沟通限定时间
|
|
||||||
List<OpenPlanShopInfoDTO> openPlanShopInfoDTOS = openingOperationPlanDAO.getOpenPlanShopListByCondition(request);
|
List<OpenPlanShopInfoDTO> openPlanShopInfoDTOS = openingOperationPlanDAO.getOpenPlanShopListByCondition(request);
|
||||||
|
//lineinfo 加盟商name,手机号,招商经理name,
|
||||||
|
if (CollectionUtils.isEmpty(openPlanShopInfoDTOS)) {
|
||||||
|
log.error("查询运营方案列表没有数据");
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
List<Long> lines = openPlanShopInfoDTOS.stream().map(OpenPlanShopInfoDTO::getLineId).collect(Collectors.toList());
|
||||||
|
List<PlanLineDTO> lineInfos = lineInfoDAO.getLines(lines);
|
||||||
|
Map<Long, PlanLineDTO> lineInfoMap = lineInfos.stream().collect(Collectors.toMap(PlanLineDTO::getLineId, dto -> dto));
|
||||||
|
for (OpenPlanShopInfoDTO openPlanShopInfoDTO : openPlanShopInfoDTOS) {
|
||||||
|
openPlanShopInfoDTO.setPartnerName(lineInfoMap.get(openPlanShopInfoDTO.getLineId()).getUsername());
|
||||||
|
openPlanShopInfoDTO.setMobile(lineInfoMap.get(openPlanShopInfoDTO.getLineId()).getMobile());
|
||||||
|
openPlanShopInfoDTO.setInvestmentManagerId(lineInfoMap.get(openPlanShopInfoDTO.getLineId()).getInvestmentManagerId());
|
||||||
|
}
|
||||||
PageInfo pageInfo = new PageInfo<>(openPlanShopInfoDTOS);
|
PageInfo pageInfo = new PageInfo<>(openPlanShopInfoDTOS);
|
||||||
//开店负责人id,督导id,招商经理id // TODO id 为null过滤
|
//开店负责人id,督导id,招商经理id //
|
||||||
Set<String> userIdset = openPlanShopInfoDTOS.stream()
|
Set<String> userIdset = openPlanShopInfoDTOS.stream()
|
||||||
|
.filter(dto -> dto.getShopManagerUserId() != null)
|
||||||
.map(OpenPlanShopInfoDTO::getShopManagerUserId)
|
.map(OpenPlanShopInfoDTO::getShopManagerUserId)
|
||||||
.collect(Collectors.toSet());
|
.collect(Collectors.toSet());
|
||||||
userIdset.addAll(openPlanShopInfoDTOS.stream()
|
userIdset.addAll(openPlanShopInfoDTOS.stream()
|
||||||
|
.filter(dto -> dto.getSupervisorUserId() != null)
|
||||||
.map(OpenPlanShopInfoDTO::getSupervisorUserId)
|
.map(OpenPlanShopInfoDTO::getSupervisorUserId)
|
||||||
.collect(Collectors.toSet()));
|
.collect(Collectors.toSet()));
|
||||||
userIdset.addAll(openPlanShopInfoDTOS.stream()
|
userIdset.addAll(openPlanShopInfoDTOS.stream()
|
||||||
|
.filter(dto -> dto.getInvestmentManagerId() != null)
|
||||||
.map(OpenPlanShopInfoDTO::getInvestmentManagerId)
|
.map(OpenPlanShopInfoDTO::getInvestmentManagerId)
|
||||||
.collect(Collectors.toSet()));
|
.collect(Collectors.toSet()));
|
||||||
List<String> userlist = new ArrayList<>();
|
List<String> userIdList = new ArrayList<>(userIdset);
|
||||||
userlist.addAll(userIdset);
|
Map<String, String> vonameMap = enterpriseUserDAO.getUserNameMap(userIdList);
|
||||||
Map<String, EnterpriseUserDO> vonameMap = enterpriseUserDAO.getUserMap(userlist);
|
|
||||||
log.info("getPlanListPage vonameMap:{}", JSONObject.toJSONString(vonameMap));
|
log.info("getPlanListPage vonameMap:{}", JSONObject.toJSONString(vonameMap));
|
||||||
//region
|
//region
|
||||||
List<Long> regionIds = openPlanShopInfoDTOS.stream().map(OpenPlanShopInfoDTO::getRegionId).collect(Collectors.toList());
|
List<Long> regionIds = openPlanShopInfoDTOS.stream()
|
||||||
|
.filter(dto -> dto.getRegionId() != null).map(OpenPlanShopInfoDTO::getRegionId).collect(Collectors.toList());
|
||||||
Map<Long, String> regionNameMap = regionService.getBelongWarRegionNameMap(regionIds);
|
Map<Long, String> regionNameMap = regionService.getBelongWarRegionNameMap(regionIds);
|
||||||
List<OpeningOperationPlanListVO> openingOperationPlanListVOList = new ArrayList<>();
|
List<OpeningOperationPlanListVO> openingOperationPlanListVOList = new ArrayList<>();
|
||||||
openPlanShopInfoDTOS.forEach(x -> {
|
openPlanShopInfoDTOS.forEach(x -> {
|
||||||
@@ -163,23 +180,13 @@ public class OpeningOperationPlanImpl implements OpeningOperationPlanService {
|
|||||||
openingOperationPlanListVO.setStoreNum(x.getStoreNum());
|
openingOperationPlanListVO.setStoreNum(x.getStoreNum());
|
||||||
openingOperationPlanListVO.setPartnerName(x.getPartnerName());
|
openingOperationPlanListVO.setPartnerName(x.getPartnerName());
|
||||||
openingOperationPlanListVO.setMobile(x.getMobile());
|
openingOperationPlanListVO.setMobile(x.getMobile());
|
||||||
//TODO
|
openingOperationPlanListVO.setRegion(regionNameMap.get(x.getRegionId()));
|
||||||
String[] split = regionNameMap.getOrDefault(x.getRegionId(), "").split("-");
|
|
||||||
if (split.length > 0) {
|
|
||||||
openingOperationPlanListVO.setBigName(split[0]);
|
|
||||||
openingOperationPlanListVO.setFightName(split[1]);
|
|
||||||
}
|
|
||||||
if (!StringUtils.isEmpty(x.getInvestmentManagerId())) {
|
|
||||||
openingOperationPlanListVO.setInvestmentManagerName
|
openingOperationPlanListVO.setInvestmentManagerName
|
||||||
(vonameMap.get(x.getInvestmentManagerId()).getName());
|
(vonameMap.get(x.getInvestmentManagerId()));
|
||||||
}
|
|
||||||
if (!StringUtils.isEmpty(x.getShopManagerUserId())) {
|
|
||||||
openingOperationPlanListVO.setShopManagerName
|
openingOperationPlanListVO.setShopManagerName
|
||||||
(vonameMap.get(x.getInvestmentManagerId()).getName());
|
(vonameMap.get(x.getInvestmentManagerId()));
|
||||||
}
|
openingOperationPlanListVO.setSupervisorName(
|
||||||
if (!StringUtils.isEmpty(x.getSupervisorUserId())) {
|
vonameMap.get(x.getSupervisorUserId()));
|
||||||
openingOperationPlanListVO.setSupervisorName(vonameMap.get(x.getSupervisorUserId()).getName());
|
|
||||||
}
|
|
||||||
openingOperationPlanListVO.setSubmissionTime(x.getSubmissionTime());
|
openingOperationPlanListVO.setSubmissionTime(x.getSubmissionTime());
|
||||||
openingOperationPlanListVO.setResultType(x.getResultType());
|
openingOperationPlanListVO.setResultType(x.getResultType());
|
||||||
openingOperationPlanListVOList.add(openingOperationPlanListVO);
|
openingOperationPlanListVOList.add(openingOperationPlanListVO);
|
||||||
|
|||||||
Reference in New Issue
Block a user