开新店逻辑调整
This commit is contained in:
@@ -101,6 +101,8 @@ public enum ShopSubStageEnum {
|
|||||||
case SHOP_STAGE_13:
|
case SHOP_STAGE_13:
|
||||||
case SHOP_STAGE_14:
|
case SHOP_STAGE_14:
|
||||||
case SHOP_STAGE_15:
|
case SHOP_STAGE_15:
|
||||||
|
case SHOP_STAGE_16:
|
||||||
|
case SHOP_STAGE_17:
|
||||||
return ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_00;
|
return ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_00;
|
||||||
default:
|
default:
|
||||||
return null;
|
return null;
|
||||||
|
|||||||
@@ -96,10 +96,10 @@ public enum ShopSubStageStatusEnum {
|
|||||||
|
|
||||||
|
|
||||||
SHOP_SUB_STAGE_STATUS_160(ShopSubStageEnum.SHOP_STAGE_16, 1600, "验收中", Boolean.FALSE),
|
SHOP_SUB_STAGE_STATUS_160(ShopSubStageEnum.SHOP_STAGE_16, 1600, "验收中", Boolean.FALSE),
|
||||||
SHOP_SUB_STAGE_STATUS_161(ShopSubStageEnum.SHOP_STAGE_16, 1610, "已完成", Boolean.FALSE),
|
SHOP_SUB_STAGE_STATUS_161(ShopSubStageEnum.SHOP_STAGE_16, 1610, "已完成", Boolean.TRUE),
|
||||||
|
|
||||||
SHOP_SUB_STAGE_STATUS_170(ShopSubStageEnum.SHOP_STAGE_17, 1700, "试运营中", Boolean.FALSE),
|
SHOP_SUB_STAGE_STATUS_170(ShopSubStageEnum.SHOP_STAGE_17, 1700, "试运营中", Boolean.FALSE),
|
||||||
SHOP_SUB_STAGE_STATUS_171(ShopSubStageEnum.SHOP_STAGE_17, 1710, "已完成", Boolean.FALSE),
|
SHOP_SUB_STAGE_STATUS_171(ShopSubStageEnum.SHOP_STAGE_17, 1710, "已完成", Boolean.TRUE),
|
||||||
|
|
||||||
;
|
;
|
||||||
|
|
||||||
|
|||||||
@@ -244,4 +244,17 @@ public class ShopStageInfoDAO {
|
|||||||
return shopStageInfoMapper.getSubStageList(shopIds,shopSubStage);
|
return shopStageInfoMapper.getSubStageList(shopIds,shopSubStage);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取线索未开业的数量
|
||||||
|
* @param lineId
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public Integer getNotOpenShopCountByLineId(Long lineId){
|
||||||
|
if(Objects.isNull(lineId)){
|
||||||
|
return CommonConstants.ZERO;
|
||||||
|
}
|
||||||
|
ShopSubStageEnum shopSubStageEnum = ShopSubStageEnum.SHOP_STAGE_16;
|
||||||
|
return shopStageInfoMapper.getShopCountByLineIdAndStageStatus(lineId, shopSubStageEnum.getShopStageEnum().getShopStage(), shopSubStageEnum.getShopSubStage(), ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_00.getShopSubStageStatus());
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -127,4 +127,11 @@ public interface ShopStageInfoMapper extends Mapper<ShopStageInfoDO> {
|
|||||||
@Param("investmentUserId") String investmentUserId,
|
@Param("investmentUserId") String investmentUserId,
|
||||||
@Param("queryUserType") Integer queryUserType);
|
@Param("queryUserType") Integer queryUserType);
|
||||||
List<ShopStageInfoDO> getSubStageList(@Param("shopIds") List<Long> shopIds,@Param("shopSubStage") Integer shopSubStage);
|
List<ShopStageInfoDO> getSubStageList(@Param("shopIds") List<Long> shopIds,@Param("shopSubStage") Integer shopSubStage);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取线索处在某个阶段的某个状态的店铺数量
|
||||||
|
* @param lineId
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
Integer getShopCountByLineIdAndStageStatus(@Param("lineId")Long lineId, @Param("shopStage") Integer shopStage, @Param("shopSubStage") Integer shopSubStage, @Param("shopSubStageStatus") Integer shopSubStageStatus);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -261,4 +261,8 @@
|
|||||||
from xfsg_shop_stage_info
|
from xfsg_shop_stage_info
|
||||||
where shop_sub_stage_status = #{shopSubStageStatus}
|
where shop_sub_stage_status = #{shopSubStageStatus}
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
<select id="getShopCountByLineIdAndStageStatus" resultType="integer">
|
||||||
|
select count(1) from xfsg_shop_stage_info where shop_stage = #{shopStage} and shop_sub_stage = #{shopSubStage} and shop_sub_stage_status = #{shopSubStageStatus} and line_id = #{lineId}
|
||||||
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
@@ -0,0 +1,21 @@
|
|||||||
|
package com.cool.store.vo;
|
||||||
|
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author zhangchenbiao
|
||||||
|
* @FileName: IsSubmitOpenNewShopVO
|
||||||
|
* @Description:
|
||||||
|
* @date 2024-05-11 11:22
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class IsSubmitOpenNewShopVO {
|
||||||
|
|
||||||
|
@ApiModelProperty("是否可以开新店 true:可以开店 false:不能开新店")
|
||||||
|
private Boolean isSubmitOpenNewShop;
|
||||||
|
|
||||||
|
public IsSubmitOpenNewShopVO(Boolean isSubmitOpenNewShop) {
|
||||||
|
this.isSubmitOpenNewShop = isSubmitOpenNewShop;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -3,6 +3,7 @@ package com.cool.store.service;
|
|||||||
import com.cool.store.request.AuditOpenNewShopRequest;
|
import com.cool.store.request.AuditOpenNewShopRequest;
|
||||||
import com.cool.store.request.PartnerOpenNewShopPageRequest;
|
import com.cool.store.request.PartnerOpenNewShopPageRequest;
|
||||||
import com.cool.store.request.SubmitOpenNewShopRequest;
|
import com.cool.store.request.SubmitOpenNewShopRequest;
|
||||||
|
import com.cool.store.vo.IsSubmitOpenNewShopVO;
|
||||||
import com.cool.store.vo.PartnerOpenNewShopDetailVO;
|
import com.cool.store.vo.PartnerOpenNewShopDetailVO;
|
||||||
import com.cool.store.vo.PartnerOpenNewShopPageVO;
|
import com.cool.store.vo.PartnerOpenNewShopPageVO;
|
||||||
import com.github.pagehelper.PageInfo;
|
import com.github.pagehelper.PageInfo;
|
||||||
@@ -44,5 +45,5 @@ public interface OpenNewShopService {
|
|||||||
* @param lineId
|
* @param lineId
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
PartnerOpenNewShopDetailVO getWaitAuditOpenNewShopRecord(Long lineId);
|
IsSubmitOpenNewShopVO isSubmitOpenNewShop(Long lineId);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,10 +1,7 @@
|
|||||||
package com.cool.store.service.impl;
|
package com.cool.store.service.impl;
|
||||||
|
|
||||||
import com.cool.store.constants.CommonConstants;
|
import com.cool.store.constants.CommonConstants;
|
||||||
import com.cool.store.dao.EnterpriseUserDAO;
|
import com.cool.store.dao.*;
|
||||||
import com.cool.store.dao.HyOpenAreaInfoDAO;
|
|
||||||
import com.cool.store.dao.HyPartnerUserChannelDAO;
|
|
||||||
import com.cool.store.dao.OpenNewShopRecordDAO;
|
|
||||||
import com.cool.store.dto.partner.PartnerOpenNewShopPageDTO;
|
import com.cool.store.dto.partner.PartnerOpenNewShopPageDTO;
|
||||||
import com.cool.store.entity.HyOpenAreaInfoDO;
|
import com.cool.store.entity.HyOpenAreaInfoDO;
|
||||||
import com.cool.store.entity.OpenNewShopRecordDO;
|
import com.cool.store.entity.OpenNewShopRecordDO;
|
||||||
@@ -19,6 +16,7 @@ import com.cool.store.request.SubmitOpenNewShopRequest;
|
|||||||
import com.cool.store.service.LabelService;
|
import com.cool.store.service.LabelService;
|
||||||
import com.cool.store.service.OpenNewShopService;
|
import com.cool.store.service.OpenNewShopService;
|
||||||
import com.cool.store.service.ShopService;
|
import com.cool.store.service.ShopService;
|
||||||
|
import com.cool.store.vo.IsSubmitOpenNewShopVO;
|
||||||
import com.cool.store.vo.PartnerOpenNewShopDetailVO;
|
import com.cool.store.vo.PartnerOpenNewShopDetailVO;
|
||||||
import com.cool.store.vo.PartnerOpenNewShopPageVO;
|
import com.cool.store.vo.PartnerOpenNewShopPageVO;
|
||||||
import com.github.pagehelper.Page;
|
import com.github.pagehelper.Page;
|
||||||
@@ -59,6 +57,8 @@ public class OpenNewShopServiceImpl implements OpenNewShopService {
|
|||||||
private LabelService labelService;
|
private LabelService labelService;
|
||||||
@Resource
|
@Resource
|
||||||
private ShopService shopService;
|
private ShopService shopService;
|
||||||
|
@Resource
|
||||||
|
private ShopStageInfoDAO shopStageInfoDAO;
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -136,8 +136,14 @@ public class OpenNewShopServiceImpl implements OpenNewShopService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public PartnerOpenNewShopDetailVO getWaitAuditOpenNewShopRecord(Long lineId) {
|
public IsSubmitOpenNewShopVO isSubmitOpenNewShop(Long lineId) {
|
||||||
|
//首先获取有没有待审核的记录
|
||||||
OpenNewShopRecordDO openNewShopRecord = openNewShopRecordDAO.getWaitAuditOpenNewShopRecord(lineId);
|
OpenNewShopRecordDO openNewShopRecord = openNewShopRecordDAO.getWaitAuditOpenNewShopRecord(lineId);
|
||||||
return PartnerOpenNewShopDetailVO.convert(openNewShopRecord);
|
if(Objects.nonNull(openNewShopRecord)){
|
||||||
|
return new IsSubmitOpenNewShopVO(Boolean.FALSE);
|
||||||
|
}
|
||||||
|
//没有待审核的记录 去获取店铺是否都已经在验收中
|
||||||
|
Integer notOpenShopCount = shopStageInfoDAO.getNotOpenShopCountByLineId(lineId);
|
||||||
|
return new IsSubmitOpenNewShopVO(notOpenShopCount <= CommonConstants.ZERO);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,19 +1,13 @@
|
|||||||
package com.cool.store.controller.webc;
|
package com.cool.store.controller.webc;
|
||||||
|
|
||||||
import com.cool.store.context.CurrentUserHolder;
|
|
||||||
import com.cool.store.context.PartnerUserHolder;
|
import com.cool.store.context.PartnerUserHolder;
|
||||||
import com.cool.store.request.AuditOpenNewShopRequest;
|
|
||||||
import com.cool.store.request.PartnerOpenNewShopPageRequest;
|
|
||||||
import com.cool.store.request.SubmitOpenNewShopRequest;
|
import com.cool.store.request.SubmitOpenNewShopRequest;
|
||||||
import com.cool.store.response.ResponseResult;
|
import com.cool.store.response.ResponseResult;
|
||||||
import com.cool.store.service.OpenNewShopService;
|
import com.cool.store.service.OpenNewShopService;
|
||||||
import com.cool.store.vo.PartnerOpenNewShopDetailVO;
|
import com.cool.store.vo.IsSubmitOpenNewShopVO;
|
||||||
import com.cool.store.vo.PartnerOpenNewShopPageVO;
|
|
||||||
import com.github.pagehelper.PageInfo;
|
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
import io.swagger.annotations.ApiOperation;
|
import io.swagger.annotations.ApiOperation;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.validation.annotation.Validated;
|
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
@@ -40,10 +34,10 @@ public class MiniOpenNewShopController {
|
|||||||
return ResponseResult.success(openNewShopService.submitOpenNewShop(request));
|
return ResponseResult.success(openNewShopService.submitOpenNewShop(request));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiOperation("获取待审核的状态")
|
@ApiOperation("获取是否可提交开新店申请")
|
||||||
@GetMapping("/getWaitAuditOpenNewShopRecord")
|
@GetMapping("/isSubmitOpenNewShop")
|
||||||
public ResponseResult<PartnerOpenNewShopDetailVO> getWaitAuditOpenNewShopRecord() {
|
public ResponseResult<IsSubmitOpenNewShopVO> isSubmitOpenNewShop() {
|
||||||
return ResponseResult.success(openNewShopService.getWaitAuditOpenNewShopRecord(PartnerUserHolder.getUser().getLineId()));
|
return ResponseResult.success(openNewShopService.isSubmitOpenNewShop(PartnerUserHolder.getUser().getLineId()));
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user