增加,门店恢复状态,删除门店接口
This commit is contained in:
@@ -128,6 +128,13 @@ public class ShopStageInfoDAO {
|
||||
return shopStageInfoMapper.getAllCompletionCount(shopId);
|
||||
}
|
||||
|
||||
public Integer getCompletionCount(Long shopId) {
|
||||
if (Objects.isNull(shopId)) {
|
||||
return 0;
|
||||
}
|
||||
return shopStageInfoMapper.getCompletionCount(shopId);
|
||||
}
|
||||
|
||||
/**
|
||||
* @Auther: wangshuo
|
||||
* @Date: 2024/5/3
|
||||
|
||||
@@ -46,6 +46,9 @@ public interface ShopStageInfoMapper extends Mapper<ShopStageInfoDO> {
|
||||
*/
|
||||
Integer getAllCompletionCount(@Param("shopId") Long shopId);
|
||||
|
||||
|
||||
Integer getCompletionCount(@Param("shopId") Long shopId);
|
||||
|
||||
/**
|
||||
* 跟新店铺阶段信息
|
||||
* @param shopId
|
||||
|
||||
@@ -480,7 +480,7 @@
|
||||
<if test="wantShopAreaName != null">
|
||||
left join xfsg_open_area_info b on a.want_shop_area_id = b.id
|
||||
</if>
|
||||
where a.deleted = 0 and a.line_status = 1 and a.join_status in (1,2)
|
||||
where a.deleted = 0 and a.line_status = 1 and a.join_status in (1,2) and c.deleted = 0
|
||||
<if test="userId != null and userId != ''">
|
||||
and (a.investment_manager = #{userId} or c.investment_manager = #{userId} )
|
||||
</if>
|
||||
|
||||
@@ -51,7 +51,7 @@
|
||||
op.result_type AS resultType,si.supervisor_user_id as supervisorUserId
|
||||
from xfsg_opening_operation_plan op
|
||||
join xfsg_shop_info si on si.id = op.shop_id
|
||||
where 1=1
|
||||
where si.deleted = 0
|
||||
<if test="request.shopName != null and request.shopName != '' ">
|
||||
AND si.shop_name like concat('%', #{request.shopName}, '%')
|
||||
</if>
|
||||
|
||||
@@ -79,15 +79,17 @@
|
||||
</select>
|
||||
<select id="getBySubStageStatusAndUser" resultType="com.cool.store.entity.OperationLogDO">
|
||||
select *
|
||||
from xfsg_operation_log
|
||||
from xfsg_operation_log a
|
||||
left join xfsg_shop_info b on a.shop_id = b.id
|
||||
where
|
||||
operator = #{userId}
|
||||
and shop_sub_stage_status in
|
||||
b.delete=0
|
||||
and a.operator = #{userId}
|
||||
and a.shop_sub_stage_status in
|
||||
<foreach collection="list" index="index" item="item" open="(" close=")" separator=",">
|
||||
#{item}
|
||||
</foreach>
|
||||
and status = 0
|
||||
order by create_time desc
|
||||
and a.status = 0
|
||||
order by a.create_time desc
|
||||
</select>
|
||||
<select id="getByCondition" resultType="com.cool.store.entity.OperationLogDO">
|
||||
select *
|
||||
|
||||
@@ -213,7 +213,8 @@
|
||||
left join xfsg_line_info xli on xsi.line_id = xli.id
|
||||
left join xfsg_shop_stage_info xssi on xssi.shop_id = xsi.id
|
||||
where
|
||||
xssi.shop_stage = 3
|
||||
xsi.delete = 0
|
||||
and xssi.shop_stage = 3
|
||||
and xssi.shop_sub_stage_status != -100
|
||||
and
|
||||
xsi.region_id in
|
||||
@@ -346,6 +347,9 @@
|
||||
select
|
||||
<include refid="allColumn"/>
|
||||
from xfsg_shop_info where line_id = #{lineId} and deleted= '0'
|
||||
<if test="userId==null">
|
||||
and shop_status in(0,1)
|
||||
</if>
|
||||
<if test="userId!=null and userId!=''">
|
||||
and( investment_manager = #{userId}
|
||||
<if test="list!=null and list.size>0">
|
||||
|
||||
@@ -256,10 +256,9 @@
|
||||
select
|
||||
*
|
||||
from xfsg_shop_stage_info a
|
||||
<if test="(authRegionIds != null and authRegionIds.size() > 0) or (investmentUserId != null and investmentUserId != '')">
|
||||
left join xfsg_shop_info si on a.shop_id = si.id
|
||||
</if>
|
||||
left join xfsg_shop_info si on a.shop_id = si.id
|
||||
<where>
|
||||
si.deleted = 0
|
||||
<if test="shopIds != null and shopIds.size() > 0">
|
||||
and a.shop_id in
|
||||
<foreach collection="shopIds" item="shopId" index="index" open="(" separator="," close=")">
|
||||
@@ -409,4 +408,12 @@
|
||||
|
||||
|
||||
</select>
|
||||
<select id="getCompletionCount" resultType="java.lang.Integer">
|
||||
select
|
||||
count(1)
|
||||
from
|
||||
xfsg_shop_stage_info
|
||||
where
|
||||
shop_id = #{shopId} and deleted = 0 and is_terminated = 1
|
||||
</select>
|
||||
</mapper>
|
||||
@@ -95,7 +95,7 @@ public interface ShopService {
|
||||
* @return
|
||||
*/
|
||||
Boolean shopClose(Long shopId);
|
||||
|
||||
Boolean updateShopStatue(Long shopId);
|
||||
|
||||
/**
|
||||
* 分店列表
|
||||
|
||||
@@ -193,22 +193,22 @@ public class ShopServiceImpl implements ShopService {
|
||||
|
||||
@Override
|
||||
public Integer deleteShop(DeleteShopRequest request) {
|
||||
ShopInfoDO shopInfo = shopInfoDAO.getShopInfo(request.getShopId());
|
||||
if (Objects.nonNull(shopInfo)) {
|
||||
//进入选址不允许删除操作
|
||||
throw new ServiceException(ErrorCodeEnum.NOT_ALLOW_OPERATE);
|
||||
}
|
||||
// ShopStageInfoDO shopSubStageInfo = shopStageInfoDAO.getShopSubStageInfo(shopInfo.getId(), ShopSubStageEnum.SHOP_STAGE_3);
|
||||
// if(ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_33.getShopSubStageStatus().equals(shopSubStageInfo.getShopSubStageStatus())){
|
||||
// ShopInfoDO shopInfo = shopInfoDAO.getShopInfo(request.getShopId());
|
||||
// if (Objects.nonNull(shopInfo)) {
|
||||
// //进入选址不允许删除操作
|
||||
// throw new ServiceException(ErrorCodeEnum.NOT_ALLOW_OPERATE);
|
||||
// }
|
||||
if (Objects.nonNull(shopInfo.getPointId())) {
|
||||
PointInfoDO pointInfo = pointInfoDAO.getPointInfoById(shopInfo.getPointId());
|
||||
if (Objects.nonNull(pointInfo) && SelectStatusEnum.SELECT_STATUS_1.getCode().equals(pointInfo.getSelectStatus())) {
|
||||
pointInfoDAO.recyclePoint(pointInfo.getId());
|
||||
}
|
||||
pointRecommendDAO.updateRecommendStatus(shopInfo.getPointId(), PointRecommendStatusEnum.POINT_RECOMMEND_STATUS_1, Arrays.asList(PointRecommendStatusEnum.POINT_RECOMMEND_STATUS_5));
|
||||
}
|
||||
// ShopStageInfoDO shopSubStageInfo = shopStageInfoDAO.getShopSubStageInfo(shopInfo.getId(), ShopSubStageEnum.SHOP_STAGE_3);
|
||||
// if(ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_33.getShopSubStageStatus().equals(shopSubStageInfo.getShopSubStageStatus())){
|
||||
// throw new ServiceException(ErrorCodeEnum.NOT_ALLOW_OPERATE);
|
||||
// }
|
||||
// if (Objects.nonNull(shopInfo.getPointId())) {
|
||||
// PointInfoDO pointInfo = pointInfoDAO.getPointInfoById(shopInfo.getPointId());
|
||||
// if (Objects.nonNull(pointInfo) && SelectStatusEnum.SELECT_STATUS_1.getCode().equals(pointInfo.getSelectStatus())) {
|
||||
// pointInfoDAO.recyclePoint(pointInfo.getId());
|
||||
// }
|
||||
// pointRecommendDAO.updateRecommendStatus(shopInfo.getPointId(), PointRecommendStatusEnum.POINT_RECOMMEND_STATUS_1, Arrays.asList(PointRecommendStatusEnum.POINT_RECOMMEND_STATUS_5));
|
||||
// }
|
||||
ShopInfoDO updateShop = new ShopInfoDO();
|
||||
updateShop.setId(request.getShopId());
|
||||
updateShop.setDeleted(true);
|
||||
@@ -410,6 +410,22 @@ public class ShopServiceImpl implements ShopService {
|
||||
return Boolean.TRUE;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean updateShopStatue(Long shopId) {
|
||||
ShopInfoDO shopInfo = shopInfoDAO.getShopInfo(shopId);
|
||||
if (Objects.isNull(shopInfo)) {
|
||||
throw new ServiceException(ErrorCodeEnum.PARAMS_VALIDATE_ERROR);
|
||||
}
|
||||
Integer completionCount = shopStageInfoDAO.getCompletionCount(shopId);
|
||||
if (completionCount.equals(ShopSubStageEnum.values().length)) {
|
||||
shopInfo.setShopStatus(ShopStatusEnum.DONE.getCode());
|
||||
} else {
|
||||
shopInfo.setShopStatus(ShopStatusEnum.ING.getCode());
|
||||
}
|
||||
shopInfoDAO.updateShopInfo(shopInfo);
|
||||
return Boolean.TRUE;
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageInfo<BranchShopResponse> getBranchShopList(BranchShopRequest request, String userId) {
|
||||
if (request.getFlag().equals(CommonConstants.TWO)) {
|
||||
|
||||
@@ -117,12 +117,15 @@ public class PCShopController {
|
||||
return ResponseResult.success(transferLogService.getTransferLogPage(pageNum, pageSize, lineId, lineShopType));
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@ApiOperation("门店结束跟进")
|
||||
@GetMapping("/shopClose")
|
||||
public ResponseResult<Boolean> shopClose(@RequestParam("shopId")Long shopId) {
|
||||
return ResponseResult.success(shopService.shopClose(shopId));
|
||||
}
|
||||
|
||||
@ApiOperation("门店恢复状态")
|
||||
@GetMapping("/updateShopStatue")
|
||||
public ResponseResult<Boolean> updateShopStatue(@RequestParam("shopId")Long shopId) {
|
||||
return ResponseResult.success(shopService.updateShopStatue(shopId));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user